summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-07-22cpufreq/amd-pstate: handle missing policy in dynamic EPP callbacksEDAMAMEX
cpufreq_cpu_get() returns NULL when no cpufreq policy is associated with the requested CPU, for example because the CPU is offline or the policy has already been torn down. Both amd_pstate_power_supply_notifier() and amd_pstate_profile_set() acquire a policy via cpufreq_cpu_get() and then pass that pointer to amd_pstate_get_balanced_epp() and amd_pstate_set_epp(), which dereference it unconditionally. A racing CPU hotplug or driver teardown can therefore lead to a NULL pointer dereference on either of these dynamic EPP paths. The third cpufreq_cpu_get() caller in this file, amd_pstate_verify(), already handles the NULL case. Bring the two new callers in line with that pattern: return NOTIFY_OK from the power-supply notifier (matching the other "nothing to do" exits) and -ENODEV from amd_pstate_profile_set() (the usual cpufreq error for a missing CPU policy). Found by code inspection; not tested on hardware. Fixes: e30ca6dd5345 ("cpufreq/amd-pstate: Add dynamic energy performance preference") Fixes: 798c47593cca ("cpufreq/amd-pstate: Add support for platform profile class") Signed-off-by: EDAMAMEX <edame8080@gmail.com> Link: https://lore.kernel.org/r/20260520070211.2753183-1-edame8080@gmail.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22cpufreq/amd-pstate: Cache the firmware programmed EPP valueMarco Scardovi
At CPU EPP initialization, the private cpudata structure is allocated via kzalloc, which means cpudata->cppc_req_cached is initialized to 0. This makes the default cached EPP value 0 (AMD_CPPC_EPP_PERFORMANCE). When initializing a system that defaults to performance EPP, the driver attempts to configure the EPP via amd_pstate_set_epp(). Because the requested EPP (0) matches the uninitialized cached value (0), the cache guard check triggers, and the driver skips writing to the hardware. Cache the firmware-programmed default EPP value in cppc_req_cached during CPU EPP initialization. This saves on an unnecessary reprogramming later when the EPP is first set. Assisted-by: Antigravity:gemini-3.5-flash Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Signed-off-by: Marco Scardovi <scardracs@disroot.org> Link: https://lore.kernel.org/r/20260609073042.81275-4-scardracs@disroot.org Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22cpufreq/amd-pstate: Toggle auto_sel in active mode on shared memory systemsMarco Scardovi
On shared memory systems, the EPP configuration path (handled via cppc_set_epp_perf()) is responsible for toggling on the CPPC autonomous selection register (auto_sel). Currently, shmem_init_perf() returns early without doing any of the auto_sel configuration steps if cppc_state is AMD_PSTATE_ACTIVE. This skips enabling auto_sel, leaving the CPU in non-autonomous mode. Remove the early return check in shmem_init_perf() when cppc_state is AMD_PSTATE_ACTIVE. Toggling auto_sel is necessary for the active mode on shared memory systems to function based on the ACPI spec for CPPC v2 and below. Fixes: 2dd6d0ebf740 ("cpufreq: amd-pstate: Add guided autonomous mode") Assisted-by: Antigravity:gemini-3.5-flash Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Signed-off-by: Marco Scardovi <scardracs@disroot.org> Reviewed-by: K Prateek Nayak <kprateek.anayk@amd.com> Link: https://lore.kernel.org/r/20260609073042.81275-3-scardracs@disroot.org Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22cpufreq/amd-pstate: Fix EPP return type and handle errors during initializationMarco Scardovi
Currently, the EPP getter helper functions (msr_get_epp, shmem_get_epp, and the static call wrapper amd_pstate_get_epp) return u8 or s16. This makes it difficult to correctly propagate negative error values returned by the underlying MSR read or CPPC helpers (such as rdmsrq_on_cpu or cppc_get_epp_perf). Modify the return type of these functions to int, allowing them to return negative error codes properly. Additionally, in amd_pstate_epp_cpu_init(), fetch the firmware-programmed default EPP value and validate it before assigning it to the EPP variables. If amd_pstate_get_epp() returns an error code, propagate the error and abort the CPU initialization to prevent subsequent configuration failures. Fixes: 555bbe67a622 ("cpufreq/amd-pstate: Convert all perf values to u8") Assisted-by: Antigravity:gemini-3.5-flash Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Signed-off-by: Marco Scardovi <scardracs@disroot.org> Reviewed-by: K Prateek Nayak <kprateek.anayk@amd.com> Link: https://lore.kernel.org/r/20260609073042.81275-2-scardracs@disroot.org Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22cpufreq: amd-pstate-ut: Skip tests when amd-pstate driver is not activeQianheng Peng
The crash issue may occur when modprobe amd_pstate_ut on intel platform. amd_pstate_ut: 1 amd_pstate_ut_acpi_cpc_valid success! amd_pstate_ut: 2 amd_pstate_ut_check_enabled success! BUG: kernel NULL pointer dereference, address: 0000000000000080 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI CPU: 0 PID: 20300 Comm: modprobe Kdump: loaded Tainted: G O 6.6.0-0010.rc1.ctl4.x86_64 #1 Hardware name: FiberHome R2200 V5/Xeon Boards, BIOS 3.1a 02/24/2020 RIP: 0010:amd_pstate_ut_check_perf+0x141/0x280 [amd_pstate_ut] Call Trace: <TASK> amd_pstate_ut_init+0x1b/0xff0 [amd_pstate_ut] ? __pfx_amd_pstate_ut_init+0x10/0x10 [amd_pstate_ut] do_one_initcall+0x42/0x2e0 ? kmalloc_trace+0x26/0x90 do_init_module+0x60/0x240 __se_sys_init_module+0x185/0x1c0 do_syscall_64+0x62/0x190 entry_SYSCALL_64_after_hwframe+0x76/0x7e </TASK> Add state detection to amd pstate driver to prevent amd_pstate_ut driver from testing on non-AMD platforms. Fixes: 14eb1c96e3a3 ("cpufreq: amd-pstate: Add test module for amd-pstate driver") Suggested-by: Li Xiong <xiongl24@chinatelecom.cn> Suggested-by: Xibo Wang <wangxb12@chinatelecom.cn> Signed-off-by: Qianheng Peng <pengqh1@chinatelecom.cn> Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> Link: https://lore.kernel.org/r/1784191899-28957-1-git-send-email-pengqh1@chinatelecom.cn (ML: adjust title) Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22cpufreq/amd-pstate: Prevent the driver from loading on unsupported hardwareRong Zhang
X86_FEATURE_HW_PSTATE indicates if the processor supports frequency scaling or not. Without it, the driver is unusable and thus will not load. This check also prevents the driver from loading in guests and thus not confuse users with misleading prints. Reviewed-by: Michael Kelley <mhklinux@outlook.com> Tested-by: Michael Kelley <mhklinux@outlook.com> Acked-by: Mario Limonciello (AMD) <superm1@kernel.org> Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Acked-by: Borislav Petkov (AMD) <bp@alien8.de> Signed-off-by: Rong Zhang <i@rong.moe> Link: https://lore.kernel.org/r/20260722-amd-pstate-vm-v4-1-d6607d9e9d9a@rong.moe Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22cpufreq/amd-pstate: Loosen requirement on lowest nonlinear frequency != min freqMario Limonciello
This requirement was introduced by commit 8f8b42c1fcc93 ("cpufreq: amd-pstate: optimize the initial frequency values verification") specifically to aid in debugging BIOS issues with invalid _CPC tables on some older systems. This requirement is too tight for new systems though as some systems actually have lowest nonlinear frequency identical to minimum frequency. Allow that combo to work. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com> Tested-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260715174318.18235-1-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-22Merge tag 'liveupdate-fixes-2026-07-22' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux Pull liveupdate fix from Mike Rapoport: - Fix validation of LIVEUPDATE_SESSION_GET_NAME ioctl argument caused by a wrong resolution of a merge conflict during the last merge window * tag 'liveupdate-fixes-2026-07-22' of git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux: liveupdate: fix GET_NAME ioctl argument validation
2026-07-22netfilter: nf_conntrack_expect: add and use nf_ct_expect_related_pair()Pablo Neira Ayuso
Add a new function to insert a pair of expectations, this is required by the SIP and H323 NAT helpers. The spinlock is held to check if there is a slot for both expectations, in such case, insert them. This removes the need for nf_ct_unexpect_related() inside the loop to find a pair of consecutive ports, otherwise inserting expectations whose dead flag is already set on can happen. Bump master_help->expecting for the expectation class after checking if the expectation fits in the master expectation list, which is needed for this new _pair() function variant to run the eviction routine including the preallocated slot for the first expectation in the pair. Fixes: b8b09dc2bf35 ("netfilter: nf_conntrack_expect: use conntrack GC to reap expectations") Reported-by: Jaeyeong Lee <iostreampy@proton.me> Link: https://patch.msgid.link/178377968720.33756.12204817361601593230@proton.me/ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2026-07-22selftests: netfilter: nft_flowtable.sh: fix offload counter verification for ↵Lorenzo Bianconi
tunnel tests The IPIP and IP6IP6 tunnel tests call check_counters() to verify flowtable offloading occurred, but the flow-add rule only matches meta oif "veth1". When traffic is routed through a tunnel device, oif is the tunnel interface (tun0, tun6, etc.), not veth1, so the flow-add rule never fires, no flowtable entry is created, and counters stay at zero — producing a silent false pass. Fix by adding tunnel-specific flow-add rules for each tunnel interface. These match TCP dport 12345 traffic before the bare accept rule, set ct mark, add the flow to the flowtable, and increment routed_orig. The existing routed_repl rule on veth0 already handles the reply direction since decapsulated reply packets exit through the physical interface. Also add check_counters() for the IP6IP6 non-VLAN and IP6IP6-over-VLAN tests which previously used a bare PASS message. Fixes: fe8313316eaf ("selftests: netfilter: nft_flowtable.sh: Add IPIP flowtable selftest") Fixes: 5e5180352193 ("selftests: netfilter: nft_flowtable.sh: Add IP6IP6 flowtable selftest") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2026-07-22Merge branch 'for-7.3' into for-nextTejun Heo
2026-07-22sched_ext: Fix stale errno in scx_sub_enable_workfn()Cui Jian
The nesting depth check and the cgroup online check in scx_sub_enable_workfn() reach err_disable without setting ret, so the fallback error added by commit db4e9defd2e8 ("sched_ext: Record an error on errno-only sub-enable failure") reports "scx_sub_enable() failed (0)". This is currently harmless because both paths record their own scx_error() first and the first error wins, but it leaves the fallback broken for these paths. Set -EINVAL and -ENODEV there so the fallback always reports a real errno. v2: The validate_ops() path from v1 is already fixed in for-7.3 (sub.c already has ret = scx_validate_ops()), so only the two remaining paths are addressed. Signed-off-by: Cui Jian <cjian720@163.com> Reviewed-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2026-07-22Merge tag 'watchdog-for-v7.2-rc5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull watchdog fixes from Guenter Roeck: - airoha: Prevent division by zero when clock frequency is zero - core: pretimeout: Fix UAF in watchdog_unregister_governor() - ni903x_wdt: Check ACPI_COMPANION() against NULL - s32g_wdt: remove incorrect options in watchdog_info struct * tag 'watchdog-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: watchdog: airoha: Prevent division by zero when clock frequency is zero watchdog: pretimeout: Fix UAF in watchdog_unregister_governor() docs: watchdog: Fix brackets watchdog: ni903x_wdt: Check ACPI_COMPANION() against NULL watchdog: s32g_wdt: remove incorrect options in watchdog_info struct
2026-07-22Merge branch 'for-7.3' into for-nextTejun Heo
2026-07-22tools/sched_ext: scx_pair: Convert to sched_switch TPCheng-Yang Chou
ops.cpu_acquire/release() are deprecated in favor of tracking CPU preemption from a sched_switch tracepoint, see commit a3f5d4822253 ("sched_ext: Allow scx_bpf_reenqueue_local() to be called from anywhere"). Loading scx_pair currently emits a deprecation warning. Replace the pair_cpu_acquire/release() callbacks with a tp_btf/sched_switch program that edge-detects the same transitions the core used to deliver: a release when a running SCX task loses its CPU to a higher-priority class, and an acquire when the CPU switches back to an SCX task or idle while marked preempted. Tasks are classified by effective priority (p->prio) rather than by policy: rt_mutex_setprio() boosts a PI beneficiary into the rt/dl classes while leaving its policy untouched, so a policy test would both miss the release when a boosted task takes the CPU and fire a spurious acquire when a boosted task replaces a real rt task. A switch from idle straight to a higher-priority task is deliberately not treated as a release. The CPU was not running an SCX task, so there is nothing to drain, and kicking SCX_KICK_PREEMPT | SCX_KICK_WAIT on every rt wakeup would make the pair CPU wait out rt bursts it was never coupled to. The old callbacks behaved the same way, firing ops.cpu_release() only from switch_class() when an SCX task was put for a higher class. The tracepoint runs on every context switch in the system, so the common no-transition case is filtered before taking the pair-shared lock. This is safe because a CPU's own preempted_mask bit is only ever written by this tracepoint running on that CPU. sched_setscheduler() on a running task changes class in place without a context switch, so such transitions are only observed at the task's next switch. The old callbacks had the same blind spot in switch_class(), and try_dispatch() already bounds the resulting wait. Verified in virtme-ng with the script below. The scheduler must load without the deprecation warning, stay enabled through the rt churn and the idle soak (the watchdog would otherwise abort it with "runnable task stall"), keep its preemption counter advancing, and unregister cleanly at the end. A PI rt-mutex churn that repeatedly boosts SCX tasks into the rt class was exercised separately: #!/bin/bash # vng --verbose --cpus 8 -m 4G --user root -- ./verify.sh # FIFO harness: survives even if all SCHED_NORMAL tasks stall [ "${RT:-0}" = 1 ] || exec chrt -f 5 env RT=1 "$0" chrt -o 0 ./tools/sched_ext/build/bin/scx_pair & PAIR=$! sleep 3 for round in $(seq 10); do pids="" for i in 0 1 2 3; do # SCHED_FIFO churn chrt -f 10 bash -c \ 'e=$((SECONDS+1)); while [ $SECONDS -lt $e ]; do :; done' & pids="$pids $!" done for i in 0 1; do # SCHED_NORMAL load under scx chrt -o 0 bash -c \ 'n=0; while [ $n -lt 200000 ]; do n=$((n+1)); done' & pids="$pids $!" done wait $pids # explicit pids, not the scx_pair job done sleep 300 # idle soak kill -INT $PAIR # expect clean unregister in dmesg Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com> Reviewed-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2026-07-22Merge branch 'for-7.2-fixes' into for-nextTejun Heo
2026-07-22sched_ext: Mark waker CPU busy when selected in WAKE_SYNC caseKuba Piecuch
SCX's built-in idle CPU tracking is imperfect and can be out-of-sync with the actual idle state of CPUs, especially immediately after enabling SCX due to scx_idle_enable() marking all online CPUs idle. scx_select_cpu_dfl() skips marking the selected CPU as busy if the selected CPU is the waker CPU in the SCX_WAKE_SYNC case. If the waker CPU was marked idle by SCX, it will still be marked idle after CPU selection and potentially even after switching to the wakee. In the allowed_cpus selftest, this can manifest as the test failing with the following message in dmesg: allowed_cpus.bpf.c:21: CPU 0 should be marked as busy This patch explicitly marks the waker CPU as busy. With this patch, the test failure no longer reproduces. There are still some pretty unlikely races that could make the test fail (e.g. pick_task_idle() marking the selected CPU idle between selection and validation), but these can't be fixed easily. Signed-off-by: Kuba Piecuch <jpiecuch@google.com> Signed-off-by: Tejun Heo <tj@kernel.org>
2026-07-22netfilter: nf_conntrack_sip: widen NAT rewrite delta to s32 in sip_help_tcp()Xiang Mei
sip_help_tcp() stores the size change of each NAT-rewritten SIP message in s16 diff and accumulates it in s16 tdiff, but a single message can grow by more than S16_MAX while the packet stays under the 65535 enlarge_skb() limit: nf_nat_sip() rewrites every matching URI, and a long Contact list expands the message by tens of kilobytes. diff then wraps, and "datalen = datalen + diff - msglen" yields a huge unsigned datalen, so the next iteration's ct_sip_get_header() reads past the linearized skb tail. Widen diff, tdiff and the seq_adjust hook to s32. Both are bounded by the 65535 byte packet limit, and the seqadj core is already s32 (nf_ct_seqadj_set() takes s32), so no previously accepted input is rejected. BUG: KASAN: use-after-free in ct_sip_get_header (net/netfilter/nf_conntrack_sip.c:464) Read of size 1 at addr ffff888010800000 by task ksoftirqd/1/25 ct_sip_get_header (net/netfilter/nf_conntrack_sip.c:464) sip_help_tcp (net/netfilter/nf_conntrack_sip.c:1694) nf_confirm (net/netfilter/nf_conntrack_proto.c:183) nf_hook_slow (net/netfilter/core.c:619) ip6_output (net/ipv6/ip6_output.c:246) ip6_forward (net/ipv6/ip6_output.c:690) ipv6_rcv (net/ipv6/ip6_input.c:351) __netif_receive_skb_one_core (net/core/dev.c:6212) process_backlog (net/core/dev.c:6676) __napi_poll (net/core/dev.c:7735) net_rx_action (net/core/dev.c:7955) handle_softirqs (kernel/softirq.c:622) run_ksoftirqd (kernel/softirq.c:1076) ... Fixes: f5b321bd37fb ("netfilter: nf_conntrack_sip: add TCP support") Reported-by: Weiming Shi <bestswngs@gmail.com> Link: https://patch.msgid.link/netfilter-devel/20260712234201.3213635-1-xmei5@asu.edu Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Xiang Mei <xmei5@asu.edu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2026-07-22PCI/P2PDMA: Add Nvidia Vera Rubin to whitelistLeon Romanovsky
Nvidia Vera Rubin platforms support PCI peer‑to‑peer transactions. Add them to the P2P whitelist to enable this functionality. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Logan Gunthorpe <logang@deltatee.com> Link: https://patch.msgid.link/20260705-p2p-vr-v1-1-3cd45cab3fb4@nvidia.com
2026-07-22Merge tag 'platform-drivers-x86-v7.2-3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Ilpo Järvinen: - asus-wmi: Revert retaining battery charge threshold on boot due to userspace regression. Userspace assumed (errorneously) a non-zero return code from sysfs read implies feature is not supported but the correct way would be to check file visibility instead. This results in the kernel change breaking the functionality completely. Thus, we are taking timeout on the kernel side to allow userspace to sort their problem first. - intel/vsec: Free ACPI discovery data allocation on error paths * tag 'platform-drivers-x86-v7.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: asus-wmi: temporarily revert to setting a charge limit platform/x86/intel/vsec: free ACPI discovery data on early errors
2026-07-23Merge branch 'sunxi/dt-for-7.3' into sunxi/for-nextChen-Yu Tsai
2026-07-23ARM: dts: allwinner: a10: Fix PMU interruptAndre Przywara
The Performance Monitoring Unit of the Cortex-A8 cores in the Allwinner A10 SoC is connected to interrupt line 66, not 3. This is shown in the manual (where interrupt 3 is assigned to UART2, also in our .dtsi), but has also been confirmed by triggering an PMU overflow interrupt and inspecting the IRQ controller status registers (from U-Boot). Please note that "perf stat" does not use interrupts, this might explain why this evaded the initial testing. Fixes: 7e345d25c796 ("ARM: dts: sun4i-a10: Add PMU node") Signed-off-by: Andre Przywara <andre.przywara@arm.com> Link: https://patch.msgid.link/20260720215128.5761-1-andre.przywara@arm.com Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
2026-07-22net: hsr: fix memory leak on slave unregistration by removing synced VLANsEric Dumazet
When an HSR master device is brought UP, it auto-adds VLAN 0 via vlan_vid0_add(), which propagates VID 0 to its slave devices (slave A and B). If a slave device is later unregistered while HSR is active (e.g., during netns cleanup or interface destruction), hsr_del_port() is called to detach the slave port from the HSR master. However, hsr_del_port() currently does not delete the VLAN IDs that were synced to the slave device by HSR. As a result, the slave device retains a refcount on VID 0 (and any other synced VLANs). When the slave device is destroyed, its vlan_info / vlan_vid_info structure remains allocated, leading to a memory leak. Fix this by calling vlan_vids_del_by_dev(port->dev, master->dev) in hsr_del_port() before unlinking slave A or slave B ports, matching the propagation logic in hsr_ndo_vlan_rx_add_vid() / hsr_ndo_vlan_rx_kill_vid() and the cleanup behavior in bonding and team drivers. Fixes: 1a8a63a5305e ("net: hsr: Add VLAN CTAG filter support") Reported-by: syzbot+456957213f32970c0762@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/6a4cb6ca.57639fcc.86d58.000b.GAE@google.com/T/#u Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de> Reviewed-by: Felix Maurer <fmaurer@redhat.com> Link: https://patch.msgid.link/20260721101240.995597-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22Merge branch 'net-bridge-fix-vlan-range-dumps-starting-with-a-pvid'Jakub Kicinski
Nikolay Aleksandrov says: ==================== net: bridge: fix vlan range dumps starting with a PVID Patch 01 fixes a bug that can skip dumping VLANs which a part of a range starting with a PVID VLAN and share the same flags. PVID VLAN should be always on its own. Patch 02 adds a selftest for this case. More information can be found in the respective patches. ==================== Link: https://patch.msgid.link/20260721140922.682265-1-razor@blackwall.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22selftests: net: bridge: test ranges with PVID VLANNikolay Aleksandrov
Add a test with PVID VLAN that matches the flags of the VLAN following it and check if the range is properly dumped. PVID VLAN should be on its own and all VLANs should be present in the dump. Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260721140922.682265-3-razor@blackwall.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22net: bridge: vlan: fix vlan range dumps starting with pvidNikolay Aleksandrov
There is a bug in all range dumps that rely on br_vlan_can_enter_range() when the PVID is a range starting VLAN, all following VLANs that match its flags can enter the range, but when the range is filled in only the PVID VLAN is dumped and the rest of the range is discarded because br_vlan_fill_vids() checks for the PVID flag. Since the PVID VLAN can be only one, we need to break ranges around it, the best way to do that consistently for all is to alter br_vlan_can_enter_range() to take into account the PVID and return false to break the range when it's matched. Before the fix: $ ip l add br0 type bridge vlan_filtering 1 $ ip l add dumdum type dummy $ ip l set dumdum master br0 $ ip l set br0 up $ ip l set dumdum up $ bridge vlan add dev dumdum vid 1 pvid untagged master $ bridge vlan add dev dumdum vid 2 untagged master $ bridge vlan show dev dumdum # use legacy dump to show all vlans port vlan-id dumdum 1 PVID Egress Untagged 2 Egress Untagged $ bridge -d vlan show dev dumdum # use the new dump (RTM_GETVLAN) port vlan-id dumdum 1 PVID Egress Untagged state forwarding mcast_router 1 VLAN 2 is missing, and if there are more matching VLANs afterwards they'd be missing too. After the fix: [ same setup steps ] $ bridge vlan show dev dumdum port vlan-id dumdum 1 PVID Egress Untagged 2 Egress Untagged $ bridge -d vlan show dev dumdum # use the new dump (RTM_GETVLAN) port vlan-id dumdum 1 PVID Egress Untagged state forwarding mcast_router 1 2 Egress Untagged state forwarding mcast_router 1 Fixes: 0ab558795184 ("net: bridge: vlan: add rtm range support") Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260721140922.682265-2-razor@blackwall.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22Merge tag 'sound-7.2-rc5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of fixes that have been accumulated recently. The amount is still "new normal", but all small fixes. Mostly hardware-specific quirks, but including a few core fixes, too. ALSA Core: - Fix potential UAF and race fixes in ALSA timer core - Fix sequencer queue timer cleanup to prevent leaks and double-free HD-audio: - Fix silent streams with Intel HDMI keep-alive silent mode - Quirks for HP laptops (Pavilion x360, EliteBook 830 G8, ZBook 8 G2a), Samsung 750XBE/730XBE, and Dell Pro QC1255, Alienware x16 R2, Lunnen Ground 14 - Properly validate ACPI mute object in CS35L41 HDA companion driver - Reset calibration data size on failure in TAS2781 HDA driver. USB-audio: - Support FIXED_RATE quirk for JBL Quantum650 Wireless USB headset ASoC: - Intel SOF SoundWire board driver quirks for new Dell laptops - DMI overrides and quirks for AMD ACP/YC platforms, including new ASUS TUF platforms and MSI Vector A16 HX laptops - Skip sysclk reset for active DAIs in shutdown for FSL imx-card - Fix spurious BCLK on resume by clearing BYP in FSL SAI driver - Add playback-only quirk for H616 codec in Allwinner driver - Fix Cirrus Logic CS35L56 potential probe deadlock - Fix cache write-through on resume in FS210X codec - Bound firmware description string parsing in TAS2781 codec driver - Fix duplicate DAPM widget names for wideband DAI in BT-SCO codec" * tag 'sound-7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (25 commits) ALSA: hda/realtek - Add quirk for Dell Pro QC1255 ALSA: hda/tas2781: clear cali_data.total_sz when calibration read fails ALSA: hda/realtek: Add HDA_CODEC_QUIRK for Samsung 750XBE/730XBE ALSA: hda/realtek: Fix speakers on Lunnen Ground 14 ALSA: timer: drain a slave's callback before its master detaches it ALSA: timer: don't re-enter an instance callback that is still running ALSA: usb-audio: Add FIXED_RATE quirk for JBL Quantum650 Wireless ALSA: hda/realtek: Add quirk for HP Pavilion x360 ASoC: Intel: sof_sdw: Add quirks for new Dell laptops ASoC: cs35l56: Use complete_all() to signal init_completion ASoC: cs35l56: Fix potential probe() deadlock ASoC: fs210x: Make cache write through again during resume ALSA: hda/realtek: Add inverted LED quirk for HP ZBook 8 G2a ALSA: hda: codecs: hdmi: disable keep-alive before audio format change ASoC: bt-sco: fix duplicate DAPM widget names for wideband DAI ALSA: hda: cs35l41: validate and free ACPI mute object ALSA: hda/realtek: Fix speakers on Alienware x16 R2 ALSA: hda/realtek: Add quirk for HP EliteBook 830 G8 (8AB8) to enable mute LEDs ASoC: amd: yc: Add DMI quirk for MSI Vector A16 HX A8WIG ASoC: fsl: imx-card: Skip sysclk reset for active DAIs in shutdown ...
2026-07-22geneve: fix geneve_config leak on register_netdevice() failureEric Dumazet
When geneve_configure() allocates a new geneve_config structure via geneve_config_alloc() and assigns it to geneve->cfg before calling register_netdevice(), if register_netdevice() fails early (for example, in dev_get_valid_name() due to an invalid or duplicate interface name), register_netdevice() exits without calling dev->priv_destructor. The caller (e.g. rtnl_newlink()) subsequently calls free_netdev(), which frees the net_device structure directly via kvfree() because reg_state is NETREG_UNINITIALIZED, bypassing dev->priv_destructor (geneve_free_dev()). As a result, the newly allocated geneve_config and its per-CPU dst_cache are leaked. Fix this by invoking geneve_free_dev(dev) directly on the error path of register_netdevice(). Since geneve_free_dev() sets geneve->cfg to NULL, this call is fully idempotent and safe even if register_netdevice() failed on a later error path that already ran dev->priv_destructor. Fixes: 0ba269933f73 ("geneve: convert config to RCU-protected pointer") Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260721163950.1483019-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22MAINTAINERS: add nci tests to nfcJakub Kicinski
NCI is part of NFC, so include its selftests under the NFC entry. Reviewed-by: David Heidelberg <david@ixit.cz> Link: https://patch.msgid.link/20260721205555.1020513-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22Merge tag 'for-net-2026-07-21' of ↵Jakub Kicinski
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - hci_sync: Protect UUID list traversal - RFCOMM: Fix session UAF in set_termios - btusb: validate Realtek vendor event length * tag 'for-net-2026-07-21' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: btusb: validate Realtek vendor event length Bluetooth: RFCOMM: Fix session UAF in set_termios Bluetooth: hci_sync: Protect UUID list traversal ==================== Link: https://patch.msgid.link/20260721160240.884274-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22ext4: write back partial-zeroed edges in WRITE_ZEROESZhang Yi
FALLOC_FL_WRITE_ZEROES requires that all blocks in the requested range end up as written extents with zeroed content. For unaligned edges that were partial-zeroed in dirty unwritten or delalloc state, the buffer is left dirty while the underlying extent may not yet be converted to written. As a result, a subsequent SYNC write to this range would still trigger metadata changes, which violates the semantics of WRITE_ZEROES. Fix this by calling filemap_write_and_wait_range() for partial-zeroed edges to flush out the zeroed data and ensure the extent conversion is complete. Fixes: f4265b8d32c4 ("ext4: add FALLOC_FL_WRITE_ZEROES support") Cc: stable@vger.kernel.org Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-9-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: zero out whole block for clean edges in WRITE_ZEROESZhang Yi
FALLOC_FL_WRITE_ZEROES requires that all blocks in the requested range end up as written extents with zeroed content. For unaligned edges that were already allocated, ext4_zero_partial_blocks() zeros them directly. However, for unaligned edges whose underlying extent is a clean unwritten extent or a hole, the extent type remains unwritten after partial zeroing, which does not align with the semantics of WRITE_ZEROES. Therefore, when ext4_zero_partial_blocks() skips partial zeroing, it indicates that the corresponding edges are clean unwritten extents or holes. In this case, we need to expand the aligned allocation range outward to cover such edges, so that ext4_alloc_file_blocks() can correctly allocate blocks for the unaligned range. Edges that were partial-zeroed (i.e., written or dirty) are left untouched. Fixes: f4265b8d32c4 ("ext4: add FALLOC_FL_WRITE_ZEROES support") Cc: stable@vger.kernel.org Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-8-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: track partial-zero outcome per edge in ext4_zero_partial_blocks()Zhang Yi
Replace the single bool did_zero output of ext4_zero_partial_blocks() with a bitmask that records which edge (start, end, or both in the single-block case) was actually partial-zeroed. This allows callers to distinguish which edges have been zeroed, preparing for unaligned FALLOC_FL_WRITE_ZEROES handling in later patches. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-7-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: clarify return semantics of ext4_load_tail_bh()Zhang Yi
ext4_load_tail_bh() returns NULL for both holes and clean unwritten buffers, but the conditions that lead to this are not obvious from the code alone. Document this behavior to clarify the return value, so that readers do not mistakenly assume that only holes result in a NULL return. Also update the inline comment following the ext4_get_block() call to reflect this, and note that a lookup-only get_block (without EXT4_GET_BLOCKS_CREATE) never sets BH_Mapped for clean unwritten extents, which is why a clean unwritten bh falls through to the "nothing to do" path. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-6-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: move partial block zeroing earlier in ext4_zero_range()Zhang Yi
In ext4_zero_range(), move the ext4_zero_partial_blocks() call, which handles unaligned edges, into the same branch where the unaligned range is preallocated, immediately after ext4_alloc_file_blocks(). This is safe because there is no dependency between partial block handling and the subsequent full block handling. This change will be used by later patches that handle unaligned FALLOC_FL_WRITE_ZEROES operations, which will need to check the partial zeroed result. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-5-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: check return value of ext4_get_block() in ext4_load_tail_bh()Zhang Yi
ext4_load_tail_bh() ignores the return value of ext4_get_block(), so an I/O or allocation failure is silently discarded. buffer_mapped(bh) stays false and the function returns NULL, which callers such as ext4_block_do_zero_range() treat as "nothing to do" and return success. This can mask real failures during zero-range, truncate, or punch-hole operations, potentially exposing stale data if the block was not actually a hole and needed zeroing. So propagate the error to the callers. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-4-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: skip tail block zeroing for inline data filesZhang Yi
ext4_block_zero_eof() is called from ext4_write_checks() on every append write beyond EOF. For inline data files, ext4_get_block() returns -ERANGE when ext4_load_tail_bh() looks up the tail block. However, this error is currently ignored because the return value of ext4_get_block() in ext4_load_tail_bh() is discarded. Before we fix ext4_load_tail_bh() to properly propagate the error, skip the zeroing for inline data inodes to avoid unnecessary failures or confusion. Fixes: 3f60efd65412d ("ext4: zero post-EOF partial block before appending write") Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-3-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: use FGP_WRITEBEGIN for tail block zeroingZhang Yi
ext4_load_tail_bh() returns a locked folio that callers immediately mutate through folio_zero_range() and mark_buffer_dirty(). Use FGP_WRITEBEGIN so that, on backing devices that require stable writes, __filemap_get_folio() waits for writeback to finish before returning the folio; on regular devices the wait is a no-op. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260714080044.4038124-2-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22dt-bindings: display: mediatek: Introduce MT8196 2D Sharpness ProcessorAngeloGioacchino Del Regno
Add documentation for the Two-Dimension Sharpness Processor, or "TDSHP", found in many MediaTek SoCs including MT8196 and its variants. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://patch.msgid.link/20260714114414.184512-43-angelogioacchino.delregno@collabora.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2026-07-22Merge tag 'ath-next-20260722' of ↵Johannes Berg
git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath Jeff Johnson says: ================== ath.git patches for v7.3 (PR #1) There has been quite a bit of activity across the ath drivers. Significant changes in ath12k include: Align with new Qualcomm generic Peripheral Authentication Service (PAS). Ongoing infrastructure changes to support the QCC2072 platform. Ongoing infrastructure changes to support the IPQ5332 platform. Enhance datapath statistics. Tuning of datapath parameters. In addition, an assortment of cleanups and minor bug fixes across ath6kl, ath10k, ath11k, ath12k, and carl9170. ================== Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2026-07-22Merge branch 'net-dsa-realtek-rtl8365mb-add-sgmii-hsgmii-support-for-rtl8367s'Jakub Kicinski
Johan Alvarado says: ==================== net: dsa: realtek: rtl8365mb: add SGMII/HSGMII support for RTL8367S The RTL8367S is a 5+2 port switch from the same family as the RTL8365MB-VC already supported by this driver. Its chip info table entry declares SGMII and HSGMII on external interface 1, but the driver so far only implements RGMII, leaving boards that wire the switch to the CPU over the SerDes without a working CPU port. This series implements both modes. The configuration sequence and the SerDes tuning parameters are derived from the GPL-licensed Realtek rtl8367c vendor driver, as distributed in the Mercusys MR80X GPL code drop, and cross-checked against the real register sequence captured at runtime by chainloading a custom U-Boot ahead of the stock firmware and logging the live SerDes accesses on hardware. The vendor driver brings up the SerDes by loading firmware into the switch's embedded DW8051 microcontroller. Analysis of that firmware (by Luiz Angelo Daros de Luca) showed it only performs a SerDes data-path reset right after the SerDes reset is deasserted, and then runs a link-polling loop that writes the external interface force registers -- duplicating, and racing with, the link management phylink already performs. This series therefore keeps the DW8051 disabled and performs the one necessary action (the data-path reset via the SerDes BMCR register) directly in the driver, avoiding both the race and a dependency on a redistributable firmware blob. The SerDes is modelled as a phylink PCS: mac_select_pcs() hands the SerDes interfaces to a phylink_pcs whose pcs_config()/pcs_link_up() ops own the SerDes register sequence, keeping it out of the MAC operations. In-band autonegotiation is not implemented; the link is forced (fixed-link or conventional PHY), as for RGMII, and the PCS reports this to phylink through pcs_inband_caps(). Patch 1 adds the SerDes indirect access helpers, the PCS and SGMII (1 Gbps) support. Patch 2 extends the PCS to HSGMII (2.5 Gbps), which phylink represents as 2500base-x. Tested on a Mercusys MR80X v2.20 (RTL8367S wired to the SoC over the SerDes), in both SGMII and HSGMII modes with a fixed-link device tree description: link bring-up verified across cold boots, warm reboots, module reloads and link down/up cycles, with sustained traffic and no CRC/symbol errors. The SerDes pause enables were verified by driving congestion toward a 100M user port and observing pause frame emission on the CPU port (dot3OutPauseFrames) toggle with the SDS_MISC TXFC/RXFC bits. The port 6 rate limiters were verified to be live by lowering them to 100 Mbps at runtime and observing iperf3 throughput across the CPU port clamp accordingly in each direction, recovering once the maximum was restored. The HSGMII link is confirmed running at 2.5G at the register level (SoC uniphy mode and gmac clocks); per-direction throughput could not be pushed past ~1 Gbps on this board because the SoC side is driven by the IPQ5018 SSDK and the user-facing PHY is 1G, so full 2.5G line-rate throughput remains unverified on my hardware. Independently, >1 Gbps aggregate HSGMII throughput (~2 Gbps with multiple clients) has been observed on an RTL8367S-based Mercusys MR85X running an OpenWrt backport of this series with the rate limiters raised (see patch 2). The RTL8367SB also declares SGMII and HSGMII in its chip info entry and therefore gains both modes as well. The vendor driver drives the two chips through the same code path, keyed only on the chip option register (both report chip id 0x6367), so this is expected to work there too, but I have no RTL8367SB hardware to confirm it. ==================== Link: https://patch.msgid.link/20260711-rtl8367s-sgmii-v6-0-88f7944ddca7@c127.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22net: dsa: realtek: rtl8365mb: add HSGMII support for RTL8367SJohan Alvarado
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate. The chip info table already declares HSGMII as a supported interface mode for external interface 1. Extend the SerDes PCS to handle HSGMII, which phylink represents as 2500base-x: - Select the HSGMII SerDes tuning parameters and external interface mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config() according to the interface. The parameters are again lifted from the GPL-licensed Realtek rtl8367c vendor driver, and again only cover the tuning variant for a non-zero chip option, so the mode is gated on the option probed at setup. - Advertise 2500base-x and MAC_2500FD on ports whose external interface supports HSGMII. - Accept SPEED_2500 in the forced link configuration. The MAC speed field has no 2.5 Gbps value: the rate is determined by the HSGMII SerDes configuration, and the vendor driver programs the 1 Gbps value here, so do the same. - Raise the port 6 ingress and egress rate limiters to their maximum at setup time, as the vendor switch init does unconditionally for the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps in units of 8 Kbps), which caps the aggregate HSGMII throughput at roughly 1 Gbps. The vendor documentation describes the reset default as disabling the limiter, but the cap is real: on an RTL8367S-based Mercusys MR85X running an OpenWrt backport of this series, several clients on 1 Gbps user ports were limited to about 1.02 Gbps combined across the HSGMII CPU port until these limiters were raised, after which throughput reached about 2 Gbps [1]. The related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set to its maximum by the common init jam table. Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to the SoC over HSGMII. Link: https://github.com/openwrt/openwrt/pull/19445#issuecomment-4505613294 [1] Suggested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Suggested-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Signed-off-by: Johan Alvarado <contact@c127.dev> Tested-by: Stanisław Pal <kuncy7@gmail.com> Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Tested-by: Stanislaw Pal <kuncy7@gmail.com> Link: https://patch.msgid.link/20260711-rtl8367s-sgmii-v6-2-88f7944ddca7@c127.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22net: dsa: realtek: rtl8365mb: add SGMII support for RTL8367SJohan Alvarado
The RTL8367S can mux its embedded SerDes to external interface 1, which is typically used to connect the switch to a CPU port. The chip info table already declares SGMII as a supported interface mode for this chip, but the driver only implements RGMII so far. Implement SGMII support as a phylink PCS, with the configuration sequence derived from the GPL-licensed Realtek rtl8367c vendor driver as distributed in the Mercusys MR80X GPL code drop: - Add accessors for the SerDes indirect access registers (SDS_INDACS), through which the SerDes internal registers are reached. - Register a phylink_pcs for the SerDes, selected from mac_select_pcs for the SGMII interface, so the SerDes handling lives in the PCS operations rather than in the MAC operations. - Probe the SerDes tuning variant from the chip option register once at setup. The vendor driver keeps two sets of SerDes tuning parameters and selects between them based on this option; only the variant for a non-zero option (which all RTL8367S parts seen so far report) has been validated on hardware, so the SerDes interface modes are only advertised in that case. An unsupported variant thus fails at phylink validation time instead of at link configuration time. - Keep the embedded DW8051 microcontroller in reset and disabled. The vendor driver loads firmware into it to manage the SerDes link, but analysis of that firmware shows it only duplicates the link management phylink already performs: it polls the port status and writes the external interface force registers behind the driver's back. - Clear the line rate bypass bit for the external interface, tune the SerDes with the vendor-prescribed parameters, mux the SerDes to MAC8 in SGMII mode and only then take the SerDes out of reset, as the vendor driver does. - After deasserting the SerDes reset, reset the SerDes data path via the SerDes BMCR register to flush the FIFOs and resync the PLL. This mirrors what the vendor firmware does right after deasserting the SerDes reset, and ensures a clean link state from cold boot. - Force the SGMII link parameters (link, speed, duplex) in the SDS_MISC register from pcs_link_up(). SGMII in-band autonegotiation is not implemented, so only fixed-link and conventional PHY setups are supported, just like RGMII. This is reported to phylink through pcs_inband_caps() returning LINK_INBAND_DISABLE, so phylink never selects an in-band-enabled negotiation mode for this PCS. - Program the SerDes pause enables in SDS_MISC from the resolved pause modes when forcing the MAC external interface in mac_link_up, as the vendor driver does, rather than leaving whatever state the boot firmware left there. Flow control testing shows these bits, not the MAC force pause bits, gate pause on the SerDes external interface. This is done in the MAC layer because pcs_link_up() carries no pause information. - Implement pcs_get_state() by reading the link status from the SerDes, with the forced speed and duplex read back from SDS_MISC. Although the supported fixed-link and conventional PHY setups do not use it, the PCS owns the SerDes link state, and phylink consults pcs_get_state() to track the physical link when operating in in-band mode with autonegotiation disabled. The SerDes has no link interrupt wired up, so the PCS sets its poll flag. Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to the SoC over SGMII. Suggested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Suggested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Suggested-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Signed-off-by: Johan Alvarado <contact@c127.dev> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Reviewed-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Tested-by: Stanislaw Pal <kuncy7@gmail.com> Link: https://patch.msgid.link/20260711-rtl8367s-sgmii-v6-1-88f7944ddca7@c127.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-22jbd2: bound shrinker scans by examined checkpoint buffersMax Kellermann
The jbd2 shrinker currently accounts only checkpoint buffers that it successfully releases against nr_to_scan. Busy buffers therefore do not consume the scan budget. If a checkpoint transaction contains mostly busy buffers, the shrinker can scan its entire checkpoint list while holding journal->j_list_lock. Large checkpoint lists can result in excessive lock hold times and leave other CPUs spinning on j_list_lock, causing soft lockups or RCU stalls. Pass nr_to_scan into journal_shrink_one_cp_list() and decrement it for every buffer examined, including busy buffers. Pass NULL from checkpoint cleanup paths so their existing full-list behavior is preserved. This restores the scan-budget semantics that existed before journal_shrink_one_cp_list() was changed to always scan a complete checkpoint list. Fixes: b98dba273a0e ("jbd2: remove journal_clean_one_cp_list()") Cc: stable@vger.kernel.org Signed-off-by: Max Kellermann <max.kellermann@ionos.com> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260713102229.1598812-3-max.kellermann@ionos.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22jbd2: check need_resched() when skipping busy checkpoint buffersMax Kellermann
journal_shrink_one_cp_list() skips busy checkpoint buffers when called with JBD2_SHRINK_BUSY_SKIP. The continue statement on this path also skips the need_resched() check at the end of the loop body. Consequently, when a checkpoint list contains mostly busy buffers, the shrinker can walk the entire list while holding journal->j_list_lock, even when a reschedule has been requested. Large checkpoint lists under memory pressure can therefore cause long lock hold times and leave other CPUs spinning on j_list_lock, resulting in soft lockups or RCU stalls. Route the busy-buffer path through the need_resched() check so that the shrinker can release j_list_lock and reschedule promptly, restoring parity with the clean-buffer path, which already checks need_resched(). This does not change which checkpoint buffers are eligible for removal. Fixes: b98dba273a0e ("jbd2: remove journal_clean_one_cp_list()") Cc: stable@vger.kernel.org Signed-off-by: Max Kellermann <max.kellermann@ionos.com> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260713102229.1598812-2-max.kellermann@ionos.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: use str_plural() instead of custom macroJoshua Crofts
Remove the custom PLURAL() macro and use str_plural() from string_choices.h instead. Reviewed-by: Baokun Li <libaokun@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Link: https://patch.msgid.link/20260713-remove-plural-macro-v2-1-424e1536ac10@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22fs: add iput_if_not_last() helperYun Zhou
Add a helper that drops an inode reference only if the caller does not hold the last one. Returns true if the reference was dropped, false otherwise. This is useful for filesystems that need to release inode references in contexts where triggering final iput (and thus eviction) would be unsafe due to lock ordering constraints. The caller can check the return value and defer the final iput to a safe context. Unlike iput_not_last() which BUG_ON's if called with the last ref, this variant is designed to be called speculatively. Signed-off-by: Yun Zhou <yun.zhou@windriver.com> Suggested-by: Jan Kara <jack@suse.cz> Suggested-by: Mateusz Guzik <mjguzik@gmail.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christian Brauner (Amutable) <brauner@kernel.org> Tested-by: syzbot@syzkaller.appspotmail.com Link: https://patch.msgid.link/20260710030851.2791589-2-yun.zhou@windriver.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: remove ea_inode_array mechanism in favor of ext4_put_ea_inode()Yun Zhou
Now that ext4_put_ea_inode() handles deferred iput safely for all cases (using iput_if_not_last + embedded llist_node), the ea_inode_array mechanism for batching deferred iputs is redundant. Remove: - ext4_expand_inode_array() and ext4_xattr_inode_array_free() - struct ext4_xattr_inode_array and EIA_INCR/EIA_MASK defines - ea_inode_array parameter from ext4_xattr_inode_dec_ref_all(), ext4_xattr_release_block(), and ext4_xattr_delete_inode() - ea_inode_array variable from ext4_evict_inode() Instead, ext4_xattr_inode_dec_ref_all() now calls ext4_put_ea_inode() directly after processing each EA inode. This simplifies the code by eliminating multi-layer parameter threading and removes the need for callers to manage array lifetime. Signed-off-by: Yun Zhou <yun.zhou@windriver.com> Suggested-by: Jan Kara <jack@suse.cz> Reviewed-by: Jan Kara <jack@suse.cz> Tested-by: syzbot@syzkaller.appspotmail.com Link: https://patch.msgid.link/20260710030851.2791589-5-yun.zhou@windriver.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: convert all EA inode iput() calls to ext4_put_ea_inode()Yun Zhou
Convert all iput() calls on EA inodes in xattr code paths to use ext4_put_ea_inode(). This establishes a uniform rule: every EA inode reference release in ext4 xattr code goes through ext4_put_ea_inode(), eliminating the need to analyze each call site individually for lock safety. Converted sites: - ext4_xattr_inode_get() read path - ext4_xattr_inode_inc_ref_all() main loop and cleanup path - ext4_xattr_inode_dec_ref_all() error paths - ext4_xattr_inode_create() error path - ext4_xattr_inode_cache_find() mismatch path - ext4_xattr_inode_lookup_create() out_err - ext4_xattr_set_entry() old_ea_inode - ext4_xattr_block_set() new block path, cleanup, and tmp_inode - ext4_xattr_ibody_set() error and success paths - ext4_xattr_delete_inode() quota loop For most of these, iput_if_not_last() will succeed (the EA inode has other references) making the overhead a single atomic operation. Signed-off-by: Yun Zhou <yun.zhou@windriver.com> Reviewed-by: Jan Kara <jack@suse.cz> Tested-by: syzbot@syzkaller.appspotmail.com Link: https://patch.msgid.link/20260710030851.2791589-4-yun.zhou@windriver.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2026-07-22ext4: introduce ext4_put_ea_inode() for safe deferred iputYun Zhou
Calling iput() on EA inodes while holding xattr_sem or a jbd2 handle can trigger write_inode_now() -> ext4_writepages() -> s_writepages_rwsem, creating a lock ordering issue during mount (!SB_ACTIVE). Add ext4_put_ea_inode() which uses iput_if_not_last() as a fast path. If this is not the last reference, it is dropped immediately. If this is the last reference, the inode is linked onto a per-sb lock-free llist via i_ea_iput_node (embedded in ext4_inode_info, sharing space with the unused xattr_sem of EA inodes via a union) and a delayed worker (1 jiffie) performs the final iput() in a clean context. This avoids per-iput memory allocation. Flush points ensure all pending EA inode evictions complete before dependent resources become unavailable: - ext4_put_super / failed_mount9: before quota shutdown - failed_mount_wq: before freeing xattr caches - failed_mount3a: before freeing shrinker (journal replay case) - ext4_sync_fs: before remount-ro, freeze, or sync completes Initialization is placed before journal loading since fast commit replay may trigger evictions that call ext4_put_ea_inode(). Also moves init_rwsem(xattr_sem) from init_once to ext4_alloc_inode to handle slab object reuse after the union field has been overwritten. Signed-off-by: Yun Zhou <yun.zhou@windriver.com> Suggested-by: Jan Kara <jack@suse.cz> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://patch.msgid.link/20260710030851.2791589-3-yun.zhou@windriver.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>