Skip to contentSkip to conversation

6.14.2-rc1 review

PATCH In review Greg Kroah-Hartman 12 participants 758 messages Apr 8, 2025 – Apr 17, 2025 Page 1 of 7

Subsystems (3)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 6.14.2-rc1 review

This is the start of the stable review cycle for the 6.14.2 release. There are 731 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 10 Apr 2025 10:47:53 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.14.2-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.14.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>

    Linux 6.14.2-rc1

Chuck Lever <[email protected]>
NFSD: Skip sending CB_RECALL_ANY when the backchannel isn't up

Chuck Lever <[email protected]>
NFSD: Never return NFS4ERR_FILE_OPEN when removing a directory

Chuck Lever <[email protected]>
NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs()

Olga Kornievskaia <[email protected]>
nfsd: fix management of listener transports

Chuck Lever <[email protected]>
NFSD: Add a Kconfig setting to enable delegated timestamps

Li Lingfeng <[email protected]>
nfsd: put dl_stid if fail to queue dl_recall

Jeff Layton <[email protected]>
nfsd: allow SC_STATUS_FREEABLE when searching via nfs4_lookup_stateid()

Jeff Layton <[email protected]>
nfsd: don't ignore the return code of svc_proc_register()

Murad Masimov <[email protected]>
media: streamzap: fix race between device disconnection and urb callback

Nikita Zhandarovich <[email protected]>
media: vimc: skip .s_stream() for stopped entities

Oleg Nesterov <[email protected]>

    exec: fix the racy usage of fs_struct->in_exec

Yosry Ahmed <[email protected]>
mm: zswap: fix crypto_free_acomp() deadlock in zswap_cpu_comp_dead()

Roman Smirnov <[email protected]>
jfs: add index corruption check to DT_GETPAGE()

Qasim Ijaz <[email protected]>
jfs: fix slab-out-of-bounds read in ea_get()

Lukas Wunner <[email protected]>
PCI/bwctrl: Fix NULL pointer dereference on bus number exhaustion

Acs, Jakub <[email protected]>
ext4: fix OOB read when checking dotdot dir

Theodore Ts'o <[email protected]>
ext4: don't over-report free space or inodes in statvfs

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7921: fix kernel panic due to null pointer dereference

Angelos Oikonomopoulos <[email protected]>
arm64: Don't call NULL in do_compat_alignment_fixup()

David Hildenbrand <[email protected]>
mm/gup: reject FOLL_SPLIT_PMD with hugetlb VMAs

Steven Rostedt <[email protected]>
tracing: Verify event formats that have "%*p.."

Ran Xiaokai <[email protected]>
tracing/osnoise: Fix possible recursive locking for cpus_read_lock()

Douglas Raillard <[email protected]>
tracing: Fix synth event printk format for str fields

Douglas Raillard <[email protected]>
tracing: Ensure module defining synth event cannot be unloaded while tracing

Tengda Wu <[email protected]>
tracing: Fix use-after-free in print_graph_function_flags during tracer switching

Sungjong Seo <[email protected]>
exfat: fix potential wrong error return from get_block

Sungjong Seo <[email protected]>
exfat: fix random stack corruption after get_block

Namjae Jeon <[email protected]>
ksmbd: fix null pointer dereference in alloc_preauth_hash()

Norbert Szetei <[email protected]>
ksmbd: validate zero num_subauth before sub_auth is accessed

Norbert Szetei <[email protected]>
ksmbd: fix overflow in dacloffset bounds check

Namjae Jeon <[email protected]>
ksmbd: fix session use-after-free in multichannel connection

Namjae Jeon <[email protected]>
ksmbd: fix use-after-free in ksmbd_sessions_deregister()

Norbert Szetei <[email protected]>
ksmbd: add bounds check for create lease context

Namjae Jeon <[email protected]>
ksmbd: add bounds check for durable handle context

Sean Christopherson <[email protected]>
KVM: SVM: Don't change target vCPU state on AP Creation VMGEXIT error

Ulf Hansson <[email protected]>
mmc: sdhci-omap: Disable MMC_CAP_AGGRESSIVE_PM for eMMC/SD

Karel Balej <[email protected]>
mmc: sdhci-pxav3: set NEED_RSP_BUSY capability

Miaoqian Lin <[email protected]>
mmc: omap: Fix memory leak in mmc_omap_new_slot

Candice Li <[email protected]>
Remove unnecessary firmware version check for gc v9_4_2

Robin Murphy <[email protected]>
media: omap3isp: Handle ARM dma_iommu_mapping

Christian Eggers <[email protected]>
ARM: 9444/1: add KEEP() keyword to ARM_VECTORS

Nathan Chancellor <[email protected]>
ARM: 9443/1: Require linker to support KEEP within OVERLAY for DCE

Gergo Koteles <[email protected]>
ACPI: video: Handle fetching EDID as ACPI_TYPE_PACKAGE

Paul Menzel <[email protected]>
ACPI: resource: Skip IRQ override on ASUS Vivobook 14 X1404VAP

Murad Masimov <[email protected]>
acpi: nfit: fix narrowing conversion in acpi_nfit_ctl

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: remove unused acpi function for clc

Nathan Chancellor <[email protected]>
ACPI: platform-profile: Fix CFI violation when accessing sysfs files

Jann Horn <[email protected]>
x86/mm: Fix flush_tlb_range() when used for zapping normal PMDs

Guilherme G. Piccoli <[email protected]>
x86/tsc: Always save/restore TSC sched_clock() on suspend/resume

Arnd Bergmann <[email protected]>
x86/Kconfig: Add cmpxchg8b support back to Geode CPUs

Kent Overstreet <[email protected]>
bcachefs: bch2_ioctl_subvolume_destroy() fixes

Jiri Olsa <[email protected]>
uprobes/x86: Harden uretprobe syscall trampoline check

Kan Liang <[email protected]>

    perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read

Peter Zijlstra (Intel) <[email protected]>
perf/x86/intel: Apply static call for drain_pebs

Markus Elfring <[email protected]>
ntb_perf: Delete duplicate dmaengine_unmap_put() call in perf_copy_chunk()

Srinivas Pandruvada <[email protected]>
platform/x86: ISST: Correct command storage data length

Eduard Christian Dumitrescu <[email protected]>
platform/x86: thinkpad_acpi: disable ACPI fan access for T495* and E560

Hans de Goede <[email protected]>
ACPI: x86: Extend Lenovo Yoga Tab 3 quirk with skip GPIO event-handlers

Vishal Annapurve <[email protected]>
x86/tdx: Fix arch_safe_halt() execution for TDX VMs

Kirill A. Shutemov <[email protected]>
x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT

Shuai Xue <[email protected]>
x86/mce: use is_copy_from_user() to determine copy-from-user context

Boris Ostrovsky <[email protected]>
x86/microcode/AMD: Fix __apply_microcode_amd()'s return value

Paolo Bonzini <[email protected]>
KVM: x86: block KVM_CAP_SYNC_REGS if guest state is protected

Tianyu Lan <[email protected]>
x86/hyperv: Fix check of return value from snp_set_vmsa()

Hengqi Chen <[email protected]>
LoongArch: BPF: Use move_addr() for BPF_PSEUDO_FUNC

Hengqi Chen <[email protected]>
LoongArch: BPF: Don't override subprog's return value

Hengqi Chen <[email protected]>
LoongArch: BPF: Fix off-by-one error in build_prologue()

Huacai Chen <[email protected]>
LoongArch: Increase MAX_IO_PICS up to 8

Huacai Chen <[email protected]>
LoongArch: Increase ARCH_DMA_MINALIGN up to 16

WANG Rui <[email protected]>
rust: Fix enabling Rust and building with GCC for LoongArch

Danilo Krummrich <[email protected]>
rust: platform: require Send for Driver trait implementers

Danilo Krummrich <[email protected]>
rust: pci: require Send for Driver trait implementers

Ying Lu <[email protected]>
usbnet:fix NPE during rx_complete

Sherry Sun <[email protected]>
tty: serial: lpuart: only disable CTS instead of overwriting the whole UARTMODIR register

Sherry Sun <[email protected]>
tty: serial: fsl_lpuart: use port struct directly to simply code

Sherry Sun <[email protected]>
tty: serial: fsl_lpuart: Use u32 and u8 for register variables

Dave Penkler <[email protected]>
staging: gpib: Fix Oops after disconnect in agilent usb

Dave Penkler <[email protected]>
staging: gpib: agilent usb console messaging cleanup

Dave Penkler <[email protected]>
staging: gpib: Fix Oops after disconnect in ni_usb

Dave Penkler <[email protected]>
staging: gpib: ni_usb console messaging cleanup

Zhang Rui <[email protected]>
tools/power turbostat: Restore GFX sysfs fflush() call

Len Brown <[email protected]>
tools/power turbostat: report CoreThr per measurement interval

Yeoreum Yun <[email protected]>
perf/core: Fix child_total_time_enabled accounting bug at task exit

Alex Deucher <[email protected]>
drm/amdgpu/gfx12: fix num_mec

Alex Deucher <[email protected]>
drm/amdgpu/gfx11: fix num_mec

Yue Haibing <[email protected]>
drm/xe: Fix unmet direct dependencies warning

Alexandru Gagniuc <[email protected]>
kbuild: deb-pkg: don't set KBUILD_BUILD_VERSION unconditionally

Zhang Rui <[email protected]>
tools/power turbostat: Allow Zero return value for some RAPL registers

Jakub Kicinski <[email protected]>
netlink: specs: rt_route: pull the ifa- prefix out of the names

Dave Marquardt <[email protected]>
net: ibmveth: make veth_pool_store stop hanging

Henry Martin <[email protected]>
arcnet: Add NULL check in com20020pci_probe()

Ido Schimmel <[email protected]>
ipv6: Do not consider link down nexthops in path selection

Ido Schimmel <[email protected]>
ipv6: Start path selection from the first nexthop

Lin Ma <[email protected]>
net: fix geneve_opt length integer overflow

David Oberhollenzer <[email protected]>
net: dsa: mv88e6xxx: propperly shutdown PPU re-enable timer on destroy

Fernando Fernandez Mancera <[email protected]>
ipv6: fix omitted netlink attributes when using RTEXT_FILTER_SKIP_STATS

Edward Cree <[email protected]>
sfc: fix NULL dereferences in ef100_process_design_param()

Edward Cree <[email protected]>
sfc: rip out MDIO support

Lin Ma <[email protected]>
netfilter: nft_tunnel: fix geneve_opt type confusion addition

Antoine Tenart <[email protected]>
net: decrease cached dst counters in dst_release

Wang Liang <[email protected]>
xsk: Fix __xsk_generic_xmit() error code when cq is full

Guillaume Nault <[email protected]>
tunnels: Accept PACKET_HOST in skb_tunnel_check_pmtu().

Stefano Garzarella <[email protected]>
vsock: avoid timeout during connect() if the socket is closing

Kuniyuki Iwashima <[email protected]>
udp: Fix memory accounting leak.

Kuniyuki Iwashima <[email protected]>

    udp: Fix multiple wraparounds of sk->sk_rmem_alloc.

Kuniyuki Iwashima <[email protected]>
rtnetlink: Use register_pernet_subsys() in rtnl_net_debug_init().

Tobias Waldekranz <[email protected]>
net: mvpp2: Prevent parser TCAM memory corruption

Lorenzo Bianconi <[email protected]>
net: airoha: Fix ETS priomap validation

Lorenzo Bianconi <[email protected]>
net: airoha: Fix qid report in airoha_tc_get_htb_get_leaf_queue()

Eric Dumazet <[email protected]>
sctp: add mutual exclusion in proc_sctp_do_udp_port()

Cong Wang <[email protected]>
net_sched: skbprio: Remove overly strict queue assertions

Debin Zhu <[email protected]>
netlabel: Fix NULL pointer exception caused by CALIPSO on IPv4 sockets

Florian Westphal <[email protected]>
netfilter: nf_tables: don't unregister hook when table is dormant

Pablo Neira Ayuso <[email protected]>
netfilter: nft_set_hash: GC reaps elements with conncount for dynamic sets only

Emil Tantilov <[email protected]>
idpf: fix adapter NULL pointer dereference on reboot

Piotr Kwapulinski <[email protected]>
ixgbe: fix media type detection for E610 device

Vitaly Lifshits <[email protected]>
e1000e: change k1 configuration on MTP and later platforms

Zdenek Bouska <[email protected]>
igc: Fix TX drops in XDP ZC

Song Yoong Siang <[email protected]>
igc: Add launch time support to XDP ZC

Song Yoong Siang <[email protected]>
igc: Refactor empty frame insertion for launch time support

Song Yoong Siang <[email protected]>
xsk: Add launch time hardware offload support to XDP Tx metadata

Florian Fainelli <[email protected]>
spi: bcm2835: Restore native CS probing when pinctrl-bcm2835 is absent

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Fix built-in mic on another ASUS VivoBook model

Florian Fainelli <[email protected]>
spi: bcm2835: Do not call gpiod_put() on invalid descriptor

Henry Martin <[email protected]>
ASoC: imx-card: Add NULL check in imx_card_probe()

Maurizio Lombardi <[email protected]>
nvme-pci: skip nvme_write_sq_db on empty rqlist

Caleb Sander Mateos <[email protected]>
nvme/ioctl: don't warn on vectorized uring_cmd with fixed buffer

Björn Töpel <[email protected]>
riscv/purgatory: 4B align purgatory_start

Yao Zi <[email protected]>
riscv/kexec_file: Handle R_RISCV_64 in purgatory relocator

Alexandre Ghiti <[email protected]>
riscv: Fix hugetlb retrieval of number of ptes in case of !present pte

Josh Poimboeuf <[email protected]>
spi: cadence: Fix out-of-bounds array access in cdns_mrvl_xspi_setup_clock()

Christophe JAILLET <[email protected]>
ASoC: codecs: rt5665: Fix some error handling paths in rt5665_probe()

Sven Schnelle <[email protected]>
s390/entry: Fix setting _CIF_MCCK_GUEST with lowcore relocation

Ming Lei <[email protected]>

    ublk: make sure ubq->canceling is set when queue is frozen

Herton R. Krzesinski <[email protected]>
x86/uaccess: Improve performance by aligning writes to 8 bytes in copy_user_generic(), on non-FSRM/ERMS CPUs

Palmer Dabbelt <[email protected]>
RISC-V: errata: Use medany for relocatable builds

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Fix built-in mic breakage on ASUS VivoBook X515JA

Richard Fitzgerald <[email protected]>
firmware: cs_dsp: Ensure cs_dsp_load[_coeff]() returns 0 on success

Andrew Jones <[email protected]>
riscv: Fix set up of vector cpu hotplug callback

Andrew Jones <[email protected]>
riscv: Fix set up of cpu hotplug callbacks

Andrew Jones <[email protected]>
riscv: Change check_unaligned_access_speed_all_cpus to void

Andrew Jones <[email protected]>
riscv: Fix check_unaligned_access_all_cpus

Andrew Jones <[email protected]>
riscv: Fix riscv_online_cpu_vec

Andrew Jones <[email protected]>
riscv: Annotate unaligned access init functions

Pu Lehui <[email protected]>
riscv: fgraph: Fix stack layout to match __arch_ftrace_regs argument of ftrace_return_to_handler

Nikita Shubin <[email protected]>
ntb: intel: Fix using link status DB's

Yajun Deng <[email protected]>
ntb_hw_switchtec: Fix shift-out-of-bounds in switchtec_ntb_mw_set_trans

Pu Lehui <[email protected]>
riscv: fgraph: Select HAVE_FUNCTION_GRAPH_TRACER depends on HAVE_DYNAMIC_FTRACE_WITH_ARGS

Alexandre Ghiti <[email protected]>
riscv: Fix missing __free_pages() in check_vector_unaligned_access()

Tingbo Liao <[email protected]>
riscv: Fix the __riscv_copy_vec_words_unaligned implementation

Juhan Jin <[email protected]>
riscv: ftrace: Add parentheses in macro definitions of make_call_t0 and make_call_ra

Christian Schoenebeck <[email protected]>
fs/9p: fix NULL pointer dereference on mkdir

Al Viro <[email protected]>
spufs: fix a leak in spufs_create_context()

Al Viro <[email protected]>
spufs: fix gang directory lifetimes

Al Viro <[email protected]>
spufs: fix a leak on spufs_new_file() failure

Claudiu Beznea <[email protected]>
rtc: renesas-rtca3: Disable interrupts only if the RTC is enabled

Dan Carpenter <[email protected]>
nfs: Add missing release on error in nfs_lock_and_join_requests()

Josh Poimboeuf <[email protected]>
objtool/loongarch: Add unwind hints in prepare_frametrace()

Josh Poimboeuf <[email protected]>
rcu-tasks: Always inline rcu_irq_work_resched()

Josh Poimboeuf <[email protected]>
context_tracking: Always inline ct_{nmi,irq}_{enter,exit}()

Josh Poimboeuf <[email protected]>
sched/smt: Always inline sched_smt_active()

David Laight <[email protected]>
objtool: Fix verbose disassembly if CROSS_COMPILE isn't set

Geetha sowjanya <[email protected]>
octeontx2-af: Free NIX_AF_INT_VEC_GEN irq

Geetha sowjanya <[email protected]>
octeontx2-af: Fix mbox INTR handler when num VFs > 64

Jim Liu <[email protected]>
net: phy: broadcom: Correct BCM5221 PHY model detection

Giovanni Gherdovich <[email protected]>
ACPI: processor: idle: Return an error if both P_LVL{2,3} idle states are invalid

Yuli Wang <[email protected]>
LoongArch: Rework the arch_kgdb_breakpoint() implementation

Miaoqian Lin <[email protected]>
LoongArch: Fix device node refcount leak in fdt_cpu_clk_init()

谢致邦 (XIE Zhibang) <[email protected]>
LoongArch: Fix help text of CMDLINE_EXTEND in Kconfig

Josh Poimboeuf <[email protected]>
objtool: Fix segfault in ignore_unreachable_insn()

Feng Yang <[email protected]>
ring-buffer: Fix bytes_dropped calculation issue

Lama Kayal <[email protected]>
net/mlx5e: SHAMPO, Make reserved size independent of page size

Namjae Jeon <[email protected]>
ksmbd: fix r_count dec/increment mismatch

Namjae Jeon <[email protected]>
ksmbd: fix multichannel connection failure

Miaoqian Lin <[email protected]>
ksmbd: use aead_request_free to match aead_request_alloc

Lubomir Rintel <[email protected]>
rndis_host: Flag RNDIS modems as WWAN devices

Mark Zhang <[email protected]>
rtnetlink: Allocate vfinfo size for VF GUIDs when supported

Yuezhang Mo <[email protected]>
exfat: fix missing shutdown check

Yuezhang Mo <[email protected]>
exfat: fix the infinite loop in exfat_find_last_cluster()

Wang Zhaolong <[email protected]>
smb: client: Fix netns refcount imbalance causing leaks and use-after-free

Trond Myklebust <[email protected]>
NFS: Shut down the nfs_client only after all the superblocks

Josh Poimboeuf <[email protected]>
objtool, media: dib8000: Prevent divide-by-zero in dib8000_set_dds()

Josh Poimboeuf <[email protected]>
objtool, nvmet: Fix out-of-bounds stack access in nvmet_ctrl_state_show()

Josh Poimboeuf <[email protected]>
objtool, spi: amd: Fix out-of-bounds stack access in amd_set_spi_freq()

xueqin Luo <[email protected]>
thermal: core: Remove duplicate struct declaration

Josh Poimboeuf <[email protected]>
objtool: Fix detection of consecutive jump tables on Clang 20

Tiezhu Yang <[email protected]>
objtool: Handle PC relative relocation type

Tiezhu Yang <[email protected]>
objtool: Handle different entry size of rodata

Tiezhu Yang <[email protected]>
objtool: Handle various symbol types of rodata

Namhyung Kim <[email protected]>
perf bpf-filter: Fix a parsing error with comma

Marcus Meissner <[email protected]>
perf tools: annotate asm_pure_loop.S

Likhitha Korrapati <[email protected]>
perf tools: Fix is_compat_mode build break in ppc64

Bart Van Assche <[email protected]>
fs/procfs: fix the comment above proc_pid_wchan()

Ilkka Koskinen <[email protected]>
perf vendor events arm64 AmpereOneX: Fix frontend_bound calculation

Jiri Slaby (SUSE) <[email protected]>
tty: n_tty: use uint for space returned by tty_write_room()

Stefan Wahren <[email protected]>
staging: vchiq_arm: Stop kthreads if vchiq cdev register fails

Stefan Wahren <[email protected]>
staging: vchiq_arm: Fix possible NPR of keep-alive thread

Stefan Wahren <[email protected]>
staging: vchiq_arm: Register debugfs after cdev

谢致邦 (XIE Zhibang) <[email protected]>
staging: rtl8723bs: select CONFIG_CRYPTO_LIB_AES

Thomas Richter <[email protected]>
perf pmu: Handle memory failure in tool_pmu__new()

James Clark <[email protected]>
perf: intel-tpebs: Fix incorrect usage of zfree()

Stephen Brennan <[email protected]>
perf dso: fix dso__is_kallsyms() check

Arnaldo Carvalho de Melo <[email protected]>
perf python: Check if there is space to copy all the event

Arnaldo Carvalho de Melo <[email protected]>
perf python: Don't keep a raw_data pointer to consumed ring buffer space

Arnaldo Carvalho de Melo <[email protected]>
perf python: Decrement the refcount of just created event on failure

Arnaldo Carvalho de Melo <[email protected]>
perf python: Fixup description of sample.id event member

Stanley Chu <[email protected]>
i3c: master: svc: Fix missing the IBI rules

Benjamin Berg <[email protected]>
um: hostfs: avoid issues on inode number reuse by host

Benjamin Berg <[email protected]>
um: remove copy_from_kernel_nofault_allowed

David Gow <[email protected]>
um: Pass the correct Rust target and options with gcc

Cyan Yang <[email protected]>
selftests/mm/cow: fix the incorrect error handling

Alistair Popple <[email protected]>
fuse: fix dax truncate/punch_hole fault path

NeilBrown <[email protected]>
NFS: fix open_owner_id_maxsz and related fields.

Trond Myklebust <[email protected]>
NFSv4: Avoid unnecessary scans of filesystems for delayed delegations

Trond Myklebust <[email protected]>
NFSv4: Avoid unnecessary scans of filesystems for expired delegations

Trond Myklebust <[email protected]>
NFSv4: Avoid unnecessary scans of filesystems for returning delegations

Trond Myklebust <[email protected]>
NFSv4: Don't trigger uneccessary scans for return-on-close delegations

Antonio Quartulli <[email protected]>
scripts/gdb/linux/symbols.py: address changes to module_sect_attrs

Tang Yizhou <[email protected]>
writeback: fix calculations in trace_balance_dirty_pages() for cgwb

Tang Yizhou <[email protected]>
writeback: let trace_balance_dirty_pages() take struct dtc as parameter

Anshuman Khandual <[email protected]>
arch/powerpc: drop GENERIC_PTDUMP from mpc885_ads_defconfig

Danilo Krummrich <[email protected]>
rust: platform: fix unrestricted &mut platform::Device

Danilo Krummrich <[email protected]>
rust: pci: fix unrestricted &mut pci::Device

Danilo Krummrich <[email protected]>
rust: pci: use to_result() in enable_device_mem()

Ahmad Fatoum <[email protected]>
reboot: reboot, not shutdown, on hw_protection_reboot timeout

Ahmad Fatoum <[email protected]>
reboot: replace __hw_protection_shutdown bool action parameter with an enum

Vasiliy Kovalev <[email protected]>
ocfs2: validate l_tree_depth to avoid out-of-bounds access

Sourabh Jain <[email protected]>
kexec: initialize ELF lowest address to ULONG_MAX

David Hildenbrand <[email protected]>
kernel/events/uprobes: handle device-exclusive entries correctly in __replace_page()

Veronika Molnarova <[email protected]>
perf test stat_all_pmu.sh: Correctly check 'perf stat' result

Arnaldo Carvalho de Melo <[email protected]>
perf units: Fix insufficient array space

Dapeng Mi <[email protected]>
perf x86/topdown: Fix topdown leader sampling test error on hybrid

Ian Rogers <[email protected]>
perf evsel: tp_format accessing improvements

Ian Rogers <[email protected]>
perf evlist: Add success path to evlist__create_syswide_maps

Ian Rogers <[email protected]>
perf debug: Avoid stack overflow in recursive error message

Karan Sanghavi <[email protected]>
iio: light: Add check for array bounds in veml6075_read_int_time_ms

Jonathan Santos <[email protected]>
iio: adc: ad7768-1: set MOSI idle state to prevent accidental reset

Uwe Kleine-König <[email protected]>
iio: adc: ad7173: Fix comparison of channel configs

Uwe Kleine-König <[email protected]>
iio: adc: ad7124: Fix comparison of channel configs

Uwe Kleine-König <[email protected]>
iio: adc: ad4130: Fix comparison of channel setups

Uwe Kleine-König <[email protected]>
iio: adc: ad_sigma_delta: Disable channel after calibration

Basavaraj Natikar <[email protected]>
dmaengine: ptdma: Utilize the AE4DMA engine's multi-queue functionality

Basavaraj Natikar <[email protected]>
dmaengine: ae4dma: Use the MSI count and its corresponding IRQ number

Peng Fan <[email protected]>
dmaengine: fsl-edma: free irq correctly in remove path

Peng Fan <[email protected]>
dmaengine: fsl-edma: cleanup chan after dma_async_device_unregister

Bard Liao <[email protected]>
soundwire: take in count the bandwidth of a prepared stream

Chuck Lever <[email protected]>
NFSD: Fix callback decoder status codes

Ian Rogers <[email protected]>
perf tests: Fix data symbol test with LTO builds

Namhyung Kim <[email protected]>
perf test: Add timeout to datasym workload

Dan Carpenter <[email protected]>
fs/ntfs3: Prevent integer overflow in hdr_first_de()

Dan Carpenter <[email protected]>
fs/ntfs3: Fix a couple integer overflows on 32bit systems

Niklas Neronin <[email protected]>
usb: xhci: correct debug message page size calculation

Namhyung Kim <[email protected]>
perf machine: Fixup kernel maps ends after adding extra maps

Thomas Richter <[email protected]>
perf bench: Fix perf bench syscall loop count

Leo Yan <[email protected]>
perf arm-spe: Fix load-store operation checking

Uwe Kleine-König <[email protected]>
iio: adc: ad7192: Grab direct mode for calibration

Uwe Kleine-König <[email protected]>
iio: adc: ad7173: Grab direct mode for calibration

Jonathan Cameron <[email protected]>
iio: core: Rework claim and release of direct mode to work with sparse.

Nuno Sá <[email protected]>
iio: backend: make sure to NULL terminate stack buffer

Jonathan Cameron <[email protected]>
iio: accel: msa311: Fix failure to release runtime pm if direct mode claim fails.

Jonathan Cameron <[email protected]>
iio: accel: mma8452: Ensure error return on failure to matching oversampling ratio

Mario Limonciello <[email protected]>
ucsi_ccg: Don't show failed to get FW build information error

Luca Ceresoli <[email protected]>
perf build: Fix in-tree build due to symbolic link

Ian Rogers <[email protected]>
tools/x86: Fix linux/unaligned.h include path in lib/insn.c

James Clark <[email protected]>
perf pmu: Don't double count common sysfs and json events

James Clark <[email protected]>
perf pmu: Dynamically allocate tool PMU

Ian Rogers <[email protected]>
perf pmus: Restructure pmu_read_sysfs to scan fewer PMUs

Yuanfang Zhang <[email protected]>
coresight-etm4x: add isb() before reading the TRCSTATR

Mike Christie <[email protected]>
vhost-scsi: Fix handling of multiple calls to vhost_scsi_set_endpoint

Ilkka Koskinen <[email protected]>
coresight: catu: Fix number of pages while using 64k pages

Wentao Liang <[email protected]>
greybus: gb-beagleplay: Add error handling for gb_greybus_init

Dmitry Vyukov <[email protected]>
perf report: Fix input reload/switch with symbol sort key

Dmitry Vyukov <[email protected]>
perf report: Add parallelism sort key

Namhyung Kim <[email protected]>
perf report: Switch data file correctly in TUI

Dave Penkler <[email protected]>
staging: gpib: Fix cb7210 pcmcia Oops

Joe Hattori <[email protected]>
soundwire: slave: fix an OF node reference leak in soundwire slave device

James Clark <[email protected]>
perf tests: Fix Tool PMU test segfault

Qasim Ijaz <[email protected]>
isofs: fix KMSAN uninit-value bug in do_isofs_readdir()

Kan Liang <[email protected]>
perf tools: Add skip check in tool_pmu__event_to_str()

Heiko Stuebner <[email protected]>
phy: phy-rockchip-samsung-hdptx: Don't use dt aliases to determine phy-id

Uwe Kleine-König <[email protected]>
iio: adc: ad7124: Really disable all channels at probe time

Uwe Kleine-König <[email protected]>
iio: adc: ad7124: Micro-optimize channel disabling

Javier Carrasco <[email protected]>
iio: light: veml6030: fix scale to conform to ABI

Javier Carrasco <[email protected]>
iio: gts-helper: export iio_gts_get_total_gain()

Javier Carrasco <[email protected]>
iio: light: veml6030: extend regmap to support regfields

Konstantin Komarov <[email protected]>

    fs/ntfs3: Update inode->i_mapping->a_ops on compression state

Ye Bin <[email protected]>
fs/ntfs3: Fix 'proc_info_root' leak when init ntfs failed

Ye Bin <[email protected]>
fs/ntfs3: Factor out ntfs_{create/remove}_proc_root()

Ye Bin <[email protected]>
fs/ntfs3: Factor out ntfs_{create/remove}_procdir()

Ian Rogers <[email protected]>
perf stat: Don't merge counters purely on name

Thomas Richter <[email protected]>
perf test: Fix Hwmon PMU test endianess issue

Angelo Dureghello <[email protected]>
iio: dac: adi-axi-dac: modify stream enable

Benson Leung <[email protected]>
usb: typec: thunderbolt: Remove IS_ERR check for plug

Benson Leung <[email protected]>
usb: typec: thunderbolt: Fix loops that iterate TYPEC_PLUG_SOP_P and TYPEC_PLUG_SOP_PP

Dave Penkler <[email protected]>
staging: gpib: Fix pr_err format warning

Dave Penkler <[email protected]>
staging: gpib: Add missing interface entry point

Chenyuan Yang <[email protected]>
w1: fix NULL pointer dereference in probe

James Clark <[email protected]>
perf: Always feature test reallocarray

Ian Rogers <[email protected]>
perf stat: Fix find_stat for mixed legacy/non-legacy events

Tony Ambardar <[email protected]>
libbpf: Fix accessing BTF.ext core_relo header

Barnabás Czémán <[email protected]>
clk: qcom: mmcc-sdm660: fix stuck video_subcore0 clock

Andy Shevchenko <[email protected]>
pinctrl: intel: Fix wrong bypass assignment in intel_pinctrl_probe_pwm()

Wenkai Lin <[email protected]>
crypto: hisilicon/sec2 - fix for aead auth key length

Wang Liang <[email protected]>
RDMA/core: Fix use-after-free when rename device name

Jann Horn <[email protected]>
x86/dumpstack: Fix inaccurate unwinding from exception stacks due to misplaced assignment

Remi Pommarel <[email protected]>
leds: Fix LED_OFF brightness race

Nikita Zhandarovich <[email protected]>
mfd: sm501: Switch to BIT() to mitigate integer overflows

Manikanta Mylavarapu <[email protected]>
clk: qcom: ipq5424: fix software and hardware flow control error of UART

Fabrizio Castro <[email protected]>
pinctrl: renesas: rzv2m: Fix missing of_node_put() call

Patrisious Haddad <[email protected]>
RDMA/mlx5: Fix mlx5_poll_one() cur_qp update flow

Jiayuan Chen <[email protected]>
bpf: Fix array bounds error with may_goto

Neil Armstrong <[email protected]>
clk: qcom: gcc-sm8650: Do not turn off USB GDSCs during gdsc_disable()

Herbert Xu <[email protected]>
crypto: nx - Fix uninitialised hv_nxc on error

Dario Binacchi <[email protected]>
clk: stm32f4: fix an uninitialized variable

Herbert Xu <[email protected]>
crypto: api - Call crypto_alg_put in crypto_unregister_alg

Artur Weber <[email protected]>
power: supply: max77693: Fix wrong conversion of charge input threshold value

Jann Horn <[email protected]>
x86/entry: Fix ORC unwinder for PUSH_REGS with save_ret=1

Bartosz Golaszewski <[email protected]>
pinctrl: bcm2835: don't -EINVAL on alternate funcs from get_direction()

Jerome Brunet <[email protected]>
clk: amlogic: g12a: fix mmc A peripheral clock

Laurentiu Mihalcea <[email protected]>
clk: clk-imx8mp-audiomix: fix dsp/ocram_a clock parents

Bairavi Alagappan <[email protected]>
crypto: qat - remove access to parity register for QAT GEN4

Jinghao Jia <[email protected]>
samples/bpf: Fix broken vmlinux path for VMLINUX_BTF

Andy Shevchenko <[email protected]>
pinctrl: npcm8xx: Fix incorrect struct npcm8xx_pincfg assignment

Charles Han <[email protected]>
clk: mmp: Fix NULL vs IS_ERR() check

Ian Rogers <[email protected]>
libbpf: Add namespace for errstr making it libbpf_errstr

Nathan Chancellor <[email protected]>
crypto: tegra - Fix format specifier in tegra_sha_prep_cmd()

Alice Ryhl <[email protected]>
rust: fix signature of rust_fmt_argument

Saket Kumar Bhaskar <[email protected]>
selftests/bpf: Select NUMA_NO_NODE to create map

Jerome Brunet <[email protected]>
clk: amlogic: gxbb: drop non existing 32k clock parent

Jerome Brunet <[email protected]>
clk: amlogic: g12b: fix cluster A parent data

Prathamesh Shete <[email protected]>
pinctrl: tegra: Set SFIO mode to Mux Register

Maher Sanalla <[email protected]>
IB/mad: Check available slots before posting receive WRs

Herbert Xu <[email protected]>
crypto: api - Fix larval relookup type and mask

Thomas Weißschuh <[email protected]>
leds: st1202: Check for error code from devm_mutex_init() call

Sicelo A. Mhlongo <[email protected]>
power: supply: bq27xxx_battery: do not update cached flags prematurely

Luca Weiss <[email protected]>
remoteproc: qcom_q6v5_mss: Handle platforms with one power domain

Cheng Xu <[email protected]>
RDMA/erdma: Prevent use-after-free in erdma_accept_newconn()

Chiara Meiohas <[email protected]>
RDMA/mlx5: Fix calculation of total invalidated pages

Roman Gushchin <[email protected]>
RDMA/core: Don't expose hw_counters outside of init net namespace

Peter Geis <[email protected]>
clk: rockchip: rk3328: fix wrong clk_ref_usb3otg parent

Tengda Wu <[email protected]>
selftests/bpf: Fix freplace_link segfault in tailcalls prog test

Michael Guralnik <[email protected]>
RDMA/mlx5: Fix MR cache initialization error flow

Fabrizio Castro <[email protected]>
pinctrl: renesas: rzg2l: Fix missing of_node_put() call

Fabrizio Castro <[email protected]>
pinctrl: renesas: rza2: Fix missing of_node_put() call

Tanya Agarwal <[email protected]>
lib: 842: Improve error handling in sw842_compress()

Hou Tao <[email protected]>
bpf: Use preempt_count() directly in bpf_send_signal_common()

Akhil R <[email protected]>
crypto: tegra - Reserve keyslots to allocate dynamically

Akhil R <[email protected]>
crypto: tegra - finalize crypto req on error

Konrad Dybcio <[email protected]>

    clk: qcom: gcc-x1e80100: Unregister GCC_GPU_CFG_AHB_CLK/GCC_DISP_XO_CLK

Luca Weiss <[email protected]>
remoteproc: qcom_q6v5_pas: Use resource with CX PD for MSM8226

Akhil R <[email protected]>
crypto: tegra - Set IV to NULL explicitly for AES ECB

Kees Bakker <[email protected]>
RDMA/mana_ib: Ensure variable err is initialized

Niklas Schnelle <[email protected]>
s390: Remove ioremap_wt() and pgprot_writethrough()

Tony Ambardar <[email protected]>
selftests/bpf: Fix runqslower cross-endian build

Vladimir Lypak <[email protected]>
clk: qcom: gcc-msm8953: fix stuck venus0_core0 clock

Akhil R <[email protected]>
crypto: tegra - Fix CMAC intermediate result handling

Yue Haibing <[email protected]>
pinctrl: nuvoton: npcm8xx: Fix error handling in npcm8xx_gpio_fw()

Will McVicker <[email protected]>
clk: samsung: Fix UBSAN panic in samsung_clk_init()

Luca Weiss <[email protected]>
remoteproc: qcom: pas: add minidump_id to SC7280 WPSS

Claudiu Beznea <[email protected]>
clk: renesas: r8a08g045: Check the source of the CPU PLL settings

David Hildenbrand <[email protected]>
x86/mm/pat: Fix VM_PAT handling when fork() fails in copy_page_range()

Viktor Malik <[email protected]>
selftests/bpf: Fix string read in strncmp benchmark

Manikanta Mylavarapu <[email protected]>
drivers: clk: qcom: ipq5424: fix the freq table of sdcc1_apps clock

Andrii Nakryiko <[email protected]>
libbpf: Fix hypothetical STT_SECTION extern NULL deref case

Luca Weiss <[email protected]>
remoteproc: qcom_q6v5_pas: Make single-PD handling more robust

Claudiu Beznea <[email protected]>
pinctrl: renesas: rzg2l: Suppress binding attributes

Zijun Hu <[email protected]>
of: property: Increase NR_FWNODE_REFERENCE_ARGS

Peng Fan <[email protected]>
remoteproc: core: Clear table_sz when rproc_shutdown

Michael Guralnik <[email protected]>
RDMA/mlx5: Fix page_size variable overflow

Wenkai Lin <[email protected]>
crypto: hisilicon/sec2 - fix for sec spec check

Wenkai Lin <[email protected]>
crypto: hisilicon/sec2 - fix for aead authsize alignment

Jerome Brunet <[email protected]>
clk: amlogic: gxbb: drop incorrect flag on 32k clock

Akhil R <[email protected]>
crypto: tegra - Use HMAC fallback when keyslots are full

Arnd Bergmann <[email protected]>
crypto: bpf - Add MODULE_DESCRIPTION for skcipher

Akhil R <[email protected]>
crypto: tegra - Fix HASH intermediate result handling

Akhil R <[email protected]>
crypto: tegra - Transfer HASH init function to crypto engine

Akhil R <[email protected]>
crypto: tegra - check return value for hash do_one_req

Akhil R <[email protected]>
crypto: tegra - Do not use fixed size buffers

Akhil R <[email protected]>
crypto: tegra - Use separate buffer for setkey

Bairavi Alagappan <[email protected]>

    crypto: qat - set parity error mask for qat_420xx

Herbert Xu <[email protected]>
crypto: iaa - Test the correct request flag

Danila Chernetsov <[email protected]>
fbdev: sm501fb: Add some geometry checks.

Arnd Bergmann <[email protected]>
mdacon: rework dependency list

Arnd Bergmann <[email protected]>
dummycon: fix default rows/cols

Markus Elfring <[email protected]>
fbdev: au1100fb: Move a variable assignment behind a null pointer check

Pavel Begunkov <[email protected]>
io_uring: fix retry handling off iowq

Caleb Sander Mateos <[email protected]>
io_uring: use lockless_cq flag in io_req_complete_post()

Shay Drory <[email protected]>
PCI: Fix NULL dereference in SR-IOV VF creation error path

Caleb Sander Mateos <[email protected]>
io_uring/net: only import send_zc buffer once

Ilpo Järvinen <[email protected]>
PCI/bwctrl: Fix pcie_bwctrl_select_speed() return type

Ilpo Järvinen <[email protected]>
PCI: pciehp: Don't enable HPIE when resuming in poll mode

Alex Deucher <[email protected]>
drm/amdgpu/mes: enable compute pipes across all MEC

Alex Deucher <[email protected]>
drm/amdgpu/mes: optimize compute loop handling

Ilpo Järvinen <[email protected]>
PCI: Fix BAR resizing when VF BARs are assigned

Christophe JAILLET <[email protected]>
PCI: histb: Fix an error handling path in histb_pcie_probe()

Dan Carpenter <[email protected]>
PCI: dwc: ep: Return -ENOMEM for allocation failures

Thadeu Lima de Souza Cascardo <[email protected]>
drm/amd/display: avoid NPD when ASIC does not support DMUB

Dan Carpenter <[email protected]>
drm/mediatek: dsi: fix error codes in mtk_dsi_host_transfer()

Douglas Anderson <[email protected]>
drm/mediatek: dp: drm_err => dev_err in HPD path to avoid NULL ptr

Jason-JH Lin <[email protected]>
drm/mediatek: Fix config_updating flag never false when no mbox channel

Thippeswamy Havalige <[email protected]>
PCI: xilinx-cpm: Fix IRQ domain leak in error path of probe

Dan Carpenter <[email protected]>
PCI: Remove stray put_device() in pci_register_host_bridge()

Christophe Leroy <[email protected]>
powerpc/kexec: fix physical address calculation in clear_utlb_entry()

Christophe Leroy <[email protected]>
crypto: powerpc: Mark ghashp8-ppc.o as an OBJECT_FILES_NON_STANDARD

Niklas Cassel <[email protected]>
PCI: endpoint: pci-epf-test: Handle endianness properly

Niklas Cassel <[email protected]>
misc: pci_endpoint_test: Handle BAR sizes larger than INT_MAX

Niklas Cassel <[email protected]>
misc: pci_endpoint_test: Fix pci_endpoint_test_bars_read_bar() error handling

Vaibhav Jain <[email protected]>
powerpc/perf: Fix ref-counting on the PMU 'vpa_pmu'

Rob Clark <[email protected]>
drm/msm/a6xx: Fix a6xx indexed-regs in devcoreduump

Vitaliy Shevtsov <[email protected]>
drm/amd/display: fix type mismatch in CalculateDynamicMetadataParameters()

Steven Price <[email protected]>
drm/panthor: Clean up FW version information display

Adrián Larumbe <[email protected]>
drm/panthor: Avoid sleep locking in the internal BO size path

Adrián Larumbe <[email protected]>
drm/panthor: Replace sleep locks with spinlocks in fdinfo path

Adrián Larumbe <[email protected]>
drm/panthor: Expose size of driver internal BO's over fdinfo

Adrián Larumbe <[email protected]>
drm/file: Add fdinfo helper for printing regions with prefix

Ashley Smith <[email protected]>
drm/panthor: Update CS_STATUS_ defines to correct values

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: don't set crtc_state->mode_changed from atomic_check()

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: simplify dpu_encoder_get_topology() interface

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: move needs_cdm setting to dpu_encoder_get_topology()

Nishanth Aravamudan <[email protected]>
PCI: Avoid reset when disabled via sysfs

Feng Tang <[email protected]>
PCI/portdrv: Only disable pciehp interrupts early when needed

Yi Lai <[email protected]>
selftests/pcie_bwctrl: Add 'set_pcie_speed.sh' to TEST_PROGS

Jim Quinlan <[email protected]>
PCI: brcmstb: Fix potential premature regulator disabling

Jim Quinlan <[email protected]>
PCI: brcmstb: Fix error path after a call to regulator_bulk_get()

Jim Quinlan <[email protected]>
PCI: brcmstb: Use internal register to change link capability

Jim Quinlan <[email protected]>
PCI: brcmstb: Set generation limit before PCIe link up

Hans Zhang <[email protected]>
PCI: cadence-ep: Fix the driver to send MSG TLP for INTx without data payload

Lorenzo Bianconi <[email protected]>
PCI: mediatek-gen3: Configure PBUS_CSR registers for EN7581 SoC

Srinivasan Shanmugam <[email protected]>
drm/amdkfd: Fix Circular Locking Dependency in 'svm_range_cpu_invalidate_pagetables'

Dan Carpenter <[email protected]>
drm/msm/gem: Fix error code msm_parse_deps()

Marijn Suijten <[email protected]>
drm/msm/dpu: Remove arbitrary limit of 1 interface in DSC topology

Marijn Suijten <[email protected]>
drm/msm/dpu: Fall back to a single DSC encoder (1:1:1) on small SoCs

Marijn Suijten <[email protected]>
drm/msm/dsi: Set PHY usescase (and mode) before registering DSI host

Marijn Suijten <[email protected]>
drm/msm/dsi: Use existing per-interface slice count in DSC timing

Krzysztof Kozlowski <[email protected]>
drm/msm/dsi/phy: Program clock inverters in correct register

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: don't use active in atomic_check()

Aurabindo Pillai <[email protected]>
drm/amd/display: fix an indent issue in DML21

Tushar Dave <[email protected]>
PCI/ACS: Fix 'pci=config_acs=' parameter

John Keeping <[email protected]>
drm/panel: ilitek-ili9882t: fix GPIO name in error message

Daniel Stodden <[email protected]>
PCI/ASPM: Fix link state exit during switch upstream function removal

Srinivasan Shanmugam <[email protected]>
drm/amdgpu: Replace Mutex with Spinlock for RLCG register access to avoid Priority Inversion in SRIOV

AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_hdmi: Fix typo for aud_sampe_size member

AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_hdmi: Unregister audio platform device on failure

Ilpo Järvinen <[email protected]>
PCI: Allow relaxed bridge window tail sizing for optional resources

Ilpo Järvinen <[email protected]>
PCI: Simplify size1 assignment logic

Ilpo Järvinen <[email protected]>
PCI: Remove add_align overwrite unrelated to size0

Kai-Heng Feng <[email protected]>
PCI: Use downstream bridges for distributing resources

Alex Deucher <[email protected]>
drm/amdgpu/vcn5.0.1: use correct dpm helper

Alex Deucher <[email protected]>
drm/amdgpu/umsch: fix ucode check

Alex Deucher <[email protected]>
drm/amdgpu/umsch: declare umsch firmware

Saleemkhan Jamadar <[email protected]>
drm/amdgpu/umsch: remove vpe test from umsch

Yang Wang <[email protected]>
drm/amdgpu: refine smu send msg debug log format

Vitalii Mordan <[email protected]>

    gpu: cdns-mhdp8546: fix call balance of mhdp->clk handling routines

José Expósito <[email protected]>
drm/vkms: Fix use after free and double free on init error

Bart Van Assche <[email protected]>
drm: zynqmp_dp: Fix a deadlock in zynqmp_dp_ignore_hpd_set()

Charles Han <[email protected]>
drm: xlnx: zynqmp_dpsub: Add NULL check in zynqmp_audio_init

Tomi Valkeinen <[email protected]>
drm: xlnx: zynqmp: Fix max dma segment size

Adrián Larumbe <[email protected]>
drm/panthor: Fix race condition when gathering fdinfo group samples

Hermes Wu <[email protected]>
drm/bridge: it6505: fix HDCP V match check is not performed correctly

Wayne Lin <[email protected]>
drm/dp_mst: Fix drm RAD print

John Keeping <[email protected]>

    drm/ssd130x: ensure ssd132x pitch is correct

John Keeping <[email protected]>

    drm/ssd130x: fix ssd132x encoding

Boris Brezillon <[email protected]>
drm/panthor: Fix a race between the reset and suspend path

Lizhi Hou <[email protected]>
accel/amdxdna: Return error when setting clock failed for npu1

Javier Martinez Canillas <[email protected]>

    drm/ssd130x: Set SPI .id_table to prevent an SPI core warning

Geert Uytterhoeven <[email protected]>
drm/bridge: ti-sn65dsi86: Fix multiple instances

Jann Horn <[email protected]>
rwonce: fix crash by removing READ_ONCE() for unaligned read

Jiawen Wu <[email protected]>
net: libwx: fix Tx L4 checksum

Jiawen Wu <[email protected]>
net: libwx: fix Tx descriptor content for some tunnel packets

Pranjal Shrivastava <[email protected]>
net: Fix the devmem sock opts and msgs for parisc

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_event: Fix handling of HCI_EV_LE_DIRECT_ADV_REPORT

Neeraj Sanjay Kale <[email protected]>
Bluetooth: btnxpuart: Fix kernel panic during FW release

Oleksij Rempel <[email protected]>
net: dsa: microchip: fix DCB apptrust configuration on KSZ88x3

Jann Horn <[email protected]>
rwonce: handle KCSAN like KASAN in read_word_at_a_time()

Wentao Guan <[email protected]>
Bluetooth: HCI: Add definition of hci_rp_remote_name_req_cancel

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_core: Enable buffer flow control for SCO/eSCO

Pedro Nishiyama <[email protected]>
Bluetooth: btusb: Fix regression in the initialization of fake Bluetooth controllers

Pedro Nishiyama <[email protected]>
Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE

Pedro Nishiyama <[email protected]>
Bluetooth: Add quirk for broken READ_VOICE_SETTING

Akihiko Odaki <[email protected]>
virtio_net: Fix endian with virtio_net_ctrl_rss

Wang Liang <[email protected]>
net: fix NULL pointer dereference in l3mdev_l3_rcv

Nick Child <[email protected]>
ibmvnic: Use kernel helpers for hex dumps

Wang Liang <[email protected]>
bonding: check xdp prog when set bond mode

Sankararaman Jayaraman <[email protected]>
vmxnet3: unregister xdp rxq info in the reset path

Moshe Shemesh <[email protected]>
net/mlx5: Start health poll after enable hca

Mark Bloch <[email protected]>
net/mlx5: LAG, reload representors on LAG creation failure

Vladimir Oltean <[email protected]>
net: dsa: sja1105: fix kasan out-of-bounds warning in sja1105_table_delete_entry()

Vladimir Oltean <[email protected]>
net: dsa: sja1105: reject other RX filters than HWTSTAMP_FILTER_PTP_V2_L2_EVENT

Vladimir Oltean <[email protected]>
net: dsa: sja1105: fix displaced ethtool statistics counters

WangYuli <[email protected]>
mlxsw: spectrum_acl_bloom_filter: Workaround for some LLVM versions

Marek Behún <[email protected]>
net: dsa: mv88e6xxx: enable STU methods for 6320 family

Marek Behún <[email protected]>
net: dsa: mv88e6xxx: fix VTU methods for 6320 family

Marek Behún <[email protected]>
net: dsa: mv88e6xxx: enable .port_set_policy() for 6320 family

Marek Behún <[email protected]>
net: dsa: mv88e6xxx: enable PVT for 6321 switch

Marek Behún <[email protected]>
net: dsa: mv88e6xxx: fix atu_move_port_mask for 6341 family

Michael Chan <[email protected]>
bnxt_en: Linearize TX SKB if the fragments exceed the max

Michael Chan <[email protected]>
bnxt_en: Mask the bd_cnt field in the TX BD properly

Maxim Mikityanskiy <[email protected]>
net/mlx5e: Fix ethtool -N flow-type ip4 to RSS context

Murad Masimov <[email protected]>
ax25: Remove broken autobind

WangYuli <[email protected]>
netfilter: nf_tables: Only use nf_skip_indirect_calls() when MITIGATION_RETPOLINE

Chenyuan Yang <[email protected]>
netfilter: nfnetlink_queue: Initialize ctx to avoid memory allocation error

Kuniyuki Iwashima <[email protected]>
net: Remove RTNL dance for SIOCBRADDIF and SIOCBRDELIF.

Taehee Yoo <[email protected]>
eth: bnxt: fix out-of-range access of vnic_info array

Ojaswin Mujoo <[email protected]>
ext4: avoid journaling sb update on error if journal is destroying

Ojaswin Mujoo <[email protected]>
ext4: define ext4_journal_destroy wrapper

Zhang Yi <[email protected]>
jbd2: add a missing data flush during file and fs synchronization

Niklas Cassel <[email protected]>
nvmet: pci-epf: Always configure BAR0 as 64-bit

Jacob Keller <[email protected]>
ptp: ocp: reject unsupported periodic output flags

Jacob Keller <[email protected]>
broadcom: fix supported flag check in periodic output function

Jacob Keller <[email protected]>
net: lan743x: reject unsupported external timestamp requests

Jacob Keller <[email protected]>
renesas: reject PTP_STRICT_FLAGS as unsupported

Jacob Keller <[email protected]>
igb: reject invalid external timestamp requests for 82580-based HW

Nikita Zhandarovich <[email protected]>
wifi: mt76: mt7915: fix possible integer overflows in mt7915_muru_stats_show()

Mark Harmstone <[email protected]>
btrfs: don't clobber ret in btrfs_validate_super()

Boris Burkov <[email protected]>
btrfs: fix block group refcount race in btrfs_create_pending_block_groups()

Filipe Manana <[email protected]>
btrfs: fix reclaimed bytes accounting after automatic block group reclaim

Filipe Manana <[email protected]>
btrfs: get used bytes while holding lock at btrfs_reclaim_bgs_work()

Emil Tantilov <[email protected]>
idpf: check error for register_netdev() on init

Mateusz Polchlopek <[email protected]>
ice: fix using untrusted value of pkt_len in ice_vc_fdir_parse_raw()

Lukasz Czapnik <[email protected]>
ice: fix input validation for virtchnl BW

Jan Glaza <[email protected]>
ice: validate queue quanta parameters to prevent OOB access

Jan Glaza <[email protected]>
ice: stop truncating queue ids when checking

Jan Glaza <[email protected]>
virtchnl: make proto and filter action count unsigned

Jesse Brandeburg <[email protected]>
ice: fix reservation of resources for RDMA when disabled

Karol Kolacinski <[email protected]>
ice: ensure periodic output start time is in the future

Przemek Kitszel <[email protected]>
ice: health.c: fix compilation on gcc 7.5

Jeff Chen <[email protected]>
wifi: mwifiex: Fix RF calibration data download from file

Jeff Chen <[email protected]>
wifi: mwifiex: Fix premature release of RF calibration data.

Edward Adam Davis <[email protected]>
wifi: cfg80211: init wiphy_work before allocating rfkill fails

Mikhail Lobanov <[email protected]>
wifi: mac80211: check basic rates validity in sta_link_apply_parameters

Aditya Kumar Singh <[email protected]>
wifi: nl80211: store chandef on the correct link when starting CAC

Niklas Cassel <[email protected]>
ata: libata: Fix NCQ Non-Data log not supported print

Zhang Yi <[email protected]>
jbd2: fix off-by-one while erasing journal

Baokun Li <[email protected]>
ext4: goto right label 'out_mmap_sem' in ext4_setattr()

Ye Bin <[email protected]>
ext4: fix out-of-bound read in ext4_xattr_inode_dec_ref_all()

Ye Bin <[email protected]>
ext4: introduce ITAIL helper

Guixin Liu <[email protected]>
scsi: target: tcm_loop: Fix wrong abort tag

Xingui Yang <[email protected]>
scsi: hisi_sas: Fixed failure to issue vendor specific commands

Chunhai Guo <[email protected]>
f2fs: fix missing discard for active segments

Jan Kara <[email protected]>
ext4: verify fast symlink length

Kemeng Shi <[email protected]>
ext4: add missing brelse() for bh2 in ext4_dx_add_entry()

Gao Xiang <[email protected]>
erofs: allow 16-byte volume name again

Nicolas Frattaroli <[email protected]>
arm64: dts: rockchip: remove ethm0_clk0_25m_out from Sige5 gmac0

Yao Zi <[email protected]>
arm64: dts: rockchip: Fix PWM pinctrl names

Jianfeng Liu <[email protected]>
arm64: dts: rockchip: Fix pcie reset gpio on Orange Pi 5 Max

Christophe JAILLET <[email protected]>
bus: qcom-ssc-block-bus: Fix the error handling path of qcom_ssc_block_bus_probe()

Christophe JAILLET <[email protected]>
bus: qcom-ssc-block-bus: Remove some duplicated iounmap() calls

Chen-Yu Tsai <[email protected]>
arm64: dts: rockchip: Remove bluetooth node from rock-3a

Chukun Pan <[email protected]>
arm64: dts: rockchip: Move rk356x scmi SHMEM to reserved memory

Baokun Li <[email protected]>
ext4: show 'emergency_ro' when EXT4_FLAGS_EMERGENCY_RO is set

Baokun Li <[email protected]>
ext4: correct behavior under errors=remount-ro mode

Baokun Li <[email protected]>
ext4: add EXT4_FLAGS_EMERGENCY_RO bit

Baokun Li <[email protected]>
ext4: convert EXT4_FLAGS_* defines to enum

Charles Han <[email protected]>
ext4: fix potential null dereference in ext4 kunit test

Ming Lei <[email protected]>
block: fix adding folio to bio

Chao Yu <[email protected]>
f2fs: fix to avoid running out of free segments

Johannes Berg <[email protected]>
wifi: mac80211: remove SSID from ML reconf

Robin Murphy <[email protected]>
iommu: Handle race with default domain setup

Chao Yu <[email protected]>
f2fs: fix to avoid accessing uninitialized curseg

Laurentiu Mihalcea <[email protected]>
arm64: dts: imx8mp: change AUDIO_AXI_CLK_ROOT freq. to 800MHz

Laurentiu Mihalcea <[email protected]>
arm64: dts: imx8mp: add AUDIO_AXI_CLK_ROOT to AUDIOMIX block

Max Merchel <[email protected]>
ARM: dts: imx6ul-tqma6ul1: Change include order to disable fec2 node

Andreas Gruenbacher <[email protected]>
gfs2: skip if we cannot defer delete

Andreas Gruenbacher <[email protected]>
gfs2: minor evict fix

Xueqi Zhang <[email protected]>
memory: mtk-smi: Add ostd setting for mt8192

Yunhui Cui <[email protected]>
iommu/vt-d: Fix system hang on reboot -f

Vasant Hegde <[email protected]>
iommu/amd: Fix header file

Lorenzo Bianconi <[email protected]>
net: airoha: Fix lan4 support in airoha_qdma_get_gdm_port()

Arnd Bergmann <[email protected]>
firmware: arm_scmi: use ioread64() instead of ioread64_hi_lo()

Zheng Qixing <[email protected]>
badblocks: use sector_t instead of int to avoid truncation of badblocks length

Zheng Qixing <[email protected]>
badblocks: return boolean from badblocks_set() and badblocks_clear()

Shin'ichiro Kawasaki <[email protected]>
null_blk: do partial IO for bad blocks

Shin'ichiro Kawasaki <[email protected]>
null_blk: replace null_process_cmd() call in null_zone_write()

Shin'ichiro Kawasaki <[email protected]>
null_blk: introduce badblocks_once parameter

Shin'ichiro Kawasaki <[email protected]>
null_blk: generate null_blk configfs features string

Zheng Qixing <[email protected]>
badblocks: fix missing bad blocks on retry in _badblocks_check()

Li Nan <[email protected]>
badblocks: fix merge issue when new badblocks align with pre+1

Li Nan <[email protected]>
badblocks: fix the using of MAX_BADBLOCKS

Li Nan <[email protected]>
badblocks: return error if any badblock set fails

Li Nan <[email protected]>
badblocks: return error directly when setting badblocks exceeds 512

Li Nan <[email protected]>
badblocks: attempt to merge adjacent badblocks during ack_all_badblocks

Li Nan <[email protected]>
badblocks: factor out a helper try_adjacent_combine

Li Nan <[email protected]>
badblocks: Fix error shitf ops

Anuj Gupta <[email protected]>
block: Correctly initialize BLK_INTEGRITY_NOGENERATE and BLK_INTEGRITY_NOVERIFY

Anuj Gupta <[email protected]>
block: ensure correct integrity capability propagation in stacked devices

Xiao Ni <[email protected]>
md/raid10: wait barrier before returning discard request with REQ_NOWAIT

AngeloGioacchino Del Regno <[email protected]>
soc: mediatek: mt8365-mmsys: Fix routing table masks and values

AngeloGioacchino Del Regno <[email protected]>
soc: mediatek: mt8167-mmsys: Fix missing regval in all entries

AngeloGioacchino Del Regno <[email protected]>
soc: mediatek: mtk-mmsys: Fix MT8188 VDO1 DPI1 output selection

Yu Kuai <[email protected]>
blk-throttle: fix lower bps rate by throtl_trim_slice()

Ping-Ke Shih <[email protected]>
wifi: rtw89: pci: correct ISR RDU bit for 8922AE

Ping-Ke Shih <[email protected]>
wifi: rtw89: fw: correct debug message format in rtw89_build_txpwr_trk_tbl_from_elm()

Michael Walle <[email protected]>
arm64: dts: ti: k3-j722s: fix pinctrl settings

Michael Walle <[email protected]>
arm64: dts: ti: k3-am62p: fix pinctrl settings

Francesco Dolcini <[email protected]>
arm64: dts: ti: k3-am62p: Enable AUDIO_REFCLKx

Tomas Glozar <[email protected]>
tools/rv: Keep user LDFLAGS in build

Gabriele Monaco <[email protected]>
tracing: Fix DECLARE_TRACE_CONDITION

Su Yue <[email protected]>
md/md-bitmap: fix wrong bitmap_limit for clustermd when write sb

Yu Kuai <[email protected]>
md/raid1,raid10: don't ignore IO flags

Yu Kuai <[email protected]>
md: fix mddev uaf while iterating all_mddevs list

Chao Yu <[email protected]>
f2fs: fix to call f2fs_recover_quota_end() correctly

Chao Yu <[email protected]>
f2fs: fix potential deadloop in prepare_compress_overwrite()

Stefan Eichenberger <[email protected]>
arm64: dts: ti: k3-am62-verdin-dahlia: add Microphone Jack to sound card

Leo Stone <[email protected]>
f2fs: add check for deleted inode

Chao Yu <[email protected]>
f2fs: fix to set .discard_granularity correctly

Manivannan Sadhasivam <[email protected]>
wifi: ath12k: Clear affinity hint before calling ath12k_pci_free_irq() in error path

Manivannan Sadhasivam <[email protected]>
wifi: ath11k: Clear affinity hint before calling ath11k_pcic_free_irq() in error path

Louis-Alexis Eyraud <[email protected]>
arm64: dts: mediatek: mt8390-genio-common: Fix duplicated regulator name

Louis-Alexis Eyraud <[email protected]>
arm64: dts: mediatek: mt8390-genio-700-evk: Move common parts to dtsi

Ahmad Fatoum <[email protected]>
arm64: dts: imx8mp-skov: operate CPU at 850 mV by default

Ahmad Fatoum <[email protected]>
arm64: dts: imx8mp-skov: correct PMIC board limits

Baochen Qiang <[email protected]>
wifi: ath12k: use link specific bss_conf as well in ath12k_mac_vif_cache_flush()

Hrushikesh Salunke <[email protected]>

    arm64: dts: ti: k3-j722s-evm: Fix USB2.0_MUX_SEL to select Type-C

Sudeep Holla <[email protected]>
firmware: arm_ffa: Skip the first/partition ID when parsing vCPU list

Geert Uytterhoeven <[email protected]>
arm64: dts: renesas: r8a77990: Re-add voltages to OPP table

Geert Uytterhoeven <[email protected]>
arm64: dts: renesas: r8a774c0: Re-add voltages to OPP table

Sudeep Holla <[email protected]>
firmware: arm_ffa: Explicitly cast return value from NOTIFICATION_INFO_GET

Sudeep Holla <[email protected]>
firmware: arm_ffa: Explicitly cast return value from FFA_VERSION before comparison

Asahi Lina <[email protected]>
iommu/io-pgtable-dart: Only set subpage protection disable for DART 1

Leon Romanovsky <[email protected]>
xfrm: delay initialization of offload path till its actually requested

Dmitry Antipov <[email protected]>
wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps

Nicolas Escande <[email protected]>
wifi: ath12k: Add missing htt_metadata flag in ath12k_dp_tx()

Vasiliy Kovalev <[email protected]>
jfs: add check read-only before truncation in jfs_truncate_nolock()

Vasiliy Kovalev <[email protected]>
jfs: add check read-only before txBeginAnon() call

Dmitry Antipov <[email protected]>
jfs: reject on-disk inodes of an unsupported type

Robin van der Gracht <[email protected]>
can: rockchip_canfd: rkcanfd_chip_fifo_setup(): remove duplicated setup of RX FIFO

Bart Van Assche <[email protected]>
scsi: mpt3sas: Fix a locking bug in an error path

Bart Van Assche <[email protected]>
scsi: mpi3mr: Fix locking in an error path

Macpaul Lin <[email protected]>
arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec

Sudeep Holla <[email protected]>
firmware: arm_ffa: Unregister the FF-A devices when cleaning up the partitions

Viresh Kumar <[email protected]>
firmware: arm_ffa: Refactor addition of partition information into XArray

Jens Axboe <[email protected]>
io_uring/net: improve recv bundles

Pavel Begunkov <[email protected]>
io_uring: check for iowq alloc_workqueue failure

Max Kellermann <[email protected]>
io_uring/io-wq: do not use bogus hash value

Max Kellermann <[email protected]>

    io_uring/io-wq: cache work->flags in variable

Max Kellermann <[email protected]>
io_uring/io-wq: eliminate redundant io_work_get_acct() calls

Nicolas Bouchinet <[email protected]>
coredump: Fixes core_pipe_limit sysctl proc_handler

Zheng Qixing <[email protected]>
md/raid1: fix memory leak in raid1_run() if no active rdev

Li Nan <[email protected]>
md: ensure resync is prioritized over recovery

Paul Menzel <[email protected]>
scsi: mpt3sas: Reduce log level of ignore_delay_remove message to KERN_INFO

Chao Yu <[email protected]>
f2fs: fix to avoid panic once fallocation fails for pinfile

Bart Van Assche <[email protected]>
wifi: ath12k: Fix locking in "QMI firmware ready" error paths

Kang Yang <[email protected]>

    wifi: ath11k: add srng->lock for ath11k_hal_srng_* in monitor mode

P Praneesh <[email protected]>
wifi: ath11k: fix RCU stall while reaping monitor destination ring

Thadeu Lima de Souza Cascardo <[email protected]>
dlm: prevent NPD when writing a positive value to event_done

Chao Yu <[email protected]>
f2fs: quota: fix to avoid warning in dquot_writeback_dquots()

Tom Rini <[email protected]>
ARM: dts: omap4-panda-a4: Add missing model and compatible properties

Wen Gong <[email protected]>
wifi: ath11k: update channel list in reg notifier instead reg worker

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173: Fix some node names

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Drop pmic's #address-cells and #size-cells

Yu Zhang(Yuriy) <[email protected]>
wifi: ath11k: fix wrong overriding for VHT Beamformee STS Capability

Dmitry Antipov <[email protected]>
wifi: ath9k: do not submit zero bytes to the entropy pool

Rameshkumar Sundaram <[email protected]>
wifi: ath12k: Fix pdev lookup in WBM error processing

Sathishkumar Muruganandam <[email protected]>
wifi: ath12k: encode max Tx power in scan channel list command

Nicolas Escande <[email protected]>
wifi: ath12k: fix skb_ext_desc leak in ath12k_dp_tx() error path

Liang Jie <[email protected]>
wifi: rtw89: Correct immediate cfg_len calculation for scan_offload_be

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Fix built-in mic assignment on ASUS VivoBook X515UA

Takashi Iwai <[email protected]>
ALSA: timer: Don't take register_mutex with copy_from/to_user()

Olivia Mackintosh <[email protected]>
ALSA: usb-audio: separate DJM-A9 cap lvl options

Jayesh Choudhary <[email protected]>
ASoC: ti: j721e-evm: Fix clock configuration for ti,j7200-cpb-audio compatible

Ritu Chaudhary <[email protected]>
ASoC: tegra: Use non-atomic timeout for ADX status register

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Always honor no_shutup_pins

Maud Spierings <[email protected]>
dt-bindings: vendor-prefixes: add GOcontroll

Kuninori Morimoto <[email protected]>
ASoC: simple-card-utils: Don't use __free(device_node) at graph_util_parse_dai()

Jiri Kosina <[email protected]>
HID: remove superfluous (and wrong) Makefile entry for CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER

Venkata Prasad Potturu <[email protected]>
ASoC: amd: acp: Fix for enabling DMIC on acp platforms via _DSD entry

Vitaliy Shevtsov <[email protected]>
ASoC: cs35l41: check the return value from spi_setup()

Armin Wolf <[email protected]>
platform/x86: dell-ddv: Fix temperature calculation

Ilpo Järvinen <[email protected]>
platform/x86: dell-uart-backlight: Make dell_uart_bl_serdev_driver static

Ilpo Järvinen <[email protected]>
platform/x86: lenovo-yoga-tab2-pro-1380-fastcharger: Make symbol static

Andy Shevchenko <[email protected]>
auxdisplay: panel: Fix an API misuse in panel.c

Joe Hattori <[email protected]>
media: platform: allgro-dvt: unregister v4l2_device on the error path

Benjamin Gaignard <[email protected]>
media: verisilicon: HEVC: Initialize start_bit field

Geert Uytterhoeven <[email protected]>
auxdisplay: MAX6959 should select BITREVERSE

Frieder Schrempf <[email protected]>
regulator: pca9450: Fix enable register for LDO5

Atish Patra <[email protected]>
RISC-V: KVM: Teardown riscv specific bits after kvm_exit

Vitaly Kuznetsov <[email protected]>
x86/entry: Add __init to ia32_emulation_override_cmdline()

Chao Gao <[email protected]>
x86/fpu/xstate: Fix inconsistencies in guest FPU xfeatures

Josh Poimboeuf <[email protected]>
x86/traps: Make exc_double_fault() consistently noreturn

Juri Lelli <[email protected]>
sched/deadline: Rebuild root domain accounting after every update

Juri Lelli <[email protected]>
sched/deadline: Generalize unique visiting of root domains

Juri Lelli <[email protected]>
sched/topology: Wrappers for sched_domains_mutex

Juri Lelli <[email protected]>
sched/deadline: Ignore special tasks when rebuilding domains

Kan Liang <[email protected]>
perf/x86/lbr: Fix shorter LBRs call stacks for the system-wide mode

Kan Liang <[email protected]>
perf: Supply task information to sched_task()

Kan Liang <[email protected]>
perf: Save PMU specific data in task_struct

Tao Chen <[email protected]>
perf/ring_buffer: Allow the EPOLLRDNORM flag for poll

Jacky Bai <[email protected]>
cpufreq: Init cpufreq only for present CPUs

Sebastian Andrzej Siewior <[email protected]>
lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()

Rafael J. Wysocki <[email protected]>
PM: sleep: Fix handling devices with direct_complete set on errors

Chenyuan Yang <[email protected]>

    thermal: int340x: Add NULL check for adev

Jacky Bai <[email protected]>
cpuidle: Init cpuidle only for present CPUs

James Morse <[email protected]>
x86/resctrl: Fix allocation of cleanest CLOSID on platforms with no monitors

Suzuki K Poulose <[email protected]>
arm64: realm: Use aliased addresses for device DMA to shared buffers

Suzuki K Poulose <[email protected]>
dma: Introduce generic dma_addr_*crypted helpers

Suzuki K Poulose <[email protected]>
dma: Fix encryption bit clearing for dma_to_phys

Qiuxu Zhuo <[email protected]>

    EDAC/ie31200: Fix the error path order of ie31200_init()

Qiuxu Zhuo <[email protected]>
EDAC/ie31200: Fix the DIMM size mask for several SoCs

Qiuxu Zhuo <[email protected]>
EDAC/ie31200: Fix the size of EDAC_MC_LAYER_CHIP_SELECT layer

Tim Schumacher <[email protected]>
selinux: Chain up tool resolving errors in install_policy.sh

Maksim Davydov <[email protected]>
x86/split_lock: Fix the delayed detection logic

Li Huafei <[email protected]>
watchdog/hardlockup/perf: Fix perf_event memory leak

Kees Cook <[email protected]>
kunit/stackinit: Use fill byte different from Clang i386 pattern

Atish Patra <[email protected]>
RISC-V: KVM: Disable the kernel perf counter during configure

Aaron Kling <[email protected]>
cpufreq: tegra194: Allow building for Tegra234

Rafael J. Wysocki <[email protected]>
PM: sleep: Adjust check before setting power.must_resume

Peter Zijlstra <[email protected]>

    lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock

Kevin Loughlin <[email protected]>
x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()

Arnd Bergmann <[email protected]>
x86/platform: Only allow CONFIG_EISA for 32-bit

Michael Jeanson <[email protected]>
rseq: Update kernel fields in lockstep with CONFIG_DEBUG_RSEQ=y

Benjamin Berg <[email protected]>
x86/fpu: Avoid copying dynamic FP state from init_task in arch_dup_task_struct()

Dhananjay Ugwekar <[email protected]>
cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update

Dhananjay Ugwekar <[email protected]>
cpufreq/amd-pstate: Convert all perf values to u8

Dhananjay Ugwekar <[email protected]>
cpufreq/amd-pstate: Pass min/max_limit_perf as min/max_perf to amd_pstate_update

Dhananjay Ugwekar <[email protected]>
cpufreq/amd-pstate: Modify the min_perf calculation in adjust_perf callback

Stanislav Spassov <[email protected]>
x86/fpu: Fix guest FPU state buffer allocation size

Thomas Weißschuh <[email protected]>
x86/vdso: Fix latent bug in vclock_pages calculation

Qiuxu Zhuo <[email protected]>
EDAC/{skx_common,i10nm}: Fix some missing error reports on Emerald Rapids

Qiuxu Zhuo <[email protected]>
EDAC/igen6: Fix the flood of invalid error reports

Jie Zhan <[email protected]>
cpufreq: governor: Fix negative 'idle_time' handling in dbs_update()

Tianchen Ding <[email protected]>
sched/eevdf: Force propagating min_slice of cfs_rq when {en,de}queue tasks

zihan zhou <[email protected]>
sched: Cancel the slice protection of the idle entity

Konstantin Andreev <[email protected]>
smack: ipv4/ipv6: tcp/dccp/sctp: fix incorrect child socket label

Konstantin Andreev <[email protected]>
smack: dont compile ipv6 code unless ipv6 is configured

Oleg Nesterov <[email protected]>
seccomp: fix the __secure_computing() stub for !HAVE_ARCH_SECCOMP_FILTER

zuoqian <[email protected]>
cpufreq: scpi: compare kHz instead of Hz

Geert Uytterhoeven <[email protected]>
m68k: sun3: Fix DEBUG_MMU_EMU build

Thorsten Blum <[email protected]>
m68k: sun3: Use str_read_write() helper in mmu_emu_handle_fault()

Mike Rapoport (Microsoft) <[email protected]>
x86/mm/pat: cpa-test: fix length for CPA_ARRAY test

Eric Sandeen <[email protected]>
watch_queue: fix pipe accounting mismatch

Christian Brauner <[email protected]>
fs: support O_PATH fds with FSCONFIG_SET_FD

-------------

Diffstat:

 .../devicetree/bindings/vendor-prefixes.yaml       |    2 +
 Documentation/netlink/specs/netdev.yaml            |    4 +
 Documentation/netlink/specs/rt_route.yaml          |  180 ++--
 Documentation/networking/xsk-tx-metadata.rst       |   62 ++
 Makefile                                           |    4 +-
 arch/arm/Kconfig                                   |    2 +-
 .../boot/dts/nxp/imx/imx6ul-tqma6ul1-mba6ulx.dts   |    3 +-
 arch/arm/boot/dts/nxp/imx/imx6ul-tqma6ul1.dtsi     |    2 -
 arch/arm/boot/dts/ti/omap/omap4-panda-a4.dts       |    5 +
 arch/arm/include/asm/vmlinux.lds.h                 |   12 +-
 .../arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi |   39 +-
 arch/arm64/boot/dts/freescale/imx8mp.dtsi          |    7 +-
 arch/arm64/boot/dts/mediatek/mt6359.dtsi           |    3 +-
 arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi       |    2 -
 arch/arm64/boot/dts/mediatek/mt8173.dtsi           |    6 +-
 .../boot/dts/mediatek/mt8390-genio-700-evk.dts     | 1033 +------------------
 .../boot/dts/mediatek/mt8390-genio-common.dtsi     | 1046 ++++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a774c0.dtsi          |    4 +
 arch/arm64/boot/dts/renesas/r8a77990.dtsi          |    4 +
 arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts     |    2 +-
 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts    |    4 +-
 arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi   |    2 +-
 arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts    |   14 -
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi      |   25 +-
 .../boot/dts/rockchip/rk3576-armsom-sige5.dts      |    3 +-
 .../dts/rockchip/rk3588-orangepi-5-compact.dtsi    |    2 +-
 arch/arm64/boot/dts/rockchip/rk3588s-coolpi-4b.dts |    2 +-
 arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi  |    6 +-
 .../boot/dts/ti/k3-am62p-j722s-common-mcu.dtsi     |    8 -
 arch/arm64/boot/dts/ti/k3-am62p-main.dtsi          |   26 +-
 arch/arm64/boot/dts/ti/k3-j722s-evm.dts            |    2 +-
 arch/arm64/boot/dts/ti/k3-j722s-main.dtsi          |   15 -
 arch/arm64/include/asm/mem_encrypt.h               |   11 +
 arch/arm64/kernel/compat_alignment.c               |    2 +
 arch/loongarch/Kconfig                             |    4 +-
 arch/loongarch/include/asm/cache.h                 |    2 +
 arch/loongarch/include/asm/irq.h                   |    2 +-
 arch/loongarch/include/asm/stacktrace.h            |    3 +
 arch/loongarch/include/asm/unwind_hints.h          |   10 +-
 arch/loongarch/kernel/env.c                        |    2 +
 arch/loongarch/kernel/kgdb.c                       |    5 +-
 arch/loongarch/net/bpf_jit.c                       |   12 +-
 arch/loongarch/net/bpf_jit.h                       |    5 +
 arch/m68k/include/asm/processor.h                  |   14 +
 arch/m68k/sun3/mmu_emu.c                           |    7 +-
 arch/parisc/include/uapi/asm/socket.h              |   12 +-
 arch/powerpc/configs/mpc885_ads_defconfig          |    2 +-
 arch/powerpc/crypto/Makefile                       |    1 +
 arch/powerpc/kexec/relocate_32.S                   |    7 +-
 arch/powerpc/perf/core-book3s.c                    |    8 +-
 arch/powerpc/perf/vpa-pmu.c                        |    1 +
 arch/powerpc/platforms/cell/spufs/gang.c           |    1 +
 arch/powerpc/platforms/cell/spufs/inode.c          |   63 +-
 arch/powerpc/platforms/cell/spufs/spufs.h          |    2 +
 arch/riscv/Kconfig                                 |    2 +-
 arch/riscv/errata/Makefile                         |    6 +-
 arch/riscv/include/asm/cpufeature.h                |    4 +-
 arch/riscv/include/asm/ftrace.h                    |    4 +-
 arch/riscv/kernel/elf_kexec.c                      |    3 +
 arch/riscv/kernel/mcount.S                         |   24 +-
 arch/riscv/kernel/traps_misaligned.c               |   14 +-
 arch/riscv/kernel/unaligned_access_speed.c         |   91 +-
 arch/riscv/kernel/vec-copy-unaligned.S             |    2 +-
 arch/riscv/kvm/main.c                              |    4 +-
 arch/riscv/kvm/vcpu_pmu.c                          |    1 +
 arch/riscv/mm/hugetlbpage.c                        |   74 +-
 arch/riscv/purgatory/entry.S                       |    1 +
 arch/s390/include/asm/io.h                         |    2 -
 arch/s390/include/asm/pgtable.h                    |    3 -
 arch/s390/kernel/entry.S                           |    2 +-
 arch/s390/kernel/perf_pai_crypto.c                 |    3 +-
 arch/s390/kernel/perf_pai_ext.c                    |    3 +-
 arch/s390/mm/pgtable.c                             |   10 -
 arch/um/include/shared/os.h                        |    1 -
 arch/um/kernel/Makefile                            |    2 +-
 arch/um/kernel/maccess.c                           |   19 -
 arch/um/os-Linux/process.c                         |   51 -
 arch/x86/Kconfig                                   |    3 +-
 arch/x86/Kconfig.cpu                               |    2 +-
 arch/x86/Makefile.um                               |    7 +-
 arch/x86/coco/tdx/tdx.c                            |   26 +-
 arch/x86/entry/calling.h                           |    2 +
 arch/x86/entry/common.c                            |    2 +-
 arch/x86/entry/vdso/vdso-layout.lds.S              |    2 +-
 arch/x86/entry/vdso/vma.c                          |    2 +-
 arch/x86/events/amd/brs.c                          |    3 +-
 arch/x86/events/amd/lbr.c                          |    3 +-
 arch/x86/events/core.c                             |    5 +-
 arch/x86/events/intel/core.c                       |   51 +-
 arch/x86/events/intel/ds.c                         |   13 +-
 arch/x86/events/intel/lbr.c                        |   50 +-
 arch/x86/events/perf_event.h                       |   18 +-
 arch/x86/hyperv/ivm.c                              |    2 +-
 arch/x86/include/asm/irqflags.h                    |   40 +-
 arch/x86/include/asm/paravirt.h                    |   20 +-
 arch/x86/include/asm/paravirt_types.h              |    3 +-
 arch/x86/include/asm/tdx.h                         |    4 +-
 arch/x86/include/asm/tlbflush.h                    |    2 +-
 arch/x86/include/asm/vdso/vsyscall.h               |    1 +
 arch/x86/kernel/cpu/bus_lock.c                     |   20 +-
 arch/x86/kernel/cpu/mce/severity.c                 |   11 +-
 arch/x86/kernel/cpu/microcode/amd.c                |    2 +-
 arch/x86/kernel/cpu/resctrl/rdtgroup.c             |    3 +-
 arch/x86/kernel/dumpstack.c                        |    5 +-
 arch/x86/kernel/fpu/core.c                         |    6 +-
 arch/x86/kernel/paravirt.c                         |   14 +-
 arch/x86/kernel/process.c                          |    9 +-
 arch/x86/kernel/traps.c                            |   18 +-
 arch/x86/kernel/tsc.c                              |    4 +-
 arch/x86/kernel/uprobes.c                          |   14 +-
 arch/x86/kvm/svm/sev.c                             |   13 +-
 arch/x86/kvm/x86.c                                 |   15 +-
 arch/x86/lib/copy_user_64.S                        |   18 +
 arch/x86/mm/mem_encrypt_identity.c                 |    4 +-
 arch/x86/mm/pat/cpa-test.c                         |    2 +-
 arch/x86/mm/pat/memtype.c                          |   52 +-
 block/badblocks.c                                  |  286 ++----
 block/bio.c                                        |   11 +-
 block/blk-settings.c                               |   51 +-
 block/blk-throttle.c                               |   13 +-
 crypto/algapi.c                                    |    3 +-
 crypto/api.c                                       |   17 +-
 crypto/bpf_crypto_skcipher.c                       |    1 +
 drivers/accel/amdxdna/aie2_smu.c                   |    2 +
 drivers/acpi/acpi_video.c                          |    9 +-
 drivers/acpi/nfit/core.c                           |    2 +-
 drivers/acpi/platform_profile.c                    |   26 +-
 drivers/acpi/processor_idle.c                      |    4 +
 drivers/acpi/resource.c                            |    7 +
 drivers/acpi/x86/utils.c                           |    3 +-
 drivers/ata/libata-core.c                          |    2 +-
 drivers/auxdisplay/Kconfig                         |    1 +
 drivers/auxdisplay/panel.c                         |    4 +-
 drivers/base/power/main.c                          |   21 +-
 drivers/base/power/runtime.c                       |    2 +-
 drivers/block/null_blk/main.c                      |  165 +--
 drivers/block/null_blk/null_blk.h                  |    6 +
 drivers/block/null_blk/zoned.c                     |   20 +-
 drivers/block/ublk_drv.c                           |   41 +-
 drivers/bluetooth/btnxpuart.c                      |    6 +-
 drivers/bluetooth/btusb.c                          |    2 +
 drivers/bus/qcom-ssc-block-bus.c                   |   34 +-
 drivers/clk/clk-stm32f4.c                          |    4 +-
 drivers/clk/imx/clk-imx8mp-audiomix.c              |    6 +-
 drivers/clk/meson/g12a.c                           |   38 +-
 drivers/clk/meson/gxbb.c                           |   14 +-
 drivers/clk/mmp/clk-pxa1908-apmu.c                 |    4 +-
 drivers/clk/qcom/gcc-ipq5424.c                     |   24 +-
 drivers/clk/qcom/gcc-msm8953.c                     |    2 +-
 drivers/clk/qcom/gcc-sm8650.c                      |    4 +-
 drivers/clk/qcom/gcc-x1e80100.c                    |   30 -
 drivers/clk/qcom/mmcc-sdm660.c                     |    2 +-
 drivers/clk/renesas/r9a08g045-cpg.c                |    5 +-
 drivers/clk/renesas/rzg2l-cpg.c                    |   13 +-
 drivers/clk/renesas/rzg2l-cpg.h                    |   10 +-
 drivers/clk/rockchip/clk-rk3328.c                  |    2 +-
 drivers/clk/samsung/clk.c                          |    2 +-
 drivers/cpufreq/Kconfig.arm                        |    2 +-
 drivers/cpufreq/amd-pstate-trace.h                 |   46 +-
 drivers/cpufreq/amd-pstate.c                       |   80 +-
 drivers/cpufreq/amd-pstate.h                       |   18 +-
 drivers/cpufreq/armada-8k-cpufreq.c                |    2 +-
 drivers/cpufreq/cpufreq-dt.c                       |    2 +-
 drivers/cpufreq/cpufreq_governor.c                 |   45 +-
 drivers/cpufreq/mediatek-cpufreq-hw.c              |    2 +-
 drivers/cpufreq/mediatek-cpufreq.c                 |    2 +-
 drivers/cpufreq/mvebu-cpufreq.c                    |    2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c                  |    2 +-
 drivers/cpufreq/qcom-cpufreq-nvmem.c               |    8 +-
 drivers/cpufreq/scmi-cpufreq.c                     |    2 +-
 drivers/cpufreq/scpi-cpufreq.c                     |    7 +-
 drivers/cpufreq/sun50i-cpufreq-nvmem.c             |    6 +-
 drivers/cpufreq/virtual-cpufreq.c                  |    2 +-
 drivers/cpuidle/cpuidle-arm.c                      |    8 +-
 drivers/cpuidle/cpuidle-big_little.c               |    2 +-
 drivers/cpuidle/cpuidle-psci.c                     |    4 +-
 drivers/cpuidle/cpuidle-qcom-spm.c                 |    2 +-
 drivers/cpuidle/cpuidle-riscv-sbi.c                |    4 +-
 drivers/crypto/hisilicon/sec2/sec.h                |    1 -
 drivers/crypto/hisilicon/sec2/sec_crypto.c         |  125 +--
 drivers/crypto/intel/iaa/iaa_crypto_main.c         |    4 +-
 .../crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c |    1 +
 drivers/crypto/intel/qat/qat_common/adf_gen4_ras.c |   59 +-
 drivers/crypto/nx/nx-common-pseries.c              |   37 +-
 drivers/crypto/tegra/tegra-se-aes.c                |  401 +++++---
 drivers/crypto/tegra/tegra-se-hash.c               |  287 ++++--
 drivers/crypto/tegra/tegra-se-key.c                |   29 +-
 drivers/crypto/tegra/tegra-se-main.c               |   16 +-
 drivers/crypto/tegra/tegra-se.h                    |   39 +-
 drivers/dma/amd/ae4dma/ae4dma-pci.c                |    4 +-
 drivers/dma/amd/ae4dma/ae4dma.h                    |    2 +
 drivers/dma/amd/ptdma/ptdma-dmaengine.c            |   90 +-
 drivers/dma/fsl-edma-main.c                        |   14 +-
 drivers/edac/i10nm_base.c                          |    2 +
 drivers/edac/ie31200_edac.c                        |   19 +-
 drivers/edac/igen6_edac.c                          |   21 +-
 drivers/edac/skx_common.c                          |   33 +
 drivers/edac/skx_common.h                          |   11 +
 drivers/firmware/arm_ffa/bus.c                     |    3 +-
 drivers/firmware/arm_ffa/driver.c                  |   60 +-
 drivers/firmware/arm_scmi/driver.c                 |   10 -
 drivers/firmware/cirrus/cs_dsp.c                   |    2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c         |    2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c            |    5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c       |  461 +--------
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c           |    5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h           |    3 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c             |    2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c             |    2 +-
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c              |    1 +
 drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c            |   12 +-
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  |   15 -
 .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |   16 +
 .../gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c  |    4 +
 .../amd/display/dc/dml/dcn30/display_mode_vba_30.c |   12 +-
 .../dc/dml2/dml21/src/dml2_core/dml2_core_dcn4.c   |    3 +-
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c             |    3 +-
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c    |   12 +-
 drivers/gpu/drm/bridge/ite-it6505.c                |    7 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c              |    2 +
 drivers/gpu/drm/display/drm_dp_mst_topology.c      |    8 +-
 drivers/gpu/drm/drm_file.c                         |   26 +-
 drivers/gpu/drm/mediatek/mtk_crtc.c                |    7 +-
 drivers/gpu/drm/mediatek/mtk_dp.c                  |    6 +-
 drivers/gpu/drm/mediatek/mtk_dsi.c                 |    6 +-
 drivers/gpu/drm/mediatek/mtk_hdmi.c                |   33 +-
 drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c        |    2 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |    4 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |  132 ++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h        |    4 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |   24 +
 drivers/gpu/drm/msm/dsi/dsi_host.c                 |    8 +-
 drivers/gpu/drm/msm/dsi/dsi_manager.c              |   32 +-
 drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c          |    2 +-
 drivers/gpu/drm/msm/msm_atomic.c                   |   13 +-
 drivers/gpu/drm/msm/msm_dsc_helper.h               |   11 -
 drivers/gpu/drm/msm/msm_gem_submit.c               |    2 +-
 drivers/gpu/drm/msm/msm_kms.h                      |    7 +
 drivers/gpu/drm/panel/panel-ilitek-ili9882t.c      |    2 +-
 drivers/gpu/drm/panthor/panthor_device.c           |   22 +-
 drivers/gpu/drm/panthor/panthor_drv.c              |   14 +
 drivers/gpu/drm/panthor/panthor_fw.c               |    9 +-
 drivers/gpu/drm/panthor/panthor_fw.h               |    6 +-
 drivers/gpu/drm/panthor/panthor_heap.c             |   54 +-
 drivers/gpu/drm/panthor/panthor_heap.h             |    2 +
 drivers/gpu/drm/panthor/panthor_mmu.c              |   27 +
 drivers/gpu/drm/panthor/panthor_mmu.h              |    3 +
 drivers/gpu/drm/panthor/panthor_sched.c            |   84 +-
 drivers/gpu/drm/panthor/panthor_sched.h            |    3 +
 drivers/gpu/drm/solomon/ssd130x-spi.c              |    7 +-
 drivers/gpu/drm/solomon/ssd130x.c                  |    6 +-
 drivers/gpu/drm/vkms/vkms_drv.c                    |   15 +-
 drivers/gpu/drm/xe/Kconfig                         |    2 +-
 drivers/gpu/drm/xlnx/zynqmp_dp.c                   |    2 +-
 drivers/gpu/drm/xlnx/zynqmp_dp_audio.c             |    4 +
 drivers/gpu/drm/xlnx/zynqmp_dpsub.c                |    2 +
 drivers/greybus/gb-beagleplay.c                    |    4 +-
 drivers/hid/Makefile                               |    1 -
 drivers/hwtracing/coresight/coresight-catu.c       |    2 +-
 drivers/hwtracing/coresight/coresight-core.c       |   20 +-
 drivers/hwtracing/coresight/coresight-etm4x-core.c |   48 +-
 drivers/i3c/master/svc-i3c-master.c                |    2 +-
 drivers/iio/accel/mma8452.c                        |   10 +-
 drivers/iio/accel/msa311.c                         |   28 +-
 drivers/iio/adc/ad4130.c                           |   41 +-
 drivers/iio/adc/ad7124.c                           |   60 +-
 drivers/iio/adc/ad7173.c                           |   30 +-
 drivers/iio/adc/ad7192.c                           |    5 +
 drivers/iio/adc/ad7768-1.c                         |   15 +
 drivers/iio/adc/ad_sigma_delta.c                   |    1 +
 drivers/iio/dac/adi-axi-dac.c                      |    8 +
 drivers/iio/industrialio-backend.c                 |    4 +-
 drivers/iio/industrialio-gts-helper.c              |   11 +-
 drivers/iio/light/Kconfig                          |    1 +
 drivers/iio/light/veml6030.c                       |  587 +++++------
 drivers/iio/light/veml6075.c                       |    8 +-
 drivers/infiniband/core/device.c                   |   18 +-
 drivers/infiniband/core/mad.c                      |   38 +-
 drivers/infiniband/core/sysfs.c                    |    1 +
 drivers/infiniband/hw/erdma/erdma_cm.c             |    1 -
 drivers/infiniband/hw/mana/main.c                  |    2 +-
 drivers/infiniband/hw/mlx5/cq.c                    |    2 +-
 drivers/infiniband/hw/mlx5/mr.c                    |   41 +-
 drivers/infiniband/hw/mlx5/odp.c                   |   10 +-
 drivers/iommu/amd/amd_iommu.h                      |    7 +-
 drivers/iommu/intel/iommu.c                        |   17 +-
 drivers/iommu/io-pgtable-dart.c                    |    2 +-
 drivers/iommu/iommu.c                              |    5 +
 drivers/leds/led-core.c                            |   22 +-
 drivers/leds/leds-st1202.c                         |    4 +-
 drivers/md/md-bitmap.c                             |    6 +-
 drivers/md/md.c                                    |   71 +-
 drivers/md/md.h                                    |    6 +-
 drivers/md/raid1-10.c                              |    2 +-
 drivers/md/raid1.c                                 |   17 +-
 drivers/md/raid10.c                                |   19 +-
 drivers/media/dvb-frontends/dib8000.c              |    5 +-
 drivers/media/platform/allegro-dvt/allegro-core.c  |    1 +
 drivers/media/platform/ti/omap3isp/isp.c           |    7 +
 .../platform/verisilicon/hantro_g2_hevc_dec.c      |    1 +
 drivers/media/rc/streamzap.c                       |    2 +-
 drivers/media/test-drivers/vimc/vimc-streamer.c    |    6 +
 drivers/memory/mtk-smi.c                           |   33 +
 drivers/mfd/sm501.c                                |    6 +-
 drivers/misc/pci_endpoint_test.c                   |   22 +-
 drivers/mmc/host/omap.c                            |   19 +-
 drivers/mmc/host/sdhci-omap.c                      |    4 +-
 drivers/mmc/host/sdhci-pxav3.c                     |    1 +
 drivers/net/arcnet/com20020-pci.c                  |   17 +-
 drivers/net/bonding/bond_main.c                    |    8 +-
 drivers/net/bonding/bond_options.c                 |    3 +
 drivers/net/can/rockchip/rockchip_canfd-core.c     |    5 -
 drivers/net/dsa/microchip/ksz8.c                   |   11 +-
 drivers/net/dsa/microchip/ksz_dcb.c                |  231 +----
 drivers/net/dsa/mv88e6xxx/chip.c                   |   32 +-
 drivers/net/dsa/mv88e6xxx/phy.c                    |    3 +
 drivers/net/dsa/sja1105/sja1105_ethtool.c          |    9 +-
 drivers/net/dsa/sja1105/sja1105_ptp.c              |   20 +-
 drivers/net/dsa/sja1105/sja1105_static_config.c    |    6 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |   19 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h          |    6 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c      |    3 +-
 drivers/net/ethernet/ibm/ibmveth.c                 |   39 +-
 drivers/net/ethernet/ibm/ibmvnic.c                 |   30 +-
 drivers/net/ethernet/intel/e1000e/defines.h        |    3 +
 drivers/net/ethernet/intel/e1000e/ich8lan.c        |   80 +-
 drivers/net/ethernet/intel/e1000e/ich8lan.h        |    4 +
 drivers/net/ethernet/intel/ice/devlink/health.c    |    6 +-
 drivers/net/ethernet/intel/ice/ice_common.c        |    3 +-
 drivers/net/ethernet/intel/ice/ice_ptp.c           |    6 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl.c      |   39 +-
 drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c |   24 +-
 drivers/net/ethernet/intel/idpf/idpf_lib.c         |   31 +-
 drivers/net/ethernet/intel/idpf/idpf_main.c        |    6 +-
 drivers/net/ethernet/intel/igb/igb_ptp.c           |    6 +
 drivers/net/ethernet/intel/igc/igc.h               |    1 +
 drivers/net/ethernet/intel/igc/igc_main.c          |  143 ++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c      |    4 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h         |    3 +
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c    |    3 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c     |  201 ++--
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |    2 +-
 .../ethernet/marvell/octeontx2/af/rvu_devlink.c    |    2 +-
 drivers/net/ethernet/mediatek/airoha_eth.c         |   20 +-
 .../net/ethernet/mellanox/mlx5/core/en/params.c    |    8 +-
 .../ethernet/mellanox/mlx5/core/en_fs_ethtool.c    |    2 +
 drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c  |    4 +
 drivers/net/ethernet/mellanox/mlx5/core/main.c     |   15 +-
 .../mellanox/mlxsw/spectrum_acl_bloom_filter.c     |   27 +-
 drivers/net/ethernet/microchip/lan743x_ptp.c       |    6 +
 drivers/net/ethernet/renesas/ravb_ptp.c            |    3 +-
 drivers/net/ethernet/sfc/ef100_netdev.c            |    7 +-
 drivers/net/ethernet/sfc/ef100_nic.c               |   47 +-
 drivers/net/ethernet/sfc/efx.c                     |   24 -
 drivers/net/ethernet/sfc/mcdi_port.c               |   59 +-
 drivers/net/ethernet/sfc/mcdi_port_common.c        |   11 -
 drivers/net/ethernet/sfc/net_driver.h              |    6 +-
 drivers/net/ethernet/wangxun/libwx/wx_lib.c        |   65 +-
 drivers/net/ipvlan/ipvlan_l3s.c                    |    1 -
 drivers/net/phy/bcm-phy-ptp.c                      |    3 +-
 drivers/net/phy/broadcom.c                         |    6 +-
 drivers/net/usb/rndis_host.c                       |   16 +-
 drivers/net/usb/usbnet.c                           |    6 +-
 drivers/net/virtio_net.c                           |   30 +-
 drivers/net/vmxnet3/vmxnet3_drv.c                  |   10 +-
 drivers/net/wireless/ath/ath11k/dp_rx.c            |   14 +-
 drivers/net/wireless/ath/ath11k/mac.c              |    5 -
 drivers/net/wireless/ath/ath11k/pci.c              |    2 +
 drivers/net/wireless/ath/ath11k/reg.c              |   22 +-
 drivers/net/wireless/ath/ath12k/core.c             |    4 +-
 drivers/net/wireless/ath/ath12k/dp_rx.c            |    2 +-
 drivers/net/wireless/ath/ath12k/dp_tx.c            |    2 +
 drivers/net/wireless/ath/ath12k/mac.c              |    9 +-
 drivers/net/wireless/ath/ath12k/pci.c              |    2 +
 drivers/net/wireless/ath/ath12k/wmi.c              |    2 +
 drivers/net/wireless/ath/ath9k/common-spectral.c   |    4 +-
 drivers/net/wireless/marvell/mwifiex/fw.h          |   14 +
 drivers/net/wireless/marvell/mwifiex/main.c        |    4 -
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c     |   18 +-
 .../net/wireless/mediatek/mt76/mt7915/debugfs.c    |   45 +-
 drivers/net/wireless/mediatek/mt76/mt7921/main.c   |    1 +
 drivers/net/wireless/mediatek/mt76/mt7925/mcu.c    |    1 -
 drivers/net/wireless/realtek/rtw89/core.h          |    2 +-
 drivers/net/wireless/realtek/rtw89/fw.c            |   12 +-
 drivers/net/wireless/realtek/rtw89/pci.h           |   56 +-
 drivers/net/wireless/realtek/rtw89/pci_be.c        |    2 +-
 drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c  |   13 +-
 drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c |   13 +-
 drivers/ntb/hw/intel/ntb_hw_gen3.c                 |    3 +
 drivers/ntb/hw/mscc/ntb_hw_switchtec.c             |    2 +-
 drivers/ntb/test/ntb_perf.c                        |    4 +-
 drivers/nvdimm/badrange.c                          |    2 +-
 drivers/nvdimm/nd.h                                |    2 +-
 drivers/nvdimm/pfn_devs.c                          |    7 +-
 drivers/nvdimm/pmem.c                              |    2 +-
 drivers/nvme/host/ioctl.c                          |    2 +-
 drivers/nvme/host/pci.c                            |    3 +
 drivers/nvme/target/debugfs.c                      |    2 +-
 drivers/nvme/target/pci-epf.c                      |   11 +-
 drivers/pci/controller/cadence/pcie-cadence-ep.c   |    3 +-
 drivers/pci/controller/cadence/pcie-cadence.h      |    2 +-
 drivers/pci/controller/dwc/pcie-designware-ep.c    |    1 +
 drivers/pci/controller/dwc/pcie-histb.c            |   12 +-
 drivers/pci/controller/pcie-brcmstb.c              |   16 +-
 drivers/pci/controller/pcie-mediatek-gen3.c        |   28 +-
 drivers/pci/controller/pcie-xilinx-cpm.c           |   10 +-
 drivers/pci/endpoint/functions/pci-epf-test.c      |  126 ++-
 drivers/pci/hotplug/pciehp_hpc.c                   |    4 +-
 drivers/pci/iov.c                                  |   48 +-
 drivers/pci/pci-sysfs.c                            |    4 +-
 drivers/pci/pci.c                                  |   22 +-
 drivers/pci/pcie/aspm.c                            |   17 +-
 drivers/pci/pcie/bwctrl.c                          |    6 +-
 drivers/pci/pcie/portdrv.c                         |    8 +-
 drivers/pci/probe.c                                |    5 +-
 drivers/pci/setup-bus.c                            |   39 +-
 drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c  |   50 +-
 drivers/pinctrl/bcm/pinctrl-bcm2835.c              |   14 +-
 drivers/pinctrl/intel/pinctrl-intel.c              |    1 -
 drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c          |   10 +-
 drivers/pinctrl/renesas/pinctrl-rza2.c             |    2 +
 drivers/pinctrl/renesas/pinctrl-rzg2l.c            |    3 +
 drivers/pinctrl/renesas/pinctrl-rzv2m.c            |    2 +
 drivers/pinctrl/tegra/pinctrl-tegra.c              |    3 +
 drivers/platform/x86/dell/dell-uart-backlight.c    |    2 +-
 drivers/platform/x86/dell/dell-wmi-ddv.c           |    6 +-
 .../x86/intel/speed_select_if/isst_if_common.c     |    2 +-
 .../x86/lenovo-yoga-tab2-pro-1380-fastcharger.c    |    2 +-
 drivers/platform/x86/thinkpad_acpi.c               |   11 +
 drivers/power/supply/bq27xxx_battery.c             |    1 -
 drivers/power/supply/max77693_charger.c            |    2 +-
 drivers/ptp/ptp_ocp.c                              |    4 +
 drivers/regulator/pca9450-regulator.c              |    6 +-
 drivers/remoteproc/qcom_q6v5_mss.c                 |   21 +-
 drivers/remoteproc/qcom_q6v5_pas.c                 |   13 +-
 drivers/remoteproc/remoteproc_core.c               |    1 +
 drivers/rtc/rtc-renesas-rtca3.c                    |   15 +-
 drivers/scsi/hisi_sas/hisi_sas.h                   |    3 +-
 drivers/scsi/hisi_sas/hisi_sas_main.c              |   28 +-
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c             |    4 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |    4 +-
 drivers/scsi/mpi3mr/mpi3mr_app.c                   |    1 +
 drivers/scsi/mpt3sas/mpt3sas_base.c                |   12 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c               |    2 +-
 drivers/soc/mediatek/mt8167-mmsys.h                |   13 +-
 drivers/soc/mediatek/mt8188-mmsys.h                |    2 +-
 drivers/soc/mediatek/mt8365-mmsys.h                |   48 +-
 drivers/soundwire/generic_bandwidth_allocation.c   |    5 +-
 drivers/soundwire/slave.c                          |    1 +
 drivers/spi/spi-amd.c                              |    2 +-
 drivers/spi/spi-bcm2835.c                          |   18 +-
 drivers/spi/spi-cadence-xspi.c                     |    2 +-
 .../staging/gpib/agilent_82350b/agilent_82350b.c   |    2 +
 .../staging/gpib/agilent_82357a/agilent_82357a.c   |  424 ++++----
 drivers/staging/gpib/cb7210/cb7210.c               |    2 +-
 drivers/staging/gpib/hp_82341/hp_82341.c           |    2 +-
 drivers/staging/gpib/ni_usb/ni_usb_gpib.c          |  518 +++++-----
 drivers/staging/rtl8723bs/Kconfig                  |    1 +
 .../vc04_services/interface/vchiq_arm/vchiq_arm.c  |   28 +-
 drivers/target/loopback/tcm_loop.c                 |    5 +-
 .../intel/int340x_thermal/int3402_thermal.c        |    3 +
 drivers/tty/n_tty.c                                |   13 +-
 drivers/tty/serial/fsl_lpuart.c                    |  312 +++---
 drivers/usb/host/xhci-mem.c                        |    6 +-
 drivers/usb/typec/altmodes/thunderbolt.c           |   10 +-
 drivers/usb/typec/ucsi/ucsi_ccg.c                  |    5 +-
 drivers/vhost/scsi.c                               |   25 +-
 drivers/video/console/Kconfig                      |    6 +-
 drivers/video/fbdev/au1100fb.c                     |    4 +-
 drivers/video/fbdev/sm501fb.c                      |    7 +
 drivers/w1/masters/w1-uart.c                       |    4 +-
 fs/9p/vfs_inode_dotl.c                             |    2 +-
 fs/autofs/autofs_i.h                               |    2 +
 fs/bcachefs/fs-ioctl.c                             |    6 +-
 fs/btrfs/block-group.c                             |   40 +-
 fs/btrfs/disk-io.c                                 |    3 +
 fs/coredump.c                                      |    4 +-
 fs/dlm/lockspace.c                                 |    2 +-
 fs/erofs/internal.h                                |    2 -
 fs/erofs/super.c                                   |    8 -
 fs/exec.c                                          |   15 +-
 fs/exfat/fatent.c                                  |    2 +-
 fs/exfat/file.c                                    |   29 +-
 fs/exfat/inode.c                                   |   41 +-
 fs/ext4/dir.c                                      |    3 +
 fs/ext4/ext4.h                                     |   17 +-
 fs/ext4/ext4_jbd2.h                                |   29 +
 fs/ext4/inode.c                                    |   19 +-
 fs/ext4/mballoc-test.c                             |    2 +
 fs/ext4/namei.c                                    |   16 +-
 fs/ext4/super.c                                    |   81 +-
 fs/ext4/xattr.c                                    |   32 +-
 fs/ext4/xattr.h                                    |   10 +
 fs/f2fs/checkpoint.c                               |   15 +-
 fs/f2fs/compress.c                                 |    1 +
 fs/f2fs/data.c                                     |   10 +-
 fs/f2fs/f2fs.h                                     |    3 +-
 fs/f2fs/file.c                                     |   20 +-
 fs/f2fs/inode.c                                    |    7 +
 fs/f2fs/namei.c                                    |    8 +
 fs/f2fs/segment.c                                  |   29 +-
 fs/f2fs/segment.h                                  |    9 +-
 fs/f2fs/super.c                                    |   67 +-
 fs/fsopen.c                                        |    2 +-
 fs/fuse/dax.c                                      |    1 -
 fs/fuse/dir.c                                      |    2 +-
 fs/fuse/file.c                                     |    4 +-
 fs/gfs2/super.c                                    |   21 +-
 fs/hostfs/hostfs.h                                 |    2 +-
 fs/hostfs/hostfs_kern.c                            |    7 +-
 fs/hostfs/hostfs_user.c                            |   59 +-
 fs/isofs/dir.c                                     |    3 +-
 fs/jbd2/journal.c                                  |   27 +-
 fs/jfs/inode.c                                     |    2 +-
 fs/jfs/jfs_dtree.c                                 |    3 +-
 fs/jfs/jfs_extent.c                                |   10 +
 fs/jfs/jfs_imap.c                                  |   13 +-
 fs/jfs/xattr.c                                     |   13 +-
 fs/nfs/delegation.c                                |   63 +-
 fs/nfs/nfs4xdr.c                                   |   18 +-
 fs/nfs/sysfs.c                                     |   22 +-
 fs/nfs/write.c                                     |    4 +-
 fs/nfsd/Kconfig                                    |   12 +-
 fs/nfsd/nfs4callback.c                             |   14 +-
 fs/nfsd/nfs4state.c                                |   53 +-
 fs/nfsd/nfsctl.c                                   |   53 +-
 fs/nfsd/stats.c                                    |    4 +-
 fs/nfsd/stats.h                                    |    2 +-
 fs/nfsd/vfs.c                                      |   28 +-
 fs/ntfs3/attrib.c                                  |    3 +-
 fs/ntfs3/file.c                                    |   22 +-
 fs/ntfs3/frecord.c                                 |    6 +-
 fs/ntfs3/index.c                                   |    4 +-
 fs/ntfs3/ntfs.h                                    |    2 +-
 fs/ntfs3/super.c                                   |   89 +-
 fs/ocfs2/alloc.c                                   |    8 +
 fs/proc/base.c                                     |    2 +-
 fs/smb/client/connect.c                            |   16 +-
 fs/smb/server/auth.c                               |    6 +-
 fs/smb/server/connection.h                         |   11 +
 fs/smb/server/mgmt/user_session.c                  |   37 +-
 fs/smb/server/mgmt/user_session.h                  |    2 +
 fs/smb/server/oplock.c                             |   12 +-
 fs/smb/server/smb2pdu.c                            |   54 +-
 fs/smb/server/smbacl.c                             |   21 +-
 include/asm-generic/rwonce.h                       |   10 +-
 include/drm/display/drm_dp_mst_helper.h            |    7 +
 include/drm/drm_file.h                             |    5 +
 include/linux/arm_ffa.h                            |    3 +
 include/linux/avf/virtchnl.h                       |    4 +-
 include/linux/badblocks.h                          |   10 +-
 include/linux/context_tracking_irq.h               |    8 +-
 include/linux/coresight.h                          |    4 +
 include/linux/cpuset.h                             |    6 +
 include/linux/dma-direct.h                         |   13 +-
 include/linux/fwnode.h                             |    2 +-
 include/linux/if_bridge.h                          |    6 +-
 include/linux/iio/iio-gts-helper.h                 |    1 +
 include/linux/iio/iio.h                            |   26 +
 include/linux/interrupt.h                          |    8 +-
 include/linux/mem_encrypt.h                        |   23 +
 include/linux/nfs_fs_sb.h                          |    4 +
 include/linux/nmi.h                                |    4 -
 include/linux/perf_event.h                         |   37 +-
 include/linux/pgtable.h                            |   28 +-
 include/linux/pm_runtime.h                         |    2 +
 include/linux/rcupdate.h                           |    2 +-
 include/linux/reboot.h                             |   18 +-
 include/linux/sched.h                              |    7 +
 include/linux/sched/deadline.h                     |    4 +
 include/linux/sched/smt.h                          |    2 +-
 include/linux/sched/topology.h                     |    2 +
 include/linux/seccomp.h                            |    8 +-
 include/linux/thermal.h                            |    2 -
 include/linux/uprobes.h                            |    2 +
 include/linux/writeback.h                          |   24 +
 include/net/ax25.h                                 |    1 -
 include/net/bluetooth/hci.h                        |   34 +
 include/net/bluetooth/hci_core.h                   |    5 +
 include/net/bonding.h                              |    1 +
 include/net/xdp_sock.h                             |   10 +
 include/net/xdp_sock_drv.h                         |    1 +
 include/net/xfrm.h                                 |   11 +-
 include/rdma/ib_verbs.h                            |    1 +
 include/trace/define_trace.h                       |    7 +
 include/trace/events/writeback.h                   |   21 +-
 include/uapi/linux/if_xdp.h                        |   10 +
 include/uapi/linux/netdev.h                        |    3 +
 init/Kconfig                                       |    5 +
 io_uring/io-wq.c                                   |   40 +-
 io_uring/io-wq.h                                   |    7 +-
 io_uring/io_uring.c                                |    3 +-
 io_uring/net.c                                     |   23 +-
 kernel/bpf/core.c                                  |   19 +-
 kernel/bpf/verifier.c                              |    7 +
 kernel/cgroup/cpuset.c                             |   27 +-
 kernel/cpu.c                                       |    5 -
 kernel/events/core.c                               |   39 +-
 kernel/events/ring_buffer.c                        |    2 +-
 kernel/events/uprobes.c                            |   15 +-
 kernel/fork.c                                      |    4 +
 kernel/kexec_elf.c                                 |    2 +-
 kernel/reboot.c                                    |   84 +-
 kernel/rseq.c                                      |   82 +-
 kernel/sched/core.c                                |    8 +-
 kernel/sched/deadline.c                            |   37 +-
 kernel/sched/debug.c                               |    8 +-
 kernel/sched/fair.c                                |   50 +-
 kernel/sched/rt.c                                  |    2 +
 kernel/sched/sched.h                               |    2 +-
 kernel/sched/topology.c                            |   15 +-
 kernel/seccomp.c                                   |   14 +-
 kernel/trace/bpf_trace.c                           |    2 +-
 kernel/trace/ring_buffer.c                         |    4 +-
 kernel/trace/trace_events.c                        |    7 +
 kernel/trace/trace_events_synth.c                  |   32 +-
 kernel/trace/trace_functions_graph.c               |    1 +
 kernel/trace/trace_irqsoff.c                       |    2 -
 kernel/trace/trace_osnoise.c                       |    1 -
 kernel/trace/trace_sched_wakeup.c                  |    2 -
 kernel/watch_queue.c                               |    9 +
 kernel/watchdog.c                                  |   25 -
 kernel/watchdog_perf.c                             |   28 +-
 lib/842/842_compress.c                             |    2 +
 lib/stackinit_kunit.c                              |   30 +-
 lib/vsprintf.c                                     |    2 +-
 mm/gup.c                                           |    3 +
 mm/memory.c                                        |   13 +-
 mm/page-writeback.c                                |   37 +-
 mm/zswap.c                                         |   30 +-
 net/ax25/af_ax25.c                                 |   30 +-
 net/ax25/ax25_route.c                              |   74 --
 net/bluetooth/hci_core.c                           |   62 +-
 net/bluetooth/hci_event.c                          |   25 +-
 net/bluetooth/hci_sync.c                           |   30 +-
 net/bridge/br_ioctl.c                              |   36 +-
 net/bridge/br_private.h                            |    3 +-
 net/core/dev_ioctl.c                               |   19 -
 net/core/dst.c                                     |    8 +
 net/core/netdev-genl.c                             |    2 +
 net/core/rtnetlink.c                               |    3 +
 net/core/rtnl_net_debug.c                          |    2 +-
 net/ipv4/ip_tunnel_core.c                          |    4 +-
 net/ipv4/udp.c                                     |   42 +-
 net/ipv6/addrconf.c                                |   37 +-
 net/ipv6/calipso.c                                 |   21 +-
 net/ipv6/route.c                                   |   42 +-
 net/mac80211/cfg.c                                 |   12 +-
 net/mac80211/mlme.c                                |    9 +-
 net/netfilter/nf_tables_api.c                      |    4 +-
 net/netfilter/nf_tables_core.c                     |   11 +-
 net/netfilter/nfnetlink_queue.c                    |    2 +-
 net/netfilter/nft_set_hash.c                       |    3 +-
 net/netfilter/nft_tunnel.c                         |    6 +-
 net/openvswitch/actions.c                          |    6 -
 net/sched/act_tunnel_key.c                         |    2 +-
 net/sched/cls_flower.c                             |    2 +-
 net/sched/sch_skbprio.c                            |    3 -
 net/sctp/sysctl.c                                  |    4 +
 net/socket.c                                       |   19 +-
 net/vmw_vsock/af_vsock.c                           |    6 +-
 net/wireless/core.c                                |    6 +-
 net/wireless/nl80211.c                             |    2 +-
 net/xdp/xsk.c                                      |    8 +-
 net/xfrm/xfrm_device.c                             |   13 +-
 net/xfrm/xfrm_state.c                              |   32 +-
 net/xfrm/xfrm_user.c                               |    2 +-
 rust/Makefile                                      |    4 +-
 rust/kernel/pci.rs                                 |  143 ++-
 rust/kernel/platform.rs                            |   97 +-
 rust/kernel/print.rs                               |    7 +-
 samples/bpf/Makefile                               |    2 +-
 samples/rust/rust_driver_pci.rs                    |    8 +-
 samples/rust/rust_driver_platform.rs               |   11 +-
 samples/trace_events/trace-events-sample.h         |    8 +-
 scripts/gdb/linux/symbols.py                       |   13 +-
 scripts/package/debian/rules                       |    6 +-
 scripts/selinux/install_policy.sh                  |   15 +-
 security/smack/smack.h                             |    6 +
 security/smack/smack_lsm.c                         |   34 +-
 sound/core/timer.c                                 |  147 +--
 sound/pci/hda/patch_realtek.c                      |    9 +-
 sound/soc/amd/acp/acp-legacy-common.c              |   10 +-
 sound/soc/codecs/cs35l41-spi.c                     |    5 +-
 sound/soc/codecs/rt5665.c                          |   24 +-
 sound/soc/fsl/imx-card.c                           |    4 +
 sound/soc/generic/simple-card-utils.c              |    7 +-
 sound/soc/tegra/tegra210_adx.c                     |    6 +-
 sound/soc/ti/j721e-evm.c                           |    2 +
 sound/usb/mixer_quirks.c                           |    7 +-
 tools/arch/x86/lib/insn.c                          |    2 +-
 tools/bpf/runqslower/Makefile                      |    3 +-
 tools/include/uapi/linux/if_xdp.h                  |   10 +
 tools/include/uapi/linux/netdev.h                  |    3 +
 tools/lib/bpf/btf.c                                |    4 +-
 tools/lib/bpf/linker.c                             |    2 +-
 tools/lib/bpf/str_error.c                          |    2 +-
 tools/lib/bpf/str_error.h                          |    7 +-
 tools/objtool/arch/loongarch/decode.c              |   28 +-
 tools/objtool/arch/loongarch/include/arch/elf.h    |    7 +
 tools/objtool/arch/powerpc/decode.c                |   14 +
 tools/objtool/arch/x86/decode.c                    |   13 +
 tools/objtool/check.c                              |   84 +-
 tools/objtool/elf.c                                |    6 +-
 tools/objtool/include/objtool/arch.h               |    3 +
 tools/objtool/include/objtool/elf.h                |   27 +-
 tools/perf/Makefile.config                         |   10 +-
 tools/perf/Makefile.perf                           |    2 +-
 tools/perf/arch/powerpc/util/header.c              |    4 +-
 tools/perf/arch/x86/util/topdown.c                 |    2 +-
 tools/perf/bench/syscall.c                         |   22 +-
 tools/perf/builtin-report.c                        |   39 +-
 .../arch/arm64/ampere/ampereonex/metrics.json      |   10 +-
 tools/perf/tests/hwmon_pmu.c                       |   16 +-
 .../shell/coresight/asm_pure_loop/asm_pure_loop.S  |    2 +
 tools/perf/tests/shell/record_bpf_filter.sh        |    4 +-
 tools/perf/tests/shell/stat_all_pmu.sh             |   48 +-
 tools/perf/tests/shell/test_data_symbol.sh         |   17 +-
 tools/perf/tests/tool_pmu.c                        |    4 +-
 tools/perf/tests/workloads/datasym.c               |   34 +-
 tools/perf/util/arm-spe.c                          |    8 +-
 tools/perf/util/bpf-filter.l                       |    2 +-
 tools/perf/util/comm.c                             |    2 +
 tools/perf/util/debug.c                            |    2 +-
 tools/perf/util/dso.h                              |    4 +-
 tools/perf/util/evlist.c                           |   13 +-
 tools/perf/util/evsel.c                            |   16 +-
 tools/perf/util/expr.c                             |    2 +
 tools/perf/util/hist.c                             |    2 +
 tools/perf/util/hist.h                             |    3 +
 tools/perf/util/hwmon_pmu.c                        |   14 -
 tools/perf/util/hwmon_pmu.h                        |   16 +
 tools/perf/util/intel-tpebs.c                      |    2 +-
 tools/perf/util/machine.c                          |    4 +-
 tools/perf/util/pmu.c                              |    7 +-
 tools/perf/util/pmu.h                              |    7 +
 tools/perf/util/pmus.c                             |  173 ++--
 tools/perf/util/python.c                           |   17 +-
 tools/perf/util/session.c                          |   12 +
 tools/perf/util/session.h                          |    1 +
 tools/perf/util/sort.c                             |   23 +
 tools/perf/util/sort.h                             |    1 +
 tools/perf/util/stat-shadow.c                      |    3 +-
 tools/perf/util/stat.c                             |   13 +-
 tools/perf/util/tool_pmu.c                         |   32 +-
 tools/perf/util/tool_pmu.h                         |    2 +-
 tools/perf/util/units.c                            |    2 +-
 tools/power/x86/turbostat/turbostat.8              |    2 +
 tools/power/x86/turbostat/turbostat.c              |   30 +-
 tools/testing/selftests/bpf/Makefile               |    1 +
 .../selftests/bpf/prog_tests/bloom_filter_map.c    |    5 +
 tools/testing/selftests/bpf/prog_tests/tailcalls.c |    1 +
 tools/testing/selftests/bpf/progs/strncmp_bench.c  |    5 +-
 tools/testing/selftests/mm/cow.c                   |    2 +-
 tools/testing/selftests/pcie_bwctrl/Makefile       |    2 +-
 tools/verification/rv/Makefile.rv                  |    2 +-
 756 files changed, 9425 insertions(+), 7073 deletions(-)
author maintainer
#1 lore raw

PATCH 1/731 fs: support O_PATH fds with FSCONFIG_SET_FD

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Christian Brauner <[email protected]>

[ Upstream commit 0ff053b98a0f039e52c2bd8d0cb38f2831edfaf5 ]

Let FSCONFIG_SET_FD handle O_PATH file descriptors. This is particularly useful in the context of overlayfs where layers can be specified via file descriptors instead of paths. But userspace must currently use non-O_PATH file desriptors which is often pointless especially if the file descriptors have been created via open_tree(OPEN_TREE_CLONE).

Fixes a08557d19ef41 ("ovl: specify layers via file descriptors")
---
 fs/autofs/autofs_i.h | 2 ++
 fs/fsopen.c          | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
fs/autofs/autofs_i.h +2 -0
index 77c7991d89aac..23cea74f9933b 100644
@@ -218,6 +218,8 @@ void autofs_clean_ino(struct autofs_info *);
 
 static inline int autofs_check_pipe(struct file *pipe)
 {
+	if (pipe->f_mode & FMODE_PATH)
+		return -EINVAL;
 	if (!(pipe->f_mode & FMODE_CAN_WRITE))
 		return -EINVAL;
 	if (!S_ISFIFO(file_inode(pipe)->i_mode))
fs/fsopen.c +1 -1
index 094a7f510edfe..1aaf4cb2afb29 100644
@@ -453,7 +453,7 @@ SYSCALL_DEFINE5(fsconfig,
 	case FSCONFIG_SET_FD:
 		param.type = fs_value_is_file;
 		ret = -EBADF;
-		param.file = fget(aux);
+		param.file = fget_raw(aux);
 		if (!param.file)
 			goto out_key;
 		param.dirfd = aux;
Signature · 1 line
2.39.5
author maintainer
#2 lore raw

PATCH 2/731 watch_queue: fix pipe accounting mismatch

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Eric Sandeen <[email protected]>

[ Upstream commit f13abc1e8e1a3b7455511c4e122750127f6bc9b0 ]

Currently, watch_queue_set_size() modifies the pipe buffers charged to user->pipe_bufs without updating the pipe->nr_accounted on the pipe itself, due to the if (!pipe_has_watch_queue()) test in pipe_resize_ring(). This means that when the pipe is ultimately freed, we decrement user->pipe_bufs by something other than what than we had charged to it, potentially leading to an underflow. This in turn can cause subsequent too_many_pipe_buffers_soft() tests to fail with -EPERM.

To remedy this, explicitly account for the pipe usage in watch_queue_set_size() to match the number set via account_pipe_buffers()

(It's unclear why watch_queue_set_size() does not update nr_accounted; it may be due to intentional overprovisioning in watch_queue_set_size()?)

Fixes e95aada4cb93d ("pipe: wakeup wr_wait after setting max_usage")
---
 kernel/watch_queue.c | 9 +++++++++
 1 file changed, 9 insertions(+)
kernel/watch_queue.c +9 -0
index 5267adeaa4034..41e4e8070923a 100644
@@ -269,6 +269,15 @@ long watch_queue_set_size(struct pipe_inode_info *pipe, unsigned int nr_notes)
 	if (ret < 0)
 		goto error;
 
+	/*
+	 * pipe_resize_ring() does not update nr_accounted for watch_queue
+	 * pipes, because the above vastly overprovisions. Set nr_accounted on
+	 * and max_usage this pipe to the number that was actually charged to
+	 * the user above via account_pipe_buffers.
+	 */
+	pipe->max_usage = nr_pages;
+	pipe->nr_accounted = nr_pages;
+
 	ret = -ENOMEM;
 	pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL);
 	if (!pages)
Signature · 1 line
2.39.5
author maintainer
#3 lore raw

PATCH 3/731 x86/mm/pat: cpa-test: fix length for CPA_ARRAY test

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Mike Rapoport (Microsoft) <[email protected]>

[ Upstream commit 33ea120582a638b2f2e380a50686c2b1d7cce795 ]

The CPA_ARRAY test always uses len[1] as numpages argument to change_page_attr_set() although the addresses array is different each iteration of the test loop.

Replace len[1] with len[i] to have numpages matching the addresses array.

Fixes ecc729f1f471 ("x86/mm/cpa: Add ARRAY and PAGES_ARRAY selftests")
---
 arch/x86/mm/pat/cpa-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/pat/cpa-test.c +1 -1
index 3d2f7f0a6ed14..ad3c1feec990d 100644
@@ -183,7 +183,7 @@ static int pageattr_test(void)
 			break;
 
 		case 1:
-			err = change_page_attr_set(addrs, len[1], PAGE_CPA_TEST, 1);
+			err = change_page_attr_set(addrs, len[i], PAGE_CPA_TEST, 1);
 			break;
 
 		case 2:
Signature · 1 line
2.39.5
author maintainer
#4 lore raw

PATCH 4/731 m68k: sun3: Use str_read_write() helper in mmu_emu_handle_fault()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Thorsten Blum <[email protected]>

[ Upstream commit 751b3d8d886e73ecc24a5426adba228ef7eb39e8 ]

Remove hard-coded strings by using the str_read_write() helper.

Stable-dep-of: 723be3c6ab31 ("m68k: sun3: Fix DEBUG_MMU_EMU build")

---
 arch/m68k/sun3/mmu_emu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/m68k/sun3/mmu_emu.c +2 -1
index 119bd32efcfbc..7b15cc12637bf 100644
@@ -17,6 +17,7 @@
 #include <linux/bitops.h>
 #include <linux/module.h>
 #include <linux/sched/mm.h>
+#include <linux/string_choices.h>
 
 #include <asm/setup.h>
 #include <asm/traps.h>
@@ -371,7 +372,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 
 #ifdef DEBUG_MMU_EMU
 	pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
-		read_flag ? "read" : "write", crp);
+		str_read_write(read_flag), crp);
 #endif
 
 	segment = (vaddr >> SUN3_PMEG_SIZE_BITS) & 0x7FF;
Signature · 1 line
2.39.5
author maintainer
#5 lore raw

PATCH 5/731 m68k: sun3: Fix DEBUG_MMU_EMU build

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 723be3c6ab31b320afe0075e2eb9b8dd41f3b6d1 ]

With DEBUG_MMU_EMU enabled:

arch/m68k/sun3/mmu_emu.c: In function ‘mmu_emu_handle_fault’:
arch/m68k/sun3/mmu_emu.c:420:38: error: implicit declaration of function ‘get_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
420 | pr_info("seg:%ld crp:%p ->", get_fs().seg, crp);
| ^~~~~~

[...]

arch/m68k/sun3/mmu_emu.c:420:46: error: request for member ‘seg’ in something not a structure or union
420 | pr_info("seg:%ld crp:%p ->", get_fs().seg, crp);
| ^

Fix this by reintroducing and using a helper to retrieve the current value of the DFC register.

While at it, replace "%p" by "%px", as there is no point in printing obfuscated pointers during debugging.

---
 arch/m68k/include/asm/processor.h | 14 ++++++++++++++
 arch/m68k/sun3/mmu_emu.c          |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)
arch/m68k/include/asm/processor.h +14 -0
index 8f2676c3a9882..3c43c09d44894 100644
@@ -95,10 +95,24 @@ static inline void set_fc(unsigned long val)
 			      "movec %0,%/dfc\n\t"
 			      : /* no outputs */ : "r" (val) : "memory");
 }
+
+static inline unsigned long get_fc(void)
+{
+	unsigned long val;
+
+	__asm__ ("movec %/dfc,%0" : "=r" (val) : );
+
+	return val;
+}
 #else
 static inline void set_fc(unsigned long val)
 {
 }
+
+static inline unsigned long get_fc(void)
+{
+	return USER_DATA;
+}
 #endif /* CONFIG_CPU_HAS_ADDRESS_SPACES */
 
 struct thread_struct {
arch/m68k/sun3/mmu_emu.c +2 -2
index 7b15cc12637bf..b39fc3717d8ea 100644
@@ -371,7 +371,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 	}
 
 #ifdef DEBUG_MMU_EMU
-	pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
+	pr_info("%s: vaddr=%lx type=%s crp=%px\n", __func__, vaddr,
 		str_read_write(read_flag), crp);
 #endif
 
@@ -418,7 +418,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 		pte_val (*pte) |= SUN3_PAGE_ACCESSED;
 
 #ifdef DEBUG_MMU_EMU
-	pr_info("seg:%ld crp:%p ->", get_fs().seg, crp);
+	pr_info("seg:%ld crp:%px ->", get_fc(), crp);
 	print_pte_vaddr (vaddr);
 	pr_cont("\n");
 #endif
Signature · 1 line
2.39.5
author maintainer
#6 lore raw

PATCH 6/731 cpufreq: scpi: compare kHz instead of Hz

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: zuoqian <[email protected]>

[ Upstream commit 4742da9774a416908ef8e3916164192c15c0e2d1 ]

The CPU rate from clk_get_rate() may not be divisible by 1000 (e.g., 133333333). But the rate calculated from frequency(kHz) is always divisible by 1000 (e.g., 133333000).
Comparing the rate causes a warning during CPU scaling:
"cpufreq: __target_index: Failed to change cpu frequency: -5". When we choose to compare kHz here, the issue does not occur.

Fixes 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")
---
 drivers/cpufreq/scpi-cpufreq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/cpufreq/scpi-cpufreq.c +3 -2
index cd89c1b9832c0..9e09565e41c09 100644
@@ -39,8 +39,9 @@ static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
 static int
 scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
 {
-	u64 rate = policy->freq_table[index].frequency * 1000;
+	unsigned long freq_khz = policy->freq_table[index].frequency;
 	struct scpi_data *priv = policy->driver_data;
+	unsigned long rate = freq_khz * 1000;
 	int ret;
 
 	ret = clk_set_rate(priv->clk, rate);
@@ -48,7 +49,7 @@ scpi_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int index)
 	if (ret)
 		return ret;
 
-	if (clk_get_rate(priv->clk) != rate)
+	if (clk_get_rate(priv->clk) / 1000 != freq_khz)
 		return -EIO;
 
 	return 0;
Signature · 1 line
2.39.5
author maintainer
#7 lore raw

PATCH 7/731 seccomp: fix the __secure_computing() stub for !HAVE_ARCH_SECCOMP_FILTER

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Oleg Nesterov <[email protected]>

[ Upstream commit b37778bec82ba82058912ca069881397197cd3d5 ]

Depending on CONFIG_HAVE_ARCH_SECCOMP_FILTER, __secure_computing(NULL) will crash or not. This is not consistent/safe, especially considering that after the previous change __secure_computing(sd) is always called with sd == NULL.

Fortunately, if CONFIG_HAVE_ARCH_SECCOMP_FILTER=n, __secure_computing() has no callers, these architectures use secure_computing_strict(). Yet it make sense make __secure_computing(NULL) safe in this case.

Note also that with this change we can unexport secure_computing_strict() and change the current callers to use __secure_computing(NULL).

Fixes 8cf8dfceebda ("seccomp: Stub for !HAVE_ARCH_SECCOMP_FILTER")
---
 include/linux/seccomp.h |  8 ++------
 kernel/seccomp.c        | 14 ++++++++++----
 2 files changed, 12 insertions(+), 10 deletions(-)
include/linux/seccomp.h +2 -6
index e45531455d3bb..d55949071c30e 100644
@@ -22,8 +22,9 @@
 #include <linux/atomic.h>
 #include <asm/seccomp.h>
 
-#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
 extern int __secure_computing(const struct seccomp_data *sd);
+
+#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
 static inline int secure_computing(void)
 {
 	if (unlikely(test_syscall_work(SECCOMP)))
@@ -32,11 +33,6 @@ static inline int secure_computing(void)
 }
 #else
 extern void secure_computing_strict(int this_syscall);
-static inline int __secure_computing(const struct seccomp_data *sd)
-{
-	secure_computing_strict(sd->nr);
-	return 0;
-}
 #endif
 
 extern long prctl_get_seccomp(void);
kernel/seccomp.c +10 -4
index 7bbb408431ebc..3231f63d93d89 100644
@@ -29,13 +29,11 @@
 #include <linux/syscalls.h>
 #include <linux/sysctl.h>
 
+#include <asm/syscall.h>
+
 /* Not exposed in headers: strictly internal use only. */
 #define SECCOMP_MODE_DEAD	(SECCOMP_MODE_FILTER + 1)
 
-#ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
-#include <asm/syscall.h>
-#endif
-
 #ifdef CONFIG_SECCOMP_FILTER
 #include <linux/file.h>
 #include <linux/filter.h>
@@ -1074,6 +1072,14 @@ void secure_computing_strict(int this_syscall)
 	else
 		BUG();
 }
+int __secure_computing(const struct seccomp_data *sd)
+{
+	int this_syscall = sd ? sd->nr :
+		syscall_get_nr(current, current_pt_regs());
+
+	secure_computing_strict(this_syscall);
+	return 0;
+}
 #else
 
 #ifdef CONFIG_SECCOMP_FILTER
Signature · 1 line
2.39.5
author maintainer
#8 lore raw

PATCH 8/731 smack: dont compile ipv6 code unless ipv6 is configured

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Konstantin Andreev <[email protected]>

[ Upstream commit bfcf4004bcbce2cb674b4e8dbd31ce0891766bac ]

I want to be sure that ipv6-specific code
is not compiled in kernel binaries
if ipv6 is not configured.

[1] was getting rid of "unused variable" warning, but, with that, it also mandated compilation of a handful ipv6- specific functions in ipv4-only kernel configurations:

smk_ipv6_localhost, smack_ipv6host_label, smk_ipv6_check.

Their compiled bodies are likely to be removed by compiler from the resulting binary, but, to be on the safe side, I remove them from the compiler view.

[1]
Fixes 00720f0e7f28 ("smack: avoid unused 'sip' variable warning")
---
 security/smack/smack.h     |  6 ++++++
 security/smack/smack_lsm.c | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
security/smack/smack.h +6 -0
index 4608b07607a3d..c4d998972ba56 100644
@@ -152,6 +152,7 @@ struct smk_net4addr {
 	struct smack_known	*smk_label;	/* label */
 };
 
+#if IS_ENABLED(CONFIG_IPV6)
 /*
  * An entry in the table identifying IPv6 hosts.
  */
@@ -162,7 +163,9 @@ struct smk_net6addr {
 	int			smk_masks;	/* mask size */
 	struct smack_known	*smk_label;	/* label */
 };
+#endif /* CONFIG_IPV6 */
 
+#ifdef SMACK_IPV6_PORT_LABELING
 /*
  * An entry in the table identifying ports.
  */
@@ -175,6 +178,7 @@ struct smk_port_label {
 	short			smk_sock_type;	/* Socket type */
 	short			smk_can_reuse;
 };
+#endif /* SMACK_IPV6_PORT_LABELING */
 
 struct smack_known_list_elem {
 	struct list_head	list;
@@ -315,7 +319,9 @@ extern struct smack_known smack_known_web;
 extern struct mutex	smack_known_lock;
 extern struct list_head smack_known_list;
 extern struct list_head smk_net4addr_list;
+#if IS_ENABLED(CONFIG_IPV6)
 extern struct list_head smk_net6addr_list;
+#endif /* CONFIG_IPV6 */
 
 extern struct mutex     smack_onlycap_lock;
 extern struct list_head smack_onlycap_list;
security/smack/smack_lsm.c +9 -1
index 239773cdcdcf4..85f3d4337ca19 100644
@@ -2492,6 +2492,7 @@ static struct smack_known *smack_ipv4host_label(struct sockaddr_in *sip)
 	return NULL;
 }
 
+#if IS_ENABLED(CONFIG_IPV6)
 /*
  * smk_ipv6_localhost - Check for local ipv6 host address
  * @sip: the address
@@ -2559,6 +2560,7 @@ static struct smack_known *smack_ipv6host_label(struct sockaddr_in6 *sip)
 
 	return NULL;
 }
+#endif /* CONFIG_IPV6 */
 
 /**
  * smack_netlbl_add - Set the secattr on a socket
@@ -2663,6 +2665,7 @@ static int smk_ipv4_check(struct sock *sk, struct sockaddr_in *sap)
 	return rc;
 }
 
+#if IS_ENABLED(CONFIG_IPV6)
 /**
  * smk_ipv6_check - check Smack access
  * @subject: subject Smack label
@@ -2695,6 +2698,7 @@ static int smk_ipv6_check(struct smack_known *subject,
 	rc = smk_bu_note("IPv6 check", subject, object, MAY_WRITE, rc);
 	return rc;
 }
+#endif /* CONFIG_IPV6 */
 
 #ifdef SMACK_IPV6_PORT_LABELING
 /**
@@ -3027,7 +3031,9 @@ static int smack_socket_connect(struct socket *sock, struct sockaddr *sap,
 		return 0;
 	if (addrlen < offsetofend(struct sockaddr, sa_family))
 		return 0;
-	if (IS_ENABLED(CONFIG_IPV6) && sap->sa_family == AF_INET6) {
+
+#if IS_ENABLED(CONFIG_IPV6)
+	if (sap->sa_family == AF_INET6) {
 		struct sockaddr_in6 *sip = (struct sockaddr_in6 *)sap;
 		struct smack_known *rsp = NULL;
 
@@ -3047,6 +3053,8 @@ static int smack_socket_connect(struct socket *sock, struct sockaddr *sap,
 
 		return rc;
 	}
+#endif /* CONFIG_IPV6 */
+
 	if (sap->sa_family != AF_INET || addrlen < sizeof(struct sockaddr_in))
 		return 0;
 	rc = smk_ipv4_check(sock->sk, (struct sockaddr_in *)sap);
Signature · 1 line
2.39.5
author maintainer
#9 lore raw

PATCH 9/731 smack: ipv4/ipv6: tcp/dccp/sctp: fix incorrect child socket label

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Konstantin Andreev <[email protected]>

[ Upstream commit 6cce0cc3861337b3ad8d4ac131d6e47efa0954ec ]

Since inception [1], SMACK initializes ipv* child socket security for connection-oriented communications (tcp/sctp/dccp) during accept() syscall, in the security_sock_graft() hook:

| void smack_sock_graft(struct sock *sk, ...)
| {
|     // only ipv4 and ipv6 are eligible here
|     // ...
|     ssp = sk->sk_security; // socket security
|     ssp->smk_in = skp;     // process label: smk_of_current()
|     ssp->smk_out = skp;    // process label: smk_of_current()
| }

This approach is incorrect for two reasons:

A) initialization occurs too late for child socket security:

The child socket is created by the kernel once the handshake completes (e.g., for tcp: after receiving ack for syn+ack).

Data can legitimately start arriving to the child socket immediately, long before the application calls accept() on the socket.

Those data are (currently — were) processed by SMACK using incorrect child socket security attributes.

B) Incoming connection requests are handled using the listening socket's security, hence, the child socket must inherit the listening socket's security attributes.

smack_sock_graft() initilizes the child socket's security with a process label, as is done for a new socket()

But ... the process label is not necessarily the same as the listening socket label. A privileged application may legitimately set other in/out labels for a listening socket.

When this happens, SMACK processes incoming packets using incorrect socket security attributes.

In [2] Michael Lontke noticed (A) and fixed it in [3] by adding socket initialization into security_sk_clone_security() hook like

| void smack_sk_clone_security(struct sock *oldsk, struct sock *newsk)
| {
|    *(struct socket_smack *)newsk->sk_security =
|    *(struct socket_smack *)oldsk->sk_security;
| }

This initializes the child socket security with the parent (listening) socket security at the appropriate time.

I was forced to revisit this old story because

smack_sock_graft() was left in place by [3] and continues overwriting the child socket's labels with the process label,
and there might be a reason for this, so I undertook a study.

If the process label differs from the listening socket's labels, the following occurs for ipv4:

assigning the smk_out is not accompanied by netlbl_sock_setattr, so the outgoing packet's cipso label does not change.

So, the only effect of this assignment for interhost communications is a divergence between the program-visible “out” socket label and the cipso network label. For intrahost communications this label, however, becomes visible via secmark netfilter marking, and is checked for access rights by the client, receiving side.

Assigning the smk_in affects both interhost and intrahost
communications: the server begins to check access rights against an wrong label.

Access check against wrong label (smk_in or smk_out), unsurprisingly fails, breaking the connection.

The above affects protocols that calls security_sock_graft() during accept(), namely: {tcp,dccp,sctp}/{ipv4,ipv6}
One extra security_sock_graft() caller, crypto/af_alg.c`af_alg_accept is not affected, because smack_sock_graft() does nothing for PF_ALG.

To reproduce, assign non-default in/out labels to a listening socket, setup rules between these labels and client label, attempt to connect and send some data.

Ipv6 specific: ipv6 packets do not convey SMACK labels. To reproduce the issue in interhost communications set opposite labels in /smack/ipv6host on both hosts.
Ipv6 intrahost communications do not require tricking, because SMACK labels are conveyed via secmark netfilter marking.

So, currently smack_sock_graft() is not useful, but harmful, therefore, I have removed it.

This fixes the issue for {tcp,dccp}/{ipv4,ipv6},
but not sctp/{ipv4,ipv6}.

Although this change is necessary for sctp+smack to function correctly, it is not sufficient because:
sctp/ipv4 does not call security_sk_clone() and sctp/ipv6 ignores SMACK completely.

These are separate issues, belong to other subsystem, and should be addressed separately.

[1] 2008-02-04,

Fixes e114e473771c ("Smack: Simplified Mandatory Access Control Kernel")

[2] Michael Lontke, 2022-08-31, SMACK LSM checks wrong object label during ingress network traffic

[3] 2022-08-31, michael.lontke,
commit 4ca165fc6c49 ("SMACK: Add sk_clone_security LSM hook")

---
 security/smack/smack_lsm.c | 24 ------------------------
 1 file changed, 24 deletions(-)
security/smack/smack_lsm.c +0 -24
index 85f3d4337ca19..e68c982e499eb 100644
@@ -4350,29 +4350,6 @@ static int smack_socket_getpeersec_dgram(struct socket *sock,
 	return 0;
 }
 
-/**
- * smack_sock_graft - Initialize a newly created socket with an existing sock
- * @sk: child sock
- * @parent: parent socket
- *
- * Set the smk_{in,out} state of an existing sock based on the process that
- * is creating the new socket.
- */
-static void smack_sock_graft(struct sock *sk, struct socket *parent)
-{
-	struct socket_smack *ssp;
-	struct smack_known *skp = smk_of_current();
-
-	if (sk == NULL ||
-	    (sk->sk_family != PF_INET && sk->sk_family != PF_INET6))
-		return;
-
-	ssp = smack_sock(sk);
-	ssp->smk_in = skp;
-	ssp->smk_out = skp;
-	/* cssp->smk_packet is already set in smack_inet_csk_clone() */
-}
-
 /**
  * smack_inet_conn_request - Smack access check on connect
  * @sk: socket involved
@@ -5187,7 +5164,6 @@ static struct security_hook_list smack_hooks[] __ro_after_init = {
 	LSM_HOOK_INIT(sk_free_security, smack_sk_free_security),
 #endif
 	LSM_HOOK_INIT(sk_clone_security, smack_sk_clone_security),
-	LSM_HOOK_INIT(sock_graft, smack_sock_graft),
 	LSM_HOOK_INIT(inet_conn_request, smack_inet_conn_request),
 	LSM_HOOK_INIT(inet_csk_clone, smack_inet_csk_clone),
 
Signature · 1 line
2.39.5
author maintainer
#10 lore raw

PATCH 10/731 sched: Cancel the slice protection of the idle entity

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: zihan zhou <[email protected]>

[ Upstream commit f553741ac8c0e467a3b873e305f34b902e50b86d ]

A wakeup non-idle entity should preempt idle entity at any time, but because of the slice protection of the idle entity, the non-idle entity has to wait, so just cancel it.

This patch is aimed at minimizing the impact of SCHED_IDLE on SCHED_NORMAL. For example, a task with SCHED_IDLE policy that sleeps for 1s and then runs for 3 ms, running cyclictest on the same cpu, has a maximum latency of 3 ms, which is caused by the slice protection of the idle entity. It is unreasonable. With this patch, the cyclictest latency under the same conditions is basically the same on the cpu with idle processes and on empty cpu.

---
 kernel/sched/fair.c | 46 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 33 insertions(+), 13 deletions(-)
kernel/sched/fair.c +33 -13
index c798d27952431..61a5d08ac3324 100644
@@ -883,6 +883,26 @@ struct sched_entity *__pick_first_entity(struct cfs_rq *cfs_rq)
 	return __node_2_se(left);
 }
 
+/*
+ * HACK, stash a copy of deadline at the point of pick in vlag,
+ * which isn't used until dequeue.
+ */
+static inline void set_protect_slice(struct sched_entity *se)
+{
+	se->vlag = se->deadline;
+}
+
+static inline bool protect_slice(struct sched_entity *se)
+{
+	return se->vlag == se->deadline;
+}
+
+static inline void cancel_protect_slice(struct sched_entity *se)
+{
+	if (protect_slice(se))
+		se->vlag = se->deadline + 1;
+}
+
 /*
  * Earliest Eligible Virtual Deadline First
  *
@@ -919,11 +939,7 @@ static struct sched_entity *pick_eevdf(struct cfs_rq *cfs_rq)
 	if (curr && (!curr->on_rq || !entity_eligible(cfs_rq, curr)))
 		curr = NULL;
 
-	/*
-	 * Once selected, run a task until it either becomes non-eligible or
-	 * until it gets a new slice. See the HACK in set_next_entity().
-	 */
-	if (sched_feat(RUN_TO_PARITY) && curr && curr->vlag == curr->deadline)
+	if (sched_feat(RUN_TO_PARITY) && curr && protect_slice(curr))
 		return curr;
 
 	/* Pick the leftmost entity if it's eligible */
@@ -5530,11 +5546,8 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
 		update_stats_wait_end_fair(cfs_rq, se);
 		__dequeue_entity(cfs_rq, se);
 		update_load_avg(cfs_rq, se, UPDATE_TG);
-		/*
-		 * HACK, stash a copy of deadline at the point of pick in vlag,
-		 * which isn't used until dequeue.
-		 */
-		se->vlag = se->deadline;
+
+		set_protect_slice(se);
 	}
 
 	update_stats_curr_start(cfs_rq, se);
@@ -8783,8 +8796,15 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
 	 * Preempt an idle entity in favor of a non-idle entity (and don't preempt
 	 * in the inverse case).
 	 */
-	if (cse_is_idle && !pse_is_idle)
+	if (cse_is_idle && !pse_is_idle) {
+		/*
+		 * When non-idle entity preempt an idle entity,
+		 * don't give idle entity slice protection.
+		 */
+		cancel_protect_slice(se);
 		goto preempt;
+	}
+
 	if (cse_is_idle != pse_is_idle)
 		return;
 
@@ -8803,8 +8823,8 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
 	 * Note that even if @p does not turn out to be the most eligible
 	 * task at this moment, current's slice protection will be lost.
 	 */
-	if (do_preempt_short(cfs_rq, pse, se) && se->vlag == se->deadline)
-		se->vlag = se->deadline + 1;
+	if (do_preempt_short(cfs_rq, pse, se))
+		cancel_protect_slice(se);
 
 	/*
 	 * If @p has become the most eligible task, force preemption.
Signature · 1 line
2.39.5
author maintainer
#11 lore raw

PATCH 11/731 sched/eevdf: Force propagating min_slice of cfs_rq when {en,de}queue tasks

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Tianchen Ding <[email protected]>

[ Upstream commit 563bc2161b94571ea425bbe2cf69fd38e24cdedf ]

When a task is enqueued and its parent cgroup se is already on_rq, this parent cgroup se will not be enqueued again, and hence the root->min_slice leaves unchanged. The same issue happens when a task is dequeued and its parent cgroup se has other runnable entities, and the parent cgroup se will not be dequeued.

Force propagating min_slice when se doesn't need to be enqueued or dequeued. Ensure the se hierarchy always get the latest min_slice.

Fixes aef6987d8954 ("sched/eevdf: Propagate min_slice up the cgroup hierarchy")
---
 kernel/sched/fair.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/sched/fair.c +4 -0
index 61a5d08ac3324..89c7260103e18 100644
@@ -7004,6 +7004,8 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
 		update_cfs_group(se);
 
 		se->slice = slice;
+		if (se != cfs_rq->curr)
+			min_vruntime_cb_propagate(&se->run_node, NULL);
 		slice = cfs_rq_min_slice(cfs_rq);
 
 		cfs_rq->h_nr_runnable += h_nr_runnable;
@@ -7133,6 +7135,8 @@ static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags)
 		update_cfs_group(se);
 
 		se->slice = slice;
+		if (se != cfs_rq->curr)
+			min_vruntime_cb_propagate(&se->run_node, NULL);
 		slice = cfs_rq_min_slice(cfs_rq);
 
 		cfs_rq->h_nr_runnable -= h_nr_runnable;
Signature · 1 line
2.39.5
author maintainer
#12 lore raw

PATCH 12/731 cpufreq: governor: Fix negative idle_time handling in dbs_update()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jie Zhan <[email protected]>

[ Upstream commit 3698dd6b139dc37b35a9ad83d9330c1f99666c02 ]

We observed an issue that the CPU frequency can't raise up with a 100% CPU load when NOHZ is off and the 'conservative' governor is selected.

'idle_time' can be negative if it's obtained from get_cpu_idle_time_jiffy() when NOHZ is off. This was found and explained in commit 9485e4ca0b48 ("cpufreq: governor: Fix handling of special cases in dbs_update()").

However, commit 7592019634f8 ("cpufreq: governors: Fix long idle detection logic in load calculation") introduced a comparison between 'idle_time' and 'samling_rate' to detect a long idle interval. While 'idle_time' is converted to int before comparison, it's actually promoted to unsigned again when compared with an unsigned 'sampling_rate'. Hence, this leads to wrong idle interval detection when it's in fact 100% busy and sets policy_dbs->idle_periods to a very large value. 'conservative' adjusts the frequency to minimum because of the large 'idle_periods', such that the frequency can't raise up. 'Ondemand' doesn't use policy_dbs->idle_periods so it fortunately avoids the issue.

Correct negative 'idle_time' to 0 before any use of it in dbs_update().

Fixes 7592019634f8 ("cpufreq: governors: Fix long idle detection logic in load calculation")
---
 drivers/cpufreq/cpufreq_governor.c | 45 +++++++++++++++---------------
 1 file changed, 23 insertions(+), 22 deletions(-)
drivers/cpufreq/cpufreq_governor.c +23 -22
index af44ee6a64304..1a7fcaf39cc9b 100644
@@ -145,7 +145,23 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
 		time_elapsed = update_time - j_cdbs->prev_update_time;
 		j_cdbs->prev_update_time = update_time;
 
-		idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
+		/*
+		 * cur_idle_time could be smaller than j_cdbs->prev_cpu_idle if
+		 * it's obtained from get_cpu_idle_time_jiffy() when NOHZ is
+		 * off, where idle_time is calculated by the difference between
+		 * time elapsed in jiffies and "busy time" obtained from CPU
+		 * statistics.  If a CPU is 100% busy, the time elapsed and busy
+		 * time should grow with the same amount in two consecutive
+		 * samples, but in practice there could be a tiny difference,
+		 * making the accumulated idle time decrease sometimes.  Hence,
+		 * in this case, idle_time should be regarded as 0 in order to
+		 * make the further process correct.
+		 */
+		if (cur_idle_time > j_cdbs->prev_cpu_idle)
+			idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
+		else
+			idle_time = 0;
+
 		j_cdbs->prev_cpu_idle = cur_idle_time;
 
 		if (ignore_nice) {
@@ -162,7 +178,7 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
 			 * calls, so the previous load value can be used then.
 			 */
 			load = j_cdbs->prev_load;
-		} else if (unlikely((int)idle_time > 2 * sampling_rate &&
+		} else if (unlikely(idle_time > 2 * sampling_rate &&
 				    j_cdbs->prev_load)) {
 			/*
 			 * If the CPU had gone completely idle and a task has
@@ -189,30 +205,15 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
 			load = j_cdbs->prev_load;
 			j_cdbs->prev_load = 0;
 		} else {
-			if (time_elapsed >= idle_time) {
+			if (time_elapsed > idle_time)
 				load = 100 * (time_elapsed - idle_time) / time_elapsed;
-			} else {
-				/*
-				 * That can happen if idle_time is returned by
-				 * get_cpu_idle_time_jiffy().  In that case
-				 * idle_time is roughly equal to the difference
-				 * between time_elapsed and "busy time" obtained
-				 * from CPU statistics.  Then, the "busy time"
-				 * can end up being greater than time_elapsed
-				 * (for example, if jiffies_64 and the CPU
-				 * statistics are updated by different CPUs),
-				 * so idle_time may in fact be negative.  That
-				 * means, though, that the CPU was busy all
-				 * the time (on the rough average) during the
-				 * last sampling interval and 100 can be
-				 * returned as the load.
-				 */
-				load = (int)idle_time < 0 ? 100 : 0;
-			}
+			else
+				load = 0;
+
 			j_cdbs->prev_load = load;
 		}
 
-		if (unlikely((int)idle_time > 2 * sampling_rate)) {
+		if (unlikely(idle_time > 2 * sampling_rate)) {
 			unsigned int periods = idle_time / sampling_rate;
 
 			if (periods < idle_periods)
Signature · 1 line
2.39.5
author maintainer
#13 lore raw

PATCH 13/731 EDAC/igen6: Fix the flood of invalid error reports

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit 267e5b1d267539d9a927dc04aab6f15aca57da92 ]

The ECC_ERROR_LOG register of certain SoCs may contain the invalid value ~0, which results in a flood of invalid error reports in polling mode.

Fix the flood of invalid error reports by skipping the invalid ECC error log value ~0.

---
 drivers/edac/igen6_edac.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/edac/igen6_edac.c +15 -6
index fdf3a84fe6988..595908af9e5c9 100644
@@ -785,13 +785,22 @@ static u64 ecclog_read_and_clear(struct igen6_imc *imc)
 {
 	u64 ecclog = readq(imc->window + ECC_ERROR_LOG_OFFSET);
 
-	if (ecclog & (ECC_ERROR_LOG_CE | ECC_ERROR_LOG_UE)) {
-		/* Clear CE/UE bits by writing 1s */
-		writeq(ecclog, imc->window + ECC_ERROR_LOG_OFFSET);
-		return ecclog;
-	}
+	/*
+	 * Quirk: The ECC_ERROR_LOG register of certain SoCs may contain
+	 *        the invalid value ~0. This will result in a flood of invalid
+	 *        error reports in polling mode. Skip it.
+	 */
+	if (ecclog == ~0)
+		return 0;
 
-	return 0;
+	/* Neither a CE nor a UE. Skip it.*/
+	if (!(ecclog & (ECC_ERROR_LOG_CE | ECC_ERROR_LOG_UE)))
+		return 0;
+
+	/* Clear CE/UE bits by writing 1s */
+	writeq(ecclog, imc->window + ECC_ERROR_LOG_OFFSET);
+
+	return ecclog;
 }
 
 static void errsts_clear(struct igen6_imc *imc)
Signature · 1 line
2.39.5
author maintainer
#14 lore raw

PATCH 14/731 EDAC/{skx_common,i10nm}: Fix some missing error reports on Emerald Rapids

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit d9207cf7760f5f5599e9ff7eb0fedf56821a1d59 ]

When doing error injection to some memory DIMMs on certain Intel Emerald Rapids servers, the i10nm_edac missed error reports for some memory DIMMs.

Certain BIOS configurations may hide some memory controllers, and the i10nm_edac doesn't enumerate these hidden memory controllers. However, the ADXL decodes memory errors using memory controller physical indices even if there are hidden memory controllers. Therefore, the memory controller physical indices reported by the ADXL may mismatch the logical indices enumerated by the i10nm_edac, resulting in missed error reports for some memory DIMMs.

Fix this issue by creating a mapping table from memory controller physical indices (used by the ADXL) to logical indices (used by the i10nm_edac) and using it to convert the physical indices to the logical indices during the error handling process.

---
 drivers/edac/i10nm_base.c |  2 ++
 drivers/edac/skx_common.c | 33 +++++++++++++++++++++++++++++++++
 drivers/edac/skx_common.h | 11 +++++++++++
 3 files changed, 46 insertions(+)
drivers/edac/i10nm_base.c +2 -0
index f45d849d3f150..355a977019e94 100644
@@ -751,6 +751,8 @@ static int i10nm_get_ddr_munits(void)
 				continue;
 			} else {
 				d->imc[lmc].mdev = mdev;
+				if (res_cfg->type == SPR)
+					skx_set_mc_mapping(d, i, lmc);
 				lmc++;
 			}
 		}
drivers/edac/skx_common.c +33 -0
index f7bd930e058fe..fa5b442b18449 100644
@@ -121,6 +121,35 @@ void skx_adxl_put(void)
 }
 EXPORT_SYMBOL_GPL(skx_adxl_put);
 
+static void skx_init_mc_mapping(struct skx_dev *d)
+{
+	/*
+	 * By default, the BIOS presents all memory controllers within each
+	 * socket to the EDAC driver. The physical indices are the same as
+	 * the logical indices of the memory controllers enumerated by the
+	 * EDAC driver.
+	 */
+	for (int i = 0; i < NUM_IMC; i++)
+		d->mc_mapping[i] = i;
+}
+
+void skx_set_mc_mapping(struct skx_dev *d, u8 pmc, u8 lmc)
+{
+	edac_dbg(0, "Set the mapping of mc phy idx to logical idx: %02d -> %02d\n",
+		 pmc, lmc);
+
+	d->mc_mapping[pmc] = lmc;
+}
+EXPORT_SYMBOL_GPL(skx_set_mc_mapping);
+
+static u8 skx_get_mc_mapping(struct skx_dev *d, u8 pmc)
+{
+	edac_dbg(0, "Get the mapping of mc phy idx to logical idx: %02d -> %02d\n",
+		 pmc, d->mc_mapping[pmc]);
+
+	return d->mc_mapping[pmc];
+}
+
 static bool skx_adxl_decode(struct decoded_addr *res, enum error_source err_src)
 {
 	struct skx_dev *d;
@@ -188,6 +217,8 @@ static bool skx_adxl_decode(struct decoded_addr *res, enum error_source err_src)
 		return false;
 	}
 
+	res->imc = skx_get_mc_mapping(d, res->imc);
+
 	for (i = 0; i < adxl_component_count; i++) {
 		if (adxl_values[i] == ~0x0ull)
 			continue;
@@ -326,6 +357,8 @@ int skx_get_all_bus_mappings(struct res_config *cfg, struct list_head **list)
 			 d->bus[0], d->bus[1], d->bus[2], d->bus[3]);
 		list_add_tail(&d->list, &dev_edac_list);
 		prev = pdev;
+
+		skx_init_mc_mapping(d);
 	}
 
 	if (list)
drivers/edac/skx_common.h +11 -0
index b0845bdd45164..ca5408803f878 100644
@@ -93,6 +93,16 @@ struct skx_dev {
 	struct pci_dev *uracu; /* for i10nm CPU */
 	struct pci_dev *pcu_cr3; /* for HBM memory detection */
 	u32 mcroute;
+	/*
+	 * Some server BIOS may hide certain memory controllers, and the
+	 * EDAC driver skips those hidden memory controllers. However, the
+	 * ADXL still decodes memory error address using physical memory
+	 * controller indices. The mapping table is used to convert the
+	 * physical indices (reported by ADXL) to the logical indices
+	 * (used the EDAC driver) of present memory controllers during the
+	 * error handling process.
+	 */
+	u8 mc_mapping[NUM_IMC];
 	struct skx_imc {
 		struct mem_ctl_info *mci;
 		struct pci_dev *mdev; /* for i10nm CPU */
@@ -242,6 +252,7 @@ void skx_adxl_put(void);
 void skx_set_decode(skx_decode_f decode, skx_show_retry_log_f show_retry_log);
 void skx_set_mem_cfg(bool mem_cfg_2lm);
 void skx_set_res_cfg(struct res_config *cfg);
+void skx_set_mc_mapping(struct skx_dev *d, u8 pmc, u8 lmc);
 
 int skx_get_src_id(struct skx_dev *d, int off, u8 *id);
 
Signature · 1 line
2.39.5
author maintainer
#15 lore raw

PATCH 15/731 x86/vdso: Fix latent bug in vclock_pages calculation

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 3ef32d90cdaa0cfa6c4ffd18f8d646a658163e3d ]

The vclock pages are *after* the non-vclock pages. Currently there are both two vclock and two non-vclock pages so the existing logic works by accident. As soon as the number of pages changes it will break however. This will be the case with the introduction of the generic vDSO data storage.

Use a macro to keep the calculation understandable and in sync between the linker script and mapping code.

Fixes e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping")
---
 arch/x86/entry/vdso/vdso-layout.lds.S | 2 +-
 arch/x86/entry/vdso/vma.c             | 2 +-
 arch/x86/include/asm/vdso/vsyscall.h  | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/entry/vdso/vdso-layout.lds.S +1 -1
index 872947c1004c3..918606ff92a98 100644
@@ -24,7 +24,7 @@ SECTIONS
 
 	timens_page  = vvar_start + PAGE_SIZE;
 
-	vclock_pages = vvar_start + VDSO_NR_VCLOCK_PAGES * PAGE_SIZE;
+	vclock_pages = VDSO_VCLOCK_PAGES_START(vvar_start);
 	pvclock_page = vclock_pages + VDSO_PAGE_PVCLOCK_OFFSET * PAGE_SIZE;
 	hvclock_page = vclock_pages + VDSO_PAGE_HVCLOCK_OFFSET * PAGE_SIZE;
 
arch/x86/entry/vdso/vma.c +1 -1
index 39e6efc1a9cab..aa62949335ece 100644
@@ -290,7 +290,7 @@ static int map_vdso(const struct vdso_image *image, unsigned long addr)
 	}
 
 	vma = _install_special_mapping(mm,
-				       addr + (__VVAR_PAGES - VDSO_NR_VCLOCK_PAGES) * PAGE_SIZE,
+				       VDSO_VCLOCK_PAGES_START(addr),
 				       VDSO_NR_VCLOCK_PAGES * PAGE_SIZE,
 				       VM_READ|VM_MAYREAD|VM_IO|VM_DONTDUMP|
 				       VM_PFNMAP,
arch/x86/include/asm/vdso/vsyscall.h +1 -0
index 37b4a70559a82..88b31d4cdfaf3 100644
@@ -6,6 +6,7 @@
 #define __VVAR_PAGES	4
 
 #define VDSO_NR_VCLOCK_PAGES	2
+#define VDSO_VCLOCK_PAGES_START(_b)	((_b) + (__VVAR_PAGES - VDSO_NR_VCLOCK_PAGES) * PAGE_SIZE)
 #define VDSO_PAGE_PVCLOCK_OFFSET	0
 #define VDSO_PAGE_HVCLOCK_OFFSET	1
 
Signature · 1 line
2.39.5
author maintainer
#16 lore raw

PATCH 16/731 x86/fpu: Fix guest FPU state buffer allocation size

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Stanislav Spassov <[email protected]>

[ Upstream commit 1937e18cc3cf27e2b3ef70e8c161437051ab7608 ]

Ongoing work on an optimization to batch-preallocate vCPU state buffers for KVM revealed a mismatch between the allocation sizes used in fpu_alloc_guest_fpstate() and fpstate_realloc(). While the former allocates a buffer sized to fit the default set of XSAVE features in UABI form (as per fpu_user_cfg), the latter uses its ksize argument derived (for the requested set of features) in the same way as the sizes found in fpu_kernel_cfg, i.e. using the compacted in-kernel representation.

The correct size to use for guest FPU state should indeed be the kernel one as seen in fpstate_realloc(). The original issue likely went unnoticed through a combination of UABI size typically being larger than or equal to kernel size, and/or both amounting to the same number of allocated 4K pages.

Fixes 69f6ed1d14c6 ("x86/fpu: Provide infrastructure for KVM FPU cleanup")
---
 arch/x86/kernel/fpu/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/fpu/core.c +1 -1
index 1209c7aebb211..36df548acc403 100644
@@ -220,7 +220,7 @@ bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu)
 	struct fpstate *fpstate;
 	unsigned int size;
 
-	size = fpu_user_cfg.default_size + ALIGN(offsetof(struct fpstate, regs), 64);
+	size = fpu_kernel_cfg.default_size + ALIGN(offsetof(struct fpstate, regs), 64);
 	fpstate = vzalloc(size);
 	if (!fpstate)
 		return false;
Signature · 1 line
2.39.5
author maintainer
#17 lore raw

PATCH 17/731 cpufreq/amd-pstate: Modify the min_perf calculation in adjust_perf callback

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dhananjay Ugwekar <[email protected]>

[ Upstream commit 6ceb877d5cecd5417d63239bf833a1cd5f8f271c ]

Instead of setting a fixed floor at lowest_nonlinear_perf, use the min_limit_perf value, so that it gives the user the freedom to lower the floor further.

There are two minimum frequency/perf limits that we need to consider in the adjust_perf callback. One provided by schedutil i.e. the sg_cpu->bw_min value passed in _min_perf arg, another is the effective value of min_freq_qos request that is updated in cpudata->min_limit_perf. Modify the code to use the bigger of these two values.

Stable-dep-of: 426db24d4db2 ("cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update")

---
 drivers/cpufreq/amd-pstate.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/cpufreq/amd-pstate.c +6 -6
index 313550fa62d41..17595a2454e1c 100644
@@ -672,7 +672,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
 				   unsigned long capacity)
 {
 	unsigned long max_perf, min_perf, des_perf,
-		      cap_perf, lowest_nonlinear_perf;
+		      cap_perf, min_limit_perf;
 	struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
 	struct amd_cpudata *cpudata;
 
@@ -684,20 +684,20 @@ static void amd_pstate_adjust_perf(unsigned int cpu,
 	if (policy->min != cpudata->min_limit_freq || policy->max != cpudata->max_limit_freq)
 		amd_pstate_update_min_max_limit(policy);
 
-
 	cap_perf = READ_ONCE(cpudata->highest_perf);
-	lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
+	min_limit_perf = READ_ONCE(cpudata->min_limit_perf);
 
 	des_perf = cap_perf;
 	if (target_perf < capacity)
 		des_perf = DIV_ROUND_UP(cap_perf * target_perf, capacity);
 
-	min_perf = READ_ONCE(cpudata->lowest_perf);
 	if (_min_perf < capacity)
 		min_perf = DIV_ROUND_UP(cap_perf * _min_perf, capacity);
+	else
+		min_perf = cap_perf;
 
-	if (min_perf < lowest_nonlinear_perf)
-		min_perf = lowest_nonlinear_perf;
+	if (min_perf < min_limit_perf)
+		min_perf = min_limit_perf;
 
 	max_perf = cpudata->max_limit_perf;
 	if (max_perf < min_perf)
Signature · 1 line
2.39.5
author maintainer
#18 lore raw

PATCH 18/731 cpufreq/amd-pstate: Pass min/max_limit_perf as min/max_perf to amd_pstate_update

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dhananjay Ugwekar <[email protected]>

[ Upstream commit e9869c836b2a460c48e2d69ae79d786303dbffda ]

Currently, amd_pstate_update_freq passes the hardware perf limits as min/max_perf to amd_pstate_update, which eventually gets programmed into the min/max_perf fields of the CPPC_REQ register.

Instead pass the effective perf limits i.e. min/max_limit_perf values to amd_pstate_update as min/max_perf.

Stable-dep-of: 426db24d4db2 ("cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update")

---
 drivers/cpufreq/amd-pstate.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/cpufreq/amd-pstate.c +4 -5
index 17595a2454e1c..3ef10aae0502f 100644
@@ -615,7 +615,7 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
 {
 	struct cpufreq_freqs freqs;
 	struct amd_cpudata *cpudata = policy->driver_data;
-	unsigned long max_perf, min_perf, des_perf, cap_perf;
+	unsigned long des_perf, cap_perf;
 
 	if (!cpudata->max_freq)
 		return -ENODEV;
@@ -624,8 +624,6 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
 		amd_pstate_update_min_max_limit(policy);
 
 	cap_perf = READ_ONCE(cpudata->highest_perf);
-	min_perf = READ_ONCE(cpudata->lowest_perf);
-	max_perf = cap_perf;
 
 	freqs.old = policy->cur;
 	freqs.new = target_freq;
@@ -642,8 +640,9 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
 	if (!fast_switch)
 		cpufreq_freq_transition_begin(policy, &freqs);
 
-	amd_pstate_update(cpudata, min_perf, des_perf,
-			max_perf, fast_switch, policy->governor->flags);
+	amd_pstate_update(cpudata, cpudata->min_limit_perf, des_perf,
+			  cpudata->max_limit_perf, fast_switch,
+			  policy->governor->flags);
 
 	if (!fast_switch)
 		cpufreq_freq_transition_end(policy, &freqs, false);
Signature · 1 line
2.39.5
author maintainer
#19 lore raw

PATCH 19/731 cpufreq/amd-pstate: Convert all perf values to u8

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dhananjay Ugwekar <[email protected]>

[ Upstream commit 555bbe67a622b297405e246d1868dbda3284bde8 ]

All perf values are always within 0-255 range, hence convert their datatype to u8 everywhere.

Stable-dep-of: 426db24d4db2 ("cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update")

---
 drivers/cpufreq/amd-pstate-trace.h | 46 +++++++++++------------
 drivers/cpufreq/amd-pstate.c       | 60 +++++++++++++++---------------
 drivers/cpufreq/amd-pstate.h       | 18 ++++-----
 3 files changed, 62 insertions(+), 62 deletions(-)
drivers/cpufreq/amd-pstate-trace.h +23 -23
index 8d692415d9050..f457d4af2c62e 100644
@@ -24,9 +24,9 @@
 
 TRACE_EVENT(amd_pstate_perf,
 
-	TP_PROTO(unsigned long min_perf,
-		 unsigned long target_perf,
-		 unsigned long capacity,
+	TP_PROTO(u8 min_perf,
+		 u8 target_perf,
+		 u8 capacity,
 		 u64 freq,
 		 u64 mperf,
 		 u64 aperf,
@@ -47,9 +47,9 @@ TRACE_EVENT(amd_pstate_perf,
 		),
 
 	TP_STRUCT__entry(
-		__field(unsigned long, min_perf)
-		__field(unsigned long, target_perf)
-		__field(unsigned long, capacity)
+		__field(u8, min_perf)
+		__field(u8, target_perf)
+		__field(u8, capacity)
 		__field(unsigned long long, freq)
 		__field(unsigned long long, mperf)
 		__field(unsigned long long, aperf)
@@ -70,10 +70,10 @@ TRACE_EVENT(amd_pstate_perf,
 		__entry->fast_switch = fast_switch;
 		),
 
-	TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u fast_switch=%s",
-		  (unsigned long)__entry->min_perf,
-		  (unsigned long)__entry->target_perf,
-		  (unsigned long)__entry->capacity,
+	TP_printk("amd_min_perf=%hhu amd_des_perf=%hhu amd_max_perf=%hhu freq=%llu mperf=%llu aperf=%llu tsc=%llu cpu_id=%u fast_switch=%s",
+		  (u8)__entry->min_perf,
+		  (u8)__entry->target_perf,
+		  (u8)__entry->capacity,
 		  (unsigned long long)__entry->freq,
 		  (unsigned long long)__entry->mperf,
 		  (unsigned long long)__entry->aperf,
@@ -86,10 +86,10 @@ TRACE_EVENT(amd_pstate_perf,
 TRACE_EVENT(amd_pstate_epp_perf,
 
 	TP_PROTO(unsigned int cpu_id,
-		 unsigned int highest_perf,
-		 unsigned int epp,
-		 unsigned int min_perf,
-		 unsigned int max_perf,
+		 u8 highest_perf,
+		 u8 epp,
+		 u8 min_perf,
+		 u8 max_perf,
 		 bool boost
 		 ),
 
@@ -102,10 +102,10 @@ TRACE_EVENT(amd_pstate_epp_perf,
 
 	TP_STRUCT__entry(
 		__field(unsigned int, cpu_id)
-		__field(unsigned int, highest_perf)
-		__field(unsigned int, epp)
-		__field(unsigned int, min_perf)
-		__field(unsigned int, max_perf)
+		__field(u8, highest_perf)
+		__field(u8, epp)
+		__field(u8, min_perf)
+		__field(u8, max_perf)
 		__field(bool, boost)
 		),
 
@@ -118,12 +118,12 @@ TRACE_EVENT(amd_pstate_epp_perf,
 		__entry->boost = boost;
 		),
 
-	TP_printk("cpu%u: [%u<->%u]/%u, epp=%u, boost=%u",
+	TP_printk("cpu%u: [%hhu<->%hhu]/%hhu, epp=%hhu, boost=%u",
 		  (unsigned int)__entry->cpu_id,
-		  (unsigned int)__entry->min_perf,
-		  (unsigned int)__entry->max_perf,
-		  (unsigned int)__entry->highest_perf,
-		  (unsigned int)__entry->epp,
+		  (u8)__entry->min_perf,
+		  (u8)__entry->max_perf,
+		  (u8)__entry->highest_perf,
+		  (u8)__entry->epp,
 		  (bool)__entry->boost
 		 )
 );
drivers/cpufreq/amd-pstate.c +30 -30

190 lines not on this page · raw message

drivers/cpufreq/amd-pstate.h +9 -9
index 9747e3be6ceee..19d405c6d805e 100644
@@ -70,13 +70,13 @@ struct amd_cpudata {
 	struct	freq_qos_request req[2];
 	u64	cppc_req_cached;
 
-	u32	highest_perf;
-	u32	nominal_perf;
-	u32	lowest_nonlinear_perf;
-	u32	lowest_perf;
-	u32     prefcore_ranking;
-	u32     min_limit_perf;
-	u32     max_limit_perf;
+	u8	highest_perf;
+	u8	nominal_perf;
+	u8	lowest_nonlinear_perf;
+	u8	lowest_perf;
+	u8	prefcore_ranking;
+	u8	min_limit_perf;
+	u8	max_limit_perf;
 	u32     min_limit_freq;
 	u32     max_limit_freq;
 
@@ -93,11 +93,11 @@ struct amd_cpudata {
 	bool	hw_prefcore;
 
 	/* EPP feature related attributes*/
-	s16	epp_cached;
+	u8	epp_cached;
 	u32	policy;
 	u64	cppc_cap1_cached;
 	bool	suspended;
-	s16	epp_default;
+	u8	epp_default;
 };
 
 /*
Signature · 1 line
2.39.5
author maintainer
#20 lore raw

PATCH 20/731 cpufreq/amd-pstate: Add missing NULL ptr check in amd_pstate_update

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dhananjay Ugwekar <[email protected]>

[ Upstream commit 426db24d4db2e4f0d6720aeb7795eafcb9e82640 ]

Check if policy is NULL before dereferencing it in amd_pstate_update.

---
 drivers/cpufreq/amd-pstate.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/cpufreq/amd-pstate.c +3 -0
index 32f1b659904bc..bd63837eabb4e 100644
@@ -538,6 +538,9 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u8 min_perf,
 	struct cpufreq_policy *policy = cpufreq_cpu_get(cpudata->cpu);
 	u8 nominal_perf = READ_ONCE(cpudata->nominal_perf);
 
+	if (!policy)
+		return;
+
 	des_perf = clamp_t(u8, des_perf, min_perf, max_perf);
 
 	max_freq = READ_ONCE(cpudata->max_limit_freq);
Signature · 1 line
2.39.5
author maintainer
#21 lore raw

PATCH 21/731 x86/fpu: Avoid copying dynamic FP state from init_task in arch_dup_task_struct()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Benjamin Berg <[email protected]>

[ Upstream commit 5d3b81d4d8520efe888536b6906dc10fd1a228a8 ]

The init_task instance of struct task_struct is statically allocated and may not contain the full FP state for userspace. As such, limit the copy to the valid area of both init_task and 'dst' and ensure all memory is initialized.

Note that the FP state is only needed for userspace, and as such it is entirely reasonable for init_task to not contain parts of it.

Fixes 5aaeb5c01c5b ("x86/fpu, sched: Introduce CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT and use it on x86")
Cc Andy Lutomirski <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Oleg Nesterov <[email protected]>

----

v2:
- Fix code if arch_task_struct_size < sizeof(init_task) by using memcpy_and_pad.

---
 arch/x86/kernel/process.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kernel/process.c +6 -1
index 6da6769d7254a..7cb52f84cb0c2 100644
@@ -93,7 +93,12 @@ EXPORT_PER_CPU_SYMBOL_GPL(__tss_limit_invalid);
  */
 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 {
-	memcpy(dst, src, arch_task_struct_size);
+	/* init_task is not dynamically sized (incomplete FPU state) */
+	if (unlikely(src == &init_task))
+		memcpy_and_pad(dst, arch_task_struct_size, src, sizeof(init_task), 0);
+	else
+		memcpy(dst, src, arch_task_struct_size);
+
 #ifdef CONFIG_VM86
 	dst->thread.vm86 = NULL;
 #endif
Signature · 1 line
2.39.5
author maintainer
#22 lore raw

PATCH 22/731 rseq: Update kernel fields in lockstep with CONFIG_DEBUG_RSEQ=y

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Michael Jeanson <[email protected]>

[ Upstream commit 79e10dad1ce3feac7937bedf911d92f486a9e76a ]

With CONFIG_DEBUG_RSEQ=y, an in-kernel copy of the read-only fields is kept synchronized with the user-space fields. Ensure the updates are done in lockstep in case we error out on a write to user-space.

Fixes 7d5265ffcd8b ("rseq: Validate read-only fields under DEBUG_RSEQ config")
---
 kernel/rseq.c | 80 +++++++++++++++++++++++++--------------------------
 1 file changed, 40 insertions(+), 40 deletions(-)
kernel/rseq.c +40 -40
index 2cb16091ec0ae..a7d81229eda04 100644
@@ -78,24 +78,24 @@ static int rseq_validate_ro_fields(struct task_struct *t)
 	return -EFAULT;
 }
 
-static void rseq_set_ro_fields(struct task_struct *t, u32 cpu_id_start, u32 cpu_id,
-			       u32 node_id, u32 mm_cid)
-{
-	rseq_kernel_fields(t)->cpu_id_start = cpu_id;
-	rseq_kernel_fields(t)->cpu_id = cpu_id;
-	rseq_kernel_fields(t)->node_id = node_id;
-	rseq_kernel_fields(t)->mm_cid = mm_cid;
-}
+/*
+ * Update an rseq field and its in-kernel copy in lock-step to keep a coherent
+ * state.
+ */
+#define rseq_unsafe_put_user(t, value, field, error_label)		\
+	do {								\
+		unsafe_put_user(value, &t->rseq->field, error_label);	\
+		rseq_kernel_fields(t)->field = value;			\
+	} while (0)
+
 #else
 static int rseq_validate_ro_fields(struct task_struct *t)
 {
 	return 0;
 }
 
-static void rseq_set_ro_fields(struct task_struct *t, u32 cpu_id_start, u32 cpu_id,
-			       u32 node_id, u32 mm_cid)
-{
-}
+#define rseq_unsafe_put_user(t, value, field, error_label)		\
+	unsafe_put_user(value, &t->rseq->field, error_label)
 #endif
 
 /*
@@ -173,17 +173,18 @@ static int rseq_update_cpu_node_id(struct task_struct *t)
 	WARN_ON_ONCE((int) mm_cid < 0);
 	if (!user_write_access_begin(rseq, t->rseq_len))
 		goto efault;
-	unsafe_put_user(cpu_id, &rseq->cpu_id_start, efault_end);
-	unsafe_put_user(cpu_id, &rseq->cpu_id, efault_end);
-	unsafe_put_user(node_id, &rseq->node_id, efault_end);
-	unsafe_put_user(mm_cid, &rseq->mm_cid, efault_end);
+
+	rseq_unsafe_put_user(t, cpu_id, cpu_id_start, efault_end);
+	rseq_unsafe_put_user(t, cpu_id, cpu_id, efault_end);
+	rseq_unsafe_put_user(t, node_id, node_id, efault_end);
+	rseq_unsafe_put_user(t, mm_cid, mm_cid, efault_end);
+
 	/*
 	 * Additional feature fields added after ORIG_RSEQ_SIZE
 	 * need to be conditionally updated only if
 	 * t->rseq_len != ORIG_RSEQ_SIZE.
 	 */
 	user_write_access_end();
-	rseq_set_ro_fields(t, cpu_id, cpu_id, node_id, mm_cid);
 	trace_rseq_update(t);
 	return 0;
 
@@ -195,6 +196,7 @@ static int rseq_update_cpu_node_id(struct task_struct *t)
 
 static int rseq_reset_rseq_cpu_node_id(struct task_struct *t)
 {
+	struct rseq __user *rseq = t->rseq;
 	u32 cpu_id_start = 0, cpu_id = RSEQ_CPU_ID_UNINITIALIZED, node_id = 0,
 	    mm_cid = 0;
 
@@ -202,38 +204,36 @@ static int rseq_reset_rseq_cpu_node_id(struct task_struct *t)
 	 * Validate read-only rseq fields.
 	 */
 	if (rseq_validate_ro_fields(t))
-		return -EFAULT;
-	/*
-	 * Reset cpu_id_start to its initial state (0).
-	 */
-	if (put_user(cpu_id_start, &t->rseq->cpu_id_start))
-		return -EFAULT;
-	/*
-	 * Reset cpu_id to RSEQ_CPU_ID_UNINITIALIZED, so any user coming
-	 * in after unregistration can figure out that rseq needs to be
-	 * registered again.
-	 */
-	if (put_user(cpu_id, &t->rseq->cpu_id))
-		return -EFAULT;
-	/*
-	 * Reset node_id to its initial state (0).
-	 */
-	if (put_user(node_id, &t->rseq->node_id))
-		return -EFAULT;
+		goto efault;
+
+	if (!user_write_access_begin(rseq, t->rseq_len))
+		goto efault;
+
 	/*
-	 * Reset mm_cid to its initial state (0).
+	 * Reset all fields to their initial state.
+	 *
+	 * All fields have an initial state of 0 except cpu_id which is set to
+	 * RSEQ_CPU_ID_UNINITIALIZED, so that any user coming in after
+	 * unregistration can figure out that rseq needs to be registered
+	 * again.
 	 */
-	if (put_user(mm_cid, &t->rseq->mm_cid))
-		return -EFAULT;
-
-	rseq_set_ro_fields(t, cpu_id_start, cpu_id, node_id, mm_cid);
+	rseq_unsafe_put_user(t, cpu_id_start, cpu_id_start, efault_end);
+	rseq_unsafe_put_user(t, cpu_id, cpu_id, efault_end);
+	rseq_unsafe_put_user(t, node_id, node_id, efault_end);
+	rseq_unsafe_put_user(t, mm_cid, mm_cid, efault_end);
 
 	/*
 	 * Additional feature fields added after ORIG_RSEQ_SIZE
 	 * need to be conditionally reset only if
 	 * t->rseq_len != ORIG_RSEQ_SIZE.
 	 */
+	user_write_access_end();
 	return 0;
+
+efault_end:
+	user_write_access_end();
+efault:
+	return -EFAULT;
 }
 
 static int rseq_get_rseq_cs(struct task_struct *t, struct rseq_cs *rseq_cs)
Signature · 1 line
2.39.5
author maintainer
#23 lore raw

PATCH 23/731 x86/platform: Only allow CONFIG_EISA for 32-bit

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <[email protected]>

[ Upstream commit 976ba8da2f3c2f1e997f4f620da83ae65c0e3728 ]

The CONFIG_EISA menu was cleaned up in 2018, but this inadvertently brought the option back on 64-bit machines: ISA remains guarded by a CONFIG_X86_32 check, but EISA no longer depends on ISA.

The last Intel machines ith EISA support used a 82375EB PCI/EISA bridge from 1993 that could be paired with the 440FX chipset on early Pentium-II CPUs, long before the first x86-64 products.

Fixes 6630a8e50105 ("eisa: consolidate EISA Kconfig entry in drivers/eisa")
Cc Linus Torvalds <[email protected]>
---
 arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Kconfig +1 -1
index 0e27ebd7e36a9..cf79f973023f1 100644
@@ -232,7 +232,7 @@ config X86
 	select HAVE_SAMPLE_FTRACE_DIRECT_MULTI	if X86_64
 	select HAVE_EBPF_JIT
 	select HAVE_EFFICIENT_UNALIGNED_ACCESS
-	select HAVE_EISA
+	select HAVE_EISA			if X86_32
 	select HAVE_EXIT_THREAD
 	select HAVE_GUP_FAST
 	select HAVE_FENTRY			if X86_64 || DYNAMIC_FTRACE
Signature · 1 line
2.39.5
author maintainer
#24 lore raw

PATCH 24/731 x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kevin Loughlin <[email protected]>

[ Upstream commit 72dafb567760320f2de7447cd6e979bf9d4e5d17 ]

The following commit:

1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")

introduced RIP_REL_REF() to force RIP-relative accesses to global variables, as needed to prevent crashes during early SEV/SME startup code.

For completeness, RIP_REL_REF() should be used with additional variables during sme_enable():

https://lore.kernel.org/all/CAMj1kXHnA0fJu6zh634=fbJswp59kSRAbhW+ubDGj1+NYwZJ-Q@mail.gmail.com/

Access these vars with RIP_REL_REF() to prevent problem reoccurence.

Fixes 1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")
Cc Dave Hansen <[email protected]>
---
 arch/x86/mm/mem_encrypt_identity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/mm/mem_encrypt_identity.c +2 -2
index e6c7686f443a0..9fce5b87b8c50 100644
@@ -565,7 +565,7 @@ void __head sme_enable(struct boot_params *bp)
 	}
 
 	RIP_REL_REF(sme_me_mask) = me_mask;
-	physical_mask &= ~me_mask;
-	cc_vendor = CC_VENDOR_AMD;
+	RIP_REL_REF(physical_mask) &= ~me_mask;
+	RIP_REL_REF(cc_vendor) = CC_VENDOR_AMD;
 	cc_set_mask(me_mask);
 }
Signature · 1 line
2.39.5
author maintainer
#25 lore raw

PATCH 25/731 lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Peter Zijlstra <[email protected]>

[ Upstream commit a1b65f3f7c6f7f0a08a7dba8be458c6415236487 ]

Turns out that this commit, about 10 years ago:

9ec23531fd48 ("sched/preempt, mm/fault: Trigger might_sleep() in might_fault() with disabled pagefaults")

... accidentally (and unnessecarily) put the lockdep part of __might_fault() under CONFIG_DEBUG_ATOMIC_SLEEP=y.

This is potentially notable because large distributions such as Ubuntu are running with !CONFIG_DEBUG_ATOMIC_SLEEP.

Restore the debug check.

[ mingo: Update changelog. ]

Fixes 9ec23531fd48 ("sched/preempt, mm/fault: Trigger might_sleep() in might_fault() with disabled pagefaults")
Cc Linus Torvalds <[email protected]>
Cc Andrew Morton <[email protected]>
---
 mm/memory.c | 2 --
 1 file changed, 2 deletions(-)
mm/memory.c +0 -2
index fb7b8dc751679..4f6d9766a0460 100644
@@ -6834,10 +6834,8 @@ void __might_fault(const char *file, int line)
 	if (pagefault_disabled())
 		return;
 	__might_sleep(file, line);
-#if defined(CONFIG_DEBUG_ATOMIC_SLEEP)
 	if (current->mm)
 		might_lock_read(&current->mm->mmap_lock);
-#endif
 }
 EXPORT_SYMBOL(__might_fault);
 #endif
Signature · 1 line
2.39.5
author maintainer
#26 lore raw

PATCH 26/731 PM: sleep: Adjust check before setting power.must_resume

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Rafael J. Wysocki <[email protected]>

[ Upstream commit eeb87d17aceab7803a5a5bcb6cf2817b745157cf ]

The check before setting power.must_resume in device_suspend_noirq() does not take power.child_count into account, but it should do that, so use pm_runtime_need_not_resume() in it for this purpose and adjust the comment next to it accordingly.

Fixes 107d47b2b95e ("PM: sleep: core: Simplify the SMART_SUSPEND flag handling")
---
 drivers/base/power/main.c    | 13 ++++++-------
 drivers/base/power/runtime.c |  2 +-
 include/linux/pm_runtime.h   |  2 ++
 3 files changed, 9 insertions(+), 8 deletions(-)
drivers/base/power/main.c +6 -7
index 40e1d8d8a5893..5afafd4e13dff 100644
@@ -1270,14 +1270,13 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state, bool asy
 	dev->power.is_noirq_suspended = true;
 
 	/*
-	 * Skipping the resume of devices that were in use right before the
-	 * system suspend (as indicated by their PM-runtime usage counters)
-	 * would be suboptimal.  Also resume them if doing that is not allowed
-	 * to be skipped.
+	 * Devices must be resumed unless they are explicitly allowed to be left
+	 * in suspend, but even in that case skipping the resume of devices that
+	 * were in use right before the system suspend (as indicated by their
+	 * runtime PM usage counters and child counters) would be suboptimal.
 	 */
-	if (atomic_read(&dev->power.usage_count) > 1 ||
-	    !(dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME) &&
-	      dev->power.may_skip_resume))
+	if (!(dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME) &&
+	      dev->power.may_skip_resume) || !pm_runtime_need_not_resume(dev))
 		dev->power.must_resume = true;
 
 	if (dev->power.must_resume) {
drivers/base/power/runtime.c +1 -1
index 2ee45841486bc..04113adb092b5 100644
@@ -1874,7 +1874,7 @@ void pm_runtime_drop_link(struct device_link *link)
 	pm_request_idle(link->supplier);
 }
 
-static bool pm_runtime_need_not_resume(struct device *dev)
+bool pm_runtime_need_not_resume(struct device *dev)
 {
 	return atomic_read(&dev->power.usage_count) <= 1 &&
 		(atomic_read(&dev->power.child_count) == 0 ||
include/linux/pm_runtime.h +2 -0
index d39dc863f612f..d0b29cd1fd204 100644
@@ -66,6 +66,7 @@ static inline bool queue_pm_work(struct work_struct *work)
 
 extern int pm_generic_runtime_suspend(struct device *dev);
 extern int pm_generic_runtime_resume(struct device *dev);
+extern bool pm_runtime_need_not_resume(struct device *dev);
 extern int pm_runtime_force_suspend(struct device *dev);
 extern int pm_runtime_force_resume(struct device *dev);
 
@@ -241,6 +242,7 @@ static inline bool queue_pm_work(struct work_struct *work) { return false; }
 
 static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
 static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
+static inline bool pm_runtime_need_not_resume(struct device *dev) {return true; }
 static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
 static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
 
Signature · 1 line
2.39.5
author maintainer
#27 lore raw

PATCH 27/731 cpufreq: tegra194: Allow building for Tegra234

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Aaron Kling <[email protected]>

[ Upstream commit 4a1e3bf61fc78ad100018adb573355303915dca3 ]

Support was added for Tegra234 in the referenced commit, but the Kconfig was not updated to allow building for the arch.

Fixes 273bc890a2a8 ("cpufreq: tegra194: Add support for Tegra234")
---
 drivers/cpufreq/Kconfig.arm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/Kconfig.arm +1 -1
index 9e46960f6a862..4f9cb943d945c 100644
@@ -254,7 +254,7 @@ config ARM_TEGRA186_CPUFREQ
 
 config ARM_TEGRA194_CPUFREQ
 	tristate "Tegra194 CPUFreq support"
-	depends on ARCH_TEGRA_194_SOC || (64BIT && COMPILE_TEST)
+	depends on ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC || (64BIT && COMPILE_TEST)
 	depends on TEGRA_BPMP
 	default y
 	help
Signature · 1 line
2.39.5
author maintainer
#28 lore raw

PATCH 28/731 RISC-V: KVM: Disable the kernel perf counter during configure

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Atish Patra <[email protected]>

[ Upstream commit bbb622488749478955485765ddff9d56be4a7e4b ]

The perf event should be marked disabled during the creation as it is not ready to be scheduled until there is SBI PMU start call or config matching is called with auto start. Otherwise, event add/start gets called during perf_event_create_kernel_counter function. It will be enabled and scheduled to run via perf_event_enable during either the above mentioned scenario.

Fixes 0cb74b65d2e5 ("RISC-V: KVM: Implement perf support without sampling")
---
 arch/riscv/kvm/vcpu_pmu.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/kvm/vcpu_pmu.c +1 -0
index 2707a51b082ca..78ac3216a54dd 100644
@@ -666,6 +666,7 @@ int kvm_riscv_vcpu_pmu_ctr_cfg_match(struct kvm_vcpu *vcpu, unsigned long ctr_ba
 		.type = etype,
 		.size = sizeof(struct perf_event_attr),
 		.pinned = true,
+		.disabled = true,
 		/*
 		 * It should never reach here if the platform doesn't support the sscofpmf
 		 * extension as mode filtering won't work without it.
Signature · 1 line
2.39.5
author maintainer
#29 lore raw

PATCH 29/731 kunit/stackinit: Use fill byte different from Clang i386 pattern

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kees Cook <[email protected]>

[ Upstream commit d985e4399adffb58e10b38dbb5479ef29d53cde6 ]

The byte initialization values used with -ftrivial-auto-var-init=pattern (CONFIG_INIT_STACK_ALL_PATTERN=y) depends on the compiler, architecture, and byte position relative to struct member types. On i386 with Clang, this includes the 0xFF value, which means it looks like nothing changes between the leaf byte filling pass and the expected "stack wiping" pass of the stackinit test.

Use the byte fill value of 0x99 instead, fixing the test for i386 Clang builds.

Reported-by ernsteiswuerfel
Fixes 8c30d32b1a32 ("lib/test_stackinit: Handle Clang auto-initialization pattern")
---
 lib/stackinit_kunit.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)
lib/stackinit_kunit.c +20 -10
index 135322592faf8..63aa78e6f5c1a 100644
@@ -184,6 +184,15 @@ static bool stackinit_range_contains(char *haystack_start, size_t haystack_size,
 #define INIT_UNION_assigned_copy(var_type)		\
 	INIT_STRUCT_assigned_copy(var_type)
 
+/*
+ * The "did we actually fill the stack?" check value needs
+ * to be neither 0 nor any of the "pattern" bytes. The
+ * pattern bytes are compiler, architecture, and type based,
+ * so we have to pick a value that never appears for those
+ * combinations. Use 0x99 which is not 0xFF, 0xFE, nor 0xAA.
+ */
+#define FILL_BYTE	0x99
+
 /*
  * @name: unique string name for the test
  * @var_type: type to be tested for zeroing initialization
@@ -206,12 +215,12 @@ static noinline void test_ ## name (struct kunit *test)		\
 	ZERO_CLONE_ ## which(zero);				\
 	/* Clear entire check buffer for 0xFF overlap test. */	\
 	memset(check_buf, 0x00, sizeof(check_buf));		\
-	/* Fill stack with 0xFF. */				\
+	/* Fill stack with FILL_BYTE. */			\
 	ignored = leaf_ ##name((unsigned long)&ignored, 1,	\
 				FETCH_ARG_ ## which(zero));	\
-	/* Verify all bytes overwritten with 0xFF. */		\
+	/* Verify all bytes overwritten with FILL_BYTE. */	\
 	for (sum = 0, i = 0; i < target_size; i++)		\
-		sum += (check_buf[i] != 0xFF);			\
+		sum += (check_buf[i] != FILL_BYTE);		\
 	/* Clear entire check buffer for later bit tests. */	\
 	memset(check_buf, 0x00, sizeof(check_buf));		\
 	/* Extract stack-defined variable contents. */		\
@@ -222,7 +231,8 @@ static noinline void test_ ## name (struct kunit *test)		\
 	 * possible between the two leaf function calls.	\
 	 */							\
 	KUNIT_ASSERT_EQ_MSG(test, sum, 0,			\
-			    "leaf fill was not 0xFF!?\n");	\
+			    "leaf fill was not 0x%02X!?\n",	\
+			    FILL_BYTE);				\
 								\
 	/* Validate that compiler lined up fill and target. */	\
 	KUNIT_ASSERT_TRUE_MSG(test,				\
@@ -234,9 +244,9 @@ static noinline void test_ ## name (struct kunit *test)		\
 		(int)((ssize_t)(uintptr_t)fill_start -		\
 		      (ssize_t)(uintptr_t)target_start));	\
 								\
-	/* Look for any bytes still 0xFF in check region. */	\
+	/* Validate check region has no FILL_BYTE bytes. */	\
 	for (sum = 0, i = 0; i < target_size; i++)		\
-		sum += (check_buf[i] == 0xFF);			\
+		sum += (check_buf[i] == FILL_BYTE);		\
 								\
 	if (sum != 0 && xfail)					\
 		kunit_skip(test,				\
@@ -271,12 +281,12 @@ static noinline int leaf_ ## name(unsigned long sp, bool fill,	\
 	 * stack frame of SOME kind...				\
 	 */							\
 	memset(buf, (char)(sp & 0xff), sizeof(buf));		\
-	/* Fill variable with 0xFF. */				\
+	/* Fill variable with FILL_BYTE. */			\
 	if (fill) {						\
 		fill_start = &var;				\
 		fill_size = sizeof(var);			\
 		memset(fill_start,				\
-		       (char)((sp & 0xff) | forced_mask),	\
+		       FILL_BYTE & forced_mask,			\
 		       fill_size);				\
 	}							\
 								\
@@ -469,7 +479,7 @@ static int noinline __leaf_switch_none(int path, bool fill)
 			fill_start = &var;
 			fill_size = sizeof(var);
 
-			memset(fill_start, forced_mask | 0x55, fill_size);
+			memset(fill_start, (forced_mask | 0x55) & FILL_BYTE, fill_size);
 		}
 		memcpy(check_buf, target_start, target_size);
 		break;
@@ -480,7 +490,7 @@ static int noinline __leaf_switch_none(int path, bool fill)
 			fill_start = &var;
 			fill_size = sizeof(var);
 
-			memset(fill_start, forced_mask | 0xaa, fill_size);
+			memset(fill_start, (forced_mask | 0xaa) & FILL_BYTE, fill_size);
 		}
 		memcpy(check_buf, target_start, target_size);
 		break;
Signature · 1 line
2.39.5
author maintainer
#30 lore raw

PATCH 30/731 watchdog/hardlockup/perf: Fix perf_event memory leak

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Li Huafei <[email protected]>

[ Upstream commit d6834d9c990333bfa433bc1816e2417f268eebbe ]

During stress-testing, we found a kmemleak report for perf_event:

unreferenced object 0xff110001410a33e0 (size 1328):

    comm "kworker/4:11", pid 288, jiffies 4294916004
    hex dump (first 32 bytes):
      b8 be c2 3b 02 00 11 ff 22 01 00 00 00 00 ad de  ...;....".......
      f0 33 0a 41 01 00 11 ff f0 33 0a 41 01 00 11 ff  .3.A.....3.A....
    backtrace (crc 24eb7b3a):
      [<00000000e211b653>] kmem_cache_alloc_node_noprof+0x269/0x2e0
      [<000000009d0985fa>] perf_event_alloc+0x5f/0xcf0
      [<00000000084ad4a2>] perf_event_create_kernel_counter+0x38/0x1b0
      [<00000000fde96401>] hardlockup_detector_event_create+0x50/0xe0
      [<0000000051183158>] watchdog_hardlockup_enable+0x17/0x70
      [<00000000ac89727f>] softlockup_start_fn+0x15/0x40
      ...

Our stress test includes CPU online and offline cycles, and updating the watchdog configuration.

After reading the code, I found that there may be a race between cleaning up perf_event after updating watchdog and disabling event when the CPU goes offline:

CPU0 CPU1 CPU2
(update watchdog) (hotplug offline CPU1)

... _cpu_down(CPU1)
cpus_read_lock() // waiting for cpu lock

    softlockup_start_all
      smp_call_on_cpu(CPU1)
                                softlockup_start_fn
                                ...
                                  watchdog_hardlockup_enable(CPU1)
                                    perf create E1
                                    watchdog_ev[CPU1] = E1
  cpus_read_unlock()
                                                               cpus_write_lock()
                                                               cpuhp_kick_ap_work(CPU1)
                                cpuhp_thread_fun
                                ...
                                  watchdog_hardlockup_disable(CPU1)
                                    watchdog_ev[CPU1] = NULL
                                    dead_event[CPU1] = E1

__lockup_detector_cleanup
for each dead_events_mask
release each dead_event
/*
* CPU1 has not been added to
* dead_events_mask, then E1
* will not be released
*/
CPU1 -> dead_events_mask
cpumask_clear(&dead_events_mask)
// dead_events_mask is cleared, E1 is leaked

In this case, the leaked perf_event E1 matches the perf_event leak reported by kmemleak. Due to the low probability of problem recurrence (only reported once), I added some hack delays in the code:

  static void __lockup_detector_reconfigure(void)
  {
    ...
          watchdog_hardlockup_start();
          cpus_read_unlock();
  +       mdelay(100);
          /*
           * Must be called outside the cpus locked section to prevent
           * recursive locking in the perf code.
    ...
  }

  void watchdog_hardlockup_disable(unsigned int cpu)
  {
    ...
                  perf_event_disable(event);
                  this_cpu_write(watchdog_ev, NULL);
                  this_cpu_write(dead_event, event);
  +               mdelay(100);
                  cpumask_set_cpu(smp_processor_id(), &dead_events_mask);
                  atomic_dec(&watchdog_cpus);
    ...
  }

  void hardlockup_detector_perf_cleanup(void)
  {
    ...
                          perf_event_release_kernel(event);
                  per_cpu(dead_event, cpu) = NULL;
          }
  +       mdelay(100);
          cpumask_clear(&dead_events_mask);
  }

Then, simultaneously performing CPU on/off and switching watchdog, it is almost certain to reproduce this leak.

The problem here is that releasing perf_event is not within the CPU hotplug read-write lock. Commit:

941154bd6937 ("watchdog/hardlockup/perf: Prevent CPU hotplug deadlock")

introduced deferred release to solve the deadlock caused by calling get_online_cpus() when releasing perf_event. Later, commit:

efe951d3de91 ("perf/x86: Fix perf,x86,cpuhp deadlock")

removed the get_online_cpus() call on the perf_event release path to solve another deadlock problem.

Therefore, it is now possible to move the release of perf_event back into the CPU hotplug read-write lock, and release the event immediately after disabling it.

Fixes 941154bd6937 ("watchdog/hardlockup/perf: Prevent CPU hotplug deadlock")
Cc Thomas Gleixner <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 include/linux/nmi.h    |  4 ----
 kernel/cpu.c           |  5 -----
 kernel/watchdog.c      | 25 -------------------------
 kernel/watchdog_perf.c | 28 +---------------------------
 4 files changed, 1 insertion(+), 61 deletions(-)
include/linux/nmi.h +0 -4
index a8dfb38c9bb6f..e78fa535f61dd 100644
@@ -17,7 +17,6 @@
 void lockup_detector_init(void);
 void lockup_detector_retry_init(void);
 void lockup_detector_soft_poweroff(void);
-void lockup_detector_cleanup(void);
 
 extern int watchdog_user_enabled;
 extern int watchdog_thresh;
@@ -37,7 +36,6 @@ extern int sysctl_hardlockup_all_cpu_backtrace;
 static inline void lockup_detector_init(void) { }
 static inline void lockup_detector_retry_init(void) { }
 static inline void lockup_detector_soft_poweroff(void) { }
-static inline void lockup_detector_cleanup(void) { }
 #endif /* !CONFIG_LOCKUP_DETECTOR */
 
 #ifdef CONFIG_SOFTLOCKUP_DETECTOR
@@ -104,12 +102,10 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs);
 #if defined(CONFIG_HARDLOCKUP_DETECTOR_PERF)
 extern void hardlockup_detector_perf_stop(void);
 extern void hardlockup_detector_perf_restart(void);
-extern void hardlockup_detector_perf_cleanup(void);
 extern void hardlockup_config_perf_event(const char *str);
 #else
 static inline void hardlockup_detector_perf_stop(void) { }
 static inline void hardlockup_detector_perf_restart(void) { }
-static inline void hardlockup_detector_perf_cleanup(void) { }
 static inline void hardlockup_config_perf_event(const char *str) { }
 #endif
 
kernel/cpu.c +0 -5
index 07455d25329c9..ad755db29efd4 100644
@@ -1453,11 +1453,6 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
 
 out:
 	cpus_write_unlock();
-	/*
-	 * Do post unplug cleanup. This is still protected against
-	 * concurrent CPU hotplug via cpu_add_remove_lock.
-	 */
-	lockup_detector_cleanup();
 	arch_smt_update();
 	return ret;
 }
kernel/watchdog.c +0 -25
index b2da7de39d06d..18156023e4614 100644
@@ -347,8 +347,6 @@ static int __init watchdog_thresh_setup(char *str)
 }
 __setup("watchdog_thresh=", watchdog_thresh_setup);
 
-static void __lockup_detector_cleanup(void);
-
 #ifdef CONFIG_SOFTLOCKUP_DETECTOR_INTR_STORM
 enum stats_per_group {
 	STATS_SYSTEM,
@@ -886,11 +884,6 @@ static void __lockup_detector_reconfigure(void)
 
 	watchdog_hardlockup_start();
 	cpus_read_unlock();
-	/*
-	 * Must be called outside the cpus locked section to prevent
-	 * recursive locking in the perf code.
-	 */
-	__lockup_detector_cleanup();
 }
 
 void lockup_detector_reconfigure(void)
@@ -940,24 +933,6 @@ static inline void lockup_detector_setup(void)
 }
 #endif /* !CONFIG_SOFTLOCKUP_DETECTOR */
 
-static void __lockup_detector_cleanup(void)
-{
-	lockdep_assert_held(&watchdog_mutex);
-	hardlockup_detector_perf_cleanup();
-}
-
-/**
- * lockup_detector_cleanup - Cleanup after cpu hotplug or sysctl changes
- *
- * Caller must not hold the cpu hotplug rwsem.
- */
-void lockup_detector_cleanup(void)
-{
-	mutex_lock(&watchdog_mutex);
-	__lockup_detector_cleanup();
-	mutex_unlock(&watchdog_mutex);
-}
-
 /**
  * lockup_detector_soft_poweroff - Interface to stop lockup detector(s)
  *
kernel/watchdog_perf.c +1 -27
index 59c1d86a73a24..2fdb96eaf4933 100644
@@ -21,8 +21,6 @@
 #include <linux/perf_event.h>
 
 static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);
-static DEFINE_PER_CPU(struct perf_event *, dead_event);
-static struct cpumask dead_events_mask;
 
 static atomic_t watchdog_cpus = ATOMIC_INIT(0);
 
@@ -181,36 +179,12 @@ void watchdog_hardlockup_disable(unsigned int cpu)
 
 	if (event) {
 		perf_event_disable(event);
+		perf_event_release_kernel(event);
 		this_cpu_write(watchdog_ev, NULL);
-		this_cpu_write(dead_event, event);
-		cpumask_set_cpu(smp_processor_id(), &dead_events_mask);
 		atomic_dec(&watchdog_cpus);
 	}
 }
 
-/**
- * hardlockup_detector_perf_cleanup - Cleanup disabled events and destroy them
- *
- * Called from lockup_detector_cleanup(). Serialized by the caller.
- */
-void hardlockup_detector_perf_cleanup(void)
-{
-	int cpu;
-
-	for_each_cpu(cpu, &dead_events_mask) {
-		struct perf_event *event = per_cpu(dead_event, cpu);
-
-		/*
-		 * Required because for_each_cpu() reports  unconditionally
-		 * CPU0 as set on UP kernels. Sigh.
-		 */
-		if (event)
-			perf_event_release_kernel(event);
-		per_cpu(dead_event, cpu) = NULL;
-	}
-	cpumask_clear(&dead_events_mask);
-}
-
 /**
  * hardlockup_detector_perf_stop - Globally stop watchdog events
  *
Signature · 1 line
2.39.5
author maintainer
#31 lore raw

PATCH 31/731 x86/split_lock: Fix the delayed detection logic

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Maksim Davydov <[email protected]>

[ Upstream commit c929d08df8bee855528b9d15b853c892c54e1eee ]

If the warning mode with disabled mitigation mode is used, then on each CPU where the split lock occurred detection will be disabled in order to make progress and delayed work will be scheduled, which then will enable detection back.

Now it turns out that all CPUs use one global delayed work structure. This leads to the fact that if a split lock occurs on several CPUs at the same time (within 2 jiffies), only one CPU will schedule delayed work, but the rest will not.

The return value of schedule_delayed_work_on() would have shown this, but it is not checked in the code.

A diagram that can help to understand the bug reproduction:

- sld_update_msr() enables/disables SLD on both CPUs on the same core

- schedule_delayed_work_on() internally checks WORK_STRUCT_PENDING_BIT. If a work has the 'pending' status, then schedule_delayed_work_on() will return an error code and, most importantly, the work will not be placed in the workqueue.

Let's say we have a multicore system on which split_lock_mitigate=0 and a multithreaded application is running that calls splitlock in multiple threads. Due to the fact that sld_update_msr() affects the entire core (both CPUs), we will consider 2 CPUs from different cores. Let the 2 threads of this application schedule to CPU0 (core 0) and to CPU 2 (core 1), then:

|                                 ||                                   |
|             CPU 0 (core 0)      ||          CPU 2 (core 1)           |
|_________________________________||___________________________________|
|                                 ||                                   |
| 1) SPLIT LOCK occured           ||                                   |
|                                 ||                                   |
| 2) split_lock_warn()            ||                                   |
|                                 ||                                   |
| 3) sysctl_sld_mitigate == 0     ||                                   |
|    (work = &sl_reenable)        ||                                   |
|                                 ||                                   |
| 4) schedule_delayed_work_on()   ||                                   |
|    (reenable will be called     ||                                   |
|     after 2 jiffies on CPU 0)   ||                                   |
|                                 ||                                   |
| 5) disable SLD for core 0       ||                                   |
|                                 ||                                   |
|    -------------------------    ||                                   |
|                                 ||                                   |
|                                 || 6) SPLIT LOCK occured             |
|                                 ||                                   |
|                                 || 7) split_lock_warn()              |
|                                 ||                                   |
|                                 || 8) sysctl_sld_mitigate == 0       |
|                                 ||    (work = &sl_reenable,          |
|                                 ||     the same address as in 3) )   |
|                                 ||                                   |
|            2 jiffies            || 9) schedule_delayed_work_on()     |
|                                 ||    fials because the work is in   |
|                                 ||    the pending state since 4).    |
|                                 ||    The work wasn't placed to the  |
|                                 ||    workqueue. reenable won't be   |
|                                 ||    called on CPU 2                |
|                                 ||                                   |
|                                 || 10) disable SLD for core 0        |
|                                 ||                                   |
|                                 ||     From now on SLD will          |
|                                 ||     never be reenabled on core 1  |
|                                 ||                                   |
|    -------------------------    ||                                   |
|                                 ||                                   |
|    11) enable SLD for core 0 by ||                                   |
|        __split_lock_reenable    ||                                   |
|                                 ||                                   |

If the application threads can be scheduled to all processor cores, then over time there will be only one core left, on which SLD will be enabled and split lock will be able to be detected; and on all other cores SLD will be disabled all the time.

Most likely, this bug has not been noticed for so long because sysctl_sld_mitigate default value is 1, and in this case a semaphore is used that does not allow 2 different cores to have SLD disabled at the same time, that is, strictly only one work is placed in the workqueue.

In order to fix the warning mode with disabled mitigation mode, delayed work has to be per-CPU. Implement it.

Fixes 727209376f49 ("x86/split_lock: Add sysctl to control the misery mode")
Cc Thomas Gleixner <[email protected]>
Cc Ravi Bangoria <[email protected]>
Cc Tom Lendacky <[email protected]>
---
 arch/x86/kernel/cpu/bus_lock.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/bus_lock.c +16 -4
index 6cba85c79d42d..97222efb4d2a6 100644
@@ -192,7 +192,13 @@ static void __split_lock_reenable(struct work_struct *work)
 {
 	sld_update_msr(true);
 }
-static DECLARE_DELAYED_WORK(sl_reenable, __split_lock_reenable);
+/*
+ * In order for each CPU to schedule its delayed work independently of the
+ * others, delayed work struct must be per-CPU. This is not required when
+ * sysctl_sld_mitigate is enabled because of the semaphore that limits
+ * the number of simultaneously scheduled delayed works to 1.
+ */
+static DEFINE_PER_CPU(struct delayed_work, sl_reenable);
 
 /*
  * If a CPU goes offline with pending delayed work to re-enable split lock
@@ -213,7 +219,7 @@ static int splitlock_cpu_offline(unsigned int cpu)
 
 static void split_lock_warn(unsigned long ip)
 {
-	struct delayed_work *work;
+	struct delayed_work *work = NULL;
 	int cpu;
 
 	if (!current->reported_split_lock)
@@ -235,11 +241,17 @@ static void split_lock_warn(unsigned long ip)
 		if (down_interruptible(&buslock_sem) == -EINTR)
 			return;
 		work = &sl_reenable_unlock;
-	} else {
-		work = &sl_reenable;
 	}
 
 	cpu = get_cpu();
+
+	if (!work) {
+		work = this_cpu_ptr(&sl_reenable);
+		/* Deferred initialization of per-CPU struct */
+		if (!work->work.func)
+			INIT_DELAYED_WORK(work, __split_lock_reenable);
+	}
+
 	schedule_delayed_work_on(cpu, work, 2);
 
 	/* Disable split lock detection on this CPU to make progress */
Signature · 1 line
2.39.5
author maintainer
#32 lore raw

PATCH 32/731 selinux: Chain up tool resolving errors in install_policy.sh

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Tim Schumacher <[email protected]>

[ Upstream commit 6ae0042f4d3f331e841495eb0a3d51598e593ec2 ]

Subshell evaluations are not exempt from errexit, so if a command is not available, which will fail and exit the script as a whole. This causes the helpful error messages to not be printed if they are tacked on using a $? comparison.

Resolve the issue by using chains of logical operators, which are not subject to the effects of errexit.

Fixes e37c1877ba5b1 ("scripts/selinux: modernize mdp")
---
 scripts/selinux/install_policy.sh | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
scripts/selinux/install_policy.sh +6 -9
index 24086793b0d8d..db40237e60ce7 100755
@@ -6,27 +6,24 @@ if [ `id -u` -ne 0 ]; then
 	exit 1
 fi
 
-SF=`which setfiles`
-if [ $? -eq 1 ]; then
+SF=`which setfiles` || {
 	echo "Could not find setfiles"
 	echo "Do you have policycoreutils installed?"
 	exit 1
-fi
+}
 
-CP=`which checkpolicy`
-if [ $? -eq 1 ]; then
+CP=`which checkpolicy` || {
 	echo "Could not find checkpolicy"
 	echo "Do you have checkpolicy installed?"
 	exit 1
-fi
+}
 VERS=`$CP -V | awk '{print $1}'`
 
-ENABLED=`which selinuxenabled`
-if [ $? -eq 1 ]; then
+ENABLED=`which selinuxenabled` || {
 	echo "Could not find selinuxenabled"
 	echo "Do you have libselinux-utils installed?"
 	exit 1
-fi
+}
 
 if selinuxenabled; then
     echo "SELinux is already enabled"
Signature · 1 line
2.39.5
author maintainer
#33 lore raw

PATCH 33/731 EDAC/ie31200: Fix the size of EDAC_MC_LAYER_CHIP_SELECT layer

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit d59d844e319d97682c8de29b88d2d60922a683b3 ]

The EDAC_MC_LAYER_CHIP_SELECT layer pertains to the rank, not the DIMM. Fix its size to reflect the number of ranks instead of the number of DIMMs. Also delete the unused macros IE31200_{DIMMS,RANKS}.

---
 drivers/edac/ie31200_edac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/edac/ie31200_edac.c +1 -3
index 4fc16922dc1af..c3d34d1fc9ad7 100644
@@ -94,8 +94,6 @@
 	 (((did) & PCI_DEVICE_ID_INTEL_IE31200_HB_CFL_MASK) ==                 \
 	  PCI_DEVICE_ID_INTEL_IE31200_HB_CFL_MASK))
 
-#define IE31200_DIMMS			4
-#define IE31200_RANKS			8
 #define IE31200_RANKS_PER_CHANNEL	4
 #define IE31200_DIMMS_PER_CHANNEL	2
 #define IE31200_CHANNELS		2
@@ -429,7 +427,7 @@ static int ie31200_probe1(struct pci_dev *pdev, int dev_idx)
 
 	nr_channels = how_many_channels(pdev);
 	layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
-	layers[0].size = IE31200_DIMMS;
+	layers[0].size = IE31200_RANKS_PER_CHANNEL;
 	layers[0].is_virt_csrow = true;
 	layers[1].type = EDAC_MC_LAYER_CHANNEL;
 	layers[1].size = nr_channels;
Signature · 1 line
2.39.5
author maintainer
#34 lore raw

PATCH 34/731 EDAC/ie31200: Fix the DIMM size mask for several SoCs

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit 3427befbbca6b19fe0e37f91d66ce5221de70bf1 ]

The DIMM size mask for {Sky, Kaby, Coffee} Lake is not bits{7:0}, but bits{5:0}. Fix it.

Fixes 953dee9bbd24 ("EDAC, ie31200_edac: Add Skylake support")
---
 drivers/edac/ie31200_edac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/edac/ie31200_edac.c +2 -1
index c3d34d1fc9ad7..da4008c22f0d3 100644
@@ -165,6 +165,7 @@
 #define IE31200_MAD_DIMM_0_OFFSET		0x5004
 #define IE31200_MAD_DIMM_0_OFFSET_SKL		0x500C
 #define IE31200_MAD_DIMM_SIZE			GENMASK_ULL(7, 0)
+#define IE31200_MAD_DIMM_SIZE_SKL		GENMASK_ULL(5, 0)
 #define IE31200_MAD_DIMM_A_RANK			BIT(17)
 #define IE31200_MAD_DIMM_A_RANK_SHIFT		17
 #define IE31200_MAD_DIMM_A_RANK_SKL		BIT(10)
@@ -378,7 +379,7 @@ static void __iomem *ie31200_map_mchbar(struct pci_dev *pdev)
 static void __skl_populate_dimm_info(struct dimm_data *dd, u32 addr_decode,
 				     int chan)
 {
-	dd->size = (addr_decode >> (chan << 4)) & IE31200_MAD_DIMM_SIZE;
+	dd->size = (addr_decode >> (chan << 4)) & IE31200_MAD_DIMM_SIZE_SKL;
 	dd->dual_rank = (addr_decode & (IE31200_MAD_DIMM_A_RANK_SKL << (chan << 4))) ? 1 : 0;
 	dd->x16_width = ((addr_decode & (IE31200_MAD_DIMM_A_WIDTH_SKL << (chan << 4))) >>
 				(IE31200_MAD_DIMM_A_WIDTH_SKL_SHIFT + (chan << 4)));
Signature · 1 line
2.39.5
author maintainer
#35 lore raw

PATCH 35/731 EDAC/ie31200: Fix the error path order of ie31200_init()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit 231e341036d9988447e3b3345cf741a98139199e ]

The error path order of ie31200_init() is incorrect, fix it.

Fixes 709ed1bcef12 ("EDAC/ie31200: Fallback if host bridge device is already initialized")
---
 drivers/edac/ie31200_edac.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/edac/ie31200_edac.c +7 -5
index da4008c22f0d3..9b02a6b43ab58 100644
@@ -621,7 +621,7 @@ static int __init ie31200_init(void)
 
 	pci_rc = pci_register_driver(&ie31200_driver);
 	if (pci_rc < 0)
-		goto fail0;
+		return pci_rc;
 
 	if (!mci_pdev) {
 		ie31200_registered = 0;
@@ -632,11 +632,13 @@ static int __init ie31200_init(void)
 			if (mci_pdev)
 				break;
 		}
+
 		if (!mci_pdev) {
 			edac_dbg(0, "ie31200 pci_get_device fail\n");
 			pci_rc = -ENODEV;
-			goto fail1;
+			goto fail0;
 		}
+
 		pci_rc = ie31200_init_one(mci_pdev, &ie31200_pci_tbl[i]);
 		if (pci_rc < 0) {
 			edac_dbg(0, "ie31200 init fail\n");
@@ -644,12 +646,12 @@ static int __init ie31200_init(void)
 			goto fail1;
 		}
 	}
-	return 0;
 
+	return 0;
 fail1:
-	pci_unregister_driver(&ie31200_driver);
-fail0:
 	pci_dev_put(mci_pdev);
+fail0:
+	pci_unregister_driver(&ie31200_driver);
 
 	return pci_rc;
 }
Signature · 1 line
2.39.5
author maintainer
#36 lore raw

PATCH 36/731 dma: Fix encryption bit clearing for dma_to_phys

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Suzuki K Poulose <[email protected]>

[ Upstream commit c380931712d16e23f6aa90703f438330139e9731 ]

phys_to_dma() sets the encryption bit on the translated DMA address. But dma_to_phys() clears the encryption bit after it has been translated back to the physical address, which could fail if the device uses DMA ranges.

AMD SME doesn't use the DMA ranges and thus this is harmless. But as we are about to add support for other architectures, let us fix this.

---
 include/linux/dma-direct.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/dma-direct.h +2 -1
index d7e30d4f7503a..d20ecc24cb0f5 100644
@@ -101,12 +101,13 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dma_addr)
 {
 	phys_addr_t paddr;
 
+	dma_addr = __sme_clr(dma_addr);
 	if (dev->dma_range_map)
 		paddr = translate_dma_to_phys(dev, dma_addr);
 	else
 		paddr = dma_addr;
 
-	return __sme_clr(paddr);
+	return paddr;
 }
 #endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
 
Signature · 1 line
2.39.5
author maintainer
#37 lore raw

PATCH 37/731 dma: Introduce generic dma_addr_*crypted helpers

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Suzuki K Poulose <[email protected]>

[ Upstream commit b66e2ee7b6c8d45bbe4b6f6885ee27511506812c ]

AMD SME added __sme_set/__sme_clr primitives to modify the DMA address for encrypted/decrypted traffic. However this doesn't fit in with other models, e.g., Arm CCA where the meanings are the opposite. i.e., "decrypted" traffic has a bit set and "encrypted" traffic has the top bit cleared.

In preparation for adding the support for Arm CCA DMA conversions, convert the existing primitives to more generic ones that can be provided by the backends. i.e., add helpers to
1. dma_addr_encrypted - Convert a DMA address to "encrypted" [ == __sme_set() ]
2. dma_addr_unencrypted - Convert a DMA address to "decrypted" [ None exists today ]
3. dma_addr_canonical - Clear any "encryption"/"decryption" bits from DMA address [ SME uses __sme_clr() ] and convert to a canonical DMA address.

Since the original __sme_xxx helpers come from linux/mem_encrypt.h, use that as the home for the new definitions and provide dummy ones when none is provided by the architectures.

With the above, phys_to_dma_unencrypted() uses the newly added dma_addr_unencrypted() helper and to make it a bit more easier to read and avoid double conversion, provide __phys_to_dma().

Cc Will Deacon <[email protected]>
Cc Jean-Philippe Brucker <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Steven Price <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Tom Lendacky <[email protected]>
Cc Aneesh Kumar K.V <[email protected]>
Fixes 42be24a4178f ("arm64: Enable memory encrypt for Realms")
---
 include/linux/dma-direct.h  | 12 ++++++++----
 include/linux/mem_encrypt.h | 23 +++++++++++++++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)
include/linux/dma-direct.h +8 -4
index d20ecc24cb0f5..f3bc0bcd70980 100644
@@ -78,14 +78,18 @@ static inline dma_addr_t dma_range_map_max(const struct bus_dma_region *map)
 #define phys_to_dma_unencrypted		phys_to_dma
 #endif
 #else
-static inline dma_addr_t phys_to_dma_unencrypted(struct device *dev,
-		phys_addr_t paddr)
+static inline dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
 {
 	if (dev->dma_range_map)
 		return translate_phys_to_dma(dev, paddr);
 	return paddr;
 }
 
+static inline dma_addr_t phys_to_dma_unencrypted(struct device *dev,
+						phys_addr_t paddr)
+{
+	return dma_addr_unencrypted(__phys_to_dma(dev, paddr));
+}
 /*
  * If memory encryption is supported, phys_to_dma will set the memory encryption
  * bit in the DMA address, and dma_to_phys will clear it.
@@ -94,14 +98,14 @@ static inline dma_addr_t phys_to_dma_unencrypted(struct device *dev,
  */
 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
 {
-	return __sme_set(phys_to_dma_unencrypted(dev, paddr));
+	return dma_addr_encrypted(__phys_to_dma(dev, paddr));
 }
 
 static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dma_addr)
 {
 	phys_addr_t paddr;
 
-	dma_addr = __sme_clr(dma_addr);
+	dma_addr = dma_addr_canonical(dma_addr);
 	if (dev->dma_range_map)
 		paddr = translate_dma_to_phys(dev, dma_addr);
 	else
include/linux/mem_encrypt.h +23 -0
index ae45263892611..07584c5e36fb4 100644
@@ -26,11 +26,34 @@
  */
 #define __sme_set(x)		((x) | sme_me_mask)
 #define __sme_clr(x)		((x) & ~sme_me_mask)
+
+#define dma_addr_encrypted(x)	__sme_set(x)
+#define dma_addr_canonical(x)	__sme_clr(x)
+
 #else
 #define __sme_set(x)		(x)
 #define __sme_clr(x)		(x)
 #endif
 
+/*
+ * dma_addr_encrypted() and dma_addr_unencrypted() are for converting a given DMA
+ * address to the respective type of addressing.
+ *
+ * dma_addr_canonical() is used to reverse any conversions for encrypted/decrypted
+ * back to the canonical address.
+ */
+#ifndef dma_addr_encrypted
+#define dma_addr_encrypted(x)		(x)
+#endif
+
+#ifndef dma_addr_unencrypted
+#define dma_addr_unencrypted(x)		(x)
+#endif
+
+#ifndef dma_addr_canonical
+#define dma_addr_canonical(x)		(x)
+#endif
+
 #endif	/* __ASSEMBLY__ */
 
 #endif	/* __MEM_ENCRYPT_H__ */
Signature · 1 line
2.39.5
author maintainer
#38 lore raw

PATCH 38/731 arm64: realm: Use aliased addresses for device DMA to shared buffers

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Suzuki K Poulose <[email protected]>

[ Upstream commit 7d953a06241624ee2efb172d037a4168978f4147 ]

When a device performs DMA to a shared buffer using physical addresses, (without Stage1 translation), the device must use the "{I}PA address" with the top bit set in Realm. This is to make sure that a trusted device will be able to write to shared buffers as well as the protected buffers. Thus, a Realm must always program the full address including the "protection" bit, like AMD SME encryption bits.

Enable this by providing arm64 specific dma_addr_{encrypted, canonical} helpers for Realms. Please note that the VMM needs to similarly make sure that the SMMU Stage2 in the Non-secure world is setup accordingly to map IPA at the unprotected alias.

Cc Will Deacon <[email protected]>
Cc Jean-Philippe Brucker <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Steven Price <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Marek Szyprowski <[email protected]>
Cc Tom Lendacky <[email protected]>
Cc Aneesh Kumar K.V <[email protected]>
Fixes 42be24a4178f ("arm64: Enable memory encrypt for Realms")
---
 arch/arm64/include/asm/mem_encrypt.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/include/asm/mem_encrypt.h +11 -0
index f8f78f622dd2c..a2a1eeb36d4b5 100644
@@ -21,4 +21,15 @@ static inline bool force_dma_unencrypted(struct device *dev)
 	return is_realm_world();
 }
 
+/*
+ * For Arm CCA guests, canonical addresses are "encrypted", so no changes
+ * required for dma_addr_encrypted().
+ * The unencrypted DMA buffers must be accessed via the unprotected IPA,
+ * "top IPA bit" set.
+ */
+#define dma_addr_unencrypted(x)		((x) | PROT_NS_SHARED)
+
+/* Clear the "top" IPA bit while converting back */
+#define dma_addr_canonical(x)		((x) & ~PROT_NS_SHARED)
+
 #endif	/* __ASM_MEM_ENCRYPT_H */
Signature · 1 line
2.39.5
author maintainer
#39 lore raw

PATCH 39/731 x86/resctrl: Fix allocation of cleanest CLOSID on platforms with no monitors

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: James Morse <[email protected]>

[ Upstream commit a121798ae669351ec0697c94f71c3a692b2a755b ]

Commit

6eac36bb9eb0 ("x86/resctrl: Allocate the cleanest CLOSID by searching closid_num_dirty_rmid")

added logic that causes resctrl to search for the CLOSID with the fewest dirty cache lines when creating a new control group, if requested by the arch code. This depends on the values read from the llc_occupancy counters. The logic is applicable to architectures where the CLOSID effectively forms part of the monitoring identifier and so do not allow complete freedom to choose an unused monitoring identifier for a given CLOSID.

This support missed that some platforms may not have these counters. This causes a NULL pointer dereference when creating a new control group as the array was not allocated by dom_data_init().

As this feature isn't necessary on platforms that don't have cache occupancy monitors, add this to the check that occurs when a new control group is allocated.

---
 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/resctrl/rdtgroup.c +2 -1
index 6419e04d8a7b2..04b653d613e88 100644
@@ -157,7 +157,8 @@ static int closid_alloc(void)
 
 	lockdep_assert_held(&rdtgroup_mutex);
 
-	if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) {
+	if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID) &&
+	    is_llc_occupancy_enabled()) {
 		cleanest_closid = resctrl_find_cleanest_closid();
 		if (cleanest_closid < 0)
 			return cleanest_closid;
Signature · 1 line
2.39.5
author maintainer
#40 lore raw

PATCH 40/731 cpuidle: Init cpuidle only for present CPUs

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jacky Bai <[email protected]>

[ Upstream commit 68cb0139fec8e05b93978dc0ef1bc8df90a86419 ]

for_each_possible_cpu() is currently used to initialize cpuidle in below cpuidle drivers:
drivers/cpuidle/cpuidle-arm.c drivers/cpuidle/cpuidle-big_little.c drivers/cpuidle/cpuidle-psci.c drivers/cpuidle/cpuidle-qcom-spm.c drivers/cpuidle/cpuidle-riscv-sbi.c

However, in cpu_dev_register_generic(), for_each_present_cpu() is used to register CPU devices which means the CPU devices are only registered for present CPUs and not all possible CPUs.

With nosmp or maxcpus=0, only the boot CPU is present, lead to the failure:

| Failed to register cpuidle device for cpu1

Then rollback to cancel all CPUs' cpuidle registration.

Change for_each_possible_cpu() to for_each_present_cpu() in the above cpuidle drivers to ensure it only registers cpuidle devices for CPUs that are actually present.

---
 drivers/cpuidle/cpuidle-arm.c        | 8 ++++----
 drivers/cpuidle/cpuidle-big_little.c | 2 +-
 drivers/cpuidle/cpuidle-psci.c       | 4 ++--
 drivers/cpuidle/cpuidle-qcom-spm.c   | 2 +-
 drivers/cpuidle/cpuidle-riscv-sbi.c  | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
drivers/cpuidle/cpuidle-arm.c +4 -4
index caba6f4bb1b79..e044fefdb8167 100644
@@ -137,9 +137,9 @@ static int __init arm_idle_init_cpu(int cpu)
 /*
  * arm_idle_init - Initializes arm cpuidle driver
  *
- * Initializes arm cpuidle driver for all CPUs, if any CPU fails
- * to register cpuidle driver then rollback to cancel all CPUs
- * registration.
+ * Initializes arm cpuidle driver for all present CPUs, if any
+ * CPU fails to register cpuidle driver then rollback to cancel
+ * all CPUs registration.
  */
 static int __init arm_idle_init(void)
 {
@@ -147,7 +147,7 @@ static int __init arm_idle_init(void)
 	struct cpuidle_driver *drv;
 	struct cpuidle_device *dev;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		ret = arm_idle_init_cpu(cpu);
 		if (ret)
 			goto out_fail;
drivers/cpuidle/cpuidle-big_little.c +1 -1
index 74972deda0ead..4abba42fcc311 100644
@@ -148,7 +148,7 @@ static int __init bl_idle_driver_init(struct cpuidle_driver *drv, int part_id)
 	if (!cpumask)
 		return -ENOMEM;
 
-	for_each_possible_cpu(cpu)
+	for_each_present_cpu(cpu)
 		if (smp_cpuid_part(cpu) == part_id)
 			cpumask_set_cpu(cpu, cpumask);
 
drivers/cpuidle/cpuidle-psci.c +2 -2
index 2562dc001fc1d..a4594c3d6562d 100644
@@ -400,7 +400,7 @@ static int psci_idle_init_cpu(struct device *dev, int cpu)
 /*
  * psci_idle_probe - Initializes PSCI cpuidle driver
  *
- * Initializes PSCI cpuidle driver for all CPUs, if any CPU fails
+ * Initializes PSCI cpuidle driver for all present CPUs, if any CPU fails
  * to register cpuidle driver then rollback to cancel all CPUs
  * registration.
  */
@@ -410,7 +410,7 @@ static int psci_cpuidle_probe(struct platform_device *pdev)
 	struct cpuidle_driver *drv;
 	struct cpuidle_device *dev;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		ret = psci_idle_init_cpu(&pdev->dev, cpu);
 		if (ret)
 			goto out_fail;
drivers/cpuidle/cpuidle-qcom-spm.c +1 -1
index 3ab240e0e1229..5f386761b1562 100644
@@ -135,7 +135,7 @@ static int spm_cpuidle_drv_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(&pdev->dev, ret, "set warm boot addr failed");
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		ret = spm_cpuidle_register(&pdev->dev, cpu);
 		if (ret && ret != -ENODEV) {
 			dev_err(&pdev->dev,
drivers/cpuidle/cpuidle-riscv-sbi.c +2 -2
index 0c92a628bbd40..0fe1ece9fbdca 100644
@@ -529,8 +529,8 @@ static int sbi_cpuidle_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	/* Initialize CPU idle driver for each CPU */
-	for_each_possible_cpu(cpu) {
+	/* Initialize CPU idle driver for each present CPU */
+	for_each_present_cpu(cpu) {
 		ret = sbi_cpuidle_init_cpu(&pdev->dev, cpu);
 		if (ret) {
 			pr_debug("HART%ld: idle driver init failed\n",
Signature · 1 line
2.39.5
author maintainer
#41 lore raw

PATCH 41/731 thermal: int340x: Add NULL check for adev

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chenyuan Yang <[email protected]>

[ Upstream commit 2542a3f70e563a9e70e7ded314286535a3321bdb ]

Not all devices have an ACPI companion fwnode, so adev might be NULL. This is similar to the commit cd2fd6eab480
("platform/x86: int3472: Check for adev == NULL").

Add a check for adev not being set and return -ENODEV in that case to avoid a possible NULL pointer deref in int3402_thermal_probe().

Note, under the same directory, int3400_thermal_probe() has such a check.

Fixes 77e337c6e23e ("Thermal: introduce INT3402 thermal driver")
[ rjw: Subject edit, added Fixes: ]
---
 drivers/thermal/intel/int340x_thermal/int3402_thermal.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/thermal/intel/int340x_thermal/int3402_thermal.c +3 -0
index 543b03960e992..57b90005888a3 100644
@@ -45,6 +45,9 @@ static int int3402_thermal_probe(struct platform_device *pdev)
 	struct int3402_thermal_data *d;
 	int ret;
 
+	if (!adev)
+		return -ENODEV;
+
 	if (!acpi_has_method(adev->handle, "_TMP"))
 		return -ENODEV;
 
Signature · 1 line
2.39.5
author maintainer
#42 lore raw

PATCH 42/731 PM: sleep: Fix handling devices with direct_complete set on errors

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Rafael J. Wysocki <[email protected]>

[ Upstream commit 03f1444016b71feffa1dfb8a51f15ba592f94b13 ]

When dpm_suspend() fails, some devices with power.direct_complete set may not have been handled by device_suspend() yet, so runtime PM has not been disabled for them yet even though power.direct_complete is set.

Since device_resume() expects that runtime PM has been disabled for all devices with power.direct_complete set, it will attempt to reenable runtime PM for the devices that have not been processed by device_suspend() which does not make sense. Had those devices had runtime PM disabled before device_suspend() had run, device_resume() would have inadvertently enable runtime PM for them, but this is not expected to happen because it would require ->prepare() callbacks to return positive values for devices with runtime PM disabled, which would be invalid.

In practice, this issue is most likely benign because pm_runtime_enable() will not allow the "disable depth" counter to underflow, but it causes a warning message to be printed for each affected device.

To allow device_resume() to distinguish the "direct complete" devices that have been processed by device_suspend() from those which have not been handled by it, make device_suspend() set power.is_suspended for "direct complete" devices.

Next, move the power.is_suspended check in device_resume() before the power.direct_complete check in it to make it skip the "direct complete" devices that have not been handled by device_suspend().

This change is based on a preliminary patch from Saravana Kannan.

---
 drivers/base/power/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/base/power/main.c +4 -4
index 5afafd4e13dff..23be2d1b04079 100644
@@ -929,6 +929,9 @@ static void device_resume(struct device *dev, pm_message_t state, bool async)
 	if (dev->power.syscore)
 		goto Complete;
 
+	if (!dev->power.is_suspended)
+		goto Complete;
+
 	if (dev->power.direct_complete) {
 		/* Match the pm_runtime_disable() in device_suspend(). */
 		pm_runtime_enable(dev);
@@ -947,9 +950,6 @@ static void device_resume(struct device *dev, pm_message_t state, bool async)
 	 */
 	dev->power.is_prepared = false;
 
-	if (!dev->power.is_suspended)
-		goto Unlock;
-
 	if (dev->pm_domain) {
 		info = "power domain ";
 		callback = pm_op(&dev->pm_domain->ops, state);
@@ -989,7 +989,6 @@ static void device_resume(struct device *dev, pm_message_t state, bool async)
 	error = dpm_run_callback(callback, dev, state, info);
 	dev->power.is_suspended = false;
 
- Unlock:
 	device_unlock(dev);
 	dpm_watchdog_clear(&wd);
 
@@ -1649,6 +1648,7 @@ static int device_suspend(struct device *dev, pm_message_t state, bool async)
 			pm_runtime_disable(dev);
 			if (pm_runtime_status_suspended(dev)) {
 				pm_dev_dbg(dev, state, "direct-complete ");
+				dev->power.is_suspended = true;
 				goto Complete;
 			}
 
Signature · 1 line
2.39.5
author maintainer
#43 lore raw

PATCH 43/731 lockdep: Dont disable interrupts on RT in disable_irq_nosync_lockdep.*()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <[email protected]>

[ Upstream commit 87886b32d669abc11c7be95ef44099215e4f5788 ]

disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to avoid false positive reports by lockdep that a certain lock has not been acquired with disabled interrupts. The user of this macros expects that a lock can be acquried without disabling interrupts because the IRQ line triggering the interrupt is disabled.

This triggers a warning on PREEMPT_RT because after disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired with disabled interrupts.

On PREEMPT_RT there is no difference between spin_lock() and spin_lock_irq() so avoiding disabling interrupts in this case works for the two remaining callers as of today.

Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*().

---
 include/linux/interrupt.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/interrupt.h +4 -4
index 8cd9327e4e78d..a1b1be9bf73b2 100644
@@ -448,7 +448,7 @@ irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
 static inline void disable_irq_nosync_lockdep(unsigned int irq)
 {
 	disable_irq_nosync(irq);
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_disable();
 #endif
 }
@@ -456,7 +456,7 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
 static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
 {
 	disable_irq_nosync(irq);
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_save(*flags);
 #endif
 }
@@ -471,7 +471,7 @@ static inline void disable_irq_lockdep(unsigned int irq)
 
 static inline void enable_irq_lockdep(unsigned int irq)
 {
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_enable();
 #endif
 	enable_irq(irq);
@@ -479,7 +479,7 @@ static inline void enable_irq_lockdep(unsigned int irq)
 
 static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
 {
-#ifdef CONFIG_LOCKDEP
+#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
 	local_irq_restore(*flags);
 #endif
 	enable_irq(irq);
Signature · 1 line
2.39.5
author maintainer
#44 lore raw

PATCH 44/731 cpufreq: Init cpufreq only for present CPUs

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jacky Bai <[email protected]>

[ Upstream commit 45f589b7167f36290d29c79e3a442dc0b13c086a ]

for_each_possible_cpu() is currently used to initialize cpufreq. However, in cpu_dev_register_generic(), for_each_present_cpu() is used to register CPU devices which means the CPU devices are only registered for present CPUs and not all possible CPUs.

With nosmp or maxcpus=0, only the boot CPU is present, lead to the cpufreq probe failure or defer probe due to no cpu device available for not present CPUs.

Change for_each_possible_cpu() to for_each_present_cpu() in the above cpufreq drivers to ensure it only registers cpufreq for CPUs that are actually present.

Fixes b0c69e1214bc ("drivers: base: Use present CPUs in GENERIC_CPU_DEVICES")
---
 drivers/cpufreq/armada-8k-cpufreq.c    | 2 +-
 drivers/cpufreq/cpufreq-dt.c           | 2 +-
 drivers/cpufreq/mediatek-cpufreq-hw.c  | 2 +-
 drivers/cpufreq/mediatek-cpufreq.c     | 2 +-
 drivers/cpufreq/mvebu-cpufreq.c        | 2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c      | 2 +-
 drivers/cpufreq/qcom-cpufreq-nvmem.c   | 8 ++++----
 drivers/cpufreq/scmi-cpufreq.c         | 2 +-
 drivers/cpufreq/scpi-cpufreq.c         | 2 +-
 drivers/cpufreq/sun50i-cpufreq-nvmem.c | 6 +++---
 drivers/cpufreq/virtual-cpufreq.c      | 2 +-
 11 files changed, 16 insertions(+), 16 deletions(-)
drivers/cpufreq/armada-8k-cpufreq.c +1 -1
index 7a979db81f098..5a3545bd0d8d2 100644
@@ -47,7 +47,7 @@ static void __init armada_8k_get_sharing_cpus(struct clk *cur_clk,
 {
 	int cpu;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		struct device *cpu_dev;
 		struct clk *clk;
 
drivers/cpufreq/cpufreq-dt.c +1 -1
index 3a7c3372bda75..f3913eea5e553 100644
@@ -303,7 +303,7 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
 	int ret, cpu;
 
 	/* Request resources early so we can return in case of -EPROBE_DEFER */
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		ret = dt_cpufreq_early_init(&pdev->dev, cpu);
 		if (ret)
 			goto err;
drivers/cpufreq/mediatek-cpufreq-hw.c +1 -1
index 9252ebd60373f..478257523cc3c 100644
@@ -304,7 +304,7 @@ static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev)
 	struct regulator *cpu_reg;
 
 	/* Make sure that all CPU supplies are available before proceeding. */
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		cpu_dev = get_cpu_device(cpu);
 		if (!cpu_dev)
 			return dev_err_probe(&pdev->dev, -EPROBE_DEFER,
drivers/cpufreq/mediatek-cpufreq.c +1 -1
index 663f61565cf72..2e4f9ca0af350 100644
@@ -632,7 +632,7 @@ static int mtk_cpufreq_probe(struct platform_device *pdev)
 		return dev_err_probe(&pdev->dev, -ENODEV,
 				     "failed to get mtk cpufreq platform data\n");
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		info = mtk_cpu_dvfs_info_lookup(cpu);
 		if (info)
 			continue;
drivers/cpufreq/mvebu-cpufreq.c +1 -1
index 7f3cfe668f307..2aad4c04673cc 100644
@@ -56,7 +56,7 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
 	 * it), and registers the clock notifier that will take care
 	 * of doing the PMSU part of a frequency transition.
 	 */
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		struct device *cpu_dev;
 		struct clk *clk;
 		int ret;
drivers/cpufreq/qcom-cpufreq-hw.c +1 -1
index b2e7e89feaac4..dce7cad1813fb 100644
@@ -306,7 +306,7 @@ static void qcom_get_related_cpus(int index, struct cpumask *m)
 	struct of_phandle_args args;
 	int cpu, ret;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		cpu_np = of_cpu_device_node_get(cpu);
 		if (!cpu_np)
 			continue;
drivers/cpufreq/qcom-cpufreq-nvmem.c +4 -4
index 3a8ed723a23e5..54f8117103c85 100644
@@ -489,7 +489,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
 		nvmem_cell_put(speedbin_nvmem);
 	}
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		struct dev_pm_opp_config config = {
 			.supported_hw = NULL,
 		};
@@ -543,7 +543,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
 	dev_err(cpu_dev, "Failed to register platform device\n");
 
 free_opp:
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		dev_pm_domain_detach_list(drv->cpus[cpu].pd_list);
 		dev_pm_opp_clear_config(drv->cpus[cpu].opp_token);
 	}
@@ -557,7 +557,7 @@ static void qcom_cpufreq_remove(struct platform_device *pdev)
 
 	platform_device_unregister(cpufreq_dt_pdev);
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		dev_pm_domain_detach_list(drv->cpus[cpu].pd_list);
 		dev_pm_opp_clear_config(drv->cpus[cpu].opp_token);
 	}
@@ -568,7 +568,7 @@ static int qcom_cpufreq_suspend(struct device *dev)
 	struct qcom_cpufreq_drv *drv = dev_get_drvdata(dev);
 	unsigned int cpu;
 
-	for_each_possible_cpu(cpu)
+	for_each_present_cpu(cpu)
 		qcom_cpufreq_suspend_pd_devs(drv, cpu);
 
 	return 0;
drivers/cpufreq/scmi-cpufreq.c +1 -1
index b8fe758aeb010..914bf2c940a03 100644
@@ -104,7 +104,7 @@ scmi_get_sharing_cpus(struct device *cpu_dev, int domain,
 	int cpu, tdomain;
 	struct device *tcpu_dev;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		if (cpu == cpu_dev->id)
 			continue;
 
drivers/cpufreq/scpi-cpufreq.c +1 -1
index 9e09565e41c09..1f97b949763fa 100644
@@ -65,7 +65,7 @@ scpi_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
 	if (domain < 0)
 		return domain;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		if (cpu == cpu_dev->id)
 			continue;
 
drivers/cpufreq/sun50i-cpufreq-nvmem.c +3 -3
index 17d6a149f580d..47d6840b34899 100644
@@ -262,7 +262,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
 	snprintf(name, sizeof(name), "speed%d", speed);
 	config.prop_name = name;
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		struct device *cpu_dev = get_cpu_device(cpu);
 
 		if (!cpu_dev) {
@@ -288,7 +288,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
 	pr_err("Failed to register platform device\n");
 
 free_opp:
-	for_each_possible_cpu(cpu)
+	for_each_present_cpu(cpu)
 		dev_pm_opp_clear_config(opp_tokens[cpu]);
 	kfree(opp_tokens);
 
@@ -302,7 +302,7 @@ static void sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
 
 	platform_device_unregister(cpufreq_dt_pdev);
 
-	for_each_possible_cpu(cpu)
+	for_each_present_cpu(cpu)
 		dev_pm_opp_clear_config(opp_tokens[cpu]);
 
 	kfree(opp_tokens);
drivers/cpufreq/virtual-cpufreq.c +1 -1
index a050b3a6737f0..272dc3c85106c 100644
@@ -138,7 +138,7 @@ static int virt_cpufreq_get_sharing_cpus(struct cpufreq_policy *policy)
 	cur_perf_domain = readl_relaxed(base + policy->cpu *
 					PER_CPU_OFFSET + REG_PERF_DOMAIN_OFFSET);
 
-	for_each_possible_cpu(cpu) {
+	for_each_present_cpu(cpu) {
 		cpu_dev = get_cpu_device(cpu);
 		if (!cpu_dev)
 			continue;
Signature · 1 line
2.39.5
author maintainer
#45 lore raw

PATCH 45/731 perf/ring_buffer: Allow the EPOLLRDNORM flag for poll

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Tao Chen <[email protected]>

[ Upstream commit c96fff391c095c11dc87dab35be72dee7d217cde ]

The poll man page says POLLRDNORM is equivalent to POLLIN. For poll(), it seems that if user sets pollfd with POLLRDNORM in userspace, perf_poll will not return until timeout even if perf_output_wakeup called, whereas POLLIN returns.

Fixes 76369139ceb9 ("perf: Split up buffer handling from core code")
Cc Peter Zijlstra <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Linus Torvalds <[email protected]>
---
 kernel/events/ring_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/ring_buffer.c +1 -1
index 180509132d4b6..09459647cb822 100644
@@ -19,7 +19,7 @@
 
 static void perf_output_wakeup(struct perf_output_handle *handle)
 {
-	atomic_set(&handle->rb->poll, EPOLLIN);
+	atomic_set(&handle->rb->poll, EPOLLIN | EPOLLRDNORM);
 
 	handle->event->pending_wakeup = 1;
 
Signature · 1 line
2.39.5
author maintainer
#46 lore raw

PATCH 46/731 perf: Save PMU specific data in task_struct

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kan Liang <[email protected]>

[ Upstream commit cb4369129339060218baca718a578bb0b826e734 ]

Some PMU specific data has to be saved/restored during context switch, e.g. LBR call stack data. Currently, the data is saved in event context structure, but only for per-process event. For system-wide event, because of missing the LBR call stack data after context switch, LBR callstacks are always shorter in comparison to per-process mode.

For example,
Per-process mode:
$perf record --call-graph lbr -- taskset -c 0 ./tchain_edit

- 99.90% 99.86% tchain_edit tchain_edit [.] f3

       99.86% _start
          __libc_start_main
          generic_start_main
          main
          f1
        - f2
             f3
  System-wide mode:
  $perf record --call-graph lbr -a -- taskset -c 0 ./tchain_edit

- 99.88% 99.82% tchain_edit tchain_edit [.] f3
- 62.02% main

        f1
        f2
        f3
   - 28.83% f1
      - f2
        f3
   - 28.83% f1
      - f2
           f3
   - 8.88% generic_start_main
        main
        f1
        f2
        f3

It isn't practical to simply allocate the data for system-wide event in CPU context structure for all tasks. We have no idea which CPU a task will be scheduled to. The duplicated LBR data has to be maintained on every CPU context structure. That's a huge waste. Otherwise, the LBR data still lost if the task is scheduled to another CPU.

Save the pmu specific data in task_struct. The size of pmu specific data is 788 bytes for LBR call stack. Usually, the overall amount of threads doesn't exceed a few thousands. For 10K threads, keeping LBR data would consume additional ~8MB. The additional space will only be allocated during LBR call stack monitoring. It will be released when the monitoring is finished.

Furthermore, moving task_ctx_data from perf_event_context to task_struct can reduce complexity and make things clearer. E.g. perf doesn't need to swap task_ctx_data on optimized context switch path.
This patch set is just the first step. There could be other optimization/extension on top of this patch set. E.g. for cgroup profiling, perf just needs to save/store the LBR call stack information for tasks in specific cgroup. That could reduce the additional space. Also, the LBR call stack can be available for software events, or allow even debugging use cases, like LBRs on crash later.

Because of the alignment requirement of Intel Arch LBR, the Kmem cache is used to allocate the PMU specific data. It's required when child task allocates the space. Save it in struct perf_ctx_data.
The refcount in struct perf_ctx_data is used to track the users of pmu specific data.

Stable-dep-of: 3cec9fd03543 ("perf/x86/lbr: Fix shorter LBRs call stacks for the system-wide mode")

---
 include/linux/perf_event.h | 35 +++++++++++++++++++++++++++++++++++
 include/linux/sched.h      |  2 ++
 kernel/events/core.c       |  1 +
 3 files changed, 38 insertions(+)
include/linux/perf_event.h +35 -0
index 8333f132f4a96..852ea843bca27 100644
@@ -1020,6 +1020,41 @@ struct perf_event_context {
 	local_t				nr_no_switch_fast;
 };
 
+/**
+ * struct perf_ctx_data - PMU specific data for a task
+ * @rcu_head:  To avoid the race on free PMU specific data
+ * @refcount:  To track users
+ * @global:    To track system-wide users
+ * @ctx_cache: Kmem cache of PMU specific data
+ * @data:      PMU specific data
+ *
+ * Currently, the struct is only used in Intel LBR call stack mode to
+ * save/restore the call stack of a task on context switches.
+ *
+ * The rcu_head is used to prevent the race on free the data.
+ * The data only be allocated when Intel LBR call stack mode is enabled.
+ * The data will be freed when the mode is disabled.
+ * The content of the data will only be accessed in context switch, which
+ * should be protected by rcu_read_lock().
+ *
+ * Because of the alignment requirement of Intel Arch LBR, the Kmem cache
+ * is used to allocate the PMU specific data. The ctx_cache is to track
+ * the Kmem cache.
+ *
+ * Careful: Struct perf_ctx_data is added as a pointer in struct task_struct.
+ * When system-wide Intel LBR call stack mode is enabled, a buffer with
+ * constant size will be allocated for each task.
+ * Also, system memory consumption can further grow when the size of
+ * struct perf_ctx_data enlarges.
+ */
+struct perf_ctx_data {
+	struct rcu_head			rcu_head;
+	refcount_t			refcount;
+	int				global;
+	struct kmem_cache		*ctx_cache;
+	void				*data;
+};
+
 struct perf_cpu_pmu_context {
 	struct perf_event_pmu_context	epc;
 	struct perf_event_pmu_context	*task_epc;
include/linux/sched.h +2 -0
index 9c15365a30c08..b13c9545d5d67 100644
@@ -65,6 +65,7 @@ struct mempolicy;
 struct nameidata;
 struct nsproxy;
 struct perf_event_context;
+struct perf_ctx_data;
 struct pid_namespace;
 struct pipe_inode_info;
 struct rcu_node;
@@ -1311,6 +1312,7 @@ struct task_struct {
 	struct perf_event_context	*perf_event_ctxp;
 	struct mutex			perf_event_mutex;
 	struct list_head		perf_event_list;
+	struct perf_ctx_data __rcu	*perf_ctx_data;
 #endif
 #ifdef CONFIG_DEBUG_PREEMPT
 	unsigned long			preempt_disable_ip;
kernel/events/core.c +1 -0
index 823aa08249161..eb359be7ec793 100644
@@ -14002,6 +14002,7 @@ int perf_event_init_task(struct task_struct *child, u64 clone_flags)
 	child->perf_event_ctxp = NULL;
 	mutex_init(&child->perf_event_mutex);
 	INIT_LIST_HEAD(&child->perf_event_list);
+	child->perf_ctx_data = NULL;
 
 	ret = perf_event_init_context(child, clone_flags);
 	if (ret) {
Signature · 1 line
2.39.5
author maintainer
#47 lore raw

PATCH 47/731 perf: Supply task information to sched_task()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kan Liang <[email protected]>

[ Upstream commit d57e94f5b891925e4f2796266eba31edd5a01903 ]

To save/restore LBR call stack data in system-wide mode, the task_struct information is required.

Extend the parameters of sched_task() to supply task_struct information.

When schedule in, the LBR call stack data for new task will be restored. When schedule out, the LBR call stack data for old task will be saved. Only need to pass the required task_struct information.

Stable-dep-of: 3cec9fd03543 ("perf/x86/lbr: Fix shorter LBRs call stacks for the system-wide mode")

---
 arch/powerpc/perf/core-book3s.c    |  8 ++++++--
 arch/s390/kernel/perf_pai_crypto.c |  3 ++-
 arch/s390/kernel/perf_pai_ext.c    |  3 ++-
 arch/x86/events/amd/brs.c          |  3 ++-
 arch/x86/events/amd/lbr.c          |  3 ++-
 arch/x86/events/core.c             |  5 +++--
 arch/x86/events/intel/core.c       |  4 ++--
 arch/x86/events/intel/lbr.c        |  3 ++-
 arch/x86/events/perf_event.h       | 14 +++++++++-----
 include/linux/perf_event.h         |  2 +-
 kernel/events/core.c               | 20 +++++++++++---------
 11 files changed, 42 insertions(+), 26 deletions(-)
arch/powerpc/perf/core-book3s.c +6 -2
index 2b79171ee185b..f4e03aaabb4c3 100644
@@ -132,7 +132,10 @@ static unsigned long ebb_switch_in(bool ebb, struct cpu_hw_events *cpuhw)
 
 static inline void power_pmu_bhrb_enable(struct perf_event *event) {}
 static inline void power_pmu_bhrb_disable(struct perf_event *event) {}
-static void power_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in) {}
+static void power_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx,
+				 struct task_struct *task, bool sched_in)
+{
+}
 static inline void power_pmu_bhrb_read(struct perf_event *event, struct cpu_hw_events *cpuhw) {}
 static void pmao_restore_workaround(bool ebb) { }
 #endif /* CONFIG_PPC32 */
@@ -444,7 +447,8 @@ static void power_pmu_bhrb_disable(struct perf_event *event)
 /* Called from ctxsw to prevent one process's branch entries to
  * mingle with the other process's entries during context switch.
  */
-static void power_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+static void power_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx,
+				 struct task_struct *task, bool sched_in)
 {
 	if (!ppmu->bhrb_nr)
 		return;
arch/s390/kernel/perf_pai_crypto.c +2 -1
index 10725f5a6f0fd..63875270941bc 100644
@@ -518,7 +518,8 @@ static void paicrypt_have_samples(void)
 /* Called on schedule-in and schedule-out. No access to event structure,
  * but for sampling only event CRYPTO_ALL is allowed.
  */
-static void paicrypt_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+static void paicrypt_sched_task(struct perf_event_pmu_context *pmu_ctx,
+				struct task_struct *task, bool sched_in)
 {
 	/* We started with a clean page on event installation. So read out
 	 * results on schedule_out and if page was dirty, save old values.
arch/s390/kernel/perf_pai_ext.c +2 -1
index a8f0bad99cf04..fd14d5ebccbca 100644
@@ -542,7 +542,8 @@ static void paiext_have_samples(void)
 /* Called on schedule-in and schedule-out. No access to event structure,
  * but for sampling only event NNPA_ALL is allowed.
  */
-static void paiext_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+static void paiext_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			      struct task_struct *task, bool sched_in)
 {
 	/* We started with a clean page on event installation. So read out
 	 * results on schedule_out and if page was dirty, save old values.
arch/x86/events/amd/brs.c +2 -1
index 780acd3dff22a..ec34274633824 100644
@@ -381,7 +381,8 @@ static void amd_brs_poison_buffer(void)
  * On ctxswin, sched_in = true, called after the PMU has started
  * On ctxswout, sched_in = false, called before the PMU is stopped
  */
-void amd_pmu_brs_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+void amd_pmu_brs_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			    struct task_struct *task, bool sched_in)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
 
arch/x86/events/amd/lbr.c +2 -1
index 19c7b76e21bcb..c06ccca96851f 100644
@@ -371,7 +371,8 @@ void amd_pmu_lbr_del(struct perf_event *event)
 	perf_sched_cb_dec(event->pmu);
 }
 
-void amd_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+void amd_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			    struct task_struct *task, bool sched_in)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
 
arch/x86/events/core.c +3 -2
index 2092d615333da..3a27c50080f4f 100644
@@ -2625,9 +2625,10 @@ static const struct attribute_group *x86_pmu_attr_groups[] = {
 	NULL,
 };
 
-static void x86_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+static void x86_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			       struct task_struct *task, bool sched_in)
 {
-	static_call_cond(x86_pmu_sched_task)(pmu_ctx, sched_in);
+	static_call_cond(x86_pmu_sched_task)(pmu_ctx, task, sched_in);
 }
 
 static void x86_pmu_swap_task_ctx(struct perf_event_pmu_context *prev_epc,
arch/x86/events/intel/core.c +2 -2
index cdb19e3ba3aa3..f5eea63013b9b 100644
@@ -5244,10 +5244,10 @@ static void intel_pmu_cpu_dead(int cpu)
 }
 
 static void intel_pmu_sched_task(struct perf_event_pmu_context *pmu_ctx,
-				 bool sched_in)
+				 struct task_struct *task, bool sched_in)
 {
 	intel_pmu_pebs_sched_task(pmu_ctx, sched_in);
-	intel_pmu_lbr_sched_task(pmu_ctx, sched_in);
+	intel_pmu_lbr_sched_task(pmu_ctx, task, sched_in);
 }
 
 static void intel_pmu_swap_task_ctx(struct perf_event_pmu_context *prev_epc,
arch/x86/events/intel/lbr.c +2 -1
index dc641b50814e2..dafeee216f3b6 100644
@@ -539,7 +539,8 @@ void intel_pmu_lbr_swap_task_ctx(struct perf_event_pmu_context *prev_epc,
 	     task_context_opt(next_ctx_data)->lbr_callstack_users);
 }
 
-void intel_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+void intel_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			      struct task_struct *task, bool sched_in)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
 	void *task_ctx;
arch/x86/events/perf_event.h +9 -5
index 31c2771545a6c..ce7c98364d5b6 100644
@@ -869,7 +869,7 @@ struct x86_pmu {
 
 	void		(*check_microcode)(void);
 	void		(*sched_task)(struct perf_event_pmu_context *pmu_ctx,
-				      bool sched_in);
+				      struct task_struct *task, bool sched_in);
 
 	/*
 	 * Intel Arch Perfmon v2+
@@ -1394,7 +1394,8 @@ void amd_pmu_lbr_reset(void);
 void amd_pmu_lbr_read(void);
 void amd_pmu_lbr_add(struct perf_event *event);
 void amd_pmu_lbr_del(struct perf_event *event);
-void amd_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in);
+void amd_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			    struct task_struct *task, bool sched_in);
 void amd_pmu_lbr_enable_all(void);
 void amd_pmu_lbr_disable_all(void);
 int amd_pmu_lbr_hw_config(struct perf_event *event);
@@ -1448,7 +1449,8 @@ static inline void amd_pmu_brs_del(struct perf_event *event)
 	perf_sched_cb_dec(event->pmu);
 }
 
-void amd_pmu_brs_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in);
+void amd_pmu_brs_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			    struct task_struct *task, bool sched_in);
 #else
 static inline int amd_brs_init(void)
 {
@@ -1473,7 +1475,8 @@ static inline void amd_pmu_brs_del(struct perf_event *event)
 {
 }
 
-static inline void amd_pmu_brs_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in)
+static inline void amd_pmu_brs_sched_task(struct perf_event_pmu_context *pmu_ctx,
+					  struct task_struct *task, bool sched_in)
 {
 }
 
@@ -1656,7 +1659,8 @@ void intel_pmu_lbr_save_brstack(struct perf_sample_data *data,
 void intel_pmu_lbr_swap_task_ctx(struct perf_event_pmu_context *prev_epc,
 				 struct perf_event_pmu_context *next_epc);
 
-void intel_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx, bool sched_in);
+void intel_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
+			      struct task_struct *task, bool sched_in);
 
 u64 lbr_from_signext_quirk_wr(u64 val);
 
include/linux/perf_event.h +1 -1
index 852ea843bca27..bcb764c3a8034 100644
@@ -495,7 +495,7 @@ struct pmu {
 	 * context-switches callback
 	 */
 	void (*sched_task)		(struct perf_event_pmu_context *pmu_ctx,
-					bool sched_in);
+					 struct task_struct *task, bool sched_in);
 
 	/*
 	 * Kmem cache of PMU specific data
kernel/events/core.c +11 -9
index eb359be7ec793..03c27754aef8b 100644
@@ -3558,7 +3558,8 @@ static void perf_event_swap_task_ctx_data(struct perf_event_context *prev_ctx,
 	}
 }
 
-static void perf_ctx_sched_task_cb(struct perf_event_context *ctx, bool sched_in)
+static void perf_ctx_sched_task_cb(struct perf_event_context *ctx,
+				   struct task_struct *task, bool sched_in)
 {
 	struct perf_event_pmu_context *pmu_ctx;
 	struct perf_cpu_pmu_context *cpc;
@@ -3567,7 +3568,7 @@ static void perf_ctx_sched_task_cb(struct perf_event_context *ctx, bool sched_in
 		cpc = this_cpu_ptr(pmu_ctx->pmu->cpu_pmu_context);
 
 		if (cpc->sched_cb_usage && pmu_ctx->pmu->sched_task)
-			pmu_ctx->pmu->sched_task(pmu_ctx, sched_in);
+			pmu_ctx->pmu->sched_task(pmu_ctx, task, sched_in);
 	}
 }
 
@@ -3630,7 +3631,7 @@ perf_event_context_sched_out(struct task_struct *task, struct task_struct *next)
 			WRITE_ONCE(ctx->task, next);
 			WRITE_ONCE(next_ctx->task, task);
 
-			perf_ctx_sched_task_cb(ctx, false);
+			perf_ctx_sched_task_cb(ctx, task, false);
 			perf_event_swap_task_ctx_data(ctx, next_ctx);
 
 			perf_ctx_enable(ctx, false);
@@ -3660,7 +3661,7 @@ perf_event_context_sched_out(struct task_struct *task, struct task_struct *next)
 		perf_ctx_disable(ctx, false);
 
 inside_switch:
-		perf_ctx_sched_task_cb(ctx, false);
+		perf_ctx_sched_task_cb(ctx, task, false);
 		task_ctx_sched_out(ctx, NULL, EVENT_ALL);
 
 		perf_ctx_enable(ctx, false);
@@ -3702,7 +3703,8 @@ void perf_sched_cb_inc(struct pmu *pmu)
  * PEBS requires this to provide PID/TID information. This requires we flush
  * all queued PEBS records before we context switch to a new task.
  */
-static void __perf_pmu_sched_task(struct perf_cpu_pmu_context *cpc, bool sched_in)
+static void __perf_pmu_sched_task(struct perf_cpu_pmu_context *cpc,
+				  struct task_struct *task, bool sched_in)
 {
 	struct perf_cpu_context *cpuctx = this_cpu_ptr(&perf_cpu_context);
 	struct pmu *pmu;
@@ -3716,7 +3718,7 @@ static void __perf_pmu_sched_task(struct perf_cpu_pmu_context *cpc, bool sched_i
 	perf_ctx_lock(cpuctx, cpuctx->task_ctx);
 	perf_pmu_disable(pmu);
 
-	pmu->sched_task(cpc->task_epc, sched_in);
+	pmu->sched_task(cpc->task_epc, task, sched_in);
 
 	perf_pmu_enable(pmu);
 	perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
@@ -3734,7 +3736,7 @@ static void perf_pmu_sched_task(struct task_struct *prev,
 		return;
 
 	list_for_each_entry(cpc, this_cpu_ptr(&sched_cb_list), sched_cb_entry)
-		__perf_pmu_sched_task(cpc, sched_in);
+		__perf_pmu_sched_task(cpc, sched_in ? next : prev, sched_in);
 }
 
 static void perf_event_switch(struct task_struct *task,
@@ -4029,7 +4031,7 @@ static void perf_event_context_sched_in(struct task_struct *task)
 		perf_ctx_lock(cpuctx, ctx);
 		perf_ctx_disable(ctx, false);
 
-		perf_ctx_sched_task_cb(ctx, true);
+		perf_ctx_sched_task_cb(ctx, task, true);
 
 		perf_ctx_enable(ctx, false);
 		perf_ctx_unlock(cpuctx, ctx);
@@ -4060,7 +4062,7 @@ static void perf_event_context_sched_in(struct task_struct *task)
 
 	perf_event_sched_in(cpuctx, ctx, NULL);
 
-	perf_ctx_sched_task_cb(cpuctx->task_ctx, true);
+	perf_ctx_sched_task_cb(cpuctx->task_ctx, task, true);
 
 	if (!RB_EMPTY_ROOT(&ctx->pinned_groups.tree))
 		perf_ctx_enable(&cpuctx->ctx, false);
Signature · 1 line
2.39.5
author maintainer
#48 lore raw

PATCH 48/731 perf/x86/lbr: Fix shorter LBRs call stacks for the system-wide mode

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kan Liang <[email protected]>

[ Upstream commit 3cec9fd03543c1e2919f906353e5cba079ae0a7c ]

In the system-wide mode, LBR callstacks are shorter in comparison to the per-process mode.

LBR MSRs are reset during a context switch in the system-wide mode. For the LBR call stack, the LBRs should be always saved/restored during a context switch.

Use the space in task_struct to save/restore the LBR call stack data.

For a system-wide event, it's unnecessagy to update the lbr_callstack_users for each threads. Add a variable in x86_pmu to indicate whether the system-wide event is active.

---
 arch/x86/events/intel/lbr.c  | 47 ++++++++++++++++++++++++++++++------
 arch/x86/events/perf_event.h |  1 +
 2 files changed, 40 insertions(+), 8 deletions(-)
arch/x86/events/intel/lbr.c +39 -8
index dafeee216f3b6..24719adbcd7ea 100644
@@ -422,11 +422,17 @@ static __always_inline bool lbr_is_reset_in_cstate(void *ctx)
 	return !rdlbr_from(((struct x86_perf_task_context *)ctx)->tos, NULL);
 }
 
+static inline bool has_lbr_callstack_users(void *ctx)
+{
+	return task_context_opt(ctx)->lbr_callstack_users ||
+	       x86_pmu.lbr_callstack_users;
+}
+
 static void __intel_pmu_lbr_restore(void *ctx)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
 
-	if (task_context_opt(ctx)->lbr_callstack_users == 0 ||
+	if (!has_lbr_callstack_users(ctx) ||
 	    task_context_opt(ctx)->lbr_stack_state == LBR_NONE) {
 		intel_pmu_lbr_reset();
 		return;
@@ -503,7 +509,7 @@ static void __intel_pmu_lbr_save(void *ctx)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
 
-	if (task_context_opt(ctx)->lbr_callstack_users == 0) {
+	if (!has_lbr_callstack_users(ctx)) {
 		task_context_opt(ctx)->lbr_stack_state = LBR_NONE;
 		return;
 	}
@@ -543,6 +549,7 @@ void intel_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
 			      struct task_struct *task, bool sched_in)
 {
 	struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
+	struct perf_ctx_data *ctx_data;
 	void *task_ctx;
 
 	if (!cpuc->lbr_users)
@@ -553,14 +560,18 @@ void intel_pmu_lbr_sched_task(struct perf_event_pmu_context *pmu_ctx,
 	 * the task was scheduled out, restore the stack. Otherwise flush
 	 * the LBR stack.
 	 */
-	task_ctx = pmu_ctx ? pmu_ctx->task_ctx_data : NULL;
+	rcu_read_lock();
+	ctx_data = rcu_dereference(task->perf_ctx_data);
+	task_ctx = ctx_data ? ctx_data->data : NULL;
 	if (task_ctx) {
 		if (sched_in)
 			__intel_pmu_lbr_restore(task_ctx);
 		else
 			__intel_pmu_lbr_save(task_ctx);
+		rcu_read_unlock();
 		return;
 	}
+	rcu_read_unlock();
 
 	/*
 	 * Since a context switch can flip the address space and LBR entries
@@ -589,9 +600,19 @@ void intel_pmu_lbr_add(struct perf_event *event)
 
 	cpuc->br_sel = event->hw.branch_reg.reg;
 
-	if (branch_user_callstack(cpuc->br_sel) && event->pmu_ctx->task_ctx_data)
-		task_context_opt(event->pmu_ctx->task_ctx_data)->lbr_callstack_users++;
+	if (branch_user_callstack(cpuc->br_sel)) {
+		if (event->attach_state & PERF_ATTACH_TASK) {
+			struct task_struct *task = event->hw.target;
+			struct perf_ctx_data *ctx_data;
 
+			rcu_read_lock();
+			ctx_data = rcu_dereference(task->perf_ctx_data);
+			if (ctx_data)
+				task_context_opt(ctx_data->data)->lbr_callstack_users++;
+			rcu_read_unlock();
+		} else
+			x86_pmu.lbr_callstack_users++;
+	}
 	/*
 	 * Request pmu::sched_task() callback, which will fire inside the
 	 * regular perf event scheduling, so that call will:
@@ -665,9 +686,19 @@ void intel_pmu_lbr_del(struct perf_event *event)
 	if (!x86_pmu.lbr_nr)
 		return;
 
-	if (branch_user_callstack(cpuc->br_sel) &&
-	    event->pmu_ctx->task_ctx_data)
-		task_context_opt(event->pmu_ctx->task_ctx_data)->lbr_callstack_users--;
+	if (branch_user_callstack(cpuc->br_sel)) {
+		if (event->attach_state & PERF_ATTACH_TASK) {
+			struct task_struct *task = event->hw.target;
+			struct perf_ctx_data *ctx_data;
+
+			rcu_read_lock();
+			ctx_data = rcu_dereference(task->perf_ctx_data);
+			if (ctx_data)
+				task_context_opt(ctx_data->data)->lbr_callstack_users--;
+			rcu_read_unlock();
+		} else
+			x86_pmu.lbr_callstack_users--;
+	}
 
 	if (event->hw.flags & PERF_X86_EVENT_LBR_SELECT)
 		cpuc->lbr_select = 0;
arch/x86/events/perf_event.h +1 -0
index ce7c98364d5b6..b93b526d6834a 100644
@@ -914,6 +914,7 @@ struct x86_pmu {
 		const int	*lbr_sel_map;	   /* lbr_select mappings */
 		int		*lbr_ctl_map;	   /* LBR_CTL mappings */
 	};
+	u64		lbr_callstack_users;	   /* lbr callstack system wide users */
 	bool		lbr_double_abort;	   /* duplicated lbr aborts */
 	bool		lbr_pt_coexist;		   /* (LBR|BTS) may coexist with PT */
 
Signature · 1 line
2.39.5
author maintainer
#49 lore raw

PATCH 49/731 sched/deadline: Ignore special tasks when rebuilding domains

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Juri Lelli <[email protected]>

[ Upstream commit f6147af176eaa4027b692fdbb1a0a60dfaa1e9b6 ]

SCHED_DEADLINE special tasks get a fake bandwidth that is only used to make sure sleeping and priority inheritance 'work', but it is ignored for runtime enforcement and admission control.

Be consistent with it also when rebuilding root domains.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index ff4df16b5186d..1a041c1fc0d1e 100644
@@ -2956,7 +2956,7 @@ void dl_add_task_root_domain(struct task_struct *p)
 	struct dl_bw *dl_b;
 
 	raw_spin_lock_irqsave(&p->pi_lock, rf.flags);
-	if (!dl_task(p)) {
+	if (!dl_task(p) || dl_entity_is_special(&p->dl)) {
 		raw_spin_unlock_irqrestore(&p->pi_lock, rf.flags);
 		return;
 	}
Signature · 1 line
2.39.5
author maintainer
#50 lore raw

PATCH 50/731 sched/topology: Wrappers for sched_domains_mutex

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Juri Lelli <[email protected]>

[ Upstream commit 56209334dda1832c0a919e1d74768c6d0f3b2ca9 ]

Create wrappers for sched_domains_mutex so that it can transparently be used on both CONFIG_SMP and !CONFIG_SMP, as some function will need to do.

---
 include/linux/sched.h   |  5 +++++
 kernel/cgroup/cpuset.c  |  4 ++--
 kernel/sched/core.c     |  4 ++--
 kernel/sched/debug.c    |  8 ++++----
 kernel/sched/topology.c | 12 ++++++++++--
 5 files changed, 23 insertions(+), 10 deletions(-)
include/linux/sched.h +5 -0
index b13c9545d5d67..6e5c38718ff56 100644
@@ -383,6 +383,11 @@ enum uclamp_id {
 #ifdef CONFIG_SMP
 extern struct root_domain def_root_domain;
 extern struct mutex sched_domains_mutex;
+extern void sched_domains_mutex_lock(void);
+extern void sched_domains_mutex_unlock(void);
+#else
+static inline void sched_domains_mutex_lock(void) { }
+static inline void sched_domains_mutex_unlock(void) { }
 #endif
 
 struct sched_param {
kernel/cgroup/cpuset.c +2 -2
index 0f910c828973a..f87526edb2a46 100644
@@ -994,10 +994,10 @@ static void
 partition_and_rebuild_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
 				    struct sched_domain_attr *dattr_new)
 {
-	mutex_lock(&sched_domains_mutex);
+	sched_domains_mutex_lock();
 	partition_sched_domains_locked(ndoms_new, doms_new, dattr_new);
 	dl_rebuild_rd_accounting();
-	mutex_unlock(&sched_domains_mutex);
+	sched_domains_mutex_unlock();
 }
 
 /*
kernel/sched/core.c +2 -2
index 042351c7afce7..8adf495491179 100644
@@ -8424,9 +8424,9 @@ void __init sched_init_smp(void)
 	 * CPU masks are stable and all blatant races in the below code cannot
 	 * happen.
 	 */
-	mutex_lock(&sched_domains_mutex);
+	sched_domains_mutex_lock();
 	sched_init_domains(cpu_active_mask);
-	mutex_unlock(&sched_domains_mutex);
+	sched_domains_mutex_unlock();
 
 	/* Move init over to a non-isolated CPU */
 	if (set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_TYPE_DOMAIN)) < 0)
kernel/sched/debug.c +4 -4
index ef047add7f9e6..a0893a483d35d 100644
@@ -292,7 +292,7 @@ static ssize_t sched_verbose_write(struct file *filp, const char __user *ubuf,
 	bool orig;
 
 	cpus_read_lock();
-	mutex_lock(&sched_domains_mutex);
+	sched_domains_mutex_lock();
 
 	orig = sched_debug_verbose;
 	result = debugfs_write_file_bool(filp, ubuf, cnt, ppos);
@@ -304,7 +304,7 @@ static ssize_t sched_verbose_write(struct file *filp, const char __user *ubuf,
 		sd_dentry = NULL;
 	}
 
-	mutex_unlock(&sched_domains_mutex);
+	sched_domains_mutex_unlock();
 	cpus_read_unlock();
 
 	return result;
@@ -515,9 +515,9 @@ static __init int sched_init_debug(void)
 	debugfs_create_u32("migration_cost_ns", 0644, debugfs_sched, &sysctl_sched_migration_cost);
 	debugfs_create_u32("nr_migrate", 0644, debugfs_sched, &sysctl_sched_nr_migrate);
 
-	mutex_lock(&sched_domains_mutex);
+	sched_domains_mutex_lock();
 	update_sched_domain_debugfs();
-	mutex_unlock(&sched_domains_mutex);
+	sched_domains_mutex_unlock();
 #endif
 
 #ifdef CONFIG_NUMA_BALANCING
kernel/sched/topology.c +10 -2
index c49aea8c10254..296ff2acfd321 100644
@@ -6,6 +6,14 @@
 #include <linux/bsearch.h>
 
 DEFINE_MUTEX(sched_domains_mutex);
+void sched_domains_mutex_lock(void)
+{
+	mutex_lock(&sched_domains_mutex);
+}
+void sched_domains_mutex_unlock(void)
+{
+	mutex_unlock(&sched_domains_mutex);
+}
 
 /* Protected by sched_domains_mutex: */
 static cpumask_var_t sched_domains_tmpmask;
@@ -2791,7 +2799,7 @@ void partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[],
 void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
 			     struct sched_domain_attr *dattr_new)
 {
-	mutex_lock(&sched_domains_mutex);
+	sched_domains_mutex_lock();
 	partition_sched_domains_locked(ndoms_new, doms_new, dattr_new);
-	mutex_unlock(&sched_domains_mutex);
+	sched_domains_mutex_unlock();
 }
Signature · 1 line
2.39.5
author maintainer
#51 lore raw

PATCH 51/731 sched/deadline: Generalize unique visiting of root domains

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Juri Lelli <[email protected]>

[ Upstream commit 45007c6fb5860cf63556a9cadc87c8984927e23d ]

Bandwidth checks and updates that work on root domains currently employ a cookie mechanism for efficiency. This mechanism is very much tied to when root domains are first created and initialized.

Generalize the cookie mechanism so that it can be used also later at runtime while updating root domains. Also, additionally guard it with sched_domains_mutex, since domains need to be stable while updating them (and it will be required for further dynamic changes).

---
 include/linux/sched/deadline.h |  3 +++
 kernel/sched/deadline.c        | 23 +++++++++++++----------
 kernel/sched/rt.c              |  2 ++
 kernel/sched/sched.h           |  2 +-
 kernel/sched/topology.c        |  2 +-
 5 files changed, 20 insertions(+), 12 deletions(-)
include/linux/sched/deadline.h +3 -0
index 3a912ab42bb55..6ec578600b24c 100644
@@ -37,4 +37,7 @@ extern void dl_clear_root_domain(struct root_domain *rd);
 
 #endif /* CONFIG_SMP */
 
+extern u64 dl_cookie;
+extern bool dl_bw_visited(int cpu, u64 cookie);
+
 #endif /* _LINUX_SCHED_DEADLINE_H */
kernel/sched/deadline.c +13 -10
index 1a041c1fc0d1e..3e05032e9e0eb 100644
@@ -166,14 +166,14 @@ static inline unsigned long dl_bw_capacity(int i)
 	}
 }
 
-static inline bool dl_bw_visited(int cpu, u64 gen)
+static inline bool dl_bw_visited(int cpu, u64 cookie)
 {
 	struct root_domain *rd = cpu_rq(cpu)->rd;
 
-	if (rd->visit_gen == gen)
+	if (rd->visit_cookie == cookie)
 		return true;
 
-	rd->visit_gen = gen;
+	rd->visit_cookie = cookie;
 	return false;
 }
 
@@ -207,7 +207,7 @@ static inline unsigned long dl_bw_capacity(int i)
 	return SCHED_CAPACITY_SCALE;
 }
 
-static inline bool dl_bw_visited(int cpu, u64 gen)
+static inline bool dl_bw_visited(int cpu, u64 cookie)
 {
 	return false;
 }
@@ -3171,15 +3171,18 @@ DEFINE_SCHED_CLASS(dl) = {
 #endif
 };
 
-/* Used for dl_bw check and update, used under sched_rt_handler()::mutex */
-static u64 dl_generation;
+/*
+ * Used for dl_bw check and update, used under sched_rt_handler()::mutex and
+ * sched_domains_mutex.
+ */
+u64 dl_cookie;
 
 int sched_dl_global_validate(void)
 {
 	u64 runtime = global_rt_runtime();
 	u64 period = global_rt_period();
 	u64 new_bw = to_ratio(period, runtime);
-	u64 gen = ++dl_generation;
+	u64 cookie = ++dl_cookie;
 	struct dl_bw *dl_b;
 	int cpu, cpus, ret = 0;
 	unsigned long flags;
@@ -3192,7 +3195,7 @@ int sched_dl_global_validate(void)
 	for_each_online_cpu(cpu) {
 		rcu_read_lock_sched();
 
-		if (dl_bw_visited(cpu, gen))
+		if (dl_bw_visited(cpu, cookie))
 			goto next;
 
 		dl_b = dl_bw_of(cpu);
@@ -3229,7 +3232,7 @@ static void init_dl_rq_bw_ratio(struct dl_rq *dl_rq)
 void sched_dl_do_global(void)
 {
 	u64 new_bw = -1;
-	u64 gen = ++dl_generation;
+	u64 cookie = ++dl_cookie;
 	struct dl_bw *dl_b;
 	int cpu;
 	unsigned long flags;
@@ -3240,7 +3243,7 @@ void sched_dl_do_global(void)
 	for_each_possible_cpu(cpu) {
 		rcu_read_lock_sched();
 
-		if (dl_bw_visited(cpu, gen)) {
+		if (dl_bw_visited(cpu, cookie)) {
 			rcu_read_unlock_sched();
 			continue;
 		}
kernel/sched/rt.c +2 -0
index 4b8e33c615b12..8cebe71d2bb16 100644
@@ -2910,6 +2910,7 @@ static int sched_rt_handler(const struct ctl_table *table, int write, void *buff
 	int ret;
 
 	mutex_lock(&mutex);
+	sched_domains_mutex_lock();
 	old_period = sysctl_sched_rt_period;
 	old_runtime = sysctl_sched_rt_runtime;
 
@@ -2936,6 +2937,7 @@ static int sched_rt_handler(const struct ctl_table *table, int write, void *buff
 		sysctl_sched_rt_period = old_period;
 		sysctl_sched_rt_runtime = old_runtime;
 	}
+	sched_domains_mutex_unlock();
 	mutex_unlock(&mutex);
 
 	return ret;
kernel/sched/sched.h +1 -1
index 023b844159c94..1aa65a0ac5864 100644
@@ -998,7 +998,7 @@ struct root_domain {
 	 * Also, some corner cases, like 'wrap around' is dangerous, but given
 	 * that u64 is 'big enough'. So that shouldn't be a concern.
 	 */
-	u64 visit_gen;
+	u64 visit_cookie;
 
 #ifdef HAVE_RT_PUSH_IPI
 	/*
kernel/sched/topology.c +1 -1
index 296ff2acfd321..44093339761c9 100644
@@ -568,7 +568,7 @@ static int init_rootdomain(struct root_domain *rd)
 	rd->rto_push_work = IRQ_WORK_INIT_HARD(rto_push_irq_work_func);
 #endif
 
-	rd->visit_gen = 0;
+	rd->visit_cookie = 0;
 	init_dl_bw(&rd->dl_bw);
 	if (cpudl_init(&rd->cpudl) != 0)
 		goto free_rto_mask;
Signature · 1 line
2.39.5
author maintainer
#52 lore raw

PATCH 52/731 sched/deadline: Rebuild root domain accounting after every update

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Juri Lelli <[email protected]>

[ Upstream commit 2ff899e3516437354204423ef0a94994717b8e6a ]

Rebuilding of root domains accounting information (total_bw) is currently broken on some cases, e.g. suspend/resume on aarch64. Problem is that the way we keep track of domain changes and try to add bandwidth back is convoluted and fragile.

Fix it by simplify things by making sure bandwidth accounting is cleared and completely restored after root domains changes (after root domains are again stable).

To be sure we always call dl_rebuild_rd_accounting while holding cpuset_mutex we also add cpuset_reset_sched_domains() wrapper.

---
 include/linux/cpuset.h         |  6 ++++++
 include/linux/sched/deadline.h |  1 +
 include/linux/sched/topology.h |  2 ++
 kernel/cgroup/cpuset.c         | 23 ++++++++++++++++-------
 kernel/sched/core.c            |  4 ++--
 kernel/sched/deadline.c        | 16 ++++++++++------
 kernel/sched/topology.c        |  1 +
 7 files changed, 38 insertions(+), 15 deletions(-)
include/linux/cpuset.h +6 -0
index 835e7b793f6a3..17cc90d900f96 100644
@@ -128,6 +128,7 @@ extern bool current_cpuset_is_being_rebound(void);
 extern void rebuild_sched_domains(void);
 
 extern void cpuset_print_current_mems_allowed(void);
+extern void cpuset_reset_sched_domains(void);
 
 /*
  * read_mems_allowed_begin is required when making decisions involving
@@ -264,6 +265,11 @@ static inline void rebuild_sched_domains(void)
 	partition_sched_domains(1, NULL, NULL);
 }
 
+static inline void cpuset_reset_sched_domains(void)
+{
+	partition_sched_domains(1, NULL, NULL);
+}
+
 static inline void cpuset_print_current_mems_allowed(void)
 {
 }
include/linux/sched/deadline.h +1 -0
index 6ec578600b24c..f9aabbc9d22ef 100644
@@ -34,6 +34,7 @@ static inline bool dl_time_before(u64 a, u64 b)
 struct root_domain;
 extern void dl_add_task_root_domain(struct task_struct *p);
 extern void dl_clear_root_domain(struct root_domain *rd);
+extern void dl_clear_root_domain_cpu(int cpu);
 
 #endif /* CONFIG_SMP */
 
include/linux/sched/topology.h +2 -0
index 7f3dbafe18177..1622232bd08b9 100644
@@ -166,6 +166,8 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
 	return to_cpumask(sd->span);
 }
 
+extern void dl_rebuild_rd_accounting(void);
+
 extern void partition_sched_domains_locked(int ndoms_new,
 					   cpumask_var_t doms_new[],
 					   struct sched_domain_attr *dattr_new);
kernel/cgroup/cpuset.c +16 -7
index f87526edb2a46..1892dc8cd2119 100644
@@ -954,10 +954,12 @@ static void dl_update_tasks_root_domain(struct cpuset *cs)
 	css_task_iter_end(&it);
 }
 
-static void dl_rebuild_rd_accounting(void)
+void dl_rebuild_rd_accounting(void)
 {
 	struct cpuset *cs = NULL;
 	struct cgroup_subsys_state *pos_css;
+	int cpu;
+	u64 cookie = ++dl_cookie;
 
 	lockdep_assert_held(&cpuset_mutex);
 	lockdep_assert_cpus_held();
@@ -965,11 +967,12 @@ static void dl_rebuild_rd_accounting(void)
 
 	rcu_read_lock();
 
-	/*
-	 * Clear default root domain DL accounting, it will be computed again
-	 * if a task belongs to it.
-	 */
-	dl_clear_root_domain(&def_root_domain);
+	for_each_possible_cpu(cpu) {
+		if (dl_bw_visited(cpu, cookie))
+			continue;
+
+		dl_clear_root_domain_cpu(cpu);
+	}
 
 	cpuset_for_each_descendant_pre(cs, pos_css, &top_cpuset) {
 
@@ -996,7 +999,6 @@ partition_and_rebuild_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
 {
 	sched_domains_mutex_lock();
 	partition_sched_domains_locked(ndoms_new, doms_new, dattr_new);
-	dl_rebuild_rd_accounting();
 	sched_domains_mutex_unlock();
 }
 
@@ -1083,6 +1085,13 @@ void rebuild_sched_domains(void)
 	cpus_read_unlock();
 }
 
+void cpuset_reset_sched_domains(void)
+{
+	mutex_lock(&cpuset_mutex);
+	partition_sched_domains(1, NULL, NULL);
+	mutex_unlock(&cpuset_mutex);
+}
+
 /**
  * cpuset_update_tasks_cpumask - Update the cpumasks of tasks in the cpuset.
  * @cs: the cpuset in which each task's cpus_allowed mask needs to be changed
kernel/sched/core.c +2 -2
index 8adf495491179..3c7c942c7c429 100644
@@ -8183,7 +8183,7 @@ static void cpuset_cpu_active(void)
 		 * operation in the resume sequence, just build a single sched
 		 * domain, ignoring cpusets.
 		 */
-		partition_sched_domains(1, NULL, NULL);
+		cpuset_reset_sched_domains();
 		if (--num_cpus_frozen)
 			return;
 		/*
@@ -8202,7 +8202,7 @@ static void cpuset_cpu_inactive(unsigned int cpu)
 		cpuset_update_active_cpus();
 	} else {
 		num_cpus_frozen++;
-		partition_sched_domains(1, NULL, NULL);
+		cpuset_reset_sched_domains();
 	}
 }
 
kernel/sched/deadline.c +10 -6
index 3e05032e9e0eb..5dca336cdd7ca 100644
@@ -166,7 +166,7 @@ static inline unsigned long dl_bw_capacity(int i)
 	}
 }
 
-static inline bool dl_bw_visited(int cpu, u64 cookie)
+bool dl_bw_visited(int cpu, u64 cookie)
 {
 	struct root_domain *rd = cpu_rq(cpu)->rd;
 
@@ -207,7 +207,7 @@ static inline unsigned long dl_bw_capacity(int i)
 	return SCHED_CAPACITY_SCALE;
 }
 
-static inline bool dl_bw_visited(int cpu, u64 cookie)
+bool dl_bw_visited(int cpu, u64 cookie)
 {
 	return false;
 }
@@ -2981,18 +2981,22 @@ void dl_clear_root_domain(struct root_domain *rd)
 	rd->dl_bw.total_bw = 0;
 
 	/*
-	 * dl_server bandwidth is only restored when CPUs are attached to root
-	 * domains (after domains are created or CPUs moved back to the
-	 * default root doamin).
+	 * dl_servers are not tasks. Since dl_add_task_root_domain ignores
+	 * them, we need to account for them here explicitly.
 	 */
 	for_each_cpu(i, rd->span) {
 		struct sched_dl_entity *dl_se = &cpu_rq(i)->fair_server;
 
 		if (dl_server(dl_se) && cpu_active(i))
-			rd->dl_bw.total_bw += dl_se->dl_bw;
+			__dl_add(&rd->dl_bw, dl_se->dl_bw, dl_bw_cpus(i));
 	}
 }
 
+void dl_clear_root_domain_cpu(int cpu)
+{
+	dl_clear_root_domain(cpu_rq(cpu)->rd);
+}
+
 #endif /* CONFIG_SMP */
 
 static void switched_from_dl(struct rq *rq, struct task_struct *p)
kernel/sched/topology.c +1 -0
index 44093339761c9..363ad268a25b0 100644
@@ -2791,6 +2791,7 @@ void partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[],
 	ndoms_cur = ndoms_new;
 
 	update_sched_domain_debugfs();
+	dl_rebuild_rd_accounting();
 }
 
 /*
Signature · 1 line
2.39.5
author maintainer
#53 lore raw

PATCH 53/731 x86/traps: Make exc_double_fault() consistently noreturn

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Josh Poimboeuf <[email protected]>

[ Upstream commit 8085fcd78c1a3dbdf2278732579009d41ce0bc4e ]

The CONFIG_X86_ESPFIX64 version of exc_double_fault() can return to its caller, but the !CONFIG_X86_ESPFIX64 version never does. In the latter case the compiler and/or objtool may consider it to be implicitly noreturn.

However, due to the currently inflexible way objtool detects noreturns, a function's noreturn status needs to be consistent across configs.

The current workaround for this issue is to suppress unreachable warnings for exc_double_fault()'s callers. Unfortunately that can result in ORC coverage gaps and potentially worse issues like inert static calls and silently disabled CPU mitigations.

Instead, prevent exc_double_fault() from ever being implicitly marked noreturn by forcing a return behind a never-taken conditional.

Until a more integrated noreturn detection method exists, this is likely the least objectionable workaround.

---
 arch/x86/kernel/traps.c | 18 +++++++++++++++++-
 tools/objtool/check.c   | 31 +------------------------------
 2 files changed, 18 insertions(+), 31 deletions(-)
arch/x86/kernel/traps.c +17 -1
index 2dbadf347b5f4..5e3e036e6e537 100644
@@ -379,6 +379,21 @@ __visible void __noreturn handle_stack_overflow(struct pt_regs *regs,
 }
 #endif
 
+/*
+ * Prevent the compiler and/or objtool from marking the !CONFIG_X86_ESPFIX64
+ * version of exc_double_fault() as noreturn.  Otherwise the noreturn mismatch
+ * between configs triggers objtool warnings.
+ *
+ * This is a temporary hack until we have compiler or plugin support for
+ * annotating noreturns.
+ */
+#ifdef CONFIG_X86_ESPFIX64
+#define always_true() true
+#else
+bool always_true(void);
+bool __weak always_true(void) { return true; }
+#endif
+
 /*
  * Runs on an IST stack for x86_64 and on a special task stack for x86_32.
  *
@@ -514,7 +529,8 @@ DEFINE_IDTENTRY_DF(exc_double_fault)
 
 	pr_emerg("PANIC: double fault, error_code: 0x%lx\n", error_code);
 	die("double fault", regs, error_code);
-	panic("Machine halted.");
+	if (always_true())
+		panic("Machine halted.");
 	instrumentation_end();
 }
 
tools/objtool/check.c +1 -30
index ce973d9d8e6d8..c1fa0220f33de 100644
@@ -4449,35 +4449,6 @@ static int validate_sls(struct objtool_file *file)
 	return warnings;
 }
 
-static bool ignore_noreturn_call(struct instruction *insn)
-{
-	struct symbol *call_dest = insn_call_dest(insn);
-
-	/*
-	 * FIXME: hack, we need a real noreturn solution
-	 *
-	 * Problem is, exc_double_fault() may or may not return, depending on
-	 * whether CONFIG_X86_ESPFIX64 is set.  But objtool has no visibility
-	 * to the kernel config.
-	 *
-	 * Other potential ways to fix it:
-	 *
-	 *   - have compiler communicate __noreturn functions somehow
-	 *   - remove CONFIG_X86_ESPFIX64
-	 *   - read the .config file
-	 *   - add a cmdline option
-	 *   - create a generic objtool annotation format (vs a bunch of custom
-	 *     formats) and annotate it
-	 */
-	if (!strcmp(call_dest->name, "exc_double_fault")) {
-		/* prevent further unreachable warnings for the caller */
-		insn->sym->warned = 1;
-		return true;
-	}
-
-	return false;
-}
-
 static int validate_reachable_instructions(struct objtool_file *file)
 {
 	struct instruction *insn, *prev_insn;
@@ -4494,7 +4465,7 @@ static int validate_reachable_instructions(struct objtool_file *file)
 		prev_insn = prev_insn_same_sec(file, insn);
 		if (prev_insn && prev_insn->dead_end) {
 			call_dest = insn_call_dest(prev_insn);
-			if (call_dest && !ignore_noreturn_call(prev_insn)) {
+			if (call_dest) {
 				WARN_INSN(insn, "%s() is missing a __noreturn annotation",
 					  call_dest->name);
 				warnings++;
Signature · 1 line
2.39.5
author maintainer
#54 lore raw

PATCH 54/731 x86/fpu/xstate: Fix inconsistencies in guest FPU xfeatures

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chao Gao <[email protected]>

[ Upstream commit dda366083e5ff307a4a728757db874bbfe7550be ]

Guest FPUs manage vCPU FPU states. They are allocated via fpu_alloc_guest_fpstate() and are resized in fpstate_realloc() when XFD features are enabled.

Since the introduction of guest FPUs, there have been inconsistencies in the kernel buffer size and xfeatures:

1. fpu_alloc_guest_fpstate() uses fpu_user_cfg since its introduction. See:

69f6ed1d14c6 ("x86/fpu: Provide infrastructure for KVM FPU cleanup") 36487e6228c4 ("x86/fpu: Prepare guest FPU for dynamically enabled FPU features")

2. __fpstate_reset() references fpu_kernel_cfg to set storage attributes.

3. fpu->guest_perm uses fpu_kernel_cfg, affecting fpstate_realloc().

A recent commit in the tip:x86/fpu tree partially addressed the inconsistency between (1) and (3) by using fpu_kernel_cfg for size calculation in (1), but left fpu_guest->xfeatures and fpu_guest->perm still referencing fpu_user_cfg:

https://lore.kernel.org/all/[email protected]/

1937e18cc3cf ("x86/fpu: Fix guest FPU state buffer allocation size")

The inconsistencies within fpu_alloc_guest_fpstate() and across the mentioned functions cause confusion.

Fix them by using fpu_kernel_cfg consistently in fpu_alloc_guest_fpstate(), except for fields related to the UABI buffer. Referencing fpu_kernel_cfg won't impact functionalities, as:

1. fpu_guest->perm is overwritten shortly in fpu_init_guest_permissions()

    with fpstate->guest_perm, which already uses fpu_kernel_cfg.

2. fpu_guest->xfeatures is solely used to check if XFD features are enabled. Including supervisor xfeatures doesn't affect the check.

Fixes 36487e6228c4 ("x86/fpu: Prepare guest FPU for dynamically enabled FPU features")
Cc Andy Lutomirski <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Juergen Gross <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Cc Sean Christopherson <[email protected]>
Cc David Woodhouse <[email protected]>
---
 arch/x86/kernel/fpu/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/fpu/core.c +2 -2
index 36df548acc403..dcac3c058fb76 100644
@@ -232,8 +232,8 @@ bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu)
 	fpstate->is_guest	= true;
 
 	gfpu->fpstate		= fpstate;
-	gfpu->xfeatures		= fpu_user_cfg.default_features;
-	gfpu->perm		= fpu_user_cfg.default_features;
+	gfpu->xfeatures		= fpu_kernel_cfg.default_features;
+	gfpu->perm		= fpu_kernel_cfg.default_features;
 
 	/*
 	 * KVM sets the FP+SSE bits in the XSAVE header when copying FPU state
Signature · 1 line
2.39.5
author maintainer
#55 lore raw

PATCH 55/731 x86/entry: Add __init to ia32_emulation_override_cmdline()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Vitaly Kuznetsov <[email protected]>

[ Upstream commit d55f31e29047f2f987286d55928ae75775111fe7 ]

ia32_emulation_override_cmdline() is an early_param() arg and these are only needed at boot time. In fact, all other early_param() functions in arch/x86 seem to have '__init' annotation and ia32_emulation_override_cmdline() is the only exception.

---
 arch/x86/entry/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +1 -1
index 14db5b85114c1..3514bf2978eed 100644
@@ -142,7 +142,7 @@ static __always_inline int syscall_32_enter(struct pt_regs *regs)
 #ifdef CONFIG_IA32_EMULATION
 bool __ia32_enabled __ro_after_init = !IS_ENABLED(CONFIG_IA32_EMULATION_DEFAULT_DISABLED);
 
-static int ia32_emulation_override_cmdline(char *arg)
+static int __init ia32_emulation_override_cmdline(char *arg)
 {
 	return kstrtobool(arg, &__ia32_enabled);
 }
Signature · 1 line
2.39.5
author maintainer
#56 lore raw

PATCH 56/731 RISC-V: KVM: Teardown riscv specific bits after kvm_exit

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Atish Patra <[email protected]>

[ Upstream commit 2d117e67f318303f6ab699a5511d1fac3f170545 ]

During a module removal, kvm_exit invokes arch specific disable call which disables AIA. However, we invoke aia_exit before kvm_exit resulting in the following warning. KVM kernel module can't be inserted afterwards due to inconsistent state of IRQ.

[25469.031389] percpu IRQ 31 still enabled on CPU0!
[25469.031732] WARNING: CPU: 3 PID: 943 at kernel/irq/manage.c:2476 __free_percpu_irq+0xa2/0x150
[25469.031804] Modules linked in: kvm(-)
[25469.031848] CPU: 3 UID: 0 PID: 943 Comm: rmmod Not tainted 6.14.0-rc5-06947-g91c763118f47-dirty #2
[25469.031905] Hardware name: riscv-virtio,qemu (DT)
[25469.031928] epc : __free_percpu_irq+0xa2/0x150
[25469.031976]  ra : __free_percpu_irq+0xa2/0x150
[25469.032197] epc : ffffffff8007db1e ra : ffffffff8007db1e sp : ff2000000088bd50
[25469.032241]  gp : ffffffff8131cef8 tp : ff60000080b96400 t0 : ff2000000088baf8
[25469.032285]  t1 : fffffffffffffffc t2 : 5249207570637265 s0 : ff2000000088bd90
[25469.032329]  s1 : ff60000098b21080 a0 : 037d527a15eb4f00 a1 : 037d527a15eb4f00
[25469.032372]  a2 : 0000000000000023 a3 : 0000000000000001 a4 : ffffffff8122dbf8
[25469.032410]  a5 : 0000000000000fff a6 : 0000000000000000 a7 : ffffffff8122dc10
[25469.032448]  s2 : ff60000080c22eb0 s3 : 0000000200000022 s4 : 000000000000001f
[25469.032488]  s5 : ff60000080c22e00 s6 : ffffffff80c351c0 s7 : 0000000000000000
[25469.032582]  s8 : 0000000000000003 s9 : 000055556b7fb490 s10: 00007ffff0e12fa0
[25469.032621]  s11: 00007ffff0e13e9a t3 : ffffffff81354ac7 t4 : ffffffff81354ac7
[25469.032664]  t5 : ffffffff81354ac8 t6 : ffffffff81354ac7
[25469.032698] status: 0000000200000100 badaddr: ffffffff8007db1e cause: 0000000000000003
[25469.032738] [<ffffffff8007db1e>] __free_percpu_irq+0xa2/0x150
[25469.032797] [<ffffffff8007dbfc>] free_percpu_irq+0x30/0x5e
[25469.032856] [<ffffffff013a57dc>] kvm_riscv_aia_exit+0x40/0x42 [kvm]
[25469.033947] [<ffffffff013b4e82>] cleanup_module+0x10/0x32 [kvm]
[25469.035300] [<ffffffff8009b150>] __riscv_sys_delete_module+0x18e/0x1fc
[25469.035374] [<ffffffff8000c1ca>] syscall_handler+0x3a/0x46
[25469.035456] [<ffffffff809ec9a4>] do_trap_ecall_u+0x72/0x134
[25469.035536] [<ffffffff809f5e18>] handle_exception+0x148/0x156

Invoke aia_exit and other arch specific cleanup functions after kvm_exit so that disable gets a chance to be called first before exit.

Fixes 54e43320c2ba ("RISC-V: KVM: Initial skeletal support for AIA")
Fixes eded6754f398 ("riscv: KVM: add basic support for host vs guest profiling")
---
 arch/riscv/kvm/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/kvm/main.c +2 -2
index 1fa8be5ee5097..4b24705dc63a9 100644
@@ -172,8 +172,8 @@ module_init(riscv_kvm_init);
 
 static void __exit riscv_kvm_exit(void)
 {
-	kvm_riscv_teardown();
-
 	kvm_exit();
+
+	kvm_riscv_teardown();
 }
 module_exit(riscv_kvm_exit);
Signature · 1 line
2.39.5
author maintainer
#57 lore raw

PATCH 57/731 regulator: pca9450: Fix enable register for LDO5

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Frieder Schrempf <[email protected]>

[ Upstream commit f5aab0438ef17f01c5ecd25e61ae6a03f82a4586 ]

The LDO5 regulator has two configuration registers, but only LDO5CTRL_L contains the bits for enabling/disabling the regulator.

Fixes 0935ff5f1f0a ("regulator: pca9450: add pca9450 pmic driver")
---
 drivers/regulator/pca9450-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/pca9450-regulator.c +3 -3
index faa6b79c27d75..dfe1dd93d56f5 100644
@@ -460,7 +460,7 @@ static const struct pca9450_regulator_desc pca9450a_regulators[] = {
 			.n_linear_ranges = ARRAY_SIZE(pca9450_ldo5_volts),
 			.vsel_reg = PCA9450_REG_LDO5CTRL_H,
 			.vsel_mask = LDO5HOUT_MASK,
-			.enable_reg = PCA9450_REG_LDO5CTRL_H,
+			.enable_reg = PCA9450_REG_LDO5CTRL_L,
 			.enable_mask = LDO5H_EN_MASK,
 			.owner = THIS_MODULE,
 		},
@@ -674,7 +674,7 @@ static const struct pca9450_regulator_desc pca9450bc_regulators[] = {
 			.n_linear_ranges = ARRAY_SIZE(pca9450_ldo5_volts),
 			.vsel_reg = PCA9450_REG_LDO5CTRL_H,
 			.vsel_mask = LDO5HOUT_MASK,
-			.enable_reg = PCA9450_REG_LDO5CTRL_H,
+			.enable_reg = PCA9450_REG_LDO5CTRL_L,
 			.enable_mask = LDO5H_EN_MASK,
 			.owner = THIS_MODULE,
 		},
@@ -864,7 +864,7 @@ static const struct pca9450_regulator_desc pca9451a_regulators[] = {
 			.n_linear_ranges = ARRAY_SIZE(pca9450_ldo5_volts),
 			.vsel_reg = PCA9450_REG_LDO5CTRL_H,
 			.vsel_mask = LDO5HOUT_MASK,
-			.enable_reg = PCA9450_REG_LDO5CTRL_H,
+			.enable_reg = PCA9450_REG_LDO5CTRL_L,
 			.enable_mask = LDO5H_EN_MASK,
 			.owner = THIS_MODULE,
 		},
Signature · 1 line
2.39.5
author maintainer
#58 lore raw

PATCH 58/731 auxdisplay: MAX6959 should select BITREVERSE

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit fce85f3da08b76c1b052f53a9f6f9c40a8a10660 ]

If CONFIG_BITREVERSE is not enabled:

    max6959.c:(.text+0x92): undefined reference to `byte_rev_table'
Fixes a9bcd02fa42217c7 ("auxdisplay: Add driver for MAX695x 7-segment LED controllers")
---
 drivers/auxdisplay/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/auxdisplay/Kconfig +1 -0
index 8934e6ad5772b..bedc6133f970a 100644
@@ -503,6 +503,7 @@ config HT16K33
 config MAX6959
 	tristate "Maxim MAX6958/6959 7-segment LED controller"
 	depends on I2C
+	select BITREVERSE
 	select REGMAP_I2C
 	select LINEDISP
 	help
Signature · 1 line
2.39.5
author maintainer
#59 lore raw

PATCH 59/731 media: verisilicon: HEVC: Initialize start_bit field

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Benjamin Gaignard <[email protected]>

[ Upstream commit 7fcb42b3835e90ef18d68555934cf72adaf58402 ]

The HEVC driver needs to set the start_bit field explicitly to avoid causing corrupted frames when the VP9 decoder is used in parallel. The reason for this problem is that the VP9 and the HEVC decoder share this register.

---
 drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c +1 -0
index 85a44143b3786..0e212198dd65b 100644
@@ -518,6 +518,7 @@ static void set_buffers(struct hantro_ctx *ctx)
 	hantro_reg_write(vpu, &g2_stream_len, src_len);
 	hantro_reg_write(vpu, &g2_strm_buffer_len, src_buf_len);
 	hantro_reg_write(vpu, &g2_strm_start_offset, 0);
+	hantro_reg_write(vpu, &g2_start_bit, 0);
 	hantro_reg_write(vpu, &g2_write_mvs_e, 1);
 
 	hantro_write_addr(vpu, G2_TILE_SIZES_ADDR, ctx->hevc_dec.tile_sizes.dma);
Signature · 1 line
2.39.5
#60 lore raw

Re: [PATCH 6.14 059/731] media: verisilicon: HEVC: Initialize start_bit field

Hi,

Le mardi 08 avril 2025 à 12:39 +0200, Greg Kroah-Hartman a écrit :

Quoted 2 lines

6.14-stable review patch.  If anyone has any objections, please let me know.

For the entire set of backport, thanks.

Nicolas

Quoted 39 lines

------------------

From: Benjamin Gaignard <[email protected]>

[ Upstream commit 7fcb42b3835e90ef18d68555934cf72adaf58402 ]

The HEVC driver needs to set the start_bit field explicitly to avoid causing corrupted frames when the VP9 decoder is used in parallel. The
reason for this problem is that the VP9 and the HEVC decoder share this
register.

---
 drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c | 1 +

 1 file changed, 1 insertion(+)
drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c +1 -0
index 85a44143b3786..0e212198dd65b 100644
@@ -518,6 +518,7 @@ static void set_buffers(struct hantro_ctx *ctx)
  	hantro_reg_write(vpu, &g2_stream_len, src_len);
  	hantro_reg_write(vpu, &g2_strm_buffer_len, src_buf_len);
  	hantro_reg_write(vpu, &g2_strm_start_offset, 0);
+	hantro_reg_write(vpu, &g2_start_bit, 0);
  	hantro_reg_write(vpu, &g2_write_mvs_e, 1);


  hantro_write_addr(vpu, G2_TILE_SIZES_ADDR, ctx-

Quoted 1 line

hevc_dec.tile_sizes.dma);

author maintainer
#61 lore raw

PATCH 60/731 media: platform: allgro-dvt: unregister v4l2_device on the error path

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Joe Hattori <[email protected]>

[ Upstream commit c2b96a6818159fba8a3bcc38262da9e77f9b3ec7 ]

In allegro_probe(), the v4l2 device is not unregistered in the error path, which results in a memory leak. Fix it by calling v4l2_device_unregister() before returning error.

Fixes d74d4e2359ec ("media: allegro: move driver out of staging")
---
 drivers/media/platform/allegro-dvt/allegro-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/allegro-dvt/allegro-core.c +1 -0
index e491399afcc98..eb03df0d86527 100644
@@ -3912,6 +3912,7 @@ static int allegro_probe(struct platform_device *pdev)
 	if (ret < 0) {
 		v4l2_err(&dev->v4l2_dev,
 			 "failed to request firmware: %d\n", ret);
+		v4l2_device_unregister(&dev->v4l2_dev);
 		return ret;
 	}
 
Signature · 1 line
2.39.5
author maintainer
#62 lore raw

PATCH 61/731 auxdisplay: panel: Fix an API misuse in panel.c

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Andy Shevchenko <[email protected]>

[ Upstream commit 72e1c440c848624ad4cfac93d69d8a999a20355b ]

Variable allocated by charlcd_alloc() should be released by charlcd_free(). The following patch changed kfree() to charlcd_free() to fix an API misuse.

Fixes 718e05ed92ec ("auxdisplay: Introduce hd44780_common.[ch]")
---
 drivers/auxdisplay/panel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/auxdisplay/panel.c +2 -2
index a731f28455b45..6dc8798d01f98 100644
@@ -1664,7 +1664,7 @@ static void panel_attach(struct parport *port)
 	if (lcd.enabled)
 		charlcd_unregister(lcd.charlcd);
 err_unreg_device:
-	kfree(lcd.charlcd);
+	charlcd_free(lcd.charlcd);
 	lcd.charlcd = NULL;
 	parport_unregister_device(pprt);
 	pprt = NULL;
@@ -1692,7 +1692,7 @@ static void panel_detach(struct parport *port)
 		charlcd_unregister(lcd.charlcd);
 		lcd.initialized = false;
 		kfree(lcd.charlcd->drvdata);
-		kfree(lcd.charlcd);
+		charlcd_free(lcd.charlcd);
 		lcd.charlcd = NULL;
 	}
 
Signature · 1 line
2.39.5
author maintainer
#63 lore raw

PATCH 62/731 platform/x86: lenovo-yoga-tab2-pro-1380-fastcharger: Make symbol static

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ilpo Järvinen <[email protected]>

[ Upstream commit 886ca11a0c70efe5627a18557062e8a44370d78f ]

Sparse reports:

lenovo-yoga-tab2-pro-1380-fastcharger.c:222:29: warning: symbol 'yt2_1380_fc_serdev_driver' was not declared. Should it be static?

Fix that by making the symbol static.

Fixes b2ed33e8d486a ("platform/x86: Add lenovo-yoga-tab2-pro-1380-fastcharger driver")
---
 drivers/platform/x86/lenovo-yoga-tab2-pro-1380-fastcharger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/lenovo-yoga-tab2-pro-1380-fastcharger.c +1 -1
index a96b215cd2c5e..25933cd018d17 100644
@@ -219,7 +219,7 @@ static int yt2_1380_fc_serdev_probe(struct serdev_device *serdev)
 	return 0;
 }
 
-struct serdev_device_driver yt2_1380_fc_serdev_driver = {
+static struct serdev_device_driver yt2_1380_fc_serdev_driver = {
 	.probe = yt2_1380_fc_serdev_probe,
 	.driver = {
 		.name = KBUILD_MODNAME,
Signature · 1 line
2.39.5
author maintainer
#64 lore raw

PATCH 63/731 platform/x86: dell-uart-backlight: Make dell_uart_bl_serdev_driver static

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ilpo Järvinen <[email protected]>

[ Upstream commit 4878e0b14c3e31a87ab147bd2dae443394cb5a2c ]

Sparse reports:

dell-uart-backlight.c:328:29: warning: symbol 'dell_uart_bl_serdev_driver' was not declared. Should it be static?

Fix it by making the symbol static.

---
 drivers/platform/x86/dell/dell-uart-backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/dell/dell-uart-backlight.c +1 -1
index 50002ef13d5d4..8f868f845350a 100644
@@ -325,7 +325,7 @@ static int dell_uart_bl_serdev_probe(struct serdev_device *serdev)
 	return PTR_ERR_OR_ZERO(dell_bl->bl);
 }
 
-struct serdev_device_driver dell_uart_bl_serdev_driver = {
+static struct serdev_device_driver dell_uart_bl_serdev_driver = {
 	.probe = dell_uart_bl_serdev_probe,
 	.driver = {
 		.name = KBUILD_MODNAME,
Signature · 1 line
2.39.5
author maintainer
#65 lore raw

PATCH 64/731 platform/x86: dell-ddv: Fix temperature calculation

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Armin Wolf <[email protected]>

[ Upstream commit 7a248294a3145bc65eb0d8980a0a8edbb1b92db4 ]

On the Dell Inspiron 3505 the battery temperature is always 0.1 degrees larger than the temperature show inside the OEM application.

Emulate this behaviour to avoid showing strange looking values like 29.1 degrees.

---
 drivers/platform/x86/dell/dell-wmi-ddv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/dell/dell-wmi-ddv.c +4 -2
index e75cd6e1efe6a..ab5f7d3ab8249 100644
@@ -665,8 +665,10 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr, char
 	if (ret < 0)
 		return ret;
 
-	/* Use 2731 instead of 2731.5 to avoid unnecessary rounding */
-	return sysfs_emit(buf, "%d\n", value - 2731);
+	/* Use 2732 instead of 2731.5 to avoid unnecessary rounding and to emulate
+	 * the behaviour of the OEM application which seems to round down the result.
+	 */
+	return sysfs_emit(buf, "%d\n", value - 2732);
 }
 
 static ssize_t eppid_show(struct device *dev, struct device_attribute *attr, char *buf)
Signature · 1 line
2.39.5
author maintainer
#66 lore raw

PATCH 65/731 ASoC: cs35l41: check the return value from spi_setup()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Vitaliy Shevtsov <[email protected]>

[ Upstream commit ad5a0970f86d82e39ebd06d45a1f7aa48a1316f8 ]

Currently the return value from spi_setup() is not checked for a failure. It is unlikely it will ever fail in this particular case but it is still better to add this check for the sake of completeness and correctness. This is cheap since it is performed once when the device is being probed.

Handle spi_setup() return value.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Fixes 872fc0b6bde8 ("ASoC: cs35l41: Set the max SPI speed for the whole device")
---
 sound/soc/codecs/cs35l41-spi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/cs35l41-spi.c +4 -1
index a6db44520c060..f9b6bf7bea9c9 100644
@@ -32,13 +32,16 @@ static int cs35l41_spi_probe(struct spi_device *spi)
 	const struct regmap_config *regmap_config = &cs35l41_regmap_spi;
 	struct cs35l41_hw_cfg *hw_cfg = dev_get_platdata(&spi->dev);
 	struct cs35l41_private *cs35l41;
+	int ret;
 
 	cs35l41 = devm_kzalloc(&spi->dev, sizeof(struct cs35l41_private), GFP_KERNEL);
 	if (!cs35l41)
 		return -ENOMEM;
 
 	spi->max_speed_hz = CS35L41_SPI_MAX_FREQ;
-	spi_setup(spi);
+	ret = spi_setup(spi);
+	if (ret < 0)
+		return ret;
 
 	spi_set_drvdata(spi, cs35l41);
 	cs35l41->regmap = devm_regmap_init_spi(spi, regmap_config);
Signature · 1 line
2.39.5
author maintainer
#67 lore raw

PATCH 66/731 ASoC: amd: acp: Fix for enabling DMIC on acp platforms via _DSD entry

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Venkata Prasad Potturu <[email protected]>

[ Upstream commit 02e1cf7a352a3ba5f768849f2b4fcaaaa19f89e3 ]

Add condition check to register ACP PDM sound card by reading _WOV acpi entry.

Fixes 09068d624c49 ("ASoC: amd: acp: fix for acp platform device creation failure")
---
 sound/soc/amd/acp/acp-legacy-common.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
sound/soc/amd/acp/acp-legacy-common.c +9 -1
index 7acc7ed2e8cc9..b9f085c560c2d 100644
@@ -13,6 +13,7 @@
  */
 
 #include "amd.h"
+#include <linux/acpi.h>
 #include <linux/pci.h>
 #include <linux/export.h>
 
@@ -445,7 +446,9 @@ void check_acp_config(struct pci_dev *pci, struct acp_chip_info *chip)
 {
 	struct acpi_device *pdm_dev;
 	const union acpi_object *obj;
-	u32 pdm_addr;
+	acpi_handle handle;
+	acpi_integer dmic_status;
+	u32 pdm_addr, ret;
 
 	switch (chip->acp_rev) {
 	case ACP_RN_PCI_ID:
@@ -477,6 +480,11 @@ void check_acp_config(struct pci_dev *pci, struct acp_chip_info *chip)
 						   obj->integer.value == pdm_addr)
 				chip->is_pdm_dev = true;
 		}
+
+		handle = ACPI_HANDLE(&pci->dev);
+		ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
+		if (!ACPI_FAILURE(ret))
+			chip->is_pdm_dev = dmic_status;
 	}
 }
 EXPORT_SYMBOL_NS_GPL(check_acp_config, "SND_SOC_ACP_COMMON");
Signature · 1 line
2.39.5
author maintainer
#68 lore raw

PATCH 67/731 HID: remove superfluous (and wrong) Makefile entry for CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiri Kosina <[email protected]>

[ Upstream commit fe0fb58325e519008e2606a5aa2cff7ad23e212d ]

The line

	obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER)   += intel-ish-hid/

in top-level HID Makefile is both superfluous (as CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER depends on CONFIG_INTEL_ISH_HID, which contains intel-ish-hid/ already) and wrong (as it's missing the CONFIG_ prefix).

Just remove it.

Fixes 91b228107da3e ("HID: intel-ish-hid: ISH firmware loader client driver")
---
 drivers/hid/Makefile | 1 -
 1 file changed, 1 deletion(-)
drivers/hid/Makefile +0 -1
index 482b096eea280..0abfe51704a0b 100644
@@ -166,7 +166,6 @@ obj-$(CONFIG_USB_KBD)		+= usbhid/
 obj-$(CONFIG_I2C_HID_CORE)	+= i2c-hid/
 
 obj-$(CONFIG_INTEL_ISH_HID)	+= intel-ish-hid/
-obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER)	+= intel-ish-hid/
 
 obj-$(CONFIG_AMD_SFH_HID)       += amd-sfh-hid/
 
Signature · 1 line
2.39.5
author maintainer
#69 lore raw

PATCH 68/731 ASoC: simple-card-utils: Dont use __free(device_node) at graph_util_parse_dai()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kuninori Morimoto <[email protected]>

[ Upstream commit de74ec718e0788e1998eb7289ad07970e27cae27 ]

commit 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for device node") uses __free(device_node) for dlc->of_node, but we need to keep it while driver is in use.

Don't use __free(device_node) in graph_util_parse_dai().

---
 sound/soc/generic/simple-card-utils.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/generic/simple-card-utils.c +5 -2
index c2445c5ccd84c..32efb30c55d69 100644
@@ -1077,6 +1077,7 @@ static int graph_get_dai_id(struct device_node *ep)
 int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 			 struct snd_soc_dai_link_component *dlc, int *is_single_link)
 {
+	struct device_node *node;
 	struct of_phandle_args args = {};
 	struct snd_soc_dai *dai;
 	int ret;
@@ -1084,7 +1085,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 	if (!ep)
 		return 0;
 
-	struct device_node *node __free(device_node) = of_graph_get_port_parent(ep);
+	node = of_graph_get_port_parent(ep);
 
 	/*
 	 * Try to find from DAI node
@@ -1126,8 +1127,10 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 	 *    if he unbinded CPU or Codec.
 	 */
 	ret = snd_soc_get_dlc(&args, dlc);
-	if (ret < 0)
+	if (ret < 0) {
+		of_node_put(node);
 		return ret;
+	}
 
 parse_dai_end:
 	if (is_single_link)
Signature · 1 line
2.39.5
author maintainer
#70 lore raw

PATCH 69/731 dt-bindings: vendor-prefixes: add GOcontroll

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Maud Spierings <[email protected]>

[ Upstream commit 5f0d2de417166698c8eba433b696037ce04730da ]

GOcontroll produces embedded linux systems and IO modules to use in these systems, add its prefix.

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 5079ca6ce1d1e..b5979832ddce6 100644
@@ -593,6 +593,8 @@ patternProperties:
     description: GlobalTop Technology, Inc.
   "^gmt,.*":
     description: Global Mixed-mode Technology, Inc.
+  "^gocontroll,.*":
+    description: GOcontroll Modular Embedded Electronics B.V.
   "^goldelico,.*":
     description: Golden Delicious Computers GmbH & Co. KG
   "^goodix,.*":
Signature · 1 line
2.39.5
author maintainer
#71 lore raw

PATCH 70/731 ALSA: hda/realtek: Always honor no_shutup_pins

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <[email protected]>

[ Upstream commit 5a0c72c1da3cbc0cd4940a95d1be2830104c6edf ]

The workaround for Dell machines to skip the pin-shutup for mic pins introduced alc_headset_mic_no_shutup() that is replaced from the generic snd_hda_shutup_pins() for certain codecs. The problem is that the call is done unconditionally even if spec->no_shutup_pins is set. This seems causing problems on other platforms like Lenovo.

This patch corrects the behavior and the driver honors always spec->no_shutup_pins flag and skips alc_headset_mic_no_shutup() if it's set.

Fixes dad3197da7a3 ("ALSA: hda/realtek - Fixup headphone noise via runtime suspend")
Reported-and-tested-by Oleg Gorobets <[email protected]>
---
 sound/pci/hda/patch_realtek.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/pci/hda/patch_realtek.c +4 -2
index 78aab243c8b65..abe269fb8ce00 100644
@@ -586,6 +586,9 @@ static void alc_shutup_pins(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
 
+	if (spec->no_shutup_pins)
+		return;
+
 	switch (codec->core.vendor_id) {
 	case 0x10ec0236:
 	case 0x10ec0256:
@@ -601,8 +604,7 @@ static void alc_shutup_pins(struct hda_codec *codec)
 		alc_headset_mic_no_shutup(codec);
 		break;
 	default:
-		if (!spec->no_shutup_pins)
-			snd_hda_shutup_pins(codec);
+		snd_hda_shutup_pins(codec);
 		break;
 	}
 }
Signature · 1 line
2.39.5
author maintainer
#72 lore raw

PATCH 71/731 ASoC: tegra: Use non-atomic timeout for ADX status register

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ritu Chaudhary <[email protected]>

[ Upstream commit f1d742c35b659fb0122da0a8ff09ad9309cb29d8 ]

ADX startup() callback uses atomic poll timeout on ADX status register.

This is unnecessary because:

- The startup() callback itself is non-atomic.
- The subsequent timeout call in the same function already uses a non-atomic version.

Using atomic version can hog CPU when it is not really needed, so replace it with non-atomic version.

Fixes a99ab6f395a9e ("ASoC: tegra: Add Tegra210 based ADX driver")
---
 sound/soc/tegra/tegra210_adx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/tegra/tegra210_adx.c +3 -3
index 0aa93b948378f..3c10e09976ad0 100644
@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
-// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES.
+// SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES.
 // All rights reserved.
 //
 // tegra210_adx.c - Tegra210 ADX driver
@@ -57,8 +57,8 @@ static int tegra210_adx_startup(struct snd_pcm_substream *substream,
 	int err;
 
 	/* Ensure if ADX status is disabled */
-	err = regmap_read_poll_timeout_atomic(adx->regmap, TEGRA210_ADX_STATUS,
-					      val, !(val & 0x1), 10, 10000);
+	err = regmap_read_poll_timeout(adx->regmap, TEGRA210_ADX_STATUS,
+				       val, !(val & 0x1), 10, 10000);
 	if (err < 0) {
 		dev_err(dai->dev, "failed to stop ADX, err = %d\n", err);
 		return err;
Signature · 1 line
2.39.5
author maintainer
#73 lore raw

PATCH 72/731 ASoC: ti: j721e-evm: Fix clock configuration for ti,j7200-cpb-audio compatible

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jayesh Choudhary <[email protected]>

[ Upstream commit 45ff65e30deb919604e68faed156ad96ce7474d9 ]

For 'ti,j7200-cpb-audio' compatible, there is support for only one PLL for 48k. For 11025, 22050, 44100 and 88200 sampling rates, due to absence of J721E_CLK_PARENT_44100, we get EINVAL while running any audio application. Add support for these rates by using the 48k parent clock and adjusting the clock for these rates later in j721e_configure_refclk.

Fixes 6748d0559059 ("ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)")
---
 sound/soc/ti/j721e-evm.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/ti/j721e-evm.c +2 -0
index d9d1e021f5b2e..0f96cc45578d8 100644
@@ -182,6 +182,8 @@ static int j721e_configure_refclk(struct j721e_priv *priv,
 		clk_id = J721E_CLK_PARENT_48000;
 	else if (!(rate % 11025) && priv->pll_rates[J721E_CLK_PARENT_44100])
 		clk_id = J721E_CLK_PARENT_44100;
+	else if (!(rate % 11025) && priv->pll_rates[J721E_CLK_PARENT_48000])
+		clk_id = J721E_CLK_PARENT_48000;
 	else
 		return ret;
 
Signature · 1 line
2.39.5
author maintainer
#74 lore raw

PATCH 73/731 ALSA: usb-audio: separate DJM-A9 cap lvl options

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Olivia Mackintosh <[email protected]>

[ Upstream commit 38e94cefbf45c1edc5b751ab90a3088f7c6fac1a ]

Mixer quicks for the Pioneer DJM-A9 mixer was added in 5289d00 with additional capture level values added to the common DJM array of values.

This breaks the existing DJM mixers however as alsa-utils relies on enumeration of the actual mixer options based on the value array which results in error when storing state.

This commit just separates the A9 values into a separate array and references them in the corresponding mixer control.

Fixes 5289d0069639 ("ALSA: usb-audio: Add Pioneer DJ/AlphaTheta DJM-A9 Mixer")
---
 sound/usb/mixer_quirks.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
sound/usb/mixer_quirks.c +4 -3
index 3d36d22f8e9e6..62b28e9d83c7a 100644
@@ -3688,8 +3688,7 @@ static const char *snd_djm_get_label(u8 device_idx, u16 wvalue, u16 windex)
 
 // common DJM capture level option values
 static const u16 snd_djm_opts_cap_level[] = {
-	0x0000, 0x0100, 0x0200, 0x0300, 0x400, 0x500 };
-
+	0x0000, 0x0100, 0x0200, 0x0300 };
 
 // DJM-250MK2
 static const u16 snd_djm_opts_250mk2_cap1[] = {
@@ -3831,6 +3830,8 @@ static const struct snd_djm_ctl snd_djm_ctls_750mk2[] = {
 
 
 // DJM-A9
+static const u16 snd_djm_opts_a9_cap_level[] = {
+	0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500 };
 static const u16 snd_djm_opts_a9_cap1[] = {
 	0x0107, 0x0108, 0x0109, 0x010a, 0x010e,
 	0x111, 0x112, 0x113, 0x114, 0x0131, 0x132, 0x133, 0x134 };
@@ -3844,7 +3845,7 @@ static const u16 snd_djm_opts_a9_cap5[] = {
 	0x0501, 0x0502, 0x0503, 0x0505, 0x0506, 0x0507, 0x0508, 0x0509, 0x050a, 0x050e };
 
 static const struct snd_djm_ctl snd_djm_ctls_a9[] = {
-	SND_DJM_CTL("Capture Level", cap_level, 0, SND_DJM_WINDEX_CAPLVL),
+	SND_DJM_CTL("Capture Level", a9_cap_level, 0, SND_DJM_WINDEX_CAPLVL),
 	SND_DJM_CTL("Master Input",  a9_cap1, 3, SND_DJM_WINDEX_CAP),
 	SND_DJM_CTL("Ch1 Input",     a9_cap2, 2, SND_DJM_WINDEX_CAP),
 	SND_DJM_CTL("Ch2 Input",     a9_cap3, 2, SND_DJM_WINDEX_CAP),
Signature · 1 line
2.39.5
author maintainer
#75 lore raw

PATCH 74/731 ALSA: timer: Dont take register_mutex with copy_from/to_user()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <[email protected]>

[ Upstream commit 3424c8f53bc63c87712a7fc22dc13d0cc85fb0d6 ]

The infamous mmap_lock taken in copy_from/to_user() can be often problematic when it's called inside another mutex, as they might lead to deadlocks.

In the case of ALSA timer code, the bad pattern is with guard(mutex)(&register_mutex) that covers copy_from/to_user() -- which was mistakenly introduced at converting to guard(), and it had been carefully worked around in the past.

This patch fixes those pieces simply by moving copy_from/to_user() out of the register mutex lock again.

---
 sound/core/timer.c | 147 ++++++++++++++++++++++++---------------------
 1 file changed, 77 insertions(+), 70 deletions(-)
sound/core/timer.c +77 -70
index fbada79380f9e..d774b9b71ce23 100644
@@ -1515,91 +1515,97 @@ static void snd_timer_user_copy_id(struct snd_timer_id *id, struct snd_timer *ti
 	id->subdevice = timer->tmr_subdevice;
 }
 
-static int snd_timer_user_next_device(struct snd_timer_id __user *_tid)
+static void get_next_device(struct snd_timer_id *id)
 {
-	struct snd_timer_id id;
 	struct snd_timer *timer;
 	struct list_head *p;
 
-	if (copy_from_user(&id, _tid, sizeof(id)))
-		return -EFAULT;
-	guard(mutex)(&register_mutex);
-	if (id.dev_class < 0) {		/* first item */
+	if (id->dev_class < 0) {		/* first item */
 		if (list_empty(&snd_timer_list))
-			snd_timer_user_zero_id(&id);
+			snd_timer_user_zero_id(id);
 		else {
 			timer = list_entry(snd_timer_list.next,
 					   struct snd_timer, device_list);
-			snd_timer_user_copy_id(&id, timer);
+			snd_timer_user_copy_id(id, timer);
 		}
 	} else {
-		switch (id.dev_class) {
+		switch (id->dev_class) {
 		case SNDRV_TIMER_CLASS_GLOBAL:
-			id.device = id.device < 0 ? 0 : id.device + 1;
+			id->device = id->device < 0 ? 0 : id->device + 1;
 			list_for_each(p, &snd_timer_list) {
 				timer = list_entry(p, struct snd_timer, device_list);
 				if (timer->tmr_class > SNDRV_TIMER_CLASS_GLOBAL) {
-					snd_timer_user_copy_id(&id, timer);
+					snd_timer_user_copy_id(id, timer);
 					break;
 				}
-				if (timer->tmr_device >= id.device) {
-					snd_timer_user_copy_id(&id, timer);
+				if (timer->tmr_device >= id->device) {
+					snd_timer_user_copy_id(id, timer);
 					break;
 				}
 			}
 			if (p == &snd_timer_list)
-				snd_timer_user_zero_id(&id);
+				snd_timer_user_zero_id(id);
 			break;
 		case SNDRV_TIMER_CLASS_CARD:
 		case SNDRV_TIMER_CLASS_PCM:
-			if (id.card < 0) {
-				id.card = 0;
+			if (id->card < 0) {
+				id->card = 0;
 			} else {
-				if (id.device < 0) {
-					id.device = 0;
+				if (id->device < 0) {
+					id->device = 0;
 				} else {
-					if (id.subdevice < 0)
-						id.subdevice = 0;
-					else if (id.subdevice < INT_MAX)
-						id.subdevice++;
+					if (id->subdevice < 0)
+						id->subdevice = 0;
+					else if (id->subdevice < INT_MAX)
+						id->subdevice++;
 				}
 			}
 			list_for_each(p, &snd_timer_list) {
 				timer = list_entry(p, struct snd_timer, device_list);
-				if (timer->tmr_class > id.dev_class) {
-					snd_timer_user_copy_id(&id, timer);
+				if (timer->tmr_class > id->dev_class) {
+					snd_timer_user_copy_id(id, timer);
 					break;
 				}
-				if (timer->tmr_class < id.dev_class)
+				if (timer->tmr_class < id->dev_class)
 					continue;
-				if (timer->card->number > id.card) {
-					snd_timer_user_copy_id(&id, timer);
+				if (timer->card->number > id->card) {
+					snd_timer_user_copy_id(id, timer);
 					break;
 				}
-				if (timer->card->number < id.card)
+				if (timer->card->number < id->card)
 					continue;
-				if (timer->tmr_device > id.device) {
-					snd_timer_user_copy_id(&id, timer);
+				if (timer->tmr_device > id->device) {
+					snd_timer_user_copy_id(id, timer);
 					break;
 				}
-				if (timer->tmr_device < id.device)
+				if (timer->tmr_device < id->device)
 					continue;
-				if (timer->tmr_subdevice > id.subdevice) {
-					snd_timer_user_copy_id(&id, timer);
+				if (timer->tmr_subdevice > id->subdevice) {
+					snd_timer_user_copy_id(id, timer);
 					break;
 				}
-				if (timer->tmr_subdevice < id.subdevice)
+				if (timer->tmr_subdevice < id->subdevice)
 					continue;
-				snd_timer_user_copy_id(&id, timer);
+				snd_timer_user_copy_id(id, timer);
 				break;
 			}
 			if (p == &snd_timer_list)
-				snd_timer_user_zero_id(&id);
+				snd_timer_user_zero_id(id);
 			break;
 		default:
-			snd_timer_user_zero_id(&id);
+			snd_timer_user_zero_id(id);
 		}
 	}
+}
+
+static int snd_timer_user_next_device(struct snd_timer_id __user *_tid)
+{
+	struct snd_timer_id id;
+
+	if (copy_from_user(&id, _tid, sizeof(id)))
+		return -EFAULT;
+	scoped_guard(mutex, &register_mutex)
+		get_next_device(&id);
 	if (copy_to_user(_tid, &id, sizeof(*_tid)))
 		return -EFAULT;
 	return 0;
@@ -1620,23 +1626,24 @@ static int snd_timer_user_ginfo(struct file *file,
 	tid = ginfo->tid;
 	memset(ginfo, 0, sizeof(*ginfo));
 	ginfo->tid = tid;
-	guard(mutex)(&register_mutex);
-	t = snd_timer_find(&tid);
-	if (!t)
-		return -ENODEV;
-	ginfo->card = t->card ? t->card->number : -1;
-	if (t->hw.flags & SNDRV_TIMER_HW_SLAVE)
-		ginfo->flags |= SNDRV_TIMER_FLG_SLAVE;
-	strscpy(ginfo->id, t->id, sizeof(ginfo->id));
-	strscpy(ginfo->name, t->name, sizeof(ginfo->name));
-	scoped_guard(spinlock_irq, &t->lock)
-		ginfo->resolution = snd_timer_hw_resolution(t);
-	if (t->hw.resolution_min > 0) {
-		ginfo->resolution_min = t->hw.resolution_min;
-		ginfo->resolution_max = t->hw.resolution_max;
-	}
-	list_for_each(p, &t->open_list_head) {
-		ginfo->clients++;
+	scoped_guard(mutex, &register_mutex) {
+		t = snd_timer_find(&tid);
+		if (!t)
+			return -ENODEV;
+		ginfo->card = t->card ? t->card->number : -1;
+		if (t->hw.flags & SNDRV_TIMER_HW_SLAVE)
+			ginfo->flags |= SNDRV_TIMER_FLG_SLAVE;
+		strscpy(ginfo->id, t->id, sizeof(ginfo->id));
+		strscpy(ginfo->name, t->name, sizeof(ginfo->name));
+		scoped_guard(spinlock_irq, &t->lock)
+			ginfo->resolution = snd_timer_hw_resolution(t);
+		if (t->hw.resolution_min > 0) {
+			ginfo->resolution_min = t->hw.resolution_min;
+			ginfo->resolution_max = t->hw.resolution_max;
+		}
+		list_for_each(p, &t->open_list_head) {
+			ginfo->clients++;
+		}
 	}
 	if (copy_to_user(_ginfo, ginfo, sizeof(*ginfo)))
 		return -EFAULT;
@@ -1674,31 +1681,31 @@ static int snd_timer_user_gstatus(struct file *file,
 	struct snd_timer_gstatus gstatus;
 	struct snd_timer_id tid;
 	struct snd_timer *t;
-	int err = 0;
 
 	if (copy_from_user(&gstatus, _gstatus, sizeof(gstatus)))
 		return -EFAULT;
 	tid = gstatus.tid;
 	memset(&gstatus, 0, sizeof(gstatus));
 	gstatus.tid = tid;
-	guard(mutex)(&register_mutex);
-	t = snd_timer_find(&tid);
-	if (t != NULL) {
-		guard(spinlock_irq)(&t->lock);
-		gstatus.resolution = snd_timer_hw_resolution(t);
-		if (t->hw.precise_resolution) {
-			t->hw.precise_resolution(t, &gstatus.resolution_num,
-						 &gstatus.resolution_den);
+	scoped_guard(mutex, &register_mutex) {
+		t = snd_timer_find(&tid);
+		if (t != NULL) {
+			guard(spinlock_irq)(&t->lock);
+			gstatus.resolution = snd_timer_hw_resolution(t);
+			if (t->hw.precise_resolution) {
+				t->hw.precise_resolution(t, &gstatus.resolution_num,
+							 &gstatus.resolution_den);
+			} else {
+				gstatus.resolution_num = gstatus.resolution;
+				gstatus.resolution_den = 1000000000uL;
+			}
 		} else {
-			gstatus.resolution_num = gstatus.resolution;
-			gstatus.resolution_den = 1000000000uL;
+			return -ENODEV;
 		}
-	} else {
-		err = -ENODEV;
 	}
-	if (err >= 0 && copy_to_user(_gstatus, &gstatus, sizeof(gstatus)))
-		err = -EFAULT;
-	return err;
+	if (copy_to_user(_gstatus, &gstatus, sizeof(gstatus)))
+		return -EFAULT;
+	return 0;
 }
 
 static int snd_timer_user_tselect(struct file *file,
Signature · 1 line
2.39.5
author maintainer
#76 lore raw

PATCH 75/731 ALSA: hda/realtek: Fix built-in mic assignment on ASUS VivoBook X515UA

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <[email protected]>

[ Upstream commit 829ee558f3527fd602c6e2e9f270959d1de09fe0 ]

ASUS VivoBook X515UA with PCI SSID 1043:106f had a default quirk pickup via pin table that applies ALC256_FIXUP_ASUS_MIC, but this adds a bogus built-in mic pin 0x13 enabled. This was no big problem because the pin 0x13 was assigned as the secondary mic, but the recent fix made the entries sorted, hence this bogus pin appeared now as the primary input and it broke.

For fixing the bug, put the right quirk entry for this device pointing to ALC256_FIXUP_ASUS_MIC_NO_PRESENCE.

Fixes 3b4309546b48 ("ALSA: hda: Fix headset detection failure due to unstable sort")
---
 sound/pci/hda/patch_realtek.c | 1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
index abe269fb8ce00..d70c72bda90a5 100644
@@ -10702,6 +10702,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
 	SND_PCI_QUIRK(0x1043, 0x1054, "ASUS G614FH/FM/FP", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
+	SND_PCI_QUIRK(0x1043, 0x106f, "ASUS VivoBook X515UA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1043, 0x1074, "ASUS G614PH/PM/PP", ALC287_FIXUP_CS35L41_I2C_2),
 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
 	SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C),
Signature · 1 line
2.39.5
author maintainer
#77 lore raw

PATCH 76/731 wifi: rtw89: Correct immediate cfg_len calculation for scan_offload_be

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Liang Jie <[email protected]>

[ Upstream commit 361cb056e2468be534f47c1a6745f96581a721e3 ]

Ensures the correct calculation of cfg_len prior to the allocation of the skb in the rtw89_fw_h2c_scan_offload_be function, particularly when the SCAN_OFFLOAD_BE_V0 firmware feature is enabled. It addresses an issue where an incorrect skb size might be allocated due to a delayed setting of cfg_len, potentially leading to memory inefficiencies.

By moving the conditional check and assignment of cfg_len before skb allocation, the patch guarantees that len, which depends on cfg_len, is accurately computed, ensuring proper skb size and preventing any unnecessary memory reservation for firmware operations not supporting beyond the w8 member of the command data structure.

This correction helps to optimize memory usage and maintain consistent behavior across different firmware versions.

Fixes 6ca6b918f280 ("wifi: rtw89: 8922a: Add new fields for scan offload H2C command")
---
 drivers/net/wireless/realtek/rtw89/fw.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtw89/fw.c +7 -3
index 5d4ad23cc3bd4..5cc9ab78c09f7 100644
@@ -5311,6 +5311,7 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev,
 	u8 macc_role_size = sizeof(*macc_role) * option->num_macc_role;
 	u8 opch_size = sizeof(*opch) * option->num_opch;
 	u8 probe_id[NUM_NL80211_BANDS];
+	u8 scan_offload_ver = U8_MAX;
 	u8 cfg_len = sizeof(*h2c);
 	unsigned int cond;
 	u8 ver = U8_MAX;
@@ -5321,6 +5322,11 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev,
 
 	rtw89_scan_get_6g_disabled_chan(rtwdev, option);
 
+	if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw)) {
+		cfg_len = offsetofend(typeof(*h2c), w8);
+		scan_offload_ver = 0;
+	}
+
 	len = cfg_len + macc_role_size + opch_size;
 	skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len);
 	if (!skb) {
@@ -5392,10 +5398,8 @@ int rtw89_fw_h2c_scan_offload_be(struct rtw89_dev *rtwdev,
 					   RTW89_H2C_SCANOFLD_BE_W8_PROBE_RATE_6GHZ);
 	}
 
-	if (RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD_BE_V0, &rtwdev->fw)) {
-		cfg_len = offsetofend(typeof(*h2c), w8);
+	if (scan_offload_ver == 0)
 		goto flex_member;
-	}
 
 	h2c->w9 = le32_encode_bits(sizeof(*h2c) / sizeof(h2c->w0),
 				   RTW89_H2C_SCANOFLD_BE_W9_SIZE_CFG) |
Signature · 1 line
2.39.5
author maintainer
#78 lore raw

PATCH 77/731 wifi: ath12k: fix skb_ext_desc leak in ath12k_dp_tx() error path

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Nicolas Escande <[email protected]>

[ Upstream commit 28a9972e0f0693cd4d08f431c992fa6be39c788c ]

When vlan support was added, we missed that when ath12k_dp_prepare_htt_metadata() returns an error we also need to free the skb holding the metadata before going on with the cleanup process.

Compile tested only.

---
 drivers/net/wireless/ath/ath12k/dp_tx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath12k/dp_tx.c +1 -0
index a8d341a6df01e..e0b85f959cd4a 100644
@@ -398,6 +398,7 @@ int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
 			if (ret < 0) {
 				ath12k_dbg(ab, ATH12K_DBG_DP_TX,
 					   "Failed to add HTT meta data, dropping packet\n");
+				kfree_skb(skb_ext_desc);
 				goto fail_unmap_dma;
 			}
 		}
Signature · 1 line
2.39.5
author maintainer
#79 lore raw

PATCH 78/731 wifi: ath12k: encode max Tx power in scan channel list command

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sathishkumar Muruganandam <[email protected]>

[ Upstream commit 07c34cad10ab0ac8b06ede8a7fbc55ecf2efa3e6 ]

Currently, when sending the scan channel list command to the firmware, the maximum Tx power is not encoded in the reg2 member. This omission causes the firmware to be unaware of the host's maximum Tx power, leading to incorrect Tx power derivation at firmware level.

To resolve this issue, encode the maximum Tx power in the scan channel list command before sending it to firmware.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

---
 drivers/net/wireless/ath/ath12k/wmi.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath12k/wmi.c +2 -0
index abb510d235a52..7a87777e0a047 100644
@@ -2794,6 +2794,8 @@ int ath12k_wmi_send_scan_chan_list_cmd(struct ath12k *ar,
 						  WMI_CHAN_REG_INFO1_REG_CLS);
 			*reg2 |= le32_encode_bits(channel_arg->antennamax,
 						  WMI_CHAN_REG_INFO2_ANT_MAX);
+			*reg2 |= le32_encode_bits(channel_arg->maxregpower,
+						  WMI_CHAN_REG_INFO2_MAX_TX_PWR);
 
 			ath12k_dbg(ar->ab, ATH12K_DBG_WMI,
 				   "WMI chan scan list chan[%d] = %u, chan_info->info %8x\n",
Signature · 1 line
2.39.5
author maintainer
#80 lore raw

PATCH 79/731 wifi: ath12k: Fix pdev lookup in WBM error processing

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Rameshkumar Sundaram <[email protected]>

[ Upstream commit 4e635b81db9d69bbb836afae8cb402978ff966a4 ]

Currently in ath12k_dp_rx_process_wbm_err(), when processing packets received on the WBM error ring, pdev validation is done based upon the hw_link_id. But hw_link_id corresponds to link id of a given partner pdev in a MLO hardware group, and is not the correct index to use to lookup a pdev in an SoC(ab). As a result, pdev validation fails, and the reaped packets are dropped instead of being processed.

The correct index to use is the pdev_id, which is already derived in the function. So update the logic to validate the pdev based upon the pdev_id instead of the hw_link_id. This matches the logic used in other Rx ring processing functions.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Fixes 1a73acb5fba4 ("wifi: ath12k: move to HW link id based receive handling")
---
 drivers/net/wireless/ath/ath12k/dp_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/dp_rx.c +1 -1
index dad35bfd83f62..68d609f2ac60e 100644
@@ -4032,7 +4032,7 @@ int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
 						      hw_links[hw_link_id].pdev_idx);
 		ar = partner_ab->pdevs[pdev_id].ar;
 
-		if (!ar || !rcu_dereference(ar->ab->pdevs_active[hw_link_id])) {
+		if (!ar || !rcu_dereference(ar->ab->pdevs_active[pdev_id])) {
 			dev_kfree_skb_any(msdu);
 			continue;
 		}
Signature · 1 line
2.39.5
author maintainer
#81 lore raw

PATCH 80/731 wifi: ath9k: do not submit zero bytes to the entropy pool

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dmitry Antipov <[email protected]>

[ Upstream commit 0f2b59a98027a781eee1cbd48c7c8fdf87cb73f6 ]

In 'ath_cmn_process_fft()', it doesn't make too much sense to add zero bytes in attempt to improve randomness. So swap calls to 'memset()' and 'add_device_randomness()' to feed the pool with actual FFT results rather than zeroes. Compile tested only.

---
 drivers/net/wireless/ath/ath9k/common-spectral.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/common-spectral.c +2 -2
index 628eeec4b82fe..300d178830adf 100644
@@ -628,12 +628,12 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
 				else
 					RX_STAT_INC(sc, rx_spectral_sample_err);
 
-				memset(sample_buf, 0, SPECTRAL_SAMPLE_MAX_LEN);
-
 				/* Mix the received bins to the /dev/random
 				 * pool
 				 */
 				add_device_randomness(sample_buf, num_bins);
+
+				memset(sample_buf, 0, SPECTRAL_SAMPLE_MAX_LEN);
 			}
 
 			/* Process a normal frame */
Signature · 1 line
2.39.5
author maintainer
#82 lore raw

PATCH 81/731 wifi: ath11k: fix wrong overriding for VHT Beamformee STS Capability

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yu Zhang(Yuriy) <[email protected]>

[ Upstream commit 9d13950acb2a51342c93c69f1a5bf285adb90d88 ]

Current code in ath11k_mac_set_txbf_conf overrides nsts, which is incorrect as it confuses nss and nsts. nss is Number of Spatial Streams,nsts is Number of Space-Time Streams.

As mentioned in Fixes: 55b5ee3357d7, the nss used when acting as a beamformee in VHT mode should be reported by the firmware and should not be greater than the number of receiving antennas - 1. The num_rx_chains related nss rather than nsts.

If STBC is enabled, nsts is greater than nss. About nss are mapped to nsts, refer to IEEE Std 802.11-2020: 19.3.11.9.2 Space-time block coding (STBC), Table 19-18—Constellation mapper output to spatial mapper input for STBC.

Remove wrong overriding for nsts of VHT Beamformee STS Capability, acting DL MU-MIMO in VHT mode is working properly.

Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04479-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1

Fixes 55b5ee3357d7 ("wifi: ath11k: fix number of VHT beamformee spatial streams")
---
 drivers/net/wireless/ath/ath11k/mac.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +0 -5
index 1556392f7ad48..1298a3190a3c5 100644
@@ -5336,8 +5336,6 @@ static int ath11k_mac_set_txbf_conf(struct ath11k_vif *arvif)
 	if (vht_cap & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE)) {
 		nsts = vht_cap & IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
 		nsts >>= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
-		if (nsts > (ar->num_rx_chains - 1))
-			nsts = ar->num_rx_chains - 1;
 		value |= SM(nsts, WMI_TXBF_STS_CAP_OFFSET);
 	}
 
@@ -5421,9 +5419,6 @@ static void ath11k_set_vht_txbf_cap(struct ath11k *ar, u32 *vht_cap)
 
 	/* Enable Beamformee STS Field only if SU BF is enabled */
 	if (subfee) {
-		if (nsts > (ar->num_rx_chains - 1))
-			nsts = ar->num_rx_chains - 1;
-
 		nsts <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
 		nsts &=  IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
 		*vht_cap |= nsts;
Signature · 1 line
2.39.5
author maintainer
#83 lore raw

PATCH 82/731 arm64: dts: mediatek: mt8173-elm: Drop pmics #address-cells and #size-cells

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chen-Yu Tsai <[email protected]>

[ Upstream commit aaa0b40e157c65aaa5e0ad903675f245333381bb ]

The PMIC has child nodes for each of its functions. It is not an actual bus and no addressing is involved.

Dropping the bogus properties fixes a DT validation error:

arch/arm64/boot/dts/mediatek/mt8173-elm.dtb: pmic: '#address-cells', '#size-cells' do not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#

---
 arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 --
 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi +0 -2
index b5d4b5baf4785..0d995b342d463 100644
@@ -925,8 +925,6 @@
 &pwrap {
 	pmic: pmic {
 		compatible = "mediatek,mt6397";
-		#address-cells = <1>;
-		#size-cells = <1>;
 		interrupts-extended = <&pio 11 IRQ_TYPE_LEVEL_HIGH>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
Signature · 1 line
2.39.5
author maintainer
#84 lore raw

PATCH 83/731 arm64: dts: mediatek: mt8173: Fix some node names

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chen-Yu Tsai <[email protected]>

[ Upstream commit be035e4a26edf8fdcbc4fe95d16c28deade13bb0 ]

Some node names are incorrect, causing DT validations due to mismatches.

Fixes b3a372484157 ("arm64: dts: Add mediatek MT8173 SoC and evaluation board dts and Makefile")
Fixes f2ce70149568 ("arm64: dts: mt8173: Add clock controller device nodes")
Cc Eddie Huang <[email protected]>
Cc Sascha Hauer <[email protected]>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173.dtsi +3 -3
index 3458be7f7f611..0ca63e8c4e16c 100644
@@ -352,14 +352,14 @@
 			#clock-cells = <1>;
 		};
 
-		infracfg: power-controller@10001000 {
+		infracfg: clock-controller@10001000 {
 			compatible = "mediatek,mt8173-infracfg", "syscon";
 			reg = <0 0x10001000 0 0x1000>;
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 		};
 
-		pericfg: power-controller@10003000 {
+		pericfg: clock-controller@10003000 {
 			compatible = "mediatek,mt8173-pericfg", "syscon";
 			reg = <0 0x10003000 0 0x1000>;
 			#clock-cells = <1>;
@@ -564,7 +564,7 @@
 			memory-region = <&vpu_dma_reserved>;
 		};
 
-		sysirq: intpol-controller@10200620 {
+		sysirq: interrupt-controller@10200620 {
 			compatible = "mediatek,mt8173-sysirq",
 				     "mediatek,mt6577-sysirq";
 			interrupt-controller;
Signature · 1 line
2.39.5
author maintainer
#85 lore raw

PATCH 84/731 wifi: ath11k: update channel list in reg notifier instead reg worker

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Wen Gong <[email protected]>

[ Upstream commit 933ab187e679e6fbdeea1835ae39efcc59c022d2 ]

Currently when ath11k gets a new channel list, it will be processed according to the following steps:
1. update new channel list to cfg80211 and queue reg_work.
2. cfg80211 handles new channel list during reg_work.
3. update cfg80211's handled channel list to firmware by ath11k_reg_update_chan_list().

But ath11k will immediately execute step 3 after reg_work is just queued. Since step 2 is asynchronous, cfg80211 may not have completed handling the new channel list, which may leading to an out-of-bounds write error:

BUG: KASAN: slab-out-of-bounds in ath11k_reg_update_chan_list
Call Trace:
    ath11k_reg_update_chan_list+0xbfe/0xfe0 [ath11k]
    kfree+0x109/0x3a0
    ath11k_regd_update+0x1cf/0x350 [ath11k]
    ath11k_regd_update_work+0x14/0x20 [ath11k]
    process_one_work+0xe35/0x14c0

Should ensure step 2 is completely done before executing step 3. Thus Wen raised patch[1]. When flag NL80211_REGDOM_SET_BY_DRIVER is set, cfg80211 will notify ath11k after step 2 is done.

So enable the flag NL80211_REGDOM_SET_BY_DRIVER then cfg80211 will notify ath11k after step 2 is done. At this time, there will be no KASAN bug during the execution of the step 3.

[1] https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes f45cb6b29cd3 ("wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update()")
---
 drivers/net/wireless/ath/ath11k/reg.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +15 -7
index b0f289784dd3a..7bfe47ad62a07 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: BSD-3-Clause-Clear
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 #include <linux/rtnetlink.h>
 
@@ -55,6 +55,19 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
 	ath11k_dbg(ar->ab, ATH11K_DBG_REG,
 		   "Regulatory Notification received for %s\n", wiphy_name(wiphy));
 
+	if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER) {
+		ath11k_dbg(ar->ab, ATH11K_DBG_REG,
+			   "driver initiated regd update\n");
+		if (ar->state != ATH11K_STATE_ON)
+			return;
+
+		ret = ath11k_reg_update_chan_list(ar, true);
+		if (ret)
+			ath11k_warn(ar->ab, "failed to update channel list: %d\n", ret);
+
+		return;
+	}
+
 	/* Currently supporting only General User Hints. Cell base user
 	 * hints to be handled later.
 	 * Hints from other sources like Core, Beacons are not expected for
@@ -293,12 +306,6 @@ int ath11k_regd_update(struct ath11k *ar)
 	if (ret)
 		goto err;
 
-	if (ar->state == ATH11K_STATE_ON) {
-		ret = ath11k_reg_update_chan_list(ar, true);
-		if (ret)
-			goto err;
-	}
-
 	return 0;
 err:
 	ath11k_warn(ab, "failed to perform regd update : %d\n", ret);
@@ -977,6 +984,7 @@ void ath11k_regd_update_work(struct work_struct *work)
 void ath11k_reg_init(struct ath11k *ar)
 {
 	ar->hw->wiphy->regulatory_flags = REGULATORY_WIPHY_SELF_MANAGED;
+	ar->hw->wiphy->flags |= WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER;
 	ar->hw->wiphy->reg_notifier = ath11k_reg_notifier;
 }
 
Signature · 1 line
2.39.5
#86 lore raw

Re: [PATCH 6.14 084/731] wifi: ath11k: update channel list in reg notifier instead reg worker

Quoted 69 lines · Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Wen Gong <[email protected]>

[ Upstream commit 933ab187e679e6fbdeea1835ae39efcc59c022d2 ]

Currently when ath11k gets a new channel list, it will be processed according to the following steps:
1. update new channel list to cfg80211 and queue reg_work.
2. cfg80211 handles new channel list during reg_work.
3. update cfg80211's handled channel list to firmware by ath11k_reg_update_chan_list().

But ath11k will immediately execute step 3 after reg_work is just queued. Since step 2 is asynchronous, cfg80211 may not have completed handling the new channel list, which may leading to an out-of-bounds write error:

BUG: KASAN: slab-out-of-bounds in ath11k_reg_update_chan_list
Call Trace:
     ath11k_reg_update_chan_list+0xbfe/0xfe0 [ath11k]
     kfree+0x109/0x3a0
     ath11k_regd_update+0x1cf/0x350 [ath11k]
     ath11k_regd_update_work+0x14/0x20 [ath11k]
     process_one_work+0xe35/0x14c0

Should ensure step 2 is completely done before executing step 3. Thus Wen raised patch[1]. When flag NL80211_REGDOM_SET_BY_DRIVER is set, cfg80211 will notify ath11k after step 2 is done.

So enable the flag NL80211_REGDOM_SET_BY_DRIVER then cfg80211 will notify ath11k after step 2 is done. At this time, there will be no KASAN bug during the execution of the step 3.

[1] https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes f45cb6b29cd3 ("wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update()")
---
  drivers/net/wireless/ath/ath11k/reg.c | 22 +++++++++++++++-------
  1 file changed, 15 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +3 -1
index b0f289784dd3a..7bfe47ad62a07 100644
@@ -1,7 +1,7 @@
  // SPDX-License-Identifier: BSD-3-Clause-Clear
  /*
   * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
   */
  #include <linux/rtnetlink.h>
 
@@ -55,6 +55,19 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
  	ath11k_dbg(ar->ab, ATH11K_DBG_REG,
  		   "Regulatory Notification received for %s\n", wiphy_name(wiphy));
 
+	if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER) {
+		ath11k_dbg(ar->ab, ATH11K_DBG_REG,

drivers/net/wireless/ath/ath11k/reg.c ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) · line 69

Quoted 10 lines
drivers/net/wireless/ath/ath11k/reg.c +10 -0
+			   "driver initiated regd update\n");
+		if (ar->state != ATH11K_STATE_ON)
+			return;
+
+		ret = ath11k_reg_update_chan_list(ar, true);
+		if (ret)
+			ath11k_warn(ar->ab, "failed to update channel list: %d\n", ret);
+
+		return;
+	}

I suspect this causes stalls for me.

Workqueues are waiting for rtnl_lock:

Quoted 13 lines

Showing busy workqueues and worker pools:
workqueue events_unbound: flags=0x2
pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=2

    in-flight: 107692:linkwatch_event
workqueue netns: flags=0x6000a
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=18
    in-flight: 107676:cleanup_net   
workqueue pm: flags=0x4
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=5 refcnt=6
    in-flight: 107843:pm_runtime_work ,100179:pm_runtime_work ,50846:pm_runtime_work ,107845:pm_runtime_work ,107652:pm_runtime_work
workqueue ipv6_addrconf: flags=0x6000a
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=18
    in-flight: 107705:addrconf_dad_work

While the above reg_notifier is stuck too:

Quoted 3 lines

workqueue events: flags=0x0
pwq 14: cpus=3 node=0 flags=0x0 nice=0 active=1 refcnt=2

    in-flight: 107807:reg_todo [cfg80211]

waiting for:

Quoted 6 lines
Workqueue: events reg_todo [cfg80211]
Call Trace:
 <TASK>
 __schedule+0x437/0x1470
 schedule+0x27/0xf0
 schedule_timeout+0x73/0xe0
Quoted 8 lines
 __wait_for_common+0x8e/0x1c0
 ath11k_reg_update_chan_list+0x23c/0x290 [ath11k 30c4a145118dc3331f552d6275ec7d6272671444]
 ath11k_reg_notifier+0x5a/0x80 [ath11k 30c4a145118dc3331f552d6275ec7d6272671444]
 reg_process_self_managed_hint+0x170/0x1b0 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 reg_process_self_managed_hints+0x47/0xf0 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 reg_todo+0x207/0x290 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 process_one_work+0x17b/0x330
 worker_thread+0x2ce/0x3f0

Is stable missing some backport or is this a problem in 6.15-rc too?

/me looking...

Ah, what about:
commit 02aae8e2f957adc1b15b6b8055316f8a154ac3f5

Author: Wen Gong <[email protected]>
Date:   Fri Jan 17 14:17:37 2025 +0800

wifi: ath11k: update channel list in worker when wait flag is set

?

thanks,

Signature · 2 lines
js
suse labs
#87 lore raw

Re: [PATCH 6.14 084/731] wifi: ath11k: update channel list in reg notifier instead reg worker

Quoted 126 lines · Jiri Slaby
Quoted 71 lines · Greg Kroah-Hartman

6.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wen Gong <[email protected]>

[ Upstream commit 933ab187e679e6fbdeea1835ae39efcc59c022d2 ]

Currently when ath11k gets a new channel list, it will be processed according to the following steps:
1. update new channel list to cfg80211 and queue reg_work.
2. cfg80211 handles new channel list during reg_work.
3. update cfg80211's handled channel list to firmware by ath11k_reg_update_chan_list().

But ath11k will immediately execute step 3 after reg_work is just queued. Since step 2 is asynchronous, cfg80211 may not have completed handling the new channel list, which may leading to an out-of-bounds write error:

BUG: KASAN: slab-out-of-bounds in ath11k_reg_update_chan_list
Call Trace:
     ath11k_reg_update_chan_list+0xbfe/0xfe0 [ath11k]
     kfree+0x109/0x3a0
     ath11k_regd_update+0x1cf/0x350 [ath11k]
     ath11k_regd_update_work+0x14/0x20 [ath11k]
     process_one_work+0xe35/0x14c0

Should ensure step 2 is completely done before executing step 3. Thus Wen raised patch[1]. When flag NL80211_REGDOM_SET_BY_DRIVER is set, cfg80211 will notify ath11k after step 2 is done.

So enable the flag NL80211_REGDOM_SET_BY_DRIVER then cfg80211 will notify ath11k after step 2 is done. At this time, there will be no KASAN bug during the execution of the step 3.

[1] https://patchwork.kernel.org/project/linux-wireless/ patch/[email protected]/

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125- QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes f45cb6b29cd3 ("wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update()")

---
  drivers/net/wireless/ath/ath11k/reg.c | 22 +++++++++++++++-------

  1 file changed, 15 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +0 -1
index b0f289784dd3a..7bfe47ad62a07 100644
@@ -1,7 +1,7 @@
   // SPDX-License-Identifier: BSD-3-Clause-Clear
   /*
    * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All 

rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
   */
  #include <linux/rtnetlink.h>

drivers/net/wireless/ath/ath11k/reg.c +3 -0
@@ -55,6 +55,19 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct 
 regulatory_request *request)
       ath11k_dbg(ar->ab, ATH11K_DBG_REG,
              "Regulatory Notification received for %s\n", wiphy_name(wiphy));
+    if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER) {
+        ath11k_dbg(ar->ab, ATH11K_DBG_REG,
+               "driver initiated regd update\n");

drivers/net/wireless/ath/ath11k/reg.c ath11k_reg_notifier(struct wiphy *wiphy, struct · line 70

Quoted 10 lines
drivers/net/wireless/ath/ath11k/reg.c +9 -0
+        if (ar->state != ATH11K_STATE_ON)
+            return;
+
+        ret = ath11k_reg_update_chan_list(ar, true);
+        if (ret)
+            ath11k_warn(ar->ab, "failed to update channel list: 
 %d\n", ret);
+
+        return;
+    }

I suspect this causes stalls for me.

Workqueues are waiting for rtnl_lock:

Quoted 4 lines

Showing busy workqueues and worker pools:
workqueue events_unbound: flags=0x2
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=2
    in-flight: 107692:linkwatch_event

Quoted 8 lines

workqueue netns: flags=0x6000a
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=18
    in-flight: 107676:cleanup_net workqueue pm: flags=0x4
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=5 refcnt=6
    in-flight: 107843:pm_runtime_work ,100179:pm_runtime_work ,50846:pm_runtime_work ,107845:pm_runtime_work ,107652:pm_runtime_work workqueue ipv6_addrconf: flags=0x6000a
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=18
    in-flight: 107705:addrconf_dad_work

While the above reg_notifier is stuck too:

Quoted 3 lines

workqueue events: flags=0x0
   pwq 14: cpus=3 node=0 flags=0x0 nice=0 active=1 refcnt=2
     in-flight: 107807:reg_todo [cfg80211]

waiting for:

Quoted 6 lines
Workqueue: events reg_todo [cfg80211]
Call Trace:
 <TASK>
 __schedule+0x437/0x1470
 schedule+0x27/0xf0
 schedule_timeout+0x73/0xe0
Quoted 8 lines
 __wait_for_common+0x8e/0x1c0
 ath11k_reg_update_chan_list+0x23c/0x290 [ath11k 30c4a145118dc3331f552d6275ec7d6272671444]
 ath11k_reg_notifier+0x5a/0x80 [ath11k 30c4a145118dc3331f552d6275ec7d6272671444]
 reg_process_self_managed_hint+0x170/0x1b0 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 reg_process_self_managed_hints+0x47/0xf0 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 reg_todo+0x207/0x290 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 process_one_work+0x17b/0x330
 worker_thread+0x2ce/0x3f0

Is stable missing some backport or is this a problem in 6.15-rc too?

/me looking...

Quoted 8 lines

Ah, what about:
commit 02aae8e2f957adc1b15b6b8055316f8a154ac3f5
Author: Wen Gong <[email protected]>
Date:   Fri Jan 17 14:17:37 2025 +0800

    wifi: ath11k: update channel list in worker when wait flag is set

?

Yes, please add this patch. It will minimize the occupation time of rtnl_lock.

You can retry and check if this warning will show again.

Quoted 2 lines

thanks,

#88 lore raw

Re: [PATCH 6.14 084/731] wifi: ath11k: update channel list in reg notifier instead reg worker

Quoted 134 lines · Kang Yang
Quoted 131 lines · Jiri Slaby
Quoted 71 lines · Greg Kroah-Hartman

6.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wen Gong <[email protected]>

[ Upstream commit 933ab187e679e6fbdeea1835ae39efcc59c022d2 ]

Currently when ath11k gets a new channel list, it will be processed according to the following steps:
1. update new channel list to cfg80211 and queue reg_work.
2. cfg80211 handles new channel list during reg_work.
3. update cfg80211's handled channel list to firmware by ath11k_reg_update_chan_list().

But ath11k will immediately execute step 3 after reg_work is just queued. Since step 2 is asynchronous, cfg80211 may not have completed handling the new channel list, which may leading to an out-of-bounds write error:

BUG: KASAN: slab-out-of-bounds in ath11k_reg_update_chan_list
Call Trace:
     ath11k_reg_update_chan_list+0xbfe/0xfe0 [ath11k]
     kfree+0x109/0x3a0
     ath11k_regd_update+0x1cf/0x350 [ath11k]
     ath11k_regd_update_work+0x14/0x20 [ath11k]
     process_one_work+0xe35/0x14c0

Should ensure step 2 is completely done before executing step 3. Thus Wen raised patch[1]. When flag NL80211_REGDOM_SET_BY_DRIVER is set, cfg80211 will notify ath11k after step 2 is done.

So enable the flag NL80211_REGDOM_SET_BY_DRIVER then cfg80211 will notify ath11k after step 2 is done. At this time, there will be no KASAN bug during the execution of the step 3.

[1] https://patchwork.kernel.org/project/linux-wireless/ patch/[email protected]/

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125- QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes f45cb6b29cd3 ("wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update()")

---
  drivers/net/wireless/ath/ath11k/reg.c | 22 +++++++++++++++-------

  1 file changed, 15 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +0 -1
index b0f289784dd3a..7bfe47ad62a07 100644
@@ -1,7 +1,7 @@
   // SPDX-License-Identifier: BSD-3-Clause-Clear
   /*
    * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All 

rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
   */
  #include <linux/rtnetlink.h>

drivers/net/wireless/ath/ath11k/reg.c +3 -0
@@ -55,6 +55,19 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct 
 regulatory_request *request)
       ath11k_dbg(ar->ab, ATH11K_DBG_REG,
              "Regulatory Notification received for %s\n", wiphy_name(wiphy));
+    if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER) {
+        ath11k_dbg(ar->ab, ATH11K_DBG_REG,
+               "driver initiated regd update\n");

drivers/net/wireless/ath/ath11k/reg.c ath11k_reg_notifier(struct wiphy *wiphy, struct · line 70

Quoted 10 lines
drivers/net/wireless/ath/ath11k/reg.c +9 -0
+        if (ar->state != ATH11K_STATE_ON)
+            return;
+
+        ret = ath11k_reg_update_chan_list(ar, true);
+        if (ret)
+            ath11k_warn(ar->ab, "failed to update channel list: 
 %d\n", ret);
+
+        return;
+    }

I suspect this causes stalls for me.

Workqueues are waiting for rtnl_lock:

Quoted 4 lines

Showing busy workqueues and worker pools:
workqueue events_unbound: flags=0x2
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=2
    in-flight: 107692:linkwatch_event

Quoted 8 lines

workqueue netns: flags=0x6000a
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=18
    in-flight: 107676:cleanup_net workqueue pm: flags=0x4
  pwq 2: cpus=0 node=0 flags=0x0 nice=0 active=5 refcnt=6
    in-flight: 107843:pm_runtime_work ,100179:pm_runtime_work ,50846:pm_runtime_work ,107845:pm_runtime_work ,107652:pm_runtime_work workqueue ipv6_addrconf: flags=0x6000a
  pwq 64: cpus=0-15 flags=0x4 nice=0 active=1 refcnt=18
    in-flight: 107705:addrconf_dad_work

While the above reg_notifier is stuck too:

 > workqueue events: flags=0x0
 >   pwq 14: cpus=3 node=0 flags=0x0 nice=0 active=1 refcnt=2 >     in-flight: 107807:reg_todo [cfg80211]

waiting for:

Quoted 6 lines
Workqueue: events reg_todo [cfg80211]
Call Trace:
 <TASK>
 __schedule+0x437/0x1470
 schedule+0x27/0xf0
 schedule_timeout+0x73/0xe0
Quoted 8 lines
 __wait_for_common+0x8e/0x1c0
 ath11k_reg_update_chan_list+0x23c/0x290 [ath11k 30c4a145118dc3331f552d6275ec7d6272671444]
 ath11k_reg_notifier+0x5a/0x80 [ath11k 30c4a145118dc3331f552d6275ec7d6272671444]
 reg_process_self_managed_hint+0x170/0x1b0 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 reg_process_self_managed_hints+0x47/0xf0 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 reg_todo+0x207/0x290 [cfg80211 2571f504aa68d55c11440c869062c668de1a2dce]
 process_one_work+0x17b/0x330
 worker_thread+0x2ce/0x3f0

Is stable missing some backport or is this a problem in 6.15-rc too?

/me looking...

Ah, what about:
commit 02aae8e2f957adc1b15b6b8055316f8a154ac3f5
Author: Wen Gong <[email protected]>
Date:   Fri Jan 17 14:17:37 2025 +0800

Quoted 10 lines
Quoted 3 lines

     wifi: ath11k: update channel list in worker when wait flag is set

?

Yes, please add this patch. It will minimize the occupation time of rtnl_lock.

You can retry and check if this warning will show again.

Hi, Jiri, Greg:

    Have you added this patch and verified it?

    May i know when this patch will be merged into 6.14 if everything is OK?

Quoted 4 lines
Quoted 3 lines

thanks,

#89 lore raw

Re: [PATCH 6.14 084/731] wifi: ath11k: update channel list in reg notifier instead reg worker

Quoted 12 lines · Kang Yang
Quoted 12 lines
Quoted 8 lines

Ah, what about:
commit 02aae8e2f957adc1b15b6b8055316f8a154ac3f5
Author: Wen Gong <[email protected]>
Date:   Fri Jan 17 14:17:37 2025 +0800

     wifi: ath11k: update channel list in worker when wait flag is set

?

Yes, please add this patch. It will minimize the occupation time of rtnl_lock.

Quoted 7 lines
Quoted 3 lines

You can retry and check if this warning will show again.

Hi, Jiri, Greg:

    Have you added this patch and verified it?

Yes, it works for me for a couple of days already.

Signature · 2 lines
js
suse labs
#90 lore raw

Re: [PATCH 6.14 084/731] wifi: ath11k: update channel list in reg notifier instead reg worker

Quoted 17 lines · Jiri Slaby
Quoted 16 lines · Kang Yang
Quoted 15 lines
Quoted 8 lines

Ah, what about:
commit 02aae8e2f957adc1b15b6b8055316f8a154ac3f5
Author: Wen Gong <[email protected]>
Date:   Fri Jan 17 14:17:37 2025 +0800

     wifi: ath11k: update channel list in worker when wait flag is set

?

Yes, please add this patch. It will minimize the occupation time of rtnl_lock.

You can retry and check if this warning will show again.

Quoted 5 lines
Quoted 3 lines

Hi, Jiri, Greg:

     Have you added this patch and verified it?

Yes, it works for me for a couple of days already.

Got it. So do you know when they will backport this patch into 6.14?

Do we need to do something?

#91 lore raw

Re: [PATCH 6.14 084/731] wifi: ath11k: update channel list in reg notifier instead reg worker

Quoted 21 lines · Kang Yang
Quoted 19 lines · Jiri Slaby
Quoted 18 lines · Kang Yang
Quoted 5 lines
Quoted 5 lines

Ah, what about:
commit 02aae8e2f957adc1b15b6b8055316f8a154ac3f5
Author: Wen Gong <[email protected]>
Date:   Fri Jan 17 14:17:37 2025 +0800

Quoted 10 lines
Quoted 3 lines

     wifi: ath11k: update channel list in worker when wait flag is set

?

Yes, please add this patch. It will minimize the occupation time of rtnl_lock.

You can retry and check if this warning will show again.

Hi, Jiri, Greg:

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

     Have you added this patch and verified it?

Yes, it works for me for a couple of days already.

Got it. So do you know when they will backport this patch into 6.14?

Do we need to do something?

I assume wait :). The Greg's inbox tends to be huge.

Signature · 2 lines
js
suse labs
author maintainer
#92 lore raw

PATCH 85/731 ARM: dts: omap4-panda-a4: Add missing model and compatible properties

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Tom Rini <[email protected]>

[ Upstream commit ea07a4775df03852c353514b5b7646a17bd425be ]

When moving the model and compatible properties out of the common Pandaboard files and in to the specific boards, the omap4-panda-a4 file wasn't updated as well and so has lacked a model and compatible entry ever since.

Fixes a1a57abaaf82 ("ARM: dts: omap4-panda: Fix model and SoC family details")
---
 arch/arm/boot/dts/ti/omap/omap4-panda-a4.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/ti/omap/omap4-panda-a4.dts +5 -0
index 8fd076e5d1b01..4b8bfd0188add 100644
@@ -7,6 +7,11 @@
 #include "omap443x.dtsi"
 #include "omap4-panda-common.dtsi"
 
+/ {
+	model = "TI OMAP4 PandaBoard (A4)";
+	compatible = "ti,omap4-panda-a4", "ti,omap4-panda", "ti,omap4430", "ti,omap4";
+};
+
 /* Pandaboard Rev A4+ have external pullups on SCL & SDA */
 &dss_hdmi_pins {
 	pinctrl-single,pins = <
Signature · 1 line
2.39.5
author maintainer
#93 lore raw

PATCH 86/731 f2fs: quota: fix to avoid warning in dquot_writeback_dquots()

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chao Yu <[email protected]>

[ Upstream commit eb85c2410d6f581e957cd03a644ff6ddbe592af9 ]

F2FS-fs (dm-59): checkpoint=enable has some unwritten data.

------------[ cut here ]------------
WARNING: CPU: 6 PID: 8013 at fs/quota/dquot.c:691 dquot_writeback_dquots+0x2fc/0x308
pc : dquot_writeback_dquots+0x2fc/0x308
lr : f2fs_quota_sync+0xcc/0x1c4
Call trace:
dquot_writeback_dquots+0x2fc/0x308
f2fs_quota_sync+0xcc/0x1c4
f2fs_write_checkpoint+0x3d4/0x9b0
f2fs_issue_checkpoint+0x1bc/0x2c0
f2fs_sync_fs+0x54/0x150
f2fs_do_sync_file+0x2f8/0x814
__f2fs_ioctl+0x1960/0x3244
f2fs_ioctl+0x54/0xe0
__arm64_sys_ioctl+0xa8/0xe4
invoke_syscall+0x58/0x114

checkpoint and f2fs_remount may race as below, resulting triggering warning in dquot_writeback_dquots().

atomic write remount
- do_remount
- down_write(&sb->s_umount);
- f2fs_remount
- ioctl
- f2fs_do_sync_file
- f2fs_sync_fs
- f2fs_write_checkpoint
- block_operations
- locked = down_read_trylock(&sbi->sb->s_umount)
: fail to lock due to the write lock was held by remount
- up_write(&sb->s_umount);
- f2fs_quota_sync
- dquot_writeback_dquots
- WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount))
: trigger warning because s_umount lock was unlocked by remount

If checkpoint comes from mount/umount/remount/freeze/quotactl, caller of checkpoint has already held s_umount lock, calling dquot_writeback_dquots() in the context should be safe.

So let's record task to sbi->umount_lock_holder, so that checkpoint can know whether the lock has held in the context or not by checking current w/ it.

In addition, in order to not misrepresent caller of checkpoint, we should not allow to trigger async checkpoint for those callers: mount/umount/remount/ freeze/quotactl.

Fixes af033b2aa8a8 ("f2fs: guarantee journalled quota data by checkpoint")
---
 fs/f2fs/checkpoint.c | 15 ++++++----
 fs/f2fs/f2fs.h       |  3 +-
 fs/f2fs/super.c      | 65 ++++++++++++++++++++++++++++++++++----------
 3 files changed, 61 insertions(+), 22 deletions(-)
fs/f2fs/checkpoint.c +9 -6
index efda9a0229816..bd890738b94d7 100644
@@ -1237,7 +1237,7 @@ static int block_operations(struct f2fs_sb_info *sbi)
 retry_flush_quotas:
 	f2fs_lock_all(sbi);
 	if (__need_flush_quota(sbi)) {
-		int locked;
+		bool need_lock = sbi->umount_lock_holder != current;
 
 		if (++cnt > DEFAULT_RETRY_QUOTA_FLUSH_COUNT) {
 			set_sbi_flag(sbi, SBI_QUOTA_SKIP_FLUSH);
@@ -1246,11 +1246,13 @@ static int block_operations(struct f2fs_sb_info *sbi)
 		}
 		f2fs_unlock_all(sbi);
 
-		/* only failed during mount/umount/freeze/quotactl */
-		locked = down_read_trylock(&sbi->sb->s_umount);
-		f2fs_quota_sync(sbi->sb, -1);
-		if (locked)
+		/* don't grab s_umount lock during mount/umount/remount/freeze/quotactl */
+		if (!need_lock) {
+			f2fs_do_quota_sync(sbi->sb, -1);
+		} else if (down_read_trylock(&sbi->sb->s_umount)) {
+			f2fs_do_quota_sync(sbi->sb, -1);
 			up_read(&sbi->sb->s_umount);
+		}
 		cond_resched();
 		goto retry_flush_quotas;
 	}
@@ -1867,7 +1869,8 @@ int f2fs_issue_checkpoint(struct f2fs_sb_info *sbi)
 	struct cp_control cpc;
 
 	cpc.reason = __get_cp_reason(sbi);
-	if (!test_opt(sbi, MERGE_CHECKPOINT) || cpc.reason != CP_SYNC) {
+	if (!test_opt(sbi, MERGE_CHECKPOINT) || cpc.reason != CP_SYNC ||
+		sbi->umount_lock_holder == current) {
 		int ret;
 
 		f2fs_down_write(&sbi->gc_lock);
fs/f2fs/f2fs.h +2 -1
index 1afa7be16e7da..493dda2d4b663 100644
@@ -1659,6 +1659,7 @@ struct f2fs_sb_info {
 
 	unsigned int nquota_files;		/* # of quota sysfile */
 	struct f2fs_rwsem quota_sem;		/* blocking cp for flags */
+	struct task_struct *umount_lock_holder;	/* s_umount lock holder */
 
 	/* # of pages, see count_type */
 	atomic_t nr_pages[NR_COUNT_TYPE];
@@ -3624,7 +3625,7 @@ int f2fs_inode_dirtied(struct inode *inode, bool sync);
 void f2fs_inode_synced(struct inode *inode);
 int f2fs_dquot_initialize(struct inode *inode);
 int f2fs_enable_quota_files(struct f2fs_sb_info *sbi, bool rdonly);
-int f2fs_quota_sync(struct super_block *sb, int type);
+int f2fs_do_quota_sync(struct super_block *sb, int type);
 loff_t max_file_blocks(struct inode *inode);
 void f2fs_quota_off_umount(struct super_block *sb);
 void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag);
fs/f2fs/super.c +50 -15

183 lines not on this page · raw message

Signature · 1 line
2.39.5
author maintainer
#94 lore raw

PATCH 87/731 dlm: prevent NPD when writing a positive value to event_done

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit 8e2bad543eca5c25cd02cbc63d72557934d45f13 ]

do_uevent returns the value written to event_done. In case it is a positive value, new_lockspace would undo all the work, and lockspace would not be set. __dlm_new_lockspace, however, would treat that positive value as a success due to commit 8511a2728ab8 ("dlm: fix use count with multiple joins").

Down the line, device_create_lockspace would pass that NULL lockspace to dlm_find_lockspace_local, leading to a NULL pointer dereference.

Treating such positive values as successes prevents the problem. Given this has been broken for so long, this is unlikely to break userspace expectations.

Fixes 8511a2728ab8 ("dlm: fix use count with multiple joins")
---
 fs/dlm/lockspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dlm/lockspace.c +1 -1
index 8afac6e2dff00..1929327ffbe1c 100644
@@ -576,7 +576,7 @@ static int new_lockspace(const char *name, const char *cluster,
 	   lockspace to start running (via sysfs) in dlm_ls_start(). */
 
 	error = do_uevent(ls, 1);
-	if (error)
+	if (error < 0)
 		goto out_recoverd;
 
 	/* wait until recovery is successful or failed */
Signature · 1 line
2.39.5
author maintainer
#95 lore raw

PATCH 88/731 wifi: ath11k: fix RCU stall while reaping monitor destination ring

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: P Praneesh <[email protected]>

[ Upstream commit 16c6c35c03ea73054a1f6d3302a4ce4a331b427d ]

While processing the monitor destination ring, MSDUs are reaped from the link descriptor based on the corresponding buf_id.

However, sometimes the driver cannot obtain a valid buffer corresponding to the buf_id received from the hardware. This causes an infinite loop in the destination processing, resulting in a kernel crash.

kernel log:
ath11k_pci 0000:58:00.0: data msdu_pop: invalid buf_id 309 ath11k_pci 0000:58:00.0: data dp_rx_monitor_link_desc_return failed ath11k_pci 0000:58:00.0: data msdu_pop: invalid buf_id 309 ath11k_pci 0000:58:00.0: data dp_rx_monitor_link_desc_return failed

Fix this by skipping the problematic buf_id and reaping the next entry, replacing the break with the next MSDU processing.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +2 -2
index 029ecf51c9efd..07cd336ee01b1 100644
@@ -4783,7 +4783,7 @@ u32 ath11k_dp_rx_mon_mpdu_pop(struct ath11k *ar, int mac_id,
 			if (!msdu) {
 				ath11k_dbg(ar->ab, ATH11K_DBG_DATA,
 					   "msdu_pop: invalid buf_id %d\n", buf_id);
-				break;
+				goto next_msdu;
 			}
 			rxcb = ATH11K_SKB_RXCB(msdu);
 			if (!rxcb->unmapped) {
@@ -5410,7 +5410,7 @@ ath11k_dp_rx_full_mon_mpdu_pop(struct ath11k *ar,
 					   "full mon msdu_pop: invalid buf_id %d\n",
 					    buf_id);
 				spin_unlock_bh(&rx_ring->idr_lock);
-				break;
+				goto next_msdu;
 			}
 			idr_remove(&rx_ring->bufs_idr, buf_id);
 			spin_unlock_bh(&rx_ring->idr_lock);
Signature · 1 line
2.39.5
author maintainer
#96 lore raw

PATCH 89/731 wifi: ath11k: add srng->lock for ath11k_hal_srng_* in monitor mode

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kang Yang <[email protected]>

[ Upstream commit 63b7af49496d0e32f7a748b6af3361ec138b1bd3 ]

ath11k_hal_srng_* should be used with srng->lock to protect srng data.

For ath11k_dp_rx_mon_dest_process() and ath11k_dp_full_mon_process_rx(), they use ath11k_hal_srng_* for many times but never call srng->lock.

So when running (full) monitor mode, warning will occur:

RIP: 0010:ath11k_hal_srng_dst_peek+0x18/0x30 [ath11k]
Call Trace:
 ? ath11k_hal_srng_dst_peek+0x18/0x30 [ath11k]
 ath11k_dp_rx_process_mon_status+0xc45/0x1190 [ath11k]
 ? idr_alloc_u32+0x97/0xd0
 ath11k_dp_rx_process_mon_rings+0x32a/0x550 [ath11k]
 ath11k_dp_service_srng+0x289/0x5a0 [ath11k]
 ath11k_pcic_ext_grp_napi_poll+0x30/0xd0 [ath11k]
 __napi_poll+0x30/0x1f0
 net_rx_action+0x198/0x320
 __do_softirq+0xdd/0x319

So add srng->lock for them to avoid such warnings.

Inorder to fetch the srng->lock, should change srng's definition from 'void' to 'struct hal_srng'. And initialize them elsewhere to prevent one line of code from being too long. This is consistent with other ring process functions, such as ath11k_dp_process_rx().

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +8 -2
index 07cd336ee01b1..b8b3dce9cdb53 100644
@@ -5148,7 +5148,7 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id,
 	struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data;
 	const struct ath11k_hw_hal_params *hal_params;
 	void *ring_entry;
-	void *mon_dst_srng;
+	struct hal_srng *mon_dst_srng;
 	u32 ppdu_id;
 	u32 rx_bufs_used;
 	u32 ring_id;
@@ -5165,6 +5165,7 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id,
 
 	spin_lock_bh(&pmon->mon_lock);
 
+	spin_lock_bh(&mon_dst_srng->lock);
 	ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng);
 
 	ppdu_id = pmon->mon_ppdu_info.ppdu_id;
@@ -5223,6 +5224,7 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, int mac_id,
 								mon_dst_srng);
 	}
 	ath11k_hal_srng_access_end(ar->ab, mon_dst_srng);
+	spin_unlock_bh(&mon_dst_srng->lock);
 
 	spin_unlock_bh(&pmon->mon_lock);
 
@@ -5612,7 +5614,7 @@ static int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id,
 	struct hal_sw_mon_ring_entries *sw_mon_entries;
 	struct ath11k_pdev_mon_stats *rx_mon_stats;
 	struct sk_buff *head_msdu, *tail_msdu;
-	void *mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id];
+	struct hal_srng *mon_dst_srng;
 	void *ring_entry;
 	u32 rx_bufs_used = 0, mpdu_rx_bufs_used;
 	int quota = 0, ret;
@@ -5628,6 +5630,9 @@ static int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id,
 		goto reap_status_ring;
 	}
 
+	mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id];
+	spin_lock_bh(&mon_dst_srng->lock);
+
 	ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng);
 	while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) {
 		head_msdu = NULL;
@@ -5671,6 +5676,7 @@ static int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id,
 	}
 
 	ath11k_hal_srng_access_end(ar->ab, mon_dst_srng);
+	spin_unlock_bh(&mon_dst_srng->lock);
 	spin_unlock_bh(&pmon->mon_lock);
 
 	if (rx_bufs_used) {
Signature · 1 line
2.39.5
author maintainer
#97 lore raw

PATCH 90/731 wifi: ath12k: Fix locking in "QMI firmware ready" error paths

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <[email protected]>

[ Upstream commit b9c7299a3341a737622e4de45b9c27e60ad01e3b ]

If ag->mutex has been locked, unlock it before returning. If it has not been locked, do not unlock it before returning. These bugs have been detected by the Clang thread-safety analyzer.

Cc Karthikeyan Periyasamy <[email protected]>
Cc Jeff Johnson <[email protected]>
Fixes ee146e11b4d9 ("wifi: ath12k: refactor core start based on hardware group")
---
 drivers/net/wireless/ath/ath12k/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/core.c +3 -1
index 0606116d6b9c4..212cd935e60a0 100644
@@ -1122,16 +1122,18 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
 		ath12k_core_stop(ab);
 		mutex_unlock(&ab->core_lock);
 	}
+	mutex_unlock(&ag->mutex);
 	goto exit;
 
 err_dp_free:
 	ath12k_dp_free(ab);
 	mutex_unlock(&ab->core_lock);
+	mutex_unlock(&ag->mutex);
+
 err_firmware_stop:
 	ath12k_qmi_firmware_stop(ab);
 
 exit:
-	mutex_unlock(&ag->mutex);
 	return ret;
 }
 
Signature · 1 line
2.39.5
author maintainer
#98 lore raw

PATCH 91/731 f2fs: fix to avoid panic once fallocation fails for pinfile

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chao Yu <[email protected]>

[ Upstream commit 48ea8b200414ac69ea96f4c231f5c7ef1fbeffef ]

syzbot reports a f2fs bug as below:

------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:2746!
CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted 6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0
RIP: 0010:get_new_segment fs/f2fs/segment.c:2746 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2876
Call Trace:
 <TASK>
 __allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3210
 f2fs_allocate_new_section fs/f2fs/segment.c:3224 [inline]
 f2fs_allocate_pinning_section+0xfa/0x4e0 fs/f2fs/segment.c:3238
 f2fs_expand_inode_data+0x696/0xca0 fs/f2fs/file.c:1830
 f2fs_fallocate+0x537/0xa10 fs/f2fs/file.c:1940
 vfs_fallocate+0x569/0x6e0 fs/open.c:327
 do_vfs_ioctl+0x258c/0x2e40 fs/ioctl.c:885
 __do_sys_ioctl fs/ioctl.c:904 [inline]
 __se_sys_ioctl+0x80/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Concurrent pinfile allocation may run out of free section, result in panic in get_new_segment(), let's expand pin_sem lock coverage to include f2fs_gc(), so that we can make sure to reclaim enough free space for following allocation.

In addition, do below changes to enhance error path handling:
- call f2fs_bug_on() only in non-pinfile allocation path in get_new_segment().
- call reset_curseg_fields() to reset all fields of curseg in new_curseg()

---
 fs/f2fs/file.c    |  8 +++++---
 fs/f2fs/segment.c | 20 ++++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)
fs/f2fs/file.c +5 -3
index f92a9fba9991b..1bb70499ab598 100644
@@ -1834,18 +1834,20 @@ static int f2fs_expand_inode_data(struct inode *inode, loff_t offset,
 
 		map.m_len = sec_blks;
 next_alloc:
+		f2fs_down_write(&sbi->pin_sem);
+
 		if (has_not_enough_free_secs(sbi, 0, f2fs_sb_has_blkzoned(sbi) ?
 			ZONED_PIN_SEC_REQUIRED_COUNT :
 			GET_SEC_FROM_SEG(sbi, overprovision_segments(sbi)))) {
 			f2fs_down_write(&sbi->gc_lock);
 			stat_inc_gc_call_count(sbi, FOREGROUND);
 			err = f2fs_gc(sbi, &gc_control);
-			if (err && err != -ENODATA)
+			if (err && err != -ENODATA) {
+				f2fs_up_write(&sbi->pin_sem);
 				goto out_err;
+			}
 		}
 
-		f2fs_down_write(&sbi->pin_sem);
-
 		err = f2fs_allocate_pinning_section(sbi);
 		if (err) {
 			f2fs_up_write(&sbi->pin_sem);
fs/f2fs/segment.c +10 -10
index c282e8a0a2ec1..6ebe25eafafa5 100644
@@ -2806,7 +2806,7 @@ static int get_new_segment(struct f2fs_sb_info *sbi,
 							MAIN_SECS(sbi));
 		if (secno >= MAIN_SECS(sbi)) {
 			ret = -ENOSPC;
-			f2fs_bug_on(sbi, 1);
+			f2fs_bug_on(sbi, !pinning);
 			goto out_unlock;
 		}
 	}
@@ -2848,7 +2848,7 @@ static int get_new_segment(struct f2fs_sb_info *sbi,
 out_unlock:
 	spin_unlock(&free_i->segmap_lock);
 
-	if (ret == -ENOSPC)
+	if (ret == -ENOSPC && !pinning)
 		f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_NO_SEGMENT);
 	return ret;
 }
@@ -2921,6 +2921,13 @@ static unsigned int __get_next_segno(struct f2fs_sb_info *sbi, int type)
 	return curseg->segno;
 }
 
+static void reset_curseg_fields(struct curseg_info *curseg)
+{
+	curseg->inited = false;
+	curseg->segno = NULL_SEGNO;
+	curseg->next_segno = 0;
+}
+
 /*
  * Allocate a current working segment.
  * This function always allocates a free segment in LFS manner.
@@ -2939,7 +2946,7 @@ static int new_curseg(struct f2fs_sb_info *sbi, int type, bool new_sec)
 	ret = get_new_segment(sbi, &segno, new_sec, pinning);
 	if (ret) {
 		if (ret == -ENOSPC)
-			curseg->segno = NULL_SEGNO;
+			reset_curseg_fields(curseg);
 		return ret;
 	}
 
@@ -3710,13 +3717,6 @@ static void f2fs_randomize_chunk(struct f2fs_sb_info *sbi,
 		get_random_u32_inclusive(1, sbi->max_fragment_hole);
 }
 
-static void reset_curseg_fields(struct curseg_info *curseg)
-{
-	curseg->inited = false;
-	curseg->segno = NULL_SEGNO;
-	curseg->next_segno = 0;
-}
-
 int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
 		block_t old_blkaddr, block_t *new_blkaddr,
 		struct f2fs_summary *sum, int type,
Signature · 1 line
2.39.5
author maintainer
#99 lore raw

PATCH 92/731 scsi: mpt3sas: Reduce log level of ignore_delay_remove message to KERN_INFO

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Paul Menzel <[email protected]>

[ Upstream commit fb27da6e06a0869d2e36255bb7e0b6102daf712f ]

On several systems with Dell HBA controller Linux prints the warning below:

    $ dmesg | grep -e "Linux version" -e "DMI: Dell"  -e "ignore_delay_remove"
    [    0.000000] Linux version 6.12.11.mx64.479 ([email protected]) (gcc (GCC) 12.3.0, GNU ld (GNU Binutils) 2.41) #1 SMP PREEMPT_DYNAMIC Fri Jan 24 13:30:47 CET 2025
    [    0.000000] DMI: Dell Inc. PowerEdge R7625/0M7YXP, BIOS 1.10.6 12/06/2024
    [    9.386551] scsi 0:0:4:0: set ignore_delay_remove for handle(0x0012)

A user does not know, what to do about it, and everything seems to work as expected. Therefore, remove the log level from warning to info.

Device information:

    $ dmesg | grep -e 0:4:0 -e '12)'
    [    8.857606] mpt3sas_cm0: config page(0x00000000db0e4179) - dma(0xfd5f6000): size(512)
    [    9.133856] scsi 0:0:0:0: SATA: handle(0x0017), sas_addr(0x3c0470e0d40cc20c), phy(12), device_name(0x5000039db8d2284b)
    [    9.366341] mpt3sas_cm0: handle(0x12) sas_address(0x3c0570e0d40cc208) port_type(0x0)
    [    9.378867] scsi 0:0:4:0: Enclosure         DP       BP_PSV           7.10 PQ: 0 ANSI: 7
    [    9.386551] scsi 0:0:4:0: set ignore_delay_remove for handle(0x0012)
    [    9.387465] scsi 0:0:4:0: SES: handle(0x0012), sas_addr(0x3c0570e0d40cc208), phy(17), device_name(0x3c0570e0d40cc208)
    [    9.387465] scsi 0:0:4:0: enclosure logical id (0x3c0470e0d4092108), slot(8)
    [    9.387465] scsi 0:0:4:0: enclosure level(0x0001), connector name( C0  )
    [    9.390495] scsi 0:0:4:0: qdepth(1), tagged(0), scsi_level(8), cmd_que(0)
    [    9.401700]  end_device-0:4: add: handle(0x0012), sas_addr(0x3c0570e0d40cc208)
    [    9.471916] ses 0:0:4:0: Attached Enclosure device
    [    9.480088] ses 0:0:4:0: Attached scsi generic sg4 type 13
    $ lspci -nn -k -s 41:
    41:00.0 Serial Attached SCSI controller [0107]: Broadcom / LSI Fusion-MPT 12GSAS/PCIe Secure SAS38xx [1000:00e6]
    	DeviceName: SL3 NonRAID
    	Subsystem: Dell HBA355i Front [1028:200c]
    	Kernel driver in use: mpt3sas
Fixes 30158dc9bbc9 ("mpt3sas: Never block the Enclosure device")
Cc Tomas Henzl <[email protected]>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +1 -1
index a456e5ec74d88..9c2d3178f3844 100644
@@ -2703,7 +2703,7 @@ scsih_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim)
 		ssp_target = 1;
 		if (sas_device->device_info &
 				MPI2_SAS_DEVICE_INFO_SEP) {
-			sdev_printk(KERN_WARNING, sdev,
+			sdev_printk(KERN_INFO, sdev,
 			"set ignore_delay_remove for handle(0x%04x)\n",
 			sas_device_priv_data->sas_target->handle);
 			sas_device_priv_data->ignore_delay_remove = 1;
Signature · 1 line
2.39.5
author maintainer
#100 lore raw

PATCH 93/731 md: ensure resync is prioritized over recovery

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Li Nan <[email protected]>

[ Upstream commit 4b10a3bc67c1232f76aa1e04778ca26d6c0ddf7f ]

If a new disk is added during resync, the resync process is interrupted, and recovery is triggered, causing the previous resync to be lost. In reality, disk addition should not terminate resync, fix it.

Steps to reproduce the issue:
mdadm -CR /dev/md0 -l1 -n3 -x1 /dev/sd[abcd]
mdadm --fail /dev/md0 /dev/sdc

Fixes 24dd469d728d ("[PATCH] md: allow a manual resync with md")
---
 drivers/md/md.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/md/md.c +7 -7
index 30b3dbbce2d2d..827646b3eb594 100644
@@ -9460,6 +9460,13 @@ static bool md_choose_sync_action(struct mddev *mddev, int *spares)
 		return true;
 	}
 
+	/* Check if resync is in progress. */
+	if (mddev->recovery_cp < MaxSector) {
+		set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
+		clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
+		return true;
+	}
+
 	/*
 	 * Remove any failed drives, then add spares if possible. Spares are
 	 * also removed and re-added, to allow the personality to fail the
@@ -9476,13 +9483,6 @@ static bool md_choose_sync_action(struct mddev *mddev, int *spares)
 		return true;
 	}
 
-	/* Check if recovery is in progress. */
-	if (mddev->recovery_cp < MaxSector) {
-		set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
-		clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
-		return true;
-	}
-
 	/* Delay to choose resync/check/repair in md_do_sync(). */
 	if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery))
 		return true;
Signature · 1 line
2.39.5
author maintainer
#101 lore raw

PATCH 94/731 md/raid1: fix memory leak in raid1_run() if no active rdev

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Zheng Qixing <[email protected]>

[ Upstream commit 5fbcf76e0dfe68578ffa2a8a691cc44cf586ae35 ]

When raid1_set_limits() fails or when the array has no active rdev, the allocated memory for conf is not properly freed.

Add raid1_free() call to properly free the conf in error path.

Fixes 799af947ed13 ("md/raid1: don't free conf on raid0_run failure")
---
 drivers/md/raid1.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/md/raid1.c +7 -1
index 10ea3af40991d..cb108b3e28c4d 100644
@@ -45,6 +45,7 @@
 
 static void allow_barrier(struct r1conf *conf, sector_t sector_nr);
 static void lower_barrier(struct r1conf *conf, sector_t sector_nr);
+static void raid1_free(struct mddev *mddev, void *priv);
 
 #define RAID_1_10_NAME "raid1"
 #include "raid1-10.c"
@@ -3256,8 +3257,11 @@ static int raid1_run(struct mddev *mddev)
 
 	if (!mddev_is_dm(mddev)) {
 		ret = raid1_set_limits(mddev);
-		if (ret)
+		if (ret) {
+			if (!mddev->private)
+				raid1_free(mddev, conf);
 			return ret;
+		}
 	}
 
 	mddev->degraded = 0;
@@ -3271,6 +3275,8 @@ static int raid1_run(struct mddev *mddev)
 	 */
 	if (conf->raid_disks - mddev->degraded < 1) {
 		md_unregister_thread(mddev, &conf->thread);
+		if (!mddev->private)
+			raid1_free(mddev, conf);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.39.5
author maintainer
#102 lore raw

PATCH 95/731 coredump: Fixes core_pipe_limit sysctl proc_handler

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Nicolas Bouchinet <[email protected]>

[ Upstream commit 049439e22825507a90d4dedf3934e24fd0a8ff62 ]

proc_dointvec converts a string to a vector of signed int, which is stored in the unsigned int .data core_pipe_limit.
It was thus authorized to write a negative value to core_pipe_limit sysctl which once stored in core_pipe_limit, leads to the signed int dump_count check against core_pipe_limit never be true. The same can be achieved with core_pipe_limit set to INT_MAX.

Any negative write or >= to INT_MAX in core_pipe_limit sysctl would hypothetically allow a user to create very high load on the system by running processes that produces a coredump in case the core_pattern sysctl is configured to pipe core files to user space helper. Memory or PID exhaustion should happen before but it anyway breaks the core_pipe_limit semantic.

This commit fixes this by changing core_pipe_limit sysctl's proc_handler to proc_dointvec_minmax and bound checking between SYSCTL_ZERO and SYSCTL_INT_MAX.

Fixes a293980c2e26 ("exec: let do_coredump() limit the number of concurrent dumps to pipes")
---
 fs/coredump.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/coredump.c +3 -1
index 4375c70144d0a..4ebec51fe4f22 100644
@@ -1016,7 +1016,9 @@ static const struct ctl_table coredump_sysctls[] = {
 		.data		= &core_pipe_limit,
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= SYSCTL_ZERO,
+		.extra2		= SYSCTL_INT_MAX,
 	},
 	{
 		.procname       = "core_file_note_size_limit",
Signature · 1 line
2.39.5
author maintainer
#103 lore raw

PATCH 96/731 io_uring/io-wq: eliminate redundant io_work_get_acct() calls

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Max Kellermann <[email protected]>

[ Upstream commit 3c75635f8ed482300931327847c50068a865a648 ]

Instead of calling io_work_get_acct() again, pass acct to io_wq_insert_work() and io_wq_remove_pending().

This atomic access in io_work_get_acct() was done under the acct->lock, and optimizing it away reduces lock contention a bit.

Stable-dep-of: 486ba4d84d62 ("io_uring/io-wq: do not use bogus hash value")

---
 io_uring/io-wq.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
io_uring/io-wq.c +4 -5
index 91019b4d03088..f7d09698e43ce 100644
@@ -916,9 +916,8 @@ static void io_run_cancel(struct io_wq_work *work, struct io_wq *wq)
 	} while (work);
 }
 
-static void io_wq_insert_work(struct io_wq *wq, struct io_wq_work *work)
+static void io_wq_insert_work(struct io_wq *wq, struct io_wq_acct *acct, struct io_wq_work *work)
 {
-	struct io_wq_acct *acct = io_work_get_acct(wq, work);
 	unsigned int hash;
 	struct io_wq_work *tail;
 
@@ -964,7 +963,7 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
 	}
 
 	raw_spin_lock(&acct->lock);
-	io_wq_insert_work(wq, work);
+	io_wq_insert_work(wq, acct, work);
 	clear_bit(IO_ACCT_STALLED_BIT, &acct->flags);
 	raw_spin_unlock(&acct->lock);
 
@@ -1034,10 +1033,10 @@ static bool io_wq_worker_cancel(struct io_worker *worker, void *data)
 }
 
 static inline void io_wq_remove_pending(struct io_wq *wq,
+					struct io_wq_acct *acct,
 					 struct io_wq_work *work,
 					 struct io_wq_work_node *prev)
 {
-	struct io_wq_acct *acct = io_work_get_acct(wq, work);
 	unsigned int hash = io_get_work_hash(work);
 	struct io_wq_work *prev_work = NULL;
 
@@ -1064,7 +1063,7 @@ static bool io_acct_cancel_pending_work(struct io_wq *wq,
 		work = container_of(node, struct io_wq_work, list);
 		if (!match->fn(work, match->data))
 			continue;
-		io_wq_remove_pending(wq, work, prev);
+		io_wq_remove_pending(wq, acct, work, prev);
 		raw_spin_unlock(&acct->lock);
 		io_run_cancel(work, wq);
 		match->nr_pending++;
Signature · 1 line
2.39.5
author maintainer
#104 lore raw

PATCH 97/731 io_uring/io-wq: cache work->flags in variable

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Max Kellermann <[email protected]>

[ Upstream commit 6ee78354eaa602002448f098b34678396d99043d ]

This eliminates several redundant atomic reads and therefore reduces the duration the surrounding spinlocks are held.

In several io_uring benchmarks, this reduced the CPU time spent in queued_spin_lock_slowpath() considerably:

io_uring benchmark with a flood of IORING_OP_NOP and IOSQE_ASYNC:

    38.86%     -1.49%  [kernel.kallsyms]  [k] queued_spin_lock_slowpath
     6.75%     +0.36%  [kernel.kallsyms]  [k] io_worker_handle_work
     2.60%     +0.19%  [kernel.kallsyms]  [k] io_nop
     3.92%     +0.18%  [kernel.kallsyms]  [k] io_req_task_complete
     6.34%     -0.18%  [kernel.kallsyms]  [k] io_wq_submit_work

HTTP server, static file:

    42.79%     -2.77%  [kernel.kallsyms]     [k] queued_spin_lock_slowpath
     2.08%     +0.23%  [kernel.kallsyms]     [k] io_wq_submit_work
     1.19%     +0.20%  [kernel.kallsyms]     [k] amd_iommu_iotlb_sync_map
     1.46%     +0.15%  [kernel.kallsyms]     [k] ep_poll_callback
     1.80%     +0.15%  [kernel.kallsyms]     [k] io_worker_handle_work

HTTP server, PHP:

    35.03%     -1.80%  [kernel.kallsyms]     [k] queued_spin_lock_slowpath
     0.84%     +0.21%  [kernel.kallsyms]     [k] amd_iommu_iotlb_sync_map
     1.39%     +0.12%  [kernel.kallsyms]     [k] _copy_to_iter
     0.21%     +0.10%  [kernel.kallsyms]     [k] update_sd_lb_stats

Stable-dep-of: 486ba4d84d62 ("io_uring/io-wq: do not use bogus hash value")

---
 io_uring/io-wq.c | 33 +++++++++++++++++++++------------
 io_uring/io-wq.h |  7 ++++++-
 2 files changed, 27 insertions(+), 13 deletions(-)
io_uring/io-wq.c +21 -12
index f7d09698e43ce..d1eaa3e39cd5f 100644
@@ -160,9 +160,9 @@ static inline struct io_wq_acct *io_get_acct(struct io_wq *wq, bool bound)
 }
 
 static inline struct io_wq_acct *io_work_get_acct(struct io_wq *wq,
-						  struct io_wq_work *work)
+						  unsigned int work_flags)
 {
-	return io_get_acct(wq, !(atomic_read(&work->flags) & IO_WQ_WORK_UNBOUND));
+	return io_get_acct(wq, !(work_flags & IO_WQ_WORK_UNBOUND));
 }
 
 static inline struct io_wq_acct *io_wq_get_acct(struct io_worker *worker)
@@ -452,9 +452,14 @@ static void __io_worker_idle(struct io_wq *wq, struct io_worker *worker)
 	}
 }
 
+static inline unsigned int __io_get_work_hash(unsigned int work_flags)
+{
+	return work_flags >> IO_WQ_HASH_SHIFT;
+}
+
 static inline unsigned int io_get_work_hash(struct io_wq_work *work)
 {
-	return atomic_read(&work->flags) >> IO_WQ_HASH_SHIFT;
+	return __io_get_work_hash(atomic_read(&work->flags));
 }
 
 static bool io_wait_on_hash(struct io_wq *wq, unsigned int hash)
@@ -484,17 +489,19 @@ static struct io_wq_work *io_get_next_work(struct io_wq_acct *acct,
 	struct io_wq *wq = worker->wq;
 
 	wq_list_for_each(node, prev, &acct->work_list) {
+		unsigned int work_flags;
 		unsigned int hash;
 
 		work = container_of(node, struct io_wq_work, list);
 
 		/* not hashed, can run anytime */
-		if (!io_wq_is_hashed(work)) {
+		work_flags = atomic_read(&work->flags);
+		if (!__io_wq_is_hashed(work_flags)) {
 			wq_list_del(&acct->work_list, node, prev);
 			return work;
 		}
 
-		hash = io_get_work_hash(work);
+		hash = __io_get_work_hash(work_flags);
 		/* all items with this hash lie in [work, tail] */
 		tail = wq->hash_tail[hash];
 
@@ -591,12 +598,13 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		/* handle a whole dependent link */
 		do {
 			struct io_wq_work *next_hashed, *linked;
-			unsigned int hash = io_get_work_hash(work);
+			unsigned int work_flags = atomic_read(&work->flags);
+			unsigned int hash = __io_get_work_hash(work_flags);
 
 			next_hashed = wq_next_work(work);
 
 			if (do_kill &&
-			    (atomic_read(&work->flags) & IO_WQ_WORK_UNBOUND))
+			    (work_flags & IO_WQ_WORK_UNBOUND))
 				atomic_or(IO_WQ_WORK_CANCEL, &work->flags);
 			wq->do_work(work);
 			io_assign_current_work(worker, NULL);
@@ -916,18 +924,19 @@ static void io_run_cancel(struct io_wq_work *work, struct io_wq *wq)
 	} while (work);
 }
 
-static void io_wq_insert_work(struct io_wq *wq, struct io_wq_acct *acct, struct io_wq_work *work)
+static void io_wq_insert_work(struct io_wq *wq, struct io_wq_acct *acct,
+			      struct io_wq_work *work, unsigned int work_flags)
 {
 	unsigned int hash;
 	struct io_wq_work *tail;
 
-	if (!io_wq_is_hashed(work)) {
+	if (!__io_wq_is_hashed(work_flags)) {
 append:
 		wq_list_add_tail(&work->list, &acct->work_list);
 		return;
 	}
 
-	hash = io_get_work_hash(work);
+	hash = __io_get_work_hash(work_flags);
 	tail = wq->hash_tail[hash];
 	wq->hash_tail[hash] = work;
 	if (!tail)
@@ -943,8 +952,8 @@ static bool io_wq_work_match_item(struct io_wq_work *work, void *data)
 
 void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
 {
-	struct io_wq_acct *acct = io_work_get_acct(wq, work);
 	unsigned int work_flags = atomic_read(&work->flags);
+	struct io_wq_acct *acct = io_work_get_acct(wq, work_flags);
 	struct io_cb_cancel_data match = {
 		.fn		= io_wq_work_match_item,
 		.data		= work,
@@ -963,7 +972,7 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work)
 	}
 
 	raw_spin_lock(&acct->lock);
-	io_wq_insert_work(wq, acct, work);
+	io_wq_insert_work(wq, acct, work, work_flags);
 	clear_bit(IO_ACCT_STALLED_BIT, &acct->flags);
 	raw_spin_unlock(&acct->lock);
 
io_uring/io-wq.h +6 -1
index b3b004a7b6252..d4fb2940e435f 100644
@@ -54,9 +54,14 @@ int io_wq_cpu_affinity(struct io_uring_task *tctx, cpumask_var_t mask);
 int io_wq_max_workers(struct io_wq *wq, int *new_count);
 bool io_wq_worker_stopped(void);
 
+static inline bool __io_wq_is_hashed(unsigned int work_flags)
+{
+	return work_flags & IO_WQ_WORK_HASHED;
+}
+
 static inline bool io_wq_is_hashed(struct io_wq_work *work)
 {
-	return atomic_read(&work->flags) & IO_WQ_WORK_HASHED;
+	return __io_wq_is_hashed(atomic_read(&work->flags));
 }
 
 typedef bool (work_cancel_fn)(struct io_wq_work *, void *);
Signature · 1 line
2.39.5
author maintainer
#105 lore raw

PATCH 98/731 io_uring/io-wq: do not use bogus hash value

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Max Kellermann <[email protected]>

[ Upstream commit 486ba4d84d62e92716cd395c4b1612b8ce70a257 ]

Previously, the hash variable was initialized with -1 and only updated by io_get_next_work() if the current work was hashed. Commit 60cf46ae6054 ("io-wq: hash dependent work") changed this to always call io_get_work_hash() even if the work was not hashed. This caused the hash != -1U check to always be true, adding some overhead for the hash->wait code.

This patch fixes the regression by checking the IO_WQ_WORK_HASHED flag.

Perf diff for a flood of IORING_OP_NOP with IOSQE_ASYNC:

    38.55%     -1.57%  [kernel.kallsyms]  [k] queued_spin_lock_slowpath
     6.86%     -0.72%  [kernel.kallsyms]  [k] io_worker_handle_work
     0.10%     +0.67%  [kernel.kallsyms]  [k] put_prev_entity
     1.96%     +0.59%  [kernel.kallsyms]  [k] io_nop_prep
     3.31%     -0.51%  [kernel.kallsyms]  [k] try_to_wake_up
     7.18%     -0.47%  [kernel.kallsyms]  [k] io_wq_free_work
Fixes 60cf46ae6054 ("io-wq: hash dependent work")
Cc Pavel Begunkov <[email protected]>
---
 io_uring/io-wq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/io-wq.c +3 -1
index d1eaa3e39cd5f..24f06fba43096 100644
@@ -599,7 +599,9 @@ static void io_worker_handle_work(struct io_wq_acct *acct,
 		do {
 			struct io_wq_work *next_hashed, *linked;
 			unsigned int work_flags = atomic_read(&work->flags);
-			unsigned int hash = __io_get_work_hash(work_flags);
+			unsigned int hash = __io_wq_is_hashed(work_flags)
+				? __io_get_work_hash(work_flags)
+				: -1U;
 
 			next_hashed = wq_next_work(work);
 
Signature · 1 line
2.39.5
author maintainer
#106 lore raw

PATCH 99/731 io_uring: check for iowq alloc_workqueue failure

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Pavel Begunkov <[email protected]>

[ Upstream commit 7215469659cb9751a9bf80e43b24a48749004d26 ]

alloc_workqueue() can fail even during init in io_uring_init(), check the result and panic if anything went wrong.

---
 io_uring/io_uring.c | 1 +
 1 file changed, 1 insertion(+)
io_uring/io_uring.c +1 -0
index f7acae5f7e1d0..573b3f542b82a 100644
@@ -3922,6 +3922,7 @@ static int __init io_uring_init(void)
 					  SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
 
 	iou_wq = alloc_workqueue("iou_exit", WQ_UNBOUND, 64);
+	BUG_ON(!iou_wq);
 
 #ifdef CONFIG_SYSCTL
 	register_sysctl_init("kernel", kernel_io_uring_disabled_table);
Signature · 1 line
2.39.5
author maintainer
#107 lore raw

PATCH 100/731 io_uring/net: improve recv bundles

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jens Axboe <[email protected]>

[ Upstream commit 7c71a0af81ba72de9b2c501065e4e718aba9a271 ]

Current recv bundles are only supported for multishot receives, and additionally they also always post at least 2 CQEs if more data is available than what a buffer will hold. This happens because the initial bundle recv will do a single buffer, and then do the rest of what is in the socket as a followup receive. As shown in a test program, if 1k buffers are available and 32k is available to receive in the socket, you'd get the following completions:

bundle=1, mshot=0
cqe res 1024
cqe res 1024
[...]
cqe res 1024

bundle=1, mshot=1
cqe res 1024
cqe res 31744

where bundle=1 && mshot=0 will post 32 1k completions, and bundle=1 && mshot=1 will post a 1k completion and then a 31k completion.

To support bundle recv without multishot, it's possible to simply retry the recv immediately and post a single completion, rather than split it into two completions. With the below patch, the same test looks as follows:

bundle=1, mshot=0
cqe res 32768

bundle=1, mshot=1
cqe res 32768

where mshot=0 works fine for bundles, and both of them post just a single 32k completion rather than split it into separate completions. Posting fewer completions is always a nice win, and not needing multishot for proper bundle efficiency is nice for cases that can't necessarily use multishot.

Fixes 2f9c9515bdfd ("io_uring/net: support bundles for recv")
---
 io_uring/net.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
io_uring/net.c +18 -0
index 50e8a3ccc9de9..e9bea0235c130 100644
@@ -76,6 +76,7 @@ struct io_sr_msg {
 	/* initialised and used only by !msg send variants */
 	u16				buf_group;
 	u16				buf_index;
+	bool				retry;
 	void __user			*msg_control;
 	/* used only for send zerocopy */
 	struct io_kiocb 		*notif;
@@ -187,6 +188,7 @@ static inline void io_mshot_prep_retry(struct io_kiocb *req,
 
 	req->flags &= ~REQ_F_BL_EMPTY;
 	sr->done_io = 0;
+	sr->retry = false;
 	sr->len = 0; /* get from the provided buffer */
 	req->buf_index = sr->buf_group;
 }
@@ -404,6 +406,7 @@ int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg);
 
 	sr->done_io = 0;
+	sr->retry = false;
 
 	if (req->opcode != IORING_OP_SEND) {
 		if (sqe->addr2 || sqe->file_index)
@@ -786,6 +789,7 @@ int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg);
 
 	sr->done_io = 0;
+	sr->retry = false;
 
 	if (unlikely(sqe->file_index || sqe->addr2))
 		return -EINVAL;
@@ -834,6 +838,9 @@ int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	return io_recvmsg_prep_setup(req);
 }
 
+/* bits to clear in old and inherit in new cflags on bundle retry */
+#define CQE_F_MASK	(IORING_CQE_F_SOCK_NONEMPTY|IORING_CQE_F_MORE)
+
 /*
  * Finishes io_recv and io_recvmsg.
  *
@@ -853,9 +860,19 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
 	if (sr->flags & IORING_RECVSEND_BUNDLE) {
 		cflags |= io_put_kbufs(req, *ret, io_bundle_nbufs(kmsg, *ret),
 				      issue_flags);
+		if (sr->retry)
+			cflags = req->cqe.flags | (cflags & CQE_F_MASK);
 		/* bundle with no more immediate buffers, we're done */
 		if (req->flags & REQ_F_BL_EMPTY)
 			goto finish;
+		/* if more is available, retry and append to this one */
+		if (!sr->retry && kmsg->msg.msg_inq > 0 && *ret > 0) {
+			req->cqe.flags = cflags & ~CQE_F_MASK;
+			sr->len = kmsg->msg.msg_inq;
+			sr->done_io += *ret;
+			sr->retry = true;
+			return false;
+		}
 	} else {
 		cflags |= io_put_kbuf(req, *ret, issue_flags);
 	}
@@ -1234,6 +1251,7 @@ int io_send_zc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	struct io_kiocb *notif;
 
 	zc->done_io = 0;
+	zc->retry = false;
 	req->flags |= REQ_F_POLL_NO_LAZY;
 
 	if (unlikely(READ_ONCE(sqe->__pad2[0]) || READ_ONCE(sqe->addr3)))
Signature · 1 line
2.39.5
author maintainer
#108 lore raw

PATCH 101/731 firmware: arm_ffa: Refactor addition of partition information into XArray

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Viresh Kumar <[email protected]>

[ Upstream commit 3c3d6767466ea316869c9f2bdd976aec8ce44545 ]

Move the common code handling addition of the FF-A partition information into the XArray as a new routine. No functional change.

Message-Id: <[email protected]>

Stable-dep-of: 46dcd68aacca ("firmware: arm_ffa: Unregister the FF-A devices when cleaning up the partitions")

---
 drivers/firmware/arm_ffa/driver.c | 47 +++++++++++++++----------------
 1 file changed, 22 insertions(+), 25 deletions(-)
drivers/firmware/arm_ffa/driver.c +22 -25
index 2c2ec3c35f156..353900c33eee3 100644
@@ -1384,11 +1384,30 @@ static struct notifier_block ffa_bus_nb = {
 	.notifier_call = ffa_bus_notifier,
 };
 
+static int ffa_xa_add_partition_info(int vm_id)
+{
+	struct ffa_dev_part_info *info;
+	int ret;
+
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
+	if (!info)
+		return -ENOMEM;
+
+	rwlock_init(&info->rw_lock);
+	ret = xa_insert(&drv_info->partition_info, vm_id, info, GFP_KERNEL);
+	if (ret) {
+		pr_err("%s: failed to save partition ID 0x%x - ret:%d. Abort.\n",
+		       __func__, vm_id, ret);
+		kfree(info);
+	}
+
+	return ret;
+}
+
 static int ffa_setup_partitions(void)
 {
 	int count, idx, ret;
 	struct ffa_device *ffa_dev;
-	struct ffa_dev_part_info *info;
 	struct ffa_partition_info *pbuf, *tpbuf;
 
 	if (drv_info->version == FFA_VERSION_1_0) {
@@ -1422,39 +1441,17 @@ static int ffa_setup_partitions(void)
 		    !(tpbuf->properties & FFA_PARTITION_AARCH64_EXEC))
 			ffa_mode_32bit_set(ffa_dev);
 
-		info = kzalloc(sizeof(*info), GFP_KERNEL);
-		if (!info) {
+		if (ffa_xa_add_partition_info(ffa_dev->vm_id)) {
 			ffa_device_unregister(ffa_dev);
 			continue;
 		}
-		rwlock_init(&info->rw_lock);
-		ret = xa_insert(&drv_info->partition_info, tpbuf->id,
-				info, GFP_KERNEL);
-		if (ret) {
-			pr_err("%s: failed to save partition ID 0x%x - ret:%d\n",
-			       __func__, tpbuf->id, ret);
-			ffa_device_unregister(ffa_dev);
-			kfree(info);
-		}
 	}
 
 	kfree(pbuf);
 
 	/* Allocate for the host */
-	info = kzalloc(sizeof(*info), GFP_KERNEL);
-	if (!info) {
-		/* Already registered devices are freed on bus_exit */
-		ffa_partitions_cleanup();
-		return -ENOMEM;
-	}
-
-	rwlock_init(&info->rw_lock);
-	ret = xa_insert(&drv_info->partition_info, drv_info->vm_id,
-			info, GFP_KERNEL);
+	ret = ffa_xa_add_partition_info(drv_info->vm_id);
 	if (ret) {
-		pr_err("%s: failed to save Host partition ID 0x%x - ret:%d. Abort.\n",
-		       __func__, drv_info->vm_id, ret);
-		kfree(info);
 		/* Already registered devices are freed on bus_exit */
 		ffa_partitions_cleanup();
 	}
Signature · 1 line
2.39.5
author maintainer
#109 lore raw

PATCH 102/731 firmware: arm_ffa: Unregister the FF-A devices when cleaning up the partitions

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sudeep Holla <[email protected]>

[ Upstream commit 46dcd68aaccac0812c12ec3f4e59c8963e2760ad ]

Both the FF-A core and the bus were in a single module before the
commit 18c250bd7ed0 ("firmware: arm_ffa: Split bus and driver into distinct modules").

The arm_ffa_bus_exit() takes care of unregistering all the FF-A devices. Now that there are 2 distinct modules, if the core driver is unloaded and reloaded, it will end up adding duplicate FF-A devices as the previously registered devices weren't unregistered when we cleaned up the modules.

Fix the same by unregistering all the FF-A devices on the FF-A bus during the cleaning up of the partitions and hence the cleanup of the module.

Fixes 18c250bd7ed0 ("firmware: arm_ffa: Split bus and driver into distinct modules")

Message-Id: <[email protected]>

---
 drivers/firmware/arm_ffa/bus.c    | 3 ++-
 drivers/firmware/arm_ffa/driver.c | 7 ++++---
 include/linux/arm_ffa.h           | 3 +++
 3 files changed, 9 insertions(+), 4 deletions(-)
drivers/firmware/arm_ffa/bus.c +2 -1
index dfda5ffc14db7..fa09a82b44921 100644
@@ -160,11 +160,12 @@ static int __ffa_devices_unregister(struct device *dev, void *data)
 	return 0;
 }
 
-static void ffa_devices_unregister(void)
+void ffa_devices_unregister(void)
 {
 	bus_for_each_dev(&ffa_bus_type, NULL, NULL,
 			 __ffa_devices_unregister);
 }
+EXPORT_SYMBOL_GPL(ffa_devices_unregister);
 
 bool ffa_device_is_valid(struct ffa_device *ffa_dev)
 {
drivers/firmware/arm_ffa/driver.c +4 -3
index 353900c33eee3..8aa05bbab5c8d 100644
@@ -1451,10 +1451,8 @@ static int ffa_setup_partitions(void)
 
 	/* Allocate for the host */
 	ret = ffa_xa_add_partition_info(drv_info->vm_id);
-	if (ret) {
-		/* Already registered devices are freed on bus_exit */
+	if (ret)
 		ffa_partitions_cleanup();
-	}
 
 	return ret;
 }
@@ -1464,6 +1462,9 @@ static void ffa_partitions_cleanup(void)
 	struct ffa_dev_part_info *info;
 	unsigned long idx;
 
+	/* Clean up/free all registered devices */
+	ffa_devices_unregister();
+
 	xa_for_each(&drv_info->partition_info, idx, info) {
 		xa_erase(&drv_info->partition_info, idx);
 		kfree(info);
include/linux/arm_ffa.h +3 -0
index 74169dd0f6594..53f2837ce7df4 100644
@@ -176,6 +176,7 @@ void ffa_device_unregister(struct ffa_device *ffa_dev);
 int ffa_driver_register(struct ffa_driver *driver, struct module *owner,
 			const char *mod_name);
 void ffa_driver_unregister(struct ffa_driver *driver);
+void ffa_devices_unregister(void);
 bool ffa_device_is_valid(struct ffa_device *ffa_dev);
 
 #else
@@ -188,6 +189,8 @@ ffa_device_register(const struct ffa_partition_info *part_info,
 
 static inline void ffa_device_unregister(struct ffa_device *dev) {}
 
+static inline void ffa_devices_unregister(void) {}
+
 static inline int
 ffa_driver_register(struct ffa_driver *driver, struct module *owner,
 		    const char *mod_name)
Signature · 1 line
2.39.5
author maintainer
#110 lore raw

PATCH 103/731 arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec

In reply to Greg Kroah-Hartman

6.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Macpaul Lin <[email protected]>

[ Upstream commit 76b35f59bbe66d3eda8a98021bc01f9200131f09 ]

This change fixes these dtbs_check errors for audio-codec:
1. pmic: 'mt6359codec' does not match any of the regexes: 'pinctrl-[0-9]+'
- Replace device node name to generic 'audio-codec'
2. pmic: regulators: 'compatible' is a required property
- Add 'mediatek,mt6359-codec' to compatible.

---
 arch/arm64/boot/dts/mediatek/mt6359.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt6359.dtsi +2 -1
index 150ad84d5d2b3..7b10f9c59819a 100644
@@ -15,7 +15,8 @@
 			#io-channel-cells = <1>;
 		};
 
-		mt6359codec: mt6359codec {
+		mt6359codec: audio-codec {
+			compatible = "mediatek,mt6359-codec";
 		};
 
 		regulators {
Signature · 1 line
2.39.5