* [PATCH 6.12 0000/1756] 6.12.119-rc1 review
@ 2026-11-18 14:35 Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0001/1756] KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM Greg Kroah-Hartman
` (998 more replies)
0 siblings, 999 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
This is the start of the stable review cycle for the 6.12.119 release.
There are 1756 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 Fri, 20 Nov 2026 14:55:44 +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.12.119-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.12.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 6.12.119-rc1
Li RongQing <lirongqing@baidu.com>
apparmor: avoid potential double free when remapping DFA tables
Justin Chen <justin.chen@broadcom.com>
net: bcmgenet: if UMAC was suspended in SW_RESET, restore it to SW_RESET
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: stop Tx NAPI before disabling the queues
Matthew Brown <matthew@bargrove.com>
ceph: fix leaked inode reference on writeback abort at umount
Baolin Liu <liubaolin@kylinos.cn>
fs/ntfs3: reject FS_IOC_SETFSLABEL on readonly mounts
Georgia Garcia <georgia.garcia@canonical.com>
apparmor: fix NULL pointer dereference in unpack_pdb
Zygmunt Krynicki <me@zygoon.pl>
apparmor: fail policy unpack on accept2 allocation failure
Shengjiu Wang <shengjiu.wang@nxp.com>
remoteproc: imx_dsp_rproc: Only reset carveout memory at RPROC_OFFLINE state
Bharath SM <bharathsm@microsoft.com>
smb: align durable reconnect v2 context to 8 byte boundary
Lijo Lazar <lijo.lazar@amd.com>
drm/amdgpu: Fix vbios build number parsing logic
Eduard Zingerman <eddyz87@gmail.com>
selftests/bpf: include limits.h needed for PATH_MAX directly
John Johansen <john.johansen@canonical.com>
apparmor: mitigate parser generating large xtables
John Johansen <john.johansen@canonical.com>
apparmor: fix: accept2 being specifie even when permission table is presnt
Christian Bruel <christian.bruel@foss.st.com>
arm64: dts: st: Use 128kB size for aliased GIC400 register access on stm32mp23 SoCs
Christian Bruel <christian.bruel@foss.st.com>
arm64: dts: st: Adjust interrupt-controller for stm32mp23 SoCs
Kuniyuki Iwashima <kuniyu@amazon.com>
nvme-tcp: fix use-after-free of netns by kernel TCP socket.
Arnaldo Carvalho de Melo <acme@redhat.com>
perf libunwind: Fixup conversion perf_sample->user_regs to a pointer
Namhyung Kim <namhyung@kernel.org>
perf tools: Fix compile error on sample->user_regs
Leo Yan <leo.yan@arm.com>
perf tools: Fix compilation error on arm64
Dan Carpenter <dan.carpenter@linaro.org>
platform/x86/amd/pmc: fix leak in probe()
Tony Ambardar <tony.ambardar@gmail.com>
libbpf: Fix accessing BTF.ext core_relo header
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
soc: qcom: pmic_glink: Drop redundant pg assignment before taking lock
Adam Ford <aford173@gmail.com>
phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings
Steven Price <steven.price@arm.com>
irqchip/gic-v3-its: Fix over allocation in itt_alloc_pool()
Hemanth Selam <hemanth.selam@gmail.com>
selftests/cgroup: set the test plan after the setup checks
Jakub Sitnicki <jakub@cloudflare.com>
net: lwtunnel: Drop skb metadata before LWT encapsulation
Szymon Wilczek <swilczek.lx@gmail.com>
fs/ntfs3: fix deadlock in ni_read_folio_cmpr
Brian Norris <briannorris@chromium.org>
PM: runtime: Only queue an idle check for RPM-linked suppliers (part 2)
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
nvmet-auth: reject incomplete DHCHAP messages
Shakeel Butt <shakeel.butt@linux.dev>
kernfs: avoid READ_ONCE() on a kgid_t in kernfs_new_node()
Damien Le Moal <dlemoal@kernel.org>
scsi: core: Fix additional sense code definition
Krzysztof Wilczyński <kwilczynski@kernel.org>
PCI/sysfs: Decouple acpi_index from the optional device name element
Linus Torvalds <torvalds@linux-foundation.org>
vdpa_sim: disable page faults around vringh_need_notify_iotlb()
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
mm: fix OOM killer inaccuracy on large many-core systems
SeongJae Park <sj@kernel.org>
mm/damon/reclaim: use parameter context correctly
Cheng Xu <chengyou@linux.alibaba.com>
RDMA/erdma: Use IRQ-safe XArray helpers for QP and CQ tables
Dominique Martinet <asmadeus@codewreck.org>
libbpf: fix cross-endian build with newer libbpf
Imre Kaloz <kaloz@kernel.org>
rtc: ds1685: do not sleep in the power-off handler
Imre Kaloz <kaloz@kernel.org>
rtc: ds1685: arm the wake-up alarm at power-off only if an alarm is set
Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
minix: reject rmdir of a directory with a corrupted link count
Jori Koolstra <jkoolstra@xs4all.nl>
Fix a drop_nlink warning in minix_rmdir
Jori Koolstra <jkoolstra@xs4all.nl>
Add error handling to minix filesystem for inode corruption detection
Nickolai Zeldovich <nickolai@csail.mit.edu>
fs_pin: do not trust the pin after a spurious wakeup in pin_kill()
Nickolai Zeldovich <nickolai@csail.mit.edu>
ucount: read the parent ucounts before dropping the rlimit count
Nickolai Zeldovich <nickolai@csail.mit.edu>
splice: retry tee() instead of returning 0 when it races
Zhiyu Zhang <zhiyuzhang999@gmail.com>
watch_queue: keep info_id separate from rcu_head
Xiao Liang <shaw.leon@gmail.com>
tun: drop batched packets while the device is down
John Johansen <john.johansen@canonical.com>
apparmor: advertise that sctp is being mediated
Jhonata Poma-Hansen <jhonata.poma@gmail.com>
netlink: check sk_rcvbuf before charging the dump skb
Eric Dumazet <edumazet@kernel.org>
openvswitch: use eth_type_trans_careful() in internal_dev_recv()
Eric Dumazet <edumazet@kernel.org>
net: use eth_type_trans_careful() in __dev_forward_skb2()
Sun Jian <sun.jian.kdev@gmail.com>
selftests/bpf: cover short IPv4/IPv6 inputs with adjust_room
Eric Dumazet <edumazet@kernel.org>
loopback: use eth_type_trans_careful()
Eric Dumazet <edumazet@kernel.org>
net: add eth_type_trans_careful()
Kyle Zeng <kylebot@openai.com>
tcp: initialize mapped children before route lookup
John Johansen <john.johansen@canonical.com>
apparmor: fix check SCTP bind, and connect permission checks
Kyle Zeng <kylebot@openai.com>
tcp: avoid double destroy in tcp_abort() of an unaccepted child
Rosen Penev <rosenp@gmail.com>
net: bgmac: fix TX DMA unmapping and slot cleanup
Kyle Zeng <kylebot@openai.com>
gro: do not GRO GSO packets with inconsistent payload
Jakub Kicinski <kuba@kernel.org>
eth: bnxt: hand XDP frags over to the copybreak skb
Jakub Kicinski <kuba@kernel.org>
eth: bnxt: free XDP frags when xdp_do_redirect() fails
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
apparmor: check connect permission for SCTP
Wentao Liang <vulab@iscas.ac.cn>
apparmor: Fix namespace reference leak in __aa_find_or_create_ns()
Maxime Bélair <maxime.belair@canonical.com>
apparmor: convert duplicated dfa transitions to match_char()
Maxime Bélair <maxime.belair@canonical.com>
apparmor: fix table_size() integer overflow on 32 bit
John Johansen <john.johansen@canonical.com>
apparmor: add additional flags to extended permission.
John Johansen <john.johansen@canonical.com>
apparmor: add support for 2^24 states to the dfa state machine.
Maxime Bélair <maxime.belair@canonical.com>
apparmor: report a label allocation failure as -ENOMEM
Jamie Nguyen <jamien@nvidia.com>
selftests: net: txtimestamp: fix out-of-bounds read in raw UDP checksum
Kunhai Dai <daikunhai@didiglobal.com>
blk-iocost: publish hweights as one atomic value
Bart Van Assche <bvanassche@acm.org>
block/blk-iocost: Inline iocg_lock() and iocg_unlock()
Bart Van Assche <bvanassche@acm.org>
block/blk-iocost: Split ioc_rqos_throttle()
Muchun Song <muchun.song@linux.dev>
block: introduce init_wait_func()
Muchun Song <muchun.song@linux.dev>
block: remove redundant explicit memory barrier from rq_qos waiter and waker
Chris Mason <mason@kernel.org>
rnbd-srv: publish the sess_dev at the end of OPEN
Chris Mason <mason@kernel.org>
rnbd-srv: fix use-after-free on two CLOSE messages
Josef Bacik <josef@toxicpanda.com>
block/rnbd-srv: drop the sess_dev kobject unlocked
Josef Bacik <josef@toxicpanda.com>
block/rnbd-srv: don't free the device on a sysfs error
Josef Bacik <josef@toxicpanda.com>
drbd: take req_lock to skip the initial sync as peer
Josef Bacik <josef@toxicpanda.com>
drbd: stop the start_resync timer of a dying device
Josef Bacik <josef@toxicpanda.com>
block: partitions/mac: compute the sectors in 64 bits
Josef Bacik <josef@toxicpanda.com>
blk-mq: exit the hctxs of a queue under tag_list_lock
Josef Bacik <josef@toxicpanda.com>
blk-mq: quiesce a queue that joins a quiesced tag set
Josef Bacik <josef@toxicpanda.com>
blk-mq: don't forget a timer the driver has restarted
Josef Bacik <josef@toxicpanda.com>
blk-mq: don't bring back flags of a completed request
Josef Bacik <josef@toxicpanda.com>
blk-mq: keep sharing tags fairly after a queue update
Josef Bacik <josef@toxicpanda.com>
block: don't lose the status of a failed flush request
Josef Bacik <josef@toxicpanda.com>
block: fix use-after-free of the disk in sync_bdevs()
Dominik Maier <dmnk@google.com>
xattr: always invoke cap_convert_nscap() for security.capability writes
Josef Bacik <josef@toxicpanda.com>
fork: Let nobody keep a task that may not come to life
Markus Probst <markus.probst@posteo.de>
rtc: s35390a: Read 24-hour mode on access
Alexandre Belloni <alexandre.belloni@bootlin.com>
rtc: s35390a: fix typo in comment
Nick Huang <sef1548@gmail.com>
rtc: s35390a: use u8 instead of char for register buffer
André Draszik <andre.draszik@linaro.org>
rtc: s35390a: drop needless struct s35390a::rtc member
Markus Probst <markus.probst@posteo.de>
rtc: s35390a: Fix alarm not disabling
Markus Probst <markus.probst@posteo.de>
rtc: s35390a: Add missing newline to dev_err
Joas Antonio dos Santos <joasantonio108@gmail.com>
net: mctp: free reassembly head skb when key_add fails on SOM
Linkui Xiao <xiaolinkui@kylinos.cn>
net: bridge: netlink: do not clear the vlan info dump error
Eric Dumazet <edumazet@google.com>
net: bridge: use atomic ops to read/change p->flags (III)
Eric Dumazet <edumazet@google.com>
bridge: add bridge_flags_bit enum
Danielle Ratson <danieller@nvidia.com>
bridge: Add internal flags for neigh_forward_grat
Eric Woudstra <ericwouds@gmail.com>
bridge: No DEV_PATH_BR_VLAN_UNTAG_HW for dsa foreign
Karol Kolacinski <karol.kolacinski@intel.com>
ice: E822: keep Tx timestamps disabled during offset calibration
Jacob Keller <jacob.e.keller@intel.com>
ice: set in_use only after preparing Tx timestamp index
Joas Antonio dos Santos <joasantonio108@gmail.com>
net: dcb: initialize PFC value before calling getpfccfg
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: restore the Tx coalescing setting when the rings are rebuilt
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: recover from a failed resume
Doug Berger <opendmb@gmail.com>
net: bcmgenet: revise suspend/resume
Doug Berger <opendmb@gmail.com>
net: bcmgenet: introduce bcmgenet_[r|t]dma_disable
Doug Berger <opendmb@gmail.com>
net: bcmgenet: consolidate dma initialization
Doug Berger <opendmb@gmail.com>
net: bcmgenet: remove dma_ctrl argument
Josef Bacik <josef@toxicpanda.com>
blk-throttle: make blkio.reset_stats reset I/O counts
Josef Bacik <josef@toxicpanda.com>
blk-throttle: pass the I/O counts of a dead group on
Li Lingfeng <lilingfeng3@huawei.com>
block: flush all throttled bios when deleting the cgroup
Josef Bacik <josef@toxicpanda.com>
blk-iolatency: flush enable_work after going offline
Josef Bacik <josef@toxicpanda.com>
blk-cgroup: don't free a blkg with its punt work queued
Josef Bacik <josef@toxicpanda.com>
blk-cgroup: fix root io.stat byte counts on 32-bit
Josef Bacik <josef@toxicpanda.com>
blk-throttle: don't truncate the cgroup v1 iops limits
Chris Mason <mason@kernel.org>
nvmet: don't clear sq->ctrl for a Connect with sqsize 0
Chris Mason <mason@kernel.org>
nvmet-rdma: fix double puts after a failed RDMA WRITE
Chris Mason <mason@kernel.org>
nvmet-rdma: disable interrupts under rsp_wr_wait_lock
Chris Mason <mason@kernel.org>
nvmet-rdma: flush nvmet-wq on module exit
Josef Bacik <josef@toxicpanda.com>
nvme-loop: don't BUG() if a scan runs beside a reset
Josef Bacik <josef@toxicpanda.com>
nvmet-tcp: don't read a removed port at Connect time
Josef Bacik <josef@toxicpanda.com>
nvmet: fix NULL dereference in debugfs host_traddr
Josef Bacik <josef@toxicpanda.com>
nvmet-tcp: stop listening when a port is removed
Josef Bacik <josef@toxicpanda.com>
nvmet-auth: take only AUTH_Negotiate for a negotiation
Josef Bacik <josef@toxicpanda.com>
nvmet: don't truncate the length of big discards
Chaitanya Kulkarni <kch@nvidia.com>
nvmet: ignore discard return value
Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
kdb: unify CMD_BUFLEN definition into kdb_private.h
Rongzheng Wang <testwrzwrz@gmail.com>
nvmet: use the enabled transport when disabling a port
Qing Zhang <diasyzhang@tencent.com>
nvmet: protect nvmet_ports_list with nvmet_config_sem
Avi Weiss <thnkslprpt@gmail.com>
nvmet: prevent double-free after metadata SGL allocation failure
Andrea Parri <parri.andrea@gmail.com>
nvmet: zns: reject a NUMD whose byte count wraps
bui duc phuc <phucduc.bui@gmail.com>
ASoC: xilinx: formatter_pcm: Fix read-modify-write of AUD_CTRL in hw_params
Sicong Huang <congei42@163.com>
nfp: flower: fix use-after-free in neighbour update work
Peter Morrow <pdmorrow@gmail.com>
net/mlx4: always create the eth and ib auxiliary devices
Feng Yang <yangfeng@kylinos.cn>
bpf: Fix out-of-bounds btf->types write for split BTF
Ömer Mete Kaya <omermetekaya0@gmail.com>
usbnet: fix EVENT_RX_PAUSED race in usbnet_skb_return()
Florian Fainelli <f.fainelli@gmail.com>
net: dsa: mv88e6xxx: fix 6351 family statistics snapshot
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: don't disable hardirqs in fdma tx clear path
Fernando Fernandez Mancera <fmancera@suse.de>
devlink: region: fix snapshot id leak on kernel-allocated ids
Daniel Machon <daniel.machon@microchip.com>
net: microchip: fdma: fix DCB corruption under sustained load
Daniel Machon <daniel.machon@microchip.com>
net: microchip: fdma: use little-endian types for descriptor fields
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: release the in-flight slot of a stale TX skb
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: fix the DB dataptr of frames from ndo_xdp_xmit
Harkirat Gill <harkirat.gill@amd.com>
drm/amdgpu: re-enable GFXOFF for compute on GFX12
Florian Fainelli <florian.fainelli@broadcom.com>
perf print_insn: Include sys/types.h for ssize_t
Paul Moses <p@1g4.org>
perf mmap: Preserve the consumed cursor in forward mode
Paul Moses <p@1g4.org>
perf mmap: Use the head selected by read_init
Len Brown <len.brown@intel.com>
x86_energy_perf_policy: Cleanup: Check fseek() in VM path
Len Brown <len.brown@intel.com>
x86_energy_perf_policy: Fix optarg keyword matching
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: do not warn on MAC entries that are not port destined
Daniel Machon <daniel.machon@microchip.com>
net: lan966x: do not inject uninitialised bytes past skb->len
Dudu Lu <phx0fer@gmail.com>
net: xps: bound the cleanup loop by the old map's num_tc
Allison Henderson <achender@kernel.org>
net/rds: do not initialize transports after rds_init() failed
Allison Henderson <achender@kernel.org>
net/rds: do not fail init when CONFIG_SYSCTL=n
Cheng Yongkang <teel4res@gmail.com>
net: tun: hold napi_mutex when deleting NAPI in tun_detach_all()
Sally Marcher <me@gry.sh>
ALSA: usb-audio: Add correct datainterval in the quirks-table for Microbook II
HyeongJun An <sammiee5311@gmail.com>
ALSA: pcmtest: Honor the enable parameter
Nicolai Buchwitz <nb@tipi-net.de>
net: usb: cdc_mbim: don't enable BHs in tx_fixup under netpoll
Nicolai Buchwitz <nb@tipi-net.de>
net: usb: cdc_ncm: don't enable BHs in tx_fixup under netpoll
Binbin Deng <18983559317@163.com>
net: atlantic: Unregister before clearing RXNFC rules
Paolo Abeni <pabeni@redhat.com>
gtp: hold RCU in gtp_genl_send_echo_req()
Qingfang Deng <qingfang.deng@linux.dev>
pppoe: drop discovery frames with no MAC header
Tung Nguyen <tung.quang.nguyen@est.tech>
tipc: fix refcount panic in tipc_rcv() when receiving shared skb
Jerome Brunet <jbrunet@baylibre.com>
clk: cdce925: Size the PLL child name buffer for any int
bui duc phuc <phucduc.bui@gmail.com>
clk: lmk04832: Handle reset GPIO lookup errors
Eric Dumazet <edumazet@kernel.org>
ipmr: clear skb->cb[] in reg_vif_xmit()
alex todadze <todadzealexi19@proton.me>
net: stmmac: fix rx checksum offload with extended descriptors
Dudu Lu <phx0fer@gmail.com>
net/sched: taprio: unwind the netdevice notifier if register_qdisc() fails
Alexandre Cassen <acassen@corp.free.fr>
net/sched: act_api: inherit filter offload flags only on new actions
Dudu Lu <phx0fer@gmail.com>
net/sched: gred: keep the qdisc lock while updating the table
Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: es*: Modify the registers related to ALC RECOVERY
Ravi Hothi <ravi.hothi@oss.qualcomm.com>
ASoC: codecs: wsa883x: Fix VI sense port channel count
Ravi Hothi <ravi.hothi@oss.qualcomm.com>
ASoC: codecs: wsa884x: Fix VI sense port channel count
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
ASoC: codecs: wsa883x: disable runtime PM on unbind
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
ASoC: codecs: wsa884x: disable runtime PM on unbind
Hungyu Lin <dennylin0707@gmail.com>
thermal: Fix CPU mask truncation in power limit trace event
Sasha Levin <sashal@kernel.org>
selftests/thermal: allow cross builds of the Intel tests
Aleksei Oladko <aleksey.oladko@virtuozzo.com>
selftests: fix ARCH normalization to handle command-line argument
TJ Adams <tadamsjr@google.com>
block: advance iterator after copy-in for SG_DXFER_TO_FROM_DEV
Waiman Long <longman@redhat.com>
cgroup/cpuset: Make sure compute_partition_effective_cpumask() is only called for valid partition
Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
libceph: reject bad connect_seq in msgr1 READY reply
Yogesh Gaur <yogeshgaur.83@gmail.com>
ceph: don't keep a mon_addr string that failed to parse
Xiang Mei <xmei5@asu.edu>
ceph: fix off-by-one NUL termination in decode_encrypted_symlink()
Tal Zussman <tz2294@columbia.edu>
ceph: don't clear write_congested when collecting folios
Tal Zussman <tz2294@columbia.edu>
ceph: fix writeback_count leak when a bounce page allocation fails
Matthew Wilcox (Oracle) <willy@infradead.org>
ceph: Convert ceph_move_dirty_page_in_page_array() to move_dirty_folio_in_page_array()
Tal Zussman <tz2294@columbia.edu>
ceph: fix error handling when the OSD client is stopping in ceph_submit_write()
Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
ceph: fix generic/421 test failure
Alex Markuze <amarkuze@redhat.com>
ceph: fix page vector leak on encrypted netfs read EIO path
Xiubo Li <xiubo.li@clyso.com>
ceph: mark the superblock active after mounting
Max Kellermann <max.kellermann@ionos.com>
ceph: remove unused field `i_cap_migration_resv`
Henry Martin <bsdhenrymartin@gmail.com>
netlink: fix out-of-bounds bitmap access clearing stale mc groups
HyeongJun An <sammiee5311@gmail.com>
ALSA: pcmtest: Reject invalid fill_mode values
Cen Zhang <zzzccc427@gmail.com>
ALSA: ump: Drain sequencer callbacks before freeing their client
Takashi Iwai <tiwai@suse.de>
ALSA: seq: Notify UMP EP and FB changes
Takashi Iwai <tiwai@suse.de>
ALSA: seq: Allow system notification in atomic
Dimitris Charisis <dchar@cslab.ece.ntua.gr>
maple_tree: fix maple_range_64 crashes in RCU mode
Pedro Falcato <pfalcato@suse.de>
maple_tree: Replace mt_free_one() with kfree()
Pedro Falcato <pfalcato@suse.de>
maple_tree: Use kfree_rcu in ma_free_rcu
Ren Tamura <ren.tamura.oss@gmail.com>
tools/cgroup: sum shrinker object counts across NUMA nodes
Lorenzo Stoakes (ARM) <ljs@kernel.org>
ALSA: us122l: mark hwdep mappings VM_MIXEDMAP
Ting-Han Hou <ue081723@gmail.com>
scripts/gdb: fix stack depot out-of-bounds diagnostic
Ting-Han Hou <ue081723@gmail.com>
scripts/gdb: fix radix tree lookup pointer handling
Ilya Leoshkevich <iii@linux.ibm.com>
scripts/gdb/radix-tree: add lx-radix-tree-command
Avi Weiss <thnkslprpt@gmail.com>
profiling: fix sampling step on 64-bit big-endian systems
Edward Adam Davis <eadavis@sina.com>
kernel/reboot: avoid potential deadlocks during suspension
Aditya Sharma <adi.sharma@zohomail.in>
bpf: Remove nmi_uaccess_okay() check in bpf_send_signal_common()
Ayushman Rout <ayushmanrout27@gmail.com>
bpf: Use memmove() to load bytes from an skb and an xdp_buff
Feng Yang <yangfeng@kylinos.cn>
bpf: Propagate btf_add_type() errors in btf_check_all_metas()
Haotian Zhang <vulab@iscas.ac.cn>
scsi: elx: libefc: Fix resource leak in efcport_init() error path
Dudu Lu <phx0fer@gmail.com>
net/sched: etf: initialise the sock_exterr_skb before filling it
Nandor Kracser <nandor@riptides.io>
tls: avoid field-spanning write when copying crypto info
Greg Thelen <gthelen@google.com>
selftests/net: tcp_mmap: remove unused -k option and keepflag
Allison Henderson <achender@kernel.org>
net/rds: keep the connected peer's scope id apart from the bound one
Allison Henderson <achender@kernel.org>
net/rds: include the scope id in the sendmsg connection cache check
Gal Pressman <gal@nvidia.com>
net/mlx5e: IPsec, Fix out-of-bounds comparison of neighbour keys
Eric Dumazet <edumazet@kernel.org>
net: fix frag_list leak in skb_segment_list() error path
Daniel Machon <daniel.machon@microchip.com>
net: sparx5: fix tx DCB index drift in fdma xmit
Daniel Machon <daniel.machon@microchip.com>
net: sparx5: activate FDMA tx in start()
Daniel Machon <daniel.machon@microchip.com>
net: sparx5: split sparx5_fdma_{start(),stop()}
Daniel Machon <daniel.machon@microchip.com>
net: sparx5/lan969x: do not read past skb->len when injecting a frame
Florian Fuchs <fuchsfl@gmail.com>
ALSA: sh: aica: Fix spu_memset() stride
Gregory Price (Meta) <gourry@gourry.net>
cgroup/cpuset: check effective mems for a movable-only configuration
Xingyuan Mo <hdthky0@gmail.com>
sctp: reject forged cookie peer_addr with unknown address family
Jiale Yao <yaojiale02@163.com>
regulator: irq: freeze deferred hardware access during suspend
Marco Crivellari <marco.crivellari@suse.com>
regulator: irq_helper: replace use of system_wq with system_dfl_wq
Steven Rostedt <rostedt@goodmis.org>
cpuidle: haltpoll: Only define guest_halt_poll_ns tracepoint when used
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: raven: Fix memory leak in acp3x_dma_close()
Michail Andreas Michalopoulos <mike.michalo@gmail.com>
ksmbd: select CRYPTO_AES
Ivan Hu <ivan.hu@canonical.com>
ACPICA: Initialize parser_state.aml_end in acpi_install_method()
Nickolai Zeldovich <nickolai@csail.mit.edu>
nsproxy: Fix cred leak in the error path of prepare_nsset()
Avi Weiss <thnkslprpt@gmail.com>
signal: skip blocked signals in dequeue_synchronous_signal()
Karl Mehltretter <kmehltretter@gmail.com>
netfs: Restore selective debug mask handling
Tianyi Chen <hi@tychen.cc>
eventpoll: propagate wakeup source creation failure in ep_modify()
Nickolai Zeldovich <nickolai@csail.mit.edu>
proc/kcore: advance the vmalloc retry by the last copy, not the total
Marek Szyprowski <m.szyprowski@samsung.com>
ASoC: wm8994: follow AIF clock source changes in MCLK gating
Binbin Deng <18983559317@163.com>
tipc: fix use-after-free of broadcast reception link at node release
Rand Deeb <rand.sec96@gmail.com>
ata: libata-core: Ignore forced transfer modes the host does not support
Travis Howard <thoward@lafayetteinstrument.com>
tg3: Add Datto SIRIS 5 1U Server to restart AER quirk table
Eric Dumazet <edumazet@kernel.org>
net: shrink the payload-only part of skb dataref to one bit
Tianyi Gao <tianyi@cloudflare.com>
veth: schedule the peer's NAPI after XDP_TX when only GRO is enabled
Daniel Machon <daniel.machon@microchip.com>
net: sparx5/lan969x: do not clobber the PSFP cycle timer update period
Willem de Bruijn <willemb@google.com>
virtio-net: fix frag overflow in big packets receive
Eric Joyner <eric.joyner@amd.com>
ionic: free port_info when probe fails after the port is set up
Nikhil P. Rao <nikhil.rao@amd.com>
ionic: fix port_info use-after-free on firmware recovery
Sivansh Gupta <sivansh.gupta@oss.qualcomm.com>
mailbox: qcom-cpucp: read mbox hardware register using readq()
Deepti Jaggi <deepti.jaggi@oss.qualcomm.com>
mailbox: qcom-cpucp: Add support for Nord CPUCP mailbox controller
Daniel Wagner <wagi@kernel.org>
nvme-fabrics: clear the poll map if no poll queues are mapped
Daniel Wagner <wagi@kernel.org>
nvme-fabrics: limit each queue type to the number of online CPUs
Daniel Wagner <wagi@kernel.org>
nvme-fabrics: reset io_queues before computing the queue mapping
James Clark <james.clark@linaro.org>
perf cs-etm: Don't add global v0 HW_IDs to unformatted queues
Arnaldo Carvalho de Melo <acme@redhat.com>
perf cs-etm: Bounds-check CPU in cs_etm__get_queue()
Namhyung Kim <namhyung@kernel.org>
perf c2c: Fix memory leaks on output fields
Waldemar Brodkorb <wbx@openadk.org>
sh: Select BINFMT_FLAT_NO_DATA_START_OFFSET for !MMU
Marek Szyprowski <m.szyprowski@samsung.com>
ASoC: samsung: midas_wm1811: run FLL1 at the AIF1 configured rate when idle
Marek Szyprowski <m.szyprowski@samsung.com>
ASoC: wm8994: fix MCLK index used for setting MCLK rate
Marek Szyprowski <m.szyprowski@samsung.com>
ASoC: wm8994: don't lose the AIF clock ratio when staying at 32kHz SYSCLK
Marek Szyprowski <m.szyprowski@samsung.com>
ASoC: wm8994: fix MCLK gating for AIF clocks sourced from MCLK2
HyeongJun An <sammiee5311@gmail.com>
selftests: ALSA: pcmtest: Compare all captured bytes in ni_capture
Alexandre Cassen <acassen@corp.free.fr>
net/mlx5: HWS, fix modify header pattern compare on big-endian
Anil Kaushik <anilkaushikwireless@gmail.com>
gtp: hold RCU for the device lookup when adding a PDP context
Anil Kaushik <anilkaushikwireless@gmail.com>
gtp: set a valid genl command in PDP context get and dump replies
HyeongJun An <sammiee5311@gmail.com>
selftests: ALSA: pcmtest: Make room for the longest fill pattern
HyeongJun An <sammiee5311@gmail.com>
selftests: ALSA: pcmtest: Check the frame count of each transfer
Takashi Iwai <tiwai@suse.de>
platform/x86: ibm_rtl: Fix potential OOB read at signature search
Jiale Yao <yaojiale02@163.com>
Drivers: hv: vmbus: Check ACPI companion before use
Cen Zhang <zzzccc427@gmail.com>
ocfs2: initialize status waiters before publishing them
Joseph Qi <joseph.qi@linux.alibaba.com>
ocfs2: reserve xattr value tree metadata only once
Carolina Jubran <cjubran@nvidia.com>
net: skbuff: don't copy alloc_cpu in skb header copies
Michail Andreas Michalopoulos <mike.michalo@gmail.com>
ksmbd: reject FILE_ATTRIBUTE_TEMPORARY on directories
Mohammed Alquraini <mohammed.saad.alquraini@gmail.com>
ksmbd: reject foreign RPC pipe handles on IPC$ read and write
Namjae Jeon <linkinjeon@kernel.org>
ksmbd: fix fd_limit accounting across durable reconnects
ChenXiaoSong <chenxiaosong@kylinos.cn>
smb/server: fix trailing period in generated short names
Henry Hu <huhai@kylinos.cn>
ksmbd: report IPv4 and IPv6 addresses independently in iface query
ZhangGuoDong <zhangguodong@kylinos.cn>
smb: move some duplicate definitions to common/smb2pdu.h
ChenXiaoSong <chenxiaosong@kylinos.cn>
smb: move create_durable_rsp_v2 to common/smb2pdu.h
ChenXiaoSong <chenxiaosong@kylinos.cn>
smb: move create_durable_handle_reconnect_v2 to common/smb2pdu.h
ChenXiaoSong <chenxiaosong@kylinos.cn>
smb: move create_durable_req_v2 to common/smb2pdu.h
ZhangGuoDong <zhangguodong@kylinos.cn>
smb: move smb_sockaddr_in and smb_sockaddr_in6 to common/smb2pdu.h
Pali Rohár <pali@kernel.org>
cifs: Update description about ACL permissions
Henry Hu <huhai@kylinos.cn>
ksmbd: fix invalid Next offset in interface info replies
Henry Hu <huhai@kylinos.cn>
ksmbd: fix unlocked IPv6 addr_list walk in fsctl_query_iface_info_ioctl()
Henry Hu <huhai@kylinos.cn>
ksmbd: fix link speed query in fsctl_query_iface_info_ioctl()
Mingming Cao <mmc@linux.ibm.com>
ibmveth: wait for the RX poll to return before freeing the RX queue
Mingming Cao <mmc@linux.ibm.com>
ibmveth: wait for in-flight transmits in ibmveth_close()
Mingming Cao <mmc@linux.ibm.com>
ibmveth: return the error when set_channels cannot add TX queues
Mingming Cao <mmc@linux.ibm.com>
ibmveth: fix netpoll races with RX replenish
Ovidiu Panait <ovidiu.panait.rb@renesas.com>
net: stmmac: Track the TX DMA threshold per queue
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
net: stmmac: Correct usage of maximum queue number macros
Furong Xu <0x1207@gmail.com>
net: stmmac: Drop useless code related to ethtool rx-copybreak
Jiale Yao <yaojiale02@163.com>
team: reject CAN, IEEE 802.15.4 and 6LoWPAN devices in team_port_add
Ido Schimmel <idosch@nvidia.com>
ipv6: Hold RCU when emitting route hardware flags notification
Rosen Penev <rosenp@gmail.com>
net: phy: marvell: keep WOL_EIE across interrupt reconfiguration
Myeonghun Pak <mhun512@gmail.com>
platform/x86: gpd pocket fan: Cancel work before releasing GPIOs
Eric Dumazet <edumazet@kernel.org>
ipv6: account route exceptions to the netns of their dst
Sagi Maimon <maimon.sagi@gmail.com>
net: axienet: release every RX buffer in axienet_dma_bd_release()
Ido Schimmel <idosch@nvidia.com>
bridge: mcast: Delete empty MDB entry when port group creation fails
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: fix network filter lookup and wake filter pair allocation
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: account for offload header in TX short packet padding
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: fix OF node reference leak for phy_dn
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: validate minimum RX packet size in bcmasp_rx_poll()
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: unmap previous DMA mappings on TX map failure
Florian Fainelli <florian.fainelli@broadcom.com>
net: bcmasp: fix mib counters struct alignment with ethtool stats
Myeonghun Pak <mhun512@gmail.com>
net: hix5hd2: serialize timeout recovery with interface teardown
Karl Mehltretter <kmehltretter@gmail.com>
net: phy: realtek: restore RTL8211F RGMII delays on resume
Vladimir Oltean <vladimir.oltean@nxp.com>
net: phy: realtek: create rtl8211f_config_rgmii_delay()
Marek Vasut <marek.vasut@mailbox.org>
net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
Michael Klein <michael@fossekall.de>
net: phy: realtek: add RTL8211F register defines
Daniel Braunwarth <daniel.braunwarth@kuka.com>
net: phy: realtek: Add support for WOL magic packet on RTL8211F
Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
net: phy: realtek: disable PHY-mode EEE
Heiner Kallweit <hkallweit1@gmail.com>
net: phy: realtek: use string choices helpers
Heiner Kallweit <hkallweit1@gmail.com>
net: phy: move realtek PHY driver to its own subdirectory
Anirudh Virdi <avirdi@redhat.com>
net: qede: initialize extack in qede_flow_spec_to_rule()
Binbin Deng <18983559317@163.com>
octeontx2: Fix use-after-free of qos node in delete path
Rishikesh Jethwani <rjethwani@purestorage.com>
tls: device: protect async RX resync state during device-down
Eric Dumazet <edumazet@kernel.org>
tcp: tcp_metrics: use the socket netns, not the dst device netns
Fernando Fernandez Mancera <fmancera@suse.de>
net: openvswitch: drop IP fragments on SCTP set action
Fernando Fernandez Mancera <fmancera@suse.de>
net: openvswitch: skip IPv4 later fragments on TCP/UDP set actions
Linus Torvalds <torvalds@linux-foundation.org>
vhost: vringh: use get_user()/put_user() for IOTLB 16-bit accesses
Rob Herring (Arm) <robh@kernel.org>
dt-bindings: clock: mediatek: Add MT8516 fallbacks
HyeongJun An <sammiee5311@gmail.com>
ASoC: cs42l56: Remove the ADC Mute Switch control
Liang Hao <haohlliang@gmail.com>
timers: Clear pending_map on CPU hotplug
Karl Mehltretter <kmehltretter@gmail.com>
rtc: class: Make the time32 hctosys limit configurable
Baek Kyu, Kim <pocj8ur4in@gmail.com>
rtc: mpfs: Fix alarm register word order
James Hilliard <james.hilliard1@gmail.com>
net: stmmac: avoid duplicate XSK TX completions
Yongzhao Chen <yongzhao.derek@gmail.com>
net: phy: qca83xx: read resolved QCA8337 link status
Matthieu Baerts (NGI0) <matttbe@kernel.org>
mptcp: options: dss: avoid printing uninit csum
Matthieu Baerts (NGI0) <matttbe@kernel.org>
mptcp: options: mpc: avoid printing uninit data
Pengfei Zhang <zhangfeionline@gmail.com>
net: stmmac: xgmac: do not treat TBU as a TX event
Li RongQing <lirongqing@baidu.com>
RDMA/mlx5: Fix CQ resize destination index mask
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: act_api: reject duplicate actions in a batch
Fan Wu <wufan@kernel.org>
ipe: fix enforcement audit
Manuel Ebner <manuelebner@mailbox.org>
ipe: fix invalid sgid value in audit event documentation
Gregory Price (Meta) <gourry@gourry.net>
cgroup/cpuset: use mems_allowed_seq when checking a policy nodemask
Li RongQing <lirongqing@baidu.com>
block, bfq: initialize active lists for all actuators
Cen Zhang <zzzccc427@gmail.com>
ALSA: aloop: Keep the timer source alive until card release
Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
pNFS/flexfiles: make pg_init retry loops killable
Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
nfsv4/pnfs: use the MDS authflavor for data server connections
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcm: Protect channel-map reads against runtime detach
Cen Zhang <zzzccc427@gmail.com>
ALSA: jack: Pin the module while debugfs files are open
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcm: Remove channel-map controls before freeing substreams
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcmtest: Pin the module while pattern files are open
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
nios2: ksyms: Declare __mulsi3 export
Sung Byeongchan <tjdqudcks0424@naver.com>
netfilter: xt_dccp: handle reserved options as single-byte
Shuangfeng He <huangya90@gmail.com>
netfilter: flowtable: use the vlan id, not the full tci, in the tuple key
Julian Anastasov <ja@ssi.bg>
ipvs: fix more races around the overload flag
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
netfilter: nf_conntrack: avoid truncating IPv6 nexthdr offset
Alok Tiwari <alok.a.tiwari@oracle.com>
octeontx2-af: Fix CQ enable state tracking after AQ writes
Cen Zhang <zzzccc427@gmail.com>
ALSA: oss: Keep emulation modules loaded until object teardown
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcm: Protect the unregister notifier traversal
Qiliang Yuan <odys.yuan@gmail.com>
selftests/bpf: Run the cpumask map insert tests only for the test task
KaFai Wan <kafai.wan@linux.dev>
selftests/bpf: Use _exit() in uprobe_multi_test clone-ed child
Troy Mitchell <troy.mitchell@linux.dev>
dt-bindings: vendor-prefixes: Add Sensylink
Serhat Kumral <serhatkumral1@gmail.com>
RDMA/usnic: Bound buffer size to sizeof(buf) in flowinfo_read()
Zhiwei Zhang <202275009@qq.com>
RDMA/rxe: Clear pkt->qp before the early drop exits in rxe_rcv()
HyeongJun An <sammiee5311@gmail.com>
ASoC: tlv320aic32x4: Fix definition of TAS2505 HP Driver Gain Volume control
Dmitry Torokhov <dmitry.torokhov@gmail.com>
ASoC: tlv320aic32x4: clean up driver code formatting and logging
Dmitry Torokhov <dmitry.torokhov@gmail.com>
ASoC: tlv320aic32x4: move regmap_config into i2c and spi drivers
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: sta350: Fix definition of limiter threshold controls
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: sta32x: Fix definition of limiter threshold controls
Serhat Kumral <serhatkumral1@gmail.com>
RDMA/srp: Avoid reading uninitialized has_port on srp_parse_in() failure
Leon Romanovsky <leon@kernel.org>
RDMA/core: Reject LAG selection when source MAC lookup fails
Leon Romanovsky <leon@kernel.org>
RDMA/core: Free unpublished port statistics after initial-read failure
Leon Romanovsky <leon@kernel.org>
RDMA/core: Preserve the selected source GID on failed AH modification
Igor Velkov <iav@iav.lv>
power: supply: gpio-charger: Report discharging without input power
Aleksandr Nogikh <nogikh@google.com>
usb: gadget: dummy_hcd: prevent unbind via sysfs
Igor Skalkin <igor.skalkin@oss.qualcomm.com>
usb: gadget: dummy_hcd: fix SuperSpeed ep0 maxpacket
Alexei Starovoitov <ast@kernel.org>
bpf: Use memmove() to store bytes in an xdp_buff
Josef Bacik <josef@toxicpanda.com>
bpf: Use memmove() to store bytes in an skb
Josef Bacik <josef@toxicpanda.com>
bpf: Use the socket of a sk_lookup test run under RCU
Paul Chaignon <paul.chaignon@gmail.com>
bpf: Craft non-linear skbs in BPF_PROG_TEST_RUN
Paul Chaignon <paul.chaignon@gmail.com>
bpf: Reorder bpf_prog_test_run_skb initialization
Paul Chaignon <paul.chaignon@gmail.com>
bpf: Refactor cleanup of bpf_prog_test_run_skb
Mahe Tardy <mahe.tardy@gmail.com>
bpf: fix cgroup_skb prog test run direct packet access
Josef Bacik <josef@toxicpanda.com>
bpf: Keep the symbols of a program until it has ended
Alexei Starovoitov <ast@kernel.org>
bpf: Don't take a program with a target program for an iterator
Florian Westphal <fw@strlen.de>
netfilter: nft_compat: restrict raw table targets/matches
Florian Westphal <fw@strlen.de>
selftests: netfilter: fix return value in zone subtest
Florian Westphal <fw@strlen.de>
netfilter: conntrack: fix unlikely UaF in gc worker
Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
power: supply: qcom_battmgr: report full batteries
Alexei Starovoitov <ast@kernel.org>
bpf: Don't take an extension for a writable raw tracepoint program
Josef Bacik <josef@toxicpanda.com>
bpf: Don't take an extension for an iterator program
Josef Bacik <josef@toxicpanda.com>
bpf: Don't bind a program to a netdev that goes away
Josef Bacik <josef@toxicpanda.com>
bpf: Fix stale offload->prog pointer after realloc
Josef Bacik <josef@toxicpanda.com>
bpf: Bound the nesting that the BTF show code follows
Alexei Starovoitov <ast@kernel.org>
bpf: Clear sk_refcnt of a clone before its storage is linked
Josef Bacik <josef@toxicpanda.com>
bpf: Update the SRH state if End.B6 fails late
Josef Bacik <josef@toxicpanda.com>
bpf: Pull the inner header for End.DT6 in End.BPF
Josef Bacik <josef@toxicpanda.com>
bpf: Validate the SRH which End.DT6 uncovers in End.BPF
Josef Bacik <josef@toxicpanda.com>
bpf: Read the probe of a perf event under event_mutex
Tao Chen <chen.dylane@linux.dev>
bpf: Add show_fdinfo for perf_event
Josef Bacik <josef@toxicpanda.com>
bpf: Don't let bpf_skb_adjust_room() use up the MSS
Jakub Sitnicki <jakub@cloudflare.com>
bpf: Make bpf_skb_adjust_room metadata-safe
Jakub Sitnicki <jakub@cloudflare.com>
net: Helper to move packet data and metadata after skb_push/pull
Josef Bacik <josef@toxicpanda.com>
bpf: Look at all 64 bits of a BPF_JSET mask on 32-bit
Josef Bacik <josef@toxicpanda.com>
bpf: Reject sleepable programs for task_vma iterator
Joonhoe Kim <26rote@gmail.com>
power: supply: qcom_battmgr: report the USB type from USB_ADAP_TYPE
Jiayuan Chen <jiayuan.chen@linux.dev>
bpf: Fix verifier WARN on narrow read of bpf_tcp_sock u64 fields
Cen Zhang <zzzccc427@gmail.com>
ALSA: jack: Protect the index scan against control removal
Brad Fitzpatrick <bradfitz@tailscale.com>
gre: keep the UDP tunnel GSO type when completing GRO
Joas Antonio dos Santos <joasantonio108@gmail.com>
calipso: update payload_len when removing the CALIPSO option
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: sta350: Fix definition of Ch2 and Ch3 Volume Bypass controls
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: sta32x: Fix definition of Ch2 and Ch3 Volume Bypass controls
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: tlv320adc3xxx: Fix definition of AGC Target Level control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: da732x: Fix definition of ADC2 EQ Overall Volume control
Yuan Chen <chenyuan@kylinos.cn>
bpf: Claim the per-CPU send_signal irq_work before filling it
Puranjay Mohan <puranjay@kernel.org>
bpf: Implement bpf_send_signal_task() kfunc
Sasha Levin <sashal@kernel.org>
ARC: Strip libgcc debug information when generating BTF
Tal Zussman <tz2294@columbia.edu>
btrfs: update the inode item when removing a free space inode
Tal Zussman <tz2294@columbia.edu>
btrfs: drop the extent maps of the written part of a failed ordered extent
Filipe Manana <fdmanana@suse.com>
btrfs: remove leftover EXTENT_UPTODATE clear from an inode's io_tree
Piotr Gliźniewicz <p.glizniewicz@gmail.com>
ALSA: 6fire: take stream_mutex in the Digital Thru control
Myeonghun Pak <mhun512@gmail.com>
platform: cznic: turris-omnia-mcu: stop button emulation producers
Ömer Mete Kaya <omermetekaya0@gmail.com>
usbnet: fix smp_processor_id() use in preemptible context
Fabrice Derepas <fabrice.derepas@canonical.com>
ima: reject a kexec buffer whose declared size exceeds the buffer
Tao Cui <cuitao@kylinos.cn>
blk-iocost: account zone append completions in latency stats
Tao Cui <cuitao@kylinos.cn>
blk-iocost: charge zone appends as writes
Colin Ian King <colin.i.king@gmail.com>
selftests/bpf: Fix spelling mistakes in descr literal strings
Yuan Chen <chenyuan@kylinos.cn>
bpftool: Fix inverted tracefs validation when scanning /proc/mounts
Qiliang Yuan <odys.yuan@gmail.com>
selftests/bpf: Expect at least one kprobe miss in missed/perf_kprobe
Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br>
HID: wacom: fix wacom_intuos_irq NULL pen_input deref
Dmitriy Geels <dmitriy.geels@gmail.com>
HID: logitech-hidpp: cancel reset_hi_res_work on probe failure
Cen Zhang <zzzccc427@gmail.com>
ALSA: vmaster: Protect follower lookup and setup
Qiliang Yuan <odys.yuan@gmail.com>
selftests/bpf: Unmount the bpffs that cgroup_hierarchical_stats mounted
Qiliang Yuan <odys.yuan@gmail.com>
selftests/bpf: Keep the bpffs of cgroup_hierarchical_stats private
Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
net: use the full socket in sk_mc_loop()
Eric Dumazet <edumazet@kernel.org>
ipv4: use RCU protection in inet_netconf_get_devconf()
George Melikov <mail@gmelikov.ru>
bnx2x: fix header length calculation for encapsulated TSO
Muchun Song <muchun.song@linux.dev>
dax/bus: Return errors for invalid mapping targets
Stefano Munari <stefanomunari.sm@gmail.com>
net: usb: lan78xx: reject invalid EEPROM write requests
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
macsec: prevent AES-GCM nonce reuse after packet number wrap
KaFai Wan <kafai.wan@linux.dev>
selftests/bpf: Fix prog_tests framework subtest count checks
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Print a signed histogram key as signed
Atharva Vartak <atharva.a.vartak@gmail.com>
net/smc: hold a reference on net_device returned by pnet_find_base_ndev()
Jianan Huang <jnhuang95@gmail.com>
f2fs: quota: fix quota flush failure during filesystem freeze
pengdonglin <pengdonglin@xiaomi.com>
tracing: Avoid BTF lookup in atomic context
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Clamp the printed end of a histogram bucket at U64_MAX
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Only report the stacktrace modifier on a real field
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Print the bucket size as unsigned
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix ETDM probe error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix HDMI TX startup error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix ETDM startup error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix ETDM MCLK error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Propagate IRQ lookup errors
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix runtime resume error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Check paired MEMIF clock enable in FE trigger
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix FE startup error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix paired memif clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix main clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix timing system clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix register access clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8195: Fix tuner clock error handling
Amadeusz Sławiński <amade@asmblr.net>
ASoC: soc-component: Fix return type of snd_soc_pcm_component_pointer()
Amadeusz Sławiński <amade@asmblr.net>
ASoC: soc-ac97: Fix error handling in snd_soc_new_ac97_component()
Amadeusz Sławiński <amade@asmblr.net>
ASoC: soc-card-test: Check return value of kunit_device_register()
Amadeusz Sławiński <amade@asmblr.net>
ASoC: soc-topology-test: Check return value of kunit_device_register()
Amadeusz Sławiński <amade@asmblr.net>
ASoC: ops: Fix return value in snd_soc_limit_volume()
Amadeusz Sławiński <amade@asmblr.net>
ASoC: soc-link: Correct stream stop operations in snd_soc_link_trigger
Hongbo Li <lihongbo22@huawei.com>
ASoC: remove unused substream in macro soc_link_mark_pop
Abraham Zukor <abe@maticrobots.com>
spi: tegra114: initialize native chip selects inactive
Haotian Zhang <vulab@iscas.ac.cn>
ASoC: rockchip: fix device node reference leak in rk3288_hdmi_analog
bui duc phuc <phucduc.bui@gmail.com>
ASoC: rockchip: rk3288_hdmi_analog: Use dev_err_probe() for error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: rockchip: rk3288_hdmi_analog: Drop redundant probe error messages
Sasha Levin <sashal@kernel.org>
selftests: keep the build status from wrapping to success
Michael Auer <mick@yoxcu.de>
ASoC: qcom: sdm845: Disable the quaternary MI2S bit clock on shutdown
Robert Oscilowski <drgitx@gmail.com>
ASoC: qcom: sdm845: set quaternary MI2S codec DAI to I2S format
Alexey Klimov <alexey.klimov@linaro.org>
ASoC: qcom: sdm845: add handling of secondary MI2S clock
Cezary Rojewski <cezary.rojewski@intel.com>
ASoC: Intel: avs: Prevent module info underflow
Cezary Rojewski <cezary.rojewski@intel.com>
ASoC: Intel: avs: Unprepare a stream when recovery occurs
Jacob Moroni <jmoroni@google.com>
RDMA/irdma: Fix FRWR IRDMAQPSQ_PBLADDR field population
Serhat Kumral <serhatkumral1@gmail.com>
IB/rdmavt: Fix error unwind path for qp_priv_init() in rvt_create_qp()
Sasha Levin <sashal@kernel.org>
kselftest/arm64: signal: copy each test binary only once
Takashi Iwai <tiwai@suse.de>
ALSA: core: Serialize snd_refcount put and sync
Qiliang Yuan <odys.yuan@gmail.com>
selftests/bpf: Create the vxlan devices of test_tunnel with their MAC
Jaewon Jung <jaewon8868@gmail.com>
selftests/ftrace: Avoid unlink error on first run
Youngsung Ahn <ays511.kr@gmail.com>
RDMA/rxe: bound the WQE opcode before indexing rxe_wr_opcode_info[]
Honggang LI <honggangli@163.com>
RDMA/rxe: Fix out-of-range unsigned-to-signed conversion for RDMA message in 2GiB size
xiongweimin <xiongweimin@kylinos.cn>
RDMA/rxe: Hold netdev reference for transmit skbs
Youngsung Ahn <ays511.kr@gmail.com>
RDMA/rxe: validate inline sge_offset in finish_packet() before indexing inline_data[]
Youngsung Ahn <ays511.kr@gmail.com>
RDMA/rxe: reject IB_WR_REG_MR from user QPs in rxe_reg_fast_mr()
Youngsung Ahn <ays511.kr@gmail.com>
RDMA/rxe: refuse to destroy a QP with type 2 MWs still bound
Sahaj Chaudhari <sahaj123.sc@gmail.com>
spi: omap2-mcspi: handle DMA setup failures
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Add refcount for races between drain and unlink
Takashi Iwai <tiwai@suse.de>
ALSA: Add simple refcount helper functions
Zhu Ling <zhuling2709@phytium.com.cn>
irqchip/gic: Fix UBSAN shift-out-of-bounds in GIC helpers
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v3: Don't register a redistributor that was never counted
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v3-its: Don't free the tables of an enabled ITS
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v3-its: Don't free a vPE table shared with another ITS
Steven Price <steven.price@arm.com>
irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor
Pengpeng Hou <hppiscas@163.com>
irqchip/riscv-imsic: Reject overlapping group index fields
Fuad Tabba <fuad.tabba@linux.dev>
irqchip/gic-v3-its: Clear vpt_page after freeing the pending table
David Howells <dhowells@redhat.com>
rxrpc: Revert "rxrpc: rxperf: Fix missing decoding of terminal magic cookie"
Carolina Jubran <cjubran@nvidia.com>
IB/IPoIB: Cancel normal flush work on device stop
Jiayuan Chen <jiayuan.chen@linux.dev>
veth: clear rx queue hint in veth_xmit
Qiliang Yuan <odys.yuan@gmail.com>
selftests/bpf: Expect at least one tp_recursion miss in missed
Sagi Maimon <maimon.sagi@gmail.com>
net: axienet: free outstanding TX buffers in axienet_dma_bd_release()
Kyrylo Biryuk <illofspeed@gmail.com>
ata: libahci: re-enable FBS after error handling on a port multiplier
Long Zhao <longzhao@ambarella.com>
dt-bindings: vendor-prefixes: add Ambarella
Fenglin Wu <fenglin.wu@oss.qualcomm.com>
spmi: pmic-arb: return 0 in spmi_pmic_arb_register_buses() on success
Xingui Yang <yangxingui@huawei.com>
scsi: hisi_sas: Fix spinup failure for SAS SSP devices in Active_Wait state
Damien Le Moal <dlemoal@kernel.org>
scsi: core: Prepare for using combined sense codes
Damien Le Moal <dlemoal@kernel.org>
scsi: core: Rename sense field of struct scsi_failure
Damien Le Moal <dlemoal@kernel.org>
scsi: core: Define all additional sense codes and their qualifiers
Damien Le Moal <dlemoal@kernel.org>
scsi: scsi_debug: move ASC and ASCQ definitions to scsi_proto.h
Niklas Cassel <cassel@kernel.org>
scsi: libsas: Add dev_parent_is_expander() helper
Kai Mäkisara <Kai.Makisara@kolumbus.fi>
scsi: scsi_debug: Add write support with block lengths and 4 bytes of data
Kai Mäkisara <Kai.Makisara@kolumbus.fi>
scsi: scsi_debug: Add READ BLOCK LIMITS and modify LOAD for tapes
Xingui Yang <yangxingui@huawei.com>
scsi: hisi_sas: Fix incorrect delay values from magic-number cleanup
Xingui Yang <yangxingui@huawei.com>
scsi: libsas: Fix out-of-bounds memcpy() in sas_ssp_task_response()
Nicolai Buchwitz <nb@tipi-net.de>
net/mlx5e: use skb_share_check() in the loopback selftest hook
Nicolai Buchwitz <nb@tipi-net.de>
net: stmmac: selftests: use skb_share_check() in the loopback receive hook
Nicolai Buchwitz <nb@tipi-net.de>
net: selftests: use skb_share_check() in the loopback receive hook
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: MSFT: Serialize handle map cleanup with event processing
Kiran K <kiran.k@intel.com>
Bluetooth: btintel: Zero version data before parsing TLVs
Laxman Acharya Padhya <acharyalaxman8848@gmail.com>
Bluetooth: btintel: propagate version TLV parsing errors
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_sync: Protect IRK identity reads with RCU
Eric Dumazet <edumazet@kernel.org>
Bluetooth: btmtk: fix skb double free on ISO padding failure
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: 6lowpan: Drain RCU readers on registration failure
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: msft: Lock failed probe cleanup against feature readers
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: MGMT: Reject quality report requests during unregister
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: ISO: Hold the listener during disconnect notification
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_sync: Serialize devcoredump reset during device open
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: hci_core: Keep RCU protection through LTK filtering
Hitalo Souza <enghitalo@gmail.com>
Bluetooth: Add missing newline to bt_dev_{err,warn}_ratelimited()
Cen Zhang <zzzccc427@gmail.com>
Bluetooth: 6LoWPAN: Use RCU-safe device list removal
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MGMT: Fix leaking instance on Add Extended Advertising Parameters
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MGMT: Fix pending state of instances added without HCI traffic
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: HCI: Fix tracking of instances sharing handle 0x00
Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Bluetooth: MGMT: Fix advertising instances with Global Advertising
Kiran K <kiran.k@intel.com>
Bluetooth: btusb: Preserve event and ACL packet ordering
Zijun Hu <zijun.hu@oss.qualcomm.com>
Bluetooth: btusb: Make btusb_recv_{event,acl}() take struct hci_dev *
Chris Lu <chris.lu@mediatek.com>
Bluetooth: btmtk: Improve BT firmware logging
Chris Lu <chris.lu@mediatek.com>
Bluetooth: btmtk: Validate the firmware layout before parsing it
Pauli Virtanen <pav@iki.fi>
Bluetooth: L2CAP: hold chan in l2cap_ecred_conn_rsp()
Pauli Virtanen <pav@iki.fi>
Bluetooth: L2CAP: hold l2cap_conn::lock in l2cap_connect_cfm()
Pauli Virtanen <pav@iki.fi>
Bluetooth: L2CAP: take chan->lock for l2cap_chan_add/ready/del
Chris Lu <chris.lu@mediatek.com>
Bluetooth: btmtksdio: Pass the hardware device id to mt79xx_setup()
Chris Lu <chris.lu@mediatek.com>
Bluetooth: btmtksdio: Remove redundant firmware filename override
Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
PCI: Fix out-of-bounds MMIO read in nvme_disable_and_flr()
Marek Szyprowski <m.szyprowski@samsung.com>
ARM: 9519/1: dma-mapping: Fix wrong free function in __iommu_alloc_simple() error path
Karl Mehltretter <kmehltretter@gmail.com>
ARM: 9492/1: alignment: fix LSR #32 and ASR #32 offset decoding
Karl Mehltretter <kmehltretter@gmail.com>
ARM: 9486/1: set !LPAE MAX_PHYSMEM_BITS to 32 and remove supersection mappings
Atul Akella <atul.akella@gmail.com>
rpmsg: virtio: fix error handling in TX buffer wait
Patrick Oppenlander <patrick.oppenlander@gmail.com>
rpmsg: virtio: EPOLLOUT support
Dr. David Alan Gilbert <linux@treblig.org>
rpmsg: virtio: Remove uncallable offchannel functions
Avi Weiss <thnkslprpt@gmail.com>
rpmsg: mtk: release channel OF node on device teardown
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8510: Fix definition of ADC Inversion Switch control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8750: Fix definition of ALC Capture NG Type control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm5100: Fix definition of EQ3 Band 1 Volume control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8737: Fix definition of zero cross switches
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm_hubs: Fix definition of MIXINR to MIXOUTR volume control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8955: Fix definition of Treble Cutoff control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8994: Fix definition of WM8958 noise gate hold time controls
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8985: Fix definition of ADC 128x Oversampling control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8983: Fix definition of ADC 128x Oversampling control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8991: Fix definition of LOMIX AINLMUX Bypass Volume control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8991: Fix definition of right input PGA controls
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8990: Fix definition of LOMIX AINLMUX Bypass Volume control
HyeongJun An <sammiee5311@gmail.com>
ASoC: codecs: wm8990: Fix definition of right input PGA controls
Tim Douglas <me@timdoug.com>
serial: pmac_zilog: report received breaks
Karl Mehltretter <kmehltretter@gmail.com>
serial: ma35d1: Do not force-enable an unselected console
Muhammad Bilal <meatuni001@gmail.com>
platform/x86: hp-bioscfg: fix oops on short integer attribute buffer
Muhammad Bilal <meatuni001@gmail.com>
platform/x86: hp-bioscfg: validate SPM state returned by firmware
Muhammad Bilal <meatuni001@gmail.com>
platform/x86: hp-bioscfg: fix off-by-one in password length check
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcm: Unlink substreams before releasing them
Johannes Berg <johannes.berg@intel.com>
wifi: cfg80211: track SSID regardless of country data
Julian Anastasov <ja@ssi.bg>
ipvs: fix buffer overflow when sending sync messages
Binbin Deng <18983559317@163.com>
module: Fix uninitialized count read of unloaded taint tracking record
Kees Cook <kees@kernel.org>
mm/slab: Mark the kmem_buckets_create() context as a Context: section
Vlastimil Babka <vbabka@suse.cz>
mm, slab: add kerneldocs for common SLAB_ flags
Karl Mehltretter <kmehltretter@gmail.com>
thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
Florian Fainelli <florian.fainelli@broadcom.com>
tools/thermal/tmon: Fix string truncation warning in optarg copy
Weigang He <geoffreyhe2@gmail.com>
thermal/drivers/sprd: validate the sensor id from the device tree
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Use fixed control index for us16x08 mixer elements
Cen Zhang <zzzccc427@gmail.com>
ALSA: vmaster: Serialize hook registration with control callbacks
Takashi Iwai <tiwai@suse.de>
ALSA: line6: Use kzalloc() for PCM buffer allocation
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Protect delay DMA sync in forward and rewind, too
Takashi Iwai <tiwai@suse.de>
ALSA: jack: Fix kctl free at error in snd_jack_kctl_new()
Amadeusz Sławiński <amade@asmblr.net>
ALSA: pcm: Fix driver_tstamp value reporting
Karl Mehltretter <kmehltretter@gmail.com>
kcov: report spurious PCs in the interrupt selftest
Karl Mehltretter <kmehltretter@gmail.com>
resource, kunit: stop selecting GET_FREE_REGION
Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
ocfs2: validate chunk and block counts of the local quota file
Joseph Qi <joseph.qi@linux.alibaba.com>
ocfs2: fix possible deadlock between nfs_sync_rwlock and fs_reclaim
Joseph Qi <joseph.qi@linux.alibaba.com>
ocfs2: retain all security xattrs during inode creation
Zhiling Zou <zhilinz@nebusec.ai>
lib: validate in-memory LZ4 chunk length
Bart Van Assche <bvanassche@acm.org>
scsi: scsi_debug: Fix a locking bug in resp_write_same()
Runyu Xiao <runyu.xiao@seu.edu.cn>
ASoC: codecs: wcd937x: request watchdog IRQs without devm
Priyanka Mani <priyankamani2100@gmail.com>
ASoC: mediatek: mt8365: Fix out-of-bounds read in get_iir_coef()
Karl Mehltretter <kmehltretter@gmail.com>
sh: sh7785lcr: Register the PCA9564 controller as I2C bus 0
bui duc phuc <phucduc.bui@gmail.com>
ASoC: atmel-i2s: use optional API for gclk
bui duc phuc <phucduc.bui@gmail.com>
ASoC: atmel-i2s: use optional API for muxclk
bui duc phuc <phucduc.bui@gmail.com>
ASoC: atmel-i2s: fix MCK generator error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: intel: atom: Fix .shutdown() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: Intel: atom: Use scoped_guard() for scoped locking
bui duc phuc <phucduc.bui@gmail.com>
ASoC: intel: atom: Use __free(kfree) for stream pointer
bui duc phuc <phucduc.bui@gmail.com>
ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: atmel: atmel-pcm-pdc: Fix atmel_pcm_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: yc: Fix acp6x_pdm_dma_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: vangogh: Fix acp5x_dma_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: renoir: Fix acp_pdm_dma_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: raven: Fix acp3x_dma_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: ps: Fix acp63_sdw_dma_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: ps: Fix acp63_pdm_dma_close() being skipped on rollback
bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: acp: Fix .close() being skipped on rollback
Mingxuan Guo <gmx472@qq.com>
firmware: cs_dsp: clear dsp->running on the cs_dsp_run() error path
Yao Sang <sangyao@kylinos.cn>
nvme: pass partition flags to passthrough checks
Sung Byeongchan <tjdqudcks0424@naver.com>
nvmet-auth: reject undersized AUTH_SEND payloads
Palla Raghunath <raghunathpalla.0209@gmail.com>
nvmet-fc: don't drop the last assoc reference in nvmet_fc_delete_ctrl()
Surabhi Gogte <sgogte@purestorage.com>
nvme-tcp: store and use the caller's network namespace
Peijie Shao <shaopeijie@cestc.cn>
nvme-tcp: fix selinux denied when calling sock_sendmsg
Heiko Carstens <hca@linux.ibm.com>
s390/uprobes: Fix off-by-one bug in emulated PER handling
Heiko Carstens <hca@linux.ibm.com>
s390/ptrace: Preserve ILC when updating system call number
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
clk: qcom: rcg2: Clear force enable after rate failure
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
clk: qcom: rcg2: Propagate force-enable status errors
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
clk: qcom: rcg2: Initialize shared floor clock state
Abel Vesa <abel.vesa@oss.qualcomm.com>
clk: qcom: mmcc-msm8960: Configure PLL15 only on APQ8064
Abel Vesa <abel.vesa@oss.qualcomm.com>
clk: qcom: mmcc-sdm660: Fix MDSS AHB clock HWCG register offset
Abel Vesa <abel.vesa@oss.qualcomm.com>
clk: qcom: mmcc-msm8996: Fix FD AHB clock register offset
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
clk: qcom: gcc-x1e80100: Don't poll the status bit of GCC_USB4_n_SYS_CLK
Yuho Choi <oss.patchbox@gmail.com>
bus: arm-cci: Drop cci-control-port node reference in __cci_ace_get_port()
Yuho Choi <oss.patchbox@gmail.com>
bus: arm-cci: Drop CPU node reference in cci_ace_init_ports()
Linkai Gong <gonglinkai@kylinos.cn>
char: scx200_gpio: check cdev_add() return value
Sasha Levin <sashal@kernel.org>
tools: hv: remove unused rte_smp_mb()
Weigang He <geoffreyhe2@gmail.com>
thermal/drivers/ti-soc-thermal: Cancel pending alert work on remove
Yogesh Gaur <yogeshgaur.83@gmail.com>
comedi: pcmuio: validate the IRQs supplied by userspace
Yogesh Gaur <yogeshgaur.83@gmail.com>
comedi: pcmmio: validate the IRQ supplied by userspace
Yogesh Gaur <yogeshgaur.83@gmail.com>
comedi: dmm32at: validate the IRQ supplied by userspace
Yogesh Gaur <yogeshgaur.83@gmail.com>
comedi: dt2814: validate the IRQ supplied by userspace
Yogesh Gaur <yogeshgaur.83@gmail.com>
comedi: ni_atmio16d: validate the IRQ supplied by userspace
Yogesh Gaur <yogeshgaur.83@gmail.com>
comedi: comedi_parport: validate the IRQ supplied by userspace
Thomas Fourier <fourier.thomas@gmail.com>
net: alacritech: fix dma_free_coherent() in error path
Weiming Shi <bestswngs@gmail.com>
fs/ntfs3: do not mark frame pages uptodate on read error
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3: remove ntfs_bio_pages and use page cache for compressed I/O
Matthew Wilcox (Oracle) <willy@infradead.org>
ntfs: Do not kmap pages used for reading from disk
Ethan Ferguson <ethan.ferguson@zetier.com>
ntfs3: add FS_IOC_SETFSLABEL ioctl
Ethan Ferguson <ethan.ferguson@zetier.com>
ntfs3: add FS_IOC_GETFSLABEL ioctl
Tapio Reijonen <tapio.reijonen@vaisala.com>
serial: max310x: don't power down the port mid-transmission on close
Tapio Reijonen <tapio.reijonen@vaisala.com>
serial: max310x: fix RS485 delays being programmed as bit-times
Tapio Reijonen <tapio.reijonen@vaisala.com>
serial: max310x: centralize the RS485 transceiver programming
Tapio Reijonen <tapio.reijonen@vaisala.com>
serial: max310x: fix breaks not reaching the wire in RS485 mode
Tapio Reijonen <tapio.reijonen@vaisala.com>
serial: max310x: don't clobber the TX break bit in set_termios
Jiayuan Chen <jiayuan.chen@linux.dev>
tcp_cubic: fix divide by zero and endless loop on bad module params
Jiayuan Chen <jiayuan.chen@linux.dev>
tcp_hybla: fix divide by zero on rtt0 == 0
Jiayuan Chen <jiayuan.chen@linux.dev>
tcp_bic: fix divide by zero on max_increment == 0
Jeff Chen <jeff.chen_1@nxp.com>
wifi: mwifiex: append hotfix number to firmware version string
Chien Wong <m@xv97.com>
wifi: mac80211: reserve MME tailroom for protected beacons
Chien Wong <m@xv97.com>
wifi: mac80211: fix encryption tailroom
Yonatan Nachum <ynachum@amazon.com>
RDMA/efa: Fix race between admin command timeout and completion
Haitam Lazaar <haitam@lazaarsec.com>
RDMA/siw: Enforce IB_ACCESS_REMOTE_READ for read responses
Luca Leonardo Scorcia <l.scorcia@gmail.com>
clocksource/drivers/timer-mediatek: Fix random crash at boot
Joas Antonio dos Santos <joasantonio108@gmail.com>
calipso: hash the cache key, not the option start, in calipso_cache_add()
Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
PCI: qcom: Honor IOMMU provider's #iommu-cells in qcom_pcie_config_sid_1_9_0()
Cen Zhang <zzzccc427@gmail.com>
ALSA: pcm: Protect delay DMA sync against concurrent HW_FREE
Cen Zhang <zzzccc427@gmail.com>
ALSA: rawmidi: Drain input work before freeing the runtime
Myeonghun Pak <mhun512@gmail.com>
fbdev: gxt4500: Release WC setup on probe failure
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
platform/x86/amd/pmc: clear devm-managed pointers on remove to prevent stale reuse
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
platform/x86/amd/pmc: Use managed APIs for mutex
Jiale Yao <yaojiale02@163.com>
platform/olpc: Reserve space for a string terminator
Aleksandrova Alyona <aga@itb.spb.ru>
platform/x86: intel_telemetry: initialize default trace verbosity
Daasaradhi Mannava <daasaradhimannava@gmail.com>
platform/x86: msi-ec: Report valid charge thresholds when unset
Ahmed Yaseen <yaseen@ghoul.dev>
platform/x86: asus-wmi: validate custom fan curves on enable
Ali Ahmet Memiş <aliamemis@disroot.org>
ALSA: hda: intel: Don't free card in the probe work
Cen Zhang <zzzccc427@gmail.com>
ALSA: jack: Remove debugfs before freeing unregistered jacks
Dan Carpenter <error27@gmail.com>
mm/hmm/test: reject overflowing page counts
Harry Yoo (Meta) <harry@kernel.org>
selftests/cgroup: ignore memory.reclaim -EAGAIN for zswap writeback test
Jiale Yao <yaojiale02@163.com>
wifi: ath12k: avoid IDR mutation during vif mgmt TX cleanup
Jiale Yao <yaojiale02@163.com>
wifi: ath11k: avoid IDR mutation during vif mgmt TX cleanup
Jiale Yao <yaojiale02@163.com>
wifi: ath11k: avoid IDR mutation during pending mgmt TX cleanup
Jiale Yao <yaojiale02@163.com>
wifi: ath10k: avoid IDR mutation during TX cleanup
Kunwu Chan <kunwu.chan@gmail.com>
rcutorture: Fix divide-by-zero with fwd_progress_div=1
bui duc phuc <phucduc.bui@gmail.com>
ASoC: codecs: rt5659: propagate GPIO errors
Roberto Bergantinos Corpas <rbergant@redhat.com>
nfs: set gencount on protocol-specific remove
Haotian Zhang <vulab@iscas.ac.cn>
mtd: rawnand: pl353: fix clk reference leak in pl35x_nfc_setup_interface()
bui duc phuc <phucduc.bui@gmail.com>
power: supply: generic-adc-battery: Propagate charged GPIO errors
Filipe Manana <fdmanana@suse.com>
btrfs: defrag: fix check to see if next extent can be defragged too
Filipe Manana <fdmanana@suse.com>
btrfs: fix lost error return value in btrfs_alloc_logged_file_extent()
Filipe Manana <fdmanana@suse.com>
btrfs: qgroup: fix swapped blocks existence check when tracing after COW
Qu Wenruo <wqu@suse.com>
btrfs: qgroup: do not treat "ret > 0" as error when deleting a qgroup
Filipe Manana <fdmanana@suse.com>
btrfs: fix off-by-one end offset check in report_setget_bounds()
David Sterba <dsterba@suse.com>
btrfs: accessors: inline eb bounds check and factor out the error report
David Sterba <dsterba@suse.com>
btrfs: accessors: use type sizeof constants directly
David Sterba <dsterba@suse.com>
btrfs: accessors: simplify folio bounds checks
David Sterba <dsterba@suse.com>
btrfs: accessors: delete token versions of set/get helpers
David Sterba <dsterba@suse.com>
btrfs: don't use token set/get accessors in inode.c:fill_inode_item()
David Sterba <dsterba@suse.com>
btrfs: don't use token set/get accessors for btrfs_item members
Filipe Manana <fdmanana@suse.com>
btrfs: fix incomplete iteration over fs state when logging messages
Johannes Thumshirn <johannes.thumshirn@wdc.com>
btrfs: zoned: fix double list add in btrfs_load_block_group_zone_info
Filipe Manana <fdmanana@suse.com>
btrfs: fix dangling nodes in tree-mod-log after error in btrfs_tree_mod_log_insert_root()
Filipe Manana <fdmanana@suse.com>
btrfs: fix off by one super block end offset calculation when writing super blocks
Qu Wenruo <wqu@suse.com>
btrfs: refactor read_key_bytes() to remove the dest_folio parameter
Tal Zussman <tz2294@columbia.edu>
block: honor IOCB_NOWAIT in the block device buffered read path
Tal Zussman <tz2294@columbia.edu>
block: use iomap_dirty_folio for block devices
Jiale Yao <yaojiale02@163.com>
ACPI: PCI: pci_link: clear driver_data before free
Adrián Larumbe <adrian.larumbe@collabora.com>
drm/panfrost: Explicitly enable MMU interrupts at device init
Ali Ahmet Memiş <aliamemis@disroot.org>
ALSA: control_led: Fix deadlock between sysfs writes and card disconnect
Takashi Iwai <tiwai@suse.de>
ALSA: control: Relax __free() variable declarations
Mikulas Patocka <mpatocka@redhat.com>
dm-snapshot: make the chunk list sorted by the chunk number
Yuan Chen <chenyuan@kylinos.cn>
bpftool: Fix out-of-bounds read in kprobe_multi link info dump
Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
RDMA/mlx5: Cancel software CQ notifications before teardown
Mark Zhang <markzhang@nvidia.com>
RDMA/mlx5: Support driver APIs pre_destroy_cq and post_destroy_cq
Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
RDMA/mlx5: Cancel deferred page-fault EQ work before teardown
Ting-Han Hou <ue081723@gmail.com>
ALSA: virtio: reset I/O message fill level on prepare
Cen Zhang <zzzccc427@gmail.com>
ALSA: timer: Pin the module for userspace timer controllers
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
mailbox: qcom-ipcc: remove stray disable_irq_wake() call
Linkai Gong <gonglinkai@kylinos.cn>
mailbox: arm_mhuv2: time out if the receiver never comes up
Beleswar Padhi <b-padhi@ti.com>
mailbox: ti-msgmgr: Read exact number of trailing message bytes
Breno Leitao <leitao@debian.org>
mailbox: pcc: Free the channel before unmapping the shared memory
Sang-Hoon Choi <csh0052@gmail.com>
xhci: dbc: lock the minor IDR on registration failure
Kumar Kartikeya Dwivedi <memxor@gmail.com>
bpf, riscv: Fix stack-passed arguments for indirect trampolines
Kees Cook <kees@kernel.org>
kbuild: Mark the initcall ordering recipe as recursive
Maxim Skokov <skokovmaksimevg@gmail.com>
bpf: test_run: Fix false -EBADMSG after skb leaves CHECKSUM_COMPLETE
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Add NULL check for the driver pointer at unsol event work
Ting-Han Hou <ue081723@gmail.com>
scripts/make_fit: Ignore schema checks when decomposing DTBs
Ting-Han Hou <ue081723@gmail.com>
clang-tools: Import os for broken pipe handling
Leizhen Zhang <lzsx618@gmail.com>
kconfig: fix infinite loop in conf_choice() when no choice value is visible
Jiale Yao <yaojiale02@163.com>
vfio/pci: Drain eventfd RCU callbacks on module exit
Leon Romanovsky <leon@kernel.org>
PCI/P2PDMA: Gate the host bridge whitelist warning on verbose
Leon Romanovsky <leon@kernel.org>
PCI/P2PDMA: Safely terminate ACS redirect lists
Antoni Pokusinski <apokusinski01@gmail.com>
rtc: abx80x: properly handle shared IRQs
Antoni Pokusinski <apokusinski01@gmail.com>
rtc: abx80x: fix error check after i2c_smbus_read in read_alarm()
Leo Cheng <leo-cheng@vip.qq.com>
nvmem: layouts: onie-tlv: fix device_node reference leak in error path
Leo Cheng <leo-cheng@vip.qq.com>
nvmem: layouts: sl28vpd: fix device_node reference leak in error path
Felix Fietkau <nbd@nbd.name>
wifi: mac80211: use link address as TA for non-MLO 4-addr station on MLD AP
Johannes Berg <johannes.berg@intel.com>
wifi: cfg80211: reg: protect regdb pointer with RCU
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: fix mbssid/rnr allocation in beacon data
Aloka Dixit <aloka.dixit@oss.qualcomm.com>
wifi: mac80211: remove redundant null check in ieee80211_assign_beacon()
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: limit injected HT/VHT MCSes
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: init radiotap iter after length checks
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: kill wake_txqs_tasklet on unregistration
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: mesh: use hlist_add_head_rcu()
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: clear fragment cache entry 'is_protected'
Johannes Berg <johannes.berg@intel.com>
wifi: ath6kl: don't take RTNL in del_virtual_intf
Takashi Iwai <tiwai@suse.de>
ALSA: hda: intel: Cancel delayed work at shutdown, too
Takashi Iwai <tiwai@suse.de>
ALSA: line6: Fix potential OOB write in line6_capture_copy()
Takashi Iwai <tiwai@suse.de>
ALSA: line6: Reject too small max packet sizes
Takashi Iwai <tiwai@suse.de>
ALSA: usb: us16x08: Fix racy accesses of mixer elements
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Fix data race at mixer_ctl_feature_info()
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
ALSA: usb: mixer: use snd_kcontrol_chip()
Takashi Iwai <tiwai@suse.de>
ALSA: caiaq: Fix races at MIDI URB and trigger accesses
Karl Mehltretter <kmehltretter@gmail.com>
gpu: buddy: Drop the stale @p line from the gpu_buddy_print() kernel-doc
Jan Beulich <jbeulich@suse.com>
x86/PVH: don't truncate initrd address/size
Gui-Dong Han <hanguidong02@gmail.com>
xen/blkback: Prevent missed completion when draining I/O
Ruoyu Wang <ruoyuw560@gmail.com>
xen/pcifront: Fix PCI device reference leak in AER handling
Haotian Zhang <vulab@iscas.ac.cn>
cpufreq: qcom-cpufreq-hw: fix device node refcount leak in phandle parsing
Jake Labelle <southampton.jake.labelle@gmail.com>
nilfs2: reject non-regular inodes in dsync recovery
Michał Kopeć <michal@nozomi.space>
ASoC: mediatek: mt8188: Constrain UL8 FE to its back end's capabilities
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
ASoC: mediatek: remove dpcm_xxx flags
Michał Kopeć <michal@nozomi.space>
ASoC: mediatek: common: Keep codec references until the card is bound
Rosen Penev <rosenp@gmail.com>
crypto: talitos - init tasklets before requesting IRQs
Rosen Penev <rosenp@gmail.com>
crypto: talitos - Use platform_get_irq() to retrieve interrupt
Rosen Penev <rosenp@gmail.com>
crypto: talitos - use devm_platform_ioremap_resource()
Rosen Penev <rosenp@gmail.com>
crypto: talitos - allocate channels with main struct
George Abraham P <george.abraham.p@intel.com>
crypto: qat - force an edge when re-enabling all VF2PF interrupts
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Don't free card at probe error in vga_switcheroo handler
Takashi Iwai <tiwai@suse.de>
ALSA: hda/intel: Move firmware loading into the probe work
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Avoid non-operational GPU warning at regular device removal
Takashi Iwai <tiwai@suse.de>
ALSA: info: Fix memory leak at card removal
Takashi Iwai <tiwai@suse.de>
ALSA: seq: Fix missing direction and ump_group handling in 32bit compat ioctl
Takashi Iwai <tiwai@suse.de>
ALSA: core: Add missing barriers for power_ref vs card->shutdown
Takashi Iwai <tiwai@suse.de>
ALSA: pcmtest: Fix a bogus pointer read in snd_pcmtst_pcm_pointer()
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Check mixer matrix size for UAC2/3 at parsing
Takashi Iwai <tiwai@suse.de>
ALSA: hda: Fix potential UAF for gating jack
Krzysztof Wilczyński <kwilczynski@kernel.org>
PCI/sysfs: Handle a malformed _DSM result in acpi_attr_is_visible()
Krzysztof Wilczyński <kwilczynski@kernel.org>
PCI/sysfs: Stop reporting _DSM failures as -EPERM
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8365: Handle constraint return value in FE startup
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: Handle constraint return value in FE startup
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: common: Handle constraint return value in FE startup
Melissa Wen <mwen@igalia.com>
drm/amd/display: copy function name into dcn_optc_lock_unlock_state trace event
Melissa Wen <mwen@igalia.com>
drm/amd/display: copy function name into dcn_fpu trace event
Melissa Wen <mwen@igalia.com>
drm/amd/display: use right type for amdgpu_dc_performance event entries
Melissa Wen <mwen@igalia.com>
drm/amd/display: fix vready offset assignment in dcn_optc_lock_unlock_state
Melissa Wen <mwen@igalia.com>
drm/amd/display: remove duplicated prev_p_state_change_support assignment
Melissa Wen <mwen@igalia.com>
drm/amd/display: assign missing trace entry in amdgpu_dm_dc_clocks_state
Ting-Han Hou <ue081723@gmail.com>
checkkconfigsymbols.py: Parse Git status output line by line
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt792x: compute the assoc RSSI from the chain signals
Karl Mehltretter <kmehltretter@gmail.com>
kobject: Fix the kobj_set_name reference in kset_register() kernel-doc
bui duc phuc <phucduc.bui@gmail.com>
ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt
John Crispin <john@phrozen.org>
wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7996: fix PLE free page and AC queue register offsets
Cristian Papa <pcristian292@gmail.com>
wifi: mt76: feed the station RSSI average from the chain signals
Pengpeng Hou <pengpeng@iscas.ac.cn>
wifi: mt76: mt7615: validate MCU response lengths
Ahmed Naseef <naseefkm@gmail.com>
wifi: mt76: mt7615: read MT7663 temperature from the correct offset
Ryan Leung <untilscour@protonmail.com>
wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup()
Cristian Papa <pcristian292@gmail.com>
wifi: mt76: mt7603: don't drop short frames looped back on PS entry
Jiale Yao <yaojiale02@163.com>
wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy
Jiale Yao <yaojiale02@163.com>
wifi: mt76: usb: fix source overread in mt76u_copy
Mark Anthony Agarro <markanthonyagarro@gmail.com>
wifi: mt76: mt7925: keep the join ROC until the station is authorized
Mark Anthony Agarro <markanthonyagarro@gmail.com>
wifi: mt76: mt7921: keep the join ROC until the station is authorized
Jiale Yao <yaojiale02@163.com>
wifi: mt76: mt76x02: validate RX padding before use
Ryan Leung <untilscour@protonmail.com>
wifi: mt76: fix wcid teardown ordering in mt76_reset_device()
Ryan Leung <untilscour@protonmail.com>
wifi: mt76: fix unlocked wcid check in mt76_tx_status_skb_add()
Ryan Leung <untilscour@protonmail.com>
wifi: mt76: mt7915: publish wcid before MCU add commands
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err
Mark Anthony Agarro <markanthonyagarro@gmail.com>
wifi: mt76: mt7925: honour mac80211's FIF_FCSFAIL instead of hardcoding drop_err
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7925: fix the lock inversion in suspend and resume
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7921: fix the lock inversion in suspend and resume
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7925: restore the reset state when fw_pmctrl fails
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7925: check drv_pmctrl return in the PCIe reset path
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7921: check drv_pmctrl return in the PCIe reset path
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7925: fix lock inversion between dev->mutex and iflist_mtx
Devin Wittmayer <lucid_duck@justthetip.ca>
wifi: mt76: mt7921: fix lock inversion between dev->mutex and iflist_mtx
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7915: guard firmware memory dump write on disabled memdump
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7915: unregister thermal cooling device on hwmon failure
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7996: validate firmware event lengths before parsing
Felix Fietkau <nbd@nbd.name>
wifi: mt76: mt7915: check default EEPROM firmware size before copying
Jiale Yao <yaojiale02@163.com>
pinctrl: sprd: free maps on DT map failure
Leizhen Zhang <lzsx618@gmail.com>
gen_init_cpio: stop parsing on lines with a missing argument list
Takashi Iwai <tiwai@suse.de>
ALSA: caiaq: Allow zero-length packet handling for EP1
Priyank Rathod <rathodpriyank@google.com>
PCI/AER: Fix struct pci_dev reference leak in aer_process_err_devices()
Joseph Qi <joseph.qi@linux.alibaba.com>
ocfs2: reject inconsistent xattr bucket during defrag
Joseph Qi <joseph.qi@linux.alibaba.com>
ocfs2: allow xattr bucket entries to span multiple blocks
Wilson Felipe Pereira <wfelipe@google.com>
init/main: fix false-positive kernel panic on environment variable overwrite
Wilson Felipe Pereira <wfelipe@google.com>
init/main: fix off-by-one in argv_init cleanup
Florian Schmaus <florian.schmaus@codasip.com>
selftests/epoll: fix race condition in multi-waiter wakeup tests
Joseph Qi <joseph.qi@linux.alibaba.com>
ocfs2: fix deadlock in inline-data truncate transactions
Petr Vorel <pvorel@suse.cz>
checkpatch: skip CamelCase cache for --no-tree without root
Wilson Felipe Pereira <wfelipe@google.com>
selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass
Li Wang <li.wang@linux.dev>
selftests/cgroup: replace hardcoded page size values in test_zswap
Li Wang <li.wang@linux.dev>
selftests/cgroup: use runtime page size for zswpin check
Li Wang <li.wang@linux.dev>
selftests/cgroup: avoid OOM in test_swapin_nozswap
Li Wang <li.wang@linux.dev>
selftests/cgroup: skip test_zswap if zswap is globally disabled
Jiayuan Chen <jiayuan.chen@shopee.com>
selftests/cgroup: add test for zswap incompressible pages
Guopeng Zhang <zhangguopeng@kylinos.cn>
selftests/cgroup: conform test to KTAP format output
Michal Koutný <mkoutny@suse.com>
selftests: cgroup: Optionally set up v1 environment
Ryusuke Konishi <konishi.ryusuke@gmail.com>
nilfs2: fix link count underflow when removing corrupted directory
Roberto Bergantinos Corpas <rbergant@redhat.com>
NFS: return DENIED in decode_lock_denied if we cannot decode owner
Marc Kleine-Budde <mkl@pengutronix.de>
spi: spi-sun4i: sun4i_spi_handler(): fix race condition between transfer completion and RX FIFO interrupt
Marc Kleine-Budde <mkl@pengutronix.de>
spi: spi-sun4i: sun4i_spi_transfer_one(): fix setting of clock rate
Marc Kleine-Budde <mkl@pengutronix.de>
spi: spi-sun4i: sun4i_spi_fill_fifo(): always apply A10 FIFO fill level workaround
Marc Kleine-Budde <mkl@pengutronix.de>
spi: spi-sun4i: sun4i_spi_transfer_one(): fix transfers for SUN4I_FIFO_DEPTH
Linus Walleij <linusw@kernel.org>
dt-bindings: dma: dma40: Restore disabled-channels
Jason Gunthorpe <jgg@ziepe.ca>
efi/libstub: Free cmdline_ptr in efi_pe_entry
Vincent Mailhol <mailhol@kernel.org>
efi/libstub: make local GUID variables static
Ard Biesheuvel <ardb@kernel.org>
x86/efistub: Merge PE and handover entrypoints
Ard Biesheuvel <ardb@kernel.org>
efi/libstub: Use cleanup helpers for freeing copies of the memory map
Ard Biesheuvel <ardb@kernel.org>
efi/libstub: Simplify PCI I/O handle buffer traversal
Ard Biesheuvel <ardb@kernel.org>
efi/libstub: Simplify GOP handling code
Ard Biesheuvel <ardb@kernel.org>
efi/libstub: Use C99-style for loop to traverse handle buffer
Ard Biesheuvel <ardb@kernel.org>
x86/efistub: Drop long obsolete UGA support
Nicolas Saenz Julienne <nsaenz@amazon.com>
x86/efi: Drop support for the EFI_PROPERTIES_TABLE
Jason Gunthorpe <jgg@ziepe.ca>
efi/riscv: libstub: Don't set image_size in handle_kernel_image()
Jason Gunthorpe <jgg@ziepe.ca>
efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot()
Pengpeng Hou <pengpeng@iscas.ac.cn>
sh: defconfig: Enable the current M66592 UDC symbol
Florian Fuchs <fuchsfl@gmail.com>
sh: uaccess: Require offsettable operands for 64-bit user access
Aurelien Jarno <aurelien@aurel32.net>
riscv: fix RVG_SYSTEM_CSR_MASK width mask
Eric Dumazet <edumazet@kernel.org>
ipv4: reserve one IP ID per segment for UDP GSO packets
Eric Dumazet <edumazet@kernel.org>
ipv4: fix IP ID reuse in ip_select_ident_segs()
Chen-Yu Tsai <wens@kernel.org>
arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine
Chen-Yu Tsai <wens@kernel.org>
arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine
Mike Snitzer <snitzer@kernel.org>
pNFS/flexfiles: don't reset to MDS for v4 error when previous layout forbid it
Mike Snitzer <snitzer@kernel.org>
pNFS/flexfiles: don't read through MDS when previous layout forbid it
Mike Snitzer <snitzer@kernel.org>
pNFS/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS over the mdsthreshold hint
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Validate memcpy configuration
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Validate fixed physical channel indexes
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix V4B event group mapping
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix event group bounds
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix logical channel bounds check
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Reject direction changes after allocation
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Validate DMA specifier length
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Validate disabled channel indexes
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix memcpy channel parsing
Rosen Penev <rosenp@gmail.com>
dmaengine: ste_dma40: turn d40_base phy_chans into a flexible array
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Put the LCPA SRAM node
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix probe LCLA free
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix LCLA allocation order
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix DMA registration unwind
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix probe IRQ leak
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Init hardware before registration
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Return IRQ_NONE when no interrupt is pending
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Handle runtime PM resume errors
Sakari Ailus <sakari.ailus@linux.intel.com>
dmaengine: ste_dma40: Remove redundant pm_runtime_mark_last_busy() calls
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Check runtime PM in IRQ
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix probe runtime PM disable
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix failed start cleanup
Linus Walleij <linusw@kernel.org>
dmaengine: ste_dma40: Fix physical cyclic capability
Roman Demidov <roman.demidov.nn@gmail.com>
drm/msm/a6xx: fix use-after-free of OPP in a6xx_pm_resume
Jiale Yao <yaojiale02@163.com>
wifi: ath12k: Reserve space for a string terminator
Guangshuo Li <lgs201920130244@gmail.com>
floppy: unregister platform device on add_disk failure
Yang Xiuwei <yangxiuwei@kylinos.cn>
floppy: avoid NULL deref in reset_interrupt when cont is cleared
Karl Mehltretter <kmehltretter@gmail.com>
floppy: flush pending work before releasing resources on init failure
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
NFS: filelayout: calculate dense stripe width in 64 bits
Chuck Lever <chuck.lever@oracle.com>
SUNRPC: treat every client-side TLS error alert as fatal
Chuck Lever <chuck.lever@oracle.com>
SUNRPC: reject a client-side TLS alert record that is not two octets
Logan Gunthorpe <logang@deltatee.com>
dmaengine: plx_dma: fix NULL pointer deref in plx_dma_isr()
Logan Gunthorpe <logang@deltatee.com>
dmaengine: ioat: disable relaxed ordering before registering the device
Aloka Dixit <aloka.dixit@oss.qualcomm.com>
Revert "wifi: mac80211: do not use old MBSSID elements"
Dan Carpenter <error27@gmail.com>
wifi: carl9170: NUL terminate string in debugfs
Dan Carpenter <error27@gmail.com>
wifi: b43legacy: debugfs: NUL terminate string in debugfs
Dan Carpenter <error27@gmail.com>
wifi: b43: don't pass unterminated string to sscanf()
Dominic White <github@singe.za.net>
wifi: cfg80211: allow zero HE OBSS PD offsets
Yibo Tan <lhfff@tju.edu.cn>
soc: qcom: pmic_pdcharger_ulog: prevent work requeue during remove
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
soc: qcom: pmic_glink: Avoid losing early rpmsg probe
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
soc: qcom: pmic_glink: simplify locking with guard()
Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
firmware: qcom: tzmem: Use DO_ONCE_SLEEPABLE() in qcom_tzmem_enable()
Joonhoe Kim <26rote@gmail.com>
drm/msm/dpu: round up the compressed INTF width
Xueqin Luo <luoxueqin@kylinos.cn>
cpufreq: sti: avoid NULL dereference in dev_err()
Xueqin Luo <luoxueqin@kylinos.cn>
cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
Xueqin Luo <luoxueqin@kylinos.cn>
cpufreq: sparc-us2e: fix frequency table index copy-paste error
Karl Mehltretter <kmehltretter@gmail.com>
svcrdma: Fix svc_rdma_recv_cid_init() kernel-doc
hpp.iscas <hppiscas@163.com>
perf/marvell: cn10k_tad: Publish the OF module alias
Hongyan Xu <getshell@seu.edu.cn>
ASoC: mt6359-accdet: manage private workqueues with devres
Yaozhong Li <yaozhonguwl@gmail.com>
arm64: dts: rockchip: disable unused i2s0 on rk3399-firefly
Yaozhong Li <yaozhonguwl@gmail.com>
arm64: dts: rockchip: fix analog headphone output on rk3399-firefly
Detlev Casanova <detlev.casanova@collabora.com>
arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards
Dragan Simic <dsimic@manjaro.org>
arm64: dts: rockchip: Prepare RK356x SoC dtsi files for per-variant OPPs
Dragan Simic <dsimic@manjaro.org>
arm64: dts: rockchip: Update CPU OPP voltages in RK356x SoC dtsi
Linus Walleij <linusw@kernel.org>
ARM: dts: ux500: Use AB8505 charger compatible
Detlev Casanova <detlev.casanova@collabora.com>
arm64: dts: rockchip: Rename rk3328 HDMI audio card
Jiale Yao <yaojiale02@163.com>
ASoC: rt722-sdca: always cancel jack work on remove
Jiale Yao <yaojiale02@163.com>
ASoC: rt712-sdca: always cancel jack work on remove
Jiale Yao <yaojiale02@163.com>
ASoC: rt711-sdca: always cancel jack work on remove
Jiale Yao <yaojiale02@163.com>
ASoC: rt711-sdw: always cancel jack work on remove
Jiale Yao <yaojiale02@163.com>
ASoC: rt5682-sdw: always cancel jack work on remove
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_fg: Avoid reserved AB8505 CCConf bit
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_fg: Finalize current measurements
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Recover inactive AB8505 charger
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Retry AB8505 USB detection
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Skip absent AB8505 main charger
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Handle detection errors
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Respect AB8505 register layout
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Decode AB8505 USB status
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_charger: Fix AC charger re-enable
Linus Walleij <linusw@kernel.org>
power: supply: ab8500: Preserve battery termination current
Linus Walleij <linusw@kernel.org>
power: supply: ab8500_btemp: Fix event temperature reporting
HyeongJun An <sammiee5311@gmail.com>
selftests/alsa: Do not take another control's event as our own
Guangshuo Li <lgs201920130244@gmail.com>
spi: bcm63xx-hsspi: Disable runtime PM on remove
Guangshuo Li <lgs201920130244@gmail.com>
spi: fsl: unmap immr_spi_cs on remove
Johan Hovold <johan@kernel.org>
spi: fsl: switch to managed controller allocation
Ruoyu Wang <ruoyuw560@gmail.com>
perf/dwc_pcie: Fix PCI device reference leak in probe
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Clear stale overflow status before using a counter
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Don't log through pmu.dev in the overflow interrupt handler
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Validate the hardware-reported counter width
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Unfreeze counters after handling an overflow interrupt
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Don't share the overflow interrupt, and keep it pinned
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Accept an overflow interrupt on MSI message number 0
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Fix the counter overflow delta fixup
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Clear stale event fields before reprogramming a counter
Dave Jiang <dave.jiang@intel.com>
perf/cxl: Program the requested event group on configurable counters
Jan Stancek <jstancek@redhat.com>
.gitignore: drop Module.markers
Linus Walleij <linusw@kernel.org>
dt-bindings: power: supply: ab8500: Add AB8505 charger
Zhihao Cheng <chengzhihao1@huawei.com>
md: Fix the null-ptr-deref of 'mddev->private' while submitting IO
Ryan Brue <ryanbrue.dev@gmail.com>
power: supply: bq24190_charger: don't reset registers across system suspend
Sakari Ailus <sakari.ailus@linux.intel.com>
power: supply: bq24190: Remove redundant pm_runtime_mark_last_busy() calls
Chen-Yu Tsai <wens@kernel.org>
dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6
Sang-Hoon Choi <csh0052@gmail.com>
md/raid5: protect big_stripe_tree lookup with RCU
Linkai Gong <gonglinkai@kylinos.cn>
clk: imx: composite-93: return timeout from gate enable
Li Youhong <liyouhong@kylinos.cn>
md/raid5: drain released_stripes before destroying the cache
Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
md: take reconfig_mutex when enabling PPL on an inactive array
Aristo Chen <aristo.chen@canonical.com>
phy: freescale: fsl-samsung-hdmi: initialize default rate
Pei Xiao <xiaopei01@kylinos.cn>
phy: freescale: fsl-samsung-hdmi: Use helper function devm_clk_get_enabled()
Adam Ford <aford173@gmail.com>
phy: freescale: fsl-samsung-hdmi: Support dynamic integer
Adam Ford <aford173@gmail.com>
phy: freescale: fsl-samsung-hdmi: Simplify REG21_PMS_S_MASK lookup
Adam Ford <aford173@gmail.com>
phy: freescale: fsl-samsung-hdmi: Replace register defines with macro
Laurence Oberman <loberman@redhat.com>
scsi: st: Record the tape position after a successful MTLOAD
Laurence Oberman <loberman@redhat.com>
scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Validate the access parameters of WRITE ATOMIC (16)
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Map the region written by WRITE ATOMIC (16)
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Refuse a short WRITE ATOMIC (16) before writing it
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Take the zone metadata lock before the data lock
Niklas Cassel <cassel@kernel.org>
scsi: scsi_debug: Refuse a negative physblk_exp
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Handle rk_udphy_reset_deassert errors
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Avoid xHCI SErrors
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Rename mode_change to phy_needs_reinit
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Hold mutex in DP PHY configure
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Drop DP HPD handling
Zhang Yubing <yubing.zhang@rock-chips.com>
phy: rockchip: usbdp: Support single-lane DP
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Add missing mode_change update
Frank Wang <frank.wang@rock-chips.com>
phy: rockchip: usbdp: add rk3576 device match data
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Limit DP lane count to muxed lanes
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Drop seamless DP takeover
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Handle missing clock-names DT property gracefully
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Fix devm_clk_bulk_get_all check
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Do not lose USB3 PHY status
Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: usbdp: Update mode_change after error handling
Akash Sukhavasi <akash.sukhavasi@gmail.com>
phy: HiSilicon: Fix error handling in hi3670_pcie_allclk_ctrl()
Joonhoe Kim <26rote@gmail.com>
drm/msm/dpu: compute the CRTC bandwidth from the state being checked
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus()
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drm/msm/dpu: drop core_clk_rate overrides from _dpu_core_perf_calc_crtc
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drm/msm/dpu: make fix_core_ab_vote consistent with fix_core_ib_vote
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drm/msm/dpu: change ib values to u32
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drm/msm/dpu: extract bandwidth aggregation function
Joonhoe Kim <26rote@gmail.com>
drm/msm/dpu: disable the slave encoder before the master
Oleg Keri <okerixx@gmail.com>
drm/msm/dp: don't report link training success after a reinit
Yuho Choi <dbgh9129@gmail.com>
soc/tegra: flowctrl: Release OF node reference on error
Igor Velkov <iav@iav.lv>
arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz
Igor Velkov <iav@iav.lv>
arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins
Mostafa Saleh <smostafa@google.com>
iommu/arm-smmu-v3-test: Fix arm_smmu_v3_test_debug_print_used_bits()
Mostafa Saleh <smostafa@google.com>
iommu/arm-smmu-v3: Ensure L2 tables are visible before L1 ptrs
Yuri Zaporozhets <yuriz@vodafonemail.de>
ASoC: dwc: Use OF match data again for StarFive JH7110
Matthias Goergens <matthias.goergens@gmail.com>
isofs: return long Joliet names whole
Slavin Liu <bolin.liu@seu.edu.cn>
clocksource/drivers/dbx500-prcmu: Check timer register mapping
Thorsten Blum <blum@kernel.org>
hwrng: intel - return -ENOMEM when ioremap() fails
Takashi Iwai <tiwai@suse.de>
ALSA: ump: Avoid dereference with max_src_size=0
Liu Dalin <liudalin@kylinsec.com.cn>
rtc: ftrtc010: fix integer overflow in time calculation
Thorsten Blum <blum@kernel.org>
hwrng: intel - return -ENOMEM when kmalloc_obj() fails
Herbert Xu <herbert@gondor.apana.org.au>
crypto: tcrypt - Avoid reading req->base after submission
Karl Mehltretter <kmehltretter@gmail.com>
crypto: atmel - handle authenc requests without plaintext
Bartosz Szpila <bszpila@google.com>
platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data
Hemanth Selam <hemanth.selam@gmail.com>
nvdimm/pmem: Release gendisk on probe failure
Mikko Perttunen <mperttunen@nvidia.com>
drm/tegra: Drop reference on postfence
Mikko Perttunen <mperttunen@nvidia.com>
drm/tegra: Don't pass an ERR_PTR to drm_syncobj_replace_fence()
Mikko Perttunen <mperttunen@nvidia.com>
drm/tegra: Fix syncobj_in wait return value check
Lance Yang <lance.yang@linux.dev>
mm/memory_hotplug: fix missing rollback in __add_pages()
Chuanhong Guo <gch981213@gmail.com>
pinctrl: mediatek: mt7629: fix the 2.4 GHz Wi-Fi pin mode array
Mario Limonciello <mario.limonciello@amd.com>
cpufreq: amd-pstate: Propagate cppc_set_auto_sel() errors on mode change
Mario Limonciello <mario.limonciello@amd.com>
cpufreq: amd-pstate: Restore previous mode when changing driver mode fails
Ian Rogers <irogers@google.com>
perf thread_map: Add thread_map__tgid()
Arnaldo Carvalho de Melo <acme@redhat.com>
perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h
Ian Rogers <irogers@google.com>
perf trace: Copy sockaddr arguments by their length
Shuming Fan <shumingf@realtek.com>
ASoC: rt712: avoid duplicate reset in io_init
Yichong Chen <chenyichong@uniontech.com>
debugfs: make debugfs_create_str() read-only
Ruoyu Wang <ruoyuw560@gmail.com>
misc: nsm: fix CBOR short-length decoding
Jasper Wise <jaspwise@amazon.co.uk>
misc: nsm: mark device ready before registering the hwrng and misc device
Linkai Gong <gonglinkai@kylinos.cn>
misc: enclosure: fix UAF on device_register() failure
Omar Ramadan <omar@blockcast.net>
amt: pull the AMT header behind the transport header in amt_parse_type()
Yuya Kusakabe <yuya.kusakabe@gmail.com>
seg6: fix HMAC validation when an extension header precedes the SRH
Mateusz Nowicki <mateusz.nowicki@posteo.net>
arm64: dts: st: fix sai3b unit address on stm32mp231
Weigang He <geoffreyhe2@gmail.com>
ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus()
Weigang He <geoffreyhe2@gmail.com>
ARM: vexpress: fix device_node refcount leak in vexpress_flags_set()
Liu Dalin <liudalin@kylinsec.com.cn>
rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove
Liu Dalin <liudalin@kylinsec.com.cn>
rtc: ftrtc010: fix clock resource leak on probe failure
André Draszik <andre.draszik@linaro.org>
rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member
Ze Huang <ze.huang@oss.qualcomm.com>
drm/imx/lcdc: avoid duplicate clk_per enable
Karl Mehltretter <kmehltretter@gmail.com>
OPP: Fix the return value in dev_pm_opp_get_of_node() kernel-doc
Lucas Costa <2000.costalucas@gmail.com>
staging: sm750fb: free cmap on framebuffer release
Xilin Wu <sophon@radxa.com>
drm/msm/dp: Initialize the debugfs connector pointer
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drm/msm/mdp5: drop cursor pipe for msm8x76
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
dt-bindings: display/msm: hdmi: Correct name of disallowed supplies
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
drm/msm: Properly handle msm_ioremap() without name
Przemek Kitszel <przemyslaw.kitszel@intel.com>
ice: skip stats handling for channel VSIs on rebuild
Qingfang Deng <qingfang.deng@linux.dev>
ARM: mvebu: fix Cortex-A9 errata selection for Armada 38x
Matthias Goergens <matthias.goergens@gmail.com>
x86/hibernate: Ignore page-zero RAM in E820 checksum
Nicolo Giuliani <nicolo.giuliani6@studio.unibo.it>
dt-bindings: vendor-prefixes: Add Sophos
Danish Khateeb <danishkhateeb03@gmail.com>
tools/nolibc: check for overflow in malloc()
Danish Khateeb <danishkhateeb03@gmail.com>
tools/nolibc: stop rounding malloc() sizes up to 4096 bytes
Arnd Bergmann <arnd@arndb.de>
f2fs: quota: fix unused-label warning
Andreas Kemnade <andreas@kemnade.info>
rtc: bd70528: properly enable wakeup
Nguyễn Văn Cao Nguyên <nguyennvc@greennode.ai>
RDMA/irdma: Do not move a fresh RoCE QP to ERROR on RESET
Nicolas Schier <n.schier@fritz.com>
kconfig: tests: Provide defconfig outfile for savedefconfig
Wentao Liang <vulab@iscas.ac.cn>
pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe()
Wentao Liang <vulab@iscas.ac.cn>
pinctrl: nuvoton: Fix clock reference leak in ma35_get_bank_data()
Hongyan Xu <getshell@seu.edu.cn>
RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit
Hongyan Xu <getshell@seu.edu.cn>
RDMA/hfi1: shut down the trap timer before unregistering
Serhat Kumral <serhatkumral1@gmail.com>
RDMA/siw: Fix length of first chunk in siw_try_1seg()
Quanye Yang <quanyeyang@proton.me>
RDMA/rtrs-clt: Validate peer-supplied IO completion msg_id
Alireza Haghdoost <haghdoost@uber.com>
perf symbols: Don't let a module's last symbol overlap the next module
Qingshuang Fu <fuqingshuang@kylinos.cn>
selftests/timers: clocksource-switch: Fix unchecked open()/read()
Abdifatah Suruur <suruurism@gmail.com>
vfio/cdx: prevent read-only region mappings from becoming writable
Abdifatah Suruur <suruurism@gmail.com>
vfio/fsl-mc: prevent read-only region mappings from becoming writable
Abdifatah Suruur <suruurism@gmail.com>
vfio/platform: prevent read-only region mappings from becoming writable
Quanye Yang <quanyeyang@proton.me>
RDMA/rtrs-clt: Don't WARN on unexpected info-response opcode
Karl Mehltretter <kmehltretter@gmail.com>
time: Prevent time64_to_tm() day truncation on 32-bit
Jiale Yao <yaojiale02@163.com>
RDMA/cxgb4: Do not allow userspace to write the status page
Jiale Yao <yaojiale02@163.com>
RDMA/mlx4: Do not allow the user to write to the clock page
Jiale Yao <yaojiale02@163.com>
RDMA/mad: Reject receive completions shorter than GRH
Ian Rogers <irogers@google.com>
perf python: Initialize debug output on module load
Quanye Yang <quanyeyang@proton.me>
RDMA/rtrs-clt: Reject invalid queue_depth from the peer
Yili Zhang <zhangyili01@baidu.com>
RDMA/nldev: Fix NULL deref in dumps of objects abandoned by DRIVER_FAILURE
Pengpeng Hou <hppiscas@163.com>
clk: si5351: fail prepare when PLL reset times out
Myeonghun Pak <mhun512@gmail.com>
clk: ti: adpll: unregister OF clock provider on remove
Dairui Zhang <zhangdairui@gmail.com>
IB/mad: fix UAF and double-free in RMPP receive reassembly
Ruoyu Wang <ruoyuw560@gmail.com>
media: venus: Drop session events without an instance
Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection
Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Fix the PD and DPI table size
Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv()
Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Validate SRQ max_sge at create time
Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Detect wrong sge_len passed for inline
Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Fix integer overflow in send payload size computation
Finn Thain <fthain@linux-m68k.org>
swim3: Fix FDEJECT ioctl for exclusive open
Finn Thain <fthain@linux-m68k.org>
swim: Fix FDEJECT ioctl for exclusive open
Finn Thain <fthain@linux-m68k.org>
swim: Return -EROFS when opened with BLK_OPEN_WRITE flag
Logan Odell <loganodell@google.com>
PCI/IOV: Read VF config values that need not match PF
Peng Fan <peng.fan@nxp.com>
arm64: dts: imx93-9x9-qsb: fix reserved memory node names for remoteproc
Peng Fan <peng.fan@nxp.com>
arm64: dts: imx93-14x14-evk: fix reserved memory node names for remoteproc
Peng Fan <peng.fan@nxp.com>
arm64: dts: imx8ulp-evk: fix reserved memory node names for remoteproc
Peng Fan <peng.fan@nxp.com>
arm64: dts: imx8qm-mek: fix reserved memory node names for remoteproc
Peng Fan <peng.fan@nxp.com>
arm64: dts: imx8dxl-evk: fix reserved memory node names for remoteproc
Li RongQing <lirongqing@baidu.com>
IB/isert: Don't share drop_cmd_list across concurrent connection teardowns
Li RongQing <lirongqing@baidu.com>
RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment
Waiman Long <longman@redhat.com>
cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only
Waiman Long <longman@redhat.com>
cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing
Xiang Mei (Microsoft) <xmei5@asu.edu>
fs/ntfs3: fix slab-out-of-bounds write in attr_insert_range()
Karl Mehltretter <kmehltretter@gmail.com>
soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc
Karl Mehltretter <kmehltretter@gmail.com>
soc: ti: k3-ringacc: Correct ring API kernel-doc
Ian Rogers <irogers@google.com>
perf vendor events intel: Fix snowridgex umask encoding.
Ian Rogers <irogers@google.com>
perf vendor events intel: Fix skylakex umask encoding.
Ian Rogers <irogers@google.com>
perf vendor events intel: Fix sierraforest umask encoding.
Ian Rogers <irogers@google.com>
perf build: Clean libperf-gtk.so in 'make clean'
Ian Rogers <irogers@google.com>
perf test code-reading: Fix duplicate kernel maps and machine leak
Ian Rogers <irogers@google.com>
perf machine: Explicitly pass in host perf_env
Ian Rogers <irogers@google.com>
perf test: Avoid use perf_env
Ian Rogers <irogers@google.com>
perf debug: Add function symbols to dump_stack
Ian Rogers <irogers@google.com>
perf machine: Factor creating a "live" machine out of dwarf-unwind
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192-mt6359: Fix error handling in MTKAIF calibration
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: Propagate errors in I2S DAI DAPM event handlers
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: Propagate errors in TDM DAI DAPM event handlers
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: Propagate mt8192_afe_gpio_request() errors in ADDA DAI
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: Handle regcache_sync() failure in runtime resume
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: check return values in mt8192_afe_gpio_init()
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: Propagate errors in mt8192_afe_gpio_request()
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: switch to devm_clk_get_optional()
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: fix MCK clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: fix error handling in APLL enable functions
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: fix AFE clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8192: fix APLL mux error handling
Ovidiu Panait <ovidiu.panait.rb@renesas.com>
spi: rspi: Fix DMA mode when the DMA controller is built as a module
Niko Huuskonen <niko.huuskonen.00@gmail.com>
ALSA: caiaq: Fix the Kore controller key map
Niko Huuskonen <niko.huuskonen.00@gmail.com>
ALSA: caiaq: Serialize access to the EP1 command buffer
Arka Mondal <arka@arkamondal.net>
iio: dac: ad5758: Fix the offset calculation
Arka Mondal <arka@arkamondal.net>
iio: dac: ad5758: Reject out-of-range raw values
Arka Mondal <arka@arkamondal.net>
iio: dac: ad5758: Fix alignment for DMA safety
Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
staging: iio: adc: ad7816: Protect sysfs attributes with mutex
Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
staging: iio: adc: ad7816: Serialize SPI operations
Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
staging: iio: adc: ad7816: Sort headers alphabetically
Chen-Yu Tsai <wenst@chromium.org>
drm/exynos/fimd: fix register offset type in fimd_trigger()
Runyu Xiao <runyu.xiao@seu.edu.cn>
ALSA: via82xx: use helper to activate DXS controls
Runyu Xiao <runyu.xiao@seu.edu.cn>
ALSA: oxygen: use helper to activate the SPDIF PCM control
Takashi Iwai <tiwai@suse.de>
ALSA: oxygen: Use guard() for mutex locks
Yibo Tan <lhfff@tju.edu.cn>
ASoC: amd: acp3x-es83xx: Keep an owned codec device reference
Yibo Tan <lhfff@tju.edu.cn>
ASoC: amd: acp-es8336: Use an owned codec device reference
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Initialize QP/RQ/SQ resource refcount before publishing it
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Set RQ event handler for raw-packet QP
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Set SRQ event handler before xarray insertion
Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Set WQ event handler before firmware RQ insertion
Yishai Hadas <yishaih@nvidia.com>
RDMA/hns: Pin CQ buffer writable to match device DMA write access
Ginger Li <ginger.jzllee@gmail.com>
wifi: mac80211: Fix a race when expiring a mesh path
Mateusz Nowicki <mateusz.nowicki@posteo.net>
arm64: dts: st: fix arm,smc-id of the SMC watchdog on stm32mp2
Alexandre Torgue <alexandre.torgue@foss.st.com>
arm64: dts: st: introduce stm32mp23 SoCs family
Guanghui Feng <guanghuifeng@linux.alibaba.com>
iommu/vt-d: Fix IQE handling to cover all descriptors in submission range
Abel Vesa <abel.vesa@oss.qualcomm.com>
arm64: dts: qcom: sm8150: Use SM8150_CX for the SDHC power domain
Myeonghun Pak <mhun512@gmail.com>
PCI: aardvark: Disable PHY on probe failures
Linus Walleij <linusw@kernel.org>
ARM: dts: gemini: Use a level-high interrupt for TVE200
Fernando Fernandez Mancera <fmancera@suse.de>
netfilter: synproxy: fix reset of ct seqadj when reopening a connection
Akhil P Oommen <akhilpo@oss.qualcomm.com>
drm/msm/a6xx: Fix secondary rail vote in ARC votes
Daniel Palmer <daniel@0x0f.com>
m68k: apollo: Fix interrupt setup
Shashank Mohan Jain <jain.sm@gmail.com>
bitmap: bitmap_parselist(): don't wrap around on a huge group size
Shashank Mohan Jain <jain.sm@gmail.com>
bitmap: bitmap_parselist(): reject trailing characters after group size
Shashank Mohan Jain <jain.sm@gmail.com>
bitmap: bitmap_parse(): reject non-hex character before 8 digits
WangYuli <wangyuli@uniontech.com>
MIPS: Only check -msym32 when need-compiler
Orgad Shaneh <orgads@gmail.com>
MIPS: Octeon: size the swiotlb for a modular OHCI platform driver
Peter Wang <peter.wang@mediatek.com>
scsi: ufs: core: Serialize AHIT register access between sysfs and host driver
Aaron Kling <webgeek1234@gmail.com>
dt-bindings: vendor-prefixes: Add Retroid Pocket
Marek Vasut <marek.vasut+renesas@mailbox.org>
dt-bindings: vendor-prefixes: Add Retronix Technology Inc.
Adam Skladowski <a39.skl@gmail.com>
dt-bindings: vendor-prefixes: Add LeEco
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
ARM: dts: qcom: msm8974: add MDSS reset
Luca Weiss <luca@lucaweiss.eu>
ARM: dts: qcom: msm8974: Sort header includes alphabetically
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
ARM: dts: qcom: msm8974: Use the header with DSI phy clock IDs
Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
arm64: dts: qcom: lemans-ride-common: fix SerDes PHY regulator supplies
Bruno Produit <bruno.produit@trailofbits.com>
hfs/hfsplus: serialize B-tree close against folio release
Paul Sajna <sajattack@postmarketos.org>
arm64: dts: qcom: sdm845-lg: fix sdcard pinctrl nodes
Aaron Kling <webgeek1234@gmail.com>
dt-bindings: vendor-prefixes: Add Chip Wealth Technology
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8183: Fix APLL enable error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8183: Fix clock handling in mux disable path
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8183: Fix wrong clock cleanup on clk_set_parent() failure
Sudeep Holla <sudeep.holla@kernel.org>
ACPI: PCC: Preserve shared memory signature in OpRegion handler
Sudeep Holla <sudeep.holla@arm.com>
ACPI: PCC: Simplify PCC shared memory region handling
Arnaldo Carvalho de Melo <acme@redhat.com>
perf annotate-data: Resolve type DIEs in the debug file they came from
Sudeep Holla <sudeep.holla@kernel.org>
ACPICA: Fix PCC OperationRegion command offsets
Breno Leitao <leitao@debian.org>
ACPICA: Fix memory leak in acpi_ds_create_field()
Xin Yin <yinxin.x@bytedance.com>
writeback: size foreign flushes by target wb dirty pages
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
wifi: ath11k: fix reg_info_store leak in ath11k_service_ready_ext_event()
Qingfang Deng <qingfang.deng@linux.dev>
mtd: block: prevent reclaim I/O during request processing
Jiebin Sun <jiebin.sun@intel.com>
perf c2c: Fix documented default coalesce fields
Muzaffer Kadir <muzafferkadir@mainlining.org>
dt-bindings: vendor-prefixes: Add General Mobile
Abel Vesa <abel.vesa@oss.qualcomm.com>
arm64: dts: qcom: x1e80100-qcp: Mark the EC reset gpio as reserved
Abel Vesa <abel.vesa@oss.qualcomm.com>
arm64: dts: qcom: x1e80100-yoga-slim7x: Mark the EC reset gpio as reserved
Shrikanth Hegde <sshegde@linux.ibm.com>
powerpc/ftrace: Don't restore r13 during ftrace_regs_caller
Rob Herring (Arm) <robh@kernel.org>
dt-bindings: arm: mediatek: Fix MT6779 audsys compatible
Pengpeng Hou <hppiscas@163.com>
iio: accel: bma220: publish the SPI driver ACPI alias
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt5665: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt5660: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt5659: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt5616: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1318: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1308: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1305: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1016: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: rt1011: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: nau8540: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: es8316: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: ak4642: return cache sync errors from resume
Pengpeng Hou <pengpeng@iscas.ac.cn>
ASoC: adau17x1: return cache sync errors from resume
Slavin Liu <bolin.liu@seu.edu.cn>
ASoC: fsl_asrc: check the second front-end DMA channel
Pu Lehui <pulehui@huawei.com>
bpf: Adjust bpf_func to account for CFI offset in bpf_jit_free on riscv
Chuck Lever <chuck.lever@oracle.com>
NFS: use TCP for MOUNT when xprtsec= selects TLS
Thomas Falcon <thomas.falcon@intel.com>
perf mem: Fix size tracking for mem_lvl's in perf_script__meminfo_scnprintf()
Shengjiu Wang <shengjiu.wang@nxp.com>
ASoC: fsl_asrc: use regmap_write_bits to update clock source registers
Dmitrii Tulnov <tulnov.dl@gmail.com>
kconfig: warn about malformed KCONFIG_PROBABILITY values
Myeonghun Pak <mhun512@gmail.com>
mfd: da9150: Balance IRQ wake on teardown
Myeonghun Pak <mhun512@gmail.com>
mfd: intel_quark_i2c_gpio: Manage the fixed-rate clock
Eric Anderson <ejona86@gmail.com>
mfd: rk8xx: Register poweroff handler in atomic phase
Jiale Yao <yaojiale02@163.com>
ext2: drain in-flight DIO before buffered write fallback
Karl Mehltretter <kmehltretter@gmail.com>
iommufd: Fix iommufd_hw_capabilities reference in kernel-doc
Hui Su <sh_def@163.com>
bpftool: Fix CPU IDs in per-CPU map output
Danish Khateeb <danishkhateeb03@gmail.com>
tools/nolibc: fix WIFSIGNALED() for status 0
Esteban Urrutia <esteuwu@proton.me>
clk: qcom: alpha-pll: Check Lucid Ole PLL status before configuring
Esteban Urrutia <esteuwu@proton.me>
clk: qcom: dispcc-sm8450: Fix disp_cc_mdss_mdp_clk_src ops
Vincent Jardin <vjardin@free.fr>
dt-bindings: vendor-prefixes: add Free Mobile
Linus Walleij <linusw@kernel.org>
ARM: dts: ux500: Convert HREF audio to audio-graph-card2
Zongmin Zhou <zhouzongmin@kylinos.cn>
serial: sifive: fix off-by-one in console port bounds check
Malathi A <malathi.a2000@gmail.com>
serial: 8250_uniphier: Use devm_clk_get_enabled()
Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
serial: txx9: Drop noop probe function and dangerous remove callback
Uwe Kleine-König <u.kleine-koenig@baylibre.com>
serial: Switch back to struct platform_driver::remove()
Dmitry Sinyavin <sinyavin@gmail.com>
serial: msm: select PM_OPP
Ginger Li <ginger.jzllee@gmail.com>
media: i2c: ov5648: Fix a data race on state->streaming
Finn Thain <fthain@linux-m68k.org>
swim: Don't search beyond the first data mark
Finn Thain <fthain@linux-m68k.org>
swim: Revisit delays
Finn Thain <fthain@linux-m68k.org>
swim: Check drive ready bit
Finn Thain <fthain@linux-m68k.org>
swim: Deduplicate polling loops
Finn Thain <fthain@linux-m68k.org>
swim: Remove redundant RELAX actions
Finn Thain <fthain@linux-m68k.org>
swim: Convert to blocking queue
Christoph Hellwig <hch@lst.de>
block: remove BLK_MQ_F_SHOULD_MERGE
Finn Thain <fthain@linux-m68k.org>
swim: Fix buffer overflow
Finn Thain <fthain@linux-m68k.org>
swim: Don't use the mark register to read data
Finn Thain <fthain@linux-m68k.org>
swim: Check error register during sector read
Finn Thain <fthain@linux-m68k.org>
swim: Simplify return value initialization
Finn Thain <fthain@linux-m68k.org>
swim: Check for CRC errors
Finn Thain <fthain@linux-m68k.org>
swim: Handle FIFO timeout error
Finn Thain <fthain@linux-m68k.org>
swim: Add track zero recalibration delay
Finn Thain <fthain@linux-m68k.org>
swim: Recalibrate when drive is probed
Finn Thain <fthain@linux-m68k.org>
swim: Don't start motor until medium is present
Finn Thain <fthain@linux-m68k.org>
swim: Enable clock divider only where appropriate
Finn Thain <fthain@linux-m68k.org>
swim: Refactor SWIM setup
Finn Thain <fthain@linux-m68k.org>
swim: Configure parameter memory
Finn Thain <fthain@linux-m68k.org>
swim: Perform ISM/IWM mode switching according to specs
Finn Thain <fthain@linux-m68k.org>
swim: Don't disable drive after every sector
Finn Thain <fthain@linux-m68k.org>
swim: Enable the drive when probing
Finn Thain <fthain@linux-m68k.org>
swim: Select appropriate drive once only
Finn Thain <fthain@linux-m68k.org>
swim: Assert strobe with stable outputs
Li RongQing <lirongqing@baidu.com>
RDMA/mlx5: Guard steering anchor resource destruction on create error
Jiale Yao <yaojiale02@163.com>
crypto: ccp - kill v5 IRQ tasklet during teardown
Jiale Yao <yaojiale02@163.com>
crypto: ccp - kill v3 IRQ tasklet during teardown
Weili Qian <qianweili@huawei.com>
crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH
Pengpeng Hou <pengpeng@iscas.ac.cn>
crypto: starfive - propagate clock and reset errors
Jiawen Liu <1298662399@qq.com>
crypto: starfive - handle clock enable failures
Pengpeng Hou <pengpeng@iscas.ac.cn>
hwrng: starfive - propagate clock and reset errors
Wentao Liang <vulab@iscas.ac.cn>
RDMA/siw: Fix qp use-after-free in siw_get_base_qp()
Wentao Liang <vulab@iscas.ac.cn>
RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event()
Wentao Liang <vulab@iscas.ac.cn>
RDMA/cxgb4: Fix skb reference leak in rx_pkt()
Wentao Liang <vulab@iscas.ac.cn>
RDMA/cxgb4: Fix neigh reference leak in rx_pkt()
Kim Wooseok <5mghybrid@khu.ac.kr>
wifi: rtl8xxxu: free RX skb when URB submission fails
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ASoC: amd: acp3x-es83xx: Switch to use acpi_bus_get_primary_device()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device()
Pei Xiao <xiaopei01@kylinos.cn>
ata: pata_parport: fix parport attach idr_alloc for
Jeremy Bongio <jbongio@google.com>
RDMA/irdma: Use kvzalloc for lvl2 leafmem allocation
Francesco Dolcini <francesco.dolcini@toradex.com>
arm64: dts: ti: k3-am62-verdin: fix main_gpio0/main_gpio1 line names size
Jisheng Zhang <jszhang@kernel.org>
regulator: mp886x: fix pontential division by zero
Jisheng Zhang <jszhang@kernel.org>
regulator: mp886x: check get_voltage_sel() return value
Dmitry Antipov <dmantipov@yandex.ru>
leds: flash: Prevent using uninitialized variable in flash_fault_show()
Jacob Moroni <jmoroni@google.com>
RDMA/irdma: Fix erroneous -ENOMEM for large MR registration
Li RongQing <lirongqing@baidu.com>
RDMA/core: Fix partial copy of IPv6 flow_lbl in LAG hash skb
Arnaldo Carvalho de Melo <acme@redhat.com>
perf annotate-data: Show the sample count in the data-type browser
Cong Nguyen <congnt264@gmail.com>
leds: lm3692x: Fix regulator/gpio leak and wrong enabled state on last write failure
Ian Rogers <irogers@google.com>
perf build: Check the version of the compiler that is used
Chen Pei <cp0613@linux.alibaba.com>
perf test: Fix a leaked map reference in the arch dwarf unwind tests
Haibo Chen <haibo.chen@nxp.com>
leds: pca9532: Check i2c_smbus_read_byte_data() return value
Miles Krause <mileskrause5200@gmail.com>
leds: lp8860: Fix device_node leak in lp8860_probe()
Yogesh Gaur <yogeshgaur.83@gmail.com>
md/raid5: give the io_unit slab caches per-array names
Arnd Bergmann <arnd@arndb.de>
KMSAN: fix memset() when using fortify-source, again
Andrea Parri <parri.andrea@gmail.com>
pstore: reject persistent RAM zones too small for the buffer header
Andrea Parri <parri.andrea@gmail.com>
pstore: don't leave an ERR_PTR in the ramoops zone pointer
Leon Hwang <leon.hwang@linux.dev>
bpftool: Compute map size of light skeletons at runtime
Leon Hwang <leon.hwang@linux.dev>
bpftool: Generate skeleton for global percpu data
WanLi Niu <niuwl1@chinatelecom.cn>
bpftool: Make skeleton C++ compatible with explicit casts
Jiayuan Chen <mrpre@163.com>
bpftool: Using the right format specifiers
Neil Armstrong <neil.armstrong@linaro.org>
dt-bindings: vendor-prefixes: add vendor prefix for Nexperia B.V.
Pengpeng Hou <hppiscas@163.com>
pmdomain: imx: Propagate SCU provider registration failures
Xiang Mei <xmei5@asu.edu>
fs/ntfs3: validate $SDH entry size in ntfs_insert_security
Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3: validate EA entry layout against ef->size in ntfs_read_ea
Zhan Xusheng <zhanxusheng1024@gmail.com>
fs/ntfs3: fix valid_size not being updated in attr_allocate_frame()
Xiang Mei (Microsoft) <xmei5@asu.edu>
fs/ntfs3: check INDEX_ROOT resident size before use in ntfs_read_mft()
Andrew Gaylard <ag@ffroot.co.za>
pinctrl: fix PINCTRL_SPPCTL=m
Daniel Borkmann <daniel@iogearbox.net>
bpf, lsm: Reject writes into the BPF LSM program context
Slavin Liu <bolin.liu@seu.edu.cn>
clk: starfive: jh7110: reject oscillator lookup errors
Wentao Liang <vulab@iscas.ac.cn>
clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
Triet Hoang <triet.hoang.dev@gmail.com>
clk: raspberrypi: Handle cpufreq device registration failure
Karl Asseily <karl@asseily.com>
dt-bindings: vendor-prefixes: add ESS Technology
Alejandro Lucero <alucerop@amd.com>
ACPI: HMAT: preserve hmat_adist_nb notifier block
Felix Gu <ustc.gu@gmail.com>
spi: mxic: fix ps_clk leak in runtime resume
Christian Loehle <christian.loehle@arm.com>
ACPI: CPPC: Validate the _CPC package header
Li RongQing <lirongqing@baidu.com>
RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT
Li RongQing <lirongqing@baidu.com>
RDMA/restrack: Don't set RESTRACK_DD mark after a failed xa_insert()
Li RongQing <lirongqing@baidu.com>
RDMA/core: Fix swapped list_add_tail() arguments in ib_add_sub_device()
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
interconnect: qcom: use 64-bit SMD RPM bus votes
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
interconnect: qcom: icc-rpm: Handle icc_link_create() failures
Myeonghun Pak <mhun512@gmail.com>
interconnect: exynos: Remove the PM QoS request on unbind
Slavin Liu <bolin.liu@seu.edu.cn>
crypto: atmel-sha - reject initialization without a device
Ahsan Atta <ahsan.atta@intel.com>
crypto: qat - fix active_devs leak on crypto alg registration failure
Guixin Liu <kanie@linux.alibaba.com>
cxl/port: Fix uninitialized coordinates reported for RCDs
Guixin Liu <kanie@linux.alibaba.com>
cxl/pci: Skip reset detection for DVSEC emulated decoders
Julian Braha <julianbraha@gmail.com>
kconfig: fix extra output from savedefconfig on out-of-range defaults
Felix Gu <ustc.gu@gmail.com>
PCI: dra7xx: Fix clock enable leak on probe failure
vladimir.oltean@nxp.com <vladimir.oltean@nxp.com>
PCI: dra7xx: Remove device links to PHY
Longlong Xia <xialonglong@kylinos.cn>
rcu: fix shrink budget underflow in lazy_rcu_shrink_scan
Joel Fernandes <joelagnelf@nvidia.com>
rcu/nocb: Remove unnecessary WakeOvfIsDeferred wake path
Frederic Weisbecker <frederic@kernel.org>
Revert "rcu/nocb: Fix rcuog wake-up from offline softirq"
Mingpei CAO <caomingpei@gmail.com>
libbpf: Reject local struct_ops bitfields before data access
Nikolay Borisov <nik.borisov@suse.com>
ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails
Hari Mishal <harimishal1@gmail.com>
drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters
Lijo Lazar <lijo.lazar@amd.com>
drm/amdgpu: bounds check ATOM IIO table parsing
Lijo Lazar <lijo.lazar@amd.com>
drm/amdgpu: Print full vbios info
Mario Limonciello (AMD) <superm1@kernel.org>
drm/amd: Add correct prefix for VBIOS message
Lijo Lazar <lijo.lazar@amd.com>
drm/amdgpu: Add vbios build number interface
Hari Mishal <harimishal1@gmail.com>
drm/amd/pm: bound SCLK FCW range entries to the table size
Pengpeng Hou <hppiscas@163.com>
clk: milbeaut: Return divider update timeouts
Pengpeng Hou <pengpeng@iscas.ac.cn>
clk: si521xx: correct the SI52147 OF output enable map
Zizhi Wo <wozizhi@huawei.com>
md/raid5: reject a per-device size smaller than one chunk
Zhihao Cheng <chengzhihao1@huawei.com>
md/raid5: setup_conf: Fix null-ptr-def in error handling path
Chen Cheng <chencheng@fnnas.com>
md/raid5: reject raid4/5 arrays with too few disks
Yogesh Gaur <yogeshgaur.83@gmail.com>
md/raid5: don't BUG() on an inconsistent reshape state from the superblock
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
md: reject v0.90 arrays with too many devices
Zizhi Wo <wozizhi@huawei.com>
md/raid10: fix missing wakeup in wait_barrier_nolock
Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers
Bart Van Assche <bvanassche@acm.org>
scsi: pm8001: Fix SATA FIS offset in struct hw_event_resp
Ștefan Ghețu <stefanghetu9@gmail.com>
ASoC: SOF: imx: Prevent stack OOB read in DSP panic dump
Karl Mehltretter <kmehltretter@gmail.com>
pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default
Stephane Danieau <stephane.danieau@foss.st.com>
pinctrl: stm32: Allow compile as module for stm32mp257
Antonio Borneo <antonio.borneo@foss.st.com>
pinctrl: stm32: Declare stm32_pmx_get_mode() as static
Alison Schofield <alison.schofield@intel.com>
cxl/hdm: Make switch decoder target parsing endian-safe
Dave Jiang <dave.jiang@intel.com>
cxl: Add a cached copy of target_map to cxl_decoder
Alison Schofield <alison.schofield@intel.com>
cxl/hdm: Reject switch decoder interleave ways that overflow targets
Slavin Liu <bolin.liu@seu.edu.cn>
ACPI: tables: handle failed initrd override mappings
Chen-Yu Tsai <wenst@chromium.org>
arm64: dts: mediatek: mt8173: Fix MFG_ASYNC power domain clock
Sarthak Sharma <sarthak.sharma@arm.com>
mm/gup_test: report actual pinned bytes
Sarthak Sharma <sarthak.sharma@arm.com>
mm/gup_test: safely calculate GUP batch size
Samuel Moelius <sam.moelius@trailofbits.com>
mm/gup_test: reject wrapped user ranges
Weiming Shi <bestswngs@gmail.com>
ntfs3: fix out-of-bounds read in ntfs_read_mft()
Luka Gejak <luka.gejak@linux.dev>
wifi: rtw88: sdio: zero the padding added to a TX transfer
Karl Mehltretter <kmehltretter@gmail.com>
loadpin: Fix stale KEXEC_VERIFY_SIG reference in documentation
Rosen Penev <rosenp@gmail.com>
dmaengine: mv_xor: kill tasklet on channel add error path
Yonghao Zhang <hyz3367@gmail.com>
remoteproc: core: Set trace buffer name for diagnostics
Karl Mehltretter <kmehltretter@gmail.com>
block: Fix the thaw_bdev reference in bdev_freeze() kernel-doc
Guangshuo Li <lgs201920130244@gmail.com>
media: i2c: ar0521: remove duplicate media entity cleanup
Li RongQing <lirongqing@baidu.com>
RDMA/uverbs: Make CQ handle mandatory for WQ creation
Nicolas Morey <nmorey@suse.com>
RDMA/rxe: Use validated num_sge in local buffer
Miles Krause <mileskrause5200@gmail.com>
memory: emif: fix device_node reference leak on np_ddr
Gregory CLEMENT <gregory.clement@bootlin.com>
phy: cadence: Sierra: Do not modify register when getting parent clock
Haotian Zhang <vulab@iscas.ac.cn>
phy: hisilicon: hi3670: Fix OF node and device reference leaks
Linkai Gong <gonglinkai@kylinos.cn>
firmware: imx: dsp: fix mailbox channel leak on kasprintf failure
Jianan Huang <jnhuang95@gmail.com>
f2fs: quota: fix stale lock holder on remount failure
Jérôme Pouiller <jerome.pouiller@silabs.com>
wifi: wfx: fix use-after-free of the cooling work on device removal
Takahiro Kuwano <takahiro.kuwano@infineon.com>
mtd: spi-nor: spansion: Remove s25fs256s0
Julius Bairaktaris <julius@bairaktaris.de>
wifi: mac80211: don't reset the TXQ scheduling round number
Karl Mehltretter <kmehltretter@gmail.com>
wifi: mac80211: Fix the return value in mesh_path_add() kernel-doc
Fuad Tabba <fuad.tabba@linux.dev>
arm64: pi: Run the source checker on the libfdt objects under C=2
Thomas Weißschuh <linux@weissschuh.net>
microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS
Thomas Weißschuh <linux@weissschuh.net>
microblaze: uaccess: Zero out destination on failed get_user()
Linkai Gong <gonglinkai@kylinos.cn>
pinctrl: amd: add timeout to irq-enable readback
Mario Limonciello (AMD) <superm1@kernel.org>
pinctrl: amd: Don't access irq_data's hwirq member directly
Mario Limonciello (AMD) <superm1@kernel.org>
pinctrl: amd: Add PM debugging message for turning on/off wakes
Weiming Shi <bestswngs@gmail.com>
fs/ntfs3: zero frame pages on read error
Matthew Wilcox (Oracle) <willy@infradead.org>
ntfs: Do not kmap page cache pages for compression
Baolin Liu <liubaolin@kylinos.cn>
fs/ntfs3: update ctime only on successful setxattr
Weiming Shi <bestswngs@gmail.com>
fs/ntfs3: take run_lock when freeing offs_folio in ni_decompress_file
Mahe Tardy <mahe.tardy@gmail.com>
libbpf: fix log level propagation for light skeleton loaders
Tony Ambardar <tony.ambardar@gmail.com>
libbpf: Support opening bpf objects of either endianness
Karl Mehltretter <kmehltretter@gmail.com>
regulator: qcom-rpmh: Fix the return value in rpmh_regulator_vrm_get_optimum_mode() kernel-doc
Ian Rogers <irogers@google.com>
perf header: Fix potential memory corruption in cpu_cache_level__read
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: video: Fix backlight unregistration ordering
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: fan: Fix memory leak due to leftover devm_kcalloc() argument
Karl Mehltretter <kmehltretter@gmail.com>
ALSA: control: Fix virtual master creation reference in kernel-doc
Michael S. Tsirkin <mst@redhat.com>
virtio_pci_modern: move avq cleanup from reset to del_vqs
Michael S. Tsirkin <mst@redhat.com>
virtio: synchronize callbacks after device reset
Karl Mehltretter <kmehltretter@gmail.com>
gfs2: Fix the return value in gfs2_get_link() kernel-doc
Karl Mehltretter <kmehltretter@gmail.com>
ata: libata-scsi: Fix ata_scsi_hotplug() reference in kernel-doc
Karl Mehltretter <kmehltretter@gmail.com>
spi: Fix the return value in spi_new_ancillary_device() kernel-doc
Pengpeng Hou <hppiscas@163.com>
clk: s2mps11: Propagate OF provider registration failures
Geert Uytterhoeven <geert+renesas@glider.be>
clk: rs9: Add clock index range check to rs9_of_clk_get()
Karl Mehltretter <kmehltretter@gmail.com>
clk: mediatek: reset: Fix device registration kernel-doc
Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
x86/svm: Avoid sign extension of SVM_EVTINJ_VALID in 64-bit expressions
Nora Schiffer <nora.schiffer@ew.tq-group.com>
ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints
Sanghyun Park <sanghyun.park.cnu@gmail.com>
bpf: Fix program BTF use-after-free in sleepable programs
Justin Yeh <justin.yeh@mediatek.com>
HID: i2c-hid: Unfollow the panel on shutdown
Marek Vasut <marex@nabladev.com>
ARM: dts: stm32: Drop bias-disable from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a
Brian Norris <briannorris@chromium.org>
PM: runtime: Only queue an idle check for RPM-linked suppliers
Xueqin Luo <luoxueqin@kylinos.cn>
cpuidle: teo: Do not return a disabled idle state
Alain Volmat <alain.volmat@foss.st.com>
ARM: dts: stm32: add LTDC / DCMIPP access controller for STM32MP135
Ahmad Fatoum <a.fatoum@pengutronix.de>
ARM: dts: stm32: lxa-tac: change stdout-path baud rate from 9600 to 115200
Ahmad Fatoum <a.fatoum@pengutronix.de>
ARM: dts: stm32: lxa-mc1: change stdout-path baud rate from 9600 to 115200
Xueqin Luo <luoxueqin@kylinos.cn>
cpuidle: menu: Do not return a disabled idle state
Christian Loehle <christian.loehle@arm.com>
cpuidle: menu: Remove single state handling
Breno Leitao <leitao@debian.org>
cpuidle: menu: Remove incorrect unlikely() annotation
Takashi Sakamoto <o-takashi@sakamocchi.jp>
firewire: core: remove unused link field in fw_packet structure
Karl Mehltretter <kmehltretter@gmail.com>
firewire: cdev: Fix FW_CDEV_IOC_CREATE_ISO_CONTEXT references in kernel-doc
Sumeet Pawnikar <sumeet4linux@gmail.com>
thermal: gov_power_allocator: Fix NULL pointer dereference in update_tz()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: glue: Fix up and adjust acpi_unbind_one()
Jan Kara <jack@suse.cz>
gfs2: Fix journaled truncate range end offset
Jiawen Liu <1298662399@qq.com>
memory: exynos5422-dmc: handle clock enable failures
Karl Mehltretter <kmehltretter@gmail.com>
crypto: lskcipher - preserve state across unaligned chunks
Linmao Li <lilinmao@kylinos.cn>
crypto: mxs-dcp - handle zero-length skcipher requests
Ahsan Atta <ahsan.atta@intel.com>
crypto: qat - release instance on DH fallback allocation failure
Ahsan Atta <ahsan.atta@intel.com>
crypto: qat - avoid OOB read when stripping RSA leading zeros
Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
crypto: amlogic - Fix DMA memory leak in cipher error path
Eric Dumazet <edumazet@google.com>
ip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setup
Eric Dumazet <edumazet@google.com>
sit: fix UAF in ipip6_tunnel_del_prl()
Luca Weiss <luca.weiss@fairphone.com>
arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON
Linus Walleij <linusw@kernel.org>
regulator: ab8500: Propagate mode enable read errors
Linus Walleij <linusw@kernel.org>
regulator: ab8500: Test dedicated enable bits only
Linus Walleij <linusw@kernel.org>
regulator: ab8500: Treat cut 1.0 VAUX3 as fixed
Linus Walleij <linusw@kernel.org>
regulator: ab8500: Handle AB8505 VINTCORE selector 7
Linus Walleij <linusw@kernel.org>
regulator: ab8500: Add AB8505 VAUX3 3.05 V setting
Babanpreet Singh <bbnpreetsingh@gmail.com>
regulator: ab8500: Remove stale expand_register kernel-doc entry
Linus Walleij <linusw@kernel.org>
regulator: ab8500: Fix AB8505 VANA voltage selectors
Koichiro Den <den@valinux.co.jp>
PCI: endpoint: pci-epf-vntb: Serialize virtual PCI bus scan
Jia Wang <wangjia@ultrarisc.com>
dmaengine: dw-axi-dmac: Fix CH_CFG2 channel priority position
Jia Wang <wangjia@ultrarisc.com>
dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access
Jia Wang <wangjia@ultrarisc.com>
dmaengine: dw-axi-dmac: Fix AXI burst length encoding
Rosen Penev <rosenp@gmail.com>
dmaengine: fsl_raid: zero CF descriptor pool allocations
Keisuke Tsukuda <catnyaaan@outlook.com>
usb: gadget: f_mass_storage: ignore class requests while inactive
Keisuke Tsukuda <catnyaaan@outlook.com>
usb: gadget: composite: avoid warning on aborted delayed status
Roland Dreier <rolanddreier@rivian.com>
firmware: arm_scmi: Don't reuse raw xfers with async_done still armed
Roland Dreier <rolanddreier@rivian.com>
firmware: arm_scmi: Protect xfer->async_done with xfer->lock
Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
dmaengine: sprd: use clk_bulk API to fix clock imbalance
Pengpeng Hou <pengpeng@iscas.ac.cn>
usb: musb: da8xx: depopulate OF children on probe failure
Pengpeng Hou <pengpeng@iscas.ac.cn>
usb: musb: da8xx: depopulate OF children on remove
Arka Mondal <arka@arkamondal.net>
usb-storage: alauda: fix out-of-bounds zone index
Arka Mondal <arka@arkamondal.net>
usb-storage: alauda: check the return value of alauda_read_map()
Arka Mondal <arka@arkamondal.net>
usb-storage: alauda: do not do DMA from the stack
Yuho Choi <dbgh9129@gmail.com>
USB: pci-quirks: Release EHCI device reference
Jiangong.Han <jiangong.han@windriver.com>
USB: usbmon: fix null-ptr-deref in mon_bus_remove() when mon_bus_init() fails
Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
usb: image: microtek: stop SG processing after transfer errors
Junxian Huang <huangjunxian6@hisilicon.com>
RDMA/hns: Fix GID capacity loss in 64K system
Junxian Huang <huangjunxian6@hisilicon.com>
RDMA/hns: Limit gmv_entry_num to avoid memory waste
Yuho Choi <dbgh9129@gmail.com>
PCI: xgene: Use managed clock for PCIe controller
Shakeel Butt <shakeel.butt@linux.dev>
kernfs: fix up the unlocked attribute reads on the creation paths
Karl Mehltretter <kmehltretter@gmail.com>
efi/libstub: Fix efi_set_event_at() parameter documentation
Salah Triki <salah.triki@gmail.com>
iio: imu: adis16400: Check return value of spi_setup()
Matti Vaittinen <mazziesaccount@gmail.com>
iio: accel: kionix-kx022a: Fix IPOL macro name
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix NULL pointer dereference on PCI error recovery
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix use-after-free of the firmware event workqueue
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: zero out diagnostic buffer status memory
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds read in PCIe topology change events
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix buffer overflow in the BSG target device map
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds phy array access on link change
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds read of event data
Ranjan Kumar <ranjan.kumar@broadcom.com>
scsi: mpi3mr: Rename log data save helper to reflect threaded/BH context
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix device loss during enclosure reboot due to zero link speed
Ranjan Kumar <ranjan.kumar@broadcom.com>
scsi: mpi3mr: Event processing debug improvement
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds read in SAS topology change events
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix target device reference leak in device removal handshake
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds bitmap access during device removal
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds sense buffer access
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds reply frame access
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix buffer overflow when caching log data
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix target device reference leak in BSG task management
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix I/O block counter leak on admin request post failure
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix out-of-bounds read when copying BSG MPI requests
Chandrakanth Patil <chandrakanth.patil@broadcom.com>
scsi: mpi3mr: Fix buffer overflow in BSG passthrough request copy
Linmao Li <lilinmao@kylinos.cn>
power: supply: bq2515x: Propagate charge-enable read errors
Ryan Brue <ryanbrue.dev@gmail.com>
power: supply: bq24190_charger: use the wake irq API
Peng Fan <peng.fan@nxp.com>
PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq()
Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
PM: wakeup: implement devm_device_init_wakeup() helper
hpp.iscas <hppiscas@163.com>
power: supply: mm8013: Publish the OF module alias
Karl Mehltretter <kmehltretter@gmail.com>
power: supply: mp2629: Use the full batt_impedance_compensation name in the ABI document
Willem de Bruijn <willemb@google.com>
selftests: net: csum: filter packets by source address and port
Sean Anderson <sean.anderson@linux.dev>
selftests: net: csum: Clean up recv_verify_packet_ipv6
Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
wifi: ath12k: Free allocated external IRQs on request_irq() failure
Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
wifi: ath12k: Free allocated CE IRQs on request_irq() failure
Nicolas Escande <nico.escande@gmail.com>
wifi: ath11k: fix locking problem in ath11k_dp_rx_tid_del_func()
Mikhail Lobanov <m.lobanov@rosalinux.ru>
wifi: ath11k: modify null check logic in ath11k_ce_rx_post_pipe()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: utils: Adjust message printing macros for ACPI objects
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: scan: Stop calling acpi_bus_init_power() early
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: PCI: Introduce acpi_dev_get_pci_dev()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: PM: Drop parent state update from acpi_device_get_power()
Ian Gallagher <cdine@cdine.org>
ACPI: button: Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020) RZ09-0310
Vinod Koul <vkoul@kernel.org>
dmaengine: zynqmp_dma: drop redundant label
Srinivas Neeli <srinivas.neeli@amd.com>
dmaengine: xilinx_dma: Move descriptors to done list based on completion bit
Srinivas Neeli <srinivas.neeli@amd.com>
dmaengine: xilinx_dma: Fix MCDMA descriptor fields based on DMA direction
Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
dmaengine: dw-axi-dmac: convert clock handling to clk_bulk API
Golla Nagendra <nagendra.golla@amd.com>
dmaengine: zynqmp_dma: Fix chan probe/remove error handling
Ruoyu Wang <ruoyuw560@gmail.com>
dmaengine: img-mdc: Fix runtime PM usage counter leak
Myeonghun Pak <mhun512@gmail.com>
dmaengine: mediatek: hsdma: fix runtime PM leak on init failure
Hongling Zeng <zenghongling@kylinos.cn>
dmaengine: at_hdmac: Fix use-after-free by proper tasklet cleanup
Hongling Zeng <zenghongling@kylinos.cn>
dmaengine: sun6i-dma: Fix use-after-free in error handling paths
Karl Mehltretter <kmehltretter@gmail.com>
mtd: spinand: Fix spinand_manufacturer_ops kernel-doc
Aaron Tomlin <atomlin@atomlin.com>
perf trace: Add upper bound checks for augmented BTF struct printing
Aaron Tomlin <atomlin@atomlin.com>
perf trace: Enhance BTF type formatting to symbolise kernel function pointers
Mark Brown <broonie@kernel.org>
perf bpf: Fix up build failure due to change of btf_vlen() return type
Arnaldo Carvalho de Melo <acme@redhat.com>
perf btf: Make the sigtrap test helper to find a member by name widely available
Qiuxu Zhuo <qiuxu.zhuo@intel.com>
EDAC/i10nm: Fix Granite Rapids ADXL MC mapping
Tianyi Chen <hi@tychen.cc>
selftests/sched_ext: Handle CPU hotplug write failures
Manush Prajwal <manushprajwal555@gmail.com>
pwm: lp3943: fix NULL pointer dereference for an unconfigured channel
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt6797: fix wrong unwind order and error code in enable_clock
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8186: Fix MCK error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8186: Fix APLL enable error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8186: Fix AFE clock error handling
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8186: Fix clock handling in mux disable path
bui duc phuc <phucduc.bui@gmail.com>
ASoC: mediatek: mt8186: Fix APLL mux setting error handling
Bert Karwatzki <spasswolf@web.de>
mac80211: tx: Use info->flags in ieee80211_tx_h_select_key()
Chen-Yu Tsai <wenst@chromium.org>
pwm: mtk-disp: Fix period readback
Karl Mehltretter <kmehltretter@gmail.com>
virtio_ccw: always take irq_lock in the classic interrupt handler
Karl Mehltretter <kmehltretter@gmail.com>
virtio_ccw: fix synchronize_cbs() after interrupt fallback
Pengpeng Hou <hppiscas@163.com>
ASoC: es8326: report resume restore errors
Karl Mehltretter <kmehltretter@gmail.com>
irqchip/gic-v3-its: Don't WARN on LPI free allocation failure
Linkai Gong <gonglinkai@kylinos.cn>
drivers/base/node: fix UAF on device_register() failure
Dmitry Torokhov <dmitry.torokhov@gmail.com>
gpio: crystalcove: add missing MODULE_ALIAS()
Leon Romanovsky <leon@kernel.org>
RDMA/irdma: Preserve fast-registration IOVA on 32-bit
Mark Amirkan <markdamirkan@gmail.com>
perf evsel: Validate RAW sample before byte swapping
Mark Amirkan <markdamirkan@gmail.com>
perf evsel: Validate branch stack before byte swapping
Aaron Tomlin <atomlin@atomlin.com>
perf trace: Fix error checking in btf_struct_scnprintf()
Marcel Hofmann <marcel.hofmann@ingenics-digital.com>
remoteproc: imx_rproc: Allow mappings ending at region boundary
Felix Gu <ustc.gu@gmail.com>
spi: mtk-nor: fix runtime PM usage count leak in probe error path
Dave Jiang <dave.jiang@intel.com>
efi/cper: Read only validated fields in cper_mem_err_pack()
Dave Jiang <dave.jiang@intel.com>
ACPI: APEI: GHES: Bound CXL event record copy to the firmware section length
Dave Jiang <dave.jiang@intel.com>
ACPI: extlog: Validate elog record length before walking sections
Dave Jiang <dave.jiang@intel.com>
efi/cper: Reject an error status block length that wraps a u32
Dave Jiang <dave.jiang@intel.com>
efi/cper: Reject CPER records with an out-of-range error_data_length
Jisheng Zhang <jszhang@kernel.org>
regulator: mp886x: fix vsel_mask
Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
selftests/bpf: make cmdline_contains stricter
Eduard Zingerman <eddyz87@gmail.com>
selftests/bpf: More precise cpu_mitigations state detection
Jared McArthur <j-mcarthur@ti.com>
arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock
Chintan Vankar <c-vankar@ti.com>
arm64: dts: ti: k3-j722s-evm: Add bootph-all property to enable Ethernet boot
Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
arm64: dts: ti: j722s-evm: Add MUX to control CSI2RX
Udit Kumar <u-kumar1@ti.com>
arm64: dts: ti: k3-j722s-evm: Enable PMIC
Pengpeng Hou <pengpeng@iscas.ac.cn>
memory: brcmstb_dpfe: validate firmware section sizes
Pengpeng Hou <pengpeng@iscas.ac.cn>
irqchip/riscv-imsic: Use GENMASK for base address masks
Julius Bairaktaris <julius@bairaktaris.de>
wifi: mac80211: fix swapped fq_overlimit/fq_overmemory in aqm debugfs
Fabrice Derepas <fabrice.derepas@canonical.com>
crypto: asymmetric_keys - fix OOB read in pefile_parse_binary
Ruoyu Wang <ruoyuw560@gmail.com>
hwrng: cctrng - Fix runtime PM usage counter leak
Jérôme Pouiller <jerome.pouiller@silabs.com>
wifi: wfx: fix possible device hang during init
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup
Bert Karwatzki <spasswolf@web.de>
wifi: check if socket flags are valid
Johannes Berg <johannes.berg@intel.com>
wifi: free SKBTX_WIFI_STATUS skb tx_flags flag
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: drop encap offload frames with a tainted key
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: don't send encap offload frames unencrypted
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: fix key selection for encap offload frames
Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: fix unauthorised port check for encap offload
Paul Dolan <paul.dolan.dev@gmail.com>
selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test
Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
wifi: ath11k: fix sporadic WLAN initialization failures
Julius Bairaktaris <julius@bairaktaris.de>
wifi: ath11k: disable interrupts during firmware crash recovery
Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
clk: Use the generic OF phandle parsing in only one place
Chengchang Tang <tangchengchang@huawei.com>
RDMA/hns: Fix missing CQE when UD QP use different SL
Rosen Penev <rosenp@gmail.com>
dmaengine: fsl_raid: avoid free_q underflow in free_chan_resources
Rosen Penev <rosenp@gmail.com>
dmaengine: fsl_raid: don't invoke client callback under desc_lock
Koichiro Den <den@valinux.co.jp>
PCI: endpoint: pci-epf-vntb: Pass PF/VF number when BAR programming
Toke Høiland-Jørgensen <toke@redhat.com>
bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively
Ionut Nechita <ionut.nechita@windriver.com>
x86/crash: Reserve elfcorehdr for CONFIG_NR_CPUS, not CONFIG_NR_CPUS_DEFAULT
Richard Zhu <hongxing.zhu@nxp.com>
arm64: dts: imx95: Avoid 32-bit PCIe window System RAM overlap
Pengpeng Hou <pengpeng@iscas.ac.cn>
remoteproc: imx_dsp: Acquire runtime PM before adding carveouts
Peng Fan <peng.fan@nxp.com>
remoteproc: imx_dsp_rproc: Drop extra space
Shengjiu Wang <shengjiu.wang@nxp.com>
remoteproc: imx_dsp_rproc: Add support of recovery and coredump process
Alexander Aring <aahringo@redhat.com>
dlm: fix variable key length lookup
Joseph Qi <joseph.qi@linux.alibaba.com>
dlm: fix buffer overflow from negative len in dlm_search_rsb_tree
Danila Chernetsov <listdansp@mail.ru>
dlm: fix NULL pointer dereference in dlm_dump_rsb_name()
Danila Chernetsov <listdansp@mail.ru>
dlm: validate lock modes in recovery messages
Miklos Szeredi <mszeredi@redhat.com>
fuse: fall back to copy_splice_read() on FOPEN_DIRECT_IO
Tao Cui <cuitao@kylinos.cn>
sched_ext/scx_flatcg: Make cgv_node_less() wraparound-safe
Abdurrahman Karadag <abdurrahmankaradag19@gmail.com>
wifi: rtw88: debugfs: don't vzalloc(0) when rsvd_page is read unconfigured
Chris Morgan <macromorgan@hotmail.com>
arm64: dts: rockchip: Correct Device Orientation on Gameforce Ace
Boris Faure <boris@fau.re>
soundwire: intel: initialise quirk_mask before reading it
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
microblaze: prevent ptrace writes to MSR and pt_mode
Alexander A. Klimov <grandmaster@al2klimov.de>
microblaze: CCF: fix refcount leak
Jerome Brunet <jbrunet@baylibre.com>
clk: fix self-consuming provider module pinning
Orgad Shaneh <orgads@gmail.com>
staging: octeon: schedule the TX cleanup tasklet every 1024th packet
Myeonghun Pak <mhun512@gmail.com>
staging: rtl8723bs: disable SDIO function on block size failure
Ethan Tidmore <ethantidmore06@gmail.com>
staging: rtl8723bs: remove unused private debug counters
Michael Straube <straube.linux@gmail.com>
staging: rtl8723bs: move rtw_recv_indicatepkt to rtw_recv.c
Michael Straube <straube.linux@gmail.com>
staging: rtl8723bs: remove wrapper rtw_init_recv_timer
Michael Straube <straube.linux@gmail.com>
staging: rtl8723bs: remove return from void function
Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
staging: rtl8723bs: change remaining printk to proper api
Rob Barnes <robbarnes@google.com>
platform/chrome: cros_ec_proto: Fix deferred response
Hongyan Xu <getshell@seu.edu.cn>
soc: qcom: apr: clean up failed service registrations
Felix Gu <ustc.gu@gmail.com>
spi: omap2-mcspi: Remove unbalanced pm_runtime_put_sync() calls
Ruoyu Wang <ruoyuw560@gmail.com>
pwm: renesas-tpu: Fix runtime PM reference leak
David Heidelberg <david@ixit.cz>
ASoC: wcd-mbhc-v2: Fix incorrect properties names and typos
Cai Xinchen <caixinchen1@huawei.com>
lsm: don't call security_backing_file_free() multiple times
Runyu Xiao <runyu.xiao@seu.edu.cn>
remoteproc: xlnx: Initialize mailbox work before requesting channels
Shujath Mohd <shujath@outlook.in>
arm64: dts: qcom: sdm845-sony-xperia-tama: Fix Bluetooth UART pinctrl
Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
remoteproc: qcom_q6v5_adsp: Fix double jiffies conversion in adsp_start()
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Validate unwinding sizes against record payload
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Validate sym string NUL-termination in code load
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Validate debug entries on native (non-swap) path
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Use dirname() return value in jit_open()
Hrishikesh Suresh <hrishikesh123s@gmail.com>
perf: replace strcpy() with strncpy() in util/jitdump.c
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Free event in jit_repipe_code_move()
Ian Rogers <irogers@google.com>
perf sample: Make user_regs and intr_regs optional
Ian Rogers <irogers@google.com>
perf python: Constify variables and parameters
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Fix funlockfile on unlocked stream in jit_open() error path
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Check snprintf return before computing header size
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Bounds-check debug entry byte-swap loop
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Prevent integer underflow in debug info size calculation
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Validate code_size against total_size in code load
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Fix debug_data and unwinding_data leaks
Arnaldo Carvalho de Melo <acme@redhat.com>
perf jitdump: Fix extended header read that always fails
Breno Leitao <leitao@debian.org>
kexec_file: stop the top-down search before it underflows
Rosen Penev <rosenp@gmail.com>
ARM: dts: helios4: fix spi1 location
Rosen Penev <rosenp@gmail.com>
ARM: dts: helios4: fix vbus-supply for USB2 PHY
Rosen Penev <rosenp@gmail.com>
ARM: dts: armada-388-helios4: fix vmmc property name
Rosen Penev <rosenp@gmail.com>
ARM: dts: armada-395-gp: drop unsupported SDHCI clock-frequency
Rosen Penev <rosenp@gmail.com>
ARM: dts: armada-385-clearfog-gtr: fix vmmc property name
Rosen Penev <rosenp@gmail.com>
ARM: dts: helios4: fix lm75 supply name
Pei Xiao <xiaopei01@kylinos.cn>
ata: pata_parport: Fix use-after-free in new_device_store
Matti Vaittinen <mazziesaccount@gmail.com>
iio: pressure: rohm-bm1390: Fix AVE_NUM initialization
Salah Triki <salah.triki@gmail.com>
iio: temperature: tmp117: fix calibbias cache update on I2C write failure
Esben Haabendal <esben@geanix.com>
dt-bindings: iio: light: ltr501: Add missing ltr303 compatible
Esben Haabendal <esben@geanix.com>
dt-bindings: iio: light: ltr501: Sort compatible enum array
Adi Nata <adinata.softwareengineer@gmail.com>
iio: humidity: hts221: report available values via read_avail()
Pengpeng Hou <pengpeng@iscas.ac.cn>
spi: sh-msiof: propagate setup runtime-PM errors
Geert Uytterhoeven <geert+renesas@glider.be>
spi: sh-msiof: SITMDR1/SIRMDR1 bitfield conversion
Chandradhar Kumar <chandradhar.2003@gmail.com>
regulator: fixed: reject incompatible platform devices
Yuan Chen <chenyuan_fl@163.com>
bpftool: Fix spurious batch file read error
Tapio Reijonen <tapio.reijonen@vaisala.com>
gpio: pcf857x: implement get_direction()
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
gpio: pcf857x: use new GPIO line value setter callbacks
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
drm/panthor: Take reqs_lock in soft_reset for clearing pending_reqs
Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
selftests/bpf: Allocate a larger timeout for connection
Darren Carreras <carrerasdarren@gmail.com>
libbpf: Avoid overflow in BTF.ext bounds check
Tony Ambardar <tony.ambardar@gmail.com>
libbpf: Support BTF.ext loading and output in either endianness
Tony Ambardar <tony.ambardar@gmail.com>
libbpf: Improve log message formatting
Marek Vasut <marek.vasut+renesas@mailbox.org>
drm: of: Fix drm_of_get_data_lanes_count_ep() return value documentation
Andreas Kemnade <andreas@kemnade.info>
drm/omap: dsi: avoid sending bta sync all the time in writes
Tejun Heo <tj@kernel.org>
bpf: sched_ext: Mark ops argument container pointer fields as trusted
Song Liu <song@kernel.org>
bpf: Mark dentry->d_inode as trusted_or_null
Adrián Larumbe <adrian.larumbe@collabora.com>
drm/panfrost: Prevent division by 0
Hao-Qun Huang <alvinhuang0603@gmail.com>
accel/qaic: reject BO sizes that overflow page count
Raveendra Talabattula <raveendra.talabattula@arm.com>
drm/komeda: Fix bits parsing of GLB_CORE_ID
Su Hui <suhui@nfschina.com>
fs/stat.c: avoid harmless garbage value problem in vfs_statx_path()
Borislav Petkov (AMD) <bp@alien8.de>
x86/microcode/AMD: Move the no-revision fixup to get_patch_level()
Daejun Park <daejun7.park@samsung.com>
xfs: add a flag to convert unwritten extents without allocating blocks
Heiner Kallweit <hkallweit1@gmail.com>
r8169: align RTL8125/RTL8126 PHY config with vendor driver
Pei Xiao <xiaopei01@kylinos.cn>
comedi: dt2811: fix shift-out-of-bounds in IRQ check
Yang Zi <2959243019@qq.com>
comedi: addi_apci_3xxx: fix subdevice count underallocation
Pablo Neira Ayuso <pablo@netfilter.org>
netfilter: flowtable: ensure sufficient headroom in xmit path
Amir Goldstein <amir73il@gmail.com>
ovl: inherit FMODE_NONOTIFY when reading directory layers
Mike Rapoport (Microsoft) <rppt@kernel.org>
mm/cma: accept memory of CMA areas reserved at a fixed address
David Hildenbrand (Arm) <david@kernel.org>
mm/shmem: fix accounting of swapin-error markers
Roman Li <Roman.Li@amd.com>
drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates
Ilya Bakoulin <Ilya.Bakoulin@amd.com>
drm/amd/display: Minimize wait for pending updates
Yingjie Wang <1075151112@qq.com>
nvmet: reject keep-alive timeouts that would overflow
Jouni Högander <jouni.hogander@intel.com>
drm/i915/display: Add enabled pipe planes into state for selective fetch
David Hildenbrand (Arm) <david@kernel.org>
mm/shmem: make shmem_file() check the file's inode
Bernard Pidoux <bernard.f6bvp@gmail.com>
hdlcdrv: close the hardware driver once, and only if it was opened
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: disconnect sockets under their lock when a neighbour goes away
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: clear the other half of a through route a new call takes over
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: give loopback answers LCIs that calls cannot be given
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: refuse an empty message when the Q bit is included
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: keep a socket unbound when connect() fails to autobind it
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: check the length of Restart Request and Diagnostic frames
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: change the loopback nodes under the neighbour list lock too
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: hold RTNL while a route is added or deleted
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: walk the neighbour list under its lock when a device goes down
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdkfd: use the queue's process info for the WPTR BO eviction fence
Lang Yu <lang.yu@amd.com>
drm/amdkfd: Map wptr BO to GART unconditionally
Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
ASoC: qcom: q6apm: clear g_apm on driver removal
David Hildenbrand (Arm) <david@kernel.org>
fork: take mmap_lock before copying mm_struct
David Hildenbrand (Arm) <david@kernel.org>
mm/rmap: handle device-exclusive entries in folio_referenced_one()
Josef Bacik <josef@toxicpanda.com>
mm/filemap: read mapping->a_ops->free_folio under i_lock
Cong Zhang <cong.zhang@oss.qualcomm.com>
virtio_blk: use synchronous quiesce in virtblk_freeze_priv()
Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
apparmor: fix query_data() output overlapping the lookup key
Gregory Price <gourry@gourry.net>
mm/userfaultfd: compare exact registration modes before skipping
Ian Bridges <icb@fastmail.org>
ksmbd: let the owner read and change the DACL when no ACE names it
YouYou Yu <youyouyu@amazon.com>
quota: initialize dquot cache before mounting rootfs
Shubham Antil <shubham@octane.security>
vhost-scsi: zero misaligned I/O bounce pages
Mike Christie <michael.christie@oracle.com>
vhost-scsi: Reduce mem use by moving upages to per queue
David Hildenbrand (Arm) <david@kernel.org>
mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs
David Hildenbrand (Arm) <david@kernel.org>
mm/madvise: preserve VMA_SOFTDIRTY_BIT when changing anonymous names
Josef Bacik <josef@toxicpanda.com>
mm/hugetlb: don't clear the resv_map of a VMA whose lock is held
Jouni Högander <jouni.hogander@intel.com>
drm/i915/psr: Clear selective fetch area when duplicating plane state
David Hildenbrand (Arm) <david@kernel.org>
mm/vma: don't leak the charge for stack growth
Daejun Park <daejun7.park@samsung.com>
nvme: unregister when pr_register() is given a zero new key
Guixin Liu <kanie@linux.alibaba.com>
nvme: tuning pr code by using defined structs and macros
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: don't walk the CS chunks when allocating them failed
Guenter Roeck <linux@roeck-us.net>
hwmon: (tmp108) Fix initial conversion delay and wait until ready
Frank Li <Frank.Li@nxp.com>
hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support
Guenter Roeck <linux@roeck-us.net>
hwmon: (coretemp) Fix 32-bit jiffies wraparound in show_temp()
Myeonghun Pak <mhun512@gmail.com>
fbdev: kyro: Release WC setup on registration failure
Giovanni Di Santi <giovanni.disanti.lkl@gmail.com>
fbdev: kyro: Use devm_ioremap_wc() for screen mem
Giovanni Di Santi <giovanni.disanti.lkl@gmail.com>
fbdev: kyro: Use devm_ioremap() for mmio registers
Chris Mason <mason@kernel.org>
mm/huge_memory: fix truncate racing with PMD zapping
David Hildenbrand (Arm) <david@kernel.org>
mm: fix address wraparound when scanning large folio PTEs
Aditya Sharma <adi.sharma@zohomail.in>
mm/memory: update stale locking comments for fault handlers
Jinliang Zheng <alexjlzheng@gmail.com>
mm: fix outdated incorrect code comments for handle_mm_fault()
Li Zhe <lizhe.67@bytedance.com>
mm/hugetlb: fix mremap deadlock when PMD sharing is possible
Chengfeng Ye <nicoyip.dev@gmail.com>
l2tp: snapshot sequencing state when building transmit headers
Fuad Tabba <fuad.tabba@linux.dev>
KVM: arm64: vgic-its: Don't map an LPI from more than one event
Mike Christie <michael.christie@oracle.com>
scsi: target: Fix LUN/device R/W and total command stats
Yu Zhang <yuz08559@gmail.com>
scsi: target: Fix demo-mode dynamic ACL dev-entry UAF vs LUN teardown
Mike Christie <michael.christie@oracle.com>
scsi: target: Move I/O path stats to per CPU
Lorenzo Stoakes (ARM) <ljs@kernel.org>
mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows
Sasha Levin <sashal@kernel.org>
Revert "x86/mm/pat: Fix effective RW computation in lookup_address_in_pgd_attr()"
Sasha Levin <sashal@kernel.org>
Revert "x86/mm/pat: Use pr_warn() for early W^X warnings"
Jann Horn <jannh@google.com>
cipso: stop modifying live ip_options_rcu
Ian Bridges <icb@fastmail.org>
ksmbd: do not read past the DACL in the access denied debug message
Javier Carrasco <javier.carrasco.cruz@gmail.com>
hwmon: chipcap2: synchronize ready IRQ state
Javier Carrasco <javier.carrasco.cruz@gmail.com>
hwmon: chipcap2: serialize access to the alarm indicators
Guenter Roeck <linux@roeck-us.net>
hwmon: (chipcap2) Drop unnecessary include files
Javier Carrasco <javier.carrasco.cruz@gmail.com>
hwmon: (chipcap2) Switch to guard() for mutext handling
Cen Zhang <zzzccc427@gmail.com>
ocfs2: validate move extents against a stable EOF
Qu Wenruo <wqu@suse.com>
btrfs: raid56: do not verify the content if there is no data checksum
Kevin Wang <kevin.wang@amd.com>
drm/amd/pm: populate unique ID for smu 13.0.7
Guenter Roeck <linux@roeck-us.net>
hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds
Melissa Wen <mwen@igalia.com>
drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
drm/msm/hdmi: Handle msm_hdmi_power_on() errors during .atomic_pre_enable()
Eva Kurchatova <eva.kurchatova@virtuozzo.com>
hugetlbfs: enforce F_SEAL_EXEC in setattr
Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
drm/amd/display: set allow_freesync before validating a new stream
Leo Liu <leo.liu@amd.com>
drm/amdgpu: cancel idle work in hw_init failure paths for vcn/uvd/vce/jpeg
Johannes Weiner <hannes@cmpxchg.org>
mm: page_alloc: do not give all non-blocking requests reserve access
David Hildenbrand (Arm) <david@kernel.org>
mm/mremap: recheck PUDs under the page table lock
Josef Bacik <josef@toxicpanda.com>
mm/mremap: fix moving PUD leaves
Myeonghun Pak <mhun512@gmail.com>
hwmon: (sht15) Stop deferred work before releasing its resources
Pan Chuang <panchuang@vivo.com>
hwmon: (sht15) Remove redundant dev_err()
Lance Yang <lance.yang@linux.dev>
khugepaged: fix readahead lock inversion in collapse_file()
Will Deacon <will@kernel.org>
tools: linux/types.h: Add 128-bit integer types for arm64 UAPI structures
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Prevent O_APPEND open on OSS streams
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Optimize cpu_latency_qos_*() calls
Vincent Mailhol <mailhol@kernel.org>
can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices
Matt Turner <mattst88@gmail.com>
alpha: select SYSCTL_EXCEPTION_TRACE
Yufan Chen <ericterminal@gmail.com>
io_uring/eventfd: reset deferred signal state
Eric Dumazet <edumazet@kernel.org>
inet: frags: bound the wmem charge of the socket completing a reassembly
Ciro Pedrini <ciro.pedrini@gmail.com>
platform/x86: hp-wmi: Add OMEN board 8A17 thermal profile support
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
platform/x86: hp-wmi: Order DMI board name arrays
Chengfeng Ye <nicoyip.dev@gmail.com>
mm/ksm: mark migration stores with WRITE_ONCE()
Georgia Garcia <georgia.garcia@canonical.com>
apparmor: fix profile leak when a policy load fails
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: drop the gang leader reference when freeing gang jobs
Prike Liang <Prike.Liang@amd.com>
drm/amdgpu: finish GPU recovery callbacks before restarting schedulers
Lorenzo Stoakes (ARM) <ljs@kernel.org>
mm/vma: fix expansion of VMA_MIXEDMAP_BIT VMAs
Chao Yu <chao@kernel.org>
f2fs: fix to fetch ino via ino_of_node() under cache lock
Lorenzo Stoakes (ARM) <ljs@kernel.org>
mm/vma: update VMA iterator state on error in new VMA merge
David Hildenbrand (Arm) <david@kernel.org>
mm/memory-tiers: unregister empty tiers outside memory_tier_lock
Amir Goldstein <amir73il@gmail.com>
ovl: inherit FMODE_NONOTIFY when opening directory realfiles
Darong Lu <zzyy19904204639@163.com>
libceph: initialize CRUSH choose argument weights
Javier Carrasco <javier.carrasco.cruz@gmail.com>
hwmon: chipcap2: disable device after hwmon teardown
Javier Carrasco <javier.carrasco.cruz@gmail.com>
hwmon: chipcap2: fix IRQ teardown ordering
Chao Yu <chao@kernel.org>
f2fs: fix to update superblock crc in sanity_check_area_boundary()
David Hildenbrand (Arm) <david@kernel.org>
mm/userfaultfd: wake waiters when registration modes are removed
Christian Brauner <brauner@kernel.org>
backing-file: enforce append-only and immutable backing inodes
David Hildenbrand (Arm) <david@kernel.org>
mm/userfaultfd: write-lock the VMA before waking waiters when unregistering
Linlin Yang <yanglinlin@kylinos.cn>
wifi: mt76: mt7996: fix PCI device reference leak in mt7996_pci_init_hif2()
Christian Brauner <brauner@kernel.org>
proc: don't let an entry below /proc/<pid>/net be a mountpoint
Ali Ahmet Memiş <aliamemis@disroot.org>
platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively
Ali Ahmet Memiş <aliamemis@disroot.org>
ACPI: utils: Add exclusive AML evaluation helpers
Eklavya Singh <eklavyasingh2106@gmail.com>
ocfs2/heartbeat: serialize concurrent writes to a region's dev attribute
Karl Mehltretter <kmehltretter@gmail.com>
ocfs2/cluster: hold a reference on the heartbeat thread
guolingxing <guolingxing@tju.edu.cn>
btrfs: prevent deleting the wrong subvolume by ID
William Palacek <William.Palacek@amd.com>
drm/amdkfd: Validate the control stack of a restored queue
Rik van Riel <riel@surriel.com>
mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus
Yao Yiqi <yaoyiqi3@huawei.com>
fbcon: Rebuild rotated font buffer on font change
Priyank Rathod <rathodpriyank@google.com>
PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing
Vernon Yang <yanglincheng@kylinos.cn>
selftests/mm: include kselftest.h in vm_util.h
Ian Bridges <icb@fastmail.org>
ksmbd: enforce the read-only share flag when creating a stream
David Hildenbrand (Arm) <david@kernel.org>
mm/ksm: fix use of a freed anon_vma at swap-in
Ian Bridges <icb@fastmail.org>
ksmbd: revert fsids on durable reconnect and replay failure
Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
9p/xen: drain response work after unbinding IRQ
Josef Bacik <josef@toxicpanda.com>
mm/hugetlb: fix endless write fault on a leftover uffd bit
Eric Dumazet <edumazet@kernel.org>
inet: frags: limit the truesize of a reassembly queue
Sean Christopherson <seanjc@google.com>
KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM
-------------
Diffstat:
.gitignore | 1 -
Documentation/ABI/testing/sysfs-bus-pci | 14 +-
Documentation/ABI/testing/sysfs-class-power-mp2629 | 2 +-
Documentation/admin-guide/LSM/LoadPin.rst | 10 +-
Documentation/admin-guide/LSM/ipe.rst | 4 +-
.../bindings/arm/mediatek/mediatek,audsys.yaml | 2 +-
.../bindings/clock/mediatek,apmixedsys.yaml | 2 +-
.../bindings/clock/mediatek,topckgen.yaml | 2 +-
.../devicetree/bindings/display/msm/hdmi.yaml | 4 +-
.../devicetree/bindings/dma/stericsson,dma40.yaml | 14 +
.../bindings/iio/light/liteon,ltr501.yaml | 3 +-
.../media/allwinner,sun4i-a10-video-engine.yaml | 21 +-
.../power/supply/stericsson,ab8500-charger.yaml | 76 +-
.../devicetree/bindings/vendor-prefixes.yaml | 22 +
Documentation/sound/designs/midi-2.0.rst | 7 +
Documentation/trace/histogram.rst | 3 +
Makefile | 4 +-
arch/alpha/Kconfig | 1 +
arch/alpha/mm/fault.c | 29 +
arch/arc/Makefile | 9 +-
arch/arc/lib/Makefile | 8 +
arch/arm/boot/dts/gemini/gemini.dtsi | 2 +-
.../boot/dts/marvell/armada-385-clearfog-gtr.dtsi | 2 +-
arch/arm/boot/dts/marvell/armada-388-helios4.dts | 23 +-
arch/arm/boot/dts/marvell/armada-395-gp.dts | 1 -
arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi | 40 +-
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 30 +-
arch/arm/boot/dts/st/ste-ab8500.dtsi | 6 -
arch/arm/boot/dts/st/ste-ab8505.dtsi | 23 +-
arch/arm/boot/dts/st/ste-dbx5x0.dtsi | 5 -
arch/arm/boot/dts/st/ste-href-ab8500.dtsi | 104 ++
arch/arm/boot/dts/st/ste-href-ab8505.dtsi | 118 +-
arch/arm/boot/dts/st/stm32mp135.dtsi | 44 +-
arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts | 2 +-
arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi | 2 +-
arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi | 2 +
arch/arm/include/asm/domain.h | 17 -
arch/arm/include/asm/memory.h | 4 +-
arch/arm/include/asm/pgtable-2level-hwdef.h | 1 -
arch/arm/include/asm/pgtable-2level.h | 7 -
arch/arm/include/asm/sparsemem.h | 4 +
arch/arm/kernel/efi.c | 13 +
arch/arm/mach-mvebu/Kconfig | 4 +-
arch/arm/mach-versatile/platsmp-vexpress.c | 4 +-
arch/arm/mach-versatile/v2m.c | 4 +-
arch/arm/mm/Kconfig | 7 -
arch/arm/mm/alignment.c | 10 +-
arch/arm/mm/dma-mapping.c | 5 +-
arch/arm/mm/ioremap.c | 53 +-
arch/arm/mm/mmu.c | 76 +-
arch/arm64/Kconfig.platforms | 1 -
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 4 +-
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 9 +
.../boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 4 +-
arch/arm64/boot/dts/freescale/imx8dxl-evk.dts | 14 +-
arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 26 +-
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 4 +-
arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts | 4 +-
arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts | 4 +-
arch/arm64/boot/dts/freescale/imx95.dtsi | 4 +-
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi | 8 +-
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 13 +-
.../boot/dts/qcom/sdm845-sony-xperia-tama.dtsi | 2 +
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 4 +
arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
.../boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts | 1 +
arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 1 +
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 +-
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 32 +-
arch/arm64/boot/dts/rockchip/rk3566-base.dtsi | 39 +
arch/arm64/boot/dts/rockchip/rk3566.dtsi | 118 +-
arch/arm64/boot/dts/rockchip/rk3568.dtsi | 117 +-
.../dts/rockchip/{rk356x.dtsi => rk356x-base.dtsi} | 82 --
.../boot/dts/rockchip/rk3588s-gameforce-ace.dts | 7 +-
arch/arm64/boot/dts/st/stm32mp231.dtsi | 1213 ++++++++++++++++++++
arch/arm64/boot/dts/st/stm32mp233.dtsi | 94 ++
arch/arm64/boot/dts/st/stm32mp235.dtsi | 16 +
arch/arm64/boot/dts/st/stm32mp23xc.dtsi | 8 +
arch/arm64/boot/dts/st/stm32mp23xf.dtsi | 8 +
arch/arm64/boot/dts/st/stm32mp251.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 41 +-
arch/arm64/boot/dts/ti/k3-j722s-evm.dts | 124 +-
arch/arm64/kernel/pi/Makefile | 1 +
arch/arm64/kvm/vgic/vgic-its.c | 37 +-
arch/m68k/apollo/dn_ints.c | 6 +
arch/m68k/mac/config.c | 31 +-
arch/microblaze/Makefile | 6 +-
arch/microblaze/include/asm/uaccess.h | 3 +-
arch/microblaze/kernel/cpu/cpuinfo.c | 1 +
arch/microblaze/kernel/ptrace.c | 3 +
arch/mips/Makefile | 22 +-
arch/mips/cavium-octeon/dma-octeon.c | 2 +-
arch/nios2/kernel/nios2_ksyms.c | 1 +
arch/powerpc/kernel/trace/ftrace_entry.S | 6 +
arch/riscv/include/asm/insn.h | 2 +-
arch/riscv/net/bpf_jit_comp64.c | 14 +-
arch/riscv/net/bpf_jit_core.c | 1 +
arch/s390/kernel/ptrace.c | 9 +-
arch/s390/kernel/uprobes.c | 2 +-
arch/sh/Kconfig | 1 +
arch/sh/boards/board-sh7785lcr.c | 2 +-
arch/sh/configs/migor_defconfig | 2 +-
arch/sh/configs/sdk7786_defconfig | 2 +-
arch/sh/configs/shx3_defconfig | 2 +-
arch/sh/include/asm/uaccess_32.h | 8 +-
arch/um/drivers/ubd_kern.c | 1 -
arch/x86/boot/compressed/efi_mixed.S | 16 +-
arch/x86/include/asm/efi.h | 3 +
arch/x86/include/asm/svm.h | 4 +-
arch/x86/kernel/cpu/microcode/amd.c | 12 +-
arch/x86/kernel/crash.c | 6 +-
arch/x86/kvm/svm/nested.c | 23 +-
arch/x86/kvm/svm/svm.c | 2 +
arch/x86/kvm/svm/svm.h | 2 +
arch/x86/mm/pat/set_memory.c | 23 +-
arch/x86/platform/efi/efi.c | 29 -
arch/x86/platform/efi/efi_64.c | 42 -
arch/x86/platform/pvh/enlighten.c | 2 +
arch/x86/power/hibernate.c | 51 +-
block/bdev.c | 12 +-
block/bfq-iosched.c | 4 +-
block/blk-cgroup.c | 19 +-
block/blk-cgroup.h | 6 +-
block/blk-flush.c | 8 +-
block/blk-iocost.c | 311 +++--
block/blk-iolatency.c | 3 +-
block/blk-map.c | 1 +
block/blk-mq-debugfs.c | 1 -
block/blk-mq-sched.c | 3 +-
block/blk-mq.c | 42 +-
block/blk-rq-qos.c | 18 +-
block/blk-throttle.c | 91 +-
block/blk-timeout.c | 3 +-
block/blk.h | 14 +
block/fops.c | 12 +-
block/partitions/mac.c | 4 +-
crypto/asymmetric_keys/verify_pefile.c | 5 +
crypto/lskcipher.c | 6 +-
crypto/tcrypt.c | 182 +--
drivers/accel/qaic/qaic_data.c | 8 +-
drivers/acpi/acpi_extlog.c | 9 +
drivers/acpi/acpi_pcc.c | 29 +-
drivers/acpi/acpi_video.c | 12 +-
drivers/acpi/acpica/dsfield.c | 3 +-
drivers/acpi/acpica/exfield.c | 11 +-
drivers/acpi/acpica/nsxfname.c | 1 +
drivers/acpi/apei/ghes.c | 16 +-
drivers/acpi/button.c | 12 +
drivers/acpi/cppc_acpi.c | 22 +-
drivers/acpi/device_pm.c | 77 +-
drivers/acpi/fan_core.c | 9 +-
drivers/acpi/glue.c | 10 +-
drivers/acpi/numa/hmat.c | 2 +-
drivers/acpi/pci_link.c | 1 +
drivers/acpi/pci_root.c | 22 +-
drivers/acpi/scan.c | 40 +-
drivers/acpi/tables.c | 3 +
drivers/acpi/utils.c | 41 +
drivers/ata/libahci.c | 15 +
drivers/ata/libata-core.c | 12 +
drivers/ata/libata-scsi.c | 2 +-
drivers/ata/pata_parport/pata_parport.c | 9 +-
drivers/ata/sata_dwc_460ex.c | 5 +-
drivers/base/node.c | 17 +-
drivers/base/power/runtime.c | 6 +-
drivers/base/power/wakeirq.c | 26 +
drivers/block/amiflop.c | 1 -
drivers/block/aoe/aoeblk.c | 1 -
drivers/block/ataflop.c | 1 -
drivers/block/drbd/drbd_main.c | 1 +
drivers/block/drbd/drbd_receiver.c | 2 +
drivers/block/floppy.c | 11 +-
drivers/block/loop.c | 3 +-
drivers/block/mtip32xx/mtip32xx.c | 1 -
drivers/block/nbd.c | 3 +-
drivers/block/null_blk/main.c | 2 -
drivers/block/ps3disk.c | 3 +-
drivers/block/rbd.c | 1 -
drivers/block/rnbd/rnbd-clt.c | 3 +-
drivers/block/rnbd/rnbd-srv-sysfs.c | 28 +-
drivers/block/rnbd/rnbd-srv.c | 36 +-
drivers/block/sunvdc.c | 2 +-
drivers/block/swim.c | 287 ++---
drivers/block/swim3.c | 11 +-
drivers/block/swim_asm.S | 136 +--
drivers/block/ublk_drv.c | 1 -
drivers/block/virtio_blk.c | 3 +-
drivers/block/xen-blkback/blkback.c | 7 +
drivers/block/xen-blkfront.c | 1 -
drivers/block/z2ram.c | 1 -
drivers/bluetooth/btintel.c | 6 +-
drivers/bluetooth/btmtk.c | 88 +-
drivers/bluetooth/btmtksdio.c | 13 +-
drivers/bluetooth/btusb.c | 19 +-
drivers/bluetooth/virtio_bt.c | 4 +-
drivers/bus/arm-cci.c | 6 +-
drivers/cdrom/gdrom.c | 2 +-
drivers/char/hw_random/cctrng.c | 7 +-
drivers/char/hw_random/intel-rng.c | 5 +-
drivers/char/hw_random/jh7110-trng.c | 39 +-
drivers/char/scx200_gpio.c | 8 +-
drivers/clk/bcm/clk-raspberrypi.c | 2 +
drivers/clk/clk-cdce925.c | 9 +-
drivers/clk/clk-lmk04832.c | 3 +
drivers/clk/clk-milbeaut.c | 10 +-
drivers/clk/clk-renesas-pcie.c | 5 +
drivers/clk/clk-s2mps11.c | 12 +-
drivers/clk/clk-si521xx.c | 2 +-
drivers/clk/clk-si5351.c | 20 +-
drivers/clk/clk.c | 51 +-
drivers/clk/clk.h | 5 +-
drivers/clk/clkdev.c | 4 +-
drivers/clk/imx/clk-composite-93.c | 11 +-
drivers/clk/mediatek/reset.h | 6 +-
drivers/clk/qcom/clk-alpha-pll.c | 9 +
drivers/clk/qcom/clk-rcg2.c | 35 +-
drivers/clk/qcom/dispcc-sm8450.c | 2 +-
drivers/clk/qcom/gcc-x1e80100.c | 6 +-
drivers/clk/qcom/mmcc-msm8960.c | 3 +-
drivers/clk/qcom/mmcc-msm8996.c | 4 +-
drivers/clk/qcom/mmcc-sdm660.c | 2 +-
drivers/clk/starfive/clk-starfive-jh7110-sys.c | 3 +
drivers/clk/ti/adpll.c | 1 +
drivers/clk/versatile/clk-icst.c | 4 +
drivers/clocksource/clksrc-dbx500-prcmu.c | 2 +
drivers/clocksource/timer-mediatek.c | 4 +-
drivers/comedi/drivers/addi_apci_3xxx.c | 2 +-
drivers/comedi/drivers/comedi_parport.c | 3 +-
drivers/comedi/drivers/dmm32at.c | 3 +-
drivers/comedi/drivers/dt2811.c | 2 +-
drivers/comedi/drivers/dt2814.c | 3 +-
drivers/comedi/drivers/ni_atmio16d.c | 4 +-
drivers/comedi/drivers/pcmmio.c | 3 +-
drivers/comedi/drivers/pcmuio.c | 5 +-
drivers/cpufreq/amd-pstate.c | 18 +-
drivers/cpufreq/qcom-cpufreq-hw.c | 3 +
drivers/cpufreq/sparc-us2e-cpufreq.c | 11 +-
drivers/cpufreq/sti-cpufreq.c | 4 +-
drivers/cpufreq/tegra194-cpufreq.c | 2 +-
drivers/cpuidle/governors/menu.c | 8 +-
drivers/cpuidle/governors/teo.c | 11 +
drivers/crypto/amlogic/amlogic-gxl-cipher.c | 25 +-
drivers/crypto/atmel-aes.c | 2 +
drivers/crypto/atmel-sha.c | 17 +
drivers/crypto/ccp/ccp-dev-v3.c | 4 +
drivers/crypto/ccp/ccp-dev-v5.c | 4 +
drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 -
drivers/crypto/intel/qat/qat_common/adf_init.c | 24 +-
drivers/crypto/intel/qat/qat_common/adf_isr.c | 15 +-
drivers/crypto/intel/qat/qat_common/qat_algs.c | 15 +-
.../crypto/intel/qat/qat_common/qat_asym_algs.c | 38 +-
drivers/crypto/mxs-dcp.c | 3 +
drivers/crypto/starfive/jh7110-cryp.c | 20 +-
drivers/crypto/talitos.c | 93 +-
drivers/crypto/talitos.h | 5 +-
drivers/cxl/acpi.c | 7 +-
drivers/cxl/core/hdm.c | 57 +-
drivers/cxl/core/pci.c | 9 +
drivers/cxl/core/port.c | 28 +-
drivers/cxl/core/region.c | 4 +-
drivers/cxl/cxl.h | 10 +-
drivers/dax/bus.c | 8 +-
drivers/dma/at_hdmac.c | 28 +-
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 37 +-
drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 5 +-
drivers/dma/fsl_raid.c | 32 +-
drivers/dma/img-mdc-dma.c | 2 +-
drivers/dma/ioat/init.c | 18 +-
drivers/dma/mediatek/mtk-hsdma.c | 26 +-
drivers/dma/mv_xor.c | 1 +
drivers/dma/plx_dma.c | 10 +-
drivers/dma/sprd-dma.c | 45 +-
drivers/dma/ste_dma40.c | 434 ++++---
drivers/dma/ste_dma40_ll.h | 2 -
drivers/dma/sun6i-dma.c | 31 +-
drivers/dma/xilinx/xilinx_dma.c | 37 +-
drivers/dma/xilinx/zynqmp_dma.c | 29 +-
drivers/edac/i10nm_base.c | 1 +
drivers/firmware/arm_scmi/common.h | 22 +
drivers/firmware/arm_scmi/driver.c | 38 +-
drivers/firmware/arm_scmi/protocols.h | 9 +-
drivers/firmware/arm_scmi/raw_mode.c | 29 +-
drivers/firmware/cirrus/cs_dsp.c | 2 +
drivers/firmware/efi/cper.c | 51 +-
drivers/firmware/efi/efi.c | 3 -
drivers/firmware/efi/libstub/efi-stub-entry.c | 4 +-
drivers/firmware/efi/libstub/efi-stub-helper.c | 10 +-
drivers/firmware/efi/libstub/efi-stub.c | 30 +-
drivers/firmware/efi/libstub/efistub.h | 22 +-
drivers/firmware/efi/libstub/fdt.c | 6 +-
drivers/firmware/efi/libstub/file.c | 8 +-
drivers/firmware/efi/libstub/gop.c | 58 +-
drivers/firmware/efi/libstub/kaslr.c | 6 +-
drivers/firmware/efi/libstub/mem.c | 22 +-
drivers/firmware/efi/libstub/pci.c | 38 +-
drivers/firmware/efi/libstub/random.c | 8 +-
drivers/firmware/efi/libstub/randomalloc.c | 4 +-
drivers/firmware/efi/libstub/relocate.c | 10 +-
drivers/firmware/efi/libstub/riscv-stub.c | 7 +-
drivers/firmware/efi/libstub/riscv.c | 2 +-
drivers/firmware/efi/libstub/tpm.c | 8 +-
drivers/firmware/efi/libstub/unaccepted_memory.c | 2 +-
drivers/firmware/efi/libstub/x86-stub.c | 210 +---
drivers/firmware/imx/imx-dsp.c | 6 +-
drivers/firmware/qcom/qcom_tzmem.c | 2 +-
drivers/gpio/gpio-crystalcove.c | 1 +
drivers/gpio/gpio-pcf857x.c | 33 +-
drivers/gpu/buddy.c | 1 -
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 8 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 3 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 35 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 48 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 19 +-
drivers/gpu/drm/amd/amdgpu/atom.c | 105 +-
drivers/gpu/drm/amd/amdgpu/atom.h | 5 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 6 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 6 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 6 +-
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 4 +-
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 +-
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 4 +-
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 4 +-
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 4 +-
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 9 +-
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 8 +-
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 8 +-
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 8 +-
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 6 +-
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c | 10 +-
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 3 +
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 3 +
.../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 48 +-
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 20 +-
.../drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 38 +-
drivers/gpu/drm/amd/display/dc/core/dc.c | 9 +-
.../gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 32 +
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h | 3 +
.../gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 3 +
.../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 20 +
.../gpu/drm/arm/display/include/malidp_product.h | 10 +-
drivers/gpu/drm/drm_of.c | 8 +-
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +-
drivers/gpu/drm/i915/display/intel_atomic_plane.c | 1 +
drivers/gpu/drm/i915/display/intel_display.c | 12 +
drivers/gpu/drm/i915/display/intel_psr.c | 49 +-
drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 3 +-
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 102 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 10 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 10 +-
.../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 +-
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 9 -
drivers/gpu/drm/msm/dp/dp_ctrl.c | 3 +
drivers/gpu/drm/msm/dp/dp_debug.c | 1 +
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 30 +-
drivers/gpu/drm/msm/msm_io_utils.c | 6 +-
drivers/gpu/drm/omapdrm/dss/dsi.c | 63 +-
drivers/gpu/drm/panfrost/panfrost_devfreq.c | 2 +-
drivers/gpu/drm/panfrost/panfrost_mmu.c | 11 +-
drivers/gpu/drm/panthor/panthor_gpu.c | 5 +-
drivers/gpu/drm/tegra/submit.c | 12 +-
drivers/hid/hid-logitech-hidpp.c | 1 +
drivers/hid/i2c-hid/i2c-hid-core.c | 11 +-
drivers/hid/wacom_wac.c | 14 +-
drivers/hv/vmbus_drv.c | 8 +-
drivers/hwmon/chipcap2.c | 260 +++--
drivers/hwmon/coretemp.c | 19 +-
drivers/hwmon/sht15.c | 26 +-
drivers/hwmon/tmp108.c | 65 +-
drivers/iio/accel/bma220_spi.c | 3 +-
drivers/iio/accel/kionix-kx022a.h | 2 +-
drivers/iio/dac/ad5758.c | 8 +-
drivers/iio/humidity/hts221_core.c | 106 +-
drivers/iio/imu/adis16400.c | 5 +-
drivers/iio/pressure/rohm-bm1390.c | 4 +-
drivers/iio/temperature/tmp117.c | 9 +-
drivers/infiniband/core/device.c | 2 +-
drivers/infiniband/core/lag.c | 14 +-
drivers/infiniband/core/mad.c | 2 +
drivers/infiniband/core/mad_rmpp.c | 7 +-
drivers/infiniband/core/nldev.c | 5 +-
drivers/infiniband/core/restrack.c | 3 +-
drivers/infiniband/core/sysfs.c | 9 +-
drivers/infiniband/core/uverbs_std_types_device.c | 1 +
drivers/infiniband/core/uverbs_std_types_wq.c | 2 +-
drivers/infiniband/core/verbs.c | 3 +-
drivers/infiniband/hw/bnxt_re/hw_counters.c | 6 +-
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 58 +-
drivers/infiniband/hw/bnxt_re/qplib_res.c | 9 +-
drivers/infiniband/hw/bnxt_re/qplib_sp.c | 2 +-
drivers/infiniband/hw/cxgb4/cm.c | 5 +-
drivers/infiniband/hw/cxgb4/provider.c | 5 +
drivers/infiniband/hw/efa/efa_com.c | 28 +-
drivers/infiniband/hw/erdma/erdma_main.c | 4 +-
drivers/infiniband/hw/erdma/erdma_verbs.c | 16 +-
drivers/infiniband/hw/hfi1/sdma.c | 3 +
drivers/infiniband/hw/hfi1/verbs.c | 4 +
drivers/infiniband/hw/hns/hns_roce_cq.c | 1 +
drivers/infiniband/hw/hns/hns_roce_device.h | 1 +
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 55 +-
drivers/infiniband/hw/irdma/ctrl.c | 8 +-
drivers/infiniband/hw/irdma/pble.c | 8 +-
drivers/infiniband/hw/irdma/type.h | 4 +-
drivers/infiniband/hw/irdma/verbs.c | 13 +-
drivers/infiniband/hw/mlx4/main.c | 4 +
drivers/infiniband/hw/mlx5/cq.c | 24 +-
drivers/infiniband/hw/mlx5/fs.c | 4 +-
drivers/infiniband/hw/mlx5/main.c | 2 +
drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +
drivers/infiniband/hw/mlx5/odp.c | 2 +-
drivers/infiniband/hw/mlx5/qp.c | 8 +-
drivers/infiniband/hw/mlx5/qpc.c | 8 +-
drivers/infiniband/hw/mlx5/srq.c | 3 +-
drivers/infiniband/hw/mlx5/wr.c | 1 +
drivers/infiniband/hw/usnic/usnic_debugfs.c | 2 +-
drivers/infiniband/sw/rdmavt/qp.c | 2 +-
drivers/infiniband/sw/rxe/rxe_loc.h | 8 +-
drivers/infiniband/sw/rxe/rxe_mr.c | 12 +-
drivers/infiniband/sw/rxe/rxe_mw.c | 3 +
drivers/infiniband/sw/rxe/rxe_net.c | 70 +-
drivers/infiniband/sw/rxe/rxe_qp.c | 10 +
drivers/infiniband/sw/rxe/rxe_recv.c | 9 +-
drivers/infiniband/sw/rxe/rxe_req.c | 11 +-
drivers/infiniband/sw/rxe/rxe_resp.c | 23 +-
drivers/infiniband/sw/rxe/rxe_verbs.h | 1 +
drivers/infiniband/sw/siw/siw_main.c | 5 +-
drivers/infiniband/sw/siw/siw_qp_tx.c | 20 +-
drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 +
drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 32 +-
drivers/infiniband/ulp/srp/ib_srp.c | 2 +-
drivers/interconnect/qcom/icc-rpm.c | 11 +-
drivers/interconnect/qcom/icc-rpm.h | 4 +-
drivers/interconnect/qcom/smd-rpm.c | 8 +-
drivers/interconnect/samsung/exynos.c | 1 +
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 4 +-
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +
drivers/iommu/intel/dmar.c | 70 +-
drivers/irqchip/irq-gic-common.c | 2 +-
drivers/irqchip/irq-gic-v3-its.c | 156 ++-
drivers/irqchip/irq-gic-v3.c | 15 +-
drivers/irqchip/irq-gic.c | 4 +-
drivers/irqchip/irq-riscv-imsic-state.c | 21 +-
drivers/leds/led-class-flash.c | 2 +-
drivers/leds/leds-lm3692x.c | 4 +-
drivers/leds/leds-lp8860.c | 5 +-
drivers/leds/leds-pca9532.c | 9 +-
drivers/mailbox/arm_mhuv2.c | 9 +-
drivers/mailbox/pcc.c | 5 +-
drivers/mailbox/qcom-cpucp-mbox.c | 37 +-
drivers/mailbox/qcom-ipcc.c | 1 -
drivers/mailbox/ti-msgmgr.c | 12 +-
drivers/md/dm-rq.c | 2 +-
drivers/md/dm-snap.c | 18 +-
drivers/md/md.c | 30 +-
drivers/md/raid10.c | 3 +-
drivers/md/raid5-cache.c | 14 +-
drivers/md/raid5-ppl.c | 12 +-
drivers/md/raid5.c | 65 +-
drivers/media/i2c/ar0521.c | 1 -
drivers/media/i2c/ov5648.c | 4 +-
drivers/media/platform/qcom/venus/hfi_msgs.c | 3 +
drivers/memory/brcmstb_dpfe.c | 17 +-
drivers/memory/emif.c | 3 +
drivers/memory/samsung/exynos5422-dmc.c | 11 +-
drivers/memstick/core/ms_block.c | 3 +-
drivers/memstick/core/mspro_block.c | 3 +-
drivers/mfd/da9150-core.c | 8 +-
drivers/mfd/intel_quark_i2c_gpio.c | 52 +-
drivers/mfd/rk8xx-core.c | 2 +-
drivers/misc/enclosure.c | 3 +-
drivers/misc/nsm.c | 7 +-
drivers/mmc/core/queue.c | 2 +-
drivers/mtd/mtd_blkdevs.c | 7 +-
drivers/mtd/nand/raw/pl35x-nand-controller.c | 1 +
drivers/mtd/spi-nor/spansion.c | 7 -
drivers/mtd/ubi/block.c | 2 +-
drivers/net/amt.c | 8 +-
drivers/net/can/dev/skb.c | 2 +-
drivers/net/dsa/mv88e6xxx/chip.c | 8 +-
drivers/net/ethernet/alacritech/slicoss.c | 2 +-
.../net/ethernet/aquantia/atlantic/aq_pci_func.c | 2 +-
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 121 +-
drivers/net/ethernet/broadcom/asp2/bcmasp.h | 4 -
drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 32 +-
drivers/net/ethernet/broadcom/bgmac.c | 51 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 +
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 1 +
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 406 ++++---
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 +
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 80 +-
drivers/net/ethernet/broadcom/tg3.c | 6 +
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 12 +-
drivers/net/ethernet/ibm/ibmveth.c | 41 +-
drivers/net/ethernet/intel/ice/ice_lib.c | 4 +
drivers/net/ethernet/intel/ice/ice_ptp.c | 49 +-
drivers/net/ethernet/intel/ice/ice_ptp.h | 6 +-
.../net/ethernet/marvell/octeontx2/af/rvu_nix.c | 4 +-
drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 2 +
drivers/net/ethernet/mellanox/mlx4/intf.c | 15 +-
.../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 3 +
.../net/ethernet/mellanox/mlx5/core/en_selftest.c | 4 +
.../mlx5/core/steering/hws/mlx5hws_pat_arg.c | 4 +-
drivers/net/ethernet/microchip/fdma/fdma_api.c | 45 +-
drivers/net/ethernet/microchip/fdma/fdma_api.h | 20 +-
.../net/ethernet/microchip/lan966x/lan966x_fdma.c | 17 +-
.../net/ethernet/microchip/lan966x/lan966x_mac.c | 4 +-
.../net/ethernet/microchip/lan966x/lan966x_main.c | 19 +-
.../net/ethernet/microchip/lan966x/lan966x_ptp.c | 10 +-
.../net/ethernet/microchip/sparx5/sparx5_fdma.c | 58 +-
.../net/ethernet/microchip/sparx5/sparx5_main.c | 7 +-
.../net/ethernet/microchip/sparx5/sparx5_main.h | 2 +
.../net/ethernet/microchip/sparx5/sparx5_packet.c | 15 +-
.../net/ethernet/microchip/sparx5/sparx5_psfp.c | 10 +-
drivers/net/ethernet/netronome/nfp/flower/main.h | 2 +
.../ethernet/netronome/nfp/flower/tunnel_conf.c | 24 +-
.../net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 +
drivers/net/ethernet/pensando/ionic/ionic_main.c | 13 +-
drivers/net/ethernet/qlogic/qede/qede_filter.c | 2 +-
drivers/net/ethernet/realtek/r8169_phy_config.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/common.h | 4 +-
drivers/net/ethernet/stmicro/stmmac/descs.h | 6 +-
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 25 +-
drivers/net/ethernet/stmicro/stmmac/hwif.h | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 10 +-
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 39 -
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 66 +-
.../net/ethernet/stmicro/stmmac/stmmac_selftests.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 86 +-
drivers/net/gtp.c | 51 +-
drivers/net/hamradio/hdlcdrv.c | 5 +-
drivers/net/loopback.c | 8 +-
drivers/net/macsec.c | 5 +
drivers/net/phy/Kconfig | 5 +-
drivers/net/phy/Makefile | 2 +-
drivers/net/phy/marvell.c | 97 +-
drivers/net/phy/qcom/qca83xx.c | 58 +
drivers/net/phy/realtek/Kconfig | 5 +
drivers/net/phy/realtek/Makefile | 3 +
.../net/phy/{realtek.c => realtek/realtek_main.c} | 197 +++-
drivers/net/ppp/pppoe.c | 3 +
drivers/net/team/team_core.c | 11 +
drivers/net/tun.c | 10 +
drivers/net/usb/cdc_mbim.c | 5 +-
drivers/net/usb/cdc_ncm.c | 7 +-
drivers/net/usb/lan78xx.c | 9 +-
drivers/net/usb/usbnet.c | 32 +-
drivers/net/veth.c | 7 +-
drivers/net/virtio_net.c | 12 +-
drivers/net/wireless/ath/ath10k/htt_tx.c | 12 +-
drivers/net/wireless/ath/ath11k/Kconfig | 3 +
drivers/net/wireless/ath/ath11k/ahb.c | 1 +
drivers/net/wireless/ath/ath11k/ce.c | 2 +-
drivers/net/wireless/ath/ath11k/core.c | 13 +-
drivers/net/wireless/ath/ath11k/dp_rx.c | 19 +-
drivers/net/wireless/ath/ath11k/mac.c | 33 +-
drivers/net/wireless/ath/ath11k/mac.h | 2 +-
drivers/net/wireless/ath/ath11k/wmi.c | 9 +
.../net/wireless/ath/ath12k/debugfs_htt_stats.c | 2 +-
drivers/net/wireless/ath/ath12k/mac.c | 21 +-
drivers/net/wireless/ath/ath12k/pci.c | 55 +-
drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 -
drivers/net/wireless/ath/carl9170/debug.c | 5 +-
drivers/net/wireless/ath/wil6210/txrx.h | 4 +-
drivers/net/wireless/broadcom/b43/debugfs.c | 2 +-
drivers/net/wireless/broadcom/b43legacy/debugfs.c | 2 +-
drivers/net/wireless/marvell/mwifiex/cmdevt.c | 10 +-
drivers/net/wireless/marvell/mwifiex/fw.h | 6 +
drivers/net/wireless/marvell/mwifiex/init.c | 1 +
drivers/net/wireless/marvell/mwifiex/main.c | 4 +-
drivers/net/wireless/marvell/mwifiex/main.h | 1 +
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 3 +-
drivers/net/wireless/mediatek/mt76/mac80211.c | 11 +-
drivers/net/wireless/mediatek/mt76/mt7603/dma.c | 18 +-
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 13 +
drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 17 +-
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 11 +-
.../net/wireless/mediatek/mt76/mt7915/coredump.c | 7 +-
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 6 +
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 7 +-
drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 47 +-
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 5 +
.../net/wireless/mediatek/mt76/mt7921/pci_mac.c | 4 +-
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 50 +-
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h | 5 +
.../net/wireless/mediatek/mt76/mt7925/pci_mac.c | 6 +-
drivers/net/wireless/mediatek/mt76/mt792x.h | 2 +
drivers/net/wireless/mediatek/mt76/mt792x_mac.c | 6 +-
.../net/wireless/mediatek/mt76/mt7996/coredump.c | 7 +-
drivers/net/wireless/mediatek/mt76/mt7996/init.c | 6 +
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 46 +-
drivers/net/wireless/mediatek/mt76/mt7996/pci.c | 9 +-
drivers/net/wireless/mediatek/mt76/mt7996/regs.h | 8 +-
drivers/net/wireless/mediatek/mt76/tx.c | 7 +-
drivers/net/wireless/mediatek/mt76/usb.c | 16 +-
drivers/net/wireless/realtek/rtl8xxxu/core.c | 16 +-
drivers/net/wireless/realtek/rtw88/debug.c | 5 +
drivers/net/wireless/realtek/rtw88/sdio.c | 12 +
drivers/net/wireless/silabs/wfx/bh.c | 6 +-
drivers/net/wireless/silabs/wfx/bus_sdio.c | 1 +
drivers/net/wireless/silabs/wfx/main.c | 36 +-
drivers/nvdimm/pmem.c | 6 +-
drivers/nvme/host/apple.c | 1 -
drivers/nvme/host/core.c | 1 -
drivers/nvme/host/fabrics.c | 30 +-
drivers/nvme/host/ioctl.c | 2 +-
drivers/nvme/host/pr.c | 130 ++-
drivers/nvme/host/tcp.c | 10 +-
drivers/nvme/target/admin-cmd.c | 7 +-
drivers/nvme/target/configfs.c | 24 +-
drivers/nvme/target/core.c | 23 +-
drivers/nvme/target/fabrics-cmd-auth.c | 9 +-
drivers/nvme/target/fabrics-cmd.c | 3 +-
drivers/nvme/target/fc.c | 15 +-
drivers/nvme/target/io-cmd-bdev.c | 29 +-
drivers/nvme/target/loop.c | 2 -
drivers/nvme/target/nvmet.h | 8 +
drivers/nvme/target/rdma.c | 26 +-
drivers/nvme/target/tcp.c | 7 +-
drivers/nvme/target/zns.c | 12 +-
drivers/nvmem/layouts/onie-tlv.c | 1 +
drivers/nvmem/layouts/sl28vpd.c | 1 +
drivers/opp/of.c | 2 +-
drivers/pci/controller/dwc/pci-dra7xx.c | 22 +-
drivers/pci/controller/dwc/pcie-qcom.c | 90 +-
drivers/pci/controller/pci-aardvark.c | 31 +-
drivers/pci/controller/pci-xgene.c | 11 +-
drivers/pci/endpoint/functions/pci-epf-vntb.c | 8 +-
drivers/pci/iov.c | 25 -
drivers/pci/p2pdma.c | 10 +-
drivers/pci/pci-label.c | 92 +-
drivers/pci/pci.h | 4 -
drivers/pci/pcie/aer.c | 25 +-
drivers/pci/probe.c | 15 +-
drivers/pci/quirks.c | 2 +-
drivers/pci/xen-pcifront.c | 5 +-
drivers/perf/cxl_pmu.c | 100 +-
drivers/perf/dwc_pcie_pmu.c | 11 +-
drivers/perf/marvell_cn10k_tad_pmu.c | 1 +
drivers/phy/cadence/phy-cadence-sierra.c | 11 +-
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 581 ++++++----
drivers/phy/hisilicon/phy-hi3670-pcie.c | 4 +-
drivers/phy/rockchip/phy-rockchip-usbdp.c | 287 +++--
drivers/pinctrl/mediatek/pinctrl-mt7629.c | 2 +-
drivers/pinctrl/nuvoton/pinctrl-ma35.c | 8 +-
drivers/pinctrl/pinctrl-amd.c | 47 +-
drivers/pinctrl/sprd/pinctrl-sprd.c | 3 +
drivers/pinctrl/stm32/Kconfig | 6 +-
drivers/pinctrl/stm32/pinctrl-stm32.c | 16 +-
drivers/pinctrl/stm32/pinctrl-stm32.h | 18 +-
drivers/pinctrl/stm32/pinctrl-stm32mp257.c | 11 +-
drivers/pinctrl/sunplus/Kconfig | 8 +-
drivers/platform/chrome/cros_ec_proto.c | 32 +-
drivers/platform/chrome/cros_ec_proto_test.c | 158 ++-
drivers/platform/chrome/cros_ec_typec.c | 10 +
drivers/platform/cznic/turris-omnia-mcu-gpio.c | 31 +-
drivers/platform/olpc/olpc-ec.c | 2 +-
drivers/platform/x86/amd/pmc/pmc.c | 9 +-
drivers/platform/x86/asus-wmi.c | 32 +
drivers/platform/x86/gpd-pocket-fan.c | 9 +-
.../platform/x86/hp/hp-bioscfg/int-attributes.c | 7 +-
.../x86/hp/hp-bioscfg/passwdobj-attributes.c | 2 +-
.../platform/x86/hp/hp-bioscfg/spmobj-attributes.c | 7 +
drivers/platform/x86/hp/hp-wmi.c | 24 +-
drivers/platform/x86/ibm_rtl.c | 8 +-
drivers/platform/x86/ideapad-laptop.c | 12 +-
drivers/platform/x86/intel/telemetry/core.c | 4 +
drivers/platform/x86/msi-ec.c | 9 +
drivers/pmdomain/imx/scu-pd.c | 10 +-
drivers/power/supply/ab8500_bmdata.c | 2 +-
drivers/power/supply/ab8500_btemp.c | 28 +-
drivers/power/supply/ab8500_chargalg.c | 9 +-
drivers/power/supply/ab8500_charger.c | 402 ++++++-
drivers/power/supply/ab8500_fg.c | 27 +-
drivers/power/supply/bq24190_charger.c | 53 +-
drivers/power/supply/bq2515x_charger.c | 15 +-
drivers/power/supply/generic-adc-battery.c | 3 +
drivers/power/supply/gpio-charger.c | 5 +-
drivers/power/supply/mm8013.c | 1 +
drivers/power/supply/qcom_battmgr.c | 26 +-
drivers/pwm/pwm-lp3943.c | 3 +
drivers/pwm/pwm-mtk-disp.c | 4 +-
drivers/pwm/pwm-renesas-tpu.c | 23 +-
drivers/regulator/ab8500.c | 159 ++-
drivers/regulator/fixed.c | 4 +
drivers/regulator/irq_helpers.c | 38 +-
drivers/regulator/mp886x.c | 13 +-
drivers/regulator/qcom-rpmh-regulator.c | 2 +-
drivers/remoteproc/imx_dsp_rproc.c | 58 +-
drivers/remoteproc/imx_rproc.c | 18 +-
drivers/remoteproc/qcom_q6v5_adsp.c | 2 +-
drivers/remoteproc/remoteproc_core.c | 3 +
drivers/remoteproc/xlnx_r5_remoteproc.c | 8 +-
drivers/rpmsg/mtk_rpmsg.c | 1 +
drivers/rpmsg/virtio_rpmsg_bus.c | 118 +-
drivers/rtc/Kconfig | 21 +
drivers/rtc/class.c | 8 +-
drivers/rtc/rtc-abx80x.c | 58 +-
drivers/rtc/rtc-bd70528.c | 5 +
drivers/rtc/rtc-ds1685.c | 20 +-
drivers/rtc/rtc-ftrtc010.c | 85 +-
drivers/rtc/rtc-mpfs.c | 4 +-
drivers/rtc/rtc-s35390a.c | 147 ++-
drivers/s390/block/dasd_genhd.c | 1 -
drivers/s390/block/scm_blk.c | 1 -
drivers/s390/virtio/virtio_ccw.c | 6 +-
drivers/scsi/ch.c | 2 +-
drivers/scsi/device_handler/scsi_dh_hp_sw.c | 4 +-
drivers/scsi/device_handler/scsi_dh_rdac.c | 10 +-
drivers/scsi/elx/libefc/efclib.c | 2 +
drivers/scsi/hisi_sas/hisi_sas.h | 3 +
drivers/scsi/hisi_sas/hisi_sas_main.c | 43 +
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 4 +
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 +-
drivers/scsi/libsas/sas_expander.c | 5 +-
drivers/scsi/libsas/sas_task.c | 2 +-
drivers/scsi/mpi3mr/mpi3mr.h | 2 +-
drivers/scsi/mpi3mr/mpi3mr_app.c | 47 +-
drivers/scsi/mpi3mr/mpi3mr_fw.c | 17 +-
drivers/scsi/mpi3mr/mpi3mr_os.c | 161 ++-
drivers/scsi/mpi3mr/mpi3mr_transport.c | 18 +-
drivers/scsi/pm8001/pm8001_defs.h | 98 ++
drivers/scsi/pm8001/pm8001_hwi.c | 2 +-
drivers/scsi/pm8001/pm8001_hwi.h | 4 +-
drivers/scsi/pm8001/pm80xx_hwi.c | 2 +-
drivers/scsi/pm8001/pm80xx_hwi.h | 100 +-
drivers/scsi/scsi_debug.c | 415 ++++++-
drivers/scsi/scsi_lib.c | 7 +-
drivers/scsi/scsi_lib_test.c | 25 +-
drivers/scsi/scsi_scan.c | 8 +-
drivers/scsi/scsi_transport_spi.c | 2 +-
drivers/scsi/sd.c | 20 +-
drivers/scsi/ses.c | 8 +-
drivers/scsi/st.c | 75 ++
drivers/soc/qcom/apr.c | 50 +-
drivers/soc/qcom/pmic_glink.c | 69 +-
drivers/soc/qcom/pmic_pdcharger_ulog.c | 2 +-
drivers/soc/tegra/flowctrl.c | 7 +-
drivers/soundwire/intel_auxdevice.c | 2 +-
drivers/spi/spi-bcm63xx-hsspi.c | 1 +
drivers/spi/spi-fsl-spi.c | 22 +-
drivers/spi/spi-mtk-nor.c | 1 +
drivers/spi/spi-mxic.c | 8 +-
drivers/spi/spi-omap2-mcspi.c | 242 ++--
drivers/spi/spi-rspi.c | 49 +-
drivers/spi/spi-sh-msiof.c | 50 +-
drivers/spi/spi-sun4i.c | 56 +-
drivers/spi/spi-tegra114.c | 49 +
drivers/spi/spi.c | 2 +-
drivers/spmi/spmi-pmic-arb.c | 2 +-
drivers/staging/iio/adc/ad7816.c | 33 +-
drivers/staging/octeon/ethernet-tx.c | 2 +-
drivers/staging/rtl8723bs/core/rtw_mlme.c | 13 -
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 +-
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 6 +-
drivers/staging/rtl8723bs/core/rtw_recv.c | 53 +-
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 4 +-
drivers/staging/rtl8723bs/hal/hal_com.c | 20 +-
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 16 +-
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 8 +-
drivers/staging/rtl8723bs/include/drv_types.h | 41 -
drivers/staging/rtl8723bs/include/recv_osdep.h | 4 -
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 21 +-
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 44 -
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 45 +-
drivers/staging/sm750fb/sm750.c | 10 +-
drivers/target/target_core_device.c | 87 +-
drivers/target/target_core_stat.c | 69 +-
drivers/target/target_core_tpg.c | 10 +-
drivers/thermal/gov_power_allocator.c | 7 +-
drivers/thermal/sprd_thermal.c | 6 +
drivers/thermal/thermal_trace.h | 4 +-
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 10 +-
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 +
drivers/tty/serial/8250/8250_aspeed_vuart.c | 2 +-
drivers/tty/serial/8250/8250_bcm2835aux.c | 2 +-
drivers/tty/serial/8250/8250_bcm7271.c | 2 +-
drivers/tty/serial/8250/8250_dw.c | 2 +-
drivers/tty/serial/8250/8250_em.c | 2 +-
drivers/tty/serial/8250/8250_fsl.c | 2 +-
drivers/tty/serial/8250/8250_ingenic.c | 2 +-
drivers/tty/serial/8250/8250_ioc3.c | 2 +-
drivers/tty/serial/8250/8250_lpc18xx.c | 2 +-
drivers/tty/serial/8250/8250_mtk.c | 2 +-
drivers/tty/serial/8250/8250_of.c | 2 +-
drivers/tty/serial/8250/8250_omap.c | 2 +-
drivers/tty/serial/8250/8250_platform.c | 2 +-
drivers/tty/serial/8250/8250_pxa.c | 2 +-
drivers/tty/serial/8250/8250_tegra.c | 2 +-
drivers/tty/serial/8250/8250_uniphier.c | 12 +-
drivers/tty/serial/Kconfig | 1 +
drivers/tty/serial/altera_jtaguart.c | 2 +-
drivers/tty/serial/altera_uart.c | 2 +-
drivers/tty/serial/amba-pl011.c | 2 +-
drivers/tty/serial/ar933x_uart.c | 2 +-
drivers/tty/serial/atmel_serial.c | 2 +-
drivers/tty/serial/bcm63xx_uart.c | 2 +-
drivers/tty/serial/clps711x.c | 2 +-
drivers/tty/serial/cpm_uart.c | 2 +-
drivers/tty/serial/digicolor-usart.c | 2 +-
drivers/tty/serial/esp32_acm.c | 2 +-
drivers/tty/serial/esp32_uart.c | 2 +-
drivers/tty/serial/fsl_linflexuart.c | 2 +-
drivers/tty/serial/fsl_lpuart.c | 2 +-
drivers/tty/serial/imx.c | 2 +-
drivers/tty/serial/lantiq.c | 2 +-
drivers/tty/serial/liteuart.c | 2 +-
drivers/tty/serial/lpc32xx_hs.c | 2 +-
drivers/tty/serial/ma35d1_serial.c | 4 +-
drivers/tty/serial/max310x.c | 185 ++-
drivers/tty/serial/mcf.c | 2 +-
drivers/tty/serial/meson_uart.c | 2 +-
drivers/tty/serial/milbeaut_usio.c | 2 +-
drivers/tty/serial/mpc52xx_uart.c | 2 +-
drivers/tty/serial/msm_serial.c | 2 +-
drivers/tty/serial/mxs-auart.c | 2 +-
drivers/tty/serial/omap-serial.c | 2 +-
drivers/tty/serial/owl-uart.c | 2 +-
drivers/tty/serial/pic32_uart.c | 2 +-
drivers/tty/serial/pmac_zilog.c | 3 +-
drivers/tty/serial/qcom_geni_serial.c | 2 +-
drivers/tty/serial/rda-uart.c | 2 +-
drivers/tty/serial/sa1100.c | 2 +-
drivers/tty/serial/samsung_tty.c | 2 +-
drivers/tty/serial/sccnxp.c | 2 +-
drivers/tty/serial/serial-tegra.c | 2 +-
drivers/tty/serial/serial_txx9.c | 55 +-
drivers/tty/serial/sh-sci.c | 2 +-
drivers/tty/serial/sifive.c | 4 +-
drivers/tty/serial/sprd_serial.c | 2 +-
drivers/tty/serial/st-asc.c | 2 +-
drivers/tty/serial/stm32-usart.c | 2 +-
drivers/tty/serial/sunhv.c | 2 +-
drivers/tty/serial/sunplus-uart.c | 2 +-
drivers/tty/serial/sunsab.c | 2 +-
drivers/tty/serial/sunsu.c | 2 +-
drivers/tty/serial/sunzilog.c | 2 +-
drivers/tty/serial/tegra-tcu.c | 2 +-
drivers/tty/serial/timbuart.c | 2 +-
drivers/tty/serial/uartlite.c | 2 +-
drivers/tty/serial/ucc_uart.c | 2 +-
drivers/tty/serial/xilinx_uartps.c | 2 +-
drivers/ufs/core/ufshcd.c | 14 +-
drivers/ufs/host/ufs-mediatek.c | 16 +-
drivers/usb/gadget/composite.c | 2 +-
drivers/usb/gadget/function/f_mass_storage.c | 7 +-
drivers/usb/gadget/udc/dummy_hcd.c | 4 +-
drivers/usb/host/pci-quirks.c | 1 +
drivers/usb/host/xhci-dbgtty.c | 2 +
drivers/usb/image/microtek.c | 1 +
drivers/usb/mon/mon_main.c | 3 +
drivers/usb/musb/da8xx.c | 8 +-
drivers/usb/storage/alauda.c | 95 +-
drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 9 +-
drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 9 +-
drivers/vfio/cdx/main.c | 10 +-
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 10 +-
drivers/vfio/pci/vfio_pci_core.c | 1 +
drivers/vfio/platform/vfio_platform_common.c | 10 +-
drivers/vhost/scsi.c | 31 +-
drivers/vhost/vringh.c | 4 +-
drivers/video/fbdev/core/fbcon.c | 57 +
drivers/video/fbdev/gxt4500.c | 1 +
drivers/video/fbdev/kyro/fbdev.c | 19 +-
drivers/virtio/virtio.c | 2 +
drivers/virtio/virtio_pci_modern.c | 12 +-
fs/backing-file.c | 28 +
fs/btrfs/accessors.c | 123 +-
fs/btrfs/accessors.h | 37 -
fs/btrfs/block-group.c | 6 +-
fs/btrfs/ctree.c | 51 +-
fs/btrfs/ctree.h | 2 +-
fs/btrfs/defrag.c | 2 +-
fs/btrfs/disk-io.c | 6 +-
fs/btrfs/extent-io-tree.h | 7 -
fs/btrfs/extent-tree.c | 3 +-
fs/btrfs/free-space-cache.c | 10 +
fs/btrfs/inode.c | 74 +-
fs/btrfs/ioctl.c | 11 +
fs/btrfs/messages.c | 5 +-
fs/btrfs/qgroup.c | 4 +-
fs/btrfs/raid56.c | 11 +-
fs/btrfs/relocation.c | 3 -
fs/btrfs/tests/inode-tests.c | 12 +-
fs/btrfs/tree-mod-log.c | 13 +-
fs/btrfs/verity.c | 31 +-
fs/btrfs/zoned.c | 8 +-
fs/ceph/addr.c | 102 +-
fs/ceph/inode.c | 2 +-
fs/ceph/mds_client.c | 2 +
fs/ceph/mds_client.h | 3 +
fs/ceph/super.c | 29 +-
fs/ceph/super.h | 1 -
fs/dcache.c | 2 +
fs/debugfs/file.c | 81 +-
fs/dlm/config.c | 30 +-
fs/dlm/dlm_internal.h | 5 +
fs/dlm/lock.c | 18 +-
fs/dlm/lock.h | 4 +-
fs/eventpoll.c | 18 +-
fs/ext2/file.c | 7 +
fs/f2fs/node.c | 4 +-
fs/f2fs/super.c | 33 +-
fs/fs-writeback.c | 17 +-
fs/fs_pin.c | 15 +-
fs/fuse/file.c | 5 +-
fs/gfs2/bmap.c | 2 +-
fs/gfs2/inode.c | 2 +-
fs/hfs/btree.c | 7 +-
fs/hfsplus/btree.c | 7 +-
fs/hugetlbfs/inode.c | 6 +
fs/isofs/dir.c | 4 +-
fs/isofs/isofs.h | 11 +-
fs/isofs/joliet.c | 27 +-
fs/isofs/namei.c | 3 +-
fs/kernfs/dir.c | 12 +-
fs/kernfs/symlink.c | 17 +-
fs/minix/inode.c | 16 +
fs/minix/minix.h | 9 +
fs/minix/namei.c | 27 +-
fs/netfs/internal.h | 32 +-
fs/nfs/dir.c | 13 +-
fs/nfs/filelayout/filelayout.c | 5 +-
fs/nfs/flexfilelayout/flexfilelayout.c | 81 +-
fs/nfs/fs_context.c | 1 +
fs/nfs/internal.h | 31 +
fs/nfs/nfs3proc.c | 8 +
fs/nfs/nfs4client.c | 7 +-
fs/nfs/nfs4proc.c | 5 +
fs/nfs/nfs4xdr.c | 3 +-
fs/nfs/pnfs.c | 12 +-
fs/nfs/proc.c | 8 +
fs/nilfs2/namei.c | 8 +-
fs/nilfs2/recovery.c | 17 +
fs/ntfs3/attrib.c | 10 +-
fs/ntfs3/file.c | 35 +-
fs/ntfs3/frecord.c | 180 +--
fs/ntfs3/fsntfs.c | 130 +--
fs/ntfs3/inode.c | 13 +-
fs/ntfs3/ntfs_fs.h | 20 +-
fs/ntfs3/xattr.c | 8 +-
fs/ocfs2/cluster/heartbeat.c | 52 +-
fs/ocfs2/cluster/tcp.c | 8 +-
fs/ocfs2/dlmglue.c | 29 +-
fs/ocfs2/dlmglue.h | 5 +-
fs/ocfs2/export.c | 10 +-
fs/ocfs2/inode.c | 5 +-
fs/ocfs2/move_extents.c | 62 +-
fs/ocfs2/namei.c | 6 +-
fs/ocfs2/quota_local.c | 24 +
fs/ocfs2/xattr.c | 266 ++++-
fs/ocfs2/xattr.h | 12 +-
fs/overlayfs/readdir.c | 41 +-
fs/overlayfs/util.c | 2 +-
fs/proc/generic.c | 4 +
fs/proc/kcore.c | 8 +-
fs/pstore/ram.c | 1 +
fs/pstore/ram_core.c | 6 +
fs/quota/dquot.c | 10 +-
fs/smb/client/cifspdu.h | 95 +-
fs/smb/client/smb2ops.c | 8 +-
fs/smb/client/smb2pdu.c | 14 +-
fs/smb/client/smb2pdu.h | 69 --
fs/smb/common/smb2pdu.h | 230 +++-
fs/smb/server/Kconfig | 1 +
fs/smb/server/oplock.c | 8 +-
fs/smb/server/smb2ops.c | 6 +-
fs/smb/server/smb2pdu.c | 192 ++--
fs/smb/server/smb2pdu.h | 58 -
fs/smb/server/smb_common.c | 4 +-
fs/smb/server/smb_common.h | 75 +-
fs/smb/server/smbacl.c | 41 +-
fs/smb/server/vfs_cache.c | 15 +-
fs/splice.c | 43 +-
fs/stat.c | 4 +-
fs/userfaultfd.c | 12 +-
fs/xattr.c | 2 +-
fs/xfs/libxfs/xfs_bmap.c | 14 +-
fs/xfs/libxfs/xfs_bmap.h | 10 +-
include/acpi/acpi_bus.h | 9 +-
include/acpi/acpi_drivers.h | 9 +-
include/kvm/arm_vgic.h | 1 +
include/linux/acpi.h | 24 +-
include/linux/blk-mq.h | 7 +-
include/linux/bpf.h | 9 +-
include/linux/clk-provider.h | 22 +-
include/linux/efi.h | 21 +-
include/linux/etherdevice.h | 28 +
include/linux/firewire.h | 1 -
include/linux/fortify-string.h | 2 -
include/linux/if_bridge.h | 77 +-
include/linux/mfd/da9150/core.h | 1 +
include/linux/mm.h | 53 +-
include/linux/mm_types.h | 13 +-
include/linux/mmap_lock.h | 16 +
include/linux/mtd/spinand.h | 2 +-
include/linux/pm_wakeirq.h | 6 +
include/linux/pm_wakeup.h | 17 +
include/linux/quotaops.h | 5 +
include/linux/shmem_fs.h | 15 +-
include/linux/skbuff.h | 90 +-
include/linux/slab.h | 60 +-
include/linux/soc/ti/k3-ringacc.h | 31 +-
include/linux/sunrpc/svc_rdma.h | 2 +-
include/linux/userfaultfd_k.h | 8 +
include/linux/wait.h | 6 +-
include/linux/watch_queue.h | 6 +-
include/net/bluetooth/bluetooth.h | 4 +-
include/net/bluetooth/hci_sync.h | 1 +
include/net/bluetooth/l2cap.h | 3 +-
include/net/cfg80211.h | 12 +-
include/net/cipso_ipv4.h | 11 +-
include/net/inet_frag.h | 9 +
include/net/ip.h | 2 +-
include/net/ip_vs.h | 50 +-
include/net/netfilter/nf_conntrack_seqadj.h | 1 +
include/net/netlabel.h | 11 +-
include/net/seg6_hmac.h | 3 +-
include/net/sock.h | 8 +-
include/net/switchdev.h | 1 +
include/scsi/libsas.h | 8 +
include/scsi/scsi_cmnd.h | 7 +
include/scsi/scsi_common.h | 31 +-
include/scsi/scsi_device.h | 37 +-
include/scsi/scsi_proto.h | 65 +-
include/scsi/scsi_sense.h | 950 +++++++++++++++
include/sound/control.h | 4 +-
include/sound/core.h | 25 +-
include/sound/pcm.h | 2 +
include/sound/pcm_oss.h | 1 +
include/sound/soc-component.h | 2 +-
include/sound/ump.h | 6 +
include/target/target_core_base.h | 20 +-
include/trace/events/iocost.h | 7 +-
include/trace/events/power.h | 3 +
include/uapi/linux/firewire-cdev.h | 4 +-
include/uapi/linux/iommufd.h | 2 +-
include/uapi/sound/asequencer.h | 12 +-
include/ufs/ufshcd.h | 8 +
init/main.c | 8 +-
io_uring/eventfd.c | 1 +
kernel/bpf/bpf_iter.c | 24 +-
kernel/bpf/bpf_lsm.c | 4 +-
kernel/bpf/btf.c | 27 +-
kernel/bpf/core.c | 54 +-
kernel/bpf/helpers.c | 1 +
kernel/bpf/offload.c | 25 +-
kernel/bpf/syscall.c | 144 ++-
kernel/bpf/task_iter.c | 6 +-
kernel/bpf/verifier.c | 42 +-
kernel/cgroup/cpuset.c | 45 +-
kernel/debug/kdb/kdb_io.c | 1 -
kernel/debug/kdb/kdb_main.c | 6 +-
kernel/debug/kdb/kdb_private.h | 3 +-
kernel/fork.c | 44 +-
kernel/kcov.c | 35 +-
kernel/kexec_file.c | 4 +-
kernel/module/tracking.c | 2 +-
kernel/nsproxy.c | 2 +-
kernel/profile.c | 2 +-
kernel/rcu/rcutorture.c | 2 +-
kernel/rcu/tree.c | 2 +-
kernel/rcu/tree.h | 3 +-
kernel/rcu/tree_nocb.h | 60 +-
kernel/reboot.c | 4 +-
kernel/resource_kunit.c | 3 +
kernel/signal.c | 5 +-
kernel/time/timeconv.c | 6 +-
kernel/time/timer.c | 2 +
kernel/trace/bpf_trace.c | 80 +-
kernel/trace/trace_btf.c | 3 +
kernel/trace/trace_events_hist.c | 25 +-
kernel/ucount.c | 7 +-
kernel/watch_queue.c | 2 +-
lib/Kconfig.debug | 1 -
lib/bitmap-str.c | 24 +-
lib/decompress_unlz4.c | 4 +
lib/kobject.c | 2 +-
lib/maple_tree.c | 65 +-
lib/test_hmm.c | 2 +
mm/cma.c | 2 +
mm/damon/reclaim.c | 4 +-
mm/filemap.c | 31 +-
mm/gup_test.c | 17 +-
mm/huge_memory.c | 11 +-
mm/hugetlb.c | 55 +-
mm/internal.h | 4 +-
mm/khugepaged.c | 51 +-
mm/ksm.c | 40 +-
mm/madvise.c | 4 +
mm/memcontrol.c | 2 +
mm/memory-tiers.c | 29 +-
mm/memory.c | 106 +-
mm/memory_hotplug.c | 6 +-
mm/mmap.c | 3 +-
mm/mmap_lock.c | 39 +
mm/mremap.c | 32 +-
mm/oom_kill.c | 22 +-
mm/page_alloc.c | 4 +-
mm/rmap.c | 20 +-
mm/shmem.c | 40 +-
mm/slab_common.c | 18 +-
mm/truncate.c | 7 +-
mm/userfaultfd.c | 14 +-
mm/util.c | 13 +
mm/vma.c | 68 +-
net/9p/trans_xen.c | 4 +-
net/bluetooth/6lowpan.c | 3 +-
net/bluetooth/hci_core.c | 4 +-
net/bluetooth/hci_event.c | 58 +-
net/bluetooth/hci_sync.c | 47 +-
net/bluetooth/iso.c | 3 +
net/bluetooth/l2cap_core.c | 24 +
net/bluetooth/mgmt.c | 115 +-
net/bluetooth/msft.c | 6 +
net/bpf/test_run.c | 171 ++-
net/bridge/br_mdb.c | 16 +-
net/bridge/br_multicast.c | 14 +-
net/bridge/br_netlink.c | 2 +-
net/bridge/br_private.h | 12 +
net/bridge/br_stp.c | 4 +-
net/bridge/br_stp_bpdu.c | 2 +-
net/bridge/br_switchdev.c | 23 +-
net/bridge/br_vlan.c | 7 +-
net/bridge/br_vlan_options.c | 2 +-
net/ceph/messenger_v1.c | 8 +-
net/ceph/osdmap.c | 2 +-
net/core/bpf_sk_storage.c | 7 +
net/core/dev.c | 20 +-
net/core/filter.c | 58 +-
net/core/gro.c | 5 +-
net/core/lwtunnel.c | 6 +
net/core/selftests.c | 2 +-
net/core/skbuff.c | 11 +-
net/core/sock.c | 1 +
net/dcb/dcbnl.c | 2 +
net/devlink/region.c | 5 +
net/ipv4/cipso_ipv4.c | 16 +-
net/ipv4/devinet.c | 35 +-
net/ipv4/gre_offload.c | 2 +-
net/ipv4/inet_fragment.c | 66 +-
net/ipv4/ip_fragment.c | 13 +-
net/ipv4/ip_output.c | 15 +-
net/ipv4/ip_tunnel.c | 14 +-
net/ipv4/ipmr.c | 5 +
net/ipv4/tcp.c | 14 +-
net/ipv4/tcp_bic.c | 14 +-
net/ipv4/tcp_cubic.c | 14 +-
net/ipv4/tcp_hybla.c | 16 +-
net/ipv4/tcp_ipv4.c | 10 +-
net/ipv4/tcp_metrics.c | 20 +-
net/ipv4/tcp_offload.c | 12 +-
net/ipv6/calipso.c | 6 +-
net/ipv6/exthdrs.c | 2 +-
net/ipv6/netfilter/nf_conntrack_reasm.c | 15 +-
net/ipv6/reassembly.c | 13 +-
net/ipv6/route.c | 20 +-
net/ipv6/seg6_hmac.c | 5 +-
net/ipv6/seg6_local.c | 6 +-
net/ipv6/sit.c | 4 +-
net/l2tp/l2tp_core.c | 51 +-
net/l2tp/l2tp_core.h | 6 +-
net/l2tp/l2tp_debugfs.c | 4 +-
net/l2tp/l2tp_netlink.c | 11 +-
net/l2tp/l2tp_ppp.c | 8 +-
net/mac80211/cfg.c | 49 +-
net/mac80211/debugfs.c | 2 +-
net/mac80211/ieee80211_i.h | 3 +-
net/mac80211/main.c | 2 +
net/mac80211/mesh.c | 3 +-
net/mac80211/mesh_pathtbl.c | 17 +-
net/mac80211/rx.c | 1 +
net/mac80211/tx.c | 223 ++--
net/mctp/route.c | 10 +-
net/mptcp/options.c | 9 +-
net/netfilter/ipvs/ip_vs_conn.c | 8 +-
net/netfilter/ipvs/ip_vs_ctl.c | 38 +-
net/netfilter/ipvs/ip_vs_dh.c | 16 +-
net/netfilter/ipvs/ip_vs_fo.c | 2 +-
net/netfilter/ipvs/ip_vs_lblc.c | 4 +-
net/netfilter/ipvs/ip_vs_lblcr.c | 8 +-
net/netfilter/ipvs/ip_vs_lc.c | 2 +-
net/netfilter/ipvs/ip_vs_mh.c | 2 +-
net/netfilter/ipvs/ip_vs_nq.c | 2 +-
net/netfilter/ipvs/ip_vs_ovf.c | 2 +-
net/netfilter/ipvs/ip_vs_rr.c | 2 +-
net/netfilter/ipvs/ip_vs_sed.c | 4 +-
net/netfilter/ipvs/ip_vs_sh.c | 2 +-
net/netfilter/ipvs/ip_vs_sync.c | 23 +-
net/netfilter/ipvs/ip_vs_twos.c | 4 +-
net/netfilter/ipvs/ip_vs_wlc.c | 4 +-
net/netfilter/ipvs/ip_vs_wrr.c | 2 +-
net/netfilter/nf_conntrack_core.c | 5 +
net/netfilter/nf_conntrack_seqadj.c | 17 +
net/netfilter/nf_flow_table_ip.c | 30 +-
net/netfilter/nf_synproxy_core.c | 4 +-
net/netfilter/nft_compat.c | 15 +
net/netfilter/xt_dccp.c | 2 +-
net/netlabel/netlabel_kapi.c | 24 +-
net/netlink/af_netlink.c | 12 +-
net/openvswitch/actions.c | 9 +
net/openvswitch/vport-internal_dev.c | 8 +-
net/rds/af_rds.c | 29 +-
net/rds/bind.c | 4 +-
net/rds/ib_sysctl.c | 2 +-
net/rds/rdma_transport.c | 3 +
net/rds/rds.h | 3 +
net/rds/recv.c | 11 +-
net/rds/send.c | 9 +-
net/rds/sysctl.c | 2 +-
net/rds/tcp.c | 5 +-
net/rose/af_rose.c | 56 +-
net/rose/rose_link.c | 7 +-
net/rose/rose_loopback.c | 7 +-
net/rose/rose_route.c | 65 +-
net/rxrpc/rxperf.c | 12 -
net/sched/act_api.c | 24 +-
net/sched/sch_etf.c | 1 +
net/sched/sch_gred.c | 16 +-
net/sched/sch_taprio.c | 6 +-
net/sctp/ipv6.c | 6 +-
net/sctp/sm_make_chunk.c | 24 +-
net/sctp/sm_statefuns.c | 2 +-
net/smc/smc_pnet.c | 29 +-
net/sunrpc/xprtsock.c | 34 +-
net/switchdev/switchdev.c | 2 +-
net/tipc/bearer.c | 4 +
net/tipc/node.c | 2 +-
net/tls/tls_device.c | 21 +-
net/tls/tls_main.c | 4 +-
net/wireless/nl80211.c | 6 +-
net/wireless/reg.c | 41 +-
net/wireless/sme.c | 38 +-
scripts/Makefile.vmlinux_o | 2 +-
scripts/checkkconfigsymbols.py | 2 +-
scripts/checkpatch.pl | 2 +
scripts/clang-tools/run-clang-tools.py | 1 +
scripts/gdb/linux/radixtree.py | 203 +++-
scripts/gdb/linux/stackdepot.py | 2 +-
scripts/kconfig/conf.c | 19 +-
scripts/kconfig/symbol.c | 39 +-
scripts/kconfig/tests/conftest.py | 9 +-
.../kconfig/tests/randconfig_probability/Kconfig | 12 +
.../tests/randconfig_probability/__init__.py | 130 +++
scripts/kconfig/tests/savedefconfig_range/Kconfig | 60 +
.../kconfig/tests/savedefconfig_range/__init__.py | 8 +
scripts/kconfig/tests/savedefconfig_range/config | 7 +
.../tests/savedefconfig_range/expected_defconfig | 0
scripts/make_fit.py | 3 +-
security/apparmor/apparmorfs.c | 21 +-
security/apparmor/domain.c | 9 +-
security/apparmor/file.c | 23 +-
security/apparmor/include/file.h | 5 +-
security/apparmor/include/lib.h | 1 +
security/apparmor/include/match.h | 19 +-
security/apparmor/include/policy.h | 27 +-
security/apparmor/label.c | 14 +-
security/apparmor/lib.c | 23 +
security/apparmor/lsm.c | 19 +
security/apparmor/match.c | 158 ++-
security/apparmor/net.c | 1 +
security/apparmor/policy.c | 3 +
security/apparmor/policy_compat.c | 6 +-
security/apparmor/policy_ns.c | 6 +-
security/apparmor/policy_unpack.c | 57 +-
security/integrity/ima/ima_template.c | 5 +
security/ipe/audit.c | 8 -
security/security.c | 3 +-
security/selinux/netlabel.c | 5 +-
security/smack/smack_lsm.c | 14 +-
sound/core/control.c | 12 +-
sound/core/control_compat.c | 21 +-
sound/core/control_led.c | 74 +-
sound/core/ctljack.c | 1 +
sound/core/info.c | 3 +-
sound/core/init.c | 33 +-
sound/core/jack.c | 11 +-
sound/core/misc.c | 27 +
sound/core/oss/mixer_oss.c | 36 +-
sound/core/oss/pcm_oss.c | 12 +
sound/core/pcm.c | 13 +-
sound/core/pcm_compat.c | 4 +-
sound/core/pcm_lib.c | 16 +-
sound/core/pcm_local.h | 6 +
sound/core/pcm_native.c | 122 +-
sound/core/rawmidi.c | 3 +
sound/core/seq/seq_clientmgr.c | 12 +-
sound/core/seq/seq_compat.c | 15 +-
sound/core/seq/seq_system.c | 9 +-
sound/core/seq/seq_system.h | 31 +-
sound/core/seq/seq_ump_client.c | 45 +-
sound/core/timer.c | 1 +
sound/core/ump.c | 80 +-
sound/core/vmaster.c | 10 +-
sound/drivers/aloop.c | 17 +-
sound/drivers/pcmtest.c | 28 +-
sound/hda/hdac_bus.c | 9 +-
sound/pci/hda/hda_codec.c | 2 +-
sound/pci/hda/hda_controller.h | 4 -
sound/pci/hda/hda_intel.c | 91 +-
sound/pci/hda/hda_jack.c | 9 +-
sound/pci/oxygen/oxygen.c | 12 +-
sound/pci/oxygen/oxygen_mixer.c | 60 +-
sound/pci/oxygen/oxygen_pcm.c | 54 +-
sound/pci/oxygen/xonar_cs43xx.c | 3 +-
sound/pci/oxygen/xonar_dg_mixer.c | 33 +-
sound/pci/oxygen/xonar_pcm179x.c | 18 +-
sound/pci/oxygen/xonar_wm87x6.c | 31 +-
sound/pci/via82xx.c | 11 +-
sound/sh/aica.c | 2 +-
sound/soc/amd/acp-es8336.c | 5 +-
sound/soc/amd/acp/acp-platform.c | 2 +-
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 14 +-
sound/soc/amd/ps/ps-pdm-dma.c | 2 +-
sound/soc/amd/ps/ps-sdw-dma.c | 2 +-
sound/soc/amd/raven/acp3x-pcm-dma.c | 4 +-
sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 +-
sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +-
sound/soc/amd/yc/acp6x-pdm-dma.c | 2 +-
sound/soc/atmel/atmel-i2s.c | 43 +-
sound/soc/atmel/atmel-pcm-pdc.c | 2 +
sound/soc/codecs/adau17x1.c | 4 +-
sound/soc/codecs/ak4642.c | 3 +-
sound/soc/codecs/cs42l56.c | 1 -
sound/soc/codecs/da732x.c | 2 +-
sound/soc/codecs/es8316.c | 4 +-
sound/soc/codecs/es8326.c | 26 +-
sound/soc/codecs/mt6359-accdet.c | 50 +-
sound/soc/codecs/nau8540.c | 4 +-
sound/soc/codecs/rt1011.c | 4 +-
sound/soc/codecs/rt1016.c | 4 +-
sound/soc/codecs/rt1305.c | 4 +-
sound/soc/codecs/rt1308.c | 4 +-
sound/soc/codecs/rt1318.c | 3 +-
sound/soc/codecs/rt5616.c | 3 +-
sound/soc/codecs/rt5659.c | 10 +-
sound/soc/codecs/rt5660.c | 4 +-
sound/soc/codecs/rt5665.c | 4 +-
sound/soc/codecs/rt5682-sdw.c | 3 +-
sound/soc/codecs/rt711-sdca-sdw.c | 6 +-
sound/soc/codecs/rt711-sdw.c | 8 +-
sound/soc/codecs/rt712-sdca-sdw.c | 6 +-
sound/soc/codecs/rt712-sdca.c | 5 +-
sound/soc/codecs/rt722-sdca-sdw.c | 6 +-
sound/soc/codecs/sta32x.c | 20 +-
sound/soc/codecs/sta350.c | 20 +-
sound/soc/codecs/tlv320adc3xxx.c | 2 +-
sound/soc/codecs/tlv320aic32x4-clk.c | 68 +-
sound/soc/codecs/tlv320aic32x4-i2c.c | 21 +-
sound/soc/codecs/tlv320aic32x4-spi.c | 25 +-
sound/soc/codecs/tlv320aic32x4.c | 273 ++---
sound/soc/codecs/tlv320aic32x4.h | 6 +-
sound/soc/codecs/wcd-mbhc-v2.c | 8 +-
sound/soc/codecs/wcd937x.c | 44 +-
sound/soc/codecs/wm5100.c | 2 +-
sound/soc/codecs/wm8510.c | 2 +-
sound/soc/codecs/wm8737.c | 8 +-
sound/soc/codecs/wm8750.c | 2 +-
sound/soc/codecs/wm8955.c | 2 +-
sound/soc/codecs/wm8983.c | 2 +-
sound/soc/codecs/wm8985.c | 2 +-
sound/soc/codecs/wm8990.c | 10 +-
sound/soc/codecs/wm8991.c | 10 +-
sound/soc/codecs/wm8994.c | 159 +--
sound/soc/codecs/wm8994.h | 2 +
sound/soc/codecs/wm_hubs.c | 2 +-
sound/soc/codecs/wsa883x.c | 8 +-
sound/soc/codecs/wsa884x.c | 8 +-
sound/soc/dwc/dwc-i2s.c | 6 +-
sound/soc/fsl/fsl_asrc.c | 8 +-
sound/soc/fsl/fsl_asrc_dma.c | 5 +
sound/soc/fsl/imx-pcm-rpmsg.c | 2 +-
sound/soc/intel/atom/sst-atom-controls.c | 38 +-
sound/soc/intel/atom/sst-mfld-platform-pcm.c | 36 +-
sound/soc/intel/avs/pcm.c | 2 +
sound/soc/intel/avs/utils.c | 6 +-
sound/soc/mediatek/common/mtk-afe-fe-dai.c | 8 +-
sound/soc/mediatek/common/mtk-soundcard-driver.c | 23 +-
sound/soc/mediatek/mt2701/mt2701-cs42448.c | 20 +-
sound/soc/mediatek/mt2701/mt2701-wm8960.c | 6 +-
sound/soc/mediatek/mt6797/mt6797-afe-clk.c | 14 +-
sound/soc/mediatek/mt6797/mt6797-mt6351.c | 24 +-
sound/soc/mediatek/mt7986/mt7986-wm8960.c | 6 +-
sound/soc/mediatek/mt8173/mt8173-max98090.c | 6 +-
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 6 +-
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 10 +-
sound/soc/mediatek/mt8173/mt8173-rt5650.c | 10 +-
sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 22 +-
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 34 +-
.../mt8183/mt8183-mt6358-ts3a227-max98357.c | 34 +-
sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 95 +-
sound/soc/mediatek/mt8186/mt8186-mt6366.c | 86 +-
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 104 +-
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 24 +-
sound/soc/mediatek/mt8188/mt8188-mt6359.c | 61 +-
sound/soc/mediatek/mt8192/mt8192-afe-clk.c | 139 ++-
sound/soc/mediatek/mt8192/mt8192-afe-gpio.c | 90 +-
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 6 +-
sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 44 +-
sound/soc/mediatek/mt8192/mt8192-dai-i2s.c | 20 +-
sound/soc/mediatek/mt8192/mt8192-dai-tdm.c | 18 +-
.../mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 115 +-
sound/soc/mediatek/mt8195/mt8195-afe-clk.c | 77 +-
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 102 +-
sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 99 +-
sound/soc/mediatek/mt8195/mt8195-mt6359.c | 60 +-
sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 7 +-
sound/soc/mediatek/mt8365/mt8365-dai-i2s.c | 2 +-
sound/soc/mediatek/mt8365/mt8365-mt6357.c | 14 +-
sound/soc/qcom/qdsp6/q6apm.c | 1 +
sound/soc/qcom/sdm845.c | 26 +-
sound/soc/rockchip/rk3288_hdmi_analog.c | 48 +-
sound/soc/rockchip/rockchip_i2s.c | 4 +-
sound/soc/samsung/midas_wm1811.c | 14 +-
sound/soc/soc-ac97.c | 4 +-
sound/soc/soc-card-test.c | 7 +-
sound/soc/soc-component.c | 2 +-
sound/soc/soc-link.c | 10 +-
sound/soc/soc-ops.c | 10 +-
sound/soc/soc-topology-test.c | 8 +-
sound/soc/sof/imx/imx-common.c | 1 +
sound/soc/xilinx/xlnx_formatter_pcm.c | 18 +-
sound/usb/6fire/control.c | 7 +
sound/usb/caiaq/device.c | 9 +-
sound/usb/caiaq/device.h | 6 +-
sound/usb/caiaq/input.c | 29 +-
sound/usb/caiaq/midi.c | 2 +
sound/usb/line6/capture.c | 3 +-
sound/usb/line6/pcm.c | 8 +-
sound/usb/mixer.c | 151 ++-
sound/usb/mixer.h | 6 +-
sound/usb/mixer_quirks.c | 2 +-
sound/usb/mixer_us16x08.c | 19 +-
sound/usb/quirks-table.h | 2 +
sound/usb/usx2y/us122l.c | 2 +-
sound/virtio/virtio_pcm.h | 2 +
sound/virtio/virtio_pcm_msg.c | 19 +
sound/virtio/virtio_pcm_ops.c | 1 +
tools/bpf/bpftool/common.c | 40 +
tools/bpf/bpftool/gen.c | 91 +-
tools/bpf/bpftool/link.c | 18 +-
tools/bpf/bpftool/main.c | 24 +-
tools/bpf/bpftool/main.h | 1 +
tools/bpf/bpftool/map.c | 101 +-
tools/bpf/bpftool/prog.c | 2 +-
tools/bpf/bpftool/tracelog.c | 2 +-
tools/cgroup/iocost_monitor.py | 7 +-
tools/cgroup/memcg_shrinker.py | 2 +-
tools/hv/vmbus_bufring.c | 6 -
tools/include/linux/types.h | 5 +
tools/include/nolibc/stdlib.h | 8 +-
tools/include/nolibc/types.h | 2 +-
tools/lib/bpf/btf.c | 300 +++--
tools/lib/bpf/btf.h | 3 +
tools/lib/bpf/btf_dump.c | 2 +-
tools/lib/bpf/btf_relocate.c | 2 +-
tools/lib/bpf/libbpf.c | 67 +-
tools/lib/bpf/libbpf.map | 2 +
tools/lib/bpf/libbpf_internal.h | 39 +
tools/lib/bpf/relo_core.c | 2 +-
tools/lib/bpf/skel_internal.h | 64 +-
tools/lib/perf/mmap.c | 2 +-
tools/perf/Documentation/perf-c2c.txt | 2 +-
tools/perf/Makefile.perf | 2 +-
tools/perf/arch/arm/tests/dwarf-unwind.c | 3 +-
tools/perf/arch/arm/util/unwind-libdw.c | 2 +-
tools/perf/arch/arm64/tests/dwarf-unwind.c | 3 +-
tools/perf/arch/arm64/util/unwind-libdw.c | 2 +-
tools/perf/arch/csky/util/unwind-libdw.c | 2 +-
tools/perf/arch/loongarch/util/unwind-libdw.c | 2 +-
tools/perf/arch/powerpc/tests/dwarf-unwind.c | 3 +-
tools/perf/arch/powerpc/util/unwind-libdw.c | 2 +-
tools/perf/arch/riscv/util/unwind-libdw.c | 2 +-
tools/perf/arch/s390/util/unwind-libdw.c | 2 +-
tools/perf/arch/x86/tests/dwarf-unwind.c | 2 +-
tools/perf/arch/x86/util/unwind-libdw.c | 2 +-
tools/perf/builtin-buildid-list.c | 5 +-
tools/perf/builtin-c2c.c | 16 +-
tools/perf/builtin-kallsyms.c | 21 +-
tools/perf/builtin-record.c | 4 +-
tools/perf/builtin-script.c | 10 +-
tools/perf/builtin-top.c | 8 +-
tools/perf/builtin-trace.c | 149 ++-
.../arch/x86/sierraforest/uncore-cache.json | 5 +
.../arch/x86/sierraforest/uncore-interconnect.json | 2 +
.../arch/x86/skylakex/uncore-interconnect.json | 6 +
.../arch/x86/snowridgex/uncore-cache.json | 68 ++
.../arch/x86/snowridgex/uncore-interconnect.json | 10 +
tools/perf/tests/builtin-test.c | 15 +-
tools/perf/tests/code-reading.c | 30 +-
tools/perf/tests/dlfilter-test.c | 51 +-
tools/perf/tests/dwarf-unwind.c | 53 +-
tools/perf/tests/mmap-basic.c | 3 +
tools/perf/tests/mmap-thread-lookup.c | 6 +-
tools/perf/tests/openat-syscall-tp-fields.c | 4 +-
tools/perf/tests/parse-no-sample-id-all.c | 6 +-
tools/perf/tests/perf-record.c | 2 +
tools/perf/tests/perf-time-to-tsc.c | 2 +
tools/perf/tests/sample-parsing.c | 167 ++-
tools/perf/tests/sigtrap.c | 20 +-
tools/perf/tests/sw-clock.c | 3 +
tools/perf/tests/switch-tracking.c | 14 +-
tools/perf/tests/symbols.c | 104 +-
tools/perf/ui/browsers/annotate-data.c | 2 +-
tools/perf/ui/tui/setup.c | 2 +-
tools/perf/util/Build | 4 +-
tools/perf/util/annotate-data.c | 21 +-
tools/perf/util/arm-spe.c | 24 +-
.../perf/util/arm64-frame-pointer-unwind-support.c | 29 +-
tools/perf/util/auxtrace.c | 15 +-
tools/perf/util/bpf-filter.c | 30 +-
tools/perf/util/bpf-utils.h | 5 +
tools/perf/util/btf.c | 27 +
tools/perf/util/btf.h | 10 +
tools/perf/util/cs-etm.c | 60 +-
tools/perf/util/debug.c | 77 +-
tools/perf/util/debug.h | 1 +
tools/perf/util/env.c | 1 +
tools/perf/util/evsel.c | 41 +-
tools/perf/util/header.c | 18 +-
tools/perf/util/intel-bts.c | 4 +-
tools/perf/util/intel-pt.c | 136 ++-
tools/perf/util/jitdump.c | 139 ++-
tools/perf/util/machine.c | 63 +-
tools/perf/util/machine.h | 5 +-
tools/perf/util/mem-events.c | 2 +-
tools/perf/util/mmap.c | 3 +-
tools/perf/util/print_insn.h | 1 +
tools/perf/util/probe-event.c | 5 +-
tools/perf/util/python.c | 65 +-
tools/perf/util/s390-cpumsf.c | 6 +-
tools/perf/util/sample.c | 43 +
tools/perf/util/sample.h | 9 +-
.../util/scripting-engines/trace-event-python.c | 29 +-
tools/perf/util/session.c | 94 +-
tools/perf/util/symbol.c | 4 +
tools/perf/util/synthetic-events.c | 24 +-
tools/perf/util/thread_map.c | 26 +
tools/perf/util/thread_map.h | 1 +
tools/perf/util/unwind-libdw.c | 9 +-
tools/perf/util/unwind-libunwind-local.c | 12 +-
.../x86_energy_perf_policy.c | 18 +-
tools/sched_ext/scx_flatcg.bpf.c | 2 +-
tools/testing/cxl/test/cxl.c | 8 +-
tools/testing/selftests/Makefile | 4 +-
tools/testing/selftests/alsa/mixer-test.c | 2 +
tools/testing/selftests/alsa/test-pcmtest-driver.c | 27 +-
tools/testing/selftests/arm64/signal/Makefile | 4 +-
tools/testing/selftests/bpf/network_helpers.c | 46 +-
.../bpf/prog_tests/cgroup_hierarchical_stats.c | 4 +-
tools/testing/selftests/bpf/prog_tests/empty_skb.c | 59 +-
tools/testing/selftests/bpf/prog_tests/missed.c | 8 +-
.../bpf/prog_tests/prog_tests_framework.c | 10 +-
tools/testing/selftests/bpf/prog_tests/sockopt.c | 4 +-
.../testing/selftests/bpf/prog_tests/test_tunnel.c | 13 +-
.../selftests/bpf/prog_tests/uprobe_multi_test.c | 4 +-
.../testing/selftests/bpf/progs/cpumask_success.c | 6 +
tools/testing/selftests/bpf/progs/empty_skb.c | 7 +
.../selftests/bpf/progs/verifier_vfs_accept.c | 18 +
.../selftests/bpf/progs/verifier_vfs_reject.c | 15 +
tools/testing/selftests/bpf/unpriv_helpers.c | 101 +-
tools/testing/selftests/breakpoints/Makefile | 4 +-
tools/testing/selftests/cgroup/test_core.c | 51 +-
tools/testing/selftests/cgroup/test_cpu.c | 7 +-
tools/testing/selftests/cgroup/test_cpuset.c | 7 +-
tools/testing/selftests/cgroup/test_freezer.c | 7 +-
tools/testing/selftests/cgroup/test_kill.c | 7 +-
tools/testing/selftests/cgroup/test_kmem.c | 7 +-
tools/testing/selftests/cgroup/test_memcontrol.c | 7 +-
tools/testing/selftests/cgroup/test_pids.c | 2 +-
tools/testing/selftests/cgroup/test_zswap.c | 238 +++-
.../selftests/clone3/clone3_clear_sighand.c | 6 +-
.../filesystems/epoll/epoll_wakeup_test.c | 32 +-
tools/testing/selftests/ftrace/ftracetest | 2 +-
tools/testing/selftests/ipc/Makefile | 8 +-
tools/testing/selftests/mm/vm_util.h | 1 +
tools/testing/selftests/net/lib/csum.c | 67 +-
.../selftests/net/netfilter/conntrack_vrf.sh | 25 +-
tools/testing/selftests/net/tcp_mmap.c | 6 +-
tools/testing/selftests/net/txtimestamp.c | 23 +-
tools/testing/selftests/prctl/Makefile | 4 +-
tools/testing/selftests/sched_ext/hotplug.c | 34 +-
tools/testing/selftests/sparc64/Makefile | 4 +-
.../selftests/thermal/intel/power_floor/Makefile | 12 +-
.../selftests/thermal/intel/workload_hint/Makefile | 12 +-
.../testing/selftests/timers/clocksource-switch.c | 23 +-
tools/thermal/tmon/tmon.c | 2 +-
usr/gen_init_cpio.c | 1 +
1611 files changed, 24531 insertions(+), 11234 deletions(-)
^ permalink raw reply [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0001/1756] KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0002/1756] inet: frags: limit the truesize of a reassembly queue Greg Kroah-Hartman
` (997 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bill Wendling, Stefan Teodorescu,
Sean Christopherson, Paolo Bonzini, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit 053621535f014085c935879582dd3b65964a0dce ]
When doing RSM to L2, validate L1's state after copying it back into vmcb01
from SMRAM, as SMRAM is carved out of guest memory, i.e. is writable by the
guest. Failure to validate L1's state is especially problematic for inputs
to MMU context, as KVM can end up with impossible CR4 vs. EFER state. E.g.
without the recent hardening FNAME(walk_addr_generic), a guest can trigger:
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in arch/x86/kvm/mmu/paging_tmpl.h:435:15
index 3 is out of range for type 'u32 [2]'
CPU: 3 UID: 0 PID: 92 Comm: CPU 1/KVM Not tainted 7.3.0-rc1 #2 PREEMPT(lazy)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x5f/0x90
dump_stack+0x10/0x18
ubsan_epilogue+0x9/0x39
__ubsan_handle_out_of_bounds.cold+0x50/0x55
paging32_walk_addr_generic+0x889/0x970
paging32_page_fault+0x79/0xa60
kvm_mmu_do_page_fault+0x125/0x270
kvm_mmu_page_fault+0x88/0x7b0
npf_interception+0xc8/0x220 [kvm_amd]
svm_invoke_exit_handler+0x16d/0x1d0 [kvm_amd]
svm_handle_exit+0xb7/0x160 [kvm_amd]
vcpu_enter_guest+0x428/0x16a0
kvm_arch_vcpu_ioctl_run+0x479/0x920
kvm_vcpu_ioctl+0x316/0xb00
__x64_sys_ioctl+0xa3/0x100
x64_sys_call+0x281/0x23d0
do_syscall_64+0xba/0x550
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x79bb30deb04b
</TASK>
---[ end trace ]---
Fixes: 37be407b2ce8 ("KVM: nSVM: Fix L1 state corruption upon return from SMM")
Cc: stable@vger.kernel.org
Reported-by: Bill Wendling <morbo@google.com>
Reported-by: Stefan Teodorescu <fane@google.com>
Tested-by: Stefan Teodorescu <fane@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20261022021046.295001-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[ sashal: adapted validation to __nested_vmcb_check_save() with failures routed through the existing unmap_save cleanup ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/svm/nested.c | 23 ++++++++++++++++-------
arch/x86/kvm/svm/svm.c | 2 ++
arch/x86/kvm/svm/svm.h | 2 ++
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index 3c9c20d7855fe..670a5d57f33da 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -1613,6 +1613,21 @@ static void nested_copy_vmcb_cache_to_control(struct vmcb_control_area *dst,
/* 'clean' and 'hv_enlightenments' are not changed by KVM */
}
+bool nested_svm_check_vmcb01_save(struct kvm_vcpu *vcpu,
+ struct vmcb_save_area *save)
+{
+ struct vmcb_save_area_cached save_cached;
+
+ if (!(save->cr0 & X86_CR0_PG) ||
+ !(save->cr0 & X86_CR0_PE) ||
+ (save->rflags & X86_EFLAGS_VM) ||
+ ((save->efer & EFER_LMA) && !(save->efer & EFER_LME)))
+ return false;
+
+ __nested_copy_vmcb_save_to_cache(&save_cached, save);
+ return __nested_vmcb_check_save(vcpu, &save_cached);
+}
+
static int svm_get_nested_state(struct kvm_vcpu *vcpu,
struct kvm_nested_state __user *user_kvm_nested_state,
u32 user_data_size)
@@ -1689,7 +1704,6 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
&user_kvm_nested_state->data.svm[0];
struct vmcb_control_area *ctl;
struct vmcb_save_area *save;
- struct vmcb_save_area_cached save_cached;
struct vmcb_ctrl_area_cached ctl_cached;
unsigned long cr0;
int ret;
@@ -1759,12 +1773,7 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
* Validate host state saved from before VMRUN (see
* nested_svm_check_permissions).
*/
- __nested_copy_vmcb_save_to_cache(&save_cached, save);
- if (!(save->cr0 & X86_CR0_PG) ||
- !(save->cr0 & X86_CR0_PE) ||
- (save->rflags & X86_EFLAGS_VM) ||
- ((save->efer & EFER_LMA) && !(save->efer & EFER_LME)) ||
- !__nested_vmcb_check_save(vcpu, &save_cached))
+ if (!nested_svm_check_vmcb01_save(vcpu, save))
goto out_free;
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index df325d0864819..2796368f231d3 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -4960,6 +4960,8 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const union kvm_smram *smram)
*/
svm_copy_vmrun_state(&svm->vmcb01.ptr->save, map_save.hva + 0x400);
+ if (!nested_svm_check_vmcb01_save(vcpu, &svm->vmcb01.ptr->save))
+ goto unmap_save;
/*
* Enter the nested guest now
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
index 511fadfb055f6..a3724e867a4c9 100644
--- a/arch/x86/kvm/svm/svm.h
+++ b/arch/x86/kvm/svm/svm.h
@@ -689,6 +689,8 @@ void nested_copy_vmcb_save_to_cache(struct vcpu_svm *svm,
struct vmcb_save_area *save);
void nested_sync_control_from_vmcb02(struct vcpu_svm *svm);
void nested_vmcb02_compute_g_pat(struct vcpu_svm *svm);
+bool nested_svm_check_vmcb01_save(struct kvm_vcpu *vcpu,
+ struct vmcb_save_area *save);
void svm_switch_vmcb(struct vcpu_svm *svm, struct kvm_vmcb_info *target_vmcb);
extern struct kvm_x86_nested_ops svm_nested_ops;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0002/1756] inet: frags: limit the truesize of a reassembly queue
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0001/1756] KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0003/1756] mm/hugetlb: fix endless write fault on a leftover uffd bit Greg Kroah-Hartman
` (996 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Florian Westphal,
Eric Dumazet, Ido Schimmel, Jiayuan Chen, Wang Zhan, Paolo Abeni,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 3ae20e4697eb969104fe4b1e98a675f0100382b6 ]
The truesize of fragments in a reassembly queue is only bounded by
the per netns ipfrag_high_thresh sysctl, which has no upper limit.
inet_frag_reasm_finish() sums the truesize of all fragments in an int.
If this sum reaches 2^32, it wraps, and the final sk_wmem_alloc
adjustment of the socket owning the reassembled skb can cancel its own
reference, leading to a use-after-free of this socket.
This can be triggered from an unprivileged user/network namespace,
raising ipfrag_high_thresh and using padded TUN packets, which keep
a large truesize after being trimmed by ip_rcv_core().
Track the sum of the truesize of fragments in each queue, and refuse
a fragment that would make it bigger than INT_MAX / 2. Callers kill
the queue on this error. This bound is far above the needs of
legitimate traffic.
Fixes: 18685451fc4e ("inet: inet_defrag: prevent sk release while still in use")
Cc: stable@vger.kernel.org
Reported-by: Kyle Zeng <kylebot@openai.com>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Tested-by: Wang Zhan <wang.zhan@smartx.com>
Link: https://patch.msgid.link/20261030081225.2575462-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: adjusted context for missing secpath validation and conditional nf_reset_ct() call ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/inet_frag.h | 9 +++++++++
net/ipv4/inet_fragment.c | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 365925c9d2628..6aea2d1ac376f 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -79,6 +79,7 @@ struct frag_v6_compare_key {
* @tstamp_type: stamp has a mono delivery time (EDT)
* @flags: fragment queue flags
* @max_size: maximum received fragment size
+ * @truesize: sum of the truesize of queued fragments
* @fqdir: pointer to struct fqdir
* @rcu: rcu head for freeing deferall
*/
@@ -100,6 +101,7 @@ struct inet_frag_queue {
u8 tstamp_type;
__u8 flags;
u16 max_size;
+ unsigned int truesize;
struct fqdir *fqdir;
struct rcu_head rcu;
};
@@ -171,6 +173,13 @@ extern const u8 ip_frag_ecn_table[16];
#define IPFRAG_OK 0
#define IPFRAG_DUP 1
#define IPFRAG_OVERLAP 2
+#define IPFRAG_TOOBIG 4
+
+/* Max sum of the truesize of fragments in a queue. This keeps the sums
+ * done in inet_frag_reasm_prepare() and inet_frag_reasm_finish() well
+ * below INT_MAX. Legitimate traffic stays far below this limit.
+ */
+#define INET_FRAG_MAX_TRUESIZE (INT_MAX / 2)
int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb,
int offset, int end);
void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb,
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index 33b490165f4bb..0224440720e12 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -337,6 +337,7 @@ void inet_frag_queue_flush(struct inet_frag_queue *q,
q->rb_fragments = RB_ROOT;
q->fragments_tail = NULL;
q->last_run_head = NULL;
+ q->truesize = 0;
}
EXPORT_SYMBOL(inet_frag_queue_flush);
@@ -441,6 +442,9 @@ int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb,
{
struct sk_buff *last = q->fragments_tail;
+ if (skb->truesize > INET_FRAG_MAX_TRUESIZE - q->truesize)
+ return IPFRAG_TOOBIG;
+
/* An IP fragment is never a GSO packet, but an untrusted source
* (virtio_net_hdr) may have attached GSO metadata to it. Do not let
* that reach the reassembled skb, whose head keeps the first
@@ -503,6 +507,7 @@ int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb,
FRAG_CB(skb)->ip_defrag_offset = offset;
+ q->truesize += skb->truesize;
return IPFRAG_OK;
}
EXPORT_SYMBOL(inet_frag_queue_insert);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0003/1756] mm/hugetlb: fix endless write fault on a leftover uffd bit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0001/1756] KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0002/1756] inet: frags: limit the truesize of a reassembly queue Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0004/1756] 9p/xen: drain response work after unbinding IRQ Greg Kroah-Hartman
` (995 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Mike Rapoport (Microsoft), Andrew Morton, Chris Mason,
Lorenzo Stoakes (ARM), Lance Yang, Liam R. Howlett,
Vlastimil Babka, Jann Horn, Pedro Falcato, Muchun Song,
Oscar Salvador, Miaohe Lin, Naoya Horiguchi, Adam Litke,
Mel Gorman, Rik van Riel, Peter Xu, Kiryl Shutsemau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit f61e1cf15fb44f9cf89d43d8ef01f926322bb1c4 ]
hugetlb_fault() resolves the uffd bit on a write fault only if the VMA is
registered for userfaultfd write protection, and hugetlb_wp() bails out
for any entry with the uffd bit set assuming hugetlb_fault() has already
resolved it.
When a read-only hugetlb entry with the uffd bit set is mapped in a VMA
that is not registered for uffd-wp, a write fault to it never makes
progress. If the access comes from the kernel, e.g. read(2) from
/dev/zero into such page, the task spins in the page fault handler,
ignores SIGKILL and keeps holding the locks taken by the system call.
Such entries should not exist, but an unprivileged user can create them,
for example with MADV_DONTNEED of a page protected with UFFDIO_RWPROTECT
or with UFFDIO_COPY in MODE_WP racing with UFFDIO_UNREGISTER.
Clear the uffd bit when the VMA is not registered for uffd-wp and let the
fault proceed to hugetlb_wp(), like do_wp_page() does for regular pages.
Note that a FOLL_FORCE write to a page protected with UFFDIO_RWPROTECT in
a private VMA that was made PROT_NONE now drops the RWP protection of
that page.
Original fix generated by an LLM and sent in private by Josef.
[rppt@kernel.org: massage commit message]
[david@kernel.org: convert comment into a TODO]
Link: https://lore.kernel.org/20261015-urgent_fixes-v1-6-42796911043b@kernel.org
Fixes: 60d5b473d61b ("mm/hugetlb: fix uffd wr-protection for CoW optimization path")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Chris Mason <mason@kernel.org>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Rik van Riel <riel@surriel.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: <stable@vger.kernel.org>
[ sashal: adapted to the existing huge_pte_uffd_wp() and huge_pte_clear_uffd_wp() helper names ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/hugetlb.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 1dd80a5b72b07..e6f913f227e6c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -6516,15 +6516,19 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
goto out_ptl;
/* Handle userfault-wp first, before trying to lock more pages */
- if (userfaultfd_wp(vma) && huge_pte_uffd_wp(huge_ptep_get(mm, vmf.address, vmf.pte)) &&
+ if (huge_pte_uffd_wp(huge_ptep_get(mm, vmf.address, vmf.pte)) &&
(flags & FAULT_FLAG_WRITE) && !huge_pte_write(vmf.orig_pte)) {
- if (!userfaultfd_wp_async(vma)) {
+ if (userfaultfd_wp(vma) && !userfaultfd_wp_async(vma)) {
spin_unlock(vmf.ptl);
hugetlb_vma_unlock_read(vma);
mutex_unlock(&hugetlb_fault_mutex_table[hash]);
return handle_userfault(&vmf, VM_UFFD_WP);
}
+ /*
+ * TODO: fix all cases where uffd PTE bits remain in VMAs that
+ * are no longer registered with uffd.
+ */
vmf.orig_pte = huge_pte_clear_uffd_wp(vmf.orig_pte);
set_huge_pte_at(mm, vmf.address, vmf.pte, vmf.orig_pte,
huge_page_size(hstate_vma(vma)));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0004/1756] 9p/xen: drain response work after unbinding IRQ
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0003/1756] mm/hugetlb: fix endless write fault on a leftover uffd bit Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0005/1756] ksmbd: revert fsids on durable reconnect and replay failure Greg Kroah-Hartman
` (994 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yizhou Zhao, Yuxiang Yang, Ao Wang,
Xuewei Feng, Qi Li, Ke Xu, Dominique Martinet, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
[ Upstream commit 7b6f2e3c29fb4d76f1e4973280792eabbd526602 ]
commit ea4f1009408e ("9p/xen : Fix use after free bug in
xen_9pfs_front_remove due to race condition") added cancel_work_sync()
to keep xen_9pfs_front_free() from freeing a ring while
p9_xen_response() is still running.
The work is currently drained before the event channel IRQ is unbound.
That leaves a race window where xen_9pfs_front_event_handler() can run
after cancel_work_sync() returns and queue p9_xen_response() again. The
following unbind_from_irqhandler() synchronizes with the IRQ handler, but
it does not cancel work that the handler already queued. The teardown
can then free the ring and private data while the response work remains
pending, and the worker later dereferences ring->priv and priv->client.
Unbind the event channel IRQ before draining the work. Once the IRQ is
unbound, no new response work can be queued by the backend event channel,
and cancel_work_sync() waits for any work that was queued before or
during the unbind. It is then safe to release the ring resources.
Fixes: ea4f1009408e ("9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition")
Cc: stable@vger.kernel.org
Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
Reported-by: Ao Wang <wangao@seu.edu.cn>
Reported-by: Xuewei Feng <fengxw06@126.com>
Reported-by: Qi Li <qli01@tsinghua.edu.cn>
Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
Assisted-by: GLM:GLM-5.1
Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Message-ID: <20260609155202.1706-1-zhaoyz24@mails.tsinghua.edu.cn>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/9p/trans_xen.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index 67f464acf6171..ef9bac5f4a24a 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -288,12 +288,12 @@ static void xen_9pfs_front_free(struct xen_9pfs_front_priv *priv)
for (i = 0; i < XEN_9PFS_NUM_RINGS; i++) {
struct xen_9pfs_dataring *ring = &priv->rings[i];
- cancel_work_sync(&ring->work);
-
if (!priv->rings[i].intf)
break;
if (priv->rings[i].irq > 0)
unbind_from_irqhandler(priv->rings[i].irq, ring);
+ cancel_work_sync(&ring->work);
+
if (priv->rings[i].data.in) {
for (j = 0;
j < (1 << priv->rings[i].intf->ring_order);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0005/1756] ksmbd: revert fsids on durable reconnect and replay failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0004/1756] 9p/xen: drain response work after unbinding IRQ Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0006/1756] mm/ksm: fix use of a freed anon_vma at swap-in Greg Kroah-Hartman
` (993 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
[ Upstream commit 539223f18026448f67d33d09719c355b91db7fd0 ]
On a durable handle reconnect or a request replay, smb2_open() switches
to the SMB user's fsids before calling ksmbd_vfs_getattr(). If that call
fails, the code jumps to err_out2 and skips ksmbd_revert_fsids() at
err_out1. The user's credentials then stay installed on the shared ksmbd
worker. Later work on that worker, including other users' requests, runs
with the first user's fsuid, fsgid and supplementary groups.
ksmbd_free_work_struct() also warns, because work->saved_cred is still
set.
Jump to err_out1 instead. No path is held at this point, so skipping the
path_put() at err_out is correct.
Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Fixes: bb8bf7eb13b5 ("ksmbd: add SMB3 request replay support")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: omitted the durable reconnect error-path hunk in smb2_open() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index f7e3d7986c4ca..1af013ae66f94 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -3129,7 +3129,7 @@ int smb2_open(struct ksmbd_work *work)
rc = ksmbd_vfs_getattr(&fp->filp->f_path, &stat);
if (rc)
- goto err_out2;
+ goto err_out1;
goto reconnected_fp;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0006/1756] mm/ksm: fix use of a freed anon_vma at swap-in
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0005/1756] ksmbd: revert fsids on durable reconnect and replay failure Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0007/1756] ksmbd: enforce the read-only share flag when creating a stream Greg Kroah-Hartman
` (992 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Lorenzo Stoakes (ARM),
Xu Xin, Muhammad Usama Anjum, David Hildenbrand (Arm),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 4c2dec1dce368ad9e9b1814307cb5ef3832fa07e ]
A folio read from a swap slot previously shared by KSM can remain in the
swap cache after the process that first mapped it exits. Its anon_vma
can then be freed, so ksm_might_need_to_copy() must not dereference it
to compare roots.
Doing so can result in some false-positives, resulting in the reverse
mapping missing the new folio mapping, preventing migration and reclaim.
SLAB_TYPESAFE_BY_RCU allows individual anon_vma objects to be reused
immediately after freeing. A stale pointer can then refer to another
anon_vma whose root matches, even though the target VMA is not linked
to that anon_vma.
Move the anonymous rmap compatibility checks into
folio_anon_rmap_compatible(). Keep the page-index check and compare the
folio's anon_vma pointer against the VMA's own anon_vma and root first.
If neither matches, bite the bullet and walk the VMA's anon_vma_chain.
The VMA keeps these anon_vmas alive, and finding a match guarantees that
reverse mapping can find the new mapping.
Lorenzo Stoakes says in a private discussion:
"This isn't quite equivalent to the existing check.
Every anon_vma in an anon_vma_chain shares the same root, but if you
split a VMA then fork both of them like this:
VMA A
/ \ <split>
VMA B VMA C
\ /
root <- anon_vma 1
----^ ^---- <fork>
/ parent \
anon_vma 2 anon_vma 3
| |
VMA D VMA E
VMA's D and E both get their own new
anon_vma's such that:
VMA D: anon_vma 2 -> anon_vma 1 -> root
VMA E: anon_vma 3 -> anon_vma 1 -> root
And if you found a folio referencing anon_vma 2, the existing check:
anon_vma->root == vma->anon-vma->root
Would be true for VMA's B, C, D & E.
However after your change it'd be true for VMA D only, as it's the only
one with anon_vma 2 in its anon_vma_chain.
Whether or not that could actually happen in practice... 🙂 I don't
know.
[...] after your change it'd be true for VMA D only, as it's the only
one with anon_vma 2 in its anon_vma_chain. [...] I would [...] say that
you are making the test stricter but more correct.
"
If this affects performance when KSM was never even involved, we could
just track whether KSM ever merged anything and just skip these checks.
There isn't really a lot we can do otherwise: for mapped folios we might
be able to use folio_get_anon_vma(), but for unmapped folios there really
is no easy way to see if the anon_vma is still valid.
Document the (confusing) lifetime requirements of folio_anon_vma().
Fixes: ba6f0ff3981e ("ksm: fix ksm swapin time optimization")
Cc: stable@vger.kernel.org
Reported-by: Chris Mason <mason@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Xu Xin <xu.xin@linux.dev>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-40-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted the helper to use linear_page_index() and a non-const folio parameter without the unavailable vma_assert_stabilised() check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/ksm.c | 35 ++++++++++++++++++++++++++++++-----
mm/util.c | 13 +++++++++++++
2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/mm/ksm.c b/mm/ksm.c
index 8ce4cd5a382ce..e64a0dbcad5dd 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -3059,11 +3059,39 @@ void __ksm_exit(struct mm_struct *mm)
trace_ksm_exit(mm);
}
+static bool folio_anon_rmap_compatible(struct folio *folio,
+ struct vm_area_struct *vma, unsigned long addr)
+{
+ const struct anon_vma *anon_vma = folio_anon_vma(folio);
+ struct anon_vma_chain *avc;
+
+ VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
+ VM_WARN_ON_ONCE_FOLIO(folio_test_large(folio), folio);
+ VM_WARN_ON_ONCE_FOLIO(folio_test_ksm(folio), folio);
+
+ if (!anon_vma)
+ return true;
+ if (folio->index != linear_page_index(vma, addr))
+ return false;
+
+ /*
+ * Careful: anon_vma might have been freed, so we cannot safely
+ * dereference it. Add a fast path before we walk the anon_vma chain.
+ */
+ if (anon_vma == vma->anon_vma || anon_vma == vma->anon_vma->root)
+ return true;
+
+ list_for_each_entry(avc, &vma->anon_vma_chain, same_vma) {
+ if (avc->anon_vma == anon_vma)
+ return true;
+ }
+ return false;
+}
+
struct folio *ksm_might_need_to_copy(struct folio *folio,
struct vm_area_struct *vma, unsigned long addr)
{
struct page *page = folio_page(folio, 0);
- struct anon_vma *anon_vma = folio_anon_vma(folio);
struct folio *new_folio;
if (folio_test_large(folio))
@@ -3073,10 +3101,7 @@ struct folio *ksm_might_need_to_copy(struct folio *folio,
if (folio_stable_node(folio) &&
!(ksm_run & KSM_RUN_UNMERGE))
return folio; /* no need to copy it */
- } else if (!anon_vma) {
- return folio; /* no need to copy it */
- } else if (folio->index == linear_page_index(vma, addr) &&
- anon_vma->root == vma->anon_vma->root) {
+ } else if (folio_anon_rmap_compatible(folio, vma, addr)) {
return folio; /* still no need to copy it */
}
if (PageHWPoison(page))
diff --git a/mm/util.c b/mm/util.c
index 4f1275023eb73..8c6d8d4d62c4f 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -820,6 +820,19 @@ void *vcalloc_noprof(size_t n, size_t size)
}
EXPORT_SYMBOL(vcalloc_noprof);
+/**
+ * folio_anon_vma - Get a folio's raw anon_vma pointer.
+ * @folio: The folio.
+ *
+ * The returned pointer may be stale for an unmapped folio. The caller
+ * must ensure the anon_vma stays alive before dereferencing it. A folio
+ * reference or lock alone is insufficient; use folio_get_anon_vma() when
+ * the anon_vma's lifetime is not otherwise protected. Note that
+ * folio_get_anon_vma() is only useful for folios that are still mapped.
+ *
+ * Return: The raw anon_vma pointer for an anonymous, non-KSM folio, or
+ * %NULL otherwise.
+ */
struct anon_vma *folio_anon_vma(struct folio *folio)
{
unsigned long mapping = (unsigned long)folio->mapping;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0007/1756] ksmbd: enforce the read-only share flag when creating a stream
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0006/1756] mm/ksm: fix use of a freed anon_vma at swap-in Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0008/1756] selftests/mm: include kselftest.h in vm_util.h Greg Kroah-Hartman
` (991 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
[ Upstream commit 09139429fab3a5114c18d7c15fb161511d4d66c9 ]
When a share is read-only, smb2_open() rejects opens that would create
or truncate a file. Creating a named stream on an existing file with
streams_xattr sets neither O_CREAT nor O_TRUNC, so it passes this check,
and smb2_set_stream_name_xattr() then creates the stream. On a Time
Machine share, opening a missing AFP_AfpInfo stream also writes one. A
user who can write a file at the filesystem level can therefore add
streams to it through a read-only share.
Do not create a stream or synthesize AFP_AfpInfo when the share is not
writable. Existing streams still open normally, and a missing stream
opened with FILE_OPEN still returns STATUS_OBJECT_NAME_NOT_FOUND.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Fixes: eaff8e924f60 ("ksmbd: synthesize empty AFP_AfpInfo xattr on first probe")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: omitted the writable-tree check in the AFP_AfpInfo stream synthesis branch ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 1af013ae66f94..2577fbce80c4f 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2574,6 +2574,9 @@ static noinline int smb2_set_stream_name_xattr(const struct path *path,
return -EBADF;
}
+ if (!test_tree_conn_flag(fp->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE))
+ return -EACCES;
+
rc = ksmbd_vfs_setxattr(idmap, path, xattr_stream_name, NULL, 0, 0, false);
if (rc < 0)
pr_err("Failed to store XATTR stream name :%d\n", rc);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0008/1756] selftests/mm: include kselftest.h in vm_util.h
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0007/1756] ksmbd: enforce the read-only share flag when creating a stream Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0009/1756] PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing Greg Kroah-Hartman
` (990 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Vernon Yang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vernon Yang <yanglincheng@kylinos.cn>
commit d8a866c766ebe34b4371d42f4a3edca200f5e645 upstream.
The 6.12.y backport of commit fdc3bc349794 ("ksm_tests: skip hugepage
test when Transparent Hugepages are disabled"), added a KSFT_SKIP return
to khugepaged.c, but the prerequisite include from upstream commit
d8a866c766eb ("selftests/mm: add commentary about 9pfs bugs") was not
backported.
As a result, the selftests/mm build fails:
khugepaged.c:1195:24: error: ‘KSFT_SKIP’ undeclared (first use in this function)
Add the missing include, only the vm_util.h hunk of commit d8a866c766eb
("selftests/mm: add commentary about 9pfs bugs") is needed here.
The remaining hunks depend on commit 32b42970e861 ("selftests/mm: skip
gup_longterm tests on weird filesystems") and commit 571a4b62ed63
("selftests/mm: skip map_populate on weird filesystems"), which are not
present in this tree, so we don't need to backport the remaining hunks.
Fixes: 6cd1e92981f8 ("ksm_tests: skip hugepage test when Transparent Hugepages are disabled")
Signed-off-by: Vernon Yang <yanglincheng@kylinos.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/mm/vm_util.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h
index 823d07d84ad01..b3d1d17a09e4b 100644
--- a/tools/testing/selftests/mm/vm_util.h
+++ b/tools/testing/selftests/mm/vm_util.h
@@ -5,6 +5,7 @@
#include <err.h>
#include <strings.h> /* ffsl() */
#include <unistd.h> /* _SC_PAGESIZE */
+#include "../kselftest.h"
#define BIT_ULL(nr) (1ULL << (nr))
#define PM_SOFT_DIRTY BIT_ULL(55)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0009/1756] PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0008/1756] selftests/mm: include kselftest.h in vm_util.h Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0010/1756] fbcon: Rebuild rotated font buffer on font change Greg Kroah-Hartman
` (989 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Priyank Rathod, Bjorn Helgaas,
Kuppuswamy Sathyanarayanan, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Priyank Rathod <rathodpriyank@google.com>
[ Upstream commit d4c842c3af5bc52b3ca0b8a7f116114e43b6ba44 ]
When ACPI APEI/GHES processes PCIe AER error records, it allocates memory
for aer_capability_regs (entry.regs) from ghes_estatus_pool and queues the
entry into aer_recover_ring.
In aer_recover_work_func(), items are popped from aer_recover_ring via
kfifo_get(). If pci_get_domain_bus_and_slot() fails to find a matching
pci_dev, the code previously executed 'continue', bypassing the call to
ghes_estatus_pool_region_free(). As a result, the memory allocated for
entry.regs from ghes_estatus_pool was leaked.
This is reachable whenever the device reported by firmware is not (or is no
longer) present in the PCI device tree, e.g. after hot-removal or when
firmware reports an error for a device the kernel never enumerated.
Refactor aer_recover_work_func() to ensure ghes_estatus_pool_region_free()
is called unconditionally for every dequeued entry, releasing the pool
memory even when pci_dev is missing.
Fixes: e2abc47a5a1a ("ACPI: APEI: Fix AER info corruption when error status data has multiple sections")
Signed-off-by: Priyank Rathod <rathodpriyank@google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260928-b4-fix-aer-memleaks-v5-2-ba6b94c9c9a6@google.com
[ sashal: Adjusted patch context to preserve existing pr_err() logging instead of upstream pr_err_ratelimited(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pcie/aer.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 229853e9d565e..44fac6c2f437e 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1150,13 +1150,12 @@ static void aer_recover_work_func(struct work_struct *work)
while (kfifo_get(&aer_recover_ring, &entry)) {
pdev = pci_get_domain_bus_and_slot(entry.domain, entry.bus,
entry.devfn);
- if (!pdev) {
+ if (!pdev)
pr_err("no pci_dev for %04x:%02x:%02x.%x\n",
entry.domain, entry.bus,
PCI_SLOT(entry.devfn), PCI_FUNC(entry.devfn));
- continue;
- }
- pci_print_aer(pdev, entry.severity, entry.regs);
+ else
+ pci_print_aer(pdev, entry.severity, entry.regs);
/*
* Memory for aer_capability_regs(entry.regs) is being allocated from the
* ghes_estatus_pool to protect it from overwriting when multiple sections
@@ -1166,13 +1165,15 @@ static void aer_recover_work_func(struct work_struct *work)
ghes_estatus_pool_region_free((unsigned long)entry.regs,
sizeof(struct aer_capability_regs));
- if (entry.severity == AER_NONFATAL)
- pcie_do_recovery(pdev, pci_channel_io_normal,
- aer_root_reset);
- else if (entry.severity == AER_FATAL)
- pcie_do_recovery(pdev, pci_channel_io_frozen,
- aer_root_reset);
- pci_dev_put(pdev);
+ if (pdev) {
+ if (entry.severity == AER_NONFATAL)
+ pcie_do_recovery(pdev, pci_channel_io_normal,
+ aer_root_reset);
+ else if (entry.severity == AER_FATAL)
+ pcie_do_recovery(pdev, pci_channel_io_frozen,
+ aer_root_reset);
+ pci_dev_put(pdev);
+ }
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0010/1756] fbcon: Rebuild rotated font buffer on font change
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0009/1756] PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0011/1756] mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus Greg Kroah-Hartman
` (988 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yao Yiqi, Thomas Zimmermann,
Helge Deller, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yao Yiqi <yaoyiqi3@huawei.com>
[ Upstream commit e4b6b865d45d8dafb6c6f28c8a993a5b4431d25a ]
fbcon_rotate_font() caches a rotated copy of the console font in
par->rotated.buf. The buffer is sized from the font's width, height
and charcount, and is rebuilt in fbcon_init(), fbcon_switch() and
fbcon_modechanged(), but not in fbcon_do_set_font().
When the font is changed through KDFONTOP, the new geometry is
installed and vc_resize() redraws before the buffer is rebuilt. The
rotated putcs/cursor ops then index the old buffer with the new cell
size; KASAN reports a slab-out-of-bounds read in soft_cursor().
Rebuild the buffer for the visible console before the redraw, as the
other callers do: select the console's blitting state with
set_blitting_type() (which also uploads the new font's map on
tile-blitting hardware), then rebuild. Background consoles keep
their rebuild at fbcon_switch() time, as the buffer is shared per
framebuffer and must not be updated for a console that is not being
displayed.
To ensure a correct rollback when the rebuild or the following
vc_resize() fails, save the rotated font state, clear it before
rebuilding, and restore it in the error path of
fbcon_do_set_font().
Fixes: 6cc50e1c5b57 ("[PATCH] fbcon: Console Rotation - Add support to rotate font bitmap")
Cc: stable@vger.kernel.org
Signed-off-by: Yao Yiqi <yaoyiqi3@huawei.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
[ sashal: adapted rotated font handling to the older fbcon_par layout with individual cache fields and a direct rotate_font callback ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/core/fbcon.c | 57 ++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index e582314f1ccc3..eabe5cc227457 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -2427,6 +2427,12 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
int resize, ret, old_userfont, old_width, old_height, old_charcount;
u8 *old_data = vc->vc_font.data;
unsigned short old_hi_font_mask = vc->vc_hi_font_mask;
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
+ u8 *saved_fontdata = NULL, *saved_fontbuffer = NULL;
+ u32 saved_fd_size = 0;
+ int saved_cur_rotate = 0;
+ bool rotated_saved = false;
+#endif
resize = (w != vc->vc_font.width) || (h != vc->vc_font.height);
vc->vc_font.data = (void *)(p->fontdata = data);
@@ -2446,6 +2452,33 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
else if (!vc->vc_hi_font_mask && charcount == 512)
set_vc_hi_font(vc, true);
+ /*
+ * Select the console's blitting state and update the rotated font buffer
+ * to match the new font, so that the rendering below does not use a
+ * cache that was built for the old font. Clear the cached state so
+ * the rebuild allocates a fresh buffer; the old state is kept until
+ * the font change can no longer fail.
+ */
+ if (con_is_visible(vc)) {
+ set_blitting_type(vc, info);
+ if (par->rotate_font) {
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
+ saved_fontdata = par->fontdata;
+ saved_fontbuffer = par->fontbuffer;
+ saved_fd_size = par->fd_size;
+ saved_cur_rotate = par->cur_rotate;
+ par->fontdata = NULL;
+ par->fontbuffer = NULL;
+ par->fd_size = 0;
+ par->cur_rotate = 0;
+ rotated_saved = true;
+#endif
+ ret = par->rotate_font(info, vc);
+ if (ret)
+ goto err_out;
+ }
+ }
+
if (resize) {
int cols, rows;
@@ -2462,11 +2495,28 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
update_screen(vc);
}
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
+ if (rotated_saved)
+ kfree(saved_fontbuffer);
+#endif
if (old_userfont && (--REFCOUNT(old_data) == 0))
kfree(old_data - FONT_EXTRA_WORDS * sizeof(int));
return 0;
err_out:
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
+ /*
+ * Drop the buffer built for the new font and restore the saved
+ * state.
+ */
+ if (rotated_saved) {
+ kfree(par->fontbuffer);
+ par->fontdata = saved_fontdata;
+ par->fontbuffer = saved_fontbuffer;
+ par->fd_size = saved_fd_size;
+ par->cur_rotate = saved_cur_rotate;
+ }
+#endif
p->fontdata = old_data;
vc->vc_font.data = old_data;
@@ -2486,6 +2536,13 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount,
else if (!old_hi_font_mask && vc->vc_hi_font_mask)
set_vc_hi_font(vc, false);
+ /*
+ * Re-select the blitting type, which re-uploads the font map on
+ * tile-blitting hardware.
+ */
+ if (con_is_visible(vc))
+ set_blitting_type(vc, info);
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0011/1756] mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0010/1756] fbcon: Rebuild rotated font buffer on font change Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0012/1756] drm/amdkfd: Validate the control stack of a restored queue Greg Kroah-Hartman
` (987 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Hocko, Shakeel Butt,
Rik van Riel, Andrew Morton, Johannes Weiner, Muchun Song,
Roman Gushchin, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <riel@surriel.com>
[ Upstream commit d2f28a1a652e0a43f6f63de9b4e4d8d5f2716803 ]
When drain_all_stock() sets FLUSHING_CACHED_CHARGE before checking
isolation, schedule_drain_work() can drop the work in a separate RCU
critical section, and housekeeping_update()'s synchronize_rcu() can race
that second check, leaving the flag set.
drain_local_stock() only clears the bit for work that ran, so the flag
remains set and the stock is never drained again.
Have schedule_drain_work() return whether the work was queued, and clear
FLUSHING_CACHED_CHARGE in drain_all_stock() when the remote CPU is
isolated, so future drains can retry.
Link: https://lore.kernel.org/20260828135036.7d44361f@fangorn
Fixes: 6a792697a53a ("memcg: do not drain charge pcp caches on remote isolated cpus")
Suggested-by: Michal Hocko <mhocko@suse.com>
Suggested-by: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: <stable@vger.kernel.org>
[ sashal: Adapted schedule_drain_work() result handling to an inline branch in drain_all_stock() for the combined charge cache. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memcontrol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2aae088c86082..de7bd67619533 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1871,6 +1871,8 @@ void drain_all_stock(struct mem_cgroup *root_memcg)
drain_local_stock(&stock->work);
else if (!cpu_is_isolated(cpu))
schedule_work_on(cpu, &stock->work);
+ else
+ clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags);
}
}
migrate_enable();
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0012/1756] drm/amdkfd: Validate the control stack of a restored queue
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0011/1756] mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0013/1756] btrfs: prevent deleting the wrong subvolume by ID Greg Kroah-Hartman
` (986 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, William Palacek, Alex Deucher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: William Palacek <William.Palacek@amd.com>
[ Upstream commit 90d91a192751cd9a7d9d2286299bc72ec1c28179 ]
kfd_criu_restore_queue() takes the control stack size from the
checkpoint image without the topology check create-queue does in
kfd_queue_acquire_buffers(), which restore stopped calling in
commit 1cafa8b29e02 ("drm/amdkfd: Don't acquire buffers
during CRIU queue restore."). An image size of 0x300000 is accepted and
sizes the MQD allocation, and 0xFFFFFFFF trips a page allocator warning
in kmalloc().
restore_mqd() also keeps the image's cp_hqd_cntl_stack_size,
cp_hqd_cntl_stack_offset and cp_hqd_wg_state_offset. With offset > size
or wave state offset < size, get_wave_state() returns wrapped sizes.
Take the per-XCC size from topology, 0 for queues without a control
stack, and reject larger images. In restore_mqd(), set the size to it
and bound both offsets as init_mqd() does.
Fixes: 626f7b3190b4 ("drm/amdkfd: CRIU add queues support")
Fixes: 42c6c48214b7 ("drm/amdkfd: CRIU checkpoint and restore queue mqds")
Signed-off-by: William Palacek <William.Palacek@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 92249023caee17bfc6f29c71d6aaa5f2298cf507)
Cc: stable@vger.kernel.org
[ sashal: Removed the NUM_XCC() multiplier because the existing restore path handles one control stack per image. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 3 +++
.../gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 3 +++
.../gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 3 +++
.../gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c | 3 +++
.../amd/amdkfd/kfd_process_queue_manager.c | 24 +++++++++++++++----
5 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
index 4a621791da230..99fdbf666c87d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
@@ -293,6 +293,9 @@ static void restore_mqd(struct mqd_manager *mm, void **mqd,
addr = mqd_mem_obj->gpu_addr;
memcpy(m, mqd_src, sizeof(*m));
+ m->cp_hqd_cntl_stack_size = qp->ctl_stack_size;
+ m->cp_hqd_cntl_stack_offset = min(m->cp_hqd_cntl_stack_offset, qp->ctl_stack_size);
+ m->cp_hqd_wg_state_offset = max(m->cp_hqd_wg_state_offset, qp->ctl_stack_size);
*mqd = m;
if (gart_addr)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c
index ca90454b01acc..2f4caf637a065 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c
@@ -344,6 +344,9 @@ static void restore_mqd(struct mqd_manager *mm, void **mqd,
addr = mqd_mem_obj->gpu_addr;
memcpy(m, mqd_src, sizeof(*m));
+ m->cp_hqd_cntl_stack_size = qp->ctl_stack_size;
+ m->cp_hqd_cntl_stack_offset = min(m->cp_hqd_cntl_stack_offset, qp->ctl_stack_size);
+ m->cp_hqd_wg_state_offset = max(m->cp_hqd_wg_state_offset, qp->ctl_stack_size);
*mqd = m;
if (gart_addr)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
index 1e220e8810922..0d22a377f3e33 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
@@ -416,6 +416,9 @@ static void restore_mqd(struct mqd_manager *mm, void **mqd,
addr = mqd_mem_obj->gpu_addr;
memcpy(m, mqd_src, sizeof(*m));
+ m->cp_hqd_cntl_stack_size = qp->ctl_stack_size;
+ m->cp_hqd_cntl_stack_offset = min(m->cp_hqd_cntl_stack_offset, qp->ctl_stack_size);
+ m->cp_hqd_wg_state_offset = max(m->cp_hqd_wg_state_offset, qp->ctl_stack_size);
*mqd = m;
if (gart_addr)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
index f0de0893bc597..ae3bd2bb410a5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
@@ -305,6 +305,9 @@ static void restore_mqd(struct mqd_manager *mm, void **mqd,
addr = mqd_mem_obj->gpu_addr;
memcpy(m, mqd_src, sizeof(*m));
+ m->cp_hqd_cntl_stack_size = qp->ctl_stack_size;
+ m->cp_hqd_cntl_stack_offset = min(m->cp_hqd_cntl_stack_offset, qp->ctl_stack_size);
+ m->cp_hqd_wg_state_offset = max(m->cp_hqd_wg_state_offset, qp->ctl_stack_size);
*mqd = m;
if (gart_addr)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index bf3c7d055fc33..445fba8e4bbdd 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -26,6 +26,7 @@
#include <linux/list.h>
#include "kfd_device_queue_manager.h"
#include "kfd_priv.h"
+#include "kfd_topology.h"
#include "kfd_kernel_queue.h"
#include "amdgpu_amdkfd.h"
#include "amdgpu_reset.h"
@@ -984,7 +985,6 @@ static void set_queue_properties_from_criu(struct queue_properties *qp,
qp->eop_ring_buffer_size = q_data->eop_ring_buffer_size;
qp->ctx_save_restore_area_address = q_data->ctx_save_restore_area_address;
qp->ctx_save_restore_area_size = q_data->ctx_save_restore_area_size;
- qp->ctl_stack_size = q_data->ctl_stack_size;
qp->type = q_data->type;
qp->format = q_data->format;
}
@@ -996,6 +996,7 @@ int kfd_criu_restore_queue(struct kfd_process *p,
{
uint8_t *mqd, *ctl_stack, *q_extra_data = NULL;
struct kfd_criu_queue_priv_data *q_data;
+ struct kfd_topology_device *topo_dev;
struct kfd_process_device *pdd;
uint64_t q_extra_data_size;
struct queue_properties qp;
@@ -1032,6 +1033,24 @@ int kfd_criu_restore_queue(struct kfd_process *p,
goto exit;
}
+ memset(&qp, 0, sizeof(qp));
+ set_queue_properties_from_criu(&qp, q_data);
+
+ /* Per-XCC control stack size from topology, as create-queue requires */
+ if (qp.type == KFD_QUEUE_TYPE_COMPUTE && pdd->dev->kfd->cwsr_enabled) {
+ topo_dev = kfd_topology_device_by_id(pdd->dev->id);
+ if (!topo_dev) {
+ ret = -EINVAL;
+ goto exit;
+ }
+ qp.ctl_stack_size = topo_dev->node_props.ctl_stack_size;
+ }
+
+ if (q_data->ctl_stack_size > qp.ctl_stack_size) {
+ ret = -EINVAL;
+ goto exit;
+ }
+
*priv_data_offset += sizeof(*q_data);
q_extra_data_size = (uint64_t)q_data->ctl_stack_size + q_data->mqd_size;
@@ -1058,9 +1077,6 @@ int kfd_criu_restore_queue(struct kfd_process *p,
mqd = q_extra_data;
ctl_stack = mqd + q_data->mqd_size;
- memset(&qp, 0, sizeof(qp));
- set_queue_properties_from_criu(&qp, q_data);
-
ret = kfd_queue_acquire_buffers(pdd, &qp);
if (ret) {
pr_debug("failed to acquire user queue buffers for CRIU\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0013/1756] btrfs: prevent deleting the wrong subvolume by ID
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0012/1756] drm/amdkfd: Validate the control stack of a restored queue Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0014/1756] ocfs2/cluster: hold a reference on the heartbeat thread Greg Kroah-Hartman
` (985 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, guolingxing, David Sterba,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: guolingxing <guolingxing@tju.edu.cn>
[ Upstream commit 1960146913b31b288ed2cd607d103ee3b41681d4 ]
When deleting a subvolume by ID, btrfs_ioctl_snap_destroy() first
resolves the requested ID to a name, then looks up that name again
under the parent directory lock.
A concurrent rename can change which subvolume is associated with
the name between these operations. Since the deletion path does not
verify the ID of the resolved subvolume, it can delete a different
subvolume while leaving the requested one intact.
This was reproduced by repeatedly exchanging the names of two
subvolumes using renameat2(RENAME_EXCHANGE) while deleting one of
them by ID. The wrong subvolume was deleted in 9 out of 14 independent
tests.
Fix this by checking that the resolved subvolume ID matches the
requested ID while holding the parent directory lock. Return -EAGAIN
on a mismatch so that userspace can retry the operation instead of
being told that the requested subvolume does not exist.
Fixes: 949964c92843 ("btrfs: add new BTRFS_IOC_SNAP_DESTROY_V2 ioctl")
CC: stable@vger.kernel.org
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: guolingxing <guolingxing@tju.edu.cn>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: Changed goto out_end_removing to goto out_dput to use the existing cleanup path. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/ioctl.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 3c3c767c858f6..aa49622cd302a 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2536,6 +2536,17 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
inode = d_inode(dentry);
dest = BTRFS_I(inode)->root;
+
+ /*
+ * A concurrent rename may have changed which subvolume the name
+ * refers to. Verify that the resolved ID still matches the requested ID.
+ */
+ if (destroy_v2 && (vol_args2->flags & BTRFS_SUBVOL_SPEC_BY_ID) &&
+ btrfs_root_id(dest) != vol_args2->subvolid) {
+ ret = -EAGAIN;
+ goto out_dput;
+ }
+
if (!capable(CAP_SYS_ADMIN)) {
/*
* Regular user. Only allow this with a special mount
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0014/1756] ocfs2/cluster: hold a reference on the heartbeat thread
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0013/1756] btrfs: prevent deleting the wrong subvolume by ID Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0015/1756] ocfs2/heartbeat: serialize concurrent writes to a regions dev attribute Greg Kroah-Hartman
` (984 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Andrew Morton,
Sashiko, Joseph Qi, Mark Fasheh, Joel Becker, Cen Zhang,
Junxiao Bi, Heming Zhao, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit aa2e38aabaae87236290e486a2b77cfa3adfbebe ]
Since commit 688bc88e2046 ("ocfs2/cluster: keep heartbeat local node
stable"), o2hb_thread() leaves its loop and returns when the local node
changes, for example after "echo 0 > node/<name>/local". The thread was
started with kthread_run() and nothing holds a reference to its
task_struct, so the task is freed once it exits, while reg->hr_task still
points to it.
Reading the region's pid attribute then reads the freed task, and removing
the region calls kthread_stop() on it:
BUG: KASAN: slab-use-after-free in o2hb_region_pid_show+0xb3/0xc0
refcount_t: addition on 0; use-after-free.
Oops: Oops: 0000 [#1] SMP KASAN NOPTI
RIP: 0010:kthread_stop+0xb1/0x390
The thread could already return by itself before, when heartbeat start was
aborted or on an unclean stop, but the local node change makes it
reachable from userspace at any time.
Create the thread, take a reference on it and only then wake it, so the
reference cannot race with the thread exiting. Drop it with
kthread_stop_put().
Link: https://lore.kernel.org/20260923010149.14391-1-kmehltretter@gmail.com
Fixes: 688bc88e2046 ("ocfs2/cluster: keep heartbeat local node stable")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260616074931.3774929-1-zzzccc427%40gmail.com
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Assisted-by: LLM
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Cen Zhang <zzzccc427@gmail.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Stable-dep-of: 0a8f258c0f01 ("ocfs2/heartbeat: serialize concurrent writes to a region's dev attribute")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/cluster/heartbeat.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 94743cef12f13..c7fd2e5c2c0bf 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1956,18 +1956,22 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
atomic_set(®->hr_unsteady_iterations, (live_threshold * 3));
o2hb_set_region_stopping(reg, false);
- hb_task = kthread_run(o2hb_thread, reg, "o2hb-%s",
- reg->hr_item.ci_name);
+ hb_task = kthread_create(o2hb_thread, reg, "o2hb-%s",
+ reg->hr_item.ci_name);
if (IS_ERR(hb_task)) {
ret = PTR_ERR(hb_task);
mlog_errno(ret);
goto out;
}
+ /* The thread may exit on its own, so pin it before it can run. */
+ get_task_struct(hb_task);
spin_lock(&o2hb_live_lock);
reg->hr_task = hb_task;
spin_unlock(&o2hb_live_lock);
+ wake_up_process(hb_task);
+
ret = wait_event_interruptible(o2hb_steady_queue,
atomic_read(®->hr_steady_iterations) == 0 ||
reg->hr_node_deleted);
@@ -2012,7 +2016,7 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
spin_unlock(&o2hb_live_lock);
if (hb_task)
- kthread_stop(hb_task);
+ kthread_stop_put(hb_task);
o2hb_unmap_slot_data(reg);
@@ -2208,7 +2212,7 @@ static void o2hb_heartbeat_group_drop_item(struct config_group *group,
spin_unlock(&o2hb_live_lock);
if (hb_task)
- kthread_stop(hb_task);
+ kthread_stop_put(hb_task);
if (o2hb_global_heartbeat_active()) {
spin_lock(&o2hb_live_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0015/1756] ocfs2/heartbeat: serialize concurrent writes to a regions dev attribute
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0014/1756] ocfs2/cluster: hold a reference on the heartbeat thread Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0016/1756] ACPI: utils: Add exclusive AML evaluation helpers Greg Kroah-Hartman
` (983 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eklavya Singh, Andrew Morton,
syzbot+5d4e96acd0febccb5e87, Joseph Qi, Mark Fasheh, Joel Becker,
Heming Zhao, Deepanshu Kartikey, Cen Zhang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eklavya Singh <eklavyasingh2106@gmail.com>
[ Upstream commit 0a8f258c0f012314c36b9e4818cdc0178c68f891 ]
o2hb_region_dev_store() checks reg->hr_bdev_file to see if the region
is already started, but nothing stops two writers from doing that at
the same time. configfs only serializes writes through the same open
file, so two processes that each open the dev attribute can both get
past the check:
A: hr_bdev_file is NULL, opens file A, sets hr_bdev_file = A
B: hr_bdev_file is NULL, opens file B, sets hr_bdev_file = B
A: start fails, fput(hr_bdev_file) drops B, sets it to NULL
B: start fails, fput(NULL)
Both calls also use the same hr_slots, hr_slot_data and hr_tmp_block,
so the error paths can free the slot data twice.
syzbot hit the fput(NULL) with an unbound loop device, where every
start fails with -EIO. With four threads doing the same thing on a
KASAN kernel I get both crashes within a second:
BUG: KASAN: double-free in o2hb_unmap_slot_data+0x14d/0x2f0
BUG: kernel NULL pointer dereference, address: 0000000000000158
Add a mutex to the region and hold it in dev_store(), in the
block_bytes, start_block and blocks stores, and in dev_show(), since
they all look at hr_bdev_file. dev_store() cleans up with goto, so it
takes the mutex in a small wrapper rather than with guard(). The mutex
is dropped while dev_store() waits for the heartbeat to become steady,
which takes seconds, so a read of dev doesn't stall behind a start.
hr_bdev_file is already set at that point, so other writers still get
-EINVAL, and the cleanup after the wait retakes the mutex.
With the patch the same test ran for 10 minutes with lockdep on and
nothing was reported. So did a second one, with a working loop device,
that interrupts starts during the wait while other threads read and
write the attributes.
Link: https://lore.kernel.org/20261020212339.46591-1-eklavyasingh2106@gmail.com
Fixes: a7f6a5fb4bde ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem")
Signed-off-by: Eklavya Singh <eklavyasingh2106@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: <syzbot+5d4e96acd0febccb5e87@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=5d4e96acd0febccb5e87
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: Deepanshu Kartikey <kartikey406@gmail.com>
Cc: Cen Zhang <zzzccc427@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/cluster/heartbeat.c | 40 ++++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 6 deletions(-)
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index c7fd2e5c2c0bf..85377208aa1ad 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -268,6 +268,8 @@ struct o2hb_region {
struct list_head hr_handler_list;
/* Serializes timeout arming against failed-start and teardown. */
struct mutex hr_arming_mutex;
+ /* Serializes the dev, block_bytes, start_block and blocks attributes. */
+ struct mutex hr_dev_mutex;
bool hr_stopping;
/* last hb status, 0 for success, other value for error. */
@@ -1664,6 +1666,7 @@ static ssize_t o2hb_region_block_bytes_store(struct config_item *item,
unsigned long block_bytes;
unsigned int block_bits;
+ guard(mutex)(®->hr_dev_mutex);
if (reg->hr_bdev_file)
return -EINVAL;
@@ -1693,6 +1696,7 @@ static ssize_t o2hb_region_start_block_store(struct config_item *item,
char *p = (char *)page;
ssize_t ret;
+ guard(mutex)(®->hr_dev_mutex);
if (reg->hr_bdev_file)
return -EINVAL;
@@ -1718,6 +1722,7 @@ static ssize_t o2hb_region_blocks_store(struct config_item *item,
unsigned long tmp;
char *p = (char *)page;
+ guard(mutex)(®->hr_dev_mutex);
if (reg->hr_bdev_file)
return -EINVAL;
@@ -1735,10 +1740,12 @@ static ssize_t o2hb_region_blocks_store(struct config_item *item,
static ssize_t o2hb_region_dev_show(struct config_item *item, char *page)
{
+ struct o2hb_region *reg = to_o2hb_region(item);
unsigned int ret = 0;
- if (to_o2hb_region(item)->hr_bdev_file)
- ret = sprintf(page, "%pg\n", reg_bdev(to_o2hb_region(item)));
+ guard(mutex)(®->hr_dev_mutex);
+ if (reg->hr_bdev_file)
+ ret = sprintf(page, "%pg\n", reg_bdev(reg));
return ret;
}
@@ -1856,11 +1863,9 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
* this is acting as commit; we set up all of hr_bdev_file and hr_task or
* nothing
*/
-static ssize_t o2hb_region_dev_store(struct config_item *item,
- const char *page,
- size_t count)
+static ssize_t __o2hb_region_dev_store(struct o2hb_region *reg,
+ const char *page, size_t count)
{
- struct o2hb_region *reg = to_o2hb_region(item);
struct task_struct *hb_task;
long fd;
int sectsize;
@@ -1869,6 +1874,8 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
ssize_t ret = -EINVAL;
int live_threshold;
+ lockdep_assert_held(®->hr_dev_mutex);
+
if (reg->hr_bdev_file)
return -EINVAL;
@@ -1972,9 +1979,15 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
wake_up_process(hb_task);
+ /*
+ * Don't hold hr_dev_mutex across the wait, which can take seconds.
+ * hr_bdev_file is already set, so other writers still get -EINVAL.
+ */
+ mutex_unlock(®->hr_dev_mutex);
ret = wait_event_interruptible(o2hb_steady_queue,
atomic_read(®->hr_steady_iterations) == 0 ||
reg->hr_node_deleted);
+ mutex_lock(®->hr_dev_mutex);
if (ret) {
atomic_set(®->hr_steady_iterations, 0);
reg->hr_aborted_start = 1;
@@ -2028,6 +2041,20 @@ static ssize_t o2hb_region_dev_store(struct config_item *item,
return ret;
}
+static ssize_t o2hb_region_dev_store(struct config_item *item,
+ const char *page,
+ size_t count)
+{
+ struct o2hb_region *reg = to_o2hb_region(item);
+ ssize_t ret;
+
+ mutex_lock(®->hr_dev_mutex);
+ ret = __o2hb_region_dev_store(reg, page, count);
+ mutex_unlock(®->hr_dev_mutex);
+
+ return ret;
+}
+
static ssize_t o2hb_region_pid_show(struct config_item *item, char *page)
{
struct o2hb_region *reg = to_o2hb_region(item);
@@ -2130,6 +2157,7 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g
INIT_LIST_HEAD(®->hr_all_item);
mutex_init(®->hr_arming_mutex);
+ mutex_init(®->hr_dev_mutex);
reg->hr_stopping = true;
INIT_DELAYED_WORK(®->hr_write_timeout_work, o2hb_write_timeout);
INIT_DELAYED_WORK(®->hr_nego_timeout_work, o2hb_nego_timeout);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0016/1756] ACPI: utils: Add exclusive AML evaluation helpers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0015/1756] ocfs2/heartbeat: serialize concurrent writes to a regions dev attribute Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0017/1756] platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively Greg Kroah-Hartman
` (982 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki,
Ali Ahmet Memiş, Rong Zhang, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Ahmet Memiş <aliamemis@disroot.org>
[ Upstream commit 80892972ff23bf0b9049230ef0931b34163aaed3 ]
ACPICA drops the interpreter lock while AML waits, for example around EC
accesses, so two methods can run interleaved.
Some firmware relies on methods not interleaving, for instance by
switching an EC page selector without taking the AML mutex that the
other users of that page hold.
Add acpi_evaluate_object_exclusive(), acpi_evaluate_integer_exclusive()
and acpi_execute_simple_method_exclusive() which serialize the
evaluation under a global mutex, for callers that are known to be
affected.
Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/all/CAJZ5v0gS4agVUkCO6M=VW4Wi2y1-s+k23bpzmX9aAZ0Rsv4z9Q@mail.gmail.com/
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
Reviewed-by: Rong Zhang <i@rong.moe>
Link: https://patch.msgid.link/20261018122220.678822-2-aliamemis@disroot.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: f91c2cd6dbce ("platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/utils.c | 41 +++++++++++++++++++++++++++++++++++++++++
include/acpi/acpi_bus.h | 7 +++++++
2 files changed, 48 insertions(+)
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 6de542d995189..219d3d23aee8a 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -10,6 +10,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/types.h>
@@ -243,6 +244,28 @@ acpi_extract_package(union acpi_object *package,
EXPORT_SYMBOL(acpi_extract_package);
+static DEFINE_MUTEX(acpi_exclusive_eval_lock);
+
+/**
+ * acpi_evaluate_object_exclusive - Evaluate an object without interleaving
+ * @handle: ACPI handle of the object or its scope.
+ * @pathname: Path of the object relative to @handle.
+ * @arguments: Arguments to pass, or NULL.
+ * @buffer: Buffer for the return value, or NULL.
+ *
+ * Same as acpi_evaluate_object(), but serialized with other exclusive
+ * evaluations. Use it only for methods known to break when interleaved.
+ */
+acpi_status acpi_evaluate_object_exclusive(acpi_handle handle, acpi_string pathname,
+ struct acpi_object_list *arguments,
+ struct acpi_buffer *buffer)
+{
+ guard(mutex)(&acpi_exclusive_eval_lock);
+
+ return acpi_evaluate_object(handle, pathname, arguments, buffer);
+}
+EXPORT_SYMBOL_GPL(acpi_evaluate_object_exclusive);
+
acpi_status
acpi_evaluate_integer(acpi_handle handle,
acpi_string pathname,
@@ -277,6 +300,16 @@ acpi_evaluate_integer(acpi_handle handle,
EXPORT_SYMBOL(acpi_evaluate_integer);
+acpi_status acpi_evaluate_integer_exclusive(acpi_handle handle, acpi_string pathname,
+ struct acpi_object_list *arguments,
+ unsigned long long *data)
+{
+ guard(mutex)(&acpi_exclusive_eval_lock);
+
+ return acpi_evaluate_integer(handle, pathname, arguments, data);
+}
+EXPORT_SYMBOL_GPL(acpi_evaluate_integer_exclusive);
+
int acpi_get_local_u64_address(acpi_handle handle, u64 *addr)
{
acpi_status status;
@@ -686,6 +719,14 @@ acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
}
EXPORT_SYMBOL(acpi_execute_simple_method);
+acpi_status acpi_execute_simple_method_exclusive(acpi_handle handle, char *method, u64 arg)
+{
+ guard(mutex)(&acpi_exclusive_eval_lock);
+
+ return acpi_execute_simple_method(handle, method, arg);
+}
+EXPORT_SYMBOL_GPL(acpi_execute_simple_method_exclusive);
+
/**
* acpi_evaluate_ej0: Evaluate _EJ0 method for hotplug operations
* @handle: ACPI device handle
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b8cf06904fa20..f46464d1430a2 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -30,6 +30,12 @@ acpi_status
acpi_evaluate_integer(acpi_handle handle,
acpi_string pathname,
struct acpi_object_list *arguments, unsigned long long *data);
+acpi_status acpi_evaluate_object_exclusive(acpi_handle handle, acpi_string pathname,
+ struct acpi_object_list *arguments,
+ struct acpi_buffer *buffer);
+acpi_status acpi_evaluate_integer_exclusive(acpi_handle handle, acpi_string pathname,
+ struct acpi_object_list *arguments,
+ unsigned long long *data);
bool acpi_evaluate_reference(acpi_handle handle, acpi_string pathname,
struct acpi_object_list *arguments,
struct acpi_handle_list *list);
@@ -49,6 +55,7 @@ acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld
bool acpi_has_method(acpi_handle handle, char *name);
acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
u64 arg);
+acpi_status acpi_execute_simple_method_exclusive(acpi_handle handle, char *method, u64 arg);
acpi_status acpi_evaluate_ej0(acpi_handle handle);
acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
acpi_status acpi_evaluate_reg(acpi_handle handle, u8 space_id, u32 function);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0017/1756] platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0016/1756] ACPI: utils: Add exclusive AML evaluation helpers Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0018/1756] proc: dont let an entry below /proc/<pid>/net be a mountpoint Greg Kroah-Hartman
` (981 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ali Ahmet Memiş, Rong Zhang,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Ahmet Memiş <aliamemis@disroot.org>
[ Upstream commit f91c2cd6dbcedf52e227b2eea8d7b99ecbac7552 ]
On some Lenovo IdeaPad and Yoga models, the battery _BIX takes the EC
AML mutex and then calls the serialized RDER through RDIF, while GBMD
calls RDER first and then takes the EC mutex. When the two run
interleaved they deadlock until the mutex acquisition in RDER times
out, and GBMD returns garbage that is reported as both charge types
being enabled.
Evaluate all methods with the exclusive helpers, so that GBMD never runs
interleaved with the battery methods.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221065
Link: https://lore.kernel.org/all/58586fa666f09c209f9d7fe8c692a8bdda6d4410.camel@rong.moe/
Signed-off-by: Ali Ahmet Memiş <aliamemis@disroot.org>
Reviewed-by: Rong Zhang <i@rong.moe>
Cc: All applicable <stable@vger.kernel.org> # 80892972ff23 ACPI: utils: Add exclusive AML evaluation helpers
Link: https://patch.msgid.link/20261018122348.679126-1-aliamemis@disroot.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/ideapad-laptop.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index c7e8bcf3d6239..6349defc17385 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -282,12 +282,16 @@ static void ideapad_shared_exit(struct ideapad_private *priv)
#define IDEAPAD_EC_POLL_MIN_US 150
#define IDEAPAD_EC_POLL_MAX_US 300
+/*
+ * On some models GBMD and the battery _BIX take the EC mutex and a
+ * serialized method in opposite order, so evaluate all methods exclusively.
+ */
static int eval_int(acpi_handle handle, const char *name, unsigned long *res)
{
unsigned long long result;
acpi_status status;
- status = acpi_evaluate_integer(handle, (char *)name, NULL, &result);
+ status = acpi_evaluate_integer_exclusive(handle, (char *)name, NULL, &result);
if (ACPI_FAILURE(status))
return -EIO;
@@ -309,7 +313,7 @@ static int eval_int_with_arg(acpi_handle handle, const char *name, unsigned long
in_obj.type = ACPI_TYPE_INTEGER;
in_obj.integer.value = arg;
- status = acpi_evaluate_integer(handle, (char *)name, ¶ms, &result);
+ status = acpi_evaluate_integer_exclusive(handle, (char *)name, ¶ms, &result);
if (ACPI_FAILURE(status))
return -EIO;
@@ -321,7 +325,7 @@ static int eval_int_with_arg(acpi_handle handle, const char *name, unsigned long
static int exec_simple_method(acpi_handle handle, const char *name, unsigned long arg)
{
- acpi_status status = acpi_execute_simple_method(handle, (char *)name, arg);
+ acpi_status status = acpi_execute_simple_method_exclusive(handle, (char *)name, arg);
return ACPI_FAILURE(status) ? -EIO : 0;
}
@@ -379,7 +383,7 @@ static int eval_vpcw(acpi_handle handle, unsigned long cmd, unsigned long data)
in_obj[1].type = ACPI_TYPE_INTEGER;
in_obj[1].integer.value = data;
- status = acpi_evaluate_object(handle, "VPCW", ¶ms, NULL);
+ status = acpi_evaluate_object_exclusive(handle, "VPCW", ¶ms, NULL);
if (ACPI_FAILURE(status))
return -EIO;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0018/1756] proc: dont let an entry below /proc/<pid>/net be a mountpoint
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0017/1756] platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0019/1756] wifi: mt76: mt7996: fix PCI device reference leak in mt7996_pci_init_hif2() Greg Kroah-Hartman
` (980 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jan Kara, Aleksa Sarai,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit eeecea75ece2ba894bee4d3c53ed2e40abda8f0e ]
proc_net_d_revalidate() always returns 0 so that a dentry below
/proc/<pid>/net is never reused after setns(). So lookup_fast() will end
up calling d_invalidate(), which unhashes the dentry and detaches every
mount on it, in every mount namespace; including locked mounts.
Then lookup_slow() creates a new dentry for the same entry. So a mount
on /proc/<pid>/net/dev succeeds and goes away with the first lookup of
the name by anybody with search permission on the directory. Given it's
0555 that's everyone's grandma. A mask on such a name hides nothing as
the repro below shows.
Treat those entries like I did fd/, fdinfo/ and map_files/ and refuse to
mount on them in the first place. It's nonsensical theater otherwise:
procnet net/dev stat
// SPDX-License-Identifier: GPL-2.0
/*
* procnet: cover an entry of /proc/<pid>/ with a bind mount, lock the mount,
* then look the name up.
*
* The first task stays alive, <pid> is its pid. The "container" task has its
* own mount namespace. There it binds a mask on /proc/<pid>/<name>. It drops to
* uid 1000 and enters a new user namespace with a new mount namespace, so that
* the mask is locked. Then one task looks the name up:
*
* stat the container calls stat() on the name
* umount the container calls umount2(MNT_DETACH) on the name
* nobody a task with uid 65534 in the first namespaces calls stat()
*
* The container lists its mounts before and after (that does not look the
* name up) and then reads the name. MASK is fine. Anything else means that
* the lookup uncovered the entry.
*
* usage: procnet <name> stat|umount|nobody
* name "status" is the control, "net/dev" is a file below net, "net/stat" is
* a directory below net
*/
#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#define WORK "/run/pn"
static char target[128];
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s\n", what, strerror(errno));
exit(2);
}
static void write_str(const char *path, const char *s, int flags)
{
int fd = open(path, O_WRONLY | flags, 0644);
if (fd < 0 || write(fd, s, strlen(s)) < 0)
die(path);
close(fd);
}
/* list the mounts below /proc without a lookup of the target */
static void mounts(const char *when)
{
char line[512];
FILE *f = fopen("/proc/self/mountinfo", "r");
int n = 0;
if (!f)
die("mountinfo");
while (fgets(line, sizeof(line), f)) {
if (!strstr(line, " /proc/"))
continue;
printf("container: %s: mount: %s", when, line);
n++;
}
fclose(f);
if (!n)
printf("container: %s: nothing is mounted below /proc\n", when);
}
static void show(const char *when, int isdir)
{
char buf[48] = "";
int fd;
if (isdir) {
struct dirent *de;
DIR *d = opendir(target);
int hit = 0;
if (!d) {
printf("container: %s: opendir(%s) = %s\n", when, target, strerror(errno));
return;
}
printf("container: %s: readdir(%s) =", when, target);
while ((de = readdir(d))) {
if (de->d_name[0] == '.')
continue;
printf(" %s", de->d_name);
hit |= strcmp(de->d_name, "MASK");
}
closedir(d);
printf("%s\n", hit ? " <-- HIT" : "");
return;
}
fd = open(target, O_RDONLY);
if (fd < 0) {
printf("container: %s: open(%s) = %s\n", when, target, strerror(errno));
return;
}
if (read(fd, buf, sizeof(buf) - 1) < 0)
die("read");
close(fd);
if (strchr(buf, '\n'))
*strchr(buf, '\n') = 0;
printf("container: %s: read(%s) = \"%s\"%s\n", when, target, buf,
strncmp(buf, "MASK", 4) ? " <-- HIT" : "");
}
int main(int argc, char **argv)
{
const char *name = argc > 1 ? argv[1] : "net/dev";
const char *op = argc > 2 ? argv[2] : "stat";
int isdir = !strcmp(name, "net/stat");
int to_host[2], to_cont[2];
struct stat st;
pid_t pid;
char c;
setvbuf(stdout, NULL, _IOLBF, 0);
snprintf(target, sizeof(target), "/proc/%d/%s", getpid(), name);
if (unshare(CLONE_NEWNS) || mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL))
die("unshare");
mkdir(WORK, 0755);
if (mount("W", WORK, "tmpfs", 0, NULL))
die("mount W");
write_str(WORK "/mask", "MASK", O_CREAT);
mkdir(WORK "/maskdir", 0755);
write_str(WORK "/maskdir/MASK", "MASK", O_CREAT);
if (pipe(to_host) || pipe(to_cont))
die("pipe");
pid = fork();
if (pid < 0)
die("fork");
if (!pid) {
if (unshare(CLONE_NEWNS))
die("container unshare");
if (mount(isdir ? WORK "/maskdir" : WORK "/mask", target, NULL, MS_BIND, NULL)) {
printf("container: bind the mask on %s: %s\n", target, strerror(errno));
exit(0);
}
printf("container: bind the mask on %s: ok\n", target);
if (setgid(1000) || setuid(1000) || prctl(PR_SET_DUMPABLE, 1))
die("setuid");
/* lock the mount: a new user namespace with a copy of the tree */
if (unshare(CLONE_NEWUSER | CLONE_NEWNS))
die("container userns");
write_str("/proc/self/setgroups", "deny", 0);
write_str("/proc/self/uid_map", "0 1000 1", 0);
write_str("/proc/self/gid_map", "0 1000 1", 0);
mounts("before");
errno = 0;
if (!strcmp(op, "stat")) {
stat(target, &st);
printf("container: stat(%s): %s\n", target, strerror(errno));
} else if (!strcmp(op, "umount")) {
umount2(target, MNT_DETACH);
printf("container: umount2(%s, MNT_DETACH): %s\n", target, strerror(errno));
} else if (write(to_host[1], "g", 1) != 1 || read(to_cont[0], &c, 1) != 1) {
die("sync");
}
mounts("after");
show("after", isdir);
exit(0);
}
close(to_host[1]);
if (read(to_host[0], &c, 1) == 1) {
pid_t p2 = fork();
if (!p2) {
if (setgid(65534) || setuid(65534))
die("setuid");
errno = 0;
stat(target, &st);
printf("nobody: uid %u: stat(%s): %s\n", getuid(), target, strerror(errno));
exit(0);
}
waitpid(p2, NULL, 0);
if (write(to_cont[1], "g", 1) != 1)
die("sync");
}
waitpid(pid, NULL, 0);
return 0;
}
Fixes: 1fde6f21d90f ("proc: fix /proc/net/* after setns(2)")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261024-work-procfs-fixes-v1-1-46b03c3a8fac@kernel.org
Acked-by: Jan Kara <jack@suse.cz>
Reviewed-by: Aleksa Sarai <aleksa@amutable.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: replaced the PROC_ENTRY_FORCE_LOOKUP flag check with de->proc_dops == &proc_net_dentry_ops. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/proc/generic.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index c3cc99973ef64..e8fe204a88c39 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -255,6 +255,10 @@ struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry,
inode = proc_get_inode(dir->i_sb, de);
if (!inode)
return ERR_PTR(-ENOMEM);
+ /* never reused and so never a mountpoint for long */
+ if (de->proc_dops == &proc_net_dentry_ops)
+ return proc_splice_unmountable(inode, dentry,
+ &proc_net_dentry_ops);
d_set_d_op(dentry, de->proc_dops);
return d_splice_alias(inode, dentry);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0019/1756] wifi: mt76: mt7996: fix PCI device reference leak in mt7996_pci_init_hif2()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0018/1756] proc: dont let an entry below /proc/<pid>/net be a mountpoint Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0020/1756] mm/userfaultfd: write-lock the VMA before waking waiters when unregistering Greg Kroah-Hartman
` (979 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linlin Yang, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linlin Yang <yanglinlin@kylinos.cn>
[ Upstream commit d92bac6b6af2602516ee82ae112709c71af27cf6 ]
pci_get_device() increments the reference count on the returned
struct pci_dev. In mt7996_pci_init_hif2(), three pci_get_device()
calls are made but their return values are only checked for NULL
and then discarded. pci_dev_put() is never called, causing a PCI
device reference count leak.
Fix this by storing the return value and calling pci_dev_put()
before returning, following the same pattern already used in the
sibling driver mt7915/pci.c.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Cc: stable@vger.kernel.org
Signed-off-by: Linlin Yang <yanglinlin@kylinos.cn>
Link: https://patch.msgid.link/20260824092937.683240-1-yanglinlin@kylinos.cn
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[ sashal: adapted device lookups to use only the two existing numeric IDs instead of named constants for three chipsets ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/pci.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/pci.c b/drivers/net/wireless/mediatek/mt76/mt7996/pci.c
index dbd05612f2e4a..3cb5678932427 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/pci.c
@@ -61,11 +61,16 @@ static void mt7996_put_hif2(struct mt7996_hif *hif)
static struct mt7996_hif *mt7996_pci_init_hif2(struct pci_dev *pdev)
{
+ struct pci_dev *tmp_pdev;
+
hif_idx++;
- if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7991, NULL) &&
- !pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x799a, NULL))
+ tmp_pdev = pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7991, NULL);
+ if (!tmp_pdev)
+ tmp_pdev = pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x799a, NULL);
+ if (!tmp_pdev)
return NULL;
+ pci_dev_put(tmp_pdev);
writel(hif_idx | MT_PCIE_RECOG_ID_SEM,
pcim_iomap_table(pdev)[0] + MT_PCIE_RECOG_ID);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0020/1756] mm/userfaultfd: write-lock the VMA before waking waiters when unregistering
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0019/1756] wifi: mt76: mt7996: fix PCI device reference leak in mt7996_pci_init_hif2() Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0021/1756] backing-file: enforce append-only and immutable backing inodes Greg Kroah-Hartman
` (978 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik,
Mike Rapoport (Microsoft), Lorenzo Stoakes (ARM),
Suren Baghdasaryan, Muhammad Usama Anjum, David Hildenbrand (Arm),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 35f7ecd55ce7e51cb6d5ef49e6dd51f3c80f61e4 ]
userfaultfd_unregister() wakes pending missing faults before clearing the
VMA's userfaultfd registration. With per-VMA fault locking, holding
mmap_lock for write does not prevent another fault from queuing after
the wakeup but before userfaultfd_clear_vma() write-locks the VMA. That
waiter can then remain asleep indefinitely.
Call vma_start_write() before waking waiters. Existing fault handlers
queue themselves before dropping the VMA read lock, and new readers are
excluded until mmap_write_unlock().
Fixes: 29a22b9e08d7 ("mm: handle userfaults under VMA lock")
Cc: stable@vger.kernel.org
Reported-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-23-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adjusted the patch target to the older file location of userfaultfd_unregister() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/userfaultfd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index cbd9d610c54bf..59f01cc7c5ace 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1513,6 +1513,9 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
start = vma->vm_start;
vma_end = min(end, vma->vm_end);
+ /* Prevent new userfaults from being queued after the wakeup. */
+ vma_start_write(vma);
+
if (userfaultfd_missing(vma)) {
/*
* Wake any concurrent pending userfault while
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0021/1756] backing-file: enforce append-only and immutable backing inodes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0020/1756] mm/userfaultfd: write-lock the VMA before waking waiters when unregistering Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0022/1756] mm/userfaultfd: wake waiters when registration modes are removed Greg Kroah-Hartman
` (977 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Amir Goldstein,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 19b18e01d0361ce495be153ecce80b581086ab3f ]
FUSE passthrough opens the backing file anew whenever the FUSE file is
opened. fuse_passthrough_open() passes the flags of that open to
backing_file_open() which opens the backing file with vfs_open() and the
credentials of the server. But vfs_open() doesn't go through may_open().
So the backing inode is never checked for S_APPEND and S_IMMUTABLE. The
checks that did run were done on the FUSE inode and that one never has
either flag.
So anyone who may open the FUSE file for writing can overwrite an
append-only backing file anywhere or write to an immutable one. The
server only has to register the file and a read-only or even an O_PATH
file descriptor is enough for that. Registering requires CAP_SYS_ADMIN
but the writer can be any user that the server lets open the file.
The FUSE inode is checked instead of the backing inode in a few more
places:
- do_mmap() refuses a shared mapping of an append-only file that was
opened for writing. A FUSE file opened with O_RDWR | O_APPEND passes
the open check and can then be mapped shared and written to at any
offset.
- fcntl(F_SETFL) and RWF_NOAPPEND refuse to take append mode away from a
file on an append-only inode. On the FUSE file both succeed. A
synchronous write still appends because the backing file was opened
with O_APPEND. But an asynchronous write is submitted with the flags
of the user's kiocb and lands at the given offset.
Do the checks on the backing inode. backing_file_open() refuses to open
an immutable inode for writing and an append-only inode for writing
without O_APPEND, just like may_open(). backing_file_mmap() refuses a
shared mapping of an append-only inode, just like do_mmap(). And writes
and splices to a backing file in append mode fail if append mode was
taken away from the user file.
A FUSE file that was opened before the backing file became append-only
can still write anywhere. That's what happens on the native filesystem
as well and the backing file of such a file isn't in append mode. Two
differences remain. F_SETFL succeeds and the next write fails. And FUSE
reports EIO for a refused open because it turns every error from opening
the backing file into EIO.
overlayfs uses the same helpers but it mirrors S_APPEND and S_IMMUTABLE
in its own inode and a chattr through the overlay never sets them on the
upper inode. So for overlayfs this only changes something if the upper
inode is changed behind the overlay's back.
Fixes: 4a90451bbc7f ("fuse: implement open in passthrough mode")
Reported-by: Chris Mason <mason@kernel.org>
Cc: stable@vger.kernel.org # v6.9+
Link: https://patch.msgid.link/20261029-work-fs-ai-fixes-v1-2-88f22792f6f7@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Retained file_remove_privs(ctx->user_file) instead of file_remove_privs(iocb->ki_filp) to match the existing API. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/backing-file.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/fs/backing-file.c b/fs/backing-file.c
index 2ed8f17aa5f48..a0caad973766b 100644
--- a/fs/backing-file.c
+++ b/fs/backing-file.c
@@ -35,9 +35,21 @@ struct file *backing_file_open(const struct file *user_file, int flags,
const struct cred *cred)
{
const struct path *user_path = file_user_path(user_file);
+ struct inode *real_inode = d_inode(real_path->dentry);
struct file *f;
int error;
+ /*
+ * may_open() checked the inode of the user file, which need not carry
+ * S_APPEND and S_IMMUTABLE of the backing inode.
+ */
+ if ((flags & O_ACCMODE) != O_RDONLY) {
+ if (IS_IMMUTABLE(real_inode))
+ return ERR_PTR(-EPERM);
+ if (IS_APPEND(real_inode) && !(flags & O_APPEND))
+ return ERR_PTR(-EPERM);
+ }
+
f = alloc_empty_backing_file(flags, cred, user_file);
if (IS_ERR(f))
return f;
@@ -224,6 +236,14 @@ ssize_t backing_file_write_iter(struct file *file, struct iov_iter *iter,
if (!iov_iter_count(iter))
return 0;
+ /*
+ * F_SETFL and RWF_NOAPPEND can take append mode away from the user
+ * file. They checked its inode, not the backing one.
+ */
+ if ((file->f_flags & O_APPEND) && !(flags & IOCB_APPEND) &&
+ IS_APPEND(file_inode(file)))
+ return -EPERM;
+
ret = file_remove_privs(ctx->user_file);
if (ret)
return ret;
@@ -312,6 +332,10 @@ ssize_t backing_file_splice_write(struct pipe_inode_info *pipe,
if (!out->f_op->splice_write)
return -EINVAL;
+ /* splice refuses a user file in append mode, so F_SETFL cleared it */
+ if ((out->f_flags & O_APPEND) && IS_APPEND(file_inode(out)))
+ return -EPERM;
+
ret = file_remove_privs(ctx->user_file);
if (ret)
return ret;
@@ -343,6 +367,10 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
if (!file->f_op->mmap)
return -ENODEV;
+ /* do_mmap() checked the inode of the user file */
+ if ((vma->vm_flags & VM_SHARED) && IS_APPEND(file_inode(file)))
+ return -EACCES;
+
vma_set_file(vma, file);
old_cred = override_creds(ctx->cred);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0022/1756] mm/userfaultfd: wake waiters when registration modes are removed
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0021/1756] backing-file: enforce append-only and immutable backing inodes Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0023/1756] f2fs: fix to update superblock crc in sanity_check_area_boundary() Greg Kroah-Hartman
` (976 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Mike Rapoport (Microsoft), Lorenzo Stoakes (ARM),
Muhammad Usama Anjum, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 4eee9c389b072e161549d46dcb1ae10b0222717e ]
UFFDIO_REGISTER can replace MISSING or MINOR tracking without waking
faults that are already queued. For example, switching an anonymous
range from MISSING to WP leaves a missing-fault waiter asleep until
userspace explicitly wakes it.
When a registration change removes a UFFD mode, wake waiters in the
affected interval after updating the VMA. The VMA is write-locked at
this point, so no new faults can queue under the old modes and woken
threads cannot retry until mmap_write_unlock(). Waiters for retained
modes in the same interval may also wake and refault.
The hang reproduces for MISSING-to-WP and MINOR-to-MISSING transitions,
with both read and unread fault events.
Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Cc: stable@vger.kernel.org
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-25-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: replaced the local wake_userfault_range() wrapper with a direct wake_userfault() call, exposing the helper and its range structure across files ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/userfaultfd.c | 9 ++-------
include/linux/userfaultfd_k.h | 8 ++++++++
mm/userfaultfd.c | 12 ++++++++++++
3 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 59f01cc7c5ace..e1b1a5b1a757a 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -71,11 +71,6 @@ struct userfaultfd_wait_queue {
bool waken;
};
-struct userfaultfd_wake_range {
- unsigned long start;
- unsigned long len;
-};
-
/* internal indication that UFFD_API ioctl was successfully executed */
#define UFFD_FEATURE_INITIALIZED (1u << 31)
@@ -1185,8 +1180,8 @@ static void __wake_userfault(struct userfaultfd_ctx *ctx,
spin_unlock_irq(&ctx->fault_pending_wqh.lock);
}
-static __always_inline void wake_userfault(struct userfaultfd_ctx *ctx,
- struct userfaultfd_wake_range *range)
+void wake_userfault(struct userfaultfd_ctx *ctx,
+ struct userfaultfd_wake_range *range)
{
unsigned seq;
bool need_wakeup;
diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h
index 8ff68ce1860be..8b8be5fa2eb57 100644
--- a/include/linux/userfaultfd_k.h
+++ b/include/linux/userfaultfd_k.h
@@ -82,6 +82,14 @@ struct userfaultfd_ctx {
struct mm_struct *mm;
};
+struct userfaultfd_wake_range {
+ unsigned long start;
+ unsigned long len;
+};
+
+void wake_userfault(struct userfaultfd_ctx *ctx,
+ struct userfaultfd_wake_range *range);
+
extern vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason);
/* A combined operation mode + behavior flags. */
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 29d2366d88fa1..10685c46f0866 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -1965,6 +1965,8 @@ int userfaultfd_register_range(struct userfaultfd_ctx *ctx,
prev = vma;
for_each_vma_range(vmi, vma, end) {
+ const bool any_mode_removed = vma->vm_flags & __VM_UFFD_FLAGS & ~vm_flags;
+
cond_resched();
BUG_ON(!vma_can_userfault(vma, vm_flags, wp_async));
@@ -1999,6 +2001,16 @@ int userfaultfd_register_range(struct userfaultfd_ctx *ctx,
*/
userfaultfd_set_ctx(vma, ctx, vm_flags);
+ /* Retry faults for removed modes while the VMA is write-locked. */
+ if (any_mode_removed) {
+ struct userfaultfd_wake_range range = {
+ .start = start,
+ .len = vma_end - start,
+ };
+
+ wake_userfault(ctx, &range);
+ }
+
if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma))
hugetlb_unshare_all_pmds(vma);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0023/1756] f2fs: fix to update superblock crc in sanity_check_area_boundary()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0022/1756] mm/userfaultfd: wake waiters when registration modes are removed Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0024/1756] hwmon: chipcap2: fix IRQ teardown ordering Greg Kroah-Hartman
` (975 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Chao Yu, Jaegeuk Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
[ Upstream commit f8f956c7ec8c0285d7a80bed497d2f7adcbded15 ]
This patch fixes the bug reported by Sashiko:
We should update superblock crc along w/ raw_super->segment_count in
sanity_check_area_boundary() if sb_checksum feature is enabled.
Cc: stable@kernel.org
Fixes: d440c52d3151 ("f2fs: support superblock checksum")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[ sashal: Added sbi as the first argument to f2fs_crc32() to match the older checksum API. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/super.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index ec3e20cd6c5eb..facf7647b5095 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3571,6 +3571,12 @@ static inline bool sanity_check_area_boundary(struct f2fs_sb_info *sbi,
/* fix in-memory information all the time */
raw_super->segment_count = cpu_to_le32((main_end_blkaddr -
segment0_blkaddr) >> log_blocks_per_seg);
+ if (__F2FS_HAS_FEATURE(raw_super, F2FS_FEATURE_SB_CHKSUM)) {
+ __u32 crc = f2fs_crc32(sbi, raw_super,
+ offsetof(struct f2fs_super_block, crc));
+
+ raw_super->crc = cpu_to_le32(crc);
+ }
if (f2fs_readonly(sb) || f2fs_hw_is_readonly(sbi)) {
set_sbi_flag(sbi, SBI_NEED_SB_WRITE);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0024/1756] hwmon: chipcap2: fix IRQ teardown ordering
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0023/1756] f2fs: fix to update superblock crc in sanity_check_area_boundary() Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0025/1756] hwmon: chipcap2: disable device after hwmon teardown Greg Kroah-Hartman
` (974 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Javier Carrasco, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
[ Upstream commit d2a66c515d7730fd453485ffb306c412f1f46d72 ]
The threaded IRQs are currently requested before the hwmon device
is registered. Since devres releases resources in reverse order,
the hwmon device is unregistered before the IRQs are freed during
driver teardown. An IRQ may therefore still run after the hwmon
device has been released and access the stale data->hwmon pointer.
Separate IRQ discovery from IRQ registration so that the IRQ numbers
and alarm visibility flags are initialized before registering the
hwmon device while the IRQs are released before the hwmon device
during devres cleanup.
Fixes: 3af350929e75 ("hwmon: Add support for Amphenol ChipCap 2")
Cc: stable@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20261014-chipcap2_locks-v3-5-27ebfc2c5b9e@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
The label-property access is omitted because the driver has no label
support. Reuse the two existing IRQ helpers for discovery and data-ready
registration, and request alarm IRQs directly in probe after registering
hwmon. This preserves the teardown ordering without adding a helper.
Stable-dep-of: 4724ac5556ce ("hwmon: chipcap2: disable device after hwmon teardown")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/chipcap2.c | 79 ++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 39 deletions(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 46a3e22f43ade..0f7711ca6feb7 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -663,58 +663,39 @@ static int cc2_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
return ret;
}
-static int cc2_request_ready_irq(struct cc2_data *data, struct device *dev)
+static int cc2_get_irqs(struct cc2_data *data, struct device *dev)
{
- int ret = 0;
-
data->irq_ready = fwnode_irq_get_byname(dev_fwnode(dev), "ready");
if (data->irq_ready == -EPROBE_DEFER)
return data->irq_ready;
- if (data->irq_ready > 0) {
+ if (data->irq_ready > 0)
init_completion(&data->complete);
- ret = devm_request_threaded_irq(dev, data->irq_ready, NULL,
- cc2_ready_interrupt,
- IRQF_ONESHOT |
- IRQF_TRIGGER_RISING,
- dev_name(dev), data);
- }
-
- return ret;
-}
-
-static int cc2_request_alarm_irqs(struct cc2_data *data, struct device *dev)
-{
- int ret = 0;
data->irq_low = fwnode_irq_get_byname(dev_fwnode(dev), "low");
if (data->irq_low == -EPROBE_DEFER)
return data->irq_low;
- if (data->irq_low > 0) {
- ret = devm_request_threaded_irq(dev, data->irq_low, NULL,
- cc2_low_interrupt,
- IRQF_ONESHOT |
- IRQF_TRIGGER_RISING,
- dev_name(dev), data);
- if (ret)
- return ret;
-
+ if (data->irq_low > 0)
data->rh_alarm.low_alarm_visible = true;
- }
data->irq_high = fwnode_irq_get_byname(dev_fwnode(dev), "high");
if (data->irq_high == -EPROBE_DEFER)
return data->irq_high;
- if (data->irq_high > 0) {
- ret = devm_request_threaded_irq(dev, data->irq_high, NULL,
- cc2_high_interrupt,
+ if (data->irq_high > 0)
+ data->rh_alarm.high_alarm_visible = true;
+
+ return 0;
+}
+
+static int cc2_request_data_ready(struct cc2_data *data, struct device *dev)
+{
+ int ret = 0;
+
+ if (data->irq_ready > 0)
+ ret = devm_request_threaded_irq(dev, data->irq_ready, NULL,
+ cc2_ready_interrupt,
IRQF_ONESHOT |
IRQF_TRIGGER_RISING,
dev_name(dev), data);
- if (ret)
- return ret;
-
- data->rh_alarm.high_alarm_visible = true;
- }
return ret;
}
@@ -762,13 +743,13 @@ static int cc2_probe(struct i2c_client *client)
return dev_err_probe(dev, PTR_ERR(data->regulator),
"Failed to get regulator\n");
- ret = cc2_request_ready_irq(data, dev);
+ ret = cc2_get_irqs(data, dev);
if (ret)
- return dev_err_probe(dev, ret, "Failed to request ready irq\n");
+ return dev_err_probe(dev, ret, "Failed to get IRQs\n");
- ret = cc2_request_alarm_irqs(data, dev);
+ ret = cc2_request_data_ready(data, dev);
if (ret)
- return dev_err_probe(dev, ret, "Failed to request alarm irqs\n");
+ return dev_err_probe(dev, ret, "Failed to request ready irq\n");
data->hwmon = devm_hwmon_device_register_with_info(dev, client->name,
data, &cc2_chip_info,
@@ -777,6 +758,26 @@ static int cc2_probe(struct i2c_client *client)
return dev_err_probe(dev, PTR_ERR(data->hwmon),
"Failed to register hwmon device\n");
+ if (data->irq_low > 0) {
+ ret = devm_request_threaded_irq(dev, data->irq_low, NULL,
+ cc2_low_interrupt,
+ IRQF_ONESHOT |
+ IRQF_TRIGGER_RISING,
+ dev_name(dev), data);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to request alarm irqs\n");
+ }
+
+ if (data->irq_high > 0) {
+ ret = devm_request_threaded_irq(dev, data->irq_high, NULL,
+ cc2_high_interrupt,
+ IRQF_ONESHOT |
+ IRQF_TRIGGER_RISING,
+ dev_name(dev), data);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to request alarm irqs\n");
+ }
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0025/1756] hwmon: chipcap2: disable device after hwmon teardown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0024/1756] hwmon: chipcap2: fix IRQ teardown ordering Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0026/1756] libceph: initialize CRUSH choose argument weights Greg Kroah-Hartman
` (973 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Javier Carrasco, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
[ Upstream commit 4724ac5556ce63f01a3f5d61fc7fcc20f4ddef3f ]
cc2_remove() disables the device while the device-managed hwmon device is
still registered. A concurrent sysfs callback can then enable the device
after it has been disabled during removal.
Register a device-managed disable action before registering the hwmon
device, so devres unregisters the hwmon device before disabling the
physical device.
Fixes: 3af350929e75 ("hwmon: Add support for Amphenol ChipCap 2")
Cc: stable@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20261014-chipcap2_locks-v3-6-27ebfc2c5b9e@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/chipcap2.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 0f7711ca6feb7..6a69c7699594b 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -166,6 +166,11 @@ static void cc2_disable(struct cc2_data *data)
data->regulator_enabled = false;
}
+static void cc2_disable_action(void *data)
+{
+ cc2_disable(data);
+}
+
static int cc2_cmd_response_diagnostic(struct device *dev, u8 status)
{
int resp;
@@ -747,6 +752,10 @@ static int cc2_probe(struct i2c_client *client)
if (ret)
return dev_err_probe(dev, ret, "Failed to get IRQs\n");
+ ret = devm_add_action_or_reset(dev, cc2_disable_action, data);
+ if (ret)
+ return ret;
+
ret = cc2_request_data_ready(data, dev);
if (ret)
return dev_err_probe(dev, ret, "Failed to request ready irq\n");
@@ -781,13 +790,6 @@ static int cc2_probe(struct i2c_client *client)
return 0;
}
-static void cc2_remove(struct i2c_client *client)
-{
- struct cc2_data *data = i2c_get_clientdata(client);
-
- cc2_disable(data);
-}
-
static const struct i2c_device_id cc2_id[] = {
{ "cc2d23" },
{ "cc2d23s" },
@@ -820,7 +822,6 @@ static struct i2c_driver cc2_driver = {
.of_match_table = cc2_of_match,
},
.probe = cc2_probe,
- .remove = cc2_remove,
.id_table = cc2_id,
};
module_i2c_driver(cc2_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0026/1756] libceph: initialize CRUSH choose argument weights
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0025/1756] hwmon: chipcap2: disable device after hwmon teardown Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0027/1756] ovl: inherit FMODE_NONOTIFY when opening directory realfiles Greg Kroah-Hartman
` (972 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Darong Lu, Ren Wei,
Alex Markuze, Ilya Dryomov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darong Lu <zzyy19904204639@163.com>
[ Upstream commit c3a995ff0782587789333c621e1f6bd5e574371e ]
Initialize the CRUSH choose argument weight-set array before decoding so
entries start in a defined state while the decoder fills them.
Cc: stable@vger.kernel.org
Fixes: 5cf9c4a9959b ("libceph, crush: per-pool crush_choose_arg_map for crush_do_rule()")
Reported-by: Vega <vega@nebusec.ai>
Assisted-by: LLM
Signed-off-by: Darong Lu <zzyy19904204639@163.com>
Signed-off-by: Ren Wei <weir@nebusec.ai>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
[ sashal: replaced kzalloc_objs() with kcalloc() using an explicit element size ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ceph/osdmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index 803514a1bc7ce..fdb8c398f5ecd 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -320,7 +320,7 @@ static int decode_choose_arg(void **p, void *end, struct crush_choose_arg *arg)
if (arg->weight_set_size) {
u32 i;
- arg->weight_set = kmalloc_array(arg->weight_set_size,
+ arg->weight_set = kcalloc(arg->weight_set_size,
sizeof(*arg->weight_set),
GFP_NOIO);
if (!arg->weight_set)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0027/1756] ovl: inherit FMODE_NONOTIFY when opening directory realfiles
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0026/1756] libceph: initialize CRUSH choose argument weights Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0028/1756] mm/memory-tiers: unregister empty tiers outside memory_tier_lock Greg Kroah-Hartman
` (971 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Edvard Conrad, Amir Goldstein, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit 323899b4ed233d5b6e2fc160c16fbf39cf0317da ]
When fanotify hands a listener an fd for a permission event on an
overlay directory, ovl_dir_open_realfile() opens the real directory via
dentry_open(), not backing_file_open(), so the lower open could still
raise FS_OPEN_PERM and deadlock a listener that also marks the backing
filesystem.
Export dentry_open_nonotify() and call it from ovl_path_open_realfile()
when the overlay user file must not generate events. Ordinary
ovl_path_open() callers are unchanged.
Reported-by: Christian Brauner (Amutable) <brauner@kernel.org>
Closes: https://lore.kernel.org/all/20261030-welpen-anbinden-nullen-b2432cee1d10@brauner/
Fixes: 130fdbc3d1f99 ("ovl: pass correct flags for opening real directory")
Cc: stable@vger.kernel.org
Tested-by: Edvard Conrad <edvard@tuta.io>
Link: https://lore.kernel.org/ltp/P5Iny41--F-9@tuta.io/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
[ sashal: Replaced dentry_open_nonotify() with dentry_open() using __FMODE_NONOTIFY. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/readdir.c | 10 +++++++++-
fs/overlayfs/util.c | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 5d912f887aac7..843c3d5168f4e 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -869,9 +869,17 @@ static struct file *ovl_dir_open_realfile(const struct file *file,
{
struct file *res;
const struct cred *old_cred;
+ int flags = O_RDONLY | (file->f_flags & O_LARGEFILE);
+
+ /*
+ * Inherit FMODE_NONOTIFY from a fanotify permission fd so a listener
+ * that also watches the real filesystem does not deadlock.
+ */
+ if (FMODE_FSNOTIFY_NONE(file->f_mode))
+ flags |= __FMODE_NONOTIFY;
old_cred = ovl_override_creds(file_inode(file)->i_sb);
- res = ovl_path_open(realpath, O_RDONLY | (file->f_flags & O_LARGEFILE));
+ res = ovl_path_open(realpath, flags);
revert_creds(old_cred);
return res;
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 723672073b1e3..4c0881f0b75e0 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -652,7 +652,7 @@ struct file *ovl_path_open(const struct path *path, int flags)
struct mnt_idmap *real_idmap = mnt_idmap(path->mnt);
int err, acc_mode;
- if (flags & ~(O_ACCMODE | O_LARGEFILE))
+ if (flags & ~(O_ACCMODE | O_LARGEFILE | __FMODE_NONOTIFY))
BUG();
switch (flags & O_ACCMODE) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0028/1756] mm/memory-tiers: unregister empty tiers outside memory_tier_lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0027/1756] ovl: inherit FMODE_NONOTIFY when opening directory realfiles Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0029/1756] mm/vma: update VMA iterator state on error in new VMA merge Greg Kroah-Hartman
` (970 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Gregory Price (Meta),
Muhammad Usama Anjum, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 500624f28eca441e35f978979ccfb373202fefd3 ]
When offlining a node's last memory empties its tier,
clear_node_memory_tier() calls device_unregister() while holding
memory_tier_lock. A concurrent sysfs read can hold a kernfs active
reference and block in nodelist_show() on that mutex. device_unregister()
then waits in kernfs_drain() for the read to finish and release its active
reference, while the reader waits for the offlining task to release the
mutex.
Return the node's former tier from clear_node_memory_tier(), making the
helper more similar to set_node_memory_tier(), which also returns a
memory_tier pointer. Let the caller unlink an empty tier under
memory_tier_lock before rebuilding demotion targets, then unregister its
device after dropping the lock.
Fixes: 9832fb87834e ("mm/demotion: expose memory tier details via sysfs")
Cc: stable@vger.kernel.org
Reported-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-46-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted node notifications to the existing memory-notifier API using arg->status_change_nid instead of nn->nid. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory-tiers.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
index fc14fe53e9b75..a8733cd8d554b 100644
--- a/mm/memory-tiers.c
+++ b/mm/memory-tiers.c
@@ -561,21 +561,14 @@ static struct memory_tier *set_node_memory_tier(int node)
return memtier;
}
-static void destroy_memory_tier(struct memory_tier *memtier)
+static struct memory_tier *clear_node_memory_tier(int node)
{
- list_del(&memtier->list);
- device_unregister(&memtier->dev);
-}
-
-static bool clear_node_memory_tier(int node)
-{
- bool cleared = false;
pg_data_t *pgdat;
struct memory_tier *memtier;
pgdat = NODE_DATA(node);
if (!pgdat)
- return false;
+ return NULL;
/*
* Make sure that anybody looking at NODE_DATA who finds
@@ -593,14 +586,10 @@ static bool clear_node_memory_tier(int node)
synchronize_rcu();
memtype = node_memory_types[node].memtype;
node_clear(node, memtype->nodes);
- if (nodes_empty(memtype->nodes)) {
+ if (nodes_empty(memtype->nodes))
list_del_init(&memtype->tier_sibling);
- if (list_empty(&memtier->memory_types))
- destroy_memory_tier(memtier);
- }
- cleared = true;
}
- return cleared;
+ return memtier;
}
static void release_memtype(struct kref *kref)
@@ -873,6 +862,7 @@ static int __meminit memtier_hotplug_callback(struct notifier_block *self,
{
struct memory_tier *memtier;
struct memory_notify *arg = _arg;
+ bool empty = false;
/*
* Only update the node migration order when a node is
@@ -884,9 +874,16 @@ static int __meminit memtier_hotplug_callback(struct notifier_block *self,
switch (action) {
case MEM_OFFLINE:
mutex_lock(&memory_tier_lock);
- if (clear_node_memory_tier(arg->status_change_nid))
+ memtier = clear_node_memory_tier(arg->status_change_nid);
+ if (memtier) {
+ empty = list_empty(&memtier->memory_types);
+ if (empty)
+ list_del(&memtier->list);
establish_demotion_targets();
+ }
mutex_unlock(&memory_tier_lock);
+ if (empty)
+ device_unregister(&memtier->dev);
break;
case MEM_ONLINE:
mutex_lock(&memory_tier_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0029/1756] mm/vma: update VMA iterator state on error in new VMA merge
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0028/1756] mm/memory-tiers: unregister empty tiers outside memory_tier_lock Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0030/1756] f2fs: fix to fetch ino via ino_of_node() under cache lock Greg Kroah-Hartman
` (969 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Stoakes (ARM), Andrew Morton,
Li Jinyue, Liam R. Howlett, Vlastimil Babka, Jann Horn,
Pedro Falcato, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Stoakes (ARM) <ljs@kernel.org>
[ Upstream commit 168ed9c5d5ec2fd326715eba5750c2b69e559ff3 ]
Commit cacded5e42b9 ("mm: avoid using vma_merge() for new VMAs") shared
code between vma_merge_new_range() and vma_expand().
However in doing so, it failed to correctly restore the VMA iterator when
vma_expand() errors out.
This is a problem when the immediately preceding VMA is mergeable and
vmg->just_expand isn't specified, at which point the VMA iterator is moved
to the previous VMA.
(Note that vmg->just_expand is a special case for brk(), where the
iterator will already be positioned at the VMA to be expanded.)
Resolve things by restoring the VMA iterator on error. Use
vma_iter_next_range() to do this, so it will correctly stop on the gap
after the previous VMA, rather than skip to the next VMA after it (this is
a new VMA merge, so is being applied at a gap).
To isolate the error handling, return early when a merge isn't
possible (what the vmg->target check was doing before), then handle the
merge success/failure case explicitly.
While here, update vma_expand() to jump to the nomem case when
dup_anon_vma() fails, so vmg->state is correctly updated.
This doesn't impact anything in practice, but is the correct course and
since it's part of the error path that this patch addresses, it makes sense
to update it also.
Users are very unlikely to have observed the issue this patch addresses in
practice, as it is near-impossible to fail an allocation for an anon_vma,
but a process under memory pressure that receives a fatal signal could
trigger it.
This issue was originally reported by Li Jinyue for which I am grateful. He
indicated this was uncovered by a private syzkaller instance.
Link: https://lore.kernel.org/20261027-fix-new-merge-bug-v1-1-7023a787e6b9@kernel.org
Fixes: cacded5e42b9 ("mm: avoid using vma_merge() for new VMAs")
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Li Jinyue <jinyue.li@linux.alibaba.com>
Closes: https://lore.kernel.org/all/20261025093921.1011927-1-jinyue.li@linux.alibaba.com/
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: <stable@vger.kernel.org>
[ sashal: Retained merge descriptor cleanup on expansion failure because the caller reuses the descriptor for retries. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/vma.c | 44 +++++++++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/mm/vma.c b/mm/vma.c
index 85660d67b7942..6f165bf041031 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -931,6 +931,7 @@ struct vm_area_struct *vma_merge_new_range(struct vma_merge_struct *vmg)
pgoff_t pglen = PHYS_PFN(end - start);
bool can_merge_left, can_merge_right;
bool just_expand = vmg->merge_flags & VMG_FLAG_JUST_EXPAND;
+ bool move_iter_back = false;
mmap_assert_write_locked(vmg->mm);
VM_WARN_ON(vmg->vma);
@@ -968,33 +969,38 @@ struct vm_area_struct *vma_merge_new_range(struct vma_merge_struct *vmg)
vmg->end = end;
/* In expand-only case we are already positioned at prev. */
- if (!just_expand) {
- /* Equivalent to going to the previous range. */
- vma_prev(vmg->vmi);
- }
+ if (!just_expand)
+ move_iter_back = true;
}
+ if (!can_merge_left && !can_merge_right)
+ return NULL;
+
+ if (move_iter_back)
+ vma_prev(vmg->vmi);
+
/*
* Now try to expand adjacent VMA(s). This takes care of removing the
* following VMA if we have VMAs on both sides.
*/
- if (vmg->vma && !vma_expand(vmg)) {
- khugepaged_enter_vma(vmg->vma, vmg->flags);
- vmg->state = VMA_MERGE_SUCCESS;
- return vmg->vma;
- }
+ if (vma_expand(vmg)) {
+ /* Error occurred, restore iterator. */
+ if (move_iter_back)
+ vma_iter_next_range(vmg->vmi);
- /* If expansion failed, reset state. Allows us to retry merge later. */
- if (!just_expand) {
- vmg->vma = NULL;
- vmg->start = start;
- vmg->end = end;
- vmg->pgoff = pgoff;
- if (vmg->vma == prev)
- vma_iter_set(vmg->vmi, start);
+ /* If expansion failed, reset state. Allows us to retry merge later. */
+ if (!just_expand) {
+ vmg->vma = NULL;
+ vmg->start = start;
+ vmg->end = end;
+ vmg->pgoff = pgoff;
+ }
+ return NULL;
}
- return NULL;
+ khugepaged_enter_vma(vmg->vma, vmg->flags);
+ vmg->state = VMA_MERGE_SUCCESS;
+ return vmg->vma;
}
/*
@@ -1032,7 +1038,7 @@ int vma_expand(struct vma_merge_struct *vmg)
vma_start_write(next);
ret = dup_anon_vma(vma, next, &anon_dup);
if (ret)
- return ret;
+ goto nomem;
}
/* Not merging but overwriting any part of next is not handled. */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0030/1756] f2fs: fix to fetch ino via ino_of_node() under cache lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0029/1756] mm/vma: update VMA iterator state on error in new VMA merge Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0031/1756] mm/vma: fix expansion of VMA_MIXEDMAP_BIT VMAs Greg Kroah-Hartman
` (968 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Chao Yu, Jaegeuk Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <chao@kernel.org>
[ Upstream commit cd6d8b1891395b681f2060916a4b83880b765698 ]
In f2fs_writeback_node_caches(), it's better to fetch ino via ino_of_node()
under cache lock, otherwise, node cache content may become stale after cache
is unlocked due to racing w/ truncation.
Commit 493b9dc8b52c ("f2fs: cache: use node cache") fixes similar issue in
f2fs_flush_inline_data() introduced in commit 34c061ad85a2 ("f2fs: Avoid double
lock for cp_rwsem during checkpoint").
Cc: stable@kernel.org
Fixes: 2049d4fcb057 ("f2fs: avoid multiple node page writes due to inline_data")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[ sashal: adapted node cache access in f2fs_writeback_node_caches() to page access in f2fs_sync_node_pages() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/node.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 231a9281968e4..c5ea13cdb2e8e 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2100,9 +2100,11 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,
/* flush inline_data */
if (page_private_inline(page)) {
+ nid_t ino = ino_of_node(page);
+
clear_page_private_inline(page);
unlock_page(page);
- flush_inline_data(sbi, ino_of_node(page));
+ flush_inline_data(sbi, ino);
goto lock_node;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0031/1756] mm/vma: fix expansion of VMA_MIXEDMAP_BIT VMAs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0030/1756] f2fs: fix to fetch ino via ino_of_node() under cache lock Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0032/1756] drm/amdgpu: finish GPU recovery callbacks before restarting schedulers Greg Kroah-Hartman
` (967 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Stoakes (ARM), Andrew Morton,
Luiz Capitulino, Vlastimil Babka (SUSE), Pedro Falcato,
Liam R. Howlett, Jann Horn, Jakub Matěna, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Stoakes (ARM) <ljs@kernel.org>
[ Upstream commit 8146c6478224d8f6395c6b08a19c344a56d79867 ]
Commit ca3d76b0aa80 ("mm: add merging after mremap resize") combined
merging with expansion of mremap()'d VMAs, however it also unintentionally
disallowed the expansion of unmergeable VMAs.
Previously it was possible to expand a mixed mapping which mremap() had
already ensured was a legal expansion.
This is clearly seen in the mremap() logic, as it checks
vma_is_fixed_mapping() to determine legality of an expansion rather than
vma_can_merge().
Additionally, copy_vma() allows for a failed merge to result in a new VMA
being instantiated if MREMAP_MAYMOVE is specified.
However, this is not attempted, as a failure in vma_merge_extend() is
assumed to be an -ENOMEM failure.
Since vma_merge_extend() is used exclusively by mremap() to perform a merge
and/or expansion, resolve the issue by invoking vma_expand() for
unmergeable VMAs there.
Explicitly assert that the VMA is both non-fixed and a mixed mapping.
This provides double insurance against broken changes in future.
Note that khugepaged_enter_vma() (which vma_merge_new_range() runs) is
redundant in this case, as a mixed mapping is not subject to khugepaged.
Also update the VMA userland tests to add a required predicate.
Link: https://lore.kernel.org/20261023-vma-expansion-fix-v1-1-6142baf1f46b@kernel.org
Fixes: ca3d76b0aa80 ("mm: add merging after mremap resize")
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Luiz Capitulino <luizcap@redhat.com>
Closes: https://lore.kernel.org/all/20261023023106.515365-1-luizcap@redhat.com/
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Jann Horn <jannh@google.com>
Cc: Jakub Matěna <matenajakub@gmail.com>
Cc: <stable@vger.kernel.org>
[ sashal: Adapted VMA handling to use direct vm_flags checks and the existing vmg.vma merge-state field. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/vma.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/mm/vma.c b/mm/vma.c
index 6f165bf041031..6f50712eb9b6d 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -1550,12 +1550,28 @@ struct vm_area_struct *vma_merge_extend(struct vma_iterator *vmi,
struct vm_area_struct *vma,
unsigned long delta)
{
- VMG_VMA_STATE(vmg, vmi, vma, vma, vma->vm_end, vma->vm_end + delta);
+ const bool can_merge = !(vma->vm_flags & (VM_PFNMAP | VM_DONTEXPAND |
+ VM_MIXEDMAP)) &&
+ !is_vm_hugetlb_page(vma);
+ const unsigned long start =
+ can_merge ? vma->vm_end : vma->vm_start;
+ VMG_VMA_STATE(vmg, vmi, vma, vma, start, vma->vm_end + delta);
- vmg.next = vma_iter_next_rewind(vmi, NULL);
vmg.vma = NULL; /* We use the VMA to populate VMG fields only. */
- return vma_merge_new_range(&vmg);
+ if (can_merge) {
+ vmg.next = vma_iter_next_rewind(vmi, NULL);
+ return vma_merge_new_range(&vmg);
+ }
+
+ /* Mixed mappings are permitted to be expanded, not merged. */
+ VM_WARN_ON_ONCE(vma->vm_flags & (VM_PFNMAP | VM_DONTEXPAND));
+ VM_WARN_ON_ONCE(!(vma->vm_flags & VM_MIXEDMAP));
+ vma_prev(vmi); /* Reposition to start of VMA. */
+ vmg.vma = vma;
+ if (vma_expand(&vmg))
+ return NULL;
+ return vma;
}
void unlink_file_vma_batch_init(struct unlink_vma_file_batch *vb)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0032/1756] drm/amdgpu: finish GPU recovery callbacks before restarting schedulers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0031/1756] mm/vma: fix expansion of VMA_MIXEDMAP_BIT VMAs Greg Kroah-Hartman
@ 2026-11-18 14:35 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0033/1756] drm/amdgpu: drop the gang leader reference when freeing gang jobs Greg Kroah-Hartman
` (966 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Prike Liang, Lijo Lazar,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prike Liang <Prike.Liang@amd.com>
[ Upstream commit 733389cb31e2c55e355410759fdc68afe74a4582 ]
Run GPU post-reset callbacks, including KFD and display-audio resume,
before restarting DRM scheduler workqueues. IP hardware initialization
already happens inside ASIC recovery; this change orders the remaining
callbacks before new scheduler submissions. Preserve the emergency-stop
and guity job completition path's callbacks without starting schedulers,
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1f6433e2b264e75c56ae95f187788806201bdbc3)
Cc: stable@vger.kernel.org
[ sashal: adapted resume helper reordering to existing inline code in amdgpu_device_gpu_recover() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 48 +++++++++++-----------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 037cb9ce69e42..798e82769e789 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -6030,7 +6030,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
}
if (need_emergency_restart)
- goto skip_sched_resume;
+ goto post_resume;
/*
* Must check guilty signal here since after this point all old
@@ -6041,7 +6041,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
if (job && dma_fence_is_signaled(&job->hw_fence.base)) {
job_signaled = true;
dev_info(adev->dev, "Guilty job already signaled, skipping HW reset");
- goto skip_hw_reset;
+ goto post_resume;
}
retry: /* Rest of adevs pre asic reset from XGMI hive. */
@@ -6087,7 +6087,28 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
amdgpu_device_stop_pending_resets(tmp_adev);
}
-skip_hw_reset:
+post_resume:
+ list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
+ /* unlock kfd: SRIOV would do it separately */
+ if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev))
+ amdgpu_amdkfd_post_reset(tmp_adev);
+
+ /* kfd_post_reset will do nothing if kfd device is not initialized,
+ * need to bring up kfd here if it's not be initialized before
+ */
+ if (!adev->kfd.init_complete)
+ amdgpu_amdkfd_device_init(adev);
+
+ if (audio_suspended)
+ amdgpu_device_resume_display_audio(tmp_adev);
+
+ amdgpu_device_unset_mp1_state(tmp_adev);
+
+ amdgpu_ras_set_error_query_ready(tmp_adev, true);
+ }
+
+ if (need_emergency_restart)
+ goto reset_unlock;
/* Post ASIC reset for all devs .*/
list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
@@ -6126,26 +6147,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
}
}
-skip_sched_resume:
- list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
- /* unlock kfd: SRIOV would do it separately */
- if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev))
- amdgpu_amdkfd_post_reset(tmp_adev);
-
- /* kfd_post_reset will do nothing if kfd device is not initialized,
- * need to bring up kfd here if it's not be initialized before
- */
- if (!adev->kfd.init_complete)
- amdgpu_amdkfd_device_init(adev);
-
- if (audio_suspended)
- amdgpu_device_resume_display_audio(tmp_adev);
-
- amdgpu_device_unset_mp1_state(tmp_adev);
-
- amdgpu_ras_set_error_query_ready(tmp_adev, true);
- }
-
+reset_unlock:
tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device,
reset_list);
amdgpu_device_unlock_reset_domain(tmp_adev->reset_domain);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0033/1756] drm/amdgpu: drop the gang leader reference when freeing gang jobs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-11-18 14:35 ` [PATCH 6.12 0032/1756] drm/amdgpu: finish GPU recovery callbacks before restarting schedulers Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0034/1756] apparmor: fix profile leak when a policy load fails Greg Kroah-Hartman
` (965 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian König, Jesse Zhang,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
[ Upstream commit c1584e10a7deb655438f21867b2b7a356a9aaf9f ]
Every job of a gang except the leader holds a reference to the
scheduled fence of the leader in job->gang_submit. Only
amdgpu_job_free(), used for jobs which never ran, drops it, so for every
gang submission which completes the scheduler fence of the leader, and
with it its hardware fence, is leaked. amdgpu_job_free() in turn checks
for the leader only after drm_sched_job_cleanup() cleared the scheduler
fence, so a leader freed there drops a reference it never took.
On navi31, 100 submissions of a GFX + COMPUTE gang grow the slab cache
drm_sched_fence is merged into by 60 to 180 objects each time, while
100 GFX only submissions don't.
Use amdgpu_job_free() for the jobs the scheduler frees too, and check
for the gang leader there before drm_sched_job_cleanup() clears the
scheduler fence. As the scheduler clears the entity of the jobs it
picked up, check for the scheduler fence instead to tell whether the job
needs cleaning up.
Keep freeing the remaining IBs with amdgpu_job_free_resources() after
drm_sched_job_cleanup(), so that it frees them with the hardware fence or
right away and not with the scheduler fence, which nobody signals for
jobs aborted after drm_sched_job_arm(), like a CS returning -EAGAIN.
v2: unify amdgpu_job_free() and amdgpu_job_free_cb() (Christian), don't
free the remaining IBs with the scheduler fence
v3: drop the comments (Christian)
v4: free the IBs with amdgpu_job_free_resources() again (Christian)
Fixes: 68ce8b242242 ("drm/amdgpu: add gang submit backend v2")
Fixes: f7d66fb2ea43 ("drm/amdgpu: cleanup scheduler job initialization v2")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit df4d6d404d44bbc8fc850bc7f9f136a25dabf180)
Cc: stable@vger.kernel.org
[ sashal: adjusted cleanup context for an embedded hw_fence instead of separately allocated hardware and VM fences ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 0abc38bb242ca..348a38ee36bb4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -274,17 +274,7 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
static void amdgpu_job_free_cb(struct drm_sched_job *s_job)
{
- struct amdgpu_job *job = to_amdgpu_job(s_job);
-
- drm_sched_job_cleanup(s_job);
-
- amdgpu_sync_free(&job->explicit_sync);
-
- /* only put the hw fence if has embedded fence */
- if (!job->hw_fence.base.ops)
- kfree(job);
- else
- dma_fence_put(&job->hw_fence.base);
+ amdgpu_job_free(to_amdgpu_job(s_job));
}
void amdgpu_job_set_gang_leader(struct amdgpu_job *job,
@@ -305,13 +295,14 @@ void amdgpu_job_set_gang_leader(struct amdgpu_job *job,
void amdgpu_job_free(struct amdgpu_job *job)
{
- if (job->base.entity)
+ if (job->gang_submit != &job->base.s_fence->scheduled)
+ dma_fence_put(job->gang_submit);
+
+ if (job->base.s_fence)
drm_sched_job_cleanup(&job->base);
amdgpu_job_free_resources(job);
amdgpu_sync_free(&job->explicit_sync);
- if (job->gang_submit != &job->base.s_fence->scheduled)
- dma_fence_put(job->gang_submit);
if (!job->hw_fence.base.ops)
kfree(job);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0034/1756] apparmor: fix profile leak when a policy load fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0033/1756] drm/amdgpu: drop the gang leader reference when freeing gang jobs Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0035/1756] mm/ksm: mark migration stores with WRITE_ONCE() Greg Kroah-Hartman
` (964 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Georgia Garcia, John Johansen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georgia Garcia <georgia.garcia@canonical.com>
[ Upstream commit ce94927fa4173fcc1eca27bdc65a140064c8f1e6 ]
The error paths of aa_replace_profiles() and aa_unpack() do not break
the refcount cycle between label and proxy. They just aa_put_profile()
the new profiles, which drops the label refcount from 2 to 1, and the
proxy keeps the profile alive. Every failed atomic policy load
(e.g. "profile can not be replaced", or a later profile in the blob
failing to unpack) leaks every new profile in the set, along with its
proxy, rules and its loaddata reference.
The leak is usually not visible from userspace, because the raw_data
directory for a failed load is not created, but it becomes visible
when the blob is deduplicated onto an existing loaddata, which then
keeps its policy/raw_data/<rev> directory forever.
Add aa_put_unpublished_profile(), which drops the profile's own proxy
before putting the profile, and use it on those error paths. The
proxy of an unpacked profile is always freshly allocated and not
referenced by anything else before the profile is published, so
putting it is safe.
Fixes: 637f688dc3dc ("apparmor: switch from profiles to using labels on contexts")
Cc: stable@vger.kernel.org
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ sashal: Adjusted helper insertion context to retain the existing non-const AUDIT_MODE() parameter. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/include/policy.h | 20 ++++++++++++++++++++
security/apparmor/policy.c | 3 +++
security/apparmor/policy_unpack.c | 4 +++-
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/security/apparmor/include/policy.h b/security/apparmor/include/policy.h
index e85824c90f430..47199bead884b 100644
--- a/security/apparmor/include/policy.h
+++ b/security/apparmor/include/policy.h
@@ -382,6 +382,26 @@ static inline void aa_put_profile(struct aa_profile *p)
kref_put(&p->label.count.count, aa_label_kref);
}
+/**
+ * aa_put_unpublished_profile - put a profile that was never made visible
+ * @p: profile (MAYBE NULL)
+ *
+ * A newly allocated profile and its proxy reference each other
+ * (proxy->label holds a label refcount). That cycle is normally broken
+ * when the profile is replaced or removed, which redirects the proxy.
+ * A profile that is discarded before being added to the policy tree
+ * never goes through either path, so break the cycle here, otherwise
+ * the profile, its proxy and its rawdata are leaked.
+ */
+static inline void aa_put_unpublished_profile(struct aa_profile *p)
+{
+ if (p && p->label.proxy) {
+ aa_put_proxy(p->label.proxy);
+ p->label.proxy = NULL;
+ }
+ aa_put_profile(p);
+}
+
static inline int AUDIT_MODE(struct aa_profile *profile)
{
if (aa_g_audit != AUDIT_NORMAL)
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index c9ffb1eec7a7c..62345fad007c3 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -1403,6 +1403,9 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
}
list_for_each_entry_safe(ent, tmp, &lh, list) {
list_del_init(&ent->list);
+ /* new was never added to the policy tree */
+ aa_put_unpublished_profile(ent->new);
+ ent->new = NULL;
aa_load_ent_free(ent);
}
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 61d7ef232f320..0928c064ee9f9 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -1512,11 +1512,13 @@ int aa_unpack(struct aa_loaddata *udata, struct list_head *lh,
fail_profile:
kfree(ns_name);
- aa_put_profile(profile);
+ aa_put_unpublished_profile(profile);
fail:
list_for_each_entry_safe(ent, tmp, lh, list) {
list_del_init(&ent->list);
+ aa_put_unpublished_profile(ent->new);
+ ent->new = NULL;
aa_load_ent_free(ent);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0035/1756] mm/ksm: mark migration stores with WRITE_ONCE()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0034/1756] apparmor: fix profile leak when a policy load fails Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0036/1756] platform/x86: hp-wmi: Order DMI board name arrays Greg Kroah-Hartman
` (963 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Andrew Morton, Xu Xin,
David Hildenbrand (Arm), Hugh Dickins, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
[ Upstream commit d3863210464f69c18615cbe400d48a6e53e770d4 ]
ksm_get_folio() deliberately samples stable_node->kpfn and folio->mapping
without taking the folio lock because the KSM folio may be migrated
concurrently. folio_migrate_ksm() updates the same state using plain
assignments.
The reader can load the old kpfn, then the migrator can store the new
kpfn, execute smp_wmb(), and clear the old folio's mapping before the
reader checks that mapping. Thus the initial kpfn load can overlap its
update and the subsequent mapping load can overlap the clear, with no
common lock. This leaves marked READ_ONCE() accesses racing with plain
stores.
The kernel reported:
BUG: KCSAN: data-race in folio_migrate_ksm / ksm_get_folio
read (marked) to 0xffff8ce401421330 of 8 bytes by task 48 on cpu 3:
ksm_get_folio+0x7f/0x2a0
ksm_scan_thread+0x1635/0x3330
kthread+0x1af/0x1f0
write to 0xffff8ce401421330 of 8 bytes by task 102 on cpu 1:
folio_migrate_ksm+0x6a/0xd0
folio_migrate_flags+0x193/0x420
__migrate_folio.isra.0+0x162/0x1a0
migrate_folio+0x4c/0x70
move_to_new_folio+0xd6/0x170
Use WRITE_ONCE() for both stores to pair them with the existing lockless
reads. This preserves the existing smp_wmb()/smp_rmb() migration protocol
and control flow while preventing compiler transformations of the shared
accesses.
Link: https://lore.kernel.org/20260824112433.191301-1-nicoyip.dev@gmail.com
Fixes: c8d6553b9580 ("ksm: make KSM page migration possible")
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Xu Xin <xu.xin16@zte.com.cn>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: <stable@vger.kernel.org>
[ sashal: Replaced FOLIO_MAPPING_KSM with the equivalent PAGE_MAPPING_KSM flag. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/ksm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/ksm.c b/mm/ksm.c
index e64a0dbcad5dd..9a98aa97317a4 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1067,7 +1067,8 @@ static inline void folio_set_stable_node(struct folio *folio,
struct ksm_stable_node *stable_node)
{
VM_WARN_ON_FOLIO(folio_test_anon(folio) && PageAnonExclusive(&folio->page), folio);
- folio->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM);
+ WRITE_ONCE(folio->mapping,
+ (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM));
}
#ifdef CONFIG_SYSFS
@@ -3258,7 +3259,7 @@ void folio_migrate_ksm(struct folio *newfolio, struct folio *folio)
stable_node = folio_stable_node(folio);
if (stable_node) {
VM_BUG_ON_FOLIO(stable_node->kpfn != folio_pfn(folio), folio);
- stable_node->kpfn = folio_pfn(newfolio);
+ WRITE_ONCE(stable_node->kpfn, folio_pfn(newfolio));
/*
* newfolio->mapping was set in advance; now we need smp_wmb()
* to make sure that the new stable_node->kpfn is visible
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0036/1756] platform/x86: hp-wmi: Order DMI board name arrays
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0035/1756] mm/ksm: mark migration stores with WRITE_ONCE() Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0037/1756] platform/x86: hp-wmi: Add OMEN board 8A17 thermal profile support Greg Kroah-Hartman
` (962 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit 68779adbabdbb1891ba4d9b8c7d3be99ed5e0b3d ]
The hp-wmi driver has a number of arrays that are getting new entries
and all/most entries have been added to the end of the array. As a
result, the numerical order is mixed up in a few entries.
Reorder the array entries. Split lines for each two leading chars to
make the arrays easier to read.
Add also trailing commas.
Link: https://patch.msgid.link/20251128120215.4450-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Stable-dep-of: d35a1ea827a2 ("platform/x86: hp-wmi: Add OMEN board 8A17 thermal profile support")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/hp/hp-wmi.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 02227a4392907..d189da2205609 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -59,12 +59,16 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45E9-BE91-3D44E2C707E4");
* contains "PerformanceControl".
*/
static const char * const omen_thermal_profile_boards[] = {
- "84DA", "84DB", "84DC", "8574", "8575", "860A", "87B5", "8572", "8573",
- "8600", "8601", "8602", "8605", "8606", "8607", "8746", "8747", "8749",
- "874A", "8603", "8604", "8748", "886B", "886C", "878A", "878B", "878C",
- "88C8", "88CB", "8786", "8787", "8788", "88D1", "88D2", "88F4", "88FD",
- "88F5", "88F6", "88F7", "88FE", "88FF", "8900", "8901", "8902", "8912",
- "8917", "8918", "8949", "894A", "89EB", "8BAD", "8A42", "8A15"
+ "84DA", "84DB", "84DC",
+ "8572", "8573", "8574", "8575",
+ "8600", "8601", "8602", "8603", "8604", "8605", "8606", "8607", "860A",
+ "8746", "8747", "8748", "8749", "874A", "8786", "8787", "8788", "878A",
+ "878B", "878C", "87B5",
+ "886B", "886C", "88C8", "88CB", "88D1", "88D2", "88F4", "88F5", "88F6",
+ "88F7", "88FD", "88FE", "88FF",
+ "8900", "8901", "8902", "8912", "8917", "8918", "8949", "894A", "89EB",
+ "8A15", "8A42",
+ "8BAD",
};
/* DMI Board names of Omen laptops that are specifically set to be thermal
@@ -72,7 +76,8 @@ static const char * const omen_thermal_profile_boards[] = {
* the get system design information WMI call returns
*/
static const char * const omen_thermal_profile_force_v0_boards[] = {
- "8607", "8746", "8747", "8749", "874A", "8748"
+ "8607",
+ "8746", "8747", "8748", "8749", "874A",
};
/* DMI board names of Omen laptops that have a thermal profile timer which will
@@ -80,12 +85,13 @@ static const char * const omen_thermal_profile_force_v0_boards[] = {
* "balanced" when reaching zero.
*/
static const char * const omen_timed_thermal_profile_boards[] = {
- "8BAD", "8A42", "8A15"
+ "8A15", "8A42",
+ "8BAD",
};
/* DMI Board names of Victus laptops */
static const char * const victus_thermal_profile_boards[] = {
- "8A25"
+ "8A25",
};
enum hp_wmi_radio {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0037/1756] platform/x86: hp-wmi: Add OMEN board 8A17 thermal profile support
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0036/1756] platform/x86: hp-wmi: Order DMI board name arrays Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0038/1756] inet: frags: bound the wmem charge of the socket completing a reassembly Greg Kroah-Hartman
` (961 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ciro Pedrini, Ilpo Järvinen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ciro Pedrini <ciro.pedrini@gmail.com>
[ Upstream commit d35a1ea827a2efaea7fb059ffafefae7c13b9556 ]
The HP OMEN 17-ck1xxx (board 8A17) isn't in omen_thermal_profile_boards,
so hp-wmi uses the generic thermal profile query. The firmware only
stores that value and never acts on it, so the EC stays in its default
mode and the CPU is held at 45 W whatever profile is selected.
The board uses the OMEN interface (mode byte at EC 0x95, thermal policy
v1) and also needs the timed profile quirk: without it, the EC drops
back to the default mode about two minutes after each profile change.
Add 8A17 to omen_thermal_profile_boards and
omen_timed_thermal_profile_boards.
With this, all three profiles work and sustained package power under
load goes from 45 W to 56-79 W.
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ciro Pedrini <ciro.pedrini@gmail.com>
Link: https://patch.msgid.link/20260925205226.883724-1-ciro.pedrini@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ sashal: Adjusted context to match the shorter omen_thermal_profile_boards array. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/hp/hp-wmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index d189da2205609..e20f1ba937c09 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -67,7 +67,7 @@ static const char * const omen_thermal_profile_boards[] = {
"886B", "886C", "88C8", "88CB", "88D1", "88D2", "88F4", "88F5", "88F6",
"88F7", "88FD", "88FE", "88FF",
"8900", "8901", "8902", "8912", "8917", "8918", "8949", "894A", "89EB",
- "8A15", "8A42",
+ "8A15", "8A17", "8A42",
"8BAD",
};
@@ -85,7 +85,7 @@ static const char * const omen_thermal_profile_force_v0_boards[] = {
* "balanced" when reaching zero.
*/
static const char * const omen_timed_thermal_profile_boards[] = {
- "8A15", "8A42",
+ "8A15", "8A17", "8A42",
"8BAD",
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0038/1756] inet: frags: bound the wmem charge of the socket completing a reassembly
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0037/1756] platform/x86: hp-wmi: Add OMEN board 8A17 thermal profile support Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0039/1756] io_uring/eventfd: reset deferred signal state Greg Kroah-Hartman
` (960 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paolo Abeni, Eric Dumazet,
Ido Schimmel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit b71c101bbb9814d163c00234d43c41f0a17907d4 ]
When a socket owned fragment completes a reassembly queue,
inet_frag_reasm_prepare() and inet_frag_reasm_finish() charge the
truesize of all other fragments to its sk_wmem_alloc. These fragments
were orphaned when queued, and might have been sent by someone else,
for instance padded TUN packets.
Commit 3ae20e4697eb ("inet: frags: limit the truesize of a reassembly
queue") bounds this charge to INT_MAX / 2 per queue, but a socket can
complete several queues while the reassembled skbs are still alive,
for instance held in a qdisc. sk_wmem_alloc can then go past INT_MAX,
refcount_add() saturates it with a WARN, and the socket is leaked.
This is reachable from an unprivileged user/network namespace, by
raising ipfrag_high_thresh.
Refuse the reassembly if the charge would push sk_wmem_alloc above
2 * sk_sndbuf, the bound ip_append_data() uses, plus 4MB of slack for
fragments inflated by a refragmentation with a small MTU, and never
above INT_MAX / 2. The cap matters for tun sockets, which use
sk_sndbuf = INT_MAX, and whose skbs are still owned when act_ct or
openvswitch reassemble them at ingress.
Several queues can complete at the same time on different cpus for
the same socket, so the charge is reserved with a cmpxchg() loop in
inet_frag_reasm_prepare(), before it modifies the queue, and settled
in inet_frag_reasm_finish(). Move the size checks of ip_frag_reasm(),
ip6_frag_reasm() and nf_ct_frag6_reasm() before
inet_frag_reasm_prepare(), using the first fragment which becomes the
head, so that a successful inet_frag_reasm_prepare() is always followed
by inet_frag_reasm_finish(). All callers already kill the queue when
inet_frag_reasm_prepare() returns NULL.
Found by code inspection (AI review), not reproduced.
Fixes: 18685451fc4e ("inet: inet_defrag: prevent sk release while still in use")
Reported-by: Paolo Abeni <pabeni@redhat.com>
Closes: https://lore.kernel.org/netdev/24feda7d-ae49-45af-9596-2cc5f149f28e@redhat.com/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20261104122927.1033747-1-edumazet@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/inet_fragment.c | 61 ++++++++++++++++++++++---
net/ipv4/ip_fragment.c | 13 ++++--
net/ipv6/netfilter/nf_conntrack_reasm.c | 13 ++++--
net/ipv6/reassembly.c | 13 ++++--
4 files changed, 78 insertions(+), 22 deletions(-)
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index 0224440720e12..8ecd70b4f20fc 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -17,6 +17,7 @@
#include <linux/rtnetlink.h>
#include <linux/slab.h>
#include <linux/rhashtable.h>
+#include <linux/sizes.h>
#include <net/sock.h>
#include <net/inet_frag.h>
@@ -512,6 +513,43 @@ int inet_frag_queue_insert(struct inet_frag_queue *q, struct sk_buff *skb,
}
EXPORT_SYMBOL(inet_frag_queue_insert);
+/* When a socket owned fragment completes a queue, the truesize of all
+ * other fragments is charged to its sk_wmem_alloc, although they were
+ * orphaned when queued and possibly sent by someone else.
+ * Bound this like ip_append_data() bounds the memory a socket can
+ * allocate (2 * sk_sndbuf), plus slack for fragments inflated by a
+ * refragmentation using a small MTU. Otherwise, several reassembled skbs
+ * alive at the same time can saturate sk_wmem_alloc, and leak the socket.
+ *
+ * Several queues can complete at the same time for the same socket,
+ * and some sockets (tun) use sk_sndbuf = INT_MAX. The charge is reserved
+ * with a cmpxchg() loop, a refcount_t has no helper for this.
+ */
+#define INET_FRAG_WMEM_SLACK SZ_4M
+
+static bool inet_frag_wmem_reserve(struct sock *sk, unsigned int charge)
+{
+ u64 limit = 2ULL * READ_ONCE(sk->sk_sndbuf) + INET_FRAG_WMEM_SLACK;
+ int old = refcount_read(&sk->sk_wmem_alloc);
+
+ limit = min_t(u64, limit, INET_FRAG_MAX_TRUESIZE);
+ do {
+ if (old <= 0 || (u64)old + charge > limit)
+ return false;
+ } while (!atomic_try_cmpxchg(&sk->sk_wmem_alloc.refs, &old,
+ old + charge));
+
+ return true;
+}
+
+static void inet_frag_wmem_adjust(struct sock *sk, int delta)
+{
+ if (delta >= 0)
+ refcount_add(delta, &sk->sk_wmem_alloc);
+ else
+ WARN_ON_ONCE(refcount_sub_and_test(-delta, &sk->sk_wmem_alloc));
+}
+
void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb,
struct sk_buff *parent)
{
@@ -523,6 +561,11 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb,
int delta;
if (sk && is_skb_wmem(skb)) {
+ /* skb->truesize is already charged to sk, and is part of
+ * q->truesize. inet_frag_reasm_finish() settles the charge.
+ */
+ if (!inet_frag_wmem_reserve(sk, q->truesize - skb->truesize))
+ return NULL;
/* TX: skb->sk might have been passed as argument to
* dst->output and must remain valid until tx completes.
*
@@ -600,17 +643,18 @@ void *inet_frag_reasm_prepare(struct inet_frag_queue *q, struct sk_buff *skb,
out_restore_sk:
if (orig_truesize) {
- int ts_delta = head->truesize - orig_truesize;
-
/* if this reassembled skb is fragmented later,
* fraglist skbs will get skb->sk assigned from head->sk,
* and each frag skb will be released via sock_wfree.
- *
- * Update sk_wmem_alloc.
*/
head->sk = sk;
head->destructor = destructor;
- refcount_add(ts_delta, &sk->sk_wmem_alloc);
+ /* On failure, head stays in the queue and will be freed
+ * with the queue: only charge its truesize.
+ */
+ if (!nextp)
+ inet_frag_wmem_adjust(sk, (int)head->truesize -
+ (int)q->truesize);
}
return nextp;
@@ -621,7 +665,6 @@ void inet_frag_reasm_finish(struct inet_frag_queue *q, struct sk_buff *head,
void *reasm_data, bool try_coalesce)
{
struct sock *sk = is_skb_wmem(head) ? head->sk : NULL;
- const unsigned int head_truesize = head->truesize;
struct sk_buff **nextp = reasm_data;
struct rb_node *rbn;
struct sk_buff *fp;
@@ -686,8 +729,12 @@ void inet_frag_reasm_finish(struct inet_frag_queue *q, struct sk_buff *head,
head->tstamp = q->stamp;
head->tstamp_type = q->tstamp_type;
+ /* After inet_frag_reasm_prepare(), q->truesize is charged to sk.
+ * sum_truesize also includes what it added (skb_unclone() and
+ * frag_list clone).
+ */
if (sk)
- refcount_add(sum_truesize - head_truesize, &sk->sk_wmem_alloc);
+ inet_frag_wmem_adjust(sk, sum_truesize - (int)q->truesize);
}
EXPORT_SYMBOL(inet_frag_reasm_finish);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 9cc55a0c64f7d..1fd7017300b3b 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -413,16 +413,19 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,
goto out_fail;
}
+ /* Check the size on the first fragment, which will become the head:
+ * inet_frag_reasm_finish() must follow inet_frag_reasm_prepare().
+ */
+ len = ip_hdrlen(skb_rb_first(&qp->q.rb_fragments)) + qp->q.len;
+ err = -E2BIG;
+ if (len > 65535)
+ goto out_oversize;
+
/* Make the one we just received the head. */
reasm_data = inet_frag_reasm_prepare(&qp->q, skb, prev_tail);
if (!reasm_data)
goto out_nomem;
- len = ip_hdrlen(skb) + qp->q.len;
- err = -E2BIG;
- if (len > 65535)
- goto out_oversize;
-
inet_frag_reasm_finish(&qp->q, skb, reasm_data,
ip_frag_coalesce_ok(qp));
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 60e8927329dde..8ccc0463bc21b 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -330,11 +330,10 @@ static int nf_ct_frag6_reasm(struct frag_queue *fq, struct sk_buff *skb,
if (unlikely(ecn == 0xff))
goto err;
- reasm_data = inet_frag_reasm_prepare(&fq->q, skb, prev_tail);
- if (!reasm_data)
- goto err;
-
- payload_len = -skb_network_offset(skb) -
+ /* Check the size on the first fragment, which will become the head:
+ * inet_frag_reasm_finish() must follow inet_frag_reasm_prepare().
+ */
+ payload_len = -skb_network_offset(skb_rb_first(&fq->q.rb_fragments)) -
sizeof(struct ipv6hdr) + fq->q.len -
sizeof(struct frag_hdr);
if (payload_len > IPV6_MAXPLEN) {
@@ -343,6 +342,10 @@ static int nf_ct_frag6_reasm(struct frag_queue *fq, struct sk_buff *skb,
goto err;
}
+ reasm_data = inet_frag_reasm_prepare(&fq->q, skb, prev_tail);
+ if (!reasm_data)
+ goto err;
+
/* We have to remove fragment header from datagram and to relocate
* header in order to calculate ICV correctly. */
skb_network_header(skb)[fq->nhoffset] = skb_transport_header(skb)[0];
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 29e15ff9d7c1e..34031424c9789 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -271,16 +271,19 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *skb,
if (unlikely(ecn == 0xff))
goto out_fail;
- reasm_data = inet_frag_reasm_prepare(&fq->q, skb, prev_tail);
- if (!reasm_data)
- goto out_oom;
-
- payload_len = -skb_network_offset(skb) -
+ /* Check the size on the first fragment, which will become the head:
+ * inet_frag_reasm_finish() must follow inet_frag_reasm_prepare().
+ */
+ payload_len = -skb_network_offset(skb_rb_first(&fq->q.rb_fragments)) -
sizeof(struct ipv6hdr) + fq->q.len -
sizeof(struct frag_hdr);
if (payload_len > IPV6_MAXPLEN)
goto out_oversize;
+ reasm_data = inet_frag_reasm_prepare(&fq->q, skb, prev_tail);
+ if (!reasm_data)
+ goto out_oom;
+
/* We have to remove fragment header from datagram and to relocate
* header in order to calculate ICV correctly. */
nhoff = fq->nhoffset;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0039/1756] io_uring/eventfd: reset deferred signal state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0038/1756] inet: frags: bound the wmem charge of the socket completing a reassembly Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0040/1756] alpha: select SYSCTL_EXCEPTION_TRACE Greg Kroah-Hartman
` (959 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yufan Chen, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yufan Chen <ericterminal@gmail.com>
[ Upstream commit 04fe9aeb4f3c0999e6715385664c677469dfd8f4 ]
Recursive eventfd wakeups must defer io_uring eventfd signaling because
eventfd_signal_mask() rejects reentry from eventfd wakeup handlers. The
io_ev_fd ops bit tracks an outstanding deferred signal so that the same
rcu_head is not queued twice.
That bit is only set today. Once the first deferred callback runs, later
recursive notifications still see the bit set and skip queueing another
deferred signal. This can leave new completions without a matching
eventfd wake after the first recursive deferral.
Clear the pending bit before issuing the deferred signal. If the wakeup
path recurses while the callback runs, a new signal can be queued for
the next RCU grace period while the current callback keeps its reference
until it returns.
Signed-off-by: Yufan Chen <ericterminal@gmail.com>
Fixes: 60b6c075e8eb ("io_uring/eventfd: move to more idiomatic RCU free usage")
Link: https://patch.msgid.link/20260503175710.37209-1-yufan.chen@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/eventfd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/io_uring/eventfd.c b/io_uring/eventfd.c
index 6a6ec9d4d6402..1859abc536487 100644
--- a/io_uring/eventfd.c
+++ b/io_uring/eventfd.c
@@ -35,6 +35,7 @@ static void io_eventfd_do_signal(struct rcu_head *rcu)
{
struct io_ev_fd *ev_fd = container_of(rcu, struct io_ev_fd, rcu);
+ atomic_andnot(BIT(IO_EVENTFD_OP_SIGNAL_BIT), &ev_fd->ops);
eventfd_signal_mask(ev_fd->cq_ev_fd, EPOLL_URING_WAKE);
if (refcount_dec_and_test(&ev_fd->refs))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0040/1756] alpha: select SYSCTL_EXCEPTION_TRACE
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0039/1756] io_uring/eventfd: reset deferred signal state Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0041/1756] can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices Greg Kroah-Hartman
` (958 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matt Turner, Magnus Lindholm,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Turner <mattst88@gmail.com>
[ Upstream commit e517a172b77601839e1c52ac4303602e285804bb ]
Report unhandled user faults the way other architectures do, and hook up
the debug.exception-trace sysctl that controls the reporting.
The message gives the faulting address, the PC and the user stack
pointer, and is rate limited.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Matt Turner <mattst88@gmail.com>
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Reviewed-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://lore.kernel.org/r/20260905-arch-kconfig-options-v2-v2-17-83e8245761a2@gmail.com
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/alpha/Kconfig | 1 +
arch/alpha/mm/fault.c | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 109a4cddcd138..33adbcce536a5 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -38,6 +38,7 @@ config ALPHA
select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
select MMU_GATHER_NO_RANGE
select SPARSEMEM_EXTREME if SPARSEMEM
+ select SYSCTL_EXCEPTION_TRACE
select ZONE_DMA
help
The Alpha is a 64-bit general-purpose processor designed and
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index 53e170e965915..63a24afa7a155 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -28,8 +28,32 @@
#include <linux/uaccess.h>
#include <linux/perf_event.h>
+#include <asm/pal.h>
+
extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
+int show_unhandled_signals = 1;
+
+static void
+show_signal_msg(struct pt_regs *regs, unsigned long address, int signo,
+ const char *desc)
+{
+ const char *level;
+
+ if (!show_unhandled_signals || !unhandled_signal(current, signo))
+ return;
+ if (!printk_ratelimit())
+ return;
+
+ /* Losing init is fatal, so shout about it. */
+ level = task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG;
+
+ printk("%s%s[%d]: %s at %016lx pc %016lx sp %016lx\n",
+ level, current->comm, task_pid_nr(current), desc,
+ address, regs->pc, rdusp());
+ print_vma_addr(KERN_CONT " in ", regs->pc);
+ printk(KERN_CONT "\n");
+}
/*
* Force a new ASN for a task.
@@ -223,6 +247,8 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
mmap_read_unlock(mm);
/* Send a sigbus, regardless of whether we were in kernel
or user mode. */
+ if (user_mode(regs))
+ show_signal_msg(regs, address, SIGBUS, "bus error");
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *) address);
if (!user_mode(regs))
goto no_context;
@@ -244,6 +270,9 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
return;
do_sigsegv:
+ show_signal_msg(regs, address, SIGSEGV,
+ si_code == SEGV_MAPERR ? "unmapped access"
+ : "access violation");
force_sig_fault(SIGSEGV, si_code, (void __user *) address);
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0041/1756] can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0040/1756] alpha: select SYSCTL_EXCEPTION_TRACE Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0042/1756] ALSA: pcm: Optimize cpu_latency_qos_*() calls Greg Kroah-Hartman
` (957 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vincent Mailhol, stable,
Marc Kleine-Budde, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Mailhol <mailhol@kernel.org>
[ Upstream commit 0fce44e29fce4b07642491b098afb41bd571e4f2 ]
Sending a PF_PACKET bypasses the CAN framework logic and can directly
reach a CAN driver's xmit() function. The PF_PACKET framework only
checks that skb->len does not exceed the net_device MTU.
For a CAN device that is not CAN XL capable, anything above CANFD_MTU
(72 bytes) is therefore dropped before it reaches the driver. However,
CAN XL frames are variable length. can_is_canxl_skb() accepts lengths in
the range CANXL_HDR_SIZE + CANXL_MIN_DLEN up to CANXL_MTU, i.e. 13 to
2060 bytes.
As a result, an ETH_P_CANXL skb with a length between 13 and 72 bytes
can pass both the MTU and the can_dropped_invalid_skb() checks.
A driver that does not support CAN XL will interpret canxl_frame->flags
as a length because of the overlap with can_frame->len. And because
CANXL_XLF is set, the resulting length is between 128 and 255. For
drivers that do not check can_frame->len before copying can_frame->data,
as most drivers do, this results in a buffer overflow of up to 247
bytes.
Drop ETH_P_CANXL skbs if the device does not have the CAN_CAP_XL
capability. Keep can_is_canxl_skb() for the validation of CAN XL skbs.
Closes: https://sashiko.dev/#/patchset/20260731-master-v5-0-5b27029dee20@qq.com?part=1
Fixes: fb08cba12b52 ("can: canxl: update CAN infrastructure for CAN XL frames")
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20260731-drop_canxl_frames-v1-1-7387b70353b3@kernel.org
Cc: stable@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
[ sashal: Replaced can_cap_enabled(dev, CAN_CAP_XL) with can_is_canxl_dev_mtu(dev->mtu) because the capability API is unavailable. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/dev/skb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/dev/skb.c b/drivers/net/can/dev/skb.c
index 6fb1f9b2a9e20..b643995fc5369 100644
--- a/drivers/net/can/dev/skb.c
+++ b/drivers/net/can/dev/skb.c
@@ -354,7 +354,7 @@ bool can_dropped_invalid_skb(struct net_device *dev, struct sk_buff *skb)
break;
case ETH_P_CANXL:
- if (!can_is_canxl_skb(skb))
+ if (!can_is_canxl_dev_mtu(dev->mtu) || !can_is_canxl_skb(skb))
goto inval_skb;
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0042/1756] ALSA: pcm: Optimize cpu_latency_qos_*() calls
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0041/1756] can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0043/1756] ALSA: pcm: Prevent O_APPEND open on OSS streams Greg Kroah-Hartman
` (956 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 9f6f4e97fd53908aecb0979507d9ff10a22288eb ]
We have a few cpu_latency_qos_*() calls in PCM callbacks, but they
seem suboptimal in a few aspects:
- We call them at each time when the hw_params changed, but explicitly
do remove and (re-)add; this could be
cpu_latency_qos_update_request(), instead
- The setup of cpu_latency_qos_*() doesn't have to be in hw_params at
all; it's not the place where the actual parameters are set up, but
rather better at the prepare callback.
- The hw_free calls cpu_latency_qos_remove_request() unconditionally,
which may be poking a WARNING when it wasn't queued.
For addressing the issues above, this patch cleans up and reorganize
the cpu_latency_qos_*() calls in the PCM core by a couple helper
functions. Now, they are set up at prepare callback, and cleared at
hw_free and release callbacks via the new helpers.
Link: https://patch.msgid.link/20261002150420.879056-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stable-dep-of: 9017bc3d13da ("ALSA: pcm: Prevent O_APPEND open on OSS streams")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/pcm_native.c | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index dd135ed91c99c..f3b17ec2f1778 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -751,11 +751,32 @@ EXPORT_SYMBOL_GPL(snd_pcm_runtime_buffer_set_silence);
#define is_oss_stream(substream) false
#endif
+static void pcm_qos_req_clear(struct snd_pcm_substream *substream)
+{
+ if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
+ cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
+}
+
+static void pcm_qos_req_update(struct snd_pcm_substream *substream, int usecs)
+{
+ if (usecs < 0) {
+ pcm_qos_req_clear(substream);
+ return;
+ }
+
+ if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
+ cpu_latency_qos_update_request(&substream->latency_pm_qos_req,
+ usecs);
+ else
+ cpu_latency_qos_add_request(&substream->latency_pm_qos_req,
+ usecs);
+}
+
static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_pcm_runtime *runtime;
- int err, usecs;
+ int err;
unsigned int bits;
snd_pcm_uframes_t frames;
@@ -862,12 +883,6 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
snd_pcm_timer_resolution_change(substream);
snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP);
- if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
- cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
- usecs = period_to_usecs(runtime);
- if (usecs >= 0)
- cpu_latency_qos_add_request(&substream->latency_pm_qos_req,
- usecs);
err = 0;
_error:
if (err) {
@@ -944,7 +959,7 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
goto unlock;
result = do_hw_free(substream);
snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN);
- cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
+ pcm_qos_req_clear(substream);
unlock:
snd_pcm_buffer_access_unlock(runtime);
return result;
@@ -1972,6 +1987,7 @@ static int snd_pcm_do_prepare(struct snd_pcm_substream *substream,
err = substream->ops->prepare(substream);
if (err < 0)
return err;
+ pcm_qos_req_update(substream, period_to_usecs(substream->runtime));
return snd_pcm_do_reset(substream, state);
}
@@ -2762,8 +2778,7 @@ void snd_pcm_release_substream(struct snd_pcm_substream *substream)
substream->ops->close(substream);
substream->hw_opened = 0;
}
- if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
- cpu_latency_qos_remove_request(&substream->latency_pm_qos_req);
+ pcm_qos_req_clear(substream);
if (substream->pcm_release) {
substream->pcm_release(substream);
substream->pcm_release = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0043/1756] ALSA: pcm: Prevent O_APPEND open on OSS streams
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0042/1756] ALSA: pcm: Optimize cpu_latency_qos_*() calls Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0044/1756] tools: linux/types.h: Add 128-bit integer types for arm64 UAPI structures Greg Kroah-Hartman
` (955 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bo Cao, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 9017bc3d13da0ea4e63be618c87143a7b69185e6 ]
ALSA PCM core accepts to re-use the existing stream when O_APPEND is
passed, and it's been used for dmix, etc. However, this mode isn't
supposed to be used for OSS: the OSS stream allows re-configuration
via its hw_params/hw_refine procedure even while it's being mmapped,
so it implies the usage of only a single stream. Because of this
assumption, the sanity check is skipped for OSS streams, and if user
may attach to an existing OSS stream with O_APPEND, it may result in a
UAF of the mapped pages which could be used as a privilege escalation
exploit.
For addressing it, this patch simply prohibits the O_APPEND behavior
on the OSS stream. O_APPEND is never used for OSS layer itself, so
this can't break for the right applications.
Fixes: 0df63e44c3e3 ("[ALSA] Add O_APPEND flag support to PCM")
Cc: stable@vger.kernel.org
Reported-by: Bo Cao <treebacker@foxmail.com>
Link: https://lore.kernel.org/tencent_E90BB4F086165FAA3313723567A5C675EA06@qq.com
Link: https://patch.msgid.link/20261103155844.120838-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/pcm.c | 2 ++
sound/core/pcm_local.h | 6 ++++++
sound/core/pcm_native.c | 6 ------
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index ff1e9f8c1ecae..18979f88f7159 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -923,6 +923,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
return -ENODEV;
if (! SUBSTREAM_BUSY(substream))
return -EBADFD;
+ if (is_oss_stream(substream))
+ return -EINVAL;
substream->ref_count++;
*rsubstream = substream;
return 0;
diff --git a/sound/core/pcm_local.h b/sound/core/pcm_local.h
index ecb21697ae3a4..4b134d435c24f 100644
--- a/sound/core/pcm_local.h
+++ b/sound/core/pcm_local.h
@@ -80,4 +80,10 @@ static inline void snd_pcm_dma_buffer_sync(struct snd_pcm_substream *substream,
snd_dma_buffer_sync(snd_pcm_get_dma_buf(substream), mode);
}
+#if IS_ENABLED(CONFIG_SND_PCM_OSS)
+#define is_oss_stream(substream) ((substream)->oss.oss)
+#else
+#define is_oss_stream(substream) false
+#endif
+
#endif /* __SOUND_CORE_PCM_LOCAL_H */
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index f3b17ec2f1778..24b923aabc9a2 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -745,12 +745,6 @@ int snd_pcm_runtime_buffer_set_silence(struct snd_pcm_runtime *runtime)
}
EXPORT_SYMBOL_GPL(snd_pcm_runtime_buffer_set_silence);
-#if IS_ENABLED(CONFIG_SND_PCM_OSS)
-#define is_oss_stream(substream) ((substream)->oss.oss)
-#else
-#define is_oss_stream(substream) false
-#endif
-
static void pcm_qos_req_clear(struct snd_pcm_substream *substream)
{
if (cpu_latency_qos_request_active(&substream->latency_pm_qos_req))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0044/1756] tools: linux/types.h: Add 128-bit integer types for arm64 UAPI structures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0043/1756] ALSA: pcm: Prevent O_APPEND open on OSS streams Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0045/1756] khugepaged: fix readahead lock inversion in collapse_file() Greg Kroah-Hartman
` (954 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnd Bergmann,
Arnaldo Carvalho de Melo, David Matlack, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will@kernel.org>
[ Upstream commit 10a47fb67340bca274276faf855d7d460afd9a7a ]
The arm64 UAPI exposes some 128-bit integer types to represent things
such as fpsimd registers in the sigcontext. In preparation for defining
these using the '__u128' typedef implemented by uapi/linux/types.h, copy
that typedef over to the private linux/types.h header used by the tools
directory.
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/linux/types.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h
index 8519386acd239..432b28f77ae2c 100644
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -23,6 +23,11 @@ typedef enum {
__GFP_HIGH
} gfp_t;
+#ifdef __SIZEOF_INT128__
+typedef __signed__ __int128 __s128 __attribute__((aligned(16)));
+typedef unsigned __int128 __u128 __attribute__((aligned(16)));
+#endif
+
/*
* We define u64 as uint64_t for every architecture
* so that we can print it with "%"PRIx64 without getting warnings.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0045/1756] khugepaged: fix readahead lock inversion in collapse_file()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0044/1756] tools: linux/types.h: Add 128-bit integer types for arm64 UAPI structures Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0046/1756] hwmon: (sht15) Remove redundant dev_err() Greg Kroah-Hartman
` (953 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+16bf7cd0ebeb1de93aa5,
Lance Yang, Pedro Falcato, David Hildenbrand (Arm), Zi Yan,
Baolin Wang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <lance.yang@linux.dev>
[ Upstream commit eadce52a9ef657d561b3e76c9b5f178bd99735f5 ]
collapse_file() can call page_cache_sync_readahead() while still holding
source folios locked. If truncate holds mapping->invalidate_lock
exclusively and waits for one of those folios, readahead waits for
invalidate_lock and neither side can make progress.
We need to release those folio locks before starting readahead. On a page
cache miss, roll back first, populate the collapse range, and retry once.
Doing readahead after rollback avoids an extra pass when all folios are
already present. If another miss occurs on retry, give up rather than keep
retrying while truncate or reclaim removes folios.
Keep page_cache_sync_readahead() and wait for read I/O with
filemap_lock_folio(), releasing each folio before moving to the next. The
existing uptodate check during collapse still handles read errors.
Shmem uses shmem_get_folio() for swapin and fallocated folios without
taking mapping->invalidate_lock, so it is unaffected.
Reported-by: syzbot+16bf7cd0ebeb1de93aa5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=16bf7cd0ebeb1de93aa5
Fixes: 730633f0b7f9 ("mm: Protect operations adding pages to page cache with invalidate_lock")
Cc: stable@vger.kernel.org
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://patch.msgid.link/20261026152013.10511-1-lance.yang@linux.dev
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/khugepaged.c | 49 +++++++++++++++++++++++++++++++++++++------------
1 file changed, 37 insertions(+), 12 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 1250d878d7242..2e9d0e13b068a 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1817,6 +1817,8 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
XA_STATE_ORDER(xas, &mapping->i_pages, start, HPAGE_PMD_ORDER);
int nr_none = 0, result = SCAN_SUCCEED;
bool is_shmem = shmem_file(file);
+ bool do_readahead = false;
+ bool readahead_done = false;
VM_BUG_ON(!IS_ENABLED(CONFIG_READ_ONLY_THP_FOR_FS) && !is_shmem);
VM_BUG_ON(start & (HPAGE_PMD_NR - 1));
@@ -1828,6 +1830,10 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
mapping_set_update(&xas, mapping);
+retry:
+ result = SCAN_SUCCEED;
+ do_readahead = false;
+ xas_set_order(&xas, start, HPAGE_PMD_ORDER);
__folio_set_locked(new_folio);
if (is_shmem)
__folio_set_swapbacked(new_folio);
@@ -1892,17 +1898,9 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
}
} else { /* !is_shmem */
if (!folio || xa_is_value(folio)) {
- xas_unlock_irq(&xas);
- page_cache_sync_readahead(mapping, &file->f_ra,
- file, index,
- end - index);
- /* drain lru cache to help folio_isolate_lru() */
- lru_add_drain();
- folio = filemap_lock_folio(mapping, index);
- if (IS_ERR(folio)) {
- result = SCAN_FAIL;
- goto xa_unlocked;
- }
+ do_readahead = !readahead_done;
+ result = SCAN_FAIL;
+ goto xa_locked;
} else if (folio_test_dirty(folio)) {
/*
* khugepaged only works on read-only fd,
@@ -2044,7 +2042,10 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
* in do_dentry_open() truncating the page cache. This is
* particularly important if there are dirty folios in transit.
*/
- filemap_invalidate_lock_shared(mapping);
+ if (!filemap_invalidate_trylock_shared(mapping)) {
+ result = SCAN_FAIL;
+ goto rollback;
+ }
filemap_nr_thps_inc(mapping);
/*
* Paired with the fence in do_dentry_open() -> get_write_access()
@@ -2245,6 +2246,30 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
new_folio->mapping = NULL;
folio_unlock(new_folio);
+
+ /* Readahead may take invalidate_lock; source folios are unlocked. */
+ if (do_readahead) {
+ for (index = start; index < end;) {
+ folio = filemap_lock_folio(mapping, index);
+ if (IS_ERR(folio)) {
+ page_cache_sync_readahead(mapping, &file->f_ra,
+ file, index, end - index);
+ folio = filemap_lock_folio(mapping, index);
+ if (IS_ERR(folio)) {
+ result = SCAN_FAIL;
+ goto out_put;
+ }
+ }
+ index = folio_next_index(folio);
+ folio_unlock(folio);
+ folio_put(folio);
+ }
+ /* Drain the local LRU batch before retrying isolation. */
+ lru_add_drain();
+ readahead_done = true;
+ goto retry;
+ }
+out_put:
folio_put(new_folio);
out:
VM_BUG_ON(!list_empty(&pagelist));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0046/1756] hwmon: (sht15) Remove redundant dev_err()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0045/1756] khugepaged: fix readahead lock inversion in collapse_file() Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0047/1756] hwmon: (sht15) Stop deferred work before releasing its resources Greg Kroah-Hartman
` (952 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pan Chuang, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Chuang <panchuang@vivo.com>
[ Upstream commit b8ffbb950dffbcf810ba41e776516cf3438bbe25 ]
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs detailed
error messages on failure. Remove the now-redundant driver-specific
dev_err() call.
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-7-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: 5eab1e7f7ed1 ("hwmon: (sht15) Stop deferred work before releasing its resources")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/sht15.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 3d55047e9baf9..48bcd362c4808 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -981,10 +981,8 @@ static int sht15_probe(struct platform_device *pdev)
IRQF_TRIGGER_FALLING,
"sht15 data",
data);
- if (ret) {
- dev_err(&pdev->dev, "failed to get irq for data line\n");
+ if (ret)
goto err_release_reg;
- }
disable_irq_nosync(gpiod_to_irq(data->data));
ret = sht15_connection_reset(data);
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0047/1756] hwmon: (sht15) Stop deferred work before releasing its resources
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0046/1756] hwmon: (sht15) Remove redundant dev_err() Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0048/1756] mm/mremap: fix moving PUD leaves Greg Kroah-Hartman
` (951 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Guenter Roeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit 5eab1e7f7ed12893f3864fe46ffcd5a41a752d6a ]
The IRQ handler and regulator notifier can leave work pending after a
measurement or notification completes. Neither work item is drained before
its resources are released on removal or probe failure.
Disable read_work before freeing the IRQ, since the worker can re-enable
it. Use request_irq()/free_irq() for explicit teardown. Unregister the
regulator notifier before cancelling update_supply_work and disabling the
regulator. Apply the same ordering to probe failures.
Fixes: 251eb40f5ccd ("hwmon: sht15 humidity sensor driver")
Cc: stable@vger.kernel.org
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20261024014044.27853-1-mhun512@gmail.com
[groeck: Dropped obsolete 'Assisted-by: tag]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/sht15.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 48bcd362c4808..8af2336052b0e 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -31,6 +31,7 @@
#include <linux/bitrev.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
+#include <linux/workqueue.h>
/* Commands */
#define SHT15_MEASURE_TEMP 0x03
@@ -976,25 +977,22 @@ static int sht15_probe(struct platform_device *pdev)
goto err_release_reg;
}
- ret = devm_request_irq(&pdev->dev, gpiod_to_irq(data->data),
- sht15_interrupt_fired,
- IRQF_TRIGGER_FALLING,
- "sht15 data",
- data);
+ ret = request_irq(gpiod_to_irq(data->data), sht15_interrupt_fired,
+ IRQF_TRIGGER_FALLING, "sht15 data", data);
if (ret)
goto err_release_reg;
disable_irq_nosync(gpiod_to_irq(data->data));
ret = sht15_connection_reset(data);
if (ret)
- goto err_release_reg;
+ goto err_free_irq;
ret = sht15_soft_reset(data);
if (ret)
- goto err_release_reg;
+ goto err_free_irq;
ret = sysfs_create_group(&pdev->dev.kobj, &sht15_attr_group);
if (ret) {
dev_err(&pdev->dev, "sysfs create failed\n");
- goto err_release_reg;
+ goto err_free_irq;
}
data->hwmon_dev = hwmon_device_register(data->dev);
@@ -1007,9 +1005,13 @@ static int sht15_probe(struct platform_device *pdev)
err_release_sysfs_group:
sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
+err_free_irq:
+ disable_work_sync(&data->read_work);
+ free_irq(gpiod_to_irq(data->data), data);
err_release_reg:
if (!IS_ERR(data->reg)) {
regulator_unregister_notifier(data->reg, &data->nb);
+ cancel_work_sync(&data->update_supply_work);
regulator_disable(data->reg);
}
return ret;
@@ -1023,12 +1025,16 @@ static void sht15_remove(struct platform_device *pdev)
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
+ disable_work_sync(&data->read_work);
+ free_irq(gpiod_to_irq(data->data), data);
+
ret = sht15_soft_reset(data);
if (ret)
dev_err(&pdev->dev, "Failed to reset device (%pe)\n", ERR_PTR(ret));
if (!IS_ERR(data->reg)) {
regulator_unregister_notifier(data->reg, &data->nb);
+ cancel_work_sync(&data->update_supply_work);
regulator_disable(data->reg);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0048/1756] mm/mremap: fix moving PUD leaves
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0047/1756] hwmon: (sht15) Stop deferred work before releasing its resources Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0049/1756] mm/mremap: recheck PUDs under the page table lock Greg Kroah-Hartman
` (950 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Lorenzo Stoakes (ARM),
Pedro Falcato, Muhammad Usama Anjum, Lance Yang,
David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 440c8779757f09f290770b1d361dc1516a9d0b3e ]
pud_none_or_clear_bad() only really works on page tables. PUD leaves
confuse the check and make us clear the page table entry and print a
warning.
Since commit aed877c2b4257 ("device/dax: properly refcount device dax pages
when mapping"), this also leaks device-DAX folio references, mapcounts
and RSS accounting, resulting in "Bad rss-counter state" warnings on exit.
Allow PUD leaves in get_old_pud(). If a PUD leaf cannot be moved as a
whole or the move fails, split it. This unmaps it with proper accounting
instead of treating the leaf entry as a PMD table.
Keep using pud_trans_huge() for now, in the future this code should be
cleaned up to just check for PUD leaves.
Fix generated by an LLM and sent by Josef Bacik in private.
Fixes: a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
[ david: fallthrough after splitting ]
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-32-d6437171ecc3@kernel.org
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Adapted pagetable_move_control-based calls to individual arguments while retaining explicit pud_devmap() checks. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mremap.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/mm/mremap.c b/mm/mremap.c
index d4666f1ab5939..079127769ea3a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -47,7 +47,8 @@ static pud_t *get_old_pud(struct mm_struct *mm, unsigned long addr)
return NULL;
pud = pud_offset(p4d, addr);
- if (pud_none_or_clear_bad(pud))
+ if (!pud_trans_huge(*pud) && !pud_devmap(*pud) &&
+ pud_none_or_clear_bad(pud))
return NULL;
return pud;
@@ -624,12 +625,11 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
if (!new_pud)
break;
if (pud_trans_huge(*old_pud) || pud_devmap(*old_pud)) {
- if (extent == HPAGE_PUD_SIZE) {
- move_pgt_entry(HPAGE_PUD, vma, old_addr, new_addr,
- old_pud, new_pud, need_rmap_locks);
- /* We ignore and continue on error? */
+ if (extent == HPAGE_PUD_SIZE &&
+ move_pgt_entry(HPAGE_PUD, vma, old_addr, new_addr,
+ old_pud, new_pud, need_rmap_locks))
continue;
- }
+ split_huge_pud(vma, old_pud, old_addr);
} else if (IS_ENABLED(CONFIG_HAVE_MOVE_PUD) &&
extent == PUD_SIZE && uffd_supports_move) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0049/1756] mm/mremap: recheck PUDs under the page table lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0048/1756] mm/mremap: fix moving PUD leaves Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0050/1756] mm: page_alloc: do not give all non-blocking requests reserve access Greg Kroah-Hartman
` (949 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Stoakes (ARM), Pedro Falcato,
Muhammad Usama Anjum, Lance Yang, David Hildenbrand (Arm),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 402882943dfa8bab5c2bcc66189f9fb2828f248e ]
Once get_old_pud() is fixed to accept PUD leaves, unmap_mapping_range() can
clear a leaf between the lookup and the move. Holding mmap_lock in write
mode does not prevent this.
If the zap happens before move_page_tables() tests the entry, an empty
PUD can reach move_normal_pud(), where pud_populate() turns it into a
present page table entry. If it happens after the test, move_huge_pud()
can instead try to move an empty entry, triggering CONFIG_DEBUG_VM
warnings on powerpc.
Recheck the source under the page table lock in both helpers. Treat an
empty source in move_normal_pud() as a completed move, and use
__pud_trans_huge_lock() in move_huge_pud().
In the future we should likely have the code lookup a PUD/PMD lockless
once, instead of multiple times, because one of the problematic bits
here is the:
pud_trans_huge(*old_pud)
Fixes: 0881ace292b6 ("mm/mremap: use pmd/pud_poplulate to update page table entries")
Cc: stable@vger.kernel.org
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-31-d6437171ecc3@kernel.org
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Adapted pagetable_move_control context to use direct vma and address arguments. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mremap.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/mm/mremap.c b/mm/mremap.c
index 079127769ea3a..3d5c2f69fdbfd 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -346,14 +346,18 @@ static bool move_normal_pud(struct vm_area_struct *vma, unsigned long old_addr,
if (new_ptl != old_ptl)
spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
- /* Clear the pud */
pud = *old_pud;
+ if (unlikely(pud_none(pud)))
+ goto out_unlock;
+
+ /* Clear the pud */
pud_clear(old_pud);
VM_BUG_ON(!pud_none(*new_pud));
pud_populate(mm, new_pud, pud_pgtable(pud));
flush_tlb_range(vma, old_addr, old_addr + PUD_SIZE);
+out_unlock:
if (new_ptl != old_ptl)
spin_unlock(new_ptl);
spin_unlock(old_ptl);
@@ -388,7 +392,9 @@ static bool move_huge_pud(struct vm_area_struct *vma, unsigned long old_addr,
* We don't have to worry about the ordering of src and dst
* ptlocks because exclusive mmap_lock prevents deadlock.
*/
- old_ptl = pud_lock(vma->vm_mm, old_pud);
+ old_ptl = __pud_trans_huge_lock(old_pud, vma);
+ if (unlikely(!old_ptl))
+ return false;
new_ptl = pud_lockptr(mm, new_pud);
if (new_ptl != old_ptl)
spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0050/1756] mm: page_alloc: do not give all non-blocking requests reserve access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0049/1756] mm/mremap: recheck PUDs under the page table lock Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0051/1756] drm/amdgpu: cancel idle work in hw_init failure paths for vcn/uvd/vce/jpeg Greg Kroah-Hartman
` (948 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Johannes Weiner, Andrew Morton,
Sashiko, Balbir Singh, Vlastimil Babka (SUSE),
Matthew Wilcox (Oracle), Salvatore Dipietro, Christoph Hellwig,
Dave Chinner, Matt Fleming, Mel Gorman, Michal Hocko,
Suren Baghdasaryan, Brendan Jackman, Zi Yan, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Weiner <hannes@cmpxchg.org>
[ Upstream commit 6ee3d87b940848aaed5d4e8d005c5f674bf2637a ]
Patch series "mm: page_alloc: fix reserve access for non-blocking
requests", v2.
Two fixes for how non-blocking allocations interact with the highatomic
reserve. There are prerequisites for Salvatore's "mm/page_alloc: avoid
direct reclaim and compaction for costly __GFP_NORETRY allocations" [0].
Patch 1 narrows which requests may physically take highatomic pages,
patch 2 narrows which requests may count them in their watermark check.
Both are prerequisites for Salvatore's patch: it clears
__GFP_DIRECT_RECLAIM for costly __GFP_NORETRY requests, which turns every
large page cache folio allocation that reaches the slowpath into a
non-blocking one. Without patch 1, those requests may fall back to the
highatomic freelists reserved for atomic requests. Without patch 2, they
count the free highatomic pages in their watermark check while being
served from regular memory, so they can consume regular high-order blocks
below the min watermark by the size of the reserve. GFP_NOWAIT requests
hit both paths today, so these are existing problems worthy of their own
stable backports; but Salvatore's patch would widen them significantly.
Patch 2 reproduction: a GFP_NOWAIT burst under memory pressure can drain
regular free memory to zero while the highatomic reserve sits idle.
Measured on a 32G box with an anonymous working set, swap, and a full 290M
reserve, three synthetic bursts drove the 28G Normal zone's regular free
memory to 28M, 0.8M and 0.6M against a 60M min watermark. Swapout failed
its swap table allocation inside reclaim, reclaim scanned 13M pages to
free 200k, and page faults stalled for tens to hundreds of milliseconds.
With the fix the burst stops at the min watermark and nothing else
happens. This was found in review and reproduced synthetically; it has
not been observed in production.
GFP_ATOMIC order-0 requests have a milder version of the same problem:
They are entitled to the reserve but are served regular memory first, so
the fix there has to change the watermark check and the freelist order
together. Salvatore's change doesn't interact with this, though; fixing
that is left for a separate patch.
This patch (of 2):
281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access
highatomic reserves") accidentally gave all non-blocking allocation
requests access to highatomic reserves, which includes GFP_NOWAIT and
other sites clearing __GFP_DIRECT_RECLAIM.
While this improved atomic request success rate, it's unintentionally
broad and can actually worsen highatomic requests by squandering the
reserves on requests that don't need it.
There are concurrent efforts to clear __GFP_DIRECT_RECLAIM altogether
for costly order __GFP_NORETRY requests, which would then also fall
into this exemption and deplete reserves even faster.
What GFP_ATOMIC has over the others is __GFP_HIGH, which
alloc_flags_slowpath() translates to ALLOC_MIN_RESERVE.
Narrow the exemption to contexts that have both ALLOC_NON_BLOCK |
ALLOC_MIN_RESERVE.
Link: https://lore.kernel.org/20261001082152.2879289-1-dipiets@amazon.it [0]
Link: https://lore.kernel.org/linux-mm/arFBWvzXPYrKuIYi@cmpxchg.org/ [1]
Link: https://lore.kernel.org/linux-mm/20261001082152.2879289-1-dipiets@amazon.it/ [2]
Link: https://lore.kernel.org/20261028171719.2043421-1-hannes@cmpxchg.org
Link: https://lore.kernel.org/20261028171719.2043421-2-hannes@cmpxchg.org
Fixes: 281dd25c1a01 ("mm/page_alloc: let GFP_ATOMIC order-0 allocs access highatomic reserves")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260904115629.3993331-1-dipiets@amazon.it
Acked-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Salvatore Dipietro <dipiets@amazon.it>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <dgc@kernel.org>
Cc: Matt Fleming <matt@readmodwrite.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Zi Yan <ziy@nvidia.com>
Cc: <stable@vger.kernel.org>
[ sashal: moved the ALLOC_MASK_ATOMIC definition from the page allocation header to the internal header ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/internal.h | 3 +++
mm/page_alloc.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/mm/internal.h b/mm/internal.h
index 7aca909c54052..9fbed032a9c1a 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1230,6 +1230,9 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
/* Flags that allow allocations below the min watermark. */
#define ALLOC_RESERVES (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE|ALLOC_HIGHATOMIC|ALLOC_OOM)
+/* Flags that mean GFP_ATOMIC */
+#define ALLOC_MASK_ATOMIC (ALLOC_NON_BLOCK|ALLOC_MIN_RESERVE)
+
enum ttu_flags;
struct tlbflush_unmap_batch;
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 869296e43349e..51a1aad29d5a8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3001,7 +3001,9 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone,
* reserves as failing now is worse than failing a
* high-order atomic allocation in the future.
*/
- if (!page && (alloc_flags & (ALLOC_OOM|ALLOC_NON_BLOCK)))
+ if (!page &&
+ ((alloc_flags & ALLOC_OOM) ||
+ (alloc_flags & ALLOC_MASK_ATOMIC) == ALLOC_MASK_ATOMIC))
page = __rmqueue_smallest(zone, order, MIGRATE_HIGHATOMIC);
if (!page) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0051/1756] drm/amdgpu: cancel idle work in hw_init failure paths for vcn/uvd/vce/jpeg
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0050/1756] mm: page_alloc: do not give all non-blocking requests reserve access Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0052/1756] drm/amd/display: set allow_freesync before validating a new stream Greg Kroah-Hartman
` (947 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Leo Liu, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leo Liu <leo.liu@amd.com>
[ Upstream commit a56c2536c399d57a9bb1c02fd411e0c25859af3b ]
When hw_init() fails, amdgpu_device_ip_fini_early() skips hw_fini()
because status.hw was never set. For VCN, UVD (including UVD ENC), VCE,
and JPEG, hw_fini() is where cancel_delayed_work_sync() is called. Any
idle work queued during the partial hw_init() is therefore left pending
after sw_fini() frees the adev state the handler touches.
Cancel the idle work in each hw_init() error path, immediately before
returning the error, so that hw_fini() remains the sole cancel site on
the normal teardown path with no duplication.
Link: https://github.com/ROCm/amdgpu/issues/234
Fixes: 416e1fab4752 ("drm/amdgpu: drop redundant cancel_delayed_work_sync call")
Assisted-by: Claude:Claude-Sonnet-4.6
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7ff2327fde029e97d0050fcb94e3f4063c318547)
Cc: stable@vger.kernel.org
[ sashal: Adapted per-instance VCN idle-work cancellation to the shared VCN worker also used by JPEG 1.0. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 4 +++-
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 4 +++-
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 4 +++-
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 4 +++-
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 4 +++-
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 9 +++++++--
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 8 ++++++--
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 8 ++++++--
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 8 ++++++--
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 6 +++++-
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c | 10 +++++++++-
24 files changed, 119 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
index 5c95cf6167d94..3135ec3ac25a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
@@ -132,11 +132,15 @@ static int jpeg_v2_0_hw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec;
+ int r;
adev->nbio.funcs->vcn_doorbell_range(adev, ring->use_doorbell,
(adev->doorbell_index.vcn.vcn_ring0_1 << 1), 0);
- return amdgpu_ring_test_helper(ring);
+ r = amdgpu_ring_test_helper(ring);
+ if (r)
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
index e4cfa6b7141f6..22ad2213a85e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
@@ -193,10 +193,14 @@ static int jpeg_v2_5_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
index 27a27de6c6c3d..635279f7a9090 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
@@ -146,11 +146,15 @@ static int jpeg_v3_0_hw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec;
+ int r;
adev->nbio.funcs->vcn_doorbell_range(adev, ring->use_doorbell,
(adev->doorbell_index.vcn.vcn_ring0_1 << 1), 0);
- return amdgpu_ring_test_helper(ring);
+ r = amdgpu_ring_test_helper(ring);
+ if (r)
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
index 90f64a46bff7c..e641b1a917349 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
@@ -178,10 +178,14 @@ static int jpeg_v4_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index c4f812939a85f..76d9201d7249c 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -347,12 +347,16 @@ static int jpeg_v4_0_3_hw_init(void *handle)
VCN_JPEG_DB_CTRL__EN_MASK);
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
}
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
index 78a9fb26bce2e..3ec310fbdb903 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
@@ -201,10 +201,14 @@ static int jpeg_v4_0_5_hw_init(void *handle)
ring = adev->jpeg.inst[i].ring_dec;
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
index d0f800e7938dd..cc3344b069746 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
@@ -145,9 +145,13 @@ static int jpeg_v5_0_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->jpeg.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
index dc5cc48a31350..ca13fa271288a 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
@@ -710,7 +710,9 @@ static int uvd_v3_1_hw_init(void *handle)
amdgpu_ring_commit(ring);
done:
- if (!r)
+ if (r)
+ cancel_delayed_work_sync(&adev->uvd.idle_work);
+ else
DRM_INFO("UVD initialized successfully.\n");
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
index a1227867dc887..c2d1d38c1b3ca 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
@@ -198,7 +198,9 @@ static int uvd_v4_2_hw_init(void *handle)
amdgpu_ring_commit(ring);
done:
- if (!r)
+ if (r)
+ cancel_delayed_work_sync(&adev->uvd.idle_work);
+ else
DRM_INFO("UVD initialized successfully.\n");
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
index fd4acb1300f93..2101f96f6b28d 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
@@ -190,7 +190,9 @@ static int uvd_v5_0_hw_init(void *handle)
amdgpu_ring_commit(ring);
done:
- if (!r)
+ if (r)
+ cancel_delayed_work_sync(&adev->uvd.idle_work);
+ else
DRM_INFO("UVD initialized successfully.\n");
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
index 71a16073c43b2..47e7987be0ba6 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
@@ -513,7 +513,9 @@ static int uvd_v6_0_hw_init(void *handle)
}
done:
- if (!r) {
+ if (r) {
+ cancel_delayed_work_sync(&adev->uvd.idle_work);
+ } else {
if (uvd_v6_0_enc_support(adev))
DRM_INFO("UVD and UVD ENC initialized successfully.\n");
else
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
index bc0fca75417ce..a03b32f40bdab 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
@@ -581,7 +581,9 @@ static int uvd_v7_0_hw_init(void *handle)
}
}
done:
- if (!r)
+ if (r)
+ cancel_delayed_work_sync(&adev->uvd.idle_work);
+ else
DRM_INFO("UVD and UVD ENC initialized successfully.\n");
return r;
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
index 8a6c24b98f1fa..843227ec96e03 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
@@ -467,12 +467,16 @@ static int vce_v2_0_hw_init(void *handle)
for (i = 0; i < adev->vce.num_rings; i++) {
r = amdgpu_ring_test_helper(&adev->vce.ring[i]);
if (r)
- return r;
+ goto error;
}
DRM_INFO("VCE initialized successfully.\n");
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vce.idle_work);
+ return r;
}
static int vce_v2_0_hw_fini(void *handle)
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
index 4c7f6c2e1adee..5d4758ce474fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
@@ -477,12 +477,16 @@ static int vce_v3_0_hw_init(void *handle)
for (i = 0; i < adev->vce.num_rings; i++) {
r = amdgpu_ring_test_helper(&adev->vce.ring[i]);
if (r)
- return r;
+ goto error;
}
DRM_INFO("VCE initialized successfully.\n");
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vce.idle_work);
+ return r;
}
static int vce_v3_0_hw_fini(void *handle)
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
index 14ead62ec57db..df3220ab98bbd 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
@@ -528,12 +528,16 @@ static int vce_v4_0_hw_init(void *handle)
for (i = 0; i < adev->vce.num_rings; i++) {
r = amdgpu_ring_test_helper(&adev->vce.ring[i]);
if (r)
- return r;
+ goto error;
}
DRM_INFO("VCE initialized successfully.\n");
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vce.idle_work);
+ return r;
}
static int vce_v4_0_hw_fini(void *handle)
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 563721c551634..be1e799795848 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -250,18 +250,23 @@ static int vcn_v1_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error_vcn;
for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
ring = &adev->vcn.inst->ring_enc[i];
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error_vcn;
}
ring = adev->jpeg.inst->ring_dec;
r = amdgpu_ring_test_helper(ring);
+ if (r)
+ goto error_vcn;
+ return 0;
+error_vcn:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
return r;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
index 29f5f6b1eb0a4..72975d44c1240 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
@@ -287,7 +287,7 @@ static int vcn_v2_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
//Disable vcn decode for sriov
if (amdgpu_sriov_vf(adev))
@@ -297,10 +297,14 @@ static int vcn_v2_0_hw_init(void *handle)
ring = &adev->vcn.inst->ring_enc[i];
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
index 20ef8835b12b1..e5cd2c9371358 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
@@ -365,18 +365,22 @@ static int vcn_v2_5_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
ring = &adev->vcn.inst[j].ring_enc[i];
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
}
}
return r;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
index c175c58c6073d..518cde0476232 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
@@ -397,18 +397,22 @@ static int vcn_v3_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
for (j = 0; j < adev->vcn.num_enc_rings; ++j) {
ring = &adev->vcn.inst[i].ring_enc[j];
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
}
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
index e9d43924bcd73..276d6e7d14bdc 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -332,11 +332,15 @@ static int vcn_v4_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index 7edb6da93fd2e..f4061a2ed83cb 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -313,11 +313,15 @@ static int vcn_v4_0_3_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
}
return r;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
index f0354a7dfb461..da0daf9bcaa2d 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
@@ -283,10 +283,14 @@ static int vcn_v4_0_5_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
index f8994e4bdf4b6..3c7fd45917788 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
@@ -250,10 +250,14 @@ static int vcn_v5_0_0_hw_init(void *handle)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
return 0;
+
+error:
+ cancel_delayed_work_sync(&adev->vcn.idle_work);
+ return r;
}
/**
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
index 0034e71283964..d0a6496b731be 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
@@ -257,11 +257,19 @@ static int vcn_v5_0_1_hw_init(struct amdgpu_ip_block *ip_block)
r = amdgpu_ring_test_helper(ring);
if (r)
- return r;
+ goto error;
}
}
return 0;
+
+error:
+ while (i >= 0) {
+ if (!(adev->vcn.harvest_config & (1 << i)))
+ cancel_delayed_work_sync(&adev->vcn.inst[i].idle_work);
+ i--;
+ }
+ return r;
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0052/1756] drm/amd/display: set allow_freesync before validating a new stream
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0051/1756] drm/amdgpu: cancel idle work in hw_init failure paths for vcn/uvd/vce/jpeg Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0053/1756] hugetlbfs: enforce F_SEAL_EXEC in setattr Greg Kroah-Hartman
` (946 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josh Kasten, Mikhail Gavrilov,
Alex Hung, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
[ Upstream commit ab18dd3061eb2d92e60c8bbf9a435c25962e449f ]
After resume from S3, DC enables SubVP on a single FreeSync display at
a high refresh rate, although dcn32_allow_subvp_high_refresh_rate() is
meant to keep SubVP off that configuration ("For single display cases,
freesync must be disabled"). On an RX 7900 XTX driving a FreeSync TV
at 3840x2160@120, amdgpu_dm_capabilities reports sub-viewport disabled
after boot and enabled after "rtcwake -m mem", and the memory clock
starts switching. It stays that way until a later commit re-validates
the state; a CRTC gamma change (toggling Night Light) turns SubVP off
again.
The policy reads dc_stream_state::allow_freesync while the new state
is validated, but amdgpu_dm sets that field only in
amdgpu_dm_update_freesync_state_on_stream(), on the first flip after
the commit. A stream created by a modeset is therefore validated as
if FreeSync were off. On resume, dm_destroy_cached_state() drops the
streams and forces a modeset, so the resumed state is validated
without FreeSync.
Set allow_freesync in amdgpu_dm_get_freesync_config_for_crtc(), which
atomic check calls for every active CRTC and which already writes
ignore_msa_timing_param to the stream. It uses vrr_supported, the
condition the flip-time value is derived from. With this change the
same TV keeps SubVP disabled across "rtcwake -m mem".
On this machine SubVP is also what exposes the single-frame scanout
corruption reported in the thread linked below, so the FreeSync
setting stopped working as a workaround after every suspend.
Fixes: 87f0c16e0eeb ("drm/amd/display: Enable SubVP for high refresh rate displays")
Link: https://lore.kernel.org/all/20260829010525.29935-1-mikhail.v.gavrilov@gmail.com/
Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/5714#note_3736349
Tested-by: Josh Kasten <jkasten@gmail.com>
Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 29793918b0eb63b6810b248a906f87dd79b70be5)
Cc: stable@vger.kernel.org
[ sashal: adapted the change to get_freesync_config_for_crtc() instead of amdgpu_dm_get_freesync_config_for_crtc() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 305a9fe006de4..175cf9e1a24e7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -10546,6 +10546,14 @@ static void get_freesync_config_for_crtc(
vrefresh >= aconnector->min_vfreq &&
vrefresh <= aconnector->max_vfreq;
+ /*
+ * DC reads allow_freesync while validating the new state, for example
+ * to keep SubVP off a single FreeSync display, but it is otherwise set
+ * only on the first flip after the commit. Set it here, so that a
+ * stream created by this commit is not validated without it.
+ */
+ new_crtc_state->stream->allow_freesync = new_crtc_state->vrr_supported;
+
if (new_crtc_state->vrr_supported) {
new_crtc_state->stream->ignore_msa_timing_param = true;
fs_vid_mode = new_crtc_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0053/1756] hugetlbfs: enforce F_SEAL_EXEC in setattr
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0052/1756] drm/amd/display: set allow_freesync before validating a new stream Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0054/1756] drm/msm/hdmi: Handle msm_hdmi_power_on() errors during .atomic_pre_enable() Greg Kroah-Hartman
` (945 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eva Kurchatova, Pedro Falcato,
Kiryl Shutsemau (Meta), Zi Yan, Gregory Price (Meta), Muchun Song,
Oscar Salvador, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
[ Upstream commit b7f570e7cea761ec7eb4a3a9557a3a082d14e88c ]
F_SEAL_EXEC is enforced by shmem_setattr(), but hugetlbfs_setattr() does
not check it. As a result, fchmod() can change the execute bits of a
sealed hugetlbfs memfd.
Use memfd_check_seals_mode() in hugetlbfs_setattr() to reject changes
to execute bits when F_SEAL_EXEC is set.
This also fixes the memfd_test hugetlbfs SEAL-EXEC subtest, where
fchmod() incorrectly succeeded after applying F_SEAL_EXEC.
Fixes: 6fd7353829ca ("mm/memfd: add F_SEAL_EXEC")
Cc: stable@vger.kernel.org
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Link: https://patch.msgid.link/20260629180247.2343229-1-eva.kurchatova@virtuozzo.com
Acked-by: Pedro Falcato <pfalcato@suse.de>
Acked-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Acked-by: Zi Yan <ziy@nvidia.com>
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
[ david: use common helper; fixup Fixes:; check only regular files ]
Acked-by: Oscar Salvador <osalvador@suse.de>
Link: https://patch.msgid.link/20261029-fixes_shmem-v4-5-392fc715d8f6@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Replaced the unavailable memfd_check_seals_mode() helper call with its equivalent inline check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/hugetlbfs/inode.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 1a12932b58806..2856c3bbc38d4 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -932,6 +932,12 @@ static int hugetlbfs_setattr(struct mnt_idmap *idmap,
if (error)
return error;
+ if (S_ISREG(inode->i_mode) && (ia_valid & ATTR_MODE)) {
+ if ((info->seals & F_SEAL_EXEC) &&
+ ((inode->i_mode ^ attr->ia_mode) & 0111))
+ return -EPERM;
+ }
+
if (ia_valid & ATTR_SIZE) {
loff_t oldsize = inode->i_size;
loff_t newsize = attr->ia_size;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0054/1756] drm/msm/hdmi: Handle msm_hdmi_power_on() errors during .atomic_pre_enable()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0053/1756] hugetlbfs: enforce F_SEAL_EXEC in setattr Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0055/1756] drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR Greg Kroah-Hartman
` (944 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski,
Dmitry Baryshkov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
[ Upstream commit dd6ecace57851878e62367a6f1a26dd5b9aa217f ]
Properly handle power up failures during .atomic_pre_enable() by
aborting the .atomic_pre_enable() to avoid accessing registers why
blocks did not bring up. Otherwise this could lead to imprecise aborts
when accessing MMIO while entire power domain is off.
Cc: <stable@vger.kernel.org>
Fixes: ba3d7bf3a7ab ("drm/msm/hdmi: Convert PHY files according to new design")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/752652/
Link: https://lore.kernel.org/r/20260911-drm-msm-hdmi-fixes-before-eliza-v4-2-87bdb9f1987f@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
[ sashal: adapted atomic_pre_enable() error handling to pre_enable() with explicit regulator and multiple-clock cleanup ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 30 +++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
index b4abac49f5d96..4b874b1c846ad 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c
@@ -11,7 +11,7 @@
#include "msm_kms.h"
#include "hdmi.h"
-static void msm_hdmi_power_on(struct drm_bridge *bridge)
+static int msm_hdmi_power_on(struct drm_bridge *bridge)
{
struct drm_device *dev = bridge->dev;
struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge);
@@ -19,11 +19,15 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge)
const struct hdmi_platform_config *config = hdmi->config;
int i, ret;
- pm_runtime_get_sync(&hdmi->pdev->dev);
+ ret = pm_runtime_resume_and_get(&hdmi->pdev->dev);
+ if (ret)
+ return ret;
ret = regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs);
- if (ret)
+ if (ret) {
DRM_DEV_ERROR(dev->dev, "failed to enable pwr regulator: %d\n", ret);
+ goto err_pm_put;
+ }
if (config->pwr_clk_cnt > 0) {
DBG("pixclock: %lu", hdmi->pixclock);
@@ -39,8 +43,19 @@ static void msm_hdmi_power_on(struct drm_bridge *bridge)
if (ret) {
DRM_DEV_ERROR(dev->dev, "failed to enable pwr clk: %s (%d)\n",
config->pwr_clk_names[i], ret);
+ goto err_clk_unprepare;
}
}
+
+ return 0;
+
+err_clk_unprepare:
+ for (; i > 0; i--)
+ clk_disable_unprepare(hdmi->pwr_clks[i - 1]);
+ regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs);
+err_pm_put:
+ pm_runtime_put(&hdmi->pdev->dev);
+ return ret;
}
static void power_off(struct drm_bridge *bridge)
@@ -135,8 +150,13 @@ static void msm_hdmi_bridge_pre_enable(struct drm_bridge *bridge)
DBG("power up");
if (!hdmi->power_on) {
- msm_hdmi_phy_resource_enable(phy);
- msm_hdmi_power_on(bridge);
+ if (msm_hdmi_phy_resource_enable(phy))
+ return;
+
+ if (msm_hdmi_power_on(bridge)) {
+ msm_hdmi_phy_resource_disable(phy);
+ return;
+ }
hdmi->power_on = true;
if (hdmi->hdmi_mode) {
msm_hdmi_config_avi_infoframe(hdmi);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0055/1756] drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0054/1756] drm/msm/hdmi: Handle msm_hdmi_power_on() errors during .atomic_pre_enable() Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0056/1756] hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds Greg Kroah-Hartman
` (943 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pierre-Loup A. Griffais, Melissa Wen,
Alex Hung, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 81f923b065801c7d30042bcda31ccb9449b4f58b ]
Commit c2791297013e ("drm/amd/display: Add color bit info to freesync
infoframe") created the app_tf interface for FreeSync HDR and commit
c21a764a98cb ("drm/amd/display: Send PQ bit in AMD VSIF") used it to set
PB9 bit 5 (PQ EOTF) in v2/v3 AMD Freesync infopacket. However, Linux
never made use of this interface: DM ignores what userspace sets
regarding HDR and always passes TRANSFER_FUNC_UNKNOWN as app_tf, so the
PQ bit is never set in the infopacket received by the eDP panel.
Check the EOTF in the HDR static metadata and set the PQ bit in Freesync
infopacket for DP accordingly. This fixes gray-washed HDR on KDE/GNOME
on Framework 13 Pro AI 9 HX 370 (DCN 3.5) and may fix similar issues on
other VRR-capable panels that advertise Replay in its AMD VSDB.
It doesn't affect color/EOTF bits on infopackets for SDR and native
HDMI.
Reported-by: Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/3200
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b318f3e13dd73781404670d3b3c6cf2177e0119c)
Cc: stable@vger.kernel.org
[ sashal: inlined the upstream dm_dp_in_hdr_mode() condition in the existing update_freesync_state_on_stream() function ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 175cf9e1a24e7..0302109de6baa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8817,6 +8817,8 @@ static void prepare_flip_isr(struct amdgpu_crtc *acrtc)
acrtc->crtc_id);
}
+#define DP_HDR_SDP_EOTF_IDX 2
+
static void update_freesync_state_on_stream(
struct amdgpu_display_manager *dm,
struct dm_crtc_state *new_crtc_state,
@@ -8832,6 +8834,8 @@ static void update_freesync_state_on_stream(
bool pack_sdp_v1_3 = false;
struct amdgpu_dm_connector *aconn;
enum vrr_packet_type packet_type = PACKET_TYPE_VRR;
+ enum color_transfer_func app_tf;
+ const struct dc_info_packet *hdr;
if (!new_stream)
return;
@@ -8883,12 +8887,18 @@ static void update_freesync_state_on_stream(
&new_stream->adaptive_sync_infopacket);
}
+ hdr = &new_stream->hdr_static_metadata;
+ app_tf = dc_is_dp_signal(new_stream->signal) && hdr->valid &&
+ hdr->sb[DP_HDR_SDP_EOTF_IDX] == HDMI_EOTF_SMPTE_ST2084 ?
+ TRANSFER_FUNC_PQ2084 :
+ TRANSFER_FUNC_UNKNOWN;
+
mod_freesync_build_vrr_infopacket(
dm->freesync_module,
new_stream,
&vrr_params,
packet_type,
- TRANSFER_FUNC_UNKNOWN,
+ app_tf,
&vrr_infopacket,
pack_sdp_v1_3);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0056/1756] hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0055/1756] drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0057/1756] drm/amd/pm: populate unique ID for smu 13.0.7 Greg Kroah-Hartman
` (942 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Asaf Nuri Bertizlioğlu,
Guenter Roeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 95638f1f05ced75a82e83f610cd01b636d2a21b1 ]
In init_temp_data(), pdata->nr_cores is populated from
topology_num_cores_per_package() before allocating pdata->core_data. If
that allocation fails, init_temp_data() returns NULL with
pdata->core_data still NULL and pdata->nr_cores set to a positive value.
coretemp_add_core() logs the error without failing coretemp_cpu_online(),
so the CPU still comes online with pdata->hwmon_dev registered. When the
CPU is later taken offline (or the module is unloaded),
coretemp_cpu_offline() calls get_temp_data(pd, cpu), which loops up to
pdata->nr_cores and dereferences the NULL pdata->core_data pointer.
Store the core count in a local variable and assign pdata->nr_cores only
after pdata->core_data is allocated, preserving the invariant that
pdata->nr_cores is zero whenever pdata->core_data is NULL.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: 1a793caf6f69 ("hwmon: (coretemp) Use dynamic allocated memory for core temp_data")
Cc: stable@vger.kernel.org
Tested-by: Asaf Nuri Bertizlioğlu <ycistak@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[ sashal: used kcalloc() with NUM_REAL_CORES instead of kzalloc_objs() with topology_num_cores_per_package() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/coretemp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index cc81b849c09ef..7f8ff6dd16bfa 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -497,11 +497,13 @@ init_temp_data(struct platform_data *pdata, unsigned int cpu, int pkg_flag)
* Will replace hardcoded NUM_REAL_CORES with actual per package core count
* when this information becomes available.
*/
- pdata->nr_cores = NUM_REAL_CORES;
- pdata->core_data = kcalloc(pdata->nr_cores, sizeof(struct temp_data *),
+ int nr_cores = NUM_REAL_CORES;
+
+ pdata->core_data = kcalloc(nr_cores, sizeof(struct temp_data *),
GFP_KERNEL);
if (!pdata->core_data)
return NULL;
+ pdata->nr_cores = nr_cores;
}
tdata = kzalloc(sizeof(struct temp_data), GFP_KERNEL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0057/1756] drm/amd/pm: populate unique ID for smu 13.0.7
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0056/1756] hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0058/1756] btrfs: raid56: do not verify the content if there is no data checksum Greg Kroah-Hartman
` (941 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kevin Wang, Kenneth Feng,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Wang <kevin.wang@amd.com>
[ Upstream commit 079f9103d9cde68fb2ccc414e94520f43ee102de ]
The smu 13.0.7 backend does not register get_unique_id, leaving
adev->unique_id at zero and KFD topology without the stable GPU
identifier consumed by HIP.
The failure is observed at:
auto ierr = hipDeviceGetUuid(&uuid, 0);
Fixes: 113cc31dde66 ("drm/amd/pm: add SMU_13_0_7 ppt_funcs for SMU_13_0_7")
Signed-off-by: Kevin Wang <kevin.wang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5e2585daaf8336d9ce1bf52e55a9b7a8cdbf625b)
Cc: stable@vger.kernel.org
[ sashal: Moved smu_v13_0_7_get_unique_id() immediately before smu_v13_0_7_ppt_funcs because the upstream neighboring functions are absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
index 9467db88969c6..22420256750fa 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
@@ -2669,6 +2669,25 @@ static int smu_v13_0_7_set_power_limit(struct smu_context *smu,
return 0;
}
+static void smu_v13_0_7_get_unique_id(struct smu_context *smu)
+{
+ SmuMetricsExternal_t metrics_external;
+ SmuMetrics_t *metrics = &metrics_external.SmuMetrics;
+ struct amdgpu_device *adev = smu->adev;
+ u32 upper32 = 0, lower32 = 0;
+ int ret;
+
+ ret = smu_cmn_get_metrics_table(smu, &metrics_external, false);
+ if (ret)
+ goto out;
+
+ upper32 = metrics->PublicSerialNumberUpper;
+ lower32 = metrics->PublicSerialNumberLower;
+
+out:
+ adev->unique_id = ((u64)upper32 << 32) | lower32;
+}
+
static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
.get_allowed_feature_mask = smu_v13_0_7_get_allowed_feature_mask,
.set_default_dpm_table = smu_v13_0_7_set_default_dpm_table,
@@ -2739,6 +2758,7 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = {
.enable_uclk_shadow = smu_v13_0_enable_uclk_shadow,
.set_wbrf_exclusion_ranges = smu_v13_0_set_wbrf_exclusion_ranges,
.interrupt_work = smu_v13_0_interrupt_work,
+ .get_unique_id = smu_v13_0_7_get_unique_id,
};
void smu_v13_0_7_set_ppt_funcs(struct smu_context *smu)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0058/1756] btrfs: raid56: do not verify the content if there is no data checksum
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0057/1756] drm/amd/pm: populate unique ID for smu 13.0.7 Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0059/1756] ocfs2: validate move extents against a stable EOF Greg Kroah-Hartman
` (940 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bartosz Fenski, Filipe Manana,
Qu Wenruo, David Sterba, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <wqu@suse.com>
[ Upstream commit d00b85308abee300dfb7e1ac642f38bab9ec7492 ]
[BUG]
There is a bug report that fio can fail to sync the data on a degraded
RAID56 mount:
# mkfs.btrfs -m raid1 -d raid5 -f $dev1 $dev2 $dev3
# mount $dev1 $mnt
# btrfs balance start -d $mnt
# umount $mnt
# btrfs dev scan -u $dev2
# wipefs -fa $dev2
# mount -o degraded $dev1 $mnt
# fio --name=degraded-write --directory=$mnt --rw=randwrite --fdatasync=4 \
--bs=4k --size=512M --randrepeat=1
The run will fail at fsync:
fio: io_u error on file /mnt/btrfs/degraded-write.0.0: Input/output error: datasync offset=142254080, buflen=0
fio: pid=2064, err=5/file:io_u.c:2008, func=io_u error, error=Input/output error
[CAUSE]
With extra debug output, it shows the problem pretty well:
rbio=2876243968 faila=0 sectornr=0
rbio=2876243968 error=0-15 csum=2 bio=15
The first line shows the rbio's full stripe logical, and stripe/sector
number when verify_one_sector() failed.
The second line shows more detail about the rbio, the sector range [0, 16)
is corrupted, which indicates the first data stripe is corrupted, matching
the missing device.
The important part is that the csum bitmap shows the data csum is only
for sector number 2, meanwhile the failed verification is at sector
number 0.
This means we did the checksum verification even if no corresponding
checksum is populated.
[FIX]
There is already a similar check at verify_bio_data_sectors(), but
unfortunately there is no such check at verify_one_sector().
Add the missing check to skip the csum verification if there is no
corresponding data checksum.
Reported-by: Bartosz Fenski <bartosz@fenski.pl>
Link: https://lore.kernel.org/linux-btrfs/a72409af-45ef-45df-9970-2e38bcb22ea6@fenski.pl/
Fixes: 7a3150723061 ("btrfs: raid56: do data csum verification during RMW cycle")
CC: stable@vger.kernel.org
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: Adjusted verify_one_sector() context for the existing struct sector_ptr and btrfs_check_sector_csum() instead of physical-address helpers. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/raid56.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 8afadf994b8c8..9f8515370eb8d 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1789,6 +1789,8 @@ static int verify_one_sector(struct btrfs_raid_bio *rbio,
{
struct btrfs_fs_info *fs_info = rbio->bioc->fs_info;
struct sector_ptr *sector;
+ const unsigned int total_sector_nr =
+ stripe_nr * rbio->stripe_nsectors + sector_nr;
u8 csum_buf[BTRFS_CSUM_SIZE];
u8 *csum_expected;
int ret;
@@ -1799,6 +1801,11 @@ static int verify_one_sector(struct btrfs_raid_bio *rbio,
/* No way to verify P/Q as they are not covered by data csum. */
if (stripe_nr >= rbio->nr_data)
return 0;
+
+ /* No data checksum for this sector. */
+ if (!test_bit(total_sector_nr, rbio->csum_bitmap))
+ return 0;
+
/*
* If we're rebuilding a read, we have to use pages from the
* bio list if possible.
@@ -1811,9 +1818,7 @@ static int verify_one_sector(struct btrfs_raid_bio *rbio,
ASSERT(sector->page);
- csum_expected = rbio->csum_buf +
- (stripe_nr * rbio->stripe_nsectors + sector_nr) *
- fs_info->csum_size;
+ csum_expected = rbio->csum_buf + total_sector_nr * fs_info->csum_size;
ret = btrfs_check_sector_csum(fs_info, sector->page, sector->pgoff,
csum_buf, csum_expected);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0059/1756] ocfs2: validate move extents against a stable EOF
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0058/1756] btrfs: raid56: do not verify the content if there is no data checksum Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0060/1756] hwmon: (chipcap2) Switch to guard() for mutext handling Greg Kroah-Hartman
` (939 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Andrew Morton, Joseph Qi,
Mark Fasheh, Joel Becker, Heming Zhao, Jia-Ju Bai, jjzuming,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 84db6619cb702c37cf848b450c21b9c9706b0775 ]
The move-extents range must be bounded by the inode size used for extent
movement. ocfs2_ioctl_move_extents() checks and clamps the request before
taking the local inode and cluster locks in ocfs2_move_extents(). It also
uses separate i_size_read() calls for the range check and subtraction.
A concurrent truncate can invalidate the first check and make the later
unsigned subtraction underflow:
Move-extents ioctl Truncate
------------------ --------
check me_start <= i_size
take inode and cluster locks
shrink EOF below me_start
release locks
compare me_start + me_len with EOF
set me_len = EOF - me_start
[unsigned underflow]
acquire inode and cluster locks
select extents using the bad range
A truncate after clamping can also leave the range extending beyond EOF.
Conversely, the cached size may be smaller than the size refreshed when
the cluster inode lock is acquired. Early validation can then reject a
valid start or permanently shorten the requested length and threshold.
The me_start + me_len comparison can also wrap for a large input length.
Validate and adjust the original request once, after inode_lock(), the
exclusive rw lock and ocfs2_inode_lock() have stabilized and refreshed the
size. Read EOF once, reject a start beyond it, and bound the length by
EOF minus start. Normalize the threshold using the same EOF snapshot.
This keeps zero as the default-threshold sentinel until validation uses
the size that will govern extent movement.
Move goal validation after range adjustment as well. Its allocation-group
capacity check uses me_len and must see the EOF-clamped length. Both
validation failures use the existing inode-lock unwind path before any
extent movement or transaction starts.
Range errors now reach the ioctl's normal copyout path, as goal errors
already did. Unlike the old early rejection, a failed copyout can
therefore override -EINVAL with -EFAULT.
Link: https://lore.kernel.org/pm-ocfs2-move-extents-isize-rrw-v6-395bdee84ea81149068e@gmail.com
Fixes: 53069d4e7695 ("Ocfs2/move_extents: move/defrag extents within a certain range.")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Assisted-by: LLM
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: <jjzuming@gmail.com>
Cc: <stable@vger.kernel.org>
[ sashal: inlined the upstream range-validation helper into ocfs2_move_extents() to avoid adding a new function ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/move_extents.c | 62 ++++++++++++++++++++---------------------
1 file changed, 31 insertions(+), 31 deletions(-)
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index decf14ea21478..279726e5f7cfe 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -906,8 +906,10 @@ static int __ocfs2_move_extents_range(struct buffer_head *di_bh,
static int ocfs2_move_extents(struct ocfs2_move_extents_context *context)
{
int status;
+ u64 i_size;
handle_t *handle;
struct inode *inode = context->inode;
+ struct ocfs2_move_extents *range = context->range;
struct ocfs2_dinode *di;
struct buffer_head *di_bh = NULL;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
@@ -932,6 +934,35 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context)
goto out_rw_unlock;
}
+ i_size = i_size_read(inode);
+ if (range->me_start > i_size) {
+ status = -EINVAL;
+ mlog_errno(status);
+ goto out_inode_unlock;
+ }
+
+ if (range->me_len > i_size - range->me_start)
+ range->me_len = i_size - range->me_start;
+
+ /*
+ * The default threshold for defragmentation is 1 MiB, which
+ * matches the maximum OCFS2 cluster size.
+ */
+ if (!range->me_threshold)
+ range->me_threshold = 1024 * 1024;
+
+ if (range->me_threshold > i_size)
+ range->me_threshold = i_size;
+
+ /* The goal check depends on the adjusted range length. */
+ if (!context->auto_defrag) {
+ status = ocfs2_validate_and_adjust_move_goal(inode, context->range);
+ if (status) {
+ mlog_errno(status);
+ goto out_inode_unlock;
+ }
+ }
+
/*
* rememer ip_xattr_sem also needs to be held if necessary
*/
@@ -1024,49 +1055,18 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
goto out_free;
}
- if (range.me_start > i_size_read(inode)) {
- status = -EINVAL;
- goto out_free;
- }
-
- if (range.me_start + range.me_len > i_size_read(inode))
- range.me_len = i_size_read(inode) - range.me_start;
-
context->range = ⦥
- /*
- * ok, the default theshold for the defragmentation
- * is 1M, since our maximum clustersize was 1M also.
- * any thought?
- */
- if (!range.me_threshold)
- range.me_threshold = 1024 * 1024;
-
- if (range.me_threshold > i_size_read(inode))
- range.me_threshold = i_size_read(inode);
-
if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
context->auto_defrag = 1;
if (range.me_flags & OCFS2_MOVE_EXT_FL_PART_DEFRAG)
context->partial = 1;
- } else {
- /*
- * first best-effort attempt to validate and adjust the goal
- * (physical address in block), while it can't guarantee later
- * operation can succeed all the time since global_bitmap may
- * change a bit over time.
- */
-
- status = ocfs2_validate_and_adjust_move_goal(inode, &range);
- if (status)
- goto out_copy;
}
status = ocfs2_move_extents(context);
if (status)
mlog_errno(status);
-out_copy:
/*
* movement/defragmentation may end up being partially completed,
* that's the reason why we need to return userspace the finished
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0060/1756] hwmon: (chipcap2) Switch to guard() for mutext handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0059/1756] ocfs2: validate move extents against a stable EOF Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0061/1756] hwmon: (chipcap2) Drop unnecessary include files Greg Kroah-Hartman
` (938 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Javier Carrasco, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
[ Upstream commit 232ba88182083b4410df41cf310c9a16b84e547e ]
Switch to guard() for mutex handling to simplify the code, getting rid
of the 'ret = x, break; return ret;' construct and return the result
of the operation instead.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: bed5f0c075eb ("hwmon: chipcap2: serialize access to the alarm indicators")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/chipcap2.c | 63 ++++++++++++----------------------------
1 file changed, 18 insertions(+), 45 deletions(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 6a69c7699594b..2572710fb2384 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -13,6 +13,7 @@
#include <linux/bitfield.h>
#include <linux/bits.h>
+#include <linux/cleanup.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/hwmon.h>
@@ -573,55 +574,40 @@ static int cc2_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{
struct cc2_data *data = dev_get_drvdata(dev);
- int ret = 0;
- mutex_lock(&data->dev_access_lock);
+ guard(mutex)(&data->dev_access_lock);
switch (type) {
case hwmon_temp:
- ret = cc2_measurement(data, type, val);
- break;
+ return cc2_measurement(data, type, val);
case hwmon_humidity:
switch (attr) {
case hwmon_humidity_input:
- ret = cc2_measurement(data, type, val);
- break;
+ return cc2_measurement(data, type, val);
case hwmon_humidity_min:
- ret = cc2_get_reg_val(data, CC2_R_ALARM_L_ON, val);
- break;
+ return cc2_get_reg_val(data, CC2_R_ALARM_L_ON, val);
case hwmon_humidity_min_hyst:
- ret = cc2_get_reg_val(data, CC2_R_ALARM_L_OFF, val);
- break;
+ return cc2_get_reg_val(data, CC2_R_ALARM_L_OFF, val);
case hwmon_humidity_max:
- ret = cc2_get_reg_val(data, CC2_R_ALARM_H_ON, val);
- break;
+ return cc2_get_reg_val(data, CC2_R_ALARM_H_ON, val);
case hwmon_humidity_max_hyst:
- ret = cc2_get_reg_val(data, CC2_R_ALARM_H_OFF, val);
- break;
+ return cc2_get_reg_val(data, CC2_R_ALARM_H_OFF, val);
case hwmon_humidity_min_alarm:
- ret = cc2_humidity_min_alarm_status(data, val);
- break;
+ return cc2_humidity_min_alarm_status(data, val);
case hwmon_humidity_max_alarm:
- ret = cc2_humidity_max_alarm_status(data, val);
- break;
+ return cc2_humidity_max_alarm_status(data, val);
default:
- ret = -EOPNOTSUPP;
+ return -EOPNOTSUPP;
}
- break;
default:
- ret = -EOPNOTSUPP;
+ return -EOPNOTSUPP;
}
-
- mutex_unlock(&data->dev_access_lock);
-
- return ret;
}
static int cc2_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long val)
{
struct cc2_data *data = dev_get_drvdata(dev);
- int ret;
u16 arg;
u8 cmd;
@@ -631,41 +617,28 @@ static int cc2_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
if (val < 0 || val > CC2_RH_MAX)
return -EINVAL;
- mutex_lock(&data->dev_access_lock);
+ guard(mutex)(&data->dev_access_lock);
switch (attr) {
case hwmon_humidity_min:
cmd = CC2_W_ALARM_L_ON;
arg = cc2_rh_to_reg(val);
- ret = cc2_write_reg(data, cmd, arg);
- break;
-
+ return cc2_write_reg(data, cmd, arg);
case hwmon_humidity_min_hyst:
cmd = CC2_W_ALARM_L_OFF;
arg = cc2_rh_to_reg(val);
- ret = cc2_write_reg(data, cmd, arg);
- break;
-
+ return cc2_write_reg(data, cmd, arg);
case hwmon_humidity_max:
cmd = CC2_W_ALARM_H_ON;
arg = cc2_rh_to_reg(val);
- ret = cc2_write_reg(data, cmd, arg);
- break;
-
+ return cc2_write_reg(data, cmd, arg);
case hwmon_humidity_max_hyst:
cmd = CC2_W_ALARM_H_OFF;
arg = cc2_rh_to_reg(val);
- ret = cc2_write_reg(data, cmd, arg);
- break;
-
+ return cc2_write_reg(data, cmd, arg);
default:
- ret = -EOPNOTSUPP;
- break;
+ return -EOPNOTSUPP;
}
-
- mutex_unlock(&data->dev_access_lock);
-
- return ret;
}
static int cc2_get_irqs(struct cc2_data *data, struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0061/1756] hwmon: (chipcap2) Drop unnecessary include files
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0060/1756] hwmon: (chipcap2) Switch to guard() for mutext handling Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0062/1756] hwmon: chipcap2: serialize access to the alarm indicators Greg Kroah-Hartman
` (937 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 4c8d758d4ebff3780d09599f2c8db5d6af3ca2af ]
The driver does not perform any locking, does not execute or use any sleep
related functionality, and does not allocate memory. Drop the unnecessary
include files.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: bed5f0c075eb ("hwmon: chipcap2: serialize access to the alarm indicators")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/chipcap2.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 2572710fb2384..4a9c51c792aed 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -82,7 +82,6 @@ struct cc2_data {
struct completion complete;
struct device *hwmon;
struct i2c_client *client;
- struct mutex dev_access_lock; /* device access lock */
struct regulator *regulator;
const char *name;
int irq_ready;
@@ -575,8 +574,6 @@ static int cc2_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
{
struct cc2_data *data = dev_get_drvdata(dev);
- guard(mutex)(&data->dev_access_lock);
-
switch (type) {
case hwmon_temp:
return cc2_measurement(data, type, val);
@@ -617,8 +614,6 @@ static int cc2_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
if (val < 0 || val > CC2_RH_MAX)
return -EINVAL;
- guard(mutex)(&data->dev_access_lock);
-
switch (attr) {
case hwmon_humidity_min:
cmd = CC2_W_ALARM_L_ON;
@@ -712,8 +707,6 @@ static int cc2_probe(struct i2c_client *client)
i2c_set_clientdata(client, data);
- mutex_init(&data->dev_access_lock);
-
data->client = client;
data->regulator = devm_regulator_get_exclusive(dev, "vdd");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0062/1756] hwmon: chipcap2: serialize access to the alarm indicators
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0061/1756] hwmon: (chipcap2) Drop unnecessary include files Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0063/1756] hwmon: chipcap2: synchronize ready IRQ state Greg Kroah-Hartman
` (936 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Javier Carrasco, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
[ Upstream commit bed5f0c075eb99442fca6a61c009a32752eceda2 ]
low_alarm and high_alarm are accessed from the threaded interrupt
handlers and from sysfs without any locking, which can lead to lost
alarms.
Add a mutex to serialize the access to the alarm indicators and to
process_irqs, which the handlers use to decide whether an interrupt
belongs to an ongoing operation.
Fixes: 3af350929e75 ("hwmon: Add support for Amphenol ChipCap 2")
Cc: stable@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20261014-chipcap2_locks-v3-10-27ebfc2c5b9e@gmail.com
[groeck: Dropped obsolete 'Assisted-by: tag]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/chipcap2.c | 58 +++++++++++++++++++++++++---------------
1 file changed, 37 insertions(+), 21 deletions(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 4a9c51c792aed..8d2f7ba4c1789 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -20,6 +20,7 @@
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/unaligned.h>
#include <linux/regulator/consumer.h>
@@ -88,6 +89,8 @@ struct cc2_data {
int irq_low;
int irq_high;
bool process_irqs;
+ /* protects process_irqs and the alarm indicators */
+ struct mutex irq_lock;
bool regulator_enabled;
};
@@ -119,7 +122,8 @@ static int cc2_enable(struct cc2_data *data)
/* exclusive regulator, check in case a disable failed */
if (data->regulator_enabled) {
- data->process_irqs = true;
+ scoped_guard(mutex, &data->irq_lock)
+ data->process_irqs = true;
return 0;
}
@@ -134,7 +138,8 @@ static int cc2_enable(struct cc2_data *data)
usleep_range(CC2_STARTUP_TIME_US, CC2_STARTUP_TIME_US + 125);
- data->process_irqs = true;
+ scoped_guard(mutex, &data->irq_lock)
+ data->process_irqs = true;
return 0;
}
@@ -151,7 +156,8 @@ static void cc2_disable(struct cc2_data *data)
synchronize_irq(data->irq_high);
/* ignore alarms triggered by voltage toggling when powering up */
- data->process_irqs = false;
+ scoped_guard(mutex, &data->irq_lock)
+ data->process_irqs = false;
/* exclusive regulator, check in case an enable failed */
if (!data->regulator_enabled)
@@ -507,10 +513,12 @@ static irqreturn_t cc2_low_interrupt(int irq, void *data)
{
struct cc2_data *cc2 = data;
- if (cc2->process_irqs) {
- hwmon_notify_event(cc2->hwmon, hwmon_humidity,
- hwmon_humidity_min_alarm, 0);
- cc2->rh_alarm.low_alarm = true;
+ scoped_guard(mutex, &cc2->irq_lock) {
+ if (cc2->process_irqs) {
+ hwmon_notify_event(cc2->hwmon, hwmon_humidity,
+ hwmon_humidity_min_alarm, 0);
+ cc2->rh_alarm.low_alarm = true;
+ }
}
return IRQ_HANDLED;
@@ -520,10 +528,12 @@ static irqreturn_t cc2_high_interrupt(int irq, void *data)
{
struct cc2_data *cc2 = data;
- if (cc2->process_irqs) {
- hwmon_notify_event(cc2->hwmon, hwmon_humidity,
- hwmon_humidity_max_alarm, 0);
- cc2->rh_alarm.high_alarm = true;
+ scoped_guard(mutex, &cc2->irq_lock) {
+ if (cc2->process_irqs) {
+ hwmon_notify_event(cc2->hwmon, hwmon_humidity,
+ hwmon_humidity_max_alarm, 0);
+ cc2->rh_alarm.high_alarm = true;
+ }
}
return IRQ_HANDLED;
@@ -539,11 +549,13 @@ static int cc2_humidity_min_alarm_status(struct cc2_data *data, long *val)
if (ret < 0)
return ret;
- if (data->rh_alarm.low_alarm) {
- *val = (measurement < min_hyst) ? 1 : 0;
- data->rh_alarm.low_alarm = *val;
- } else {
- *val = 0;
+ scoped_guard(mutex, &data->irq_lock) {
+ if (data->rh_alarm.low_alarm) {
+ *val = (measurement < min_hyst) ? 1 : 0;
+ data->rh_alarm.low_alarm = *val;
+ } else {
+ *val = 0;
+ }
}
return 0;
@@ -559,11 +571,13 @@ static int cc2_humidity_max_alarm_status(struct cc2_data *data, long *val)
if (ret < 0)
return ret;
- if (data->rh_alarm.high_alarm) {
- *val = (measurement > max_hyst) ? 1 : 0;
- data->rh_alarm.high_alarm = *val;
- } else {
- *val = 0;
+ scoped_guard(mutex, &data->irq_lock) {
+ if (data->rh_alarm.high_alarm) {
+ *val = (measurement > max_hyst) ? 1 : 0;
+ data->rh_alarm.high_alarm = *val;
+ } else {
+ *val = 0;
+ }
}
return 0;
@@ -707,6 +721,8 @@ static int cc2_probe(struct i2c_client *client)
i2c_set_clientdata(client, data);
+ mutex_init(&data->irq_lock);
+
data->client = client;
data->regulator = devm_regulator_get_exclusive(dev, "vdd");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0063/1756] hwmon: chipcap2: synchronize ready IRQ state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0062/1756] hwmon: chipcap2: serialize access to the alarm indicators Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0064/1756] ksmbd: do not read past the DACL in the access denied debug message Greg Kroah-Hartman
` (935 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Javier Carrasco, Guenter Roeck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
[ Upstream commit 8c02722be2caa6604a837b81faeaba78250eda4a ]
The ready IRQ handler can race with reinit_completion() in the enable
path. In particular, a handler from an earlier operation can complete
the completion after it is reset for a new operation.
Use irq_lock to serialize access to the completion and process_irqs.
Disable IRQ processing and synchronize any running handler before resetting
the completion for a new operation.
Fixes: 3af350929e75 ("hwmon: Add support for Amphenol ChipCap 2")
Cc: stable@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20261014-chipcap2_locks-v3-11-27ebfc2c5b9e@gmail.com
[groeck: Dropped obsolete 'Assisted-by: tag]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/chipcap2.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 8d2f7ba4c1789..e466f8f39d52f 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -120,6 +120,16 @@ static int cc2_enable(struct cc2_data *data)
{
int ret;
+ if (data->irq_ready > 0) {
+ scoped_guard(mutex, &data->irq_lock)
+ data->process_irqs = false;
+
+ synchronize_irq(data->irq_ready);
+
+ scoped_guard(mutex, &data->irq_lock)
+ reinit_completion(&data->complete);
+ }
+
/* exclusive regulator, check in case a disable failed */
if (data->regulator_enabled) {
scoped_guard(mutex, &data->irq_lock)
@@ -127,9 +137,6 @@ static int cc2_enable(struct cc2_data *data)
return 0;
}
- /* clear any pending completion */
- try_wait_for_completion(&data->complete);
-
ret = regulator_enable(data->regulator);
if (ret < 0)
return ret;
@@ -159,6 +166,9 @@ static void cc2_disable(struct cc2_data *data)
scoped_guard(mutex, &data->irq_lock)
data->process_irqs = false;
+ if (data->irq_ready > 0)
+ synchronize_irq(data->irq_ready);
+
/* exclusive regulator, check in case an enable failed */
if (!data->regulator_enabled)
return;
@@ -503,8 +513,10 @@ static irqreturn_t cc2_ready_interrupt(int irq, void *data)
{
struct cc2_data *cc2 = data;
- if (cc2->process_irqs)
- complete(&cc2->complete);
+ scoped_guard(mutex, &cc2->irq_lock) {
+ if (cc2->process_irqs)
+ complete(&cc2->complete);
+ }
return IRQ_HANDLED;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0064/1756] ksmbd: do not read past the DACL in the access denied debug message
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0063/1756] hwmon: chipcap2: synchronize ready IRQ state Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0065/1756] cipso: stop modifying live ip_options_rcu Greg Kroah-Hartman
` (934 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
[ Upstream commit 8296a64df5448548f410fb246c1d88a93609602b ]
When smb_check_perm_dacl() falls back to the POSIX ACL and then denies
the request, its debug message prints the access mask of the ACE that
the second DACL walk stopped at. On that path the walk ran to the end
of the DACL, so the pointer is one past the last ACE. If the DACL is
the last part of the stored security descriptor, the message reads 4
bytes past the buffer, and KASAN reports a slab-out-of-bounds read in
smb_check_perm_dacl().
Print the requested and allowed masks instead. They are what the check
compares.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: adjusted context for the check_access_bits label and expanded access mask ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smbacl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index 63f7bccb4d9af..d8c01e775d941 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -1650,8 +1650,8 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
check_access_bits:
if (granted &
~(access_bits | FILE_READ_ATTRIBUTES | READ_CONTROL | WRITE_DAC | DELETE)) {
- ksmbd_debug(SMB, "Access denied with winACL, granted : %x, access_req : %x\n",
- granted, le32_to_cpu(ace->access_req));
+ ksmbd_debug(SMB, "Access denied with winACL, requested : %x, allowed : %x\n",
+ granted, access_bits);
rc = -EACCES;
goto err_out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0065/1756] cipso: stop modifying live ip_options_rcu
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0064/1756] ksmbd: do not read past the DACL in the access denied debug message Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0066/1756] Revert "x86/mm/pat: Use pr_warn() for early W^X warnings" Greg Kroah-Hartman
` (933 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jann Horn, Eric Dumazet, Paul Moore,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <jannh@google.com>
[ Upstream commit 1f2c5183fc0902892648f0453e38c0951cef3fec ]
cipso_v4_delopt() operates on the ip_options_rcu of a socket or a request
socket, and tries to remove CIPSO options from the middle by moving all
subsequent options.
That's not allowed - ip_options_rcu can be read locklessly and must always
be consistent. For example, ip_options_undo() reads trusted offsets and
length values from the options buffer.
Fix it by doing the modification in a copy.
The core change is in cipso_v4_delopt(), the rest is ugly plumbing to
propagate memory allocation failures.
Triggering this bug requires that the system is configured to use CIPSO.
(Setting up CIPSO requires privileges in init_user_ns.)
Fixes: f6d8bd051c39 ("inet: add RCU protection to inet->opt")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Acked-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/20261106-cipso-rcuopts-v1-1-31ae931d7a0f@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/cipso_ipv4.h | 11 ++++++-----
include/net/netlabel.h | 11 ++++++-----
net/ipv4/cipso_ipv4.c | 16 +++++++++++++---
net/netlabel/netlabel_kapi.c | 24 ++++++++++--------------
security/selinux/netlabel.c | 5 +++--
security/smack/smack_lsm.c | 14 +++++++++-----
6 files changed, 47 insertions(+), 34 deletions(-)
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index d6780d7903f4a..b41672221797b 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -185,12 +185,12 @@ int cipso_v4_sock_setattr(struct sock *sk,
const struct cipso_v4_doi *doi_def,
const struct netlbl_lsm_secattr *secattr,
bool sk_locked);
-void cipso_v4_sock_delattr(struct sock *sk);
+int cipso_v4_sock_delattr(struct sock *sk);
int cipso_v4_sock_getattr(struct sock *sk, struct netlbl_lsm_secattr *secattr);
int cipso_v4_req_setattr(struct request_sock *req,
const struct cipso_v4_doi *doi_def,
const struct netlbl_lsm_secattr *secattr);
-void cipso_v4_req_delattr(struct request_sock *req);
+int cipso_v4_req_delattr(struct request_sock *req);
int cipso_v4_skbuff_setattr(struct sk_buff *skb,
const struct cipso_v4_doi *doi_def,
const struct netlbl_lsm_secattr *secattr);
@@ -221,8 +221,9 @@ static inline int cipso_v4_sock_setattr(struct sock *sk,
return -ENOSYS;
}
-static inline void cipso_v4_sock_delattr(struct sock *sk)
+static inline int cipso_v4_sock_delattr(struct sock *sk)
{
+ return 0;
}
static inline int cipso_v4_sock_getattr(struct sock *sk,
@@ -238,9 +239,9 @@ static inline int cipso_v4_req_setattr(struct request_sock *req,
return -ENOSYS;
}
-static inline void cipso_v4_req_delattr(struct request_sock *req)
+static inline int cipso_v4_req_delattr(struct request_sock *req)
{
- return;
+ return 0;
}
static inline int cipso_v4_skbuff_setattr(struct sk_buff *skb,
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 529160f76cac2..93ff5889a2673 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -476,7 +476,7 @@ int netlbl_sock_setattr(struct sock *sk,
u16 family,
const struct netlbl_lsm_secattr *secattr,
bool sk_locked);
-void netlbl_sock_delattr(struct sock *sk);
+int netlbl_sock_delattr(struct sock *sk);
int netlbl_sock_getattr(struct sock *sk,
struct netlbl_lsm_secattr *secattr);
int netlbl_conn_setattr(struct sock *sk,
@@ -484,7 +484,7 @@ int netlbl_conn_setattr(struct sock *sk,
const struct netlbl_lsm_secattr *secattr);
int netlbl_req_setattr(struct request_sock *req,
const struct netlbl_lsm_secattr *secattr);
-void netlbl_req_delattr(struct request_sock *req);
+int netlbl_req_delattr(struct request_sock *req);
int netlbl_skbuff_setattr(struct sk_buff *skb,
u16 family,
const struct netlbl_lsm_secattr *secattr);
@@ -625,8 +625,9 @@ static inline int netlbl_sock_setattr(struct sock *sk,
{
return -ENOSYS;
}
-static inline void netlbl_sock_delattr(struct sock *sk)
+static inline int netlbl_sock_delattr(struct sock *sk)
{
+ return 0;
}
static inline int netlbl_sock_getattr(struct sock *sk,
struct netlbl_lsm_secattr *secattr)
@@ -644,9 +645,9 @@ static inline int netlbl_req_setattr(struct request_sock *req,
{
return -ENOSYS;
}
-static inline void netlbl_req_delattr(struct request_sock *req)
+static inline int netlbl_req_delattr(struct request_sock *req)
{
- return;
+ return 0;
}
static inline int netlbl_skbuff_setattr(struct sk_buff *skb,
u16 family,
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 019c16d6d6955..4b27b764ebf59 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -2006,11 +2006,16 @@ static int cipso_v4_delopt(struct ip_options_rcu __rcu **opt_ptr)
if (!opt || opt->opt.cipso == 0)
return 0;
if (opt->opt.srr || opt->opt.rr || opt->opt.ts || opt->opt.router_alert) {
+ struct ip_options_rcu *old_opt = opt;
u8 cipso_len;
u8 cipso_off;
unsigned char *cipso_ptr;
int optlen_new;
+ /* ip_options_rcu must not be modified in place, use a copy */
+ opt = kmemdup(opt, sizeof(*opt) + opt->opt.optlen, GFP_ATOMIC);
+ if (!opt)
+ return -ENOMEM;
cipso_off = opt->opt.cipso - sizeof(struct iphdr);
cipso_ptr = &opt->opt.__data[cipso_off];
cipso_len = cipso_ptr[1];
@@ -2038,6 +2043,8 @@ static int cipso_v4_delopt(struct ip_options_rcu __rcu **opt_ptr)
memset(&opt->opt.__data[optlen_new], IPOPT_END,
opt->opt.optlen - optlen_new);
+ rcu_assign_pointer(*opt_ptr, opt);
+ kfree_rcu(old_opt, rcu);
} else {
/* only the cipso option was present on the socket so we can
* remove the entire option struct */
@@ -2057,7 +2064,7 @@ static int cipso_v4_delopt(struct ip_options_rcu __rcu **opt_ptr)
* Removes the CIPSO option from a socket, if present.
*
*/
-void cipso_v4_sock_delattr(struct sock *sk)
+int cipso_v4_sock_delattr(struct sock *sk)
{
struct inet_sock *sk_inet;
int hdr_delta;
@@ -2070,6 +2077,7 @@ void cipso_v4_sock_delattr(struct sock *sk)
sk_conn->icsk_ext_hdr_len -= hdr_delta;
sk_conn->icsk_sync_mss(sk, sk_conn->icsk_pmtu_cookie);
}
+ return (hdr_delta < 0) ? hdr_delta : 0;
}
/**
@@ -2080,9 +2088,11 @@ void cipso_v4_sock_delattr(struct sock *sk)
* Removes the CIPSO option from a request socket, if present.
*
*/
-void cipso_v4_req_delattr(struct request_sock *req)
+int cipso_v4_req_delattr(struct request_sock *req)
{
- cipso_v4_delopt(&inet_rsk(req)->ireq_opt);
+ int hdr_delta = cipso_v4_delopt(&inet_rsk(req)->ireq_opt);
+
+ return (hdr_delta < 0) ? hdr_delta : 0;
}
/**
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 33b77084a4e5f..34ef835191dd2 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -1045,18 +1045,18 @@ int netlbl_sock_setattr(struct sock *sk,
* ensuring that @sk is locked.
*
*/
-void netlbl_sock_delattr(struct sock *sk)
+int netlbl_sock_delattr(struct sock *sk)
{
switch (sk->sk_family) {
case AF_INET:
- cipso_v4_sock_delattr(sk);
- break;
+ return cipso_v4_sock_delattr(sk);
#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
calipso_sock_delattr(sk);
break;
#endif /* IPv6 */
}
+ return 0;
}
/**
@@ -1156,8 +1156,7 @@ int netlbl_conn_setattr(struct sock *sk,
case NETLBL_NLTYPE_UNLABELED:
/* just delete the protocols we support for right now
* but we could remove other protocols if needed */
- netlbl_sock_delattr(sk);
- ret_val = 0;
+ ret_val = netlbl_sock_delattr(sk);
break;
default:
ret_val = -ENOENT;
@@ -1185,8 +1184,7 @@ int netlbl_conn_setattr(struct sock *sk,
case NETLBL_NLTYPE_UNLABELED:
/* just delete the protocols we support for right now
* but we could remove other protocols if needed */
- netlbl_sock_delattr(sk);
- ret_val = 0;
+ ret_val = netlbl_sock_delattr(sk);
break;
default:
ret_val = -ENOENT;
@@ -1234,8 +1232,7 @@ int netlbl_req_setattr(struct request_sock *req,
entry->cipso, secattr);
break;
case NETLBL_NLTYPE_UNLABELED:
- netlbl_req_delattr(req);
- ret_val = 0;
+ ret_val = netlbl_req_delattr(req);
break;
default:
ret_val = -ENOENT;
@@ -1255,8 +1252,7 @@ int netlbl_req_setattr(struct request_sock *req,
entry->calipso, secattr);
break;
case NETLBL_NLTYPE_UNLABELED:
- netlbl_req_delattr(req);
- ret_val = 0;
+ ret_val = netlbl_req_delattr(req);
break;
default:
ret_val = -ENOENT;
@@ -1280,18 +1276,18 @@ int netlbl_req_setattr(struct request_sock *req,
* Remove all the NetLabel labeling from @req.
*
*/
-void netlbl_req_delattr(struct request_sock *req)
+int netlbl_req_delattr(struct request_sock *req)
{
switch (req->rsk_ops->family) {
case AF_INET:
- cipso_v4_req_delattr(req);
- break;
+ return cipso_v4_req_delattr(req);
#if IS_ENABLED(CONFIG_IPV6)
case AF_INET6:
calipso_req_delattr(req);
break;
#endif /* IPv6 */
}
+ return 0;
}
/**
diff --git a/security/selinux/netlabel.c b/security/selinux/netlabel.c
index d51dfe8923122..24b11d1891d85 100644
--- a/security/selinux/netlabel.c
+++ b/security/selinux/netlabel.c
@@ -557,9 +557,10 @@ static int selinux_netlbl_socket_connect_helper(struct sock *sk,
* is set to AF_UNSPEC, if that is what is happening we want to reset
* the socket */
if (addr->sa_family == AF_UNSPEC) {
- netlbl_sock_delattr(sk);
+ rc = netlbl_sock_delattr(sk);
+ if (rc)
+ return rc;
sksec->nlbl_state = NLBL_REQSKB;
- rc = 0;
return rc;
}
secattr = selinux_netlbl_sock_genattr(sk);
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index c1c7b1409bf4c..2d39d001cedb9 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2665,22 +2665,26 @@ static int smack_netlbl_add(struct sock *sk)
*
* Remove the outbound smack value from a socket
*/
-static void smack_netlbl_delete(struct sock *sk)
+static int smack_netlbl_delete(struct sock *sk)
{
struct socket_smack *ssp = smack_sock(sk);
+ int rc;
/*
* Take the label off the socket if one is set.
*/
if (ssp->smk_state != SMK_NETLBL_LABELED)
- return;
+ return 0;
local_bh_disable();
bh_lock_sock_nested(sk);
- netlbl_sock_delattr(sk);
+ rc = netlbl_sock_delattr(sk);
bh_unlock_sock(sk);
local_bh_enable();
+ if (rc)
+ return rc;
ssp->smk_state = SMK_NETLBL_UNLABELED;
+ return 0;
}
/**
@@ -2720,7 +2724,7 @@ static int smk_ipv4_check(struct sock *sk, struct sockaddr_in *sap)
* Clear the socket netlabel if it's set.
*/
if (!rc)
- smack_netlbl_delete(sk);
+ rc = smack_netlbl_delete(sk);
}
rcu_read_unlock();
@@ -4564,7 +4568,7 @@ static int smack_inet_conn_request(const struct sock *sk, struct sk_buff *skb,
if (hskp == NULL)
rc = netlbl_req_setattr(req, &ssp->smk_out->smk_netlabel);
else
- netlbl_req_delattr(req);
+ rc = netlbl_req_delattr(req);
return rc;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0066/1756] Revert "x86/mm/pat: Use pr_warn() for early W^X warnings"
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0065/1756] cipso: stop modifying live ip_options_rcu Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0067/1756] Revert "x86/mm/pat: Fix effective RW computation in lookup_address_in_pgd_attr()" Greg Kroah-Hartman
` (932 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 091c44b2d3c3cdc943f0a1fdfe63f210cb1da0c4.
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/mm/pat/set_memory.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index de8f065706518..e3a20be305bdf 100644
--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -647,21 +647,6 @@ static inline pgprot_t verify_rwx(pgprot_t old, pgprot_t new, unsigned long star
return new;
end = start + npg * PAGE_SIZE - 1;
-
- /*
- * If the kernel text is still RWX, gently complain, this could be a
- * false positive.
- * Once debug_checkwx() becomes mandatory for CONFIG_STRICT_KERNEL_RWX,
- * the warning can be removed completely.
- */
- if (!kernel_set_to_readonly) {
- pr_warn_once("CPA detected W^X violation: %016llx -> %016llx range: 0x%016lx - 0x%016lx PFN %lx\n",
- (unsigned long long)pgprot_val(old),
- (unsigned long long)pgprot_val(new),
- start, end, pfn);
- return new;
- }
-
WARN_ONCE(1, "CPA detected W^X violation: %016llx -> %016llx range: 0x%016lx - 0x%016lx PFN %lx\n",
(unsigned long long)pgprot_val(old),
(unsigned long long)pgprot_val(new),
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0067/1756] Revert "x86/mm/pat: Fix effective RW computation in lookup_address_in_pgd_attr()"
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0066/1756] Revert "x86/mm/pat: Use pr_warn() for early W^X warnings" Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0068/1756] mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows Greg Kroah-Hartman
` (931 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 11d1ba991c0754b2c3c1e31aa63b0818afc6e4f7.
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/mm/pat/set_memory.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index e3a20be305bdf..69ceb967d73e9 100644
--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -682,7 +682,7 @@ pte_t *lookup_address_in_pgd_attr(pgd_t *pgd, unsigned long address,
*level = PG_LEVEL_512G;
*nx |= pgd_flags(*pgd) & _PAGE_NX;
- *rw &= !!(pgd_flags(*pgd) & _PAGE_RW);
+ *rw &= pgd_flags(*pgd) & _PAGE_RW;
p4d = p4d_offset(pgd, address);
if (p4d_none(*p4d))
@@ -693,7 +693,7 @@ pte_t *lookup_address_in_pgd_attr(pgd_t *pgd, unsigned long address,
*level = PG_LEVEL_1G;
*nx |= p4d_flags(*p4d) & _PAGE_NX;
- *rw &= !!(p4d_flags(*p4d) & _PAGE_RW);
+ *rw &= p4d_flags(*p4d) & _PAGE_RW;
pud = pud_offset(p4d, address);
if (pud_none(*pud))
@@ -704,7 +704,7 @@ pte_t *lookup_address_in_pgd_attr(pgd_t *pgd, unsigned long address,
*level = PG_LEVEL_2M;
*nx |= pud_flags(*pud) & _PAGE_NX;
- *rw &= !!(pud_flags(*pud) & _PAGE_RW);
+ *rw &= pud_flags(*pud) & _PAGE_RW;
pmd = pmd_offset(pud, address);
if (pmd_none(*pmd))
@@ -715,7 +715,7 @@ pte_t *lookup_address_in_pgd_attr(pgd_t *pgd, unsigned long address,
*level = PG_LEVEL_4K;
*nx |= pmd_flags(*pmd) & _PAGE_NX;
- *rw &= !!(pmd_flags(*pmd) & _PAGE_RW);
+ *rw &= pmd_flags(*pmd) & _PAGE_RW;
return pte_offset_kernel(pmd, address);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0068/1756] mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0067/1756] Revert "x86/mm/pat: Fix effective RW computation in lookup_address_in_pgd_attr()" Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0069/1756] scsi: target: Move I/O path stats to per CPU Greg Kroah-Hartman
` (930 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Stoakes (ARM), Andrew Morton,
Daehyeon Ko, Jose A. Perez de Azpillaga, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Stoakes (ARM) <ljs@kernel.org>
[ Upstream commit 7135a05838e85845e1bbf6caa6596a7e3b791a40 ]
So far the assumption has been that mm->mm_lock_seq overflow is benign,
resulting only in readers spuriously falling back to the mmap lock, however
it turns out that this was an unsafe assumption.
If a VMA can be spuriously considered write locked that means read lock
exclusion does not take place, and thus a VMA can end up write-locked with
concurrent readers.
Since overflow only occurs every 2^31 write lock/unlock cycles, resolve the
issue by resetting every VMA's vma->vm_lock_seq each time such an overflow
occurs.
This is done in vma_end_write_all(), which is called when the mmap write
lock is released, i.e. in mmap_write_unlock() and mmap_write_downgrade().
Care must be taken, as resetting the sequence count at overflow means
changing the seqcount of VMAs which are already attached and observable.
The mm's seqcount is guaranteed to be odd when a write lock is held, and
thus any write locked VMA will have an odd seqcount assigned.
Therefore resetting to an even value prevents spurious write locks, since
these can only occur with the mmap write lock held, at which point the mmap
seqcount will be odd.
However, vma_start_read() also checks vma->vm_lock_seq == mm->mm_lock_seq,
bailing if so (indicating a write lock).
This would cause any even reset value chosen to prevent VMA read locks from
being taken - avoid this by also checking whether the VMA seqcount is odd
before bailing on the read lock.
So far, vma->vm_lock_seq has defaulted to UINT_MAX, but this has been
unnecessary since commit e5e7fb278e59 ("mm: convert mm_lock_seq to a proper
seqcount"), since this is assigned when the VMA is still detached, and
cannot be observed.
Therefore perform both reset and initialisation of vma->vm_lock_seq by
simply setting vma->vm_lock_seq to zero.
The reset, performed in __mm_reset_vma_seqcounts(), only needs to
WRITE_ONCE() the value.
However the read of vma->vm_lock_seq in vma_start_read() needs to have
acquire semantics to pair with the smp_wmb() in do_raw_write_seqcount_end()
so a reader reading a reset value also observes VMA modifications made
under the write lock.
Since all VMA write locks were just released and the mmap write lock is
still held, there are no concurrent VMA writers.
Concurrent VMA readers are unaffected. New VMA readers observe either zero,
never a write lock, or the prior seqcount, behaving as before the reset.
Since this only occurs every 2^31 write lock/unlock cycles, the time taken
to update all VMAs is considered to be acceptable.
Also update comments to reflect the change.
User facing effects are - dangerous races that could cause memory
corruption or NULL pointer derefences (especially on page table traversal)
are avoided.
Fixes: 5e31275cc997 ("mm: add per-VMA lock and helper functions to control it")
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Daehyeon Ko <4ncienth@gmail.com>
Closes: https://lore.kernel.org/all/20261015143735.1630957-1-4ncienth@gmail.com/
Reviewed-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Tested-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Cc: <stable@vger.kernel.org>
[ ljs - Applied to the rwsem-based vma_start_read() in mm.h, dropped doc and test changes. ]
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/mm.h | 46 ++++++++++++++++++++++++++++++++-------
include/linux/mm_types.h | 13 +++++++----
include/linux/mmap_lock.h | 16 ++++++++++++++
kernel/fork.c | 2 +-
mm/mmap_lock.c | 39 +++++++++++++++++++++++++++++++++
5 files changed, 103 insertions(+), 13 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f05962963e28d..81e973784d3be 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -684,6 +684,22 @@ static inline void vma_numab_state_free(struct vm_area_struct *vma) {}
#endif /* CONFIG_NUMA_BALANCING */
#ifdef CONFIG_PER_VMA_LOCK
+/* Do the VMA, mm seqcounts indicate the VMA is write locked? */
+static inline bool vma_seqcount_is_write_locked(unsigned int vma_seq,
+ unsigned int mm_seq)
+{
+ /* VMA and mm sequence numbers must match for a write lock. */
+ if (vma_seq != mm_seq)
+ return false;
+
+ /*
+ * The VMA seqcount is always odd if locked. An even value can only be
+ * the zero assigned on allocation or stored by
+ * __mm_reset_vma_seqcounts(), never a write lock.
+ */
+ return vma_seq & 1;
+}
+
/*
* Try to read-lock a vma. The function is allowed to occasionally yield false
* locked result to avoid performance overhead, in which case we fall back to
@@ -691,6 +707,9 @@ static inline void vma_numab_state_free(struct vm_area_struct *vma) {}
*/
static inline bool vma_start_read(struct vm_area_struct *vma)
{
+ unsigned int vma_seq;
+ unsigned int mm_seq;
+
/*
* Check before locking. A race might cause false locked result.
* We can use READ_ONCE() for the mm_lock_seq here, and don't need
@@ -698,24 +717,35 @@ static inline bool vma_start_read(struct vm_area_struct *vma)
* we don't rely on for anything - the mm_lock_seq read against which we
* need ordering is below.
*/
- if (READ_ONCE(vma->vm_lock_seq) == READ_ONCE(vma->vm_mm->mm_lock_seq.sequence))
+ vma_seq = READ_ONCE(vma->vm_lock_seq);
+ mm_seq = READ_ONCE(vma->vm_mm->mm_lock_seq.sequence);
+ if (vma_seqcount_is_write_locked(vma_seq, mm_seq))
return false;
if (unlikely(down_read_trylock(&vma->vm_lock->lock) == 0))
return false;
/*
- * Overflow might produce false locked result.
- * False unlocked result is impossible because we modify and check
+ * False unlocked result is impossible because a write lock sets
* vma->vm_lock_seq under vma->vm_lock protection and mm->mm_lock_seq
* modification invalidates all existing locks.
*
- * We must use ACQUIRE semantics for the mm_lock_seq so that if we are
- * racing with vma_end_write_all(), we only start reading from the VMA
- * after it has been unlocked.
- * This pairs with RELEASE semantics in vma_end_write_all().
+ * ACQUIRE semantics are required for both reads.
+ *
+ * __mm_reset_vma_seqcounts() might reset vma->vm_lock_seq to zero
+ * after an overflow. A reader observing that zero must also observe
+ * the VMA modifications made under the write lock which just ended, so
+ * the ACQUIRE pairs with the smp_wmb() in do_raw_write_seqcount_end()
+ * that precedes the reset stores.
+ *
+ * The ACQUIRE semantics for the mm_lock_seq read is required so that,
+ * if we are racing with vma_end_write_all(), we only start reading from
+ * the VMA after it has been unlocked. This pairs with the RELEASE
+ * semantics in vma_end_write_all().
*/
- if (unlikely(vma->vm_lock_seq == raw_read_seqcount(&vma->vm_mm->mm_lock_seq))) {
+ vma_seq = smp_load_acquire(&vma->vm_lock_seq);
+ mm_seq = raw_read_seqcount(&vma->vm_mm->mm_lock_seq);
+ if (unlikely(vma_seqcount_is_write_locked(vma_seq, mm_seq))) {
up_read(&vma->vm_lock->lock);
return false;
}
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 3deb3f1d5ad26..6a45cb93092d9 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -750,15 +750,20 @@ struct vm_area_struct {
* Can only be written (using WRITE_ONCE()) while holding both:
* - mmap_lock (in write mode)
* - vm_lock->lock (in write mode)
+ * The one exception is __mm_reset_vma_seqcounts(), which stores zero
+ * (an even value, which can never indicate a write lock) under the
+ * mmap write lock alone once the mm seqcount has wrapped, so a reader
+ * holding only vm_lock->lock may observe the value change from odd to
+ * zero.
* Can be read reliably while holding one of:
* - mmap_lock (in read or write mode)
- * - vm_lock->lock (in read or write mode)
+ * - vm_lock->lock (in write mode)
* Can be read unreliably (using READ_ONCE()) for pessimistic bailout
* while holding nothing (except RCU to keep the VMA struct allocated).
*
- * This sequence counter is explicitly allowed to overflow; sequence
- * counter reuse can only lead to occasional unnecessary use of the
- * slowpath.
+ * Assigned the (odd) mm seqcount on write lock and not updated on
+ * unlock, so a stale value would alias the mm seqcount again 2^31 write
+ * lock/unlock cycles later. The reset described above prevents this.
*/
unsigned int vm_lock_seq;
/* Unstable RCU readers are allowed to read this. */
diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h
index e74f3720c9399..49cb7792c2108 100644
--- a/include/linux/mmap_lock.h
+++ b/include/linux/mmap_lock.h
@@ -127,6 +127,10 @@ static inline int __must_check mmap_write_lock_killable(struct mm_struct *mm)
return ret;
}
+#ifdef CONFIG_PER_VMA_LOCK
+void __mm_reset_vma_seqcounts(struct mm_struct *mm);
+#endif
+
/*
* Drop all currently-held per-VMA locks.
* This is called from the mmap_lock implementation directly before releasing
@@ -139,6 +143,18 @@ static inline void vma_end_write_all(struct mm_struct *mm)
{
mmap_assert_write_locked(mm);
mm_lock_seqcount_end(mm);
+
+#ifdef CONFIG_PER_VMA_LOCK
+ /*
+ * VMA seqcounts are not updated on unlock, so once the mm seqcount has
+ * wrapped, any VMA still carrying a sequence number from before the
+ * wrap would satisfy __is_vma_write_locked() when that number comes
+ * round again, and readers would not be excluded. Reset every VMA's
+ * seqcount so that no stale value survives the wrap.
+ */
+ if (unlikely(!mm->mm_lock_seq.sequence))
+ __mm_reset_vma_seqcounts(mm);
+#endif
}
static inline void mmap_write_unlock(struct mm_struct *mm)
diff --git a/kernel/fork.c b/kernel/fork.c
index 140a615daf42e..a4139e5765a33 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -450,7 +450,7 @@ static bool vma_lock_alloc(struct vm_area_struct *vma)
return false;
init_rwsem(&vma->vm_lock->lock);
- vma->vm_lock_seq = UINT_MAX;
+ vma->vm_lock_seq = 0;
return true;
}
diff --git a/mm/mmap_lock.c b/mm/mmap_lock.c
index 368b840e75082..05bec3cc1c46d 100644
--- a/mm/mmap_lock.c
+++ b/mm/mmap_lock.c
@@ -109,3 +109,42 @@ void __mmap_lock_do_trace_released(struct mm_struct *mm, bool write)
}
EXPORT_SYMBOL(__mmap_lock_do_trace_released);
#endif /* CONFIG_TRACING */
+
+#ifdef CONFIG_PER_VMA_LOCK
+/*
+ * Called with mmap write lock held after mm->mm_lock_seq just overflowed (and
+ * therefore zero), with all VMA write locks now released.
+ *
+ * The stores below follow the smp_wmb() in do_raw_write_seqcount_end(), so
+ * a reader that observes a reset value also observes this cycle's VMA
+ * modifications (ordered by the ACQUIRE on vma->vm_lock_seq in
+ * vma_start_read()).
+ */
+void __mm_reset_vma_seqcounts(struct mm_struct *mm)
+{
+ struct vm_area_struct *vma;
+ VMA_ITERATOR(vmi, mm, 0);
+
+ mmap_assert_write_locked(mm);
+ VM_WARN_ON_ONCE(mm->mm_lock_seq.sequence);
+
+ /*
+ * Failing to reset means stale vma->vm_lock_seq values could result in
+ * those VMAs becoming spuriously write locked when mm->mm_lock_seq
+ * happens to match their values.
+ *
+ * This is problematic, as it causes the VMA write lock to not exclude
+ * readers, which can result in concurrent readers while a VMA write
+ * lock is held.
+ *
+ * Avoid this by resetting to an even value (indicates no write lock
+ * held).
+ *
+ * Readers will either observe zero (not write locked) or the previous
+ * value, so this is safe.
+ */
+ for_each_vma(vmi, vma)
+ WRITE_ONCE(vma->vm_lock_seq, 0);
+}
+EXPORT_SYMBOL(__mm_reset_vma_seqcounts);
+#endif /* CONFIG_PER_VMA_LOCK */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0069/1756] scsi: target: Move I/O path stats to per CPU
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0068/1756] mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0070/1756] scsi: target: Fix demo-mode dynamic ACL dev-entry UAF vs LUN teardown Greg Kroah-Hartman
` (929 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Hannes Reinecke,
Martin K. Petersen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <michael.christie@oracle.com>
[ Upstream commit 9cf2317b795d6cde0fccb8744b5a080a9586020e ]
The atomic use in the main I/O path is causing perf issues when using
higher performance backend devices and multiple queues. This moves the
stats to per CPU. Combined with the next patch that moves the
non_ordered/delayed_cmd_count to per CPU, IOPS by up to 33% for 8K IOS
when using 4 or more queues.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20250424032741.16216-2-michael.christie@oracle.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: 6a6e7d7230cd ("scsi: target: Fix demo-mode dynamic ACL dev-entry UAF vs LUN teardown")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/target_core_device.c | 69 +++++++++++++++++++++--------
drivers/target/target_core_stat.c | 69 ++++++++++++++++++++++++-----
include/target/target_core_base.h | 20 ++++++---
3 files changed, 121 insertions(+), 37 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index d1ae3df069a4f..87cae55df2382 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -55,14 +55,14 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd)
rcu_read_lock();
deve = target_nacl_find_deve(nacl, se_cmd->orig_fe_lun);
if (deve) {
- atomic_long_inc(&deve->total_cmds);
+ this_cpu_inc(deve->stats->total_cmds);
if (se_cmd->data_direction == DMA_TO_DEVICE)
- atomic_long_add(se_cmd->data_length,
- &deve->write_bytes);
+ this_cpu_add(deve->stats->write_bytes,
+ se_cmd->data_length);
else if (se_cmd->data_direction == DMA_FROM_DEVICE)
- atomic_long_add(se_cmd->data_length,
- &deve->read_bytes);
+ this_cpu_add(deve->stats->read_bytes,
+ se_cmd->data_length);
if ((se_cmd->data_direction == DMA_TO_DEVICE) &&
deve->lun_access_ro) {
@@ -126,14 +126,14 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd)
* target_core_fabric_configfs.c:target_fabric_port_release
*/
se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev);
- atomic_long_inc(&se_cmd->se_dev->num_cmds);
+ this_cpu_inc(se_cmd->se_dev->stats->total_cmds);
if (se_cmd->data_direction == DMA_TO_DEVICE)
- atomic_long_add(se_cmd->data_length,
- &se_cmd->se_dev->write_bytes);
+ this_cpu_add(se_cmd->se_dev->stats->write_bytes,
+ se_cmd->data_length);
else if (se_cmd->data_direction == DMA_FROM_DEVICE)
- atomic_long_add(se_cmd->data_length,
- &se_cmd->se_dev->read_bytes);
+ this_cpu_add(se_cmd->se_dev->stats->read_bytes,
+ se_cmd->data_length);
return ret;
}
@@ -322,6 +322,7 @@ int core_enable_device_list_for_node(
struct se_portal_group *tpg)
{
struct se_dev_entry *orig, *new;
+ int ret = 0;
new = kzalloc(sizeof(*new), GFP_KERNEL);
if (!new) {
@@ -329,6 +330,12 @@ int core_enable_device_list_for_node(
return -ENOMEM;
}
+ new->stats = alloc_percpu(struct se_dev_entry_io_stats);
+ if (!new->stats) {
+ ret = -ENOMEM;
+ goto free_deve;
+ }
+
spin_lock_init(&new->ua_lock);
INIT_LIST_HEAD(&new->ua_list);
INIT_LIST_HEAD(&new->lun_link);
@@ -351,8 +358,8 @@ int core_enable_device_list_for_node(
" for dynamic -> explicit NodeACL conversion:"
" %s\n", nacl->initiatorname);
mutex_unlock(&nacl->lun_entry_mutex);
- kfree(new);
- return -EINVAL;
+ ret = -EINVAL;
+ goto free_stats;
}
if (orig->se_lun_acl != NULL) {
pr_warn_ratelimited("Detected existing explicit"
@@ -360,8 +367,8 @@ int core_enable_device_list_for_node(
" mapped_lun: %llu, failing\n",
nacl->initiatorname, mapped_lun);
mutex_unlock(&nacl->lun_entry_mutex);
- kfree(new);
- return -EINVAL;
+ ret = -EINVAL;
+ goto free_stats;
}
new->se_lun = lun;
@@ -394,6 +401,20 @@ int core_enable_device_list_for_node(
target_luns_data_has_changed(nacl, new, true);
return 0;
+
+free_stats:
+ free_percpu(new->stats);
+free_deve:
+ kfree(new);
+ return ret;
+}
+
+static void target_free_dev_entry(struct rcu_head *head)
+{
+ struct se_dev_entry *deve = container_of(head, struct se_dev_entry,
+ rcu_head);
+ free_percpu(deve->stats);
+ kfree(deve);
}
void core_disable_device_list_for_node(
@@ -443,7 +464,7 @@ void core_disable_device_list_for_node(
kref_put(&orig->pr_kref, target_pr_kref_release);
wait_for_completion(&orig->pr_comp);
- kfree_rcu(orig, rcu_head);
+ call_rcu(&orig->rcu_head, target_free_dev_entry);
core_scsi3_free_pr_reg_from_nacl(dev, nacl);
target_luns_data_has_changed(nacl, NULL, false);
@@ -689,11 +710,13 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
if (!dev)
return NULL;
+ dev->stats = alloc_percpu(struct se_dev_io_stats);
+ if (!dev->stats)
+ goto free_device;
+
dev->queues = kcalloc(nr_cpu_ids, sizeof(*dev->queues), GFP_KERNEL);
- if (!dev->queues) {
- hba->backend->ops->free_device(dev);
- return NULL;
- }
+ if (!dev->queues)
+ goto free_stats;
dev->queue_cnt = nr_cpu_ids;
for (i = 0; i < dev->queue_cnt; i++) {
@@ -707,6 +730,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
INIT_WORK(&q->sq.work, target_queued_submit_work);
}
+
dev->se_hba = hba;
dev->transport = hba->backend->ops;
dev->transport_flags = dev->transport->transport_flags_default;
@@ -791,6 +815,12 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
sizeof(dev->t10_wwn.revision));
return dev;
+
+free_stats:
+ free_percpu(dev->stats);
+free_device:
+ hba->backend->ops->free_device(dev);
+ return NULL;
}
/*
@@ -1001,6 +1031,7 @@ void target_free_device(struct se_device *dev)
dev->transport->free_prot(dev);
kfree(dev->queues);
+ free_percpu(dev->stats);
dev->transport->free_device(dev);
}
diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
index c42cbde8a31b3..576d07a8484e3 100644
--- a/drivers/target/target_core_stat.c
+++ b/drivers/target/target_core_stat.c
@@ -280,30 +280,51 @@ static ssize_t target_stat_lu_num_cmds_show(struct config_item *item,
char *page)
{
struct se_device *dev = to_stat_lu_dev(item);
+ struct se_dev_io_stats *stats;
+ unsigned int cpu;
+ u32 cmds = 0;
+
+ for_each_possible_cpu(cpu) {
+ stats = per_cpu_ptr(dev->stats, cpu);
+ cmds += stats->total_cmds;
+ }
/* scsiLuNumCommands */
- return snprintf(page, PAGE_SIZE, "%lu\n",
- atomic_long_read(&dev->num_cmds));
+ return snprintf(page, PAGE_SIZE, "%u\n", cmds);
}
static ssize_t target_stat_lu_read_mbytes_show(struct config_item *item,
char *page)
{
struct se_device *dev = to_stat_lu_dev(item);
+ struct se_dev_io_stats *stats;
+ unsigned int cpu;
+ u32 bytes = 0;
+
+ for_each_possible_cpu(cpu) {
+ stats = per_cpu_ptr(dev->stats, cpu);
+ bytes += stats->read_bytes;
+ }
/* scsiLuReadMegaBytes */
- return snprintf(page, PAGE_SIZE, "%lu\n",
- atomic_long_read(&dev->read_bytes) >> 20);
+ return snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
}
static ssize_t target_stat_lu_write_mbytes_show(struct config_item *item,
char *page)
{
struct se_device *dev = to_stat_lu_dev(item);
+ struct se_dev_io_stats *stats;
+ unsigned int cpu;
+ u32 bytes = 0;
+
+ for_each_possible_cpu(cpu) {
+ stats = per_cpu_ptr(dev->stats, cpu);
+ bytes += stats->write_bytes;
+ }
/* scsiLuWrittenMegaBytes */
- return snprintf(page, PAGE_SIZE, "%lu\n",
- atomic_long_read(&dev->write_bytes) >> 20);
+ return snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
}
static ssize_t target_stat_lu_resets_show(struct config_item *item, char *page)
@@ -1019,8 +1040,11 @@ static ssize_t target_stat_auth_num_cmds_show(struct config_item *item,
{
struct se_lun_acl *lacl = auth_to_lacl(item);
struct se_node_acl *nacl = lacl->se_lun_nacl;
+ struct se_dev_entry_io_stats *stats;
struct se_dev_entry *deve;
+ unsigned int cpu;
ssize_t ret;
+ u32 cmds = 0;
rcu_read_lock();
deve = target_nacl_find_deve(nacl, lacl->mapped_lun);
@@ -1028,9 +1052,14 @@ static ssize_t target_stat_auth_num_cmds_show(struct config_item *item,
rcu_read_unlock();
return -ENODEV;
}
+
+ for_each_possible_cpu(cpu) {
+ stats = per_cpu_ptr(deve->stats, cpu);
+ cmds += stats->total_cmds;
+ }
+
/* scsiAuthIntrOutCommands */
- ret = snprintf(page, PAGE_SIZE, "%lu\n",
- atomic_long_read(&deve->total_cmds));
+ ret = snprintf(page, PAGE_SIZE, "%u\n", cmds);
rcu_read_unlock();
return ret;
}
@@ -1040,8 +1069,11 @@ static ssize_t target_stat_auth_read_mbytes_show(struct config_item *item,
{
struct se_lun_acl *lacl = auth_to_lacl(item);
struct se_node_acl *nacl = lacl->se_lun_nacl;
+ struct se_dev_entry_io_stats *stats;
struct se_dev_entry *deve;
+ unsigned int cpu;
ssize_t ret;
+ u32 bytes = 0;
rcu_read_lock();
deve = target_nacl_find_deve(nacl, lacl->mapped_lun);
@@ -1049,9 +1081,14 @@ static ssize_t target_stat_auth_read_mbytes_show(struct config_item *item,
rcu_read_unlock();
return -ENODEV;
}
+
+ for_each_possible_cpu(cpu) {
+ stats = per_cpu_ptr(deve->stats, cpu);
+ bytes += stats->read_bytes;
+ }
+
/* scsiAuthIntrReadMegaBytes */
- ret = snprintf(page, PAGE_SIZE, "%u\n",
- (u32)(atomic_long_read(&deve->read_bytes) >> 20));
+ ret = snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
rcu_read_unlock();
return ret;
}
@@ -1061,8 +1098,11 @@ static ssize_t target_stat_auth_write_mbytes_show(struct config_item *item,
{
struct se_lun_acl *lacl = auth_to_lacl(item);
struct se_node_acl *nacl = lacl->se_lun_nacl;
+ struct se_dev_entry_io_stats *stats;
struct se_dev_entry *deve;
+ unsigned int cpu;
ssize_t ret;
+ u32 bytes = 0;
rcu_read_lock();
deve = target_nacl_find_deve(nacl, lacl->mapped_lun);
@@ -1070,9 +1110,14 @@ static ssize_t target_stat_auth_write_mbytes_show(struct config_item *item,
rcu_read_unlock();
return -ENODEV;
}
+
+ for_each_possible_cpu(cpu) {
+ stats = per_cpu_ptr(deve->stats, cpu);
+ bytes += stats->write_bytes;
+ }
+
/* scsiAuthIntrWrittenMegaBytes */
- ret = snprintf(page, PAGE_SIZE, "%u\n",
- (u32)(atomic_long_read(&deve->write_bytes) >> 20));
+ ret = snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
rcu_read_unlock();
return ret;
}
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 97099a5e3f6c8..05e3673607b8c 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -669,15 +669,19 @@ struct se_lun_acl {
struct se_ml_stat_grps ml_stat_grps;
};
+struct se_dev_entry_io_stats {
+ u32 total_cmds;
+ u32 read_bytes;
+ u32 write_bytes;
+};
+
struct se_dev_entry {
u64 mapped_lun;
u64 pr_res_key;
u64 creation_time;
bool lun_access_ro;
u32 attach_count;
- atomic_long_t total_cmds;
- atomic_long_t read_bytes;
- atomic_long_t write_bytes;
+ struct se_dev_entry_io_stats __percpu *stats;
/* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */
struct kref pr_kref;
struct completion pr_comp;
@@ -800,6 +804,12 @@ struct se_device_queue {
struct se_cmd_queue sq;
};
+struct se_dev_io_stats {
+ u32 total_cmds;
+ u32 read_bytes;
+ u32 write_bytes;
+};
+
struct se_device {
/* Used for SAM Task Attribute ordering */
u32 dev_cur_ordered_id;
@@ -821,9 +831,7 @@ struct se_device {
atomic_long_t num_resets;
atomic_long_t aborts_complete;
atomic_long_t aborts_no_task;
- atomic_long_t num_cmds;
- atomic_long_t read_bytes;
- atomic_long_t write_bytes;
+ struct se_dev_io_stats __percpu *stats;
/* Active commands on this virtual SE device */
atomic_t non_ordered;
bool ordered_sync_in_progress;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0070/1756] scsi: target: Fix demo-mode dynamic ACL dev-entry UAF vs LUN teardown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0069/1756] scsi: target: Move I/O path stats to per CPU Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0071/1756] scsi: target: Fix LUN/device R/W and total command stats Greg Kroah-Hartman
` (928 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yu Zhang,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhang <yuz08559@gmail.com>
[ Upstream commit 6a6e7d7230cd4e0a6c003bae5b85bf37a1e77b94 ]
A demo-mode (generate_node_acls=1) login that allocates a dynamic NodeACL
populates that ACL's per-LUN dev entries in core_tpg_add_node_to_devs()
*before* the ACL is linked onto tpg->acl_node_list by
target_add_node_acl():
core_tpg_check_initiator_node_acl():
...
core_tpg_add_node_to_devs(acl, tpg, NULL); /* builds deves */
target_add_node_acl(acl); /* only now listed */
The LUN teardown sweep, core_clear_lun_from_tpg(), enumerates only
tpg->acl_node_list, so a dev entry whose ACL is still in the window above
is invisible to the sweep and is never disabled. It is left on the
se_lun->lun_deve_list after core_tpg_remove_lun() frees the se_lun; when
the same unpacked_lun is later re-added and the se_lun is reallocated at
the same address, the stale dev entry is rediscovered by
target_nacl_find_deve() and core_enable_device_list_for_node() corrupts
lun_deve_list:
BUG: KASAN: slab-use-after-free ...
core_enable_device_list_for_node+0x5ce/0x880
core_tpg_add_node_to_devs+0x169/0x190
core_dev_add_lun+0x146/0x190
target_fabric_port_link+0xe9/0x1b0
configfs_symlink+0x381/0xae0
__x64_sys_symlink+0x55/0x80
The demo-mode login path that drives the ACL/dev-entry creation is
reachable by an unauthenticated initiator; the colliding LUN add/remove is
a local configfs operation.
Commit 49cb77e297dc ("target: Avoid mappedlun symlink creation during lun
shutdown") introduced se_lun->lun_shutdown and guarded the *explicit* ACL
MappedLUN path (target_fabric_mappedlun_link()), but the demo-mode
automatic path, core_tpg_add_node_to_devs() ->
core_enable_device_list_for_node(), was never given the equivalent guard,
and the publish-after-populate ordering in
core_tpg_check_initiator_node_acl() was left unchanged.
Fix it in three cooperating parts:
1) Publish the dynamic NodeACL onto acl_node_list *before* creating its
dev entries, so the teardown sweep can observe them.
2) Refuse to attach a dev entry to an se_lun that is shutting down,
checked under nacl->lun_entry_mutex -- the same lock the sweep takes --
so once the sweep has passed an ACL any later enable for that LUN
observes lun_shutdown and skips it.
3) In core_enable_device_list_for_node(), insert the new dev entry onto
lun->lun_deve_list while still holding nacl->lun_entry_mutex, in both
the replace and the new-entry branch. Previously the entry was added
to nacl->lun_entry_hlist under the mutex but to lun->lun_deve_list only
after dropping it; with the ACL now published early, the sweep could
take the mutex in that gap, find the entry on the hlist,
core_disable_device_list_for_node() it (list_del() on the not-yet-
linked lun_link succeeds and the entry is freed), and then the enable
would list_add_tail() the freed entry back onto lun_deve_list. Linking
both lists under the mutex makes enable and the sweep mutually
exclusive, closing that window.
core_tpg_add_node_to_devs() already ignores the return value of
core_enable_device_list_for_node(), so a shutting-down LUN is simply
skipped.
Cc: stable@vger.kernel.org
Fixes: 49cb77e297dc ("target: Avoid mappedlun symlink creation during lun shutdown")
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Tested-by: Yu Zhang <yuz08559@gmail.com>
Link: https://patch.msgid.link/20261014013746.46705-1-yuz08559@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/target_core_device.c | 18 +++++++++++++++---
drivers/target/target_core_tpg.c | 10 +++++++++-
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 87cae55df2382..ef170aee34d5b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -349,6 +349,19 @@ int core_enable_device_list_for_node(
new->attach_count++;
mutex_lock(&nacl->lun_entry_mutex);
+ /*
+ * Do not attach a new dev entry to an se_lun that is being torn down.
+ * lun_shutdown is set by core_tpg_remove_lun() before its
+ * core_clear_lun_from_tpg() sweep; checking it here under the same
+ * nacl->lun_entry_mutex the sweep takes guarantees that once the sweep
+ * has passed this ACL no dev entry can be left dangling on the
+ * se_lun->lun_deve_list that is about to be freed.
+ */
+ if (lun->lun_shutdown) {
+ mutex_unlock(&nacl->lun_entry_mutex);
+ ret = -ENODEV;
+ goto free_stats;
+ }
orig = target_nacl_find_deve(nacl, mapped_lun);
if (orig && orig->se_lun) {
struct se_lun *orig_lun = orig->se_lun;
@@ -375,12 +388,12 @@ int core_enable_device_list_for_node(
new->se_lun_acl = lun_acl;
hlist_del_rcu(&orig->link);
hlist_add_head_rcu(&new->link, &nacl->lun_entry_hlist);
- mutex_unlock(&nacl->lun_entry_mutex);
spin_lock(&lun->lun_deve_lock);
list_del(&orig->lun_link);
list_add_tail(&new->lun_link, &lun->lun_deve_list);
spin_unlock(&lun->lun_deve_lock);
+ mutex_unlock(&nacl->lun_entry_mutex);
kref_put(&orig->pr_kref, target_pr_kref_release);
wait_for_completion(&orig->pr_comp);
@@ -393,11 +406,10 @@ int core_enable_device_list_for_node(
new->se_lun = lun;
new->se_lun_acl = lun_acl;
hlist_add_head_rcu(&new->link, &nacl->lun_entry_hlist);
- mutex_unlock(&nacl->lun_entry_mutex);
-
spin_lock(&lun->lun_deve_lock);
list_add_tail(&new->lun_link, &lun->lun_deve_list);
spin_unlock(&lun->lun_deve_lock);
+ mutex_unlock(&nacl->lun_entry_mutex);
target_luns_data_has_changed(nacl, new, true);
return 0;
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c
index c0e429e5ef310..d8f4538e48dc7 100644
--- a/drivers/target/target_core_tpg.c
+++ b/drivers/target/target_core_tpg.c
@@ -266,6 +266,15 @@ struct se_node_acl *core_tpg_check_initiator_node_acl(
kref_get(&acl->acl_kref);
acl->dynamic_node_acl = 1;
+ /*
+ * Publish the dynamic NodeACL on tpg->acl_node_list before creating
+ * its demo-mode MappedLUN dev entries below, so that a concurrent LUN
+ * teardown sweep (core_clear_lun_from_tpg(), which walks acl_node_list)
+ * can observe and disable those dev entries. Otherwise a dev entry can
+ * be left on an se_lun->lun_deve_list that is about to be freed.
+ */
+ target_add_node_acl(acl);
+
/*
* Here we only create demo-mode MappedLUNs from the active
* TPG LUNs if the fabric is not explicitly asking for
@@ -275,7 +284,6 @@ struct se_node_acl *core_tpg_check_initiator_node_acl(
(tpg->se_tpg_tfo->tpg_check_demo_mode_login_only(tpg) != 1))
core_tpg_add_node_to_devs(acl, tpg, NULL);
- target_add_node_acl(acl);
return acl;
}
EXPORT_SYMBOL(core_tpg_check_initiator_node_acl);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0071/1756] scsi: target: Fix LUN/device R/W and total command stats
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0070/1756] scsi: target: Fix demo-mode dynamic ACL dev-entry UAF vs LUN teardown Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0072/1756] KVM: arm64: vgic-its: Dont map an LPI from more than one event Greg Kroah-Hartman
` (927 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Dmitry Bogdanov,
Martin K. Petersen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <michael.christie@oracle.com>
[ Upstream commit 95aa2041c654161d1b5c1eca5379d67d91ef1cf2 ]
In commit 9cf2317b795d ("scsi: target: Move I/O path stats to per CPU")
I saw we sometimes use %u and also misread the spec. As a result I
thought all the stats were supposed to be 32-bit only. However, for the
majority of cases we support currently, the spec specifies u64 bit
stats. This patch converts the stats changed in the commit above to u64.
Fixes: 9cf2317b795d ("scsi: target: Move I/O path stats to per CPU")
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Link: https://patch.msgid.link/20250917221338.14813-2-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/target_core_stat.c | 24 ++++++++++++------------
include/target/target_core_base.h | 12 ++++++------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
index 576d07a8484e3..cd57db809d31e 100644
--- a/drivers/target/target_core_stat.c
+++ b/drivers/target/target_core_stat.c
@@ -282,7 +282,7 @@ static ssize_t target_stat_lu_num_cmds_show(struct config_item *item,
struct se_device *dev = to_stat_lu_dev(item);
struct se_dev_io_stats *stats;
unsigned int cpu;
- u32 cmds = 0;
+ u64 cmds = 0;
for_each_possible_cpu(cpu) {
stats = per_cpu_ptr(dev->stats, cpu);
@@ -290,7 +290,7 @@ static ssize_t target_stat_lu_num_cmds_show(struct config_item *item,
}
/* scsiLuNumCommands */
- return snprintf(page, PAGE_SIZE, "%u\n", cmds);
+ return snprintf(page, PAGE_SIZE, "%llu\n", cmds);
}
static ssize_t target_stat_lu_read_mbytes_show(struct config_item *item,
@@ -299,7 +299,7 @@ static ssize_t target_stat_lu_read_mbytes_show(struct config_item *item,
struct se_device *dev = to_stat_lu_dev(item);
struct se_dev_io_stats *stats;
unsigned int cpu;
- u32 bytes = 0;
+ u64 bytes = 0;
for_each_possible_cpu(cpu) {
stats = per_cpu_ptr(dev->stats, cpu);
@@ -307,7 +307,7 @@ static ssize_t target_stat_lu_read_mbytes_show(struct config_item *item,
}
/* scsiLuReadMegaBytes */
- return snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
+ return snprintf(page, PAGE_SIZE, "%llu\n", bytes >> 20);
}
static ssize_t target_stat_lu_write_mbytes_show(struct config_item *item,
@@ -316,7 +316,7 @@ static ssize_t target_stat_lu_write_mbytes_show(struct config_item *item,
struct se_device *dev = to_stat_lu_dev(item);
struct se_dev_io_stats *stats;
unsigned int cpu;
- u32 bytes = 0;
+ u64 bytes = 0;
for_each_possible_cpu(cpu) {
stats = per_cpu_ptr(dev->stats, cpu);
@@ -324,7 +324,7 @@ static ssize_t target_stat_lu_write_mbytes_show(struct config_item *item,
}
/* scsiLuWrittenMegaBytes */
- return snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
+ return snprintf(page, PAGE_SIZE, "%llu\n", bytes >> 20);
}
static ssize_t target_stat_lu_resets_show(struct config_item *item, char *page)
@@ -1044,7 +1044,7 @@ static ssize_t target_stat_auth_num_cmds_show(struct config_item *item,
struct se_dev_entry *deve;
unsigned int cpu;
ssize_t ret;
- u32 cmds = 0;
+ u64 cmds = 0;
rcu_read_lock();
deve = target_nacl_find_deve(nacl, lacl->mapped_lun);
@@ -1059,7 +1059,7 @@ static ssize_t target_stat_auth_num_cmds_show(struct config_item *item,
}
/* scsiAuthIntrOutCommands */
- ret = snprintf(page, PAGE_SIZE, "%u\n", cmds);
+ ret = snprintf(page, PAGE_SIZE, "%llu\n", cmds);
rcu_read_unlock();
return ret;
}
@@ -1073,7 +1073,7 @@ static ssize_t target_stat_auth_read_mbytes_show(struct config_item *item,
struct se_dev_entry *deve;
unsigned int cpu;
ssize_t ret;
- u32 bytes = 0;
+ u64 bytes = 0;
rcu_read_lock();
deve = target_nacl_find_deve(nacl, lacl->mapped_lun);
@@ -1088,7 +1088,7 @@ static ssize_t target_stat_auth_read_mbytes_show(struct config_item *item,
}
/* scsiAuthIntrReadMegaBytes */
- ret = snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
+ ret = snprintf(page, PAGE_SIZE, "%llu\n", bytes >> 20);
rcu_read_unlock();
return ret;
}
@@ -1102,7 +1102,7 @@ static ssize_t target_stat_auth_write_mbytes_show(struct config_item *item,
struct se_dev_entry *deve;
unsigned int cpu;
ssize_t ret;
- u32 bytes = 0;
+ u64 bytes = 0;
rcu_read_lock();
deve = target_nacl_find_deve(nacl, lacl->mapped_lun);
@@ -1117,7 +1117,7 @@ static ssize_t target_stat_auth_write_mbytes_show(struct config_item *item,
}
/* scsiAuthIntrWrittenMegaBytes */
- ret = snprintf(page, PAGE_SIZE, "%u\n", bytes >> 20);
+ ret = snprintf(page, PAGE_SIZE, "%llu\n", bytes >> 20);
rcu_read_unlock();
return ret;
}
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 05e3673607b8c..69efd10e2844c 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -670,9 +670,9 @@ struct se_lun_acl {
};
struct se_dev_entry_io_stats {
- u32 total_cmds;
- u32 read_bytes;
- u32 write_bytes;
+ u64 total_cmds;
+ u64 read_bytes;
+ u64 write_bytes;
};
struct se_dev_entry {
@@ -805,9 +805,9 @@ struct se_device_queue {
};
struct se_dev_io_stats {
- u32 total_cmds;
- u32 read_bytes;
- u32 write_bytes;
+ u64 total_cmds;
+ u64 read_bytes;
+ u64 write_bytes;
};
struct se_device {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0072/1756] KVM: arm64: vgic-its: Dont map an LPI from more than one event
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0071/1756] scsi: target: Fix LUN/device R/W and total command stats Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0073/1756] l2tp: snapshot sequencing state when building transmit headers Greg Kroah-Hartman
` (926 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marc Zyngier, Fuad Tabba,
Oliver Upton, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fuad Tabba <fuad.tabba@linux.dev>
[ Upstream commit de81b28f0b83b22163d7d9a9b708d7aa912e0ef7 ]
KVM keeps one vgic_irq per LPI. A MAPTI of an LPI whose vgic_irq
already exists reuses it for the new ITE and leaves its target vCPU as
it was. Mapping one LPI from two events is UNPREDICTABLE (IHI 0069H.b,
5.2.10), but nothing stops a guest from doing it. If the first MAPTI
names a collection the guest never maps and the second a mapped one,
the LPI translates through the second event with a NULL target vCPU.
When the VMM routes an assigned device's MSI to that event on a host
with GICv4 enabled, kvm_vgic_v4_set_forwarding() takes the vPE from the
NULL target vCPU and the host oopses:
Unable to handle kernel paging request at virtual address 0000000000001980
[...]
Call trace:
its_build_vmapti_cmd (drivers/irqchip/irq-gic-v3-its.c:943) (P)
its_irq_set_vcpu_affinity (drivers/irqchip/irq-gic-v3-its.c:1380)
irq_set_vcpu_affinity (kernel/irq/manage.c:670)
its_map_vlpi (drivers/irqchip/irq-gic-v4.c:326)
kvm_vgic_v4_set_forwarding (arch/arm64/kvm/vgic/vgic-v4.c:485)
kvm_arch_irq_bypass_add_producer (arch/arm64/kvm/arm.c:2977)
irq_bypass_register_consumer (virt/lib/irqbypass.c:44)
kvm_irqfd (arch/arm64/kvm/../../../virt/kvm/eventfd.c:496)
kvm_vm_ioctl (arch/arm64/kvm/../../../virt/kvm/kvm_main.c:5270)
Track in each vgic_irq whether an ITE maps it. Drop a MAPTI of an LPI
that is already mapped, as a failed MAPTI already is. Restoring the ITS
tables keeps the first ITE it reads for each LPI and drops any later
one, so a guest saved with a double mapping still restores. Key the
check on the mapping, not on the vgic_irq. A vgic_irq outlives its ITE
while anything holds a reference to it, such as the vCPU it was last
queued on. A later MAPTI of such an LPI succeeds as before, and now
retargets it to its collection.
Fixes: 196b136498b35 ("KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass")
Suggested-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/20261013081646.933312-2-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
[ sashal: added the missing irq_lock cleanup while retaining the unmap WARN_ON() and defining mapped as a plain bool. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kvm/vgic/vgic-its.c | 37 +++++++++++++++++++++++++++++-----
include/kvm/arm_vgic.h | 1 +
2 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
index e13e25dddd528..cff18e79a3ac5 100644
--- a/arch/arm64/kvm/vgic/vgic-its.c
+++ b/arch/arm64/kvm/vgic/vgic-its.c
@@ -786,12 +786,18 @@ int vgic_its_inject_msi(struct kvm *kvm, struct kvm_msi *msi)
/* Requires the its_lock to be held. */
static void its_free_ite(struct kvm *kvm, struct its_ite *ite)
{
+ struct vgic_irq *irq = ite->irq;
list_del(&ite->ite_list);
/* This put matches the get in vgic_add_lpi. */
- if (ite->irq) {
- if (ite->irq->hw)
- WARN_ON(its_unmap_vlpi(ite->irq->host_irq));
+ if (irq) {
+ scoped_guard(raw_spinlock_irqsave, &irq->irq_lock) {
+ if (irq->hw)
+ WARN_ON(its_unmap_vlpi(ite->irq->host_irq));
+
+ irq->hw = false;
+ irq->mapped = false;
+ }
vgic_put_irq(kvm, ite->irq);
}
@@ -799,6 +805,23 @@ static void its_free_ite(struct kvm *kvm, struct its_ite *ite)
kfree(ite);
}
+/* Mapping one LPI from two events is UNPREDICTABLE: the first ITE keeps it. */
+static bool vgic_its_map_lpi(struct kvm *kvm, struct its_ite *ite,
+ struct vgic_irq *irq, struct kvm_vcpu *vcpu)
+{
+ scoped_guard(raw_spinlock_irqsave, &irq->irq_lock) {
+ if (!irq->mapped) {
+ irq->mapped = true;
+ irq->target_vcpu = vcpu;
+ ite->irq = irq;
+ return true;
+ }
+ }
+
+ vgic_put_irq(kvm, irq);
+ return false;
+}
+
static u64 its_cmd_mask_field(u64 *its_cmd, int word, int shift, int size)
{
return (le64_to_cpu(its_cmd[word]) >> shift) & (BIT_ULL(size) - 1);
@@ -1108,13 +1131,14 @@ static int vgic_its_cmd_handle_mapi(struct kvm *kvm, struct vgic_its *its,
vcpu = collection_to_vcpu(kvm, collection);
irq = vgic_add_lpi(kvm, lpi_nr, vcpu);
+ if (!IS_ERR(irq) && !vgic_its_map_lpi(kvm, ite, irq, vcpu))
+ irq = ERR_PTR(-EEXIST);
if (IS_ERR(irq)) {
if (new_coll)
vgic_its_free_collection(its, coll_id);
its_free_ite(kvm, ite);
return PTR_ERR(irq);
}
- ite->irq = irq;
return 0;
}
@@ -2223,7 +2247,10 @@ static int vgic_its_restore_ite(struct vgic_its *its, u32 event_id,
its_free_ite(kvm, ite);
return PTR_ERR(irq);
}
- ite->irq = irq;
+
+ /* Drop an ITE whose LPI another ITE maps, as MAPTI does. */
+ if (!vgic_its_map_lpi(kvm, ite, irq, vcpu))
+ its_free_ite(kvm, ite);
return offset;
}
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index f5172549f9ba0..6c2b1ac1e9671 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -139,6 +139,7 @@ struct vgic_irq {
bool active; /* not used for LPIs */
bool enabled;
bool hw; /* Tied to HW IRQ */
+ bool mapped; /* LPIs: mapped by an ITE */
struct kref refcount; /* Used for LPIs */
u32 hwintid; /* HW INTID number */
unsigned int host_irq; /* linux irq corresponding to hwintid */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0073/1756] l2tp: snapshot sequencing state when building transmit headers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0072/1756] KVM: arm64: vgic-its: Dont map an LPI from more than one event Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0074/1756] mm/hugetlb: fix mremap deadlock when PMD sharing is possible Greg Kroah-Hartman
` (925 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Paolo Abeni,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
[ Upstream commit d06ae66516e1aaf023808912af6292aef09d46c3 ]
Updates to send_seq from netlink, PPP setsockopt and receive-side
negotiation race with packet transmission. The header length is updated
separately, while transmit reads both fields repeatedly without
synchronization.
For example, transmit can push a ten-byte L2TPv2 header, then a concurrent
writer clears send_seq before the header builder reads it. The builder
writes only six bytes, leaving four bytes of uninitialized skb headroom
in the outgoing packet. The reverse mismatch overwrites the beginning of
the payload. A later hdr_len read can also make the UDP length disagree
with the skb length.
KCSAN reported:
BUG: KCSAN: data-race in l2tp_session_set_header_len / l2tp_xmit_skb
write to 0xffff888100d0944a of 2 bytes by task 116 on cpu 1:
l2tp_session_set_header_len+0x81/0xc0
l2tp_nl_cmd_session_modify+0x122/0x2c0
genl_family_rcv_msg_doit+0x170/0x1d0
read to 0xffff888100d0944a of 2 bytes by task 115 on cpu 0:
l2tp_xmit_skb+0x9c/0xc80
pppol2tp_sendmsg+0x21c/0x2a0
__sys_sendto+0x28c/0x2a0
The bug can lead to leak kernel base address for KASLR bypass, the
corresponding reproducer can be provided per request.
Initialize hdr_len to the maximum header size and leave it unchanged
when sequencing is toggled. Snapshot send_seq once per packet and use
that snapshot for the actual header length and header construction,
including the sequence flag. Use the same length for headroom, the header
push and the UDP length. PPP callers can safely reserve the maximum size;
L2TPv3 header sizes do not depend on sequencing.
Make send_seq a separate bool so READ_ONCE() and WRITE_ONCE() can be used
without sharing a bitfield storage unit with other configuration flags.
Preserve the netlink attribute's existing low-bit truncation.
Fixes: 3557baabf280 ("[L2TP]: PPP over L2TP driver core")
Cc: stable@vger.kernel.org
Assisted-by: GPT-6 Astra
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Link: https://patch.msgid.link/20261013090500.1180376-1-nicoyip.dev@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ sashal: adapted the setsockopt change to preserve existing PPP channel header-length updates ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/l2tp/l2tp_core.c | 51 +++++++++++++++++++----------------------
net/l2tp/l2tp_core.h | 6 ++---
net/l2tp/l2tp_debugfs.c | 4 ++--
net/l2tp/l2tp_netlink.c | 11 ++++-----
net/l2tp/l2tp_ppp.c | 8 +++----
5 files changed, 35 insertions(+), 45 deletions(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 6c83cb02d4345..4f7f2d986c00a 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -924,11 +924,9 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
* check if we sre sending sequence numbers and if not,
* configure it so.
*/
- if (!session->lns_mode && !session->send_seq) {
+ if (!session->lns_mode && !READ_ONCE(session->send_seq)) {
trace_session_seqnum_lns_enable(session);
- session->send_seq = 1;
- l2tp_session_set_header_len(session, tunnel->version,
- tunnel->encap);
+ WRITE_ONCE(session->send_seq, true);
}
} else {
/* No sequence numbers.
@@ -946,12 +944,10 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
* If we're the LNS and we're sending sequence numbers, the
* LAC is broken. Discard the frame.
*/
- if (!session->lns_mode && session->send_seq) {
+ if (!session->lns_mode && READ_ONCE(session->send_seq)) {
trace_session_seqnum_lns_disable(session);
- session->send_seq = 0;
- l2tp_session_set_header_len(session, tunnel->version,
- tunnel->encap);
- } else if (session->send_seq) {
+ WRITE_ONCE(session->send_seq, false);
+ } else if (READ_ONCE(session->send_seq)) {
pr_debug_ratelimited("%s: recv data has no seq numbers when required. Discarding.\n",
session->name);
atomic_long_inc(&session->stats.rx_seq_discards);
@@ -1147,7 +1143,8 @@ static void l2tp_udp_encap_err_recv(struct sock *sk, struct sk_buff *skb, int er
/* Build an L2TP header for the session into the buffer provided.
*/
-static int l2tp_build_l2tpv2_header(struct l2tp_session *session, void *buf)
+static int l2tp_build_l2tpv2_header(struct l2tp_session *session, void *buf,
+ bool send_seq)
{
struct l2tp_tunnel *tunnel = session->tunnel;
__be16 *bufp = buf;
@@ -1156,14 +1153,14 @@ static int l2tp_build_l2tpv2_header(struct l2tp_session *session, void *buf)
u32 tunnel_id = tunnel->peer_tunnel_id;
u32 session_id = session->peer_session_id;
- if (session->send_seq)
+ if (send_seq)
flags |= L2TP_HDRFLAG_S;
/* Setup L2TP header. */
*bufp++ = htons(flags);
*bufp++ = htons(tunnel_id);
*bufp++ = htons(session_id);
- if (session->send_seq) {
+ if (send_seq) {
*bufp++ = htons(session->ns);
*bufp++ = 0;
session->ns++;
@@ -1174,7 +1171,8 @@ static int l2tp_build_l2tpv2_header(struct l2tp_session *session, void *buf)
return bufp - optr;
}
-static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf)
+static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf,
+ bool send_seq)
{
struct l2tp_tunnel *tunnel = session->tunnel;
char *bufp = buf;
@@ -1200,7 +1198,7 @@ static int l2tp_build_l2tpv3_header(struct l2tp_session *session, void *buf)
if (session->l2specific_type == L2TP_L2SPECTYPE_DEFAULT) {
u32 l2h = 0;
- if (session->send_seq) {
+ if (send_seq) {
l2h = 0x40000000 | session->ns;
session->ns++;
session->ns &= 0xffffff;
@@ -1234,19 +1232,24 @@ static int l2tp_xmit_queue(struct l2tp_tunnel *tunnel, struct sk_buff *skb, stru
static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, unsigned int *len)
{
struct l2tp_tunnel *tunnel = session->tunnel;
+ bool send_seq = READ_ONCE(session->send_seq);
unsigned int data_len = skb->len;
struct sock *sk = tunnel->sock;
+ u16 hdr_len = session->hdr_len;
int headroom, uhlen, udp_len;
int ret = NET_XMIT_SUCCESS;
struct inet_sock *inet;
struct udphdr *uh;
+ if (tunnel->version == L2TP_HDR_VER_2 && !send_seq)
+ hdr_len -= 4;
+
/* Check that there's enough headroom in the skb to insert IP,
* UDP and L2TP headers. If not enough, expand it to
* make room. Adjust truesize.
*/
uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(*uh) : 0;
- headroom = NET_SKB_PAD + sizeof(struct iphdr) + uhlen + session->hdr_len;
+ headroom = NET_SKB_PAD + sizeof(struct iphdr) + uhlen + hdr_len;
if (skb_cow_head(skb, headroom)) {
kfree_skb(skb);
return NET_XMIT_DROP;
@@ -1254,9 +1257,9 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, uns
/* Setup L2TP header */
if (tunnel->version == L2TP_HDR_VER_2)
- l2tp_build_l2tpv2_header(session, __skb_push(skb, session->hdr_len));
+ l2tp_build_l2tpv2_header(session, __skb_push(skb, hdr_len), send_seq);
else
- l2tp_build_l2tpv3_header(session, __skb_push(skb, session->hdr_len));
+ l2tp_build_l2tpv3_header(session, __skb_push(skb, hdr_len), send_seq);
/* Reset skb netfilter state */
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
@@ -1299,7 +1302,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, uns
uh = udp_hdr(skb);
uh->source = inet->inet_sport;
uh->dest = inet->inet_dport;
- udp_len = uhlen + session->hdr_len + data_len;
+ udp_len = uhlen + hdr_len + data_len;
if (udp_len > U16_MAX) {
kfree_skb(skb);
ret = NET_XMIT_DROP;
@@ -1768,16 +1771,11 @@ static void l2tp_session_del_work(struct work_struct *work)
l2tp_session_put(session);
}
-/* We come here whenever a session's send_seq, cookie_len or
- * l2specific_type parameters are set.
- */
-void l2tp_session_set_header_len(struct l2tp_session *session, int version,
- enum l2tp_encap_type encap)
+static void l2tp_session_set_header_len(struct l2tp_session *session, int version,
+ enum l2tp_encap_type encap)
{
if (version == L2TP_HDR_VER_2) {
- session->hdr_len = 6;
- if (session->send_seq)
- session->hdr_len += 4;
+ session->hdr_len = 10;
} else {
session->hdr_len = 4 + session->cookie_len;
session->hdr_len += l2tp_get_l2specific_len(session);
@@ -1785,7 +1783,6 @@ void l2tp_session_set_header_len(struct l2tp_session *session, int version,
session->hdr_len += 4;
}
}
-EXPORT_SYMBOL_GPL(l2tp_session_set_header_len);
struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_tunnel *tunnel, u32 session_id,
u32 peer_session_id, struct l2tp_session_cfg *cfg)
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h
index ffd8ced3a51ff..25ae4c25d3eff 100644
--- a/net/l2tp/l2tp_core.h
+++ b/net/l2tp/l2tp_core.h
@@ -76,7 +76,7 @@ struct l2tp_session {
u8 peer_cookie[8];
int peer_cookie_len;
u16 l2specific_type;
- u16 hdr_len;
+ u16 hdr_len; /* maximum L2TP header length */
u32 nr; /* session NR state (receive) */
u32 ns; /* session NR state (send) */
struct sk_buff_head reorder_q; /* receive reorder queue */
@@ -94,8 +94,8 @@ struct l2tp_session {
char name[L2TP_SESSION_NAME_MAX]; /* for logging */
char ifname[IFNAMSIZ];
+ bool send_seq; /* send packets with sequence numbers? */
unsigned int recv_seq:1; /* expect receive packets with sequence numbers? */
- unsigned int send_seq:1; /* send packets with sequence numbers? */
unsigned int lns_mode:1; /* behave as LNS?
* LAC enables sequence numbers under LNS control.
*/
@@ -257,8 +257,6 @@ void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
int l2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb);
/* Transmit path helpers for sending packets over the tunnel socket. */
-void l2tp_session_set_header_len(struct l2tp_session *session, int version,
- enum l2tp_encap_type encap);
int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb);
/* Pseudowire management.
diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
index 90fc0a59d50ac..17c3a6db4c227 100644
--- a/net/l2tp/l2tp_debugfs.c
+++ b/net/l2tp/l2tp_debugfs.c
@@ -182,12 +182,12 @@ static void l2tp_dfs_seq_session_show(struct seq_file *m, void *v)
session->pwtype == L2TP_PWTYPE_ETH ? "ETH" :
session->pwtype == L2TP_PWTYPE_PPP ? "PPP" :
"");
- if (session->send_seq || session->recv_seq)
+ if (READ_ONCE(session->send_seq) || session->recv_seq)
seq_printf(m, " nr %u, ns %u\n", session->nr, session->ns);
seq_printf(m, " refcnt %d\n", refcount_read(&session->ref_count));
seq_printf(m, " config 0/0/%c/%c/-/%s %08x %u\n",
session->recv_seq ? 'R' : '-',
- session->send_seq ? 'S' : '-',
+ READ_ONCE(session->send_seq) ? 'S' : '-',
session->lns_mode ? "LNS" : "LAC",
0,
jiffies_to_msecs(session->reorder_timeout));
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c
index fbdd3d055dbc7..a9221c7360b70 100644
--- a/net/l2tp/l2tp_netlink.c
+++ b/net/l2tp/l2tp_netlink.c
@@ -697,12 +697,9 @@ static int l2tp_nl_cmd_session_modify(struct sk_buff *skb, struct genl_info *inf
if (info->attrs[L2TP_ATTR_RECV_SEQ])
session->recv_seq = nla_get_u8(info->attrs[L2TP_ATTR_RECV_SEQ]);
- if (info->attrs[L2TP_ATTR_SEND_SEQ]) {
- struct l2tp_tunnel *tunnel = session->tunnel;
-
- session->send_seq = nla_get_u8(info->attrs[L2TP_ATTR_SEND_SEQ]);
- l2tp_session_set_header_len(session, tunnel->version, tunnel->encap);
- }
+ if (info->attrs[L2TP_ATTR_SEND_SEQ])
+ WRITE_ONCE(session->send_seq,
+ nla_get_u8(info->attrs[L2TP_ATTR_SEND_SEQ]) & 1);
if (info->attrs[L2TP_ATTR_LNS_MODE])
session->lns_mode = nla_get_u8(info->attrs[L2TP_ATTR_LNS_MODE]);
@@ -745,7 +742,7 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl
(session->peer_cookie_len &&
nla_put(skb, L2TP_ATTR_PEER_COOKIE, session->peer_cookie_len, session->peer_cookie)) ||
nla_put_u8(skb, L2TP_ATTR_RECV_SEQ, session->recv_seq) ||
- nla_put_u8(skb, L2TP_ATTR_SEND_SEQ, session->send_seq) ||
+ nla_put_u8(skb, L2TP_ATTR_SEND_SEQ, READ_ONCE(session->send_seq)) ||
nla_put_u8(skb, L2TP_ATTR_LNS_MODE, session->lns_mode) ||
(l2tp_tunnel_uses_xfrm(tunnel) &&
nla_put_u8(skb, L2TP_ATTR_USING_IPSEC, 1)) ||
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index c67ba1eab4769..dda3d12337802 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1193,15 +1193,13 @@ static int pppol2tp_session_setsockopt(struct sock *sk,
err = -EINVAL;
break;
}
- session->send_seq = !!val;
+ WRITE_ONCE(session->send_seq, !!val);
{
struct pppox_sock *po = pppox_sk(sk);
po->chan.hdrlen = val ? PPPOL2TP_L2TP_HDR_SIZE_SEQ :
PPPOL2TP_L2TP_HDR_SIZE_NOSEQ;
}
- l2tp_session_set_header_len(session, session->tunnel->version,
- session->tunnel->encap);
break;
case PPPOL2TP_SO_LNSMODE:
@@ -1311,7 +1309,7 @@ static int pppol2tp_session_getsockopt(struct sock *sk,
break;
case PPPOL2TP_SO_SENDSEQ:
- *val = session->send_seq;
+ *val = READ_ONCE(session->send_seq);
break;
case PPPOL2TP_SO_LNSMODE:
@@ -1557,7 +1555,7 @@ static void pppol2tp_seq_session_show(struct seq_file *m, void *v)
state, user_data_ok);
seq_printf(m, " 0/0/%c/%c/%s %08x %u\n",
session->recv_seq ? 'R' : '-',
- session->send_seq ? 'S' : '-',
+ READ_ONCE(session->send_seq) ? 'S' : '-',
session->lns_mode ? "LNS" : "LAC",
0,
jiffies_to_msecs(session->reorder_timeout));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0074/1756] mm/hugetlb: fix mremap deadlock when PMD sharing is possible
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0073/1756] l2tp: snapshot sequencing state when building transmit headers Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0075/1756] mm: fix outdated incorrect code comments for handle_mm_fault() Greg Kroah-Hartman
` (924 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li Zhe, David Hildenbrand (Arm),
Andrew Morton, Muchun Song, Oscar Salvador, Peter Xu,
Mike Rapoport, Jose A. Perez de Azpillaga, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Zhe <lizhe.67@bytedance.com>
[ Upstream commit 92daa8652f88c8cfc05f4899a8408a04b02f211e ]
move_hugetlb_page_tables() holds the mapping's i_mmap_rwsem for
write while moving hugetlb PTEs. This prevents races with truncation
and protects huge_pmd_unshare(), but the move loop must not call
helpers that can acquire the same rwsem for read.
huge_pte_alloc() can do that when the destination can use PMD
sharing: it may call huge_pmd_share(), which takes i_mmap_rwsem for
read while searching for a shareable PMD table. Calling it while the
move path already holds i_mmap_rwsem for write can deadlock.
Avoid that path for PMD-sized hugetlb mappings that can use PMD
sharing. Instead of allocating or sharing the destination page table
while moving, zap the source range and let the destination fault path
populate or share the PMD lazily.
Reuse the hugetlb unmap logic for the source-side zap by splitting
the core loop out of __unmap_hugepage_range(). The wrapper keeps the
existing tlb_start_vma(), tlb_end_vma() and huge_pmd_unshare_flush()
behavior, while move_hugetlb_page_tables() can reuse the unmap loop
with its existing mmu_gather.
Link: https://lore.kernel.org/20261022034543.51226-4-lizhe.67@bytedance.com
Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma")
Signed-off-by: Li Zhe <lizhe.67@bytedance.com>
Co-developed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Cc: <stable@vger.kernel.org>
[ sashal: adapted the unmap helper’s folio parameter to the existing struct page ref_page interface ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/hugetlb.c | 47 +++++++++++++++++++++++++++++++++++++----------
1 file changed, 37 insertions(+), 10 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index e6f913f227e6c..fcdb4f2e4c599 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -92,6 +92,10 @@ static int __huge_pmd_unshare(struct mmu_gather *tlb,
bool check_locks);
static void hugetlb_unshare_pmds(struct vm_area_struct *vma,
unsigned long start, unsigned long end, bool take_locks);
+static void hugetlb_unmap_range(struct mmu_gather *tlb,
+ struct vm_area_struct *vma, unsigned long start,
+ unsigned long end, struct page *ref_page,
+ zap_flags_t zap_flags);
static struct resv_map *vma_resv_map(struct vm_area_struct *vma);
static void hugetlb_free_folio(struct folio *folio)
@@ -5540,6 +5544,8 @@ unsigned long move_hugetlb_page_tables(struct vm_area_struct *vma,
for (; old_addr < old_end; old_addr += sz, new_addr += sz) {
const unsigned long offset_to_last_entry =
(old_addr | last_addr_mask) - old_addr;
+ const unsigned long offset_to_last_dst_entry =
+ (new_addr | last_addr_mask) - new_addr;
src_pte = hugetlb_walk(vma, old_addr, sz);
if (!src_pte) {
@@ -5556,6 +5562,24 @@ unsigned long move_hugetlb_page_tables(struct vm_area_struct *vma,
continue;
}
+ /*
+ * Avoid entering the destination PMD sharing path while holding
+ * i_mmap_rwsem for write. Leave destination page table
+ * population to the fault path, which can share the PMD lazily.
+ */
+ if (sz == PMD_SIZE && want_pmd_share(new_vma, new_addr)) {
+ const unsigned long unmap_size =
+ min(old_end - old_addr,
+ offset_to_last_dst_entry + sz);
+
+ hugetlb_unmap_range(&tlb, vma, old_addr,
+ old_addr + unmap_size, NULL,
+ ZAP_FLAG_DROP_MARKER);
+ old_addr += unmap_size - sz;
+ new_addr += unmap_size - sz;
+ continue;
+ }
+
dst_pte = huge_pte_alloc(mm, new_vma, new_addr, sz);
if (!dst_pte)
break;
@@ -5575,9 +5599,10 @@ unsigned long move_hugetlb_page_tables(struct vm_area_struct *vma,
return len + old_addr - old_end;
}
-void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
- unsigned long start, unsigned long end,
- struct page *ref_page, zap_flags_t zap_flags)
+static void hugetlb_unmap_range(struct mmu_gather *tlb,
+ struct vm_area_struct *vma, unsigned long start,
+ unsigned long end, struct page *ref_page,
+ zap_flags_t zap_flags)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long address;
@@ -5595,13 +5620,6 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
BUG_ON(start & ~huge_page_mask(h));
BUG_ON(end & ~huge_page_mask(h));
- /*
- * This is a hugetlb vma, all the pte entries should point
- * to huge page.
- */
- tlb_change_page_size(tlb, sz);
- tlb_start_vma(tlb, vma);
-
last_addr_mask = hugetlb_mask_last_page(h);
address = start;
for (; address < end; address += sz) {
@@ -5728,6 +5746,15 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
if (ref_page)
break;
}
+}
+
+void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
+ unsigned long start, unsigned long end,
+ struct page *ref_page, zap_flags_t zap_flags)
+{
+ tlb_change_page_size(tlb, huge_page_size(hstate_vma(vma)));
+ tlb_start_vma(tlb, vma);
+ hugetlb_unmap_range(tlb, vma, start, end, ref_page, zap_flags);
tlb_end_vma(tlb, vma);
huge_pmd_unshare_flush(tlb, vma);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0075/1756] mm: fix outdated incorrect code comments for handle_mm_fault()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0074/1756] mm/hugetlb: fix mremap deadlock when PMD sharing is possible Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0076/1756] mm/memory: update stale locking comments for fault handlers Greg Kroah-Hartman
` (923 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jinliang Zheng, Liam R. Howlett,
Andrew Morton, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinliang Zheng <alexjlzheng@gmail.com>
[ Upstream commit 8e6173ccf7b87c1f855e1ad3d94fd50c51d1f46b ]
[akpm@linux-foundation.org: s/mmap_Lock/mmap_lock/, per Liam]
Link: https://lkml.kernel.org/r/20241213031820.778342-1-alexjlzheng@tencent.com
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: f681d4580d5c ("mm: fix address wraparound when scanning large folio PTEs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c
index 38019497d8d4f..4e6c893b18b38 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -6071,7 +6071,8 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma,
}
/*
- * By the time we get here, we already hold the mm semaphore
+ * By the time we get here, we already hold either the VMA lock or the
+ * mmap_lock (FAULT_FLAG_VMA_LOCK tells you which).
*
* The mmap_lock may have been released depending on flags and our
* return value. See filemap_fault() and __folio_lock_or_retry().
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0076/1756] mm/memory: update stale locking comments for fault handlers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0075/1756] mm: fix outdated incorrect code comments for handle_mm_fault() Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0077/1756] mm: fix address wraparound when scanning large folio PTEs Greg Kroah-Hartman
` (922 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aditya Sharma,
David Hildenbrand (Arm), Liam Howlett, Lorenzo Stoakes,
Michal Hocko, Mike Rapoport, Suren Baghdasaryan, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aditya Sharma <adi.sharma@zohomail.in>
[ Upstream commit 214f9ab72ce6e16120c20ad670389656f059e685 ]
Update the comments for wp_page_copy(), do_wp_page(), do_swap_page(),
do_anonymous_page(), __do_fault(), do_fault(), handle_pte_fault(),
__handle_mm_fault(), and handle_mm_fault() to concisely clarify that they
can be entered holding either the mmap_lock or the VMA lock, and that the
lock may be released upon returning VM_FAULT_RETRY.
Additionally, make the following corrections:
- In do_anonymous_page(), correct the outdated claim that the function
is entered with the PTE "mapped but not yet locked". Since
handle_pte_fault() unmaps the empty PTE before routing to
do_pte_missing(), the comment now correctly states it is entered
with the PTE unmapped and unlocked.
- In __do_fault(), update the stale reference from __lock_page_retry()
to __folio_lock_or_retry().
Link: https://lore.kernel.org/20260424092217.263648-1-adi.sharma@zohomail.in
Signed-off-by: Aditya Sharma <adi.sharma@zohomail.in>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Liam Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: f681d4580d5c ("mm: fix address wraparound when scanning large folio PTEs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory.c | 55 ++++++++++++++++++++++++++++-------------------------
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 4e6c893b18b38..d7f74ee122328 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3322,8 +3322,8 @@ vm_fault_t __vmf_anon_prepare(struct vm_fault *vmf)
* Handle the case of a page which we actually need to copy to a new page,
* either due to COW or unsharing.
*
- * Called with mmap_lock locked and the old page referenced, but
- * without the ptl held.
+ * Called with either the VMA lock or the mmap_lock held (see FAULT_FLAG_VMA_LOCK)
+ * and the old page referenced, but without the ptl held.
*
* High level logic flow:
*
@@ -3657,9 +3657,9 @@ static bool wp_can_reuse_anon_folio(struct folio *folio,
* though the page will change only once the write actually happens. This
* avoids a few races, and potentially makes it more efficient.
*
- * We enter with non-exclusive mmap_lock (to exclude vma changes,
- * but allow concurrent faults), with pte both mapped and locked.
- * We return with mmap_lock still held, but pte unmapped and unlocked.
+ * We enter with either the VMA lock or the mmap_lock held (see
+ * FAULT_FLAG_VMA_LOCK) and pte both mapped and locked. We return with
+ * the same lock still held, but pte unmapped and unlocked.
*/
static vm_fault_t do_wp_page(struct vm_fault *vmf)
__releases(vmf->ptl)
@@ -4199,12 +4199,12 @@ static struct folio *alloc_swap_folio(struct vm_fault *vmf)
static DECLARE_WAIT_QUEUE_HEAD(swapcache_wq);
/*
- * We enter with non-exclusive mmap_lock (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
+ * We enter with either the VMA lock or the mmap_lock held (see
+ * FAULT_FLAG_VMA_LOCK), and pte mapped but not yet locked.
* We return with pte unmapped and unlocked.
*
- * We return with the mmap_lock locked or unlocked in the same cases
- * as does filemap_fault().
+ * When returning, the lock may have been released in the same cases
+ * as done by filemap_fault().
*/
vm_fault_t do_swap_page(struct vm_fault *vmf)
{
@@ -4737,9 +4737,10 @@ static struct folio *alloc_anon_folio(struct vm_fault *vmf)
}
/*
- * We enter with non-exclusive mmap_lock (to exclude vma changes,
- * but allow concurrent faults), and pte mapped but not yet locked.
- * We return with mmap_lock still held, but pte unmapped and unlocked.
+ * We enter with either the VMA lock or the mmap_lock held (see
+ * FAULT_FLAG_VMA_LOCK), and pte unmapped and unlocked.
+ * We return with the lock still held, but pte unmapped and unlocked.
+ * If VM_FAULT_RETRY is returned, the lock may have been released.
*/
static vm_fault_t do_anonymous_page(struct vm_fault *vmf)
{
@@ -4857,9 +4858,10 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf)
}
/*
- * The mmap_lock must have been held on entry, and may have been
- * released depending on flags and vma->vm_ops->fault() return value.
- * See filemap_fault() and __lock_page_retry().
+ * Either the VMA lock or the mmap_lock must have been held on entry
+ * (see FAULT_FLAG_VMA_LOCK) and may have been released depending on
+ * flags and vma->vm_ops->fault() return value.
+ * See filemap_fault() and __folio_lock_or_retry().
*/
static vm_fault_t __do_fault(struct vm_fault *vmf)
{
@@ -5423,11 +5425,11 @@ static vm_fault_t do_shared_fault(struct vm_fault *vmf)
}
/*
- * We enter with non-exclusive mmap_lock (to exclude vma changes,
- * but allow concurrent faults).
- * The mmap_lock may have been released depending on flags and our
+ * We enter with either the VMA lock or the mmap_lock held (see
+ * FAULT_FLAG_VMA_LOCK).
+ * The lock may have been released depending on flags and our
* return value. See filemap_fault() and __folio_lock_or_retry().
- * If mmap_lock is released, vma may become invalid (for example
+ * If the lock is released, vma may become invalid (for example
* by other thread calling munmap()).
*/
static vm_fault_t do_fault(struct vm_fault *vmf)
@@ -5755,10 +5757,11 @@ static vm_fault_t wp_huge_pud(struct vm_fault *vmf, pud_t orig_pud)
* with external mmu caches can use to update those (ie the Sparc or
* PowerPC hashed page tables that act as extended TLBs).
*
- * We enter with non-exclusive mmap_lock (to exclude vma changes, but allow
- * concurrent faults).
+ * On entry, we hold either the VMA lock or the mmap_lock
+ * (see FAULT_FLAG_VMA_LOCK).
*
- * The mmap_lock may have been released depending on flags and our return value.
+ * The mmap_lock or VMA lock may have been released depending on flags
+ * and our return value.
* See filemap_fault() and __folio_lock_or_retry().
*/
static vm_fault_t handle_pte_fault(struct vm_fault *vmf)
@@ -5841,8 +5844,8 @@ static vm_fault_t handle_pte_fault(struct vm_fault *vmf)
/*
* On entry, we hold either the VMA lock or the mmap_lock
- * (FAULT_FLAG_VMA_LOCK tells you which). If VM_FAULT_RETRY is set in
- * the result, the mmap_lock is not held on exit. See filemap_fault()
+ * (see FAULT_FLAG_VMA_LOCK). If VM_FAULT_RETRY is set in
+ * the result, the lock is not held on exit. See filemap_fault()
* and __folio_lock_or_retry().
*/
static vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
@@ -6072,9 +6075,9 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma,
/*
* By the time we get here, we already hold either the VMA lock or the
- * mmap_lock (FAULT_FLAG_VMA_LOCK tells you which).
+ * mmap_lock (see FAULT_FLAG_VMA_LOCK).
*
- * The mmap_lock may have been released depending on flags and our
+ * The lock may have been released depending on flags and our
* return value. See filemap_fault() and __folio_lock_or_retry().
*/
vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0077/1756] mm: fix address wraparound when scanning large folio PTEs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0076/1756] mm/memory: update stale locking comments for fault handlers Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0078/1756] mm/huge_memory: fix truncate racing with PMD zapping Greg Kroah-Hartman
` (921 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Hildenbrand (Arm),
Andrew Morton, Kyle Zeng, Lorenzo Stoakes (ARM),
Kiryl Shutsemau (Meta), Baolin Wang, Lance Yang, Barry Song,
Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
Suren Baghdasaryan, Michal Hocko, Ying Huang, Ryan Roberts,
Chuanhua Han, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit f681d4580d5c3c749f623cda722a21aefd3147b3 ]
numa_rebuild_large_mapping() and do_swap_page() can be tricked into
generating an address wraparound, crashing the kernel. All that's required
is to map a tail page of a large folio close enough to the start/end of
the address space to e.g., make
unsigned long addr_start = addr - (nr << PAGE_SHIFT);
to wrap around.
Let's fix it by providing a better helper, folio_scan_range(), that
takes care of staying within VMA and page table boundaries while
handling possible wraparounds.
There are some nasty details, like not being able to use pmd_addr_end()
in this context. Add some helpful comments for these cases.
Link: https://lore.kernel.org/20261014-folio_pte_scan_range-v2-1-00cf9bbaa364@kernel.org
Fixes: d2136d749d76 ("mm: support multi-size THP numa balancing")
Fixes: 508758960b8d ("mm: swap: entirely map large folios found in swapcache")
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Barry Song <baohua@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Ying Huang <huang.ying.caritas@gmail.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Chuanhua Han <hanchuanhua@oppo.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory.c | 50 ++++++++++++++++++++++++++++++++++++--------------
1 file changed, 36 insertions(+), 14 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index d7f74ee122328..37b039cc7ba39 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4198,6 +4198,34 @@ static struct folio *alloc_swap_folio(struct vm_fault *vmf)
static DECLARE_WAIT_QUEUE_HEAD(swapcache_wq);
+/*
+ * Get the address range in which a folio might be mapped, assuming its pages
+ * are mapped consecutively and the folio page at the given idx is mapped at
+ * the given address.
+ */
+static void folio_pte_range(const struct folio *folio,
+ const struct vm_area_struct *vma, unsigned long addr,
+ unsigned long idx, unsigned long *start, unsigned long *end)
+{
+ /* Stay within the page table and VMA boundaries. */
+ const unsigned long pmd_start = addr & PMD_MASK;
+ const unsigned long pmd_end = pmd_start + PMD_SIZE;
+ const unsigned long lower = max(pmd_start, vma->vm_start);
+ /*
+ * We cannot use pmd_addr_end(), as it does not clamp reliably. To
+ * avoid wraparounds, compute using the inclusive end.
+ */
+ const unsigned long upper = min(pmd_end - 1, vma->vm_end - 1) + 1;
+ const unsigned long offset = idx << PAGE_SHIFT;
+
+ /*
+ * Avoid start/end addresses wrapping by not adding/subtracting more
+ * than the lower/upper limits would allow.
+ */
+ *start = addr - min(addr - lower, offset);
+ *end = addr + min(upper - addr, folio_size(folio) - offset);
+}
+
/*
* We enter with either the VMA lock or the mmap_lock held (see
* FAULT_FLAG_VMA_LOCK), and pte mapped but not yet locked.
@@ -4445,16 +4473,15 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
address = vmf->address;
ptep = vmf->pte;
if (folio_test_large(folio) && folio_test_swapcache(folio)) {
- int nr = folio_nr_pages(folio);
- unsigned long idx = folio_page_idx(folio, page);
- unsigned long folio_start = address - idx * PAGE_SIZE;
- unsigned long folio_end = folio_start + nr * PAGE_SIZE;
+ const int nr = folio_nr_pages(folio);
+ const unsigned long idx = folio_page_idx(folio, page);
+ unsigned long folio_start, folio_end;
pte_t *folio_ptep;
pte_t folio_pte;
- if (unlikely(folio_start < max(address & PMD_MASK, vma->vm_start)))
- goto check_folio;
- if (unlikely(folio_end > pmd_addr_end(address, vma->vm_end)))
+ folio_pte_range(folio, vma, address, idx, &folio_start,
+ &folio_end);
+ if (unlikely((folio_end - folio_start) >> PAGE_SHIFT != nr))
goto check_folio;
folio_ptep = vmf->pte - idx;
@@ -5542,16 +5569,11 @@ static void numa_rebuild_large_mapping(struct vm_fault *vmf, struct vm_area_stru
struct folio *folio, pte_t fault_pte,
bool ignore_writable, bool pte_write_upgrade)
{
- int nr = pte_pfn(fault_pte) - folio_pfn(folio);
+ const unsigned long idx = pte_pfn(fault_pte) - folio_pfn(folio);
unsigned long start, end, addr = vmf->address;
- unsigned long addr_start = addr - (nr << PAGE_SHIFT);
- unsigned long pt_start = ALIGN_DOWN(addr, PMD_SIZE);
pte_t *start_ptep;
- /* Stay within the VMA and within the page table. */
- start = max3(addr_start, pt_start, vma->vm_start);
- end = min3(addr_start + folio_size(folio), pt_start + PMD_SIZE,
- vma->vm_end);
+ folio_pte_range(folio, vma, addr, idx, &start, &end);
start_ptep = vmf->pte - ((addr - start) >> PAGE_SHIFT);
/* Restore all PTEs' mapping of the large folio */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0078/1756] mm/huge_memory: fix truncate racing with PMD zapping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0077/1756] mm: fix address wraparound when scanning large folio PTEs Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0079/1756] fbdev: kyro: Use devm_ioremap() for mmio registers Greg Kroah-Hartman
` (920 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Gregory Price (Meta),
Muhammad Usama Anjum, Zi Yan, Baolin Wang,
David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mason <mason@kernel.org>
[ Upstream commit e6a07d29b0a60f3a4cfe77fe34eeb4b3fb38d6c4 ]
zap_huge_pmd_folio() removes the rmap before calling folio_mark_dirty().
If this was the last mapping, truncation can skip unmapping the folio
and proceed without waiting for the PMD lock, racing with dirtying.
ifs_set_range_dirty() can oops if MADV_DONTNEED races with
ftruncate() on XFS, when we get the folio set dirty after it was found
to not be mapped anymore.
Move folio_mark_dirty() and folio_mark_accessed() before rmap removal,
matching the PTE zap path. This keeps the folio mapped while updating
its state, so truncation must wait for the page table lock.
Fix generated by an LLM and sent by Chris Mason in private.
Fixes: fe6cf984939d ("mm/huge_memory: transfer the pmd dirty bit to the folio on zap")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <mason@kernel.org>
[ david: simplify comment and description ]
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-13-d6437171ecc3@kernel.org
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted to inline zap_huge_pmd() logic with flush_needed replacing the is_present || is_device_private check ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/huge_memory.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ce4d17871ff43..6cd88cd4b33be 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2128,8 +2128,6 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
struct page *page = pmd_page(orig_pmd);
folio = page_folio(page);
- folio_remove_rmap_pmd(folio, page, vma);
- WARN_ON_ONCE(folio_mapcount(folio) < 0);
VM_BUG_ON_PAGE(!PageHead(page), page);
} else if (thp_migration_supported()) {
swp_entry_t entry;
@@ -2154,6 +2152,15 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
folio_mark_dirty(folio);
}
+ /*
+ * Only present folios are rmappable. Remove the rmap after
+ * transferring young+dirty to the folio.
+ */
+ if (flush_needed) {
+ folio_remove_rmap_pmd(folio, &folio->page, vma);
+ WARN_ON_ONCE(folio_mapcount(folio) < 0);
+ }
+
spin_unlock(ptl);
if (flush_needed)
tlb_remove_page_size(tlb, &folio->page, HPAGE_PMD_SIZE);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0079/1756] fbdev: kyro: Use devm_ioremap() for mmio registers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0078/1756] mm/huge_memory: fix truncate racing with PMD zapping Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0080/1756] fbdev: kyro: Use devm_ioremap_wc() for screen mem Greg Kroah-Hartman
` (919 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giovanni Di Santi, Helge Deller,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giovanni Di Santi <giovanni.disanti.lkl@gmail.com>
[ Upstream commit e0bf12a43243e6afc5a03fc55c58ec48aba48088 ]
Replace the manual ioremap() call for the MMIO registers with the
device-managed devm_ioremap() variant.
This simplifies the driver's resource management by ensuring the memory is
automatically unmapped when the driver detaches from the device.
Signed-off-by: Giovanni Di Santi <giovanni.disanti.lkl@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Stable-dep-of: d3bc005a6294 ("fbdev: kyro: Release WC setup on registration failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/kyro/fbdev.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c
index cf6062210c8bb..c026600d5963b 100644
--- a/drivers/video/fbdev/kyro/fbdev.c
+++ b/drivers/video/fbdev/kyro/fbdev.c
@@ -718,13 +718,14 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
kyro_fix.mmio_len = pci_resource_len(pdev, 1);
currentpar->regbase = deviceInfo.pSTGReg =
- ioremap(kyro_fix.mmio_start, kyro_fix.mmio_len);
+ devm_ioremap(&pdev->dev, kyro_fix.mmio_start,
+ kyro_fix.mmio_len);
if (!currentpar->regbase)
goto out_free_fb;
info->screen_base = pci_ioremap_wc_bar(pdev, 0);
if (!info->screen_base)
- goto out_unmap_regs;
+ goto out_free_fb;
if (!nomtrr)
currentpar->wc_cookie = arch_phys_wc_add(kyro_fix.smem_start,
@@ -772,8 +773,6 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
out_unmap:
iounmap(info->screen_base);
-out_unmap_regs:
- iounmap(currentpar->regbase);
out_free_fb:
framebuffer_release(info);
@@ -796,7 +795,6 @@ static void kyrofb_remove(struct pci_dev *pdev)
deviceInfo.ulOverlayOffset = 0;
iounmap(info->screen_base);
- iounmap(par->regbase);
arch_phys_wc_del(par->wc_cookie);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0080/1756] fbdev: kyro: Use devm_ioremap_wc() for screen mem
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0079/1756] fbdev: kyro: Use devm_ioremap() for mmio registers Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0081/1756] fbdev: kyro: Release WC setup on registration failure Greg Kroah-Hartman
` (918 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giovanni Di Santi, Helge Deller,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giovanni Di Santi <giovanni.disanti.lkl@gmail.com>
[ Upstream commit 32dfb6112ea3ca143636832cd34234f2be4830bb ]
Replace the manual pci_ioremap_wc() call for mapping screen memory with the
device-managed devm_ioremap_wc() variant.
This simplifies the driver's resource management by ensuring the memory is
automatically unmapped when the driver detaches from the device.
Signed-off-by: Giovanni Di Santi <giovanni.disanti.lkl@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Stable-dep-of: d3bc005a6294 ("fbdev: kyro: Release WC setup on registration failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/kyro/fbdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c
index c026600d5963b..c387bdb1e515f 100644
--- a/drivers/video/fbdev/kyro/fbdev.c
+++ b/drivers/video/fbdev/kyro/fbdev.c
@@ -723,7 +723,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (!currentpar->regbase)
goto out_free_fb;
- info->screen_base = pci_ioremap_wc_bar(pdev, 0);
+ info->screen_base = devm_ioremap_wc(&pdev->dev, kyro_fix.smem_start,
+ kyro_fix.smem_len);
if (!info->screen_base)
goto out_free_fb;
@@ -760,7 +761,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
fb_memset_io(info->screen_base, 0, size);
if (register_framebuffer(info) < 0)
- goto out_unmap;
+ goto out_free_fb;
fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n",
info->fix.id,
@@ -771,8 +772,6 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
-out_unmap:
- iounmap(info->screen_base);
out_free_fb:
framebuffer_release(info);
@@ -794,8 +793,6 @@ static void kyrofb_remove(struct pci_dev *pdev)
deviceInfo.ulNextFreeVidMem = 0;
deviceInfo.ulOverlayOffset = 0;
- iounmap(info->screen_base);
-
arch_phys_wc_del(par->wc_cookie);
unregister_framebuffer(info);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0081/1756] fbdev: kyro: Release WC setup on registration failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0080/1756] fbdev: kyro: Use devm_ioremap_wc() for screen mem Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0082/1756] hwmon: (coretemp) Fix 32-bit jiffies wraparound in show_temp() Greg Kroah-Hartman
` (917 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Helge Deller, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit d3bc005a62945aec57059201092b12b7c955e5a7 ]
If register_framebuffer() fails, kyrofb_probe() frees the framebuffer
without releasing its write-combining range. Release the range before
freeing the framebuffer. Earlier failures still skip this cleanup.
The missing cleanup already exists in the initial Git import, before
the conversion from mtrr_add() to arch_phys_wc_add().
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/kyro/fbdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/kyro/fbdev.c b/drivers/video/fbdev/kyro/fbdev.c
index c387bdb1e515f..f5439f34e1336 100644
--- a/drivers/video/fbdev/kyro/fbdev.c
+++ b/drivers/video/fbdev/kyro/fbdev.c
@@ -761,7 +761,7 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
fb_memset_io(info->screen_base, 0, size);
if (register_framebuffer(info) < 0)
- goto out_free_fb;
+ goto out_free_wc;
fb_info(info, "%s frame buffer device, at %dx%d@%d using %ldk/%ldk of VRAM\n",
info->fix.id,
@@ -772,6 +772,8 @@ static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
+out_free_wc:
+ arch_phys_wc_del(currentpar->wc_cookie);
out_free_fb:
framebuffer_release(info);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0082/1756] hwmon: (coretemp) Fix 32-bit jiffies wraparound in show_temp()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0081/1756] fbdev: kyro: Release WC setup on registration failure Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0083/1756] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Greg Kroah-Hartman
` (916 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Asaf Nuri Bertizlioğlu,
Guenter Roeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 9a6aa085c94c7f2817c4d50a7264e6fb51286f40 ]
show_temp() rate-limits MSR reads by storing tdata->last_updated as an
unsigned long and comparing it against jiffies using
time_after(jiffies, tdata->last_updated + HZ).
time_after() relies on signed long subtraction, which only produces the
expected result while the two timestamps are within LONG_MAX jiffies of
each other. On 32-bit kernels, if tempX_input is not read for more than
LONG_MAX jiffies (~24.85 days at HZ=1000), the signed difference flips
sign and time_after() evaluates to false. Because tdata->last_updated is
only refreshed when time_after() succeeds, subsequent reads remain
blocked from refreshing for another ~24.85 days until jiffies wraps
past tdata->last_updated + HZ again, returning either a stale cached
temperature or -ENODATA if the sensor had never been read since
initialization.
Store tdata->last_updated as a u64 and use get_jiffies_64() with
time_after64(), which does not wrap in any practical uptime.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: bebe467823c0 ("hwmon: New coretemp driver")
Cc: stable@vger.kernel.org
Tested-by: Asaf Nuri Bertizlioğlu <ycistak@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[ sashal: Adjusted show_temp() context to retain rdmsr_on_cpu() and the TjMax read before the refresh condition. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/coretemp.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 7f8ff6dd16bfa..13c0b4c47501e 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -77,7 +77,7 @@ struct temp_data {
int temp;
bool temp_valid;
int tjmax;
- unsigned long last_updated;
+ u64 last_updated;
unsigned int cpu;
int index;
u32 cpu_core_id;
@@ -407,7 +407,7 @@ static ssize_t show_temp(struct device *dev,
tjmax = get_tjmax(tdata, dev);
/* Check whether the time interval has elapsed */
- if (time_after(jiffies, tdata->last_updated + HZ)) {
+ if (time_after64(get_jiffies_64(), tdata->last_updated + HZ)) {
rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx);
/*
* Bit 31 indicates whether the reading is valid. Some CPUs
@@ -416,7 +416,7 @@ static ssize_t show_temp(struct device *dev,
*/
tdata->temp_valid = (eax >> 31) & 1;
tdata->temp = tjmax - ((eax >> 16) & 0xff) * 1000;
- tdata->last_updated = jiffies;
+ tdata->last_updated = get_jiffies_64();
}
valid = tdata->temp_valid;
@@ -528,11 +528,8 @@ init_temp_data(struct platform_data *pdata, unsigned int cpu, int pkg_flag)
tdata->cpu = cpu;
tdata->cpu_core_id = topology_core_id(cpu);
tdata->attr_size = MAX_CORE_ATTRS;
- /*
- * A zero timestamp does not look stale on 32-bit, where jiffies
- * starts just short of wrapping. Backdate it instead.
- */
- tdata->last_updated = jiffies - HZ - 1;
+ /* Backdate to force a refresh on the first read */
+ tdata->last_updated = get_jiffies_64() - HZ - 1;
mutex_init(&tdata->update_lock);
return tdata;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0083/1756] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0082/1756] hwmon: (coretemp) Fix 32-bit jiffies wraparound in show_temp() Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0084/1756] hwmon: (tmp108) Fix initial conversion delay and wait until ready Greg Kroah-Hartman
` (915 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Li, Guenter Roeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Li <Frank.Li@nxp.com>
[ Upstream commit 700f3250198d51093884254220a96777a922dd47 ]
Add help function tmp108_common_probe() to pave road to support i3c for
P3T1085(NXP) chip.
Use dev_err_probe() to simplify the code.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Message-ID: <20241112-p3t1085-v4-1-a1334314b1e6@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: 7cd60538073e ("hwmon: (tmp108) Fix initial conversion delay and wait until ready")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/tmp108.c | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index 18e7c9d9bcbb8..d95957d808e1b 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -323,33 +323,19 @@ static const struct regmap_config tmp108_regmap_config = {
.use_single_write = true,
};
-static int tmp108_probe(struct i2c_client *client)
+static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *name)
{
- struct device *dev = &client->dev;
struct device *hwmon_dev;
struct tmp108 *tmp108;
- int err;
u32 config;
-
- if (!i2c_check_functionality(client->adapter,
- I2C_FUNC_SMBUS_WORD_DATA)) {
- dev_err(dev,
- "adapter doesn't support SMBus word transactions\n");
- return -ENODEV;
- }
+ int err;
tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL);
if (!tmp108)
return -ENOMEM;
dev_set_drvdata(dev, tmp108);
-
- tmp108->regmap = devm_regmap_init_i2c(client, &tmp108_regmap_config);
- if (IS_ERR(tmp108->regmap)) {
- err = PTR_ERR(tmp108->regmap);
- dev_err(dev, "regmap init failed: %d", err);
- return err;
- }
+ tmp108->regmap = regmap;
err = regmap_read(tmp108->regmap, TMP108_REG_CONF, &config);
if (err < 0) {
@@ -383,13 +369,30 @@ static int tmp108_probe(struct i2c_client *client)
return err;
}
- hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
+ hwmon_dev = devm_hwmon_device_register_with_info(dev, name,
tmp108,
&tmp108_chip_info,
NULL);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
+static int tmp108_probe(struct i2c_client *client)
+{
+ struct device *dev = &client->dev;
+ struct regmap *regmap;
+
+ if (!i2c_check_functionality(client->adapter,
+ I2C_FUNC_SMBUS_WORD_DATA))
+ return dev_err_probe(dev, -ENODEV,
+ "adapter doesn't support SMBus word transactions\n");
+
+ regmap = devm_regmap_init_i2c(client, &tmp108_regmap_config);
+ if (IS_ERR(regmap))
+ return dev_err_probe(dev, PTR_ERR(regmap), "regmap init failed");
+
+ return tmp108_common_probe(dev, regmap, client->name);
+}
+
static int tmp108_suspend(struct device *dev)
{
struct tmp108 *tmp108 = dev_get_drvdata(dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0084/1756] hwmon: (tmp108) Fix initial conversion delay and wait until ready
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0083/1756] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0085/1756] drm/amdgpu: dont walk the CS chunks when allocating them failed Greg Kroah-Hartman
` (914 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Guenter Roeck, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 7cd60538073e465310c94b2a2f0ea8d2f03768ef ]
In tmp108_common_probe(), the driver only adds the 30 ms conversion delay
(TMP108_CONVERSION_TIME_MS) to ready_time if the sensor was previously in
TMP108_MODE_SHUTDOWN. However, the TMP108 hardware defaults to continuous
conversion mode (TMP108_MODE_CONTINUOUS) upon power-on reset, including
immediately after enabling the vcc supply regulator during probe, while
the temperature register retains its power-on reset value of 0x0000 (0°C)
until the first conversion completes. Because the initial mode is not
shutdown, the delay is bypassed and early reads via thermal zone
registration or sysfs before the first conversion finishes return an
uninitialized 0°C reading.
In addition, returning -EAGAIN from tmp108_read() while waiting for a
conversion to complete after probe or resume can trigger an unnecessary
tight retry loop in callers or fail initial reads.
Unconditionally set ready_time to TMP108_CONVERSION_TIME_MS ahead in
tmp108_common_probe(), track ready_time as ktime_t, and wait for the
remaining conversion time in tmp108_read() using usleep_range() instead
of returning -EAGAIN.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: 66e1c9171339 ("hwmon: Add Texas Instruments TMP108 temperature sensor driver.")
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[ sashal: Adjusted structure context to account for the missing tmp108_params structure and params member. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/tmp108.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
index d95957d808e1b..310f8cae1fd84 100644
--- a/drivers/hwmon/tmp108.c
+++ b/drivers/hwmon/tmp108.c
@@ -14,7 +14,7 @@
#include <linux/of.h>
#include <linux/i2c.h>
#include <linux/init.h>
-#include <linux/jiffies.h>
+#include <linux/ktime.h>
#include <linux/regmap.h>
#include <linux/slab.h>
@@ -73,7 +73,7 @@
struct tmp108 {
struct regmap *regmap;
u16 orig_config;
- u64 ready_time;
+ ktime_t ready_time;
};
/* convert 12-bit TMP108 register value to milliCelsius */
@@ -94,6 +94,7 @@ static int tmp108_read(struct device *dev, enum hwmon_sensor_types type,
struct tmp108 *tmp108 = dev_get_drvdata(dev);
unsigned int regval;
int err, hyst;
+ s64 delay;
if (type == hwmon_chip) {
if (attr == hwmon_chip_update_interval) {
@@ -123,12 +124,10 @@ static int tmp108_read(struct device *dev, enum hwmon_sensor_types type,
switch (attr) {
case hwmon_temp_input:
- /* Is it too early to return a conversion ? */
- if (time_before64(get_jiffies_64(), tmp108->ready_time)) {
- dev_dbg(dev, "%s: Conversion not ready yet..\n",
- __func__);
- return -EAGAIN;
- }
+ /* Wait if it is too early to return a conversion */
+ delay = ktime_us_delta(tmp108->ready_time, ktime_get());
+ if (delay > 0)
+ usleep_range(delay, delay + 1000);
err = regmap_read(tmp108->regmap, TMP108_REG_TEMP, ®val);
if (err < 0)
return err;
@@ -357,11 +356,8 @@ static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *
return err;
}
- tmp108->ready_time = get_jiffies_64();
- if ((tmp108->orig_config & TMP108_CONF_MODE_MASK) ==
- TMP108_MODE_SHUTDOWN)
- tmp108->ready_time +=
- msecs_to_jiffies(TMP108_CONVERSION_TIME_MS);
+ tmp108->ready_time = ktime_add_ms(ktime_get(),
+ TMP108_CONVERSION_TIME_MS);
err = devm_add_action_or_reset(dev, tmp108_restore_config, tmp108);
if (err) {
@@ -408,8 +404,8 @@ static int tmp108_resume(struct device *dev)
err = regmap_update_bits(tmp108->regmap, TMP108_REG_CONF,
TMP108_CONF_MODE_MASK, TMP108_MODE_CONTINUOUS);
- tmp108->ready_time = get_jiffies_64() +
- msecs_to_jiffies(TMP108_CONVERSION_TIME_MS);
+ tmp108->ready_time = ktime_add_ms(ktime_get(),
+ TMP108_CONVERSION_TIME_MS);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0085/1756] drm/amdgpu: dont walk the CS chunks when allocating them failed
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0084/1756] hwmon: (tmp108) Fix initial conversion delay and wait until ready Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0086/1756] nvme: tuning pr code by using defined structs and macros Greg Kroah-Hartman
` (913 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jesse Zhang, Christian König,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
[ Upstream commit ade92d50aad6799a5a9d7e73cd1604fd0576e656 ]
amdgpu_cs_pass1() sets p->nchunks before allocating p->chunks, and the
allocation failure path skips resetting it. amdgpu_cs_parser_fini() then
frees the kdata of nchunks chunks from a NULL array. On navi48 with the
chunk array allocation failed through failslab:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
RIP: 0010:amdgpu_cs_parser_fini+0x35d/0x710 [amdgpu]
amdgpu_cs_ioctl+0xcae/0x7a20 [amdgpu]
drm_ioctl_kernel+0x180/0x320 [drm]
Set nchunks once the array exists.
Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0c828445757b86aaa3ed2638832d76f450022bdf)
Cc: stable@vger.kernel.org
[ sashal: used kvmalloc_array() with explicit element size and GFP_KERNEL instead of kvmalloc_objs() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index c49aabb343a72..364fbaf4e0fa5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -215,13 +215,14 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
if (IS_ERR(chunk_array))
return PTR_ERR(chunk_array);
- p->nchunks = cs->in.num_chunks;
- p->chunks = kvmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk),
+ /* parser_fini() walks nchunks chunks, set it once they exist */
+ p->chunks = kvmalloc_array(cs->in.num_chunks, sizeof(struct amdgpu_cs_chunk),
GFP_KERNEL);
if (!p->chunks) {
ret = -ENOMEM;
goto free_chunk;
}
+ p->nchunks = cs->in.num_chunks;
for (i = 0; i < p->nchunks; i++) {
struct drm_amdgpu_cs_chunk __user *chunk_ptr = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0086/1756] nvme: tuning pr code by using defined structs and macros
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0085/1756] drm/amdgpu: dont walk the CS chunks when allocating them failed Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0087/1756] nvme: unregister when pr_register() is given a zero new key Greg Kroah-Hartman
` (912 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Christoph Hellwig,
Keith Busch, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit 029cc98dec2eadb5d0978b5fea9ae6c427f2a020 ]
All the modifications are simply to make the code more readable,
and this patch does not include any functional changes.
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Stable-dep-of: a9d431124fb2 ("nvme: unregister when pr_register() is given a zero new key")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/pr.c | 122 +++++++++++++++++++++++++----------------
1 file changed, 75 insertions(+), 47 deletions(-)
diff --git a/drivers/nvme/host/pr.c b/drivers/nvme/host/pr.c
index e1d07f824b13c..fe7dbe2648158 100644
--- a/drivers/nvme/host/pr.c
+++ b/drivers/nvme/host/pr.c
@@ -92,109 +92,137 @@ static int nvme_status_to_pr_err(int status)
}
}
-static int nvme_send_pr_command(struct block_device *bdev,
- struct nvme_command *c, void *data, unsigned int data_len)
+static int __nvme_send_pr_command(struct block_device *bdev, u32 cdw10,
+ u32 cdw11, u8 op, void *data, unsigned int data_len)
{
- if (nvme_disk_is_ns_head(bdev->bd_disk))
- return nvme_send_ns_head_pr_command(bdev, c, data, data_len);
+ struct nvme_command c = { 0 };
- return nvme_send_ns_pr_command(bdev->bd_disk->private_data, c, data,
- data_len);
+ c.common.opcode = op;
+ c.common.cdw10 = cpu_to_le32(cdw10);
+ c.common.cdw11 = cpu_to_le32(cdw11);
+
+ if (nvme_disk_is_ns_head(bdev->bd_disk))
+ return nvme_send_ns_head_pr_command(bdev, &c, data, data_len);
+ return nvme_send_ns_pr_command(bdev->bd_disk->private_data, &c,
+ data, data_len);
}
-static int nvme_pr_command(struct block_device *bdev, u32 cdw10,
- u64 key, u64 sa_key, u8 op)
+static int nvme_send_pr_command(struct block_device *bdev, u32 cdw10, u32 cdw11,
+ u8 op, void *data, unsigned int data_len)
{
- struct nvme_command c = { };
- u8 data[16] = { 0, };
int ret;
- put_unaligned_le64(key, &data[0]);
- put_unaligned_le64(sa_key, &data[8]);
-
- c.common.opcode = op;
- c.common.cdw10 = cpu_to_le32(cdw10);
-
- ret = nvme_send_pr_command(bdev, &c, data, sizeof(data));
- if (ret < 0)
- return ret;
-
- return nvme_status_to_pr_err(ret);
+ ret = __nvme_send_pr_command(bdev, cdw10, cdw11, op, data, data_len);
+ return ret < 0 ? ret : nvme_status_to_pr_err(ret);
}
-static int nvme_pr_register(struct block_device *bdev, u64 old,
- u64 new, unsigned flags)
+static int nvme_pr_register(struct block_device *bdev, u64 old_key, u64 new_key,
+ unsigned int flags)
{
+ struct nvmet_pr_register_data data = { 0 };
u32 cdw10;
if (flags & ~PR_FL_IGNORE_KEY)
return -EOPNOTSUPP;
- cdw10 = old ? 2 : 0;
- cdw10 |= (flags & PR_FL_IGNORE_KEY) ? 1 << 3 : 0;
- cdw10 |= (1 << 30) | (1 << 31); /* PTPL=1 */
- return nvme_pr_command(bdev, cdw10, old, new, nvme_cmd_resv_register);
+ data.crkey = cpu_to_le64(old_key);
+ data.nrkey = cpu_to_le64(new_key);
+
+ cdw10 = old_key ? NVME_PR_REGISTER_ACT_REPLACE :
+ NVME_PR_REGISTER_ACT_REG;
+ cdw10 |= (flags & PR_FL_IGNORE_KEY) ? NVME_PR_IGNORE_KEY : 0;
+ cdw10 |= NVME_PR_CPTPL_PERSIST;
+
+ return nvme_send_pr_command(bdev, cdw10, 0, nvme_cmd_resv_register,
+ &data, sizeof(data));
}
static int nvme_pr_reserve(struct block_device *bdev, u64 key,
enum pr_type type, unsigned flags)
{
+ struct nvmet_pr_acquire_data data = { 0 };
u32 cdw10;
if (flags & ~PR_FL_IGNORE_KEY)
return -EOPNOTSUPP;
- cdw10 = nvme_pr_type_from_blk(type) << 8;
- cdw10 |= ((flags & PR_FL_IGNORE_KEY) ? 1 << 3 : 0);
- return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_acquire);
+ data.crkey = cpu_to_le64(key);
+
+ cdw10 = NVME_PR_ACQUIRE_ACT_ACQUIRE;
+ cdw10 |= nvme_pr_type_from_blk(type) << 8;
+ cdw10 |= (flags & PR_FL_IGNORE_KEY) ? NVME_PR_IGNORE_KEY : 0;
+
+ return nvme_send_pr_command(bdev, cdw10, 0, nvme_cmd_resv_acquire,
+ &data, sizeof(data));
}
static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
enum pr_type type, bool abort)
{
- u32 cdw10 = nvme_pr_type_from_blk(type) << 8 | (abort ? 2 : 1);
+ struct nvmet_pr_acquire_data data = { 0 };
+ u32 cdw10;
+
+ data.crkey = cpu_to_le64(old);
+ data.prkey = cpu_to_le64(new);
- return nvme_pr_command(bdev, cdw10, old, new, nvme_cmd_resv_acquire);
+ cdw10 = abort ? NVME_PR_ACQUIRE_ACT_PREEMPT_AND_ABORT :
+ NVME_PR_ACQUIRE_ACT_PREEMPT;
+ cdw10 |= nvme_pr_type_from_blk(type) << 8;
+
+ return nvme_send_pr_command(bdev, cdw10, 0, nvme_cmd_resv_acquire,
+ &data, sizeof(data));
}
static int nvme_pr_clear(struct block_device *bdev, u64 key)
{
- u32 cdw10 = 1 | (key ? 0 : 1 << 3);
+ struct nvmet_pr_release_data data = { 0 };
+ u32 cdw10;
+
+ data.crkey = cpu_to_le64(key);
- return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
+ cdw10 = NVME_PR_RELEASE_ACT_CLEAR;
+ cdw10 |= key ? 0 : NVME_PR_IGNORE_KEY;
+
+ return nvme_send_pr_command(bdev, cdw10, 0, nvme_cmd_resv_release,
+ &data, sizeof(data));
}
static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type)
{
- u32 cdw10 = nvme_pr_type_from_blk(type) << 8 | (key ? 0 : 1 << 3);
+ struct nvmet_pr_release_data data = { 0 };
+ u32 cdw10;
+
+ data.crkey = cpu_to_le64(key);
- return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
+ cdw10 = NVME_PR_RELEASE_ACT_RELEASE;
+ cdw10 |= nvme_pr_type_from_blk(type) << 8;
+ cdw10 |= key ? 0 : NVME_PR_IGNORE_KEY;
+
+ return nvme_send_pr_command(bdev, cdw10, 0, nvme_cmd_resv_release,
+ &data, sizeof(data));
}
static int nvme_pr_resv_report(struct block_device *bdev, void *data,
u32 data_len, bool *eds)
{
- struct nvme_command c = { };
+ u32 cdw10, cdw11;
int ret;
- c.common.opcode = nvme_cmd_resv_report;
- c.common.cdw10 = cpu_to_le32(nvme_bytes_to_numd(data_len));
- c.common.cdw11 = cpu_to_le32(NVME_EXTENDED_DATA_STRUCT);
+ cdw10 = nvme_bytes_to_numd(data_len);
+ cdw11 = NVME_EXTENDED_DATA_STRUCT;
*eds = true;
retry:
- ret = nvme_send_pr_command(bdev, &c, data, data_len);
+ ret = __nvme_send_pr_command(bdev, cdw10, cdw11, nvme_cmd_resv_report,
+ data, data_len);
if (ret == NVME_SC_HOST_ID_INCONSIST &&
- c.common.cdw11 == cpu_to_le32(NVME_EXTENDED_DATA_STRUCT)) {
- c.common.cdw11 = 0;
+ cdw11 == NVME_EXTENDED_DATA_STRUCT) {
+ cdw11 = 0;
*eds = false;
goto retry;
}
- if (ret < 0)
- return ret;
-
- return nvme_status_to_pr_err(ret);
+ return ret < 0 ? ret : nvme_status_to_pr_err(ret);
}
static int nvme_pr_read_keys(struct block_device *bdev,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0087/1756] nvme: unregister when pr_register() is given a zero new key
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0086/1756] nvme: tuning pr code by using defined structs and macros Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0088/1756] mm/vma: dont leak the charge for stack growth Greg Kroah-Hartman
` (911 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Daejun Park,
Keith Busch, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
[ Upstream commit a9d431124fb2e58215daf0299d6fcf47bbc2d6b1 ]
The block layer PR API defines a zero new_key in pr_register() as
unregistering old_key. nvme_pr_register() sends Replace Reservation
Key with a zero NRKEY instead. The host stays registered with key 0,
and its next registration with another key fails with Reservation
Conflict.
The pNFS SCSI layout client unregisters this way at umount. A later
mount cannot register and sends all I/O through the metadata server.
Send Unregister Reservation Key when new_key is zero.
Fixes: 1d277a637a71 ("NVMe: Add persistent reservation ops")
Cc: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/pr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/pr.c b/drivers/nvme/host/pr.c
index fe7dbe2648158..d8b6ac4d83bb9 100644
--- a/drivers/nvme/host/pr.c
+++ b/drivers/nvme/host/pr.c
@@ -128,8 +128,12 @@ static int nvme_pr_register(struct block_device *bdev, u64 old_key, u64 new_key,
data.crkey = cpu_to_le64(old_key);
data.nrkey = cpu_to_le64(new_key);
- cdw10 = old_key ? NVME_PR_REGISTER_ACT_REPLACE :
- NVME_PR_REGISTER_ACT_REG;
+ if (!new_key)
+ cdw10 = NVME_PR_REGISTER_ACT_UNREG;
+ else if (old_key)
+ cdw10 = NVME_PR_REGISTER_ACT_REPLACE;
+ else
+ cdw10 = NVME_PR_REGISTER_ACT_REG;
cdw10 |= (flags & PR_FL_IGNORE_KEY) ? NVME_PR_IGNORE_KEY : 0;
cdw10 |= NVME_PR_CPTPL_PERSIST;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0088/1756] mm/vma: dont leak the charge for stack growth
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0087/1756] nvme: unregister when pr_register() is given a zero new key Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0089/1756] drm/i915/psr: Clear selective fetch area when duplicating plane state Greg Kroah-Hartman
` (910 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Lorenzo Stoakes (ARM),
Pedro Falcato, Harry Yoo (Meta), Muhammad Usama Anjum,
David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit b1ee87802111156e27557e82acc31fa7dfc76e2a ]
acct_stack_growth() charges stack expansion even without VM_ACCOUNT.
This can happen for read-only or MAP_NORESERVE mappings created with
MAP_GROWSDOWN. Unmapping these VMAs does not release the charge, leaking
Committed_AS.
Only check and charge growth for VM_ACCOUNT VMAs, matching mremap().
Unaccounted growth skips the overcommit check while remaining subject
to the other stack-growth limits.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reported-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Reviewed-by: Harry Yoo (Meta) <harry@kernel.org>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-44-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Replaced vma_test(vma, VMA_ACCOUNT_BIT) with the equivalent vma->vm_flags & VM_ACCOUNT check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index c930e03bd7997..e2c51c6ed83d2 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1040,7 +1040,8 @@ static int acct_stack_growth(struct vm_area_struct *vma,
* Overcommit.. This must be the final test, as it will
* update security statistics.
*/
- if (security_vm_enough_memory_mm(mm, grow))
+ if ((vma->vm_flags & VM_ACCOUNT) &&
+ security_vm_enough_memory_mm(mm, grow))
return -ENOMEM;
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0089/1756] drm/i915/psr: Clear selective fetch area when duplicating plane state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0088/1756] mm/vma: dont leak the charge for stack growth Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0090/1756] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held Greg Kroah-Hartman
` (909 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jouni Högander, Mika Kahola,
Joonas Lahtinen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <jouni.hogander@intel.com>
[ Upstream commit cbe565475988d3b22dc36f13c14d9f0eec1685cd ]
We are currently not clearing selective fetch area when duplicating plane
state. This is causing problem when plane is re-used for another
purpose. Fix this by clearing selective fetch area when duplicating plane
state.
Now as the state is cleared we need to ensure we have consistent selective
fetch area in plane state on full update. Earlier this was relying on
selective fetch area being copied from old state on state duplicate. Now
this isn't true anymore as we are clearing it. Tackle this by setting full
plane area as selective fetch area for each plane on full update. Rename
the label as skip_su_area_calc as the loop setting the plane selective
fetch area is not skipped anymore.
Move also psr2_sel_fetch_pipe_state_supported check after psr2_su_area
initialization. The loop is run on full update as well now and it needs
initialized psr2_su_area. Clip_area_update is only touching rect height and
x1/x2 are left untouched.
Don't set the area at all for planes not intersecting with the selective
update area. It is already zero sized after plane state duplicate.
Fixes: efab47658a6c ("drm/i915/display/psr: Calculate selective fetch plane registers")
Cc: <stable@vger.kernel.org> # v5.12+
Assisted-by: GitHub-Copilot:claude-opus-5
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20260929094434.77129-2-jouni.hogander@intel.com
(cherry picked from commit bd58f0e221386808cd614bb205112e807dc6b159)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
[ sashal: Adjusted intel_plane_duplicate_state() context to preserve the existing flags reset instead of the newer fence_id and damage resets. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../gpu/drm/i915/display/intel_atomic_plane.c | 1 +
drivers/gpu/drm/i915/display/intel_psr.c | 24 +++++++++----------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 186735b469c5c..4f668cc1d7fb9 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -115,6 +115,7 @@ intel_plane_duplicate_state(struct drm_plane *plane)
intel_state->ggtt_vma = NULL;
intel_state->dpt_vma = NULL;
intel_state->flags = 0;
+ intel_state->psr2_sel_fetch_area = DRM_RECT_INIT(0, 0, 0, 0);
/* add reference to fb */
if (intel_state->hw.fb)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 97f82949a3a51..d59f2131fd996 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2579,16 +2579,16 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
if (!crtc_state->enable_psr2_sel_fetch)
return 0;
- if (!psr2_sel_fetch_pipe_state_supported(crtc_state)) {
- full_update = true;
- goto skip_sel_fetch_set_loop;
- }
-
crtc_state->psr2_su_area.x1 = 0;
crtc_state->psr2_su_area.y1 = -1;
crtc_state->psr2_su_area.x2 = drm_rect_width(&display_area);
crtc_state->psr2_su_area.y2 = -1;
+ if (!psr2_sel_fetch_pipe_state_supported(crtc_state)) {
+ full_update = true;
+ goto skip_su_area_calc;
+ }
+
/*
* Calculate minimal selective fetch area of each plane and calculate
* the pipe damaged area.
@@ -2672,7 +2672,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
}
if (full_update)
- goto skip_sel_fetch_set_loop;
+ goto skip_su_area_calc;
intel_psr_apply_su_area_workarounds(crtc_state);
@@ -2708,6 +2708,11 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
break;
} while (su_area_changed);
+skip_su_area_calc:
+ if (full_update)
+ clip_area_update(&crtc_state->psr2_su_area, &display_area,
+ &display_area);
+
/*
* Now that we have the pipe damaged area check if it intersect with
* every plane, if it does set the plane selective fetch area.
@@ -2724,8 +2729,6 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
inter = crtc_state->psr2_su_area;
sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
if (!drm_rect_intersect(&inter, &new_plane_state->uapi.dst)) {
- sel_fetch_area->y1 = -1;
- sel_fetch_area->y2 = -1;
/*
* if plane sel fetch was previously enabled ->
* disable it
@@ -2765,11 +2768,6 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
}
}
-skip_sel_fetch_set_loop:
- if (full_update)
- clip_area_update(&crtc_state->psr2_su_area, &display_area,
- &display_area);
-
psr2_man_trk_ctl_calc(crtc_state, full_update);
crtc_state->pipe_srcsz_early_tpt =
psr2_pipe_srcsz_early_tpt_calc(crtc_state, full_update);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0090/1756] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0089/1756] drm/i915/psr: Clear selective fetch area when duplicating plane state Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0091/1756] mm/madvise: preserve VMA_SOFTDIRTY_BIT when changing anonymous names Greg Kroah-Hartman
` (908 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Andrew Morton, Chris Mason, Lorenzo Stoakes (ARM), Muchun Song,
Lance Yang, Liam R. Howlett, Vlastimil Babka, Jann Horn,
Pedro Falcato, Oscar Salvador, Miaohe Lin, Naoya Horiguchi,
Adam Litke, Mel Gorman, Rik van Riel, Peter Xu, Kiryl Shutsemau,
Mike Rapoport, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit d42032c0fe3ca007986c1229128775af0340fbec ]
Since commit bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private
VMAs") the lock of a private hugetlb VMA that owns a reservation is the
rw_sema of its resv_map. The hugetlb_vma_*lock*() helpers find it through
vma->vm_private_data, anew for every lock and every unlock.
At the end of mremap() the old VMA has to let go of the resv_map, which
now belongs to the new VMA: clear_vma_resv_huge_pages() stores NULL into
vm_private_data. mremap() holds mmap_lock for writing and has write
locked the VMA, which keeps away everybody who comes through the mm. It
does not keep away those who find the VMA through the file. For hole
punch and truncation hugetlb_vmdelete_list() does
hugetlb_vma_trylock_write(vma); locks resv_map->rw_sema
unmap_hugepage_range(vma, ...);
vm_private_data = NULL
hugetlb_vma_unlock_write(vma); no resv_map: does nothing
and the rw_sema stays write locked for ever:
WARNING: lock held when returning to user space!
mremap_punch/116 is leaving the kernel with locks still held!
locks held by mremap_punch/116: 1, last CPU#1:
#0: (&resv_map->rw_sema){+.+.}-{4:4}, at:
hugetlb_vmdelete_list+0x46/0x160
The next fault in the new VMA sleeps in hugetlb_vma_lock_read(),
uninterruptibly, and it holds its entry of hugetlb_fault_mutex_table[].
That table is global, so a fault of any other process on a page that
hashes to the same entry sleeps uninterruptibly as well.
All those who take the lock of a private VMA without taking the mmap/vma
lock are affected: rmap walks. So hold i_mmap_rwsem around the clearing
of the resv_map.
No change of behaviour, other than that mremap() of a hugetlb VMA takes
i_mmap_rwsem once more.
Original fix generated by an LLM and sent in private by Josef.
[david: avoid local variable, move and refine comment, description cleanups+simplifications]
Link: https://lore.kernel.org/20261015-urgent_fixes-v1-5-42796911043b@kernel.org
Fixes: bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private VMAs")
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Chris Mason <mason@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Rik van Riel <riel@surriel.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: <stable@vger.kernel.org>
[ sashal: applied the change around the existing clear_vma_resv_huge_pages() call in move_vma() because fixup_hugetlb_reservations() is absent ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mremap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/mremap.c b/mm/mremap.c
index 3d5c2f69fdbfd..6731efdcd21bc 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -812,7 +812,14 @@ static unsigned long move_vma(struct vm_area_struct *vma,
}
if (is_vm_hugetlb_page(vma)) {
+ /*
+ * Rmap walks might still find this VMA and take the lock
+ * inside the reservation map for __vma_private_lock(). Don't clear
+ * the reservation map while that is possible.
+ */
+ i_mmap_lock_write(vma->vm_file->f_mapping);
clear_vma_resv_huge_pages(vma);
+ i_mmap_unlock_write(vma->vm_file->f_mapping);
}
/* Conceal VM_ACCOUNT so old reservation is not undone */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0091/1756] mm/madvise: preserve VMA_SOFTDIRTY_BIT when changing anonymous names
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0090/1756] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0092/1756] mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs Greg Kroah-Hartman
` (907 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Hildenbrand (Arm),
Lorenzo Stoakes (ARM), Andrew Morton, Pedro Falcato,
Gregory Price (Meta), Liam R. Howlett, Vlastimil Babka,
Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Jann Horn,
Davidlohr Bueso, SJ Park, Kees Cook, Colin Cross, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 652f15be3c11415725694ccea317c51e35c0b582 ]
When changing the anonymous VMA name, madvise_update_vma() calls
vma_modify_name() to possibly merge with adjacent VMAs. We don't call
vma_modify_flags() and consequently don't obtain the new VMA flags.
Later in the function we update the VMA flags to the stale new_vma_flags
we obtained before. This can result in us losing the VMA_SOFTDIRTY_BIT
flag set on a VMA we just merged with.
There is no need to update the VMA flags at all, so just exit early. This
skips calling khugepaged_enter_vma(), but since the flags didn't change
this is fine.
[ljs@kernel.org: minor edit of commit message, rebased]
Link: https://lore.kernel.org/20261023-fix-vma-atomic-v1-3-8ff4fae1fc85@kernel.org
Fixes: 9a10064f5625 ("mm: add a field to store names for private anonymous memory")
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jann Horn <jannh@google.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: SJ Park <sj@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Colin Cross <ccross@google.com>
Cc: <stable@vger.kernel.org>
[ sashal: inferred name-only changes from pre-merge flag equality instead of using a separate name-change indicator ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/madvise.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/mm/madvise.c b/mm/madvise.c
index 6ce97106d6d44..2f2f4ba351a0b 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -140,6 +140,7 @@ static int madvise_update_vma(struct vm_area_struct *vma,
struct anon_vma_name *anon_name)
{
struct mm_struct *mm = vma->vm_mm;
+ bool set_new_anon_name = new_flags == vma->vm_flags;
int error;
VMA_ITERATOR(vmi, mm, start);
@@ -157,6 +158,9 @@ static int madvise_update_vma(struct vm_area_struct *vma,
/* vm_flags is protected by the mmap_lock held in write mode. */
vma_start_write(vma);
+ if (set_new_anon_name)
+ return replace_anon_vma_name(vma, anon_name);
+
vm_flags_reset(vma, new_flags);
/*
* If the vma become good for khugepaged to scan,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0092/1756] mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0091/1756] mm/madvise: preserve VMA_SOFTDIRTY_BIT when changing anonymous names Greg Kroah-Hartman
@ 2026-11-18 14:36 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0093/1756] vhost-scsi: Reduce mem use by moving upages to per queue Greg Kroah-Hartman
` (906 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Stoakes (ARM), Pedro Falcato,
Dev Jain, Muhammad Usama Anjum, Lance Yang,
David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit b4417d08034a7b4a3083e0e2d95429d4542524f2 ]
move_huge_pud() reads the old PUD and clears it in separate operations.
Hardware accessed or dirty updates between those operations can be lost
when the saved entry is installed at the new address.
The raw pud_clear() also bypasses page_table_check_pud_clear(), while
set_pud_at() accounts for the destination mapping. This leaves the
checker counts unbalanced for mappings tracked by page table checking.
To fix it, simply use pudp_huge_get_and_clear().
Fixes: 7d846db7d0e2 ("mm/mremap: convert huge PUD move to separate helper")
Cc: stable@vger.kernel.org
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-30-d6437171ecc3@kernel.org
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Replaced pmc->old_addr with the existing old_addr argument in move_huge_pud(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mremap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/mremap.c b/mm/mremap.c
index 6731efdcd21bc..d697a684b141c 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -400,8 +400,7 @@ static bool move_huge_pud(struct vm_area_struct *vma, unsigned long old_addr,
spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
/* Clear the pud */
- pud = *old_pud;
- pud_clear(old_pud);
+ pud = pudp_huge_get_and_clear(mm, old_addr, old_pud);
VM_BUG_ON(!pud_none(*new_pud));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0093/1756] vhost-scsi: Reduce mem use by moving upages to per queue
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2026-11-18 14:36 ` [PATCH 6.12 0092/1756] mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0094/1756] vhost-scsi: zero misaligned I/O bounce pages Greg Kroah-Hartman
` (905 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Michael S. Tsirkin,
Stefan Hajnoczi, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <michael.christie@oracle.com>
[ Upstream commit 4c1f3a7d74277903b290dd989cbd2ea8627fc925 ]
Each worker thread can process 1 command at a time so there's no need to
allocate a upages array per cmd. This patch moves it to per queue. Even a
small device with 128 cmds and 1 queue this brings mem use for the array
from
2 MB = 8 bytes per page pointer * 2048 pointers * 128 cmds
to
16K = 8 bytes per pointer * 2048 * 1 queue
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Message-Id: <20241203191705.19431-2-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Stable-dep-of: 01c3a5fa6d64 ("vhost-scsi: zero misaligned I/O bounce pages")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/scsi.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index fa0d407442914..725166d4cc79f 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -83,7 +83,6 @@ struct vhost_scsi_cmd {
/* Pointer to the SGL formatted memory from virtio-scsi */
struct scatterlist *tvc_sgl;
struct scatterlist *tvc_prot_sgl;
- struct page **tvc_upages;
/* Pointer to response header iovec */
struct iovec *tvc_resp_iov;
/* Pointer to vhost_scsi for our device */
@@ -187,6 +186,7 @@ struct vhost_scsi_virtqueue {
struct vhost_scsi_cmd *scsi_cmds;
struct sbitmap scsi_tags;
int max_cmds;
+ struct page **upages;
struct vhost_work completion_work;
struct llist_head completion_list;
@@ -624,7 +624,6 @@ vhost_scsi_get_cmd(struct vhost_virtqueue *vq, struct vhost_scsi_tpg *tpg,
struct vhost_scsi_nexus *tv_nexus;
struct scatterlist *sg, *prot_sg;
struct iovec *tvc_resp_iov;
- struct page **pages;
int tag;
tv_nexus = tpg->tpg_nexus;
@@ -642,12 +641,10 @@ vhost_scsi_get_cmd(struct vhost_virtqueue *vq, struct vhost_scsi_tpg *tpg,
cmd = &svq->scsi_cmds[tag];
sg = cmd->tvc_sgl;
prot_sg = cmd->tvc_prot_sgl;
- pages = cmd->tvc_upages;
tvc_resp_iov = cmd->tvc_resp_iov;
memset(cmd, 0, sizeof(*cmd));
cmd->tvc_sgl = sg;
cmd->tvc_prot_sgl = prot_sg;
- cmd->tvc_upages = pages;
cmd->tvc_se_cmd.map_tag = tag;
cmd->tvc_tag = scsi_tag;
cmd->tvc_lun = lun;
@@ -674,7 +671,9 @@ vhost_scsi_map_to_sgl(struct vhost_scsi_cmd *cmd,
struct scatterlist *sgl,
bool is_prot)
{
- struct page **pages = cmd->tvc_upages;
+ struct vhost_scsi_virtqueue *svq = container_of(cmd->tvc_vq,
+ struct vhost_scsi_virtqueue, vq);
+ struct page **pages = svq->upages;
struct scatterlist *sg = sgl;
ssize_t bytes, mapped_bytes;
size_t offset, mapped_offset;
@@ -1659,11 +1658,11 @@ static void vhost_scsi_destroy_vq_cmds(struct vhost_virtqueue *vq)
kfree(tv_cmd->tvc_sgl);
kfree(tv_cmd->tvc_prot_sgl);
- kfree(tv_cmd->tvc_upages);
kfree(tv_cmd->tvc_resp_iov);
}
sbitmap_free(&svq->scsi_tags);
+ kfree(svq->upages);
kfree(svq->scsi_cmds);
svq->scsi_cmds = NULL;
}
@@ -1689,6 +1688,11 @@ static int vhost_scsi_setup_vq_cmds(struct vhost_virtqueue *vq, int max_cmds)
return -ENOMEM;
}
+ svq->upages = kcalloc(VHOST_SCSI_PREALLOC_UPAGES, sizeof(struct page *),
+ GFP_KERNEL);
+ if (!svq->upages)
+ goto out;
+
for (i = 0; i < max_cmds; i++) {
tv_cmd = &svq->scsi_cmds[i];
@@ -1700,14 +1704,6 @@ static int vhost_scsi_setup_vq_cmds(struct vhost_virtqueue *vq, int max_cmds)
goto out;
}
- tv_cmd->tvc_upages = kcalloc(VHOST_SCSI_PREALLOC_UPAGES,
- sizeof(struct page *),
- GFP_KERNEL);
- if (!tv_cmd->tvc_upages) {
- pr_err("Unable to allocate tv_cmd->tvc_upages\n");
- goto out;
- }
-
tv_cmd->tvc_resp_iov = kcalloc(UIO_MAXIOV,
sizeof(struct iovec),
GFP_KERNEL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0094/1756] vhost-scsi: zero misaligned I/O bounce pages
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0093/1756] vhost-scsi: Reduce mem use by moving upages to per queue Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0095/1756] quota: initialize dquot cache before mounting rootfs Greg Kroah-Hartman
` (904 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shubham Antil, Mike Christie,
Michael S. Tsirkin, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shubham Antil <shubham@octane.security>
[ Upstream commit 01c3a5fa6d641c93c7cef4fb25c5f12938316e18 ]
The misaligned I/O fallback copies the full bounce scatterlist to the
request buffer during completion. If a data-in command transfers less
than requested, part of a newly allocated bounce page can remain unwritten.
Allocate bounce pages with __GFP_ZERO so all bytes copied during completion
have a defined value. This path is already the slow fallback for
misaligned I/O, so the added initialization cost is acceptable.
Found during an LLM-assisted source audit and validated with a QEMU/KVM
vhost-scsi target using misaligned data-in commands.
Fixes: 5ced58bfa132 ("vhost-scsi: Fix alignment handling with windows")
Cc: stable@vger.kernel.org
Assisted-by: LLM (OpenAI Codex, gpt-5.6-sol)
Signed-off-by: Shubham Antil <shubham@octane.security>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261020105503.75904-1-shubham@octane.security>
[ sashal: Adjusted context to retain the existing indexed scatterlist loop in place of for_each_sgtable_sg(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vhost/scsi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 4e1b5184cf36b..5a904241f6311 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -771,7 +771,12 @@ vhost_scsi_copy_iov_to_sgl(struct vhost_scsi_cmd *cmd, struct iov_iter *iter,
}
for (i = 0; i < sg_count; i++) {
- page = alloc_page(GFP_KERNEL);
+ /*
+ * Completion copies the full bounce buffer, including bytes the
+ * target did not write. This is already the slow fallback for
+ * misaligned I/O, so zeroing is acceptable here.
+ */
+ page = alloc_page(GFP_KERNEL | __GFP_ZERO);
if (!page) {
i--;
ret = -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0095/1756] quota: initialize dquot cache before mounting rootfs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0094/1756] vhost-scsi: zero misaligned I/O bounce pages Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0096/1756] ksmbd: let the owner read and change the DACL when no ACE names it Greg Kroah-Hartman
` (903 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dylan Johnson, YouYou Yu,
Gunnar Kudrjavets, Jan Kara, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: YouYou Yu <youyouyu@amazon.com>
[ Upstream commit e21a6f39aa6d0336ffbf5f34e5fa20ff8de36773 ]
On some systems, a tmpfs backed rootfs is extensively used throughout
system's lifecycle. tmpfs quotas are needed to limit per user rootfs
usage. However, booting with CONFIG_TMPFS_QUOTA=y, an initramfs, no root=
and "initramfs_options=usrquota" panics at boot:
BUG: kernel NULL pointer dereference, address: 0000000000000000
RIP: 0010:dqget+0x1ac/0x490
Call Trace:
__dquot_initialize
dquot_initialize
shmem_get_inode
shmem_fill_super
...
mnt_init
vfs_caches_init
start_kernel
The rootfs is mounted from mnt_init(), but the dquot hash table and
cache are only set up later by dquot_init(), an fs_initcall. Creating
the root inode of a quota enabled rootfs thus dereferences the NULL
dquot_hash in dqget().
Rename dquot_init() to dquot_cache_init() and call it from
vfs_caches_init() before mnt_init(). The slab, percpu and early
workqueue code it relies on is available there, and the workqueue
rescuer and shrinker debugfs entries are set up later by their own
subsystems. Keep the sysctl registration in an fs_initcall, as done
for the dcache, inode and mount sysctls. This only moves existing
allocations earlier in boot.
Fixes: 278033a225e1 ("fs: Add 'initramfs_options' to set initramfs mount options")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Dylan Johnson <dgj@amazon.com>
Signed-off-by: Dylan Johnson <dgj@amazon.com>
Signed-off-by: YouYou Yu <youyouyu@amazon.com>
Reviewed-by: Gunnar Kudrjavets <gunnarku@amazon.com>
Link: https://patch.msgid.link/20261021181217.20171-1-youyouyu@amazon.com
Signed-off-by: Jan Kara <jack@suse.cz>
[ sashal: adjusted context to match existing quota initialization declarations and surrounding includes ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dcache.c | 2 ++
fs/quota/dquot.c | 10 ++++++----
include/linux/quotaops.h | 5 +++++
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index ff9d401e18539..55270ad327b48 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -32,6 +32,7 @@
#include <linux/bit_spinlock.h>
#include <linux/rculist_bl.h>
#include <linux/list_lru.h>
+#include <linux/quotaops.h>
#include "internal.h"
#include "mount.h"
@@ -3204,6 +3205,7 @@ void __init vfs_caches_init(void)
inode_init();
files_init();
files_maxfiles_init();
+ dquot_cache_init();
mnt_init();
bdev_cache_init();
chrdev_init();
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 7c3095622872f..1912ebf2bafdb 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -3020,7 +3020,7 @@ static struct ctl_table fs_dqstats_table[] = {
#endif
};
-static int __init dquot_init(void)
+void __init dquot_cache_init(void)
{
int i, ret;
unsigned long nr_hash, order;
@@ -3028,8 +3028,6 @@ static int __init dquot_init(void)
printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
- register_sysctl_init("fs/quota", fs_dqstats_table);
-
dquot_cachep = kmem_cache_create("dquot",
sizeof(struct dquot), sizeof(unsigned long) * 4,
(SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
@@ -3071,7 +3069,11 @@ static int __init dquot_init(void)
WQ_UNBOUND | WQ_MEM_RECLAIM, WQ_MAX_ACTIVE);
if (!quota_unbound_wq)
panic("Cannot create quota_unbound_wq\n");
+}
+static int __init init_fs_dquot_sysctls(void)
+{
+ register_sysctl_init("fs/quota", fs_dqstats_table);
return 0;
}
-fs_initcall(dquot_init);
+fs_initcall(init_fs_dquot_sysctls);
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 2334a02c30149..06563b0baccfd 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -40,6 +40,7 @@ void __quota_error(struct super_block *sb, const char *func,
/*
* declaration of quota_function calls in kernel.
*/
+void dquot_cache_init(void);
int dquot_initialize(struct inode *inode);
bool dquot_initialize_needed(struct inode *inode);
void dquot_drop(struct inode *inode);
@@ -206,6 +207,10 @@ static inline int sb_has_quota_active(struct super_block *sb, int type)
return 0;
}
+static inline void dquot_cache_init(void)
+{
+}
+
static inline int dquot_initialize(struct inode *inode)
{
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0096/1756] ksmbd: let the owner read and change the DACL when no ACE names it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0095/1756] quota: initialize dquot cache before mounting rootfs Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0097/1756] mm/userfaultfd: compare exact registration modes before skipping Greg Kroah-Hartman
` (902 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
[ Upstream commit ffc855fe16afe02b22305111aa68cd8d07360941 ]
smb_check_perm_dacl() refuses the owner when neither its DACL lookup nor
the POSIX ACL fallback matches. The owner then cannot read or replace
the DACL over SMB. MS-DTYP 2.5.3.2 grants the owner READ_CONTROL and
WRITE_DAC unless an OWNER RIGHTS ACE applies.
An empty DACL allows the owner's explicit requests for these rights but
refuses MAXIMUM_ALLOWED. smb2_open() uses that check for the maximal
access reply (MS-SMB2 3.3.5.9.5), so even a READ_CONTROL open fails when
it asks for that reply.
Grant the owner's implicit rights on both paths, for explicit requests
and MAXIMUM_ALLOWED, unless an OWNER RIGHTS ACE applies.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: added the missing sid_owner_rights constant definition for OWNER_RIGHTS SID S-1-3-4 ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smbacl.c | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/fs/smb/server/smbacl.c b/fs/smb/server/smbacl.c
index d8c01e775d941..42a638d1d2b97 100644
--- a/fs/smb/server/smbacl.c
+++ b/fs/smb/server/smbacl.c
@@ -27,6 +27,9 @@ static const struct smb_sid creator_owner = {
/* security id for everyone/world system group */
static const struct smb_sid creator_group = {
1, 1, {0, 0, 0, 0, 0, 3}, {cpu_to_le32(1)} };
+/* security id for owner rights */
+static const struct smb_sid sid_owner_rights = {
+ 1, 1, {0, 0, 0, 0, 0, 3}, {cpu_to_le32(4)} };
/* security id for everyone/world system group */
static const struct smb_sid sid_everyone = {
@@ -1466,6 +1469,7 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
int i, found = 0;
unsigned int access_bits = 0, denied = 0;
struct smb_ace *others_ace = NULL;
+ bool or_ace = false;
struct posix_acl_entry *pa_entry;
unsigned int sid_type = SIDOWNER;
unsigned short ace_size;
@@ -1498,6 +1502,8 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
is_owner = uid == from_kuid(&init_user_ns, vfsuid_into_kuid(vfsuid));
if (!pdacl->num_aces) {
+ unsigned int allowed = 0;
+
/*
* An empty (present, zero-ACE) DACL grants no access to
* anyone except the object owner's implicit READ_CONTROL
@@ -1506,9 +1512,14 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
* not let trailing bytes after a zero-ACE DACL become an
* implicit grant.
*/
- if (!is_owner ||
- (*pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)))
+ if (is_owner)
+ allowed = READ_CONTROL | WRITE_DAC;
+ if (*pdaccess & FILE_MAXIMAL_ACCESS_LE)
+ requested |= allowed;
+ if (!allowed || requested & ~allowed)
rc = -EACCES;
+ else
+ *pdaccess = cpu_to_le32(requested);
goto err_out;
}
@@ -1585,6 +1596,9 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
found = 1;
break;
}
+ if (!compare_sids(&sid_owner_rights, &ace->sid) &&
+ !(ace->flags & INHERIT_ONLY_ACE))
+ or_ace = true;
if (!compare_sids(&sid_everyone, &ace->sid) ||
!compare_sids(&sid_authusers, &ace->sid))
others_ace = ace;
@@ -1629,8 +1643,23 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
if (others_ace) {
ace = others_ace;
} else {
- ksmbd_debug(SMB, "Can't find corresponding sid\n");
- rc = -EACCES;
+ unsigned int allowed = 0;
+
+ /*
+ * No ACE names the owner, who may still read and
+ * change the DACL unless OWNER RIGHTS applies
+ * (MS-DTYP 2.5.3.2).
+ */
+ if (is_owner && !or_ace)
+ allowed = READ_CONTROL | WRITE_DAC;
+ if (*pdaccess & FILE_MAXIMAL_ACCESS_LE)
+ requested |= allowed;
+ if (!allowed || requested & ~allowed) {
+ ksmbd_debug(SMB, "Can't find corresponding sid\n");
+ rc = -EACCES;
+ goto err_out;
+ }
+ *pdaccess = cpu_to_le32(requested);
goto err_out;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0097/1756] mm/userfaultfd: compare exact registration modes before skipping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0096/1756] ksmbd: let the owner read and change the DACL when no ACE names it Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0098/1756] apparmor: fix query_data() output overlapping the lookup key Greg Kroah-Hartman
` (901 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Muhammad Usama Anjum, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price <gourry@gourry.net>
[ Upstream commit 05f64f211a25f7d9771d4fde109aad97174a1cf3 ]
Changing registration from MISSING|WP to WP returns success but leaves
MISSING enabled. The no-op check sees that WP is already set and skips
the update, so later accesses to missing pages still wait for userspace.
Skip the update only when the current and requested UFFD modes match
exactly.
Fixes: 63b2d4174c4a ("userfaultfd: wp: add the writeprotect API to userfaultfd ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
[ david: apply fixup from Lorenzo ]
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-26-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: replaced vma_flags_t helpers with a direct vm_flags bitmask comparison ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/userfaultfd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 10685c46f0866..6a575335bc6f0 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -1979,7 +1979,7 @@ int userfaultfd_register_range(struct userfaultfd_ctx *ctx,
* userfaultfd and with the right tracking mode too.
*/
if (vma->vm_userfaultfd_ctx.ctx == ctx &&
- (vma->vm_flags & vm_flags) == vm_flags)
+ (vma->vm_flags & __VM_UFFD_FLAGS) == vm_flags)
goto skip;
if (vma->vm_start > start)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0098/1756] apparmor: fix query_data() output overlapping the lookup key
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0097/1756] mm/userfaultfd: compare exact registration modes before skipping Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0099/1756] virtio_blk: use synchronous quiesce in virtblk_freeze_priv() Greg Kroah-Hartman
` (900 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Francis Perron,
AutonomousCodeSecurity, Cen Zhang (Microsoft), John Johansen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
[ Upstream commit d30844001360a403a511cf24fc75ecaa6a7a7544 ]
In query_data(), buf and query point into the same multi_transaction
buffer: buf at the start, query a few bytes in, and the lookup key
right after the label string that query points to. Reusing the buffer
is by design and is safe as long as the query is fully parsed before
buf is written to, but the key is not: it is dereferenced on every
iteration of label_for_each_confined(), after output has already been
written. So when the label has more than one profile with a data
table, the data of the first matching profile is written to buf while
the key is still needed, and overwrites it if the data is large enough.
The later lookups then run on a corrupted key. Besides, if the data has
no NUL byte from the key's position to the end of the allocation,
strhash() -> strlen() -> jhash() reads past the 4096-byte slab object,
triggering an out-of-bound read:
BUG: KASAN: slab-out-of-bounds in jhash+0x595/0x5e0
Read of size 1 at addr ff1100001159d000 by task exploit/155
CPU: 0 UID: 1000 PID: 155 Comm: exploit Not tainted 7.3.0-rc7 #1
Call Trace:
jhash+0x595/0x5e0
aa_write_access+0x880/0x1400
vfs_write+0x26f/0xd20
ksys_write+0x115/0x210
Writing to the .access file is unprivileged (0666), but triggering this
requires loaded profiles that carry a data table, which needs
CAP_MAC_ADMIN and is not the case on default distribution policies.
Fix by copying the key with kstrdup() before writing any output to buf,
so the key stays valid across all loop iterations regardless of what
gets written to the overlapping buffer.
Fixes: 317d9a054e1c ("apparmor: update query interface to support label queries")
Cc: stable@vger.kernel.org # v4.13+
Cc: Francis Perron <francis@akrites.dev>
Reported-by: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
[ sashal: Retained the older label critical-section API calls without the needput argument. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/apparmor/apparmorfs.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index c94c7c9f227ba..eeed8047b12ff 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -744,7 +744,7 @@ static void profile_query_cb(struct aa_profile *profile, struct aa_perms *perms,
static ssize_t query_data(char *buf, size_t buf_len,
char *query, size_t query_len)
{
- char *out;
+ char *out, *keydup;
const char *key;
struct label_it i;
struct aa_label *label, *curr;
@@ -765,11 +765,18 @@ static ssize_t query_data(char *buf, size_t buf_len,
if (buf_len < sizeof(bytes) + sizeof(blocks))
return -EINVAL; /* not enough space */
+ /* buf overlaps query, keep a copy of the key for the later lookups */
+ keydup = kstrdup(key, GFP_KERNEL);
+ if (!keydup)
+ return -ENOMEM;
+
curr = begin_current_label_crit_section();
label = aa_label_parse(curr, query, GFP_KERNEL, false, false);
end_current_label_crit_section(curr);
- if (IS_ERR(label))
+ if (IS_ERR(label)) {
+ kfree(keydup);
return PTR_ERR(label);
+ }
/* We are going to leave space for two numbers. The first is the total
* number of bytes we are writing after the first number. This is so
@@ -787,13 +794,14 @@ static ssize_t query_data(char *buf, size_t buf_len,
if (!profile->data)
continue;
- data = rhashtable_lookup_fast(profile->data, &key,
+ data = rhashtable_lookup_fast(profile->data, &keydup,
profile->data->p);
if (data) {
if (out + sizeof(outle32) + data->size > buf +
buf_len) {
aa_put_label(label);
+ kfree(keydup);
return -EINVAL; /* not enough space */
}
outle32 = __cpu_to_le32(data->size);
@@ -805,6 +813,7 @@ static ssize_t query_data(char *buf, size_t buf_len,
}
}
aa_put_label(label);
+ kfree(keydup);
outle32 = __cpu_to_le32(out - buf - sizeof(bytes));
memcpy(buf, &outle32, sizeof(outle32));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0099/1756] virtio_blk: use synchronous quiesce in virtblk_freeze_priv()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0098/1756] apparmor: fix query_data() output overlapping the lookup key Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0100/1756] mm/filemap: read mapping->a_ops->free_folio under i_lock Greg Kroah-Hartman
` (899 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason Wang, Stefan Hajnoczi,
Cong Zhang, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Zhang <cong.zhang@oss.qualcomm.com>
[ Upstream commit 6c6dec7883f8eb10b326bc9d109a4990c885d949 ]
blk_mq_run_work_fn() can call blk_mq_sched_dispatch_requests() through
blk_mq_run_dispatch_ops(). The dispatcher checks QUEUE_FLAG_QUIESCED
while the flag is clear. It can then be preempted before it gets a
request. At that time, it has no queue usage reference, so
blk_mq_freeze_queue() does not wait for it.
virtblk_freeze_priv() then calls blk_mq_quiesce_queue_nowait() and
blk_mq_unfreeze_queue(). A new request can enter the queue. The old
dispatcher can run again, use its old flag check, get the new request,
and call virtio_queue_rq(). At the same time, virtblk_freeze_priv() can
reset the device, delete the virtqueues, and free vblk->vqs. The old
dispatcher can then use a deleted virtqueue or a NULL vblk->vqs, and the
kernel can crash.
Fix this by using blk_mq_quiesce_queue(), which waits for dispatch code
that was already running. Keep the existing freeze and unfreeze order.
The queue remains quiesced until virtblk_restore_priv() calls
blk_mq_unquiesce_queue().
Fixes: 7678abee0867 ("virtio-blk: don't keep queue frozen during system suspend")
Cc: stable@vger.kernel.org
Acked-by: Jason Wang <jasowangio@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Cong Zhang <cong.zhang@oss.qualcomm.com>
Link: https://lore.kernel.org/20260911-virtblk_sync_quiesce-v1-1-a883f8f31258@oss.qualcomm.com
Link: https://patch.msgid.link/20261103-virtblk_sync_quiesce-v3-1-f40233f9bdd9@oss.qualcomm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Adjusted context from virtblk_freeze_priv() to virtblk_freeze() with older freeze/unfreeze signatures lacking memflags. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/virtio_blk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 789890f3c5ff4..43884773dc3a8 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1590,7 +1590,7 @@ static int virtblk_freeze(struct virtio_device *vdev)
/* Ensure no requests in virtqueues before deleting vqs. */
blk_mq_freeze_queue(q);
- blk_mq_quiesce_queue_nowait(q);
+ blk_mq_quiesce_queue(q);
blk_mq_unfreeze_queue(q);
/* Ensure we don't receive any more interrupts */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0100/1756] mm/filemap: read mapping->a_ops->free_folio under i_lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0099/1756] virtio_blk: use synchronous quiesce in virtblk_freeze_priv() Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0101/1756] mm/rmap: handle device-exclusive entries in folio_referenced_one() Greg Kroah-Hartman
` (898 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Rik van Riel,
Muhammad Usama Anjum, Zi Yan, David Hildenbrand (Arm),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit dc24e273244e9d712257d5a6c20a32c7f5ca84e6 ]
memory_failure() -> ... -> filemap_remove_folio() can read mapping->a_ops
after the inode has been freed. Once the folio is deleted from the
pagecache it no longer pins the mapping, so after i_lock is dropped
e.g., a concurrent final iput() can evict and free the inode before
filemap_free_folio() looks up mapping->a_ops->free_folio.
Most callers hold a reference on the inode, but not all.
Documentation/filesystems/vfs.rst explicitly states that ->free_folio()
must not assume the original address_space mapping still exists.
Fix it by loading ->free_folio while i_lock is still held, similar to
what folio_unmap_invalidate() does.
Inline filemap_free_folio() into its remaining caller such that
delete_from_page_cache_batch() also just loads the callback before
dropping the i_lock.
The bug was found by code inspection and has not been reproduced.
Fix generated by an LLM and sent by Josef Bacik in private.
Fixes: 59c66c5f8c4f ("mm: factor out page cache page freeing into a separate function")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
[ david: get rid of filemap_free_folio() entirely; improve patch description ]
Reviewed-by: Rik van Riel <riel@surriel.com>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-6-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted filemap_free_folio() removal to the additional invalidate_complete_folio2() caller by inlining its cleanup ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/filemap.c | 31 ++++++++++++++-----------------
mm/internal.h | 1 -
mm/truncate.c | 7 ++++++-
3 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 602106b329bc8..76efdb1e1b784 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -224,20 +224,6 @@ void __filemap_remove_folio(struct folio *folio, void *shadow)
page_cache_delete(mapping, folio, shadow);
}
-void filemap_free_folio(struct address_space *mapping, struct folio *folio)
-{
- void (*free_folio)(struct folio *);
- int refs = 1;
-
- free_folio = mapping->a_ops->free_folio;
- if (free_folio)
- free_folio(folio);
-
- if (folio_test_large(folio))
- refs = folio_nr_pages(folio);
- folio_put_refs(folio, refs);
-}
-
/**
* filemap_remove_folio - Remove folio from page cache.
* @folio: The folio.
@@ -249,6 +235,7 @@ void filemap_free_folio(struct address_space *mapping, struct folio *folio)
void filemap_remove_folio(struct folio *folio)
{
struct address_space *mapping = folio->mapping;
+ void (*free_folio)(struct folio *folio);
BUG_ON(!folio_test_locked(folio));
spin_lock(&mapping->host->i_lock);
@@ -257,9 +244,12 @@ void filemap_remove_folio(struct folio *folio)
xa_unlock_irq(&mapping->i_pages);
if (mapping_shrinkable(mapping))
inode_add_lru(mapping->host);
+ free_folio = mapping->a_ops->free_folio;
spin_unlock(&mapping->host->i_lock);
- filemap_free_folio(mapping, folio);
+ if (free_folio)
+ free_folio(folio);
+ folio_put_refs(folio, folio_nr_pages(folio));
}
/*
@@ -319,6 +309,7 @@ static void page_cache_delete_batch(struct address_space *mapping,
void delete_from_page_cache_batch(struct address_space *mapping,
struct folio_batch *fbatch)
{
+ void (*free_folio)(struct folio *folio);
int i;
if (!folio_batch_count(fbatch))
@@ -336,10 +327,16 @@ void delete_from_page_cache_batch(struct address_space *mapping,
xa_unlock_irq(&mapping->i_pages);
if (mapping_shrinkable(mapping))
inode_add_lru(mapping->host);
+ free_folio = mapping->a_ops->free_folio;
spin_unlock(&mapping->host->i_lock);
- for (i = 0; i < folio_batch_count(fbatch); i++)
- filemap_free_folio(mapping, fbatch->folios[i]);
+ for (i = 0; i < folio_batch_count(fbatch); i++) {
+ struct folio *folio = fbatch->folios[i];
+
+ if (free_folio)
+ free_folio(folio);
+ folio_put_refs(folio, folio_nr_pages(folio));
+ }
}
int filemap_check_errors(struct address_space *mapping)
diff --git a/mm/internal.h b/mm/internal.h
index 9fbed032a9c1a..ba332da196e43 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -402,7 +402,6 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t *start,
pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices);
unsigned find_get_entries(struct address_space *mapping, pgoff_t *start,
pgoff_t end, struct folio_batch *fbatch, pgoff_t *indices);
-void filemap_free_folio(struct address_space *mapping, struct folio *folio);
int truncate_inode_folio(struct address_space *mapping, struct folio *folio);
bool truncate_inode_partial_folio(struct folio *folio, loff_t start,
loff_t end);
diff --git a/mm/truncate.c b/mm/truncate.c
index fb5c20b57bd4f..8ed9ae8d6c1ef 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -574,6 +574,8 @@ EXPORT_SYMBOL(invalidate_mapping_pages);
static int invalidate_complete_folio2(struct address_space *mapping,
struct folio *folio)
{
+ void (*free_folio)(struct folio *folio);
+
if (folio->mapping != mapping)
return 0;
@@ -590,9 +592,12 @@ static int invalidate_complete_folio2(struct address_space *mapping,
xa_unlock_irq(&mapping->i_pages);
if (mapping_shrinkable(mapping))
inode_add_lru(mapping->host);
+ free_folio = mapping->a_ops->free_folio;
spin_unlock(&mapping->host->i_lock);
- filemap_free_folio(mapping, folio);
+ if (free_folio)
+ free_folio(folio);
+ folio_put_refs(folio, folio_nr_pages(folio));
return 1;
failed:
xa_unlock_irq(&mapping->i_pages);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0101/1756] mm/rmap: handle device-exclusive entries in folio_referenced_one()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0100/1756] mm/filemap: read mapping->a_ops->free_folio under i_lock Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0102/1756] fork: take mmap_lock before copying mm_struct Greg Kroah-Hartman
` (897 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Stoakes (ARM), Josef Bacik,
Harry Yoo (Meta), Barry Song, Dev Jain, Muhammad Usama Anjum,
Baolin Wang, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit f3c493d2f42b5f44a5c134d8d7ea7f960caf5e2c ]
page_vma_mapped_walk() can return non-present device-exclusive entries,
but folio_referenced_one() passes them to PTE young-bit accessors that
require present PTEs.
We must neither call clear_flush_young_ptes_notify() nor
folio_pte_batch() with non-present entries. For example, clearing the
young bit on non-present PTEs can corrupt the entry: on arm64
PTE_AF overlaps the swap type, so clearing it turns a device-exclusive
entry into an ordinary swap entry.
folio_pte_batch() will VM_WARN_ON_FOLIO.
Apply the same approach as the previous fixes to e.g., damon_ptep_mkold():
treat these entries as old from the CPU's perspective and obtain their
young state through the MMU notifier.
Skip PTE batching and MGLRU look-around for non-present entries, and
don't modify non-present PTEs.
Fixes: b756a3b5e7ea ("mm: device exclusive memory access")
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Cc: stable@vger.kernel.org
Reported-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Harry Yoo (Meta) <harry@kernel.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-9-d6437171ecc3@kernel.org
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Adapted batched PTE reference checks to the existing single-PTE walker. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/rmap.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/mm/rmap.c b/mm/rmap.c
index 1bf83e939583f..ad0c6b1eebfec 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -850,6 +850,7 @@ static bool folio_referenced_one(struct folio *folio,
DEFINE_FOLIO_VMA_WALK(pvmw, folio, vma, address, 0);
int referenced = 0;
unsigned long start = address, ptes = 0;
+ pte_t pteval;
while (page_vma_mapped_walk(&pvmw)) {
address = pvmw.address;
@@ -892,12 +893,25 @@ static bool folio_referenced_one(struct folio *folio,
return false;
}
- if (lru_gen_enabled() && pvmw.pte) {
+ if (pvmw.pte)
+ pteval = ptep_get(pvmw.pte);
+
+ if (lru_gen_enabled() && pvmw.pte && pte_present(pteval)) {
if (lru_gen_look_around(&pvmw))
referenced++;
} else if (pvmw.pte) {
- if (ptep_clear_flush_young_notify(vma, address,
- pvmw.pte))
+ bool young = false;
+
+ /*
+ * PFN swap PTEs, such as device-exclusive ones, that
+ * actually map pages are "old" from a CPU perspective.
+ * The MMU notifier takes care of any device aspects.
+ */
+ if (pte_present(pteval))
+ young = ptep_clear_flush_young(vma, address, pvmw.pte);
+ young |= mmu_notifier_clear_flush_young(vma->vm_mm, address,
+ address + PAGE_SIZE);
+ if (young)
referenced++;
} else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
if (pmdp_clear_flush_young_notify(vma, address,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0102/1756] fork: take mmap_lock before copying mm_struct
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0101/1756] mm/rmap: handle device-exclusive entries in folio_referenced_one() Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0103/1756] ASoC: qcom: q6apm: clear g_apm on driver removal Greg Kroah-Hartman
` (896 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Lorenzo Stoakes (ARM),
Rik van Riel, Vlastimil Babka (SUSE), Barry Song, Pedro Falcato,
Harry Yoo (Meta), Kiryl Shutsemau (Meta), SJ Park,
Muhammad Usama Anjum, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit ef694e2d210111cc08c52fd25da9ab130170bfa3 ]
dup_mm() copies the parent's mm_struct before dup_mmap() takes the
mmap_lock. A concurrent brk() can leave the child with a stale mm->brk
and newer heap mappings, causing later brk() requests to fail.
Other operations (e.g., PR_SET_MM) on the parent's mm_struct can similarly
cause inconsistencies.
As a simple and robust fix, grab the parent's mmap_lock earlier. This
way we don't need to update individual mm fields in dup_mmap() and
keep missing ones. Stop updating the 4 existing members (total_vm, data_vm,
exec_vm, stack_vm), as that is now no longer required.
Keep releasing the parent's mmap_lock in dup_mmap(), before
userfaultfd completion, to avoid moving the userfaultfd handling into the
caller. This should get cleaned up later.
Move uprobe_start_dup_mmap() to preserve the lock ordering.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reported-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Rik van Riel <riel@surriel.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Reviewed-by: Harry Yoo (Meta) <harry@kernel.org>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Reviewed-by: SJ Park <sj@kernel.org>
Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Link: https://patch.msgid.link/20261031-fixes_core-v3-2-d6437171ecc3@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Retained mm->user_ns as the third argument to mm_init(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/fork.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index a4139e5765a33..f3ba045debeda 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -641,8 +641,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
LIST_HEAD(uf);
VMA_ITERATOR(vmi, mm, 0);
- if (mmap_write_lock_killable(oldmm))
- return -EINTR;
+ mmap_assert_write_locked(oldmm);
flush_cache_dup_mm(oldmm);
uprobe_dup_mmap(oldmm, mm);
/*
@@ -653,11 +652,6 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
/* No ordering required: file already has been exposed. */
dup_mm_exe_file(mm, oldmm);
- mm->total_vm = oldmm->total_vm;
- mm->data_vm = oldmm->data_vm;
- mm->exec_vm = oldmm->exec_vm;
- mm->stack_vm = oldmm->stack_vm;
-
/* Use __mt_dup() to efficiently build an identical maple tree. */
retval = __mt_dup(&oldmm->mm_mt, &mm->mm_mt, GFP_KERNEL);
if (unlikely(retval))
@@ -824,7 +818,7 @@ static inline void mm_free_pgd(struct mm_struct *mm)
#else
static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
{
- mmap_write_lock(oldmm);
+ mmap_assert_write_locked(oldmm);
dup_mm_exe_file(mm, oldmm);
mmap_write_unlock(oldmm);
return 0;
@@ -1705,12 +1699,19 @@ static struct mm_struct *dup_mm(struct task_struct *tsk,
if (!mm)
goto fail_nomem;
+ uprobe_start_dup_mmap();
+ if (mmap_write_lock_killable(oldmm)) {
+ free_mm(mm);
+ goto fail_uprobe;
+ }
+
memcpy(mm, oldmm, sizeof(*mm));
- if (!mm_init(mm, tsk, mm->user_ns))
- goto fail_nomem;
+ if (!mm_init(mm, tsk, mm->user_ns)) {
+ mmap_write_unlock(oldmm);
+ goto fail_uprobe;
+ }
- uprobe_start_dup_mmap();
err = dup_mmap(mm, oldmm);
if (err)
goto free_pt;
@@ -1729,9 +1730,10 @@ static struct mm_struct *dup_mm(struct task_struct *tsk,
mm->binfmt = NULL;
mm_init_owner(mm, NULL);
mmput(mm);
- if (err)
- uprobe_end_dup_mmap();
-
+ if (!err)
+ return NULL;
+fail_uprobe:
+ uprobe_end_dup_mmap();
fail_nomem:
return NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0103/1756] ASoC: qcom: q6apm: clear g_apm on driver removal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0102/1756] fork: take mmap_lock before copying mm_struct Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0104/1756] drm/amdkfd: Map wptr BO to GART unconditionally Greg Kroah-Hartman
` (895 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ajay Kumar Nandam, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
[ Upstream commit be2172758f2b7c801ae80b9c8d1510b31eeffdaa ]
The global g_apm pointer is set during apm_probe() but never cleared
in apm_remove(). After the driver is removed the devm-managed struct
q6apm is freed, leaving g_apm dangling. A subsequent call to
q6apm_is_adsp_ready() dereferences the freed pointer.
Clear g_apm in apm_remove() before the component is unregistered so
that q6apm_is_adsp_ready() returns false instead of triggering a
use-after-free.
Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support")
Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260923-vmid-v4-v6-1-3d61a0319b1c@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/qcom/qdsp6/q6apm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
index 1025ddde9e316..8937b3b797e58 100644
--- a/sound/soc/qcom/qdsp6/q6apm.c
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -795,6 +795,7 @@ static int apm_probe(gpr_device_t *gdev)
static void apm_remove(gpr_device_t *gdev)
{
+ g_apm = NULL;
of_platform_depopulate(&gdev->dev);
snd_soc_unregister_component(&gdev->dev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0104/1756] drm/amdkfd: Map wptr BO to GART unconditionally
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0103/1756] ASoC: qcom: q6apm: clear g_apm on driver removal Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0105/1756] drm/amdkfd: use the queues process info for the WPTR BO eviction fence Greg Kroah-Hartman
` (894 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lang Yu, Felix Kuehling,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lang Yu <lang.yu@amd.com>
[ Upstream commit 30837a49bd0aba0f311d4056cd48753955f60d40 ]
For simulation C models that don't run CP FW where adev->mes.sched_version
is not populated correctly. This causes NULL dereference in
amdgpu_amdkfd_free_gtt_mem(dev->adev, (void **)&pqn->q->wptr_bo_gart)
and warning on unpinned BO in amdgpu_bo_gpu_offset(q->properties.wptr_bo).
Compared with adding version check here and there,
always map wptr BO to GART simplifies things.
v2: Add NULL check in amdgpu_amdkfd_free_gtt_mem.(Philip)
Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: da2897ee8b81 ("drm/amdkfd: use the queue's process info for the WPTR BO eviction fence")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 +++
.../amd/amdkfd/kfd_process_queue_manager.c | 23 ++++++++-----------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index 1a92f04c63ace..2de2895e3850b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -368,6 +368,9 @@ void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj)
{
struct amdgpu_bo **bo = (struct amdgpu_bo **) mem_obj;
+ if (!bo || !*bo)
+ return;
+
(void)amdgpu_bo_reserve(*bo, true);
amdgpu_bo_kunmap(*bo);
amdgpu_bo_unpin(*bo);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index 445fba8e4bbdd..4a3ed391b3c7b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -278,20 +278,17 @@ static int init_user_queue(struct process_queue_manager *pqm,
/* Starting with GFX11, wptr BOs must be mapped to GART for MES to determine work
* on unmapped queues for usermode queue oversubscription (no aggregated doorbell)
*/
- if (((dev->adev->mes.sched_version & AMDGPU_MES_API_VERSION_MASK)
- >> AMDGPU_MES_API_VERSION_SHIFT) >= 2) {
- if (dev->adev != amdgpu_ttm_adev(q_properties->wptr_bo->tbo.bdev)) {
- pr_err("Queue memory allocated to wrong device\n");
- retval = -EINVAL;
- goto free_gang_ctx_bo;
- }
+ if (dev->adev != amdgpu_ttm_adev(q_properties->wptr_bo->tbo.bdev)) {
+ pr_err("Queue memory allocated to wrong device\n");
+ retval = -EINVAL;
+ goto free_gang_ctx_bo;
+ }
- retval = amdgpu_amdkfd_map_gtt_bo_to_gart(q_properties->wptr_bo,
- &(*q)->wptr_bo_gart);
- if (retval) {
- pr_err("Failed to map wptr bo to GART\n");
- goto free_gang_ctx_bo;
- }
+ retval = amdgpu_amdkfd_map_gtt_bo_to_gart(q_properties->wptr_bo,
+ &(*q)->wptr_bo_gart);
+ if (retval) {
+ pr_err("Failed to map wptr bo to GART\n");
+ goto free_gang_ctx_bo;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0105/1756] drm/amdkfd: use the queues process info for the WPTR BO eviction fence
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0104/1756] drm/amdkfd: Map wptr BO to GART unconditionally Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0106/1756] rose: walk the neighbour list under its lock when a device goes down Greg Kroah-Hartman
` (893 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Kuehling, Jesse Zhang,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
[ Upstream commit da2897ee8b811945fd40ecc4aaf03291c14ce61c ]
amdgpu_amdkfd_map_gtt_bo_to_gart() removes the eviction fence of
bo->vm_bo->vm->process_info from the WPTR BO of a new queue. bo->vm_bo
is the VM which opened the BO last, not necessarily the KFD process' VM,
and a render node VM has no process info.
On navi31, an unprivileged process which exports its WPTR BO with
AMDKFD_IOC_EXPORT_DMABUF and imports it on a second render node fd
oopses in AMDKFD_IOC_CREATE_QUEUE:
BUG: kernel NULL pointer dereference, address: 0000000000000060
RIP: 0010:amdgpu_amdkfd_map_gtt_bo_to_gart+0x86/0x1a0 [amdgpu]
init_user_queue.part.0+0x180/0x250 [amdgpu]
pqm_create_queue+0x32d/0x730 [amdgpu]
kfd_ioctl_create_queue+0x583/0x9f0 [amdgpu]
Pass the process info of the queue instead. With the fix, the queue is
created and destroyed normally.
Fixes: 7f347e3f8217 ("drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU")
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6b4157498a176bd1c6083f6bb5aaf8a257a2027e)
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 3 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 +++++---
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 3 ++-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
index b921587d428cc..f5374b6f2501b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
@@ -324,7 +324,8 @@ int amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel(struct kgd_mem *mem,
void **kptr, uint64_t *size);
void amdgpu_amdkfd_gpuvm_unmap_gtt_bo_from_kernel(struct kgd_mem *mem);
-int amdgpu_amdkfd_map_gtt_bo_to_gart(struct amdgpu_bo *bo, struct amdgpu_bo **bo_gart);
+int amdgpu_amdkfd_map_gtt_bo_to_gart(struct amdgpu_bo *bo, struct amdgpu_bo **bo_gart,
+ struct amdkfd_process_info *process_info);
int amdgpu_amdkfd_gpuvm_restore_process_bos(void *process_info,
struct dma_fence __rcu **ef);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 55834719e9848..318d731bf9ecd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -2248,11 +2248,13 @@ int amdgpu_amdkfd_gpuvm_sync_memory(
* amdgpu_amdkfd_map_gtt_bo_to_gart - Map BO to GART and increment reference count
* @bo: Buffer object to be mapped
* @bo_gart: Return bo reference
+ * @process_info: KFD process info of the queue the BO is for
*
* Before return, bo reference count is incremented. To release the reference and unpin/
* unmap the BO, call amdgpu_amdkfd_free_gtt_mem.
*/
-int amdgpu_amdkfd_map_gtt_bo_to_gart(struct amdgpu_bo *bo, struct amdgpu_bo **bo_gart)
+int amdgpu_amdkfd_map_gtt_bo_to_gart(struct amdgpu_bo *bo, struct amdgpu_bo **bo_gart,
+ struct amdkfd_process_info *process_info)
{
int ret;
@@ -2274,8 +2276,8 @@ int amdgpu_amdkfd_map_gtt_bo_to_gart(struct amdgpu_bo *bo, struct amdgpu_bo **bo
goto err_map_bo_gart_failed;
}
- amdgpu_amdkfd_remove_eviction_fence(
- bo, bo->vm_bo->vm->process_info->eviction_fence);
+ /* bo->vm_bo can be the VM of any file which opened the BO */
+ amdgpu_amdkfd_remove_eviction_fence(bo, process_info->eviction_fence);
amdgpu_bo_unreserve(bo);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index 4a3ed391b3c7b..819c7f5fb16f8 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -285,7 +285,8 @@ static int init_user_queue(struct process_queue_manager *pqm,
}
retval = amdgpu_amdkfd_map_gtt_bo_to_gart(q_properties->wptr_bo,
- &(*q)->wptr_bo_gart);
+ &(*q)->wptr_bo_gart,
+ pqm->process->kgd_process_info);
if (retval) {
pr_err("Failed to map wptr bo to GART\n");
goto free_gang_ctx_bo;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0106/1756] rose: walk the neighbour list under its lock when a device goes down
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0105/1756] drm/amdkfd: use the queues process info for the WPTR BO eviction fence Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0107/1756] rose: hold RTNL while a route is added or deleted Greg Kroah-Hartman
` (892 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
rose_link_device_down() walks rose_neigh_list without
rose_neigh_list_lock. The list can change under it: rose_add_node() and
rose_del_node() from the SIOCADDRT/SIOCDELRT ioctls, and
rose_rt_device_down(), which the same NETDEV_DOWN event calls right
after, all add or free neighbours under that lock. The walk can then
follow a neighbour that has just been freed.
Take the lock around the walk, as rose_link_failed() does around the
very same calls to rose_del_route_by_neigh() and rose_kill_by_neigh().
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit bf7007048732cd8eac6e3c7c68d131692b480f75)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_route.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 00fbe47fffe04..70ed72f4a11cb 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -958,12 +958,14 @@ void rose_link_device_down(struct net_device *dev)
{
struct rose_neigh *rose_neigh;
+ spin_lock_bh(&rose_neigh_list_lock);
for (rose_neigh = rose_neigh_list; rose_neigh != NULL; rose_neigh = rose_neigh->next) {
if (rose_neigh->dev == dev) {
rose_del_route_by_neigh(rose_neigh);
rose_kill_by_neigh(rose_neigh);
}
}
+ spin_unlock_bh(&rose_neigh_list_lock);
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0107/1756] rose: hold RTNL while a route is added or deleted
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0106/1756] rose: walk the neighbour list under its lock when a device goes down Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0108/1756] rose: change the loopback nodes under the neighbour list lock too Greg Kroah-Hartman
` (891 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
rose_ax25_dev_find() says it is called with RTNL, but rose_rt_ioctl()
does not take it for SIOCADDRT and SIOCDELRT. __dev_get_by_name() is
then used without RTNL or RCU, and the device can go down between the
IFF_UP check and rose_add_node(): the NETDEV_DOWN notifier runs
rose_rt_device_down(), finds no neighbour on the device yet, and the
neighbour added right after keeps a pointer to a device that may be
unregistered and freed, since rose_neigh->dev holds no reference.
Commit b4ec82402149 ("rose: device refcount leak") stopped taking a
reference on the device because RTNL would be held, which the ioctl
never did.
Take RTNL around the lookup of the device and the change of the
tables. The notifier runs under RTNL too, so a neighbour is either on
the list before the device goes down, where rose_rt_device_down()
removes it, or not added at all.
Fixes: b4ec82402149 ("rose: device refcount leak")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 1b9d3d721a9d334e7cd8ab21a2885fe1fa271a80)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_route.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 70ed72f4a11cb..7044496bb214e 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -17,6 +17,7 @@
#include <net/ax25.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
#include <net/arp.h>
#include <linux/if_arp.h>
#include <linux/skbuff.h>
@@ -829,23 +830,29 @@ int rose_rt_ioctl(unsigned int cmd, void __user *arg)
case SIOCADDRT:
if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct)))
return -EFAULT;
- if ((dev = rose_ax25_dev_find(rose_route.device)) == NULL)
- return -EINVAL;
if (rose_dev_exists(&rose_route.address)) /* Can't add routes to ourself */
return -EINVAL;
if (rose_route.mask > 10) /* Mask can't be more than 10 digits */
return -EINVAL;
if (rose_route.ndigis > AX25_MAX_DIGIS)
return -EINVAL;
- err = rose_add_node(&rose_route, dev);
+ /*
+ * RTNL keeps the device up until the neighbour that uses it
+ * is on the list, where rose_rt_device_down() finds it.
+ */
+ rtnl_lock();
+ dev = rose_ax25_dev_find(rose_route.device);
+ err = dev ? rose_add_node(&rose_route, dev) : -EINVAL;
+ rtnl_unlock();
return err;
case SIOCDELRT:
if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct)))
return -EFAULT;
- if ((dev = rose_ax25_dev_find(rose_route.device)) == NULL)
- return -EINVAL;
- err = rose_del_node(&rose_route, dev);
+ rtnl_lock();
+ dev = rose_ax25_dev_find(rose_route.device);
+ err = dev ? rose_del_node(&rose_route, dev) : -EINVAL;
+ rtnl_unlock();
return err;
case SIOCRSCLRRT:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0108/1756] rose: change the loopback nodes under the neighbour list lock too
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0107/1756] rose: hold RTNL while a route is added or deleted Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0109/1756] rose: check the length of Restart Request and Diagnostic frames Greg Kroah-Hartman
` (890 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
Since commit fe2c802ab62a ("rose: improving AX25 routing frames via ROSE
network"), rose_route_frame() looks up the node list through
rose_get_neigh() with route_frame set, under rose_neigh_list_lock only:
it cannot take rose_node_list_lock there. Every other writer of
rose_node_list holds both locks for that reason, but
rose_add_loopback_node() and rose_del_loopback_node(), run when a rose
device is opened, closed or given a new address, take
rose_node_list_lock alone. A frame routed at that moment can walk a node
that is being freed.
Take rose_neigh_list_lock inside rose_node_list_lock in both, in the
same order as rose_add_node() and rose_del_node().
Fixes: fe2c802ab62a ("rose: improving AX25 routing frames via ROSE network")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 0ab5a3287997c348ca74443999abb9e6004beece)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_route.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 7044496bb214e..30dfbe1f14311 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -463,6 +463,7 @@ int rose_add_loopback_node(const rose_address *address)
int err = 0;
spin_lock_bh(&rose_node_list_lock);
+ spin_lock_bh(&rose_neigh_list_lock);
rose_node = rose_node_list;
while (rose_node != NULL) {
@@ -495,6 +496,7 @@ int rose_add_loopback_node(const rose_address *address)
rose_neigh_hold(rose_loopback_neigh);
out:
+ spin_unlock_bh(&rose_neigh_list_lock);
spin_unlock_bh(&rose_node_list_lock);
return err;
@@ -508,6 +510,7 @@ void rose_del_loopback_node(const rose_address *address)
struct rose_node *rose_node;
spin_lock_bh(&rose_node_list_lock);
+ spin_lock_bh(&rose_neigh_list_lock);
rose_node = rose_node_list;
while (rose_node != NULL) {
@@ -527,6 +530,7 @@ void rose_del_loopback_node(const rose_address *address)
rose_neigh_put(rose_loopback_neigh);
out:
+ spin_unlock_bh(&rose_neigh_list_lock);
spin_unlock_bh(&rose_node_list_lock);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0109/1756] rose: check the length of Restart Request and Diagnostic frames
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0108/1756] rose: change the loopback nodes under the neighbour list lock too Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0110/1756] rose: keep a socket unbound when connect() fails to autobind it Greg Kroah-Hartman
` (889 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
rose_route_frame() only makes sure that a frame holds the three bytes
of the ROSE header before it hands the frames with LCI 0 to
rose_link_rx_restart(). There, a Restart Request has its cause read
from byte 3 to set dce_mode, and a Diagnostic has bytes 3 to 6 printed.
A peer that sends them shorter makes the kernel read past the end of
the frame, and set dce_mode, which decides from which end LCIs are
given out, from whatever lies there.
Only read the restarting cause when the frame has one, and leave
dce_mode as it was otherwise. Ignore a Diagnostic too short to hold
its diagnostic code and the three bytes it reports, as x25 does with
pskb_may_pull().
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 13db36d85e64fa98f579d5ee38e416baf9fc0dec)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_link.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c
index 2e2837e632426..c544157944f57 100644
--- a/net/rose/rose_link.c
+++ b/net/rose/rose_link.c
@@ -185,7 +185,9 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne
rose_link_restarted(neigh);
rose_stop_t0timer(neigh);
neigh->restarted = 1;
- neigh->dce_mode = (skb->data[3] == ROSE_DTE_ORIGINATED);
+ /* The restarting cause, when present, tells if the peer is a DTE */
+ if (skb->len > ROSE_MIN_LEN)
+ neigh->dce_mode = (skb->data[3] == ROSE_DTE_ORIGINATED);
rose_transmit_restart_confirmation(neigh);
break;
@@ -195,6 +197,9 @@ void rose_link_rx_restart(struct sk_buff *skb, struct rose_neigh *neigh, unsigne
break;
case ROSE_DIAGNOSTIC:
+ /* Diagnostic code and the first three bytes of the bad packet */
+ if (skb->len < ROSE_MIN_LEN + 4)
+ break;
pr_warn("ROSE: received diagnostic #%d - %3ph\n", skb->data[3],
skb->data + 4);
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0110/1756] rose: keep a socket unbound when connect() fails to autobind it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0109/1756] rose: check the length of Restart Request and Diagnostic frames Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0111/1756] rose: refuse an empty message when the Q bit is included Greg Kroah-Hartman
` (888 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
When connect() is called on a socket that was never bound, it clears
SOCK_ZAPPED first and then looks for a rose device and for the
callsign of the user. If there is no rose device, or no callsign for
the user, connect() fails, but the socket is left marked as bound
although it has no device, no source address and is not on rose_list.
A second connect() on that socket then skips the autobind and places
the call with an all-zero source address and callsign. The socket is
not on rose_list, so rose_new_lci() does not see the LCI it holds and
rose_find_socket() never finds it: the Call Accepted is not delivered
to it and the call can only time out.
Clear SOCK_ZAPPED only once the autobind has succeeded, right before
the socket goes on rose_list, as rose_bind() does.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit f079e74f7889731570e7f53e9a7372e7776e3f9e)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/af_rose.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 332d267716813..1b5230ed4a452 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -894,8 +894,6 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */
struct net_device *dev;
- sock_reset_flag(sk, SOCK_ZAPPED);
-
dev = rose_dev_first();
if (!dev) {
err = -ENETUNREACH;
@@ -916,6 +914,8 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
GFP_KERNEL);
ax25_uid_put(user);
+ /* Only now is the socket bound: a failed autobind leaves it as it was */
+ sock_reset_flag(sk, SOCK_ZAPPED);
rose_insert_socket(sk); /* Finish the bind */
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0111/1756] rose: refuse an empty message when the Q bit is included
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0110/1756] rose: keep a socket unbound when connect() fails to autobind it Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0112/1756] rose: give loopback answers LCIs that calls cannot be given Greg Kroah-Hartman
` (887 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
With the ROSE_QBITINCL socket option set, rose_sendmsg() takes the Q
bit from the first byte of the message and pulls that byte off.
Nothing checks that there is a first byte: a send() of zero bytes
reads the Q bit from beyond the data copied from the user, skb_pull()
fails without a word, and an empty data frame goes out with a Q bit
taken from uninitialised memory.
Refuse such a message with EINVAL before anything is allocated.
x25_sendmsg() checks for that byte too, with pskb_may_pull().
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit fd8a23b811b7c46d0b9aefc2a45955ea8f685a8e)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/af_rose.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 1b5230ed4a452..2cb096068e5ed 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1286,6 +1286,10 @@ static int rose_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
if (len > 65535)
return -EMSGSIZE;
+ /* With the Q bit included, the first byte of the data holds it */
+ if (rose->qbitincl && len < 1)
+ return -EINVAL;
+
size = len + AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + ROSE_MIN_LEN;
if ((skb = sock_alloc_send_skb(sk, size, msg->msg_flags & MSG_DONTWAIT, &err)) == NULL)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0112/1756] rose: give loopback answers LCIs that calls cannot be given
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0111/1756] rose: refuse an empty message when the Q bit is included Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0113/1756] rose: clear the other half of a through route a new call takes over Greg Kroah-Hartman
` (886 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
A call to an address of the node itself goes through the loopback
neighbour, and both ends of it use that neighbour. rose_loopback_timer()
gives the answering end LCI 51 - i for a call on LCI i, so that each
end finds the other. The 51 comes from ROSE_DEFAULT_MAXVC, but the
number of circuits is the maximum_virtual_circuits sysctl, which goes
up to 254, and rose_new_lci() hands out LCIs from 1 up to that value
on the loopback neighbour as on any other.
With more than 50 circuits allowed, the call on LCI 51 is answered on
LCI 0 and the next ones on LCIs that wrap around to huge values: the
answer is never matched to its call. Below that, LCI 51 - i is never
checked to be free, and only the way rose_new_lci() walks the LCIs
keeps it from being one that a call already uses.
Answer on LCI 4096 - i instead, at the top of the 12-bit LCI range, as
was nearly done before commit 1f731b63752d ("rose_loopback_timer sets
VC number <= ROSE_DEFAULT_MAXVC"): 0xFFF - i. That commit moved the
answers below 51 so that /proc/net/rose would not show an LCI above
the number of circuits; it prints the LCI on three hex digits, which
any LCI up to 0xFFF fits. 4096 - i is still its own inverse, so each
end finds the other as before, and rose_new_lci() never gives out an
LCI above 254.
Fixes: 1f731b63752d ("rose_loopback_timer sets VC number <= ROSE_DEFAULT_MAXVC")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit aeddd6cb7ca6e8019ac73c8c0d40e5d9dcbc5c6f)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_loopback.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/rose/rose_loopback.c b/net/rose/rose_loopback.c
index 6c5c35030e67b..efd4a719ab2ca 100644
--- a/net/rose/rose_loopback.c
+++ b/net/rose/rose_loopback.c
@@ -101,7 +101,12 @@ static void rose_loopback_timer(struct timer_list *unused)
continue;
}
dest = (rose_address *)(skb->data + ROSE_CALL_REQ_DEST_ADDR_OFF);
- lci_o = ROSE_DEFAULT_MAXVC + 1 - lci_i;
+ /*
+ * The call and its answer use the same neighbour: give the
+ * answer the LCI at the other end of the 12-bit range, which
+ * rose_new_lci() never hands out, and get back from it.
+ */
+ lci_o = 0xFFF + 1 - lci_i;
skb_reset_transport_header(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0113/1756] rose: clear the other half of a through route a new call takes over
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0112/1756] rose: give loopback answers LCIs that calls cannot be given Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0114/1756] rose: disconnect sockets under their lock when a neighbour goes away Greg Kroah-Hartman
` (885 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
When a Call Request comes in on the LCI of an existing through route,
for a call other than the one the route was built for, the neighbour
has evidently lost that call: it gives the LCI out again.
rose_route_frame() then removes the route and goes on with the new
call, but says nothing to the neighbour on the other half. That end
keeps its virtual circuit up with nothing behind it, and its LCI on
our side is freed while it may still send on it.
Do as rose_clear_routes_by_neigh() does when a neighbour goes away:
detach the half that the new call takes over and send a Clear Request
on the other half. The route stays for that half until its Clear
Confirmation, which removes it, and its LCI is not given to another
call meanwhile. The cause is the one given to a socket in the same
case, network congestion. A route that has no other half left is
removed as before.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 9b1a1d3395bdcf1eca96d3db517eae195d02a632)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/rose_route.c | 40 ++++++++++++++++++++++++++++++++++++----
1 file changed, 36 insertions(+), 4 deletions(-)
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 30dfbe1f14311..d23f8d30067ba 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -1145,8 +1145,24 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
120);
goto out;
}
- /* Remove an existing unused route */
- rose_remove_route(rose_route);
+ /*
+ * Another call on the LCI of a through
+ * route: the neighbour no longer has the
+ * call it was built for. Clear the other
+ * half, which keeps the route until its
+ * Clear Confirmation, and leave the LCI
+ * to the new call.
+ */
+ if (rose_route->neigh2 != NULL) {
+ rose_neigh_put(rose_route->neigh1);
+ rose_route->neigh1 = NULL;
+ rose_transmit_clear_request(rose_route->neigh2,
+ rose_route->lci2,
+ ROSE_NETWORK_CONGESTION,
+ 0);
+ } else {
+ rose_remove_route(rose_route);
+ }
break;
} else if (rose_route->neigh2 != NULL) {
skb->data[0] &= 0xF0;
@@ -1180,8 +1196,24 @@ int rose_route_frame(struct sk_buff *skb, ax25_cb *ax25)
120);
goto out;
}
- /* Remove an existing unused route */
- rose_remove_route(rose_route);
+ /*
+ * Another call on the LCI of a through
+ * route: the neighbour no longer has the
+ * call it was built for. Clear the other
+ * half, which keeps the route until its
+ * Clear Confirmation, and leave the LCI
+ * to the new call.
+ */
+ if (rose_route->neigh1 != NULL) {
+ rose_neigh_put(rose_route->neigh2);
+ rose_route->neigh2 = NULL;
+ rose_transmit_clear_request(rose_route->neigh1,
+ rose_route->lci1,
+ ROSE_NETWORK_CONGESTION,
+ 0);
+ } else {
+ rose_remove_route(rose_route);
+ }
break;
} else if (rose_route->neigh1 != NULL) {
skb->data[0] &= 0xF0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0114/1756] rose: disconnect sockets under their lock when a neighbour goes away
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0113/1756] rose: clear the other half of a through route a new call takes over Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0115/1756] hdlcdrv: close the hardware driver once, and only if it was opened Greg Kroah-Hartman
` (884 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
rose_kill_by_neigh() disconnects every socket that uses a neighbour
whose link has failed, restarted or gone down, holding only
rose_list_lock. rose_disconnect() stops the timers, purges the queues
and changes the state of the socket, but its timers and the frames
received for it work on the same socket under bh_lock_sock() only, on
other CPUs, and are not kept out by rose_list_lock.
Disconnect each socket under its lock. rose_rx_call_request() and
rose_kill_by_device() take the socket lock before rose_list_lock, so
do as rose_kill_by_device() does: take a reference on the sockets that
use the neighbour under rose_list_lock, drop it, and lock each socket
in turn, checking that it still uses the neighbour. The neighbour is
still taken under rose_list_lock as well: rose_release() takes it under
that lock while it owns the socket, which bh_lock_sock() does not keep
out.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 250c2ad2174f0a1aeb6c306e7bcc259a7fe2178d)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rose/af_rose.c | 48 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 41 insertions(+), 7 deletions(-)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 2cb096068e5ed..2a610cf8425af 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -162,19 +162,52 @@ static void rose_remove_socket(struct sock *sk)
*/
void rose_kill_by_neigh(struct rose_neigh *neigh)
{
- struct sock *s;
+ struct sock *s, *array[16];
+ bool rescan;
+ int i, cnt;
+ /*
+ * Each socket is disconnected under its lock, which its timers and
+ * the frames received for it hold while they work on it. That lock
+ * is taken before rose_list_lock elsewhere, so collect the sockets
+ * first, as rose_kill_by_device() does. rose_list_lock is still
+ * held around the change of the neighbour, which rose_release()
+ * takes under it while it owns the socket. A socket done with has
+ * no neighbour left and is not collected again.
+ */
+again:
+ rescan = false;
+ cnt = 0;
spin_lock_bh(&rose_list_lock);
sk_for_each(s, &rose_list) {
- struct rose_sock *rose = rose_sk(s);
+ if (rose_sk(s)->neighbour != neigh)
+ continue;
+ if (cnt == ARRAY_SIZE(array)) {
+ rescan = true;
+ break;
+ }
+ sock_hold(s);
+ array[cnt++] = s;
+ }
+ spin_unlock_bh(&rose_list_lock);
+
+ for (i = 0; i < cnt; i++) {
+ struct rose_sock *rose = rose_sk(array[i]);
+ bh_lock_sock(array[i]);
+ /* rose_release() takes the neighbour under rose_list_lock */
+ spin_lock_bh(&rose_list_lock);
if (rose->neighbour == neigh) {
- rose_disconnect(s, ENETUNREACH, ROSE_OUT_OF_ORDER, 0);
+ rose_disconnect(array[i], ENETUNREACH, ROSE_OUT_OF_ORDER, 0);
rose_neigh_put(rose->neighbour);
rose->neighbour = NULL;
}
+ spin_unlock_bh(&rose_list_lock);
+ bh_unlock_sock(array[i]);
+ sock_put(array[i]);
}
- spin_unlock_bh(&rose_list_lock);
+ if (rescan)
+ goto again;
}
/*
@@ -721,9 +754,10 @@ static int rose_release(struct socket *sock)
* Disconnect before the socket lock is dropped: frames put on
* the backlog meanwhile, a Clear Confirmation for one, then
* find it in state 0 instead of dropping the neighbour
- * reference a second time. rose_kill_by_neigh() does not take
- * the socket lock: take the neighbour under rose_list_lock, as
- * it does, so that only one of them drops the reference.
+ * reference a second time. rose_kill_by_neigh() can run while
+ * the socket is owned here: take the neighbour under
+ * rose_list_lock, as it does, so that only one of them drops
+ * the reference.
*/
rose_disconnect(sk, 0, -1, -1);
spin_lock_bh(&rose_list_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0115/1756] hdlcdrv: close the hardware driver once, and only if it was opened
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0114/1756] rose: disconnect sockets under their lock when a neighbour goes away Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0116/1756] mm/shmem: make shmem_file() check the files inode Greg Kroah-Hartman
` (883 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
hdlcdrv_unregister() calls the hardware driver's close() when s->opened
is set and then calls unregister_netdev(). Two things go wrong:
- if the interface is still up, unregister_netdev() closes it through
ndo_stop, so hdlcdrv_close() calls the hardware driver's close() a
second time;
- hdlcdrv_open() sets s->opened before it calls the hardware driver's
open() and leaves it set when that fails, so close() is also called
for a port that was never opened.
The close() methods of the baycom drivers are not written for either
case. baycom_ser_fdx and baycom_ser_hdx call free_irq() and
release_region() for resources they do not hold. baycom_par
dereferences bc->pdev, which is NULL if the port was never opened and
points to an unregistered parport device after a first close.
Set s->opened only once the hardware driver's open() has succeeded,
and let unregister_netdev() do the closing.
Tested in a QEMU guest (6.12.94, KASAN and lockdep) with
baycom_ser_fdx and two ports: bcsf0 at an address without a UART, whose
open fails, and bcsf1 on a UART, left up. Unloading baycom_ser_fdx gave
before the change:
Trying to free already-free IRQ 5
ser12_close+0xa1/0x190 [baycom_ser_fdx]
cleanup_baycomserfdx+0x38/0x50 [baycom_ser_fdx]
resource: Trying to free nonexistent resource <0x300-0x307>
baycom_ser_fdx: close ser_fdx at iobase 0x250 irq 9
Trying to free already-free IRQ 9
resource: Trying to free nonexistent resource <0x250-0x257>
and after the change a single close of bcsf1 and no warning. The
baycom_par case was not reproduced, the test kernel has no parport
support.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 056d9c67e92622d5ec8cc6ce4a49179a16c53ef1)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/hamradio/hdlcdrv.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index 2263029d1a20e..dc4e2c45e2d11 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -441,7 +441,6 @@ static int hdlcdrv_open(struct net_device *dev)
/*
* initialise some variables
*/
- s->opened = 1;
s->hdlcrx.hbuf.rd = s->hdlcrx.hbuf.wr = 0;
s->hdlcrx.in_hdlc_rx = 0;
s->hdlcrx.rx_state = 0;
@@ -458,6 +457,7 @@ static int hdlcdrv_open(struct net_device *dev)
i = s->ops->open(dev);
if (i)
return i;
+ s->opened = 1;
netif_start_queue(dev);
return 0;
}
@@ -725,8 +725,7 @@ void hdlcdrv_unregister(struct net_device *dev)
BUG_ON(s->magic != HDLCDRV_MAGIC);
- if (s->opened && s->ops->close)
- s->ops->close(dev);
+ /* unregister_netdev() closes the device if it is still up */
unregister_netdev(dev);
free_netdev(dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0116/1756] mm/shmem: make shmem_file() check the files inode
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0115/1756] hdlcdrv: close the hardware driver once, and only if it was opened Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0117/1756] drm/i915/display: Add enabled pipe planes into state for selective fetch Greg Kroah-Hartman
` (882 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason, Pratyush Yadav,
Baolin Wang, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit d3710111839d11339e414b1bb3fea3d05ab83f6e ]
shmem_file() only checks if file->f_mapping is a shmem mapping. This
mapping can belong to another file, however, as with a Coda file backed
by a tmpfs container after mmap().
So it does not guarantee that the file inode is an actual shmem inode.
Seal handling and memfd preservation use this check before accessing
shmem inode state, so they can access an inode of the wrong type.
Let's make shmem_file() check the inode's file operations instead, to
identify shmem inodes reliably. This will identify regular shmem inodes,
including memfds and ordinary tmpfs files, independently of wrapper file
operations.
Use shmem_mapping() in collapse_file() instead to not change the behavior
of collapse_file(): it operates on the page cache and uses mapping->host
for shmem inode operations. Focusing on the file does not seem relevant.
Fixes: c49fcfcda8b5 ("mm/shmem: update file sealing comments and file checking")
Fixes: b3749f174d68 ("mm: memfd_luo: allow preserving memfd")
Cc: stable@vger.kernel.org
Reported-by: Chris Mason <mason@kernel.org>
Suggested-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20261031-fixes_core-v3-3-d6437171ecc3@kernel.org
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: Adjusted context to preserve the existing non-const shmem_mapping() interface. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/shmem_fs.h | 15 ++++++---------
mm/khugepaged.c | 2 +-
mm/shmem.c | 5 +++++
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 515a9a6a3c6f8..183975ead5cf6 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -97,8 +97,14 @@ extern unsigned long shmem_get_unmapped_area(struct file *, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags);
extern int shmem_lock(struct file *file, int lock, struct ucounts *ucounts);
#ifdef CONFIG_SHMEM
+bool shmem_file(struct file *file);
bool shmem_mapping(struct address_space *mapping);
#else
+static inline bool shmem_file(struct file *file)
+{
+ return false;
+}
+
static inline bool shmem_mapping(struct address_space *mapping)
{
return false;
@@ -161,15 +167,6 @@ static inline struct page *shmem_read_mapping_page(
mapping_gfp_mask(mapping));
}
-static inline bool shmem_file(struct file *file)
-{
- if (!IS_ENABLED(CONFIG_SHMEM))
- return false;
- if (!file || !file->f_mapping)
- return false;
- return shmem_mapping(file->f_mapping);
-}
-
/*
* If fallocate(FALLOC_FL_KEEP_SIZE) has been used, there may be pages
* beyond i_size's notion of EOF, which fallocate has committed to reserving:
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 2e9d0e13b068a..9b8021d440289 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1809,6 +1809,7 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
struct collapse_control *cc)
{
struct address_space *mapping = file->f_mapping;
+ const bool is_shmem = shmem_mapping(mapping);
struct page *dst;
struct folio *folio, *tmp, *new_folio;
unsigned long new_pfn = -1;
@@ -1816,7 +1817,6 @@ static int collapse_file(struct mm_struct *mm, unsigned long addr,
LIST_HEAD(pagelist);
XA_STATE_ORDER(xas, &mapping->i_pages, start, HPAGE_PMD_ORDER);
int nr_none = 0, result = SCAN_SUCCEED;
- bool is_shmem = shmem_file(file);
bool do_readahead = false;
bool readahead_done = false;
diff --git a/mm/shmem.c b/mm/shmem.c
index 8de38d7a98f92..df6a57f227865 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -270,6 +270,11 @@ static const struct vm_operations_struct shmem_vm_ops;
static const struct vm_operations_struct shmem_anon_vm_ops;
static struct file_system_type shmem_fs_type;
+bool shmem_file(struct file *file)
+{
+ return file && file_inode(file)->i_fop == &shmem_file_operations;
+}
+
bool shmem_mapping(struct address_space *mapping)
{
return mapping->a_ops == &shmem_aops;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0117/1756] drm/i915/display: Add enabled pipe planes into state for selective fetch
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0116/1756] mm/shmem: make shmem_file() check the files inode Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0118/1756] nvmet: reject keep-alive timeouts that would overflow Greg Kroah-Hartman
` (881 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jouni Högander, Mika Kahola,
Joonas Lahtinen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jouni Högander <jouni.hogander@intel.com>
[ Upstream commit 94cb1f08b197d9ae932ff98c741bd0dbc96e17e8 ]
Selective fetch support for biplanar formats relies on linking of UV and
the Y planes. Planes that are not part of the atomic state are pulled in by
the drm_atomic_add_affected_planes. If the UV plane is added into the state
by drm_atomic_add_affected_planes in the selective fetch calculation, the
linking isn't done anymore and the Y plane is left disabled.
Fix this by adding affected planes already in intel_add_affected_planes if
selective fetch is enabled.
Remove redundant drm_atomic_add_affected_planes from
intel_psr2_sel_fetch_update and redundant check for plane selective fetch
support that is not needed as all planes are already in atomic state on
first loop iterating them. Also switch to intel_atomic_get_new_plane_state
for linked plane new plane state.
Fixes: 3809991ff5f4 ("drm/i915/display: Add initial selective fetch support for biplanar formats")
Cc: <stable@vger.kernel.org> # v5.17+
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20260929094434.77129-3-jouni.hogander@intel.com
(cherry picked from commit 0d173898b11157d37de3e5f01ef28a48582167d8)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
[ sashal: adapted the collection loop to intel_atomic_check_planes() using the existing intel_atomic_add_affected_planes() helper ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/i915/display/intel_display.c | 12 ++++++++++
drivers/gpu/drm/i915/display/intel_psr.c | 25 +++++++-------------
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 4a3cc3369180b..841a2129bdd3a 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -5879,6 +5879,18 @@ static int intel_atomic_check_planes(struct intel_atomic_state *state)
struct intel_crtc *crtc;
int i, ret;
+ for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) {
+ /*
+ * Add affected plane here to ensure UV and Y plane linking is
+ * in place if UV plane is added as a part of selective update.
+ */
+ if (new_crtc_state->enable_psr2_sel_fetch) {
+ ret = intel_atomic_add_affected_planes(state, crtc);
+ if (ret)
+ return ret;
+ }
+ }
+
ret = icl_add_linked_planes(state);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index d59f2131fd996..929113fc12e60 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2561,7 +2561,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
.y2 = crtc_state->hw.adjusted_mode.crtc_vdisplay,
};
bool full_update = false, su_area_changed;
- int i, ret;
+ int i;
/*
* Selective fetch is not always usable, for instance it is dropped
@@ -2676,19 +2676,15 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
intel_psr_apply_su_area_workarounds(crtc_state);
- ret = drm_atomic_add_affected_planes(&state->base, &crtc->base);
- if (ret)
- return ret;
-
do {
bool cursor_in_su_area = false;
/*
* Adjust su area to cover cursor fully as necessary
- * (early transport). This needs to be done after
- * drm_atomic_add_affected_planes to ensure visible
- * cursor is added into affected planes even when
- * cursor is not updated by itself.
+ * (early transport). A visible cursor is in the state
+ * even when it is not updated by itself as all planes
+ * of the pipe are added into the state before the plane
+ * checks when selective fetch is enabled.
*/
intel_psr2_sel_fetch_et_alignment(state, crtc, &display_area,
&cursor_in_su_area);
@@ -2739,11 +2735,6 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
continue;
}
- if (!psr2_sel_fetch_plane_state_supported(new_plane_state)) {
- full_update = true;
- break;
- }
-
sel_fetch_area = &new_plane_state->psr2_sel_fetch_area;
sel_fetch_area->y1 = inter.y1 - new_plane_state->uapi.dst.y1;
sel_fetch_area->y2 = inter.y2 - new_plane_state->uapi.dst.y1;
@@ -2757,9 +2748,9 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
struct intel_plane_state *linked_new_plane_state;
struct drm_rect *linked_sel_fetch_area;
- linked_new_plane_state = intel_atomic_get_plane_state(state, linked);
- if (IS_ERR(linked_new_plane_state))
- return PTR_ERR(linked_new_plane_state);
+ linked_new_plane_state = intel_atomic_get_new_plane_state(state, linked);
+ if (!linked_new_plane_state)
+ return -EINVAL;
linked_sel_fetch_area = &linked_new_plane_state->psr2_sel_fetch_area;
linked_sel_fetch_area->y1 = sel_fetch_area->y1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0118/1756] nvmet: reject keep-alive timeouts that would overflow
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0117/1756] drm/i915/display: Add enabled pipe planes into state for selective fetch Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0119/1756] drm/amd/display: Minimize wait for pending updates Greg Kroah-Hartman
` (880 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Yingjie Wang,
Keith Busch, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yingjie Wang <1075151112@qq.com>
[ Upstream commit 96ae13f40ce5930cd58c43128e385131476f2a66 ]
nvmet_set_feat_kato() and nvmet_alloc_ctrl() convert the 32-bit
millisecond KATO from the host to seconds with DIV_ROUND_UP(kato, 1000).
The addition in DIV_ROUND_UP() is done in 32 bits, so any KATO above
4294966296 ms wraps around and rounds to 0 seconds. A Set Features
command with KATO 0xffffffff then succeeds but disables the keep-alive
timer: Get Features returns 0 and Keep Alive fails with Keep Alive
Timeout Invalid. A Connect command with such a KATO creates a controller
without a keep-alive timer.
The converted value has more consumers that can overflow. Get Features
multiplies it by 1000, and the timer paths multiply it by HZ in 32 bits
and arm a delay that must not exceed MAX_JIFFY_OFFSET.
Reject a KATO whose rounded value does not fit all of these. Return Keep
Alive Timeout Invalid from both Set Features and Connect. Validate Set
Features before stopping the current timer so a failed update leaves its
timeout unchanged. Round in 64 bits. A KATO of 0 keeps its current
meaning.
Fixes: a07b4970f464 ("nvmet: add a generic NVMe target")
Cc: stable@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Yingjie Wang <1075151112@qq.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
[ sashal: adapted nvmet_alloc_ctrl() error handling to the request-based API with direct NVMe status returns ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/admin-cmd.c | 7 ++++++-
drivers/nvme/target/core.c | 7 ++++++-
drivers/nvme/target/nvmet.h | 8 ++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 1cc2f57b53ffa..fdfcec2ca9b89 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -811,8 +811,13 @@ u16 nvmet_set_feat_kato(struct nvmet_req *req)
{
u32 val32 = le32_to_cpu(req->cmd->common.cdw11);
+ if (val32 > NVMET_MAX_KATO * MSEC_PER_SEC) {
+ req->error_loc = offsetof(struct nvme_common_command, cdw11);
+ return NVME_SC_KA_TIMEOUT_INVALID | NVME_STATUS_DNR;
+ }
+
nvmet_stop_keep_alive_timer(req->sq->ctrl);
- req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000);
+ req->sq->ctrl->kato = DIV_ROUND_UP_ULL(val32, MSEC_PER_SEC);
nvmet_start_keep_alive_timer(req->sq->ctrl);
nvmet_set_result(req, req->sq->ctrl->kato);
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index fa011c16c9b1c..849cd6a5b4219 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1422,6 +1422,11 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
int ret;
u16 status;
+ if (kato > NVMET_MAX_KATO * MSEC_PER_SEC) {
+ req->error_loc = offsetof(struct nvmf_connect_command, kato);
+ return NVME_SC_KA_TIMEOUT_INVALID | NVME_STATUS_DNR;
+ }
+
status = NVME_SC_CONNECT_INVALID_PARAM | NVME_STATUS_DNR;
subsys = nvmet_find_get_subsys(req->port, subsysnqn);
if (!subsys) {
@@ -1487,7 +1492,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
kato = NVMET_DISC_KATO_MS;
/* keep-alive timeout in seconds */
- ctrl->kato = DIV_ROUND_UP(kato, 1000);
+ ctrl->kato = DIV_ROUND_UP_ULL(kato, MSEC_PER_SEC);
ctrl->err_counter = 0;
spin_lock_init(&ctrl->error_lock);
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 2a1a848189bea..f1691750705e2 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -7,6 +7,7 @@
#define _NVMET_H
#include <linux/dma-mapping.h>
+#include <linux/jiffies.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/kref.h>
@@ -586,6 +587,13 @@ bool nvmet_subsys_nsid_exists(struct nvmet_subsys *subsys, u32 nsid);
#define NVMET_KAS 10
#define NVMET_DISC_KATO_MS 120000
+/*
+ * Largest keep-alive timeout in seconds that can be reported back in
+ * milliseconds and converted to jiffies without overflowing.
+ */
+#define NVMET_MAX_KATO \
+ min3(U32_MAX / MSEC_PER_SEC, U32_MAX / HZ, MAX_JIFFY_OFFSET / HZ)
+
int __init nvmet_init_configfs(void);
void __exit nvmet_exit_configfs(void);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0119/1756] drm/amd/display: Minimize wait for pending updates
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0118/1756] nvmet: reject keep-alive timeouts that would overflow Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0120/1756] drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates Greg Kroah-Hartman
` (879 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dillon Varone, Alvin Lee,
Ilya Bakoulin, Zaeem Mohamed, Daniel Wheeler, Alex Deucher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
[ Upstream commit caccee7b296b1f6c37f09b5d4808606c66438e9d ]
[Why/How]
Move the wait for pending updates past prepare_bandwidth if the previous
update was not a full update to reduce the average time it takes to
complete a full update.
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: f3afbf7d832a ("drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index ad1cc546ba48d..0975616b53004 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3802,7 +3802,7 @@ static void commit_planes_for_stream(struct dc *dc,
dc_exit_ips_for_hw_access(dc);
dc_z10_restore(dc);
- if (update_type == UPDATE_TYPE_FULL)
+ if (update_type == UPDATE_TYPE_FULL && dc->optimized_required)
hwss_process_outstanding_hw_updates(dc, dc->current_state);
for (i = 0; i < dc->res_pool->pipe_count; i++) {
@@ -3829,6 +3829,9 @@ static void commit_planes_for_stream(struct dc *dc,
context_clock_trace(dc, context);
}
+ if (update_type == UPDATE_TYPE_FULL)
+ hwss_wait_for_outstanding_hw_updates(dc, dc->current_state);
+
top_pipe_to_program = resource_get_otg_master_for_stream(
&context->res_ctx,
stream);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0120/1756] drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0119/1756] drm/amd/display: Minimize wait for pending updates Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0121/1756] mm/shmem: fix accounting of swapin-error markers Greg Kroah-Hartman
` (878 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dillon Varone, Mario Limonciello,
Alex Deucher, Roman Li, Alex Hung, Dan Wheeler, Leo Li,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roman Li <Roman.Li@amd.com>
[ Upstream commit f3afbf7d832ab138655afc96bd42226775d03ce7 ]
[WHY]
DC asserts with:
WARNING: dc/hubbub/dcn401/dcn401_hubbub.c at dcn401_program_compbuf_segments
Call Trace:
<TASK>
dcn401_program_outstanding_updates+0x36/0x60 [amdgpu]
hwss_process_outstanding_hw_updates+0x33/0x40 [amdgpu]
commit_planes_for_stream+0x171f/0x1ff0 [amdgpu]
dc_update_state_execute+0xaa/0x170 [amdgpu]
dc_update_planes_and_stream+0x42/0x70 [amdgpu]
amdgpu_dm_atomic_commit_tail+0x16a9/0x4020 [amdgpu]
commit_tail+0xc3/0x1b0 [drm_kms_helper]
The DET left by the VBIOS on a HUBP without a plane can be larger than
the DET planned for the new state. The compbuf is sized for the planned
DET, so DET + compbuf can exceed the CRB size. Programming the compbuf
then triggers the ASSERT and sets CONFIG_ERROR in hardware.
[HOW]
Release the DET of HUBPs without a plane before the compbuf is
programmed.
Add hwss_reset_unused_det() and call it in the commit and flip paths,
to cover both seamless and non-seamless boots.
Fixes: 7a1eb6680939 ("drm/amd/display: Perform outstanding programming on full updates")
Cc: Dillon Varone <dillon.varone@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c93f6fc7175b445ba3b7c85a1fc31e4e4951bbc9)
Cc: stable@vger.kernel.org
[ sashal: added a missing header include to provide the complete struct hubbub definition ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +++-
.../drm/amd/display/dc/core/dc_hw_sequencer.c | 32 +++++++++++++++++++
.../drm/amd/display/dc/hwss/hw_sequencer.h | 3 ++
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 0975616b53004..282de24961710 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -2062,6 +2062,8 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
* update pending complete before optimizing bandwidth.
*/
hwss_wait_for_odm_update_pending_complete(dc, context);
+ /* No DET may stay allocated to a HUBP without a plane (e.g. left over from VBIOS) */
+ hwss_reset_unused_det(dc, context);
/* pplib is notified if disp_num changed */
dc->hwss.optimize_bandwidth(dc, context);
/* Need to do otg sync again as otg could be out of sync due to otg
@@ -3802,8 +3804,10 @@ static void commit_planes_for_stream(struct dc *dc,
dc_exit_ips_for_hw_access(dc);
dc_z10_restore(dc);
- if (update_type == UPDATE_TYPE_FULL && dc->optimized_required)
+ if (update_type == UPDATE_TYPE_FULL && dc->optimized_required) {
+ hwss_reset_unused_det(dc, dc->current_state);
hwss_process_outstanding_hw_updates(dc, dc->current_state);
+ }
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
index 5dcb0fb2f66a5..f7dd6e9114c20 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
@@ -32,6 +32,7 @@
#include "resource.h"
#include "dc_dmub_srv.h"
#include "dc_state_priv.h"
+#include "dchubbub.h"
#define NUM_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
@@ -1056,6 +1057,37 @@ void hwss_wait_for_odm_update_pending_complete(struct dc *dc, struct dc_state *c
hwss_wait_for_all_blank_complete(dc, context);
}
+void hwss_reset_unused_det(struct dc *dc, struct dc_state *context)
+{
+ struct hubbub *hubbub = dc->res_pool->hubbub;
+ unsigned int i, j;
+
+ if (!hubbub || !hubbub->funcs->program_det_segments)
+ return;
+
+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
+ struct hubp *hubp = dc->res_pool->hubps[i];
+ bool hubp_in_use = false;
+
+ if (!hubp)
+ continue;
+
+ for (j = 0; j < dc->res_pool->pipe_count; j++) {
+ const struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[j];
+
+ /* A plane-less pipe renders from the DPG, its HUBP (assigned with the stream) needs no DET */
+ if (pipe->plane_state && pipe->plane_res.hubp &&
+ pipe->plane_res.hubp->inst == hubp->inst) {
+ hubp_in_use = true;
+ break;
+ }
+ }
+
+ if (!hubp_in_use)
+ hubbub->funcs->program_det_segments(hubbub, hubp->inst, 0);
+ }
+}
+
void hwss_wait_for_no_pipes_pending(struct dc *dc, struct dc_state *context)
{
int i;
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
index 9ae6259f2db17..44df0067d8ccc 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
@@ -537,6 +537,9 @@ void hwss_wait_for_odm_update_pending_complete(struct dc *dc,
void hwss_wait_for_no_pipes_pending(struct dc *dc,
struct dc_state *context);
+void hwss_reset_unused_det(struct dc *dc,
+ struct dc_state *context);
+
void hwss_wait_for_outstanding_hw_updates(struct dc *dc,
struct dc_state *dc_context);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0121/1756] mm/shmem: fix accounting of swapin-error markers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0120/1756] drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0122/1756] mm/cma: accept memory of CMA areas reserved at a fixed address Greg Kroah-Hartman
` (877 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta), Baolin Wang,
David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 66ce68a249f4ac56cd6968aa6d8ded20fb4b7d09 ]
A failed swap read replaces the swap entry with a swapin-error marker in
the page-cache and subtracts its pages from "alloced" and "swapped";
however, it leaves their block charge in place.
Removing the marker during truncate then subtracts from "swapped" again.
This can underflow the counters or make swapped reach zero while other
pages remain swapped out, causing swapoff to loop without finding them.
When installing the marker, subtract only from "swapped" and let
shmem_recalc_inode() reduce "alloced" and release the block charge.
Make shmem_free_swap() report successful removal separately from the
number of swap pages freed, so removing a swapin-error marker does not
subtract from "swapped" again.
It's a bit confusing, but replacing a swapped out page by a swapin-error
marker in shmem_set_folio_swapin_error() behaves as follows:
Initially:
alloced=1, swapped=1, nrpages=0
Calling shmem_recalc_inode(inode, 0, -1)
-> swapped = 0
-> freed = 1 - 0 - 0 = 1
-> alloced -= freed
-> alloced=0, swapped=0, block charge released
Fixes: 6cec2b95dadf ("mm/shmem: fix infinite loop when swap in shmem error at swapoff time")
Cc: stable@vger.kernel.org
Tested-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://patch.msgid.link/20261029-fixes_shmem-v4-14-392fc715d8f6@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
[ sashal: adapted newer swap APIs to the existing swp_entry_t-based interfaces ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/shmem.c | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index df6a57f227865..1693aa906227a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -873,14 +873,14 @@ static void shmem_delete_from_page_cache(struct folio *folio, void *radswap)
}
/*
- * Remove swap entry from page cache, free the swap and its page cache. Returns
- * the number of pages being freed. 0 means entry not found in XArray (0 pages
- * being freed).
+ * Remove a swap entry or swapin-error marker wholly within [index, end].
+ * Return whether it was removed, counting freed swap pages in nr_swaps_freed.
*/
-static long shmem_free_swap(struct address_space *mapping,
- pgoff_t index, pgoff_t end, void *radswap)
+static bool shmem_free_swap(struct address_space *mapping,
+ pgoff_t index, pgoff_t end, void *radswap, long *nr_swaps_freed)
{
XA_STATE(xas, &mapping->i_pages, index);
+ const swp_entry_t swp = radix_to_swp_entry(radswap);
unsigned int nr_pages = 0;
pgoff_t base;
void *entry;
@@ -897,8 +897,11 @@ static long shmem_free_swap(struct address_space *mapping,
}
xas_unlock_irq(&xas);
- if (nr_pages)
- free_swap_and_cache_nr(radix_to_swp_entry(radswap), nr_pages);
+ /* A swapin-error marker holds no swap slot, so just drop it. */
+ if (nr_pages && !non_swap_entry(swp)) {
+ free_swap_and_cache_nr(swp, nr_pages);
+ *nr_swaps_freed += nr_pages;
+ }
return nr_pages;
}
@@ -1051,8 +1054,8 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
if (xa_is_value(folio)) {
if (unfalloc)
continue;
- nr_swaps_freed += shmem_free_swap(mapping, indices[i],
- end - 1, folio);
+ shmem_free_swap(mapping, indices[i], end - 1,
+ folio, &nr_swaps_freed);
continue;
}
@@ -1119,13 +1122,11 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
if (xa_is_value(folio)) {
int order;
- long swaps_freed;
if (unfalloc)
continue;
- swaps_freed = shmem_free_swap(mapping, indices[i],
- end - 1, folio);
- if (!swaps_freed) {
+ if (!shmem_free_swap(mapping, indices[i], end - 1,
+ folio, &nr_swaps_freed)) {
pgoff_t base = indices[i];
order = shmem_confirm_swap(mapping, indices[i],
@@ -1146,7 +1147,6 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
index = base;
break;
}
- nr_swaps_freed += swaps_freed;
continue;
}
@@ -2071,11 +2071,10 @@ static void shmem_set_folio_swapin_error(struct inode *inode, pgoff_t index,
folio_wait_writeback(folio);
delete_from_swap_cache(folio);
/*
- * Don't treat swapin error folio as alloced. Otherwise inode->i_blocks
- * won't be 0 when inode is released and thus trigger WARN_ON(i_blocks)
- * in shmem_evict_inode().
+ * Let shmem_recalc_inode() reduce alloced and release the block charge
+ * for the freed swap pages.
*/
- shmem_recalc_inode(inode, -nr_pages, -nr_pages);
+ shmem_recalc_inode(inode, 0, -nr_pages);
swap_free_nr(swap, nr_pages);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0122/1756] mm/cma: accept memory of CMA areas reserved at a fixed address
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0121/1756] mm/shmem: fix accounting of swapin-error markers Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0123/1756] ovl: inherit FMODE_NONOTIFY when reading directory layers Greg Kroah-Hartman
` (876 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Rapoport (Microsoft),
Andrew Morton, Kiryl Shutsemau (Meta), Pankaj Gupta,
David Hildenbrand, Liam R. Howlett, Lorenzo Stoakes, Michal Hocko,
Suren Baghdasaryan, Vlastimil Babka, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Rapoport (Microsoft) <rppt@kernel.org>
[ Upstream commit f8f9cbc34a309a388c052706f3329d1b52985aa3 ]
CMA areas allocated from memblock have their memory accepted by
memblock_alloc_range_nid(), but areas reserved at a fixed address with
memblock_reserve() are not.
If a fixed CMA area is requested by the cma=<size>@<base> command line
parameter, it may be in regular RAM and on TDX and SEV-SNP guests it
must be accepted.
Accept the memory of fixed CMA areas as well, so that all CMA areas are
accepted regardless of how they were reserved.
Link: https://lore.kernel.org/20261029-cma-multi-v1-2-2cbced8b5cb7@kernel.org
Fixes: 75d090fd167a ("x86/tdx: Add unaccepted memory support")
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Tested-by: Pankaj Gupta <pankaj.gupta@amd.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: <stable@vger.kernel.org>
[ sashal: placed accept_memory() directly in cma_declare_contiguous_nid() because cma_fixed_reserve() is absent ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/cma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/cma.c b/mm/cma.c
index 2d9fae9392835..4a0616bb12b77 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -313,6 +313,8 @@ int __init cma_declare_contiguous_nid(phys_addr_t base,
ret = -EBUSY;
goto err;
}
+
+ accept_memory(base, size);
} else {
phys_addr_t addr = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0123/1756] ovl: inherit FMODE_NONOTIFY when reading directory layers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0122/1756] mm/cma: accept memory of CMA areas reserved at a fixed address Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0124/1756] netfilter: flowtable: ensure sufficient headroom in xmit path Greg Kroah-Hartman
` (875 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Edvard Conrad, Amir Goldstein,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit 9ff338af0e002fe217cfa16b1289b76f6b21fc72 ]
Listing a merged or impure overlay directory opens the real layer
directories from ovl_dir_read(), when the readdir cache is filled.
Those opens use plain ovl_path_open(), so when the directory fd is
one that fanotify created for a permission event, they can still raise
FS_OPEN_PERM. A listener that also marks the backing filesystem and
calls getdents() on the event fd before answering then deadlocks the
same way as with the directory open fixed by the previous commit.
Store the overlay user file in struct ovl_readdir_data and pass it to
ovl_path_open_realfile() from ovl_dir_read(), for both the merged and
the impure cache. Internal readers such as ovl_check_empty_dir() and
the mount-time workdir cleanup still pass no user file.
A note about severity and real world impact: The FAN_OPEN_PERM event is
traditionally used by anti-malware protection agents and security/audit
agents. The scope that is often used in those use cases is FAN_MARK_MOUNT
and agents typically monitor multiple mounts in a mount namespace.
FAN_OPEN_PERM from directory open requires user opt-in with FAN_ONDIR.
It is often not the case that anti-malware agents monitor open of
directories. Security/audit engines are more likely to opt-into
FAN_OPEN_PERM on directories, but are less likely to list the content
of a directory within the scope of FAN_OPEN_PERM event, so the real
world impact of this bug is likely not significant.
Reported-by: Edvard Conrad <edvard@tuta.io>
Closes: https://lore.kernel.org/all/P5Qu3co--N-9@tuta.io/
Cc: stable@vger.kernel.org
Tested-by: Edvard Conrad <edvard@tuta.io>
Link: https://lore.kernel.org/ltp/P5WKBbq--F-9@tuta.io/
Co-developed-by: Edvard Conrad <edvard@tuta.io>
Signed-off-by: Edvard Conrad <edvard@tuta.io>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
[ sashal: replaced ovl_path_open_realfile() with ovl_path_open() using a conditional __FMODE_NONOTIFY flag ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/readdir.c | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index 843c3d5168f4e..d102819622109 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -38,6 +38,7 @@ struct ovl_dir_cache {
struct ovl_readdir_data {
struct dir_context ctx;
+ const struct file *user_file;
struct dentry *dentry;
bool is_lowest;
struct rb_root *root;
@@ -299,9 +300,13 @@ static inline int ovl_dir_read(const struct path *realpath,
struct ovl_readdir_data *rdd)
{
struct file *realfile;
+ int flags = O_RDONLY | O_LARGEFILE;
int err;
- realfile = ovl_path_open(realpath, O_RDONLY | O_LARGEFILE);
+ if (rdd->user_file && FMODE_FSNOTIFY_NONE(rdd->user_file->f_mode))
+ flags |= __FMODE_NONOTIFY;
+
+ realfile = ovl_path_open(realpath, flags);
if (IS_ERR(realfile))
return PTR_ERR(realfile);
@@ -345,12 +350,13 @@ static void ovl_dir_reset(struct file *file)
}
static int ovl_dir_read_merged(struct dentry *dentry, struct list_head *list,
- struct rb_root *root)
+ struct rb_root *root, const struct file *user_file)
{
int err;
struct path realpath;
struct ovl_readdir_data rdd = {
.ctx.actor = ovl_fill_merge,
+ .user_file = user_file,
.dentry = dentry,
.list = list,
.root = root,
@@ -397,9 +403,10 @@ static void ovl_seek_cursor(struct ovl_dir_file *od, loff_t pos)
od->cursor = p;
}
-static struct ovl_dir_cache *ovl_cache_get(struct dentry *dentry)
+static struct ovl_dir_cache *ovl_dir_cache_get(struct file *file)
{
int res;
+ struct dentry *dentry = file->f_path.dentry;
struct ovl_dir_cache *cache;
struct inode *inode = d_inode(dentry);
@@ -419,7 +426,7 @@ static struct ovl_dir_cache *ovl_cache_get(struct dentry *dentry)
INIT_LIST_HEAD(&cache->entries);
cache->root = RB_ROOT;
- res = ovl_dir_read_merged(dentry, &cache->entries, &cache->root);
+ res = ovl_dir_read_merged(dentry, &cache->entries, &cache->root, file);
if (res) {
ovl_cache_free(&cache->entries);
kfree(cache);
@@ -563,14 +570,15 @@ static bool ovl_fill_plain(struct dir_context *ctx, const char *name,
return true;
}
-static int ovl_dir_read_impure(const struct path *path, struct list_head *list,
- struct rb_root *root)
+static int ovl_dir_read_impure(const struct path *path, struct list_head *list,
+ struct rb_root *root, const struct file *user_file)
{
int err;
struct path realpath;
struct ovl_cache_entry *p, *n;
struct ovl_readdir_data rdd = {
.ctx.actor = ovl_fill_plain,
+ .user_file = user_file,
.list = list,
.root = root,
};
@@ -608,9 +616,10 @@ static int ovl_dir_read_impure(const struct path *path, struct list_head *list,
return 0;
}
-static struct ovl_dir_cache *ovl_cache_get_impure(const struct path *path)
+static struct ovl_dir_cache *ovl_cache_get_impure(struct file *file)
{
int res;
+ const struct path *path = &file->f_path;
struct dentry *dentry = path->dentry;
struct inode *inode = d_inode(dentry);
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
@@ -628,7 +637,7 @@ static struct ovl_dir_cache *ovl_cache_get_impure(const struct path *path)
if (!cache)
return ERR_PTR(-ENOMEM);
- res = ovl_dir_read_impure(path, &cache->entries, &cache->root);
+ res = ovl_dir_read_impure(path, &cache->entries, &cache->root, file);
if (res) {
ovl_cache_free(&cache->entries);
kfree(cache);
@@ -744,7 +753,7 @@ static int ovl_iterate_real(struct file *file, struct dir_context *ctx)
dput(parent);
if (ovl_is_impure_dir(file)) {
- rdt.cache = ovl_cache_get_impure(&file->f_path);
+ rdt.cache = ovl_cache_get_impure(file);
if (IS_ERR(rdt.cache))
return PTR_ERR(rdt.cache);
}
@@ -792,7 +801,7 @@ static int ovl_iterate(struct file *file, struct dir_context *ctx)
if (!od->cache) {
struct ovl_dir_cache *cache;
- cache = ovl_cache_get(dentry);
+ cache = ovl_dir_cache_get(file);
err = PTR_ERR(cache);
if (IS_ERR(cache))
goto out;
@@ -1007,7 +1016,7 @@ int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list)
const struct cred *old_cred;
old_cred = ovl_override_creds(dentry->d_sb);
- err = ovl_dir_read_merged(dentry, list, &root);
+ err = ovl_dir_read_merged(dentry, list, &root, NULL);
revert_creds(old_cred);
if (err)
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0124/1756] netfilter: flowtable: ensure sufficient headroom in xmit path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0123/1756] ovl: inherit FMODE_NONOTIFY when reading directory layers Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0125/1756] comedi: addi_apci_3xxx: fix subdevice count underallocation Greg Kroah-Hartman
` (874 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Antonio Quartulli,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <pablo@netfilter.org>
commit ef4f741e8627512cb8c82f59a1fc7aacd854aadf upstream.
Check for headroom and call skb_expand_head() like in the IP output
path to ensure there is sufficient headroom for the mac header when
forwarding this packet as suggested by sashiko.
Fixes: b5964aac51e0 ("netfilter: flowtable: consolidate xmit path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[ aq: the upstream commit does not apply to 6.12: 6.12 predates
b5964aac51e0, and FLOW_OFFLOAD_XMIT_NEIGH flows are still sent through
neigh_xmit() from nf_flow_offload_ip_hook() and
nf_flow_offload_ipv6_hook(). Do the same headroom check there, before
skb->dev is switched to the output device, and in nf_flow_queue_xmit().
Without it, a forwarded skb reaches the output device's
header_ops->create() with only the headroom it was received with. A
UDP socket behind a veth (e.g. a container) leaves 16 bytes; virtio_net
leaves 26 for frames larger than GOOD_COPY_LEN. GRE, ip6gre and VLAN
have since been hardened individually, 6LoWPAN has not:
lowpan_header_create() stores struct lowpan_addr_info (32 bytes) in
front of skb->data after a mere WARN_ON_ONCE(), i.e. an out-of-bounds
write before the skb head. Seen on v6.12.117 with IPv6 forwarded by a
flowtable from a veth to a 6LoWPAN interface:
WARNING: CPU: 1 PID: 4719 at net/ieee802154/6lowpan/tx.c:21 lowpan_header_create+0x165/0x1b0 [ieee802154_6lowpan]
Call Trace:
neigh_connected_output+0xa3/0xf0
neigh_xmit+0xbb/0x210
nf_flow_offload_ipv6_hook+0x540/0x7c0
nf_hook_slow+0x39/0xe0
__netif_receive_skb_core.constprop.0+0xe4c/0x1010
__netif_receive_skb_one_core+0x37/0xa0
process_backlog+0x77/0x140
Before e67c577d8989 ("ipv4: ip_gre: make ipgre_header() robust") the
same path panicked with multipoint GRE (DMVPN) output devices:
skb_under_panic in ipgre_header() via nf_flow_offload_ip_hook(). ]
Fixes: 97add9f0d66d ("netfilter: flow table support for IPv4")
Fixes: 0995210753a2 ("netfilter: flow table support for IPv6")
Fixes: 7a27f6ab4135 ("netfilter: flowtable: use dev_fill_forward_path() to obtain egress device")
Link: https://vyos.dev/T7549
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_flow_table_ip.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
index e9d960a1180b8..617f3cb81af11 100644
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -330,6 +330,22 @@ static void nf_flow_encap_pop(struct sk_buff *skb,
}
}
+/* Make room for the link layer header of @dev, like ip_finish_output2() does.
+ * The flowtable fast path skips the IP output path, and a device with
+ * header_ops (e.g. an NBMA GRE tunnel) may need more headroom than the skb
+ * was received with. On failure the skb has been freed.
+ */
+static struct sk_buff *nf_flow_xmit_headroom(struct sk_buff *skb,
+ struct net_device *dev)
+{
+ unsigned int hh_len = LL_RESERVED_SPACE(dev);
+
+ if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops))
+ skb = skb_expand_head(skb, hh_len);
+
+ return skb;
+}
+
static unsigned int nf_flow_queue_xmit(struct net *net, struct sk_buff *skb,
const struct flow_offload_tuple_rhash *tuplehash,
unsigned short type)
@@ -340,6 +356,10 @@ static unsigned int nf_flow_queue_xmit(struct net *net, struct sk_buff *skb,
if (!outdev)
return NF_DROP;
+ skb = nf_flow_xmit_headroom(skb, outdev);
+ if (!skb)
+ return NF_STOLEN;
+
skb->dev = outdev;
dev_hard_header(skb, skb->dev, type, tuplehash->tuple.out.h_dest,
tuplehash->tuple.out.h_source, skb->len);
@@ -452,6 +472,9 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
case FLOW_OFFLOAD_XMIT_NEIGH:
rt = dst_rtable(tuplehash->tuple.dst_cache);
outdev = rt->dst.dev;
+ skb = nf_flow_xmit_headroom(skb, outdev);
+ if (!skb)
+ return NF_STOLEN;
skb->dev = outdev;
nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr);
skb_dst_drop(skb);
@@ -748,6 +771,9 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
case FLOW_OFFLOAD_XMIT_NEIGH:
rt = dst_rt6_info(tuplehash->tuple.dst_cache);
outdev = rt->dst.dev;
+ skb = nf_flow_xmit_headroom(skb, outdev);
+ if (!skb)
+ return NF_STOLEN;
skb->dev = outdev;
nexthop = rt6_nexthop(rt, &flow->tuplehash[!dir].tuple.src_v6);
skb_dst_drop(skb);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0125/1756] comedi: addi_apci_3xxx: fix subdevice count underallocation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0124/1756] netfilter: flowtable: ensure sufficient headroom in xmit path Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0126/1756] comedi: dt2811: fix shift-out-of-bounds in IRQ check Greg Kroah-Hartman
` (873 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Zi, Ian Abbott, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Zi <2959243019@qq.com>
[ Upstream commit 3de5aa458dede472a253266d02902bd95af8e849 ]
In apci3xxx_auto_attach(), the number of subdevices is computed with
n_subdevices = (board->ai_n_chan ? 0 : 1) + board->has_ao + ...
The ternary is inverted: when the board has analog input channels
(ai_n_chan != 0), it counts 0 instead of 1, so the AI subdevice that is
actually created is not accounted for. As a result
comedi_alloc_subdevices() allocates one entry too few, and the later
subdevice initialization (notably the TTL Digital I/O subdevice, which
is populated last) writes past the end of the allocated array, causing a
slab out-of-bounds write.
Flip the ternary to count 1 when ai_n_chan is non-zero and 0 otherwise,
matching the subdevice creation order in the function.
Signed-off-by: Yang Zi <2959243019@qq.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20261014101803.11036-1-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes: 656e39fedcf0 ("staging: comedi: addi_apci_3xxx: only allocate needed subdevices")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/comedi/drivers/addi_apci_3xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/comedi/drivers/addi_apci_3xxx.c b/drivers/comedi/drivers/addi_apci_3xxx.c
index bc72273e6a291..7355ec454cb40 100644
--- a/drivers/comedi/drivers/addi_apci_3xxx.c
+++ b/drivers/comedi/drivers/addi_apci_3xxx.c
@@ -787,7 +787,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
dev->irq = pcidev->irq;
}
- n_subdevices = (board->ai_n_chan ? 0 : 1) + board->has_ao +
+ n_subdevices = (board->ai_n_chan ? 1 : 0) + board->has_ao +
board->has_dig_in + board->has_dig_out +
board->has_ttl_io;
ret = comedi_alloc_subdevices(dev, n_subdevices);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0126/1756] comedi: dt2811: fix shift-out-of-bounds in IRQ check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0125/1756] comedi: addi_apci_3xxx: fix subdevice count underallocation Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0127/1756] r8169: align RTL8125/RTL8126 PHY config with vendor driver Greg Kroah-Hartman
` (872 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a4cedab706d0a8a3f988,
Pei Xiao, Ian Abbott, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pei Xiao <xiaopei01@kylinos.cn>
[ Upstream commit 471ce96a9c415b8a67bd5081ac2089a458cacc2f ]
The IRQ number passed via comedi_devconfig->options[1] is a signed int
that comes from userspace. The check `it->options[1] <= 7` does not
reject negative values, so a negative IRQ number reaches
`BIT(it->options[1])`, which is undefined behavior and triggers a UBSAN
shift-out-of-bounds warning:
UBSAN: shift-out-of-bounds in drivers/comedi/drivers/dt2811.c:570:31
shift exponent -251 is negative
Add an explicit lower bound check (`it->options[1] >= 0`) so that only
valid IRQ numbers 0..7 are accepted before the shift.
Fixes: f2975a9b2ab9 ("staging: comedi: dt2811: add async command support for AI subdevice")
Reported-by: syzbot+a4cedab706d0a8a3f988@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/6ab21240.e548f532.1ca396.0018.GAE@google.com/#R
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Tested-by: syzbot+a4cedab706d0a8a3f988@syzkaller.appspotmail.com
Link: https://patch.msgid.link/02c46315293a26169d2a3862a2047959a1651ef4.1790061387.git.xiaopei01@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/comedi/drivers/dt2811.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/comedi/drivers/dt2811.c b/drivers/comedi/drivers/dt2811.c
index c2ec5e4fb689f..c422317ef1398 100644
--- a/drivers/comedi/drivers/dt2811.c
+++ b/drivers/comedi/drivers/dt2811.c
@@ -566,7 +566,7 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dt2811_reset(dev);
/* IRQ's 2,3,5,7 are valid for async command support */
- if (it->options[1] <= 7 && (BIT(it->options[1]) & 0xac)) {
+ if (it->options[1] >= 0 && it->options[1] <= 7 && (BIT(it->options[1]) & 0xac)) {
ret = request_irq(it->options[1], dt2811_interrupt, 0,
dev->board_name, dev);
if (ret == 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0127/1756] r8169: align RTL8125/RTL8126 PHY config with vendor driver
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0126/1756] comedi: dt2811: fix shift-out-of-bounds in IRQ check Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0128/1756] xfs: add a flag to convert unwritten extents without allocating blocks Greg Kroah-Hartman
` (871 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Heiner Kallweit, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiner Kallweit <hkallweit1@gmail.com>
[ Upstream commit 4af2f60bf7378bd5c92b15a528d8c6c7d02bed6c ]
This aligns some parameters with vendor driver r8125/r8126 to avoid
compatibility issues. Note that for RTL8125B there's no functional
change, just the open-coded version of the function is replaced.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/a8a9d896-fbe6-41f2-bf87-666567d3cdb3@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/realtek/r8169_phy_config.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
index d09b2a41cd062..b8442e6ee2496 100644
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
@@ -1068,8 +1068,8 @@ static void rtl8125b_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
r8169_apply_firmware(tp);
+ rtl8168g_enable_gphy_10m(phydev);
- phy_modify_paged(phydev, 0xa44, 0x11, 0x0000, 0x0800);
phy_modify_paged(phydev, 0xac4, 0x13, 0x00f0, 0x0090);
phy_modify_paged(phydev, 0xad3, 0x10, 0x0003, 0x0001);
@@ -1108,6 +1108,7 @@ static void rtl8125d_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
r8169_apply_firmware(tp);
+ rtl8168g_enable_gphy_10m(phydev);
rtl8125_legacy_force_mode(phydev);
rtl8168g_disable_aldps(phydev);
rtl8125b_config_eee_phy(phydev);
@@ -1117,6 +1118,9 @@ static void rtl8126a_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
r8169_apply_firmware(tp);
+ rtl8168g_enable_gphy_10m(phydev);
+ rtl8125_legacy_force_mode(phydev);
+ rtl8168g_disable_aldps(phydev);
}
void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0128/1756] xfs: add a flag to convert unwritten extents without allocating blocks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0127/1756] r8169: align RTL8125/RTL8126 PHY config with vendor driver Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0129/1756] x86/microcode/AMD: Move the no-revision fixup to get_patch_level() Greg Kroah-Hartman
` (870 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Daejun Park,
Pankaj Raghav, Carlos Maiolino, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
[ Upstream commit f3ca3498dfe624f9b604c934263538a3acd55af5 ]
xfs_bmapi_write() with XFS_BMAPI_CONVERT also allocates blocks for
holes and delalloc extents in the range. Add XFS_BMAPI_CONVERT_ONLY for
callers that may only convert already allocated blocks. It stops at a
hole or delalloc extent, and returns -ENOSR if it stops before mapping
anything.
Marked for stable because "xfs: refuse a pNFS LAYOUTCOMMIT of a range
without blocks" needs it.
Suggested-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20261013120359.GB2944@lst.de
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
[ sashal: Placed XFS_BMAPI_CONVERT_ONLY and its trace entry after XFS_BMAPI_NORMAP because XFS_BMAPI_EXTSZALIGN is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/libxfs/xfs_bmap.c | 14 ++++++++++++--
fs/xfs/libxfs/xfs_bmap.h | 10 +++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index b2b5a36ead97b..5a79ae2e2276c 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -4380,6 +4380,8 @@ xfs_bmapi_finish(
* Returns a negative error code on failure, including -ENOSPC when it could not
* allocate any blocks and -ENOSR when it did allocate blocks to convert a
* delalloc range, but those blocks were before the passed in range.
+ * With XFS_BMAPI_CONVERT_ONLY, it stops at a hole or a delalloc extent instead
+ * of allocating blocks, and returns -ENOSR if it stops before mapping anything.
*/
int
xfs_bmapi_write(
@@ -4439,6 +4441,8 @@ xfs_bmapi_write(
*/
ASSERT((flags & (XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO)) !=
(XFS_BMAPI_PREALLOC | XFS_BMAPI_ZERO));
+ ASSERT(!(flags & XFS_BMAPI_CONVERT_ONLY) ||
+ (flags & XFS_BMAPI_CONVERT));
if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) ||
XFS_TEST_ERROR(mp, XFS_ERRTAG_BMAPIFORMAT)) {
@@ -4487,6 +4491,9 @@ xfs_bmapi_write(
* that we found, if any.
*/
if (need_alloc || wasdelay) {
+ if (flags & XFS_BMAPI_CONVERT_ONLY)
+ break;
+
bma.eof = eof;
bma.conv = !!(flags & XFS_BMAPI_CONVERT);
bma.wasdel = wasdelay;
@@ -4581,10 +4588,13 @@ xfs_bmapi_write(
*
* To avoid a successful return with *nmap set to 0, return the magic
* -ENOSR error code for this particular case so that the caller can
- * handle it.
+ * handle it. The same goes for XFS_BMAPI_CONVERT_ONLY stopping at a
+ * hole or a delalloc extent at the start of the range, in which case
+ * nothing has been changed.
*/
if (!n) {
- ASSERT(bma.nallocs >= *nmap);
+ ASSERT((flags & XFS_BMAPI_CONVERT_ONLY) ? bma.nallocs == 0 :
+ bma.nallocs >= *nmap);
return -ENOSR;
}
*nmap = n;
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
index 7592d46e97c66..0a7c32c6ce34f 100644
--- a/fs/xfs/libxfs/xfs_bmap.h
+++ b/fs/xfs/libxfs/xfs_bmap.h
@@ -87,6 +87,13 @@ struct xfs_bmalloca {
/* Do not update the rmap btree. Used for reconstructing bmbt from rmapbt. */
#define XFS_BMAPI_NORMAP (1u << 10)
+/*
+ * Use with XFS_BMAPI_CONVERT to convert unwritten extents without allocating
+ * blocks. Stop at a hole or a delalloc extent: return the mappings found so
+ * far, or -ENOSR if there are none.
+ */
+#define XFS_BMAPI_CONVERT_ONLY (1u << 12)
+
#define XFS_BMAPI_FLAGS \
{ XFS_BMAPI_ENTIRE, "ENTIRE" }, \
{ XFS_BMAPI_METADATA, "METADATA" }, \
@@ -98,7 +105,8 @@ struct xfs_bmalloca {
{ XFS_BMAPI_REMAP, "REMAP" }, \
{ XFS_BMAPI_COWFORK, "COWFORK" }, \
{ XFS_BMAPI_NODISCARD, "NODISCARD" }, \
- { XFS_BMAPI_NORMAP, "NORMAP" }
+ { XFS_BMAPI_NORMAP, "NORMAP" }, \
+ { XFS_BMAPI_CONVERT_ONLY, "CONVERT_ONLY" }
static inline int xfs_bmapi_aflag(int w)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0129/1756] x86/microcode/AMD: Move the no-revision fixup to get_patch_level()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0128/1756] xfs: add a flag to convert unwritten extents without allocating blocks Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0130/1756] fs/stat.c: avoid harmless garbage value problem in vfs_statx_path() Greg Kroah-Hartman
` (869 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Borislav Petkov (AMD), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Borislav Petkov (AMD) <bp@alien8.de>
[ Upstream commit 098bcea71b8d257d80b0037b97b66070806600a5 ]
On machines which don't have microcode applied yet, the revision is 0.
However, this doesn't work with the Zen family/model/stepping patch
arithmetic. So move the fixup to the patch level getter function and
this way make sure the patch level is always proper and thus the
arithmetic always works.
And now that it can be called on any family, make this Zen-only.
Assisted-by: claude/claude-opus-4-6
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20260530024213.86137-1-bp@kernel.org
[ sashal: get_patch_level() here lacks the upstream debug/hypervisor branch; the fixup goes right after native_rdmsr() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/cpu/microcode/amd.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 24709a5589633..a846864ba89f8 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -221,11 +221,6 @@ static bool need_sha_check(u32 cur_rev)
{
u32 cutoff;
- if (!cur_rev) {
- cur_rev = cpuid_to_ucode_rev(bsp_cpuid_1_eax);
- pr_info_once("No current revision, generating the lowest one: 0x%x\n", cur_rev);
- }
-
cutoff = get_cutoff_revision(cur_rev);
if (cutoff)
return cur_rev <= cutoff;
@@ -297,6 +292,13 @@ static u32 get_patch_level(void)
u32 rev, dummy __always_unused;
native_rdmsr(MSR_AMD64_PATCH_LEVEL, rev, dummy);
+ if (!rev) {
+ if (x86_family(bsp_cpuid_1_eax) < 0x17)
+ return rev;
+
+ rev = cpuid_to_ucode_rev(bsp_cpuid_1_eax);
+ pr_info_once("No current revision, generating the lowest one: 0x%x\n", rev);
+ }
return rev;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0130/1756] fs/stat.c: avoid harmless garbage value problem in vfs_statx_path()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0129/1756] x86/microcode/AMD: Move the no-revision fixup to get_patch_level() Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0131/1756] drm/komeda: Fix bits parsing of GLB_CORE_ID Greg Kroah-Hartman
` (868 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Christian Brauner,
Petr Vaganov
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Su Hui <suhui@nfschina.com>
commit 0fac3ed473dd2955053be6671cdd747807f5e488 upstream.
Clang static checker(scan-build) warning:
fs/stat.c:287:21: warning: The left expression of the compound assignment is
an uninitialized value. The computed value will also be garbage.
287 | stat->result_mask |= STATX_MNT_ID_UNIQUE;
| ~~~~~~~~~~~~~~~~~ ^
fs/stat.c:290:21: warning: The left expression of the compound assignment is
an uninitialized value. The computed value will also be garbage.
290 | stat->result_mask |= STATX_MNT_ID;
When vfs_getattr() failed because of security_inode_getattr(), 'stat' is
uninitialized. In this case, there is a harmless garbage problem in
vfs_statx_path(). It's better to return error directly when
vfs_getattr() failed, avoiding garbage value and more clearly.
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20250119025946.1168957-1-suhui@nfschina.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Fixes: 98d2b4308197 ("add unique mount ID")
Signed-off-by: Petr Vaganov <petrvaganoff@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/stat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -253,6 +253,8 @@ static int vfs_statx_path(struct path *p
u32 request_mask)
{
int error = vfs_getattr(path, stat, request_mask, flags);
+ if (error)
+ return error;
if (request_mask & STATX_MNT_ID_UNIQUE) {
stat->mnt_id = real_mount(path->mnt)->mnt_id_unique;
@@ -274,7 +276,7 @@ static int vfs_statx_path(struct path *p
if (S_ISBLK(stat->mode))
bdev_statx(path, stat, request_mask);
- return error;
+ return 0;
}
static int vfs_statx_fd(int fd, int flags, struct kstat *stat,
^ permalink raw reply [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0131/1756] drm/komeda: Fix bits parsing of GLB_CORE_ID
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0130/1756] fs/stat.c: avoid harmless garbage value problem in vfs_statx_path() Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0132/1756] accel/qaic: reject BO sizes that overflow page count Greg Kroah-Hartman
` (867 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Raveendra Talabattula, Liviu Dudau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raveendra Talabattula <raveendra.talabattula@arm.com>
[ Upstream commit ec902de0221747094f9ccbb61454e9633fbf282f ]
GLB_CORE_ID contains the product and version information returned by the
hardware. The current macros parses VERSION_MINOR as a 4-bit field and
VERSION_STATUS as an 8-bit field, which does not match the register
layout. As a result, the driver reports an incorrect version number.
Fix the parsing macros to match the hardware specification:
- VERSION_MINOR is 8 bits at [11:4]
- VERSION_STATUS is 4 bits at [3:0]
Fixes: bd628c1bed79 ("drm/komeda: komeda_dev/pipeline/component definition and initialzation")
Signed-off-by: Raveendra Talabattula <raveendra.talabattula@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260803142122.4127851-2-raveendra.talabattula@arm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/arm/display/include/malidp_product.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/arm/display/include/malidp_product.h b/drivers/gpu/drm/arm/display/include/malidp_product.h
index 16a8a2c22c423..f0c34eff523f1 100644
--- a/drivers/gpu/drm/arm/display/include/malidp_product.h
+++ b/drivers/gpu/drm/arm/display/include/malidp_product.h
@@ -8,14 +8,18 @@
#define _MALIDP_PRODUCT_H_
/* Product identification */
+/* GLB_CORE_ID fields as per HW specification:
+ * MINOR is 8 bits ([11:4]) and STATUS is 4 bits ([3:0]).
+ * Update masks/shifts accordingly.
+ */
#define MALIDP_CORE_ID(__product, __major, __minor, __status) \
((((__product) & 0xFFFF) << 16) | (((__major) & 0xF) << 12) | \
- (((__minor) & 0xF) << 8) | ((__status) & 0xFF))
+ (((__minor) & 0xFF) << 4) | ((__status) & 0xF))
#define MALIDP_CORE_ID_PRODUCT_ID(__core_id) ((__u32)(__core_id) >> 16)
#define MALIDP_CORE_ID_MAJOR(__core_id) (((__u32)(__core_id) >> 12) & 0xF)
-#define MALIDP_CORE_ID_MINOR(__core_id) (((__u32)(__core_id) >> 8) & 0xF)
-#define MALIDP_CORE_ID_STATUS(__core_id) (((__u32)(__core_id)) & 0xFF)
+#define MALIDP_CORE_ID_MINOR(__core_id) (((__u32)(__core_id) >> 4) & 0xFF)
+#define MALIDP_CORE_ID_STATUS(__core_id) ((__u32)(__core_id) & 0xF)
/* Mali-display product IDs */
#define MALIDP_D71_PRODUCT_ID 0x0071
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0132/1756] accel/qaic: reject BO sizes that overflow page count
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0131/1756] drm/komeda: Fix bits parsing of GLB_CORE_ID Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0133/1756] drm/panfrost: Prevent division by 0 Greg Kroah-Hartman
` (866 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hao-Qun Huang, Jeff Hugo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao-Qun Huang <alvinhuang0603@gmail.com>
[ Upstream commit 568d4cb5dcc5ec4e22975699b6ea67a30806884c ]
create_sgt() receives the BO size as a u64 but stores the number of
pages in an int. qaic_create_bo_ioctl() page-aligns the user-supplied
size without an upper bound, so DIV_ROUND_UP(size, PAGE_SIZE) can exceed
INT_MAX and truncate when assigned to nr_pages.
When the page count wraps to a small positive value (for example a BO
larger than 16 TiB on a 4 KiB page kernel), create_sgt() succeeds after
allocating only a handful of pages while the GEM object still records
the full size, so the request never fails with -ENOMEM. The temporary
pages array and the allocation loop both use the truncated count, so the
backing SG table ends up smaller than obj->size. Later slice operations
validate against obj->size and then clone ranges from this short sgt.
Compute the page count as a u64 and reject sizes that do not fit in
nr_pages before the narrowing conversion.
Fixes: ff13be830333 ("accel/qaic: Add datapath")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Hao-Qun Huang <alvinhuang0603@gmail.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260708031959.966009-1-alvinhuang0603@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/qaic/qaic_data.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index aa89571b37f0e..f9c00302aff86 100644
--- a/drivers/accel/qaic/qaic_data.c
+++ b/drivers/accel/qaic/qaic_data.c
@@ -15,6 +15,7 @@
#include <linux/math64.h>
#include <linux/mm.h>
#include <linux/moduleparam.h>
+#include <linux/overflow.h>
#include <linux/scatterlist.h>
#include <linux/spinlock.h>
#include <linux/srcu.h>
@@ -454,7 +455,12 @@ static int create_sgt(struct qaic_device *qdev, struct sg_table **sgt_out, u64 s
int order;
if (size) {
- nr_pages = DIV_ROUND_UP(size, PAGE_SIZE);
+ u64 nr_pages_u64 = DIV_ROUND_UP_ULL(size, PAGE_SIZE);
+
+ if (overflows_type(nr_pages_u64, int))
+ return -E2BIG;
+
+ nr_pages = nr_pages_u64;
/*
* calculate how much extra we are going to allocate, to remove
* later
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0133/1756] drm/panfrost: Prevent division by 0
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0132/1756] accel/qaic: reject BO sizes that overflow page count Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0134/1756] bpf: Mark dentry->d_inode as trusted_or_null Greg Kroah-Hartman
` (865 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Claude, Steven Price,
Boris Brezillon, Adrián Larumbe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrián Larumbe <adrian.larumbe@collabora.com>
[ Upstream commit fd4227f03546c323b5b21568f727233e9792d298 ]
When updating and debug-printing devfreq stats, in the very unlikely
off-chance that total device time is less than 100 ns, division by 0
would happen. Fix the divisor when relevant and rearrange operands.
Reported-by: Claude <noreply@anthropic.com>
Closes: https://gitlab.freedesktop.org/panfrost/linux/-/work_items/88
Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20260820-b4-panfrost-fixes-v1-2-1b2c2376f4bc@collabora.com
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panfrost/panfrost_devfreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
index 5d0dce10336ba..9ab4fb3deb145 100644
--- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c
+++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c
@@ -76,7 +76,7 @@ static int panfrost_devfreq_get_dev_status(struct device *dev,
dev_dbg(pfdev->dev, "busy %lu total %lu %lu %% freq %lu MHz\n",
status->busy_time, status->total_time,
- status->busy_time / (status->total_time / 100),
+ status->busy_time * 100 / MAX(status->total_time, 1),
status->current_frequency / 1000 / 1000);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0134/1756] bpf: Mark dentry->d_inode as trusted_or_null
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0133/1756] drm/panfrost: Prevent division by 0 Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0135/1756] bpf: sched_ext: Mark ops argument container pointer fields as trusted Greg Kroah-Hartman
` (864 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Song Liu, Matt Bobrowski,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Song Liu <song@kernel.org>
[ Upstream commit a766cfbbeb3a74397965a8fa2e9a402026d3e1d8 ]
LSM hooks such as security_path_mknod() and security_inode_rename() have
access to newly allocated negative dentry, which has NULL d_inode.
Therefore, it is necessary to do the NULL pointer check for d_inode.
Also add selftests that checks the verifier enforces the NULL pointer
check.
Signed-off-by: Song Liu <song@kernel.org>
Reviewed-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://lore.kernel.org/r/20250613052857.1992233-1-song@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: aed1bf1a352a ("bpf: sched_ext: Mark ops argument container pointer fields as trusted")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 5 ++---
.../selftests/bpf/progs/verifier_vfs_accept.c | 18 ++++++++++++++++++
.../selftests/bpf/progs/verifier_vfs_reject.c | 15 +++++++++++++++
3 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index ecd8595bd5450..5d45edb98e3e3 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -6850,8 +6850,7 @@ BTF_TYPE_SAFE_TRUSTED(struct file) {
struct inode *f_inode;
};
-BTF_TYPE_SAFE_TRUSTED(struct dentry) {
- /* no negative dentry-s in places where bpf can see it */
+BTF_TYPE_SAFE_TRUSTED_OR_NULL(struct dentry) {
struct inode *d_inode;
};
@@ -6889,7 +6888,6 @@ static bool type_is_trusted(struct bpf_verifier_env *env,
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct bpf_iter__task));
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct linux_binprm));
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct file));
- BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct dentry));
return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_trusted");
}
@@ -6899,6 +6897,7 @@ static bool type_is_trusted_or_null(struct bpf_verifier_env *env,
const char *field_name, u32 btf_id)
{
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED_OR_NULL(struct socket));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED_OR_NULL(struct dentry));
return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id,
"__safe_trusted_or_null");
diff --git a/tools/testing/selftests/bpf/progs/verifier_vfs_accept.c b/tools/testing/selftests/bpf/progs/verifier_vfs_accept.c
index a7c0a553aa501..3e2d76ee8050f 100644
--- a/tools/testing/selftests/bpf/progs/verifier_vfs_accept.c
+++ b/tools/testing/selftests/bpf/progs/verifier_vfs_accept.c
@@ -2,6 +2,7 @@
/* Copyright (c) 2024 Google LLC. */
#include <vmlinux.h>
+#include <errno.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
@@ -82,4 +83,21 @@ int BPF_PROG(path_d_path_from_file_argument, struct file *file)
return 0;
}
+SEC("lsm.s/inode_rename")
+__success
+int BPF_PROG(inode_rename, struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry,
+ unsigned int flags)
+{
+ struct inode *inode = new_dentry->d_inode;
+ ino_t ino;
+
+ if (!inode)
+ return 0;
+ ino = inode->i_ino;
+ if (ino == 0)
+ return -EACCES;
+ return 0;
+}
+
char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/progs/verifier_vfs_reject.c b/tools/testing/selftests/bpf/progs/verifier_vfs_reject.c
index d6d3f4fcb24c4..4b392c6c8fc41 100644
--- a/tools/testing/selftests/bpf/progs/verifier_vfs_reject.c
+++ b/tools/testing/selftests/bpf/progs/verifier_vfs_reject.c
@@ -2,6 +2,7 @@
/* Copyright (c) 2024 Google LLC. */
#include <vmlinux.h>
+#include <errno.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <linux/limits.h>
@@ -158,4 +159,18 @@ int BPF_PROG(path_d_path_kfunc_non_lsm, struct path *path, struct file *f)
return 0;
}
+SEC("lsm.s/inode_rename")
+__failure __msg("invalid mem access 'trusted_ptr_or_null_'")
+int BPF_PROG(inode_rename, struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry,
+ unsigned int flags)
+{
+ struct inode *inode = new_dentry->d_inode;
+ ino_t ino;
+
+ ino = inode->i_ino;
+ if (ino == 0)
+ return -EACCES;
+ return 0;
+}
char _license[] SEC("license") = "GPL";
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0135/1756] bpf: sched_ext: Mark ops argument container pointer fields as trusted
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0134/1756] bpf: Mark dentry->d_inode as trusted_or_null Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0136/1756] drm/omap: dsi: avoid sending bta sync all the time in writes Greg Kroah-Hartman
` (863 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Kumar Kartikeya Dwivedi,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
[ Upstream commit aed1bf1a352acd4f5ffd2a81e23d2bb6e8e9b636 ]
Walking an unannotated pointer field of a trusted struct yields a bare
PTR_TO_BTF_ID in non-sleepable programs, which kfuncs and helpers accept,
but PTR_UNTRUSTED in sleepable programs, which they reject. This gets in the
way of making ops.init_task() sleepable, which schedulers want for
allocations. For example, passing args->cgroup into bpf_cgrp_storage_get()
then fails verification and the only recourse is round-tripping through the
cgroup ID with bpf_cgroup_from_id().
The pointer fields in the sched_ext ops argument containers are all pinned
by the callers for the duration of the ops calls and are never NULL. Add
them to the verifier's trusted-fields whitelist so that they are PTR_TRUSTED
in both sleepable and non-sleepable programs.
Fixes: 8195136669661 ("sched_ext: Add cgroup support")
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/95d7ccc17681aa3a4a2eeb1b073f00f7@kernel.org
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 5d45edb98e3e3..7d29b6b77f4ea 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -6850,6 +6850,28 @@ BTF_TYPE_SAFE_TRUSTED(struct file) {
struct inode *f_inode;
};
+/*
+ * The pointer fields in the sched_ext ops argument containers are pinned by the
+ * callers for the duration of the ops calls and are never NULL.
+ */
+BTF_TYPE_SAFE_TRUSTED(struct scx_init_task_args) {
+#ifdef CONFIG_EXT_GROUP_SCHED
+ struct cgroup *cgroup;
+#endif
+};
+
+BTF_TYPE_SAFE_TRUSTED(struct scx_cpu_release_args) {
+ struct task_struct *task;
+};
+
+BTF_TYPE_SAFE_TRUSTED(struct scx_sub_attach_args) {
+ struct sched_ext_ops *ops;
+};
+
+BTF_TYPE_SAFE_TRUSTED(struct scx_sub_detach_args) {
+ struct sched_ext_ops *ops;
+};
+
BTF_TYPE_SAFE_TRUSTED_OR_NULL(struct dentry) {
struct inode *d_inode;
};
@@ -6888,6 +6910,10 @@ static bool type_is_trusted(struct bpf_verifier_env *env,
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct bpf_iter__task));
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct linux_binprm));
BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct file));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct scx_init_task_args));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct scx_cpu_release_args));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct scx_sub_attach_args));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_TRUSTED(struct scx_sub_detach_args));
return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_trusted");
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0136/1756] drm/omap: dsi: avoid sending bta sync all the time in writes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0135/1756] bpf: sched_ext: Mark ops argument container pointer fields as trusted Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0137/1756] drm: of: Fix drm_of_get_data_lanes_count_ep() return value documentation Greg Kroah-Hartman
` (862 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andreas Kemnade, Tomi Valkeinen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Kemnade <andreas@kemnade.info>
[ Upstream commit 20207f78382ff339f3a7f7c5db2c0219b157d32a ]
Some chips need configuration commands to be sent first, before they can
send data. TC358762 for example needs PPI_LPTXTIMECNT configured
and PPI_STARTPPI set to 1 to be able to transmit anything. To be able to
configure such chips, do not send bta sync during writes if no acks are
requested. Instead just wait for the packet to be sent to avoid FIFO
overflows. There might be more to do about acks, but there seem to be
virtually no users of that flag.
This came to light when fiddling with the Epson Moverio BT-200 display
which consists of 2 TC358762 bridges with SPI funneled through
to the unknown display chip. With that patch the bridge can be accessed,
Reading back registers works, when the above-mentioned registers are set.
In Command-Mode update, there was a nop sent, apparently the most
relevant part was the bta sync to actually force low power mode.
Video mode panel at OMAP4 (BT-200) and video mode at OMAP5 was tested.
Fixes: e70965386353e ("drm/omap: dsi: simplify write function")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260629-vm-upstr-v4-1-9f0c62d8808e@kemnade.info
Link: https://patch.msgid.link/20260628-vm-upstr-v3-1-9e9add93378b@kemnade.info
Link: https://patch.msgid.link/20260529-vm-upstr-v2-1-24c30671719f@kernel.org
Link: https://lore.gitlab.freedesktop.org/drm-ai-reviews/review-patch1-20260529-vm-upstr-v2-1-24c30671719f@kernel.org/
Link: https://patch.msgid.link/20260528-vm-upstr-v1-1-fb93ef8cbe47@kernel.org
Link: https://patch.msgid.link/20260804-vm-upstr-v6-1-1bf3748b2fa3@kemnade.info
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/omapdrm/dss/dsi.c | 63 +++++++++++++++----------------
1 file changed, 31 insertions(+), 32 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index b9b013ba80e2e..811c9a4fdec8e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -58,9 +58,6 @@ static void dsi_uninit_dispc(struct dsi_data *dsi);
static int dsi_vc_send_null(struct dsi_data *dsi, int vc, int channel);
-static ssize_t _omap_dsi_host_transfer(struct dsi_data *dsi, int vc,
- const struct mipi_dsi_msg *msg);
-
#ifdef DSI_PERF_MEASURE
static bool dsi_perf;
module_param(dsi_perf, bool, 0644);
@@ -2189,28 +2186,45 @@ static int dsi_vc_send_null(struct dsi_data *dsi, int vc, int channel)
static int dsi_vc_write_common(struct omap_dss_device *dssdev, int vc,
const struct mipi_dsi_msg *msg)
{
+ DECLARE_COMPLETION_ONSTACK(completion);
struct dsi_data *dsi = to_dsi_data(dssdev);
+ u32 err;
int r;
+ /* wait for IRQ for packet transmission confirmation */
+ r = dsi_register_isr_vc(dsi, vc, dsi_completion_handler,
+ &completion, DSI_VC_IRQ_PACKET_SENT);
+ if (r)
+ return r;
+
if (mipi_dsi_packet_format_is_short(msg->type))
r = dsi_vc_send_short(dsi, vc, msg);
else
r = dsi_vc_send_long(dsi, vc, msg);
- if (r < 0)
+ if ((!r) && wait_for_completion_timeout(&completion,
+ msecs_to_jiffies(500)) == 0)
+ r = -EIO;
+
+ dsi_unregister_isr_vc(dsi, vc, dsi_completion_handler,
+ &completion, DSI_VC_IRQ_PACKET_SENT);
+ if (r)
return r;
- /*
- * TODO: we do not always have to do the BTA sync, for example
- * we can improve performance by setting the update window
- * information without sending BTA sync between the commands.
- * In that case we can return early.
- */
+ /* TODO: find out if more needs to be done for MIPI_DSI_MSG_REQ_ACK */
- r = dsi_vc_send_bta_sync(dssdev, vc);
- if (r) {
- DSSERR("bta sync failed\n");
- return r;
+ if (msg->flags & MIPI_DSI_MSG_REQ_ACK) {
+ r = dsi_vc_send_bta_sync(dssdev, vc);
+ if (r) {
+ DSSERR("bta sync failed\n");
+ return r;
+ }
+ } else {
+ err = dsi_get_errors(dsi);
+ if (err) {
+ DSSERR("Error while sending: %x\n", err);
+ return -EIO;
+ }
}
/* RX_FIFO_NOT_EMPTY */
@@ -3228,21 +3242,6 @@ static int _dsi_update(struct dsi_data *dsi)
return 0;
}
-static int _dsi_send_nop(struct dsi_data *dsi, int vc, int channel)
-{
- const u8 payload[] = { MIPI_DCS_NOP };
- const struct mipi_dsi_msg msg = {
- .channel = channel,
- .type = MIPI_DSI_DCS_SHORT_WRITE,
- .tx_len = 1,
- .tx_buf = payload,
- };
-
- WARN_ON(!dsi_bus_is_locked(dsi));
-
- return _omap_dsi_host_transfer(dsi, vc, &msg);
-}
-
static int dsi_update_channel(struct omap_dss_device *dssdev, int vc)
{
struct dsi_data *dsi = to_dsi_data(dssdev);
@@ -3263,13 +3262,13 @@ static int dsi_update_channel(struct omap_dss_device *dssdev, int vc)
DSSDBG("dsi_update_channel: %d", vc);
/*
- * Send NOP between the frames. If we don't send something here, the
+ * Transition to LP here. If we don't send something here, the
* updates stop working. This is probably related to DSI spec stating
* that the DSI host should transition to LP at least once per frame.
*/
- r = _dsi_send_nop(dsi, VC_CMD, dsi->dsidev->channel);
+ r = dsi_vc_send_bta_sync(dssdev, VC_CMD);
if (r < 0) {
- DSSWARN("failed to send nop between frames: %d\n", r);
+ DSSWARN("failed to send bta sync between frames: %d\n", r);
goto err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0137/1756] drm: of: Fix drm_of_get_data_lanes_count_ep() return value documentation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0136/1756] drm/omap: dsi: avoid sending bta sync all the time in writes Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0138/1756] libbpf: Improve log message formatting Greg Kroah-Hartman
` (861 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Marek Vasut,
Maxime Ripard, Tomi Valkeinen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <marek.vasut+renesas@mailbox.org>
[ Upstream commit e3eca845ef7d6cd8c407f9b42beb45af94ff096b ]
Update drm_of_get_data_lanes_count_ep() return value documentation
to match the drm_of_get_data_lanes_count() return value documentation.
The drm_of_get_data_lanes_count_ep() is only a wrapper around the
drm_of_get_data_lanes_count() and therefore returns the same error
codes.
Simplify the return code description of drm_of_get_data_lanes_count()
and drm_of_get_data_lanes_count_ep() to -ENODATA and -EINVAL.
Fixes: fc801750b197 ("drm: of: Add drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep")
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260305205840.95978-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_of.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 177b600895d3c..8adbfe8b88b50 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -444,8 +444,8 @@ EXPORT_SYMBOL_GPL(drm_of_lvds_get_data_mapping);
*
* Return:
* * min..max - positive integer count of "data-lanes" elements
- * * -ve - the "data-lanes" property is missing or invalid
- * * -EINVAL - the "data-lanes" property is unsupported
+ * * -ENODATA - the property does not have a value.
+ * * -EINVAL - the "data-lanes" property is missing or invalid
*/
int drm_of_get_data_lanes_count(const struct device_node *endpoint,
const unsigned int min, const unsigned int max)
@@ -476,8 +476,8 @@ EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count);
*
* Return:
* * min..max - positive integer count of "data-lanes" elements
- * * -EINVAL - the "data-mapping" property is unsupported
- * * -ENODEV - the "data-mapping" property is missing
+ * * -ENODATA - the property does not have a value.
+ * * -EINVAL - the "data-lanes" property is missing or invalid
*/
int drm_of_get_data_lanes_count_ep(const struct device_node *port,
int port_reg, int reg,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0138/1756] libbpf: Improve log message formatting
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0137/1756] drm: of: Fix drm_of_get_data_lanes_count_ep() return value documentation Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0139/1756] libbpf: Support BTF.ext loading and output in either endianness Greg Kroah-Hartman
` (860 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tony Ambardar, Andrii Nakryiko,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Ambardar <tony.ambardar@gmail.com>
[ Upstream commit e8957c0dde3c945db2403beb3131a5ad84860b5f ]
Fix missing newlines and extraneous terminal spaces in messages.
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/086884b7cbf87e524d584f9bf87f7a580e378b2b.1726475448.git.tony.ambardar@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: e40f61a31688 ("libbpf: Avoid overflow in BTF.ext bounds check")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/btf.c | 6 +++---
tools/lib/bpf/btf_dump.c | 2 +-
tools/lib/bpf/btf_relocate.c | 2 +-
tools/lib/bpf/libbpf.c | 4 ++--
tools/lib/bpf/relo_core.c | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 56935f86a6963..65c31915034cd 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -2942,7 +2942,7 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
/* If no records, return failure now so .BTF.ext won't be used. */
if (!info_left) {
- pr_debug("%s section in .BTF.ext has no records", ext_sec->desc);
+ pr_debug("%s section in .BTF.ext has no records\n", ext_sec->desc);
return -EINVAL;
}
@@ -3030,7 +3030,7 @@ static int btf_ext_parse_hdr(__u8 *data, __u32 data_size)
if (data_size < offsetofend(struct btf_ext_header, hdr_len) ||
data_size < hdr->hdr_len) {
- pr_debug("BTF.ext header not found");
+ pr_debug("BTF.ext header not found\n");
return -EINVAL;
}
@@ -3292,7 +3292,7 @@ int btf__dedup(struct btf *btf, const struct btf_dedup_opts *opts)
d = btf_dedup_new(btf, opts);
if (IS_ERR(d)) {
- pr_debug("btf_dedup_new failed: %ld", PTR_ERR(d));
+ pr_debug("btf_dedup_new failed: %ld\n", PTR_ERR(d));
return libbpf_err(-EINVAL);
}
diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c
index a833d91886f87..0040b7b75d1f4 100644
--- a/tools/lib/bpf/btf_dump.c
+++ b/tools/lib/bpf/btf_dump.c
@@ -1307,7 +1307,7 @@ static void btf_dump_emit_type_decl(struct btf_dump *d, __u32 id,
* chain, restore stack, emit warning, and try to
* proceed nevertheless
*/
- pr_warn("not enough memory for decl stack:%d", err);
+ pr_warn("not enough memory for decl stack: %d\n", err);
d->decl_stack_cnt = stack_start;
return;
}
diff --git a/tools/lib/bpf/btf_relocate.c b/tools/lib/bpf/btf_relocate.c
index 8ef8003480dac..53d1f3541bce6 100644
--- a/tools/lib/bpf/btf_relocate.c
+++ b/tools/lib/bpf/btf_relocate.c
@@ -428,7 +428,7 @@ static int btf_relocate_rewrite_strs(struct btf_relocate *r, __u32 i)
} else {
off = r->str_map[*str_off];
if (!off) {
- pr_warn("string '%s' [offset %u] is not mapped to base BTF",
+ pr_warn("string '%s' [offset %u] is not mapped to base BTF\n",
btf__str_by_offset(r->btf, off), *str_off);
return -ENOENT;
}
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 59ba53f1e77cd..084ae70c3a768 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -12819,7 +12819,7 @@ struct bpf_link *bpf_program__attach_freplace(const struct bpf_program *prog,
}
if (prog->type != BPF_PROG_TYPE_EXT) {
- pr_warn("prog '%s': only BPF_PROG_TYPE_EXT can attach as freplace",
+ pr_warn("prog '%s': only BPF_PROG_TYPE_EXT can attach as freplace\n",
prog->name);
return libbpf_err_ptr(-EINVAL);
}
@@ -13892,7 +13892,7 @@ int bpf_object__open_subskeleton(struct bpf_object_subskeleton *s)
map_type = btf__type_by_id(btf, map_type_id);
if (!btf_is_datasec(map_type)) {
- pr_warn("type for map '%1$s' is not a datasec: %2$s",
+ pr_warn("type for map '%1$s' is not a datasec: %2$s\n",
bpf_map__name(map),
__btf_kind_str(btf_kind(map_type)));
return libbpf_err(-EINVAL);
diff --git a/tools/lib/bpf/relo_core.c b/tools/lib/bpf/relo_core.c
index 4367378d272b3..90135cf307e91 100644
--- a/tools/lib/bpf/relo_core.c
+++ b/tools/lib/bpf/relo_core.c
@@ -1345,7 +1345,7 @@ int bpf_core_calc_relo_insn(const char *prog_name,
cands->cands[i].id, cand_spec);
if (err < 0) {
bpf_core_format_spec(spec_buf, sizeof(spec_buf), cand_spec);
- pr_warn("prog '%s': relo #%d: error matching candidate #%d %s: %d\n ",
+ pr_warn("prog '%s': relo #%d: error matching candidate #%d %s: %d\n",
prog_name, relo_idx, i, spec_buf, err);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0139/1756] libbpf: Support BTF.ext loading and output in either endianness
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0138/1756] libbpf: Improve log message formatting Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0140/1756] libbpf: Avoid overflow in BTF.ext bounds check Greg Kroah-Hartman
` (859 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tony Ambardar, Andrii Nakryiko,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Ambardar <tony.ambardar@gmail.com>
[ Upstream commit cf579164e9ea9cd41c7c1da931683a319d224890 ]
Support for handling BTF data of either endianness was added in [1], but
did not include BTF.ext data for lack of use cases. Later, support for
static linking [2] provided a use case, but this feature and later ones
were restricted to native-endian usage.
Add support for BTF.ext handling in either endianness. Convert BTF.ext data
to native endianness when read into memory for further processing, and
support raw data access that restores the original byte-order for output.
Add internal header functions for byte-swapping func, line, and core info
records.
Add new API functions btf_ext__endianness() and btf_ext__set_endianness()
for query and setting byte-order, as already exist for BTF data.
[1] 3289959b97ca ("libbpf: Support BTF loading and raw data output in both endianness")
[2] 8fd27bf69b86 ("libbpf: Add BPF static linker BTF and BTF.ext support")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/133407ab20e0dd5c07cab2a6fa7879dee1ffa4bc.1726475448.git.tony.ambardar@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: e40f61a31688 ("libbpf: Avoid overflow in BTF.ext bounds check")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/btf.c | 276 +++++++++++++++++++++++++-------
tools/lib/bpf/btf.h | 3 +
tools/lib/bpf/libbpf.map | 2 +
tools/lib/bpf/libbpf_internal.h | 29 ++++
4 files changed, 253 insertions(+), 57 deletions(-)
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 65c31915034cd..8c20395ebfd30 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -2886,7 +2886,7 @@ int btf__add_decl_tag(struct btf *btf, const char *value, int ref_type_id,
return btf_commit_type(btf, sz);
}
-struct btf_ext_sec_setup_param {
+struct btf_ext_sec_info_param {
__u32 off;
__u32 len;
__u32 min_rec_size;
@@ -2894,14 +2894,20 @@ struct btf_ext_sec_setup_param {
const char *desc;
};
-static int btf_ext_setup_info(struct btf_ext *btf_ext,
- struct btf_ext_sec_setup_param *ext_sec)
+/*
+ * Parse a single info subsection of the BTF.ext info data:
+ * - validate subsection structure and elements
+ * - save info subsection start and sizing details in struct btf_ext
+ * - endian-independent operation, for calling before byte-swapping
+ */
+static int btf_ext_parse_sec_info(struct btf_ext *btf_ext,
+ struct btf_ext_sec_info_param *ext_sec,
+ bool is_native)
{
const struct btf_ext_info_sec *sinfo;
struct btf_ext_info *ext_info;
__u32 info_left, record_size;
size_t sec_cnt = 0;
- /* The start of the info sec (including the __u32 record_size). */
void *info;
if (ext_sec->len == 0)
@@ -2913,6 +2919,7 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
return -EINVAL;
}
+ /* The start of the info sec (including the __u32 record_size). */
info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
info_left = ext_sec->len;
@@ -2928,9 +2935,13 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
return -EINVAL;
}
- /* The record size needs to meet the minimum standard */
- record_size = *(__u32 *)info;
+ /* The record size needs to meet either the minimum standard or, when
+ * handling non-native endianness data, the exact standard so as
+ * to allow safe byte-swapping.
+ */
+ record_size = is_native ? *(__u32 *)info : bswap_32(*(__u32 *)info);
if (record_size < ext_sec->min_rec_size ||
+ (!is_native && record_size != ext_sec->min_rec_size) ||
record_size & 0x03) {
pr_debug("%s section in .BTF.ext has invalid record size %u\n",
ext_sec->desc, record_size);
@@ -2957,7 +2968,7 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
return -EINVAL;
}
- num_records = sinfo->num_info;
+ num_records = is_native ? sinfo->num_info : bswap_32(sinfo->num_info);
if (num_records == 0) {
pr_debug("%s section has incorrect num_records in .BTF.ext\n",
ext_sec->desc);
@@ -2985,64 +2996,157 @@ static int btf_ext_setup_info(struct btf_ext *btf_ext,
return 0;
}
-static int btf_ext_setup_func_info(struct btf_ext *btf_ext)
+/* Parse all info secs in the BTF.ext info data */
+static int btf_ext_parse_info(struct btf_ext *btf_ext, bool is_native)
{
- struct btf_ext_sec_setup_param param = {
+ struct btf_ext_sec_info_param func_info = {
.off = btf_ext->hdr->func_info_off,
.len = btf_ext->hdr->func_info_len,
.min_rec_size = sizeof(struct bpf_func_info_min),
.ext_info = &btf_ext->func_info,
.desc = "func_info"
};
-
- return btf_ext_setup_info(btf_ext, ¶m);
-}
-
-static int btf_ext_setup_line_info(struct btf_ext *btf_ext)
-{
- struct btf_ext_sec_setup_param param = {
+ struct btf_ext_sec_info_param line_info = {
.off = btf_ext->hdr->line_info_off,
.len = btf_ext->hdr->line_info_len,
.min_rec_size = sizeof(struct bpf_line_info_min),
.ext_info = &btf_ext->line_info,
.desc = "line_info",
};
-
- return btf_ext_setup_info(btf_ext, ¶m);
-}
-
-static int btf_ext_setup_core_relos(struct btf_ext *btf_ext)
-{
- struct btf_ext_sec_setup_param param = {
+ struct btf_ext_sec_info_param core_relo = {
.off = btf_ext->hdr->core_relo_off,
.len = btf_ext->hdr->core_relo_len,
.min_rec_size = sizeof(struct bpf_core_relo),
.ext_info = &btf_ext->core_relo_info,
.desc = "core_relo",
};
+ int err;
+
+ err = btf_ext_parse_sec_info(btf_ext, &func_info, is_native);
+ if (err)
+ return err;
+
+ err = btf_ext_parse_sec_info(btf_ext, &line_info, is_native);
+ if (err)
+ return err;
+
+ if (btf_ext->hdr->hdr_len < offsetofend(struct btf_ext_header, core_relo_len))
+ return 0; /* skip core relos parsing */
- return btf_ext_setup_info(btf_ext, ¶m);
+ err = btf_ext_parse_sec_info(btf_ext, &core_relo, is_native);
+ if (err)
+ return err;
+
+ return 0;
}
-static int btf_ext_parse_hdr(__u8 *data, __u32 data_size)
+/* Swap byte-order of BTF.ext header with any endianness */
+static void btf_ext_bswap_hdr(struct btf_ext_header *h)
{
- const struct btf_ext_header *hdr = (struct btf_ext_header *)data;
+ bool is_native = h->magic == BTF_MAGIC;
+ __u32 hdr_len;
- if (data_size < offsetofend(struct btf_ext_header, hdr_len) ||
- data_size < hdr->hdr_len) {
- pr_debug("BTF.ext header not found\n");
+ hdr_len = is_native ? h->hdr_len : bswap_32(h->hdr_len);
+
+ h->magic = bswap_16(h->magic);
+ h->hdr_len = bswap_32(h->hdr_len);
+ h->func_info_off = bswap_32(h->func_info_off);
+ h->func_info_len = bswap_32(h->func_info_len);
+ h->line_info_off = bswap_32(h->line_info_off);
+ h->line_info_len = bswap_32(h->line_info_len);
+
+ if (hdr_len < offsetofend(struct btf_ext_header, core_relo_len))
+ return;
+
+ h->core_relo_off = bswap_32(h->core_relo_off);
+ h->core_relo_len = bswap_32(h->core_relo_len);
+}
+
+/* Swap byte-order of generic info subsection */
+static void btf_ext_bswap_info_sec(void *info, __u32 len, bool is_native,
+ info_rec_bswap_fn bswap_fn)
+{
+ struct btf_ext_info_sec *sec;
+ __u32 info_left, rec_size, *rs;
+
+ if (len == 0)
+ return;
+
+ rs = info; /* info record size */
+ rec_size = is_native ? *rs : bswap_32(*rs);
+ *rs = bswap_32(*rs);
+
+ sec = info + sizeof(__u32); /* info sec #1 */
+ info_left = len - sizeof(__u32);
+ while (info_left) {
+ unsigned int sec_hdrlen = sizeof(struct btf_ext_info_sec);
+ __u32 i, num_recs;
+ void *p;
+
+ num_recs = is_native ? sec->num_info : bswap_32(sec->num_info);
+ sec->sec_name_off = bswap_32(sec->sec_name_off);
+ sec->num_info = bswap_32(sec->num_info);
+ p = sec->data; /* info rec #1 */
+ for (i = 0; i < num_recs; i++, p += rec_size)
+ bswap_fn(p);
+ sec = p;
+ info_left -= sec_hdrlen + (__u64)rec_size * num_recs;
+ }
+}
+
+/*
+ * Swap byte-order of all info data in a BTF.ext section
+ * - requires BTF.ext hdr in native endianness
+ */
+static void btf_ext_bswap_info(struct btf_ext *btf_ext, void *data)
+{
+ const bool is_native = btf_ext->swapped_endian;
+ const struct btf_ext_header *h = data;
+ void *info;
+
+ /* Swap func_info subsection byte-order */
+ info = data + h->hdr_len + h->func_info_off;
+ btf_ext_bswap_info_sec(info, h->func_info_len, is_native,
+ (info_rec_bswap_fn)bpf_func_info_bswap);
+
+ /* Swap line_info subsection byte-order */
+ info = data + h->hdr_len + h->line_info_off;
+ btf_ext_bswap_info_sec(info, h->line_info_len, is_native,
+ (info_rec_bswap_fn)bpf_line_info_bswap);
+
+ /* Swap core_relo subsection byte-order (if present) */
+ if (h->hdr_len < offsetofend(struct btf_ext_header, core_relo_len))
+ return;
+
+ info = data + h->hdr_len + h->core_relo_off;
+ btf_ext_bswap_info_sec(info, h->core_relo_len, is_native,
+ (info_rec_bswap_fn)bpf_core_relo_bswap);
+}
+
+/* Parse hdr data and info sections: check and convert to native endianness */
+static int btf_ext_parse(struct btf_ext *btf_ext)
+{
+ __u32 hdr_len, data_size = btf_ext->data_size;
+ struct btf_ext_header *hdr = btf_ext->hdr;
+ bool swapped_endian = false;
+ int err;
+
+ if (data_size < offsetofend(struct btf_ext_header, hdr_len)) {
+ pr_debug("BTF.ext header too short\n");
return -EINVAL;
}
+ hdr_len = hdr->hdr_len;
if (hdr->magic == bswap_16(BTF_MAGIC)) {
- pr_warn("BTF.ext in non-native endianness is not supported\n");
- return -ENOTSUP;
+ swapped_endian = true;
+ hdr_len = bswap_32(hdr_len);
} else if (hdr->magic != BTF_MAGIC) {
pr_debug("Invalid BTF.ext magic:%x\n", hdr->magic);
return -EINVAL;
}
- if (hdr->version != BTF_VERSION) {
+ /* Ensure known version of structs, current BTF_VERSION == 1 */
+ if (hdr->version != 1) {
pr_debug("Unsupported BTF.ext version:%u\n", hdr->version);
return -ENOTSUP;
}
@@ -3052,11 +3156,39 @@ static int btf_ext_parse_hdr(__u8 *data, __u32 data_size)
return -ENOTSUP;
}
- if (data_size == hdr->hdr_len) {
+ if (data_size < hdr_len) {
+ pr_debug("BTF.ext header not found\n");
+ return -EINVAL;
+ } else if (data_size == hdr_len) {
pr_debug("BTF.ext has no data\n");
return -EINVAL;
}
+ /* Verify mandatory hdr info details present */
+ if (hdr_len < offsetofend(struct btf_ext_header, line_info_len)) {
+ pr_warn("BTF.ext header missing func_info, line_info\n");
+ return -EINVAL;
+ }
+
+ /* Keep hdr native byte-order in memory for introspection */
+ if (swapped_endian)
+ btf_ext_bswap_hdr(btf_ext->hdr);
+
+ /* Validate info subsections and cache key metadata */
+ err = btf_ext_parse_info(btf_ext, !swapped_endian);
+ if (err)
+ return err;
+
+ /* Keep infos native byte-order in memory for introspection */
+ if (swapped_endian)
+ btf_ext_bswap_info(btf_ext, btf_ext->data);
+
+ /*
+ * Set btf_ext->swapped_endian only after all header and info data has
+ * been swapped, helping bswap functions determine if their data are
+ * in native byte-order when called.
+ */
+ btf_ext->swapped_endian = swapped_endian;
return 0;
}
@@ -3068,6 +3200,7 @@ void btf_ext__free(struct btf_ext *btf_ext)
free(btf_ext->line_info.sec_idxs);
free(btf_ext->core_relo_info.sec_idxs);
free(btf_ext->data);
+ free(btf_ext->data_swapped);
free(btf_ext);
}
@@ -3088,29 +3221,7 @@ struct btf_ext *btf_ext__new(const __u8 *data, __u32 size)
}
memcpy(btf_ext->data, data, size);
- err = btf_ext_parse_hdr(btf_ext->data, size);
- if (err)
- goto done;
-
- if (btf_ext->hdr->hdr_len < offsetofend(struct btf_ext_header, line_info_len)) {
- err = -EINVAL;
- goto done;
- }
-
- err = btf_ext_setup_func_info(btf_ext);
- if (err)
- goto done;
-
- err = btf_ext_setup_line_info(btf_ext);
- if (err)
- goto done;
-
- if (btf_ext->hdr->hdr_len < offsetofend(struct btf_ext_header, core_relo_len))
- goto done; /* skip core relos parsing */
-
- err = btf_ext_setup_core_relos(btf_ext);
- if (err)
- goto done;
+ err = btf_ext_parse(btf_ext);
done:
if (err) {
@@ -3121,15 +3232,66 @@ struct btf_ext *btf_ext__new(const __u8 *data, __u32 size)
return btf_ext;
}
+static void *btf_ext_raw_data(const struct btf_ext *btf_ext_ro, bool swap_endian)
+{
+ struct btf_ext *btf_ext = (struct btf_ext *)btf_ext_ro;
+ const __u32 data_sz = btf_ext->data_size;
+ void *data;
+
+ /* Return native data (always present) or swapped data if present */
+ if (!swap_endian)
+ return btf_ext->data;
+ else if (btf_ext->data_swapped)
+ return btf_ext->data_swapped;
+
+ /* Recreate missing swapped data, then cache and return */
+ data = calloc(1, data_sz);
+ if (!data)
+ return NULL;
+ memcpy(data, btf_ext->data, data_sz);
+
+ btf_ext_bswap_info(btf_ext, data);
+ btf_ext_bswap_hdr(data);
+ btf_ext->data_swapped = data;
+ return data;
+}
+
const void *btf_ext__raw_data(const struct btf_ext *btf_ext, __u32 *size)
{
+ void *data;
+
+ data = btf_ext_raw_data(btf_ext, btf_ext->swapped_endian);
+ if (!data)
+ return errno = ENOMEM, NULL;
+
*size = btf_ext->data_size;
- return btf_ext->data;
+ return data;
}
__attribute__((alias("btf_ext__raw_data")))
const void *btf_ext__get_raw_data(const struct btf_ext *btf_ext, __u32 *size);
+enum btf_endianness btf_ext__endianness(const struct btf_ext *btf_ext)
+{
+ if (is_host_big_endian())
+ return btf_ext->swapped_endian ? BTF_LITTLE_ENDIAN : BTF_BIG_ENDIAN;
+ else
+ return btf_ext->swapped_endian ? BTF_BIG_ENDIAN : BTF_LITTLE_ENDIAN;
+}
+
+int btf_ext__set_endianness(struct btf_ext *btf_ext, enum btf_endianness endian)
+{
+ if (endian != BTF_LITTLE_ENDIAN && endian != BTF_BIG_ENDIAN)
+ return libbpf_err(-EINVAL);
+
+ btf_ext->swapped_endian = is_host_big_endian() != (endian == BTF_BIG_ENDIAN);
+
+ if (!btf_ext->swapped_endian) {
+ free(btf_ext->data_swapped);
+ btf_ext->data_swapped = NULL;
+ }
+ return 0;
+}
struct btf_dedup;
diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h
index 4e349ad79ee69..47ee8f6ac4896 100644
--- a/tools/lib/bpf/btf.h
+++ b/tools/lib/bpf/btf.h
@@ -167,6 +167,9 @@ LIBBPF_API const char *btf__str_by_offset(const struct btf *btf, __u32 offset);
LIBBPF_API struct btf_ext *btf_ext__new(const __u8 *data, __u32 size);
LIBBPF_API void btf_ext__free(struct btf_ext *btf_ext);
LIBBPF_API const void *btf_ext__raw_data(const struct btf_ext *btf_ext, __u32 *size);
+LIBBPF_API enum btf_endianness btf_ext__endianness(const struct btf_ext *btf_ext);
+LIBBPF_API int btf_ext__set_endianness(struct btf_ext *btf_ext,
+ enum btf_endianness endian);
LIBBPF_API int btf__find_str(struct btf *btf, const char *s);
LIBBPF_API int btf__add_str(struct btf *btf, const char *s);
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
index 0096e483f7eb9..f40ccc2946e74 100644
--- a/tools/lib/bpf/libbpf.map
+++ b/tools/lib/bpf/libbpf.map
@@ -421,6 +421,8 @@ LIBBPF_1.5.0 {
global:
btf__distill_base;
btf__relocate;
+ btf_ext__endianness;
+ btf_ext__set_endianness;
bpf_map__autoattach;
bpf_map__set_autoattach;
bpf_object__token_fd;
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index 408df59e07719..71a2355bba9e7 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -10,6 +10,7 @@
#define __LIBBPF_LIBBPF_INTERNAL_H
#include <stdlib.h>
+#include <byteswap.h>
#include <limits.h>
#include <errno.h>
#include <linux/err.h>
@@ -484,6 +485,8 @@ struct btf_ext {
struct btf_ext_header *hdr;
void *data;
};
+ void *data_swapped;
+ bool swapped_endian;
struct btf_ext_info func_info;
struct btf_ext_info line_info;
struct btf_ext_info core_relo_info;
@@ -511,6 +514,32 @@ struct bpf_line_info_min {
__u32 line_col;
};
+/* Functions to byte-swap info records */
+
+typedef void (*info_rec_bswap_fn)(void *);
+
+static inline void bpf_func_info_bswap(struct bpf_func_info *i)
+{
+ i->insn_off = bswap_32(i->insn_off);
+ i->type_id = bswap_32(i->type_id);
+}
+
+static inline void bpf_line_info_bswap(struct bpf_line_info *i)
+{
+ i->insn_off = bswap_32(i->insn_off);
+ i->file_name_off = bswap_32(i->file_name_off);
+ i->line_off = bswap_32(i->line_off);
+ i->line_col = bswap_32(i->line_col);
+}
+
+static inline void bpf_core_relo_bswap(struct bpf_core_relo *i)
+{
+ i->insn_off = bswap_32(i->insn_off);
+ i->type_id = bswap_32(i->type_id);
+ i->access_str_off = bswap_32(i->access_str_off);
+ i->kind = bswap_32(i->kind);
+}
+
enum btf_field_iter_kind {
BTF_FIELD_ITER_IDS,
BTF_FIELD_ITER_STRS,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0140/1756] libbpf: Avoid overflow in BTF.ext bounds check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0139/1756] libbpf: Support BTF.ext loading and output in either endianness Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0141/1756] selftests/bpf: Allocate a larger timeout for connection Greg Kroah-Hartman
` (858 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Darren Carreras, Andrii Nakryiko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Darren Carreras <carrerasdarren@gmail.com>
[ Upstream commit e40f61a31688898e7cf81e91074a42f805883e4d ]
A malformed BTF.ext subsection length in an ELF input can wrap the
pointer addition used by btf_ext_parse_sec_info() on 32-bit builds. The
wrapped pointer passes the bounds check and parsing then reads beyond the
copied BTF.ext data.
Ensure the header fits in the copied data, then validate the subsection
offset and length with subtraction before forming its pointer.
Fixes: ae4ab4b4117d ("btf: expose API to work with raw btf_ext data")
Closes: https://issues.oss-fuzz.com/issues/477315119
Signed-off-by: Darren Carreras <carrerasdarren@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260813-b4-libbpf-v6-send-20260813-v6-1-56be61c52758@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/btf.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 8c20395ebfd30..9f14ab48eef3e 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -2906,7 +2906,7 @@ static int btf_ext_parse_sec_info(struct btf_ext *btf_ext,
{
const struct btf_ext_info_sec *sinfo;
struct btf_ext_info *ext_info;
- __u32 info_left, record_size;
+ __u32 data_left, info_left, record_size;
size_t sec_cnt = 0;
void *info;
@@ -2919,16 +2919,20 @@ static int btf_ext_parse_sec_info(struct btf_ext *btf_ext,
return -EINVAL;
}
- /* The start of the info sec (including the __u32 record_size). */
- info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
- info_left = ext_sec->len;
+ if (btf_ext->hdr->hdr_len > btf_ext->data_size)
+ return -EINVAL;
- if (btf_ext->data + btf_ext->data_size < info + ext_sec->len) {
+ data_left = btf_ext->data_size - btf_ext->hdr->hdr_len;
+ if (ext_sec->off > data_left || ext_sec->len > data_left - ext_sec->off) {
pr_debug("%s section (off:%u len:%u) is beyond the end of the ELF section .BTF.ext\n",
ext_sec->desc, ext_sec->off, ext_sec->len);
return -EINVAL;
}
+ /* The start of the info sec (including the __u32 record_size). */
+ info = btf_ext->data + btf_ext->hdr->hdr_len + ext_sec->off;
+ info_left = ext_sec->len;
+
/* At least a record size */
if (info_left < sizeof(__u32)) {
pr_debug(".BTF.ext %s record size not found\n", ext_sec->desc);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0141/1756] selftests/bpf: Allocate a larger timeout for connection
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0140/1756] libbpf: Avoid overflow in BTF.ext bounds check Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0142/1756] drm/panthor: Take reqs_lock in soft_reset for clearing pending_reqs Greg Kroah-Hartman
` (857 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexis Lothoré ,
Andrii Nakryiko, Ihor Solodrai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
[ Upstream commit 669e4fa766000ae4137bb02eb22ce75ba78ad32d ]
Some tests, like tc_tunnel or tc_edt, sporadically fail in CI with the
following logs:
(network_helpers.c:309: errno: Operation now in progress) \
Failed to connect to server
send_and_test_data:FAIL:connect to server unexpected error: -115
This is due to SO_RCVTIMEO and SO_SNDTIMEO being set on the client
socket (see settimeo() in client_socket()), allowing connect() to return
an error and to set errno to EINPROGRESS instead of ETIMEDOUT.
Increasing the timeout value for those tests is likely not a good
solution (and it has already been done by commit 2790db208b44
("selftests/bpf: Improve tc_tunnel test reliability")): some tests
expect some data transfer to fail, and so the timeout value would
increase overall test execution duration again (not only the connection,
but any socket operation).
Another solution is to allocate a timeout budget specific to the
connection: we can apply a larger timeout only for connections, and once
the connection is established, set back the timeout configured through
opts->timeout_ms; this would allow connection to succeed under heavy CI
load, while keeping timeout reasonable for the rest of the test traffic.
Create a dedicated connect helper that sets a large timeout for the
connect step, tries to connect, and if successful, finally sets the
timeout value to the one configured by the test.
Fixes: 99126abec5e5 ("bpf: selftests: A few improvements to network_helpers.c")
Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Link: https://lore.kernel.org/bpf/20260818-tc_tunnel_flaky-v7-1-aec161e74ef2@bootlin.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/bpf/network_helpers.c | 46 ++++++++++++++-----
1 file changed, 35 insertions(+), 11 deletions(-)
diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c
index cd92745c4948e..dac8489c7991a 100644
--- a/tools/testing/selftests/bpf/network_helpers.c
+++ b/tools/testing/selftests/bpf/network_helpers.c
@@ -49,6 +49,8 @@
errno = __save; \
})
+#define CONNECT_MIN_TIMEOUT_MS 5000
+
struct ipv4_packet pkt_v4 = {
.eth.h_proto = __bpf_constant_htons(ETH_P_IP),
.iph.ihl = 5,
@@ -291,6 +293,37 @@ int client_socket(int family, int type,
return -1;
}
+static int connect_with_timeout(int fd, const struct sockaddr_storage *addr,
+ socklen_t addrlen, int timeout_ms)
+{
+ int connect_timeout_ms = MAX(timeout_ms, CONNECT_MIN_TIMEOUT_MS);
+
+ /*
+ * Override timeout configuration with a larger value for the
+ * connection
+ */
+ if (settimeo(fd, connect_timeout_ms)) {
+ log_err("Failed to set connect timeout");
+ return -1;
+ }
+
+ if (connect(fd, (const struct sockaddr *)addr, addrlen)) {
+ log_err("Failed to connect");
+ return -1;
+ }
+
+ /*
+ * If the timeout configured by the test is different from the
+ * connect timeout, restore it
+ */
+ if (timeout_ms != connect_timeout_ms && settimeo(fd, timeout_ms)) {
+ log_err("Failed to set timeout for connected socket");
+ return -1;
+ }
+
+ return 0;
+}
+
int connect_to_addr(int type, const struct sockaddr_storage *addr, socklen_t addrlen,
const struct network_helper_opts *opts)
{
@@ -305,8 +338,7 @@ int connect_to_addr(int type, const struct sockaddr_storage *addr, socklen_t add
return -1;
}
- if (connect(fd, (const struct sockaddr *)addr, addrlen)) {
- log_err("Failed to connect to server");
+ if (connect_with_timeout(fd, addr, addrlen, opts->timeout_ms)) {
save_errno_close(fd);
return -1;
}
@@ -376,20 +408,12 @@ int connect_fd_to_fd(int client_fd, int server_fd, int timeout_ms)
struct sockaddr_storage addr;
socklen_t len = sizeof(addr);
- if (settimeo(client_fd, timeout_ms))
- return -1;
-
if (getsockname(server_fd, (struct sockaddr *)&addr, &len)) {
log_err("Failed to get server addr");
return -1;
}
- if (connect(client_fd, (const struct sockaddr *)&addr, len)) {
- log_err("Failed to connect to server");
- return -1;
- }
-
- return 0;
+ return connect_with_timeout(client_fd, &addr, len, timeout_ms);
}
int make_sockaddr(int family, const char *addr_str, __u16 port,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0142/1756] drm/panthor: Take reqs_lock in soft_reset for clearing pending_reqs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0141/1756] selftests/bpf: Allocate a larger timeout for connection Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0143/1756] gpio: pcf857x: use new GPIO line value setter callbacks Greg Kroah-Hartman
` (856 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Boris Brezillon, Nicolas Frattaroli,
Liviu Dudau, Steven Price, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
[ Upstream commit 2d354adc5bbabe2e818be09bbe13f6bfde4a30c7 ]
panthor_gpu_soft_reset() sets pending_reqs to 0 without taking the
requisite reqs_lock.
Fix this by taking the lock for the duration of the modification.
Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260812-panthor-cache-flush-fix-v4-3-751e32901898@collabora.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panthor/panthor_gpu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c
index 15e4371d98945..038f59df38d95 100644
--- a/drivers/gpu/drm/panthor/panthor_gpu.c
+++ b/drivers/gpu/drm/panthor/panthor_gpu.c
@@ -459,7 +459,10 @@ int panthor_gpu_soft_reset(struct panthor_device *ptdev)
return -ETIMEDOUT;
}
- ptdev->gpu->pending_reqs = 0;
+ scoped_guard(spinlock, &ptdev->gpu->reqs_lock) {
+ ptdev->gpu->pending_reqs = 0;
+ }
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0143/1756] gpio: pcf857x: use new GPIO line value setter callbacks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0142/1756] drm/panthor: Take reqs_lock in soft_reset for clearing pending_reqs Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0144/1756] gpio: pcf857x: implement get_direction() Greg Kroah-Hartman
` (855 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
[ Upstream commit 4027438be823abdcfb50ee2abed06fa4e6af4b7c ]
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Link: https://lore.kernel.org/r/20250619-gpiochip-set-rv-gpio-v2-2-74abf689fbd8@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: ed14364ae8c3 ("gpio: pcf857x: implement get_direction()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-pcf857x.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index 7c57eaeb0afeb..2b8863eed1d79 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -169,21 +169,24 @@ static int pcf857x_output(struct gpio_chip *chip, unsigned int offset, int value
return status;
}
-static void pcf857x_set(struct gpio_chip *chip, unsigned int offset, int value)
+static int pcf857x_set(struct gpio_chip *chip, unsigned int offset, int value)
{
- pcf857x_output(chip, offset, value);
+ return pcf857x_output(chip, offset, value);
}
-static void pcf857x_set_multiple(struct gpio_chip *chip, unsigned long *mask,
- unsigned long *bits)
+static int pcf857x_set_multiple(struct gpio_chip *chip, unsigned long *mask,
+ unsigned long *bits)
{
struct pcf857x *gpio = gpiochip_get_data(chip);
+ int status;
mutex_lock(&gpio->lock);
gpio->out &= ~*mask;
gpio->out |= *bits & *mask;
- gpio->write(gpio->client, gpio->out);
+ status = gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
+
+ return status;
}
/*-------------------------------------------------------------------------*/
@@ -291,8 +294,8 @@ static int pcf857x_probe(struct i2c_client *client)
gpio->chip.owner = THIS_MODULE;
gpio->chip.get = pcf857x_get;
gpio->chip.get_multiple = pcf857x_get_multiple;
- gpio->chip.set = pcf857x_set;
- gpio->chip.set_multiple = pcf857x_set_multiple;
+ gpio->chip.set_rv = pcf857x_set;
+ gpio->chip.set_multiple_rv = pcf857x_set_multiple;
gpio->chip.direction_input = pcf857x_input;
gpio->chip.direction_output = pcf857x_output;
gpio->chip.ngpio = (uintptr_t)i2c_get_match_data(client);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0144/1756] gpio: pcf857x: implement get_direction()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0143/1756] gpio: pcf857x: use new GPIO line value setter callbacks Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0145/1756] bpftool: Fix spurious batch file read error Greg Kroah-Hartman
` (854 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tapio Reijonen, Linus Walleij,
Bartosz Golaszewski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tapio Reijonen <tapio.reijonen@vaisala.com>
[ Upstream commit ed14364ae8c310cc3f3f649ffcbc7f82befe1579 ]
The GPIO core warns (and taints the kernel) when a gpiochip lacks
.get_direction() and a consumer queries a line's direction, for example
via /sys/kernel/debug/gpio. pcf857x provided direction_input/output but
no get_direction.
These quasi-bidirectional expanders cannot report direction in hardware,
and the 'out' software latch alone is ambiguous - a released (input)
line and an output driven high both read back as a set bit. Track the
direction explicitly in a 'dir' latch updated by the direction_input(),
direction_output() and set_multiple() paths, and return it from
get_direction(). Initialise it from the same reset state as 'out':
released lines are inputs, lines flagged in the power-on latch are
driven-low outputs.
Fixes: 15fae37d9f5f ("gpiolib: pcf857x i2c gpio expander support")
Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260825-b4-gpio-pcf857x-get-direction-v1-1-de15996ae354@vaisala.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-pcf857x.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index 2b8863eed1d79..02af66e848e88 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -68,8 +68,9 @@ MODULE_DEVICE_TABLE(of, pcf857x_of_table);
struct pcf857x {
struct gpio_chip chip;
struct i2c_client *client;
- struct mutex lock; /* protect 'out' */
+ struct mutex lock; /* protect 'out' and 'dir' */
unsigned int out; /* software latch */
+ unsigned int dir; /* direction latch (1 = input) */
unsigned int status; /* current status */
unsigned int irq_enabled; /* enabled irqs */
@@ -122,12 +123,21 @@ static int pcf857x_input(struct gpio_chip *chip, unsigned int offset)
mutex_lock(&gpio->lock);
gpio->out |= (1 << offset);
+ gpio->dir |= (1 << offset);
status = gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
return status;
}
+static int pcf857x_get_direction(struct gpio_chip *chip, unsigned int offset)
+{
+ struct pcf857x *gpio = gpiochip_get_data(chip);
+
+ return (gpio->dir & (1 << offset)) ? GPIO_LINE_DIRECTION_IN
+ : GPIO_LINE_DIRECTION_OUT;
+}
+
static int pcf857x_get(struct gpio_chip *chip, unsigned int offset)
{
struct pcf857x *gpio = gpiochip_get_data(chip);
@@ -163,6 +173,7 @@ static int pcf857x_output(struct gpio_chip *chip, unsigned int offset, int value
gpio->out |= bit;
else
gpio->out &= ~bit;
+ gpio->dir &= ~bit;
status = gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
@@ -183,6 +194,7 @@ static int pcf857x_set_multiple(struct gpio_chip *chip, unsigned long *mask,
mutex_lock(&gpio->lock);
gpio->out &= ~*mask;
gpio->out |= *bits & *mask;
+ gpio->dir &= ~*mask;
status = gpio->write(gpio->client, gpio->out);
mutex_unlock(&gpio->lock);
@@ -298,6 +310,7 @@ static int pcf857x_probe(struct i2c_client *client)
gpio->chip.set_multiple_rv = pcf857x_set_multiple;
gpio->chip.direction_input = pcf857x_input;
gpio->chip.direction_output = pcf857x_output;
+ gpio->chip.get_direction = pcf857x_get_direction;
gpio->chip.ngpio = (uintptr_t)i2c_get_match_data(client);
/* NOTE: the OnSemi jlc1562b is also largely compatible with
@@ -369,6 +382,7 @@ static int pcf857x_probe(struct i2c_client *client)
* reset state. Otherwise it flags pins to be driven low.
*/
gpio->out = ~n_latch;
+ gpio->dir = ~n_latch;
gpio->status = gpio->read(gpio->client);
/* Enable irqchip if we have an interrupt */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0145/1756] bpftool: Fix spurious batch file read error
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0144/1756] gpio: pcf857x: implement get_direction() Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0146/1756] regulator: fixed: reject incompatible platform devices Greg Kroah-Hartman
` (853 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuan Chen, Andrii Nakryiko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuan Chen <chenyuan_fl@163.com>
[ Upstream commit 713c02b59e21840f623a3e31c43d967026c75181 ]
do_batch() checks errno after the read loop to detect read failures,
but fgets() does not clear errno on success, so a stale errno left by
a previously executed command (e.g. map dump's EBADF from a double
close) makes bpftool report a batch file read failure and exit with an
error even though every command succeeded.
Clear errno before each fgets() call, so the post-loop check only
sees the outcome of the last read: zero on success or EOF, E2BIG for
an overlong line, and a genuine errno when fgets() fails.
Since errno is now reset before every read in batch mode, drop the
USE_LIBCAP errno reset in main() that existed only to keep errno clean
for the batch mode.
Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool")
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260824092657.1789956-2-chenyuan_fl@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/main.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index a0536528dfde2..be60478b4692d 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -354,7 +354,11 @@ static int do_batch(int argc, char **argv)
if (json_output)
jsonw_start_array(json_wtr);
- while (fgets(buf, sizeof(buf), fp)) {
+ for (;;) {
+ errno = 0;
+ if (!fgets(buf, sizeof(buf), fp))
+ break;
+
cp = strchr(buf, '#');
if (cp)
*cp = '\0';
@@ -455,16 +459,6 @@ int main(int argc, char **argv)
setlinebuf(stdout);
-#ifdef USE_LIBCAP
- /* Libcap < 2.63 hooks before main() to compute the number of
- * capabilities of the running kernel, and doing so it calls prctl()
- * which may fail and set errno to non-zero.
- * Let's reset errno to make sure this does not interfere with the
- * batch mode.
- */
- errno = 0;
-#endif
-
last_do_help = do_help;
pretty_output = false;
json_output = false;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0146/1756] regulator: fixed: reject incompatible platform devices
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0145/1756] bpftool: Fix spurious batch file read error Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0147/1756] spi: sh-msiof: SITMDR1/SIRMDR1 bitfield conversion Greg Kroah-Hartman
` (852 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+bfc9e55cf4f98183c636,
Chandradhar Kumar, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandradhar Kumar <chandradhar.2003@gmail.com>
[ Upstream commit f7396c2dbbc1bed6c2c554d1ddf80d16e4780a7d ]
The fixed regulator driver expects non-DT platform devices to provide
their configuration through platform_data as a struct fixed_voltage_config.
An explicitly bound driver can bypass the normal platform device/driver
matching and attach the fixed regulator driver to an unrelated platform
device. This causes the driver's platform_data to be interpreted as a
struct fixed_voltage_config even though it contains data for a different
device.
Reject non-DT platform devices whose name does not match the fixed
regulator driver before accessing their platform data.
Fixes: 4b74ff651249 ("regulator: add support for fixed regulators.")
Reported-by: syzbot+bfc9e55cf4f98183c636@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=bfc9e55cf4f98183c636
Signed-off-by: Chandradhar Kumar <chandradhar.2003@gmail.com>
Link: https://patch.msgid.link/20260822065519.112441-1-chandradhar.2003@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/fixed.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 254c0a8a45559..0f5451532c883 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -29,6 +29,7 @@
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>
#include <linux/clk.h>
+#include <linux/string.h>
/* Default time in millisecond to wait for emergency shutdown */
#define FV_DEF_EMERG_SHUTDWN_TMO 10
@@ -229,6 +230,9 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
enum gpiod_flags gflags;
int ret;
+ if (!pdev->dev.of_node && strcmp(pdev->name, "reg-fixed-voltage"))
+ return -ENODEV;
+
drvdata = devm_kzalloc(&pdev->dev, sizeof(struct fixed_voltage_data),
GFP_KERNEL);
if (!drvdata)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0147/1756] spi: sh-msiof: SITMDR1/SIRMDR1 bitfield conversion
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0146/1756] regulator: fixed: reject incompatible platform devices Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0148/1756] spi: sh-msiof: propagate setup runtime-PM errors Greg Kroah-Hartman
` (851 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert+renesas@glider.be>
[ Upstream commit 6bae252a9452ca8496670230a7821c34450763a2 ]
Convert MSIOF Transmit and Receive Mode Register 1 field accesses to use
the FIELD_PREP() bitfield access macro.
This gets rid of explicit shifts.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/9685c54e752b8ef4256c9b281e9d8292e71d222e.1747401908.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 152867998da9 ("spi: sh-msiof: propagate setup runtime-PM errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sh-msiof.c | 45 ++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 3367c3e18de87..a83416a1d8959 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -7,6 +7,7 @@
* Copyright (C) 2014-2017 Glider bvba
*/
+#include <linux/bitfield.h>
#include <linux/bitmap.h>
#include <linux/clk.h>
#include <linux/completion.h>
@@ -83,20 +84,19 @@ struct sh_msiof_spi_priv {
/* SITMDR1 and SIRMDR1 */
#define SIMDR1_TRMD BIT(31) /* Transfer Mode (1 = Master mode) */
-#define SIMDR1_SYNCMD_MASK GENMASK(29, 28) /* SYNC Mode */
-#define SIMDR1_SYNCMD_SPI (2 << 28) /* Level mode/SPI */
-#define SIMDR1_SYNCMD_LR (3 << 28) /* L/R mode */
-#define SIMDR1_SYNCAC_SHIFT 25 /* Sync Polarity (1 = Active-low) */
-#define SIMDR1_BITLSB_SHIFT 24 /* MSB/LSB First (1 = LSB first) */
-#define SIMDR1_DTDL_SHIFT 20 /* Data Pin Bit Delay for MSIOF_SYNC */
-#define SIMDR1_SYNCDL_SHIFT 16 /* Frame Sync Signal Timing Delay */
-#define SIMDR1_FLD_MASK GENMASK(3, 2) /* Frame Sync Signal Interval (0-3) */
-#define SIMDR1_FLD_SHIFT 2
+#define SIMDR1_SYNCMD GENMASK(29, 28) /* SYNC Mode */
+#define SIMDR1_SYNCMD_SPI 2U /* Level mode/SPI */
+#define SIMDR1_SYNCMD_LR 3U /* L/R mode */
+#define SIMDR1_SYNCAC BIT(25) /* Sync Polarity (1 = Active-low) */
+#define SIMDR1_BITLSB BIT(24) /* MSB/LSB First (1 = LSB first) */
+#define SIMDR1_DTDL GENMASK(22, 20) /* Data Pin Bit Delay for MSIOF_SYNC */
+#define SIMDR1_SYNCDL GENMASK(18, 16) /* Frame Sync Signal Timing Delay */
+#define SIMDR1_FLD GENMASK(3, 2) /* Frame Sync Signal Interval (0-3) */
#define SIMDR1_XXSTP BIT(0) /* Transmission/Reception Stop on FIFO */
/* SITMDR1 */
#define SITMDR1_PCON BIT(30) /* Transfer Signal Connection */
-#define SITMDR1_SYNCCH_MASK GENMASK(27, 26) /* Sync Signal Channel Select */
-#define SITMDR1_SYNCCH_SHIFT 26 /* 0=MSIOF_SYNC, 1=MSIOF_SS1, 2=MSIOF_SS2 */
+#define SITMDR1_SYNCCH GENMASK(27, 26) /* Sync Signal Channel Select */
+ /* 0=MSIOF_SYNC, 1=MSIOF_SS1, 2=MSIOF_SS2 */
/* SITMDR2 and SIRMDR2 */
#define SIMDR2_BITLEN1(i) (((i) - 1) << 24) /* Data Size (8-32 bits) */
@@ -340,8 +340,9 @@ static u32 sh_msiof_spi_get_dtdl_and_syncdl(struct sh_msiof_spi_priv *p)
return 0;
}
- val = sh_msiof_get_delay_bit(p->info->dtdl) << SIMDR1_DTDL_SHIFT;
- val |= sh_msiof_get_delay_bit(p->info->syncdl) << SIMDR1_SYNCDL_SHIFT;
+ val = FIELD_PREP(SIMDR1_DTDL, sh_msiof_get_delay_bit(p->info->dtdl)) |
+ FIELD_PREP(SIMDR1_SYNCDL,
+ sh_msiof_get_delay_bit(p->info->syncdl));
return val;
}
@@ -360,16 +361,18 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, u32 ss,
* 1 0 11 11 0 0
* 1 1 11 11 1 1
*/
- tmp = SIMDR1_SYNCMD_SPI | 1 << SIMDR1_FLD_SHIFT | SIMDR1_XXSTP;
- tmp |= !cs_high << SIMDR1_SYNCAC_SHIFT;
- tmp |= lsb_first << SIMDR1_BITLSB_SHIFT;
+ tmp = FIELD_PREP(SIMDR1_SYNCMD, SIMDR1_SYNCMD_SPI) |
+ FIELD_PREP(SIMDR1_FLD, 1) | SIMDR1_XXSTP |
+ FIELD_PREP(SIMDR1_SYNCAC, !cs_high) |
+ FIELD_PREP(SIMDR1_BITLSB, lsb_first);
tmp |= sh_msiof_spi_get_dtdl_and_syncdl(p);
if (spi_controller_is_target(p->ctlr)) {
sh_msiof_write(p, SITMDR1, tmp | SITMDR1_PCON);
} else {
sh_msiof_write(p, SITMDR1,
tmp | SIMDR1_TRMD | SITMDR1_PCON |
- (ss < MAX_SS ? ss : 0) << SITMDR1_SYNCCH_SHIFT);
+ FIELD_PREP(SITMDR1_SYNCCH,
+ ss < MAX_SS ? ss : 0));
}
if (p->ctlr->flags & SPI_CONTROLLER_MUST_TX) {
/* These bits are reserved if RX needs TX */
@@ -564,12 +567,12 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
return 0;
/* Configure native chip select mode/polarity early */
- clr = SIMDR1_SYNCMD_MASK;
- set = SIMDR1_SYNCMD_SPI;
+ clr = SIMDR1_SYNCMD;
+ set = FIELD_PREP(SIMDR1_SYNCMD, SIMDR1_SYNCMD_SPI);
if (spi->mode & SPI_CS_HIGH)
- clr |= BIT(SIMDR1_SYNCAC_SHIFT);
+ clr |= SIMDR1_SYNCAC;
else
- set |= BIT(SIMDR1_SYNCAC_SHIFT);
+ set |= SIMDR1_SYNCAC;
pm_runtime_get_sync(&p->pdev->dev);
tmp = sh_msiof_read(p, SITMDR1) & ~clr;
sh_msiof_write(p, SITMDR1, tmp | set | SIMDR1_TRMD | SITMDR1_PCON);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0148/1756] spi: sh-msiof: propagate setup runtime-PM errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0147/1756] spi: sh-msiof: SITMDR1/SIRMDR1 bitfield conversion Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0149/1756] iio: humidity: hts221: report available values via read_avail() Greg Kroah-Hartman
` (850 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 152867998da9f331d6235d76aae1c7e1650708a9 ]
sh_msiof_spi_setup() ignores pm_runtime_get_sync() before programming
native chip-select registers and marking the configuration initialized.
Use the checked runtime-PM helper and return failure before register
access.
Fixes: 7ff0b53c4051 ("spi: sh-msiof: Avoid writing to registers from spi_master.setup()")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830140133.24156-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sh-msiof.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index a83416a1d8959..3f82dd88c1b9d 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -558,6 +558,7 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
struct sh_msiof_spi_priv *p =
spi_controller_get_devdata(spi->controller);
u32 clr, set, tmp;
+ int ret;
if (spi_get_csgpiod(spi, 0) || spi_controller_is_target(p->ctlr))
return 0;
@@ -573,7 +574,9 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
clr |= SIMDR1_SYNCAC;
else
set |= SIMDR1_SYNCAC;
- pm_runtime_get_sync(&p->pdev->dev);
+ ret = pm_runtime_resume_and_get(&p->pdev->dev);
+ if (ret < 0)
+ return ret;
tmp = sh_msiof_read(p, SITMDR1) & ~clr;
sh_msiof_write(p, SITMDR1, tmp | set | SIMDR1_TRMD | SITMDR1_PCON);
tmp = sh_msiof_read(p, SIRMDR1) & ~clr;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0149/1756] iio: humidity: hts221: report available values via read_avail()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0148/1756] spi: sh-msiof: propagate setup runtime-PM errors Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0150/1756] dt-bindings: iio: light: ltr501: Sort compatible enum array Greg Kroah-Hartman
` (849 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adi Nata, Andy Shevchenko,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adi Nata <adinata.softwareengineer@gmail.com>
[ Upstream commit 003e99cf33e344a380ba10b3e04ccb862f3d9dc3 ]
Replace the custom oversampling_ratio_available sysfs attributes with
the standard IIO read_avail() callback. This lets the IIO core create
and format *_available attributes and exposes the lists to
in-kernel consumers.
As a consequence, the incorrectly named
in_humidity_oversampling_ratio_available attribute is replaced by the
standard in_humidityrelative_oversampling_ratio_available name for the
IIO_HUMIDITYRELATIVE channel. The temperature oversampling and sampling
frequency available attribute names are unchanged.
Fixes: e4a70e3e7d84 ("iio: humidity: add support to hts221 rh/temp combo device")
Signed-off-by: Adi Nata <adinata.softwareengineer@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/humidity/hts221_core.c | 106 +++++++++++------------------
1 file changed, 40 insertions(+), 66 deletions(-)
diff --git a/drivers/iio/humidity/hts221_core.c b/drivers/iio/humidity/hts221_core.c
index 87627d116eff0..e685107f4b4bf 100644
--- a/drivers/iio/humidity/hts221_core.c
+++ b/drivers/iio/humidity/hts221_core.c
@@ -10,7 +10,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
-#include <linux/iio/sysfs.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/regmap.h>
@@ -49,7 +48,7 @@ struct hts221_odr {
struct hts221_avg {
u8 addr;
u8 mask;
- u16 avg_avl[HTS221_AVG_DEPTH];
+ int avg_avl[HTS221_AVG_DEPTH];
};
static const struct hts221_odr hts221_odr_table[] = {
@@ -58,6 +57,8 @@ static const struct hts221_odr hts221_odr_table[] = {
{ 13, 0x03 }, /* 12.5Hz */
};
+static const int hts221_odr_avail[] = { 1, 7, 13 };
+
static const struct hts221_avg hts221_avg_list[] = {
{
.addr = 0x10,
@@ -97,7 +98,11 @@ static const struct iio_chan_spec hts221_channels[] = {
BIT(IIO_CHAN_INFO_OFFSET) |
BIT(IIO_CHAN_INFO_SCALE) |
BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO),
+ .info_mask_separate_available =
+ BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO),
.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
+ .info_mask_shared_by_all_available =
+ BIT(IIO_CHAN_INFO_SAMP_FREQ),
.scan_index = 0,
.scan_type = {
.sign = 's',
@@ -113,7 +118,11 @@ static const struct iio_chan_spec hts221_channels[] = {
BIT(IIO_CHAN_INFO_OFFSET) |
BIT(IIO_CHAN_INFO_SCALE) |
BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO),
+ .info_mask_separate_available =
+ BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO),
.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
+ .info_mask_shared_by_all_available =
+ BIT(IIO_CHAN_INFO_SAMP_FREQ),
.scan_index = 1,
.scan_type = {
.sign = 's',
@@ -192,53 +201,35 @@ static int hts221_update_avg(struct hts221_hw *hw,
return 0;
}
-static ssize_t hts221_sysfs_sampling_freq(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- int i;
- ssize_t len = 0;
-
- for (i = 0; i < ARRAY_SIZE(hts221_odr_table); i++)
- len += scnprintf(buf + len, PAGE_SIZE - len, "%d ",
- hts221_odr_table[i].hz);
- buf[len - 1] = '\n';
-
- return len;
-}
-
-static ssize_t
-hts221_sysfs_rh_oversampling_avail(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- const struct hts221_avg *avg = &hts221_avg_list[HTS221_SENSOR_H];
- ssize_t len = 0;
- int i;
-
- for (i = 0; i < ARRAY_SIZE(avg->avg_avl); i++)
- len += scnprintf(buf + len, PAGE_SIZE - len, "%d ",
- avg->avg_avl[i]);
- buf[len - 1] = '\n';
-
- return len;
-}
-
-static ssize_t
-hts221_sysfs_temp_oversampling_avail(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static int hts221_read_avail(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan,
+ const int **vals, int *type, int *length,
+ long mask)
{
- const struct hts221_avg *avg = &hts221_avg_list[HTS221_SENSOR_T];
- ssize_t len = 0;
- int i;
-
- for (i = 0; i < ARRAY_SIZE(avg->avg_avl); i++)
- len += scnprintf(buf + len, PAGE_SIZE - len, "%d ",
- avg->avg_avl[i]);
- buf[len - 1] = '\n';
-
- return len;
+ switch (mask) {
+ case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
+ switch (chan->type) {
+ case IIO_HUMIDITYRELATIVE:
+ *vals = hts221_avg_list[HTS221_SENSOR_H].avg_avl;
+ *length = ARRAY_SIZE(hts221_avg_list[HTS221_SENSOR_H].avg_avl);
+ break;
+ case IIO_TEMP:
+ *vals = hts221_avg_list[HTS221_SENSOR_T].avg_avl;
+ *length = ARRAY_SIZE(hts221_avg_list[HTS221_SENSOR_T].avg_avl);
+ break;
+ default:
+ return -EINVAL;
+ }
+ *type = IIO_VAL_INT;
+ return IIO_AVAIL_LIST;
+ case IIO_CHAN_INFO_SAMP_FREQ:
+ *vals = hts221_odr_avail;
+ *type = IIO_VAL_INT;
+ *length = ARRAY_SIZE(hts221_odr_avail);
+ return IIO_AVAIL_LIST;
+ default:
+ return -EINVAL;
+ }
}
int hts221_set_enable(struct hts221_hw *hw, bool enable)
@@ -522,27 +513,10 @@ static int hts221_validate_trigger(struct iio_dev *iio_dev,
return hw->trig == trig ? 0 : -EINVAL;
}
-static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, S_IRUGO,
- hts221_sysfs_rh_oversampling_avail, NULL, 0);
-static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, S_IRUGO,
- hts221_sysfs_temp_oversampling_avail, NULL, 0);
-static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(hts221_sysfs_sampling_freq);
-
-static struct attribute *hts221_attributes[] = {
- &iio_dev_attr_sampling_frequency_available.dev_attr.attr,
- &iio_dev_attr_in_humidity_oversampling_ratio_available.dev_attr.attr,
- &iio_dev_attr_in_temp_oversampling_ratio_available.dev_attr.attr,
- NULL,
-};
-
-static const struct attribute_group hts221_attribute_group = {
- .attrs = hts221_attributes,
-};
-
static const struct iio_info hts221_info = {
- .attrs = &hts221_attribute_group,
.read_raw = hts221_read_raw,
.write_raw = hts221_write_raw,
+ .read_avail = hts221_read_avail,
.validate_trigger = hts221_validate_trigger,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0150/1756] dt-bindings: iio: light: ltr501: Sort compatible enum array
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0149/1756] iio: humidity: hts221: report available values via read_avail() Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0151/1756] dt-bindings: iio: light: ltr501: Add missing ltr303 compatible Greg Kroah-Hartman
` (848 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski,
Kuppuswamy Sathyanarayanan, Esben Haabendal, Andy Shevchenko,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Esben Haabendal <esben@geanix.com>
[ Upstream commit 6c430006fbcb63dc8baee3c3bf356b264ba7f61e ]
Restore alphabetical sorting of the properties.compatible.enum array.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Acked-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Esben Haabendal <esben@geanix.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: 198ed7962e42 ("dt-bindings: iio: light: ltr501: Add missing ltr303 compatible")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml b/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml
index c8074f180a793..480523ca37500 100644
--- a/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml
+++ b/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml
@@ -15,9 +15,9 @@ allOf:
properties:
compatible:
enum:
+ - liteon,ltr301
- liteon,ltr501
- liteon,ltr559
- - liteon,ltr301
reg:
maxItems: 1
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0151/1756] dt-bindings: iio: light: ltr501: Add missing ltr303 compatible
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0150/1756] dt-bindings: iio: light: ltr501: Sort compatible enum array Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0152/1756] iio: temperature: tmp117: fix calibbias cache update on I2C write failure Greg Kroah-Hartman
` (847 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski,
Kuppuswamy Sathyanarayanan, Esben Haabendal, Andy Shevchenko,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Esben Haabendal <esben@geanix.com>
[ Upstream commit 198ed7962e42f1e45b7f48b9abc70aad9e3185f8 ]
When support for ltr303 was back in 2021, the bindings documentation was
not updated accordingly.
Fixes: 7d71d289e1ba ("iio: light: ltr501: Added ltr303 driver support")
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Acked-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Esben Haabendal <esben@geanix.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml b/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml
index 480523ca37500..6234e2eaec2e4 100644
--- a/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml
+++ b/Documentation/devicetree/bindings/iio/light/liteon,ltr501.yaml
@@ -16,6 +16,7 @@ properties:
compatible:
enum:
- liteon,ltr301
+ - liteon,ltr303
- liteon,ltr501
- liteon,ltr559
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0152/1756] iio: temperature: tmp117: fix calibbias cache update on I2C write failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0151/1756] dt-bindings: iio: light: ltr501: Add missing ltr303 compatible Greg Kroah-Hartman
@ 2026-11-18 14:37 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0153/1756] iio: pressure: rohm-bm1390: Fix AVE_NUM initialization Greg Kroah-Hartman
` (846 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Salah Triki, Jonathan Cameron,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salah Triki <salah.triki@gmail.com>
[ Upstream commit 61fff9cebbfdf39bbd04d366882476d1def14047 ]
The calibbias cache (data->calibbias) was updated before the I2C
write to TMP117_REG_TEMP_OFFSET was known to succeed. If the write
failed, the function correctly returned an error, but the driver's
internal cache had already been updated to the new value.
This causes the cache and the actual hardware register to go out of
sync: a subsequent write of the same value would be silently
skipped by the early "if (off == data->calibbias) return 0;" check,
since the cache matches even though the register was never
successfully updated.
Update data->calibbias only after confirming the I2C write
succeeded, so the cache always reflects the actual state of the
device.
Found by code inspection.
Fixes: df041e737a38 ("iio: temperature: add driver support for ti tmp117")
Signed-off-by: Salah Triki <salah.triki@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/temperature/tmp117.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/temperature/tmp117.c b/drivers/iio/temperature/tmp117.c
index 8972083d903a2..ea2d4e0bae871 100644
--- a/drivers/iio/temperature/tmp117.c
+++ b/drivers/iio/temperature/tmp117.c
@@ -95,15 +95,20 @@ static int tmp117_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec
{
struct tmp117_data *data = iio_priv(indio_dev);
s16 off;
+ int ret;
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
off = clamp_t(int, val, S16_MIN, S16_MAX);
if (off == data->calibbias)
return 0;
+
+ ret = i2c_smbus_write_word_swapped(data->client, TMP117_REG_TEMP_OFFSET, off);
+ if (ret)
+ return ret;
+
data->calibbias = off;
- return i2c_smbus_write_word_swapped(data->client,
- TMP117_REG_TEMP_OFFSET, off);
+ return 0;
default:
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0153/1756] iio: pressure: rohm-bm1390: Fix AVE_NUM initialization
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2026-11-18 14:37 ` [PATCH 6.12 0152/1756] iio: temperature: tmp117: fix calibbias cache update on I2C write failure Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0154/1756] ata: pata_parport: Fix use-after-free in new_device_store Greg Kroah-Hartman
` (845 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matti Vaittinen, Jonathan Cameron,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matti Vaittinen <mazziesaccount@gmail.com>
[ Upstream commit 64f4173ad1a7f1b247296c84e624f5095be170c7 ]
The BM1390 tries to initialize the AVE_NUM to 110b at the start-up. The
field location is not taken into account, and value is written unsifted.
This causes the AVE_NUM to be initialized to zero.
Use FIELD_PREP() to shift the intended AVE_NUM value to correct field.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 81ca5979b6ed ("iio: pressure: Support ROHM BU1390")
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/pressure/rohm-bm1390.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/pressure/rohm-bm1390.c b/drivers/iio/pressure/rohm-bm1390.c
index ccaa07a569c9a..8008da21d021a 100644
--- a/drivers/iio/pressure/rohm-bm1390.c
+++ b/drivers/iio/pressure/rohm-bm1390.c
@@ -484,6 +484,7 @@ static const struct iio_info bm1390_info = {
static int bm1390_chip_init(struct bm1390_data *data)
{
+ u8 regval;
int ret;
ret = regmap_write_bits(data->regmap, BM1390_REG_POWER,
@@ -517,8 +518,9 @@ static int bm1390_chip_init(struct bm1390_data *data)
* Default to use IIR filter in "middle" mode. Also the AVE_NUM must
* be fixed when IIR is in use.
*/
+ regval = FIELD_PREP(BM1390_MASK_AVE_NUM, BM1390_IIR_AVE_NUM);
ret = regmap_update_bits(data->regmap, BM1390_REG_MODE_CTRL,
- BM1390_MASK_AVE_NUM, BM1390_IIR_AVE_NUM);
+ BM1390_MASK_AVE_NUM, regval);
if (ret)
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0154/1756] ata: pata_parport: Fix use-after-free in new_device_store
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0153/1756] iio: pressure: rohm-bm1390: Fix AVE_NUM initialization Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0155/1756] ARM: dts: helios4: fix lm75 supply name Greg Kroah-Hartman
` (844 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shuangpeng Bai, Pei Xiao,
Niklas Cassel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pei Xiao <xiaopei01@kylinos.cn>
[ Upstream commit bd46a0b22933fb45f4ff009fa4a3836124df34b3 ]
The function new_device_store() calls driver_find() without any
protection against concurrent driver unregistration. This can lead
to a use-after-free (UAF) when a driver is unloaded (via rmmod)
in parallel with a new device addition via sysfs.
The race window exists because driver_find() returns a pointer to
the driver's private data, but does not increase its reference
count. The caller is responsible for ensuring the driver remains
valid, but new_device_store() did not hold any lock or reference
during the lookup and subsequent use.
Concurrently, pata_parport_unregister_driver() releases the
pi_mutex before calling driver_unregister(), allowing new_device_store
to proceed with a stale pointer after the driver has been freed.
Fix this by expanding the critical section protected by pi_mutex
in both functions:
- In new_device_store(): acquire pi_mutex before calling driver_find(),
and keep it held until all uses of the found driver pointer are
completed.
- In pata_parport_unregister_driver(): hold pi_mutex throughout the
entire unregistration process, including the driver_unregister()
call, so that no concurrent lookup can see a partially removed
driver.
Thread A (new_device_store) | Thread B (pata_parport_unregister_driver)
driver_find("ate") |
| mutex_lock(&pi_mutex)
| idr_remove(&protocols, id)
| mutex_unlock(&pi_mutex)
| driver_unregister(&pr->driver)
| (frees driver_private)
/* continues using stale driv */|
-> UAF! |
Logs:
BUG: KASAN: slab-use-after-free in driver_find+0xd0/0xd4
Read of size 8 at addr ffffff9f970dc690 by task sh/4737
Call trace:
show_stack+0x14/0x1c (C)
dump_stack_lvl+0x70/0x84
print_report+0xf4/0x5a4
kasan_report+0xa0/0xe4
__asan_report_load8_noabort+0x18/0x20
driver_find+0xd0/0xd4
new_device_store+0x140/0x30c [pata_parport]
bus_attr_store+0x5c/0x94
sysfs_kf_write+0x1c4/0x25c
...
Allocated by task 4734:
kasan_save_stack+0x28/0x4c
kasan_save_track+0x1c/0x34
kasan_save_alloc_info+0x3c/0x4c
__kasan_kmalloc+0x98/0xac
__kmalloc_cache_noprof+0x158/0x3cc
bus_add_driver+0x70/0x4d8
driver_register+0xf0/0x3b0
pata_parport_register_driver+0xb8/0x1c4 [pata_parport]
0xffffffc07f5ce014
do_one_initcall+0xb8/0x36c
do_init_module+0x230/0x6d4
...
Freed by task 4737:
kasan_save_stack+0x28/0x4c
kasan_save_track+0x1c/0x34
kasan_save_free_info+0x48/0x8c
__kasan_slab_free+0x5c/0x84
kfree+0x174/0x3e0
driver_release+0x1c/0x7c
kobject_put+0x178/0x47c
driver_find+0x78/0xd4
new_device_store+0x140/0x30c [pata_parport]
bus_attr_store+0x5c/0x94
sysfs_kf_write+0x1c4/0x25c
...
Fixes: 246a1c4c6b7f ("ata: pata_parport: add driver (PARIDE replacement)")
Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
Closes: https://lore.kernel.org/lkml/20260728024015.2014674-1-shuangpeng.kernel@gmail.com/
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://lore.kernel.org/r/77dad1184ebd0e1e7ea541d4207568f8bc5ec01f.1785381141.git.xiaopei01@kylinos.cn
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/pata_parport/pata_parport.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index 22bd3ff6b7ae8..5c6651621dfbe 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -626,8 +626,9 @@ void pata_parport_unregister_driver(struct pi_protocol *pr)
break;
}
idr_remove(&protocols, id);
- mutex_unlock(&pi_mutex);
driver_unregister(&pr->driver);
+ mutex_unlock(&pi_mutex);
+
}
EXPORT_SYMBOL_GPL(pata_parport_unregister_driver);
@@ -654,18 +655,18 @@ static ssize_t new_device_store(const struct bus_type *bus, const char *buf, siz
port_wanted = -1;
}
+ mutex_lock(&pi_mutex);
drv = driver_find(protocol, &pata_parport_bus_type);
if (!drv) {
if (strcmp(protocol, "auto")) {
pr_err("protocol %s not found\n", protocol);
+ mutex_unlock(&pi_mutex);
return -EINVAL;
}
pr_wanted = NULL;
} else {
pr_wanted = container_of(drv, struct pi_protocol, driver);
}
-
- mutex_lock(&pi_mutex);
/* walk all parports */
idr_for_each_entry(&parport_list, parport, port_num) {
if (port_num == port_wanted || port_wanted == -1) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0155/1756] ARM: dts: helios4: fix lm75 supply name
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0154/1756] ata: pata_parport: Fix use-after-free in new_device_store Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0156/1756] ARM: dts: armada-385-clearfog-gtr: fix vmmc property name Greg Kroah-Hartman
` (843 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit ef473a83c63e3173ac472e42727e990b923b99db ]
The lm75 driver requests a regulator named "vs" (the +VS power pin
of the chip). The Helios4 DTS incorrectly used vcc-supply instead
of vs-supply, causing the regulator core to emit:
lm75 0-004c: supply vs not found, using dummy regulator
Fix the property name to match the binding and the driver.
Fixes: ced8025b569e ("ARM: dts: armada388-helios4")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/marvell/armada-388-helios4.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/marvell/armada-388-helios4.dts b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
index 003b0708e9656..f5ae4bea1211f 100644
--- a/arch/arm/boot/dts/marvell/armada-388-helios4.dts
+++ b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
@@ -200,7 +200,7 @@ usb3-ilimit-hog {
temp_sensor: temp@4c {
compatible = "ti,lm75";
reg = <0x4c>;
- vcc-supply = <®_3p3v>;
+ vs-supply = <®_3p3v>;
};
eeprom@53 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0156/1756] ARM: dts: armada-385-clearfog-gtr: fix vmmc property name
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0155/1756] ARM: dts: helios4: fix lm75 supply name Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0157/1756] ARM: dts: armada-395-gp: drop unsupported SDHCI clock-frequency Greg Kroah-Hartman
` (842 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 337d10963f601d5a3dfb4b7aa273ca8c0b4d5172 ]
The SDHCI node references the 3.3V regulator through a bare "vmmc"
property, which is not part of the mmc controller DT binding; the
correct property is "vmmc-supply".
Fixes: aecc313490ae ("ARM: dts: mvebu: add support for SolidRun Clearfog GTR")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi
index 8208c6a9627a8..4b4a1af514bcf 100644
--- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi
+++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr.dtsi
@@ -235,7 +235,7 @@ sdhci@d8000 {
pinctrl-0 = <&cf_gtr_sdhci_pins>;
pinctrl-names = "default";
status = "okay";
- vmmc = <®_3p3v>;
+ vmmc-supply = <®_3p3v>;
wp-inverted;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0157/1756] ARM: dts: armada-395-gp: drop unsupported SDHCI clock-frequency
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (155 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0156/1756] ARM: dts: armada-385-clearfog-gtr: fix vmmc property name Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0158/1756] ARM: dts: armada-388-helios4: fix vmmc property name Greg Kroah-Hartman
` (841 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit a56183c7f15215d804290808a2b5a1fa997aa9cd ]
The SDHCI node carries a "clock-frequency" property, but the
marvell,armada-380-sdhci binding does not define it and dtbs_check
rejects the node as a result. No driver consumes it either: only a
few other sdhci-pltfm based drivers (imx, mcf, iproc, arasan,
dwcmshc, xenon) read that property, while sdhci-pxav3 derives the
maximum clock from the io clock rate.
Remove the property.
Fixes: 356645123581 ("ARM: dts: mvebu: armada-395-gp: add support for the Armada 395 GP Board")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/marvell/armada-395-gp.dts | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/boot/dts/marvell/armada-395-gp.dts b/arch/arm/boot/dts/marvell/armada-395-gp.dts
index 6dd9e9077f842..9ea447cd35a85 100644
--- a/arch/arm/boot/dts/marvell/armada-395-gp.dts
+++ b/arch/arm/boot/dts/marvell/armada-395-gp.dts
@@ -59,7 +59,6 @@ sata@a8000 {
/* CON18 */
sdhci@d8000 {
- clock-frequency = <200000000>;
broken-cd;
wp-inverted;
bus-width = <8>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0158/1756] ARM: dts: armada-388-helios4: fix vmmc property name
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (156 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0157/1756] ARM: dts: armada-395-gp: drop unsupported SDHCI clock-frequency Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0159/1756] ARM: dts: helios4: fix vbus-supply for USB2 PHY Greg Kroah-Hartman
` (840 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 008e9faadef8c0aaa9b8a3ff05a2126e3c5b08b7 ]
The sdhci@d8000 node references the 3.3V regulator through a bare
"vmmc" property, which is not part of the mmc controller DT
binding. The binding requires supply properties in the form
"vmmc-supply", so the current entry is ignored by the driver.
Rename the property to "vmmc-supply" so the fixed regulator is
correctly wired up as the card power supply.
Fixes: ced8025b569e ("ARM: dts: armada388-helios4")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/marvell/armada-388-helios4.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/marvell/armada-388-helios4.dts b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
index f5ae4bea1211f..0545452a983fc 100644
--- a/arch/arm/boot/dts/marvell/armada-388-helios4.dts
+++ b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
@@ -269,7 +269,7 @@ sdhci@d8000 {
&helios_sdhci_cd_pins>;
pinctrl-names = "default";
status = "okay";
- vmmc = <®_3p3v>;
+ vmmc-supply = <®_3p3v>;
wp-inverted;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0159/1756] ARM: dts: helios4: fix vbus-supply for USB2 PHY
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (157 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0158/1756] ARM: dts: armada-388-helios4: fix vmmc property name Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0160/1756] ARM: dts: helios4: fix spi1 location Greg Kroah-Hartman
` (839 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit a132798a133e76a7bb575ba95b2b64eadd245438 ]
The usb-nop-xceiv binding and driver use "vbus-supply"; the driver
acquires the VBUS regulator via devm_regulator_get_exclusive("vbus")
(phy-generic.c). The stale "vbus-regulator" name is never read by
the driver and dtbs_check rejects it as an unknown property. Rename
the property so reg_5p0v_usb is honored.
Fixes: ced8025b569e ("ARM: dts: armada388-helios4")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/marvell/armada-388-helios4.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/marvell/armada-388-helios4.dts b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
index 0545452a983fc..1ed6ddf1719a7 100644
--- a/arch/arm/boot/dts/marvell/armada-388-helios4.dts
+++ b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
@@ -140,7 +140,7 @@ fan2: j17-pwm {
usb2_phy: usb2-phy {
compatible = "usb-nop-xceiv";
- vbus-regulator = <®_5p0v_usb>;
+ vbus-supply = <®_5p0v_usb>;
};
usb3_phy: usb3-phy {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0160/1756] ARM: dts: helios4: fix spi1 location
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (158 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0159/1756] ARM: dts: helios4: fix vbus-supply for USB2 PHY Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0161/1756] kexec_file: stop the top-down search before it underflows Greg Kroah-Hartman
` (838 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 5df4320a30a87f9bb918ace7b389026917c8d896 ]
This spi node is specified in armada-38x.dtsi with proper compatible
strings whereas they are not present here. Instead of copy and pasting
various lines, just reference the node in the dtsi.
This dts seems to predate the move of spi from internal-regs to the soc
node so this moves it in line there.
Allows proper probing of SPI at runtime.
Remove the microsom_spi1_cs_pins pinctrl group and its reference in
&spi1. The group only muxed mpp59 to the "spi1" function, but that
pin (SPI1 cs0) is already covered by spi1_pins, which selects the
same function for mpp56-59 in armada-38x.dtsi.
Fixes: ced8025b569e ("ARM: dts: armada388-helios4")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../arm/boot/dts/marvell/armada-388-helios4.dts | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/arm/boot/dts/marvell/armada-388-helios4.dts b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
index 1ed6ddf1719a7..33e30528bc7ca 100644
--- a/arch/arm/boot/dts/marvell/armada-388-helios4.dts
+++ b/arch/arm/boot/dts/marvell/armada-388-helios4.dts
@@ -254,13 +254,6 @@ sata3: sata-port@1 {
};
};
- spi@10680 {
- pinctrl-0 = <&spi1_pins
- µsom_spi1_cs_pins>;
- pinctrl-names = "default";
- status = "okay";
- };
-
sdhci@d8000 {
bus-width = <4>;
cd-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
@@ -327,11 +320,13 @@ helios_fan2_pins: helios_fan2_pins {
marvell,pins = "mpp48", "mpp55";
marvell,function = "gpio";
};
- microsom_spi1_cs_pins: spi1-cs-pins {
- marvell,pins = "mpp59";
- marvell,function = "spi1";
- };
};
};
};
};
+
+&spi1 {
+ pinctrl-0 = <&spi1_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0161/1756] kexec_file: stop the top-down search before it underflows
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (159 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0160/1756] ARM: dts: helios4: fix spi1 location Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0162/1756] perf jitdump: Fix extended header read that always fails Greg Kroah-Hartman
` (837 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Bradley Morgan,
Mike Rapoport (Microsoft), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
[ Upstream commit c711461303af9f796b293b5ac06f49a885e46e71 ]
locate_mem_hole_top_down() walks candidates downwards by subtracting
PAGE_SIZE whenever the window conflicts with an existing segment or with
an architecture exclude range.
Nothing stops that subtraction at zero, so a search that reaches the
bottom of the address space wraps temp_start around and continues.
The walk starts inside the range being scanned and only moves down, so
bail out once a candidate ends up above end. That covers every step in
the loop rather than the subtractions alone, and it matches
locate_mem_hole_bottom_up(), which already bounds its candidate on both
sides.
This is a better check than subtracting with check_sub_overflow(), given
that we would have 3 subtractions in this block, and this single fix
would take care of them all (instead of three check_sub_overflow()).
Fixes: cb1052581e2b ("kexec: implementation of new syscall kexec_file_load")
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Bradley Morgan <include@grrlz.net>
Link: https://patch.msgid.link/20260812-kexec_posioned-v6-1-e477887086f0@debian.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kexec_file.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 909432e804be1..cd9b5b9d0c787 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -474,7 +474,9 @@ static int locate_mem_hole_top_down(unsigned long start, unsigned long end,
/* align down start */
temp_start = ALIGN_DOWN(temp_start, kbuf->buf_align);
- if (temp_start < start || temp_start < kbuf->buf_min)
+ /* A candidate above the range means the walk wrapped around */
+ if (temp_start < start || temp_start < kbuf->buf_min ||
+ temp_start > end)
return 0;
temp_end = temp_start + kbuf->memsz - 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0162/1756] perf jitdump: Fix extended header read that always fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (160 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0161/1756] kexec_file: stop the top-down search before it underflows Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0163/1756] perf jitdump: Fix debug_data and unwinding_data leaks Greg Kroah-Hartman
` (836 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Namhyung Kim, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 598e905931380f0714d5fd50cecfac615a1ec742 ]
jit_open() sets bsz = bs before the fread() that uses bs - bsz as the
read size, making the expression always evaluate to zero. fread() with
size 0 returns 0, which triggers the ret != 1 error path — so extended
jitdump headers (total_size > sizeof(header)) have been silently broken
since the original implementation.
Additionally, when 0 < bs <= bsz the if (bs > bsz) block is skipped
entirely, leaving extended header bytes unread in the stream. Subsequent
jit_get_next_entry() calls then parse those leftover bytes as a
jr_prefix, corrupting the record stream.
Fix by separating the buffer growth from the read: realloc only when
bs > bsz, then unconditionally fread bs bytes when bs > 0.
Fixes: 9b07e27f88b9cd78 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 346513e5e9b7a..0cb6705ab40d8 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -223,10 +223,12 @@ jit_open(struct jit_buf_desc *jd, const char *name)
n = realloc(buf, bs);
if (!n)
goto error;
- bsz = bs;
buf = n;
- /* read extra we do not know about */
- ret = fread(buf, bs - bsz, 1, jd->in);
+ bsz = bs;
+ }
+ if (bs > 0) {
+ /* consume extended header bytes from the stream */
+ ret = fread(buf, bs, 1, jd->in);
if (ret != 1)
goto error;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0163/1756] perf jitdump: Fix debug_data and unwinding_data leaks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (161 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0162/1756] perf jitdump: Fix extended header read that always fails Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0164/1756] perf jitdump: Validate code_size against total_size in code load Greg Kroah-Hartman
` (835 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 2bd967f3adcba1d3e54f10b0d8b25f950e4f03fd ]
jit_repipe_debug_info() overwrites jd->debug_data without freeing the
previous allocation. If two consecutive JIT_CODE_DEBUG_INFO records
appear without an intervening LOAD record consuming the data, the first
allocation leaks.
The sibling jit_repipe_unwinding_info() already frees the old
jd->unwinding_data before reassignment — add the same pattern to
jit_repipe_debug_info() using zfree().
Also add cleanup of both buffers in jit_close() so they are freed when
the jitdump session ends, even if no LOAD record consumed them.
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 0cb6705ab40d8..d6583cc32d635 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -116,6 +116,8 @@ jit_close(struct jit_buf_desc *jd)
funlockfile(jd->in);
fclose(jd->in);
jd->in = NULL;
+ zfree(&jd->debug_data);
+ zfree(&jd->unwinding_data);
}
static int
@@ -646,6 +648,7 @@ static int jit_repipe_debug_info(struct jit_buf_desc *jd, union jr_entry *jr)
memcpy(data, &jr->info.entries, sz);
+ zfree(&jd->debug_data);
jd->debug_data = data;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0164/1756] perf jitdump: Validate code_size against total_size in code load
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (162 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0163/1756] perf jitdump: Fix debug_data and unwinding_data leaks Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0165/1756] perf jitdump: Prevent integer underflow in debug info size calculation Greg Kroah-Hartman
` (834 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 06c7cf7a072fcd52e68471628c56630d2bdcc650 ]
jit_repipe_code_load() reads code_size from the jitdump record and uses
it to compute a pointer to the code blob:
code = (unsigned long)jr + jr->load.p.total_size - csize;
An oversized code_size underflows the pointer arithmetic, causing OOB
reads into earlier heap memory. Validate that code_size fits within the
record (total_size - sizeof(jr->load)) before the pointer computation.
code_size is uint64_t but csize is int; values above INT_MAX wrap
negative when narrowed into csize, which defeats the bounds check and
sends the code pointer past the end of the record. Reject those too.
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index d6583cc32d635..de7dd4db33db8 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -9,6 +9,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <inttypes.h>
+#include <limits.h>
#include <byteswap.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -450,6 +451,16 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
csize = jr->load.code_size;
usize = jd->unwinding_mapped_size;
addr = jr->load.code_addr;
+
+ /* code blob lives at the end of the record, validate it fits */
+ if (jr->load.p.total_size < sizeof(jr->load) ||
+ jr->load.code_size > jr->load.p.total_size - sizeof(jr->load) ||
+ jr->load.code_size > INT_MAX) {
+ pr_warning("jitdump: invalid code_size %" PRIu64 " (total_size=%u) in code_load record\n",
+ (uint64_t)jr->load.code_size, jr->load.p.total_size);
+ return -1;
+ }
+
sym = (void *)((unsigned long)jr + sizeof(jr->load));
code = (unsigned long)jr + jr->load.p.total_size - csize;
count = jr->load.code_index;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0165/1756] perf jitdump: Prevent integer underflow in debug info size calculation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (163 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0164/1756] perf jitdump: Validate code_size against total_size in code load Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0166/1756] perf jitdump: Bounds-check debug entry byte-swap loop Greg Kroah-Hartman
` (833 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Stefano Sanfilippo, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit dfe8fe96efca3c32979dc0859f88e15b677d25f1 ]
jit_repipe_debug_info() and jit_repipe_unwinding_info() compute payload
sizes by subtracting the fixed header size from total_size:
sz = jr->prefix.total_size - sizeof(jr->info);
When total_size is smaller than the header struct (from a truncated or
corrupted jitdump record), the subtraction underflows to a massive
value, causing an oversized allocation followed by an OOB memcpy.
Validate that total_size covers at least the fixed header before the
subtraction in both functions.
Fixes: 598b7c6919c7 ("perf jit: add source line info support")
Fixes: 0284fecd13b6 ("perf jit: Add unwinding support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Stefano Sanfilippo <ssanfilippo@chromium.org>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index de7dd4db33db8..96e728b49af5a 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -652,6 +652,10 @@ static int jit_repipe_debug_info(struct jit_buf_desc *jd, union jr_entry *jr)
if (!(jd && jr))
return -1;
+ /* total_size must cover at least the fixed header */
+ if (jr->prefix.total_size < sizeof(jr->info))
+ return -1;
+
sz = jr->prefix.total_size - sizeof(jr->info);
data = malloc(sz);
if (!data)
@@ -680,6 +684,10 @@ jit_repipe_unwinding_info(struct jit_buf_desc *jd, union jr_entry *jr)
if (!(jd && jr))
return -1;
+ /* total_size must cover at least the fixed header */
+ if (jr->prefix.total_size < sizeof(jr->unwinding))
+ return -1;
+
unwinding_data_size = jr->prefix.total_size - sizeof(jr->unwinding);
unwinding_data = malloc(unwinding_data_size);
if (!unwinding_data)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0166/1756] perf jitdump: Bounds-check debug entry byte-swap loop
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (164 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0165/1756] perf jitdump: Prevent integer underflow in debug info size calculation Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0167/1756] perf jitdump: Check snprintf return before computing header size Greg Kroah-Hartman
` (832 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit ede3cd8151675c2983cd49104b1e9b25a3712ed8 ]
The byte-swap loop for JIT_CODE_DEBUG_INFO uses array indexing
(jr->info.entries[n]) to iterate debug entries. struct debug_entry has
a flexible array member name[], so each entry has a different size.
Array indexing computes offsets assuming fixed-size elements, landing
inside variable-length name strings after the first entry and
byte-swapping garbage.
Additionally, nr_entry is read from untrusted jitdump input without
validation against total_size, so a crafted value causes OOB reads.
Replace the array indexing with debug_entry_next() pointer arithmetic
(which correctly accounts for the variable-length name) and
bounds-check each entry against the record's total_size before
byte-swapping.
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 96e728b49af5a..800a888081e60 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -318,14 +318,32 @@ jit_get_next_entry(struct jit_buf_desc *jd)
switch(id) {
case JIT_CODE_DEBUG_INFO:
if (jd->needs_bswap) {
+ void *end = (void *)jr + jr->prefix.total_size;
+ struct debug_entry *ent;
uint64_t n;
+
jr->info.code_addr = bswap_64(jr->info.code_addr);
jr->info.nr_entry = bswap_64(jr->info.nr_entry);
- for (n = 0 ; n < jr->info.nr_entry; n++) {
- jr->info.entries[n].addr = bswap_64(jr->info.entries[n].addr);
- jr->info.entries[n].lineno = bswap_32(jr->info.entries[n].lineno);
- jr->info.entries[n].discrim = bswap_32(jr->info.entries[n].discrim);
+
+ /*
+ * debug_entry has a variable-length name[], so array
+ * indexing would compute wrong offsets — use
+ * debug_entry_next() and bounds-check each entry.
+ */
+ ent = &jr->info.entries[0];
+ for (n = 0; n < jr->info.nr_entry; n++) {
+ if ((void *)ent + sizeof(*ent) > end)
+ break;
+ /* name must be NUL-terminated within the record */
+ if (!memchr(ent->name, '\0', (char *)end - ent->name))
+ break;
+ ent->addr = bswap_64(ent->addr);
+ ent->lineno = bswap_32(ent->lineno);
+ ent->discrim = bswap_32(ent->discrim);
+ ent = debug_entry_next(ent);
}
+ /* clamp so downstream consumers don't overrun */
+ jr->info.nr_entry = n;
}
break;
case JIT_CODE_UNWINDING_INFO:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0167/1756] perf jitdump: Check snprintf return before computing header size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (165 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0166/1756] perf jitdump: Bounds-check debug entry byte-swap loop Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0168/1756] perf jitdump: Fix funlockfile on unlocked stream in jit_open() error path Greg Kroah-Hartman
` (831 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 0155f05ea6e133c18a04b8b5945cac59870da156 ]
snprintf() returns the would-have-been length on truncation. When the
jitted filename exceeds PATH_MAX, the unclamped 'size' value inflates
sizeof(event->mmap2.filename) - size into a massive underflow, causing
the header.size computation to write an oversized header. The
subsequent write to 'id = event + header.size - idr_size' then corrupts
the heap.
Clamp size to PATH_MAX - 1 after snprintf in both jit_repipe_code_load()
and jit_repipe_code_move().
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 800a888081e60..128f9dad78987 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -493,6 +493,9 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
jd->dir,
nspid,
count);
+ /* snprintf returns would-be length on truncation, clamp to buffer */
+ if (size >= sizeof(event->mmap2.filename))
+ size = sizeof(event->mmap2.filename) - 1;
size++; /* for \0 */
@@ -607,6 +610,9 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
jd->dir,
nspid,
jr->move.code_index);
+ /* snprintf returns would-be length on truncation, clamp to buffer */
+ if (size >= sizeof(event->mmap2.filename))
+ size = sizeof(event->mmap2.filename) - 1;
size++; /* for \0 */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0168/1756] perf jitdump: Fix funlockfile on unlocked stream in jit_open() error path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (166 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0167/1756] perf jitdump: Check snprintf return before computing header size Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0169/1756] perf python: Constify variables and parameters Greg Kroah-Hartman
` (830 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit bfde6848c1e24fd979d0138c57c1cc28c35093c3 ]
If the malloc() for the initial read buffer fails, jit_open() jumps to
the error label which calls funlockfile(jd->in). However, flockfile()
is called later in the function, so at this point the stream was never
locked. Calling funlockfile() on an unlocked stream is undefined
behavior per POSIX.
Split the error path into two labels: 'error' (after flockfile) calls
funlockfile before cleanup, 'error_noflock' (before flockfile) skips
the unlock.
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 128f9dad78987..4b329536c0c0c 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -156,7 +156,7 @@ jit_open(struct jit_buf_desc *jd, const char *name)
buf = malloc(bsz);
if (!buf)
- goto error;
+ goto error_noflock;
/*
* protect from writer modifying the file while we are reading it
@@ -244,8 +244,9 @@ jit_open(struct jit_buf_desc *jd, const char *name)
return 0;
error:
- free(buf);
funlockfile(jd->in);
+error_noflock:
+ free(buf);
fclose(jd->in);
return retval;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0169/1756] perf python: Constify variables and parameters
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (167 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0168/1756] perf jitdump: Fix funlockfile on unlocked stream in jit_open() error path Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0170/1756] perf sample: Make user_regs and intr_regs optional Greg Kroah-Hartman
` (829 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Adrian Hunter, Alexander Shishkin, Andi Kleen, Athira Rajeev,
Colin Ian King, Dapeng Mi, Howard Chu, Ilya Leoshkevich,
Ingo Molnar, James Clark, Jiri Olsa, Josh Poimboeuf, Kan Liang,
Mark Rutland, Michael Petlan, Namhyung Kim, Peter Zijlstra,
Thomas Richter, Veronika Molnarova, Weilin Wang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit b8816289ab390f63c7bfeb9a369defa732114f0e ]
Opportunistically constify variables and parameters when possible.
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Veronika Molnarova <vmolnaro@redhat.com>
Cc: Weilin Wang <weilin.wang@intel.com>
Link: https://lore.kernel.org/r/20241119011644.971342-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 7fc5851aac60 ("perf jitdump: Free event in jit_repipe_code_move()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/python.c | 55 +++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 6614c2303bb97..a8d96583ecf1c 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -63,7 +63,7 @@ struct pyrf_event {
sample_member_def(sample_period, period, T_ULONGLONG, "event period"), \
sample_member_def(sample_cpu, cpu, T_UINT, "event cpu"),
-static char pyrf_mmap_event__doc[] = PyDoc_STR("perf mmap event object.");
+static const char pyrf_mmap_event__doc[] = PyDoc_STR("perf mmap event object.");
static PyMemberDef pyrf_mmap_event__members[] = {
sample_members
@@ -78,7 +78,7 @@ static PyMemberDef pyrf_mmap_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_mmap_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_mmap_event__repr(const struct pyrf_event *pevent)
{
PyObject *ret;
char *s;
@@ -107,7 +107,7 @@ static PyTypeObject pyrf_mmap_event__type = {
.tp_repr = (reprfunc)pyrf_mmap_event__repr,
};
-static char pyrf_task_event__doc[] = PyDoc_STR("perf task (fork/exit) event object.");
+static const char pyrf_task_event__doc[] = PyDoc_STR("perf task (fork/exit) event object.");
static PyMemberDef pyrf_task_event__members[] = {
sample_members
@@ -120,7 +120,7 @@ static PyMemberDef pyrf_task_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_task_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_task_event__repr(const struct pyrf_event *pevent)
{
return PyUnicode_FromFormat("{ type: %s, pid: %u, ppid: %u, tid: %u, "
"ptid: %u, time: %" PRI_lu64 "}",
@@ -142,7 +142,7 @@ static PyTypeObject pyrf_task_event__type = {
.tp_repr = (reprfunc)pyrf_task_event__repr,
};
-static char pyrf_comm_event__doc[] = PyDoc_STR("perf comm event object.");
+static const char pyrf_comm_event__doc[] = PyDoc_STR("perf comm event object.");
static PyMemberDef pyrf_comm_event__members[] = {
sample_members
@@ -153,7 +153,7 @@ static PyMemberDef pyrf_comm_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_comm_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_comm_event__repr(const struct pyrf_event *pevent)
{
return PyUnicode_FromFormat("{ type: comm, pid: %u, tid: %u, comm: %s }",
pevent->event.comm.pid,
@@ -171,7 +171,7 @@ static PyTypeObject pyrf_comm_event__type = {
.tp_repr = (reprfunc)pyrf_comm_event__repr,
};
-static char pyrf_throttle_event__doc[] = PyDoc_STR("perf throttle event object.");
+static const char pyrf_throttle_event__doc[] = PyDoc_STR("perf throttle event object.");
static PyMemberDef pyrf_throttle_event__members[] = {
sample_members
@@ -182,9 +182,10 @@ static PyMemberDef pyrf_throttle_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_throttle_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_throttle_event__repr(const struct pyrf_event *pevent)
{
- struct perf_record_throttle *te = (struct perf_record_throttle *)(&pevent->event.header + 1);
+ const struct perf_record_throttle *te = (const struct perf_record_throttle *)
+ (&pevent->event.header + 1);
return PyUnicode_FromFormat("{ type: %sthrottle, time: %" PRI_lu64 ", id: %" PRI_lu64
", stream_id: %" PRI_lu64 " }",
@@ -202,7 +203,7 @@ static PyTypeObject pyrf_throttle_event__type = {
.tp_repr = (reprfunc)pyrf_throttle_event__repr,
};
-static char pyrf_lost_event__doc[] = PyDoc_STR("perf lost event object.");
+static const char pyrf_lost_event__doc[] = PyDoc_STR("perf lost event object.");
static PyMemberDef pyrf_lost_event__members[] = {
sample_members
@@ -211,7 +212,7 @@ static PyMemberDef pyrf_lost_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_lost_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_lost_event__repr(const struct pyrf_event *pevent)
{
PyObject *ret;
char *s;
@@ -237,7 +238,7 @@ static PyTypeObject pyrf_lost_event__type = {
.tp_repr = (reprfunc)pyrf_lost_event__repr,
};
-static char pyrf_read_event__doc[] = PyDoc_STR("perf read event object.");
+static const char pyrf_read_event__doc[] = PyDoc_STR("perf read event object.");
static PyMemberDef pyrf_read_event__members[] = {
sample_members
@@ -246,7 +247,7 @@ static PyMemberDef pyrf_read_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_read_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_read_event__repr(const struct pyrf_event *pevent)
{
return PyUnicode_FromFormat("{ type: read, pid: %u, tid: %u }",
pevent->event.read.pid,
@@ -267,7 +268,7 @@ static PyTypeObject pyrf_read_event__type = {
.tp_repr = (reprfunc)pyrf_read_event__repr,
};
-static char pyrf_sample_event__doc[] = PyDoc_STR("perf sample event object.");
+static const char pyrf_sample_event__doc[] = PyDoc_STR("perf sample event object.");
static PyMemberDef pyrf_sample_event__members[] = {
sample_members
@@ -275,7 +276,7 @@ static PyMemberDef pyrf_sample_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_sample_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_sample_event__repr(const struct pyrf_event *pevent)
{
PyObject *ret;
char *s;
@@ -290,13 +291,13 @@ static PyObject *pyrf_sample_event__repr(struct pyrf_event *pevent)
}
#ifdef HAVE_LIBTRACEEVENT
-static bool is_tracepoint(struct pyrf_event *pevent)
+static bool is_tracepoint(const struct pyrf_event *pevent)
{
return pevent->evsel->core.attr.type == PERF_TYPE_TRACEPOINT;
}
static PyObject*
-tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
+tracepoint_field(const struct pyrf_event *pe, struct tep_format_field *field)
{
struct tep_handle *pevent = field->event->tep;
void *data = pe->sample.raw_data;
@@ -385,7 +386,7 @@ static PyTypeObject pyrf_sample_event__type = {
.tp_getattro = (getattrofunc) pyrf_sample_event__getattro,
};
-static char pyrf_context_switch_event__doc[] = PyDoc_STR("perf context_switch event object.");
+static const char pyrf_context_switch_event__doc[] = PyDoc_STR("perf context_switch event object.");
static PyMemberDef pyrf_context_switch_event__members[] = {
sample_members
@@ -395,7 +396,7 @@ static PyMemberDef pyrf_context_switch_event__members[] = {
{ .name = NULL, },
};
-static PyObject *pyrf_context_switch_event__repr(struct pyrf_event *pevent)
+static PyObject *pyrf_context_switch_event__repr(const struct pyrf_event *pevent)
{
PyObject *ret;
char *s;
@@ -475,7 +476,7 @@ static PyTypeObject *pyrf_event__type[] = {
[PERF_RECORD_SWITCH_CPU_WIDE] = &pyrf_context_switch_event__type,
};
-static PyObject *pyrf_event__new(union perf_event *event)
+static PyObject *pyrf_event__new(const union perf_event *event)
{
struct pyrf_event *pevent;
PyTypeObject *ptype;
@@ -548,7 +549,7 @@ static PySequenceMethods pyrf_cpu_map__sequence_methods = {
.sq_item = pyrf_cpu_map__item,
};
-static char pyrf_cpu_map__doc[] = PyDoc_STR("cpu map object.");
+static const char pyrf_cpu_map__doc[] = PyDoc_STR("cpu map object.");
static PyTypeObject pyrf_cpu_map__type = {
PyVarObject_HEAD_INIT(NULL, 0)
@@ -617,7 +618,7 @@ static PySequenceMethods pyrf_thread_map__sequence_methods = {
.sq_item = pyrf_thread_map__item,
};
-static char pyrf_thread_map__doc[] = PyDoc_STR("thread map object.");
+static const char pyrf_thread_map__doc[] = PyDoc_STR("thread map object.");
static PyTypeObject pyrf_thread_map__type = {
PyVarObject_HEAD_INIT(NULL, 0)
@@ -909,7 +910,7 @@ static PyMethodDef pyrf_evsel__methods[] = {
{ .ml_name = NULL, }
};
-static char pyrf_evsel__doc[] = PyDoc_STR("perf event selector list object.");
+static const char pyrf_evsel__doc[] = PyDoc_STR("perf event selector list object.");
static PyTypeObject pyrf_evsel__type = {
PyVarObject_HEAD_INIT(NULL, 0)
@@ -1194,7 +1195,7 @@ static PySequenceMethods pyrf_evlist__sequence_methods = {
.sq_item = pyrf_evlist__item,
};
-static char pyrf_evlist__doc[] = PyDoc_STR("perf event selector list object.");
+static const char pyrf_evlist__doc[] = PyDoc_STR("perf event selector list object.");
static PyTypeObject pyrf_evlist__type = {
PyVarObject_HEAD_INIT(NULL, 0)
@@ -1216,10 +1217,12 @@ static int pyrf_evlist__setup_types(void)
#define PERF_CONST(name) { #name, PERF_##name }
-static struct {
+struct perf_constant {
const char *name;
int value;
-} perf__constants[] = {
+};
+
+static const struct perf_constant perf__constants[] = {
PERF_CONST(TYPE_HARDWARE),
PERF_CONST(TYPE_SOFTWARE),
PERF_CONST(TYPE_TRACEPOINT),
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0170/1756] perf sample: Make user_regs and intr_regs optional
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (168 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0169/1756] perf python: Constify variables and parameters Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0171/1756] perf jitdump: Free event in jit_repipe_code_move() Greg Kroah-Hartman
` (828 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit dc6d2bc2d893a878e7b58578ff01b4738708deb4 ]
The struct dump_regs contains 512 bytes of cache_regs, meaning the two
values in perf_sample contribute 1088 bytes of its total 1384 bytes
size. Initializing this much memory has a cost reported by Tavian
Barnes <tavianator@tavianator.com> as about 2.5% when running `perf
script --itrace=i0`:
https://lore.kernel.org/lkml/d841b97b3ad2ca8bcab07e4293375fb7c32dfce7.1736618095.git.tavianator@tavianator.com/
Adrian Hunter <adrian.hunter@intel.com> replied that the zero
initialization was necessary and couldn't simply be removed.
This patch aims to strike a middle ground of still zeroing the
perf_sample, but removing 79% of its size by make user_regs and
intr_regs optional pointers to zalloc-ed memory. To support the
allocation accessors are created for user_regs and intr_regs. To
support correct cleanup perf_sample__init and perf_sample__exit
functions are created and added throughout the code base.
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250113194345.1537821-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Stable-dep-of: 7fc5851aac60 ("perf jitdump: Free event in jit_repipe_code_move()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/arch/x86/tests/dwarf-unwind.c | 2 +-
tools/perf/arch/x86/util/unwind-libdw.c | 2 +-
tools/perf/builtin-record.c | 4 +-
tools/perf/builtin-script.c | 10 +-
tools/perf/builtin-top.c | 8 +-
tools/perf/builtin-trace.c | 5 +-
tools/perf/tests/code-reading.c | 12 +-
tools/perf/tests/dwarf-unwind.c | 6 +-
tools/perf/tests/mmap-basic.c | 3 +
tools/perf/tests/openat-syscall-tp-fields.c | 4 +-
tools/perf/tests/parse-no-sample-id-all.c | 6 +-
tools/perf/tests/perf-record.c | 2 +
tools/perf/tests/perf-time-to-tsc.c | 2 +
tools/perf/tests/sample-parsing.c | 62 ++++----
tools/perf/tests/sw-clock.c | 3 +
tools/perf/tests/switch-tracking.c | 14 +-
tools/perf/util/Build | 1 +
tools/perf/util/arm-spe.c | 24 +++-
.../util/arm64-frame-pointer-unwind-support.c | 29 ++--
tools/perf/util/auxtrace.c | 15 +-
tools/perf/util/cs-etm.c | 31 ++--
tools/perf/util/evsel.c | 21 +--
tools/perf/util/intel-bts.c | 4 +-
tools/perf/util/intel-pt.c | 136 ++++++++++++------
tools/perf/util/jitdump.c | 10 +-
tools/perf/util/machine.c | 4 +-
tools/perf/util/python.c | 9 ++
tools/perf/util/s390-cpumsf.c | 6 +-
tools/perf/util/sample.c | 43 ++++++
tools/perf/util/sample.h | 9 +-
.../scripting-engines/trace-event-python.c | 29 ++--
tools/perf/util/session.c | 94 ++++++++----
tools/perf/util/synthetic-events.c | 24 ++--
tools/perf/util/unwind-libdw.c | 9 +-
34 files changed, 450 insertions(+), 193 deletions(-)
create mode 100644 tools/perf/util/sample.c
diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c
index c05c0a85dad41..e91a73d09cecf 100644
--- a/tools/perf/arch/x86/tests/dwarf-unwind.c
+++ b/tools/perf/arch/x86/tests/dwarf-unwind.c
@@ -53,7 +53,7 @@ static int sample_ustack(struct perf_sample *sample,
int test__arch_unwind_sample(struct perf_sample *sample,
struct thread *thread)
{
- struct regs_dump *regs = &sample->user_regs;
+ struct regs_dump *regs = perf_sample__user_regs(sample);
u64 *buf;
buf = malloc(sizeof(u64) * PERF_REGS_MAX);
diff --git a/tools/perf/arch/x86/util/unwind-libdw.c b/tools/perf/arch/x86/util/unwind-libdw.c
index edb77e20e0832..798493e887d73 100644
--- a/tools/perf/arch/x86/util/unwind-libdw.c
+++ b/tools/perf/arch/x86/util/unwind-libdw.c
@@ -8,7 +8,7 @@
bool libdw__arch_set_initial_registers(Dwfl_Thread *thread, void *arg)
{
struct unwind_info *ui = arg;
- struct regs_dump *user_regs = &ui->sample->user_regs;
+ struct regs_dump *user_regs = perf_sample__user_regs(ui->sample);
Dwarf_Word dwarf_regs[17];
unsigned nregs;
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index e5578bd41d3bb..62e1457a44933 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1917,9 +1917,10 @@ static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
u16 misc_flag)
{
struct perf_sample_id *sid;
- struct perf_sample sample = {};
+ struct perf_sample sample;
int id_hdr_size;
+ perf_sample__init(&sample, /*all=*/true);
lost->lost = lost_count;
if (evsel->core.ids) {
sid = xyarray__entry(evsel->core.sample_id, cpu_idx, thread_idx);
@@ -1931,6 +1932,7 @@ static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
lost->header.size = sizeof(*lost) + id_hdr_size;
lost->header.misc = misc_flag;
record__write(rec, NULL, lost, lost->header.size);
+ perf_sample__exit(&sample);
}
static void record__read_lost_samples(struct record *rec)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index a644787fa9e1d..4c6200cf3d608 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -775,14 +775,20 @@ tod_scnprintf(struct perf_script *script, char *buf, int buflen,
static int perf_sample__fprintf_iregs(struct perf_sample *sample,
struct perf_event_attr *attr, const char *arch, FILE *fp)
{
- return perf_sample__fprintf_regs(&sample->intr_regs,
+ if (!sample->intr_regs)
+ return 0;
+
+ return perf_sample__fprintf_regs(perf_sample__intr_regs(sample),
attr->sample_regs_intr, arch, fp);
}
static int perf_sample__fprintf_uregs(struct perf_sample *sample,
struct perf_event_attr *attr, const char *arch, FILE *fp)
{
- return perf_sample__fprintf_regs(&sample->user_regs,
+ if (!sample->user_regs)
+ return 0;
+
+ return perf_sample__fprintf_regs(perf_sample__user_regs(sample),
attr->sample_regs_user, arch, fp);
}
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index ca3e8eca6610e..43abd06c7a8a6 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1157,6 +1157,7 @@ static int deliver_event(struct ordered_events *qe,
return 0;
}
+ perf_sample__init(&sample, /*all=*/false);
ret = evlist__parse_sample(evlist, event, &sample);
if (ret) {
pr_err("Can't parse sample, err = %d\n", ret);
@@ -1167,8 +1168,10 @@ static int deliver_event(struct ordered_events *qe,
assert(evsel != NULL);
if (event->header.type == PERF_RECORD_SAMPLE) {
- if (evswitch__discard(&top->evswitch, evsel))
- return 0;
+ if (evswitch__discard(&top->evswitch, evsel)) {
+ ret = 0;
+ goto next_event;
+ }
++top->samples;
}
@@ -1219,6 +1222,7 @@ static int deliver_event(struct ordered_events *qe,
ret = 0;
next_event:
+ perf_sample__exit(&sample);
return ret;
}
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f77e4f4b6f03e..0af5254df4720 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -4028,13 +4028,16 @@ static int __trace__deliver_event(struct trace *trace, union perf_event *event)
{
struct evlist *evlist = trace->evlist;
struct perf_sample sample;
- int err = evlist__parse_sample(evlist, event, &sample);
+ int err;
+ perf_sample__init(&sample, /*all=*/false);
+ err = evlist__parse_sample(evlist, event, &sample);
if (err)
fprintf(trace->output, "Can't parse sample, err = %d, skipping...\n", err);
else
trace__handle_event(trace, event, &sample);
+ perf_sample__exit(&sample);
return 0;
}
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 27c82cfb7e7de..638816544c3f6 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -389,19 +389,25 @@ static int process_sample_event(struct machine *machine,
struct thread *thread;
int ret;
- if (evlist__parse_sample(evlist, event, &sample)) {
+ perf_sample__init(&sample, /*all=*/false);
+ ret = evlist__parse_sample(evlist, event, &sample);
+ if (ret) {
pr_debug("evlist__parse_sample failed\n");
- return -1;
+ ret = -1;
+ goto out;
}
thread = machine__findnew_thread(machine, sample.pid, sample.tid);
if (!thread) {
pr_debug("machine__findnew_thread failed\n");
- return -1;
+ ret = -1;
+ goto out;
}
ret = read_object_code(sample.ip, READLEN, sample.cpumode, thread, state);
thread__put(thread);
+out:
+ perf_sample__exit(&sample);
return ret;
}
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index f85d391ced98e..4803ab2d97ba6 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -115,8 +115,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__thread(struct thread *thr
unsigned long cnt = 0;
int err = -1;
- memset(&sample, 0, sizeof(sample));
-
+ perf_sample__init(&sample, /*all=*/true);
if (test__arch_unwind_sample(&sample, thread)) {
pr_debug("failed to get unwind sample\n");
goto out;
@@ -134,7 +133,8 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__thread(struct thread *thr
out:
zfree(&sample.user_stack.data);
- zfree(&sample.user_regs.regs);
+ zfree(&sample.user_regs->regs);
+ perf_sample__exit(&sample);
return err;
}
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index 012c8ae439fdc..bd2106628b345 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -130,14 +130,17 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
goto out_delete_evlist;
}
+ perf_sample__init(&sample, /*all=*/false);
err = evlist__parse_sample(evlist, event, &sample);
if (err) {
pr_err("Can't parse sample, err = %d\n", err);
+ perf_sample__exit(&sample);
goto out_delete_evlist;
}
err = -1;
evsel = evlist__id2evsel(evlist, sample.id);
+ perf_sample__exit(&sample);
if (evsel == NULL) {
pr_debug("event with id %" PRIu64
" doesn't map to an evsel\n", sample.id);
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index 888df8eca9812..844c1a5b0a533 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -110,14 +110,16 @@ static int test__syscall_openat_tp_fields(struct test_suite *test __maybe_unused
continue;
}
+ perf_sample__init(&sample, /*all=*/false);
err = evsel__parse_sample(evsel, event, &sample);
if (err) {
pr_debug("Can't parse sample, err = %d\n", err);
+ perf_sample__exit(&sample);
goto out_delete_evlist;
}
tp_flags = evsel__intval(evsel, &sample, "flags");
-
+ perf_sample__exit(&sample);
if (flags != tp_flags) {
pr_debug("%s: Expected flags=%#x, got %#x\n",
__func__, flags, tp_flags);
diff --git a/tools/perf/tests/parse-no-sample-id-all.c b/tools/perf/tests/parse-no-sample-id-all.c
index 202f0a9a6796b..50e68b7d43aad 100644
--- a/tools/perf/tests/parse-no-sample-id-all.c
+++ b/tools/perf/tests/parse-no-sample-id-all.c
@@ -13,6 +13,7 @@
static int process_event(struct evlist **pevlist, union perf_event *event)
{
struct perf_sample sample;
+ int ret;
if (event->header.type == PERF_RECORD_HEADER_ATTR) {
if (perf_event__process_attr(NULL, event, pevlist)) {
@@ -28,7 +29,10 @@ static int process_event(struct evlist **pevlist, union perf_event *event)
if (!*pevlist)
return -1;
- if (evlist__parse_sample(*pevlist, event, &sample)) {
+ perf_sample__init(&sample, /*all=*/false);
+ ret = evlist__parse_sample(*pevlist, event, &sample);
+ perf_sample__exit(&sample);
+ if (ret) {
pr_debug("evlist__parse_sample failed\n");
return -1;
}
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 6e7f053006b4f..2a0a31e3d1a45 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -70,6 +70,7 @@ static int test__PERF_RECORD(struct test_suite *test __maybe_unused, int subtest
int total_events = 0, nr_events[PERF_RECORD_MAX] = { 0, };
char sbuf[STRERR_BUFSIZE];
+ perf_sample__init(&sample, /*all=*/false);
if (evlist == NULL) /* Fallback for kernels lacking PERF_COUNT_SW_DUMMY */
evlist = evlist__new_default();
@@ -334,6 +335,7 @@ static int test__PERF_RECORD(struct test_suite *test __maybe_unused, int subtest
out_delete_evlist:
evlist__delete(evlist);
out:
+ perf_sample__exit(&sample);
if (err == -EACCES)
return TEST_SKIP;
if (err < 0 || errs != 0)
diff --git a/tools/perf/tests/perf-time-to-tsc.c b/tools/perf/tests/perf-time-to-tsc.c
index bbe2ddeb9b745..d3e40fa5482ce 100644
--- a/tools/perf/tests/perf-time-to-tsc.c
+++ b/tools/perf/tests/perf-time-to-tsc.c
@@ -153,6 +153,7 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
while ((event = perf_mmap__read_event(&md->core)) != NULL) {
struct perf_sample sample;
+ perf_sample__init(&sample, /*all=*/false);
if (event->header.type != PERF_RECORD_COMM ||
(pid_t)event->comm.pid != getpid() ||
(pid_t)event->comm.tid != getpid())
@@ -170,6 +171,7 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
}
next_event:
perf_mmap__consume(&md->core);
+ perf_sample__exit(&sample);
}
perf_mmap__read_done(&md->core);
}
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 25a3f6cece505..72411580f8698 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -40,8 +40,8 @@
#define BS_EXPECTED_LE 0x1aa00000000
#define FLAG(s) s->branch_stack->entries[i].flags
-static bool samples_same(const struct perf_sample *s1,
- const struct perf_sample *s2,
+static bool samples_same(struct perf_sample *s1,
+ struct perf_sample *s2,
u64 type, u64 read_format, bool needs_swap)
{
size_t i;
@@ -126,13 +126,15 @@ static bool samples_same(const struct perf_sample *s1,
}
if (type & PERF_SAMPLE_REGS_USER) {
- size_t sz = hweight_long(s1->user_regs.mask) * sizeof(u64);
-
- COMP(user_regs.mask);
- COMP(user_regs.abi);
- if (s1->user_regs.abi &&
- (!s1->user_regs.regs || !s2->user_regs.regs ||
- memcmp(s1->user_regs.regs, s2->user_regs.regs, sz))) {
+ struct regs_dump *s1_regs = perf_sample__user_regs(s1);
+ struct regs_dump *s2_regs = perf_sample__user_regs(s2);
+ size_t sz = hweight_long(s1_regs->mask) * sizeof(u64);
+
+ COMP(user_regs->mask);
+ COMP(user_regs->abi);
+ if (s1_regs->abi &&
+ (!s1_regs->regs || !s2_regs->regs ||
+ memcmp(s1_regs->regs, s2_regs->regs, sz))) {
pr_debug("Samples differ at 'user_regs'\n");
return false;
}
@@ -157,13 +159,15 @@ static bool samples_same(const struct perf_sample *s1,
COMP(transaction);
if (type & PERF_SAMPLE_REGS_INTR) {
- size_t sz = hweight_long(s1->intr_regs.mask) * sizeof(u64);
-
- COMP(intr_regs.mask);
- COMP(intr_regs.abi);
- if (s1->intr_regs.abi &&
- (!s1->intr_regs.regs || !s2->intr_regs.regs ||
- memcmp(s1->intr_regs.regs, s2->intr_regs.regs, sz))) {
+ struct regs_dump *s1_regs = perf_sample__intr_regs(s1);
+ struct regs_dump *s2_regs = perf_sample__intr_regs(s2);
+ size_t sz = hweight_long(s1_regs->mask) * sizeof(u64);
+
+ COMP(intr_regs->mask);
+ COMP(intr_regs->abi);
+ if (s1_regs->abi &&
+ (!s1_regs->regs || !s2_regs->regs ||
+ memcmp(s1_regs->regs, s2_regs->regs, sz))) {
pr_debug("Samples differ at 'intr_regs'\n");
return false;
}
@@ -223,6 +227,16 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
const u32 raw_data[] = {0x12345678, 0x0a0b0c0d, 0x11020304, 0x05060708, 0 };
const u64 data[] = {0x2211443366558877ULL, 0, 0xaabbccddeeff4321ULL};
const u64 aux_data[] = {0xa55a, 0, 0xeeddee, 0x0282028202820282};
+ struct regs_dump user_regs = {
+ .abi = PERF_SAMPLE_REGS_ABI_64,
+ .mask = sample_regs,
+ .regs = regs,
+ };
+ struct regs_dump intr_regs = {
+ .abi = PERF_SAMPLE_REGS_ABI_64,
+ .mask = sample_regs,
+ .regs = regs,
+ };
struct perf_sample sample = {
.ip = 101,
.pid = 102,
@@ -241,11 +255,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
.callchain = &callchain.callchain,
.no_hw_idx = false,
.branch_stack = &branch_stack.branch_stack,
- .user_regs = {
- .abi = PERF_SAMPLE_REGS_ABI_64,
- .mask = sample_regs,
- .regs = regs,
- },
+ .user_regs = &user_regs,
.user_stack = {
.size = sizeof(data),
.data = (void *)data,
@@ -254,11 +264,7 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
.time_enabled = 0x030a59d664fca7deULL,
.time_running = 0x011b6ae553eb98edULL,
},
- .intr_regs = {
- .abi = PERF_SAMPLE_REGS_ABI_64,
- .mask = sample_regs,
- .regs = regs,
- },
+ .intr_regs = &intr_regs,
.phys_addr = 113,
.cgroup = 114,
.data_page_size = 115,
@@ -273,6 +279,8 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
size_t i, sz, bufsz;
int err, ret = -1;
+ perf_sample__init(&sample_out, /*all=*/false);
+ perf_sample__init(&sample_out_endian, /*all=*/false);
if (sample_type & PERF_SAMPLE_REGS_USER)
evsel.core.attr.sample_regs_user = sample_regs;
@@ -361,6 +369,8 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
ret = 0;
out_free:
free(event);
+ perf_sample__exit(&sample_out_endian);
+ perf_sample__exit(&sample_out);
if (ret && read_format)
pr_debug("read_format %#"PRIx64"\n", read_format);
return ret;
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index 290716783ac6a..4a2ad7176fa07 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -104,12 +104,14 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
while ((event = perf_mmap__read_event(&md->core)) != NULL) {
struct perf_sample sample;
+ perf_sample__init(&sample, /*all=*/false);
if (event->header.type != PERF_RECORD_SAMPLE)
goto next_event;
err = evlist__parse_sample(evlist, event, &sample);
if (err < 0) {
pr_debug("Error during parse sample\n");
+ perf_sample__exit(&sample);
goto out_delete_evlist;
}
@@ -117,6 +119,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
nr_samples++;
next_event:
perf_mmap__consume(&md->core);
+ perf_sample__exit(&sample);
}
perf_mmap__read_done(&md->core);
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index ee43d8fa2ed67..d444ed53aebc5 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -131,9 +131,11 @@ static int process_sample_event(struct evlist *evlist,
pid_t next_tid, prev_tid;
int cpu, err;
+ perf_sample__init(&sample, /*all=*/false);
if (evlist__parse_sample(evlist, event, &sample)) {
pr_debug("evlist__parse_sample failed\n");
- return -1;
+ err = -1;
+ goto out;
}
evsel = evlist__id2evsel(evlist, sample.id);
@@ -145,7 +147,7 @@ static int process_sample_event(struct evlist *evlist,
cpu, prev_tid, next_tid);
err = check_cpu(switch_tracking, cpu);
if (err)
- return err;
+ goto out;
/*
* Check for no missing sched_switch events i.e. that the
* evsel->core.system_wide flag has worked.
@@ -153,7 +155,8 @@ static int process_sample_event(struct evlist *evlist,
if (switch_tracking->tids[cpu] != -1 &&
switch_tracking->tids[cpu] != prev_tid) {
pr_debug("Missing sched_switch events\n");
- return -1;
+ err = -1;
+ goto out;
}
switch_tracking->tids[cpu] = next_tid;
}
@@ -169,7 +172,10 @@ static int process_sample_event(struct evlist *evlist,
switch_tracking->cycles_after_comm_4 = 1;
}
- return 0;
+ err = 0;
+out:
+ perf_sample__exit(&sample);
+ return err;
}
static int process_event(struct evlist *evlist, union perf_event *event,
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index dc616292b2ddf..5cc89ec8584bc 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -67,6 +67,7 @@ perf-util-y += maps.o
perf-util-y += pstack.o
perf-util-y += session.o
perf-util-y += tool.o
+perf-util-y += sample.o
perf-util-y += sample-raw.o
perf-util-y += s390-sample-raw.o
perf-util-y += amd-sample-raw.o
diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index 9890b17241c34..cc019aa161eb4 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -350,8 +350,10 @@ static int arm_spe__synth_mem_sample(struct arm_spe_queue *speq,
struct arm_spe *spe = speq->spe;
struct arm_spe_record *record = &speq->decoder->record;
union perf_event *event = speq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
+ int ret;
+ perf_sample__init(&sample, /*all=*/true);
arm_spe_prep_sample(spe, speq, event, &sample);
sample.id = spe_events_id;
@@ -361,7 +363,9 @@ static int arm_spe__synth_mem_sample(struct arm_spe_queue *speq,
sample.data_src = data_src;
sample.weight = record->latency;
- return arm_spe_deliver_synth_event(spe, speq, event, &sample);
+ ret = arm_spe_deliver_synth_event(spe, speq, event, &sample);
+ perf_sample__exit(&sample);
+ return ret;
}
static int arm_spe__synth_branch_sample(struct arm_spe_queue *speq,
@@ -370,8 +374,10 @@ static int arm_spe__synth_branch_sample(struct arm_spe_queue *speq,
struct arm_spe *spe = speq->spe;
struct arm_spe_record *record = &speq->decoder->record;
union perf_event *event = speq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
+ int ret;
+ perf_sample__init(&sample, /*all=*/true);
arm_spe_prep_sample(spe, speq, event, &sample);
sample.id = spe_events_id;
@@ -379,7 +385,9 @@ static int arm_spe__synth_branch_sample(struct arm_spe_queue *speq,
sample.addr = record->to_ip;
sample.weight = record->latency;
- return arm_spe_deliver_synth_event(spe, speq, event, &sample);
+ ret = arm_spe_deliver_synth_event(spe, speq, event, &sample);
+ perf_sample__exit(&sample);
+ return ret;
}
static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
@@ -388,7 +396,8 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
struct arm_spe *spe = speq->spe;
struct arm_spe_record *record = &speq->decoder->record;
union perf_event *event = speq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
+ int ret;
/*
* Handles perf instruction sampling period.
@@ -398,6 +407,7 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
return 0;
speq->period_instructions = 0;
+ perf_sample__init(&sample, /*all=*/true);
arm_spe_prep_sample(spe, speq, event, &sample);
sample.id = spe_events_id;
@@ -408,7 +418,9 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
sample.period = spe->instructions_sample_period;
sample.weight = record->latency;
- return arm_spe_deliver_synth_event(spe, speq, event, &sample);
+ ret = arm_spe_deliver_synth_event(spe, speq, event, &sample);
+ perf_sample__exit(&sample);
+ return ret;
}
static const struct midr_range common_ds_encoding_cpus[] = {
diff --git a/tools/perf/util/arm64-frame-pointer-unwind-support.c b/tools/perf/util/arm64-frame-pointer-unwind-support.c
index 4940be4a0569c..958afe8b821eb 100644
--- a/tools/perf/util/arm64-frame-pointer-unwind-support.c
+++ b/tools/perf/util/arm64-frame-pointer-unwind-support.c
@@ -4,6 +4,7 @@
#include "event.h"
#include "perf_regs.h" // SMPL_REG_MASK
#include "unwind.h"
+#include <string.h>
#define perf_event_arm_regs perf_event_arm64_regs
#include "../../arch/arm64/include/uapi/asm/perf_regs.h"
@@ -16,8 +17,13 @@ struct entries {
static bool get_leaf_frame_caller_enabled(struct perf_sample *sample)
{
- return callchain_param.record_mode == CALLCHAIN_FP && sample->user_regs.regs
- && sample->user_regs.mask & SMPL_REG_MASK(PERF_REG_ARM64_LR);
+ struct regs_dump *regs;
+
+ if (callchain_param.record_mode != CALLCHAIN_FP)
+ return false;
+
+ regs = perf_sample__user_regs(sample);
+ return regs->regs && regs->mask & SMPL_REG_MASK(PERF_REG_ARM64_LR);
}
static int add_entry(struct unwind_entry *entry, void *arg)
@@ -32,7 +38,7 @@ u64 get_leaf_frame_caller_aarch64(struct perf_sample *sample, struct thread *thr
{
int ret;
struct entries entries = {};
- struct regs_dump old_regs = sample->user_regs;
+ struct regs_dump old_regs, *regs;
if (!get_leaf_frame_caller_enabled(sample))
return 0;
@@ -42,19 +48,20 @@ u64 get_leaf_frame_caller_aarch64(struct perf_sample *sample, struct thread *thr
* and set its mask. SP is not used when doing the unwinding but it
* still needs to be set to prevent failures.
*/
-
- if (!(sample->user_regs.mask & SMPL_REG_MASK(PERF_REG_ARM64_PC))) {
- sample->user_regs.cache_mask |= SMPL_REG_MASK(PERF_REG_ARM64_PC);
- sample->user_regs.cache_regs[PERF_REG_ARM64_PC] = sample->callchain->ips[usr_idx+1];
+ regs = perf_sample__user_regs(sample);
+ memcpy(&old_regs, regs, sizeof(*regs));
+ if (!(regs->mask & SMPL_REG_MASK(PERF_REG_ARM64_PC))) {
+ regs->cache_mask |= SMPL_REG_MASK(PERF_REG_ARM64_PC);
+ regs->cache_regs[PERF_REG_ARM64_PC] = sample->callchain->ips[usr_idx+1];
}
- if (!(sample->user_regs.mask & SMPL_REG_MASK(PERF_REG_ARM64_SP))) {
- sample->user_regs.cache_mask |= SMPL_REG_MASK(PERF_REG_ARM64_SP);
- sample->user_regs.cache_regs[PERF_REG_ARM64_SP] = 0;
+ if (!(regs->mask & SMPL_REG_MASK(PERF_REG_ARM64_SP))) {
+ regs->cache_mask |= SMPL_REG_MASK(PERF_REG_ARM64_SP);
+ regs->cache_regs[PERF_REG_ARM64_SP] = 0;
}
ret = unwind__get_entries(add_entry, &entries, thread, sample, 2, true);
- sample->user_regs = old_regs;
+ memcpy(regs, &old_regs, sizeof(*regs));
if (ret || entries.length != 2)
return ret;
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 0927cfb42b7c5..52ba48773175d 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -1121,16 +1121,19 @@ static int auxtrace_queue_data_cb(struct perf_session *session,
if (!qd->samples || event->header.type != PERF_RECORD_SAMPLE)
return 0;
+ perf_sample__init(&sample, /*all=*/false);
err = evlist__parse_sample(session->evlist, event, &sample);
if (err)
- return err;
-
- if (!sample.aux_sample.size)
- return 0;
+ goto out;
- offset += sample.aux_sample.data - (void *)event;
+ if (sample.aux_sample.size) {
+ offset += sample.aux_sample.data - (void *)event;
- return session->auxtrace->queue_data(session, &sample, NULL, offset);
+ err = session->auxtrace->queue_data(session, &sample, NULL, offset);
+ }
+out:
+ perf_sample__exit(&sample);
+ return err;
}
int auxtrace_queue_data(struct perf_session *session, bool samples, bool events)
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index a6344ff19f746..46a34f8279ddd 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -513,20 +513,27 @@ static int cs_etm__process_aux_output_hw_id(struct perf_session *session,
evsel = evlist__event2evsel(session->evlist, event);
if (!evsel)
return -EINVAL;
+ perf_sample__init(&sample, /*all=*/false);
err = evsel__parse_sample(evsel, event, &sample);
if (err)
- return err;
+ goto out;
cpu = sample.cpu;
if (cpu == -1) {
/* no CPU in the sample - possibly recorded with an old version of perf */
pr_err("CS_ETM: no CPU AUX_OUTPUT_HW_ID sample. Use compatible perf to record.");
- return -EINVAL;
+ err = -EINVAL;
+ goto out;
}
- if (FIELD_GET(CS_AUX_HW_ID_MINOR_VERSION_MASK, hw_id) == 0)
- return cs_etm__process_trace_id_v0(etm, cpu, hw_id);
+ if (FIELD_GET(CS_AUX_HW_ID_MINOR_VERSION_MASK, hw_id) == 0) {
+ err = cs_etm__process_trace_id_v0(etm, cpu, hw_id);
+ goto out;
+ }
- return cs_etm__process_trace_id_v0_1(etm, cpu, hw_id);
+ err = cs_etm__process_trace_id_v0_1(etm, cpu, hw_id);
+out:
+ perf_sample__exit(&sample);
+ return err;
}
void cs_etm__etmq_set_traceid_queue_timestamp(struct cs_etm_queue *etmq,
@@ -1599,8 +1606,9 @@ static int cs_etm__synth_instruction_sample(struct cs_etm_queue *etmq,
int ret = 0;
struct cs_etm_auxtrace *etm = etmq->etm;
union perf_event *event = tidq->event_buf;
- struct perf_sample sample = {.ip = 0,};
+ struct perf_sample sample;
+ perf_sample__init(&sample, /*all=*/true);
event->sample.header.type = PERF_RECORD_SAMPLE;
event->sample.header.misc = cs_etm__cpu_mode(etmq, addr, packet->el);
event->sample.header.size = sizeof(struct perf_event_header);
@@ -1637,6 +1645,7 @@ static int cs_etm__synth_instruction_sample(struct cs_etm_queue *etmq,
"CS ETM Trace: failed to deliver instruction event, error %d\n",
ret);
+ perf_sample__exit(&sample);
return ret;
}
@@ -3252,9 +3261,10 @@ static int cs_etm__queue_aux_records_cb(struct perf_session *session, union perf
evsel = evlist__event2evsel(session->evlist, event);
if (!evsel)
return -EINVAL;
+ perf_sample__init(&sample, /*all=*/false);
ret = evsel__parse_sample(evsel, event, &sample);
if (ret)
- return ret;
+ goto out;
/*
* Loop through the auxtrace index to find the buffer that matches up with this aux event.
@@ -3269,7 +3279,7 @@ static int cs_etm__queue_aux_records_cb(struct perf_session *session, union perf
* 1 ('not found')
*/
if (ret != 1)
- return ret;
+ goto out;
}
}
@@ -3279,7 +3289,10 @@ static int cs_etm__queue_aux_records_cb(struct perf_session *session, union perf
*/
pr_err("CS ETM: Couldn't find auxtrace buffer for aux_offset: %#"PRI_lx64
" tid: %d cpu: %d\n", event->aux.aux_offset, sample.tid, sample.cpu);
- return 0;
+ ret = 0;
+out:
+ perf_sample__exit(&sample);
+ return ret;
}
static int cs_etm__queue_aux_records(struct perf_session *session)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 37b9196dbaa32..e84dacb5627b6 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2926,17 +2926,19 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
}
if (type & PERF_SAMPLE_REGS_USER) {
+ struct regs_dump *regs = perf_sample__user_regs(data);
+
OVERFLOW_CHECK_u64(array);
- data->user_regs.abi = *array;
+ regs->abi = *array;
array++;
- if (data->user_regs.abi) {
+ if (regs->abi) {
u64 mask = evsel->core.attr.sample_regs_user;
sz = hweight64(mask) * sizeof(u64);
OVERFLOW_CHECK(array, sz, max_size);
- data->user_regs.mask = mask;
- data->user_regs.regs = (u64 *)array;
+ regs->mask = mask;
+ regs->regs = (u64 *)array;
array = (void *)array + sz;
}
}
@@ -2980,19 +2982,20 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
array++;
}
- data->intr_regs.abi = PERF_SAMPLE_REGS_ABI_NONE;
if (type & PERF_SAMPLE_REGS_INTR) {
+ struct regs_dump *regs = perf_sample__intr_regs(data);
+
OVERFLOW_CHECK_u64(array);
- data->intr_regs.abi = *array;
+ regs->abi = *array;
array++;
- if (data->intr_regs.abi != PERF_SAMPLE_REGS_ABI_NONE) {
+ if (regs->abi != PERF_SAMPLE_REGS_ABI_NONE) {
u64 mask = evsel->core.attr.sample_regs_intr;
sz = hweight64(mask) * sizeof(u64);
OVERFLOW_CHECK(array, sz, max_size);
- data->intr_regs.mask = mask;
- data->intr_regs.regs = (u64 *)array;
+ regs->mask = mask;
+ regs->regs = (u64 *)array;
array = (void *)array + sz;
}
}
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c
index 056dde772eabf..68bb794a43ff7 100644
--- a/tools/perf/util/intel-bts.c
+++ b/tools/perf/util/intel-bts.c
@@ -275,12 +275,13 @@ static int intel_bts_synth_branch_sample(struct intel_bts_queue *btsq,
int ret;
struct intel_bts *bts = btsq->bts;
union perf_event event;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
if (bts->synth_opts.initial_skip &&
bts->num_events++ <= bts->synth_opts.initial_skip)
return 0;
+ perf_sample__init(&sample, /*all=*/true);
sample.ip = le64_to_cpu(branch->from);
sample.cpumode = intel_bts_cpumode(bts, sample.ip);
sample.pid = btsq->pid;
@@ -312,6 +313,7 @@ static int intel_bts_synth_branch_sample(struct intel_bts_queue *btsq,
pr_err("Intel BTS: failed to deliver branch event, error %d\n",
ret);
+ perf_sample__exit(&sample);
return ret;
}
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index fa4eb009a9636..362d11c965083 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1766,12 +1766,13 @@ static int intel_pt_synth_branch_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct dummy_branch_stack {
u64 nr;
u64 hw_idx;
struct branch_entry entries;
} dummy_bs;
+ int ret;
if (pt->branches_filter && !(pt->branches_filter & ptq->flags))
return 0;
@@ -1779,6 +1780,7 @@ static int intel_pt_synth_branch_sample(struct intel_pt_queue *ptq)
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_b_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->branches_id;
@@ -1808,8 +1810,10 @@ static int intel_pt_synth_branch_sample(struct intel_pt_queue *ptq)
ptq->last_br_cyc_cnt = ptq->ipc_cyc_cnt;
}
- return intel_pt_deliver_synth_event(pt, event, &sample,
+ perf_sample__exit(&sample);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
pt->branches_sample_type);
+ return ret;
}
static void intel_pt_prep_sample(struct intel_pt *pt,
@@ -1837,11 +1841,13 @@ static int intel_pt_synth_instruction_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->instructions_id;
@@ -1861,16 +1867,19 @@ static int intel_pt_synth_instruction_sample(struct intel_pt_queue *ptq)
ptq->last_insn_cnt = ptq->state->tot_insn_cnt;
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->instructions_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->instructions_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_cycle_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
u64 period = 0;
+ int ret;
if (ptq->sample_ipc)
period = ptq->ipc_cyc_cnt - ptq->last_cy_cyc_cnt;
@@ -1878,6 +1887,7 @@ static int intel_pt_synth_cycle_sample(struct intel_pt_queue *ptq)
if (!period || intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->cycles_id;
@@ -1889,25 +1899,31 @@ static int intel_pt_synth_cycle_sample(struct intel_pt_queue *ptq)
ptq->last_cy_insn_cnt = ptq->ipc_insn_cnt;
ptq->last_cy_cyc_cnt = ptq->ipc_cyc_cnt;
- return intel_pt_deliver_synth_event(pt, event, &sample, pt->cycles_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample, pt->cycles_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_transaction_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->transactions_id;
sample.stream_id = ptq->pt->transactions_id;
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->transactions_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->transactions_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static void intel_pt_prep_p_sample(struct intel_pt *pt,
@@ -1955,15 +1971,17 @@ static int intel_pt_synth_cbr_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_cbr raw;
u32 flags;
+ int ret;
if (intel_pt_skip_cbr_event(pt))
return 0;
ptq->cbr_seen = ptq->state->cbr;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->cbr_id;
@@ -1977,20 +1995,24 @@ static int intel_pt_synth_cbr_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->pwr_events_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->pwr_events_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_psb_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_psb raw;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->psb_id;
@@ -2003,20 +2025,24 @@ static int intel_pt_synth_psb_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->pwr_events_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->pwr_events_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_mwait_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_mwait raw;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->mwait_id;
@@ -2028,20 +2054,24 @@ static int intel_pt_synth_mwait_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->pwr_events_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->pwr_events_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_pwre_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_pwre raw;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->pwre_id;
@@ -2053,20 +2083,24 @@ static int intel_pt_synth_pwre_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->pwr_events_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->pwr_events_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_exstop_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_exstop raw;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->exstop_id;
@@ -2078,20 +2112,24 @@ static int intel_pt_synth_exstop_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->pwr_events_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->pwr_events_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_pwrx_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_pwrx raw;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->pwrx_id;
@@ -2103,8 +2141,10 @@ static int intel_pt_synth_pwrx_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->pwr_events_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->pwr_events_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
/*
@@ -2376,16 +2416,18 @@ static int intel_pt_do_synth_pebs_sample(struct intel_pt_queue *ptq, struct evse
u64 id, int data_src_fmt)
{
const struct intel_pt_blk_items *items = &ptq->state->items;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
union perf_event *event = ptq->event_buf;
struct intel_pt *pt = ptq->pt;
u64 sample_type = evsel->core.attr.sample_type;
u8 cpumode;
- u64 regs[8 * sizeof(sample.intr_regs.mask)];
+ u64 regs[8 * sizeof(sample.intr_regs->mask)];
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_a_sample(ptq, event, &sample);
sample.id = id;
@@ -2432,15 +2474,16 @@ static int intel_pt_do_synth_pebs_sample(struct intel_pt_queue *ptq, struct evse
items->mask[INTEL_PT_XMM_POS])) {
u64 regs_mask = evsel->core.attr.sample_regs_intr;
u64 *pos;
+ struct regs_dump *intr_regs = perf_sample__intr_regs(&sample);
- sample.intr_regs.abi = items->is_32_bit ?
+ intr_regs->abi = items->is_32_bit ?
PERF_SAMPLE_REGS_ABI_32 :
PERF_SAMPLE_REGS_ABI_64;
- sample.intr_regs.regs = regs;
+ intr_regs->regs = regs;
- pos = intel_pt_add_gp_regs(&sample.intr_regs, regs, items, regs_mask);
+ pos = intel_pt_add_gp_regs(intr_regs, regs, items, regs_mask);
- intel_pt_add_xmm(&sample.intr_regs, pos, items, regs_mask);
+ intel_pt_add_xmm(intr_regs, pos, items, regs_mask);
}
if (sample_type & PERF_SAMPLE_BRANCH_STACK) {
@@ -2514,7 +2557,9 @@ static int intel_pt_do_synth_pebs_sample(struct intel_pt_queue *ptq, struct evse
sample.transaction = txn;
}
- return intel_pt_deliver_synth_event(pt, event, &sample, sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample, sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_single_pebs_sample(struct intel_pt_queue *ptq)
@@ -2561,16 +2606,17 @@ static int intel_pt_synth_events_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct {
struct perf_synth_intel_evt cfe;
struct perf_synth_intel_evd evd[INTEL_PT_MAX_EVDS];
} raw;
- int i;
+ int i, ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->evt_id;
@@ -2592,20 +2638,24 @@ static int intel_pt_synth_events_sample(struct intel_pt_queue *ptq)
ptq->state->evd_cnt * sizeof(struct perf_synth_intel_evd);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->evt_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->evt_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_iflag_chg_sample(struct intel_pt_queue *ptq)
{
struct intel_pt *pt = ptq->pt;
union perf_event *event = ptq->event_buf;
- struct perf_sample sample = { .ip = 0, };
+ struct perf_sample sample;
struct perf_synth_intel_iflag_chg raw;
+ int ret;
if (intel_pt_skip_event(pt))
return 0;
+ perf_sample__init(&sample, /*all=*/true);
intel_pt_prep_p_sample(pt, ptq, event, &sample);
sample.id = ptq->pt->iflag_chg_id;
@@ -2625,8 +2675,10 @@ static int intel_pt_synth_iflag_chg_sample(struct intel_pt_queue *ptq)
sample.raw_size = perf_synth__raw_size(raw);
sample.raw_data = perf_synth__raw_data(&raw);
- return intel_pt_deliver_synth_event(pt, event, &sample,
- pt->iflag_chg_sample_type);
+ ret = intel_pt_deliver_synth_event(pt, event, &sample,
+ pt->iflag_chg_sample_type);
+ perf_sample__exit(&sample);
+ return ret;
}
static int intel_pt_synth_error(struct intel_pt *pt, int code, int cpu,
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 4b329536c0c0c..eebfe0d9b948c 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -553,7 +553,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
* create pseudo sample to induce dso hit increment
* use first address as sample address
*/
- memset(&sample, 0, sizeof(sample));
+ perf_sample__init(&sample, /*all=*/true);
sample.cpumode = PERF_RECORD_MISC_USER;
sample.pid = pid;
sample.tid = tid;
@@ -572,6 +572,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine);
out:
+ perf_sample__exit(&sample);
free(event);
return ret;
}
@@ -651,7 +652,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
* create pseudo sample to induce dso hit increment
* use first address as sample address
*/
- memset(&sample, 0, sizeof(sample));
+ perf_sample__init(&sample, /*all=*/true);
sample.cpumode = PERF_RECORD_MISC_USER;
sample.pid = pid;
sample.tid = tid;
@@ -660,12 +661,13 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
ret = perf_event__process_mmap2(tool, event, &sample, jd->machine);
if (ret)
- return ret;
+ goto out;
ret = jit_inject_event(jd, event);
if (!ret)
build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine);
-
+out:
+ perf_sample__exit(&sample);
return ret;
}
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 77050eff8fcb5..78c021b246a6c 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2944,8 +2944,8 @@ static int thread__resolve_callchain_unwind(struct thread *thread,
return 0;
/* Bail out if nothing was captured. */
- if ((!sample->user_regs.regs) ||
- (!sample->user_stack.size))
+ if (!sample->user_regs || !sample->user_regs->regs ||
+ !sample->user_stack.size)
return 0;
if (!symbols)
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index a8d96583ecf1c..66d3b0c633b25 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -276,6 +276,12 @@ static PyMemberDef pyrf_sample_event__members[] = {
{ .name = NULL, },
};
+static void pyrf_sample_event__delete(struct pyrf_event *pevent)
+{
+ perf_sample__exit(&pevent->sample);
+ Py_TYPE(pevent)->tp_free((PyObject*)pevent);
+}
+
static PyObject *pyrf_sample_event__repr(const struct pyrf_event *pevent)
{
PyObject *ret;
@@ -434,6 +440,9 @@ static int pyrf_event__setup_types(void)
pyrf_sample_event__type.tp_new =
pyrf_context_switch_event__type.tp_new =
pyrf_throttle_event__type.tp_new = PyType_GenericNew;
+
+ pyrf_sample_event__type.tp_dealloc = (destructor)pyrf_sample_event__delete,
+
err = PyType_Ready(&pyrf_mmap_event__type);
if (err < 0)
goto out;
diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c
index 73846b73d0cf4..4bb3ff4c19cab 100644
--- a/tools/perf/util/s390-cpumsf.c
+++ b/tools/perf/util/s390-cpumsf.c
@@ -513,6 +513,7 @@ static bool s390_cpumsf_make_event(size_t pos,
.period = 1
};
union perf_event event;
+ int ret;
memset(&event, 0, sizeof(event));
if (basic->CL == 1) /* Native LPAR mode */
@@ -536,8 +537,9 @@ static bool s390_cpumsf_make_event(size_t pos,
pr_debug4("%s pos:%#zx ip:%#" PRIx64 " P:%d CL:%d pid:%d.%d cpumode:%d cpu:%d\n",
__func__, pos, sample.ip, basic->P, basic->CL, sample.pid,
sample.tid, sample.cpumode, sample.cpu);
- if (perf_session__deliver_synth_event(sfq->sf->session, &event,
- &sample)) {
+ ret = perf_session__deliver_synth_event(sfq->sf->session, &event, &sample);
+ perf_sample__exit(&sample);
+ if (ret) {
pr_err("s390 Auxiliary Trace: failed to deliver event\n");
return false;
}
diff --git a/tools/perf/util/sample.c b/tools/perf/util/sample.c
new file mode 100644
index 0000000000000..605fee971f55b
--- /dev/null
+++ b/tools/perf/util/sample.c
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include "sample.h"
+#include "debug.h"
+#include <linux/zalloc.h>
+#include <stdlib.h>
+#include <string.h>
+
+void perf_sample__init(struct perf_sample *sample, bool all)
+{
+ if (all) {
+ memset(sample, 0, sizeof(*sample));
+ } else {
+ sample->user_regs = NULL;
+ sample->intr_regs = NULL;
+ }
+}
+
+void perf_sample__exit(struct perf_sample *sample)
+{
+ free(sample->user_regs);
+ free(sample->intr_regs);
+}
+
+struct regs_dump *perf_sample__user_regs(struct perf_sample *sample)
+{
+ if (!sample->user_regs) {
+ sample->user_regs = zalloc(sizeof(*sample->user_regs));
+ if (!sample->user_regs)
+ pr_err("Failure to allocate sample user_regs");
+ }
+ return sample->user_regs;
+}
+
+
+struct regs_dump *perf_sample__intr_regs(struct perf_sample *sample)
+{
+ if (!sample->intr_regs) {
+ sample->intr_regs = zalloc(sizeof(*sample->intr_regs));
+ if (!sample->intr_regs)
+ pr_err("Failure to allocate sample intr_regs");
+ }
+ return sample->intr_regs;
+}
diff --git a/tools/perf/util/sample.h b/tools/perf/util/sample.h
index 70b2c3135555e..bbf71e6406c45 100644
--- a/tools/perf/util/sample.h
+++ b/tools/perf/util/sample.h
@@ -114,14 +114,19 @@ struct perf_sample {
struct ip_callchain *callchain;
struct branch_stack *branch_stack;
u64 *branch_stack_cntr;
- struct regs_dump user_regs;
- struct regs_dump intr_regs;
+ struct regs_dump *user_regs;
+ struct regs_dump *intr_regs;
struct stack_dump user_stack;
struct sample_read read;
struct aux_sample aux_sample;
struct simd_flags simd_flags;
};
+void perf_sample__init(struct perf_sample *sample, bool all);
+void perf_sample__exit(struct perf_sample *sample);
+struct regs_dump *perf_sample__user_regs(struct perf_sample *sample);
+struct regs_dump *perf_sample__intr_regs(struct perf_sample *sample);
+
/*
* raw_data is always 4 bytes from an 8-byte boundary, so subtract 4 to get
* 8-byte alignment.
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index f1d461d47d73c..486f6d3faf017 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -745,19 +745,30 @@ static int set_regs_in_dict(PyObject *dict,
const char *arch = perf_env__arch(evsel__env(evsel));
int size = (__sw_hweight64(attr->sample_regs_intr) * MAX_REG_SIZE) + 1;
- char *bf = malloc(size);
- if (!bf)
- return -1;
+ char *bf = NULL;
- regs_map(&sample->intr_regs, attr->sample_regs_intr, arch, bf, size);
+ if (sample->intr_regs) {
+ bf = malloc(size);
+ if (!bf)
+ return -1;
- pydict_set_item_string_decref(dict, "iregs",
- _PyUnicode_FromString(bf));
+ regs_map(sample->intr_regs, attr->sample_regs_intr, arch, bf, size);
- regs_map(&sample->user_regs, attr->sample_regs_user, arch, bf, size);
+ pydict_set_item_string_decref(dict, "iregs",
+ _PyUnicode_FromString(bf));
+ }
- pydict_set_item_string_decref(dict, "uregs",
- _PyUnicode_FromString(bf));
+ if (sample->user_regs) {
+ if (!bf) {
+ bf = malloc(size);
+ if (!bf)
+ return -1;
+ }
+ regs_map(sample->user_regs, attr->sample_regs_user, arch, bf, size);
+
+ pydict_set_item_string_decref(dict, "uregs",
+ _PyUnicode_FromString(bf));
+ }
free(bf);
return 0;
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 89e5354fa094c..e9ac610d80563 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -949,7 +949,12 @@ static void regs__printf(const char *type, struct regs_dump *regs, const char *a
static void regs_user__printf(struct perf_sample *sample, const char *arch)
{
- struct regs_dump *user_regs = &sample->user_regs;
+ struct regs_dump *user_regs;
+
+ if (!sample->user_regs)
+ return;
+
+ user_regs = perf_sample__user_regs(sample);
if (user_regs->regs)
regs__printf("user", user_regs, arch);
@@ -957,7 +962,12 @@ static void regs_user__printf(struct perf_sample *sample, const char *arch)
static void regs_intr__printf(struct perf_sample *sample, const char *arch)
{
- struct regs_dump *intr_regs = &sample->intr_regs;
+ struct regs_dump *intr_regs;
+
+ if (!sample->intr_regs)
+ return;
+
+ intr_regs = perf_sample__intr_regs(sample);
if (intr_regs->regs)
regs__printf("intr", intr_regs, arch);
@@ -1340,25 +1350,30 @@ static int perf_session__deliver_event(struct perf_session *session,
const char *file_path)
{
struct perf_sample sample;
- int ret = evlist__parse_sample(session->evlist, event, &sample);
+ int ret;
+ perf_sample__init(&sample, /*all=*/false);
+ ret = evlist__parse_sample(session->evlist, event, &sample);
if (ret) {
pr_err("Can't parse sample, err = %d\n", ret);
- return ret;
+ goto out;
}
ret = auxtrace__process_event(session, event, &sample, tool);
if (ret < 0)
- return ret;
- if (ret > 0)
- return 0;
+ goto out;
+ if (ret > 0) {
+ ret = 0;
+ goto out;
+ }
ret = machines__deliver_event(&session->machines, session->evlist,
event, &sample, tool, file_offset, file_path);
if (dump_trace && sample.aux_sample.size)
auxtrace__dump_auxtrace_sample(session, &sample);
-
+out:
+ perf_sample__exit(&sample);
return ret;
}
@@ -1369,10 +1384,11 @@ static s64 perf_session__process_user_event(struct perf_session *session,
{
struct ordered_events *oe = &session->ordered_events;
const struct perf_tool *tool = session->tool;
- struct perf_sample sample = { .time = 0, };
+ struct perf_sample sample;
int fd = perf_data__fd(session->data);
s64 err;
+ perf_sample__init(&sample, /*all=*/true);
if (event->header.type != PERF_RECORD_COMPRESSED || perf_tool__compressed_is_stub(tool))
dump_event(session->evlist, event, file_offset, &sample, file_path);
@@ -1384,15 +1400,17 @@ static s64 perf_session__process_user_event(struct perf_session *session,
perf_session__set_id_hdr_size(session);
perf_session__set_comm_exec(session);
}
- return err;
+ break;
case PERF_RECORD_EVENT_UPDATE:
- return tool->event_update(tool, event, &session->evlist);
+ err = tool->event_update(tool, event, &session->evlist);
+ break;
case PERF_RECORD_HEADER_EVENT_TYPE:
/*
* Deprecated, but we need to handle it for sake
* of old data files create in pipe mode.
*/
- return 0;
+ err = 0;
+ break;
case PERF_RECORD_HEADER_TRACING_DATA:
/*
* Setup for reading amidst mmap, but only when we
@@ -1401,15 +1419,20 @@ static s64 perf_session__process_user_event(struct perf_session *session,
*/
if (!perf_data__is_pipe(session->data))
lseek(fd, file_offset, SEEK_SET);
- return tool->tracing_data(session, event);
+ err = tool->tracing_data(session, event);
+ break;
case PERF_RECORD_HEADER_BUILD_ID:
- return tool->build_id(session, event);
+ err = tool->build_id(session, event);
+ break;
case PERF_RECORD_FINISHED_ROUND:
- return tool->finished_round(tool, event, oe);
+ err = tool->finished_round(tool, event, oe);
+ break;
case PERF_RECORD_ID_INDEX:
- return tool->id_index(session, event);
+ err = tool->id_index(session, event);
+ break;
case PERF_RECORD_AUXTRACE_INFO:
- return tool->auxtrace_info(session, event);
+ err = tool->auxtrace_info(session, event);
+ break;
case PERF_RECORD_AUXTRACE:
/*
* Setup for reading amidst mmap, but only when we
@@ -1418,35 +1441,48 @@ static s64 perf_session__process_user_event(struct perf_session *session,
*/
if (!perf_data__is_pipe(session->data))
lseek(fd, file_offset + event->header.size, SEEK_SET);
- return tool->auxtrace(session, event);
+ err = tool->auxtrace(session, event);
+ break;
case PERF_RECORD_AUXTRACE_ERROR:
perf_session__auxtrace_error_inc(session, event);
- return tool->auxtrace_error(session, event);
+ err = tool->auxtrace_error(session, event);
+ break;
case PERF_RECORD_THREAD_MAP:
- return tool->thread_map(session, event);
+ err = tool->thread_map(session, event);
+ break;
case PERF_RECORD_CPU_MAP:
- return tool->cpu_map(session, event);
+ err = tool->cpu_map(session, event);
+ break;
case PERF_RECORD_STAT_CONFIG:
- return tool->stat_config(session, event);
+ err = tool->stat_config(session, event);
+ break;
case PERF_RECORD_STAT:
- return tool->stat(session, event);
+ err = tool->stat(session, event);
+ break;
case PERF_RECORD_STAT_ROUND:
- return tool->stat_round(session, event);
+ err = tool->stat_round(session, event);
+ break;
case PERF_RECORD_TIME_CONV:
session->time_conv = event->time_conv;
- return tool->time_conv(session, event);
+ err = tool->time_conv(session, event);
+ break;
case PERF_RECORD_HEADER_FEATURE:
- return tool->feature(session, event);
+ err = tool->feature(session, event);
+ break;
case PERF_RECORD_COMPRESSED:
err = tool->compressed(session, event, file_offset, file_path);
if (err)
dump_event(session->evlist, event, file_offset, &sample, file_path);
- return err;
+ break;
case PERF_RECORD_FINISHED_INIT:
- return tool->finished_init(session, event);
+ err = tool->finished_init(session, event);
+ break;
default:
- return -EINVAL;
+ err = -EINVAL;
+ break;
}
+ perf_sample__exit(&sample);
+ return err;
}
int perf_session__deliver_synth_event(struct perf_session *session,
diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
index 660689968b795..5513568d7f8cc 100644
--- a/tools/perf/util/synthetic-events.c
+++ b/tools/perf/util/synthetic-events.c
@@ -1508,9 +1508,9 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
}
if (type & PERF_SAMPLE_REGS_USER) {
- if (sample->user_regs.abi) {
+ if (sample->user_regs && sample->user_regs->abi) {
result += sizeof(u64);
- sz = hweight64(sample->user_regs.mask) * sizeof(u64);
+ sz = hweight64(sample->user_regs->mask) * sizeof(u64);
result += sz;
} else {
result += sizeof(u64);
@@ -1536,9 +1536,9 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
result += sizeof(u64);
if (type & PERF_SAMPLE_REGS_INTR) {
- if (sample->intr_regs.abi) {
+ if (sample->intr_regs && sample->intr_regs->abi) {
result += sizeof(u64);
- sz = hweight64(sample->intr_regs.mask) * sizeof(u64);
+ sz = hweight64(sample->intr_regs->mask) * sizeof(u64);
result += sz;
} else {
result += sizeof(u64);
@@ -1703,10 +1703,10 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, u64 read_fo
}
if (type & PERF_SAMPLE_REGS_USER) {
- if (sample->user_regs.abi) {
- *array++ = sample->user_regs.abi;
- sz = hweight64(sample->user_regs.mask) * sizeof(u64);
- memcpy(array, sample->user_regs.regs, sz);
+ if (sample->user_regs && sample->user_regs->abi) {
+ *array++ = sample->user_regs->abi;
+ sz = hweight64(sample->user_regs->mask) * sizeof(u64);
+ memcpy(array, sample->user_regs->regs, sz);
array = (void *)array + sz;
} else {
*array++ = 0;
@@ -1739,10 +1739,10 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, u64 read_fo
}
if (type & PERF_SAMPLE_REGS_INTR) {
- if (sample->intr_regs.abi) {
- *array++ = sample->intr_regs.abi;
- sz = hweight64(sample->intr_regs.mask) * sizeof(u64);
- memcpy(array, sample->intr_regs.regs, sz);
+ if (sample->intr_regs && sample->intr_regs->abi) {
+ *array++ = sample->intr_regs->abi;
+ sz = hweight64(sample->intr_regs->mask) * sizeof(u64);
+ memcpy(array, sample->intr_regs->regs, sz);
array = (void *)array + sz;
} else {
*array++ = 0;
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index 216f0d3762fda..ef1c6afc9f18d 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -190,7 +190,10 @@ static bool memory_read(Dwfl *dwfl __maybe_unused, Dwarf_Addr addr, Dwarf_Word *
int offset;
int ret;
- ret = perf_reg_value(&start, &ui->sample->user_regs,
+ if (!ui->sample->user_regs)
+ return false;
+
+ ret = perf_reg_value(&start, ui->sample->user_regs,
perf_arch_reg_sp(arch));
if (ret)
return false;
@@ -273,7 +276,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
Dwarf_Word ip;
int err = -EINVAL, i;
- if (!data->user_regs.regs)
+ if (!data->user_regs || !data->user_regs->regs)
return -EINVAL;
ui = zalloc(sizeof(ui_buf) + sizeof(ui_buf.entries[0]) * max_stack);
@@ -286,7 +289,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
if (!ui->dwfl)
goto out;
- err = perf_reg_value(&ip, &data->user_regs, perf_arch_reg_ip(arch));
+ err = perf_reg_value(&ip, data->user_regs, perf_arch_reg_ip(arch));
if (err)
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0171/1756] perf jitdump: Free event in jit_repipe_code_move()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (169 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0170/1756] perf sample: Make user_regs and intr_regs optional Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0172/1756] perf: replace strcpy() with strncpy() in util/jitdump.c Greg Kroah-Hartman
` (827 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 7fc5851aac606b9e4143f6857710cc5f346770c5 ]
jit_repipe_code_move() allocates a perf_event with calloc but never
frees it — the 'out' label exits with only perf_sample__exit().
The sibling function jit_repipe_code_load() correctly calls
free(event) at its out label. Add the same free(event) to
jit_repipe_code_move().
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index eebfe0d9b948c..e37182242b977 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -668,6 +668,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
build_id__mark_dso_hit(tool, event, &sample, NULL, jd->machine);
out:
perf_sample__exit(&sample);
+ free(event);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0172/1756] perf: replace strcpy() with strncpy() in util/jitdump.c
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (170 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0171/1756] perf jitdump: Free event in jit_repipe_code_move() Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0173/1756] perf jitdump: Use dirname() return value in jit_open() Greg Kroah-Hartman
` (826 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hrishikesh Suresh, Namhyung Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hrishikesh Suresh <hrishikesh123s@gmail.com>
[ Upstream commit 9bef5cead63d5d8fad3ba7ebaf26f3f4ee172c82 ]
Usage of strcpy() can lead to buffer overflows. Therefore, it has been
replaced with strncpy(). The output file path is provided as a parameter
and might be restricted by command-line by default. But this defensive
patch will prevent any potential overflow, making the code more robust
against future changes in input handling.
Testing:
- ran perf test from tools/perf and did not observe any regression with
the earlier code
Signed-off-by: Hrishikesh Suresh <hrishikesh123s@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Stable-dep-of: 4eddf7d9e341 ("perf jitdump: Use dirname() return value in jit_open()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index e37182242b977..48749561c77f6 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -238,7 +238,8 @@ jit_open(struct jit_buf_desc *jd, const char *name)
/*
* keep dirname for generating files and mmap records
*/
- strcpy(jd->dir, name);
+ strncpy(jd->dir, name, PATH_MAX);
+ jd->dir[PATH_MAX - 1] = '\0';
dirname(jd->dir);
free(buf);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0173/1756] perf jitdump: Use dirname() return value in jit_open()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (171 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0172/1756] perf: replace strcpy() with strncpy() in util/jitdump.c Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0174/1756] perf jitdump: Validate debug entries on native (non-swap) path Greg Kroah-Hartman
` (825 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 4eddf7d9e341eb8c41704b8aa27b4a91f4e2c7c9 ]
jit_open() calls dirname(jd->dir) but ignores the return value. POSIX
says dirname() may return a pointer to internal static storage — glibc
does this when the path has no '/', returning "." from a static buffer
and leaving jd->dir unchanged with the original filename.
Capture the return value and copy it back to jd->dir when dirname()
returns a different pointer.
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 48749561c77f6..d118a39fb2058 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -145,6 +145,7 @@ jit_open(struct jit_buf_desc *jd, const char *name)
ssize_t bs, bsz = 0;
void *n, *buf = NULL;
int ret, retval = -1;
+ char *dname;
nsinfo__mountns_enter(jd->nsi, &nsc);
jd->in = fopen(name, "r");
@@ -240,7 +241,9 @@ jit_open(struct jit_buf_desc *jd, const char *name)
*/
strncpy(jd->dir, name, PATH_MAX);
jd->dir[PATH_MAX - 1] = '\0';
- dirname(jd->dir);
+ dname = dirname(jd->dir);
+ if (dname != jd->dir)
+ strlcpy(jd->dir, dname, sizeof(jd->dir));
free(buf);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0174/1756] perf jitdump: Validate debug entries on native (non-swap) path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (172 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0173/1756] perf jitdump: Use dirname() return value in jit_open() Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0175/1756] perf jitdump: Validate sym string NUL-termination in code load Greg Kroah-Hartman
` (824 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 51e14e495f0cea061bbad33e7635f7fd857113ad ]
The bounds-checking and nr_entry clamping added for the byte-swap path
only runs when jd->needs_bswap is true. On native-endian files, nr_entry
passes through unvalidated to jit_repipe_debug_info(), which stores it
as jd->nr_debug_entries. Downstream, jit_process_debug_info() in
genelf_debug.c iterates nr_debug_entries times via debug_entry_next(),
which calls strlen() on each entry's name field — a crafted nr_entry
causes OOB reads and writes.
Add bounds-checked iteration in jit_repipe_debug_info() that validates
each debug_entry fits in the payload and its name is NUL-terminated
before calling debug_entry_next(). Clamp nr_debug_entries to the count
of valid entries.
Fixes: 598b7c6919c7bbcc ("perf jit: add source line info support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index d118a39fb2058..5c684db97fce2 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -678,8 +678,10 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
static int jit_repipe_debug_info(struct jit_buf_desc *jd, union jr_entry *jr)
{
- void *data;
- size_t sz;
+ struct debug_entry *ent;
+ void *data, *end;
+ size_t sz, valid;
+ uint64_t i;
if (!(jd && jr))
return -1;
@@ -699,10 +701,25 @@ static int jit_repipe_debug_info(struct jit_buf_desc *jd, union jr_entry *jr)
jd->debug_data = data;
/*
- * we must use nr_entry instead of size here because
- * we cannot distinguish actual entry from padding otherwise
+ * Clamp nr_debug_entries to entries that actually fit in the
+ * payload. The byte-swap path already does this for cross-endian
+ * files; validate on the native path too, since downstream
+ * jit_process_debug_info() iterates via debug_entry_next() which
+ * calls strlen() on each entry's name field.
*/
- jd->nr_debug_entries = jr->info.nr_entry;
+ end = data + sz;
+ ent = data;
+ valid = 0;
+ for (i = 0; i < jr->info.nr_entry; i++) {
+ if ((void *)ent + sizeof(*ent) > end)
+ break;
+ /* name must be NUL-terminated within the payload */
+ if (!memchr(ent->name, '\0', (char *)end - ent->name))
+ break;
+ ent = debug_entry_next(ent);
+ valid++;
+ }
+ jd->nr_debug_entries = valid;
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0175/1756] perf jitdump: Validate sym string NUL-termination in code load
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (173 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0174/1756] perf jitdump: Validate debug entries on native (non-swap) path Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0176/1756] perf jitdump: Validate unwinding sizes against record payload Greg Kroah-Hartman
` (823 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stephane Eranian, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 98bfe1142ccbaa5ffdca5dcdddd26f238ad33585 ]
jit_repipe_code_load() computes sym = (void *)jr + sizeof(jr->load) and
passes it to jit_emit_elf() which calls strlen(sym) via jit_write_elf().
If code_size equals total_size - sizeof(jr->load), the sym pointer
aliases the code blob with no NUL terminator, and strlen() scans past
the buffer into adjacent heap memory.
Add a memchr() check to verify the symbol name is NUL-terminated within
the region between the load header and the code blob before use.
Fixes: 598b7c6919c7bbcc ("perf jit: add source line info support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 5c684db97fce2..4cbae8a02d2d9 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -486,6 +486,13 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
sym = (void *)((unsigned long)jr + sizeof(jr->load));
code = (unsigned long)jr + jr->load.p.total_size - csize;
+
+ /* sym string lives between the load header and the code blob */
+ if (!memchr(sym, '\0', code - (unsigned long)sym)) {
+ pr_warning("jitdump: unterminated symbol name in code_load record\n");
+ return -1;
+ }
+
count = jr->load.code_index;
idr_size = jd->machine->id_hdr_size;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0176/1756] perf jitdump: Validate unwinding sizes against record payload
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (174 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0175/1756] perf jitdump: Validate sym string NUL-termination in code load Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0177/1756] remoteproc: qcom_q6v5_adsp: Fix double jiffies conversion in adsp_start() Greg Kroah-Hartman
` (822 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Stefano Sanfilippo, Stephane Eranian, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 92d50319b4f0c0bbee8a236a09063272cd22faab ]
jit_repipe_unwinding_info() copies unwinding_size and eh_frame_hdr_size
from the jitdump record into jd-> fields without checking them against
the actual payload size. Downstream, jit_add_eh_frame_info() in
genelf.c computes unwinding_table_size = unwinding_size -
eh_frame_hdr_size, which underflows when eh_frame_hdr_size >
unwinding_size. The result is passed as d->d_size to libelf, causing
an OOB heap read into the output ELF file.
Validate that unwinding_size fits within the record payload and that
eh_frame_hdr_size does not exceed unwinding_size before allocating or
storing the values, so a bogus record cannot force a large allocation
that is then discarded.
mapped_size is likewise taken from the record and was narrowed into an
int for the mmap2 len computation in jit_repipe_code_load() and
jit_repipe_code_move(); values above INT_MAX would turn negative,
producing a wrong mmap2 length. Use uint64_t for usize so the value
cannot truncate.
Fixes: 0284fecd13b6db3e ("perf jit: Add unwinding support")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Stefano Sanfilippo <ssanfilippo@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/jitdump.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 4cbae8a02d2d9..ea2440a5fbcb1 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -461,7 +461,8 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
u16 idr_size;
const char *sym;
uint64_t count;
- int ret, csize, usize;
+ int ret, csize;
+ uint64_t usize;
pid_t nspid, pid, tid;
struct {
u32 pid, tid;
@@ -542,7 +543,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
event->mmap2.pgoff = GEN_ELF_TEXT_OFFSET;
event->mmap2.start = addr;
- event->mmap2.len = usize ? ALIGN_8(csize) + usize : csize;
+ event->mmap2.len = usize ? ALIGN_8((uint64_t)csize) + usize : (uint64_t)csize;
event->mmap2.pid = pid;
event->mmap2.tid = tid;
event->mmap2.ino = st.st_ino;
@@ -596,7 +597,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
char *filename;
size_t size;
struct stat st;
- int usize;
+ uint64_t usize;
u16 idr_size;
int ret;
pid_t nspid, pid, tid;
@@ -745,6 +746,18 @@ jit_repipe_unwinding_info(struct jit_buf_desc *jd, union jr_entry *jr)
return -1;
unwinding_data_size = jr->prefix.total_size - sizeof(jr->unwinding);
+
+ /*
+ * Validate sizes before allocating — jit_add_eh_frame_info()
+ * computes unwinding_size - eh_frame_hdr_size and uses the
+ * result as a buffer length for libelf.
+ */
+ if (jr->unwinding.unwinding_size > unwinding_data_size ||
+ jr->unwinding.eh_frame_hdr_size > jr->unwinding.unwinding_size) {
+ pr_warning("jitdump: invalid unwinding sizes in unwinding_info record\n");
+ return -1;
+ }
+
unwinding_data = malloc(unwinding_data_size);
if (!unwinding_data)
return -1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0177/1756] remoteproc: qcom_q6v5_adsp: Fix double jiffies conversion in adsp_start()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (175 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0176/1756] perf jitdump: Validate unwinding sizes against record payload Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0178/1756] arm64: dts: qcom: sdm845-sony-xperia-tama: Fix Bluetooth UART pinctrl Greg Kroah-Hartman
` (821 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anup Vishwakarma, Konrad Dybcio,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
[ Upstream commit f559ef6316971fe39dc5f5edd6a483429ba03768 ]
adsp_start() computes 5 * HZ, an already-converted jiffies count, and
passes it into msecs_to_jiffies(), which expects milliseconds --
reinterpreting the value and shrinking the intended timeout. Every
other caller (q6v5_start() in qcom_q6v5_mss.c, qcom_pas_start() in
qcom_q6v5_pas.c) passes msecs_to_jiffies(5000) directly, matching
qcom_q6v5_wait_for_start()'s kerneldoc, which documents @timeout as
already being in jiffies.
On CONFIG_HZ=250 this shrinks the intended 5 second timeout to
~1.25 seconds, causing a DSP that legitimately takes 2-3 seconds to
signal ready to be spuriously torn down as a boot failure.
Fix by passing msecs_to_jiffies(5000) directly, matching every other
caller.
Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260831-b4-adsp_start_jiffies_fix_upstream-v1-1-9f8cf85ea220@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/qcom_q6v5_adsp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 13c9898447b2d..a9caa028a7397 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -430,7 +430,7 @@ static int adsp_start(struct rproc *rproc)
goto disable_adsp_clks;
}
- ret = qcom_q6v5_wait_for_start(&adsp->q6v5, msecs_to_jiffies(5 * HZ));
+ ret = qcom_q6v5_wait_for_start(&adsp->q6v5, msecs_to_jiffies(5000));
if (ret == -ETIMEDOUT) {
dev_err(adsp->dev, "start timed out\n");
goto disable_adsp_clks;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0178/1756] arm64: dts: qcom: sdm845-sony-xperia-tama: Fix Bluetooth UART pinctrl
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (176 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0177/1756] remoteproc: qcom_q6v5_adsp: Fix double jiffies conversion in adsp_start() Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0179/1756] remoteproc: xlnx: Initialize mailbox work before requesting channels Greg Kroah-Hartman
` (820 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shujath Mohd, Konrad Dybcio,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shujath Mohd <shujath@outlook.in>
[ Upstream commit cd0f33393882e2554d46e8e068ab95d00593f385 ]
Use the 4-pin UART6 pinctrl configuration for the WCN3990 Bluetooth
controller on Sony Xperia Tama devices.
This enables the UART hardware flow control required for reliable
Bluetooth communication at higher baud rates.
Fixes: d54331131cde ("arm64: dts: qcom: sdm845-sony-xperia-tama: Add bluetooth")
Fixes: 30a7f99befc6 ("arm64: dts: qcom: Add support for SONY Xperia XZ2 / XZ2C / XZ3 (Tama platform)")
Signed-off-by: Shujath Mohd <shujath@outlook.in>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/PUZPR01MB51413F6FF89A8FA82A9B2755C3A02@PUZPR01MB5141.apcprd01.prod.exchangelabs.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi
index b02a1dc5fecd6..4c01c43023fdd 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi
@@ -758,6 +758,8 @@ int-pins {
};
&uart6 {
+ pinctrl-0 = <&qup_uart6_4pin>;
+
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0179/1756] remoteproc: xlnx: Initialize mailbox work before requesting channels
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (177 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0178/1756] arm64: dts: qcom: sdm845-sony-xperia-tama: Fix Bluetooth UART pinctrl Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0180/1756] lsm: dont call security_backing_file_free() multiple times Greg Kroah-Hartman
` (819 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Runyu Xiao, Mathieu Poirier,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Runyu Xiao <runyu.xiao@seu.edu.cn>
[ Upstream commit 5ca7dea7cb2e47f42c15ac7206c5e0cba23d292d ]
zynqmp_r5_setup_mbox() installs zynqmp_r5_mb_rx_cb() as the mailbox RX
callback before requesting the mailbox channels, but initializes
ipi->mbox_work only after both channels have been requested. Once the RX
channel is active, a notification delivered before the late INIT_WORK()
would make the callback queue an uninitialized work item.
Initialize the work item before requesting channels. Also drain the work
before freeing the mailbox state, after the channels have been released so
no new callbacks can queue it. Use the same drain before freeing ipi from
the channel request error paths, since the callback is already published
there as well.
This issue was found by our static analysis tool and then confirmed by
manual review of the mailbox setup sequence. The callback is published
before the channel requests complete, so the work item should be ready
before the mailbox provider can invoke it.
A QEMU PoC modeled a mailbox notification delivered after the RX callback
became reachable but before the delayed INIT_WORK(). DEBUG_OBJECTS reported
queueing an uninitialized work item from the zynqmp_r5_setup_mbox() path.
This is sent as an RFC because the practical trigger depends on the ZynqMP
IPI mailbox provider and firmware delivery timing. If the provider cannot
invoke the RX callback until after setup returns, this is a defensive
lifecycle cleanup rather than a reachable race on current systems.
Fixes: 5dfb28c257b7 ("remoteproc: xilinx: Add mailbox channels for rpmsg")
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Link: https://lore.kernel.org/r/20260818101201.1603947-1-runyu.xiao@seu.edu.cn
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/xlnx_r5_remoteproc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index 88561f282f9bc..fd682c9c24ba9 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -271,6 +271,8 @@ static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev)
if (!ipi)
return NULL;
+ INIT_WORK(&ipi->mbox_work, handle_event_notified);
+
mbox_cl = &ipi->mbox_cl;
mbox_cl->rx_callback = zynqmp_r5_mb_rx_cb;
mbox_cl->tx_block = false;
@@ -282,6 +284,7 @@ static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev)
ipi->tx_chan = mbox_request_channel_byname(mbox_cl, "tx");
if (IS_ERR(ipi->tx_chan)) {
ipi->tx_chan = NULL;
+ cancel_work_sync(&ipi->mbox_work);
kfree(ipi);
dev_warn(cdev, "mbox tx channel request failed\n");
return NULL;
@@ -292,13 +295,12 @@ static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev)
mbox_free_channel(ipi->tx_chan);
ipi->rx_chan = NULL;
ipi->tx_chan = NULL;
+ cancel_work_sync(&ipi->mbox_work);
kfree(ipi);
dev_warn(cdev, "mbox rx channel request failed\n");
return NULL;
}
- INIT_WORK(&ipi->mbox_work, handle_event_notified);
-
return ipi;
}
@@ -317,6 +319,8 @@ static void zynqmp_r5_free_mbox(struct mbox_info *ipi)
ipi->rx_chan = NULL;
}
+ cancel_work_sync(&ipi->mbox_work);
+
kfree(ipi);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0180/1756] lsm: dont call security_backing_file_free() multiple times
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (178 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0179/1756] remoteproc: xlnx: Initialize mailbox work before requesting channels Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0181/1756] ASoC: wcd-mbhc-v2: Fix incorrect properties names and typos Greg Kroah-Hartman
` (818 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cai Xinchen, Paul Moore, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cai Xinchen <caixinchen1@huawei.com>
[ Upstream commit 3a84fc1a21577dbc8da7e4b6a49c9d8b07c07000 ]
I found the following path:
alloc_empty_backing-file
init_file(&ff->file, xxx)
-> file_ref_init(&f->f_ref, 1); // only 1
error = init_backing_file
-> security_backing_file_alloc
-> rc = call_int_hook(backing_file_alloc, ...)
if (unlikely(rc))
security_backing_file_free(backing_file); // first call
if (unlikely(error)) {
fput(&ff->file);
-> if (unlikely(file_ref_put(&file->f_ref))) // zero
__fput_deferred(file);
-> ____fput -> __fput -> file_free(file);
-> backing_file_free(backing_file(f));
-> security_backing_file_free(&ff->file); // second call
Currently, only SELinux has the lsm backing_file_alloc hook, and it always
return 0. When security_backing_file_free is called for the first time,
the blobs pointer is set to NULL. Therefore, double free will not occur in
the code.
Fixes: 6af36aeb147a ("lsm: add backing_file LSM hooks")
Signed-off-by: Cai Xinchen <caixinchen1@huawei.com>
[PM: subject line tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
security/security.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/security/security.c b/security/security.c
index b31fd25f4e5e3..8e11b0793b8fc 100644
--- a/security/security.c
+++ b/security/security.c
@@ -2967,9 +2967,8 @@ void security_backing_file_free(struct file *backing_file)
{
void *blob = backing_file_security(backing_file);
- call_void_hook(backing_file_free, backing_file);
-
if (blob) {
+ call_void_hook(backing_file_free, backing_file);
backing_file_set_security(backing_file, NULL);
kmem_cache_free(lsm_backing_file_cache, blob);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0181/1756] ASoC: wcd-mbhc-v2: Fix incorrect properties names and typos
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (179 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0180/1756] lsm: dont call security_backing_file_free() multiple times Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0182/1756] pwm: renesas-tpu: Fix runtime PM reference leak Greg Kroah-Hartman
` (817 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Heidelberg, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Heidelberg <david@ixit.cz>
[ Upstream commit 17bca5d55446c1e21944d47354ee2f0b80db36d6 ]
Improves debugging experience.
Fixes: 0e5c9e7ff899 ("ASoC: codecs: wcd: add multi button Headset detection support")
Signed-off-by: David Heidelberg <david@ixit.cz>
Link: https://patch.msgid.link/20260823-wcd-dt-typo-fix-v1-1-a71b458e0d31@ixit.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wcd-mbhc-v2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index d589a212b7688..bfd20303c9cc5 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -865,7 +865,7 @@ static int wcd_measure_adc_continuous(struct wcd_mbhc *mbhc)
u8 adc_en;
/* Pre-requisites for ADC continuous measurement */
- /* Read legacy electircal detection and disable */
+ /* Read legacy electrical detection and disable */
wcd_mbhc_write_field(mbhc, WCD_MBHC_ELECT_SCHMT_ISRC, 0x00);
/* Set ADC to continuous measurement */
wcd_mbhc_write_field(mbhc, WCD_MBHC_ADC_MODE, 1);
@@ -966,7 +966,7 @@ static int wcd_check_cross_conn(struct wcd_mbhc *mbhc)
if (wcd_mbhc_read_field(mbhc, WCD_MBHC_HPH_PA_EN))
return -EINVAL;
- /* Read legacy electircal detection and disable */
+ /* Read legacy electrical detection and disable */
elect_ctl = wcd_mbhc_read_field(mbhc, WCD_MBHC_ELECT_SCHMT_ISRC);
wcd_mbhc_write_field(mbhc, WCD_MBHC_ELECT_SCHMT_ISRC, 0);
@@ -1472,14 +1472,14 @@ int wcd_dt_parse_mbhc_data(struct device *dev, struct wcd_mbhc_config *cfg)
ret = of_property_read_u32(np, "qcom,mbhc-headset-vthreshold-microvolt",
µvolt);
if (ret)
- dev_dbg(dev, "missing qcom,mbhc-hs-mic-max-vthreshold--microvolt in dt node\n");
+ dev_dbg(dev, "missing qcom,mbhc-headset-vthreshold-microvolt in dt node\n");
else
cfg->hs_thr = microvolt/1000;
ret = of_property_read_u32(np, "qcom,mbhc-headphone-vthreshold-microvolt",
µvolt);
if (ret)
- dev_dbg(dev, "missing qcom,mbhc-hs-mic-min-vthreshold-microvolt entry\n");
+ dev_dbg(dev, "missing qcom,mbhc-headphone-vthreshold-microvolt entry\n");
else
cfg->hph_thr = microvolt/1000;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0182/1756] pwm: renesas-tpu: Fix runtime PM reference leak
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (180 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0181/1756] ASoC: wcd-mbhc-v2: Fix incorrect properties names and typos Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0183/1756] spi: omap2-mcspi: Remove unbalanced pm_runtime_put_sync() calls Greg Kroah-Hartman
` (816 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ruoyu Wang, Uwe Kleine-König,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <ruoyuw560@gmail.com>
[ Upstream commit 62cff15fbf2b12ebbb0b01ca720030c2bc12aed1 ]
tpu_pwm_timer_start() used pm_runtime_get_sync() without checking its
return value before touching the TPU clock. A failed runtime resume was
therefore ignored, and the callback continued into register access.
Use pm_runtime_resume_and_get() and propagate a failed resume. Keep the
matching put when clock preparation fails after a successful resume.
tpu_pwm_disable() also needs to propagate a failed start so that the PWM
apply callback does not access registers while runtime PM is inactive.
This issue was found by a static analysis checker and confirmed by manual
source review.
Fixes: 99b82abb0a35 ("pwm: Add Renesas TPU PWM driver")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Link: https://patch.msgid.link/20260814134143.1388120-1-ruoyuw560@gmail.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pwm/pwm-renesas-tpu.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
index 2196080b41770..c0bbe275275c8 100644
--- a/drivers/pwm/pwm-renesas-tpu.c
+++ b/drivers/pwm/pwm-renesas-tpu.c
@@ -149,10 +149,14 @@ static int tpu_pwm_timer_start(struct tpu_pwm_device *tpd)
if (!tpd->timer_on) {
/* Wake up device and enable clock. */
- pm_runtime_get_sync(&tpd->tpu->pdev->dev);
+ ret = pm_runtime_resume_and_get(&tpd->tpu->pdev->dev);
+ if (ret < 0)
+ return ret;
+
ret = clk_prepare_enable(tpd->tpu->clk);
if (ret) {
dev_err(&tpd->tpu->pdev->dev, "cannot enable clock\n");
+ pm_runtime_put(&tpd->tpu->pdev->dev);
return ret;
}
tpd->timer_on = true;
@@ -382,15 +386,21 @@ static int tpu_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
return 0;
}
-static void tpu_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
+static int tpu_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
{
struct tpu_device *tpu = to_tpu_device(chip);
struct tpu_pwm_device *tpd = &tpu->tpd[pwm->hwpwm];
+ int ret;
/* The timer must be running to modify the pin output configuration. */
- tpu_pwm_timer_start(tpd);
+ ret = tpu_pwm_timer_start(tpd);
+ if (ret < 0)
+ return ret;
+
tpu_pwm_set_pin(tpd, TPU_PIN_INACTIVE);
tpu_pwm_timer_stop(tpd);
+
+ return 0;
}
static int tpu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
@@ -401,7 +411,10 @@ static int tpu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (state->polarity != pwm->state.polarity) {
if (enabled) {
- tpu_pwm_disable(chip, pwm);
+ err = tpu_pwm_disable(chip, pwm);
+ if (err)
+ return err;
+
enabled = false;
}
@@ -412,7 +425,7 @@ static int tpu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (!state->enabled) {
if (enabled)
- tpu_pwm_disable(chip, pwm);
+ return tpu_pwm_disable(chip, pwm);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0183/1756] spi: omap2-mcspi: Remove unbalanced pm_runtime_put_sync() calls
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (181 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0182/1756] pwm: renesas-tpu: Fix runtime PM reference leak Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0184/1756] soc: qcom: apr: clean up failed service registrations Greg Kroah-Hartman
` (815 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Gu, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 5f01cb141169fe422c42279f7d502479b1ff9fd2 ]
pm_runtime_put_sync() is called in the probe error path and in remove
when nothing holds a runtime PM reference anymore, so it underflows
the usage count.
Fixes: 0e6f357a5deb ("spi: omap2-mcspi: Fix PM regression with deferred probe for pm_runtime_reinit")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260826-mcspi-v1-1-0a8dd7f6dd56@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-omap2-mcspi.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 1fa632eb0018b..b84b1b67d9693 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1595,7 +1595,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
disable_pm:
pm_runtime_dont_use_autosuspend(&pdev->dev);
- pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
free_ctlr:
omap2_mcspi_release_dma(ctlr);
@@ -1615,7 +1614,6 @@ static void omap2_mcspi_remove(struct platform_device *pdev)
omap2_mcspi_release_dma(ctlr);
pm_runtime_dont_use_autosuspend(mcspi->dev);
- pm_runtime_put_sync(mcspi->dev);
pm_runtime_disable(&pdev->dev);
spi_controller_put(ctlr);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0184/1756] soc: qcom: apr: clean up failed service registrations
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (182 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0183/1756] spi: omap2-mcspi: Remove unbalanced pm_runtime_put_sync() calls Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0185/1756] platform/chrome: cros_ec_proto: Fix deferred response Greg Kroah-Hartman
` (814 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongyan Xu, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongyan Xu <getshell@seu.edu.cn>
[ Upstream commit 7dc14f37ca4ee35040c67c4b0180dd7b32079caf ]
apr_add_device() publishes a service in svcs_idr before parsing the
optional protection domain and registering the device. If device
registration fails, put_device() frees the apr_device while its service
remains in the IDR. A received packet can then dereference that stale
entry. The property error path also leaves the service and allocation
behind.
Split device_register() into device_initialize() and device_add() so every
pre-registration error can safely drop the device reference. Remove the
service from the IDR on all failures after publication, then drain the RX
workqueue before dropping the device reference. This prevents an in-flight
lookup from outliving the device.
Fixes: 6adba21eb434 ("soc: qcom: Add APR bus driver")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
Link: https://lore.kernel.org/r/20260806060541.820-1-getshell@seu.edu.cn
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/qcom/apr.c | 44 +++++++++++++++++++++++++++---------------
1 file changed, 28 insertions(+), 16 deletions(-)
diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c
index a956c407ce030..b80cf8f417b03 100644
--- a/drivers/soc/qcom/apr.c
+++ b/drivers/soc/qcom/apr.c
@@ -434,31 +434,35 @@ static int apr_add_device(struct device *dev, struct device_node *np,
if (np)
snprintf(adev->name, APR_NAME_SIZE, "%pOFn", np);
+ adev->dev.bus = &aprbus;
+ adev->dev.parent = dev;
+ adev->dev.of_node = np;
+ adev->dev.release = apr_dev_release;
+ adev->dev.driver = NULL;
+ device_initialize(&adev->dev);
+
switch (apr->type) {
case PR_TYPE_APR:
- dev_set_name(&adev->dev, "aprsvc:%s:%x:%x", adev->name,
- domain_id, svc_id);
+ ret = dev_set_name(&adev->dev, "aprsvc:%s:%x:%x", adev->name,
+ domain_id, svc_id);
break;
case PR_TYPE_GPR:
- dev_set_name(&adev->dev, "gprsvc:%s:%x:%x", adev->name,
- domain_id, svc_id);
+ ret = dev_set_name(&adev->dev, "gprsvc:%s:%x:%x", adev->name,
+ domain_id, svc_id);
break;
default:
+ ret = -EINVAL;
break;
}
-
- adev->dev.bus = &aprbus;
- adev->dev.parent = dev;
- adev->dev.of_node = np;
- adev->dev.release = apr_dev_release;
- adev->dev.driver = NULL;
+ if (ret)
+ goto out_put_device;
spin_lock(&apr->svcs_lock);
ret = idr_alloc(&apr->svcs_idr, svc, svc_id, svc_id + 1, GFP_ATOMIC);
spin_unlock(&apr->svcs_lock);
if (ret < 0) {
dev_err(dev, "idr_alloc failed: %d\n", ret);
- goto out;
+ goto out_put_device;
}
/* Protection domain is optional, it does not exist on older platforms */
@@ -466,18 +470,26 @@ static int apr_add_device(struct device *dev, struct device_node *np,
1, &adev->service_path);
if (ret < 0 && ret != -EINVAL) {
dev_err(dev, "Failed to read second value of qcom,protection-domain\n");
- goto out;
+ goto out_remove_idr;
}
dev_info(dev, "Adding APR/GPR dev: %s\n", dev_name(&adev->dev));
- ret = device_register(&adev->dev);
+ ret = device_add(&adev->dev);
if (ret) {
- dev_err(dev, "device_register failed: %d\n", ret);
- put_device(&adev->dev);
+ dev_err(dev, "device_add failed: %d\n", ret);
+ goto out_remove_idr;
}
-out:
+ return 0;
+
+out_remove_idr:
+ spin_lock(&apr->svcs_lock);
+ idr_remove(&apr->svcs_idr, svc_id);
+ spin_unlock(&apr->svcs_lock);
+ flush_workqueue(apr->rxwq);
+out_put_device:
+ put_device(&adev->dev);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0185/1756] platform/chrome: cros_ec_proto: Fix deferred response
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (183 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0184/1756] soc: qcom: apr: clean up failed service registrations Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0186/1756] staging: rtl8723bs: change remaining printk to proper api Greg Kroah-Hartman
` (813 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rob Barnes, Tzung-Bi Shih,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Barnes <robbarnes@google.com>
[ Upstream commit c55749415623a58eba3eb527da023d29b43fbf5d ]
When cros_ec_wait_until_complete() succeeds after an
EC_RES_IN_PROGRESS status, it previously returned the 4-byte
transfer size of EC_CMD_GET_COMMS_STATUS. For 0-byte payload
commands (such as EC_CMD_FLASH_ERASE), userspace received 4
bytes instead of 0, causing response size validation errors.
For commands expecting non-zero response payloads, the kernel
exited without issuing EC_CMD_RESEND_RESPONSE, leaving response
buffers uninitialized.
Refactor cros_ec_wait_until_complete() to pass orig_msg, issue
EC_CMD_RESEND_RESPONSE into orig_msg->data when insize > 0, and
return 0 for 0-byte response commands.
Fixes: 2c7589af3c4d ("mfd: cros_ec: add proto v3 skeleton")
Signed-off-by: Rob Barnes <robbarnes@google.com>
Link: https://lore.kernel.org/r/20260901005126.3344929-1-robbarnes@google.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/chrome/cros_ec_proto.c | 32 +++-
drivers/platform/chrome/cros_ec_proto_test.c | 158 ++++++++++++++++++-
2 files changed, 183 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
index 5c9a53dffcf95..6eaa6fd06d915 100644
--- a/drivers/platform/chrome/cros_ec_proto.c
+++ b/drivers/platform/chrome/cros_ec_proto.c
@@ -135,7 +135,8 @@ static int cros_ec_xfer_command(struct cros_ec_device *ec_dev, struct cros_ec_co
return ret;
}
-static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t *result)
+static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev,
+ struct cros_ec_command *orig_msg)
{
struct {
struct cros_ec_command msg;
@@ -160,7 +161,7 @@ static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t *
if (ret < 0)
return ret;
- *result = msg->result;
+ orig_msg->result = msg->result;
if (msg->result != EC_RES_SUCCESS)
return ret;
@@ -169,8 +170,31 @@ static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t *
break;
}
- if (!(status->flags & EC_COMMS_STATUS_PROCESSING))
+ if (!(status->flags & EC_COMMS_STATUS_PROCESSING)) {
+ u32 orig_cmd, orig_outsize, orig_version;
+
+ /* If no response payload is expected, return 0. */
+ if (orig_msg->insize == 0)
+ return 0;
+
+ /*
+ * Request the response using EC_CMD_RESEND_RESPONSE.
+ * Restore the original message fields so it appears
+ * to be a direct response to the original command.
+ */
+ orig_cmd = orig_msg->command;
+ orig_outsize = orig_msg->outsize;
+ orig_version = orig_msg->version;
+
+ orig_msg->command = EC_CMD_RESEND_RESPONSE;
+ orig_msg->outsize = 0;
+ orig_msg->version = 0;
+ ret = cros_ec_xfer_command(ec_dev, orig_msg);
+ orig_msg->command = orig_cmd;
+ orig_msg->outsize = orig_outsize;
+ orig_msg->version = orig_version;
return ret;
+ }
}
if (i >= EC_COMMAND_RETRIES)
@@ -184,7 +208,7 @@ static int cros_ec_send_command(struct cros_ec_device *ec_dev, struct cros_ec_co
int ret = cros_ec_xfer_command(ec_dev, msg);
if (msg->result == EC_RES_IN_PROGRESS)
- ret = cros_ec_wait_until_complete(ec_dev, &msg->result);
+ ret = cros_ec_wait_until_complete(ec_dev, msg);
return ret;
}
diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c
index 3f281996a6863..cbaaf98d6877e 100644
--- a/drivers/platform/chrome/cros_ec_proto_test.c
+++ b/drivers/platform/chrome/cros_ec_proto_test.c
@@ -1744,7 +1744,7 @@ static void cros_ec_proto_test_cmd_xfer_protocol_v2_no_op(struct kunit *test)
KUNIT_EXPECT_EQ(test, ret, -EIO);
}
-static void cros_ec_proto_test_cmd_xfer_in_progress_normal(struct kunit *test)
+static void cros_ec_proto_test_cmd_xfer_in_progress_payload_0byte(struct kunit *test)
{
struct cros_ec_proto_test_priv *priv = test->priv;
struct cros_ec_device *ec_dev = &priv->ec_dev;
@@ -1774,7 +1774,7 @@ static void cros_ec_proto_test_cmd_xfer_in_progress_normal(struct kunit *test)
}
ret = cros_ec_cmd_xfer(ec_dev, &msg);
- KUNIT_EXPECT_EQ(test, ret, sizeof(struct ec_response_get_comms_status));
+ KUNIT_EXPECT_EQ(test, ret, 0);
KUNIT_EXPECT_EQ(test, msg.result, EC_RES_SUCCESS);
@@ -1799,6 +1799,156 @@ static void cros_ec_proto_test_cmd_xfer_in_progress_normal(struct kunit *test)
KUNIT_EXPECT_EQ(test, cros_kunit_ec_pkt_xfer_mock_called, 2);
}
+static void cros_ec_proto_test_cmd_xfer_in_progress_payload_4bytes(struct kunit *test)
+{
+ struct cros_ec_proto_test_priv *priv = test->priv;
+ struct cros_ec_device *ec_dev = &priv->ec_dev;
+ struct ec_xfer_mock *mock;
+ u8 resp_data[4] = {0x11, 0x22, 0x33, 0x44};
+ struct {
+ struct cros_ec_command msg;
+ u8 data[4];
+ } buf;
+ struct cros_ec_command *msg = &buf.msg;
+ int ret;
+
+ memset(&buf, 0, sizeof(buf));
+ msg->version = 1;
+ msg->command = 0x1234;
+ msg->insize = sizeof(buf.data);
+
+ ec_dev->max_response = sizeof(buf.data);
+ ec_dev->pkt_xfer = cros_kunit_ec_pkt_xfer_mock;
+
+ /* For initial command returning EC_RES_IN_PROGRESS. */
+ {
+ mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0);
+ KUNIT_ASSERT_PTR_NE(test, mock, NULL);
+ }
+
+ /* For EC_CMD_GET_COMMS_STATUS status polling. */
+ {
+ struct ec_response_get_comms_status *data;
+
+ mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data));
+ KUNIT_ASSERT_PTR_NE(test, mock, NULL);
+
+ data = (struct ec_response_get_comms_status *)mock->o_data;
+ data->flags = 0;
+ }
+
+ /* For EC_CMD_RESEND_RESPONSE returning 4 bytes payload. */
+ {
+ mock = cros_kunit_ec_xfer_mock_add(test, sizeof(resp_data));
+ KUNIT_ASSERT_PTR_NE(test, mock, NULL);
+ memcpy(mock->o_data, resp_data, sizeof(resp_data));
+ }
+
+ ret = cros_ec_cmd_xfer(ec_dev, msg);
+ KUNIT_EXPECT_EQ(test, ret, 4);
+ KUNIT_EXPECT_EQ(test, msg->result, EC_RES_SUCCESS);
+ KUNIT_EXPECT_EQ(test, msg->command, 0x1234);
+ KUNIT_EXPECT_EQ(test, msg->insize, sizeof(buf.data));
+ KUNIT_EXPECT_EQ(test, msg->version, 1);
+ KUNIT_EXPECT_EQ(test, memcmp(msg->data, resp_data, sizeof(resp_data)), 0);
+
+ /* Verify mock sequence */
+ {
+ mock = cros_kunit_ec_xfer_mock_next();
+ KUNIT_EXPECT_PTR_NE(test, mock, NULL);
+
+ mock = cros_kunit_ec_xfer_mock_next();
+ KUNIT_EXPECT_PTR_NE(test, mock, NULL);
+ KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_COMMS_STATUS);
+
+ mock = cros_kunit_ec_xfer_mock_next();
+ KUNIT_EXPECT_PTR_NE(test, mock, NULL);
+ KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_RESEND_RESPONSE);
+ KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
+ KUNIT_EXPECT_EQ(test, mock->msg.version, 0);
+ KUNIT_EXPECT_EQ(test, mock->msg.insize, 4);
+ }
+
+ KUNIT_EXPECT_EQ(test, cros_kunit_ec_pkt_xfer_mock_called, 3);
+}
+
+static void cros_ec_proto_test_cmd_xfer_in_progress_payload_gt4bytes(struct kunit *test)
+{
+ struct cros_ec_proto_test_priv *priv = test->priv;
+ struct cros_ec_device *ec_dev = &priv->ec_dev;
+ struct ec_xfer_mock *mock;
+ u8 resp_data[16];
+ struct {
+ struct cros_ec_command msg;
+ u8 data[16];
+ } buf;
+ struct cros_ec_command *msg = &buf.msg;
+ int ret, i;
+
+ for (i = 0; i < sizeof(resp_data); ++i)
+ resp_data[i] = (u8)(i + 1);
+
+ memset(&buf, 0, sizeof(buf));
+ msg->version = 0;
+ msg->command = 0x5678;
+ msg->insize = sizeof(buf.data);
+
+ ec_dev->max_response = sizeof(buf.data);
+ ec_dev->pkt_xfer = cros_kunit_ec_pkt_xfer_mock;
+
+ /* For initial command returning EC_RES_IN_PROGRESS. */
+ {
+ mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_IN_PROGRESS, 0);
+ KUNIT_ASSERT_PTR_NE(test, mock, NULL);
+ }
+
+ /* For EC_CMD_GET_COMMS_STATUS status polling. */
+ {
+ struct ec_response_get_comms_status *data;
+
+ mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data));
+ KUNIT_ASSERT_PTR_NE(test, mock, NULL);
+
+ data = (struct ec_response_get_comms_status *)mock->o_data;
+ data->flags = 0;
+ }
+
+ /* For EC_CMD_RESEND_RESPONSE returning 16 bytes payload. */
+ {
+ mock = cros_kunit_ec_xfer_mock_add(test, sizeof(resp_data));
+ KUNIT_ASSERT_PTR_NE(test, mock, NULL);
+ memcpy(mock->o_data, resp_data, sizeof(resp_data));
+ }
+
+ ret = cros_ec_cmd_xfer(ec_dev, msg);
+ KUNIT_EXPECT_EQ(test, ret, 16);
+ KUNIT_EXPECT_EQ(test, msg->result, EC_RES_SUCCESS);
+ KUNIT_EXPECT_EQ(test, msg->command, 0x5678);
+ KUNIT_EXPECT_EQ(test, msg->outsize, 0);
+ KUNIT_EXPECT_EQ(test, msg->insize, sizeof(buf.data));
+ KUNIT_EXPECT_EQ(test, msg->version, 0);
+ KUNIT_EXPECT_EQ(test, memcmp(msg->data, resp_data, sizeof(resp_data)), 0);
+
+ /* Verify mock sequence */
+ {
+ mock = cros_kunit_ec_xfer_mock_next();
+ KUNIT_EXPECT_PTR_NE(test, mock, NULL);
+
+ mock = cros_kunit_ec_xfer_mock_next();
+ KUNIT_EXPECT_PTR_NE(test, mock, NULL);
+ KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_GET_COMMS_STATUS);
+
+ mock = cros_kunit_ec_xfer_mock_next();
+ KUNIT_EXPECT_PTR_NE(test, mock, NULL);
+ KUNIT_EXPECT_EQ(test, mock->msg.command, EC_CMD_RESEND_RESPONSE);
+ KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
+ KUNIT_EXPECT_EQ(test, mock->msg.version, 0);
+ KUNIT_EXPECT_EQ(test, mock->msg.insize, 16);
+ }
+
+ KUNIT_EXPECT_EQ(test, cros_kunit_ec_pkt_xfer_mock_called, 3);
+}
+
static void cros_ec_proto_test_cmd_xfer_in_progress_retries_eagain(struct kunit *test)
{
struct cros_ec_proto_test_priv *priv = test->priv;
@@ -2703,7 +2853,9 @@ static struct kunit_case cros_ec_proto_test_cases[] = {
KUNIT_CASE(cros_ec_proto_test_cmd_xfer_protocol_v3_no_op),
KUNIT_CASE(cros_ec_proto_test_cmd_xfer_protocol_v2_normal),
KUNIT_CASE(cros_ec_proto_test_cmd_xfer_protocol_v2_no_op),
- KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_normal),
+ KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_payload_0byte),
+ KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_payload_4bytes),
+ KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_payload_gt4bytes),
KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_retries_eagain),
KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing),
KUNIT_CASE(cros_ec_proto_test_cmd_xfer_in_progress_xfer_error),
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0186/1756] staging: rtl8723bs: change remaining printk to proper api
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (184 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0185/1756] platform/chrome: cros_ec_proto: Fix deferred response Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0187/1756] staging: rtl8723bs: remove return from void function Greg Kroah-Hartman
` (812 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rodrigo Gobbi, Dan Carpenter,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
[ Upstream commit e139445ccbe4d902fce1dce517cd3b63f5b68eb8 ]
As part of TODO file for future work, use dyn debug api for
remaining printk statements.
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20241029221544.112800-1-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: baa84b1bb164 ("staging: rtl8723bs: disable SDIO function on block size failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 6 +++---
drivers/staging/rtl8723bs/hal/hal_com.c | 7 +++----
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 12 ++++++++----
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 2 +-
4 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 740868a156dcd..cb30201fbcc20 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1885,10 +1885,10 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv
if (0) {
int pp;
- printk("pattrib->pktlen = %d =>", pattrib->pkt_len);
+ netdev_dbg(padapter->pnetdev, "pattrib->pktlen = %d =>", pattrib->pkt_len);
for (pp = 0; pp < pattrib->pkt_len; pp++)
- printk(" %02x ", pframe[pp]);
- printk("\n");
+ pr_cont(" %02x ", pframe[pp]);
+ pr_cont("\n");
}
return _SUCCESS;
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 719dd116d8076..f0eecd5b47f30 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -910,10 +910,9 @@ void rtw_dump_raw_rssi_info(struct adapter *padapter)
for (rf_path = 0; rf_path < pHalData->NumTotalRFPath; rf_path++) {
if (!isCCKrate) {
- printk(", rx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n",
- psample_pkt_rssi->ofdm_pwr[rf_path], psample_pkt_rssi->ofdm_snr[rf_path]);
- } else {
- printk("\n");
+ netdev_dbg(padapter->pnetdev, ", rx_ofdm_pwr:%d(dBm), rx_ofdm_snr:%d(dB)\n",
+ psample_pkt_rssi->ofdm_pwr[rf_path],
+ psample_pkt_rssi->ofdm_snr[rf_path]);
}
}
}
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 37ebbbf408ecf..eab4ca950959d 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -62,7 +62,8 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)
for (i = 0; i < blockCount_p1; i++) {
ret = rtw_write32(padapter, (FW_8723B_START_ADDRESS + i * blockSize_p1), *((u32 *)(bufferPtr + i * blockSize_p1)));
if (ret == _FAIL) {
- printk("====>%s %d i:%d\n", __func__, __LINE__, i);
+ netdev_dbg(padapter->pnetdev, "write failed at %s %d, block:%d\n",
+ __func__, __LINE__, i);
goto exit;
}
}
@@ -85,7 +86,8 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)
ret = rtw_write8(padapter, (FW_8723B_START_ADDRESS + offset + i), *(bufferPtr + offset + i));
if (ret == _FAIL) {
- printk("====>%s %d i:%d\n", __func__, __LINE__, i);
+ netdev_dbg(padapter->pnetdev, "write failed at %s %d, block:%d\n",
+ __func__, __LINE__, i);
goto exit;
}
}
@@ -127,7 +129,8 @@ static int _WriteFW(struct adapter *padapter, void *buffer, u32 size)
ret = _PageWrite(padapter, page, bufferPtr+offset, MAX_DLFW_PAGE_SIZE);
if (ret == _FAIL) {
- printk("====>%s %d\n", __func__, __LINE__);
+ netdev_dbg(padapter->pnetdev, "page write failed at %s %d\n",
+ __func__, __LINE__);
goto exit;
}
}
@@ -138,7 +141,8 @@ static int _WriteFW(struct adapter *padapter, void *buffer, u32 size)
ret = _PageWrite(padapter, page, bufferPtr+offset, remainSize);
if (ret == _FAIL) {
- printk("====>%s %d\n", __func__, __LINE__);
+ netdev_dbg(padapter->pnetdev, "remaining page write failed at %s %d\n",
+ __func__, __LINE__);
goto exit;
}
}
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index c1e02f2a84c3c..86657223af98f 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -72,7 +72,7 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
err = sdio_claim_irq(func, &sd_sync_int_hdl);
if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
- printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
+ netdev_crit(dvobj->if1->pnetdev, "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
} else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0187/1756] staging: rtl8723bs: remove return from void function
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (185 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0186/1756] staging: rtl8723bs: change remaining printk to proper api Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0188/1756] staging: rtl8723bs: remove wrapper rtw_init_recv_timer Greg Kroah-Hartman
` (811 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Straube, Hans de Goede,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Straube <straube.linux@gmail.com>
[ Upstream commit 9279204d37cce549f40cdc677b86405e8628212c ]
Remove exit label and return statement from a void function.
After the exit label no cleanup is done, so it is safe to remove it
and return early in the only place where the label is used.
This simplifies the code and clears a checkpatch warning.
WARNING: void function return statements are not generally useful
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250615123758.41869-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: baa84b1bb164 ("staging: rtl8723bs: disable SDIO function on block size failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index fc9b9c5efb50e..ea3a5e0d196da 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -1144,7 +1144,7 @@ void rtw_suspend_common(struct adapter *padapter)
if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) {
pdbgpriv->dbg_suspend_error_cnt++;
- goto exit;
+ return;
}
rtw_ps_deny(padapter, PS_DENY_SUSPEND);
@@ -1166,10 +1166,6 @@ void rtw_suspend_common(struct adapter *padapter)
netdev_dbg(padapter->pnetdev, "rtw suspend success in %d ms\n",
jiffies_to_msecs(jiffies - start_time));
-
-exit:
-
- return;
}
static int rtw_resume_process_normal(struct adapter *padapter)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0188/1756] staging: rtl8723bs: remove wrapper rtw_init_recv_timer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (186 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0187/1756] staging: rtl8723bs: remove return from void function Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0189/1756] staging: rtl8723bs: move rtw_recv_indicatepkt to rtw_recv.c Greg Kroah-Hartman
` (810 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Straube, Hans de Goede,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Straube <straube.linux@gmail.com>
[ Upstream commit 0149f27d1a248f013fe36d29bc391c303e853ee0 ]
The function rtw_init_recv_timer in os_dep/recv_linux.c is jsut a wrapper
around timer_setup. Use timer_setup directly and remove the wrapper to
reduce code in the os_dep directory.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: baa84b1bb164 ("staging: rtl8723bs: disable SDIO function on block size failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 4 +++-
drivers/staging/rtl8723bs/include/recv_osdep.h | 3 ---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 7 -------
3 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index 1b72f2196a1cf..6995b61aa67d5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -247,7 +247,9 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
INIT_LIST_HEAD(&preorder_ctrl->pending_recvframe_queue.queue);
spin_lock_init(&preorder_ctrl->pending_recvframe_queue.lock);
- rtw_init_recv_timer(preorder_ctrl);
+ /* init recv timer */
+ timer_setup(&preorder_ctrl->reordering_ctrl_timer,
+ rtw_reordering_ctrl_timeout_handler, 0);
}
/* init for DM */
diff --git a/drivers/staging/rtl8723bs/include/recv_osdep.h b/drivers/staging/rtl8723bs/include/recv_osdep.h
index 83330ea98fbf7..ea0b58aa0ba05 100644
--- a/drivers/staging/rtl8723bs/include/recv_osdep.h
+++ b/drivers/staging/rtl8723bs/include/recv_osdep.h
@@ -34,7 +34,4 @@ void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *pre
struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata);
void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib);
-void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
-
-
#endif /* */
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index ca808ded61ac0..f76aaff15fd01 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -219,10 +219,3 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
return _FAIL;
}
-
-void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
-{
- timer_setup(&preorder_ctrl->reordering_ctrl_timer,
- rtw_reordering_ctrl_timeout_handler, 0);
-
-}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0189/1756] staging: rtl8723bs: move rtw_recv_indicatepkt to rtw_recv.c
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (187 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0188/1756] staging: rtl8723bs: remove wrapper rtw_init_recv_timer Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0190/1756] staging: rtl8723bs: remove unused private debug counters Greg Kroah-Hartman
` (809 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Straube, Hans de Goede,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Straube <straube.linux@gmail.com>
[ Upstream commit f97151eb17dcdc8d7a27e05f2ec8c55bbb16c7a9 ]
Move the function rtw_recv_indicatepkt from os_dep/recv_linux.c to
core/rtw_recv.c to reduce code in the os_dep directory.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20250822135418.118115-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: baa84b1bb164 ("staging: rtl8723bs: disable SDIO function on block size failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 37 +++++++++++++++++++
.../staging/rtl8723bs/include/recv_osdep.h | 1 -
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 37 -------------------
3 files changed, 37 insertions(+), 38 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 96630315d46a7..65629f0de6243 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1740,6 +1740,43 @@ static void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev
}
+static int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame)
+{
+ struct recv_priv *precvpriv;
+ struct __queue *pfree_recv_queue;
+ struct sk_buff *skb;
+ struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
+
+ precvpriv = &(padapter->recvpriv);
+ pfree_recv_queue = &(precvpriv->free_recv_queue);
+
+ skb = precv_frame->u.hdr.pkt;
+ if (!skb)
+ goto _recv_indicatepkt_drop;
+
+ skb->data = precv_frame->u.hdr.rx_data;
+
+ skb_set_tail_pointer(skb, precv_frame->u.hdr.len);
+
+ skb->len = precv_frame->u.hdr.len;
+
+ rtw_os_recv_indicate_pkt(padapter, skb, pattrib);
+
+ /* pointers to NULL before rtw_free_recvframe() */
+ precv_frame->u.hdr.pkt = NULL;
+
+ rtw_free_recvframe(precv_frame, pfree_recv_queue);
+
+ return _SUCCESS;
+
+_recv_indicatepkt_drop:
+
+ /* enqueue back to free_recv_queue */
+ rtw_free_recvframe(precv_frame, pfree_recv_queue);
+
+ return _FAIL;
+}
+
static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
{
struct list_head *phead, *plist;
diff --git a/drivers/staging/rtl8723bs/include/recv_osdep.h b/drivers/staging/rtl8723bs/include/recv_osdep.h
index ea0b58aa0ba05..f31c87b21206b 100644
--- a/drivers/staging/rtl8723bs/include/recv_osdep.h
+++ b/drivers/staging/rtl8723bs/include/recv_osdep.h
@@ -13,7 +13,6 @@ extern void _rtw_free_recv_priv(struct recv_priv *precvpriv);
extern s32 rtw_recv_entry(union recv_frame *precv_frame);
-extern int rtw_recv_indicatepkt(struct adapter *adapter, union recv_frame *precv_frame);
extern void rtw_recv_returnpacket(struct net_device *cnxt, struct sk_buff *preturnedpkt);
extern void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index f76aaff15fd01..3d79e16c4e734 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -182,40 +182,3 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
memset(&wrqu, 0x00, sizeof(wrqu));
wrqu.data.length = sizeof(ev);
}
-
-int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame)
-{
- struct recv_priv *precvpriv;
- struct __queue *pfree_recv_queue;
- struct sk_buff *skb;
- struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
-
- precvpriv = &(padapter->recvpriv);
- pfree_recv_queue = &(precvpriv->free_recv_queue);
-
- skb = precv_frame->u.hdr.pkt;
- if (!skb)
- goto _recv_indicatepkt_drop;
-
- skb->data = precv_frame->u.hdr.rx_data;
-
- skb_set_tail_pointer(skb, precv_frame->u.hdr.len);
-
- skb->len = precv_frame->u.hdr.len;
-
- rtw_os_recv_indicate_pkt(padapter, skb, pattrib);
-
- /* pointers to NULL before rtw_free_recvframe() */
- precv_frame->u.hdr.pkt = NULL;
-
- rtw_free_recvframe(precv_frame, pfree_recv_queue);
-
- return _SUCCESS;
-
-_recv_indicatepkt_drop:
-
- /* enqueue back to free_recv_queue */
- rtw_free_recvframe(precv_frame, pfree_recv_queue);
-
- return _FAIL;
-}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0190/1756] staging: rtl8723bs: remove unused private debug counters
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (188 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0189/1756] staging: rtl8723bs: move rtw_recv_indicatepkt to rtw_recv.c Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0191/1756] staging: rtl8723bs: disable SDIO function on block size failure Greg Kroah-Hartman
` (808 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ethan Tidmore, Dan Carpenter,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ethan Tidmore <ethantidmore06@gmail.com>
[ Upstream commit 7de30d5d76aa614777a02a9807d29ed65b0704a0 ]
The driver maintains a private `struct debug_priv` embedded within
`struct dvobj_priv` to track various error counters (e.g., suspend
errors, alloc failures, RX drops).
These counters are incremented in various files but the data is
never read or exposed to userspace.
Remove the unused `debug_priv` structure definition, the instance
in `dvobj_priv`, and all associated increment operations across
the driver to clean up the code.
This also removes the following helper functions which were used
solely to update these counters:
- rtw_reset_rx_info()
- recv_indicatepkts_pkt_loss_cnt()
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260131212128.25548-1-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: baa84b1bb164 ("staging: rtl8723bs: disable SDIO function on block size failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 13 ------
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 3 --
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 6 +--
drivers/staging/rtl8723bs/core/rtw_recv.c | 24 +---------
drivers/staging/rtl8723bs/hal/hal_com.c | 13 ------
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 4 --
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 8 +---
drivers/staging/rtl8723bs/include/drv_types.h | 41 -----------------
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 15 +------
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 45 +++++--------------
10 files changed, 15 insertions(+), 157 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index e2d5a40085f68..db3b368789cdd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -807,15 +807,6 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
spin_unlock_bh(&scan_queue->lock);
}
-static void rtw_reset_rx_info(struct debug_priv *pdbgpriv)
-{
- pdbgpriv->dbg_rx_ampdu_drop_count = 0;
- pdbgpriv->dbg_rx_ampdu_forced_indicate_count = 0;
- pdbgpriv->dbg_rx_ampdu_loss_count = 0;
- pdbgpriv->dbg_rx_dup_mgt_frame_drop_count = 0;
- pdbgpriv->dbg_rx_ampdu_window_shift_cnt = 0;
-}
-
static void find_network(struct adapter *adapter)
{
struct wlan_network *pwlan = NULL;
@@ -840,8 +831,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
{
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
- struct dvobj_priv *psdpriv = adapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE)) {
struct sta_info *psta;
@@ -865,8 +854,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
if (lock_scanned_queue)
adapter->securitypriv.key_mask = 0;
-
- rtw_reset_rx_info(pdbgpriv);
}
/*
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index cb30201fbcc20..c123f998a233f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -439,8 +439,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 *pframe = precv_frame->u.hdr.rx_data;
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe));
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
if (GetFrameType(pframe) != WIFI_MGT_TYPE)
return;
@@ -464,7 +462,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
if (GetRetry(pframe)) {
if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum) {
/* drop the duplicate management frame */
- pdbgpriv->dbg_rx_dup_mgt_frame_drop_count++;
return;
}
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index dbfcbac3d8555..5b84e836594d4 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -144,8 +144,6 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
void rtw_ps_processor(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
u32 ps_deny = 0;
mutex_lock(&adapter_to_pwrctl(padapter)->lock);
@@ -154,10 +152,8 @@ void rtw_ps_processor(struct adapter *padapter)
if (ps_deny != 0)
goto exit;
- if (pwrpriv->bInSuspend) {/* system suspend or autosuspend */
- pdbgpriv->dbg_ps_insuspend_cnt++;
+ if (pwrpriv->bInSuspend) /* system suspend or autosuspend */
return;
- }
pwrpriv->ps_processing = true;
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 65629f0de6243..c3d10509398cd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1652,9 +1652,6 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
{
- struct adapter *padapter = preorder_ctrl->padapter;
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
u8 wsize = preorder_ctrl->wsize_b;
u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */
@@ -1680,7 +1677,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
preorder_ctrl->indicate_seq = seq_num + 1 - wsize;
else
preorder_ctrl->indicate_seq = 0xFFF - (wsize - (seq_num + 1)) + 1;
- pdbgpriv->dbg_rx_ampdu_window_shift_cnt++;
}
return true;
@@ -1731,15 +1727,6 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
}
-static void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev_seq, u64 current_seq)
-{
- if (current_seq < prev_seq)
- pdbgpriv->dbg_rx_ampdu_loss_count += (4096 + current_seq - prev_seq);
- else
- pdbgpriv->dbg_rx_ampdu_loss_count += (current_seq - prev_seq);
-
-}
-
static int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame)
{
struct recv_priv *precvpriv;
@@ -1786,8 +1773,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
int bPktInBuf = false;
struct recv_priv *precvpriv = &padapter->recvpriv;
struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
/* spin_lock(&ppending_recvframe_queue->lock); */
@@ -1797,7 +1782,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
/* Handling some condition for forced indicate case. */
if (bforced == true) {
- pdbgpriv->dbg_rx_ampdu_forced_indicate_count++;
if (list_empty(phead)) {
/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
/* spin_unlock(&ppending_recvframe_queue->lock); */
@@ -1807,7 +1791,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
prframe = (union recv_frame *)plist;
pattrib = &prframe->u.hdr.attrib;
- recv_indicatepkts_pkt_loss_cnt(pdbgpriv, preorder_ctrl->indicate_seq, pattrib->seq_num);
preorder_ctrl->indicate_seq = pattrib->seq_num;
}
@@ -1868,8 +1851,6 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl;
struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
if (!pattrib->amsdu) {
/* s1. */
@@ -1915,11 +1896,8 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
spin_lock_bh(&ppending_recvframe_queue->lock);
/* s2. check if winstart_b(indicate_seq) needs to been updated */
- if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) {
- pdbgpriv->dbg_rx_ampdu_drop_count++;
+ if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num))
goto _err_exit;
- }
-
/* s3. Insert all packet into Reorder Queue to maintain its ordering. */
if (!enqueue_reorder_recvframe(preorder_ctrl, prframe)) {
diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index f0eecd5b47f30..2c9cf445d0ebd 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -878,22 +878,9 @@ bool GetU1ByteIntegerFromStringInDecimal(char *Str, u8 *pInt)
void rtw_hal_check_rxfifo_full(struct adapter *adapter)
{
- struct dvobj_priv *psdpriv = adapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
- int save_cnt = false;
-
/* switch counter to RX fifo */
/* printk("8723b or 8192e , MAC_667 set 0xf0\n"); */
rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xf0);
- save_cnt = true;
- /* todo: other chips */
-
- if (save_cnt) {
- /* rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xa0); */
- pdbgpriv->dbg_rx_fifo_last_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow;
- pdbgpriv->dbg_rx_fifo_curr_overflow = rtw_read16(adapter, REG_RXERR_RPT);
- pdbgpriv->dbg_rx_fifo_diff_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow-pdbgpriv->dbg_rx_fifo_last_overflow;
- }
}
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index eab4ca950959d..a14e61b4c23a9 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -306,8 +306,6 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
const struct firmware *fw;
struct device *device = dvobj_to_dev(padapter->dvobj);
u8 *fwfilepath;
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
u8 tmp_ps;
pFirmware = kzalloc(sizeof(struct rt_firmware), GFP_KERNEL);
@@ -326,8 +324,6 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
/* 2. read power_state = 0xA0[1:0] */
tmp_ps = rtw_read8(padapter, 0xa0);
tmp_ps &= 0x03;
- if (tmp_ps != 0x01)
- pdbgpriv->dbg_downloadfw_pwr_state_cnt++;
fwfilepath = "rtlwifi/rtl8723bs_nic.bin";
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index d3aae413fc0f9..b86e5ad45df3c 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -886,9 +886,6 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
static u32 rtl8723bs_hal_deinit(struct adapter *padapter)
{
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
-
if (padapter->hw_init_completed) {
if (adapter_to_pwrctl(padapter)->bips_processing) {
if (padapter->netif_up) {
@@ -921,18 +918,15 @@ static u32 rtl8723bs_hal_deinit(struct adapter *padapter)
adapter_to_pwrctl(padapter)->pre_ips_type = 0;
} else {
- pdbgpriv->dbg_carddisable_cnt++;
CardDisableRTL8723BSdio(padapter);
adapter_to_pwrctl(padapter)->pre_ips_type = 1;
}
} else {
- pdbgpriv->dbg_carddisable_cnt++;
CardDisableRTL8723BSdio(padapter);
}
- } else
- pdbgpriv->dbg_deinit_fail_cnt++;
+ }
return _SUCCESS;
}
diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index 0b35c97843cc7..f653a0a9cbb7b 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -188,45 +188,6 @@ struct registry_priv {
#define GET_IFACE_NUMS(padapter) (((struct adapter *)padapter)->dvobj->iface_nums)
#define GET_ADAPTER(padapter, iface_id) (((struct adapter *)padapter)->dvobj->padapters[iface_id])
-struct debug_priv {
- u32 dbg_sdio_free_irq_error_cnt;
- u32 dbg_sdio_alloc_irq_error_cnt;
- u32 dbg_sdio_free_irq_cnt;
- u32 dbg_sdio_alloc_irq_cnt;
- u32 dbg_sdio_deinit_error_cnt;
- u32 dbg_sdio_init_error_cnt;
- u32 dbg_suspend_error_cnt;
- u32 dbg_suspend_cnt;
- u32 dbg_resume_cnt;
- u32 dbg_resume_error_cnt;
- u32 dbg_deinit_fail_cnt;
- u32 dbg_carddisable_cnt;
- u32 dbg_carddisable_error_cnt;
- u32 dbg_ps_insuspend_cnt;
- u32 dbg_dev_unload_inIPS_cnt;
- u32 dbg_wow_leave_ps_fail_cnt;
- u32 dbg_scan_pwr_state_cnt;
- u32 dbg_downloadfw_pwr_state_cnt;
- u32 dbg_fw_read_ps_state_fail_cnt;
- u32 dbg_leave_ips_fail_cnt;
- u32 dbg_leave_lps_fail_cnt;
- u32 dbg_h2c_leave32k_fail_cnt;
- u32 dbg_diswow_dload_fw_fail_cnt;
- u32 dbg_enwow_dload_fw_fail_cnt;
- u32 dbg_ips_drvopen_fail_cnt;
- u32 dbg_poll_fail_cnt;
- u32 dbg_rpwm_toggle_cnt;
- u32 dbg_rpwm_timeout_fail_cnt;
- u64 dbg_rx_fifo_last_overflow;
- u64 dbg_rx_fifo_curr_overflow;
- u64 dbg_rx_fifo_diff_overflow;
- u64 dbg_rx_ampdu_drop_count;
- u64 dbg_rx_ampdu_forced_indicate_count;
- u64 dbg_rx_ampdu_loss_count;
- u64 dbg_rx_dup_mgt_frame_drop_count;
- u64 dbg_rx_ampdu_window_shift_cnt;
-};
-
struct rtw_traffic_statistics {
/* tx statistics */
u64 tx_bytes;
@@ -262,8 +223,6 @@ struct dvobj_priv {
s32 processing_dev_remove;
- struct debug_priv drv_dbg;
-
/* for local/global synchronization */
/* */
spinlock_t lock;
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index ea3a5e0d196da..cdd5923064f5e 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -1013,8 +1013,6 @@ void rtw_ndev_destructor(struct net_device *ndev)
void rtw_dev_unload(struct adapter *padapter)
{
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
- struct dvobj_priv *pobjpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &pobjpriv->drv_dbg;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 cnt = 0;
@@ -1044,7 +1042,6 @@ void rtw_dev_unload(struct adapter *padapter)
/* check HW status and SW state */
netdev_dbg(padapter->pnetdev,
"%s: driver in IPS-FWLPS\n", __func__);
- pdbgpriv->dbg_dev_unload_inIPS_cnt++;
LeaveAllPowerSaveMode(padapter);
} else {
netdev_dbg(padapter->pnetdev,
@@ -1128,24 +1125,21 @@ static void rtw_suspend_normal(struct adapter *padapter)
void rtw_suspend_common(struct adapter *padapter)
{
struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long start_time = jiffies;
netdev_dbg(padapter->pnetdev, " suspend start\n");
- pdbgpriv->dbg_suspend_cnt++;
pwrpriv->bInSuspend = true;
while (pwrpriv->bips_processing)
msleep(1);
- if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) {
- pdbgpriv->dbg_suspend_error_cnt++;
+ if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))
return;
- }
+
rtw_ps_deny(padapter, PS_DENY_SUSPEND);
rtw_cancel_all_timer(padapter);
@@ -1173,8 +1167,6 @@ static int rtw_resume_process_normal(struct adapter *padapter)
struct net_device *pnetdev;
struct pwrctrl_priv *pwrpriv;
struct mlme_priv *pmlmepriv;
- struct dvobj_priv *psdpriv;
- struct debug_priv *pdbgpriv;
int ret = _SUCCESS;
@@ -1186,8 +1178,6 @@ static int rtw_resume_process_normal(struct adapter *padapter)
pnetdev = padapter->pnetdev;
pwrpriv = adapter_to_pwrctl(padapter);
pmlmepriv = &padapter->mlmepriv;
- psdpriv = padapter->dvobj;
- pdbgpriv = &psdpriv->drv_dbg;
/* interface init */
/* if (sdio_init(adapter_to_dvobj(padapter)) != _SUCCESS) */
if ((padapter->intf_init) && (padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS)) {
@@ -1206,7 +1196,6 @@ static int rtw_resume_process_normal(struct adapter *padapter)
if (pm_netdev_open(pnetdev, true) != 0) {
ret = -1;
- pdbgpriv->dbg_resume_error_cnt++;
goto exit;
}
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 86657223af98f..8432d13e7b125 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -70,13 +70,10 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
sdio_claim_host(func);
err = sdio_claim_irq(func, &sd_sync_int_hdl);
- if (err) {
- dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
+ if (err)
netdev_crit(dvobj->if1->pnetdev, "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
- } else {
- dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
+ else
dvobj->irq_alloc = 1;
- }
sdio_release_host(func);
@@ -97,12 +94,10 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
sdio_claim_host(func);
err = sdio_release_irq(func);
if (err) {
- dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
netdev_err(dvobj->if1->pnetdev,
"%s: sdio_release_irq FAIL(%d)!\n",
__func__, err);
- } else
- dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
+ }
sdio_release_host(func);
}
dvobj->irq_alloc = 0;
@@ -122,16 +117,13 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
sdio_claim_host(func);
err = sdio_enable_func(func);
- if (err) {
- dvobj->drv_dbg.dbg_sdio_init_error_cnt++;
+ if (err)
goto release;
- }
err = sdio_set_block_size(func, 512);
- if (err) {
- dvobj->drv_dbg.dbg_sdio_init_error_cnt++;
+ if (err)
goto release;
- }
+
psdio_data->block_transfer_len = 512;
psdio_data->tx_block_mode = 1;
psdio_data->rx_block_mode = 1;
@@ -147,22 +139,15 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
static void sdio_deinit(struct dvobj_priv *dvobj)
{
struct sdio_func *func;
- int err;
func = dvobj->intf_data.func;
if (func) {
sdio_claim_host(func);
- err = sdio_disable_func(func);
- if (err)
- dvobj->drv_dbg.dbg_sdio_deinit_error_cnt++;
+ sdio_disable_func(func);
if (dvobj->irq_alloc) {
- err = sdio_release_irq(func);
- if (err)
- dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
- else
- dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
+ sdio_release_irq(func);
}
sdio_release_host(func);
@@ -440,15 +425,12 @@ static int rtw_sdio_suspend(struct device *dev)
struct dvobj_priv *psdpriv = sdio_get_drvdata(func);
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
struct adapter *padapter = psdpriv->if1;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
if (padapter->bDriverStopped)
return 0;
- if (pwrpriv->bInSuspend) {
- pdbgpriv->dbg_suspend_error_cnt++;
+ if (pwrpriv->bInSuspend)
return 0;
- }
rtw_suspend_common(padapter);
@@ -458,13 +440,9 @@ static int rtw_sdio_suspend(struct device *dev)
static int rtw_resume_process(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
- struct dvobj_priv *psdpriv = padapter->dvobj;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
- if (!pwrpriv->bInSuspend) {
- pdbgpriv->dbg_resume_error_cnt++;
+ if (!pwrpriv->bInSuspend)
return -1;
- }
return rtw_resume_common(padapter);
}
@@ -476,9 +454,6 @@ static int rtw_sdio_resume(struct device *dev)
struct adapter *padapter = psdpriv->if1;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
int ret = 0;
- struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
-
- pdbgpriv->dbg_resume_cnt++;
ret = rtw_resume_process(padapter);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0191/1756] staging: rtl8723bs: disable SDIO function on block size failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (189 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0190/1756] staging: rtl8723bs: remove unused private debug counters Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0192/1756] staging: octeon: schedule the TX cleanup tasklet every 1024th packet Greg Kroah-Hartman
` (807 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Dan Carpenter, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit baa84b1bb1648506333fde3e66b6540f9d7d73cc ]
sdio_init() enables the SDIO function before configuring the block
size. If sdio_set_block_size() fails, the function jumps to the release
path and returns the error without disabling the SDIO function. The
caller then frees the dvobj directly, so the enabled SDIO function is
left active on that probe failure path.
Disable the SDIO function before releasing the host when block size
configuration fails.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/20260731161710.44828-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 8432d13e7b125..096429afdd144 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -121,8 +121,10 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
goto release;
err = sdio_set_block_size(func, 512);
- if (err)
+ if (err) {
+ sdio_disable_func(func);
goto release;
+ }
psdio_data->block_transfer_len = 512;
psdio_data->tx_block_mode = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0192/1756] staging: octeon: schedule the TX cleanup tasklet every 1024th packet
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (190 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0191/1756] staging: rtl8723bs: disable SDIO function on block size failure Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0193/1756] clk: fix self-consuming provider module pinning Greg Kroah-Hartman
` (806 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Orgad Shaneh, Dan Carpenter,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Orgad Shaneh <orgads@gmail.com>
[ Upstream commit db57f6517bf65523968ae29cd34a790bfa7d32af ]
cvm_oct_xmit() means to schedule the cleanup tasklet once every 1024
packets, as its comment says, to cover the pathological case of heavy
traffic on one port delaying the cleanup of another port blocked
waiting for it.
The test is inverted: total_to_clean & 0x3ff is true for 1023 of every
1024 values, and false only on the multiples of 1024. So the tasklet is
scheduled on nearly every packet, and skipped on exactly the packet the
comment wants. That costs one TASKLET softirq per transmitted packet,
each walking every port and doing an FAU fetch-and-add per non-empty
queue, and it buys nothing for this port, which already frees its
completed skbs inline from the skb_to_free value it reads out of the
FAU.
Test the mask against zero. On a CN50XX board (2 cores at 300MHz)
carrying ~6.9k transmitted packets/s, TASKLET softirqs drop from 7133/s
to 597/s with no throughput change; the freeing work is conserved, so
this removes softirq entries, not work.
Fixes: 4898c560103f ("Staging: Octeon: Free transmit SKBs in a timely manner")
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/20260820113239.8169-1-orgads@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/octeon/ethernet-tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index e54b4a413dc40..4c66d43b66ee1 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -483,7 +483,7 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
cvmx_fau_fetch_and_add32(FAU_TOTAL_TX_TO_CLEAN, 1);
}
- if (total_to_clean & 0x3ff) {
+ if ((total_to_clean & 0x3ff) == 0) {
/*
* Schedule the cleanup tasklet every 1024 packets for
* the pathological case of high traffic on one port
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0193/1756] clk: fix self-consuming provider module pinning
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (191 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0192/1756] staging: octeon: schedule the TX cleanup tasklet every 1024th packet Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0194/1756] microblaze: CCF: fix refcount leak Greg Kroah-Hartman
` (805 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jerome Brunet, Brian Masney,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Brunet <jbrunet@baylibre.com>
[ Upstream commit a1c8d531c694e193dc48ef2428877d5ea2e35134 ]
clk_hw_get_clk() lets a provider get a struct clk for one of its own
struct clk_hw.
When a struct clk is created, the module usage count of the provider
is unconditionally increased. For a self-consuming provider, this means
it pins itself and the module can never be unloaded.
Increasing the module usage count should only be done when the consumer
lives in a different module from the provider. Use THIS_MODULE to
capture caller's module and increase the module usage count accordingly.
It is OK for consumer-only APIs such as clk_get() or of_clk_get() to
pass a NULL owner. As a result, any provider module will get pinned,
same as before.
Fixes: 30d6f8c15d2c ("clk: add api to get clk consumer from clk_hw")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk.c | 46 ++++++++++++++++++++----------------
drivers/clk/clk.h | 5 ++--
drivers/clk/clkdev.c | 4 ++--
include/linux/clk-provider.h | 22 ++++++++++++++---
4 files changed, 50 insertions(+), 27 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7de3dfdae4b50..1bab1ca73a74c 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -108,6 +108,7 @@ struct clk {
unsigned long max_rate;
unsigned int exclusive_count;
struct hlist_node clks_node;
+ bool pinning;
};
/*** runtime pm ***/
@@ -4162,13 +4163,15 @@ static void free_clk(struct clk *clk)
* @hw: clk_hw associated with the clk being consumed
* @dev_id: string describing device name
* @con_id: connection ID string on device
+ * @owner: reference to the module creating the clock
*
* This is the main function used to create a clk pointer for use by clk
* consumers. It connects a consumer to the clk_core and clk_hw structures
* used by the framework and clk provider respectively.
*/
struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
- const char *dev_id, const char *con_id)
+ const char *dev_id, const char *con_id,
+ struct module *owner)
{
struct clk *clk;
struct clk_core *core;
@@ -4183,7 +4186,13 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
return clk;
clk->dev = dev;
- if (!try_module_get(core->owner)) {
+ /*
+ * Pin the provider module only when the consumer lives in a different
+ * module. A provider getting a clk from its own clk_hw would otherwise
+ * pin itself and could never be unloaded.
+ */
+ clk->pinning = owner != core->owner;
+ if (clk->pinning && !try_module_get(core->owner)) {
free_clk(clk);
return ERR_PTR(-ENOENT);
}
@@ -4194,24 +4203,19 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
return clk;
}
-/**
- * clk_hw_get_clk - get clk consumer given an clk_hw
- * @hw: clk_hw associated with the clk being consumed
- * @con_id: connection ID string on device
- *
- * Returns: new clk consumer
- * This is the function to be used by providers which need
- * to get a consumer clk and act on the clock element
- * Calls to this function must be balanced with calls clk_put()
+/*
+ * Internal helper backing the clk_hw_get_clk() macro, which passes the caller's
+ * module via THIS_MODULE.
*/
-struct clk *clk_hw_get_clk(struct clk_hw *hw, const char *con_id)
+struct clk *__clk_hw_get_clk(struct clk_hw *hw, const char *con_id,
+ struct module *owner)
{
struct device *dev = hw->core->dev;
const char *name = dev ? dev_name(dev) : NULL;
- return clk_hw_create_clk(dev, hw, name, con_id);
+ return clk_hw_create_clk(dev, hw, name, con_id, owner);
}
-EXPORT_SYMBOL(clk_hw_get_clk);
+EXPORT_SYMBOL(__clk_hw_get_clk);
static int clk_cpy_name(const char **dst_p, const char *src, bool must_exist)
{
@@ -4375,8 +4379,9 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
INIT_HLIST_HEAD(&core->clks);
/*
- * Don't call clk_hw_create_clk() here because that would pin the
- * provider module to itself and prevent it from ever being removed.
+ * Don't call clk_hw_create_clk() here because it would systematically
+ * add a consumer to the hw clock and all clocks would appear to have
+ * consumer in the clock summary.
*/
hw->clk = alloc_clk(core, NULL, NULL);
if (IS_ERR(hw->clk)) {
@@ -4725,7 +4730,7 @@ struct clk *devm_clk_hw_get_clk(struct device *dev, struct clk_hw *hw,
if (!clkp)
return ERR_PTR(-ENOMEM);
- clk = clk_hw_get_clk(hw, con_id);
+ clk = __clk_hw_get_clk(hw, con_id, dev->driver->owner);
if (!IS_ERR(clk)) {
*clkp = clk;
devres_add(dev, clkp);
@@ -4772,7 +4777,8 @@ void __clk_put(struct clk *clk)
owner = clk->core->owner;
kref_put(&clk->core->ref, __clk_release);
- module_put(owner);
+ if (clk->pinning)
+ module_put(owner);
free_clk(clk);
}
@@ -5293,7 +5299,7 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
{
struct clk_hw *hw = of_clk_get_hw_from_clkspec(clkspec);
- return clk_hw_create_clk(NULL, hw, NULL, __func__);
+ return clk_hw_create_clk(NULL, hw, NULL, __func__, NULL);
}
EXPORT_SYMBOL_GPL(of_clk_get_from_provider);
@@ -5320,7 +5326,7 @@ static struct clk *__of_clk_get(struct device_node *np,
{
struct clk_hw *hw = of_clk_get_hw(np, index, con_id);
- return clk_hw_create_clk(NULL, hw, dev_id, con_id);
+ return clk_hw_create_clk(NULL, hw, dev_id, con_id, NULL);
}
struct clk *of_clk_get(struct device_node *np, int index)
diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h
index 2d801900cad59..5009380863a9d 100644
--- a/drivers/clk/clk.h
+++ b/drivers/clk/clk.h
@@ -23,13 +23,14 @@ struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id);
#ifdef CONFIG_COMMON_CLK
struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
- const char *dev_id, const char *con_id);
+ const char *dev_id, const char *con_id,
+ struct module *owner);
void __clk_put(struct clk *clk);
#else
/* All these casts to avoid ifdefs in clkdev... */
static inline struct clk *
clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
- const char *con_id)
+ const char *con_id, struct module *owner)
{
return (struct clk *)hw;
}
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 2f83fb97c6fbe..6c2152c9d7104 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -88,7 +88,7 @@ static struct clk *__clk_get_sys(struct device *dev, const char *dev_id,
{
struct clk_hw *hw = clk_find_hw(dev_id, con_id);
- return clk_hw_create_clk(dev, hw, dev_id, con_id);
+ return clk_hw_create_clk(dev, hw, dev_id, con_id, NULL);
}
struct clk *clk_get_sys(const char *dev_id, const char *con_id)
@@ -105,7 +105,7 @@ struct clk *clk_get(struct device *dev, const char *con_id)
if (dev && dev->of_node) {
hw = of_clk_get_hw(dev->of_node, 0, con_id);
if (!IS_ERR(hw) || PTR_ERR(hw) == -EPROBE_DEFER)
- return clk_hw_create_clk(dev, hw, dev_id, con_id);
+ return clk_hw_create_clk(dev, hw, dev_id, con_id, NULL);
}
return __clk_get_sys(dev, dev_id, con_id);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 7e43caabb54b9..5bc89016e9413 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -37,6 +37,7 @@ struct clk;
struct clk_hw;
struct clk_core;
struct dentry;
+struct module;
/**
* struct clk_rate_request - Structure encoding the clk constraints that
@@ -316,8 +317,9 @@ struct clk_init_data {
* @core: pointer to the struct clk_core instance that points back to this
* struct clk_hw instance
*
- * @clk: pointer to the per-user struct clk instance that can be used to call
- * into the clk API
+ * @clk: pointer to the per-user struct clk instance. This will be removed at
+ * some point in the future, Please consider the field obsolete and do not use
+ * it. Use clk_hw_get_clk() to get a per-user struct clk from a struct clk_hw.
*
* @init: pointer to struct clk_init_data that contains the init data shared
* with the common clock framework. This pointer will be set to NULL once
@@ -1343,10 +1345,24 @@ static inline struct clk_hw *__clk_get_hw(struct clk *clk)
}
#endif
-struct clk *clk_hw_get_clk(struct clk_hw *hw, const char *con_id);
+struct clk *__clk_hw_get_clk(struct clk_hw *hw, const char *con_id,
+ struct module *owner);
struct clk *devm_clk_hw_get_clk(struct device *dev, struct clk_hw *hw,
const char *con_id);
+/**
+ * clk_hw_get_clk - get clk consumer given a clk_hw
+ * @hw: clk_hw associated with the clk being consumed
+ * @con_id: connection ID string on device
+ *
+ * Return: new clk consumer
+ * This is the function to be used by providers which need
+ * to get a consumer clk and act on the clock element
+ * Calls to this function must be balanced with calls to clk_put()
+ */
+#define clk_hw_get_clk(hw, con_id) \
+ __clk_hw_get_clk((hw), (con_id), THIS_MODULE)
+
unsigned int clk_hw_get_num_parents(const struct clk_hw *hw);
struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);
struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0194/1756] microblaze: CCF: fix refcount leak
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (192 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0193/1756] clk: fix self-consuming provider module pinning Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0195/1756] microblaze: prevent ptrace writes to MSR and pt_mode Greg Kroah-Hartman
` (804 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander A. Klimov, Michal Simek,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander A. Klimov <grandmaster@al2klimov.de>
[ Upstream commit aeedf85beac51c7cd8f7bf4c918a0104dfdb8b78 ]
Every value returned from of_clk_get() is supposed to be cleaned up
via clk_put() once not needed anymore.
Fixes: c1120542b99a ("microblaze: Add support for CCF")
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Link: https://patch.msgid.link/20260526184105.18962-4-grandmaster@al2klimov.de
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/microblaze/kernel/cpu/cpuinfo.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/microblaze/kernel/cpu/cpuinfo.c b/arch/microblaze/kernel/cpu/cpuinfo.c
index cd9b4450763b0..32c508e85408a 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo.c
@@ -133,6 +133,7 @@ void __init setup_cpuinfo_clk(void)
cpuinfo.cpu_clock_freq = fcpu(cpu, "timebase-frequency");
} else {
cpuinfo.cpu_clock_freq = clk_get_rate(clk);
+ clk_put(clk);
}
if (!cpuinfo.cpu_clock_freq) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0195/1756] microblaze: prevent ptrace writes to MSR and pt_mode
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (193 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0194/1756] microblaze: CCF: fix refcount leak Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0196/1756] soundwire: intel: initialise quirk_mask before reading it Greg Kroah-Hartman
` (803 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Michal Simek,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
[ Upstream commit 8518fd17ccef4a7d77877ccb0403b722106ad1a4 ]
arch_ptrace() accepts PTRACE_POKEUSR for every aligned offset below
PT_SIZE. This includes the saved machine status register and pt_mode,
which are kernel-owned execution state rather than general registers.
On return from an exception, rtbd copies MSR_UMS to the live MSR_UM bit.
An unprivileged same-UID tracer can therefore clear MSR_UMS in its
tracee's saved register frame and make the tracee resume in supervisor
mode. pt_mode also controls whether later entry paths classify the frame
as kernel or user state.
Reject PTRACE_POKEUSR writes to both fields while retaining read access.
Fixes: 2b4384542691 ("microblaze_v8: ptrace support")
Assisted-by: Codex:gpt-5
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Link: https://patch.msgid.link/20260821103026.3627292-2-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/microblaze/kernel/ptrace.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
index 5234d0c1dcaad..04700b08842e2 100644
--- a/arch/microblaze/kernel/ptrace.c
+++ b/arch/microblaze/kernel/ptrace.c
@@ -101,6 +101,9 @@ long arch_ptrace(struct task_struct *child, long request,
} else {
rval = -EIO;
}
+ } else if (request == PTRACE_POKEUSR &&
+ (addr == PT_MSR || addr == PT_MODE)) {
+ rval = -EIO;
} else if (addr < PT_SIZE && (addr & 0x3) == 0) {
microblaze_reg_t *reg_addr = reg_save_addr(addr, child);
if (request == PTRACE_PEEKUSR)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0196/1756] soundwire: intel: initialise quirk_mask before reading it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (194 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0195/1756] microblaze: prevent ptrace writes to MSR and pt_mode Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0197/1756] arm64: dts: rockchip: Correct Device Orientation on Gameforce Ace Greg Kroah-Hartman
` (802 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Boris Faure, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Faure <boris@fau.re>
[ Upstream commit ee8a8cfe4e8d3c67456e554c988017c252710a25 ]
sdw_master_read_intel_prop() declares quirk_mask without an initialiser
and ignores the return value of fwnode_property_read_u32(). When a BIOS
does not describe "intel-quirk-mask" for a link, the property read leaves
the variable untouched and stack garbage decides whether
SDW_INTEL_QUIRK_MASK_BUS_DISABLE is honoured, so the link may be marked
hw_disabled at random.
Initialise it to 0, matching is_link_enabled() in
sound/hda/core/intel-sdw-acpi.c.
Found by code inspection, not observed at run time.
Fixes: 395713d8ca43 ("soundwire: intel: handle disabled links")
Signed-off-by: Boris Faure <boris@fau.re>
Link: https://patch.msgid.link/20260820212220.226912-1-boris@fau.re
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soundwire/intel_auxdevice.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index d444ca477064f..5843c219ca430 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -130,7 +130,7 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus)
struct sdw_intel_prop *intel_prop;
struct fwnode_handle *link;
char name[32];
- u32 quirk_mask;
+ u32 quirk_mask = 0;
/* Find master handle */
snprintf(name, sizeof(name),
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0197/1756] arm64: dts: rockchip: Correct Device Orientation on Gameforce Ace
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (195 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0196/1756] soundwire: intel: initialise quirk_mask before reading it Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0198/1756] wifi: rtw88: debugfs: dont vzalloc(0) when rsvd_page is read unconfigured Greg Kroah-Hartman
` (801 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Morgan, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Morgan <macromorgan@hotmail.com>
[ Upstream commit 0d170ee38e7a943248082cdb4b3e40b45a96e2f6 ]
The display, touchscreen, and IMU are currently not oriented
consistently. The touchscreen is 90 degrees offset and the IMU is using
the default mount matrix which is 180 degrees offset.
Fix the touchscreen alignment and add a mount matrix for the IMU. When
the device is held vertically relative to the display hardware, the
touchscreen 0,0 position is in the top left corner of the display
(next to the home button), and the IMU reads the correct orientation.
Fixes: 4e946c447a04 ("arm64: dts: rockchip: Add GameForce Ace")
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://patch.msgid.link/20260828205331.78185-1-macroalpha82@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts b/arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts
index b9a17108e1acd..b658e4892424b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts
@@ -519,6 +519,7 @@ regulator-state-mem {
&i2c3 {
status = "okay";
+ /* Touchscreen is rotated 90 degrees with 0,0 position near home button. */
touchscreen@14 {
compatible = "goodix,gt911";
reg = <0x14>;
@@ -528,10 +529,8 @@ touchscreen@14 {
pinctrl-0 = <&touch_int>, <&touch_rst>;
pinctrl-names = "default";
reset-gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_HIGH>;
- touchscreen-inverted-x;
touchscreen-size-x = <1080>;
touchscreen-size-y = <1920>;
- touchscreen-swapped-x-y;
};
};
@@ -563,11 +562,15 @@ channel@7 {
};
};
+ /* IMU oriented relative to panel, which is rotated 90 degrees. */
imu@68 {
compatible = "invensense,mpu6880";
reg = <0x68>;
interrupt-parent = <&gpio0>;
interrupts = <RK_PD3 IRQ_TYPE_EDGE_RISING>;
+ mount-matrix = "-1", "0", "0",
+ "0", "-1", "0",
+ "0", "0", "1";
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0198/1756] wifi: rtw88: debugfs: dont vzalloc(0) when rsvd_page is read unconfigured
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (196 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0197/1756] arm64: dts: rockchip: Correct Device Orientation on Gameforce Ace Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0199/1756] sched_ext/scx_flatcg: Make cgv_node_less() wraparound-safe Greg Kroah-Hartman
` (800 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abdurrahman Karadag, Ping-Ke Shih,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdurrahman Karadag <abdurrahmankaradag19@gmail.com>
[ Upstream commit 81510c3d6f2199889a4a936d8cf8b9e05911b10e ]
Reading the rsvd_page debugfs entry before writing a page offset and
count to it calls vzalloc() with a size of zero, because
rsvd_page.page_num defaults to 0. vmalloc warns about this:
WARNING: mm/vmalloc.c:4019 at __vmalloc_node_range_noprof+0x9ac/0xa30
...
Call Trace:
__vmalloc_node_noprof+0x4c/0x70
rtw_debugfs_get_rsvd_page+0x4c/0x110 [rtw88_core]
seq_read_iter+0x132/0x4b0
seq_read+0x12e/0x1c0
full_proxy_read+0x6f/0xc0
vfs_read+0xdd/0x490
rtw_fw_dump_fifo() would reject the zero size anyway, but only after
the allocation. Check for a zero buffer size first and print a short
usage hint instead of allocating.
Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Abdurrahman Karadag <abdurrahmankaradag19@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260827131244.35623-1-abdurrahmankaradag19@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/realtek/rtw88/debug.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index c26a6905fd15a..ca38bc12dce26 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -315,6 +315,11 @@ static int rtw_debugfs_get_rsvd_page(struct seq_file *m, void *v)
int i;
int ret;
+ if (!buf_size) {
+ seq_puts(m, "usage: echo <page_offset> <page_num> > rsvd_page\n");
+ return 0;
+ }
+
buf = vzalloc(buf_size);
if (!buf)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0199/1756] sched_ext/scx_flatcg: Make cgv_node_less() wraparound-safe
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (197 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0198/1756] wifi: rtw88: debugfs: dont vzalloc(0) when rsvd_page is read unconfigured Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0200/1756] fuse: fall back to copy_splice_read() on FOPEN_DIRECT_IO Greg Kroah-Hartman
` (799 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Tao Cui, Tejun Heo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Cui <cuitao@kylinos.cn>
[ Upstream commit bf2f23dc5a36237c0d4738966829e5cbde973c8a ]
cgv_node_less() compares cvtimes with a plain <, which misorders once
cvtime wraps: the wrapped node lands at the front of the tree while
the unwrapped ones get stuck behind it. Each CPU picking a cgroup
charges it a full slice, making wrap occur earlier than a naive
estimate might suggest.
Use time_before() instead. cgrp_cap_budget() bounds the lag behind
cvtime_now, while the lead is bounded by the slice charge plus pending
cvtime_delta on re-insertion, so the cyclic ordering assumptions of
time_before() hold.
Fixes: a4103eacc2ab ("sched_ext: Add a cgroup scheduler which uses flattened hierarchy")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/3f1ce004-e259-4e72-a5f7-14a5050053bd@linux.dev
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/sched_ext/scx_flatcg.bpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
index d9cd322210799..ee984a194ab85 100644
--- a/tools/sched_ext/scx_flatcg.bpf.c
+++ b/tools/sched_ext/scx_flatcg.bpf.c
@@ -149,7 +149,7 @@ static bool cgv_node_less(struct bpf_rb_node *a, const struct bpf_rb_node *b)
cgc_a = container_of(a, struct cgv_node, rb_node);
cgc_b = container_of(b, struct cgv_node, rb_node);
- return cgc_a->cvtime < cgc_b->cvtime;
+ return time_before(cgc_a->cvtime, cgc_b->cvtime);
}
static struct fcg_cpu_ctx *find_cpu_ctx(void)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0200/1756] fuse: fall back to copy_splice_read() on FOPEN_DIRECT_IO
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (198 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0199/1756] sched_ext/scx_flatcg: Make cgv_node_less() wraparound-safe Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0201/1756] dlm: validate lock modes in recovery messages Greg Kroah-Hartman
` (798 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yafang Shao, Changyuan Lyu,
Miklos Szeredi, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <mszeredi@redhat.com>
[ Upstream commit 10bd6b32965265688fa277d166ab224de8e86eb2 ]
Yafang Shao reports:
"After upgrading the kernel from 6.1.y to 6.18.y on production servers,
some containers failed to read lxcfs data. The root cause is that our
lxcfs is still at the old v3.0.4, which does not include commit 25982f5
("Set the file size to 4k") [0].
Between 6.1.y and 6.18.y, the FUSE splice_read path was converted from
generic_file_splice_read() to filemap_splice_read() by commit
2cb1e08985e3 ("splice: Use filemap_splice_read() instead of
generic_file_splice_read()"). Unlike generic_file_splice_read(),
filemap_splice_read() strictly checks i_size and refuses to read from
zero-size files, which breaks virtual FUSE filesystems like the old
lxcfs."
Fix by using copy_splice_read() for the FOPEN_DIRECT_IO case, just like the
VFS does for DAX and O_DIRECT files.
Reported-by: Yafang Shao <laoar.shao@gmail.com>
Closes: https://lore.kernel.org/all/20260706025705.58301-1-laoar.shao@gmail.com/
Reported-by: Changyuan Lyu <changyuanl@google.com>
Closes: https://lore.kernel.org/all/20260901213412.1763253-1-changyuanl@google.com/
Fixes: 2cb1e08985e3 ("splice: Use filemap_splice_read() instead of generic_file_splice_read()")
Tested-and-acked-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fuse/file.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index cada359fd03a2..f733a0f781146 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1795,7 +1795,10 @@ static ssize_t fuse_splice_read(struct file *in, loff_t *ppos,
struct fuse_file *ff = in->private_data;
/* FOPEN_DIRECT_IO overrides FOPEN_PASSTHROUGH */
- if (fuse_file_passthrough(ff) && !(ff->open_flags & FOPEN_DIRECT_IO))
+
+ if (ff->open_flags & FOPEN_DIRECT_IO)
+ return copy_splice_read(in, ppos, pipe, len, flags);
+ else if (fuse_file_passthrough(ff))
return fuse_passthrough_splice_read(in, ppos, pipe, len, flags);
else
return filemap_splice_read(in, ppos, pipe, len, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0201/1756] dlm: validate lock modes in recovery messages
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (199 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0200/1756] fuse: fall back to copy_splice_read() on FOPEN_DIRECT_IO Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0202/1756] dlm: fix NULL pointer dereference in dlm_dump_rsb_name() Greg Kroah-Hartman
` (797 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Aring, Danila Chernetsov,
David Teigland, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danila Chernetsov <listdansp@mail.ru>
[ Upstream commit 7bf1aca6d626944091a5cb218b4e487547edff0a ]
The DLM recovery path restores lock state from rcom_lock messages
received from remote nodes. The lock modes in these messages are
copied directly into the local lkb state without validating that they
are within the valid DLM lock mode range.
The rest of the DLM code assumes that lkb_rqmode and lkb_grmode
contain valid lock modes. In particular, LVB callback handling in
dlm_may_skip_callback() uses lock modes as indexes into the
dlm_lvb_operations array:
dlm_lvb_operations[prev_mode + 1][mode + 1]
An invalid lock mode received during recovery could therefore result in
an out-of-bounds read during subsequent LVB callback processing.
Validate rl_rqmode and rl_grmode before storing them into the local LKB
state. This preserves the lock mode invariant required by the rest of
the DLM code.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: e7fd41792fc0 ("[DLM] The core of the DLM for GFS2/CLVM")
Acked-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Danila Chernetsov <listdansp@mail.ru>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dlm/lock.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 195e4ce22a824..ad0715f905195 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -5558,6 +5558,10 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
{
struct rcom_lock *rl = (struct rcom_lock *) rc->rc_buf;
+ if (rl->rl_rqmode < DLM_LOCK_IV || rl->rl_rqmode > DLM_LOCK_EX ||
+ rl->rl_grmode < DLM_LOCK_IV || rl->rl_grmode > DLM_LOCK_EX)
+ return -EINVAL;
+
lkb->lkb_nodeid = le32_to_cpu(rc->rc_header.h_nodeid);
lkb->lkb_ownpid = le32_to_cpu(rl->rl_ownpid);
lkb->lkb_remid = le32_to_cpu(rl->rl_lkid);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0202/1756] dlm: fix NULL pointer dereference in dlm_dump_rsb_name()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (200 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0201/1756] dlm: validate lock modes in recovery messages Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0203/1756] dlm: fix buffer overflow from negative len in dlm_search_rsb_tree Greg Kroah-Hartman
` (796 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Aring, Danila Chernetsov,
David Teigland, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danila Chernetsov <listdansp@mail.ru>
[ Upstream commit 19982c99a302ab544c69f95d37ca3070c89762d3 ]
The function dlm_dump_rsb_name() is called from receive_rcom_lookup()
when a debug dump is requested via a special RCOM_LOOKUP message with
rc_id == 0xFFFFFFFF.
The resource name passed to dlm_dump_rsb_name() comes from the received
message. There is no guarantee that an RSB with this name exists in the
local hash table.
dlm_search_rsb_tree() returns 0 when the RSB is found and stores a valid
pointer in r. When the lookup fails, it returns -EBADR and leaves r
NULL.
The current error handling is inverted:
if (!error)
goto out;
As a result, dlm_dump_rsb() is called only when the lookup fails and r
is NULL, resulting in a NULL pointer dereference.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 2d90354027ad ("dlm: merge toss and keep hash table lists into one list")
Acked-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Danila Chernetsov <listdansp@mail.ru>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dlm/lock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index ad0715f905195..18c4039058969 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1421,7 +1421,7 @@ void dlm_dump_rsb_name(struct dlm_ls *ls, const char *name, int len)
rcu_read_lock();
error = dlm_search_rsb_tree(&ls->ls_rsbtbl, name, len, &r);
- if (!error)
+ if (error)
goto out;
dlm_dump_rsb(r);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0203/1756] dlm: fix buffer overflow from negative len in dlm_search_rsb_tree
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (201 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0202/1756] dlm: fix NULL pointer dereference in dlm_dump_rsb_name() Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0204/1756] dlm: fix variable key length lookup Greg Kroah-Hartman
` (795 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Aring, Joseph Qi,
David Teigland, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
[ Upstream commit d785f7d92f197b72d496bbcf54a160cd54f00263 ]
commit 080e5563f878c ("dlm: validate length in dlm_search_rsb_tree")
only checks for len > DLM_RESNAME_MAXLEN, which does not catch negative
values. While the input 'len' can be negative and a negative int passed
to memcpy() is implicitly converted to a large size_t, causing a stack
buffer overflow on the key[] array.
Fix this by changing the 'len' parameter type from int to unsigned int.
This ensures negative values from callers are implicitly converted to
large unsigned values that are caught by the existing
len > DLM_RESNAME_MAXLEN check.
Acked-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Stable-dep-of: b4e6ae7ba711 ("dlm: fix variable key length lookup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dlm/lock.c | 6 ++++--
fs/dlm/lock.h | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 18c4039058969..431534e956f0e 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -622,12 +622,14 @@ static int get_rsb_struct(struct dlm_ls *ls, const void *name, int len,
return 0;
}
-int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name, int len,
- struct dlm_rsb **r_ret)
+int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name,
+ unsigned int len, struct dlm_rsb **r_ret)
{
char key[DLM_RESNAME_MAXLEN] = {};
+
if (len > DLM_RESNAME_MAXLEN)
return -EINVAL;
+
memcpy(key, name, len);
*r_ret = rhashtable_lookup_fast(rhash, &key, dlm_rhash_rsb_params);
if (*r_ret)
diff --git a/fs/dlm/lock.h b/fs/dlm/lock.h
index b23d7b854ed46..c75975937331c 100644
--- a/fs/dlm/lock.h
+++ b/fs/dlm/lock.h
@@ -31,8 +31,8 @@ void resume_scan_timer(struct dlm_ls *ls);
int dlm_master_lookup(struct dlm_ls *ls, int from_nodeid, const char *name,
int len, unsigned int flags, int *r_nodeid, int *result);
-int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name, int len,
- struct dlm_rsb **r_ret);
+int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name,
+ unsigned int len, struct dlm_rsb **r_ret);
void dlm_recover_purge(struct dlm_ls *ls, const struct list_head *root_list);
void dlm_purge_mstcpy_locks(struct dlm_rsb *r);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0204/1756] dlm: fix variable key length lookup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (202 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0203/1756] dlm: fix buffer overflow from negative len in dlm_search_rsb_tree Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0205/1756] remoteproc: imx_dsp_rproc: Add support of recovery and coredump process Greg Kroah-Hartman
` (794 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Aring, David Teigland,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Aring <aahringo@redhat.com>
[ Upstream commit b4e6ae7ba711758c38d5eb7d5a7a0712273bdf6f ]
Before commit 6c648035cbe7 ("dlm: switch to use rhashtable for rsbs")
the rsb hashtable was dynamic key length. Accidentally it was changed to
switch to static key length which can end in different results. We
fixing this back to the original behaviour by adding the necessary
functionality to rhashtable to handle the objects and lookups as dynamic
key lengths.
Fixes: 6c648035cbe7 ("dlm: switch to use rhashtable for rsbs")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/dlm/config.c | 30 ++++++++++++++++++++++++++++--
fs/dlm/dlm_internal.h | 5 +++++
fs/dlm/lock.c | 6 ++++--
3 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index eac96f1c1d742..a523df1a1a735 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -63,11 +63,37 @@ static void release_node(struct config_item *);
static struct configfs_attribute *comm_attrs[];
static struct configfs_attribute *node_attrs[];
+static u32 rsb_hashfn(const void *data, u32 len, u32 seed)
+{
+ const struct dlm_rsb_key *key = data;
+
+ return jhash(key->name, key->len, 0);
+}
+
+static u32 rsb_obj_hashfn(const void *data, u32 len, u32 seed)
+{
+ const struct dlm_rsb *r = data;
+
+ return r->res_hash;
+}
+
+static int rsb_obj_cmpfn(struct rhashtable_compare_arg *arg, const void *obj)
+{
+ const struct dlm_rsb_key *key = arg->key;
+ const struct dlm_rsb *r = obj;
+
+ if (key->len != r->res_length)
+ return -1;
+
+ return memcmp(&r->res_name, key->name, key->len);
+}
+
const struct rhashtable_params dlm_rhash_rsb_params = {
.nelem_hint = 3, /* start small */
- .key_len = DLM_RESNAME_MAXLEN,
- .key_offset = offsetof(struct dlm_rsb, res_name),
.head_offset = offsetof(struct dlm_rsb, res_node),
+ .hashfn = rsb_hashfn,
+ .obj_hashfn = rsb_obj_hashfn,
+ .obj_cmpfn = rsb_obj_cmpfn,
.automatic_shrinking = true,
};
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index d534a4bc162bb..08b903fbce589 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -340,6 +340,11 @@ struct dlm_rsb {
char res_name[DLM_RESNAME_MAXLEN+1];
};
+struct dlm_rsb_key {
+ char name[DLM_RESNAME_MAXLEN];
+ size_t len;
+};
+
/* dlm_master_lookup() flags */
#define DLM_LU_RECOVER_DIR 1
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 431534e956f0e..74af60296e099 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -625,12 +625,14 @@ static int get_rsb_struct(struct dlm_ls *ls, const void *name, int len,
int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name,
unsigned int len, struct dlm_rsb **r_ret)
{
- char key[DLM_RESNAME_MAXLEN] = {};
+ struct dlm_rsb_key key = {
+ .len = len,
+ };
if (len > DLM_RESNAME_MAXLEN)
return -EINVAL;
- memcpy(key, name, len);
+ memcpy(key.name, name, len);
*r_ret = rhashtable_lookup_fast(rhash, &key, dlm_rhash_rsb_params);
if (*r_ret)
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0205/1756] remoteproc: imx_dsp_rproc: Add support of recovery and coredump process
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (203 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0204/1756] dlm: fix variable key length lookup Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0206/1756] remoteproc: imx_dsp_rproc: Drop extra space Greg Kroah-Hartman
` (793 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shengjiu Wang, Daniel Baluta,
Mathieu Poirier, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Upstream commit c4c432dfb00fcb69d56cc9778f527cce71cec9bb ]
When enabled FW recovery, but is broken because software reset is missed
in this recovery flow. So move software reset from
imx_dsp_runtime_resume() to .load() and clear memory before loading
firmware to make recovery work.
Add call rproc_coredump_set_elf_info() to initialize the elf info for
coredump, otherwise coredump will report error "ELF class is not set".
Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20250722075225.544319-1-shengjiu.wang@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Stable-dep-of: 13df1fa4f1a3 ("remoteproc: imx_dsp: Acquire runtime PM before adding carveouts")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/imx_dsp_rproc.c | 45 +++++++++++++++++++-----------
1 file changed, 29 insertions(+), 16 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index 427c200a175c3..af0b9d39a8eb3 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -680,7 +680,6 @@ static int imx_dsp_rproc_prepare(struct rproc *rproc)
{
struct imx_dsp_rproc *priv = rproc->priv;
struct device *dev = rproc->dev.parent;
- struct rproc_mem_entry *carveout;
int ret;
ret = imx_dsp_rproc_add_carveout(priv);
@@ -691,15 +690,6 @@ static int imx_dsp_rproc_prepare(struct rproc *rproc)
pm_runtime_get_sync(dev);
- /*
- * Clear buffers after pm rumtime for internal ocram is not
- * accessible if power and clock are not enabled.
- */
- list_for_each_entry(carveout, &rproc->carveouts, node) {
- if (carveout->va)
- memset(carveout->va, 0, carveout->len);
- }
-
return 0;
}
@@ -928,13 +918,39 @@ static int imx_dsp_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw
return 0;
}
+static int imx_dsp_rproc_load(struct rproc *rproc, const struct firmware *fw)
+{
+ struct imx_dsp_rproc *priv = rproc->priv;
+ const struct imx_dsp_rproc_dcfg *dsp_dcfg = priv->dsp_dcfg;
+ struct rproc_mem_entry *carveout;
+ int ret;
+
+ /* Reset DSP if needed */
+ if (dsp_dcfg->reset)
+ dsp_dcfg->reset(priv);
+ /*
+ * Clear buffers after pm rumtime for internal ocram is not
+ * accessible if power and clock are not enabled.
+ */
+ list_for_each_entry(carveout, &rproc->carveouts, node) {
+ if (carveout->va)
+ memset(carveout->va, 0, carveout->len);
+ }
+
+ ret = imx_dsp_rproc_elf_load_segments(rproc, fw);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
static const struct rproc_ops imx_dsp_rproc_ops = {
.prepare = imx_dsp_rproc_prepare,
.unprepare = imx_dsp_rproc_unprepare,
.start = imx_dsp_rproc_start,
.stop = imx_dsp_rproc_stop,
.kick = imx_dsp_rproc_kick,
- .load = imx_dsp_rproc_elf_load_segments,
+ .load = imx_dsp_rproc_load,
.parse_fw = imx_dsp_rproc_parse_fw,
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
.sanity_check = rproc_elf_sanity_check,
@@ -1085,6 +1101,8 @@ static int imx_dsp_rproc_probe(struct platform_device *pdev)
goto err_detach_domains;
}
+ rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_XTENSA);
+
pm_runtime_enable(dev);
return 0;
@@ -1110,7 +1128,6 @@ static int imx_dsp_runtime_resume(struct device *dev)
{
struct rproc *rproc = dev_get_drvdata(dev);
struct imx_dsp_rproc *priv = rproc->priv;
- const struct imx_dsp_rproc_dcfg *dsp_dcfg = priv->dsp_dcfg;
int ret;
/*
@@ -1131,10 +1148,6 @@ static int imx_dsp_runtime_resume(struct device *dev)
return ret;
}
- /* Reset DSP if needed */
- if (dsp_dcfg->reset)
- dsp_dcfg->reset(priv);
-
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0206/1756] remoteproc: imx_dsp_rproc: Drop extra space
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (204 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0205/1756] remoteproc: imx_dsp_rproc: Add support of recovery and coredump process Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0207/1756] remoteproc: imx_dsp: Acquire runtime PM before adding carveouts Greg Kroah-Hartman
` (792 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Daniel Baluta,
Shengjiu Wang, Iuliana Prodan, Peng Fan, Mathieu Poirier,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 8049dc7b631e33a42d8413fe48b043113afa914c ]
Drop extra space between return and zero.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Tested-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20251119-imx-dsp-2025-11-19-v4-5-adafd342d07b@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Stable-dep-of: 13df1fa4f1a3 ("remoteproc: imx_dsp: Acquire runtime PM before adding carveouts")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/imx_dsp_rproc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index af0b9d39a8eb3..2a999f0283142 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -690,7 +690,7 @@ static int imx_dsp_rproc_prepare(struct rproc *rproc)
pm_runtime_get_sync(dev);
- return 0;
+ return 0;
}
/* Unprepare function for rproc_ops */
@@ -698,7 +698,7 @@ static int imx_dsp_rproc_unprepare(struct rproc *rproc)
{
pm_runtime_put_sync(rproc->dev.parent);
- return 0;
+ return 0;
}
/* Kick function for rproc_ops */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0207/1756] remoteproc: imx_dsp: Acquire runtime PM before adding carveouts
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (205 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0206/1756] remoteproc: imx_dsp_rproc: Drop extra space Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0208/1756] arm64: dts: imx95: Avoid 32-bit PCIe window System RAM overlap Greg Kroah-Hartman
` (791 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mathieu Poirier,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 13df1fa4f1a30571442eda64c73d6cac7b9b5c95 ]
The prepare callback publishes DSP carveouts before acquiring the
runtime-PM reference that establishes required clocks and mailbox state.
A PM failure therefore leaves the prepare transaction partially
published.
Acquire runtime PM first and drop that reference if carveout
construction fails, so a failed prepare does not add resources before
its hardware prerequisite.
Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20260830133310.6926-1-pengpeng@iscas.ac.cn
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/imx_dsp_rproc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index 2a999f0283142..df633aaf865b5 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -682,14 +682,17 @@ static int imx_dsp_rproc_prepare(struct rproc *rproc)
struct device *dev = rproc->dev.parent;
int ret;
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ return ret;
+
ret = imx_dsp_rproc_add_carveout(priv);
if (ret) {
dev_err(dev, "failed on imx_dsp_rproc_add_carveout\n");
+ pm_runtime_put_sync(dev);
return ret;
}
- pm_runtime_get_sync(dev);
-
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0208/1756] arm64: dts: imx95: Avoid 32-bit PCIe window System RAM overlap
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (206 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0207/1756] remoteproc: imx_dsp: Acquire runtime PM before adding carveouts Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0209/1756] x86/crash: Reserve elfcorehdr for CONFIG_NR_CPUS, not CONFIG_NR_CPUS_DEFAULT Greg Kroah-Hartman
` (790 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Richard Zhu, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Zhu <hongxing.zhu@nxp.com>
[ Upstream commit 9094eb07b3e236233dbaac61ed30cc65be9e9c6c ]
Move the PCIe non-prefetchable memory PCI bus address from 0xe0000000
to 0x10000000 to avoid overlap with DRAM. Avoid hit this as a P2P
transfer[1]. The 0x10000000 range is reserved and safe to use.
Fixes: dbecf38e60d4e ("arm64: dts: imx95: Correct PCIe outbound address space configuration")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Link: https://lore.kernel.org/imx/753fca23-c3eb-45e3-aeac-b7b248fa723a@app.fastmail.com/ [1]
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx95.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi
index 227eae56125d3..7b88fe079087a 100644
--- a/arch/arm64/boot/dts/freescale/imx95.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx95.dtsi
@@ -1481,7 +1481,7 @@ pcie0: pcie@4c300000 {
<0 0x4c340000 0 0x4000>;
reg-names = "dbi", "config", "atu", "app";
ranges = <0x43000000 0x9 0x00000000 0x9 0x00000000 0x0 0xe0000000>,
- <0x82000000 0x0 0xe0000000 0x9 0xe0000000 0x0 0x10000000>,
+ <0x82000000 0x0 0x10000000 0x9 0xe0000000 0x0 0x10000000>,
<0x81000000 0x0 0x00000000 0x9 0xf0000000 0x0 0x00100000>;
#address-cells = <3>;
#size-cells = <2>;
@@ -1549,7 +1549,7 @@ pcie1: pcie@4c380000 {
<0 0x4c3c0000 0 0x4000>;
reg-names = "dbi", "config", "atu", "app";
ranges = <0x43000000 0xa 0x00000000 0xa 0x00000000 0x0 0xe0000000>,
- <0x82000000 0x0 0xe0000000 0xa 0xe0000000 0x0 0x10000000>,
+ <0x82000000 0x0 0x10000000 0xa 0xe0000000 0x0 0x10000000>,
<0x81000000 0x0 0x00000000 0xa 0xf0000000 0x0 0x00100000>;
#address-cells = <3>;
#size-cells = <2>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0209/1756] x86/crash: Reserve elfcorehdr for CONFIG_NR_CPUS, not CONFIG_NR_CPUS_DEFAULT
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (207 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0208/1756] arm64: dts: imx95: Avoid 32-bit PCIe window System RAM overlap Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0210/1756] bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively Greg Kroah-Hartman
` (789 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ionut Nechita, Dave Hansen,
Jinjie Ruan, Bradley Morgan, Sourabh Jain, Baoquan He,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ionut Nechita <ionut.nechita@windriver.com>
[ Upstream commit 6664ad1026b558563702f9a1ce637df33e7c001e ]
NR_CPUS_DEFAULT is purely a Kconfig thing. Its entire purpose in life is
to start NR_CPUS at a sane value. There is precisely one (buggy)
reference to it outside of Kconfig in the whole kernel: the x86 crash
code.
That code undersizes the elfcorehdr reservation whenever NR_CPUS exceeds
NR_CPUS_DEFAULT, because the header carries one phdr per possible CPU and
num_possible_cpus() is bounded by NR_CPUS. kexec_file_load(2) then fails
with -EINVAL from sanity_check_segment_list(), and kexec_load(2) silently
truncates the elfcorehdr, which surfaces later as a bad or unusable dump.
Size the elfcorehdr reservation with NR_CPUS instead.
Fixes: ea53ad9cf73b ("x86/crash: add x86 crash hotplug support")
Signed-off-by: Ionut Nechita <ionut.nechita@windriver.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Acked-by: Baoquan He <baoquan.he@linux.dev>
Link: https://patch.msgid.link/20260901071041.16311-2-ionut.nechita@windriver.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/crash.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 340af81556584..957b8464a9aaa 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -379,9 +379,9 @@ int crash_load_segments(struct kimage *image)
* maximum CPUs and maximum memory ranges.
*/
if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
- pnum = 2 + CONFIG_NR_CPUS_DEFAULT + CONFIG_CRASH_MAX_MEMORY_RANGES;
+ pnum = 2 + CONFIG_NR_CPUS + CONFIG_CRASH_MAX_MEMORY_RANGES;
else
- pnum += 2 + CONFIG_NR_CPUS_DEFAULT;
+ pnum += 2 + CONFIG_NR_CPUS;
if (pnum < (unsigned long)PN_XNUM) {
kbuf.memsz = pnum * sizeof(Elf64_Phdr);
@@ -440,7 +440,7 @@ unsigned int arch_crash_get_elfcorehdr_size(void)
unsigned int sz;
/* kernel_map, VMCOREINFO and maximum CPUs */
- sz = 2 + CONFIG_NR_CPUS_DEFAULT;
+ sz = 2 + CONFIG_NR_CPUS;
if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
sz += CONFIG_CRASH_MAX_MEMORY_RANGES;
sz *= sizeof(Elf64_Phdr);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0210/1756] bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (208 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0209/1756] x86/crash: Reserve elfcorehdr for CONFIG_NR_CPUS, not CONFIG_NR_CPUS_DEFAULT Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0211/1756] PCI: endpoint: pci-epf-vntb: Pass PF/VF number when BAR programming Greg Kroah-Hartman
` (788 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Toke Høiland-Jørgensen,
Andrii Nakryiko, Larysa Zaremba, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toke Høiland-Jørgensen <toke@redhat.com>
[ Upstream commit 06d6f845c4bda857a6ae864690f35321b878e827 ]
When setting the XDP hints ifname, bpftool would set the
BPF_F_XDP_DEV_BOUND_ONLY without looking at the existing program flags,
overriding any other flag values. This was always a destructive action,
but after we change libbpf to carry the frags section flag in
prog_flags, this can impact bpftool loading of XDP frags programs.
Change the flag setting to be non-destructive by OR'ing it with the
existing flags.
Fixes: f46392ee3dec ("bpftool: Specify XDP Hints ifname when loading program")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://lore.kernel.org/bpf/20260901-libbpf-frags-flags-v3-1-4eb6f14968b0@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/prog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 6e095a3afc046..ee91c256d4fbd 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -1713,7 +1713,7 @@ static int load_with_options(int argc, char **argv, bool first_prog_only)
}
if (prog_type == BPF_PROG_TYPE_XDP && xdpmeta_ifindex) {
- bpf_program__set_flags(pos, BPF_F_XDP_DEV_BOUND_ONLY);
+ bpf_program__set_flags(pos, bpf_program__flags(pos) | BPF_F_XDP_DEV_BOUND_ONLY);
bpf_program__set_ifindex(pos, xdpmeta_ifindex);
} else {
bpf_program__set_ifindex(pos, offload_ifindex);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0211/1756] PCI: endpoint: pci-epf-vntb: Pass PF/VF number when BAR programming
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (209 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0210/1756] bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0212/1756] dmaengine: fsl_raid: dont invoke client callback under desc_lock Greg Kroah-Hartman
` (787 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Koichiro Den, Manivannan Sadhasivam,
Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koichiro Den <den@valinux.co.jp>
[ Upstream commit afe2aa9dc93d904730bab63f5ccb514a318e6464 ]
vntb_epf_mw_set_trans() programs the memory-window BAR through
pci_epc_set_bar() with hardcoded function numbers (0, 0), so the BAR
lands on the wrong function whenever the vNTB EPF is bound to anything
but PF0. The other BAR programming sites in the vNTB driver already pass
the EPF's own numbers.
Pass the EPF's own func_no/vfunc_no here as well.
Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP")
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260728172306.2751813-2-den@valinux.co.jp
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/endpoint/functions/pci-epf-vntb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
index 710bddc30cdfc..ea96174cc5110 100644
--- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
@@ -1065,7 +1065,8 @@ static int vntb_epf_mw_set_trans(struct ntb_dev *ndev, int pidx, int idx,
epf_bar->barno = barno;
epf_bar->size = size;
- ret = pci_epc_set_bar(ntb->epf->epc, 0, 0, epf_bar);
+ ret = pci_epc_set_bar(ntb->epf->epc, ntb->epf->func_no,
+ ntb->epf->vfunc_no, epf_bar);
if (ret) {
dev_err(dev, "failure set mw trans\n");
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0212/1756] dmaengine: fsl_raid: dont invoke client callback under desc_lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (210 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0211/1756] PCI: endpoint: pci-epf-vntb: Pass PF/VF number when BAR programming Greg Kroah-Hartman
@ 2026-11-18 14:38 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0213/1756] dmaengine: fsl_raid: avoid free_q underflow in free_chan_resources Greg Kroah-Hartman
` (786 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 62c267ce97444f8a381f2bb3cd5d534eb362c540 ]
fsl_re_dequeue() holds re_chan->desc_lock while calling
fsl_re_desc_done(), which synchronously invokes the DMA client completion
callback via dmaengine_desc_get_callback_invoke(). If that callback
submits new work (e.g. fsl_re_tx_submit()), it tries to reacquire the
same desc_lock and deadlocks on the spinlock.
Collect completed descriptors into a local list under the lock, then
release the lock and invoke the callbacks before moving the descriptors
to the ack queue.
Fixes: ad80da658bbc ("dmaengine: Driver support for FSL RaidEngine device.")
Assisted-by: opencode:hy3-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260718053010.3074329-1-rosenp@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/fsl_raid.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
index 014ff523d5ec9..399b4d2a8bac1 100644
--- a/drivers/dma/fsl_raid.c
+++ b/drivers/dma/fsl_raid.c
@@ -162,6 +162,7 @@ static void fsl_re_dequeue(struct tasklet_struct *t)
struct fsl_re_hw_desc *hwdesc;
unsigned long flags;
unsigned int count, oub_count;
+ LIST_HEAD(completed);
int found;
fsl_re_cleanup_descs(re_chan);
@@ -182,8 +183,7 @@ static void fsl_re_dequeue(struct tasklet_struct *t)
}
if (found) {
- fsl_re_desc_done(desc);
- list_move_tail(&desc->node, &re_chan->ack_q);
+ list_move_tail(&desc->node, &completed);
} else {
dev_err(re_chan->dev,
"found hwdesc not in sw queue, discard it\n");
@@ -196,6 +196,17 @@ static void fsl_re_dequeue(struct tasklet_struct *t)
FSL_RE_RMVD_JOB(1));
}
spin_unlock_irqrestore(&re_chan->desc_lock, flags);
+
+ /* Invoke the client callbacks outside the channel lock. The callback
+ * may submit new work which re-acquires desc_lock, so holding it here
+ * would deadlock.
+ */
+ list_for_each_entry_safe(desc, _desc, &completed, node) {
+ fsl_re_desc_done(desc);
+ spin_lock_irqsave(&re_chan->desc_lock, flags);
+ list_move_tail(&desc->node, &re_chan->ack_q);
+ spin_unlock_irqrestore(&re_chan->desc_lock, flags);
+ }
}
/* Per Job Ring interrupt handler */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0213/1756] dmaengine: fsl_raid: avoid free_q underflow in free_chan_resources
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (211 preceding siblings ...)
2026-11-18 14:38 ` [PATCH 6.12 0212/1756] dmaengine: fsl_raid: dont invoke client callback under desc_lock Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0214/1756] RDMA/hns: Fix missing CQE when UD QP use different SL Greg Kroah-Hartman
` (785 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit d805aa5b6088b193debabaa80cc0991bfa2bd057 ]
fsl_re_free_chan_resources() loops alloc_count times calling
list_first_entry() on free_q without checking whether the list still
has entries. If descriptors remain un-acked or pending in submit_q /
active_q / ack_q when the channel resources are freed, free_q becomes
smaller than alloc_count and list_first_entry() returns the list head,
causing list_del() to corrupt the list head and dereference a bogus
pointer.
Walk free_q with list_for_each_entry_safe() until it is empty,
decrementing alloc_count per freed descriptor, instead of relying on
the alloc_count count.
Fixes: ad80da658bbc ("dmaengine: Driver support for FSL RaidEngine device.")
Assisted-by: opencode:hy3-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260718235227.385108-1-rosenp@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/fsl_raid.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
index 399b4d2a8bac1..5c4f1d0f0c115 100644
--- a/drivers/dma/fsl_raid.c
+++ b/drivers/dma/fsl_raid.c
@@ -613,18 +613,15 @@ static int fsl_re_alloc_chan_resources(struct dma_chan *chan)
static void fsl_re_free_chan_resources(struct dma_chan *chan)
{
struct fsl_re_chan *re_chan;
- struct fsl_re_desc *desc;
+ struct fsl_re_desc *desc, *_desc;
re_chan = container_of(chan, struct fsl_re_chan, chan);
- while (re_chan->alloc_count--) {
- desc = list_first_entry(&re_chan->free_q,
- struct fsl_re_desc,
- node);
-
+ list_for_each_entry_safe(desc, _desc, &re_chan->free_q, node) {
list_del(&desc->node);
dma_pool_free(re_chan->re_dev->cf_desc_pool, desc->cf_addr,
desc->cf_paddr);
kfree(desc);
+ re_chan->alloc_count--;
}
if (!list_empty(&re_chan->free_q))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0214/1756] RDMA/hns: Fix missing CQE when UD QP use different SL
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (212 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0213/1756] dmaengine: fsl_raid: avoid free_q underflow in free_chan_resources Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0215/1756] clk: Use the generic OF phandle parsing in only one place Greg Kroah-Hartman
` (784 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengchang Tang, Junxian Huang,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <tangchengchang@huawei.com>
[ Upstream commit 3547f46c31993d41748f0f7936f9d4dc5b5d4b12 ]
Due to the hardware contraint, CQEs may be dropped when a UD QP
sends with multiple SLs. Pin the SL to the value from the first
post_send on the QP to avoid this issue.
Fixes: 66d86e529dd5 ("RDMA/hns: Add UD support for HIP09")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20260831020324.3540901-2-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hns/hns_roce_device.h | 1 +
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 15 ++++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
index e184a715d1661..a825dae5744ce 100644
--- a/drivers/infiniband/hw/hns/hns_roce_device.h
+++ b/drivers/infiniband/hw/hns/hns_roce_device.h
@@ -655,6 +655,7 @@ struct hns_roce_qp {
u8 priority;
spinlock_t flush_lock;
struct hns_roce_dip *dip;
+ bool ud_sl_set;
};
struct hns_roce_ib_iboe {
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index a54f86468b053..9036593857397 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -425,7 +425,8 @@ static int set_ud_opcode(struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
return 0;
}
-static int fill_ud_av(struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
+static int fill_ud_av(struct hns_roce_qp *qp,
+ struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
struct hns_roce_ah *ah)
{
struct ib_device *ib_dev = ah->ibah.device;
@@ -435,7 +436,12 @@ static int fill_ud_av(struct hns_roce_v2_ud_send_wqe *ud_sq_wqe,
hr_reg_write(ud_sq_wqe, UD_SEND_WQE_HOPLIMIT, ah->av.hop_limit);
hr_reg_write(ud_sq_wqe, UD_SEND_WQE_TCLASS, ah->av.tclass);
hr_reg_write(ud_sq_wqe, UD_SEND_WQE_FLOW_LABEL, ah->av.flowlabel);
- hr_reg_write(ud_sq_wqe, UD_SEND_WQE_SL, ah->av.sl);
+ if (!qp->ud_sl_set) {
+ qp->sl = ah->av.sl;
+ qp->ud_sl_set = true;
+ }
+
+ hr_reg_write(ud_sq_wqe, UD_SEND_WQE_SL, qp->sl);
ud_sq_wqe->sgid_index = ah->av.gid_index;
@@ -485,12 +491,10 @@ static inline int set_ud_wqe(struct hns_roce_qp *qp,
qp->qkey : ud_wr(wr)->remote_qkey);
hr_reg_write(ud_sq_wqe, UD_SEND_WQE_DQPN, ud_wr(wr)->remote_qpn);
- ret = fill_ud_av(ud_sq_wqe, ah);
+ ret = fill_ud_av(qp, ud_sq_wqe, ah);
if (ret)
return ret;
- qp->sl = to_hr_ah(ud_wr(wr)->ah)->av.sl;
-
set_extend_sge(qp, wr->sg_list, &curr_idx, valid_num_sge);
/*
@@ -5383,6 +5387,7 @@ static void v2_set_flushed_fields(struct ib_qp *ibqp,
hr_reg_write(context, QPC_SQ_PRODUCER_IDX, hr_qp->sq.head);
hr_reg_clear(qpc_mask, QPC_SQ_PRODUCER_IDX);
hr_qp->state = IB_QPS_ERR;
+ hr_qp->ud_sl_set = false;
spin_unlock_irqrestore(&hr_qp->sq.lock, sq_flag);
if (ibqp->srq || ibqp->qp_type == IB_QPT_XRC_INI) /* no RQ */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0215/1756] clk: Use the generic OF phandle parsing in only one place
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (213 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0214/1756] RDMA/hns: Fix missing CQE when UD QP use different SL Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0216/1756] wifi: ath11k: disable interrupts during firmware crash recovery Greg Kroah-Hartman
` (783 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stephen Boyd,
Miquel Raynal (Schneider Electric), Brian Masney, Frank Li,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
[ Upstream commit 57d728b4ab15a8af890013bb0f302e7733f7c1c6 ]
Ideally, there should be one single entry in the OF world. This way, the
DT parsing logic is always identical. At this stage, we call
of_parse_phandle_with_args() in:
- of_parse_clkspec()
- of_clk_get_parent_name()
which kinds of defeats the above statement. Furthermore, when this call
is done from of_clk_get_parent_name(), we fail to parse the
'clock-ranges' property.
Make sure DT world is entered only once by calling of_parse_clkspec()
from of_clk_get_parent_name(). Doing so implies that we do not try the
"clock-ranges" path if we already found a "clocks" property.
Suggested-by: Stephen Boyd <sboyd@kernel.org>
Fixes: 4472287a3b2f5 ("clk: Introduce of_clk_get_hw_from_clkspec()")
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 1bab1ca73a74c..4a10d5c664572 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -5237,6 +5237,8 @@ static int of_parse_clkspec(const struct device_node *np, int index,
* has a "clock-ranges" property, then we can try one of its
* clocks.
*/
+ if (of_property_present(np, "clocks"))
+ break;
np = np->parent;
if (np && !of_property_present(np, "clock-ranges"))
break;
@@ -5381,8 +5383,7 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index)
int count;
struct clk *clk;
- rc = of_parse_phandle_with_args(np, "clocks", "#clock-cells", index,
- &clkspec);
+ rc = of_parse_clkspec(np, index, NULL, &clkspec);
if (rc)
return NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0216/1756] wifi: ath11k: disable interrupts during firmware crash recovery
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (214 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0215/1756] clk: Use the generic OF phandle parsing in only one place Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0217/1756] wifi: ath11k: fix sporadic WLAN initialization failures Greg Kroah-Hartman
` (782 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Julius Bairaktaris,
Rameshkumar Sundaram, Baochen Qiang, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julius Bairaktaris <julius@bairaktaris.de>
[ Upstream commit f7a74e131d3f0de04335dbe278bfb82bdafcdb3e ]
On IPQ8074 a firmware assert reboots the SoC:
Unable to handle kernel read from unreadable memory at virtual address 0
pc : ath11k_hal_srng_access_begin+0xc/0x60 [ath11k]
lr : ath11k_dp_rx_process_mon_status+0x15c/0xd84 [ath11k]
Call trace:
ath11k_hal_srng_access_begin+0xc/0x60 [ath11k]
ath11k_dp_rx_process_mon_rings+0xa0/0x5d4 [ath11k]
ath11k_dp_service_srng+0x1f4/0x348 [ath11k]
ath11k_ahb_ext_grp_napi_poll+0x34/0xd4 [ath11k_ahb]
__napi_poll+0x38/0x188
net_rx_action+0x120/0x2c0
ath11k_core_reconfigure_on_crash() tears the data path down with
ath11k_dp_pdev_free(), ath11k_dp_free() and ath11k_hal_srng_clear(),
which memsets the ring list. The DP NAPI is still running while that
happens, so it services a ring whose address pointer has just been
cleared.
That function used to disable the interrupts first, until
commit d455e805de70 ("wifi: ath11k: rearrange IRQ enable/disable in reset path")
moved the disable into ath11k_core_reset(). reset_work is only queued
from mhi.c and from the debugfs hw-restart handler, so AHB parts never
run it on a real firmware crash. Their recovery goes QMI server exit ->
restart_work -> ath11k_core_reconfigure_on_crash() ->
ath11k_core_qmi_firmware_ready(), and nothing disables the interrupts
anywhere along it.
Disable them again on the crash path. The reset path has already done
so by the time it gets here, hence the ab->is_reset check.
This is also why the debugfs hw-restart trigger never showed the
problem: it goes through ath11k_core_reset(), the one path that still
had the disable.
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.12-01460-QCAHKSWPL_SILICONZ-1
Fixes: d455e805de70 ("wifi: ath11k: rearrange IRQ enable/disable in reset path")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260726221908.104873-3-julius@bairaktaris.de
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/core.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index c6d17dbbdb376..bdadde90df9d2 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -1998,6 +1998,16 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)
mutex_lock(&ab->core_lock);
ath11k_thermal_unregister(ab);
+
+ /*
+ * ath11k_core_reset() already disabled the interrupts on the reset
+ * path; only the firmware crash path reaches here with them live.
+ */
+ if (!ab->is_reset) {
+ ath11k_hif_irq_disable(ab);
+ ath11k_hif_ce_irq_disable(ab);
+ }
+
ath11k_dp_pdev_free(ab);
ath11k_spectral_deinit(ab);
ath11k_ce_cleanup_pipes(ab);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0217/1756] wifi: ath11k: fix sporadic WLAN initialization failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (215 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0216/1756] wifi: ath11k: disable interrupts during firmware crash recovery Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0218/1756] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test Greg Kroah-Hartman
` (781 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miaoqing Pan, Baochen Qiang,
Rameshkumar Sundaram, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
[ Upstream commit 32ec8488d75d122768b1977501bcb5ec799230c4 ]
On WCN6750 platforms, reboot stress testing occasionally results in WLAN
initialization failures after boot. The WPSS firmware reaches the running
state successfully, but no WLAN interface is created.
Analysis shows that ath11k_ahb depends on the QRTR SMD transport for QMI
communication with WPSS firmware. However, this dependency is not
currently expressed in Kconfig, allowing qrtr_smd and ath11k_ahb to load
in either order when built as modules.
If ath11k_ahb is loaded before qrtr_smd becomes available, WLAN
initialization may not complete successfully.
Make the QRTR and QRTR_SMD dependencies explicit and add a soft
dependency to ensure qrtr_smd is loaded before ath11k_ahb.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00204-QCAMSLSWPLZ-1
Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260806101331.484063-2-miaoqing.pan@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/Kconfig | 3 +++
drivers/net/wireless/ath/ath11k/ahb.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/Kconfig b/drivers/net/wireless/ath/ath11k/Kconfig
index 2e935d381b6b1..35d922885c803 100644
--- a/drivers/net/wireless/ath/ath11k/Kconfig
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
@@ -15,6 +15,9 @@ config ATH11K_AHB
tristate "Atheros ath11k AHB support"
depends on ATH11K
depends on REMOTEPROC
+ select RPMSG
+ select QRTR
+ select QRTR_SMD
help
This module adds support for AHB bus
diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index ee40cd3be47e3..b9bf1c5a934cd 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -1357,5 +1357,6 @@ static struct platform_driver ath11k_ahb_driver = {
module_platform_driver(ath11k_ahb_driver);
+MODULE_SOFTDEP("pre: qrtr_smd");
MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices");
MODULE_LICENSE("Dual BSD/GPL");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0218/1756] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (216 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0217/1756] wifi: ath11k: fix sporadic WLAN initialization failures Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0219/1756] wifi: mac80211: fix unauthorised port check for encap offload Greg Kroah-Hartman
` (780 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paul Dolan,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Dolan <paul.dolan.dev@gmail.com>
[ Upstream commit aeebb4884f0e8feb9929f013067488b7f2081f33 ]
The CLONE_CLEAR_SIGHAND test intends to verify that
CLONE_CLEAR_SIGHAND and CLONE_SIGHAND are mutually exclusive. However,
CLONE_SIGHAND without CLONE_VM is independently invalid, so the test
input has another reason to fail with EINVAL.
Add CLONE_VM so that CLONE_SIGHAND is otherwise valid, and require
clone3() to fail with EINVAL. This ensures the test exercises the
intended flag conflict and does not accept an unrelated failure.
Fixes: de5287235631 ("tests: test CLONE_CLEAR_SIGHAND")
Signed-off-by: Paul Dolan <paul.dolan.dev@gmail.com>
Link: https://patch.msgid.link/20260902174939.15135-1-paul.dolan.dev@gmail.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/clone3/clone3_clear_sighand.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c
index ce04267868288..2be0221104456 100644
--- a/tools/testing/selftests/clone3/clone3_clear_sighand.c
+++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c
@@ -50,12 +50,12 @@ static void test_clone3_clear_sighand(void)
* Check that CLONE_CLEAR_SIGHAND and CLONE_SIGHAND are mutually
* exclusive.
*/
- args.flags |= CLONE_CLEAR_SIGHAND | CLONE_SIGHAND;
+ args.flags |= CLONE_VM | CLONE_CLEAR_SIGHAND | CLONE_SIGHAND;
args.exit_signal = SIGCHLD;
pid = sys_clone3(&args, sizeof(args));
- if (pid > 0)
+ if (pid != -1 || errno != EINVAL)
ksft_exit_fail_msg(
- "clone3(CLONE_CLEAR_SIGHAND | CLONE_SIGHAND) succeeded\n");
+ "clone3(CLONE_CLEAR_SIGHAND | CLONE_SIGHAND) did not fail with EINVAL\n");
act.sa_handler = nop_handler;
ret = sigemptyset(&act.sa_mask);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0219/1756] wifi: mac80211: fix unauthorised port check for encap offload
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (217 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0218/1756] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0220/1756] wifi: mac80211: fix key selection for encap offload frames Greg Kroah-Hartman
` (779 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit d59b9bf7df49367e01b06e82dd0f6e7ad3be493c ]
The check in ieee80211_tx_dequeue() reads frame_control, addr1 and
addr2 out of the skb, but for encapsulation offload that's just a
random part of the ethernet addresses, so dropping depends on bits
in the destination address. This is obviously wrong.
Refactor the check and short-circuit for ethernet format frames,
it only needs the port-control flag check since those are locally
generated and not forwarded frames.
Fixes: 50ff477a8639 ("mac80211: add 802.11 encapsulation offloading support")
Link: https://patch.msgid.link/20260802105818.dd5da579813d.I51ed0121154bb652bebc97bb0597b1fae9ac978f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 48 +++++++++++++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index fff9ea0dba079..bacc732df0c6d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3864,6 +3864,38 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
return true;
}
+static bool ieee80211_drop_unauth_port(struct ieee80211_tx_data *tx)
+{
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
+ struct ieee80211_hdr *hdr;
+
+ if (likely(test_sta_flag(tx->sta, WLAN_STA_AUTHORIZED)))
+ return false;
+
+ if (info->flags & IEEE80211_TX_CTL_INJECTED)
+ return false;
+
+ if (ieee80211_vif_is_mesh(&tx->sdata->vif) ||
+ tx->sdata->vif.type == NL80211_IFTYPE_OCB)
+ return false;
+
+ /* no need to check forwarding here */
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
+ return !(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO);
+
+ hdr = (struct ieee80211_hdr *)tx->skb->data;
+
+ if (!ieee80211_is_data_present(hdr->frame_control) ||
+ is_multicast_ether_addr(hdr->addr1))
+ return false;
+
+ if ((info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO) &&
+ ieee80211_is_our_addr(tx->sdata, hdr->addr2, NULL))
+ return false;
+
+ return true;
+}
+
struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
struct ieee80211_txq *txq)
{
@@ -3930,20 +3962,8 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
if (txq->sta) {
tx.sta = container_of(txq->sta, struct sta_info, sta);
- /*
- * Drop unicast frames to unauthorised stations unless they are
- * injected frames or EAPOL frames from the local station.
- */
- if (unlikely(!(info->flags & IEEE80211_TX_CTL_INJECTED) &&
- ieee80211_is_data_present(hdr->frame_control) &&
- !ieee80211_vif_is_mesh(&tx.sdata->vif) &&
- tx.sdata->vif.type != NL80211_IFTYPE_OCB &&
- !is_multicast_ether_addr(hdr->addr1) &&
- !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) &&
- (!(info->control.flags &
- IEEE80211_TX_CTRL_PORT_CTRL_PROTO) ||
- !ieee80211_is_our_addr(tx.sdata, hdr->addr2,
- NULL)))) {
+
+ if (unlikely(ieee80211_drop_unauth_port(&tx))) {
I802_DEBUG_INC(local->tx_handlers_drop_unauth_port);
ieee80211_free_txskb(&local->hw, skb);
goto begin;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0220/1756] wifi: mac80211: fix key selection for encap offload frames
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (218 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0219/1756] wifi: mac80211: fix unauthorised port check for encap offload Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0221/1756] wifi: mac80211: dont send encap offload frames unencrypted Greg Kroah-Hartman
` (778 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 0e80db08668b560b3522849cb705623148bcd4b5 ]
ieee80211_tx_h_select_key() assumes the frame is in 802.11 format
for picking the key, at least when there's no pairwise TK for the
STA to transmit with.
For unicast this is likely not relevant because if there's no
pairwise TK for the STA there's probably not going to be any other
key either. But multicast encapsulation offload frames have no
STA, so it looks at the ethernet header as if it was 802.11. This
may not matter very much since multicast encapsulation offload is
likely to ignore the key selection, but it's still wrong.
Create a separate selection function that doesn't (need to) look
at the frame header - it's data anyway, so either unicast to a
station (with sta pointer) or multicast. For MLO, the driver has
to duplicate the frame and select the key anyway, so just skip
it in that case entirely.
Fixes: 50ff477a8639 ("mac80211: add 802.11 encapsulation offloading support")
Link: https://patch.msgid.link/20260802105818.0feb7ad61047.Ia506ca211176a3c466bc60e4cc3e506df34a4a67@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 37 +++++++++++++++++++++++++++++++------
1 file changed, 31 insertions(+), 6 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index bacc732df0c6d..2336786680e87 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -581,6 +581,34 @@ ieee80211_select_link_key(struct ieee80211_tx_data *tx)
return NULL;
}
+/*
+ * An 802.3 frame is always a data frame, so there are no 802.11 addresses to
+ * look at: with a station the pairwise key is all that can apply, without one
+ * the frame is group addressed. On an MLD the driver has to pick the group key
+ * itself, as the same frame goes out on several links that each have their own.
+ */
+static ieee80211_tx_result
+ieee80211_select_key_8023(struct ieee80211_tx_data *tx)
+{
+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
+
+ if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT))
+ return TX_CONTINUE;
+
+ if (tx->sta) {
+ tx->key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]);
+ if (!tx->key)
+ tx->key = rcu_dereference(tx->sdata->default_unicast_key);
+ } else if (!ieee80211_vif_is_mld(&tx->sdata->vif)) {
+ tx->key = rcu_dereference(tx->sdata->deflink.default_multicast_key);
+ }
+
+ if (tx->key && tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
+ info->control.hw_key = &tx->key->conf;
+
+ return TX_CONTINUE;
+}
+
static ieee80211_tx_result debug_noinline
ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
{
@@ -588,6 +616,9 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
+ if (info->control.flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
+ return ieee80211_select_key_8023(tx);
+
if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) {
tx->key = NULL;
return TX_CONTINUE;
@@ -604,12 +635,6 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
else
tx->key = NULL;
- if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
- if (tx->key && tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
- info->control.hw_key = &tx->key->conf;
- return TX_CONTINUE;
- }
-
if (tx->key) {
bool skip_hw = false;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0221/1756] wifi: mac80211: dont send encap offload frames unencrypted
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (219 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0220/1756] wifi: mac80211: fix key selection for encap offload frames Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0222/1756] wifi: mac80211: drop encap offload frames with a tainted key Greg Kroah-Hartman
` (777 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit a48daf145fed445d41ef422573411500785415c8 ]
For 802.11 frames, ieee80211_tx_h_select_key() drops a data frame
that ended up without a key if the station requires encryption, so
that traffic can never leak out unprotected. Encapsulation offload
erroneously didn't get this code path. Fix that.
Fixes: 50ff477a8639 ("mac80211: add 802.11 encapsulation offloading support")
Link: https://patch.msgid.link/20260802085818.1336616-7-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2336786680e87..bcc3b16bc183e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -599,6 +599,9 @@ ieee80211_select_key_8023(struct ieee80211_tx_data *tx)
tx->key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]);
if (!tx->key)
tx->key = rcu_dereference(tx->sdata->default_unicast_key);
+
+ if (!tx->key && test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION))
+ return TX_DROP;
} else if (!ieee80211_vif_is_mld(&tx->sdata->vif)) {
tx->key = rcu_dereference(tx->sdata->deflink.default_multicast_key);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0222/1756] wifi: mac80211: drop encap offload frames with a tainted key
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (220 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0221/1756] wifi: mac80211: dont send encap offload frames unencrypted Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0223/1756] wifi: free SKBTX_WIFI_STATUS skb tx_flags flag Greg Kroah-Hartman
` (776 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit c8ddbe1e8c43f6d008591c50f8be8de39cdce267 ]
When a key is tainted, which happens in some WoWLAN and extended
key ID scenarios, frames that would use it should be dropped.
Fix that for encapsulation offload frames.
Fixes: 50ff477a8639 ("mac80211: add 802.11 encapsulation offloading support")
Link: https://patch.msgid.link/20260802105818.870b6ef31374.Ib87175b55b9fd94c16ba6d9cd816b7a09248df87@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index bcc3b16bc183e..b4ee237378612 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -606,7 +606,13 @@ ieee80211_select_key_8023(struct ieee80211_tx_data *tx)
tx->key = rcu_dereference(tx->sdata->deflink.default_multicast_key);
}
- if (tx->key && tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
+ if (!tx->key)
+ return TX_CONTINUE;
+
+ if (unlikely(tx->key->flags & KEY_FLAG_TAINTED))
+ return TX_DROP;
+
+ if (tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
info->control.hw_key = &tx->key->conf;
return TX_CONTINUE;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0223/1756] wifi: free SKBTX_WIFI_STATUS skb tx_flags flag
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (221 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0222/1756] wifi: mac80211: drop encap offload frames with a tainted key Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0224/1756] wifi: check if socket flags are valid Greg Kroah-Hartman
` (775 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jason Xing, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 76a853f86c97b348dc96e75a6e6f94d8750715ee ]
Jason mentioned at netdevconf that we've run out of tx_flags in
the skb_shinfo(). Gain one bit back by removing the wifi bit.
We can do that because the only userspace application for it
(hostapd) doesn't change the setting on the socket, it just
uses different sockets, and normally doesn't even use this any
more, sending the frames over nl80211 instead.
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20250313134942.52ff54a140ec.If390bbdc46904cf451256ba989d7a056c457af6e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Stable-dep-of: e035900ffe9e ("wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/wil6210/txrx.h | 3 ++-
drivers/net/wireless/marvell/mwifiex/main.c | 3 ++-
include/linux/skbuff.h | 3 ---
include/net/sock.h | 2 --
net/mac80211/mesh.c | 3 ++-
net/mac80211/tx.c | 9 ++++-----
6 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
index 689f68d89a440..33ccd0b248d4e 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.h
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -7,6 +7,7 @@
#ifndef WIL6210_TXRX_H
#define WIL6210_TXRX_H
+#include <net/sock.h>
#include "wil6210.h"
#include "txrx_edma.h"
@@ -617,7 +618,7 @@ static inline bool wil_need_txstat(struct sk_buff *skb)
const u8 *da = wil_skb_get_da(skb);
return is_unicast_ether_addr(da) && skb->sk &&
- (skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS);
+ sock_flag(skb->sk, SOCK_WIFI_STATUS);
}
static inline void wil_consume_skb(struct sk_buff *skb, bool acked)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 2a9eae68d9ba1..c2b553194b780 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -6,6 +6,7 @@
*/
#include <linux/suspend.h>
+#include <net/sock.h>
#include "main.h"
#include "wmm.h"
@@ -943,7 +944,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
multicast = is_multicast_ether_addr(skb->data);
if (unlikely(!multicast && skb->sk &&
- skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS &&
+ sock_flag(skb->sk, SOCK_WIFI_STATUS) &&
priv->adapter->fw_api_ver == MWIFIEX_FW_V15))
skb = mwifiex_clone_skb_for_tx_status(priv,
skb,
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index df548a3d60657..41c78025d8aa5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -480,9 +480,6 @@ enum {
/* generate hardware time stamp based on cycles if supported */
SKBTX_HW_TSTAMP_USE_CYCLES = 1 << 3,
- /* generate wifi status information (where possible) */
- SKBTX_WIFI_STATUS = 1 << 4,
-
/* determine hardware time stamp based on time or cycles */
SKBTX_HW_TSTAMP_NETDEV = 1 << 5,
diff --git a/include/net/sock.h b/include/net/sock.h
index efa549885b7f8..a39b2349bf9b6 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2760,8 +2760,6 @@ static inline void _sock_tx_timestamp(struct sock *sk, __u16 tsflags,
tsflags & SOF_TIMESTAMPING_TX_RECORD_MASK)
*tskey = atomic_inc_return(&sk->sk_tskey) - 1;
}
- if (unlikely(sock_flag(sk, SOCK_WIFI_STATUS)))
- *tx_flags |= SKBTX_WIFI_STATUS;
}
static inline void sock_tx_timestamp(struct sock *sk, __u16 tsflags,
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 258c865921784..23467fec56e5c 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -8,6 +8,7 @@
#include <linux/slab.h>
#include <linux/unaligned.h>
+#include <net/sock.h>
#include "ieee80211_i.h"
#include "mesh.h"
#include "wme.h"
@@ -782,7 +783,7 @@ bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
if (ethertype < ETH_P_802_3_MIN)
return false;
- if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
+ if (skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS))
return false;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b4ee237378612..260fced04ecc4 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -26,6 +26,7 @@
#include <net/codel_impl.h>
#include <linux/unaligned.h>
#include <net/fq_impl.h>
+#include <net/sock.h>
#include <net/gso.h>
#include "ieee80211_i.h"
@@ -2965,8 +2966,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
}
if (unlikely(!multicast &&
- ((skb->sk &&
- skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS) ||
+ ((skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS)) ||
ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS)))
info_id = ieee80211_store_ack_skb(local, skb, &info_flags,
cookie);
@@ -3868,7 +3868,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
return false;
/* don't handle TX status request here either */
- if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
+ if (skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS))
return false;
if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
@@ -4792,8 +4792,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
memcpy(IEEE80211_SKB_CB(seg), info, sizeof(*info));
}
- if (unlikely(skb->sk &&
- skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) {
+ if (unlikely(skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS))) {
info->status_data = ieee80211_store_ack_skb(local, skb,
&info->flags, NULL);
if (info->status_data)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0224/1756] wifi: check if socket flags are valid
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (222 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0223/1756] wifi: free SKBTX_WIFI_STATUS skb tx_flags flag Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0225/1756] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup Greg Kroah-Hartman
` (774 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Johannes Berg, Bert Karwatzki,
Jason Xing, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bert Karwatzki <spasswolf@web.de>
[ Upstream commit d7500fbfb12067ee7313f13f4c58f771be3018ab ]
Checking the SOCK_WIFI_STATUS flag bit in sk_flags may give wrong results
since sk_flags are part of a union and the union is used otherwise. Add
sk_requests_wifi_status() which checks if sk is non-NULL, sk is a full
socket (so flags are valid) and checks the flag bit.
Fixes: 76a853f86c97 ("wifi: free SKBTX_WIFI_STATUS skb tx_flags flag")
Suggested-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Bert Karwatzki <spasswolf@web.de>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20250520223430.6875-1-spasswolf@web.de
[edit commit message, fix indentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Stable-dep-of: e035900ffe9e ("wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/wil6210/txrx.h | 3 +--
drivers/net/wireless/marvell/mwifiex/main.c | 3 +--
include/net/sock.h | 6 ++++++
net/mac80211/mesh.c | 2 +-
net/mac80211/tx.c | 6 +++---
5 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
index 33ccd0b248d4e..fff8b7f8abc5d 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.h
+++ b/drivers/net/wireless/ath/wil6210/txrx.h
@@ -617,8 +617,7 @@ static inline bool wil_need_txstat(struct sk_buff *skb)
{
const u8 *da = wil_skb_get_da(skb);
- return is_unicast_ether_addr(da) && skb->sk &&
- sock_flag(skb->sk, SOCK_WIFI_STATUS);
+ return is_unicast_ether_addr(da) && sk_requests_wifi_status(skb->sk);
}
static inline void wil_consume_skb(struct sk_buff *skb, bool acked)
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index c2b553194b780..20d1e6cd83c95 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -943,8 +943,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
multicast = is_multicast_ether_addr(skb->data);
- if (unlikely(!multicast && skb->sk &&
- sock_flag(skb->sk, SOCK_WIFI_STATUS) &&
+ if (unlikely(!multicast && sk_requests_wifi_status(skb->sk) &&
priv->adapter->fw_api_ver == MWIFIEX_FW_V15))
skb = mwifiex_clone_skb_for_tx_status(priv,
skb,
diff --git a/include/net/sock.h b/include/net/sock.h
index a39b2349bf9b6..79e409bf3d13a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2844,6 +2844,12 @@ sk_is_refcounted(struct sock *sk)
return !sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE);
}
+static inline bool
+sk_requests_wifi_status(struct sock *sk)
+{
+ return sk && sk_fullsock(sk) && sock_flag(sk, SOCK_WIFI_STATUS);
+}
+
/* Checks if this SKB belongs to an HW offloaded socket
* and whether any SW fallbacks are required based on dev.
* Check decrypted mark in case skb_orphan() cleared socket.
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 23467fec56e5c..d32affec4e65d 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -783,7 +783,7 @@ bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
if (ethertype < ETH_P_802_3_MIN)
return false;
- if (skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS))
+ if (sk_requests_wifi_status(skb->sk))
return false;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 260fced04ecc4..3b72b38d9e278 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2966,7 +2966,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
}
if (unlikely(!multicast &&
- ((skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS)) ||
+ (sk_requests_wifi_status(skb->sk) ||
ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS)))
info_id = ieee80211_store_ack_skb(local, skb, &info_flags,
cookie);
@@ -3868,7 +3868,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
return false;
/* don't handle TX status request here either */
- if (skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS))
+ if (sk_requests_wifi_status(skb->sk))
return false;
if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
@@ -4792,7 +4792,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
memcpy(IEEE80211_SKB_CB(seg), info, sizeof(*info));
}
- if (unlikely(skb->sk && sock_flag(skb->sk, SOCK_WIFI_STATUS))) {
+ if (unlikely(sk_requests_wifi_status(skb->sk))) {
info->status_data = ieee80211_store_ack_skb(local, skb,
&info->flags, NULL);
if (info->status_data)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0225/1756] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (223 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0224/1756] wifi: check if socket flags are valid Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0226/1756] wifi: wfx: fix possible device hang during init Greg Kroah-Hartman
` (773 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit e035900ffe9e8978f7c0d7b61811b6b578751697 ]
In ieee80211_build_hdr(), IEEE80211_TX_CTL_REQ_TX_STATUS is checked
in ctrl_flags, which is wrong - IEEE80211_TX_CTL_REQ_TX_STATUS is in
info->flags, so the check is for IEEE80211_TX_CTRL_PORT_CTRL_PROTO
instead. This works out OK because the only place setting _that_ at
a point before this gets called is in fact ieee80211_tx_control_port()
which was intended here. This is actually needed for correctness, if
jt were checking info->flags instead, TDLS would fill/leak the status
frames created here.
However, we can just fix it by using the cookie instead, that'll be
set for PREAUTH frames via ieee80211_tx_control_port() as well, and
no other frames.
Additionally, the code also erroneously set it, but that just caused
preauth frames to get it set, since storing the ACK SKB will also set
the correct flag. Drop this assignment entirely.
Fixes: a7528198add8 ("mac80211: support control port TX status reporting")
Link: https://patch.msgid.link/20260803141309.292711-10-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 3b72b38d9e278..b8b8a2622cbfe 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2966,8 +2966,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
}
if (unlikely(!multicast &&
- (sk_requests_wifi_status(skb->sk) ||
- ctrl_flags & IEEE80211_TX_CTL_REQ_TX_STATUS)))
+ (sk_requests_wifi_status(skb->sk) || cookie)))
info_id = ieee80211_store_ack_skb(local, skb, &info_flags,
cookie);
@@ -6351,9 +6350,6 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
if (unencrypted)
flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
- if (cookie)
- ctrl_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
-
flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX;
skb = dev_alloc_skb(local->hw.extra_tx_headroom +
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0226/1756] wifi: wfx: fix possible device hang during init
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (224 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0225/1756] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0227/1756] hwrng: cctrng - Fix runtime PM usage counter leak Greg Kroah-Hartman
` (772 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gerard Salvatella, Lukas Stockmann,
Jérôme Pouiller, Alexander Sverdlin, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérôme Pouiller <jerome.pouiller@silabs.com>
[ Upstream commit 102f54dc47be198e9310b18d41305a78d70a0796 ]
The WFxxx device provides an SDIO interface. In addition to the usual
in-band SDIO IRQ, the device also supports out-of-band IRQ line. OOB IRQ
requires a specific initialization described in commit f00dc1d789e1c
("staging: wfx: poll IRQ during init"):
When the chip starts in SDIO mode, the external IRQ (aka Out-Of-Band
IRQ) cannot be used before to configure it. Therefore, the first
exchanges with the chip have to be done without the OOB IRQ.
This patch allow to poll the data until the OOB IRQ is correctly
setup. In order to keep the code simpler, this patch also poll data
even if OOB IRQ is not used.
Commit 57aa557f110d9 ("staging: wfx: introduce a way to poll IRQ")
announce some limitation about the data polling mechanism:
This function [wfx_bh_poll_irq()] must used with care: if an IRQ
fires while the host reads control register, the IRQ can be lost.
However, with last analysis, it seems it does not only impact the IRQ.
When this condition happen the hardware is lost and won't reply the next
commands. The only way to recover the error is to pull the reset pin and
bind the device again.
Currently wfx_bh_poll_irq() is only used during the two first exchanges
with the hardware. Therefore, it has been reported to only happen after
a few hours of bind/rebind in a loop. This explain why it has not been
reported before.
Fortunately, wfx_bh_poll_irq() is only required for OOB IRQ, which is
probably very marginal. The In-Band IRQ case also uses this function,
but only to simplify the code.
This patch limits the use of wfx_bh_poll_irq() to the OOB IRQ. The bus
driver now tells wfx_probe() whether polling is necessary. When it is
not (in-band SDIO IRQ and SPI), the IRQ is subscribed before the first
exchange with the device and wfx_bh_poll_irq() is never called. When it
is (SDIO with OOB IRQ), the behavior is unchanged: the control register
is polled until the PDS file has configured the IRQ line.
To conclude, In-Band users are now safe. Users of OOB IRQ will be still
impacted by the bug, but there is nothing we can do (and nobody
complained during the last 6 years).
Fixes: f00dc1d789e1c ("staging: wfx: poll IRQ during init")
Reported-by: Gerard Salvatella <gerard.salvatella@siemens.com>
Reported-by: Lukas Stockmann <lukas.stockmann@siemens.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://patch.msgid.link/20260901083548.113131-2-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/silabs/wfx/bh.c | 6 ++--
drivers/net/wireless/silabs/wfx/bus_sdio.c | 1 +
drivers/net/wireless/silabs/wfx/main.c | 34 ++++++++++++++--------
3 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/silabs/wfx/bh.c b/drivers/net/wireless/silabs/wfx/bh.c
index 21dfdcf9cc273..0071659bc9c98 100644
--- a/drivers/net/wireless/silabs/wfx/bh.c
+++ b/drivers/net/wireless/silabs/wfx/bh.c
@@ -284,10 +284,10 @@ void wfx_bh_request_tx(struct wfx_dev *wdev)
}
/* If IRQ is not available, this function allow to manually poll the control register and simulate
- * an IRQ ahen an event happened.
+ * an IRQ when an event happened.
*
- * Note that the device has a bug: If an IRQ raise while host read control register, the IRQ is
- * lost. So, use this function carefully (only duing device initialisation).
+ * Note that the device has a bug: If an IRQ raise while host read control register, the device is
+ * lost. Unfortunately, this is the only way to initialize the SDIO with out-of-band IRQ.
*/
void wfx_bh_poll_irq(struct wfx_dev *wdev)
{
diff --git a/drivers/net/wireless/silabs/wfx/bus_sdio.c b/drivers/net/wireless/silabs/wfx/bus_sdio.c
index f290eecde773f..fdd089d8bf722 100644
--- a/drivers/net/wireless/silabs/wfx/bus_sdio.c
+++ b/drivers/net/wireless/silabs/wfx/bus_sdio.c
@@ -231,6 +231,7 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i
goto sdio_release;
}
+ bus->core->poll_irq = !!bus->of_irq;
ret = wfx_probe(bus->core);
if (ret)
goto sdio_release;
diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c
index 64441c8bc4606..fced10c057043 100644
--- a/drivers/net/wireless/silabs/wfx/main.c
+++ b/drivers/net/wireless/silabs/wfx/main.c
@@ -348,7 +348,6 @@ int wfx_probe(struct wfx_dev *wdev)
*/
gpio_saved = wdev->pdata.gpio_wakeup;
wdev->pdata.gpio_wakeup = NULL;
- wdev->poll_irq = true;
wdev->bh_wq = alloc_workqueue("wfx_bh_wq", WQ_HIGHPRI, 0);
if (!wdev->bh_wq)
@@ -356,16 +355,24 @@ int wfx_probe(struct wfx_dev *wdev)
wfx_bh_register(wdev);
+ if (!wdev->poll_irq) {
+ err = wdev->hwbus_ops->irq_subscribe(wdev->hwbus_priv);
+ if (err)
+ goto bh_unregister;
+ }
+
err = wfx_init_device(wdev);
if (err)
- goto bh_unregister;
+ goto irq_unsubscribe;
+
+ if (wdev->poll_irq)
+ wfx_bh_poll_irq(wdev);
- wfx_bh_poll_irq(wdev);
err = wait_for_completion_timeout(&wdev->firmware_ready, 1 * HZ);
if (err == 0) {
dev_err(wdev->dev, "timeout while waiting for startup indication\n");
err = -ETIMEDOUT;
- goto bh_unregister;
+ goto irq_unsubscribe;
}
/* FIXME: fill wiphy::hw_version */
@@ -385,12 +392,12 @@ int wfx_probe(struct wfx_dev *wdev)
dev_err(wdev->dev, "unsupported firmware API version (expect 1 while firmware returns %d)\n",
wdev->hw_caps.api_version_major);
err = -EOPNOTSUPP;
- goto bh_unregister;
+ goto irq_unsubscribe;
}
if (wdev->hw_caps.link_mode == SEC_LINK_ENFORCED) {
dev_err(wdev->dev, "chip require secure_link, but can't negotiate it\n");
- goto bh_unregister;
+ goto irq_unsubscribe;
}
if (wdev->hw_caps.region_sel_mode) {
@@ -406,12 +413,14 @@ int wfx_probe(struct wfx_dev *wdev)
dev_dbg(wdev->dev, "sending configuration file %s\n", wdev->pdata.file_pds);
err = wfx_send_pdata_pds(wdev);
if (err < 0 && err != -ENOENT)
- goto bh_unregister;
+ goto irq_unsubscribe;
- wdev->poll_irq = false;
- err = wdev->hwbus_ops->irq_subscribe(wdev->hwbus_priv);
- if (err)
- goto bh_unregister;
+ if (wdev->poll_irq) {
+ err = wdev->hwbus_ops->irq_subscribe(wdev->hwbus_priv);
+ if (err)
+ goto bh_unregister;
+ wdev->poll_irq = false;
+ }
err = wfx_hif_use_multi_tx_conf(wdev, true);
if (err)
@@ -460,7 +469,8 @@ int wfx_probe(struct wfx_dev *wdev)
ieee80211_unregister:
ieee80211_unregister_hw(wdev->hw);
irq_unsubscribe:
- wdev->hwbus_ops->irq_unsubscribe(wdev->hwbus_priv);
+ if (!wdev->poll_irq)
+ wdev->hwbus_ops->irq_unsubscribe(wdev->hwbus_priv);
bh_unregister:
wfx_bh_unregister(wdev);
destroy_workqueue(wdev->bh_wq);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0227/1756] hwrng: cctrng - Fix runtime PM usage counter leak
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (225 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0226/1756] wifi: wfx: fix possible device hang during init Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0228/1756] crypto: asymmetric_keys - fix OOB read in pefile_parse_binary Greg Kroah-Hartman
` (771 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ruoyu Wang, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <ruoyuw560@gmail.com>
[ Upstream commit 58d27c41542be6c40edac4f91f35a1dd8bf0d2c2 ]
pm_runtime_get_sync() increments the device usage counter even when
runtime resume fails. cctrng_read() propagates errors from
cc_trng_pm_get() without scheduling the work that later drops the
counter, so a clock or reset-completion failure in cctrng_resume()
leaves the counter elevated.
Use pm_runtime_resume_and_get(), which drops the usage counter when
resume fails and returns zero on success. This preserves the existing
success path while balancing the error path.
This issue was found by a static analysis checker and confirmed by
manual source review.
Fixes: a583ed310bb6 ("hwrng: cctrng - introduce Arm CryptoCell driver")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/char/hw_random/cctrng.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c
index 4db198849695d..893f7d3a3d0ab 100644
--- a/drivers/char/hw_random/cctrng.c
+++ b/drivers/char/hw_random/cctrng.c
@@ -86,12 +86,7 @@ static inline u32 cc_ioread(struct cctrng_drvdata *drvdata, u32 reg)
static int cc_trng_pm_get(struct device *dev)
{
- int rc = 0;
-
- rc = pm_runtime_get_sync(dev);
-
- /* pm_runtime_get_sync() can return 1 as a valid return code */
- return (rc == 1 ? 0 : rc);
+ return pm_runtime_resume_and_get(dev);
}
static void cc_trng_pm_put_suspend(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0228/1756] crypto: asymmetric_keys - fix OOB read in pefile_parse_binary
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (226 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0227/1756] hwrng: cctrng - Fix runtime PM usage counter leak Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0229/1756] wifi: mac80211: fix swapped fq_overlimit/fq_overmemory in aqm debugfs Greg Kroah-Hartman
` (770 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fabrice Derepas, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabrice Derepas <fabrice.derepas@canonical.com>
[ Upstream commit 37d550172c2d3cdb3a5ace3e6cb0625967d86349 ]
pefile_parse_binary() reads the size field of the certificate table's
data-directory entry, which sits at fixed index 4 of the PE optional
header's data directory:
ctx->certs_size = ddir->certs.size;
but nothing ensures index 4 is present. n_data_dirents (the untrusted
NumberOfRvaAndSizes) is only upper-bounded against header_size and may be
0, and header_size need only satisfy cursor < header_size < datalen. A
crafted PE with n_data_dirents = 0 and a tiny header_size therefore causes
the ddir->certs.size read to land past the end of the image (CWE-125). The
chkaddr() that bounds the certificate blob runs only after this read.
verify_pefile_signature() is reached from kexec_file_load() (the
lockdown/secure-boot enforced PE-image signature path), and the image is
parsed before its signature is checked. The trigger needs CAP_SYS_BOOT and
the access is out-of-bounds read only (no write).
Require the certificate table's data-directory entry (index 4) to be
present; the existing upper-bound check then keeps ddir->certs within
[cursor, header_size).
Fixes: 26d1164be37f ("pefile: Parse a PE binary to find a key and a signature contained therein")
Assisted-by: copilot-cli:claude-opus-4-6 frama-c
Signed-off-by: Fabrice Derepas <fabrice.derepas@canonical.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
crypto/asymmetric_keys/verify_pefile.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/crypto/asymmetric_keys/verify_pefile.c b/crypto/asymmetric_keys/verify_pefile.c
index 95ba0a91dbbdd..2bc32d1ae99f2 100644
--- a/crypto/asymmetric_keys/verify_pefile.c
+++ b/crypto/asymmetric_keys/verify_pefile.c
@@ -87,6 +87,11 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
if (ctx->n_data_dirents > (ctx->header_size - cursor) / sizeof(*dde))
return -ELIBBAD;
+ /* the certificate table entry must be present in the data directory */
+ if (ctx->n_data_dirents <=
+ offsetof(struct data_directory, certs) / sizeof(*dde))
+ return -ELIBBAD;
+
ddir = pebuf + cursor;
cursor += sizeof(*dde) * ctx->n_data_dirents;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0229/1756] wifi: mac80211: fix swapped fq_overlimit/fq_overmemory in aqm debugfs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (227 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0228/1756] crypto: asymmetric_keys - fix OOB read in pefile_parse_binary Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0230/1756] irqchip/riscv-imsic: Use GENMASK for base address masks Greg Kroah-Hartman
` (769 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Toke Høiland-Jørgensen,
Julius Bairaktaris, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julius Bairaktaris <julius@bairaktaris.de>
[ Upstream commit 25f3f2ff88ae604a3b473b501fc55d58fcb0f5eb ]
The two scnprintf arguments for fq_overlimit and fq_overmemory are in the
wrong order, which results in the aqm debugfs file showing the overmemory
count under the fq_overlimit label and vice versa.
Fixes: 2a4e675d887b ("mac80211: Export fq memory limit information in debugfs")
Reviewed-by: Toke Høiland-Jørgensen <toke@toke.dk>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://patch.msgid.link/20260904090626.92727-1-julius@bairaktaris.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 28b1355cc062f..610acecd45f8b 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -98,8 +98,8 @@ static ssize_t aqm_read(struct file *file,
"RW fq_quantum %u\n",
fq->flows_cnt,
fq->backlog,
- fq->overmemory,
fq->overlimit,
+ fq->overmemory,
fq->collisions,
fq->memory_usage,
fq->memory_limit,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0230/1756] irqchip/riscv-imsic: Use GENMASK for base address masks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (228 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0229/1756] wifi: mac80211: fix swapped fq_overlimit/fq_overmemory in aqm debugfs Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0231/1756] memory: brcmstb_dpfe: validate firmware section sizes Greg Kroah-Hartman
` (768 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Thomas Gleixner,
Anup Patel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit bd7d57a03c4b0fa3b0291ec64d688ebfed5edffc ]
The IMSIC DT binding allows riscv,guest-index-bits up to 7 and
riscv,hart-index-bits up to 15. On RV32, guest-index-bits=7 and
hart-index-bits=13, together with the 12-bit IMSIC page offset, is a
binding-valid layout that consumes a 32-bit low-address mask.
The parser accepts this equality case because it rejects only values
larger than the remaining bit budget. The base address canonicalization
then builds the low-address mask with BIT(sum) - 1. When sum is 32 on
RV32, that expression shifts an unsigned long by its full width.
Keep the legal equality layout and express the mask with GENMASK(sum - 1,
0) instead. The existing parser bounds guarantee that sum - 1 is below
BITS_PER_LONG at both mask sites.
Fixes: 21a8f8a0eb35 ("irqchip: Add RISC-V incoming MSI controller early driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://patch.msgid.link/20260718040000.004.929c1ef2-caplitmus-rv@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-riscv-imsic-state.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/irqchip/irq-riscv-imsic-state.c b/drivers/irqchip/irq-riscv-imsic-state.c
index 06ff0e17c0c33..61e30372a67df 100644
--- a/drivers/irqchip/irq-riscv-imsic-state.c
+++ b/drivers/irqchip/irq-riscv-imsic-state.c
@@ -7,6 +7,7 @@
#define pr_fmt(fmt) "riscv-imsic: " fmt
#include <linux/acpi.h>
#include <linux/cpu.h>
+#include <linux/bits.h>
#include <linux/bitmap.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -739,9 +740,9 @@ static int __init imsic_parse_fwnode(struct fwnode_handle *fwnode,
return -EINVAL;
}
global->base_addr = res.start;
- global->base_addr &= ~(BIT(global->guest_index_bits +
- global->hart_index_bits +
- IMSIC_MMIO_PAGE_SHIFT) - 1);
+ global->base_addr &= ~GENMASK(global->guest_index_bits +
+ global->hart_index_bits +
+ IMSIC_MMIO_PAGE_SHIFT - 1, 0);
global->base_addr &= ~((BIT(global->group_index_bits) - 1) <<
global->group_index_shift);
@@ -820,9 +821,9 @@ int __init imsic_setup_state(struct fwnode_handle *fwnode, void *opaque)
}
base_addr = mmios[i].start;
- base_addr &= ~(BIT(global->guest_index_bits +
- global->hart_index_bits +
- IMSIC_MMIO_PAGE_SHIFT) - 1);
+ base_addr &= ~GENMASK(global->guest_index_bits +
+ global->hart_index_bits +
+ IMSIC_MMIO_PAGE_SHIFT - 1, 0);
base_addr &= ~((BIT(global->group_index_bits) - 1) <<
global->group_index_shift);
if (base_addr != global->base_addr) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0231/1756] memory: brcmstb_dpfe: validate firmware section sizes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (229 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0230/1756] irqchip/riscv-imsic: Use GENMASK for base address masks Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0232/1756] arm64: dts: ti: k3-j722s-evm: Enable PMIC Greg Kroah-Hartman
` (767 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Krzysztof Kozlowski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit e61c1a1103e2617e8f86288368911a8591e35c1e ]
The firmware header is read before the image has been shown to contain a
complete header. In addition, the final size check adds two
firmware-provided u32 section lengths before comparing the result with
fw->size, so the addition can wrap.
Reject images shorter than the fixed header and checksum before reading
the header. Then derive the available payload length with subtraction and
require the two declared sections to fill it exactly.
Fixes: 2f330caff577 ("memory: brcmstb: Add driver for DPFE")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260815134559.47888-1-pengpeng@iscas.ac.cn
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/memory/brcmstb_dpfe.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c
index 0f8dac23ba288..c76d3281d644f 100644
--- a/drivers/memory/brcmstb_dpfe.c
+++ b/drivers/memory/brcmstb_dpfe.c
@@ -533,9 +533,15 @@ static int __verify_firmware(struct init_data *init,
const struct firmware *fw)
{
const struct dpfe_firmware_header *header = (void *)fw->data;
- unsigned int dmem_size, imem_size, total_size;
+ unsigned int dmem_size, imem_size;
bool is_big_endian = false;
const u32 *chksum_ptr;
+ size_t payload_size;
+
+ if (fw->size < sizeof(*header) + sizeof(*chksum_ptr))
+ return ERR_INVALID_SIZE;
+
+ payload_size = fw->size - sizeof(*header) - sizeof(*chksum_ptr);
if (header->magic == DPFE_BE_MAGIC)
is_big_endian = true;
@@ -554,13 +560,8 @@ static int __verify_firmware(struct init_data *init,
if ((dmem_size % sizeof(u32)) != 0 || (imem_size % sizeof(u32)) != 0)
return ERR_INVALID_SIZE;
- /*
- * The header + the data section + the instruction section + the
- * checksum must be equal to the total firmware size.
- */
- total_size = dmem_size + imem_size + sizeof(*header) +
- sizeof(*chksum_ptr);
- if (total_size != fw->size)
+ /* The data and instruction sections must fill the payload exactly. */
+ if (dmem_size > payload_size || imem_size != payload_size - dmem_size)
return ERR_INVALID_SIZE;
/* The checksum comes at the very end. */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0232/1756] arm64: dts: ti: k3-j722s-evm: Enable PMIC
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (230 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0231/1756] memory: brcmstb_dpfe: validate firmware section sizes Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0233/1756] arm64: dts: ti: j722s-evm: Add MUX to control CSI2RX Greg Kroah-Hartman
` (766 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Udit Kumar, Nishanth Menon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Udit Kumar <u-kumar1@ti.com>
[ Upstream commit 998ad09ad3b0ef1776fcb988af4916a062b92cc1 ]
Add support for TPS6522x PMIC family on wakeup I2C0 bus.
This device provides regulators (bucks and LDOs), along with
GPIOs, and monitors SOC's MCU error signal.
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Link: https://lore.kernel.org/r/20250102103814.102499-1-u-kumar1@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Stable-dep-of: 432bfc86fe62 ("arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/ti/k3-j722s-evm.dts | 88 +++++++++++++++++++++++++
1 file changed, 88 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
index 98fc1c0f86a42..4504912512b41 100644
--- a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
+++ b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
@@ -359,6 +359,13 @@ audio_ext_refclk1_pins_default: audio-ext-refclk1-default-pins {
J722S_IOPAD(0x00a0, PIN_OUTPUT, 1) /* (N24) GPMC0_WPn.AUDIO_EXT_REFCLK1 */
>;
};
+
+ pmic_irq_pins_default: pmic-irq-default-pins {
+ pinctrl-single,pins = <
+ J722S_IOPAD(0x030, PIN_INPUT, 7) /* (K23) GPIO0_12 */
+ >;
+ };
+
};
&cpsw3g {
@@ -459,6 +466,87 @@ &wkup_i2c0 {
clock-frequency = <400000>;
status = "okay";
bootph-all;
+
+ tps65224: pmic@48 {
+ compatible = "ti,tps65224-q1";
+ reg = <0x48>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pmic_irq_pins_default>;
+ interrupt-parent = <&main_gpio0>;
+ interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+ ti,primary-pmic;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ buck12-supply = <&vsys_io_3v3>;
+ buck3-supply = <&vsys_io_3v3>;
+ buck4-supply = <&vsys_io_3v3>;
+
+ ldo1-supply = <&vsys_io_3v3>;
+ ldo2-supply = <&vsys_io_3v3>;
+ ldo3-supply = <&vsys_io_3v3>;
+
+ regulators {
+
+ buck1: buck1 {
+ regulator-name = "vcc1v8_io_buck1";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ bootph-all;
+ };
+
+ buck2: buck2 {
+ regulator-name = "vcc1v1_ddr_buck2";
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ buck3: buck3 {
+ regulator-name = "vcc0v85_ram_buck3";
+ regulator-min-microvolt = <850000>;
+ regulator-max-microvolt = <850000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ buck4: buck4 {
+ regulator-name = "vcc0v75_ioret_buck4";
+ regulator-min-microvolt = <750000>;
+ regulator-max-microvolt = <750000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ ldo1: ldo1 {
+ regulator-name = "vdda1v8_pll_ldo1";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ ldo2: ldo2 {
+ regulator-name = "dvdd3v3_ldo2";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ ldo3: ldo3 {
+ regulator-name = "vdd1v85_phy_ldo3";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+ };
+ };
};
&k3_clks {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0233/1756] arm64: dts: ti: j722s-evm: Add MUX to control CSI2RX
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (231 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0232/1756] arm64: dts: ti: k3-j722s-evm: Enable PMIC Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0234/1756] arm64: dts: ti: k3-j722s-evm: Add bootph-all property to enable Ethernet boot Greg Kroah-Hartman
` (765 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yemike Abhilash Chandra, Udit Kumar,
Nishanth Menon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
[ Upstream commit 2e8861103a08e4220e99b673ab247aff108ddef5 ]
J722S EVM has the CSI2RX routed to a MIPI CSI connector and to 22-pin RPi
camera connector through an analog mux with GPIO control, model mux so
that an overlay can control the mux state according to connected cameras.
Signed-off-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Link: https://lore.kernel.org/r/20250509091911.2442934-3-y-abhilashchandra@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Stable-dep-of: 432bfc86fe62 ("arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/ti/k3-j722s-evm.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
index 4504912512b41..b8464082fa492 100644
--- a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
+++ b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
@@ -244,6 +244,20 @@ transceiver2: can-phy2 {
max-bitrate = <5000000>;
standby-gpios = <&exp1 17 GPIO_ACTIVE_HIGH>;
};
+
+ csi01_mux: mux-controller-0 {
+ compatible = "gpio-mux";
+ #mux-state-cells = <1>;
+ mux-gpios = <&exp1 6 GPIO_ACTIVE_HIGH>;
+ idle-state = <0>;
+ };
+
+ csi23_mux: mux-controller-1 {
+ compatible = "gpio-mux";
+ #mux-state-cells = <1>;
+ mux-gpios = <&exp1 7 GPIO_ACTIVE_HIGH>;
+ idle-state = <0>;
+ };
};
&main_pmx0 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0234/1756] arm64: dts: ti: k3-j722s-evm: Add bootph-all property to enable Ethernet boot
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (232 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0233/1756] arm64: dts: ti: j722s-evm: Add MUX to control CSI2RX Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0235/1756] arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock Greg Kroah-Hartman
` (764 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roger Quadros, Chintan Vankar,
Vignesh Raghavendra, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chintan Vankar <c-vankar@ti.com>
[ Upstream commit ab9ec669cf74b6499c0de4f42a6dd756a4e4e2a1 ]
Ethernet boot requires CPSW nodes to be present starting from R5 SPL
stage. Add bootph-all property to required nodes to enable Ethernet boot
for J722S-EVM.
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Link: https://lore.kernel.org/r/20250709105326.232608-4-c-vankar@ti.com
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Stable-dep-of: 432bfc86fe62 ("arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/ti/k3-j722s-evm.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
index b8464082fa492..ccc04548d3b9a 100644
--- a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
+++ b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
@@ -260,6 +260,14 @@ csi23_mux: mux-controller-1 {
};
};
+&cpsw_mac_syscon {
+ bootph-all;
+};
+
+&phy_gmii_sel {
+ bootph-all;
+};
+
&main_pmx0 {
main_mcan0_pins_default: main-mcan0-default-pins {
@@ -317,6 +325,7 @@ mdio_pins_default: mdio-default-pins {
J722S_IOPAD(0x0160, PIN_OUTPUT, 0) /* (AC24) MDIO0_MDC */
J722S_IOPAD(0x015c, PIN_INPUT, 0) /* (AD25) MDIO0_MDIO */
>;
+ bootph-all;
};
ospi0_pins_default: ospi0-default-pins {
@@ -351,6 +360,7 @@ J722S_IOPAD(0x0140, PIN_OUTPUT, 0) /* (AF24) RGMII1_TD3 */
J722S_IOPAD(0x0130, PIN_OUTPUT, 0) /* (AG26) RGMII1_TXC */
J722S_IOPAD(0x012c, PIN_OUTPUT, 0) /* (AF25) RGMII1_TX_CTL */
>;
+ bootph-all;
};
main_usb1_pins_default: main-usb1-default-pins {
@@ -395,6 +405,7 @@ &cpsw3g_mdio {
cpsw3g_phy0: ethernet-phy@0 {
reg = <0>;
+ bootph-all;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
ti,min-output-impedance;
@@ -405,6 +416,7 @@ &cpsw_port1 {
phy-mode = "rgmii-rxid";
phy-handle = <&cpsw3g_phy0>;
status = "okay";
+ bootph-all;
};
&main_gpio1 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0235/1756] arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (233 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0234/1756] arm64: dts: ti: k3-j722s-evm: Add bootph-all property to enable Ethernet boot Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0236/1756] selftests/bpf: More precise cpu_mitigations state detection Greg Kroah-Hartman
` (763 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jared McArthur, Moteen Shah,
Sen Wang, Nishanth Menon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jared McArthur <j-mcarthur@ti.com>
[ Upstream commit 432bfc86fe62b654c74d9376b03cbe4d3513ac5f ]
In revision PROC170E1 of the J722SXH01EVM [0], the audio codec's
(TLV320AIC3106IRGZT [1]) MCLK was provided by the AUDIO_EXT_REFCLK1
(96MHz). Revisions PROC170E2 and later switched the MCLK's source
to an external LMK6CE012288CDLFT [2] oscillator (12.288MHz). The
PROC170E1 revision of the board is not publicly available.
Fix the audio codec's clock by creating a new fixed clock node with
a frequency of 12.288MHz, and switch the audio codec's clock from
the audio_refclk1 to the new fixed clock. Remove pinmuxing and clock
muxing for the audio_refclk1.
[0] https://www.ti.com/lit/zip/SPRR495
[1] https://www.ti.com/lit/gpn/TLV320AIC3106
[2] https://www.ti.com/lit/gpn/lmk6c
Fixes: 3a36c535dfd2 ("arm64: dts: ti: k3-j722s-evm: Enable analog audio support")
Signed-off-by: Jared McArthur <j-mcarthur@ti.com>
Tested-by: Moteen Shah <m-shah@ti.com>
Tested-by: Sen Wang <sen@ti.com>
Link: https://patch.msgid.link/20260804210558.1455777-1-j-mcarthur@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/ti/k3-j722s-evm.dts | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
index ccc04548d3b9a..8286ce75a5744 100644
--- a/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
+++ b/arch/arm64/boot/dts/ti/k3-j722s-evm.dts
@@ -194,6 +194,12 @@ vsys_io_1v2: regulator-vsys-io-1v2 {
regulator-boot-on;
};
+ tlv320_mclk: clock-12288000 {
+ compatible = "fixed-clock";
+ clock-frequency = <12288000>;
+ #clock-cells = <0>;
+ };
+
codec_audio: sound {
compatible = "simple-audio-card";
simple-audio-card,name = "J722S-EVM";
@@ -219,7 +225,7 @@ simple-audio-card,cpu {
sound_master: simple-audio-card,codec {
sound-dai = <&tlv320aic3106>;
- clocks = <&audio_refclk1>;
+ clocks = <&tlv320_mclk>;
};
};
@@ -378,12 +384,6 @@ J722S_IOPAD(0x0084, PIN_INPUT, 2) /* (N21) GPMC0_ADVn_ALE.MCASP1_AXR2 */
>;
};
- audio_ext_refclk1_pins_default: audio-ext-refclk1-default-pins {
- pinctrl-single,pins = <
- J722S_IOPAD(0x00a0, PIN_OUTPUT, 1) /* (N24) GPMC0_WPn.AUDIO_EXT_REFCLK1 */
- >;
- };
-
pmic_irq_pins_default: pmic-irq-default-pins {
pinctrl-single,pins = <
J722S_IOPAD(0x030, PIN_INPUT, 7) /* (K23) GPIO0_12 */
@@ -575,12 +575,6 @@ ldo3: ldo3 {
};
};
-&k3_clks {
- /* Configure AUDIO_EXT_REFCLK1 pin as output */
- pinctrl-names = "default";
- pinctrl-0 = <&audio_ext_refclk1_pins_default>;
-};
-
&main_i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c0_pins_default>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0236/1756] selftests/bpf: More precise cpu_mitigations state detection
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (234 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0235/1756] arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0237/1756] selftests/bpf: make cmdline_contains stricter Greg Kroah-Hartman
` (762 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mykyta Yatsenko, Eduard Zingerman,
Andrii Nakryiko, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eduard Zingerman <eddyz87@gmail.com>
[ Upstream commit fc2915bb8bfcfdc6e5ea2cfc8d13fbaefe77c2c8 ]
test_progs and test_verifier binaries execute unpriv tests under the
following conditions:
- unpriv BPF is enabled;
- CPU mitigations are enabled (see [1] for details).
The detection of the "mitigations enabled" state is performed by
unpriv_helpers.c:get_mitigations_off() via inspecting kernel boot
command line, looking for a parameter "mitigations=off".
Such detection scheme won't work for certain configurations,
e.g. when CONFIG_CPU_MITIGATIONS is disabled and boot parameter is
not supplied.
Miss-detection leads to test_progs executing tests meant to be run
only with mitigations enabled, e.g.
verifier_and.c:known_subreg_with_unknown_reg(), and reporting false
failures.
Internally, verifier sets bpf_verifier_env->bypass_spec_{v1,v4}
basing on the value returned by kernel/cpu.c:cpu_mitigations_off().
This function is backed by a variable kernel/cpu.c:cpu_mitigations.
This state is not fully introspect-able via sysfs. The closest proxy
is /sys/devices/system/cpu/vulnerabilities/spectre_v1, but it reports
"vulnerable" state only if mitigations are disabled *and* current cpu
is vulnerable, while verifier does not check cpu state.
There are only two ways the kernel/cpu.c:cpu_mitigations can be set:
- via boot parameter;
- via CONFIG_CPU_MITIGATIONS option.
This commit updates unpriv_helpers.c:get_mitigations_off() to scan
/boot/config-$(uname -r) and /proc/config.gz for
CONFIG_CPU_MITIGATIONS value in addition to boot command line check.
Tested using the following configurations:
- mitigations enabled (unpriv tests are enabled)
- mitigations disabled via boot cmdline (unpriv tests skipped)
- mitigations disabled via CONFIG_CPU_MITIGATIONS
(unpriv tests skipped)
[1] https://lore.kernel.org/bpf/20231025031144.5508-1-laoar.shao@gmail.com/
Reported-by: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250617005710.1066165-2-eddyz87@gmail.com
Stable-dep-of: 040ef1f8b02e ("selftests/bpf: make cmdline_contains stricter")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/bpf/unpriv_helpers.c | 93 +++++++++++++++++++-
1 file changed, 90 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/unpriv_helpers.c b/tools/testing/selftests/bpf/unpriv_helpers.c
index 220f6a9638134..3aa9ee80a55e4 100644
--- a/tools/testing/selftests/bpf/unpriv_helpers.c
+++ b/tools/testing/selftests/bpf/unpriv_helpers.c
@@ -1,15 +1,75 @@
// SPDX-License-Identifier: GPL-2.0-only
+#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <sys/utsname.h>
#include <unistd.h>
#include <fcntl.h>
+#include <zlib.h>
#include "unpriv_helpers.h"
-static bool get_mitigations_off(void)
+static gzFile open_config(void)
+{
+ struct utsname uts;
+ char buf[PATH_MAX];
+ gzFile config;
+
+ if (uname(&uts)) {
+ perror("uname");
+ goto config_gz;
+ }
+
+ snprintf(buf, sizeof(buf), "/boot/config-%s", uts.release);
+ config = gzopen(buf, "rb");
+ if (config)
+ return config;
+ fprintf(stderr, "gzopen %s: %s\n", buf, strerror(errno));
+
+config_gz:
+ config = gzopen("/proc/config.gz", "rb");
+ if (!config)
+ perror("gzopen /proc/config.gz");
+ return config;
+}
+
+static int config_contains(const char *pat)
+{
+ const char *msg;
+ char buf[1024];
+ gzFile config;
+ int n, err;
+
+ config = open_config();
+ if (!config)
+ return -1;
+
+ for (;;) {
+ if (!gzgets(config, buf, sizeof(buf))) {
+ msg = gzerror(config, &err);
+ if (err == Z_ERRNO)
+ perror("gzgets /proc/config.gz");
+ else if (err != Z_OK)
+ fprintf(stderr, "gzgets /proc/config.gz: %s", msg);
+ gzclose(config);
+ return -1;
+ }
+ n = strlen(buf);
+ if (buf[n - 1] == '\n')
+ buf[n - 1] = 0;
+ if (strcmp(buf, pat) == 0) {
+ gzclose(config);
+ return 1;
+ }
+ }
+ gzclose(config);
+ return 0;
+}
+
+static bool cmdline_contains(const char *pat)
{
char cmdline[4096], *c;
int fd, ret = false;
@@ -27,7 +87,7 @@ static bool get_mitigations_off(void)
cmdline[sizeof(cmdline) - 1] = '\0';
for (c = strtok(cmdline, " \n"); c; c = strtok(NULL, " \n")) {
- if (strncmp(c, "mitigations=off", strlen(c)))
+ if (strncmp(c, pat, strlen(c)))
continue;
ret = true;
break;
@@ -37,8 +97,21 @@ static bool get_mitigations_off(void)
return ret;
}
+static int get_mitigations_off(void)
+{
+ int enabled_in_config;
+
+ if (cmdline_contains("mitigations=off"))
+ return 1;
+ enabled_in_config = config_contains("CONFIG_CPU_MITIGATIONS=y");
+ if (enabled_in_config < 0)
+ return -1;
+ return !enabled_in_config;
+}
+
bool get_unpriv_disabled(void)
{
+ int mitigations_off;
bool disabled;
char buf[2];
FILE *fd;
@@ -52,5 +125,19 @@ bool get_unpriv_disabled(void)
disabled = true;
}
- return disabled ? true : get_mitigations_off();
+ if (disabled)
+ return true;
+
+ /*
+ * Some unpriv tests rely on spectre mitigations being on.
+ * If mitigations are off or status can't be determined
+ * assume that unpriv tests are disabled.
+ */
+ mitigations_off = get_mitigations_off();
+ if (mitigations_off < 0) {
+ fprintf(stderr,
+ "Can't determine if mitigations are enabled, disabling unpriv tests.");
+ return true;
+ }
+ return mitigations_off;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0237/1756] selftests/bpf: make cmdline_contains stricter
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (235 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0236/1756] selftests/bpf: More precise cpu_mitigations state detection Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0238/1756] regulator: mp886x: fix vsel_mask Greg Kroah-Hartman
` (761 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexis Lothoré ,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
[ Upstream commit 040ef1f8b02e57b78081581d490ceec04ef5f7c0 ]
cmdline_contains is used by BPF selftests to check the presence of
specific kernel commandline parameters, but it currently suffers from
two issues:
- the read commandline isn't NULL terminated right after the read data
but only at the end of the buffer, leaving uninitialized bytes that
are then possibly tokenized
- the comparison of found tokens is done based on the size of found
token. This could lead to too-short-but-matching tokens to wrongly
match the search pattern.
Enforce stricter checks in cmdline_contains to avoid accidental matches.
Fixes: 399f6185a1c0 ("selftests/bpf: Fix selftests broken by mitigations=off")
Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20260903-kasan-v9-6-2407fe99255a@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/bpf/unpriv_helpers.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/unpriv_helpers.c b/tools/testing/selftests/bpf/unpriv_helpers.c
index 3aa9ee80a55e4..2b97d40660867 100644
--- a/tools/testing/selftests/bpf/unpriv_helpers.c
+++ b/tools/testing/selftests/bpf/unpriv_helpers.c
@@ -71,8 +71,8 @@ static int config_contains(const char *pat)
static bool cmdline_contains(const char *pat)
{
+ int fd, cnt, ret = false;
char cmdline[4096], *c;
- int fd, ret = false;
fd = open("/proc/cmdline", O_RDONLY);
if (fd < 0) {
@@ -80,14 +80,15 @@ static bool cmdline_contains(const char *pat)
return false;
}
- if (read(fd, cmdline, sizeof(cmdline) - 1) < 0) {
+ cnt = read(fd, cmdline, sizeof(cmdline) - 1);
+ if (cnt < 0) {
perror("read /proc/cmdline");
goto out;
}
- cmdline[sizeof(cmdline) - 1] = '\0';
+ cmdline[cnt] = '\0';
for (c = strtok(cmdline, " \n"); c; c = strtok(NULL, " \n")) {
- if (strncmp(c, pat, strlen(c)))
+ if (strcmp(c, pat))
continue;
ret = true;
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0238/1756] regulator: mp886x: fix vsel_mask
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (236 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0237/1756] selftests/bpf: make cmdline_contains stricter Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0239/1756] efi/cper: Reject CPER records with an out-of-range error_data_length Greg Kroah-Hartman
` (760 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jisheng Zhang, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jisheng Zhang <jszhang@kernel.org>
[ Upstream commit 24fa0eadc2e3c7e9397924197dca7777ec08b8d7 ]
The MP886X vsel is 7bits, fix the vsel_mask.
Fixes: 97be82880b61 ("regulator: add support for MP8869 regulator")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20260901043123.5401-2-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/mp886x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/mp886x.c b/drivers/regulator/mp886x.c
index 48dcee5287f3d..451bd7c0abe24 100644
--- a/drivers/regulator/mp886x.c
+++ b/drivers/regulator/mp886x.c
@@ -267,7 +267,7 @@ static int mp886x_regulator_register(struct mp886x_device_info *di,
rdesc->min_uV = 600000;
rdesc->uV_step = 10000;
rdesc->vsel_reg = MP886X_VSEL;
- rdesc->vsel_mask = 0x3f;
+ rdesc->vsel_mask = 0x7f;
rdesc->ramp_reg = MP886X_SYSCNTLREG1;
rdesc->ramp_mask = MP886X_SLEW_MASK;
rdesc->ramp_delay_table = di->ci->slew_rates;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0239/1756] efi/cper: Reject CPER records with an out-of-range error_data_length
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (237 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0238/1756] regulator: mp886x: fix vsel_mask Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0240/1756] efi/cper: Reject an error status block length that wraps a u32 Greg Kroah-Hartman
` (759 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Hanjun Guo, Shuai Xue,
Dave Jiang, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit a5a612cd3eecbadf135df1e9b2b40bc9f4c28f1c ]
cper_estatus_check() sizes each section with acpi_hest_get_record_size(),
which adds the firmware-controlled u32 error_data_length to the header size
as a signed int (see <acpi/ghes.h>). A value in the top sizeof(*gdata)
bytes of the u32 range wraps the sum small rather than large, so it slips
past the "record_size > data_len" check: against the 72-byte v300 header,
0xffffffb9 sizes the record at 1 and acpi_hest_get_next() walks it a byte
at a time, off the end. 0xffffffb8 sizes it at 0 and loops forever.
Use check_add_overflow() to reject a sum that will not fit the int those
helpers return, since the walk advances by that value. That subsumes the
"acpi_hest_get_size(gdata) > data_len" test above it, because record_size
is never smaller than the header.
The later "len < sizeof(*foo)" guards rely on this per-section upper bound;
they are lower bounds only.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=1
Fixes: 45b14a4ffcc1 ("efi: cper: Fix possible out-of-bounds access")
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-2-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/cper.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index 7fe10a06e68c3..c696a1c2cc39e 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -753,7 +753,7 @@ EXPORT_SYMBOL_GPL(cper_estatus_check_header);
int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
{
struct acpi_hest_generic_data *gdata;
- unsigned int data_len, record_size;
+ unsigned int data_len;
int rc;
rc = cper_estatus_check_header(estatus);
@@ -763,10 +763,18 @@ int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
data_len = estatus->data_length;
apei_estatus_for_each_section(estatus, gdata) {
- if (acpi_hest_get_size(gdata) > data_len)
+ int record_size;
+
+ /*
+ * The <acpi/ghes.h> helpers sum these as a signed int, so a
+ * huge error_data_length wraps small rather than large and the
+ * walk then advances by that wrapped value. Reject a size an
+ * int cannot carry.
+ */
+ if (check_add_overflow(acpi_hest_get_size(gdata),
+ gdata->error_data_length, &record_size))
return -EINVAL;
- record_size = acpi_hest_get_record_size(gdata);
if (record_size > data_len)
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0240/1756] efi/cper: Reject an error status block length that wraps a u32
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (238 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0239/1756] efi/cper: Reject CPER records with an out-of-range error_data_length Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0241/1756] ACPI: extlog: Validate elog record length before walking sections Greg Kroah-Hartman
` (758 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Hanjun Guo, Shuai Xue, Dave Jiang, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 41e25ef5e417c62eb7bf39b187242b283b3ef9f1 ]
cper_estatus_len() sums the firmware-controlled data_length (or
raw_data_offset plus raw_data_length) into a u32. A data_length of
0xffffffec wraps that sum to 0, and a length that reads back short defeats
every bound built on it: bert_print_all() passes its "remain <
estatus_len" check, then advances "estatus += estatus_len" by zero and
loops forever. GHES survives only because __ghes_check_estatus() rejects a
length below sizeof(*estatus) first.
Reject a length that cannot be expressed in a u32 in
cper_estatus_check_header(), which both of today's callers reach: GHES via
__ghes_check_estatus() and BERT via cper_estatus_check(). extlog reaches
neither yet; a later patch routes it through cper_estatus_check(), whose
ELOG_ENTRY_LEN bound needs this to hold.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=1
Fixes: 06d65deade9a ("ACPI, APEI, UEFI Common Platform Error Record (CPER) header")
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-3-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/cper.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index c696a1c2cc39e..f8c4866c480d9 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -746,6 +746,17 @@ int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus)
estatus->raw_data_offset < sizeof(*estatus) + estatus->data_length)
return -EINVAL;
+ /*
+ * cper_estatus_len() sums these into a u32, and a wrapped sum reads
+ * back smaller than the record. Reject a length that cannot be
+ * expressed so no caller is handed the short value.
+ */
+ if ((u64)sizeof(*estatus) + estatus->data_length > U32_MAX)
+ return -EINVAL;
+ if (estatus->raw_data_length &&
+ (u64)estatus->raw_data_offset + estatus->raw_data_length > U32_MAX)
+ return -EINVAL;
+
return 0;
}
EXPORT_SYMBOL_GPL(cper_estatus_check_header);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0241/1756] ACPI: extlog: Validate elog record length before walking sections
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (239 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0240/1756] efi/cper: Reject an error status block length that wraps a u32 Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0242/1756] ACPI: APEI: GHES: Bound CXL event record copy to the firmware section length Greg Kroah-Hartman
` (757 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Alison Schofield,
Shuai Xue, Hanjun Guo, Dave Jiang, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit e1fd582a8134150aa10c1f0286dbce00cf63b086 ]
extlog_print() copies a fixed ELOG_ENTRY_LEN (4096) bytes from the elog
record into elog_buf, then walks the sections using the firmware-controlled
data_length. Nothing keeps data_length inside the buffer, so a malformed
record walks the section pointer past elog_buf and reads adjacent memory.
Unlike the GHES paths, extlog never calls cper_estatus_check().
Reject a record longer than ELOG_ENTRY_LEN and run cper_estatus_check()
before walking the sections. The length test alone is not enough: a wrapped
length reads back short and passes it, which cper_estatus_check() catches
via the header check added earlier. Drop a malformed record with
NOTIFY_DONE and without MCE_HANDLED_EXTLOG, since extlog did not consume
it.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=6
Fixes: f6ec01da40e4 ("ACPI: extlog: Handle multiple records")
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-4-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpi_extlog.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index ca87a09391359..9d59b5f54b3d8 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -159,6 +159,15 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
tmp = (struct acpi_hest_generic_status *)elog_buf;
+ /*
+ * Bound the length before cper_estatus_check() walks the sections: it
+ * iterates over data_length, which is not yet known to fit elog_buf.
+ * cper_estatus_check_header() then rejects a length that wrapped, which
+ * the bound cannot see.
+ */
+ if (cper_estatus_len(tmp) > ELOG_ENTRY_LEN || cper_estatus_check(tmp))
+ return NOTIFY_DONE;
+
if (!ras_userspace_consumers()) {
print_extlog_rcd(NULL, tmp, cpu);
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0242/1756] ACPI: APEI: GHES: Bound CXL event record copy to the firmware section length
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (240 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0241/1756] ACPI: extlog: Validate elog record length before walking sections Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0243/1756] efi/cper: Read only validated fields in cper_mem_err_pack() Greg Kroah-Hartman
` (756 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Alison Schofield,
Shuai Xue, Jonathan Cameron, Hanjun Guo, Dave Jiang,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit b7a4915a2b43d47f0bbb0b2a4c30e722fa0d3191 ]
cxl_cper_post_event() copies a fixed sizeof(struct cxl_cper_event_rec)
out of the firmware CPER section without checking how long the section
actually is, so a short one reads past the record.
Pass gdata->error_data_length in and reject a section too small to hold
the record before the copy.
Reported-by: sashiko-bot@kernel.org
Link: https://sashiko.dev/#/patchset/20260617-topics-ahmtib01-ras_ffh_arm_internal_review-v6-0-91f725174aa0@arm.com?part=6
Fixes: 5e4a264bf8b5 ("acpi/ghes: Process CXL Component Events")
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-9-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/apei/ghes.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 045acf13c1313..dd9ea631f6f60 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -714,10 +714,15 @@ static DEFINE_RAW_SPINLOCK(cxl_cper_work_lock);
struct work_struct *cxl_cper_work;
static void cxl_cper_post_event(enum cxl_event_type event_type,
- struct cxl_cper_event_rec *rec)
+ struct cxl_cper_event_rec *rec, u32 len)
{
struct cxl_cper_work_data wd;
+ if (len < sizeof(*rec)) {
+ pr_err(FW_WARN "CXL CPER section too small (%u)\n", len);
+ return;
+ }
+
if (rec->hdr.length <= sizeof(rec->hdr) ||
rec->hdr.length > sizeof(*rec)) {
pr_err(FW_WARN "CXL CPER Invalid section length (%u)\n",
@@ -817,15 +822,18 @@ static bool ghes_do_proc(struct ghes *ghes,
} else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) {
struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata);
- cxl_cper_post_event(CXL_CPER_EVENT_GEN_MEDIA, rec);
+ cxl_cper_post_event(CXL_CPER_EVENT_GEN_MEDIA, rec,
+ gdata->error_data_length);
} else if (guid_equal(sec_type, &CPER_SEC_CXL_DRAM_GUID)) {
struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata);
- cxl_cper_post_event(CXL_CPER_EVENT_DRAM, rec);
+ cxl_cper_post_event(CXL_CPER_EVENT_DRAM, rec,
+ gdata->error_data_length);
} else if (guid_equal(sec_type, &CPER_SEC_CXL_MEM_MODULE_GUID)) {
struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata);
- cxl_cper_post_event(CXL_CPER_EVENT_MEM_MODULE, rec);
+ cxl_cper_post_event(CXL_CPER_EVENT_MEM_MODULE, rec,
+ gdata->error_data_length);
} else {
void *err = acpi_hest_get_payload(gdata);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0243/1756] efi/cper: Read only validated fields in cper_mem_err_pack()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (241 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0242/1756] ACPI: APEI: GHES: Bound CXL event record copy to the firmware section length Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0244/1756] spi: mtk-nor: fix runtime PM usage count leak in probe error path Greg Kroah-Hartman
` (755 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Hanjun Guo, Shuai Xue,
Dave Jiang, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 92480a2b00a15b0add512b6fc474151ec5340a8e ]
cper_mem_err_pack() copies extended, rank, mem_array_handle and
mem_dev_handle unconditionally. Those live at offsets 73 to 79, past the
end of struct cper_sec_mem_err_old, the 73-byte UEFI 2.1/2.2 layout that
older firmware still emits and that cper_estatus_print_section() admits.
On such a record the copy reads up to seven bytes past the payload, and off
the end of the error status block when that section is the last one.
Copy each of the four only when its validation bit is set, and zero it
otherwise. Nothing is lost: a 2.1/2.2 record leaves those bits clear, and
every consumer of struct cper_mem_err_compact already gates the fields on
the same bits. Zeroing also stops callers reading them back out of the
uninitialised on-stack struct they pass in.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260714231835.303081-1-dave.jiang@intel.com?part=7
Fixes: 2dfb7d51a61d ("trace, RAS: Add eMCA trace event interface")
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260904172337.1409775-11-dave.jiang@intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/cper.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index f8c4866c480d9..292eda2077941 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -390,10 +390,28 @@ void cper_mem_err_pack(const struct cper_sec_mem_err *mem,
cmem->requestor_id = mem->requestor_id;
cmem->responder_id = mem->responder_id;
cmem->target_id = mem->target_id;
- cmem->extended = mem->extended;
- cmem->rank = mem->rank;
- cmem->mem_array_handle = mem->mem_array_handle;
- cmem->mem_dev_handle = mem->mem_dev_handle;
+
+ /*
+ * These four sit past the end of the UEFI 2.1/2.2 layout, which older
+ * firmware still emits, so reading them unconditionally runs off a
+ * short record. Every consumer of the compact record gates them on the
+ * same validation bits, so leave them zero when firmware does not
+ * claim them.
+ */
+ cmem->extended = 0;
+ cmem->rank = 0;
+ cmem->mem_array_handle = 0;
+ cmem->mem_dev_handle = 0;
+
+ if (mem->validation_bits &
+ (CPER_MEM_VALID_ROW_EXT | CPER_MEM_VALID_CHIP_ID))
+ cmem->extended = mem->extended;
+ if (mem->validation_bits & CPER_MEM_VALID_RANK_NUMBER)
+ cmem->rank = mem->rank;
+ if (mem->validation_bits & CPER_MEM_VALID_CARD_HANDLE)
+ cmem->mem_array_handle = mem->mem_array_handle;
+ if (mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE)
+ cmem->mem_dev_handle = mem->mem_dev_handle;
}
EXPORT_SYMBOL_GPL(cper_mem_err_pack);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0244/1756] spi: mtk-nor: fix runtime PM usage count leak in probe error path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (242 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0243/1756] efi/cper: Read only validated fields in cper_mem_err_pack() Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0245/1756] remoteproc: imx_rproc: Allow mappings ending at region boundary Greg Kroah-Hartman
` (754 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Gu, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 4cee1ed13e2687f1a9fec7dd50e31eb179506d75 ]
mtk_nor_probe() takes a runtime PM reference with
pm_runtime_get_noresume() before registering the controller, but the
error path never drops it.
Balance the get with pm_runtime_put_noidle() in the error path.
Fixes: 3bfd9103c7af ("spi: spi-mtk-nor: Add power management support")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260904-mtk-nor-v1-1-cefdca098f83@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-mtk-nor.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index d4a2760c7b66e..c2a92bdbdb07e 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -926,6 +926,7 @@ static int mtk_nor_probe(struct platform_device *pdev)
return 0;
err_probe:
+ pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0245/1756] remoteproc: imx_rproc: Allow mappings ending at region boundary
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (243 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0244/1756] spi: mtk-nor: fix runtime PM usage count leak in probe error path Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0246/1756] perf trace: Fix error checking in btf_struct_scnprintf() Greg Kroah-Hartman
` (753 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marcel Hofmann, Mathieu Poirier,
Sasha Levin, Peng Fan
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcel Hofmann <marcel.hofmann@ingenics-digital.com>
[ Upstream commit 749eed0c7178c8d53ce4c9acdda4a545721c494b ]
The address range checks in imx_rproc_da_to_sys() and
imx_rproc_da_to_va() use a strict comparison for the exclusive end
address of the requested range.
As a result, a valid request that ends exactly at the end of an address
translation or mapped memory region is rejected. For a region
[start, start + size), a request [addr, addr + len) is contained when:
addr >= start && addr + len <= start + size
This occurs when a loadable ELF segment fills an entire mapped memory
region. This can be produced by a linker script that extends the
resource table section to the end of its designated region:
.resource_table :
{
. = ALIGN(8);
KEEP(*(.resource_table)) /* Resource table */
. = ALIGN(8);
. = ORIGIN(m_rsc_tbl) + LENGTH(m_rsc_tbl);
} > m_rsc_tbl =0x00
This produces a ELF program header like:
LOAD 0x010000 0xa4220000 0xa4220000 0x01000 0x01000 R 0x1000
In this case, the segment size matches the mapped region size exactly,
causing the address translation to fail with:
bad phdr da 0xa4220000 mem 0x1000
Rework the upper-bound checks to allow ranges ending exactly at the region
boundary while guarding against integer overflow.
Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver")
Signed-off-by: Marcel Hofmann <marcel.hofmann@ingenics-digital.com>
Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95-19x19-EVK
Link: https://lore.kernel.org/r/20260827123136.438798-1-marcel@hofmania.de
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/imx_rproc.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 4f73b1ea05ffb..8b2afa8242f91 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -456,6 +456,7 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da,
/* parse address translation table */
for (i = 0; i < dcfg->att_size; i++) {
const struct imx_rproc_att *att = &dcfg->att[i];
+ u64 offset;
/*
* Ignore entries not belong to current core:
@@ -468,9 +469,11 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da,
continue;
}
- if (da >= att->da && da + len < att->da + att->size) {
- unsigned int offset = da - att->da;
+ if (da < att->da)
+ continue;
+ offset = da - att->da;
+ if (offset <= att->size && len <= att->size - offset) {
*sys = att->sa + offset;
if (is_iomem)
*is_iomem = att->flags & ATT_IOMEM;
@@ -501,9 +504,14 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *i
return NULL;
for (i = 0; i < IMX_RPROC_MEM_MAX; i++) {
- if (sys >= priv->mem[i].sys_addr && sys + len <
- priv->mem[i].sys_addr + priv->mem[i].size) {
- unsigned int offset = sys - priv->mem[i].sys_addr;
+ u64 offset;
+
+ if (sys < priv->mem[i].sys_addr)
+ continue;
+
+ offset = sys - priv->mem[i].sys_addr;
+ if (offset <= priv->mem[i].size &&
+ len <= priv->mem[i].size - offset) {
/* __force to make sparse happy with type conversion */
va = (__force void *)(priv->mem[i].cpu_addr + offset);
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0246/1756] perf trace: Fix error checking in btf_struct_scnprintf()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (244 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0245/1756] remoteproc: imx_rproc: Allow mappings ending at region boundary Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0247/1756] perf evsel: Validate branch stack before byte swapping Greg Kroah-Hartman
` (752 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Ian Rogers,
Aaron Tomlin, Howard Chu, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Tomlin <atomlin@atomlin.com>
[ Upstream commit 02241f791aa28802cc05223a740e163e14cd5ea2 ]
btf_dump__dump_type_data() returns the positive number of bytes dumped on
success, or a negative error code (e.g., -EINVAL) on failure.
Currently, btf_struct_scnprintf() checks if btf_dump__dump_type_data()
returns 0. When a negative error code is returned on failure, this check
evaluates to false, causing the function to proceed down the success path
and advance arg->augmented.args past the unprinted struct data before
returning 0.
Consequently, when syscall__scnprintf_args() falls back to the default
argument beautifier upon receiving 0 from trace__btf_scnprintf(), the
fallback beautifier or subsequent arguments read from an erroneously
advanced augmented arguments buffer.
Fix this by checking for '<= 0' ensuring that on any failure or 0-byte
dump, 0 is returned without modifying the augmented arguments pointer.
Fixes: cb32035214b9a09d ("perf trace: Pretty print struct data")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Tested-by: Ian Rogers <irogers@google.com>
Cc: Howard Chu <howardchu95@gmail.com>
[ Restored that call to be a single line ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 0af5254df4720..385686a93ab8f 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1044,7 +1044,7 @@ static size_t btf_struct_scnprintf(const struct btf_type *type, struct btf *btf,
return 0;
/* pretty print the struct data here */
- if (btf_dump__dump_type_data(btf_dump, type_id, arg->augmented.args->value, type->size, &dump_data_opts) == 0)
+ if (btf_dump__dump_type_data(btf_dump, type_id, arg->augmented.args->value, type->size, &dump_data_opts) <= 0)
return 0;
consumed = sizeof(*augmented_arg) + augmented_arg->size;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0247/1756] perf evsel: Validate branch stack before byte swapping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (245 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0246/1756] perf trace: Fix error checking in btf_struct_scnprintf() Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0248/1756] perf evsel: Validate RAW sample " Greg Kroah-Hartman
` (751 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Mark Amirkan,
Madhavan Srinivasan, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Amirkan <markdamirkan@gmail.com>
[ Upstream commit 2148e094671b0f6a44f033787b7da4ed14e96c27 ]
When perf reads an opposite-endian branch stack, __evsel__parse_sample()
swaps each entry before checking whether all entries fit in the event. A
truncated sample can therefore make the swap loop read and write past the
event boundary.
A truncated perf.data file makes perf report crash with SIGSEGV. ASan
reports an out-of-bounds read. A regression test puts an entry just past
the declared end and shows that its flags are changed before the parser
returns -EFAULT.
Move the bounds check before the byte-swap loop. Valid samples are handled
as before.
Fixes: 63c12ae2f246dcdc ("perf evsel: Add bitfield_swap() to handle branch_stack endian issue")
Reviewed-by: Ian Rogers <irogers@google.com>
Assisted-by: Symbolic
Signed-off-by: Mark Amirkan <markdamirkan@gmail.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/sample-parsing.c | 48 +++++++++++++++++++++++++++++++
tools/perf/util/evsel.c | 3 +-
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 72411580f8698..5af2c1a0c376f 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdbool.h>
+#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
@@ -376,6 +377,49 @@ static int do_test(u64 sample_type, u64 sample_regs, u64 read_format)
return ret;
}
+static int test_truncated_branch_stack(void)
+{
+ struct perf_event_attr attr = {
+ .sample_type = PERF_SAMPLE_BRANCH_STACK,
+ };
+ struct {
+ struct perf_event_header header;
+ u64 nr;
+ struct branch_entry entry;
+ } input = {
+ .header = {
+ .type = PERF_RECORD_SAMPLE,
+ .size = sizeof(input.header) + sizeof(input.nr),
+ },
+ .nr = 1,
+ };
+ struct perf_sample sample;
+ struct evsel *evsel;
+ u64 flags = 1;
+ int err;
+
+ input.entry.flags.value = flags;
+ evsel = evsel__new(&attr);
+ if (!evsel)
+ return -1;
+
+ evsel->sample_size = __evsel__sample_size(attr.sample_type);
+ err = __evsel__parse_sample(evsel, (union perf_event *)&input,
+ &sample, /*needs_swap=*/true);
+ perf_sample__exit(&sample);
+ evsel__put(evsel);
+
+ if (err != -EFAULT) {
+ pr_debug("truncated branch stack returned %d, expected -EFAULT\n", err);
+ return -1;
+ }
+ if (input.entry.flags.value != flags) {
+ pr_debug("truncated branch stack modified data past the event\n");
+ return -1;
+ }
+ return 0;
+}
+
/**
* test__sample_parsing - test sample parsing.
*
@@ -392,6 +436,10 @@ static int test__sample_parsing(struct test_suite *test __maybe_unused, int subt
size_t i;
int err;
+ err = test_truncated_branch_stack();
+ if (err)
+ return err;
+
/*
* Fail the test if it has not been updated when new sample format bits
* were added. Please actually update the test rather than just change
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index e84dacb5627b6..ab808f0754055 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2898,6 +2898,8 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
e = (struct branch_entry *)&data->branch_stack->hw_idx;
}
+ OVERFLOW_CHECK(array, sz, max_size);
+
if (swapped) {
/*
* struct branch_flag does not have endian
@@ -2913,7 +2915,6 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
e->flags.value = evsel__bitfield_swap_branch_flags(e->flags.value);
}
- OVERFLOW_CHECK(array, sz, max_size);
array = (void *)array + sz;
if (evsel__has_branch_counters(evsel)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0248/1756] perf evsel: Validate RAW sample before byte swapping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (246 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0247/1756] perf evsel: Validate branch stack before byte swapping Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0249/1756] RDMA/irdma: Preserve fast-registration IOVA on 32-bit Greg Kroah-Hartman
` (750 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Mark Amirkan, Jiri Olsa,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Amirkan <markdamirkan@gmail.com>
[ Upstream commit 02f6847e1822714a4201b87e42f92b0d43e8549d ]
For an opposite-endian RAW sample, __evsel__parse_sample() passes the
input-controlled size to mem_bswap_64() before checking whether the
payload fits in the event. A truncated record can therefore make the helper
read and write past the event boundary.
A crafted perf.data file makes perf report crash with SIGSEGV. ASan
reports the out-of-bounds access. A regression test puts backed data past
the declared end and shows that it is changed before the parser returns
-EFAULT.
Move the bounds checks before mem_bswap_64(). Check the rounded length too,
because the helper accesses complete 64-bit words. Complete records are
handled as before.
Fixes: f9d8adb345d7adbb ("perf evsel: Fix swap for samples with raw data")
Reviewed-by: Ian Rogers <irogers@google.com>
Assisted-by: Symbolic
Signed-off-by: Mark Amirkan <markdamirkan@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/sample-parsing.c | 61 +++++++++++++++++++++++++++++++
tools/perf/util/evsel.c | 17 +++++----
2 files changed, 70 insertions(+), 8 deletions(-)
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index 5af2c1a0c376f..0602c4be32975 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -420,6 +420,55 @@ static int test_truncated_branch_stack(void)
return 0;
}
+static int test_truncated_swapped_raw(u16 event_size, u32 raw_size)
+{
+ struct perf_event_attr attr = {
+ .sample_type = PERF_SAMPLE_RAW,
+ };
+ struct {
+ struct perf_event_header header;
+ union {
+ u64 value;
+ u32 words[2];
+ } raw;
+ u64 canary;
+ } input = {
+ .header = {
+ .type = PERF_RECORD_SAMPLE,
+ .size = event_size,
+ },
+ /* Parsing a pre-swapped word exchanges these two u32 values. */
+ .raw.words = { 0x12345678, raw_size },
+ .canary = 0x8877665544332211ULL,
+ };
+ struct perf_sample sample;
+ struct evsel *evsel;
+ u64 raw = input.raw.value;
+ u64 canary = input.canary;
+ int err;
+
+ evsel = evsel__new(&attr);
+ if (!evsel)
+ return -1;
+
+ evsel->sample_size = __evsel__sample_size(attr.sample_type);
+ err = __evsel__parse_sample(evsel, (union perf_event *)&input,
+ &sample, /*needs_swap=*/true);
+ perf_sample__exit(&sample);
+ evsel__put(evsel);
+
+ if (err != -EFAULT) {
+ pr_debug("truncated swapped RAW sample (size %u, raw %u) returned %d, expected -EFAULT\n",
+ event_size, raw_size, err);
+ return -1;
+ }
+ if (input.raw.value != raw || input.canary != canary) {
+ pr_debug("truncated swapped RAW sample modified data before validation\n");
+ return -1;
+ }
+ return 0;
+}
+
/**
* test__sample_parsing - test sample parsing.
*
@@ -440,6 +489,18 @@ static int test__sample_parsing(struct test_suite *test __maybe_unused, int subt
if (err)
return err;
+ /* The declared RAW payload extends past an otherwise aligned event. */
+ err = test_truncated_swapped_raw(sizeof(struct perf_event_header) +
+ sizeof(u64), 16);
+ if (err)
+ return err;
+
+ /* The final complete word touched by mem_bswap_64() extends past it. */
+ err = test_truncated_swapped_raw(sizeof(struct perf_event_header) +
+ sizeof(u32) + 9, 9);
+ if (err)
+ return err;
+
/*
* Fail the test if it has not been updated when new sample format bits
* were added. Please actually update the test rather than just change
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index ab808f0754055..2e8bfd4ea5c8b 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2843,7 +2843,10 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
}
if (type & PERF_SAMPLE_RAW) {
+ const __u64 *raw;
+
OVERFLOW_CHECK_u64(array);
+ raw = array;
u.val64 = *array;
/*
@@ -2859,16 +2862,14 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
}
data->raw_size = u.val32[0];
- /*
- * The raw data is aligned on 64bits including the
- * u32 size, so it's safe to use mem_bswap_64.
- */
- if (swapped)
- mem_bswap_64((void *) array, data->raw_size);
-
array = (void *)array + sizeof(u32);
-
OVERFLOW_CHECK(array, data->raw_size, max_size);
+ if (swapped) {
+ /* mem_bswap_64() accesses complete 64-bit words. */
+ sz = roundup((u64)data->raw_size, sizeof(u64));
+ OVERFLOW_CHECK(raw, sz, max_size);
+ mem_bswap_64((void *)raw, data->raw_size);
+ }
data->raw_data = (void *)array;
array = (void *)array + data->raw_size;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0249/1756] RDMA/irdma: Preserve fast-registration IOVA on 32-bit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (247 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0248/1756] perf evsel: Validate RAW sample " Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0250/1756] gpio: crystalcove: add missing MODULE_ALIAS() Greg Kroah-Hartman
` (749 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jacob Moroni, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <leonro@nvidia.com>
[ Upstream commit c470050f2a7a7748ce35367e828885a8e658d712 ]
ib_mr::iova is u64, but the fast-registration path passes it through
void * and uintptr_t. These conversions truncate the upper 32 bits on
32-bit kernels before the WQE is built.
Store the IOVA as u64 and write it directly to the WQE. The sole caller
always uses VA-based addressing, so remove the unused FBO selection and
set the VA-based bit unconditionally.
Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Link: https://patch.msgid.link/20260903-64-bit-iova-is-silently-truncated-to-v1-1-96e878ea6873@nvidia.com
Reviewed-by: Jacob Moroni <jmoroni@google.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/irdma/ctrl.c | 6 ++----
drivers/infiniband/hw/irdma/type.h | 4 +---
drivers/infiniband/hw/irdma/verbs.c | 3 +--
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c
index de1bd2b57414a..16dbb1d350425 100644
--- a/drivers/infiniband/hw/irdma/ctrl.c
+++ b/drivers/infiniband/hw/irdma/ctrl.c
@@ -1320,9 +1320,7 @@ int irdma_sc_mr_fast_register(struct irdma_sc_qp *qp,
info->wr_id, wqe_idx,
&qp->qp_uk.sq_wrtrk_array[wqe_idx].wrid);
- temp = (info->addr_type == IRDMA_ADDR_TYPE_VA_BASED) ?
- (uintptr_t)info->va : info->fbo;
- set_64bit_val(wqe, 0, temp);
+ set_64bit_val(wqe, 0, info->va);
temp = FIELD_GET(IRDMAQPSQ_FIRSTPMPBLIDXHI,
info->first_pm_pbl_index >> 16);
@@ -1339,7 +1337,7 @@ int irdma_sc_mr_fast_register(struct irdma_sc_qp *qp,
FIELD_PREP(IRDMAQPSQ_LPBLSIZE, info->chunk_size) |
FIELD_PREP(IRDMAQPSQ_HPAGESIZE, page_size) |
FIELD_PREP(IRDMAQPSQ_STAGRIGHTS, info->access_rights) |
- FIELD_PREP(IRDMAQPSQ_VABASEDTO, info->addr_type) |
+ IRDMAQPSQ_VABASEDTO |
FIELD_PREP(IRDMAQPSQ_READFENCE, info->read_fence) |
FIELD_PREP(IRDMAQPSQ_LOCALFENCE, info->local_fence) |
FIELD_PREP(IRDMAQPSQ_SIGCOMPL, info->signaled) |
diff --git a/drivers/infiniband/hw/irdma/type.h b/drivers/infiniband/hw/irdma/type.h
index 59b34afa867bd..45f5d6c211cf5 100644
--- a/drivers/infiniband/hw/irdma/type.h
+++ b/drivers/infiniband/hw/irdma/type.h
@@ -1005,13 +1005,11 @@ struct irdma_reg_ns_stag_info {
struct irdma_fast_reg_stag_info {
u64 wr_id;
u64 reg_addr_pa;
- u64 fbo;
- void *va;
+ u64 va;
u64 total_len;
u32 page_size;
u32 chunk_size;
u32 first_pm_pbl_index;
- enum irdma_addressing_type addr_type;
irdma_stag_index stag_idx;
u16 access_rights;
u32 pd_id;
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index f86249226b60e..8a3c08679953d 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -3566,8 +3566,7 @@ static int irdma_post_send(struct ib_qp *ibqp,
stag_info.stag_idx = reg_wr(ib_wr)->key >> 8;
stag_info.page_size = reg_wr(ib_wr)->mr->page_size;
stag_info.wr_id = ib_wr->wr_id;
- stag_info.addr_type = IRDMA_ADDR_TYPE_VA_BASED;
- stag_info.va = (void *)(uintptr_t)iwmr->ibmr.iova;
+ stag_info.va = iwmr->ibmr.iova;
stag_info.total_len = iwmr->ibmr.length;
stag_info.reg_addr_pa = *palloc->level1.addr;
stag_info.first_pm_pbl_index = palloc->level1.idx;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0250/1756] gpio: crystalcove: add missing MODULE_ALIAS()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (248 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0249/1756] RDMA/irdma: Preserve fast-registration IOVA on 32-bit Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0251/1756] drivers/base/node: fix UAF on device_register() failure Greg Kroah-Hartman
` (748 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Torokhov, Linus Walleij,
Andy Shevchenko, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[ Upstream commit 32c7f7f80e5f7f2764682fd456054478fc11c8d9 ]
The crystalcove GPIO driver lacks a MODULE_ALIAS() to allow it to be
auto-loaded.
Fix this by adding the missing platform alias.
Fixes: 104fb1d5153c ("gpio: Add support for Intel Crystal Cove PMIC")
Assisted-by: LLM
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-crystalcove.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
index 25db014494a4d..636e4d3f990b1 100644
--- a/drivers/gpio/gpio-crystalcove.c
+++ b/drivers/gpio/gpio-crystalcove.c
@@ -395,3 +395,4 @@ module_platform_driver(crystalcove_gpio_driver);
MODULE_AUTHOR("Yang, Bin <bin.yang@intel.com>");
MODULE_DESCRIPTION("Intel Crystal Cove GPIO Driver");
MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:crystal_cove_gpio");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0251/1756] drivers/base/node: fix UAF on device_register() failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (249 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0250/1756] gpio: crystalcove: add missing MODULE_ALIAS() Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0252/1756] irqchip/gic-v3-its: Dont WARN on LPI free allocation failure Greg Kroah-Hartman
` (747 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linkai Gong, Danilo Krummrich,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <gonglinkai@kylinos.cn>
[ Upstream commit 6d7e9bc51d8f2d73b3403c759c769f880082f9ae ]
node_init_node_access() frees the access node with kfree() if
device_register() fails. After device_register() the embedded device is
initialized and must be released with put_device() so that
node_access_release() can free it.
Fixes: 08d9dbe72b1f ("node: Link memory nodes to their compute nodes")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Link: https://patch.msgid.link/20260907024732.1452228-1-gonglinkai@kylinos.cn
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/node.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index deccfe68214ec..091e397b72b47 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -144,20 +144,19 @@ static struct node_access_nodes *node_init_node_access(struct node *node,
dev->parent = &node->dev;
dev->release = node_access_release;
dev->groups = node_access_node_groups;
- if (dev_set_name(dev, "access%u", access))
- goto free;
+ if (dev_set_name(dev, "access%u", access)) {
+ kfree(access_node);
+ return NULL;
+ }
- if (device_register(dev))
- goto free_name;
+ if (device_register(dev)) {
+ put_device(dev);
+ return NULL;
+ }
pm_runtime_no_callbacks(dev);
list_add_tail(&access_node->list_node, &node->access_list);
return access_node;
-free_name:
- kfree_const(dev->kobj.name);
-free:
- kfree(access_node);
- return NULL;
}
#ifdef CONFIG_HMEM_REPORTING
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0252/1756] irqchip/gic-v3-its: Dont WARN on LPI free allocation failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (250 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0251/1756] drivers/base/node: fix UAF on device_register() failure Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0253/1756] ASoC: es8326: report resume restore errors Greg Kroah-Hartman
` (746 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+229d761b8a110e6de517,
Karl Mehltretter, Thomas Gleixner, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 135d9e67f7ab4f261c2157ee2de1f93a4de39a41 ]
free_lpi_range() cannot give LPIs back to the allocator without
allocating a struct lpi_range to describe the freed range, so it
returns -ENOMEM (its only failure mode) when that allocation fails,
and its_lpi_free() turns this into a WARN_ON().
syzbot triggers the WARN_ON() by injecting a slab allocation failure
on device teardown, which with panic_on_warn becomes a panic:
WARNING: drivers/irqchip/irq-gic-v3-its.c:2251 at its_msi_teardown+0x3a4/0x424
its_msi_teardown+0x3a4/0x424
msi_remove_device_irq_domain+0x16c/0x27c
msi_device_data_release+0x38/0x9c
The failure is transient and the consequence benign: the freed range
is simply never returned to the allocator. This does not warrant a
WARN_ON() backtrace, so log a rate-limited error instead.
Fixes: 880cb3cddd16 ("irqchip/gic-v3-its: Refactor LPI allocator")
Reported-by: syzbot+229d761b8a110e6de517@syzkaller.appspotmail.com
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: Claude:claude-fable-5
Link: https://patch.msgid.link/20260811095532.48454-1-kmehltretter@gmail.com
Closes: https://syzkaller.appspot.com/bug?extid=229d761b8a110e6de517
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-gic-v3-its.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 7ab93108c1096..a98acf21becce 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2166,7 +2166,8 @@ static unsigned long *its_lpi_alloc(int nr_irqs, u32 *base, int *nr_ids)
static void its_lpi_free(unsigned long *bitmap, u32 base, u32 nr_ids)
{
- WARN_ON(free_lpi_range(base, nr_ids));
+ if (free_lpi_range(base, nr_ids))
+ pr_err_ratelimited("ITS: failed to free LPI range %u:%u\n", base, nr_ids);
bitmap_free(bitmap);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0253/1756] ASoC: es8326: report resume restore errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (251 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0252/1756] irqchip/gic-v3-its: Dont WARN on LPI free allocation failure Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0254/1756] virtio_ccw: fix synchronize_cbs() after interrupt fallback Greg Kroah-Hartman
` (745 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 349e94679968785803cc32c1d2e41e000e8afd5f ]
es8326_resume() ignores the status-register read, the direct clock-state
write and the register-cache replay. A read failure can also leave reg
uninitialized before it selects the reset path, and a cache failure is
followed by jack IRQ processing.
Return these errors before later resume work. The ASoC component wrapper
reports the callback failure while retaining its best-effort resume
contract.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 5c439937775d ("ASoC: codecs: add support for ES8326")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Link: https://patch.msgid.link/20260906034217.85696-2-hppiscas@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/es8326.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
index d5362b3be4844..caaacde8b59e3 100644
--- a/sound/soc/codecs/es8326.c
+++ b/sound/soc/codecs/es8326.c
@@ -1082,18 +1082,28 @@ static int es8326_resume(struct snd_soc_component *component)
{
struct es8326_priv *es8326 = snd_soc_component_get_drvdata(component);
unsigned int reg;
+ int ret;
regcache_cache_only(es8326->regmap, false);
regcache_cache_bypass(es8326->regmap, true);
- regmap_read(es8326->regmap, ES8326_CLK_RESAMPLE, ®);
+ ret = regmap_read(es8326->regmap, ES8326_CLK_RESAMPLE, ®);
regcache_cache_bypass(es8326->regmap, false);
+ if (ret)
+ return ret;
+
/* reset internal clock state */
- if (reg == 0x05)
- regmap_write(es8326->regmap, ES8326_CLK_CTL, ES8326_CLK_ON);
- else
+ if (reg == 0x05) {
+ ret = regmap_write(es8326->regmap, ES8326_CLK_CTL,
+ ES8326_CLK_ON);
+ if (ret)
+ return ret;
+ } else {
es8326_init(component);
+ }
- regcache_sync(es8326->regmap);
+ ret = regcache_sync(es8326->regmap);
+ if (ret)
+ return ret;
es8326_irq(es8326->irq, es8326);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0254/1756] virtio_ccw: fix synchronize_cbs() after interrupt fallback
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (252 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0253/1756] ASoC: es8326: report resume restore errors Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0255/1756] virtio_ccw: always take irq_lock in the classic interrupt handler Greg Kroah-Hartman
` (744 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Michael S. Tsirkin,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 6e484b870b71eb6acb3fa7a10b8e71098e242033 ]
virtio_ccw_synchronize_cbs() assumes the device uses adapter interrupts
when vcdev->airq_info is not NULL. If registering adapter indicators
fails, virtio_ccw_find_vqs() falls back to classic interrupts but can
leave airq_info set.
With VIRTIO_HARDEN_NOTIFICATION enabled,
virtio_ccw_int_handler() invokes callbacks under vcdev->irq_lock.
synchronize_cbs() instead takes the indicator area lock, so it does
not synchronize with those callbacks.
Use vcdev->is_thinint, which the fallback clears, to select the lock.
Keep the airq_info check because is_thinint can be set before the
first find_vqs() call, when airq_info is still NULL.
Fixes: 3a232277c1ac ("virtio-ccw: implement synchronize_cbs()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260908053817.26065-2-kmehltretter@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/virtio/virtio_ccw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 4904b831c0a75..98b62bc18228b 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -1061,7 +1061,7 @@ static void virtio_ccw_synchronize_cbs(struct virtio_device *vdev)
struct virtio_ccw_device *vcdev = to_vc_device(vdev);
struct airq_info *info = vcdev->airq_info;
- if (info) {
+ if (vcdev->is_thinint && info) {
/*
* This device uses adapter interrupts: synchronize with
* vring_interrupt() called by virtio_airq_handler()
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0255/1756] virtio_ccw: always take irq_lock in the classic interrupt handler
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (253 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0254/1756] virtio_ccw: fix synchronize_cbs() after interrupt fallback Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0256/1756] pwm: mtk-disp: Fix period readback Greg Kroah-Hartman
` (743 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Michael S. Tsirkin,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 48a355cf5b382570975e60857450ff3d42f268e9 ]
virtio_ccw_int_handler() takes vcdev->irq_lock around its
vring_interrupt() calls only when VIRTIO_HARDEN_NOTIFICATION is enabled.
The virtio shutdown path calls synchronize_cbs() even when notification
hardening is disabled. virtio_reset_device() now does so after the
transport reset too.
For classic interrupts, synchronize_cbs() takes vcdev->irq_lock for
writing, but the interrupt handler does not take the matching read
lock in that configuration. synchronize_cbs() can return while a
callback is still running.
Take the read lock unconditionally so the write side can synchronize
with the callbacks.
Fixes: 8bd2fa086a04 ("virtio: break and reset virtio devices on device_shutdown()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260908053817.26065-3-kmehltretter@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/virtio/virtio_ccw.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 98b62bc18228b..340191410d2c8 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -1203,13 +1203,11 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev,
vcdev->err = -EIO;
}
virtio_ccw_check_activity(vcdev, activity);
-#ifdef CONFIG_VIRTIO_HARDEN_NOTIFICATION
/*
* Paired with virtio_ccw_synchronize_cbs() and interrupts are
* disabled here.
*/
read_lock(&vcdev->irq_lock);
-#endif
for_each_set_bit(i, indicators(vcdev),
sizeof(*indicators(vcdev)) * BITS_PER_BYTE) {
/* The bit clear must happen before the vring kick. */
@@ -1218,9 +1216,7 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev,
vq = virtio_ccw_vq_by_ind(vcdev, i);
vring_interrupt(0, vq);
}
-#ifdef CONFIG_VIRTIO_HARDEN_NOTIFICATION
read_unlock(&vcdev->irq_lock);
-#endif
if (test_bit(0, indicators2(vcdev))) {
virtio_config_changed(&vcdev->vdev);
clear_bit(0, indicators2(vcdev));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0256/1756] pwm: mtk-disp: Fix period readback
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (254 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0255/1756] virtio_ccw: always take irq_lock in the classic interrupt handler Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0257/1756] mac80211: tx: Use info->flags in ieee80211_tx_h_select_key() Greg Kroah-Hartman
` (742 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jitao Shi, Chen-Yu Tsai,
AngeloGioacchino Del Regno, Fei Shao, Uwe Kleine-König,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wenst@chromium.org>
[ Upstream commit c5b29baad42b2b02389cc6a716697a8a63209930 ]
The period value stored in the register is the number of clock cycles - 1.
Account for the offset when calculating the period in nanoseconds. This
fixes the discrepancy reported by the pwm core when CONFIG_PWM_DEBUG=1:
mediatek-disp-pwm 1100e000.pwm: .apply is not idempotent
(ena=1 pol=0 281500/499875) -> (ena=1 pol=0 281500/499750)
Calculation discrepancy in the driver was found by AI run by a colleague
while debugging another PWM related issue. Check against SoC datasheet
and fix done by the author.
Fixes: 3f2b16734914 ("pwm: mtk-disp: Implement atomic API .get_state()")
Cc: Jitao Shi <jitao.shi@mediatek.com>
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Link: https://patch.msgid.link/20260827105738.8570-1-wenst@chromium.org
[ukleinek: Adapt comment accordingly]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pwm/pwm-mtk-disp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-mtk-disp.c b/drivers/pwm/pwm-mtk-disp.c
index bafd6b6195f66..3906342ff45eb 100644
--- a/drivers/pwm/pwm-mtk-disp.c
+++ b/drivers/pwm/pwm-mtk-disp.c
@@ -210,9 +210,9 @@ static int mtk_disp_pwm_get_state(struct pwm_chip *chip,
period = FIELD_GET(PWM_PERIOD_MASK, con1);
/*
* period has 12 bits, clk_div 11 and NSEC_PER_SEC has 30,
- * so period * (clk_div + 1) * NSEC_PER_SEC doesn't overflow.
+ * so (period + 1) * (clk_div + 1) * NSEC_PER_SEC doesn't overflow.
*/
- state->period = DIV64_U64_ROUND_UP(period * (clk_div + 1) * NSEC_PER_SEC, rate);
+ state->period = DIV64_U64_ROUND_UP((period + 1) * (clk_div + 1) * NSEC_PER_SEC, rate);
high_width = FIELD_GET(PWM_HIGH_WIDTH_MASK, con1);
state->duty_cycle = DIV64_U64_ROUND_UP(high_width * (clk_div + 1) * NSEC_PER_SEC,
rate);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0257/1756] mac80211: tx: Use info->flags in ieee80211_tx_h_select_key()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (255 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0256/1756] pwm: mtk-disp: Fix period readback Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0258/1756] ASoC: mediatek: mt8186: Fix APLL mux setting error handling Greg Kroah-Hartman
` (741 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bert Karwatzki, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bert Karwatzki <spasswolf@web.de>
[ Upstream commit 5f2530a4df8e0573e54cc0f4175c06ecb810a4dd ]
Without this ieee80211_select_key_8023() is never called and wifi never
connects.
Fixes: 0e80db08668b ("wifi: mac80211: fix key selection for encap offload frames")
Signed-off-by: Bert Karwatzki <spasswolf@web.de>
Link: https://patch.msgid.link/20260908094341.12196-1-spasswolf@web.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b8b8a2622cbfe..e64811ff8ccb4 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -626,7 +626,7 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
- if (info->control.flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
return ieee80211_select_key_8023(tx);
if (unlikely(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0258/1756] ASoC: mediatek: mt8186: Fix APLL mux setting error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (256 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0257/1756] mac80211: tx: Use info->flags in ieee80211_tx_h_select_key() Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0259/1756] ASoC: mediatek: mt8186: Fix clock handling in mux disable path Greg Kroah-Hartman
` (740 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 5ee5987fadf6ae15678a654b4d909225c97f0299 ]
The APLL mux setup functions return immediately when a clock operation
fails, without undoing the clock changes already made. This can leave
clocks enabled or muxes configured to an unexpected parent.
Restore the affected muxes to CLK26M and disable previously enabled
clocks on error before propagating the original error.
Fixes: 55b423d5623c ("ASoC: mediatek: mt8186: support audio clock control in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903051150.178057-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 50 ++++++++++++++++------
1 file changed, 38 insertions(+), 12 deletions(-)
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
index 70ec101890d36..dddb3ec55248e 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
@@ -98,7 +98,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1], ret);
- return ret;
+ goto ERR_ENABLE_CLK_TOP_MUX_AUD_1;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1],
afe_priv->clk[CLK_TOP_APLL1_CK]);
@@ -106,7 +106,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1],
aud_clks[CLK_TOP_APLL1_CK], ret);
- return ret;
+ goto ERR_SELECT_CLK_TOP_MUX_AUD_1;
}
/* 180.6336 / 8 = 22.5792MHz */
@@ -114,7 +114,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1], ret);
- return ret;
+ goto ERR_ENABLE_CLK_TOP_MUX_AUD_ENG1;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1],
afe_priv->clk[CLK_TOP_APLL1_D8]);
@@ -122,7 +122,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
aud_clks[CLK_TOP_APLL1_D8], ret);
- return ret;
+ goto ERR_SELECT_CLK_TOP_MUX_AUD_ENG1;
}
} else {
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1],
@@ -131,7 +131,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
aud_clks[CLK_CLK26M], ret);
- return ret;
+ goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
@@ -141,12 +141,25 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1],
aud_clks[CLK_CLK26M], ret);
- return ret;
+ goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
}
return 0;
+
+ERR_SELECT_CLK_TOP_MUX_AUD_ENG1:
+ clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1],
+ afe_priv->clk[CLK_CLK26M]);
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
+ERR_ENABLE_CLK_TOP_MUX_AUD_ENG1:
+ERR_SELECT_CLK_TOP_MUX_AUD_1:
+ clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1],
+ afe_priv->clk[CLK_CLK26M]);
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
+ERR_ENABLE_CLK_TOP_MUX_AUD_1:
+EXIT:
+ return ret;
}
static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
@@ -159,7 +172,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2], ret);
- return ret;
+ goto ERR_ENABLE_CLK_TOP_MUX_AUD_2;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2],
afe_priv->clk[CLK_TOP_APLL2_CK]);
@@ -167,7 +180,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2],
aud_clks[CLK_TOP_APLL2_CK], ret);
- return ret;
+ goto ERR_SELECT_CLK_TOP_MUX_AUD_2;
}
/* 196.608 / 8 = 24.576MHz */
@@ -175,7 +188,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2], ret);
- return ret;
+ goto ERR_ENABLE_CLK_TOP_MUX_AUD_ENG2;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2],
afe_priv->clk[CLK_TOP_APLL2_D8]);
@@ -183,7 +196,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2],
aud_clks[CLK_TOP_APLL2_D8], ret);
- return ret;
+ goto ERR_SELECT_CLK_TOP_MUX_AUD_ENG2;
}
} else {
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2],
@@ -192,7 +205,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2],
aud_clks[CLK_CLK26M], ret);
- return ret;
+ goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]);
@@ -202,12 +215,25 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2],
aud_clks[CLK_CLK26M], ret);
- return ret;
+ goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
}
return 0;
+
+ERR_SELECT_CLK_TOP_MUX_AUD_ENG2:
+ clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2],
+ afe_priv->clk[CLK_CLK26M]);
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]);
+ERR_ENABLE_CLK_TOP_MUX_AUD_ENG2:
+ERR_SELECT_CLK_TOP_MUX_AUD_2:
+ clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2],
+ afe_priv->clk[CLK_CLK26M]);
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
+ERR_ENABLE_CLK_TOP_MUX_AUD_2:
+EXIT:
+ return ret;
}
int mt8186_afe_enable_cgs(struct mtk_base_afe *afe)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0259/1756] ASoC: mediatek: mt8186: Fix clock handling in mux disable path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (257 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0258/1756] ASoC: mediatek: mt8186: Fix APLL mux setting error handling Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0260/1756] ASoC: mediatek: mt8186: Fix AFE clock error handling Greg Kroah-Hartman
` (739 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit d70109f5510b423e72894dadfbab27087a7b26b0 ]
In the disable path of the appl*_mux_setting() functions,
clk_disable_unprepare() is called after clk_set_parent().
If clk_set_parent() fails, clk_disable_unprepare() is skipped,
potentially leaving one of the clocks enabled.
Remove the goto exit paths so that all teardown steps are attempted
and any errors are only reported.
Fixes: 55b423d5623c ("ASoC: mediatek: mt8186: support audio clock control in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903051150.178057-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
index dddb3ec55248e..effc4193e63ea 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
@@ -131,7 +131,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
@@ -141,7 +140,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
}
@@ -158,7 +156,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
afe_priv->clk[CLK_CLK26M]);
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
ERR_ENABLE_CLK_TOP_MUX_AUD_1:
-EXIT:
return ret;
}
@@ -205,7 +202,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]);
@@ -215,7 +211,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
}
@@ -232,7 +227,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
afe_priv->clk[CLK_CLK26M]);
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
ERR_ENABLE_CLK_TOP_MUX_AUD_2:
-EXIT:
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0260/1756] ASoC: mediatek: mt8186: Fix AFE clock error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (258 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0259/1756] ASoC: mediatek: mt8186: Fix clock handling in mux disable path Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0261/1756] ASoC: mediatek: mt8186: Fix APLL enable " Greg Kroah-Hartman
` (738 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit eb72060a1966baf9a6ed753186621ee6e39dc889 ]
The error paths in mt8186_afe_enable_clock() do not consistently
undo the clock operations performed before an error.
Fix the goto targets and cleanup order so that the audio internal
bus parent is restored to CLK26M and all previously enabled clocks
are disabled before returning the error.
Fixes: 55b423d5623c ("ASoC: mediatek: mt8186: support audio clock control in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903051150.178057-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
index effc4193e63ea..13781d5ca5444 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
@@ -288,7 +288,7 @@ int mt8186_afe_enable_clock(struct mtk_base_afe *afe)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIO],
aud_clks[CLK_CLK26M], ret);
- goto clk_mux_audio_err;
+ goto clk_mux_audio_intbus_err;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]);
@@ -315,24 +315,22 @@ int mt8186_afe_enable_clock(struct mtk_base_afe *afe)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_AFE], ret);
- goto clk_afe_err;
+ goto clk_mux_audio_h_parent_err;
}
return 0;
-clk_afe_err:
- clk_disable_unprepare(afe_priv->clk[CLK_AFE]);
clk_mux_audio_h_parent_err:
-clk_mux_audio_intbus_parent_err:
mt8186_set_audio_int_bus_parent(afe, CLK_CLK26M);
-clk_mux_audio_intbus_err:
+clk_mux_audio_intbus_parent_err:
clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]);
-clk_mux_audio_err:
+clk_mux_audio_intbus_err:
clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIO]);
-clk_infra_sys_audio_err:
- clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]);
-clk_infra_audio_26m_err:
+clk_mux_audio_err:
clk_disable_unprepare(afe_priv->clk[CLK_INFRA_AUDIO_26M]);
+clk_infra_audio_26m_err:
+ clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]);
+clk_infra_sys_audio_err:
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0261/1756] ASoC: mediatek: mt8186: Fix APLL enable error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (259 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0260/1756] ASoC: mediatek: mt8186: Fix AFE clock error handling Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0262/1756] ASoC: mediatek: mt8186: Fix MCK " Greg Kroah-Hartman
` (737 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit cb552c6b9abe02f254d44d8c29d0dce1ae21f69f ]
Currently, the mt8186_apll*_enable() functions call mux_setting(afe, true)
but do not check its return value to handle failures.
In addition, the cleanup paths of mt8186_apll*_enable() do not call
mux_setting(afe, false) when the enable operation fails, while the
mt8186_apll*_disable() functions do.
Add error handling for apll*_mux_setting() and call mux_setting(afe, false)
in the cleanup paths when mt8186_apll*_enable() fails.
Fixes: 55b423d5623c ("ASoC: mediatek: mt8186: support audio clock control in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903051150.178057-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
index 13781d5ca5444..a54fff16ffa4d 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
@@ -408,7 +408,9 @@ int mt8186_apll1_enable(struct mtk_base_afe *afe)
int ret;
/* setting for APLL */
- apll1_mux_setting(afe, true);
+ ret = apll1_mux_setting(afe, true);
+ if (ret)
+ return ret;
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]);
if (ret) {
@@ -433,9 +435,9 @@ int mt8186_apll1_enable(struct mtk_base_afe *afe)
return 0;
err_clk_apll1_tuner:
- clk_disable_unprepare(afe_priv->clk[CLK_APLL1_TUNER]);
-err_clk_apll22m:
clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]);
+err_clk_apll22m:
+ apll1_mux_setting(afe, false);
return ret;
}
@@ -461,7 +463,9 @@ int mt8186_apll2_enable(struct mtk_base_afe *afe)
int ret;
/* setting for APLL */
- apll2_mux_setting(afe, true);
+ ret = apll2_mux_setting(afe, true);
+ if (ret)
+ return ret;
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]);
if (ret) {
@@ -486,9 +490,9 @@ int mt8186_apll2_enable(struct mtk_base_afe *afe)
return 0;
err_clk_apll2_tuner:
- clk_disable_unprepare(afe_priv->clk[CLK_APLL2_TUNER]);
-err_clk_apll24m:
clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]);
+err_clk_apll24m:
+ apll2_mux_setting(afe, false);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0262/1756] ASoC: mediatek: mt8186: Fix MCK error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (260 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0261/1756] ASoC: mediatek: mt8186: Fix APLL enable " Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0263/1756] ASoC: mediatek: mt6797: fix wrong unwind order and error code in enable_clock Greg Kroah-Hartman
` (736 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 996469c1092e8fa81fac98d819174ce56baff821 ]
The mt8186_mck_enable() function returns immediately when a clock
operation fails, leaving previously enabled clocks active.
Add error paths to disable previously enabled clocks before returning
the error.
Fixes: 55b423d5623c ("ASoC: mediatek: mt8186: support audio clock control in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903051150.178057-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
index a54fff16ffa4d..ead467d027c33 100644
--- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
+++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
@@ -575,7 +575,7 @@ int mt8186_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate)
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[m_sel_id], ret);
- return ret;
+ goto ERR_ENABLE_MCLK;
}
ret = clk_set_parent(afe_priv->clk[m_sel_id],
afe_priv->clk[apll_clk_id]);
@@ -583,7 +583,7 @@ int mt8186_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate)
dev_err(afe->dev, "%s(), clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[m_sel_id],
aud_clks[apll_clk_id], ret);
- return ret;
+ goto ERR_SELECT_MCLK;
}
}
@@ -592,16 +592,25 @@ int mt8186_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate)
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[div_clk_id], ret);
- return ret;
+ goto ERR_ENABLE_MCLK_DIV;
}
ret = clk_set_rate(afe_priv->clk[div_clk_id], rate);
if (ret) {
dev_err(afe->dev, "%s(), clk_set_rate %s, rate %d, fail %d\n",
__func__, aud_clks[div_clk_id], rate, ret);
- return ret;
+ goto ERR_SET_MCLK_RATE;
}
return 0;
+
+ERR_SET_MCLK_RATE:
+ clk_disable_unprepare(afe_priv->clk[div_clk_id]);
+ERR_ENABLE_MCLK_DIV:
+ERR_SELECT_MCLK:
+ if (m_sel_id >= 0)
+ clk_disable_unprepare(afe_priv->clk[m_sel_id]);
+ERR_ENABLE_MCLK:
+ return ret;
}
void mt8186_mck_disable(struct mtk_base_afe *afe, int mck_id)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0263/1756] ASoC: mediatek: mt6797: fix wrong unwind order and error code in enable_clock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (261 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0262/1756] ASoC: mediatek: mt8186: Fix MCK " Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0264/1756] pwm: lp3943: fix NULL pointer dereference for an unconfigured channel Greg Kroah-Hartman
` (735 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cezary Rojewski, bui duc phuc,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit e967d479b65c778cd2394ab185e289beefcf996d ]
The error paths in mt6797_afe_enable_clock() use incorrect goto labels,
causing clocks that failed to enable to be disabled during cleanup.
Fix the goto labels to only unwind clocks that were successfully
enabled, and return the actual error code.
Fixes: c5e7fca928d3 ("ASoC: mt6797: add structure define and clock control function for 6797")
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260821122840.41266-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt6797/mt6797-afe-clk.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/sound/soc/mediatek/mt6797/mt6797-afe-clk.c b/sound/soc/mediatek/mt6797/mt6797-afe-clk.c
index 6f3e6acfcfab2..0ac04d73b7772 100644
--- a/sound/soc/mediatek/mt6797/mt6797-afe-clk.c
+++ b/sound/soc/mediatek/mt6797/mt6797-afe-clk.c
@@ -63,21 +63,21 @@ int mt6797_afe_enable_clock(struct mtk_base_afe *afe)
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_INFRA_SYS_AUD], ret);
- goto CLK_INFRA_SYS_AUDIO_ERR;
+ return ret;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_INFRA_SYS_AUD_26M]);
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_INFRA_SYS_AUD_26M], ret);
- goto CLK_INFRA_SYS_AUD_26M_ERR;
+ goto CLK_INFRA_SYS_AUDIO_ERR;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD]);
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD], ret);
- goto CLK_MUX_AUDIO_ERR;
+ goto CLK_INFRA_SYS_AUD_26M_ERR;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD],
@@ -93,13 +93,11 @@ int mt6797_afe_enable_clock(struct mtk_base_afe *afe)
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_BUS], ret);
- goto CLK_MUX_AUDIO_INTBUS_ERR;
+ goto CLK_MUX_AUDIO_ERR;
}
- return ret;
+ return 0;
-CLK_MUX_AUDIO_INTBUS_ERR:
- clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_BUS]);
CLK_MUX_AUDIO_ERR:
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD]);
CLK_INFRA_SYS_AUD_26M_ERR:
@@ -107,7 +105,7 @@ int mt6797_afe_enable_clock(struct mtk_base_afe *afe)
CLK_INFRA_SYS_AUDIO_ERR:
clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUD]);
- return 0;
+ return ret;
}
int mt6797_afe_disable_clock(struct mtk_base_afe *afe)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0264/1756] pwm: lp3943: fix NULL pointer dereference for an unconfigured channel
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (262 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0263/1756] ASoC: mediatek: mt6797: fix wrong unwind order and error code in enable_clock Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0265/1756] selftests/sched_ext: Handle CPU hotplug write failures Greg Kroah-Hartman
` (734 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko AI review, Manush Prajwal,
Uwe Kleine-König, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manush Prajwal <manushprajwal555@gmail.com>
[ Upstream commit 17dbb6938d3ab444cd6be1c95506450595a8800d ]
lp3943_pwm_probe() unconditionally registers a pwmchip with
LP3943_NUM_PWMS(2) hwpwm channels, but lp3943_pwm_parse_dt() only
populates pdata->pwms[i] for the channels whose ti,pwm0/ti,pwm1
property is actually present in the devicetree (the binding
explicitly allows each PWM generator to drive zero or more outputs,
and lp3943_pwm_parse_dt() only fails outright with -ENODATA if
*neither* property is present). A devicetree that configures only one
of the two channels leaves pdata->pwms[] NULL for the other.
lp3943_pwm_request_map() dereferences pdata->pwms[hwpwm] with no NULL
check:
pwm_map->output = pdata->pwms[hwpwm]->output;
pwm_map->num_outputs = pdata->pwms[hwpwm]->num_outputs;
so requesting the unconfigured channel (e.g. exporting it from
sysfs) crashes with a NULL pointer dereference instead of failing
cleanly.
Return -ENODEV from lp3943_pwm_request_map() when the channel was
never configured, before the pointer is dereferenced. The caller,
lp3943_pwm_request(), already propagates an ERR_PTR return correctly
(it does so today for the existing -EBUSY case).
Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/6a9d4c6b.79b5ea6e.147aa1.5883@mx.google.com?part=1
Signed-off-by: Manush Prajwal <manushprajwal555@gmail.com>
Link: https://patch.msgid.link/6a9d5187.d63de05c.175391.a17c@mx.google.com
Fixes: af66b3c0934e ("pwm: Add LP3943 PWM driver")
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pwm/pwm-lp3943.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pwm/pwm-lp3943.c b/drivers/pwm/pwm-lp3943.c
index 90b0733c00c1b..ad761daab4f44 100644
--- a/drivers/pwm/pwm-lp3943.c
+++ b/drivers/pwm/pwm-lp3943.c
@@ -38,6 +38,9 @@ lp3943_pwm_request_map(struct lp3943_pwm *lp3943_pwm, int hwpwm)
struct lp3943_pwm_map *pwm_map = &lp3943_pwm->pwm_map[hwpwm];
int i, offset;
+ if (!pdata->pwms[hwpwm])
+ return ERR_PTR(-ENODEV);
+
pwm_map->output = pdata->pwms[hwpwm]->output;
pwm_map->num_outputs = pdata->pwms[hwpwm]->num_outputs;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0265/1756] selftests/sched_ext: Handle CPU hotplug write failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (263 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0264/1756] pwm: lp3943: fix NULL pointer dereference for an unconfigured channel Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0266/1756] EDAC/i10nm: Fix Granite Rapids ADXL MC mapping Greg Kroah-Hartman
` (733 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tianyi Chen, Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianyi Chen <hi@tychen.cc>
[ Upstream commit 49c64ffb2fd996af4c82007196c61e17d74cb1ab ]
toggle_online_status() logs failed CPU state changes but discards the
write result. The hotplug tests can consequently wait indefinitely for
a scheduler exit that the failed operation never triggered.
Return the write result and stop both hotplug tests when a required
CPU state change fails. Release the acquired scheduler resources on
these paths and let the existing cleanup callback retry restoring
CPU1. Also fail the test when its normal CPU restoration fails.
Tested in a two-vCPU VM running a kernel built from the same source
as the selftests. Injecting EIO with strace into each of the ten CPU
state writes makes the fixed test return 1, with CPU1 online and
sched_ext disabled after cleanup. The original test does not finish
within three seconds when either of the first two writes fails.
Normal hotplug tests pass before and after the change. Making the
online file read-only also produces a failure without hanging.
Fixes: a5db7817af78 ("sched_ext: Add selftests")
Assisted-by: LLM
Signed-off-by: Tianyi Chen <hi@tychen.cc>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/sched_ext/hotplug.c | 34 ++++++++++++++-------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/tools/testing/selftests/sched_ext/hotplug.c b/tools/testing/selftests/sched_ext/hotplug.c
index 87bf220b1bcee..461604e8cf5ea 100644
--- a/tools/testing/selftests/sched_ext/hotplug.c
+++ b/tools/testing/selftests/sched_ext/hotplug.c
@@ -22,15 +22,17 @@ static bool is_cpu_online(void)
return file_read_long(online_path) > 0;
}
-static void toggle_online_status(bool online)
+static int toggle_online_status(bool online)
{
long val = online ? 1 : 0;
int ret;
ret = file_write_long(online_path, val);
if (ret != 0)
- fprintf(stderr, "Failed to bring CPU %s (%s)",
+ fprintf(stderr, "Failed to bring CPU %s (%s)\n",
online ? "online" : "offline", strerror(errno));
+
+ return ret;
}
static enum scx_test_status setup(void **ctx)
@@ -45,6 +47,7 @@ static enum scx_test_status test_hotplug(bool onlining, bool cbs_defined)
{
struct hotplug *skel;
struct bpf_link *link;
+ enum scx_test_status status = SCX_TEST_FAIL;
long kind, code;
SCX_ASSERT(is_cpu_online());
@@ -53,8 +56,8 @@ static enum scx_test_status test_hotplug(bool onlining, bool cbs_defined)
SCX_ASSERT(skel);
/* Testing the offline -> online path, so go offline before starting */
- if (onlining)
- toggle_online_status(0);
+ if (onlining && toggle_online_status(0))
+ goto out_destroy_skel;
if (cbs_defined) {
kind = SCX_KIND_VAL(SCX_EXIT_UNREG_BPF);
@@ -78,7 +81,8 @@ static enum scx_test_status test_hotplug(bool onlining, bool cbs_defined)
return SCX_TEST_FAIL;
}
- toggle_online_status(onlining ? 1 : 0);
+ if (toggle_online_status(onlining ? 1 : 0))
+ goto out_destroy_link;
while (!UEI_EXITED(skel, uei))
sched_yield();
@@ -86,20 +90,23 @@ static enum scx_test_status test_hotplug(bool onlining, bool cbs_defined)
SCX_EQ(skel->data->uei.kind, kind);
SCX_EQ(UEI_REPORT(skel, uei), code);
- if (!onlining)
- toggle_online_status(1);
+ if (!onlining && toggle_online_status(1))
+ goto out_destroy_link;
+ status = SCX_TEST_PASS;
+out_destroy_link:
bpf_link__destroy(link);
+out_destroy_skel:
hotplug__destroy(skel);
- return SCX_TEST_PASS;
+ return status;
}
static enum scx_test_status test_hotplug_attach(void)
{
struct hotplug *skel;
struct bpf_link *link;
- enum scx_test_status status = SCX_TEST_PASS;
+ enum scx_test_status status = SCX_TEST_FAIL;
long kind, code;
SCX_ASSERT(is_cpu_online());
@@ -114,10 +121,12 @@ static enum scx_test_status test_hotplug_attach(void)
* Take the CPU offline to increment the global hotplug seq, which
* should cause attach to fail due to us setting the hotplug seq above
*/
- toggle_online_status(0);
+ if (toggle_online_status(0))
+ goto out_destroy_skel;
link = bpf_map__attach_struct_ops(skel->maps.hotplug_nocb_ops);
- toggle_online_status(1);
+ if (toggle_online_status(1))
+ goto out_destroy_link;
SCX_ASSERT(link);
while (!UEI_EXITED(skel, uei))
@@ -129,7 +138,10 @@ static enum scx_test_status test_hotplug_attach(void)
SCX_EQ(skel->data->uei.kind, kind);
SCX_EQ(UEI_REPORT(skel, uei), code);
+ status = SCX_TEST_PASS;
+out_destroy_link:
bpf_link__destroy(link);
+out_destroy_skel:
hotplug__destroy(skel);
return status;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0266/1756] EDAC/i10nm: Fix Granite Rapids ADXL MC mapping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (264 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0265/1756] selftests/sched_ext: Handle CPU hotplug write failures Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0267/1756] perf btf: Make the sigtrap test helper to find a member by name widely available Greg Kroah-Hartman
` (732 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yanhua Wu, Qiuxu Zhuo, Tony Luck,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
[ Upstream commit ba71d9b4e9dd83c1614b3b5cec6c82a39d290f7e ]
ADXL reports memory errors using memory-controller physical indices,
while the EDAC driver identifies memory controllers using logical
indices. On Granite Rapids systems, BIOS may disable some memory
controllers, causing the physical and logical indices to differ.
As a result, ADXL memory errors may be associated with the wrong memory
controller, preventing EDAC from reporting errors for some DIMMs.
Maintain a physical-to-logical MC mapping so that ADXL memory errors are
decoded correctly regardless of the BIOS memory-controller
configuration.
Fixes: ba987eaaabf9 ("EDAC/i10nm: Add Intel Granite Rapids server support")
Reported-by: Yanhua Wu <yanhua1.wu@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://patch.msgid.link/20260819025259.266201-1-qiuxu.zhuo@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/edac/i10nm_base.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/edac/i10nm_base.c b/drivers/edac/i10nm_base.c
index 6697df5b4af55..6c4cab5f372a9 100644
--- a/drivers/edac/i10nm_base.c
+++ b/drivers/edac/i10nm_base.c
@@ -594,6 +594,7 @@ static struct pci_dev *get_gnr_mdev(struct skx_dev *d, int logical_idx, int *phy
if (mdev) {
if (logical == logical_idx) {
*physical_idx = i;
+ skx_set_mc_mapping(d, i, logical_idx);
return mdev;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0267/1756] perf btf: Make the sigtrap test helper to find a member by name widely available
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (265 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0266/1756] EDAC/i10nm: Fix Granite Rapids ADXL MC mapping Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0268/1756] perf bpf: Fix up build failure due to change of btf_vlen() return type Greg Kroah-Hartman
` (731 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Ian Rogers,
James Clark, Jiri Olsa, Kan Liang, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit dcf900429d1e7c9b528e3e4682d0255003ab7be3 ]
By introducing a tools/perf/util/btf.c to collect utilities not yet
available via libbpf, the first being a way to find a member by name
once we get the type_id for the struct.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 024b219744a9 ("perf trace: Add upper bound checks for augmented BTF struct printing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/sigtrap.c | 20 +++-----------------
tools/perf/util/Build | 1 +
tools/perf/util/btf.c | 27 +++++++++++++++++++++++++++
tools/perf/util/btf.h | 10 ++++++++++
4 files changed, 41 insertions(+), 17 deletions(-)
create mode 100644 tools/perf/util/btf.c
create mode 100644 tools/perf/util/btf.h
diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c
index e6fd934b027a3..a67c756f90b8d 100644
--- a/tools/perf/tests/sigtrap.c
+++ b/tools/perf/tests/sigtrap.c
@@ -56,6 +56,7 @@ static struct perf_event_attr make_event_attr(void)
#ifdef HAVE_BPF_SKEL
#include <bpf/btf.h>
+#include <util/btf.h>
static struct btf *btf;
@@ -73,21 +74,6 @@ static void btf__exit(void)
btf = NULL;
}
-static const struct btf_member *__btf_type__find_member_by_name(int type_id, const char *member_name)
-{
- const struct btf_type *t = btf__type_by_id(btf, type_id);
- const struct btf_member *m;
- int i;
-
- for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
- const char *current_member_name = btf__name_by_offset(btf, m->name_off);
- if (!strcmp(current_member_name, member_name))
- return m;
- }
-
- return NULL;
-}
-
static bool attr_has_sigtrap(void)
{
int id;
@@ -101,7 +87,7 @@ static bool attr_has_sigtrap(void)
if (id < 0)
return false;
- return __btf_type__find_member_by_name(id, "sigtrap") != NULL;
+ return __btf_type__find_member_by_name(btf, id, "sigtrap") != NULL;
}
static bool kernel_with_sleepable_spinlocks(void)
@@ -119,7 +105,7 @@ static bool kernel_with_sleepable_spinlocks(void)
return false;
// Only RT has a "lock" member for "struct spinlock"
- member = __btf_type__find_member_by_name(id, "lock");
+ member = __btf_type__find_member_by_name(btf, id, "lock");
if (member == NULL)
return false;
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 5cc89ec8584bc..7659db6039367 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -167,6 +167,7 @@ perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-flex.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-bison.o
+perf-util-$(CONFIG_PERF_BPF_SKEL) += btf.o
ifeq ($(CONFIG_LIBTRACEEVENT),y)
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.o
diff --git a/tools/perf/util/btf.c b/tools/perf/util/btf.c
new file mode 100644
index 0000000000000..bb163fe87767c
--- /dev/null
+++ b/tools/perf/util/btf.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Arnaldo Carvalho de Melo <acme@redhat.com>
+ *
+ * Copyright (C) 2024, Red Hat, Inc
+ */
+
+#include <bpf/btf.h>
+#include <util/btf.h>
+#include <string.h>
+
+const struct btf_member *__btf_type__find_member_by_name(struct btf *btf,
+ int type_id, const char *member_name)
+{
+ const struct btf_type *t = btf__type_by_id(btf, type_id);
+ const struct btf_member *m;
+ int i;
+
+ for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
+ const char *current_member_name = btf__name_by_offset(btf, m->name_off);
+
+ if (!strcmp(current_member_name, member_name))
+ return m;
+ }
+
+ return NULL;
+}
diff --git a/tools/perf/util/btf.h b/tools/perf/util/btf.h
new file mode 100644
index 0000000000000..05e6e5bf23d62
--- /dev/null
+++ b/tools/perf/util/btf.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PERF_UTIL_BTF
+#define __PERF_UTIL_BTF 1
+
+struct btf;
+struct btf_member;
+
+const struct btf_member *__btf_type__find_member_by_name(struct btf *btf,
+ int type_id, const char *member_name);
+#endif // __PERF_UTIL_BTF
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0268/1756] perf bpf: Fix up build failure due to change of btf_vlen() return type
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (266 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0267/1756] perf btf: Make the sigtrap test helper to find a member by name widely available Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0269/1756] perf trace: Enhance BTF type formatting to symbolise kernel function pointers Greg Kroah-Hartman
` (730 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alan Maguire, Mark Brown,
Alexei Starovoitov, Linus Torvalds, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <broonie@kernel.org>
[ Upstream commit 3287a1881ca528b89b964d9fa6d28880d277d9e2 ]
Fix:
util/btf.c: In function '__btf_type__find_member_by_name':
util/btf.c:19:43: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
19 | for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
| ^
builtin-trace.c: In function 'syscall_arg__strtoul_btf_enum':
builtin-trace.c:967:27: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
967 | for (int i = 0; i < btf_vlen(bt); ++i, ++be) {
| ^
by making the variable the same type as the function.
Committer note:
Add an extra hunk from Alan Maguire, fixing btf_enum_scnprintf().
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 024b219744a9 ("perf trace: Add upper bound checks for augmented BTF struct printing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-trace.c | 6 +++---
tools/perf/util/btf.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 385686a93ab8f..f0d7d9b53f9b2 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -951,7 +951,7 @@ static bool syscall_arg__strtoul_btf_enum(char *bf, size_t size, struct syscall_
struct btf *btf = arg->trace->btf;
struct btf_enum *be = btf_enum(bt);
- for (int i = 0; i < btf_vlen(bt); ++i, ++be) {
+ for (u32 i = 0; i < btf_vlen(bt); ++i, ++be) {
const char *name = btf__name_by_offset(btf, be->name_off);
int max_len = max(size, strlen(name));
@@ -996,9 +996,9 @@ static bool syscall_arg__strtoul_btf_type(char *bf, size_t size, struct syscall_
static size_t btf_enum_scnprintf(const struct btf_type *type, struct btf *btf, char *bf, size_t size, int val)
{
struct btf_enum *be = btf_enum(type);
- const int nr_entries = btf_vlen(type);
+ const unsigned int nr_entries = btf_vlen(type);
- for (int i = 0; i < nr_entries; ++i, ++be) {
+ for (unsigned int i = 0; i < nr_entries; ++i, ++be) {
if (be->val == val) {
return scnprintf(bf, size, "%s",
btf__name_by_offset(btf, be->name_off));
diff --git a/tools/perf/util/btf.c b/tools/perf/util/btf.c
index bb163fe87767c..50d98f3e83bf0 100644
--- a/tools/perf/util/btf.c
+++ b/tools/perf/util/btf.c
@@ -14,7 +14,7 @@ const struct btf_member *__btf_type__find_member_by_name(struct btf *btf,
{
const struct btf_type *t = btf__type_by_id(btf, type_id);
const struct btf_member *m;
- int i;
+ u32 i;
for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
const char *current_member_name = btf__name_by_offset(btf, m->name_off);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0269/1756] perf trace: Enhance BTF type formatting to symbolise kernel function pointers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (267 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0268/1756] perf bpf: Fix up build failure due to change of btf_vlen() return type Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0270/1756] perf trace: Add upper bound checks for augmented BTF struct printing Greg Kroah-Hartman
` (729 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaron Tomlin, Ian Rogers,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Tomlin <atomlin@atomlin.com>
[ Upstream commit c6dd6161815d0c10ed24ad13fdad847bec63d961 ]
When BTF (BPF Type Format) metadata is loaded from vmlinux, 'perf trace'
can inspect the precise C types of tracepoint and system call parameters.
However, function pointer arguments are currently not recognised during
BTF pretty-printing and default to hexadecimal output.
Introduce btf_is_func_ptr() to inspect BTF type hierarchies
(i.e., traversing pointers, typedefs, and type modifiers) to determine
whether a parameter resolves to a function prototype
(BTF_KIND_FUNC_PROTO).
Generalise BTF type caching via syscall_arg_fmt__cache_btf_type() to
handle structs, unions, enums, and function pointers alike. When a field
is identified as a kernel function pointer, trace__btf_scnprintf()
routes its value to syscall_arg__scnprintf_ksym(), enabling automatic
zero-config symbolisation of kernel function pointers whenever BTF is
available.
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 024b219744a9 ("perf trace: Add upper bound checks for augmented BTF struct printing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-trace.c | 106 +++++++++++++++++++++++++++++--------
1 file changed, 85 insertions(+), 21 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f0d7d9b53f9b2..d701836f62819 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -122,6 +122,7 @@ struct syscall_arg_fmt {
#ifdef HAVE_LIBBPF_SUPPORT
const struct btf_type *type;
int type_id; /* used in btf_dump */
+ bool btf_type_cached;
#endif
};
@@ -928,21 +929,68 @@ static size_t syscall_arg__scnprintf_getrandom_flags(char *bf, size_t size,
#define SCA_GETRANDOM_FLAGS syscall_arg__scnprintf_getrandom_flags
#ifdef HAVE_LIBBPF_SUPPORT
-static void syscall_arg_fmt__cache_btf_enum(struct syscall_arg_fmt *arg_fmt, struct btf *btf, char *type)
+static bool btf_is_func_ptr(const struct btf *btf, const struct btf_type *type)
{
+ int nr_ptrs = 0;
+
+ while (type) {
+ if (btf_is_ptr(type)) {
+ if (++nr_ptrs > 1)
+ return false;
+ type = btf__type_by_id(btf, type->type);
+ } else if (btf_is_typedef(type) || btf_is_mod(type)) {
+ type = btf__type_by_id(btf, type->type);
+ } else {
+ break;
+ }
+ }
+ return nr_ptrs == 1 && type && btf_is_func_proto(type);
+}
+
+static void syscall_arg_fmt__cache_btf_type(struct syscall_arg_fmt *arg_fmt,
+ struct btf *btf, const char *type)
+{
+ char name[128];
+ const char *pos;
+ size_t len = 0;
int id;
- type = strstr(type, "enum ");
+ arg_fmt->btf_type_cached = true;
+
if (type == NULL)
return;
- type += 5; // skip "enum " to get the enumeration name
+ /* Pointers to enums are memory addresses, not scalar enums */
+ if (strstr(type, "enum ") && strchr(type, '*'))
+ return;
+
+ if ((pos = strstr(type, "enum ")) != NULL)
+ pos += 5;
+ else if ((pos = strstr(type, "struct ")) != NULL)
+ pos += 7;
+ else if ((pos = strstr(type, "union ")) != NULL)
+ pos += 6;
+ else
+ pos = type;
+
+ while (isspace(*pos))
+ pos++;
+
+ while ((isalnum(pos[len]) || pos[len] == '_') && len < sizeof(name) - 1) {
+ name[len] = pos[len];
+ len++;
+ }
+ name[len] = '\0';
+
+ if (len == 0)
+ return;
- id = btf__find_by_name(btf, type);
+ id = btf__find_by_name(btf, name);
if (id < 0)
return;
arg_fmt->type = btf__type_by_id(btf, id);
+ arg_fmt->type_id = id;
}
static bool syscall_arg__strtoul_btf_enum(char *bf, size_t size, struct syscall_arg *arg, u64 *val)
@@ -976,10 +1024,8 @@ static bool syscall_arg__strtoul_btf_type(char *bf, size_t size, struct syscall_
if (btf == NULL)
return false;
- if (arg->fmt->type == NULL) {
- // See if this is an enum
- syscall_arg_fmt__cache_btf_enum(arg->fmt, btf, type);
- }
+ if (!arg->fmt->btf_type_cached)
+ syscall_arg_fmt__cache_btf_type(arg->fmt, btf, type);
// Now let's see if we have a BTF type resolved
bt = arg->fmt->type;
@@ -987,19 +1033,22 @@ static bool syscall_arg__strtoul_btf_type(char *bf, size_t size, struct syscall_
return false;
// If it is an enum:
- if (btf_is_enum(arg->fmt->type))
+ if (btf_is_enum(arg->fmt->type)) {
+ if (type && strchr(type, '*'))
+ return false;
return syscall_arg__strtoul_btf_enum(bf, size, arg, val);
+ }
return false;
}
-static size_t btf_enum_scnprintf(const struct btf_type *type, struct btf *btf, char *bf, size_t size, int val)
+static size_t btf_enum_scnprintf(const struct btf_type *type, struct btf *btf, char *bf, size_t size, unsigned long val)
{
struct btf_enum *be = btf_enum(type);
const unsigned int nr_entries = btf_vlen(type);
for (unsigned int i = 0; i < nr_entries; ++i, ++be) {
- if (be->val == val) {
+ if ((unsigned long)(__u32)be->val == val || (unsigned long)be->val == val) {
return scnprintf(bf, size, "%s",
btf__name_by_offset(btf, be->name_off));
}
@@ -1026,14 +1075,19 @@ static size_t btf_struct_scnprintf(const struct btf_type *type, struct btf *btf,
.bf = bf,
.size = size,
};
- struct augmented_arg *augmented_arg = arg->augmented.args;
+ struct augmented_arg *augmented_arg;
int type_id = arg->fmt->type_id, consumed;
struct btf_dump *btf_dump;
LIBBPF_OPTS(btf_dump_opts, dump_opts);
LIBBPF_OPTS(btf_dump_type_data_opts, dump_data_opts);
- if (arg == NULL || arg->augmented.args == NULL)
+ if (arg == NULL || arg->augmented.args == NULL || arg->augmented.size <= 0 ||
+ arg->fmt == NULL || !arg->fmt->from_user)
+ return 0;
+
+ augmented_arg = arg->augmented.args;
+ if (augmented_arg->size <= 0)
return 0;
dump_data_opts.compact = true;
@@ -1044,8 +1098,10 @@ static size_t btf_struct_scnprintf(const struct btf_type *type, struct btf *btf,
return 0;
/* pretty print the struct data here */
- if (btf_dump__dump_type_data(btf_dump, type_id, arg->augmented.args->value, type->size, &dump_data_opts) <= 0)
+ if (btf_dump__dump_type_data(btf_dump, type_id, arg->augmented.args->value, type->size, &dump_data_opts) <= 0) {
+ btf_dump__free(btf_dump);
return 0;
+ }
consumed = sizeof(*augmented_arg) + augmented_arg->size;
arg->augmented.args = ((void *)arg->augmented.args) + consumed;
@@ -1057,33 +1113,40 @@ static size_t btf_struct_scnprintf(const struct btf_type *type, struct btf *btf,
}
static size_t trace__btf_scnprintf(struct trace *trace, struct syscall_arg *arg, char *bf,
- size_t size, int val, char *type)
+ size_t size, unsigned long val, char *type)
{
struct syscall_arg_fmt *arg_fmt = arg->fmt;
if (trace->btf == NULL)
return 0;
- if (arg_fmt->type == NULL) {
- // Check if this is an enum and if we have the BTF type for it.
- syscall_arg_fmt__cache_btf_enum(arg_fmt, trace->btf, type);
- }
+ if (!arg_fmt->btf_type_cached)
+ syscall_arg_fmt__cache_btf_type(arg_fmt, trace->btf, type);
// Did we manage to find a BTF type for the syscall/tracepoint argument?
if (arg_fmt->type == NULL)
return 0;
+ if (type && strchr(type, '*')) {
+ if (btf_is_enum(arg_fmt->type) || btf_is_func_ptr(trace->btf, arg_fmt->type))
+ return 0;
+ }
+
if (btf_is_enum(arg_fmt->type))
return btf_enum_scnprintf(arg_fmt->type, trace->btf, bf, size, val);
else if (btf_is_struct(arg_fmt->type) || btf_is_union(arg_fmt->type))
return btf_struct_scnprintf(arg_fmt->type, trace->btf, bf, size, arg);
+ else if (btf_is_func_ptr(trace->btf, arg_fmt->type)) {
+ arg->val = val;
+ return syscall_arg__scnprintf_ksym(bf, size, arg);
+ }
return 0;
}
#else // HAVE_LIBBPF_SUPPORT
static size_t trace__btf_scnprintf(struct trace *trace __maybe_unused, struct syscall_arg *arg __maybe_unused,
- char *bf __maybe_unused, size_t size __maybe_unused, int val __maybe_unused,
+ char *bf __maybe_unused, size_t size __maybe_unused, unsigned long val __maybe_unused,
char *type __maybe_unused)
{
return 0;
@@ -2377,7 +2440,8 @@ static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size,
default_scnprintf = sc->arg_fmt[arg.idx].scnprintf;
- if (trace->force_btf || default_scnprintf == NULL || default_scnprintf == SCA_PTR) {
+ if (trace->force_btf || default_scnprintf == NULL ||
+ default_scnprintf == SCA_PTR || default_scnprintf == SCA_KSYM) {
btf_printed = trace__btf_scnprintf(trace, &arg, bf + printed,
size - printed, val, field->type);
if (btf_printed) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0270/1756] perf trace: Add upper bound checks for augmented BTF struct printing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (268 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0269/1756] perf trace: Enhance BTF type formatting to symbolise kernel function pointers Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0271/1756] mtd: spinand: Fix spinand_manufacturer_ops kernel-doc Greg Kroah-Hartman
` (728 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Aaron Tomlin,
Howard Chu, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Tomlin <atomlin@atomlin.com>
[ Upstream commit 024b219744a949419b3c9e8aa23031c04428d9d6 ]
When pretty-printing augmented struct payloads using BTF via
btf_struct_scnprintf(), augmented_arg->size is currently only validated
against values <= 0.
However, several edge cases can result in size mismatches or buffer
over-reads:
1. If arg->augmented.size is smaller than sizeof(*augmented_arg),
dereferencing augmented_arg->size reads past the available
buffer.
2. If augmented_arg->size exceeds arg->augmented.size -
sizeof(*augmented_arg), calculating consumed =
sizeof(*augmented_arg) + augmented_arg->size can overflow signed
integer limits (e.g., with crafted INT_MAX values in an
untrusted perf.data file) or cause arg->augmented.size to
underflow. This advances arg->augmented.args out of bounds,
corrupting the parsing state for subsequent arguments in
multi-argument syscalls.
3. If the captured payload is truncated (e.g., short reads in BPF,
or during cross-architecture analysis such as replaying a 32-bit
perf.data on a 64-bit host where host BTF type->size exceeds the
32-bit target payload), passing type->size to
btf_dump__dump_type_data() causes libbpf to read past the end of
the payload buffer.
Enforce an upper bound on augmented_arg->size against the remaining
buffer (arg->augmented.size - sizeof(*augmented_arg)) and verify that the
captured payload contains at least type->size bytes before passing it to
btf_dump__dump_type_data().
Fixes: cb32035214b9a09d ("perf trace: Pretty print struct data")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Cc: Howard Chu <howardchu95@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-trace.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d701836f62819..d3bd36e12080b 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1082,12 +1082,13 @@ static size_t btf_struct_scnprintf(const struct btf_type *type, struct btf *btf,
LIBBPF_OPTS(btf_dump_opts, dump_opts);
LIBBPF_OPTS(btf_dump_type_data_opts, dump_data_opts);
- if (arg == NULL || arg->augmented.args == NULL || arg->augmented.size <= 0 ||
+ if (arg == NULL || arg->augmented.args == NULL || arg->augmented.size < (int)sizeof(*augmented_arg) ||
arg->fmt == NULL || !arg->fmt->from_user)
return 0;
augmented_arg = arg->augmented.args;
- if (augmented_arg->size <= 0)
+ if (augmented_arg->size <= 0 || augmented_arg->size > arg->augmented.size - (int)sizeof(*augmented_arg) ||
+ (size_t)augmented_arg->size < type->size)
return 0;
dump_data_opts.compact = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0271/1756] mtd: spinand: Fix spinand_manufacturer_ops kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (269 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0270/1756] perf trace: Add upper bound checks for augmented BTF struct printing Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0272/1756] dmaengine: sun6i-dma: Fix use-after-free in error handling paths Greg Kroah-Hartman
` (727 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Miquel Raynal,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 7e874b1750a40f3dc9a629aeb72eba09c77f77e9 ]
The kernel-doc heading for struct spinand_manufacturer_ops misspells
and truncates its name as manufacurer_ops. As a result, kernel-doc cannot
match the comment to the structure declaration.
Use the structure's actual name.
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/mtd/spinand.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 4bf33cefbae5f..66f8d52522350 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -230,7 +230,7 @@ struct spinand_devid {
};
/**
- * struct manufacurer_ops - SPI NAND manufacturer specific operations
+ * struct spinand_manufacturer_ops - SPI NAND manufacturer specific operations
* @init: initialize a SPI NAND device
* @cleanup: cleanup a SPI NAND device
*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0272/1756] dmaengine: sun6i-dma: Fix use-after-free in error handling paths
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (270 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0271/1756] mtd: spinand: Fix spinand_manufacturer_ops kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:39 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0273/1756] dmaengine: at_hdmac: Fix use-after-free by proper tasklet cleanup Greg Kroah-Hartman
` (726 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongling Zeng, Jernej Skrabec,
Frank Li, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
[ Upstream commit f472919f4c0650d7fb22bb230eacaada0c6ee951 ]
In error handling paths, the for loop frees v_lli in the loop body,
then accesses v_lli->v_lli_next and v_lli->p_lli_next in the
increment expression, which is use-after-free.
Fix by refactoring the cleanup into a helper function sun6i_dma_free_desc()
that saves both the next virtual and physical pointers before freeing the
current node, preventing the use-after-free.
Fixes: 555859308723 ("dmaengine: sun6i: Add driver for the Allwinner A31 DMA controller")
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Suggested-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260727061142.44195-1-zenghongling@kylinos.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/sun6i-dma.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index a2085bf206b74..fed034f461b02 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -407,16 +407,12 @@ static inline void sun6i_dma_dump_lli(struct sun6i_vchan *vchan,
v_lli->len, v_lli->para, v_lli->p_lli_next);
}
-static void sun6i_dma_free_desc(struct virt_dma_desc *vd)
+static void sun6i_dma_free_desc(struct sun6i_dma_dev *sdev,
+ struct sun6i_desc *txd)
{
- struct sun6i_desc *txd = to_sun6i_desc(&vd->tx);
- struct sun6i_dma_dev *sdev = to_sun6i_dma_dev(vd->tx.chan->device);
struct sun6i_dma_lli *v_lli, *v_next;
dma_addr_t p_lli, p_next;
- if (unlikely(!txd))
- return;
-
p_lli = txd->p_lli;
v_lli = txd->v_lli;
@@ -433,6 +429,17 @@ static void sun6i_dma_free_desc(struct virt_dma_desc *vd)
kfree(txd);
}
+static void sun6i_dma_free_desc_virt(struct virt_dma_desc *vd)
+{
+ struct sun6i_desc *txd = to_sun6i_desc(&vd->tx);
+ struct sun6i_dma_dev *sdev = to_sun6i_dma_dev(vd->tx.chan->device);
+
+ if (unlikely(!txd))
+ return;
+
+ sun6i_dma_free_desc(sdev, txd);
+}
+
static int sun6i_dma_start_desc(struct sun6i_vchan *vchan)
{
struct sun6i_dma_dev *sdev = to_sun6i_dma_dev(vchan->vc.chan.device);
@@ -789,10 +796,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_slave_sg(
return vchan_tx_prep(&vchan->vc, &txd->vd, flags);
err_lli_free:
- for (p_lli = txd->p_lli, v_lli = txd->v_lli; v_lli;
- p_lli = v_lli->p_lli_next, v_lli = v_lli->v_lli_next)
- dma_pool_free(sdev->pool, v_lli, p_lli);
- kfree(txd);
+ sun6i_dma_free_desc(sdev, txd);
return NULL;
}
@@ -860,10 +864,7 @@ static struct dma_async_tx_descriptor *sun6i_dma_prep_dma_cyclic(
return vchan_tx_prep(&vchan->vc, &txd->vd, flags);
err_lli_free:
- for (p_lli = txd->p_lli, v_lli = txd->v_lli; v_lli;
- p_lli = v_lli->p_lli_next, v_lli = v_lli->v_lli_next)
- dma_pool_free(sdev->pool, v_lli, p_lli);
- kfree(txd);
+ sun6i_dma_free_desc(sdev, txd);
return NULL;
}
@@ -1418,7 +1419,7 @@ static int sun6i_dma_probe(struct platform_device *pdev)
struct sun6i_vchan *vchan = &sdc->vchans[i];
INIT_LIST_HEAD(&vchan->node);
- vchan->vc.desc_free = sun6i_dma_free_desc;
+ vchan->vc.desc_free = sun6i_dma_free_desc_virt;
vchan_init(&vchan->vc, &sdc->slave);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0273/1756] dmaengine: at_hdmac: Fix use-after-free by proper tasklet cleanup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (271 preceding siblings ...)
2026-11-18 14:39 ` [PATCH 6.12 0272/1756] dmaengine: sun6i-dma: Fix use-after-free in error handling paths Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0274/1756] dmaengine: mediatek: hsdma: fix runtime PM leak on init failure Greg Kroah-Hartman
` (725 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Hongling Zeng, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
[ Upstream commit 13f2d32a09609d083ace2d589fbdc68e970ae34c ]
Current cleanup paths have a use-after-free vulnerability:
- vchan_init() creates tasklets that access at_dma_chan memory
- free_irq() only waits for IRQ handler, NOT tasklets
- atdma is devm-managed and freed after probe/remove
- Running tasklets accessing freed memory → Use-After-Free!
The fix requires careful ordering:
- free_irq() FIRST to synchronize with running IRQ handlers and prevent
them from scheduling new tasklets
- Then kill tasklets to wait for already-scheduled ones to complete
- Only then free other resources
Fixes: ac803b56860f ("dmaengine: at_hdmac: Convert driver to use virt-dma")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/all/20260604073945.54B311F00898@smtp.kernel.org/
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Suggested-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260727061705.45169-1-zenghongling@kylinos.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/at_hdmac.c | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 606f0b81c0672..de117f9c3f285 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1940,6 +1940,20 @@ static void at_dma_off(struct at_dma *atdma)
cpu_relax();
}
+static void at_dma_cleanup_channels(struct at_dma *atdma)
+{
+ struct dma_chan *chan, *_chan;
+ int i = 0;
+
+ list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
+ device_node) {
+ /* Disable interrupts */
+ atc_disable_chan_irq(atdma, i++);
+ tasklet_kill(&to_at_dma_chan(chan)->vc.task);
+ list_del(&chan->device_node);
+ }
+}
+
static int __init at_dma_probe(struct platform_device *pdev)
{
struct at_dma *atdma;
@@ -2105,6 +2119,8 @@ static int __init at_dma_probe(struct platform_device *pdev)
err_of_dma_controller_register:
dma_async_device_unregister(&atdma->dma_device);
err_dma_async_device_register:
+ disable_irq(platform_get_irq(pdev, 0));
+ at_dma_cleanup_channels(atdma);
dma_pool_destroy(atdma->memset_pool);
err_memset_pool_create:
dma_pool_destroy(atdma->lli_pool);
@@ -2118,23 +2134,17 @@ static int __init at_dma_probe(struct platform_device *pdev)
static void at_dma_remove(struct platform_device *pdev)
{
struct at_dma *atdma = platform_get_drvdata(pdev);
- struct dma_chan *chan, *_chan;
at_dma_off(atdma);
if (pdev->dev.of_node)
of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&atdma->dma_device);
- dma_pool_destroy(atdma->memset_pool);
- dma_pool_destroy(atdma->lli_pool);
free_irq(platform_get_irq(pdev, 0), atdma);
- list_for_each_entry_safe(chan, _chan, &atdma->dma_device.channels,
- device_node) {
- /* Disable interrupts */
- atc_disable_chan_irq(atdma, chan->chan_id);
- list_del(&chan->device_node);
- }
+ at_dma_cleanup_channels(atdma);
+ dma_pool_destroy(atdma->memset_pool);
+ dma_pool_destroy(atdma->lli_pool);
clk_disable_unprepare(atdma->clk);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0274/1756] dmaengine: mediatek: hsdma: fix runtime PM leak on init failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (272 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0273/1756] dmaengine: at_hdmac: Fix use-after-free by proper tasklet cleanup Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0275/1756] dmaengine: img-mdc: Fix runtime PM usage counter leak Greg Kroah-Hartman
` (724 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit f10d96b1c549a2f43506e9bf847196839808b8dc ]
mtk_hsdma_hw_init() enables runtime PM and gets a runtime PM reference
before enabling the HSDMA clock. It currently ignores failures from
pm_runtime_get_sync(); if runtime resume fails, the usage count remains
held. If clk_prepare_enable() then fails, the usage count remains held.
Use devm_pm_runtime_enable() to manage runtime PM enablement, and use
pm_runtime_resume_and_get() so resume failures do not leak the usage count.
If clk_prepare_enable() fails after a successful runtime resume, drop the
runtime PM reference before returning.
The probe path also ignores the return value from mtk_hsdma_hw_init(), so a
failed hardware init can continue as a successful probe. Propagate
mtk_hsdma_hw_init() failures from probe, while keeping a separate unwind
label so mtk_hsdma_hw_deinit() is only called after hardware init succeeds.
Fixes: 548c4597e984 ("dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260804153924.49627-1-mhun512@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/mediatek/mtk-hsdma.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index 58c7961ab9ad1..abbad59e0f958 100644
--- a/drivers/dma/mediatek/mtk-hsdma.c
+++ b/drivers/dma/mediatek/mtk-hsdma.c
@@ -848,17 +848,27 @@ static int mtk_hsdma_hw_init(struct mtk_hsdma_device *hsdma)
{
int err;
- pm_runtime_enable(hsdma2dev(hsdma));
- pm_runtime_get_sync(hsdma2dev(hsdma));
+ err = devm_pm_runtime_enable(hsdma2dev(hsdma));
+ if (err)
+ return err;
+
+ err = pm_runtime_resume_and_get(hsdma2dev(hsdma));
+ if (err < 0)
+ return err;
err = clk_prepare_enable(hsdma->clk);
if (err)
- return err;
+ goto err_put_pm;
mtk_dma_write(hsdma, MTK_HSDMA_INT_ENABLE, 0);
mtk_dma_write(hsdma, MTK_HSDMA_GLO, MTK_HSDMA_GLO_DEFAULT);
return 0;
+
+err_put_pm:
+ pm_runtime_put_sync(hsdma2dev(hsdma));
+
+ return err;
}
static int mtk_hsdma_hw_deinit(struct mtk_hsdma_device *hsdma)
@@ -868,7 +878,6 @@ static int mtk_hsdma_hw_deinit(struct mtk_hsdma_device *hsdma)
clk_disable_unprepare(hsdma->clk);
pm_runtime_put_sync(hsdma2dev(hsdma));
- pm_runtime_disable(hsdma2dev(hsdma));
return 0;
}
@@ -983,7 +992,9 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
goto err_unregister;
}
- mtk_hsdma_hw_init(hsdma);
+ err = mtk_hsdma_hw_init(hsdma);
+ if (err)
+ goto err_free;
err = devm_request_irq(&pdev->dev, hsdma->irq,
mtk_hsdma_irq, 0,
@@ -991,7 +1002,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
if (err) {
dev_err(&pdev->dev,
"request_irq failed with err %d\n", err);
- goto err_free;
+ goto err_deinit;
}
platform_set_drvdata(pdev, hsdma);
@@ -1000,8 +1011,9 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return 0;
-err_free:
+err_deinit:
mtk_hsdma_hw_deinit(hsdma);
+err_free:
of_dma_controller_free(pdev->dev.of_node);
err_unregister:
dma_async_device_unregister(dd);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0275/1756] dmaengine: img-mdc: Fix runtime PM usage counter leak
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (273 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0274/1756] dmaengine: mediatek: hsdma: fix runtime PM leak on init failure Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0276/1756] dmaengine: zynqmp_dma: Fix chan probe/remove error handling Greg Kroah-Hartman
` (723 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ruoyu Wang, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <ruoyuw560@gmail.com>
[ Upstream commit 4a1a2d8b8529cc569b769b92fcd71c53805cbeb2 ]
pm_runtime_get_sync() leaves the IMG MDC device's usage counter
incremented when runtime resume fails. mdc_alloc_chan_resources() returns
that error to the DMA core, so the channel's client count is not
incremented and mdc_free_chan_resources() is not called to drop the
reference. Repeated allocation attempts can therefore accumulate usage
references and prevent runtime suspend.
Use pm_runtime_resume_and_get() so a failed resume does not retain a
usage reference while successful allocations remain paired with
mdc_free_chan_resources(). DMA core only treats negative return values as
allocation failures, so the helper's zero success return preserves
behavior.
This issue was found by a static analysis checker and confirmed by manual
source review.
Fixes: 56d355e6f586 ("dmaengine: img-mdc: Add runtime PM")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260813153143.3953303-1-ruoyuw560@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/img-mdc-dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/img-mdc-dma.c b/drivers/dma/img-mdc-dma.c
index 0532dd2640dce..9dbceb9904e28 100644
--- a/drivers/dma/img-mdc-dma.c
+++ b/drivers/dma/img-mdc-dma.c
@@ -738,7 +738,7 @@ static int mdc_alloc_chan_resources(struct dma_chan *chan)
struct mdc_chan *mchan = to_mdc_chan(chan);
struct device *dev = mdma2dev(mchan->mdma);
- return pm_runtime_get_sync(dev);
+ return pm_runtime_resume_and_get(dev);
}
static void mdc_free_chan_resources(struct dma_chan *chan)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0276/1756] dmaengine: zynqmp_dma: Fix chan probe/remove error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (274 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0275/1756] dmaengine: img-mdc: Fix runtime PM usage counter leak Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0277/1756] dmaengine: dw-axi-dmac: convert clock handling to clk_bulk API Greg Kroah-Hartman
` (722 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Golla Nagendra, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Golla Nagendra <nagendra.golla@amd.com>
[ Upstream commit 0266dac57019201a14a81245d22750ab221d6c66 ]
Keep the real platform_get_irq() error by returning ret directly, stage
IRQ setup via a local ret variable, and assign chan->irq only after
devm_request_irq() succeeds.
Initialize chan->irq to -1 and initialize chan->common.device_node
before it may be touched by teardown. In channel remove, free IRQ only
for valid IRQ numbers and delete the channel node only when it is linked.
Register the channel node only after successful IRQ setup. On channel
probe failure in zynqmp_dma_probe(), route cleanup through the existing
free_chan_resources teardown path.
Fixes: b0cc417c1637 ("dmaengine: Add Xilinx zynqmp dma engine driver support")
Signed-off-by: Golla Nagendra <nagendra.golla@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260814045616.1661199-4-nagendra.golla@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/zynqmp_dma.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 9ae46f1198fe6..e8661f7b755a4 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -205,7 +205,7 @@ struct zynqmp_dma_desc_sw {
* @desc_pool_p: Physical allocated descriptor base
* @desc_free_cnt: Descriptor available count
* @dev: The dma device
- * @irq: Channel IRQ
+ * @irq: Linux IRQ number, or -1 when not registered
* @is_dmacoherent: Tells whether dma operations are coherent or not
* @tasklet: Cleanup work after irq
* @idle : Channel status;
@@ -887,10 +887,11 @@ static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan)
if (!chan)
return;
- if (chan->irq)
+ if (chan->irq >= 0)
devm_free_irq(chan->zdev->dev, chan->irq, chan);
tasklet_kill(&chan->tasklet);
- list_del(&chan->common.device_node);
+ if (!list_empty(&chan->common.device_node))
+ list_del(&chan->common.device_node);
}
/**
@@ -906,13 +907,14 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
struct zynqmp_dma_chan *chan;
struct device_node *node = pdev->dev.of_node;
const struct zynqmp_dma_config *match_data;
- int err;
+ int err, ret;
chan = devm_kzalloc(zdev->dev, sizeof(*chan), GFP_KERNEL);
if (!chan)
return -ENOMEM;
chan->dev = zdev->dev;
chan->zdev = zdev;
+ chan->irq = -1;
chan->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(chan->regs))
@@ -945,22 +947,26 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
INIT_LIST_HEAD(&chan->pending_list);
INIT_LIST_HEAD(&chan->done_list);
INIT_LIST_HEAD(&chan->free_list);
+ INIT_LIST_HEAD(&chan->common.device_node);
dma_cookie_init(&chan->common);
chan->common.device = &zdev->common;
- list_add_tail(&chan->common.device_node, &zdev->common.channels);
-
zynqmp_dma_init(chan);
- chan->irq = platform_get_irq(pdev, 0);
- if (chan->irq < 0)
- return -ENXIO;
- err = devm_request_irq(&pdev->dev, chan->irq, zynqmp_dma_irq_handler, 0,
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
+ return ret;
+
+ err = devm_request_irq(&pdev->dev, ret, zynqmp_dma_irq_handler, 0,
"zynqmp-dma", chan);
if (err)
return err;
+ chan->irq = ret;
+
chan->desc_size = sizeof(struct zynqmp_dma_desc_ll);
chan->idle = true;
+ list_add_tail(&chan->common.device_node, &zdev->common.channels);
+
return 0;
}
@@ -1125,7 +1131,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
ret = zynqmp_dma_chan_probe(zdev, pdev);
if (ret) {
dev_err_probe(&pdev->dev, ret, "Probing channel failed\n");
- goto err_disable_pm;
+ goto free_chan_resources;
}
p->dst_addr_widths = BIT(zdev->chan->bus_width / 8);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0277/1756] dmaengine: dw-axi-dmac: convert clock handling to clk_bulk API
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (275 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0276/1756] dmaengine: zynqmp_dma: Fix chan probe/remove error handling Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0278/1756] dmaengine: xilinx_dma: Fix MCDMA descriptor fields based on DMA direction Greg Kroah-Hartman
` (721 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chaithanya Lagisetty, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
[ Upstream commit c843417e6d6b55e24318e2edf405566e70786d3b ]
The driver managed its two mandatory clocks (core-clk and cfgr-clk)
individually. This was error prone: axi_dma_resume() enabled cfgr_clk
and then core_clk, and if enabling core_clk failed it returned the
error without disabling cfgr_clk, leaving the clock refcount
unbalanced.
Convert the driver to the clk_bulk API. The two clocks are always
acquired, enabled and disabled together, so a clk_bulk_data array
expresses this naturally and shrinks the get/enable/disable paths.
clk_bulk_prepare_enable() also unwinds any clock it already enabled
when a later one fails, which fixes the resume imbalance.
Fixes: 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")
Signed-off-by: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
Link: https://lore.kernel.org/all/20260813105432.2577322-1-nagachaithanya9911@gmail.com/
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260816054858.2667380-1-nagachaithanya9911@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 28 ++++++++-----------
drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 3 +-
2 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 8cfe9309819a3..06bb3e698ec0d 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1322,8 +1322,7 @@ static int axi_dma_suspend(struct axi_dma_chip *chip)
axi_dma_irq_disable(chip);
axi_dma_disable(chip);
- clk_disable_unprepare(chip->core_clk);
- clk_disable_unprepare(chip->cfgr_clk);
+ clk_bulk_disable_unprepare(ARRAY_SIZE(chip->clks), chip->clks);
return 0;
}
@@ -1332,11 +1331,7 @@ static int axi_dma_resume(struct axi_dma_chip *chip)
{
int ret;
- ret = clk_prepare_enable(chip->cfgr_clk);
- if (ret < 0)
- return ret;
-
- ret = clk_prepare_enable(chip->core_clk);
+ ret = clk_bulk_prepare_enable(ARRAY_SIZE(chip->clks), chip->clks);
if (ret < 0)
return ret;
@@ -1513,13 +1508,11 @@ static int dw_probe(struct platform_device *pdev)
chip->dw->hdata->use_cfg2 = !!(flags & AXI_DMA_FLAG_USE_CFG2);
- chip->core_clk = devm_clk_get(chip->dev, "core-clk");
- if (IS_ERR(chip->core_clk))
- return PTR_ERR(chip->core_clk);
-
- chip->cfgr_clk = devm_clk_get(chip->dev, "cfgr-clk");
- if (IS_ERR(chip->cfgr_clk))
- return PTR_ERR(chip->cfgr_clk);
+ chip->clks[0].id = "core-clk";
+ chip->clks[1].id = "cfgr-clk";
+ ret = devm_clk_bulk_get(chip->dev, ARRAY_SIZE(chip->clks), chip->clks);
+ if (ret)
+ return dev_err_probe(chip->dev, ret, "failed to get clocks\n");
ret = parse_device_properties(chip);
if (ret)
@@ -1629,10 +1622,13 @@ static void dw_remove(struct platform_device *pdev)
struct dw_axi_dma *dw = chip->dw;
struct axi_dma_chan *chan, *_chan;
u32 i;
+ int ret;
/* Enable clk before accessing to registers */
- clk_prepare_enable(chip->cfgr_clk);
- clk_prepare_enable(chip->core_clk);
+ ret = clk_bulk_prepare_enable(ARRAY_SIZE(chip->clks), chip->clks);
+ if (ret)
+ dev_warn(chip->dev, "failed to enable clocks before remove: %d\n",
+ ret);
axi_dma_irq_disable(chip);
for (i = 0; i < dw->hdata->nr_channels; i++) {
axi_chan_disable(&chip->dw->chan[i]);
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
index b842e6a8d90d3..d6e53f400af25 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
@@ -68,8 +68,7 @@ struct axi_dma_chip {
int irq[DMAC_MAX_CHANNELS];
void __iomem *regs;
void __iomem *apb_regs;
- struct clk *core_clk;
- struct clk *cfgr_clk;
+ struct clk_bulk_data clks[2];
struct dw_axi_dma *dw;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0278/1756] dmaengine: xilinx_dma: Fix MCDMA descriptor fields based on DMA direction
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (276 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0277/1756] dmaengine: dw-axi-dmac: convert clock handling to clk_bulk API Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0279/1756] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit Greg Kroah-Hartman
` (720 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Radhey Shyam Pandey, Srinivas Neeli,
Frank Li, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Neeli <srinivas.neeli@amd.com>
[ Upstream commit b70ab341088b2114dcbc7be868588f3e97893e6a ]
The MCDMA BD format differs between memory-to-device (MM2S) and
device-to-memory (S2MM) directions, but the driver was using generic
'status' and 'sideband_status' fields for both. This led to incorrect
residue calculations when the hardware updates direction-specific fields.
Refactor the descriptor structure to use unions with direction-specific
field mappings, and update the residue calculation logic to select the
correct status field based on DMA direction.
This matches the hardware descriptor layout and fixes incorrect
residue reporting.
Fixes: 6ccd692bfb7f ("dmaengine: xilinx_dma: Add Xilinx AXI MCDMA Engine driver support")
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Srinivas Neeli <srinivas.neeli@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260818174151.1608971-2-srinivas.neeli@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/xilinx_dma.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 39e6625c143cc..0ffd2fa2b1809 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -222,6 +222,7 @@
#define XILINX_MCDMA_IRQ_ERR_MASK BIT(7)
#define XILINX_MCDMA_BD_EOP BIT(30)
#define XILINX_MCDMA_BD_SOP BIT(31)
+#define XILINX_MCDMA_BD_HW_SIZE 64
/**
* struct xilinx_vdma_desc_hw - Hardware Descriptor
@@ -276,8 +277,10 @@ struct xilinx_axidma_desc_hw {
* @buf_addr_msb: MSB of Buffer address @0x0C
* @rsvd: Reserved field @0x10
* @control: Control Information field @0x14
- * @status: Status field @0x18
- * @sideband_status: Status of sideband signals @0x1C
+ * @mm2s_ctrl_sideband: Sideband control info for mm2s @0x18
+ * @s2mm_status: Status field for s2mm @0x18
+ * @mm2s_status: Status field for mm2s @0x1C
+ * @s2mm_sideband_status: Sideband status for s2mm @0x1C
* @app: APP Fields @0x20 - 0x30
*/
struct xilinx_aximcdma_desc_hw {
@@ -287,10 +290,17 @@ struct xilinx_aximcdma_desc_hw {
u32 buf_addr_msb;
u32 rsvd;
u32 control;
- u32 status;
- u32 sideband_status;
+ union {
+ u32 mm2s_ctrl_sideband;
+ u32 s2mm_status;
+ };
+ union {
+ u32 mm2s_status;
+ u32 s2mm_sideband_status;
+ };
u32 app[XILINX_DMA_NUM_APP_WORDS];
} __aligned(64);
+static_assert(sizeof(struct xilinx_aximcdma_desc_hw) == XILINX_MCDMA_BD_HW_SIZE);
/**
* struct xilinx_cdma_desc_hw - Hardware Descriptor
@@ -1024,9 +1034,11 @@ static u32 xilinx_dma_get_residue(struct xilinx_dma_chan *chan,
struct xilinx_aximcdma_tx_segment,
node);
aximcdma_hw = &aximcdma_seg->hw;
- residue +=
- (aximcdma_hw->control & chan->xdev->max_buffer_len) -
- (aximcdma_hw->status & chan->xdev->max_buffer_len);
+ residue += aximcdma_hw->control & chan->xdev->max_buffer_len;
+ if (chan->direction == DMA_DEV_TO_MEM)
+ residue -= aximcdma_hw->s2mm_status & chan->xdev->max_buffer_len;
+ else
+ residue -= aximcdma_hw->mm2s_status & chan->xdev->max_buffer_len;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0279/1756] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (277 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0278/1756] dmaengine: xilinx_dma: Fix MCDMA descriptor fields based on DMA direction Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0280/1756] dmaengine: zynqmp_dma: drop redundant label Greg Kroah-Hartman
` (719 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Radhey Shyam Pandey, Srinivas Neeli,
Frank Li, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivas Neeli <srinivas.neeli@amd.com>
[ Upstream commit 5b585cc8778185ae7a7c9903f8cd70d562b91282 ]
In AXI MCDMA, xilinx_dma_complete_descriptor() walks the channel's
active_list and unconditionally moves every entry to the done_list. The
MCDMA IOC interrupt handler invokes this function on every
interrupt-on-completion, but with interrupt coalescing (IRQThreshold > 1)
an IOC interrupt may fire after only a subset of the queued descriptors
have actually been processed by the hardware. As a result, descriptors
whose completion bit is not yet set in the BD status were being reported
as completed to client drivers.
Add a check for the descriptor completion bit before moving entries from
the active list to the done list, using the appropriate direction-
specific status field (s2mm_status for DMA_DEV_TO_MEM, mm2s_status for
DMA_MEM_TO_DEV).
This mirrors the AXIDMA fix in commit 7bcdaa658102 ("dmaengine:
xilinx_dma: Freeup active list based on descriptor completion bit").
Fixes: 6ccd692bfb7f ("dmaengine: xilinx_dma: Add Xilinx AXI MCDMA Engine driver support")
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Srinivas Neeli <srinivas.neeli@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260818174151.1608971-3-srinivas.neeli@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/xilinx_dma.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 0ffd2fa2b1809..d7ff5d6e1f402 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1767,6 +1767,17 @@ static void xilinx_dma_complete_descriptor(struct xilinx_dma_chan *chan)
struct xilinx_axidma_tx_segment, node);
if (!(seg->hw.status & XILINX_DMA_BD_COMP_MASK) && chan->has_sg)
break;
+ } else if (chan->xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA) {
+ struct xilinx_aximcdma_tx_segment *seg;
+ u32 status;
+
+ seg = list_last_entry(&desc->segments,
+ struct xilinx_aximcdma_tx_segment,
+ node);
+ status = (chan->direction == DMA_DEV_TO_MEM) ?
+ seg->hw.s2mm_status : seg->hw.mm2s_status;
+ if (!(status & XILINX_DMA_BD_COMP_MASK))
+ break;
}
if (chan->has_sg && chan->xdev->dma_config->dmatype !=
XDMA_TYPE_VDMA)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0280/1756] dmaengine: zynqmp_dma: drop redundant label
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (278 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0279/1756] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0281/1756] ACPI: button: Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020) RZ09-0310 Greg Kroah-Hartman
` (718 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Radhey Shyam Pandey, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinod Koul <vkoul@kernel.org>
[ Upstream commit 08f04d5ab868bc28d3115f7406499e8e5d1d1765 ]
Commit 3f30db282c28 ("dmaengine: zynqmp_dma: Fix chan probe/remove error
handling") dropped the use of err_disable_pm label causing warning:
drivers/dma/xilinx/zynqmp_dma.c: In function ‘zynqmp_dma_probe’:
drivers/dma/xilinx/zynqmp_dma.c:1171:1: error: label ‘err_disable_pm’ defined but not used [-Werror=unused-label]
1171 | err_disable_pm:
Drop it
Fixes: 3f30db282c28 ("dmaengine: zynqmp_dma: Fix chan probe/remove error handling")
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260903170357.1711462-1-vkoul@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/xilinx/zynqmp_dma.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index e8661f7b755a4..235c60e1e320e 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -1158,7 +1158,6 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
free_chan_resources:
zynqmp_dma_chan_remove(zdev->chan);
-err_disable_pm:
if (!pm_runtime_enabled(zdev->dev))
zynqmp_dma_runtime_suspend(zdev->dev);
pm_runtime_disable(zdev->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0281/1756] ACPI: button: Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020) RZ09-0310
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (279 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0280/1756] dmaengine: zynqmp_dma: drop redundant label Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0282/1756] ACPI: PM: Drop parent state update from acpi_device_get_power() Greg Kroah-Hartman
` (717 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Gallagher, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Gallagher <cdine@cdine.org>
[ Upstream commit f16c512a07b954aa3b0b3c580e7abb5dd4f5e703 ]
This patch adds a quirk mapping for the "Blade Stealth 13 (Early 2020) -
RZ09-0310" laptop, which exhibits the same issue as the following two
related products already accounted for in this file.
- Razer Blade Stealth 13 Late 2019
- Blade Pro 17 (Early 2020) - RZ09-0329
Summary of the issue this fixes:
The firmware's _LID method still returns "closed" after resume when the
lid was opened during S3, causing systemd-logind to suspend the system
again within several seconds (15-40) after waking.
Signed-off-by: Ian Gallagher <cdine@cdine.org>
Link: https://patch.msgid.link/90ab9b58-da8b-4ffc-bd4b-adf7590545a9@app.fastmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/button.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 4f5b51f8114ca..94c6df4de7ff6 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -141,6 +141,18 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
},
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
},
+ {
+ /*
+ * Razer Blade Stealth 13 early 2020, when the lid is opened
+ * while suspended the open notification is lost and _LID keeps
+ * returning closed after resume, causing spurious re-suspends.
+ */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Razer"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Blade Stealth 13 (Early 2020) - RZ09-0310"),
+ },
+ .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
+ },
{
/*
* Samsung galaxybook2 ,initial _LID device notification returns
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0282/1756] ACPI: PM: Drop parent state update from acpi_device_get_power()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (280 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0281/1756] ACPI: button: Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020) RZ09-0310 Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0283/1756] ACPI: PCI: Introduce acpi_dev_get_pci_dev() Greg Kroah-Hartman
` (716 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Peixin Xie,
Sakari Ailus, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 5636eebb7bb1c6f06f0058d48353686304d4bb47 ]
The parent state update in acpi_device_get_power(), that occurs when the
child device turns out to be in D0 and the parent's power state is still
unknown, is highly questionable because it may cause the reference
counters of the power resources used by the parent in D0 (if any) to
underflow when the parent goes into a low-power state later. Moreover,
there is no reason to do it on reads from the real_power_state sysfs
attribute of the child.
That check had been added by commit 8f7412a792bc ("ACPI / PM: Infer
parent power state from child if unknown, v2") before starting to
handle the "missing _PSC and no power resources" case directly in
acpi_bus_init_power(), as of commit b3785492268f ("ACPI / PM: Do not
power manage devices in unknown initial states"). It is not necessary
any more and commit b3785492268f should have removed it.
Drop it now.
Fixes: b3785492268f ("ACPI / PM: Do not power manage devices in unknown initial states")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Peixin Xie <peixin.xie@linux.spacemit.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://patch.msgid.link/5147279.31r3eYUQgx@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/device_pm.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index dbd4446025ecd..86301f094e4b8 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -75,15 +75,14 @@ static int acpi_dev_pm_explicit_get(struct acpi_device *device, int *state)
int acpi_device_get_power(struct acpi_device *device, int *state)
{
int result = ACPI_STATE_UNKNOWN;
- struct acpi_device *parent;
int error;
if (!device || !state)
return -EINVAL;
- parent = acpi_dev_parent(device);
-
if (!device->flags.power_manageable) {
+ struct acpi_device *parent = acpi_dev_parent(device);
+
/* TBD: Non-recursive algorithm for walking up hierarchy. */
*state = parent ? parent->power.state : ACPI_STATE_D0;
goto out;
@@ -119,16 +118,6 @@ int acpi_device_get_power(struct acpi_device *device, int *state)
result = psc > ACPI_STATE_D2 ? ACPI_STATE_D3_HOT : psc;
}
- /*
- * If we were unsure about the device parent's power state up to this
- * point, the fact that the device is in D0 implies that the parent has
- * to be in D0 too, except if ignore_parent is set.
- */
- if (!device->power.flags.ignore_parent && parent &&
- parent->power.state == ACPI_STATE_UNKNOWN &&
- result == ACPI_STATE_D0)
- parent->power.state = ACPI_STATE_D0;
-
*state = result;
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0283/1756] ACPI: PCI: Introduce acpi_dev_get_pci_dev()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (281 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0282/1756] ACPI: PM: Drop parent state update from acpi_device_get_power() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0284/1756] ACPI: scan: Stop calling acpi_bus_init_power() early Greg Kroah-Hartman
` (715 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Andy Shevchenko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 9d4f0ecb87fd939207682ec30dcaf128d43f07fb ]
Some acpi_get_pci_dev() callers already have a struct ACPI device for
which they want to get the struct pci_dev pointer of the associated
PCI device, so they don't need to look for one.
For this reason, add acpi_dev_get_pci_dev() that will get a PCI device
for a given ACPI one (if possible) and turn acpi_get_pci_dev() into
a static inline helper passing the acpi_fetch_acpi_dev() return value
directly to acpi_dev_get_pci_dev().
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/3430928.44csPzL39Z@rafael.j.wysocki
Stable-dep-of: 2f4ddf2bd1ba ("ACPI: scan: Stop calling acpi_bus_init_power() early")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/pci_root.c | 22 +++++++++++-----------
include/acpi/acpi_drivers.h | 9 +++++++--
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index b22781852953c..9679c2d47a84f 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -294,20 +294,20 @@ struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle)
EXPORT_SYMBOL_GPL(acpi_pci_find_root);
/**
- * acpi_get_pci_dev - convert ACPI CA handle to struct pci_dev
- * @handle: the handle in question
+ * acpi_dev_get_pci_dev - Get a struct pci_dev for a given ACPI device
+ * @adev: Target ACPI device.
*
- * Given an ACPI CA handle, the desired PCI device is located in the
- * list of PCI devices.
+ * Find the PCI device associated with @adev, if any, and bump up its reference
+ * counter.
*
- * If the device is found, its reference count is increased and this
- * function returns a pointer to its data structure. The caller must
- * decrement the reference count by calling pci_dev_put().
- * If no device is found, %NULL is returned.
+ * Callers are responsible for dropping the PCI device reference obtained by
+ * this function.
+ *
+ * Return: The struct pci_dev pointer of a reference-counted PCI device on
+ * success or NULL on failure.
*/
-struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
+struct pci_dev *acpi_dev_get_pci_dev(struct acpi_device *adev)
{
- struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
struct acpi_device_physical_node *pn;
struct pci_dev *pci_dev = NULL;
@@ -328,7 +328,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
return pci_dev;
}
-EXPORT_SYMBOL_GPL(acpi_get_pci_dev);
+EXPORT_SYMBOL_GPL(acpi_dev_get_pci_dev);
/**
* acpi_pci_osc_control_set - Request control of PCI root _OSC features.
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index b14d165632e76..3f9e16f44b2bd 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -59,14 +59,19 @@ int acpi_pci_link_free_irq(acpi_handle handle);
struct pci_bus;
#ifdef CONFIG_PCI
-struct pci_dev *acpi_get_pci_dev(acpi_handle);
+struct pci_dev *acpi_dev_get_pci_dev(struct acpi_device *adev);
#else
-static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
+static inline struct pci_dev *acpi_dev_get_pci_dev(struct acpi_device *adev)
{
return NULL;
}
#endif
+static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
+{
+ return acpi_dev_get_pci_dev(acpi_fetch_acpi_dev(handle));
+}
+
/* Arch-defined function to add a bus to the system */
struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0284/1756] ACPI: scan: Stop calling acpi_bus_init_power() early
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (282 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0283/1756] ACPI: PCI: Introduce acpi_dev_get_pci_dev() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0285/1756] ACPI: utils: Adjust message printing macros for ACPI objects Greg Kroah-Hartman
` (714 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Peixin Xie,
Sakari Ailus, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 2f4ddf2bd1baf0ee3c8542ec6f382a3585cae607 ]
There is a problem, introduced by commit 9d9bcae47fd5 ("ACPI: delay
enumeration of devices with a _DEP pointing to an INT3472 device")
inadvertently, that devices with missing dependencies may be put
into power state D0 prematurely [1].
Namely, acpi_bus_init_power() called by acpi_bus_get_power_flags()
during the early initialization of ACPI device objects, may discover
that all of the power resources needed by the given device to be in
power state D0 are initially on, so it will reference count those
power resources and transition the device into D0. Later, if
acpi_bus_attach() running for that device notices that it has missing
dependencies, the enumeration of it will be deferred and its
power_manageable flag will be cleared, even though it is still in D0
at that point.
After the dependencies in question have been met, acpi_bus_attach()
runs again for the device and now it calls acpi_bus_init_power() that
takes additional references to the power resources used by the device
in D0. These additional references prevent the power resources from
being turned off when the device goes into D3hot/D3cold.
Another problem, related to the previous one, is that ACPI power state
initialization may be carried out for devices whose parents are not
ready for enumeration which may lead to initialization ordering issues.
To address both, stop calling acpi_bus_init_power() from
acpi_bus_get_power_flags(), but also take the initialization of
PCI devices into account, which needs to be done because they
are initialized and bound to their ACPI companions before
acpi_bus_attach() is called for the latter.
To that end, notice that acpi_power_up_if_adr_present() is used for
powering-up PCI devices in D3cold before walking the bus in order to
discover them and the initial ACPI power state of those devices needs
to be known for this purpose, so add an acpi_bus_init_power() invocation
to that function. [The debug statement printed by it duplicates the
debug statements printed during the acpi_bus_init_power() execution, so
drop it.]
Moreover, since the ACPI companions of PCI devices are associated with
the corresponding PCI devices found on the bus before acpi_bus_attach()
is called for them, it is not necessary or even useful to skip them in
acpi_bus_attach() due to an ACPI status mismatch, so avoid doing that
and complain if the ACPI status does not match the observed situation.
Also use the ACPI power state tracking to decide whether or not
the device's power state needs to be initialized in acpi_bus_attach()
instead of using the "initialized" flag of the ACPI device object
for this purpose, which is fragile and inconvenient, and clear the
power_manageable flag on failure in acpi_bus_init_power() (additionally,
poison the device ACPI power state as "invalid" if the initialization of
it fails). That allows the clearing of the power_manageable flag for
devices with unmet dependencies to be dropped.
While at it, add a debug message pringing statement to
acpi_bus_init_power() to facilitate diagnostics.
Fixes: 9d9bcae47fd5 ("ACPI: delay enumeration of devices with a _DEP pointing to an INT3472 device")
Link: https://lore.kernel.org/linux-acpi/20260820-acpi-power-resource-ref-fix-v2-1-29818173ea13@linux.spacemit.com/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Peixin Xie <peixin.xie@linux.spacemit.com>
Tested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://patch.msgid.link/2295263.irdbgypaU6@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/device_pm.c | 62 ++++++++++++++++++++++++++++++++--------
drivers/acpi/scan.c | 40 +++++++++++++++++---------
2 files changed, 76 insertions(+), 26 deletions(-)
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 86301f094e4b8..fef0ec39b8bb8 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -23,6 +23,8 @@
#include "fan.h"
#include "internal.h"
+#define ACPI_D_STATE_INVALID ACPI_D_STATE_COUNT
+
/**
* acpi_power_state_string - String representation of ACPI device power state.
* @state: ACPI device power state to return the string representation of.
@@ -293,24 +295,28 @@ int acpi_bus_set_power(acpi_handle handle, int state)
}
EXPORT_SYMBOL(acpi_bus_set_power);
-int acpi_bus_init_power(struct acpi_device *device)
+static int acpi_device_init_power(struct acpi_device *device)
{
int state;
int result;
- if (!device)
- return -EINVAL;
-
- device->power.state = ACPI_STATE_UNKNOWN;
- if (!acpi_device_is_present(device)) {
- device->flags.initialized = false;
- return -ENXIO;
- }
-
result = acpi_device_get_power(device, &state);
if (result)
return result;
+ /*
+ * If the current power state of the device is D0 and it has a parent
+ * whose power state is not ignored, and the parent's power state
+ * initialization has failed, the parent's power state can be updated to
+ * D0 for consistency.
+ */
+ if (!device->power.flags.ignore_parent && state == ACPI_STATE_D0) {
+ struct acpi_device *parent = acpi_dev_parent(device);
+
+ if (parent && parent->power.state == ACPI_D_STATE_INVALID)
+ parent->power.state = ACPI_STATE_D0;
+ }
+
if (state < ACPI_STATE_D3_COLD && device->power.flags.power_resources) {
/* Reference count the power resources. */
result = acpi_power_on_resources(device, state);
@@ -340,9 +346,36 @@ int acpi_bus_init_power(struct acpi_device *device)
state = ACPI_STATE_D0;
}
device->power.state = state;
+
+ acpi_handle_debug(device->handle, "Initial power state: %s\n",
+ acpi_power_state_string(state));
+
return 0;
}
+int acpi_bus_init_power(struct acpi_device *device)
+{
+ int result;
+
+ if (device->power.state != ACPI_STATE_UNKNOWN)
+ return 0;
+
+ /*
+ * The ACPI device power state can be only initialized once. If this
+ * fails, ACPI power management will not be used for the device going
+ * forward.
+ */
+ result = acpi_device_init_power(device);
+ if (result) {
+ device->flags.power_manageable = 0;
+ device->power.state = ACPI_D_STATE_INVALID;
+ acpi_handle_info(device->handle,
+ "Initial power state undetermined, ACPI PM disabled\n");
+ }
+
+ return result;
+}
+
/**
* acpi_device_fix_up_power - Force device with missing _PSC into D0.
* @device: Device object whose power state is to be fixed up.
@@ -464,8 +497,13 @@ static int acpi_power_up_if_adr_present(struct acpi_device *adev, void *not_used
if (!(adev->flags.power_manageable && adev->pnp.type.bus_address))
return 0;
- acpi_handle_debug(adev->handle, "Power state: %s\n",
- acpi_power_state_string(adev->power.state));
+ /*
+ * This is done during the PCI root initialization which occurs before
+ * acpi_bus_attach() is called for the device, so the ACPI power state
+ * of the device needs to be initialized here.
+ */
+ if (acpi_bus_init_power(adev))
+ return 0;
if (adev->power.state == ACPI_STATE_D3_COLD)
return acpi_device_set_power(adev, ACPI_STATE_D0);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index ae744ab62b1c0..78daad7209a59 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -18,6 +18,7 @@
#include <linux/kthread.h>
#include <linux/dmi.h>
#include <linux/dma-map-ops.h>
+#include <linux/pci.h>
#include <linux/platform_data/x86/apple.h>
#include <linux/pgtable.h>
#include <linux/crc32.h>
@@ -1157,8 +1158,7 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
}
- if (acpi_bus_init_power(device))
- device->flags.power_manageable = 0;
+ device->power.state = ACPI_STATE_UNKNOWN;
}
static void acpi_bus_get_flags(struct acpi_device *device)
@@ -2284,38 +2284,50 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
static int acpi_bus_attach(struct acpi_device *device, void *first_pass)
{
bool skip = !first_pass && device->flags.visited;
+ struct pci_dev *pci;
acpi_handle ejd;
int ret;
if (skip)
goto ok;
+ device->flags.initialized = true;
+
if (ACPI_SUCCESS(acpi_bus_get_ejd(device->handle, &ejd)))
register_dock_dependent_device(device, ejd);
acpi_bus_get_status(device);
- /* Skip devices that are not ready for enumeration (e.g. not present) */
- if (!acpi_dev_ready_for_enumeration(device)) {
- device->flags.initialized = false;
+ /*
+ * If the given ACPI device object has been already associated with a
+ * PCI device found on the bus, its status is effectively "present and
+ * enabled", and dependencies are not tracked for PCI devices, so it is
+ * not necessary or even useful to check the device's readiness in that
+ * case.
+ */
+ pci = acpi_dev_get_pci_dev(device);
+ if (pci) {
+ acpi_handle_debug(device->handle, "PCI companion %s found\n",
+ pci_name(pci));
+
+ if (!acpi_device_is_present(device))
+ pci_info(pci, FW_BUG "ACPI status differs from reality\n");
+
+ pci_dev_put(pci);
+ } else if (!acpi_dev_ready_for_enumeration(device)) {
+ /* The device is not ready (e.g. not present), so skip it. */
acpi_device_clear_enumerated(device);
- device->flags.power_manageable = 0;
return 0;
}
+
if (device->handler)
goto ok;
acpi_ec_register_opregions(device);
- if (!device->flags.initialized) {
- device->flags.power_manageable =
- device->power.states[ACPI_STATE_D0].flags.valid;
- if (acpi_bus_init_power(device))
- device->flags.power_manageable = 0;
+ acpi_bus_init_power(device);
- device->flags.initialized = true;
- } else if (device->flags.visited) {
+ if (device->flags.visited)
goto ok;
- }
ret = acpi_scan_attach_handler(device);
if (ret < 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0285/1756] ACPI: utils: Adjust message printing macros for ACPI objects
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (283 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0284/1756] ACPI: scan: Stop calling acpi_bus_init_power() early Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0286/1756] wifi: ath11k: modify null check logic in ath11k_ce_rx_post_pipe() Greg Kroah-Hartman
` (713 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Andy Shevchenko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 78ddbfaa72d68acc98cd5ba12eca071d452702c4 ]
The majority of acpi_handle_<level>() macros use neither pr_fmt() nor
dev_fmt() and acpi_handle_debug() uses pr_fmt() like dev_fmt(), but
only if dynamic debug is compiled in.
For more consistency, redefine all of the macros in question to use
dev_fmt() because they are more similar to the analogous dev_*()
family of macros than to the pr_*() ones and make all of them use it
in the same way.
While at it, rephrase the comment documenting those macros for more
clarity.
Fixes: 45fef5b88d1f ("ACPI: add dynamic_debug support")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/2300525.irdbgypaU6@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/acpi.h | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 0e8d684ad9f43..82d913a0f20d8 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1208,34 +1208,34 @@ void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const c
#endif
/*
- * acpi_handle_<level>: Print message with ACPI prefix and object path
+ * acpi_handle_<level> - Print a message with ACPI prefix and object path
*
- * These interfaces acquire the global namespace mutex to obtain an object
- * path. In interrupt context, it shows the object path as <n/a>.
+ * In thread context, the global namespace mutex is acquired to obtain the
+ * object path. In interrupt context, the object path is shown as <n/a>.
*/
#define acpi_handle_emerg(handle, fmt, ...) \
- acpi_handle_printk(KERN_EMERG, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_EMERG, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_alert(handle, fmt, ...) \
- acpi_handle_printk(KERN_ALERT, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_ALERT, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_crit(handle, fmt, ...) \
- acpi_handle_printk(KERN_CRIT, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_CRIT, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_err(handle, fmt, ...) \
- acpi_handle_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_ERR, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_warn(handle, fmt, ...) \
- acpi_handle_printk(KERN_WARNING, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_WARNING, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_notice(handle, fmt, ...) \
- acpi_handle_printk(KERN_NOTICE, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_NOTICE, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_info(handle, fmt, ...) \
- acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_INFO, handle, dev_fmt(fmt), ##__VA_ARGS__)
#if defined(DEBUG)
#define acpi_handle_debug(handle, fmt, ...) \
- acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_DEBUG, handle, dev_fmt(fmt), ##__VA_ARGS__)
#else
#if defined(CONFIG_DYNAMIC_DEBUG)
#define acpi_handle_debug(handle, fmt, ...) \
_dynamic_func_call(fmt, __acpi_handle_debug, \
- handle, pr_fmt(fmt), ##__VA_ARGS__)
+ handle, dev_fmt(fmt), ##__VA_ARGS__)
#else
#define acpi_handle_debug(handle, fmt, ...) \
({ \
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0286/1756] wifi: ath11k: modify null check logic in ath11k_ce_rx_post_pipe()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (284 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0285/1756] ACPI: utils: Adjust message printing macros for ACPI objects Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0287/1756] wifi: ath11k: fix locking problem in ath11k_dp_rx_tid_del_func() Greg Kroah-Hartman
` (712 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikhail Lobanov, Baochen Qiang,
Rameshkumar Sundaram, Jeff Johnson, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Lobanov <m.lobanov@rosalinux.ru>
[ Upstream commit 52953d149ab4da0432d54b09f3c8add42b4d4a82 ]
The previous logic in ath11k_ce_rx_post_pipe() incorrectly required both
dest_ring and status_ring to be NULL in order to exit the function.
This caused the function to continue even if only one of the pointers
was NULL, potentially leading to null pointer dereferences in
ath11k_ce_rx_buf_enqueue_pipe().
Fix the condition by modifying the logic so that the function returns
early if either dest_ring or status_ring is NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Mikhail Lobanov <m.lobanov@rosalinux.ru>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://patch.msgid.link/20240909150824.28195-1-m.lobanov@rosalinux.ru
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/ce.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c
index 39d9aad33bc69..7f2c91fd7ab3a 100644
--- a/drivers/net/wireless/ath/ath11k/ce.c
+++ b/drivers/net/wireless/ath/ath11k/ce.c
@@ -324,7 +324,7 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe)
dma_addr_t paddr;
int ret = 0;
- if (!(pipe->dest_ring || pipe->status_ring))
+ if (!pipe->dest_ring || !pipe->status_ring)
return 0;
spin_lock_bh(&ab->ce.ce_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0287/1756] wifi: ath11k: fix locking problem in ath11k_dp_rx_tid_del_func()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (285 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0286/1756] wifi: ath11k: modify null check logic in ath11k_ce_rx_post_pipe() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0288/1756] wifi: ath12k: Free allocated CE IRQs on request_irq() failure Greg Kroah-Hartman
` (711 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Baochen Qiang, Nicolas Escande,
Rameshkumar Sundaram, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Escande <nico.escande@gmail.com>
[ Upstream commit c7555d47b1d051e0406474349deccf74b491ae01 ]
In this function, we iterate over dp->reo_cmd_cache_flush_list using
list_for_each_entry_safe(), under dp->reo_cmd_lock for concurrent access,
and for each expired entries we :
- drop the lock
- call ath11k_dp_reo_cache_flush()
- kfree() the entry
- retake the lock to keep on iterating
list_for_each_entry_safe() protects us from deleting the entry during
iteration but doesn't protect for concurrent access. So another thread can
take the lock and modify the list in between and crash like below.
To fix the issue, move all entries that needs to be freed to a local list
while under the lock and then iterate over the list to free the entries
without holding the lock.
BUG: Unable to handle kernel paging request at virtual address 00000010ddbeef8c
Call trace:
ath11k_dp_rx_tid_del_func+0x164/0x3c8
ath11k_dp_process_reo_status+0x1d4/0x2fc
ath11k_dp_service_srng+0x334/0x338
ath11k_pcic_ext_grp_napi_poll+0x30/0xc0
__napi_poll+0x34/0x184
napi_threaded_poll+0xb4/0x1d8
kthread+0xdc/0xe0
ret_from_fork+0x10/0x20
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.9.0.1-01977-QCAHKSWPL_SILICONZ-1
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Suggested-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260813-ath11k-locking-v2-1-f4113a0bd0f4@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/dp_rx.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 9344d3f1f45da..077ded7f15da5 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -762,6 +762,9 @@ static void ath11k_dp_rx_tid_del_func(struct ath11k_dp *dp, void *ctx,
struct ath11k_base *ab = dp->ab;
struct dp_rx_tid *rx_tid = ctx;
struct dp_reo_cache_flush_elem *elem, *tmp;
+ struct list_head flush_list;
+
+ INIT_LIST_HEAD(&flush_list);
if (status == HAL_REO_CMD_DRAIN) {
goto free_desc;
@@ -783,23 +786,25 @@ static void ath11k_dp_rx_tid_del_func(struct ath11k_dp *dp, void *ctx,
list_add_tail(&elem->list, &dp->reo_cmd_cache_flush_list);
dp->reo_cmd_cache_flush_count++;
- /* Flush and invalidate aged REO desc from HW cache */
+ /* identify aged REO desc that needs removal */
list_for_each_entry_safe(elem, tmp, &dp->reo_cmd_cache_flush_list,
list) {
if (dp->reo_cmd_cache_flush_count > DP_REO_DESC_FREE_THRESHOLD ||
time_after(jiffies, elem->ts +
msecs_to_jiffies(DP_REO_DESC_FREE_TIMEOUT_MS))) {
- list_del(&elem->list);
+ list_move_tail(&elem->list, &flush_list);
dp->reo_cmd_cache_flush_count--;
- spin_unlock_bh(&dp->reo_cmd_lock);
-
- ath11k_dp_reo_cache_flush(ab, &elem->data);
- kfree(elem);
- spin_lock_bh(&dp->reo_cmd_lock);
}
}
spin_unlock_bh(&dp->reo_cmd_lock);
+ /* remove aged REO desc from HW */
+ list_for_each_entry_safe(elem, tmp, &flush_list, list) {
+ ath11k_dp_reo_cache_flush(ab, &elem->data);
+ list_del(&elem->list);
+ kfree(elem);
+ }
+
return;
free_desc:
dma_free_noncoherent(ab->dev, rx_tid->unaligned_size,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0288/1756] wifi: ath12k: Free allocated CE IRQs on request_irq() failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (286 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0287/1756] wifi: ath11k: fix locking problem in ath11k_dp_rx_tid_del_func() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0289/1756] wifi: ath12k: Free allocated external " Greg Kroah-Hartman
` (710 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaradhana Sahu, Rameshkumar Sundaram,
Baochen Qiang, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
[ Upstream commit 12ca935af2e68447e9218a615ebbb5ff7faf1554 ]
When CE IRQ configuration fails, the driver does not release all IRQs
that were successfully requested before the failure. This can leak IRQ
resources during probe failure.
Free the previously requested CE IRQs before returning from the error
path to ensure that partially initialized IRQ resources are properly
cleaned up during probe failure.
Factor out the CE IRQ cleanup into a helper to reuse the cleanup logic
during both error handling and driver teardown.
Also free CE IRQs when external IRQ configuration fails, before
returning from the error path.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260819110215.2485514-2-aaradhana.sahu@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/pci.c | 29 ++++++++++++++++++---------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 4ba0c1bb32341..2017b54dc9f92 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -343,6 +343,19 @@ static void ath12k_pci_sw_reset(struct ath12k_base *ab, bool power_on)
ath12k_mhi_set_mhictrl_reset(ab);
}
+static void ath12k_pci_free_ce_irq(struct ath12k_base *ab, int num_ce)
+{
+ int i, irq_idx;
+
+ for (i = 0; i < num_ce; i++) {
+ if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
+ continue;
+
+ irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i;
+ free_irq(ab->irq_num[irq_idx], &ab->ce.ce_pipe[i]);
+ }
+}
+
static void ath12k_pci_free_ext_irq(struct ath12k_base *ab)
{
int i, j;
@@ -360,15 +373,7 @@ static void ath12k_pci_free_ext_irq(struct ath12k_base *ab)
static void ath12k_pci_free_irq(struct ath12k_base *ab)
{
- int i, irq_idx;
-
- for (i = 0; i < ab->hw_params->ce_count; i++) {
- if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
- continue;
- irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i;
- free_irq(ab->irq_num[irq_idx], &ab->ce.ce_pipe[i]);
- }
-
+ ath12k_pci_free_ce_irq(ab, ab->hw_params->ce_count);
ath12k_pci_free_ext_irq(ab);
}
@@ -690,6 +695,8 @@ static int ath12k_pci_config_irq(struct ath12k_base *ab)
if (ret) {
ath12k_err(ab, "failed to request irq %d: %d\n",
irq_idx, ret);
+
+ ath12k_pci_free_ce_irq(ab, i);
return ret;
}
@@ -700,8 +707,10 @@ static int ath12k_pci_config_irq(struct ath12k_base *ab)
}
ret = ath12k_pci_ext_irq_config(ab);
- if (ret)
+ if (ret) {
+ ath12k_pci_free_ce_irq(ab, ab->hw_params->ce_count);
return ret;
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0289/1756] wifi: ath12k: Free allocated external IRQs on request_irq() failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (287 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0288/1756] wifi: ath12k: Free allocated CE IRQs on request_irq() failure Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0290/1756] selftests: net: csum: Clean up recv_verify_packet_ipv6 Greg Kroah-Hartman
` (709 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaradhana Sahu, Rameshkumar Sundaram,
Baochen Qiang, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
[ Upstream commit 9a78703ec4a895bd2e99bf43bd18d76683126c19 ]
When external IRQ configuration fails, the driver does not release all
IRQs that were successfully requested before the failure. This can leak
IRQ resources during probe failure.
Free previously requested external IRQs when external IRQ configuration
fails.
Also remove the NAPI instance with netif_napi_del() before freeing the
associated netdev to properly clean up the NAPI resources.
Store the IRQ number only after request_irq() succeeds to avoid recording
an IRQ that was not successfully requested.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260819110215.2485514-3-aaradhana.sahu@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/pci.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 2017b54dc9f92..3ccd15accf87e 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -356,11 +356,11 @@ static void ath12k_pci_free_ce_irq(struct ath12k_base *ab, int num_ce)
}
}
-static void ath12k_pci_free_ext_irq(struct ath12k_base *ab)
+static void ath12k_pci_free_ext_irq(struct ath12k_base *ab, int num_ext_irq_grp)
{
int i, j;
- for (i = 0; i < ATH12K_EXT_IRQ_GRP_NUM_MAX; i++) {
+ for (i = 0; i < num_ext_irq_grp; i++) {
struct ath12k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
for (j = 0; j < irq_grp->num_irq; j++)
@@ -374,7 +374,7 @@ static void ath12k_pci_free_ext_irq(struct ath12k_base *ab)
static void ath12k_pci_free_irq(struct ath12k_base *ab)
{
ath12k_pci_free_ce_irq(ab, ab->hw_params->ce_count);
- ath12k_pci_free_ext_irq(ab);
+ ath12k_pci_free_ext_irq(ab, ATH12K_EXT_IRQ_GRP_NUM_MAX);
}
static void ath12k_pci_ce_irq_enable(struct ath12k_base *ab, u16 ce_id)
@@ -619,8 +619,6 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
int vector = (i % num_vectors) + base_vector;
int irq = ath12k_pci_get_msi_irq(ab->dev, vector);
- ab->irq_num[irq_idx] = irq;
-
ath12k_dbg(ab, ATH12K_DBG_PCI,
"irq:%d group:%d\n", irq, i);
@@ -631,22 +629,24 @@ static int ath12k_pci_ext_irq_config(struct ath12k_base *ab)
if (ret) {
ath12k_err(ab, "failed request irq %d: %d\n",
vector, ret);
- goto fail_request;
+
+ for (n = 0; n < j; n++)
+ free_irq(ab->irq_num[irq_grp->irqs[n]], irq_grp);
+
+ netif_napi_del(&ab->ext_irq_grp[i].napi);
+ free_netdev(ab->ext_irq_grp[i].napi_ndev);
+ goto fail_allocate;
}
+
+ ab->irq_num[irq_idx] = irq;
}
ath12k_pci_ext_grp_disable(irq_grp);
}
return 0;
-fail_request:
- /* i ->napi_ndev was properly allocated. Free it also */
- i += 1;
fail_allocate:
- for (n = 0; n < i; n++) {
- irq_grp = &ab->ext_irq_grp[n];
- free_netdev(irq_grp->napi_ndev);
- }
+ ath12k_pci_free_ext_irq(ab, i);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0290/1756] selftests: net: csum: Clean up recv_verify_packet_ipv6
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (288 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0289/1756] wifi: ath12k: Free allocated external " Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0291/1756] selftests: net: csum: filter packets by source address and port Greg Kroah-Hartman
` (708 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sean Anderson, Willem de Bruijn,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Anderson <sean.anderson@linux.dev>
[ Upstream commit d772cc25ccf772f4cbb81270970cbe1356c23d3e ]
Rename ip_len to payload_len since the length in this case refers only
to the payload, and not the entire IP packet like for IPv4. While we're
at it, just use the variable directly when calling
recv_verify_packet_udp/tcp.
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20240930162935.980712-1-sean.anderson@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 8342c68435dd ("selftests: net: csum: filter packets by source address and port")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/net/lib/csum.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/net/lib/csum.c b/tools/testing/selftests/net/lib/csum.c
index e0a34e5e8dd5c..27437590eeb53 100644
--- a/tools/testing/selftests/net/lib/csum.c
+++ b/tools/testing/selftests/net/lib/csum.c
@@ -675,22 +675,20 @@ static int recv_verify_packet_ipv6(void *nh, int len)
{
struct ipv6hdr *ip6h = nh;
uint16_t proto = cfg_encap ? IPPROTO_UDP : cfg_proto;
- uint16_t ip_len;
+ uint16_t payload_len;
if (len < sizeof(*ip6h) || ip6h->nexthdr != proto)
return -1;
- ip_len = ntohs(ip6h->payload_len);
- if (ip_len > len - sizeof(*ip6h))
+ payload_len = ntohs(ip6h->payload_len);
+ if (payload_len > len - sizeof(*ip6h))
return -1;
- len = ip_len;
iph_addr_p = &ip6h->saddr;
-
if (proto == IPPROTO_TCP)
- return recv_verify_packet_tcp(ip6h + 1, len);
+ return recv_verify_packet_tcp(ip6h + 1, payload_len);
else
- return recv_verify_packet_udp(ip6h + 1, len);
+ return recv_verify_packet_udp(ip6h + 1, payload_len);
}
/* return whether auxdata includes TP_STATUS_CSUM_VALID */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0291/1756] selftests: net: csum: filter packets by source address and port
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (289 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0290/1756] selftests: net: csum: Clean up recv_verify_packet_ipv6 Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0292/1756] power: supply: mp2629: Use the full batt_impedance_compensation name in the ABI document Greg Kroah-Hartman
` (707 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Willem de Bruijn, Simon Horman,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <willemb@google.com>
[ Upstream commit 8342c68435dd34b1ecd65b02fff9745cadab2616 ]
Add source address and port verification in recv_verify_packet_* and
recv_udp: non-matching packets are skipped.
The receiver reads from PF_PACKET and UDP sockets to verify incoming
packets to test hardware checksum offload. It did not validate the
packet source address or source port.
During tests expecting an invalid checksum (-E) or zero checksum (-Z),
background packets can fail the test.
For -Z, build_packet_udp chooses a specific source port that causes
the checksum to sum to zero. When running in receive-only mode (-R),
call build_packet in do_rx to compute the expected source port so
that source port filtering can be applied to -Z as well.
Also
- add an inter-packet delay to avoid drops from bursts.
- remove a comment that is no longer correct.
Fixes: 91a7de85600d ("selftests/net: add csum offload test")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260908155537.813889-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/net/lib/csum.c | 55 +++++++++++++++++++++++---
1 file changed, 50 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/net/lib/csum.c b/tools/testing/selftests/net/lib/csum.c
index 27437590eeb53..26c642c1f7fd3 100644
--- a/tools/testing/selftests/net/lib/csum.c
+++ b/tools/testing/selftests/net/lib/csum.c
@@ -2,8 +2,7 @@
/* Test hardware checksum offload: Rx + Tx, IPv4 + IPv6, TCP + UDP.
*
- * The test runs on two machines to exercise the NIC. For this reason it
- * is not integrated in kselftests.
+ * The test runs on two machines to exercise the NIC.
*
* CMD=$((./csum -[46] -[tu] -S $SADDR -D $DADDR -[RT] -r 1 $EXTRA_ARGS))
*
@@ -236,7 +235,8 @@ static void *build_packet_udp(void *_uh)
uh->source = 0;
uh->source = checksum(uh, IPPROTO_UDP, sizeof(*uh) + cfg_payload_len);
- fprintf(stderr, "tx: changing sport: %hu -> %hu\n",
+ fprintf(stderr, "%s: changing sport: %hu -> %hu\n",
+ cfg_do_tx ? "tx" : "rx",
cfg_port_src, ntohs(uh->source));
cfg_port_src = ntohs(uh->source);
}
@@ -249,7 +249,8 @@ static void *build_packet_udp(void *_uh)
if (cfg_bad_csum)
uh->check = ~uh->check;
- fprintf(stderr, "tx: sending checksum: 0x%x\n", uh->check);
+ if (cfg_do_tx)
+ fprintf(stderr, "tx: sending checksum: 0x%x\n", uh->check);
return uh + 1;
}
@@ -571,15 +572,36 @@ static int recv_prepare_packet(void)
static int recv_udp(int fd)
{
static char buf[MAX_PAYLOAD_LEN];
+ struct sockaddr_storage addr;
+ socklen_t addrlen;
int ret, count = 0;
while (1) {
- ret = recv(fd, buf, sizeof(buf), MSG_DONTWAIT);
+ addrlen = sizeof(addr);
+ ret = recvfrom(fd, buf, sizeof(buf), MSG_DONTWAIT,
+ (struct sockaddr *)&addr, &addrlen);
if (ret == -1 && errno == EAGAIN)
break;
if (ret == -1)
error(1, errno, "recv r");
+ if (cfg_family == PF_INET) {
+ struct sockaddr_in *sin = (void *)&addr;
+
+ if (sin->sin_addr.s_addr != cfg_saddr4.sin_addr.s_addr)
+ continue;
+ if (sin->sin_port != htons(cfg_port_src))
+ continue;
+ } else {
+ struct sockaddr_in6 *sin6 = (void *)&addr;
+
+ if (memcmp(&sin6->sin6_addr, &cfg_saddr6.sin6_addr,
+ sizeof(sin6->sin6_addr)))
+ continue;
+ if (sin6->sin6_port != htons(cfg_port_src))
+ continue;
+ }
+
fprintf(stderr, "rx: udp: len=%u\n", ret);
count++;
}
@@ -620,6 +642,9 @@ static int recv_verify_packet_tcp(void *th, int len)
if (len < sizeof(*tcph) || tcph->dest != htons(cfg_port_dst))
return -1;
+ if (tcph->source != htons(cfg_port_src))
+ return -1;
+
return recv_verify_csum(th, len, ntohs(tcph->source), tcph->check);
}
@@ -647,6 +672,9 @@ static int recv_verify_packet_udp(void *th, int len)
return recv_verify_packet_udp_encap(udph + 1,
len - sizeof(*udph));
+ if (udph->source != htons(cfg_port_src))
+ return -1;
+
return recv_verify_csum(th, len, ntohs(udph->source), udph->check);
}
@@ -659,6 +687,9 @@ static int recv_verify_packet_ipv4(void *nh, int len)
if (len < sizeof(*iph) || iph->protocol != proto)
return -1;
+ if (iph->saddr != cfg_saddr4.sin_addr.s_addr)
+ return -1;
+
ip_len = ntohs(iph->tot_len);
if (ip_len > len || ip_len < sizeof(*iph))
return -1;
@@ -680,6 +711,9 @@ static int recv_verify_packet_ipv6(void *nh, int len)
if (len < sizeof(*ip6h) || ip6h->nexthdr != proto)
return -1;
+ if (memcmp(&ip6h->saddr, &cfg_saddr6.sin6_addr, sizeof(ip6h->saddr)))
+ return -1;
+
payload_len = ntohs(ip6h->payload_len);
if (payload_len > len - sizeof(*ip6h))
return -1;
@@ -940,6 +974,9 @@ static void do_tx(void)
cfg_payload_len = rand() % MAX_PAYLOAD_LEN;
buf = build_packet(_buf, sizeof(_buf), &len);
}
+
+ /* avoid bursting */
+ usleep(20);
}
if (close(fd))
@@ -952,6 +989,14 @@ static void do_rx(int fdp, int fdr)
long tleft, tstop;
struct pollfd pfd;
+ if (!cfg_do_tx && cfg_zero_sum) {
+ static char _buf[MAX_HEADER_LEN + MAX_PAYLOAD_LEN];
+ int len;
+
+ /* calculate source port that causes csum to add up to zero */
+ build_packet(_buf, sizeof(_buf), &len);
+ }
+
tstop = gettimeofday_ms() + cfg_timeout_ms;
tleft = cfg_timeout_ms;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0292/1756] power: supply: mp2629: Use the full batt_impedance_compensation name in the ABI document
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (290 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0291/1756] selftests: net: csum: filter packets by source address and port Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0293/1756] power: supply: mm8013: Publish the OF module alias Greg Kroah-Hartman
` (706 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 1101833121a447999309a01f03d5b35bc1652e09 ]
drivers/power/supply/mp2629_charger.c creates the attribute with
DEVICE_ATTR_RW(batt_impedance_compensation). The ABI file documents it
under the truncated name batt_impedance_compen, which does not exist in
sysfs.
Use the full name.
Fixes: fe27f04e0cdc ("power: supply: mp2629: Add impedance compensation config")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260905101849.42830-1-kmehltretter@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/ABI/testing/sysfs-class-power-mp2629 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/ABI/testing/sysfs-class-power-mp2629 b/Documentation/ABI/testing/sysfs-class-power-mp2629
index 914d67caac0d7..a85f926ce9c26 100644
--- a/Documentation/ABI/testing/sysfs-class-power-mp2629
+++ b/Documentation/ABI/testing/sysfs-class-power-mp2629
@@ -1,4 +1,4 @@
-What: /sys/class/power_supply/mp2629_battery/batt_impedance_compen
+What: /sys/class/power_supply/mp2629_battery/batt_impedance_compensation
Date: April 2020
KernelVersion: 5.7
Description:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0293/1756] power: supply: mm8013: Publish the OF module alias
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (291 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0292/1756] power: supply: mp2629: Use the full batt_impedance_compensation name in the ABI document Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0294/1756] PM: wakeup: implement devm_device_init_wakeup() helper Greg Kroah-Hartman
` (705 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, hpp.iscas, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: hpp.iscas <hppiscas@163.com>
[ Upstream commit f265940e54d749c77507da083a3c16a481f5f5c5 ]
The MM8013 driver matches mitsumi,mm8013 Device Tree clients, but
exports only its legacy I2C ID table. The I2C core emits an OF modalias
for these clients rather than i2c:mm8013.
Publish the existing OF match table without changing gauge operations.
Fixes: c75f4bf6800b ("power: supply: Introduce MM8013 fuel gauge driver")
Signed-off-by: hpp.iscas <hppiscas@163.com>
Link: https://patch.msgid.link/20260905134500.67832-1-hppiscas@163.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/mm8013.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/power/supply/mm8013.c b/drivers/power/supply/mm8013.c
index 5bcfaeeda3db7..9fead1cebfc74 100644
--- a/drivers/power/supply/mm8013.c
+++ b/drivers/power/supply/mm8013.c
@@ -293,6 +293,7 @@ static const struct of_device_id mm8013_match_table[] = {
{ .compatible = "mitsumi,mm8013" },
{}
};
+MODULE_DEVICE_TABLE(of, mm8013_match_table);
static struct i2c_driver mm8013_i2c_driver = {
.probe = mm8013_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0294/1756] PM: wakeup: implement devm_device_init_wakeup() helper
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (292 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0293/1756] power: supply: mm8013: Publish the OF module alias Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0295/1756] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq() Greg Kroah-Hartman
` (704 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Belloni, Joe Hattori,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
[ Upstream commit b317268368546d6401af788648668f82e3ba1bd3 ]
Some drivers that enable device wakeup fail to properly disable it
during their cleanup, which results in a memory leak.
To address this, introduce devm_device_init_wakeup(), a managed variant
of device_init_wakeup(dev, true).
With this managed helper, wakeup functionality will be automatically
disabled when the device is released, ensuring a more reliable cleanup
process.
This need for this addition arose during a previous discussion [1].
Link: https://lore.kernel.org/linux-rtc/20241212100403.3799667-1-joe@pf.is.s.u-tokyo.ac.jp/ [1]
Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20241218040935.1921416-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: ece9baab2a6e ("power: supply: bq24190_charger: use the wake irq API")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/pm_wakeup.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index 76cd1f9f13653..59d542f761fb7 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -240,4 +240,21 @@ static inline int device_init_wakeup(struct device *dev, bool enable)
return 0;
}
+static void device_disable_wakeup(void *dev)
+{
+ device_init_wakeup(dev, false);
+}
+
+/**
+ * devm_device_init_wakeup - Resource managed device wakeup initialization.
+ * @dev: Device to handle.
+ *
+ * This function is the devm managed version of device_init_wakeup(dev, true).
+ */
+static inline int devm_device_init_wakeup(struct device *dev)
+{
+ device_init_wakeup(dev, true);
+ return devm_add_action_or_reset(dev, device_disable_wakeup, dev);
+}
+
#endif /* _LINUX_PM_WAKEUP_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0295/1756] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (293 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0294/1756] PM: wakeup: implement devm_device_init_wakeup() helper Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0296/1756] power: supply: bq24190_charger: use the wake irq API Greg Kroah-Hartman
` (703 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peng Fan, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit fd8318a32573d73eb20637a0c80689de0dc98169 ]
Add device-managed variant of dev_pm_set_wake_irq which automatically
clear the wake irq on device destruction to simplify error handling
and resource management in drivers.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250103-wake_irq-v2-1-e3aeff5e9966@nxp.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: ece9baab2a6e ("power: supply: bq24190_charger: use the wake irq API")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/power/wakeirq.c | 26 ++++++++++++++++++++++++++
include/linux/pm_wakeirq.h | 6 ++++++
2 files changed, 32 insertions(+)
diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index ddbe9cc91d23d..c0809d18fc540 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -106,6 +106,32 @@ void dev_pm_clear_wake_irq(struct device *dev)
}
EXPORT_SYMBOL_GPL(dev_pm_clear_wake_irq);
+static void devm_pm_clear_wake_irq(void *dev)
+{
+ dev_pm_clear_wake_irq(dev);
+}
+
+/**
+ * devm_pm_set_wake_irq - device-managed variant of dev_pm_set_wake_irq
+ * @dev: Device entry
+ * @irq: Device IO interrupt
+ *
+ *
+ * Attach a device IO interrupt as a wake IRQ, same with dev_pm_set_wake_irq,
+ * but the device will be auto clear wake capability on driver detach.
+ */
+int devm_pm_set_wake_irq(struct device *dev, int irq)
+{
+ int ret;
+
+ ret = dev_pm_set_wake_irq(dev, irq);
+ if (ret)
+ return ret;
+
+ return devm_add_action_or_reset(dev, devm_pm_clear_wake_irq, dev);
+}
+EXPORT_SYMBOL_GPL(devm_pm_set_wake_irq);
+
/**
* handle_threaded_wake_irq - Handler for dedicated wake-up interrupts
* @irq: Device specific dedicated wake-up interrupt
diff --git a/include/linux/pm_wakeirq.h b/include/linux/pm_wakeirq.h
index d9642c6cf8521..25b63ed51b765 100644
--- a/include/linux/pm_wakeirq.h
+++ b/include/linux/pm_wakeirq.h
@@ -10,6 +10,7 @@ extern int dev_pm_set_wake_irq(struct device *dev, int irq);
extern int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq);
extern int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq);
extern void dev_pm_clear_wake_irq(struct device *dev);
+extern int devm_pm_set_wake_irq(struct device *dev, int irq);
#else /* !CONFIG_PM */
@@ -32,5 +33,10 @@ static inline void dev_pm_clear_wake_irq(struct device *dev)
{
}
+static inline int devm_pm_set_wake_irq(struct device *dev, int irq)
+{
+ return 0;
+}
+
#endif /* CONFIG_PM */
#endif /* _LINUX_PM_WAKEIRQ_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0296/1756] power: supply: bq24190_charger: use the wake irq API
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (294 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0295/1756] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0297/1756] power: supply: bq2515x: Propagate charge-enable read errors Greg Kroah-Hartman
` (702 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ryan Brue, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Brue <ryanbrue.dev@gmail.com>
[ Upstream commit ece9baab2a6e79224d3f591893be23b540b1625f ]
bq24190_probe() calls enable_irq_wake() on the charger interrupt and
never calls disable_irq_wake(). That is wrong in three ways.
It is unbalanced. free_irq() does not touch desc->wake_depth -- only
irq_set_irq_wake() does -- so after the driver is unbound the descriptor
is still one wake reference deep and the irqchip is still configured for
wake, forever, for an interrupt nobody owns any more.
It ignores the device's wakeup policy. The chip is made a system wake
source whether or not anyone asked for it, and because
device_init_wakeup() is never called there is no power/wakeup attribute
for userspace to say otherwise. A board that would rather not be woken
by its charger has no way to express that.
And it arms the interrupt for wake permanently, from probe onwards,
rather than for the sleep it is meant to cover.
Use the wake irq API instead: devm_device_init_wakeup() to make the
device wakeup-capable and enabled -- preserving today's behaviour -- and
devm_pm_set_wake_irq() to hand the interrupt to the PM core, which arms
it in dpm_suspend_noirq() (only if device_may_wakeup(), immediately
before suspend_device_irqs()) and disarms it on resume. Both are unwound
by devm, so the reference is balanced on unbind, and userspace gets the
power/wakeup control it should have had.
No intended change in behaviour: charger events still wake the system by
default.
The same conversion was made to another charger driver for the same
reason, in commit 6c5393771c50 ("power: supply: qcom_pmi8998_charger: fix
wakeirq").
Fixes: f385e6e2a153 ("power: bq24190_charger: Use PM runtime autosuspend")
Assisted-by: LLM
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
Link: https://patch.msgid.link/20260908-rbrue-suez-upstreaming-bq24190_charger-use-wake-irq-api-v1-1-c3f10ae2a34a@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/bq24190_charger.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index c47f32f152e60..35611eca057e1 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -10,6 +10,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_wakeirq.h>
#include <linux/power_supply.h>
#include <linux/power/bq24190_charger.h>
#include <linux/regulator/driver.h>
@@ -2151,7 +2152,13 @@ static int bq24190_probe(struct i2c_client *client)
if (ret < 0)
goto out_charger;
- enable_irq_wake(client->irq);
+ ret = devm_device_init_wakeup(dev);
+ if (ret < 0)
+ goto out_charger;
+
+ ret = devm_pm_set_wake_irq(dev, client->irq);
+ if (ret < 0)
+ goto out_charger;
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0297/1756] power: supply: bq2515x: Propagate charge-enable read errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (295 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0296/1756] power: supply: bq24190_charger: use the wake irq API Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0298/1756] scsi: mpi3mr: Fix buffer overflow in BSG passthrough request copy Greg Kroah-Hartman
` (701 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linmao Li, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linmao Li <lilinmao@kylinos.cn>
[ Upstream commit 4a35810a847411c466a15d1737d11e8e818dc197 ]
bq2515x_get_charge_disable() returns bool even though reading the
charger-disable state can fail. A negative error is therefore converted to
true, so POWER_SUPPLY_PROP_STATUS reports NOT_CHARGING with success instead
of propagating the failure. The GPIO read is not checked for errors either.
Return an int from the helper, check both reads, and only convert a valid
charger-disable state to the charging-status boolean.
Fixes: 44908459275e ("power: supply: bq25150 introduce the bq25150")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Link: https://patch.msgid.link/20260824084217.670213-1-lilinmao@kylinos.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/bq2515x_charger.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/power/supply/bq2515x_charger.c b/drivers/power/supply/bq2515x_charger.c
index a3424f67f2b1d..0da6cc0ef5540 100644
--- a/drivers/power/supply/bq2515x_charger.c
+++ b/drivers/power/supply/bq2515x_charger.c
@@ -420,7 +420,7 @@ static int bq2515x_get_battery_current_now(struct bq2515x_device *bq2515x)
BQ2515X_ICHG_DIVISOR);
}
-static bool bq2515x_get_charge_disable(struct bq2515x_device *bq2515x)
+static int bq2515x_get_charge_disable(struct bq2515x_device *bq2515x)
{
int ret;
int ce_pin;
@@ -428,6 +428,8 @@ static bool bq2515x_get_charge_disable(struct bq2515x_device *bq2515x)
int charger_disable;
ce_pin = gpiod_get_value_cansleep(bq2515x->ce_gpio);
+ if (ce_pin < 0)
+ return ce_pin;
ret = regmap_read(bq2515x->regmap, BQ2515X_ICCTRL2, &icctrl2);
if (ret)
@@ -435,10 +437,7 @@ static bool bq2515x_get_charge_disable(struct bq2515x_device *bq2515x)
charger_disable = icctrl2 & BQ2515X_CHARGER_DISABLE;
- if (charger_disable || ce_pin)
- return true;
-
- return false;
+ return charger_disable || ce_pin;
}
static int bq2515x_set_charge_disable(struct bq2515x_device *bq2515x, int val)
@@ -615,7 +614,11 @@ static int bq2515x_charging_status(struct bq2515x_device *bq2515x,
else
status1_no_fault = false;
- ce_status = (!bq2515x_get_charge_disable(bq2515x));
+ ret = bq2515x_get_charge_disable(bq2515x);
+ if (ret < 0)
+ return ret;
+
+ ce_status = !ret;
/*
* If there are no faults and charging is enabled, then status is
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0298/1756] scsi: mpi3mr: Fix buffer overflow in BSG passthrough request copy
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (296 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0297/1756] power: supply: bq2515x: Propagate charge-enable read errors Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0299/1756] scsi: mpi3mr: Fix out-of-bounds read when copying BSG MPI requests Greg Kroah-Hartman
` (700 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 896abdd4d81f40575b05d593f7fe004935a6cf97 ]
The size of an incoming BSG request is checked using a variable that is
narrower than the field it is read from, so large values wrap and pass the
check. The copy that follows then uses the full value and writes past the
request buffer.
Widen the variable and copy only the amount that was checked.
Fixes: 506bc1a0d6ba ("scsi: mpi3mr: Add support for MPT commands")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-2-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 047a906aaf0bc..c05b8d0d1a5d0 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -2300,7 +2300,7 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
long rval = -EINVAL;
struct mpi3mr_ioc *mrioc = NULL;
u8 *mpi_req = NULL, *sense_buff_k = NULL;
- u8 mpi_msg_size = 0;
+ u32 mpi_msg_size = 0;
struct mpi3mr_bsg_packet *bsg_req = NULL;
struct mpi3mr_bsg_mptcmd *karg;
struct mpi3mr_buf_entry *buf_entries = NULL;
@@ -2453,7 +2453,7 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
rval = -EINVAL;
goto out;
}
- memcpy(mpi_req, sgl_iter, buf_entries->buf_len);
+ memcpy(mpi_req, sgl_iter, mpi_msg_size);
break;
default:
invalid_be = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0299/1756] scsi: mpi3mr: Fix out-of-bounds read when copying BSG MPI requests
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (297 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0298/1756] scsi: mpi3mr: Fix buffer overflow in BSG passthrough request copy Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0300/1756] scsi: mpi3mr: Fix I/O block counter leak on admin request post failure Greg Kroah-Hartman
` (699 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 9fac4cbd66d852958e8a8d0952eb57f8554ce83b ]
The MPI request is copied out of the caller supplied payload without first
checking that the requested amount is actually present, so the copy can
read past the end of the payload buffer.
Check the range before copying.
Fixes: 506bc1a0d6ba ("scsi: mpi3mr: Add support for MPT commands")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-3-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index c05b8d0d1a5d0..74e003e540535 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -2453,6 +2453,14 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
rval = -EINVAL;
goto out;
}
+ if (sgl_iter + mpi_msg_size >
+ dout_buf + job->request_payload.payload_len) {
+ dprint_bsg_err(mrioc, "%s: MPI request buf exceeds dout_buf\n",
+ __func__);
+ mutex_unlock(&mrioc->bsg_cmds.mutex);
+ rval = -EINVAL;
+ goto out;
+ }
memcpy(mpi_req, sgl_iter, mpi_msg_size);
break;
default:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0300/1756] scsi: mpi3mr: Fix I/O block counter leak on admin request post failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (298 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0299/1756] scsi: mpi3mr: Fix out-of-bounds read when copying BSG MPI requests Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0301/1756] scsi: mpi3mr: Fix target device reference leak in BSG task management Greg Kroah-Hartman
` (698 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 37e7d274272bc5e545e2d5f9261afa7f33f1cf49 ]
The per device I/O block counter is raised before a task management request
is posted and only lowered once the request completes. If the post itself
fails the counter stays raised and I/O to that device remains blocked.
Lower it on the failure path as well.
Fixes: 506bc1a0d6ba ("scsi: mpi3mr: Add support for MPT commands")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-4-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 74e003e540535..f08f5f7cf5753 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -2697,6 +2697,8 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
dprint_bsg_err(mrioc,
"%s: posting bsg request is failed\n", __func__);
rval = -EAGAIN;
+ if (block_io && stgt_priv)
+ atomic_dec(&stgt_priv->block_io);
goto out_unlock;
}
wait_for_completion_timeout(&mrioc->bsg_cmds.done,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0301/1756] scsi: mpi3mr: Fix target device reference leak in BSG task management
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (299 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0300/1756] scsi: mpi3mr: Fix I/O block counter leak on admin request post failure Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0302/1756] scsi: mpi3mr: Fix buffer overflow when caching log data Greg Kroah-Hartman
` (697 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit f0ec04bdf6156ed2ae7d86a8819dafdd9383b705 ]
The target device lookup takes a reference, but it is only dropped inside a
branch that also requires the SCSI target data to be set up. When it is
not, the reference is leaked.
Drop the reference whenever the lookup succeeded.
Fixes: 506bc1a0d6ba ("scsi: mpi3mr: Add support for MPT commands")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-5-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index f08f5f7cf5753..b51dbb4404565 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -2660,10 +2660,12 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
}
if (block_io) {
tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle);
- if (tgtdev && tgtdev->starget && tgtdev->starget->hostdata) {
- stgt_priv = (struct mpi3mr_stgt_priv_data *)
- tgtdev->starget->hostdata;
- atomic_inc(&stgt_priv->block_io);
+ if (tgtdev) {
+ if (tgtdev->starget && tgtdev->starget->hostdata) {
+ stgt_priv = (struct mpi3mr_stgt_priv_data *)
+ tgtdev->starget->hostdata;
+ atomic_inc(&stgt_priv->block_io);
+ }
mpi3mr_tgtdev_put(tgtdev);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0302/1756] scsi: mpi3mr: Fix buffer overflow when caching log data
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (300 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0301/1756] scsi: mpi3mr: Fix target device reference leak in BSG task management Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0303/1756] scsi: mpi3mr: Fix out-of-bounds reply frame access Greg Kroah-Hartman
` (696 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 9ff1af19c488efad66f2b803eefa0abd5fdac8f4 ]
Each log data slot holds a header followed by the payload, but the copy was
sized against the whole slot and so wrote one header length past the end of
it. Subtracting the header on its own is not enough either, because the
entry size is derived from the controller reply size and can be smaller
than the header.
Work out the payload room first and clamp the copy to it.
Fixes: 43ca11005098 ("scsi: mpi3mr: Add support for PEL commands")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-6-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index b51dbb4404565..3c409b3fdd925 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -2862,7 +2862,8 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
void mpi3mr_app_save_logdata(struct mpi3mr_ioc *mrioc, char *event_data,
u16 event_data_size)
{
- u32 index = mrioc->logdata_buf_idx, sz;
+ u32 index = mrioc->logdata_buf_idx;
+ size_t entry_payload_len, sz;
struct mpi3mr_logdata_entry *entry;
if (!(mrioc->logdata_buf))
@@ -2871,7 +2872,12 @@ void mpi3mr_app_save_logdata(struct mpi3mr_ioc *mrioc, char *event_data,
entry = (struct mpi3mr_logdata_entry *)
(mrioc->logdata_buf + (index * mrioc->logdata_entry_sz));
entry->valid_entry = 1;
- sz = min(mrioc->logdata_entry_sz, event_data_size);
+ if (mrioc->logdata_entry_sz > MPI3MR_BSG_LOGDATA_ENTRY_HEADER_SZ)
+ entry_payload_len = (size_t)mrioc->logdata_entry_sz -
+ MPI3MR_BSG_LOGDATA_ENTRY_HEADER_SZ;
+ else
+ entry_payload_len = 0;
+ sz = min_t(size_t, entry_payload_len, event_data_size);
memcpy(entry->data, event_data, sz);
mrioc->logdata_buf_idx =
((++index) % MPI3MR_BSG_LOGDATA_MAX_ENTRIES);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0303/1756] scsi: mpi3mr: Fix out-of-bounds reply frame access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (301 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0302/1756] scsi: mpi3mr: Fix buffer overflow when caching log data Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0304/1756] scsi: mpi3mr: Fix out-of-bounds sense buffer access Greg Kroah-Hartman
` (695 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit bcf0a5bed59acd5ae19d80e1f617c1a5b355af0b ]
The reply frame address reported on completion is only checked against the
start and the end of the pool. An address near the top can pass the check
while leaving less than a full frame, and an unaligned one resolves into
the middle of a frame instead of the start of one.
Require a whole frame to fit and the address to be frame aligned.
Fixes: 824a156633df ("scsi: mpi3mr: Base driver code")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-7-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index 25e8186f5df49..e651f2450e2fc 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -119,11 +119,16 @@ void mpi3mr_build_zero_len_sge(void *paddr)
void *mpi3mr_get_reply_virt_addr(struct mpi3mr_ioc *mrioc,
dma_addr_t phys_addr)
{
+ u64 offset;
+
if (!phys_addr)
return NULL;
+ offset = phys_addr - mrioc->reply_buf_dma;
+
if ((phys_addr < mrioc->reply_buf_dma) ||
- (phys_addr > mrioc->reply_buf_dma_max_address))
+ (phys_addr > mrioc->reply_buf_dma_max_address - mrioc->reply_sz) ||
+ do_div(offset, mrioc->reply_sz))
return NULL;
return mrioc->reply_buf + (phys_addr - mrioc->reply_buf_dma);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0304/1756] scsi: mpi3mr: Fix out-of-bounds sense buffer access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (302 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0303/1756] scsi: mpi3mr: Fix out-of-bounds reply frame access Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0305/1756] scsi: mpi3mr: Fix out-of-bounds bitmap access during device removal Greg Kroah-Hartman
` (694 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 7fea128f6b829ad834f21834d2605d28a45b903d ]
The sense buffer address reported on completion is turned into a virtual
address with no range check, so an address outside the pool resolves to
memory that does not belong to it.
Check that it lies within the pool and is correctly aligned.
Fixes: 824a156633df ("scsi: mpi3mr: Base driver code")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-8-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_fw.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index e651f2450e2fc..39c173586774d 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -137,9 +137,19 @@ void *mpi3mr_get_reply_virt_addr(struct mpi3mr_ioc *mrioc,
void *mpi3mr_get_sensebuf_virt_addr(struct mpi3mr_ioc *mrioc,
dma_addr_t phys_addr)
{
+ u64 offset;
+
if (!phys_addr)
return NULL;
+ offset = phys_addr - mrioc->sense_buf_dma;
+
+ if (phys_addr < mrioc->sense_buf_dma ||
+ (phys_addr > mrioc->sense_buf_dma +
+ (mrioc->num_sense_bufs * MPI3MR_SENSE_BUF_SZ) - MPI3MR_SENSE_BUF_SZ) ||
+ do_div(offset, MPI3MR_SENSE_BUF_SZ))
+ return NULL;
+
return mrioc->sense_buf + (phys_addr - mrioc->sense_buf_dma);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0305/1756] scsi: mpi3mr: Fix out-of-bounds bitmap access during device removal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (303 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0304/1756] scsi: mpi3mr: Fix out-of-bounds sense buffer access Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0306/1756] scsi: mpi3mr: Fix target device reference leak in device removal handshake Greg Kroah-Hartman
` (693 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 5dade59551d344d0308256edfef6bc3fb4202eb3 ]
Device handles reported by the controller are used to index the remove
pending bitmap and to build a task management request without being
compared against the maximum handle the controller reported.
Check the handle before using it.
Fixes: 13ef29ea4aa0 ("scsi: mpi3mr: Add support for device add/remove event handling")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-9-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 894d358ade75b..eb9477d70e681 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2285,7 +2285,8 @@ static void mpi3mr_dev_rmhs_complete_iou(struct mpi3mr_ioc *mrioc,
ioc_info(mrioc,
"%s :dev removal handshake completed successfully: handle(0x%04x)\n",
__func__, drv_cmd->dev_handle);
- clear_bit(drv_cmd->dev_handle, mrioc->removepend_bitmap);
+ if (drv_cmd->dev_handle < mrioc->facts.max_devhandle)
+ clear_bit(drv_cmd->dev_handle, mrioc->removepend_bitmap);
}
if (!list_empty(&mrioc->delayed_rmhs_list)) {
@@ -2399,6 +2400,20 @@ static void mpi3mr_dev_rmhs_send_tm(struct mpi3mr_ioc *mrioc, u16 handle,
struct mpi3mr_tgt_dev *tgtdev = NULL;
unsigned long flags;
+ if (handle >= mrioc->facts.max_devhandle) {
+ ioc_err(mrioc, "dev_remove_hs: handle(0x%04x) >= max_devhandle(0x%04x)\n",
+ handle, mrioc->facts.max_devhandle);
+ if (drv_cmd) {
+ cmd_idx = drv_cmd->host_tag - MPI3MR_HOSTTAG_DEVRMCMD_MIN;
+ drv_cmd->state = MPI3MR_CMD_NOTUSED;
+ drv_cmd->callback = NULL;
+ drv_cmd->dev_handle = MPI3MR_INVALID_DEV_HANDLE;
+ drv_cmd->retry_count = 0;
+ clear_bit(cmd_idx, mrioc->devrem_bitmap);
+ }
+ return;
+ }
+
spin_lock_irqsave(&mrioc->tgtdev_lock, flags);
tgtdev = __mpi3mr_get_tgtdev_by_handle(mrioc, handle);
if (tgtdev && (iou_rc == MPI3_CTRL_OP_REMOVE_DEVICE))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0306/1756] scsi: mpi3mr: Fix target device reference leak in device removal handshake
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (304 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0305/1756] scsi: mpi3mr: Fix out-of-bounds bitmap access during device removal Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0307/1756] scsi: mpi3mr: Fix out-of-bounds read in SAS topology change events Greg Kroah-Hartman
` (692 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit a04b0f3a17e32aa449fd896163a7b40efc29c4f5 ]
The device removal handshake looks up the target device to update its state
but never drops the reference that the lookup takes.
Drop it once the state has been updated.
Fixes: 13ef29ea4aa0 ("scsi: mpi3mr: Add support for device add/remove event handling")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-10-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index eb9477d70e681..b92026b350819 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2420,6 +2420,9 @@ static void mpi3mr_dev_rmhs_send_tm(struct mpi3mr_ioc *mrioc, u16 handle,
tgtdev->state = MPI3MR_DEV_REMOVE_HS_STARTED;
spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
+ if (tgtdev)
+ mpi3mr_tgtdev_put(tgtdev);
+
if (drv_cmd)
goto issue_cmd;
do {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0307/1756] scsi: mpi3mr: Fix out-of-bounds read in SAS topology change events
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (305 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0306/1756] scsi: mpi3mr: Fix target device reference leak in device removal handshake Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0308/1756] scsi: mpi3mr: Event processing debug improvement Greg Kroah-Hartman
` (691 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 9e220ce4bd0468e47cc9eea07e40799ebae6eda8 ]
The number of entries in a SAS topology change event is used to walk the
entry array without being compared against the amount of event data that
was received, so the walk can run past the end of the buffer.
Work out how many entries the payload can hold and skip the event if it
claims more.
Fixes: 13ef29ea4aa0 ("scsi: mpi3mr: Add support for device add/remove event handling")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-11-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index b92026b350819..e1cb435a59eed 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2713,12 +2713,28 @@ static void mpi3mr_sastopochg_evt_th(struct mpi3mr_ioc *mrioc,
struct mpi3_event_data_sas_topology_change_list *topo_evt =
(struct mpi3_event_data_sas_topology_change_list *)event_reply->event_data;
int i;
- u16 handle;
- u8 reason_code;
+ u16 handle, avail_len;
+ u8 reason_code, max_entries, num_entries;
struct mpi3mr_tgt_dev *tgtdev = NULL;
struct mpi3mr_stgt_priv_data *scsi_tgt_priv_data = NULL;
- for (i = 0; i < topo_evt->num_entries; i++) {
+ avail_len = event_reply->event_data_length * 4;
+ if (avail_len < offsetof(struct mpi3_event_data_sas_topology_change_list, phy_entry)) {
+ ioc_err(mrioc, "SAS topology event: event data too small (%u bytes)\n",
+ avail_len);
+ return;
+ }
+ max_entries = (avail_len -
+ offsetof(struct mpi3_event_data_sas_topology_change_list, phy_entry)) /
+ sizeof(struct mpi3_event_sas_topo_phy_entry);
+ num_entries = topo_evt->num_entries;
+ if (num_entries > max_entries) {
+ ioc_err(mrioc, "SAS topology event: num_entries(%d) exceeds max(%d)\n",
+ num_entries, max_entries);
+ return;
+ }
+
+ for (i = 0; i < num_entries; i++) {
handle = le16_to_cpu(topo_evt->phy_entry[i].attached_dev_handle);
if (!handle)
continue;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0308/1756] scsi: mpi3mr: Event processing debug improvement
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (306 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0307/1756] scsi: mpi3mr: Fix out-of-bounds read in SAS topology change events Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0309/1756] scsi: mpi3mr: Fix device loss during enclosure reboot due to zero link speed Greg Kroah-Hartman
` (690 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ranjan Kumar, Martin K. Petersen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ranjan Kumar <ranjan.kumar@broadcom.com>
[ Upstream commit 04f79c113ae77732e7e6674bd814e76c7a3453cf ]
Improve event process debugging. Implement more verbose event logging
throughout the driver.
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://lore.kernel.org/r/20250423092139.110206-1-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: 77554f01187d ("scsi: mpi3mr: Fix out-of-bounds read of event data")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 67 ++++++++++++++++++++++++---------
1 file changed, 50 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index e1cb435a59eed..03bbc9bfa6941 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -992,6 +992,10 @@ static int mpi3mr_report_tgtdev_to_host(struct mpi3mr_ioc *mrioc,
goto out;
}
}
+ dprint_event_bh(mrioc,
+ "exposed target device with handle(0x%04x), perst_id(%d)\n",
+ tgtdev->dev_handle, perst_id);
+ goto out;
} else
mpi3mr_report_tgtdev_to_sas_transport(mrioc, tgtdev);
out:
@@ -1351,9 +1355,9 @@ static void mpi3mr_devstatuschg_evt_bh(struct mpi3mr_ioc *mrioc,
(struct mpi3_event_data_device_status_change *)fwevt->event_data;
dev_handle = le16_to_cpu(evtdata->dev_handle);
- ioc_info(mrioc,
- "%s :device status change: handle(0x%04x): reason code(0x%x)\n",
- __func__, dev_handle, evtdata->reason_code);
+ dprint_event_bh(mrioc,
+ "processing device status change event bottom half for handle(0x%04x), rc(0x%02x)\n",
+ dev_handle, evtdata->reason_code);
switch (evtdata->reason_code) {
case MPI3_EVENT_DEV_STAT_RC_HIDDEN:
delete = 1;
@@ -1372,8 +1376,13 @@ static void mpi3mr_devstatuschg_evt_bh(struct mpi3mr_ioc *mrioc,
}
tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle);
- if (!tgtdev)
+ if (!tgtdev) {
+ dprint_event_bh(mrioc,
+ "processing device status change event bottom half,\n"
+ "cannot identify target device for handle(0x%04x), rc(0x%02x)\n",
+ dev_handle, evtdata->reason_code);
goto out;
+ }
if (uhide) {
tgtdev->is_hidden = 0;
if (!tgtdev->host_exposed)
@@ -1413,12 +1422,17 @@ static void mpi3mr_devinfochg_evt_bh(struct mpi3mr_ioc *mrioc,
perst_id = le16_to_cpu(dev_pg0->persistent_id);
dev_handle = le16_to_cpu(dev_pg0->dev_handle);
- ioc_info(mrioc,
- "%s :Device info change: handle(0x%04x): persist_id(0x%x)\n",
- __func__, dev_handle, perst_id);
+ dprint_event_bh(mrioc,
+ "processing device info change event bottom half for handle(0x%04x), perst_id(%d)\n",
+ dev_handle, perst_id);
tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle);
- if (!tgtdev)
+ if (!tgtdev) {
+ dprint_event_bh(mrioc,
+ "cannot identify target device for device info\n"
+ "change event handle(0x%04x), perst_id(%d)\n",
+ dev_handle, perst_id);
goto out;
+ }
mpi3mr_update_tgtdev(mrioc, tgtdev, dev_pg0, false);
if (!tgtdev->is_hidden && !tgtdev->host_exposed)
mpi3mr_report_tgtdev_to_host(mrioc, perst_id);
@@ -2019,8 +2033,11 @@ static void mpi3mr_fwevt_bh(struct mpi3mr_ioc *mrioc,
mpi3mr_fwevt_del_from_list(mrioc, fwevt);
mrioc->current_event = fwevt;
- if (mrioc->stop_drv_processing)
+ if (mrioc->stop_drv_processing) {
+ dprint_event_bh(mrioc, "ignoring event(0x%02x) in the bottom half handler\n"
+ "due to stop_drv_processing\n", fwevt->event_id);
goto out;
+ }
if (mrioc->unrecoverable) {
dprint_event_bh(mrioc,
@@ -2032,6 +2049,9 @@ static void mpi3mr_fwevt_bh(struct mpi3mr_ioc *mrioc,
if (!fwevt->process_evt)
goto evt_ack;
+ dprint_event_bh(mrioc, "processing event(0x%02x) in the bottom half handler\n",
+ fwevt->event_id);
+
switch (fwevt->event_id) {
case MPI3_EVENT_DEVICE_ADDED:
{
@@ -2804,6 +2824,9 @@ static void mpi3mr_devstatuschg_evt_th(struct mpi3mr_ioc *mrioc,
goto out;
dev_handle = le16_to_cpu(evtdata->dev_handle);
+ dprint_event_th(mrioc,
+ "device status change event top half with rc(0x%02x) for handle(0x%04x)\n",
+ evtdata->reason_code, dev_handle);
switch (evtdata->reason_code) {
case MPI3_EVENT_DEV_STAT_RC_INT_DEVICE_RESET_STRT:
@@ -2827,8 +2850,12 @@ static void mpi3mr_devstatuschg_evt_th(struct mpi3mr_ioc *mrioc,
}
tgtdev = mpi3mr_get_tgtdev_by_handle(mrioc, dev_handle);
- if (!tgtdev)
+ if (!tgtdev) {
+ dprint_event_th(mrioc,
+ "processing device status change event could not identify device for handle(0x%04x)\n",
+ dev_handle);
goto out;
+ }
if (hide)
tgtdev->is_hidden = hide;
if (tgtdev->starget && tgtdev->starget->hostdata) {
@@ -2906,13 +2933,13 @@ static void mpi3mr_energypackchg_evt_th(struct mpi3mr_ioc *mrioc,
u16 shutdown_timeout = le16_to_cpu(evtdata->shutdown_timeout);
if (shutdown_timeout <= 0) {
- ioc_warn(mrioc,
+ dprint_event_th(mrioc,
"%s :Invalid Shutdown Timeout received = %d\n",
__func__, shutdown_timeout);
return;
}
- ioc_info(mrioc,
+ dprint_event_th(mrioc,
"%s :Previous Shutdown Timeout Value = %d New Shutdown Timeout Value = %d\n",
__func__, mrioc->facts.shutdown_timeout, shutdown_timeout);
mrioc->facts.shutdown_timeout = shutdown_timeout;
@@ -3017,9 +3044,11 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
struct mpi3_device_page0 *dev_pg0 =
(struct mpi3_device_page0 *)event_reply->event_data;
if (mpi3mr_create_tgtdev(mrioc, dev_pg0))
- ioc_err(mrioc,
- "%s :Failed to add device in the device add event\n",
- __func__);
+ dprint_event_th(mrioc,
+ "failed to process device added event for handle(0x%04x),\n"
+ "perst_id(%d) in the event top half handler\n",
+ le16_to_cpu(dev_pg0->dev_handle),
+ le16_to_cpu(dev_pg0->persistent_id));
else
process_evt_bh = 1;
break;
@@ -3082,11 +3111,15 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
break;
}
if (process_evt_bh || ack_req) {
+ dprint_event_th(mrioc,
+ "scheduling bottom half handler for event(0x%02x),ack_required=%d\n",
+ evt_type, ack_req);
sz = event_reply->event_data_length * 4;
fwevt = mpi3mr_alloc_fwevt(sz);
if (!fwevt) {
- ioc_info(mrioc, "%s :failure at %s:%d/%s()!\n",
- __func__, __FILE__, __LINE__, __func__);
+ dprint_event_th(mrioc,
+ "failed to schedule bottom half handler for\n"
+ "event(0x%02x), ack_required=%d\n", evt_type, ack_req);
return;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0309/1756] scsi: mpi3mr: Fix device loss during enclosure reboot due to zero link speed
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (307 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0308/1756] scsi: mpi3mr: Event processing debug improvement Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0310/1756] scsi: mpi3mr: Rename log data save helper to reflect threaded/BH context Greg Kroah-Hartman
` (689 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit d6c8e8b7c98c3cb326515ef4bc5c57e16ac5ae4e ]
During enclosure reboot or expander reset, firmware may report a link
speed of 0 in "Device Add" events while the link is still coming up.
The driver drops such devices, leaving them missing even after the link
recovers.
Fix this by treating link speed 0 as 1.5 Gbps during device addition so
the device is exposed to the OS. The actual link speed will be updated
later when link-up events arrive.
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://lore.kernel.org/r/20250820084138.228471-2-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: 77554f01187d ("scsi: mpi3mr: Fix out-of-bounds read of event data")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 8 ++++----
drivers/scsi/mpi3mr/mpi3mr_transport.c | 11 +++++++++--
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 03bbc9bfa6941..53408fb9fc407 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2049,8 +2049,8 @@ static void mpi3mr_fwevt_bh(struct mpi3mr_ioc *mrioc,
if (!fwevt->process_evt)
goto evt_ack;
- dprint_event_bh(mrioc, "processing event(0x%02x) in the bottom half handler\n",
- fwevt->event_id);
+ dprint_event_bh(mrioc, "processing event(0x%02x) -(0x%08x) in the bottom half handler\n",
+ fwevt->event_id, fwevt->evt_ctx);
switch (fwevt->event_id) {
case MPI3_EVENT_DEVICE_ADDED:
@@ -3112,8 +3112,8 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
}
if (process_evt_bh || ack_req) {
dprint_event_th(mrioc,
- "scheduling bottom half handler for event(0x%02x),ack_required=%d\n",
- evt_type, ack_req);
+ "scheduling bottom half handler for event(0x%02x) - (0x%08x), ack_required=%d\n",
+ evt_type, le32_to_cpu(event_reply->event_context), ack_req);
sz = event_reply->event_data_length * 4;
fwevt = mpi3mr_alloc_fwevt(sz);
if (!fwevt) {
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index c0364fb5b0c5b..97e8947b46d16 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -413,9 +413,11 @@ static void mpi3mr_remove_device_by_sas_address(struct mpi3mr_ioc *mrioc,
sas_address, hba_port);
if (tgtdev) {
if (!list_empty(&tgtdev->list)) {
- list_del_init(&tgtdev->list);
was_on_tgtdev_list = 1;
- mpi3mr_tgtdev_put(tgtdev);
+ if (tgtdev->state == MPI3MR_DEV_REMOVE_HS_STARTED) {
+ list_del_init(&tgtdev->list);
+ mpi3mr_tgtdev_put(tgtdev);
+ }
}
}
spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
@@ -2087,6 +2089,8 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle)
link_rate = (expander_pg1.negotiated_link_rate &
MPI3_SAS_NEG_LINK_RATE_LOGICAL_MASK) >>
MPI3_SAS_NEG_LINK_RATE_LOGICAL_SHIFT;
+ if (link_rate < MPI3_SAS_NEG_LINK_RATE_1_5)
+ link_rate = MPI3_SAS_NEG_LINK_RATE_1_5;
mpi3mr_update_links(mrioc, sas_address_parent,
handle, i, link_rate, hba_port);
}
@@ -2396,6 +2400,9 @@ int mpi3mr_report_tgtdev_to_sas_transport(struct mpi3mr_ioc *mrioc,
link_rate = mpi3mr_get_sas_negotiated_logical_linkrate(mrioc, tgtdev);
+ if (link_rate < MPI3_SAS_NEG_LINK_RATE_1_5)
+ link_rate = MPI3_SAS_NEG_LINK_RATE_1_5;
+
mpi3mr_update_links(mrioc, sas_address_parent, tgtdev->dev_handle,
parent_phy_number, link_rate, hba_port);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0310/1756] scsi: mpi3mr: Rename log data save helper to reflect threaded/BH context
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (308 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0309/1756] scsi: mpi3mr: Fix device loss during enclosure reboot due to zero link speed Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0311/1756] scsi: mpi3mr: Fix out-of-bounds read of event data Greg Kroah-Hartman
` (688 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ranjan Kumar, Martin K. Petersen,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ranjan Kumar <ranjan.kumar@broadcom.com>
[ Upstream commit d0d19250ed81907eac707be8221eb31e5b96b647 ]
Log data events can be processed from BH and threaded contexts. Rename
the save helper to document its intended usage and improve readability
of the event handling flow.
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://patch.msgid.link/20260116060719.32937-3-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Stable-dep-of: 77554f01187d ("scsi: mpi3mr: Fix out-of-bounds read of event data")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr.h | 2 +-
drivers/scsi/mpi3mr/mpi3mr_app.c | 4 ++--
drivers/scsi/mpi3mr/mpi3mr_os.c | 7 ++++++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h
index 840195373084e..07e8ffb4d0565 100644
--- a/drivers/scsi/mpi3mr/mpi3mr.h
+++ b/drivers/scsi/mpi3mr/mpi3mr.h
@@ -1488,7 +1488,7 @@ void mpi3mr_pel_get_seqnum_complete(struct mpi3mr_ioc *mrioc,
struct mpi3mr_drv_cmd *drv_cmd);
int mpi3mr_pel_get_seqnum_post(struct mpi3mr_ioc *mrioc,
struct mpi3mr_drv_cmd *drv_cmd);
-void mpi3mr_app_save_logdata(struct mpi3mr_ioc *mrioc, char *event_data,
+void mpi3mr_app_save_logdata_th(struct mpi3mr_ioc *mrioc, char *event_data,
u16 event_data_size);
struct mpi3mr_enclosure_node *mpi3mr_enclosure_find_by_handle(
struct mpi3mr_ioc *mrioc, u16 handle);
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 3c409b3fdd925..337b6ebda49c0 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -2847,7 +2847,7 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
}
/**
- * mpi3mr_app_save_logdata - Save Log Data events
+ * mpi3mr_app_save_logdata_th - Save Log Data events
* @mrioc: Adapter instance reference
* @event_data: event data associated with log data event
* @event_data_size: event data size to copy
@@ -2859,7 +2859,7 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
*
* Return:Nothing
*/
-void mpi3mr_app_save_logdata(struct mpi3mr_ioc *mrioc, char *event_data,
+void mpi3mr_app_save_logdata_th(struct mpi3mr_ioc *mrioc, char *event_data,
u16 event_data_size)
{
u32 index = mrioc->logdata_buf_idx;
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 53408fb9fc407..18d3ebdb62e3c 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1954,7 +1954,7 @@ static void mpi3mr_pcietopochg_evt_bh(struct mpi3mr_ioc *mrioc,
static void mpi3mr_logdata_evt_bh(struct mpi3mr_ioc *mrioc,
struct mpi3mr_fwevt *fwevt)
{
- mpi3mr_app_save_logdata(mrioc, fwevt->event_data,
+ mpi3mr_app_save_logdata_th(mrioc, fwevt->event_data,
fwevt->event_data_size);
}
@@ -3084,6 +3084,11 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
}
case MPI3_EVENT_DEVICE_INFO_CHANGED:
case MPI3_EVENT_LOG_DATA:
+
+ sz = event_reply->event_data_length * 4;
+ mpi3mr_app_save_logdata_th(mrioc,
+ (char *)event_reply->event_data, sz);
+ break;
case MPI3_EVENT_ENCL_DEVICE_STATUS_CHANGE:
case MPI3_EVENT_ENCL_DEVICE_ADDED:
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0311/1756] scsi: mpi3mr: Fix out-of-bounds read of event data
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (309 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0310/1756] scsi: mpi3mr: Rename log data save helper to reflect threaded/BH context Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0312/1756] scsi: mpi3mr: Fix out-of-bounds phy array access on link change Greg Kroah-Hartman
` (687 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 77554f01187d91c20f04d2a8e28270943ed64cca ]
The event data length from the reply is used as is, both when caching log
data and when sizing the buffer handed to the bottom half. A length larger
than the frame makes both of them read past the end of it.
Clamp the length to what the frame can hold.
Fixes: 13ef29ea4aa0 ("scsi: mpi3mr: Add support for device add/remove event handling")
Fixes: d0d19250ed81 ("scsi: mpi3mr: Rename log data save helper to reflect threaded/BH context")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-12-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 18d3ebdb62e3c..0ce10b4bf0ffe 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -3024,7 +3024,7 @@ void mpi3mr_add_event_wait_for_device_refresh(struct mpi3mr_ioc *mrioc)
void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
struct mpi3_event_notification_reply *event_reply)
{
- u16 evt_type, sz;
+ u16 evt_type, sz, avail_reply_room;
struct mpi3mr_fwevt *fwevt = NULL;
bool ack_req = 0, process_evt_bh = 0;
@@ -3085,7 +3085,12 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
case MPI3_EVENT_DEVICE_INFO_CHANGED:
case MPI3_EVENT_LOG_DATA:
- sz = event_reply->event_data_length * 4;
+ if (mrioc->reply_sz > offsetof(struct mpi3_event_notification_reply, event_data))
+ avail_reply_room = mrioc->reply_sz -
+ offsetof(struct mpi3_event_notification_reply, event_data);
+ else
+ avail_reply_room = 0;
+ sz = min_t(u16, event_reply->event_data_length * 4, avail_reply_room);
mpi3mr_app_save_logdata_th(mrioc,
(char *)event_reply->event_data, sz);
break;
@@ -3119,7 +3124,12 @@ void mpi3mr_os_handle_events(struct mpi3mr_ioc *mrioc,
dprint_event_th(mrioc,
"scheduling bottom half handler for event(0x%02x) - (0x%08x), ack_required=%d\n",
evt_type, le32_to_cpu(event_reply->event_context), ack_req);
- sz = event_reply->event_data_length * 4;
+ if (mrioc->reply_sz > offsetof(struct mpi3_event_notification_reply, event_data))
+ avail_reply_room = mrioc->reply_sz -
+ offsetof(struct mpi3_event_notification_reply, event_data);
+ else
+ avail_reply_room = 0;
+ sz = min_t(u16, event_reply->event_data_length * 4, avail_reply_room);
fwevt = mpi3mr_alloc_fwevt(sz);
if (!fwevt) {
dprint_event_th(mrioc,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0312/1756] scsi: mpi3mr: Fix out-of-bounds phy array access on link change
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (310 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0311/1756] scsi: mpi3mr: Fix out-of-bounds read of event data Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0313/1756] scsi: mpi3mr: Fix buffer overflow in the BSG target device map Greg Kroah-Hartman
` (686 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit f67caaa2521a3c8f931d1e679d831ba5ca654794 ]
The phy number that comes with a link change is used to index the node's
phy array without being compared against the number of phys allocated for
that node.
Check it first.
Fixes: 42fc9fee116f ("scsi: mpi3mr: Add helper functions to manage device's port")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-13-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_transport.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index 97e8947b46d16..6bfac88a522c8 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -1091,6 +1091,13 @@ void mpi3mr_update_links(struct mpi3mr_ioc *mrioc,
return;
}
+ if (phy_number >= mr_sas_node->num_phys) {
+ spin_unlock_irqrestore(&mrioc->sas_node_lock, flags);
+ ioc_err(mrioc, "%s: phy_number(%d) >= num_phys(%d)\n",
+ __func__, phy_number, mr_sas_node->num_phys);
+ return;
+ }
+
mr_sas_phy = &mr_sas_node->phy[phy_number];
mr_sas_phy->attached_handle = handle;
spin_unlock_irqrestore(&mrioc->sas_node_lock, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0313/1756] scsi: mpi3mr: Fix buffer overflow in the BSG target device map
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (311 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0312/1756] scsi: mpi3mr: Fix out-of-bounds phy array access on link change Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0314/1756] scsi: mpi3mr: Fix out-of-bounds read in PCIe topology change events Greg Kroah-Hartman
` (685 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 203b3072e7aa10d98b3f2b766693ea925cfc571d ]
The size of the target device map buffer is held in a u16 while the number
of devices it is derived from is not bounded to fit. With enough devices
the size wraps, a short buffer is allocated, and the loop that fills it
writes past the end.
Do the calculation in size_t.
Fixes: fb428a2005fc ("scsi: mpi3mr: Fix issues in mpi3mr_get_all_tgt_info()")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-14-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 337b6ebda49c0..a0c181049cf04 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -1382,7 +1382,8 @@ static long mpi3mr_bsg_pel_enable(struct mpi3mr_ioc *mrioc,
static long mpi3mr_get_all_tgt_info(struct mpi3mr_ioc *mrioc,
struct bsg_job *job)
{
- u16 num_devices = 0, i = 0, size;
+ u16 num_devices = 0, i = 0;
+ size_t size;
unsigned long flags;
struct mpi3mr_tgt_dev *tgtdev;
struct mpi3mr_device_map_info *devmap_info = NULL;
@@ -1408,8 +1409,8 @@ static long mpi3mr_get_all_tgt_info(struct mpi3mr_ioc *mrioc,
return 0;
}
- kern_entrylen = num_devices * sizeof(*devmap_info);
- size = sizeof(u64) + kern_entrylen;
+ kern_entrylen = (uint32_t)num_devices * sizeof(*devmap_info);
+ size = sizeof(u64) + (size_t)kern_entrylen;
alltgt_info = kzalloc(size, GFP_KERNEL);
if (!alltgt_info)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0314/1756] scsi: mpi3mr: Fix out-of-bounds read in PCIe topology change events
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (312 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0313/1756] scsi: mpi3mr: Fix buffer overflow in the BSG target device map Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0315/1756] scsi: mpi3mr: zero out diagnostic buffer status memory Greg Kroah-Hartman
` (684 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 7d572b4dc4ed0494e67097d4b7368666655f5c99 ]
The number of entries in a PCIe topology change event is used to walk the
entry array without being compared against the amount of event data that
was received.
Bound the entry count to the received event data before use.
Fixes: 8e653455547a ("scsi: mpi3mr: Add support for PCIe device event handling")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-15-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 0ce10b4bf0ffe..3bb0d96f58f8a 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2667,12 +2667,28 @@ static void mpi3mr_pcietopochg_evt_th(struct mpi3mr_ioc *mrioc,
struct mpi3_event_data_pcie_topology_change_list *topo_evt =
(struct mpi3_event_data_pcie_topology_change_list *)event_reply->event_data;
int i;
- u16 handle;
- u8 reason_code;
+ u16 handle, avail_len;
+ u8 reason_code, max_entries, num_entries;
struct mpi3mr_tgt_dev *tgtdev = NULL;
struct mpi3mr_stgt_priv_data *scsi_tgt_priv_data = NULL;
- for (i = 0; i < topo_evt->num_entries; i++) {
+ avail_len = event_reply->event_data_length * 4;
+ if (avail_len < offsetof(struct mpi3_event_data_pcie_topology_change_list, port_entry)) {
+ ioc_err(mrioc, "PCIe topology event: event data too small (%u bytes)\n",
+ avail_len);
+ return;
+ }
+ max_entries = (avail_len -
+ offsetof(struct mpi3_event_data_pcie_topology_change_list, port_entry)) /
+ sizeof(struct mpi3_event_pcie_topo_port_entry);
+ num_entries = topo_evt->num_entries;
+ if (num_entries > max_entries) {
+ ioc_err(mrioc, "PCIe topology event: num_entries(%d) exceeds max(%d)\n",
+ num_entries, max_entries);
+ return;
+ }
+
+ for (i = 0; i < num_entries; i++) {
handle = le16_to_cpu(topo_evt->port_entry[i].attached_dev_handle);
if (!handle)
continue;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0315/1756] scsi: mpi3mr: zero out diagnostic buffer status memory
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (313 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0314/1756] scsi: mpi3mr: Fix out-of-bounds read in PCIe topology change events Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0316/1756] scsi: mpi3mr: Fix use-after-free of the firmware event workqueue Greg Kroah-Hartman
` (683 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 052aea807cfbcefaf5b6ed8202f65da1fc65f4a0 ]
Memory allocated for the BSG diagnostic buffer status is not zeroed before
it is copied back to user space. Several fields in this structure are
reserved and never written by the driver. Use kzalloc() instead of
kmalloc() to zero out the allocated memory.
Fixes: 78b506984ebe ("scsi: mpi3mr: Add ioctl support for HDB")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-16-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index a0c181049cf04..e75badb31aa04 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -1160,7 +1160,7 @@ static long mpi3mr_bsg_query_hdb(struct mpi3mr_ioc *mrioc,
length = (sizeof(*hbd_status) + ((MPI3MR_MAX_NUM_HDB - 1) *
sizeof(*hbd_status_entry)));
- hbd_status = kmalloc(length, GFP_KERNEL);
+ hbd_status = kzalloc(length, GFP_KERNEL);
if (!hbd_status)
return -ENOMEM;
hbd_status_entry = &hbd_status->entry[0];
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0316/1756] scsi: mpi3mr: Fix use-after-free of the firmware event workqueue
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (314 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0315/1756] scsi: mpi3mr: zero out diagnostic buffer status memory Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0317/1756] scsi: mpi3mr: Fix NULL pointer dereference on PCI error recovery Greg Kroah-Hartman
` (682 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit c94c746e6c80439a4a9a0e1e20f2dae62a4d57ef ]
The enqueue path reads the workqueue pointer before taking the event lock,
while the remove path clears that pointer and destroys the workqueue while
holding it. The enqueue can therefore reach queue_work() after the
workqueue is gone.
Move the check inside the lock.
Fixes: 13ef29ea4aa0 ("scsi: mpi3mr: Add support for device add/remove event handling")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-17-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 3bb0d96f58f8a..852849d42ea99 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -233,10 +233,11 @@ static void mpi3mr_fwevt_add_to_list(struct mpi3mr_ioc *mrioc,
{
unsigned long flags;
- if (!mrioc->fwevt_worker_thread)
- return;
-
spin_lock_irqsave(&mrioc->fwevt_lock, flags);
+ if (!mrioc->fwevt_worker_thread) {
+ spin_unlock_irqrestore(&mrioc->fwevt_lock, flags);
+ return;
+ }
/* get fwevt reference count while adding it to fwevt_list */
mpi3mr_fwevt_get(fwevt);
INIT_LIST_HEAD(&fwevt->list);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0317/1756] scsi: mpi3mr: Fix NULL pointer dereference on PCI error recovery
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (315 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0316/1756] scsi: mpi3mr: Fix use-after-free of the firmware event workqueue Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0318/1756] iio: accel: kionix-kx022a: Fix IPOL macro name Greg Kroah-Hartman
` (681 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chandrakanth Patil,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
[ Upstream commit 2ba1d12b2629827fdb1116eb3c9f8566911f2034 ]
On a frozen PCI channel the driver unmaps the register window and frees the
interrupts, but leaves the firmware event workqueue running. An event
handler that is already in flight can still reach the register window after
it has been unmapped.
Stop event processing and drain the queue first, and start it again when
the channel resumes.
Fixes: 30bafe1774f0 ("scsi: mpi3mr: Support PCI Error Recovery callback handlers")
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Link: https://patch.msgid.link/20260825210411.301535-18-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 852849d42ea99..3ce4c21e87f2d 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -2034,9 +2034,11 @@ static void mpi3mr_fwevt_bh(struct mpi3mr_ioc *mrioc,
mpi3mr_fwevt_del_from_list(mrioc, fwevt);
mrioc->current_event = fwevt;
- if (mrioc->stop_drv_processing) {
- dprint_event_bh(mrioc, "ignoring event(0x%02x) in the bottom half handler\n"
- "due to stop_drv_processing\n", fwevt->event_id);
+ if (mrioc->stop_drv_processing || mrioc->pci_err_recovery) {
+ dprint_event_bh(mrioc,
+ "ignoring event(0x%02x) in the bottom half handler\n"
+ "due to stop_drv_processing or pci_err_recovery\n",
+ fwevt->event_id);
goto out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0318/1756] iio: accel: kionix-kx022a: Fix IPOL macro name
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (316 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0317/1756] scsi: mpi3mr: Fix NULL pointer dereference on PCI error recovery Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0319/1756] iio: imu: adis16400: Check return value of spi_setup() Greg Kroah-Hartman
` (680 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matti Vaittinen, Mehdi Djait,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matti Vaittinen <mazziesaccount@gmail.com>
[ Upstream commit 4a4b0d75622f7d911c96045b328fe2e88be05072 ]
The "interrupt polarity high"-macro for KX022A variant is defined as:
"#define KX022A_MASK_IPOL KX022A_MASK_IPOL1"
However, the KX022A_MASK_IPOL1 is not defined anywhere, so actually
using the KX022A_IPOL_HIGH would produce a compile error.
Fix the define by using correct mask.
Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer")
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/accel/kionix-kx022a.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
index 7060438ad88c8..95df968d341f1 100644
--- a/drivers/iio/accel/kionix-kx022a.h
+++ b/drivers/iio/accel/kionix-kx022a.h
@@ -64,7 +64,7 @@
#define KX022A_MASK_IEN BIT(5)
#define KX022A_MASK_IPOL BIT(4)
#define KX022A_IPOL_LOW 0
-#define KX022A_IPOL_HIGH KX022A_MASK_IPOL1
+#define KX022A_IPOL_HIGH KX022A_MASK_IPOL
#define KX022A_MASK_ITYP BIT(3)
#define KX022A_ITYP_PULSE KX022A_MASK_ITYP
#define KX022A_ITYP_LEVEL 0
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0319/1756] iio: imu: adis16400: Check return value of spi_setup()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (317 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0318/1756] iio: accel: kionix-kx022a: Fix IPOL macro name Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0320/1756] efi/libstub: Fix efi_set_event_at() parameter documentation Greg Kroah-Hartman
` (679 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Salah Triki, Andy Shevchenko,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Salah Triki <salah.triki@gmail.com>
[ Upstream commit a7c07602e00596a45de8a4a700af96392953ed38 ]
In adis16400_initial_setup(), the return value of spi_setup() was ignored.
If SPI configuration fails, the driver would proceed with the
initialization anyway, leading to undefined behavior or silent failures
during device setup.
Check the return value of spi_setup() and return the error code immediately
if it fails.
Fixes: cd888a17f95f ("staging:iio:adis16400: Use adis library")
Signed-off-by: Salah Triki <salah.triki@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/imu/adis16400.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c
index 2c291f6920f44..7c658122b6305 100644
--- a/drivers/iio/imu/adis16400.c
+++ b/drivers/iio/imu/adis16400.c
@@ -433,7 +433,10 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev)
else
st->adis.spi->max_speed_hz = ADIS16400_SPI_FAST;
st->adis.spi->mode = SPI_MODE_3;
- spi_setup(st->adis.spi);
+
+ ret = spi_setup(st->adis.spi);
+ if (ret)
+ return ret;
ret = __adis_initial_startup(&st->adis);
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0320/1756] efi/libstub: Fix efi_set_event_at() parameter documentation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (318 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0319/1756] iio: imu: adis16400: Check return value of spi_setup() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0321/1756] kernfs: fix up the unlocked attribute reads on the creation paths Greg Kroah-Hartman
` (678 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Ard Biesheuvel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit c12a3a4b35e47fd511fbd550d3637318be41c4eb ]
efi_set_event_at() documents ids although its array index argument is
named idx. This produces missing and excess parameter warnings.
Match the argument name and fix the adjacent spelling of array.
Fixes: 8c0a839c2bcc ("efi/libstub: Descriptions for stub helper functions")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/efistub.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index eebcdf653d072..a2838e36f3f9f 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -220,8 +220,8 @@ typedef void (__efiapi *efi_event_notify_t)(efi_event_t, void *);
* efi_set_event_at() - add event to events array
*
* @events: array of UEFI events
- * @ids: index where to put the event in the array
- * @event: event to add to the aray
+ * @idx: index where to put the event in the array
+ * @event: event to add to the array
*
* boottime->wait_for_event() takes an array of events as input.
* Provide a helper to set it up correctly for mixed mode.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0321/1756] kernfs: fix up the unlocked attribute reads on the creation paths
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (319 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0320/1756] efi/libstub: Fix efi_set_event_at() parameter documentation Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0322/1756] PCI: xgene: Use managed clock for PCIe controller Greg Kroah-Hartman
` (677 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tejun Heo, Shakeel Butt,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shakeel Butt <shakeel.butt@linux.dev>
[ Upstream commit 81bdc85b4c086502f4446a58eb5d25f29bb5e9f7 ]
Two creation paths read a live node's attributes without holding
kernfs_iattr_rwsem, which kernfs_iop_setattr() takes for writing. They
need different fixes.
kernfs_create_link() copies the target's ia_uid and then its ia_gid into
the new link. A chown of the target between the two reads leaves the
link with the old uid and the new gid, an owner the target never had.
Read both under the rwsem.
kernfs_new_node() reads the parent's mode and ia_gid for S_ISGID
inheritance. Either value is fine there: the node does not exist yet,
so nothing orders a racing chmod or chown against the creation. Taking
the rwsem would only pick between two answers that are both right. Mark
the reads with READ_ONCE() instead.
The pointer that leads to them is already fine: __kernfs_iattrs()
publishes kernfs_node::iattr with try_cmpxchg(), and both sides read it
with READ_ONCE(), like the rest of fs/kernfs.
The Fixes tag is for the symlink half. kernfs_create_link() has read
the pair unlocked since it started copying the target's owner; only the
name of the lock its writer takes has changed. The READ_ONCE() markings
are not a fix.
Fixes: 488dee96bb62 ("kernfs: allow creating kernfs objects with arbitrary uid/gid")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20260905191613.3143937-5-shakeel.butt@linux.dev
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/kernfs/dir.c | 12 +++++++++---
fs/kernfs/symlink.c | 17 ++++++++++++++---
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 5dc90a498e75d..0eda24cf0ef3d 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -685,13 +685,19 @@ struct kernfs_node *kernfs_new_node(struct kernfs_node *parent,
{
struct kernfs_node *kn;
- if (parent->mode & S_ISGID) {
+ /*
+ * The mode and the gid below are read unlocked on purpose: they feed
+ * a node that does not exist yet, so nothing orders a racing chmod or
+ * chown against this creation.
+ */
+ if (READ_ONCE(parent->mode) & S_ISGID) {
/* this code block imitates inode_init_owner() for
* kernfs
*/
+ struct kernfs_iattrs *attrs = READ_ONCE(parent->iattr);
- if (parent->iattr)
- gid = parent->iattr->ia_gid;
+ if (attrs)
+ gid = READ_ONCE(attrs->ia_gid);
if (flags & KERNFS_DIR)
mode |= S_ISGID;
diff --git a/fs/kernfs/symlink.c b/fs/kernfs/symlink.c
index 45371a70caa71..3d5fc22878936 100644
--- a/fs/kernfs/symlink.c
+++ b/fs/kernfs/symlink.c
@@ -31,9 +31,20 @@ struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
kuid_t uid = GLOBAL_ROOT_UID;
kgid_t gid = GLOBAL_ROOT_GID;
- if (target->iattr) {
- uid = target->iattr->ia_uid;
- gid = target->iattr->ia_gid;
+ /*
+ * A symlink takes its owner from its target, so both fields have to
+ * come from the same moment: read them under kernfs_iattr_rwsem, or
+ * a chown of the target racing this could leave the link with the
+ * old uid and the new gid. The section ends before kernfs_add_one()
+ * takes kernfs_rwsem.
+ */
+ scoped_guard(rwsem_read, &kernfs_root(target)->kernfs_iattr_rwsem) {
+ struct kernfs_iattrs *attrs = READ_ONCE(target->iattr);
+
+ if (attrs) {
+ uid = attrs->ia_uid;
+ gid = attrs->ia_gid;
+ }
}
kn = kernfs_new_node(parent, name, S_IFLNK|0777, uid, gid, KERNFS_LINK);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0322/1756] PCI: xgene: Use managed clock for PCIe controller
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (320 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0321/1756] kernfs: fix up the unlocked attribute reads on the creation paths Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0323/1756] RDMA/hns: Limit gmv_entry_num to avoid memory waste Greg Kroah-Hartman
` (676 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuho Choi, Manivannan Sadhasivam,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuho Choi <dbgh9129@gmail.com>
[ Upstream commit b9022584ebbae81f7bbe4a61bd1df0d0a95e1a99 ]
xgene_pcie_init_port() obtains and enables the controller clock manually.
When xgene_pcie_setup() or pci_host_probe() fails, probe returns without
disabling, unpreparing, or releasing the clock. A failed enable also leaves
the clk_get() reference unreleased.
Use devm_clk_get_enabled() so the clock is unwound automatically on probe
failure and device removal.
Fixes: 5f6b6ccdbe1c ("PCI: xgene: Add APM X-Gene PCIe driver")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260802221146.573233-1-dbgh9129@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/pci-xgene.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c
index 7028d4b6abe6c..e850a3183370b 100644
--- a/drivers/pci/controller/pci-xgene.c
+++ b/drivers/pci/controller/pci-xgene.c
@@ -322,18 +322,11 @@ static void xgene_pcie_linkup(struct xgene_pcie *port,
static int xgene_pcie_init_port(struct xgene_pcie *port)
{
struct device *dev = port->dev;
- int rc;
- port->clk = clk_get(dev, NULL);
+ port->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(port->clk)) {
dev_err(dev, "clock not available\n");
- return -ENODEV;
- }
-
- rc = clk_prepare_enable(port->clk);
- if (rc) {
- dev_err(dev, "clock enable failed\n");
- return rc;
+ return PTR_ERR(port->clk);
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0323/1756] RDMA/hns: Limit gmv_entry_num to avoid memory waste
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (321 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0322/1756] PCI: xgene: Use managed clock for PCIe controller Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0324/1756] RDMA/hns: Fix GID capacity loss in 64K system Greg Kroah-Hartman
` (675 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Junxian Huang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxian Huang <huangjunxian6@hisilicon.com>
[ Upstream commit bb464eeadd301c3a53e9f92a2a472b73c42b74c4 ]
The GMV entry is a HW object corresponding to a GID. Since gid_table_len
is already limited to a maximum of 256, there is no need to allocate
memory for those extra GMV entries as they will never be touched.
Fixes: 7243396aaf12 ("RDMA/hns: Add a max length of gid table")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20260907084901.2420703-3-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 9036593857397..8774715174b3e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -2165,8 +2165,7 @@ static void apply_func_caps(struct hns_roce_dev *hr_dev)
caps->gmv_bt_num *
(HNS_HW_PAGE_SIZE / caps->gmv_entry_sz));
- caps->gmv_entry_num = caps->gmv_bt_num * (HNS_HW_PAGE_SIZE /
- caps->gmv_entry_sz);
+ caps->gmv_entry_num = caps->gid_table_len[0];
} else {
u32 func_num = max_t(u32, 1, hr_dev->func_num);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0324/1756] RDMA/hns: Fix GID capacity loss in 64K system
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (322 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0323/1756] RDMA/hns: Limit gmv_entry_num to avoid memory waste Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0325/1756] usb: image: microtek: stop SG processing after transfer errors Greg Kroah-Hartman
` (674 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Junxian Huang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxian Huang <huangjunxian6@hisilicon.com>
[ Upstream commit 95761b8736c938759032e8d4eb42074d39d13007 ]
Our HW always handles GMV BT pages with a fixed 4K size, but the driver
calculates the needed GMV BT pages number with PAGE_SIZE, which is 64K
in 64K system. Only the first 4K (GMV index 0-127) can be reached by HW,
causing GID capacity loss and memory waste.
Split a single 64K BT page into multiple 4K pages and register them to
HW per 4K block so that HW can correctly reach all GMV entries.
Fixes: 32053e584e4a ("RDMA/hns: Add support for filling GMV table")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20260907084901.2420703-4-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 37 +++++++++++++++++-----
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 8774715174b3e..065b76e9f29a3 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -4136,18 +4136,39 @@ static int get_op_for_set_hem(struct hns_roce_dev *hr_dev, u32 type,
static int config_gmv_ba_to_hw(struct hns_roce_dev *hr_dev, unsigned long obj,
dma_addr_t base_addr)
{
+ u32 obj_num_per_bt = HNS_HW_PAGE_SIZE / hr_dev->caps.gmv_entry_sz;
+ u32 chunk_size = 1 << (hr_dev->caps.gmv_buf_pg_sz + PAGE_SHIFT);
+ u32 bt_num_per_chunk = chunk_size / HNS_HW_PAGE_SIZE;
+ u32 first = obj / obj_num_per_bt;
+ u32 last = min(first + bt_num_per_chunk, hr_dev->caps.gmv_bt_num);
struct hns_roce_cmq_desc desc;
- struct hns_roce_cmq_req *req = (struct hns_roce_cmq_req *)desc.data;
- u32 idx = obj / (HNS_HW_PAGE_SIZE / hr_dev->caps.gmv_entry_sz);
- u64 addr = to_hr_hw_page_addr(base_addr);
+ struct hns_roce_cmq_req *req;
+ u64 addr;
+ int ret;
+ u32 i;
- hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_CFG_GMV_BT, false);
+ /* The GMV BT entry of hardware covers a fixed 4K region, so a buffer
+ * chunk larger than 4K must be registered to hardware with one BT
+ * entry per 4K block, otherwise the GMV entries beyond the first
+ * 4K of the chunk are unreachable.
+ */
+ for (i = first; i < last; i++) {
+ hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_CFG_GMV_BT,
+ false);
+ req = (struct hns_roce_cmq_req *)desc.data;
- hr_reg_write(req, CFG_GMV_BT_BA_L, lower_32_bits(addr));
- hr_reg_write(req, CFG_GMV_BT_BA_H, upper_32_bits(addr));
- hr_reg_write(req, CFG_GMV_BT_IDX, idx);
+ addr = to_hr_hw_page_addr(base_addr +
+ (u64)(i - first) * HNS_HW_PAGE_SIZE);
+ hr_reg_write(req, CFG_GMV_BT_BA_L, lower_32_bits(addr));
+ hr_reg_write(req, CFG_GMV_BT_BA_H, upper_32_bits(addr));
+ hr_reg_write(req, CFG_GMV_BT_IDX, i);
- return hns_roce_cmq_send(hr_dev, &desc, 1);
+ ret = hns_roce_cmq_send(hr_dev, &desc, 1);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
static int set_hem_to_hw(struct hns_roce_dev *hr_dev, int obj,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0325/1756] usb: image: microtek: stop SG processing after transfer errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (323 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0324/1756] RDMA/hns: Fix GID capacity loss in 64K system Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0326/1756] USB: usbmon: fix null-ptr-deref in mon_bus_remove() when mon_bus_init() fails Greg Kroah-Hartman
` (673 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Diego Fernando Mancera Gomez,
Oliver Neukum, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
[ Upstream commit d937ca39cc44a01ce64865dd25b1e205a05ae3a0 ]
When an SG URB completes with an error, mts_do_sg() calls
mts_transfer_cleanup(), which completes the SCSI command through
scsi_done(). However, the callback continues advancing the scatterlist
and may submit another URB for a command that has already been
completed.
Return immediately after the cleanup so that no further processing is
performed on the completed command.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20260723195654.152104-1-diegomancera.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/image/microtek.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 9f758241d9d37..c1f4eca9ef547 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -495,6 +495,7 @@ static void mts_do_sg (struct urb* transfer)
if (unlikely(status)) {
set_host_byte(context->srb, (status == -ENOENT ? DID_ABORT : DID_ERROR));
mts_transfer_cleanup(transfer);
+ return;
}
context->curr_sg = sg_next(context->curr_sg);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0326/1756] USB: usbmon: fix null-ptr-deref in mon_bus_remove() when mon_bus_init() fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (324 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0325/1756] usb: image: microtek: stop SG processing after transfer errors Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0327/1756] USB: pci-quirks: Release EHCI device reference Greg Kroah-Hartman
` (672 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+5f4b29d9fe710a964482,
Jiangong.Han, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiangong.Han <jiangong.han@windriver.com>
[ Upstream commit 0c6cae0f56239e3274b30dbe5b362cd297ccacc7 ]
When mon_bus_init() fails to allocate the mon_bus struct, it returns
without setting ubus->mon_bus, so mbus->mon_bus remains NULL.
mon_bus_add() intentionally ignores this failure because the USB core
does not require monitoring to be established for normal operation.
However, when the HCD is later removed, usb_remove_hcd() fires the
USB_BUS_REMOVE notifier which calls mon_bus_remove(), it dereferences
ubus->mon_bus without checking for NULL, causing a null-ptr deference.
Fix this by adding a NULL check for mbus at the top of mon_bus_remove().
If mon_bus_init() failed, ubus->mon_bus is NULL, meaning the bus was
never tracked by the monitor, so there is nothing to clean up and
returning early is correct.
Reported-by: syzbot+5f4b29d9fe710a964482@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=5f4b29d9fe710a964482
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jiangong.Han <jiangong.han@windriver.com>
Link: https://patch.msgid.link/20260801095128.46322-1-jiangong.han@windriver.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/mon/mon_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/mon/mon_main.c b/drivers/usb/mon/mon_main.c
index af852d53aac69..4aaaa9d0748fc 100644
--- a/drivers/usb/mon/mon_main.c
+++ b/drivers/usb/mon/mon_main.c
@@ -199,6 +199,9 @@ static void mon_bus_remove(struct usb_bus *ubus)
{
struct mon_bus *mbus = ubus->mon_bus;
+ if (mbus == NULL)
+ return;
+
mutex_lock(&mon_lock);
list_del(&mbus->bus_link);
if (mbus->text_inited)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0327/1756] USB: pci-quirks: Release EHCI device reference
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (325 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0326/1756] USB: usbmon: fix null-ptr-deref in mon_bus_remove() when mon_bus_init() fails Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0328/1756] usb-storage: alauda: do not do DMA from the stack Greg Kroah-Hartman
` (671 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuho Choi, Alan Stern, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuho Choi <dbgh9129@gmail.com>
[ Upstream commit e93731c29f749d5b2495a67109d1f0804ab3b89d ]
for_each_pci_dev() holds a reference to the current device. The Intel
EHCI lookup breaks as soon as it finds a match, so the iterator does not
get a chance to drop that reference on its next iteration.
Release the reference before leaving the loop.
Fixes: 26b76798e050 ("Intel xhci: refactor EHCI/xHCI port switching")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20260807024304.928708-1-dbgh9129@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/host/pci-quirks.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 0404489c2f6a9..ba158d63bb8bd 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -1073,6 +1073,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev)
if (companion->class == PCI_CLASS_SERIAL_USB_EHCI &&
companion->vendor == PCI_VENDOR_ID_INTEL) {
ehci_found = true;
+ pci_dev_put(companion);
break;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0328/1756] usb-storage: alauda: do not do DMA from the stack
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (326 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0327/1756] USB: pci-quirks: Release EHCI device reference Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0329/1756] usb-storage: alauda: check the return value of alauda_read_map() Greg Kroah-Hartman
` (670 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Arka Mondal, Alan Stern, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arka Mondal <arka@arkamondal.net>
[ Upstream commit ec67dacb75ebd11fbe6d727e6f37c0ef5e3d3431 ]
alauda_check_status2(), alauda_get_redu_data(), alauda_erase_block(),
alauda_read_block_raw() and alauda_write_block() build their commands in
stack arrays and pass them to usb_stor_bulk_transfer_buf().
alauda_check_status2() and alauda_erase_block() also read the reply back
into a stack array.
usb_stor_msg_common() sets URB_NO_TRANSFER_DMA_MAP only when the buffer
is us->iobuf. Every other buffer reaches usb_hcd_map_urb_for_dma(),
which has warned and returned -EAGAIN for a buffer on the stack since
commit 4568136620c6 ("usb: core: Check URB setup_packet and
transfer_buffer sanity"). On a host controller that uses DMA, all of
these commands fail.
Use us->iobuf, as alauda_reset_media() in this driver and the other
usb-storage subdrivers already do. The command is sent before the reply
is read, so both can use it; sddr09_read_status() does the same.
Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217862
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20260901065831.43567-2-arka@arkamondal.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/storage/alauda.c | 70 ++++++++++++++++++++++++------------
1 file changed, 48 insertions(+), 22 deletions(-)
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
index a9d3c58ce7d93..13dabf6a16f82 100644
--- a/drivers/usb/storage/alauda.c
+++ b/drivers/usb/storage/alauda.c
@@ -500,11 +500,14 @@ static int alauda_check_media(struct us_data *us)
static int alauda_check_status2(struct us_data *us)
{
int rc;
- unsigned char command[] = {
- ALAUDA_BULK_CMD, ALAUDA_BULK_GET_STATUS2,
- 0, 0, 0, 0, 3, 0, MEDIA_PORT(us)
- };
- unsigned char data[3];
+ unsigned char *command = us->iobuf;
+ unsigned char *data = us->iobuf;
+
+ memset(command, 0, 9);
+ command[0] = ALAUDA_BULK_CMD;
+ command[1] = ALAUDA_BULK_GET_STATUS2;
+ command[6] = 3;
+ command[8] = MEDIA_PORT(us);
rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
command, 9, NULL);
@@ -530,10 +533,15 @@ static int alauda_check_status2(struct us_data *us)
static int alauda_get_redu_data(struct us_data *us, u16 pba, unsigned char *data)
{
int rc;
- unsigned char command[] = {
- ALAUDA_BULK_CMD, ALAUDA_BULK_GET_REDU_DATA,
- PBA_HI(pba), PBA_ZONE(pba), 0, PBA_LO(pba), 0, 0, MEDIA_PORT(us)
- };
+ unsigned char *command = us->iobuf;
+
+ memset(command, 0, 9);
+ command[0] = ALAUDA_BULK_CMD;
+ command[1] = ALAUDA_BULK_GET_REDU_DATA;
+ command[2] = PBA_HI(pba);
+ command[3] = PBA_ZONE(pba);
+ command[5] = PBA_LO(pba);
+ command[8] = MEDIA_PORT(us);
rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
command, 9, NULL);
@@ -702,14 +710,20 @@ static void alauda_ensure_map_for_zone(struct us_data *us, unsigned int zone)
static int alauda_erase_block(struct us_data *us, u16 pba)
{
int rc;
- unsigned char command[] = {
- ALAUDA_BULK_CMD, ALAUDA_BULK_ERASE_BLOCK, PBA_HI(pba),
- PBA_ZONE(pba), 0, PBA_LO(pba), 0x02, 0, MEDIA_PORT(us)
- };
- unsigned char buf[2];
+ unsigned char *command = us->iobuf;
+ unsigned char *buf = us->iobuf;
usb_stor_dbg(us, "Erasing PBA %d\n", pba);
+ memset(command, 0, 9);
+ command[0] = ALAUDA_BULK_CMD;
+ command[1] = ALAUDA_BULK_ERASE_BLOCK;
+ command[2] = PBA_HI(pba);
+ command[3] = PBA_ZONE(pba);
+ command[5] = PBA_LO(pba);
+ command[6] = 0x02;
+ command[8] = MEDIA_PORT(us);
+
rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
command, 9, NULL);
if (rc != USB_STOR_XFER_GOOD)
@@ -732,13 +746,19 @@ static int alauda_read_block_raw(struct us_data *us, u16 pba,
unsigned int page, unsigned int pages, unsigned char *data)
{
int rc;
- unsigned char command[] = {
- ALAUDA_BULK_CMD, ALAUDA_BULK_READ_BLOCK, PBA_HI(pba),
- PBA_ZONE(pba), 0, PBA_LO(pba) + page, pages, 0, MEDIA_PORT(us)
- };
+ unsigned char *command = us->iobuf;
usb_stor_dbg(us, "pba %d page %d count %d\n", pba, page, pages);
+ memset(command, 0, 9);
+ command[0] = ALAUDA_BULK_CMD;
+ command[1] = ALAUDA_BULK_READ_BLOCK;
+ command[2] = PBA_HI(pba);
+ command[3] = PBA_ZONE(pba);
+ command[5] = PBA_LO(pba) + page;
+ command[6] = pages;
+ command[8] = MEDIA_PORT(us);
+
rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
command, 9, NULL);
if (rc != USB_STOR_XFER_GOOD)
@@ -783,13 +803,19 @@ static int alauda_write_block(struct us_data *us, u16 pba, unsigned char *data)
{
int rc;
struct alauda_info *info = (struct alauda_info *) us->extra;
- unsigned char command[] = {
- ALAUDA_BULK_CMD, ALAUDA_BULK_WRITE_BLOCK, PBA_HI(pba),
- PBA_ZONE(pba), 0, PBA_LO(pba), 32, 0, MEDIA_PORT(us)
- };
+ unsigned char *command = us->iobuf;
usb_stor_dbg(us, "pba %d\n", pba);
+ memset(command, 0, 9);
+ command[0] = ALAUDA_BULK_CMD;
+ command[1] = ALAUDA_BULK_WRITE_BLOCK;
+ command[2] = PBA_HI(pba);
+ command[3] = PBA_ZONE(pba);
+ command[5] = PBA_LO(pba);
+ command[6] = 32;
+ command[8] = MEDIA_PORT(us);
+
rc = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
command, 9, NULL);
if (rc != USB_STOR_XFER_GOOD)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0329/1756] usb-storage: alauda: check the return value of alauda_read_map()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (327 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0328/1756] usb-storage: alauda: do not do DMA from the stack Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0330/1756] usb-storage: alauda: fix out-of-bounds zone index Greg Kroah-Hartman
` (669 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Arka Mondal, Alan Stern, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arka Mondal <arka@arkamondal.net>
[ Upstream commit eb882419790c6710646904c6b25132189152cf33 ]
alauda_ensure_map_for_zone() ignores the value alauda_read_map()
returns. On failure lba_to_pba[zone] and pba_to_lba[zone] are left NULL,
and both callers dereference them immediately:
pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset];
alauda_read_map() returns USB_STOR_TRANSPORT_ERROR when either kcalloc()
fails or an alauda_get_redu_data() transfer fails, so one failed bulk
transfer is enough to reach the NULL dereference.
Return that value from alauda_ensure_map_for_zone() and check it in
alauda_read_data() and alauda_write_lba().
Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217862
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20260901065831.43567-3-arka@arkamondal.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/storage/alauda.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
index 13dabf6a16f82..05baaa996ca67 100644
--- a/drivers/usb/storage/alauda.c
+++ b/drivers/usb/storage/alauda.c
@@ -697,11 +697,13 @@ static int alauda_read_map(struct us_data *us, unsigned int zone)
* Checks to see whether we have already mapped a certain zone
* If we haven't, the map is generated
*/
-static void alauda_ensure_map_for_zone(struct us_data *us, unsigned int zone)
+static int alauda_ensure_map_for_zone(struct us_data *us, unsigned int zone)
{
if (MEDIA_INFO(us).lba_to_pba[zone] == NULL
|| MEDIA_INFO(us).pba_to_lba[zone] == NULL)
- alauda_read_map(us, zone);
+ return alauda_read_map(us, zone);
+
+ return 0;
}
/*
@@ -849,7 +851,9 @@ static int alauda_write_lba(struct us_data *us, u16 lba,
unsigned int new_pba_offset;
unsigned int zone = lba / uzonesize;
- alauda_ensure_map_for_zone(us, zone);
+ result = alauda_ensure_map_for_zone(us, zone);
+ if (result != USB_STOR_TRANSPORT_GOOD)
+ return result;
pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset];
if (pba == 1) {
@@ -980,7 +984,10 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
unsigned int lba_offset = lba - (zone * uzonesize);
unsigned int pages;
u16 pba;
- alauda_ensure_map_for_zone(us, zone);
+
+ result = alauda_ensure_map_for_zone(us, zone);
+ if (result != USB_STOR_TRANSPORT_GOOD)
+ break;
/* Not overflowing capacity? */
if (lba >= max_lba) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0330/1756] usb-storage: alauda: fix out-of-bounds zone index
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (328 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0329/1756] usb-storage: alauda: check the return value of alauda_read_map() Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0331/1756] usb: musb: da8xx: depopulate OF children on remove Greg Kroah-Hartman
` (668 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alan Stern, Arka Mondal, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arka Mondal <arka@arkamondal.net>
[ Upstream commit c4542993c071fcafe7335698bf52650dee7e3555 ]
MEDIA_INFO(us).lba_to_pba and .pba_to_lba are arrays of num_zones
pointers, allocated by kcalloc() in alauda_init_media().
alauda_ensure_map_for_zone() reads lba_to_pba[zone] and
pba_to_lba[zone], and when either is NULL alauda_read_map() writes a
pointer back to both. Two separate errors let zone reach num_zones, one
element past the end.
max_lba is capacity >> (blockshift + pageshift), which counts physical
blocks, but zone is lba / uzonesize and uzonesize is 125/128 of
zonesize. On a 16 MB card (alauda_card_ids id 0x73) num_zones is 1 and
uzonesize is 1000, so lba 1000 to 1023 pass the bounds check and index
element 1 of a one-element array.
alauda_read_data() also calls alauda_ensure_map_for_zone() before it
compares lba against max_lba, so any larger lba is used as an index
before the check rejects it. alauda_write_data() already checks first.
Bound lba by num_zones * uzonesize on both paths and move the read
side's call below the check. alauda_transport() reports
num_zones * uzonesize * blocksize for READ_CAPACITY, so the new bound is
exactly the range the device advertises and no block becomes
unreachable.
sd never issues an lba past the reported capacity; an SG_IO READ_10 can.
Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support")
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20260901065831.43567-4-arka@arkamondal.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/storage/alauda.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
index 05baaa996ca67..929c39f8a9f9b 100644
--- a/drivers/usb/storage/alauda.c
+++ b/drivers/usb/storage/alauda.c
@@ -949,6 +949,7 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
unsigned char *buffer;
u16 lba, max_lba;
unsigned int page, len, offset;
+ unsigned int num_zones;
unsigned int blockshift = MEDIA_INFO(us).blockshift;
unsigned int pageshift = MEDIA_INFO(us).pageshift;
unsigned int blocksize = MEDIA_INFO(us).blocksize;
@@ -973,7 +974,9 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
/* Figure out the initial LBA and page */
lba = address >> blockshift;
page = (address & MEDIA_INFO(us).blockmask);
- max_lba = MEDIA_INFO(us).capacity >> (blockshift + pageshift);
+ num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift
+ + blockshift + pageshift);
+ max_lba = num_zones * uzonesize;
result = USB_STOR_TRANSPORT_GOOD;
offset = 0;
@@ -985,10 +988,6 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
unsigned int pages;
u16 pba;
- result = alauda_ensure_map_for_zone(us, zone);
- if (result != USB_STOR_TRANSPORT_GOOD)
- break;
-
/* Not overflowing capacity? */
if (lba >= max_lba) {
usb_stor_dbg(us, "Error: Requested lba %u exceeds maximum %u\n",
@@ -997,6 +996,10 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
break;
}
+ result = alauda_ensure_map_for_zone(us, zone);
+ if (result != USB_STOR_TRANSPORT_GOOD)
+ break;
+
/* Find number of pages we can read in this block */
pages = min(sectors, blocksize - page);
len = pages << pageshift;
@@ -1052,6 +1055,7 @@ static int alauda_write_data(struct us_data *us, unsigned long address,
unsigned int pagesize = MEDIA_INFO(us).pagesize;
struct scatterlist *sg;
u16 lba, max_lba;
+ unsigned int num_zones;
int result;
/*
@@ -1078,7 +1082,9 @@ static int alauda_write_data(struct us_data *us, unsigned long address,
/* Figure out the initial LBA and page */
lba = address >> blockshift;
page = (address & MEDIA_INFO(us).blockmask);
- max_lba = MEDIA_INFO(us).capacity >> (pageshift + blockshift);
+ num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift
+ + blockshift + pageshift);
+ max_lba = num_zones * MEDIA_INFO(us).uzonesize;
result = USB_STOR_TRANSPORT_GOOD;
offset = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0331/1756] usb: musb: da8xx: depopulate OF children on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (329 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0330/1756] usb-storage: alauda: fix out-of-bounds zone index Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0332/1756] usb: musb: da8xx: depopulate OF children on probe failure Greg Kroah-Hartman
` (667 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 4b30c89fb36924983be652bb24fc49e20390bf27 ]
da8xx_probe() creates CPPI platform devices with of_platform_populate(),
but da8xx_remove() unregisters only the separately created MUSB device and
the generic PHY. The OF children therefore remain registered after the
glue driver is unbound.
Pair the successful population with of_platform_depopulate() during remove.
Unregister the MUSB device first because it reuses the parent DT node but
was not created by of_platform_populate().
Fixes: d6299b6efbf6 ("usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260813153353.42817-1-pengpeng@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/musb/da8xx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 953094c1930c8..7bc1f935be296 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -590,6 +590,7 @@ static void da8xx_remove(struct platform_device *pdev)
struct da8xx_glue *glue = platform_get_drvdata(pdev);
platform_device_unregister(glue->musb);
+ of_platform_depopulate(&pdev->dev);
usb_phy_generic_unregister(glue->usb_phy);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0332/1756] usb: musb: da8xx: depopulate OF children on probe failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (330 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0331/1756] usb: musb: da8xx: depopulate OF children on remove Greg Kroah-Hartman
@ 2026-11-18 14:40 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0333/1756] dmaengine: sprd: use clk_bulk API to fix clock imbalance Greg Kroah-Hartman
` (666 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 8d70a378e702141424e27e0b8341e421f058635d ]
da8xx_probe() creates the CPPI child devices before registering the MUSB
platform device. If population partially succeeds or the later MUSB
registration fails, the probe path unregisters the generic PHY but leaves
the OF children registered under a parent whose probe failed.
Depopulate the OF children before unregistering the PHY on both failure
paths. Use one cleanup label so each resource is unwound in reverse
publication order without introducing an unused label.
Fixes: d6299b6efbf6 ("usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260813153230.40421-1-pengpeng@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/musb/da8xx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 7bc1f935be296..f410015567999 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -560,7 +560,7 @@ static int da8xx_probe(struct platform_device *pdev)
ret = of_platform_populate(pdev->dev.of_node, NULL,
da8xx_auxdata_lookup, &pdev->dev);
if (ret)
- goto err_unregister_phy;
+ goto err_depopulate;
pinfo = da8xx_dev_info;
pinfo.parent = &pdev->dev;
@@ -575,12 +575,13 @@ static int da8xx_probe(struct platform_device *pdev)
ret = PTR_ERR_OR_ZERO(glue->musb);
if (ret) {
dev_err(&pdev->dev, "failed to register musb device: %d\n", ret);
- goto err_unregister_phy;
+ goto err_depopulate;
}
return 0;
-err_unregister_phy:
+err_depopulate:
+ of_platform_depopulate(&pdev->dev);
usb_phy_generic_unregister(glue->usb_phy);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0333/1756] dmaengine: sprd: use clk_bulk API to fix clock imbalance
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (331 preceding siblings ...)
2026-11-18 14:40 ` [PATCH 6.12 0332/1756] usb: musb: da8xx: depopulate OF children on probe failure Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0334/1756] firmware: arm_scmi: Protect xfer->async_done with xfer->lock Greg Kroah-Hartman
` (665 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chaithanya Lagisetty, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
[ Upstream commit d09cd5e8bbc98969b5333015b45c525078ac0f6f ]
sprd_dma_enable() enabled sdev->clk and then the optional ashb_clk. If
enabling ashb_clk failed, sdev->clk was left enabled: both callers
(probe and resume) treat a non-zero return as "nothing was enabled" and
bail out, leaking sdev->clk.
Convert the driver to the clk_bulk API. clk_bulk_prepare_enable()
enables all clocks and unwinds them on failure, and
clk_bulk_disable_unprepare() disables them, which fixes the imbalance
and simplifies the enable/disable paths. Both clocks are fetched with
devm_clk_bulk_get_optional(); the optional ashb_eb clock simply becomes
a NULL entry that the bulk helpers treat as a no-op, while the mandatory
enable clock is still checked explicitly.
Fixes: 9b3b8171f7f4 ("dmaengine: sprd: Add Spreadtrum DMA driver")
Signed-off-by: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260819053518.2825514-1-nagachaithanya9911@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/sprd-dma.c | 45 ++++++++++++------------------------------
1 file changed, 13 insertions(+), 32 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index f000d5a5add52..a18c4f1eb233e 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -208,8 +208,7 @@ struct sprd_dma_chn {
struct sprd_dma_dev {
struct dma_device dma_dev;
void __iomem *glb_base;
- struct clk *clk;
- struct clk *ashb_clk;
+ struct clk_bulk_data clks[2];
int irq;
u32 total_chns;
struct sprd_dma_chn channels[] __counted_by(total_chns);
@@ -260,31 +259,12 @@ static void sprd_dma_chn_update(struct sprd_dma_chn *schan, u32 reg,
static int sprd_dma_enable(struct sprd_dma_dev *sdev)
{
- int ret;
-
- ret = clk_prepare_enable(sdev->clk);
- if (ret)
- return ret;
-
- /*
- * The ashb_clk is optional and only for AGCP DMA controller, so we
- * need add one condition to check if the ashb_clk need enable.
- */
- if (!IS_ERR(sdev->ashb_clk))
- ret = clk_prepare_enable(sdev->ashb_clk);
-
- return ret;
+ return clk_bulk_prepare_enable(ARRAY_SIZE(sdev->clks), sdev->clks);
}
static void sprd_dma_disable(struct sprd_dma_dev *sdev)
{
- clk_disable_unprepare(sdev->clk);
-
- /*
- * Need to check if we need disable the optional ashb_clk for AGCP DMA.
- */
- if (!IS_ERR(sdev->ashb_clk))
- clk_disable_unprepare(sdev->ashb_clk);
+ clk_bulk_disable_unprepare(ARRAY_SIZE(sdev->clks), sdev->clks);
}
static void sprd_dma_set_uid(struct sprd_dma_chn *schan)
@@ -1140,16 +1120,17 @@ static int sprd_dma_probe(struct platform_device *pdev)
if (!sdev)
return -ENOMEM;
- sdev->clk = devm_clk_get(&pdev->dev, "enable");
- if (IS_ERR(sdev->clk)) {
- dev_err(&pdev->dev, "get enable clock failed\n");
- return PTR_ERR(sdev->clk);
- }
+ /* The ashb_eb clock is optional and only present for AGCP DMA */
+ sdev->clks[0].id = "enable";
+ sdev->clks[1].id = "ashb_eb";
+ ret = devm_clk_bulk_get_optional(&pdev->dev, ARRAY_SIZE(sdev->clks),
+ sdev->clks);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "get clocks failed\n");
- /* ashb clock is optional for AGCP DMA */
- sdev->ashb_clk = devm_clk_get(&pdev->dev, "ashb_eb");
- if (IS_ERR(sdev->ashb_clk))
- dev_warn(&pdev->dev, "no optional ashb eb clock\n");
+ if (!sdev->clks[0].clk)
+ return dev_err_probe(&pdev->dev, -ENOENT,
+ "get enable clock failed\n");
/*
* We have three DMA controllers: AP DMA, AON DMA and AGCP DMA. For AGCP
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0334/1756] firmware: arm_scmi: Protect xfer->async_done with xfer->lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (332 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0333/1756] dmaengine: sprd: use clk_bulk API to fix clock imbalance Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0335/1756] firmware: arm_scmi: Dont reuse raw xfers with async_done still armed Greg Kroah-Hartman
` (664 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roland Dreier, Cristian Marussi,
Sudeep Holla, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roland Dreier <rolanddreier@rivian.com>
[ Upstream commit 49fc5bc04eec2b7687d49ccceb7adf6ace640a3b ]
Asynchronous SCMI commands are completed by a delayed response. The RX
path signals the response with complete(xfer->async_done). Unlike
xfer->done, xfer->async_done is a pointer to a completion owned by
whoever is waiting for the delayed response, and it stays valid only for
as long as that waiter is still waiting. In do_xfer_with_response() it
is a DECLARE_COMPLETION_ONSTACK() in the caller's stack frame.
Nothing serialises the RX path against a waiter that gives up on a
timeout. scmi_msg_response_validate() does read xfer->async_done
under xfer->lock, and documents that as a requirement, but the lock is
dropped again before scmi_handle_response() dereferences the pointer,
and neither the arming nor the disarming side takes it at all. So a
delayed response arriving just as the wait times out can be signalled
on a completion that is already gone:
waiter RX path (IRQ context)
------ ---------------------
do_xfer_with_response():
xfer->async_done = &async_response
do_xfer(xfer)
wait_for_completion_timeout(xfer->async_done, tmo)
/* returns 0, gives up */
/* response receive interrupt */
scmi_handle_response():
scmi_xfer_command_acquire()
lock xfer->lock
validate: async_done != NULL
unlock xfer->lock
xfer->async_done = NULL
return -ETIMEDOUT
/* async_response goes out of scope */
complete(xfer->async_done)
That last complete() has two possible bad outcomes: it either dereferences
the NULL just stored by the waiter or - if that store is not yet visible
on the RX CPU - it takes a lock and writes to a stack frame that the
waiter may already have returned from.
Fix this by making xfer->lock cover xfer->async_done end-to-end. Add
helpers to arm and disarm it under the lock, use them on both the regular
and the raw paths, and have the RX path read and signal the completion
under that same lock. A waiter that is timing out then either completes
its disarm before the RX path looks, in which case the delayed response is
dropped, or blocks in the disarm until the RX path is done with the
completion, in which case the completion is still alive.
Log the dropped case, so every path where a delayed response that was
matched to a pending xfer and then discarded produces an error. (This is
the same treatment scmi_msg_response_validate() already gives a
delayed response that arrives after the waiter has disarmed the xfer)
Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
Signed-off-by: Roland Dreier <rolanddreier@rivian.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://patch.msgid.link/20260909-scmi-async-done-race-v2-1-cc5dec25c6be@rivian.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/arm_scmi/common.h | 22 ++++++++++++++++
drivers/firmware/arm_scmi/driver.c | 37 +++++++++++++++++++++++----
drivers/firmware/arm_scmi/protocols.h | 9 ++++---
drivers/firmware/arm_scmi/raw_mode.c | 4 +--
4 files changed, 62 insertions(+), 10 deletions(-)
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 87acc795f7436..5fbfc3a67f2b0 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -266,6 +266,28 @@ static inline bool is_polling_enabled(struct scmi_chan_info *cinfo,
is_transport_polling_capable(desc);
}
+/**
+ * scmi_xfer_async_response_arm - Arm the delayed response completion
+ *
+ * @xfer: A reference to the xfer to arm
+ * @async_done: The completion to signal upon reception of a delayed response,
+ * or NULL to disarm @xfer.
+ */
+static inline void scmi_xfer_async_response_arm(struct scmi_xfer *xfer,
+ struct completion *async_done)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&xfer->lock, flags);
+ xfer->async_done = async_done;
+ spin_unlock_irqrestore(&xfer->lock, flags);
+}
+
+static inline void scmi_xfer_async_response_disarm(struct scmi_xfer *xfer)
+{
+ scmi_xfer_async_response_arm(xfer, NULL);
+}
+
void scmi_xfer_raw_put(const struct scmi_handle *handle,
struct scmi_xfer *xfer);
struct scmi_xfer *scmi_xfer_raw_get(const struct scmi_handle *handle);
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index ce441bbb5d5d3..b1ac371e41746 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1029,6 +1029,29 @@ static inline void scmi_xfer_command_release(struct scmi_info *info,
__scmi_xfer_put(&info->tx_minfo, xfer);
}
+/**
+ * scmi_xfer_async_response_complete - Signal a received delayed response
+ *
+ * @xfer: A reference to the xfer whose delayed response was received
+ *
+ * Return: True if a completion was still armed on @xfer and has been
+ * signalled, false if a waiter has already disarmed it due to
+ * timeout or other error.
+ */
+static bool scmi_xfer_async_response_complete(struct scmi_xfer *xfer)
+{
+ unsigned long flags;
+ struct completion *async_done;
+
+ spin_lock_irqsave(&xfer->lock, flags);
+ async_done = xfer->async_done;
+ if (async_done)
+ complete(async_done);
+ spin_unlock_irqrestore(&xfer->lock, flags);
+
+ return !!async_done;
+}
+
static inline void scmi_clear_channel(struct scmi_info *info,
struct scmi_chan_info *cinfo)
{
@@ -1132,8 +1155,12 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
if (xfer->hdr.type == MSG_TYPE_DELAYED_RESP) {
scmi_clear_channel(info, cinfo);
- complete(xfer->async_done);
- scmi_inc_count(info->dbg, DELAYED_RESPONSE_OK);
+ if (scmi_xfer_async_response_complete(xfer))
+ scmi_inc_count(info->dbg, DELAYED_RESPONSE_OK);
+ else
+ dev_err(cinfo->dev,
+ "Delayed Response for %d (protocol 0x%X msg 0x%X) received after waiter was disarmed, dropping\n",
+ xfer->hdr.seq, xfer->hdr.protocol_id, xfer->hdr.id);
} else {
complete(&xfer->done);
scmi_inc_count(info->dbg, RESPONSE_OK);
@@ -1472,7 +1499,7 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
int ret, timeout = msecs_to_jiffies(SCMI_MAX_RESPONSE_TIMEOUT);
DECLARE_COMPLETION_ONSTACK(async_response);
- xfer->async_done = &async_response;
+ scmi_xfer_async_response_arm(xfer, &async_response);
/*
* Delayed responses should not be polled, so an async command should
@@ -1484,7 +1511,7 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
ret = do_xfer(ph, xfer);
if (!ret) {
- if (!wait_for_completion_timeout(xfer->async_done, timeout)) {
+ if (!wait_for_completion_timeout(&async_response, timeout)) {
dev_err(ph->dev,
"timed out in delayed resp(caller: %pS)\n",
(void *)_RET_IP_);
@@ -1494,7 +1521,7 @@ static int do_xfer_with_response(const struct scmi_protocol_handle *ph,
}
}
- xfer->async_done = NULL;
+ scmi_xfer_async_response_disarm(xfer);
return ret;
}
diff --git a/drivers/firmware/arm_scmi/protocols.h b/drivers/firmware/arm_scmi/protocols.h
index d62c4469d1fd9..bef6e634eb2f4 100644
--- a/drivers/firmware/arm_scmi/protocols.h
+++ b/drivers/firmware/arm_scmi/protocols.h
@@ -100,7 +100,10 @@ struct scmi_msg_hdr {
* message. If request-ACK protocol is used, we can reuse the same
* buffer for the rx path as we use for the tx path.
* @done: command message transmit completion event
- * @async_done: pointer to delayed response message received event completion
+ * @async_done: pointer to delayed response message received event completion,
+ * or NULL when no delayed response is expected. Protected by
+ * @lock, since the completion is owned by the waiter and can
+ * vanish once the wait times out.
* @pending: True for xfers added to @pending_xfers hashtable
* @node: An hlist_node reference used to store this xfer, alternatively, on
* the free list @free_xfers or in the @pending_xfers hashtable
@@ -121,7 +124,7 @@ struct scmi_msg_hdr {
* - SCMI_XFER_SENT_OK -> SCMI_XFER_DRESP_OK
* (Missing synchronous response is assumed OK and ignored)
* @flags: Optional flags associated to this xfer.
- * @lock: A spinlock to protect state and busy fields.
+ * @lock: A spinlock to protect state, busy and async_done fields.
* @priv: A pointer for transport private usage.
*/
struct scmi_xfer {
@@ -147,7 +150,7 @@ struct scmi_xfer {
#define SCMI_XFER_IS_CHAN_SET(x) \
((x)->flags & SCMI_XFER_FLAG_CHAN_SET)
int flags;
- /* A lock to protect state and busy fields */
+ /* A lock to protect state, busy and async_done fields */
spinlock_t lock;
void *priv;
};
diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c
index 9e89a6a763daf..bf2fa2e8cc63a 100644
--- a/drivers/firmware/arm_scmi/raw_mode.c
+++ b/drivers/firmware/arm_scmi/raw_mode.c
@@ -346,7 +346,7 @@ scmi_xfer_raw_waiter_get(struct scmi_raw_mode_info *raw, struct scmi_xfer *xfer,
if (async) {
reinit_completion(&rw->async_response);
- xfer->async_done = &rw->async_response;
+ scmi_xfer_async_response_arm(xfer, &rw->async_response);
}
rw->cinfo = cinfo;
@@ -361,7 +361,7 @@ static void scmi_xfer_raw_waiter_put(struct scmi_raw_mode_info *raw,
struct scmi_xfer_raw_waiter *rw)
{
if (rw->xfer) {
- rw->xfer->async_done = NULL;
+ scmi_xfer_async_response_disarm(rw->xfer);
rw->xfer = NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0335/1756] firmware: arm_scmi: Dont reuse raw xfers with async_done still armed
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (333 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0334/1756] firmware: arm_scmi: Protect xfer->async_done with xfer->lock Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0336/1756] usb: gadget: composite: avoid warning on aborted delayed status Greg Kroah-Hartman
` (663 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roland Dreier, Cristian Marussi,
Sudeep Holla, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roland Dreier <rolanddreier@rivian.com>
[ Upstream commit 0543fc1443de1a0b04ec64684fb920d79e15de2f ]
In SCMI raw mode, scmi_xfer_raw_worker() releases the xfer before
releasing the waiter that disarms xfer->async_done, and scmi_xfer_get()
does not clear async_done when it hands out a recycled xfer. A concurrent
transaction can therefore pick up the xfer while it still points at the
old waiter's completion, so:
- a delayed response arriving for the new transaction can be signalled
on the old waiter's completion, which may already be re-armed for yet
another unrelated transaction, making that transaction's wait return
early; and
- the old waiter's disarm, which still runs after the xfer has been
released, clobbers the arming just installed by the new transaction,
so the new waiter times out even if its delayed response arrives.
Release the waiter first, while the worker still holds a reference on
the xfer, so that an xfer can never reach the free list still
armed. Track whether a delayed response is expected in the waiter
itself instead of peeking at xfer->async_done outside xfer->lock, and
wait on the waiter's own embedded completion. (The new async flag is
not strictly needed but it makes the logic easier to reason about)
Finally, harden scmi_xfer_get() to clear async_done when handing out
an xfer, so that no future release-ordering change can leak a stale
arming into a new transaction.
Fixes: 3c3d818a9317 ("firmware: arm_scmi: Add core raw transmission support")
Signed-off-by: Roland Dreier <rolanddreier@rivian.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://patch.msgid.link/20260909-scmi-async-done-race-v2-2-cc5dec25c6be@rivian.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/arm_scmi/driver.c | 1 +
drivers/firmware/arm_scmi/raw_mode.c | 25 +++++++++++++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index b1ac371e41746..8a6bf2461c15f 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -687,6 +687,7 @@ static struct scmi_xfer *scmi_xfer_get(const struct scmi_handle *handle,
refcount_set(&xfer->users, 1);
atomic_set(&xfer->busy, SCMI_XFER_FREE);
+ xfer->async_done = NULL;
spin_unlock_irqrestore(&minfo->xfer_lock, flags);
return xfer;
diff --git a/drivers/firmware/arm_scmi/raw_mode.c b/drivers/firmware/arm_scmi/raw_mode.c
index bf2fa2e8cc63a..6aaaddcda4024 100644
--- a/drivers/firmware/arm_scmi/raw_mode.c
+++ b/drivers/firmware/arm_scmi/raw_mode.c
@@ -198,6 +198,8 @@ struct scmi_raw_mode_info {
* @async_response: A completion to be, optionally, used for async waits: it
* will be setup by @scmi_do_xfer_raw_start, if needed, to be
* pointed at by xfer->async_done.
+ * @async: True if @async_response was armed on @xfer, i.e. if a delayed
+ * response has to be waited for.
* @node: A list node.
*/
struct scmi_xfer_raw_waiter {
@@ -205,6 +207,7 @@ struct scmi_xfer_raw_waiter {
struct scmi_chan_info *cinfo;
struct scmi_xfer *xfer;
struct completion async_response;
+ bool async;
struct list_head node;
};
@@ -349,6 +352,7 @@ scmi_xfer_raw_waiter_get(struct scmi_raw_mode_info *raw, struct scmi_xfer *xfer,
scmi_xfer_async_response_arm(xfer, &rw->async_response);
}
+ rw->async = async;
rw->cinfo = cinfo;
rw->xfer = xfer;
}
@@ -361,8 +365,16 @@ static void scmi_xfer_raw_waiter_put(struct scmi_raw_mode_info *raw,
struct scmi_xfer_raw_waiter *rw)
{
if (rw->xfer) {
+ /*
+ * Disarm the delayed response before this waiter, and its
+ * embedded completion, can be picked up again for a new
+ * transaction: a delayed response received late, after the
+ * related wait timed out, must not signal a completion which
+ * has been in the meantime re-armed on a different xfer.
+ */
scmi_xfer_async_response_disarm(rw->xfer);
rw->xfer = NULL;
+ rw->async = false;
}
mutex_lock(&raw->free_mtx);
@@ -478,18 +490,23 @@ static void scmi_xfer_raw_worker(struct work_struct *work)
xfer->hdr.protocol_id, xfer->hdr.seq, ret);
/* Wait also for an async delayed response if needed */
- if (!ret && xfer->async_done) {
+ if (!ret && rw->async) {
unsigned long tmo = msecs_to_jiffies(SCMI_MAX_RESPONSE_TIMEOUT);
- if (!wait_for_completion_timeout(xfer->async_done, tmo))
+ if (!wait_for_completion_timeout(&rw->async_response, tmo))
dev_err(dev,
"timed out in RAW delayed resp - HDR:%08X\n",
pack_scmi_header(&xfer->hdr));
}
- /* Release waiter and xfer */
- scmi_xfer_raw_put(raw->handle, xfer);
+ /*
+ * Release the waiter first: this disarms the delayed response
+ * while we still hold a reference on the xfer, so that the xfer
+ * cannot be recycled by a new transaction while it still points
+ * at this waiter's completion.
+ */
scmi_xfer_raw_waiter_put(raw, rw);
+ scmi_xfer_raw_put(raw->handle, xfer);
} while (1);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0336/1756] usb: gadget: composite: avoid warning on aborted delayed status
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (334 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0335/1756] firmware: arm_scmi: Dont reuse raw xfers with async_done still armed Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0337/1756] usb: gadget: f_mass_storage: ignore class requests while inactive Greg Kroah-Hartman
` (662 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+a83a5a1ba9ff57935171,
Keisuke Tsukuda, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keisuke Tsukuda <catnyaaan@outlook.com>
[ Upstream commit 048884b782b137229399b9f727b6437d9b4f1071 ]
A SET_CONFIGURATION request that disables the current configuration, or a
disconnect, can abort a control transfer whose status stage was delayed by
a function driver. The asynchronous function work can nevertheless finish
later and call usb_composite_setup_continue() after reset_config() has
cleared delayed_status.
This is an expected consequence of aborting the old control transfer, and
does not require a kernel warning. Keep the diagnostic available under
dynamic debug and ignore the obsolete completion as before.
Fixes: 2bac51a1827a ("usb: gadget: composite: reset delayed_status on reset_config")
Reported-by: syzbot+a83a5a1ba9ff57935171@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a83a5a1ba9ff57935171
Signed-off-by: Keisuke Tsukuda <tkdkei@outlook.jp>
Link: https://patch.msgid.link/20260908203348.95825-2-tkdkei@outlook.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/composite.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 81ff6977a1feb..27fe75fb9568e 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2764,7 +2764,7 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev)
spin_lock_irqsave(&cdev->lock, flags);
if (cdev->delayed_status == 0) {
- WARN(cdev, "%s: Unexpected call\n", __func__);
+ DBG(cdev, "%s: Ignoring obsolete call\n", __func__);
} else if (--cdev->delayed_status == 0) {
DBG(cdev, "%s: Completing delayed status\n", __func__);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0337/1756] usb: gadget: f_mass_storage: ignore class requests while inactive
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (335 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0336/1756] usb: gadget: composite: avoid warning on aborted delayed status Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0338/1756] dmaengine: fsl_raid: zero CF descriptor pool allocations Greg Kroah-Hartman
` (661 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+d31109047baed8f3b590,
Keisuke Tsukuda, Alan Stern, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keisuke Tsukuda <catnyaaan@outlook.com>
[ Upstream commit e84caed6e7f58d96ea2e4aaa0b947ab05faa451b ]
SET_CONFIGURATION is handled asynchronously by the mass-storage thread.
A class request can arrive after the composite core selects the function
but before the thread installs common->fsg, or while the function is being
disabled.
fsg_setup() already rejects this state with -EOPNOTSUPP, but checking it
through fsg_is_set() also emits a warning. Check the active function
directly so normal requests during a configuration transition are rejected
without hiding fsg_is_set() warnings from other internal paths.
Fixes: 8876f5e7d3b2 ("USB: gadget: f_mass_storage: added eject callback")
Reported-by: syzbot+d31109047baed8f3b590@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d31109047baed8f3b590
Signed-off-by: Keisuke Tsukuda <tkdkei@outlook.jp>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20260908203348.95825-3-tkdkei@outlook.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/function/f_mass_storage.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 8b3deed447367..49e4501f57475 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -464,7 +464,12 @@ static int fsg_setup(struct usb_function *f,
u16 w_value = le16_to_cpu(ctrl->wValue);
u16 w_length = le16_to_cpu(ctrl->wLength);
- if (!fsg_is_set(fsg->common))
+ /*
+ * fsg_is_set() warns when common->fsg is NULL, but that can happen
+ * normally while a configuration change installs or removes the active
+ * function.
+ */
+ if (!fsg->common->fsg)
return -EOPNOTSUPP;
++fsg->common->ep0_req_tag; /* Record arrival of a new request */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0338/1756] dmaengine: fsl_raid: zero CF descriptor pool allocations
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (336 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0337/1756] usb: gadget: f_mass_storage: ignore class requests while inactive Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0339/1756] dmaengine: dw-axi-dmac: Fix AXI burst length encoding Greg Kroah-Hartman
` (660 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 26d48e9fb6997f4026dd86daecf8d2c12258f698 ]
The compound frame descriptors and embedded CDBs are allocated from the
cf_desc_pool with dma_pool_alloc(), which does not zero the memory. Only
cdb32, the gfm coefficients and the frame address/length fields are
programmed; the dpi_dest_spec/dpi_src_spec fields in the CDBs and the
rbro32 field of each frame are left uninitialized. The hardware reads
the whole block (frame 0 length is sizeof(struct fsl_re_xor_cdb) or
sizeof(struct fsl_re_pq_cdb)), so uninitialized heap contents are
exposed to the device on each new descriptor.
Use dma_pool_zalloc() in both fsl_re_chan_alloc_desc() and
fsl_re_alloc_chan_resources() so the descriptor and CDB memory is
zeroed before it is handed to the RAID engine.
Fixes: ad80da658bbc ("dmaengine: Driver support for FSL RaidEngine device.")
Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260820031654.28450-1-rosenp@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/fsl_raid.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
index 5c4f1d0f0c115..4d96a0594ee69 100644
--- a/drivers/dma/fsl_raid.c
+++ b/drivers/dma/fsl_raid.c
@@ -305,8 +305,8 @@ static struct fsl_re_desc *fsl_re_chan_alloc_desc(struct fsl_re_chan *re_chan,
if (!desc)
return NULL;
- cf = dma_pool_alloc(re_chan->re_dev->cf_desc_pool, GFP_NOWAIT,
- &paddr);
+ cf = dma_pool_zalloc(re_chan->re_dev->cf_desc_pool, GFP_NOWAIT,
+ &paddr);
if (!cf) {
kfree(desc);
return NULL;
@@ -594,8 +594,8 @@ static int fsl_re_alloc_chan_resources(struct dma_chan *chan)
if (!desc)
break;
- cf = dma_pool_alloc(re_chan->re_dev->cf_desc_pool, GFP_KERNEL,
- &paddr);
+ cf = dma_pool_zalloc(re_chan->re_dev->cf_desc_pool, GFP_KERNEL,
+ &paddr);
if (!cf) {
kfree(desc);
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0339/1756] dmaengine: dw-axi-dmac: Fix AXI burst length encoding
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (337 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0338/1756] dmaengine: fsl_raid: zero CF descriptor pool allocations Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0340/1756] dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access Greg Kroah-Hartman
` (659 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Wang, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Wang <wangjia@ultrarisc.com>
[ Upstream commit 0d59891c42e11c3840276d8a632dbc355d6ddc4f ]
The snps,axi-max-burst-len property describes the number of beats in an
AXI burst, while the ARLEN and AWLEN fields encode that value minus one.
The driver keeps axi_rw_burst_len as the actual burst length so that
dma_device.max_burst reports the correct value. However, it also programs
that unencoded value directly into the hardware fields. A value of 256
therefore overflows the 8-bit fields and can cause AXI decode errors.
Subtract one only when constructing hardware descriptors, while keeping
the actual value for dma_device.max_burst.
Fixes: c454d16a7d5a ("dmaengine: dw-axi-dmac: Burst length settings")
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260902-dma-fix-v3-1-414c6449fbcc@ultrarisc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 06bb3e698ec0d..4d4052845534c 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -706,7 +706,7 @@ static int dw_axi_dma_set_hw_desc(struct axi_dma_chan *chan,
ctlhi = CH_CTL_H_LLI_VALID;
if (chan->chip->dw->hdata->restrict_axi_burst_len) {
- burst_len = chan->chip->dw->hdata->axi_rw_burst_len;
+ burst_len = chan->chip->dw->hdata->axi_rw_burst_len - 1;
ctlhi |= CH_CTL_H_ARLEN_EN | CH_CTL_H_AWLEN_EN |
burst_len << CH_CTL_H_ARLEN_POS |
burst_len << CH_CTL_H_AWLEN_POS;
@@ -977,7 +977,7 @@ dma_chan_prep_dma_memcpy(struct dma_chan *dchan, dma_addr_t dst_adr,
reg = CH_CTL_H_LLI_VALID;
if (chan->chip->dw->hdata->restrict_axi_burst_len) {
- u32 burst_len = chan->chip->dw->hdata->axi_rw_burst_len;
+ u32 burst_len = chan->chip->dw->hdata->axi_rw_burst_len - 1;
reg |= (CH_CTL_H_ARLEN_EN |
burst_len << CH_CTL_H_ARLEN_POS |
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0340/1756] dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (338 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0339/1756] dmaengine: dw-axi-dmac: Fix AXI burst length encoding Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0341/1756] dmaengine: dw-axi-dmac: Fix CH_CFG2 channel priority position Greg Kroah-Hartman
` (658 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Wang, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Wang <wangjia@ultrarisc.com>
[ Upstream commit e6b49f8016ee8b642e8e495d1704342ee0b35d72 ]
axi_chan_list_dump_lli() uses the channel-wide descs_allocated count to
walk the hw_desc[] array of a single transaction. If multiple
transactions have allocated LLIs, the channel count can exceed the
transaction-local nr_hw_descs and make the DMA error path read past the
end of hw_desc[].
Use the descriptor-local nr_hw_descs count when dumping LLIs.
Fixes: ef6fb2d6f1ab ("dmaengine: dw-axi-dmac: simplify descriptor management")
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260902-dma-fix-v3-2-414c6449fbcc@ultrarisc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 4d4052845534c..b6d4798068ffc 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1054,10 +1054,7 @@ static void axi_chan_dump_lli(struct axi_dma_chan *chan,
static void axi_chan_list_dump_lli(struct axi_dma_chan *chan,
struct axi_dma_desc *desc_head)
{
- int count = atomic_read(&chan->descs_allocated);
- int i;
-
- for (i = 0; i < count; i++)
+ for (unsigned int i = 0; i < desc_head->nr_hw_descs; i++)
axi_chan_dump_lli(chan, &desc_head->hw_desc[i]);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0341/1756] dmaengine: dw-axi-dmac: Fix CH_CFG2 channel priority position
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (339 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0340/1756] dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0342/1756] PCI: endpoint: pci-epf-vntb: Serialize virtual PCI bus scan Greg Kroah-Hartman
` (657 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jia Wang, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Wang <wangjia@ultrarisc.com>
[ Upstream commit 2a9013c20c46216b92ff09e2283b5244a91c59da ]
The CH_CFG2 channel priority field occupies bits 51:47 of the 64-bit
channel configuration register, corresponding to bits 19:15 of CH_CFG2_H.
The driver currently shifts the priority value by 20, programming the
wrong bits. Use bit 15 as the field position.
Fixes: 824351668a41 ("dmaengine: dw-axi-dmac: support DMAX_NUM_CHANNELS > 8")
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260902-dma-fix-v3-3-414c6449fbcc@ultrarisc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
index d6e53f400af25..21adc030a7109 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
@@ -325,7 +325,7 @@ enum {
#define CH_CFG2_H_TT_FC_POS 0
#define CH_CFG2_H_HS_SEL_SRC_POS 3
#define CH_CFG2_H_HS_SEL_DST_POS 4
-#define CH_CFG2_H_PRIORITY_POS 20
+#define CH_CFG2_H_PRIORITY_POS 15
/**
* DW AXI DMA channel interrupts
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0342/1756] PCI: endpoint: pci-epf-vntb: Serialize virtual PCI bus scan
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (340 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0341/1756] dmaengine: dw-axi-dmac: Fix CH_CFG2 channel priority position Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0343/1756] regulator: ab8500: Fix AB8505 VANA voltage selectors Greg Kroah-Hartman
` (656 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Manivannan Sadhasivam, Koichiro Den,
Manivannan Sadhasivam, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koichiro Den <den@valinux.co.jp>
[ Upstream commit 84c3520c9e8c14b09a5cf645cc4fa7c6d9d61127 ]
The virtual PCI bus is scanned without holding the PCI rescan/remove
lock. This can race with other PCI topology changes.
Hold the lock across the bus scan and device addition.
Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP")
Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/3tgrcel5fl55ulf3zjya4fkz4t2ms7iwwjif5rnzn2rafsydd6@i4e5etm7uqvz/
Link: https://patch.msgid.link/20260901063238.631166-2-den@valinux.co.jp
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/endpoint/functions/pci-epf-vntb.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
index ea96174cc5110..e5fd2bc04c23f 100644
--- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
+++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
@@ -1008,15 +1008,20 @@ static int vpci_scan_bus(void *sysdata)
struct pci_bus *vpci_bus;
struct epf_ntb *ndev = sysdata;
+ pci_lock_rescan_remove();
+
vpci_bus = pci_scan_bus(ndev->vbus_number, &vpci_ops, sysdata);
if (!vpci_bus) {
pr_err("create pci bus failed\n");
+ pci_unlock_rescan_remove();
return -EINVAL;
}
ndev->vpci_bus = vpci_bus;
pci_bus_add_devices(vpci_bus);
+ pci_unlock_rescan_remove();
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0343/1756] regulator: ab8500: Fix AB8505 VANA voltage selectors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (341 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0342/1756] PCI: endpoint: pci-epf-vntb: Serialize virtual PCI bus scan Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0344/1756] regulator: ab8500: Remove stale expand_register kernel-doc entry Greg Kroah-Hartman
` (655 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit dfdfda2a95843706428a9d95ab546cb10983e684 ]
The AB8505 VANA voltage table assumes selector 0 represents 1.05 V
and all eight selectors increase linearly. Selector 0 actually
represents 1.2 V. Selectors 1 through 6 cover 1.05 V through
1.175 V, and selector 7 represents 1.225 V.
Correct the table so each selector reports and programs the documented
voltage.
Reference: AB8505 User Manual, DM00046744 Rev 3, p. 257
Fixes: 8a3b1b8703fe ("regulator: ab8500: Add voltage selection for AUDIO and ANA on AB8505")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-1-fe88b01829bf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 6b4a3a3d83851..26accd604c395 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -265,13 +265,13 @@ static const unsigned int fixed_2050000_voltage[] = {
};
static const unsigned int ldo_vana_voltages[] = {
+ 1200000,
1050000,
1075000,
1100000,
1125000,
1150000,
1175000,
- 1200000,
1225000,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0344/1756] regulator: ab8500: Remove stale expand_register kernel-doc entry
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (342 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0343/1756] regulator: ab8500: Fix AB8505 VANA voltage selectors Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0345/1756] regulator: ab8500: Add AB8505 VAUX3 3.05 V setting Greg Kroah-Hartman
` (654 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Babanpreet Singh,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Babanpreet Singh <bbnpreetsingh@gmail.com>
[ Upstream commit 0991f3b4624ed713d1d5eb56520c1c9b2deaab7a ]
Commit aeee55b76bfd ("regulator: ab8500: Remove unused embedded struct
expand_register") deleted the expand_register member from struct
ab8500_regulator_info and, in the same hunk, added an empty
"@expand_register:" line to the kernel-doc block. That traded one W=1
warning for another:
drivers/regulator/ab8500.c:196 Excess struct member 'expand_register'
description in 'ab8500_regulator_info'
Drop the leftover line; the remaining @member entries all match the
struct.
No functional changes.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202605160857.ZIE3nO9J-lkp@intel.com/
Assisted-by: Claude:claude-opus-5 [kernel-doc]
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
Link: https://patch.msgid.link/20260802013304.7-1-bbnpreetsingh@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: ac72c091a981 ("regulator: ab8500: Add AB8505 VAUX3 3.05 V setting")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 26accd604c395..ca59406d42a85 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -173,7 +173,6 @@ struct ab8500_shared_mode {
* @voltage_bank: bank to control regulator voltage
* @voltage_reg: register to control regulator voltage
* @voltage_mask: mask to control regulator voltage
- * @expand_register:
*/
struct ab8500_regulator_info {
struct device *dev;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0345/1756] regulator: ab8500: Add AB8505 VAUX3 3.05 V setting
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (343 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0344/1756] regulator: ab8500: Remove stale expand_register kernel-doc entry Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0346/1756] regulator: ab8500: Handle AB8505 VINTCORE selector 7 Greg Kroah-Hartman
` (653 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit ac72c091a9810493ccd9209414d4f859276727ab ]
AB8505 has an additional VAUX3 voltage setting which is not encoded
in the normal three-bit selector. ArmRegu2.Vaux3Sel3 overrides that
selector and selects 3.05 V.
Add the missing voltage and use the override bit as an extended
selector. Program the ordinary selector before clearing the override
so VAUX3 does not briefly switch to a stale voltage.
Reference: AB8505 User Manual, DM00046744 Rev 3, pp. 229 and 254
Fixes: 547f384f33db ("regulator: ab8500: add support for ab8505")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-2-fe88b01829bf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 101 +++++++++++++++++++++++++++++++++++--
1 file changed, 98 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index ca59406d42a85..07d96f8ff944f 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -173,6 +173,7 @@ struct ab8500_shared_mode {
* @voltage_bank: bank to control regulator voltage
* @voltage_reg: register to control regulator voltage
* @voltage_mask: mask to control regulator voltage
+ * @expand_register: additional register used to select an extra voltage
*/
struct ab8500_regulator_info {
struct device *dev;
@@ -193,6 +194,12 @@ struct ab8500_regulator_info {
u8 voltage_bank;
u8 voltage_reg;
u8 voltage_mask;
+ struct {
+ u8 voltage_limit;
+ u8 voltage_bank;
+ u8 voltage_reg;
+ u8 voltage_mask;
+ } expand_register;
};
/* voltage tables for the vauxn/vintcore supplies */
@@ -226,6 +233,18 @@ static const unsigned int ldo_vaux3_voltages[] = {
2910000,
};
+static const unsigned int ldo_vaux3_ab8505_voltages[] = {
+ 1200000,
+ 1500000,
+ 1800000,
+ 2100000,
+ 2500000,
+ 2750000,
+ 2790000,
+ 2910000,
+ 3050000,
+};
+
static const unsigned int ldo_vaux56_voltages[] = {
1800000,
1050000,
@@ -593,6 +612,64 @@ static int ab8500_regulator_set_voltage_sel(struct regulator_dev *rdev,
return ret;
}
+static int ab8500_regulator_get_voltage_sel_expand(struct regulator_dev *rdev)
+{
+ struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
+ u8 regval;
+ int ret;
+
+ if (!info)
+ return -EINVAL;
+
+ ret = abx500_get_register_interruptible(info->dev,
+ info->expand_register.voltage_bank,
+ info->expand_register.voltage_reg, ®val);
+ if (ret < 0) {
+ dev_err(rdev_get_dev(rdev),
+ "couldn't read voltage expand reg for regulator\n");
+ return ret;
+ }
+
+ if (regval & info->expand_register.voltage_mask)
+ return info->expand_register.voltage_limit;
+
+ return ab8500_regulator_get_voltage_sel(rdev);
+}
+
+static int ab8500_regulator_set_voltage_sel_expand(struct regulator_dev *rdev,
+ unsigned int selector)
+{
+ struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
+ u8 regval;
+ int ret;
+
+ if (!info)
+ return -EINVAL;
+
+ if (selector > info->expand_register.voltage_limit)
+ return -EINVAL;
+
+ if (selector < info->expand_register.voltage_limit) {
+ ret = ab8500_regulator_set_voltage_sel(rdev, selector);
+ if (ret < 0)
+ return ret;
+
+ regval = 0;
+ } else {
+ regval = info->expand_register.voltage_mask;
+ }
+
+ ret = abx500_mask_and_set_register_interruptible(info->dev,
+ info->expand_register.voltage_bank,
+ info->expand_register.voltage_reg,
+ info->expand_register.voltage_mask, regval);
+ if (ret < 0)
+ dev_err(rdev_get_dev(rdev),
+ "couldn't set voltage expand reg for regulator\n");
+
+ return ret;
+}
+
static const struct regulator_ops ab8500_regulator_volt_mode_ops = {
.enable = ab8500_regulator_enable,
.disable = ab8500_regulator_disable,
@@ -605,6 +682,18 @@ static const struct regulator_ops ab8500_regulator_volt_mode_ops = {
.list_voltage = regulator_list_voltage_table,
};
+static const struct regulator_ops ab8500_regulator_volt_mode_expand_ops = {
+ .enable = ab8500_regulator_enable,
+ .disable = ab8500_regulator_disable,
+ .is_enabled = ab8500_regulator_is_enabled,
+ .get_optimum_mode = ab8500_regulator_get_optimum_mode,
+ .set_mode = ab8500_regulator_set_mode,
+ .get_mode = ab8500_regulator_get_mode,
+ .get_voltage_sel = ab8500_regulator_get_voltage_sel_expand,
+ .set_voltage_sel = ab8500_regulator_set_voltage_sel_expand,
+ .list_voltage = regulator_list_voltage_table,
+};
+
static const struct regulator_ops ab8500_regulator_volt_ops = {
.enable = ab8500_regulator_enable,
.disable = ab8500_regulator_disable,
@@ -908,12 +997,12 @@ static struct ab8500_regulator_info
[AB8505_LDO_AUX3] = {
.desc = {
.name = "LDO-AUX3",
- .ops = &ab8500_regulator_volt_mode_ops,
+ .ops = &ab8500_regulator_volt_mode_expand_ops,
.type = REGULATOR_VOLTAGE,
.id = AB8505_LDO_AUX3,
.owner = THIS_MODULE,
- .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages),
- .volt_table = ldo_vaux3_voltages,
+ .n_voltages = ARRAY_SIZE(ldo_vaux3_ab8505_voltages),
+ .volt_table = ldo_vaux3_ab8505_voltages,
},
.load_lp_uA = 5000,
.update_bank = 0x04,
@@ -925,6 +1014,12 @@ static struct ab8500_regulator_info
.voltage_bank = 0x04,
.voltage_reg = 0x21,
.voltage_mask = 0x07,
+ .expand_register = {
+ .voltage_limit = 8,
+ .voltage_bank = 0x04,
+ .voltage_reg = 0x01,
+ .voltage_mask = 0x10,
+ },
},
[AB8505_LDO_AUX4] = {
.desc = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0346/1756] regulator: ab8500: Handle AB8505 VINTCORE selector 7
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (344 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0345/1756] regulator: ab8500: Add AB8505 VAUX3 3.05 V setting Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0347/1756] regulator: ab8500: Treat cut 1.0 VAUX3 as fixed Greg Kroah-Hartman
` (652 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 4ec4df7e54182edb6955caace37684e535e462dc ]
The AB8505 VINTCORE table exposes only selectors 0 through 6. The
hardware also accepts selector 7 and maps it to 1.35 V, just like
selector 6. Omitting it can make an OTP-programmed selector 7 appear
invalid to the regulator core.
Give AB8505 its own eight-entry selector table while leaving the
AB8500 table unchanged.
Reference: AB8505 User Manual, DM00046744 Rev 3, p. 223
Fixes: 547f384f33db ("regulator: ab8500: add support for ab8505")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-3-fe88b01829bf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 07d96f8ff944f..5e24e6cdc7732 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -266,6 +266,17 @@ static const unsigned int ldo_vintcore_voltages[] = {
1350000,
};
+static const unsigned int ldo_vintcore_ab8505_voltages[] = {
+ 1200000,
+ 1225000,
+ 1250000,
+ 1275000,
+ 1300000,
+ 1325000,
+ 1350000,
+ 1350000,
+};
+
static const unsigned int fixed_1200000_voltage[] = {
1200000,
};
@@ -1095,8 +1106,8 @@ static struct ab8500_regulator_info
.type = REGULATOR_VOLTAGE,
.id = AB8505_LDO_INTCORE,
.owner = THIS_MODULE,
- .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages),
- .volt_table = ldo_vintcore_voltages,
+ .n_voltages = ARRAY_SIZE(ldo_vintcore_ab8505_voltages),
+ .volt_table = ldo_vintcore_ab8505_voltages,
},
.load_lp_uA = 5000,
.update_bank = 0x03,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0347/1756] regulator: ab8500: Treat cut 1.0 VAUX3 as fixed
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (345 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0346/1756] regulator: ab8500: Handle AB8505 VINTCORE selector 7 Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0348/1756] regulator: ab8500: Test dedicated enable bits only Greg Kroah-Hartman
` (651 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit b9fc8a8d31b914b09329240f532ff0e9c00cd727 ]
The early-cut workaround currently gives AB8500 cut 1.0 the 16
programmable VAUX3 settings introduced with cut 1.1. On cut 1.0 the
selector is not programmable and VAUX3 is fixed at 1.2 V.
Register VAUX3 as a fixed-voltage regulator on cut 1.0 and retain the
16-value workaround only for cut 1.1.
Reference: AB8500 User Manual, UM0836 Rev 3, p. 240
Fixes: 2b75151a1041 ("regulators: Added ab8500 v2 support")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-4-fe88b01829bf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 5e24e6cdc7732..42cb8dfdc7c90 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -1783,9 +1783,14 @@ static int ab8500_regulator_register(struct platform_device *pdev,
config.driver_data = info;
config.of_node = np;
- /* fix for hardware before ab8500v2.0 */
- if (is_ab8500_1p1_or_earlier(ab8500)) {
- if (info->desc.id == AB8500_LDO_AUX3) {
+ /* Handle the different VAUX3 implementations in early AB8500 cuts. */
+ if (info->desc.id == AB8500_LDO_AUX3) {
+ if (is_ab8500_1p0_or_earlier(ab8500)) {
+ info->desc.ops = &ab8500_regulator_mode_ops;
+ info->desc.n_voltages = 1;
+ info->desc.volt_table = fixed_1200000_voltage;
+ info->voltage_mask = 0;
+ } else if (is_ab8500_1p1_or_earlier(ab8500)) {
info->desc.n_voltages =
ARRAY_SIZE(ldo_vauxn_voltages);
info->desc.volt_table = ldo_vauxn_voltages;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0348/1756] regulator: ab8500: Test dedicated enable bits only
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (346 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0347/1756] regulator: ab8500: Treat cut 1.0 VAUX3 as fixed Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0349/1756] regulator: ab8500: Propagate mode enable read errors Greg Kroah-Hartman
` (650 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit a5ee78846015512b4d3d32f8aa463024a23234ce ]
Some regulator control registers have independent enable and low-power
bits. is_enabled() currently tests their combined update mask, so an
off regulator with its low-power bit set is incorrectly reported as
enabled.
Add an optional enable mask and use it for VINTCORE, AB8500 TVOUT,
AB8505 ADC, and AB8505 VAUX5/6. Regulators whose two-bit field encodes
the complete operating state continue to test the full update mask.
References: AB8500 User Manual, UM0836 Rev 3, p. 214;
AB8505 User Manual, DM00046744 Rev 3, pp. 171-172 and 223
Fixes: 65e03ed2d0cd ("regulators: Fixed errors in ab8500 register mapping")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-5-fe88b01829bf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 42cb8dfdc7c90..05c6b9c7af0c7 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -162,6 +162,7 @@ struct ab8500_shared_mode {
* @update_bank: bank to control on/off
* @update_reg: register to control on/off
* @update_mask: mask to enable/disable and set mode of regulator
+ * @enable_mask: optional mask for an enable bit separate from the mode bit
* @update_val: bits holding the regulator current mode
* @update_val_idle: bits to enable the regulator in idle (low power) mode
* @update_val_normal: bits to enable the regulator in normal (high power) mode
@@ -183,6 +184,7 @@ struct ab8500_regulator_info {
u8 update_bank;
u8 update_reg;
u8 update_mask;
+ u8 enable_mask;
u8 update_val;
u8 update_val_idle;
u8 update_val_normal;
@@ -377,6 +379,7 @@ static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)
{
int ret;
struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
+ u8 enable_mask;
u8 regval;
if (info == NULL) {
@@ -392,13 +395,15 @@ static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)
return ret;
}
+ enable_mask = info->enable_mask ? info->enable_mask : info->update_mask;
+
dev_vdbg(rdev_get_dev(rdev),
"%s-is_enabled (bank, reg, mask, value): 0x%x, 0x%x, 0x%x,"
" 0x%x\n",
info->desc.name, info->update_bank, info->update_reg,
- info->update_mask, regval);
+ enable_mask, regval);
- if (regval & info->update_mask)
+ if (regval & enable_mask)
return 1;
else
return 0;
@@ -833,6 +838,7 @@ static struct ab8500_regulator_info
.update_bank = 0x03,
.update_reg = 0x80,
.update_mask = 0x44,
+ .enable_mask = 0x04,
.update_val = 0x44,
.update_val_idle = 0x44,
.update_val_normal = 0x04,
@@ -861,6 +867,7 @@ static struct ab8500_regulator_info
.update_bank = 0x03,
.update_reg = 0x80,
.update_mask = 0x82,
+ .enable_mask = 0x02,
.update_val = 0x02,
.update_val_idle = 0x82,
.update_val_normal = 0x02,
@@ -1070,6 +1077,7 @@ static struct ab8500_regulator_info
.update_bank = 0x01,
.update_reg = 0x55,
.update_mask = 0x18,
+ .enable_mask = 0x10,
.update_val = 0x10,
.update_val_idle = 0x18,
.update_val_normal = 0x10,
@@ -1092,6 +1100,7 @@ static struct ab8500_regulator_info
.update_bank = 0x01,
.update_reg = 0x56,
.update_mask = 0x18,
+ .enable_mask = 0x10,
.update_val = 0x10,
.update_val_idle = 0x18,
.update_val_normal = 0x10,
@@ -1113,6 +1122,7 @@ static struct ab8500_regulator_info
.update_bank = 0x03,
.update_reg = 0x80,
.update_mask = 0x44,
+ .enable_mask = 0x04,
.update_val = 0x04,
.update_val_idle = 0x44,
.update_val_normal = 0x04,
@@ -1141,6 +1151,7 @@ static struct ab8500_regulator_info
.update_bank = 0x03,
.update_reg = 0x80,
.update_mask = 0x82,
+ .enable_mask = 0x02,
.update_val = 0x02,
.update_val_idle = 0x82,
.update_val_normal = 0x02,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0349/1756] regulator: ab8500: Propagate mode enable read errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (347 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0348/1756] regulator: ab8500: Test dedicated enable bits only Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0350/1756] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON Greg Kroah-Hartman
` (649 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 71ac8878573058e2b85210760ccaeaac90796c35 ]
For regulators whose enable and mode share a state field, set_mode()
first reads that field so changing the requested mode does not enable a
disabled rail. A register read error is currently treated as true and
the driver proceeds to write the new mode, potentially enabling a rail
whose state is unknown.
Return the read error without changing the register or cached mode.
References: AB8500 User Manual, UM0836 Rev 3, p. 227;
AB8505 User Manual, DM00046744 Rev 3, p. 237
Fixes: 438e695b87e0 ("regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260901-ux500-dts-snowball-regulator-v2-6-fe88b01829bf@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/ab8500.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 05c6b9c7af0c7..e4c3502c8dbcc 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -433,7 +433,7 @@ static unsigned int ab8500_regulator_get_optimum_mode(
static int ab8500_regulator_set_mode(struct regulator_dev *rdev,
unsigned int mode)
{
- int ret = 0;
+ int enabled, ret = 0;
u8 bank, reg, mask, val;
bool lp_mode_req = false;
struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
@@ -490,7 +490,17 @@ static int ab8500_regulator_set_mode(struct regulator_dev *rdev,
goto out_unlock;
}
- if (info->mode_mask || ab8500_regulator_is_enabled(rdev)) {
+ if (info->mode_mask) {
+ enabled = 1;
+ } else {
+ enabled = ab8500_regulator_is_enabled(rdev);
+ if (enabled < 0) {
+ ret = enabled;
+ goto out_unlock;
+ }
+ }
+
+ if (enabled) {
ret = abx500_mask_and_set_register_interruptible(info->dev,
bank, reg, mask, val);
if (ret < 0) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0350/1756] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (348 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0349/1756] regulator: ab8500: Propagate mode enable read errors Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0351/1756] sit: fix UAF in ipip6_tunnel_del_prl() Greg Kroah-Hartman
` (648 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luca Weiss, Abel Vesa, Konrad Dybcio,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Weiss <luca.weiss@fairphone.com>
[ Upstream commit 5c088a33e3a9bb236c475b7230df275fc1e51eda ]
Two PMICs on this phone have a PON block, the PM6350 and PMK8350. Only
one should be enabled at one time, so disable PMK8350 PON and keep the
PM6350 PON.
Fixes: 582e7c1026fa ("arm64: dts: qcom: sm7225-fairphone-fp4: Add pmk8350 PMIC")
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260901-fp4-pmk8350-pon-v1-1-e05937e9c860@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index dfa3b111ae10f..4c73893e26931 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -924,6 +924,10 @@ xo-therm@0 {
};
};
+&pmk8350_pon {
+ status = "disabled";
+};
+
&pmk8350_rtc {
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0351/1756] sit: fix UAF in ipip6_tunnel_del_prl()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (349 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0350/1756] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0352/1756] ip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setup Greg Kroah-Hartman
` (647 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jakub Kicinski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 5145bb6a2c2683d541828f86d5321e0565f2e30c ]
When flushing all potential router list (PRL) entries,
ipip6_tunnel_del_prl() called call_rcu(&x->rcu_head, prl_list_destroy_rcu)
before clearing t->prl.
A concurrent reader in isatap_chksrc() could enter an RCU read-side
critical section after call_rcu() but before t->prl is set to NULL,
allowing prl_list_destroy_rcu() to free nodes while the reader traverses
them.
Clear t->prl using RCU_INIT_POINTER() before invoking call_rcu().
Also use rcu_assign_pointer() when unlinking individual entries.
Fixes: ef9a9d1183b3 ("ipv6 sit: RCU conversion phase I")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260907075846.2913645-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/sit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 614f7267dc9f8..eb42d3075e77d 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -435,7 +435,7 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a)
(x = rtnl_dereference(*p)) != NULL;
p = &x->next) {
if (x->addr == a->addr) {
- *p = x->next;
+ rcu_assign_pointer(*p, rtnl_dereference(x->next));
kfree_rcu(x, rcu_head);
t->prl_count--;
goto out;
@@ -446,8 +446,8 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a)
x = rtnl_dereference(t->prl);
if (x) {
t->prl_count = 0;
+ RCU_INIT_POINTER(t->prl, NULL);
call_rcu(&x->rcu_head, prl_list_destroy_rcu);
- t->prl = NULL;
}
}
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0352/1756] ip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (350 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0351/1756] sit: fix UAF in ipip6_tunnel_del_prl() Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0353/1756] crypto: amlogic - Fix DMA memory leak in cipher error path Greg Kroah-Hartman
` (646 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Lorenzo Bianconi,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 88b84cae6b94087d3a9679845fe28ad19c7bef8b ]
Update ip_tunnel_encap_setup() to use WRITE_ONCE() when writing
to encap fields (type, sport, dport, flags) and hlen fields.
This ensures that concurrent lockless readers (like fill_info)
do not see torn writes.
Also remove the unsafe memset() on t->encap which could cause
concurrent readers to transiently see zeroed fields.
Removing it also fixes a bug where t->encap was left cleared
even if ip_encap_hlen() failed, resulting in partial configuration.
Fixes: 56328486539d ("net: Changes to ip_tunnel to support foo-over-udp encapsulation")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260907075846.2913645-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/ip_tunnel.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index ed7bcd70f0c84..978fd583428ea 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -490,19 +490,17 @@ int ip_tunnel_encap_setup(struct ip_tunnel *t,
{
int hlen;
- memset(&t->encap, 0, sizeof(t->encap));
-
hlen = ip_encap_hlen(ipencap);
if (hlen < 0)
return hlen;
- t->encap.type = ipencap->type;
- t->encap.sport = ipencap->sport;
- t->encap.dport = ipencap->dport;
- t->encap.flags = ipencap->flags;
+ WRITE_ONCE(t->encap.type, ipencap->type);
+ WRITE_ONCE(t->encap.sport, ipencap->sport);
+ WRITE_ONCE(t->encap.dport, ipencap->dport);
+ WRITE_ONCE(t->encap.flags, ipencap->flags);
- t->encap_hlen = hlen;
- t->hlen = t->encap_hlen + t->tun_hlen;
+ WRITE_ONCE(t->encap_hlen, hlen);
+ WRITE_ONCE(t->hlen, hlen + t->tun_hlen);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0353/1756] crypto: amlogic - Fix DMA memory leak in cipher error path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (351 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0352/1756] ip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setup Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0354/1756] crypto: qat - avoid OOB read when stripping RSA leading zeros Greg Kroah-Hartman
` (645 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mohamad Raizudeen, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
[ Upstream commit 6c2373dd818b777d0a81eb02acebc03940552dcd ]
A DMA memory leak occurs in meson_cipher() on the mapping error paths.
The driver jumps to the end of the function without unmapping the
previously mapped source scatterlist and key/IV buffer when the
destination apping fails.
Additionally, a memory leak occurs when a scatterlist mapping succeeds
but the returned count exceeds the driver's MAXDESC limit. In this case,
the driver rejects the mapping without unmapping it. The BIDIRECTIONAL
mapping branch also lacks the required 'MAXDESC -3' upper bound check.
Fix this by introducing proper error labels, error_src and error_keyiv
and unmap resources immediately inside the calidation checks to ensure
all successfully mapped resources are cleaned up before returning the
error.
Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/amlogic/amlogic-gxl-cipher.c | 25 ++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
index 29048da6f50a7..d78815b0547d8 100644
--- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
+++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
@@ -177,10 +177,13 @@ static int meson_cipher(struct skcipher_request *areq)
if (areq->src == areq->dst) {
nr_sgs = dma_map_sg(mc->dev, areq->src, sg_nents(areq->src),
DMA_BIDIRECTIONAL);
- if (!nr_sgs) {
- dev_err(mc->dev, "Invalid SG count %d\n", nr_sgs);
+ if (!nr_sgs || nr_sgs > MAXDESC - 3) {
+ dev_err(mc->dev, "Invalid BIDIR SG count %d\n", nr_sgs);
err = -EINVAL;
- goto theend;
+
+ if (nr_sgs)
+ dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_BIDIRECTIONAL);
+ goto error_keyiv;
}
nr_sgd = nr_sgs;
} else {
@@ -189,14 +192,20 @@ static int meson_cipher(struct skcipher_request *areq)
if (!nr_sgs || nr_sgs > MAXDESC - 3) {
dev_err(mc->dev, "Invalid SG count %d\n", nr_sgs);
err = -EINVAL;
- goto theend;
+
+ if (nr_sgs)
+ dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE);
+ goto error_keyiv;
}
nr_sgd = dma_map_sg(mc->dev, areq->dst, sg_nents(areq->dst),
DMA_FROM_DEVICE);
if (!nr_sgd || nr_sgd > MAXDESC - 3) {
dev_err(mc->dev, "Invalid SG count %d\n", nr_sgd);
err = -EINVAL;
- goto theend;
+
+ if (nr_sgd)
+ dma_unmap_sg(mc->dev, areq->dst, sg_nents(areq->dst), DMA_FROM_DEVICE);
+ goto error_src;
}
}
@@ -251,6 +260,12 @@ static int meson_cipher(struct skcipher_request *areq)
ivsize, 0);
}
}
+ goto theend;
+
+error_src:
+ dma_unmap_sg(mc->dev, areq->src, sg_nents(areq->src), DMA_TO_DEVICE);
+error_keyiv:
+ dma_unmap_single(mc->dev, phykeyiv, keyivlen, DMA_TO_DEVICE);
theend:
kfree_sensitive(bkeyiv);
kfree_sensitive(backup_iv);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0354/1756] crypto: qat - avoid OOB read when stripping RSA leading zeros
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (352 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0353/1756] crypto: amlogic - Fix DMA memory leak in cipher error path Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0355/1756] crypto: qat - release instance on DH fallback allocation failure Greg Kroah-Hartman
` (644 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahsan Atta, Giovanni Cabiddu,
Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahsan Atta <ahsan.atta@intel.com>
[ Upstream commit ac508238898058f0b09b18a7891fb31279617781 ]
The logical AND operator uses short-circuit evaluation: the first
operand is always evaluated, while the second is evaluated only if
the first is true. Because the first operand dereferences a pointer,
it may cause an out-of-bounds access before the bounds check in the
second operand is evaluated.
Resolve this by checking the vlen prior to the pointer being dereferenced.
Fixes: a990532023b9 ("crypto: qat - Add support for RSA algorithm")
Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/intel/qat/qat_common/qat_asym_algs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c b/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
index afb7e3f44a5f8..173392fdf5bc4 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
@@ -987,7 +987,7 @@ static int qat_rsa_set_n(struct qat_rsa_ctx *ctx, const char *value,
const char *ptr = value;
int ret;
- while (!*ptr && vlen) {
+ while (vlen && !*ptr) {
ptr++;
vlen--;
}
@@ -1018,7 +1018,7 @@ static int qat_rsa_set_e(struct qat_rsa_ctx *ctx, const char *value,
struct device *dev = &GET_DEV(inst->accel_dev);
const char *ptr = value;
- while (!*ptr && vlen) {
+ while (vlen && !*ptr) {
ptr++;
vlen--;
}
@@ -1044,7 +1044,7 @@ static int qat_rsa_set_d(struct qat_rsa_ctx *ctx, const char *value,
const char *ptr = value;
int ret;
- while (!*ptr && vlen) {
+ while (vlen && !*ptr) {
ptr++;
vlen--;
}
@@ -1067,7 +1067,7 @@ static int qat_rsa_set_d(struct qat_rsa_ctx *ctx, const char *value,
static void qat_rsa_drop_leading_zeros(const char **ptr, unsigned int *len)
{
- while (!**ptr && *len) {
+ while (*len && !**ptr) {
(*ptr)++;
(*len)--;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0355/1756] crypto: qat - release instance on DH fallback allocation failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (353 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0354/1756] crypto: qat - avoid OOB read when stripping RSA leading zeros Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0356/1756] crypto: mxs-dcp - handle zero-length skcipher requests Greg Kroah-Hartman
` (643 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahsan Atta, Giovanni Cabiddu,
Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahsan Atta <ahsan.atta@intel.com>
[ Upstream commit 307e27d3e07f58b6d42a8c64d31304aa614ab7d2 ]
qat_dh_init_tfm() acquires a QAT crypto instance before allocating the
software fallback transform. If fallback allocation fails, the instance
reference is leaked and the device remains permanently in use.
Release the instance before returning the allocation error.
Fixes: 5d5bd24f4155 ("crypto: qat - implement dh fallback for primes > 4K")
Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/intel/qat/qat_common/qat_asym_algs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c b/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
index 173392fdf5bc4..aa809e6d67bfe 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
@@ -535,8 +535,10 @@ static int qat_dh_init_tfm(struct crypto_kpp *tfm)
return -EINVAL;
ctx->ftfm = crypto_alloc_kpp(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
- if (IS_ERR(ctx->ftfm))
+ if (IS_ERR(ctx->ftfm)) {
+ qat_crypto_put_instance(inst);
return PTR_ERR(ctx->ftfm);
+ }
crypto_kpp_set_flags(ctx->ftfm, crypto_kpp_get_flags(tfm));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0356/1756] crypto: mxs-dcp - handle zero-length skcipher requests
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (354 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0355/1756] crypto: qat - release instance on DH fallback allocation failure Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0357/1756] crypto: lskcipher - preserve state across unaligned chunks Greg Kroah-Hartman
` (642 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linmao Li, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linmao Li <lilinmao@kylinos.cn>
[ Upstream commit ac1d6a65a1e1f069f119df42c6b57dbdff5f6be8 ]
Zero-length skcipher requests are valid no-ops, but MXS-DCP queues them.
When such a request reaches the worker, last_out_len remains zero. The
CBC completion path then subtracts AES_BLOCK_SIZE from this unsigned
value when updating the IV, causing the offset to underflow. On
decryption, the resulting source address precedes aes_in_buf.
Return success before enqueueing zero-length requests. This avoids the
invalid source access and leaves the IV unchanged for a no-op.
Fixes: fadd7a6e616b ("crypto: mxs-dcp - Fix AES issues")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/mxs-dcp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
index 123f64e8460dc..eb80556c94b6e 100644
--- a/drivers/crypto/mxs-dcp.c
+++ b/drivers/crypto/mxs-dcp.c
@@ -473,6 +473,9 @@ static int mxs_dcp_aes_enqueue(struct skcipher_request *req, int enc, int ecb)
struct dcp_aes_req_ctx *rctx = skcipher_request_ctx(req);
int ret;
+ if (!req->cryptlen)
+ return 0;
+
if (unlikely(actx->key_len != AES_KEYSIZE_128 && !actx->key_referenced))
return mxs_dcp_block_fallback(req, enc);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0357/1756] crypto: lskcipher - preserve state across unaligned chunks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (355 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0356/1756] crypto: mxs-dcp - handle zero-length skcipher requests Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0358/1756] memory: exynos5422-dmc: handle clock enable failures Greg Kroah-Hartman
` (641 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit ba871255f796d1f599ba710f03e1803d1b374a75 ]
crypto_lskcipher_crypt_unaligned() splits a request into page-sized
chunks but never sets CRYPTO_LSKCIPHER_FLAG_CONT, so a stateful algorithm
restarts from its keyed state at every page boundary. It also marks every
chunk CRYPTO_LSKCIPHER_FLAG_FINAL, which is wrong but harmless: chunks are
trimmed to a multiple of the chunk size, so the trailing partial block that
FINAL guards against is caught after the loop instead.
ARC4 is the only lskcipher with internal state, and cbc, the other
in-tree user of the direct API, never passes more than one block, so
this went unnoticed. bpf_crypto_crypt() however hands
__bpf_dynptr_data() to crypto_lskcipher_encrypt() unchecked, leaving
both alignment and length to the BPF program. An 8192-byte ARC4 request
offset by one byte comes back with its second page identical to its
first: the keystream is reused.
Set FINAL only on the last chunk and CONT after the first, mirroring the
progression used by crypto_lskcipher_crypt_sg().
Fixes: 0ae4dcc1ebf6 ("crypto: skcipher - Add internal state support")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
crypto/lskcipher.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/crypto/lskcipher.c b/crypto/lskcipher.c
index b4537be3b2a8c..652416e23eaf1 100644
--- a/crypto/lskcipher.c
+++ b/crypto/lskcipher.c
@@ -75,6 +75,7 @@ static int crypto_lskcipher_crypt_unaligned(
unsigned ivsize = crypto_lskcipher_ivsize(tfm);
unsigned bs = crypto_lskcipher_blocksize(tfm);
unsigned cs = crypto_lskcipher_chunksize(tfm);
+ u32 flags = 0;
int err;
u8 *tiv;
u8 *p;
@@ -98,13 +99,16 @@ static int crypto_lskcipher_crypt_unaligned(
if (chunk > cs)
chunk &= ~(cs - 1);
+ if (chunk == len)
+ flags |= CRYPTO_LSKCIPHER_FLAG_FINAL;
memcpy(p, src, chunk);
- err = crypt(tfm, p, p, chunk, tiv, CRYPTO_LSKCIPHER_FLAG_FINAL);
+ err = crypt(tfm, p, p, chunk, tiv, flags);
if (err)
goto out;
memcpy(dst, p, chunk);
+ flags |= CRYPTO_LSKCIPHER_FLAG_CONT;
src += chunk;
dst += chunk;
len -= chunk;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0358/1756] memory: exynos5422-dmc: handle clock enable failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (356 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0357/1756] crypto: lskcipher - preserve state across unaligned chunks Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0359/1756] gfs2: Fix journaled truncate range end offset Greg Kroah-Hartman
` (640 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiawen Liu, Lukasz Luba,
Krzysztof Kozlowski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiawen Liu <1298662399@qq.com>
[ Upstream commit cce46902ea9fcd585cd200fffa3166f63bc571f1 ]
Check the return values of clk_prepare_enable() for fout_bpll and
mout_bpll.
If enabling fout_bpll fails, propagate the error. If enabling mout_bpll
fails, disable fout_bpll before returning. This keeps the clock enable
count balanced on probe error paths.
Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/tencent_B0189529F550458590E3BA614EAB800FBF08@qq.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/memory/samsung/exynos5422-dmc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 7d80322754fad..068c68da09219 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1297,8 +1297,15 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)
if (ret)
return ret;
- clk_prepare_enable(dmc->fout_bpll);
- clk_prepare_enable(dmc->mout_bpll);
+ ret = clk_prepare_enable(dmc->fout_bpll);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(dmc->mout_bpll);
+ if (ret) {
+ clk_disable_unprepare(dmc->fout_bpll);
+ return ret;
+ }
/*
* Some bootloaders do not set clock routes correctly.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0359/1756] gfs2: Fix journaled truncate range end offset
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (357 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0358/1756] memory: exynos5422-dmc: handle clock enable failures Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0360/1756] ACPI: glue: Fix up and adjust acpi_unbind_one() Greg Kroah-Hartman
` (639 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, VEGA, Jan Kara, Andreas Gruenbacher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
[ Upstream commit a52652efd8f985397e87669f505af83f06e335cf ]
The third argument to truncate_pagecache_range() is the inclusive end
offset, but gfs2_journaled_truncate_range() passes the length of each
chunk. A hole punch at an offset larger than its length therefore
creates an inverted range.
Commit 86066914edff ("gfs2: Don't support fallocate on jdata files")
disables fallocate for jdata files. Otherwise, the following bug
could occur:
The MM truncation path then underflows the unsigned partial-folio
length and passes an oversized range to folio_zero_range(), triggering
a BUG. Pass the last byte of the chunk so page-cache invalidation
covers the intended range.
Fixes: 4e56a6411fbc ("gfs2: Implement fallocate(FALLOC_FL_PUNCH_HOLE)")
Reported-by: VEGA <vega@nebusec.ai>
Assisted-by: LLM
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/gfs2/bmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index c87ce7d10bd18..d02df07dcfbdc 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -2407,7 +2407,7 @@ static int gfs2_journaled_truncate_range(struct inode *inode, loff_t offset,
if (offs && chunk > PAGE_SIZE)
chunk = offs + ((chunk - offs) & PAGE_MASK);
- truncate_pagecache_range(inode, offset, chunk);
+ truncate_pagecache_range(inode, offset, offset + chunk - 1);
offset += chunk;
length -= chunk;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0360/1756] ACPI: glue: Fix up and adjust acpi_unbind_one()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (358 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0359/1756] gfs2: Fix journaled truncate range end offset Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0361/1756] thermal: gov_power_allocator: Fix NULL pointer dereference in update_tz() Greg Kroah-Hartman
` (638 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 693546852656075e0247ac637b05625ead134eff ]
Since none of the acpi_unbind_one() callers check its return value and
it always returns 0 anyway, make it void.
Also notice that unlocking physical_node_lock for the given ACPI device
should be carried out before dropping the reference to it in case that
reference is the last one (highly unlikely), so rearrange the code to
make that happen.
Fixes: 3e3327837c18 ("ACPI: Use list_for_each_entry() in acpi_unbind_one()")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/10940500.nUPlyArG6x@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/glue.c | 10 ++++++----
include/acpi/acpi_bus.h | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index a194f30876c59..cc9ee8cb820fc 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -316,13 +316,13 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
}
EXPORT_SYMBOL_GPL(acpi_bind_one);
-int acpi_unbind_one(struct device *dev)
+void acpi_unbind_one(struct device *dev)
{
struct acpi_device *acpi_dev = ACPI_COMPANION(dev);
struct acpi_device_physical_node *entry;
if (!acpi_dev)
- return 0;
+ return;
mutex_lock(&acpi_dev->physical_node_lock);
@@ -337,15 +337,17 @@ int acpi_unbind_one(struct device *dev)
sysfs_remove_link(&acpi_dev->dev.kobj, physnode_name);
sysfs_remove_link(&dev->kobj, "firmware_node");
ACPI_COMPANION_SET(dev, NULL);
+
+ mutex_unlock(&acpi_dev->physical_node_lock);
+
/* Drop references taken by acpi_bind_one(). */
put_device(dev);
acpi_dev_put(acpi_dev);
kfree(entry);
- break;
+ return;
}
mutex_unlock(&acpi_dev->physical_node_lock);
- return 0;
}
EXPORT_SYMBOL_GPL(acpi_unbind_one);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index f46464d1430a2..0f1a84481279e 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -720,7 +720,7 @@ struct acpi_bus_type {
int register_acpi_bus_type(struct acpi_bus_type *);
int unregister_acpi_bus_type(struct acpi_bus_type *);
int acpi_bind_one(struct device *dev, struct acpi_device *adev);
-int acpi_unbind_one(struct device *dev);
+void acpi_unbind_one(struct device *dev);
enum acpi_bridge_type {
ACPI_BRIDGE_TYPE_PCIE = 1,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0361/1756] thermal: gov_power_allocator: Fix NULL pointer dereference in update_tz()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (359 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0360/1756] ACPI: glue: Fix up and adjust acpi_unbind_one() Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0362/1756] firewire: cdev: Fix FW_CDEV_IOC_CREATE_ISO_CONTEXT references in kernel-doc Greg Kroah-Hartman
` (637 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sumeet Pawnikar, Lukasz Luba,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sumeet Pawnikar <sumeet4linux@gmail.com>
[ Upstream commit d3515092f1bff9cfb4d99ea82dcd4ac66f32f50d ]
power_allocator_update_tz() unconditionally derives the trip descriptor of
params->trip_max as below,
const struct thermal_trip_desc *td = trip_to_trip_desc(params->trip_max);
and then walks td->thermal_instances. However, params->trip_max is allowed
to be NULL and in that case the list walk dereferences a bogus pointer
derived from NULL which oops the kernel.
get_governor_trips() picks trip_switch_on and trip_max out of the trip
table of the zone. When the zone has neither a passive nor an active trip
point, last_active is NULL and params->trip_max is left NULL. This is an
explicitly supported configuration, as documented in the function
get_governor_trips() as below,
If there are no passive or active trip points, then the governor won't
do anything. In fact, its throttle function won't be called at all.
Return early from power_allocator_update_tz() when params->trip_max is NULL
and only compute the trip descriptor after that check. There is nothing to
update in that case anyway, with no trip_max and there are no thermal
instances for the governor to account for, num_actors stays zero and
total_weight is irrelevant.
Fixes: 912e97c67cc3 ("thermal: gov_power_allocator: Move memory allocation out of throttle()")
Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20260822114236.15998-1-sumeet4linux@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/thermal/gov_power_allocator.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 90b4bfd9237bc..da7da3ab07558 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -655,10 +655,15 @@ static void power_allocator_update_tz(struct thermal_zone_device *tz,
enum thermal_notify_event reason)
{
struct power_allocator_params *params = tz->governor_data;
- const struct thermal_trip_desc *td = trip_to_trip_desc(params->trip_max);
+ const struct thermal_trip_desc *td;
struct thermal_instance *instance;
int num_actors = 0;
+ if (!params->trip_max)
+ return;
+
+ td = trip_to_trip_desc(params->trip_max);
+
switch (reason) {
case THERMAL_TZ_BIND_CDEV:
case THERMAL_TZ_UNBIND_CDEV:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0362/1756] firewire: cdev: Fix FW_CDEV_IOC_CREATE_ISO_CONTEXT references in kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (360 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0361/1756] thermal: gov_power_allocator: Fix NULL pointer dereference in update_tz() Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0363/1756] firewire: core: remove unused link field in fw_packet structure Greg Kroah-Hartman
` (636 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Takashi Sakamoto,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 0a6cf2b7adcbd362039e9d282f73aff3f24022ca ]
The fw_cdev_event_iso_interrupt and fw_cdev_event_iso_interrupt_mc
comments refer to FW_CDEV_CREATE_ISO_CONTEXT, but the ioctl is named
FW_CDEV_IOC_CREATE_ISO_CONTEXT.
Correct both references. The misspellings were introduced separately
with the userspace interface documentation and multichannel reception
support.
Fixes: 7ada60e36764 ("firewire: Document userspace ioctl interface.")
Fixes: 872e330e3880 ("firewire: add isochronous multichannel reception")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://lore.kernel.org/r/20260911222807.7673-1-kmehltretter@gmail.com
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/uapi/linux/firewire-cdev.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/firewire-cdev.h b/include/uapi/linux/firewire-cdev.h
index 1f2c9469f9214..48dd3619adaa7 100644
--- a/include/uapi/linux/firewire-cdev.h
+++ b/include/uapi/linux/firewire-cdev.h
@@ -293,7 +293,7 @@ struct fw_cdev_event_request3 {
/**
* struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
* @closure: See &fw_cdev_event_common;
- * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
+ * set by %FW_CDEV_IOC_CREATE_ISO_CONTEXT ioctl
* @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
* @cycle: Cycle counter of the last completed packet
* @header_length: Total length of following headers, in bytes
@@ -353,7 +353,7 @@ struct fw_cdev_event_iso_interrupt {
/**
* struct fw_cdev_event_iso_interrupt_mc - An iso buffer chunk was completed
* @closure: See &fw_cdev_event_common;
- * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
+ * set by %FW_CDEV_IOC_CREATE_ISO_CONTEXT ioctl
* @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL
* @completed: Offset into the receive buffer; data before this offset is valid
*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0363/1756] firewire: core: remove unused link field in fw_packet structure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (361 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0362/1756] firewire: cdev: Fix FW_CDEV_IOC_CREATE_ISO_CONTEXT references in kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0364/1756] cpuidle: menu: Remove incorrect unlikely() annotation Greg Kroah-Hartman
` (635 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Sakamoto, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
[ Upstream commit 00d4d31e4fdfe51312f0184f8d162b8d4de172dc ]
The link field in fw_packet structure has never been used since it was
added.
Fixes: 3038e353cfaf ("firewire: Add core firewire stack.")
Link: https://lore.kernel.org/r/20260911141602.3288806-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/firewire.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index b632eec3ab526..9e7ff7c3b7398 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -312,7 +312,6 @@ struct fw_packet {
*/
fw_packet_callback_t callback;
int ack;
- struct list_head link;
void *driver_data;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0364/1756] cpuidle: menu: Remove incorrect unlikely() annotation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (362 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0363/1756] firewire: core: remove unused link field in fw_packet structure Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0365/1756] cpuidle: menu: Remove single state handling Greg Kroah-Hartman
` (634 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
[ Upstream commit fcbd7897b871e157ee5c595e950c8466d86c0cd5 ]
The unlikely() annotation on the early-return condition in menu_select()
is incorrect on systems with only one idle state (e.g., ARM64 servers
with a single ACPI LPI state). Branch profiling shows 100% misprediction
on such systems since drv->state_count <= 1 is always true.
On platforms where only state0 is available, this path is the common
case, not an unlikely edge case. Remove the misleading annotation to
let the branch predictor learn the actual behavior.
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260105-annotated_idle-v1-1-10ddf0771b58@debian.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: d594187cafd5 ("cpuidle: menu: Do not return a disabled idle state")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 0ce7323450011..88b87ad5557a7 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -287,7 +287,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
data->bucket = which_bucket(KTIME_MAX);
}
- if (unlikely(drv->state_count <= 1 || latency_req == 0) ||
+ if (drv->state_count <= 1 || latency_req == 0 ||
((data->next_timer_ns < drv->states[1].target_residency_ns ||
latency_req < drv->states[1].exit_latency_ns) &&
!dev->states_usage[0].disable)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0365/1756] cpuidle: menu: Remove single state handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (363 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0364/1756] cpuidle: menu: Remove incorrect unlikely() annotation Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0366/1756] cpuidle: menu: Do not return a disabled idle state Greg Kroah-Hartman
` (633 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Loehle, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <christian.loehle@arm.com>
[ Upstream commit 93983a9f3beea791c21d77c2425488ad327d4fda ]
cpuidle systems where the governor has no choice because there's only
a single idle state are now handled by cpuidle core and bypass the
governor, so remove the related handling.
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
[ rjw: Rebase on top of the cpuidle changes merged recently ]
Link: https://patch.msgid.link/20260216185005.1131593-5-aboorvad@linux.ibm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: d594187cafd5 ("cpuidle: menu: Do not return a disabled idle state")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 88b87ad5557a7..3c135e40bf20d 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -287,7 +287,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
data->bucket = which_bucket(KTIME_MAX);
}
- if (drv->state_count <= 1 || latency_req == 0 ||
+ if (latency_req == 0 ||
((data->next_timer_ns < drv->states[1].target_residency_ns ||
latency_req < drv->states[1].exit_latency_ns) &&
!dev->states_usage[0].disable)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0366/1756] cpuidle: menu: Do not return a disabled idle state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (364 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0365/1756] cpuidle: menu: Remove single state handling Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0367/1756] ARM: dts: stm32: lxa-mc1: change stdout-path baud rate from 9600 to 115200 Greg Kroah-Hartman
` (632 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit d594187cafd5ad65afc5f00242f8fa20e1d8c0f1 ]
When idle state 0 is disabled and the PM QoS latency constraint is
zero (latency_req == 0), the first branch of the || in the early-return
condition of menu_select() is taken immediately, so state 0 is returned
regardless of its disable flag.
Address this by making the !disable check a prerequisite for the entire
early-return condition, so that when state 0 is disabled the normal
state selection loop is used instead, which already skips disabled
states.
Fixes: 53812cdc9100 ("cpuidle: menu: Move the latency_req == 0 special case check")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Link: https://patch.msgid.link/20260827094820.3900062-1-luoxueqin@kylinos.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 3c135e40bf20d..713d7118dd135 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -287,10 +287,10 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
data->bucket = which_bucket(KTIME_MAX);
}
- if (latency_req == 0 ||
- ((data->next_timer_ns < drv->states[1].target_residency_ns ||
- latency_req < drv->states[1].exit_latency_ns) &&
- !dev->states_usage[0].disable)) {
+ if (!dev->states_usage[0].disable &&
+ (latency_req == 0 ||
+ data->next_timer_ns < drv->states[1].target_residency_ns ||
+ latency_req < drv->states[1].exit_latency_ns)) {
/*
* In this case state[0] will be used no matter what, so return
* it right away and keep the tick running if state[0] is a
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0367/1756] ARM: dts: stm32: lxa-mc1: change stdout-path baud rate from 9600 to 115200
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (365 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0366/1756] cpuidle: menu: Do not return a disabled idle state Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0368/1756] ARM: dts: stm32: lxa-tac: " Greg Kroah-Hartman
` (631 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahmad Fatoum, Alexandre Torgue,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
[ Upstream commit fc3c0ffefc169719316eddb8c36e2427e11ce713 ]
The default baud rate when none is specified is up to the DT consumer.
In the case of the Linux STM32 serial driver, it defaults to 9600 baud,
which differs from the 115200 baud that this board's barebox bootloader
configured.
This went unnoticed, because barebox automatically fixes up a console=
command-line option that looks like this on the LXA boards:
console=ttySTM0,115200n8
This had precedence over the 9600 fallback baud rate.
But when EFI booting a kernel via GRUB, we run into this issue, because
the barebox-provided command-line is disregarded by GRUB.
Fix this by explicitly setting the baud rate to the correct 115200.
Fixes: 666b5ca85cd3 ("ARM: dts: stm32: add STM32MP1-based Linux Automation MC-1 board")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.kernel.org/r/20260611-lxa-stdout-path-baudrate-v1-1-59b60a5069ff@pengutronix.de
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts b/arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts
index eada9cf257be9..b3d8eb57aa24e 100644
--- a/arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts
+++ b/arch/arm/boot/dts/st/stm32mp157c-lxa-mc1.dts
@@ -33,7 +33,7 @@ backlight: backlight {
};
chosen {
- stdout-path = &uart4;
+ stdout-path = "serial0:115200n8";
};
led-controller-0 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0368/1756] ARM: dts: stm32: lxa-tac: change stdout-path baud rate from 9600 to 115200
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (366 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0367/1756] ARM: dts: stm32: lxa-mc1: change stdout-path baud rate from 9600 to 115200 Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0369/1756] ARM: dts: stm32: add LTDC / DCMIPP access controller for STM32MP135 Greg Kroah-Hartman
` (630 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahmad Fatoum, Alexandre Torgue,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
[ Upstream commit 85bb59fc12ef439b248d5f4faf846d5566b701fe ]
The default baud rate when none is specified is up to the DT consumer.
In the case of the Linux STM32 serial driver, it defaults to 9600 baud,
which differs from the 115200 baud that this board's barebox bootloader
configured.
This went unnoticed, because barebox automatically fixes up a console=
command-line option that looks like this on the LXA boards:
console=ttySTM0,115200n8
This had precedence over the 9600 fallback baud rate.
But when EFI booting a kernel via GRUB, we run into this issue, because
the barebox-provided command-line is disregarded by GRUB.
Fix this by explicitly setting the baud rate to the correct 115200.
Fixes: 518272af37b2 ("ARM: dts: stm32: lxa-tac: add Linux Automation GmbH TAC")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.kernel.org/r/20260611-lxa-stdout-path-baudrate-v1-2-59b60a5069ff@pengutronix.de
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi b/arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi
index c87fd96cbd918..05623806277d9 100644
--- a/arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi
+++ b/arch/arm/boot/dts/st/stm32mp15xc-lxa-tac.dtsi
@@ -25,7 +25,7 @@ aliases {
};
chosen {
- stdout-path = &uart4;
+ stdout-path = "serial0:115200n8";
};
led-controller-0 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0369/1756] ARM: dts: stm32: add LTDC / DCMIPP access controller for STM32MP135
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (367 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0368/1756] ARM: dts: stm32: lxa-tac: " Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0370/1756] cpuidle: teo: Do not return a disabled idle state Greg Kroah-Hartman
` (629 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alain Volmat, Alexandre Torgue,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alain Volmat <alain.volmat@foss.st.com>
[ Upstream commit 0c354b85cc95b5d563a581c8dbca57b4942bfae7 ]
Add ETZPC as an access controller for the LTDC and DCMIPP found
on the stm32mp135.
Fixes: a06b9560eb6c ("ARM: dts: stm32: add ETZPC as a system bus for STM32MP13x boards")
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Link: https://lore.kernel.org/r/20260721-etzpc-mp13-ltdc-dcmipp-fix-v1-1-a969f2ab8da1@foss.st.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/st/stm32mp135.dtsi | 42 ++++++++++++++--------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/arch/arm/boot/dts/st/stm32mp135.dtsi b/arch/arm/boot/dts/st/stm32mp135.dtsi
index 834a4d545fe44..f573335edf6b4 100644
--- a/arch/arm/boot/dts/st/stm32mp135.dtsi
+++ b/arch/arm/boot/dts/st/stm32mp135.dtsi
@@ -6,29 +6,29 @@
#include "stm32mp133.dtsi"
-/ {
- soc {
- dcmipp: dcmipp@5a000000 {
- compatible = "st,stm32mp13-dcmipp";
- reg = <0x5a000000 0x400>;
- interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
- resets = <&rcc DCMIPP_R>;
- clocks = <&rcc DCMIPP_K>;
- status = "disabled";
+&etzpc {
+ dcmipp: dcmipp@5a000000 {
+ compatible = "st,stm32mp13-dcmipp";
+ reg = <0x5a000000 0x400>;
+ interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc DCMIPP_R>;
+ clocks = <&rcc DCMIPP_K>;
+ access-controllers = <&etzpc 4>;
+ status = "disabled";
- port {
- };
+ port {
};
+ };
- ltdc: display-controller@5a001000 {
- compatible = "st,stm32-ltdc";
- reg = <0x5a001000 0x400>;
- interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&rcc LTDC_PX>;
- clock-names = "lcd";
- resets = <&scmi_reset RST_SCMI_LTDC>;
- status = "disabled";
- };
+ ltdc: display-controller@5a001000 {
+ compatible = "st,stm32-ltdc";
+ reg = <0x5a001000 0x400>;
+ interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc LTDC_PX>;
+ clock-names = "lcd";
+ resets = <&scmi_reset RST_SCMI_LTDC>;
+ access-controllers = <&etzpc 3>;
+ status = "disabled";
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0370/1756] cpuidle: teo: Do not return a disabled idle state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (368 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0369/1756] ARM: dts: stm32: add LTDC / DCMIPP access controller for STM32MP135 Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0371/1756] PM: runtime: Only queue an idle check for RPM-linked suppliers Greg Kroah-Hartman
` (628 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Christian Loehle,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit 60d5fca628f94f8f23398ad62d80aa284dae6571 ]
If idle state 0 is disabled and none of the enabled idle states satisfies
the PM QoS latency constraint, constraint_idx in teo_select() stays at its
initial value of 0, because the loop that updates it starts at state 1,
and so the candidate state index is capped at state 0, which is disabled,
and that state is returned to the caller.
The cpuidle core does not validate the returned state index against the
per-state disable flags, so the CPU ends up entering the disabled state 0.
To address this, ensure that constraint_idx is at least equal to the index
of the first enabled idle state (idx0), so that the candidate state is
never capped to a disabled one.
Fixes: c410a9a142f1 ("cpuidle: teo: Change the main idle state selection logic")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/20260828032457.2317326-1-luoxueqin@kylinos.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpuidle/governors/teo.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
index 520aa466c2e75..b22c1f8197795 100644
--- a/drivers/cpuidle/governors/teo.c
+++ b/drivers/cpuidle/governors/teo.c
@@ -432,6 +432,17 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
goto out_tick;
}
+ /*
+ * If the latency constraint does not allow any of the enabled idle
+ * states to be used, the candidate state index will be capped to 0
+ * by the check below, but state 0 may be disabled. To prevent the
+ * selection of a disabled state in that case, ensure that
+ * constraint_idx is at least equal to the index of the first
+ * enabled idle state.
+ */
+ if (constraint_idx < idx0)
+ constraint_idx = idx0;
+
/*
* If there is a latency constraint, it may be necessary to select an
* idle state shallower than the current candidate one.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0371/1756] PM: runtime: Only queue an idle check for RPM-linked suppliers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (369 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0370/1756] cpuidle: teo: Do not return a disabled idle state Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0372/1756] ARM: dts: stm32: Drop bias-disable from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a Greg Kroah-Hartman
` (627 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brian Norris, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brian Norris <briannorris@chromium.org>
[ Upstream commit be5755f023e7e02ec90bbd1d4ca63a0abe594733 ]
When a device RPM-suspends, it queues up an idle check for all of its
suppliers, in case that device was the last consumer, and those
suppliers are now able to suspend. Today, we do this for all suppliers,
and not only for those suppliers that are marked for use by runtime PM.
This isn't directly harmful, but it is a bit wasteful, and also may
induce unexpected suspend attempts (e.g., if a device was purposely last
touched with pm_runtime_put_noidle()).
To avoid excess idle checks, only call pm_request_idle() on linked
suppliers that opted into runtime PM.
Noticed by inspection of trace logs.
This is not expected to have a functional impact on systems that are
using device links properly, and should only be considered an
optimization.
Fixes: 5244f5e2d801 ("PM: runtime: Defer suspending suppliers")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260901013341.1417232-1-briannorris@chromium.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/power/runtime.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index b0b72fa2a1202..4261f0b90f245 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -349,7 +349,8 @@ static void rpm_suspend_suppliers(struct device *dev)
list_for_each_entry_rcu(link, &dev->links.suppliers, c_node,
device_links_read_lock_held())
- pm_request_idle(link->supplier);
+ if (device_link_test(link, DL_FLAG_PM_RUNTIME))
+ pm_request_idle(link->supplier);
device_links_read_unlock(idx);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0372/1756] ARM: dts: stm32: Drop bias-disable from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (370 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0371/1756] PM: runtime: Only queue an idle check for RPM-linked suppliers Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0373/1756] HID: i2c-hid: Unfollow the panel on shutdown Greg Kroah-Hartman
` (626 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Vasut, Alexandre Torgue,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <marex@nabladev.com>
[ Upstream commit 3572825773791f4258b553391f4e2187df321731 ]
Drop bias-disable property from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a
to fix the following DT checker warning. The bias-pull-up property is
the only bias-related property that has to be present in those pinctrl
node subnodes.
"
arch/arm/boot/dts/st/stm32mp153c-dhcom-drc02.dtb: pinctrl@50002000 (st,stm32mp157-pinctrl): sdmmc1-b4-0:pins1: {'pinmux': [10253, 10509, 10765, 11021, 12813], 'slew-rate': 1, 'drive-push-pull': True, 'bias-disable': True, 'bias-pull-up': True} is valid under each of {'required': ['bias-pull-up']}, {'required': ['bias-disable']}
"
Fixes: 7cd8567d988a ("ARM: dts: stm32: Enable internal pull-ups for SDMMC1 on DHCOM SoM")
Signed-off-by: Marek Vasut <marex@nabladev.com>
Link: https://lore.kernel.org/r/20260828150111.173089-1-marex@nabladev.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi
index 142d4a8731f8d..65f81c0c233d2 100644
--- a/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi
@@ -507,9 +507,11 @@ &sdmmc1_b4_pins_a {
* - mandatory on SoMs without SD voltage translator
*/
pins1 {
+ /delete-property/ bias-disable;
bias-pull-up;
};
pins2 {
+ /delete-property/ bias-disable;
bias-pull-up;
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0373/1756] HID: i2c-hid: Unfollow the panel on shutdown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (371 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0372/1756] ARM: dts: stm32: Drop bias-disable from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0374/1756] bpf: Fix program BTF use-after-free in sleepable programs Greg Kroah-Hartman
` (625 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Douglas Anderson, Justin Yeh,
Jiri Kosina, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Yeh <justin.yeh@mediatek.com>
[ Upstream commit 59fc35a1edbfa5405122d749cf8843da131fd796 ]
i2c_hid_core_shutdown() sends SET_POWER(SLEEP) even for panel followers,
but nothing in device_shutdown() guarantees whether the panel, and hence
our own power, is still on by the time we get there.
Do what i2c_hid_core_remove() does and just unfollow the panel.
drm_panel_remove_follower() calls panel_unpreparing() only while the
panel is still prepared, which powers us down properly; if it is already
unprepared no transfer is attempted at all. On MT8196 the panel is
unprepared long before us, so this also drops the ~2s i2c bus timeout
from every reboot.
Fixes: 96a37bfd232a ("HID: i2c-hid: Support being a panel follower")
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/i2c-hid/i2c-hid-core.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 42212ef2aa0f8..3819612817010 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -1333,7 +1333,16 @@ void i2c_hid_core_shutdown(struct i2c_client *client)
{
struct i2c_hid *ihid = i2c_get_clientdata(client);
- i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP);
+ /*
+ * Like in i2c_hid_core_remove(): if we're a follower, the act of
+ * unfollowing will cause us to be powered down. Otherwise we need to
+ * manually do it.
+ */
+ if (ihid->is_panel_follower)
+ drm_panel_remove_follower(&ihid->panel_follower);
+ else
+ i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP);
+
free_irq(client->irq, ihid);
i2c_hid_core_shutdown_tail(ihid);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0374/1756] bpf: Fix program BTF use-after-free in sleepable programs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (372 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0373/1756] HID: i2c-hid: Unfollow the panel on shutdown Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0375/1756] ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints Greg Kroah-Hartman
` (624 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sanghyun Park, Andrii Nakryiko,
Sun Jian, Emil Tsalapatis, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sanghyun Park <sanghyun.park.cnu@gmail.com>
[ Upstream commit 88c9c6d0a766dd146545990053e8a04422ccb367 ]
Object kfunc calls embed metadata owned by the program BTF. A sleepable
program can remain active under Tasks Trace RCU after its last reference is
dropped, while program teardown releases the BTF through ordinary RCU. The
invocation can then dereference freed metadata in bpf_obj_new().
Move btf_put() into __bpf_prog_put_rcu(), the callback that frees the
program. When teardown is deferred, that callback runs after the program's
own grace period (Tasks Trace RCU for sleepable programs and ordinary RCU
otherwise), so the BTF outlives every active invocation. The non-deferred
path invokes the callback synchronously, so load-error cleanup stays direct.
Fixes: 958cf2e273f0 ("bpf: Introduce bpf_obj_new")
Signed-off-by: Sanghyun Park <sanghyun.park.cnu@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Sun Jian <sun.jian.kdev@gmail.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/bpf/20260901014829.3504342-2-sanghyun.park.cnu@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 854cc29b47c8f..9ebb51a32ff36 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2194,6 +2194,7 @@ static void __bpf_prog_put_rcu(struct rcu_head *rcu)
{
struct bpf_prog_aux *aux = container_of(rcu, struct bpf_prog_aux, rcu);
+ btf_put(aux->btf);
kvfree(aux->func_info);
kfree(aux->func_info_aux);
free_uid(aux->user);
@@ -2204,7 +2205,6 @@ static void __bpf_prog_put_rcu(struct rcu_head *rcu)
static void __bpf_prog_put_noref(struct bpf_prog *prog, bool deferred)
{
bpf_prog_kallsyms_del_all(prog);
- btf_put(prog->aux->btf);
module_put(prog->aux->mod);
kvfree(prog->aux->jited_linfo);
kvfree(prog->aux->linfo);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0375/1756] ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (373 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0374/1756] bpf: Fix program BTF use-after-free in sleepable programs Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0376/1756] x86/svm: Avoid sign extension of SVM_EVTINJ_VALID in 64-bit expressions Greg Kroah-Hartman
` (623 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Nora Schiffer, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nora Schiffer <nora.schiffer@ew.tq-group.com>
[ Upstream commit f322f8f68c2c3291633ead663effa3b25c18f7b1 ]
regulator-(min|max)-microvolt refer to the supported voltages according
to board design, not the possible range of the regulators themselves.
Update the configuration for the TQMa7x's PMIC and also add a comment
regarding the PMIC's VCC_SD switching feature.
Fixes: a80a1af6ec8a ("ARM: dts: tq imx7 common board support")
Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi | 40 +++++++++++++----------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi b/arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi
index 91ca23a66bf3c..b66decb19117d 100644
--- a/arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi
@@ -46,8 +46,8 @@ pfuze3000: pmic@8 {
regulators {
sw1a_reg: sw1a {
- regulator-min-microvolt = <700000>;
- regulator-max-microvolt = <3300000>;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1225000>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <6250>;
@@ -55,34 +55,33 @@ sw1a_reg: sw1a {
/* use sw1c_reg to align with pfuze100/pfuze200 */
sw1c_reg: sw1b {
- regulator-min-microvolt = <700000>;
- regulator-max-microvolt = <1475000>;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1000000>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <6250>;
};
sw2_reg: sw2 {
- regulator-min-microvolt = <1500000>;
- regulator-max-microvolt = <1850000>;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
regulator-boot-on;
regulator-always-on;
};
sw3a_reg: sw3 {
- regulator-min-microvolt = <900000>;
- regulator-max-microvolt = <1650000>;
+ regulator-min-microvolt = <1350000>;
+ regulator-max-microvolt = <1350000>;
regulator-boot-on;
regulator-always-on;
};
swbst_reg: swbst {
- regulator-min-microvolt = <5000000>;
- regulator-max-microvolt = <5150000>;
+ /* Not connected and left unconfigured */
};
snvs_reg: vsnvs {
- regulator-min-microvolt = <1000000>;
+ regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-boot-on;
regulator-always-on;
@@ -95,18 +94,25 @@ vref_reg: vrefddr {
vgen1_reg: vldo1 {
regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <3300000>;
+ regulator-max-microvolt = <1800000>;
regulator-always-on;
};
vgen2_reg: vldo2 {
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <1550000>;
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
regulator-always-on;
};
vgen3_reg: vccsd {
- regulator-min-microvolt = <2850000>;
+ /*
+ * Specified values refer to 3.3V operation; voltage for 1.8V
+ * operation is derived from this.
+ *
+ * The base board should usually mux GPIO1_IO08 to SD1_VSELECT for
+ * automatic switching of SD card IO voltage.
+ */
+ regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
@@ -118,13 +124,13 @@ vgen4_reg: v33 {
};
vgen5_reg: vldo3 {
- regulator-min-microvolt = <1800000>;
+ regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
vgen6_reg: vldo4 {
- regulator-min-microvolt = <1800000>;
+ regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0376/1756] x86/svm: Avoid sign extension of SVM_EVTINJ_VALID in 64-bit expressions
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (374 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0375/1756] ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0377/1756] clk: mediatek: reset: Fix device registration kernel-doc Greg Kroah-Hartman
` (622 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chaithanya Lagisetty,
Sean Christopherson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
[ Upstream commit c5991239b148d40d4981901968b3a6a838ff517b ]
SVM_EVTINJ_VALID is defined as (1 << 31), i.e. as an int with the sign
bit set. Whenever it is used in a 64-bit expression the int is sign
extended, so bits 63:32 end up set as well. Two 64-bit users are
affected.
verify_exception_info() uses the macro as a mask against a 64-bit value
when it sanity checks hypervisor supplied exception information:
u64 info = ghcb->save.sw_exit_info_2;
...
if ((info & SVM_EVTINJ_VALID) &&
The mask is 0xffffffff80000000, so the check also passes when any bit of
the error code in 63:32 is set while the valid bit itself is clear.
svm_vmgexit_inject_exception() builds the value that KVM hands to an
SEV-ES guest in GHCB SW_EXITINFO2:
u64 data = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_EXEPT | vector;
For vector == X86_TRAP_GP this yields 0xffffffff8000030d instead of
0x000000008000030d. The field uses the EVENTINJ format, which holds the
error code in bits 63:32, so KVM asks the guest to inject #GP with an
error code of 0xffffffff. Linux guests only consume the error code when
SVM_EVTINJ_VALID_ERR is set, which it is not here, so they are not
affected in practice, but the value KVM writes is not the one it intends.
Use BIT() instead, as is already done for most single bit definitions in
this header. Every other user applies the macro to a u32, where the
resulting bits are unchanged.
Opportunistically give SVM_EVTINJ_VALID_ERR the same treatment, there's
zero reason to open code BIT().
Fixes: 597cfe48212a ("x86/boot/compressed/64: Setup a GHCB-based VC Exception handler")
Fixes: c3392d0ab714 ("KVM: SVM: Provide helpers to set the error code")
Signed-off-by: Chaithanya Lagisetty <nagachaithanya9911@gmail.com>
Link: https://patch.msgid.link/20260908053722.3917934-1-nagachaithanya9911@gmail.com
[sean: use BIT() for SVM_EVTINJ_VALID_ERR as well]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/svm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 2b59b9951c90e..aeec3f0f25589 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -616,8 +616,8 @@ static inline void __unused_size_checks(void)
#define SVM_EVTINJ_TYPE_EXEPT (3 << SVM_EVTINJ_TYPE_SHIFT)
#define SVM_EVTINJ_TYPE_SOFT (4 << SVM_EVTINJ_TYPE_SHIFT)
-#define SVM_EVTINJ_VALID (1 << 31)
-#define SVM_EVTINJ_VALID_ERR (1 << 11)
+#define SVM_EVTINJ_VALID BIT(31)
+#define SVM_EVTINJ_VALID_ERR BIT(11)
#define SVM_EXITINTINFO_VEC_MASK SVM_EVTINJ_VEC_MASK
#define SVM_EXITINTINFO_TYPE_MASK SVM_EVTINJ_TYPE_MASK
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0377/1756] clk: mediatek: reset: Fix device registration kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (375 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0376/1756] x86/svm: Avoid sign extension of SVM_EVTINJ_VALID in 64-bit expressions Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0378/1756] clk: rs9: Add clock index range check to rs9_of_clk_get() Greg Kroah-Hartman
` (621 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Chen-Yu Tsai,
AngeloGioacchino Del Regno, Brian Masney, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 8d5fa37307ac1f0612cf17ac0ccabcc258cc1526 ]
The comment for mtk_register_reset_controller_with_dev() names the
older helper and documents np rather than dev. The new helper takes
a struct device and obtains its device node internally.
Use the actual function and parameter names and clarify that failures
return negative error codes.
Fixes: 761bc64003e3 ("clk: mediatek: reset: Add new register reset function with device")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/mediatek/reset.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/mediatek/reset.h b/drivers/clk/mediatek/reset.h
index 562ffd290a224..b09cdcab0c4ba 100644
--- a/drivers/clk/mediatek/reset.h
+++ b/drivers/clk/mediatek/reset.h
@@ -60,11 +60,11 @@ struct mtk_clk_rst_data {
};
/**
- * mtk_register_reset_controller - Register mediatek clock reset controller with device
- * @np: Pointer to device.
+ * mtk_register_reset_controller_with_dev - Register a MediaTek reset controller
+ * @dev: Device used to manage the reset controller resources.
* @desc: Constant pointer to description of clock reset.
*
- * Return: 0 on success and errorno otherwise.
+ * Return: 0 on success, negative errno otherwise.
*/
int mtk_register_reset_controller_with_dev(struct device *dev,
const struct mtk_clk_rst_desc *desc);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0378/1756] clk: rs9: Add clock index range check to rs9_of_clk_get()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (376 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0377/1756] clk: mediatek: reset: Fix device registration kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0379/1756] clk: s2mps11: Propagate OF provider registration failures Greg Kroah-Hartman
` (620 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Marek Vasut,
Brian Masney, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert+renesas@glider.be>
[ Upstream commit a2ef401bdfd19aa41d0e3e1b630a12fbc01ac184 ]
rs9_of_clk_get() does not validate the clock index in the passed
DT clock specifier. If DT specifies an incorrect and out-of-range
index, this will access memory beyond the end of the clk_dif[] array.
Fix by this adding a range check to rs9_of_clk_get().
Fixes: 892e0ddea1aa6f70 ("clk: rs9: Add Renesas 9-series PCIe clock generator driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-renesas-pcie.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/clk-renesas-pcie.c b/drivers/clk/clk-renesas-pcie.c
index f94a9c4d0b670..6650e3440c749 100644
--- a/drivers/clk/clk-renesas-pcie.c
+++ b/drivers/clk/clk-renesas-pcie.c
@@ -277,6 +277,11 @@ rs9_of_clk_get(struct of_phandle_args *clkspec, void *data)
struct rs9_driver_data *rs9 = data;
unsigned int idx = clkspec->args[0];
+ if (idx >= rs9->chip_info->num_clks) {
+ pr_err("%s: Invalid clock index %u\n", __func__, idx);
+ return ERR_PTR(-EINVAL);
+ }
+
return rs9->clk_dif[idx];
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0379/1756] clk: s2mps11: Propagate OF provider registration failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (377 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0378/1756] clk: rs9: Add clock index range check to rs9_of_clk_get() Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0380/1756] spi: Fix the return value in spi_new_ancillary_device() kernel-doc Greg Kroah-Hartman
` (619 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Brian Masney,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 276741aac3b56ba50bef59715ba18ba3f0b953a2 ]
s2mps11_clk_probe() ignores of_clk_add_hw_provider() failures, stores
driver data and returns success even though DT consumers cannot acquire the
registered clocks.
Return the provider error through the existing lookup cleanup path. Skip
empty lookup slots while unwinding because S2MPS14 omits its CP clock.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: b228fad50c00 ("clk: s2mps11: Migrate to clk_hw based OF and registration APIs")
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-s2mps11.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 8ddf3a9a53dfd..ce52c3aeb6920 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -188,8 +188,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
clk_data->hws[i] = &s2mps11_clks[i].hw;
}
- of_clk_add_hw_provider(s2mps11_clks->clk_np, of_clk_hw_onecell_get,
- clk_data);
+ ret = of_clk_add_hw_provider(s2mps11_clks->clk_np,
+ of_clk_hw_onecell_get, clk_data);
+ if (ret)
+ goto err_reg;
platform_set_drvdata(pdev, s2mps11_clks);
@@ -197,8 +199,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
err_reg:
of_node_put(s2mps11_clks[0].clk_np);
- while (--i >= 0)
- clkdev_drop(s2mps11_clks[i].lookup);
+ while (--i >= 0) {
+ if (s2mps11_clks[i].lookup)
+ clkdev_drop(s2mps11_clks[i].lookup);
+ }
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0380/1756] spi: Fix the return value in spi_new_ancillary_device() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (378 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0379/1756] clk: s2mps11: Propagate OF provider registration failures Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0381/1756] ata: libata-scsi: Fix ata_scsi_hotplug() reference in kernel-doc Greg Kroah-Hartman
` (618 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 3742867ce96539100ed5f4c754f04273d8aa00d7 ]
spi_new_ancillary_device() returns the new struct spi_device, or an
ERR_PTR() on failure, but its kernel-doc says "0 on success; negative
errno on failure", which was never true. Describe the pointer.
Fixes: 0c79378c0199 ("spi: add ancillary device support")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260911230211.11755-1-kmehltretter@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 780a8c4bef392..c5cd38e295f56 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2577,7 +2577,7 @@ static void of_register_spi_devices(struct spi_controller *ctlr) { }
*
* This may only be called from main SPI device's probe routine.
*
- * Return: 0 on success; negative errno on failure
+ * Return: the new device on success; an ERR_PTR() on failure
*/
struct spi_device *spi_new_ancillary_device(struct spi_device *spi,
u8 chip_select)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0381/1756] ata: libata-scsi: Fix ata_scsi_hotplug() reference in kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (379 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0380/1756] spi: Fix the return value in spi_new_ancillary_device() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0382/1756] gfs2: Fix the return value in gfs2_get_link() kernel-doc Greg Kroah-Hartman
` (617 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Damien Le Moal,
Niklas Cassel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 5915ab523e33057224a0240e27b88c6c2798b919 ]
The ata_scsi_remove_dev() comment misspells its caller as
ata_eh_scsi_hotplug(). The caller is ata_scsi_hotplug(). Correct the
reference, which predates libata's move from drivers/scsi to
drivers/ata.
Fixes: 580b2102327a ("[PATCH] libata-hp: implement SCSI part of hotplug")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20260912101215.86413-1-kmehltretter@gmail.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-scsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 0e309707f8828..9419df80f39b4 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4932,7 +4932,7 @@ int ata_scsi_offline_dev(struct ata_device *dev)
* ata_scsi_remove_dev - remove attached SCSI device
* @dev: ATA device to remove attached SCSI device for
*
- * This function is called from ata_eh_scsi_hotplug() and
+ * This function is called from ata_scsi_hotplug() and
* responsible for removing the SCSI device attached to @dev.
*
* LOCKING:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0382/1756] gfs2: Fix the return value in gfs2_get_link() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (380 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0381/1756] ata: libata-scsi: Fix ata_scsi_hotplug() reference in kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0383/1756] virtio: synchronize callbacks after device reset Greg Kroah-Hartman
` (616 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter,
Andreas Gruenbacher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 700a0a6892f7c0c541d5d23837cfab98cc744d17 ]
gfs2_get_link() returns the link target or an error pointer, but its
kernel-doc still describes an integer status. The mismatch dates back to
when gfs2_readlink() was replaced by generic_readlink() and persisted
across the removal of nd_set_link().
Describe the returned pointer and error value.
Fixes: c177c2ac8c5a ("Switch gfs2 to nd_set_link()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/gfs2/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e6fe1a95d9304..c27587db85b6d 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1907,7 +1907,7 @@ static int gfs2_rename2(struct mnt_idmap *idmap, struct inode *odir,
*
* This can handle symlinks of any size.
*
- * Returns: 0 on success or error code
+ * Returns: the link target on success, an ERR_PTR() on failure
*/
static const char *gfs2_get_link(struct dentry *dentry,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0383/1756] virtio: synchronize callbacks after device reset
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (381 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0382/1756] gfs2: Fix the return value in gfs2_get_link() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0384/1756] virtio_pci_modern: move avq cleanup from reset to del_vqs Greg Kroah-Hartman
` (615 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Michael S. Tsirkin,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael S. Tsirkin <mst@redhat.com>
[ Upstream commit dd75508e6fe77116589c49658d0d18897688dc0b ]
virtio_reset_device says:
Note: this guarantees that vq callbacks are not in progress
but in practice, only virtio pci correctly synchronizes the cbs.
On other transports, a callback that is already executing, keeps running
while the driver tears down the state it uses.
Add virtio_synchronize_cbs to virtio_reset_device fixing this for all
transports that correctly implement synchronize_cbs().
Reported-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://lore.kernel.org/all/20260818040433.66986-1-kmehltretter@gmail.com/
Fixes: c46eccdaadab ("virtio: document virtio_reset_device")
Tested-by: Karl Mehltretter <kmehltretter@gmail.com>
Acked-by: Karl Mehltretter <kmehltretter@gmail.com>
Assisted-by: LLM
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <8ae2995ee649adcfe1398f7f1c4fc9f7028c3db1.1789204858.git.mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/virtio/virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 148ce610ccb83..078e5483b22f4 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -264,6 +264,8 @@ void virtio_reset_device(struct virtio_device *dev)
#endif
dev->config->reset(dev);
+ /* Flush pending VQ/configuration callbacks. */
+ virtio_synchronize_cbs(dev);
}
EXPORT_SYMBOL_GPL(virtio_reset_device);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0384/1756] virtio_pci_modern: move avq cleanup from reset to del_vqs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (382 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0383/1756] virtio: synchronize callbacks after device reset Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0385/1756] ALSA: control: Fix virtual master creation reference in kernel-doc Greg Kroah-Hartman
` (614 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Jiri Pirko,
Michael S. Tsirkin, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael S. Tsirkin <mst@redhat.com>
[ Upstream commit 2a12d96dd863cb23eadf07d8845e961580b5fcdf ]
vp_modern_avq_cleanup() detaches unused buffers from the admin
virtqueue. Calling it from vp_reset() is incorrect:
virtqueue_get_buf in the avq interrupt handler can race with
virtqueue_detach_unused_buf in cleanup, and get_buf after
detach is not documented as valid.
The root cause is that detaching buffers does not belong in
reset at all - reset quiesces the device, while cleanup belongs
where the virtqueue is about to be destroyed, from del_vqs.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/virtualization/20260911125745.E0A2F1F00899@smtp.kernel.org/
Fixes: 4c3b54af907e ("virtio_pci_modern: use completion instead of busy loop to wait on admin cmd result")
Cc: Jiri Pirko <jiri@resnulli.us>
Assisted-by: LLM
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <21fe35ad7b66e2c30dbdba6fe4df4824d1c0db66.1789204858.git.mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/virtio/virtio_pci_modern.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index 4fbcbc7a9ae1c..9f12af3332640 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -245,6 +245,12 @@ static void vp_modern_avq_cleanup(struct virtio_device *vdev)
}
}
+static void vp_modern_del_vqs(struct virtio_device *vdev)
+{
+ vp_modern_avq_cleanup(vdev);
+ vp_del_vqs(vdev);
+}
+
static void vp_transport_features(struct virtio_device *vdev, u64 features)
{
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
@@ -439,8 +445,6 @@ static void vp_reset(struct virtio_device *vdev)
while (vp_modern_get_status(mdev))
msleep(1);
- vp_modern_avq_cleanup(vdev);
-
/* Flush pending VQ/configuration callbacks. */
vp_synchronize_vectors(vdev);
}
@@ -766,7 +770,7 @@ static const struct virtio_config_ops virtio_pci_config_nodev_ops = {
.set_status = vp_set_status,
.reset = vp_reset,
.find_vqs = vp_modern_find_vqs,
- .del_vqs = vp_del_vqs,
+ .del_vqs = vp_modern_del_vqs,
.synchronize_cbs = vp_synchronize_vectors,
.get_features = vp_get_features,
.finalize_features = vp_finalize_features,
@@ -786,7 +790,7 @@ static const struct virtio_config_ops virtio_pci_config_ops = {
.set_status = vp_set_status,
.reset = vp_reset,
.find_vqs = vp_modern_find_vqs,
- .del_vqs = vp_del_vqs,
+ .del_vqs = vp_modern_del_vqs,
.synchronize_cbs = vp_synchronize_vectors,
.get_features = vp_get_features,
.finalize_features = vp_finalize_features,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0385/1756] ALSA: control: Fix virtual master creation reference in kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (383 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0384/1756] virtio_pci_modern: move avq cleanup from reset to del_vqs Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0386/1756] ACPI: fan: Fix memory leak due to leftover devm_kcalloc() argument Greg Kroah-Hartman
` (613 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit a347cc458d97ecd8adb5462b91559682a70aced6 ]
The snd_ctl_add_follower() comment refers to
snd_ctl_create_virtual_master(), but virtual master controls are created
with snd_ctl_make_virtual_master(). Correct the helper name.
Fixes: 79c7cdd5441f ("ALSA: Add kernel-doc comments to vmaster stuff")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260912100548.86134-1-kmehltretter@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/sound/control.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/sound/control.h b/include/sound/control.h
index e07f6b960641f..72d401983f53e 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -241,7 +241,7 @@ int _snd_ctl_add_follower(struct snd_kcontrol *master,
* @follower: follower element to add
*
* Add a virtual follower control to the given master element created via
- * snd_ctl_create_virtual_master() beforehand.
+ * snd_ctl_make_virtual_master() beforehand.
*
* All followers must be the same type (returning the same information
* via info callback). The function doesn't check it, so it's your
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0386/1756] ACPI: fan: Fix memory leak due to leftover devm_kcalloc() argument
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (384 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0385/1756] ALSA: control: Fix virtual master creation reference in kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0387/1756] ACPI: video: Fix backlight unregistration ordering Greg Kroah-Hartman
` (612 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Armin Wolf,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 2cf65d00347005eccf9a24801783377d7f920021 ]
An ACPI device object's dev field in passed as the first argument to
devm_kcalloc() in acpi_fan_get_fps() which is incorrect and leads to
a memory leak on driver probe errors and removal because the driver
is not bound to that ACPI device.
Address this by replacing that pointer with a pointer to the device the
driver is actually bound to.
While at it, drop a redundant error message after a memory allocation
failure (that also gets printed relative to the ACPI device).
Fixes: d91a1d129b63 ("ACPI: fan: Use platform device for devres-related actions")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/14089663.uLZWGnKmhe@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/fan_core.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index 3d85bec8c3d1f..ec9f2503d9152 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -271,7 +271,7 @@ static int acpi_fan_speed_cmp(const void *a, const void *b)
return fps1->speed - fps2->speed;
}
-static int acpi_fan_get_fps(struct acpi_device *device)
+static int acpi_fan_get_fps(struct device *dev, struct acpi_device *device)
{
struct acpi_fan *fan = acpi_driver_data(device);
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -291,11 +291,8 @@ static int acpi_fan_get_fps(struct acpi_device *device)
}
fan->fps_count = obj->package.count - 1; /* minus revision field */
- fan->fps = devm_kcalloc(&device->dev,
- fan->fps_count, sizeof(struct acpi_fan_fps),
- GFP_KERNEL);
+ fan->fps = devm_kcalloc(dev, fan->fps_count, sizeof(*fan->fps), GFP_KERNEL);
if (!fan->fps) {
- dev_err(&device->dev, "Not enough memory\n");
status = -ENOMEM;
goto err;
}
@@ -351,7 +348,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
if (result)
return result;
- result = acpi_fan_get_fps(device);
+ result = acpi_fan_get_fps(&pdev->dev, device);
if (result)
return result;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0387/1756] ACPI: video: Fix backlight unregistration ordering
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (385 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0386/1756] ACPI: fan: Fix memory leak due to leftover devm_kcalloc() argument Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0388/1756] perf header: Fix potential memory corruption in cpu_cache_level__read Greg Kroah-Hartman
` (611 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Armin Wolf,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 46577d36611953d1b99e86493289cfc824116ad2 ]
In acpi_video_dev_unregister_backlight(), the sysfs interface of the
cooling class device may access the brightness object under the
backlight device's ACPI companion, so that object cannot be freed
before unregistering the cooling class device.
Adjust the code to take that into account.
Fixes: 67b662e189f4 ("ACPI / video: seperate backlight control and event interface")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
[ rjw: Fixed the Fixes: tag ]
Link: https://patch.msgid.link/3429468.aeNJFYEL58@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpi_video.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 496f3b585bca2..a476b7397d23f 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1828,6 +1828,12 @@ static int acpi_video_bus_register_backlight(struct acpi_video_bus *video)
static void acpi_video_dev_unregister_backlight(struct acpi_video_device *device)
{
+ if (device->cooling_dev) {
+ sysfs_remove_link(&device->dev->dev.kobj, "thermal_cooling");
+ sysfs_remove_link(&device->cooling_dev->device.kobj, "device");
+ thermal_cooling_device_unregister(device->cooling_dev);
+ device->cooling_dev = NULL;
+ }
if (device->backlight) {
backlight_device_unregister(device->backlight);
device->backlight = NULL;
@@ -1837,12 +1843,6 @@ static void acpi_video_dev_unregister_backlight(struct acpi_video_device *device
kfree(device->brightness);
device->brightness = NULL;
}
- if (device->cooling_dev) {
- sysfs_remove_link(&device->dev->dev.kobj, "thermal_cooling");
- sysfs_remove_link(&device->cooling_dev->device.kobj, "device");
- thermal_cooling_device_unregister(device->cooling_dev);
- device->cooling_dev = NULL;
- }
}
static int acpi_video_bus_unregister_backlight(struct acpi_video_bus *video)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0388/1756] perf header: Fix potential memory corruption in cpu_cache_level__read
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (386 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0387/1756] ACPI: video: Fix backlight unregistration ordering Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0389/1756] regulator: qcom-rpmh: Fix the return value in rpmh_regulator_vrm_get_optimum_mode() kernel-doc Greg Kroah-Hartman
` (610 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit d964ffba01f5d0935dd6bc850029958a62c74491 ]
strim() may advance the pointer assigned to cache->size which causes
later frees to crash.
Fix by performing the strim and then memmove-ing the potentially shifted
string back over the original string.
The bug was introduced by the transition from rtrim() to strim(), as
rtrim() wouldn't move on the left.
Fixes: 13c230ab6e56c6ae ("perf tools: Ditch rtrim(), use strim() from tools/lib")
Signed-off-by: Ian Rogers <irogers@google.com>
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
--git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 7b99f58f7bf26..3653696018a90 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1182,7 +1182,11 @@ static int cpu_cache_level__read(struct cpu_cache_level *cache, u32 cpu, u16 lev
return -1;
cache->type[len] = 0;
- cache->type = strim(cache->type);
+ {
+ char *trimmed = strim(cache->type);
+
+ memmove(cache->type, trimmed, strlen(trimmed) + 1);
+ }
scnprintf(file, PATH_MAX, "%s/size", path);
if (sysfs__read_str(file, &cache->size, &len)) {
@@ -1191,7 +1195,11 @@ static int cpu_cache_level__read(struct cpu_cache_level *cache, u32 cpu, u16 lev
}
cache->size[len] = 0;
- cache->size = strim(cache->size);
+ {
+ char *trimmed = strim(cache->size);
+
+ memmove(cache->size, trimmed, strlen(trimmed) + 1);
+ }
scnprintf(file, PATH_MAX, "%s/shared_cpu_list", path);
if (sysfs__read_str(file, &cache->map, &len)) {
@@ -1201,7 +1209,11 @@ static int cpu_cache_level__read(struct cpu_cache_level *cache, u32 cpu, u16 lev
}
cache->map[len] = 0;
- cache->map = strim(cache->map);
+ {
+ char *trimmed = strim(cache->map);
+
+ memmove(cache->map, trimmed, strlen(trimmed) + 1);
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0389/1756] regulator: qcom-rpmh: Fix the return value in rpmh_regulator_vrm_get_optimum_mode() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (387 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0388/1756] perf header: Fix potential memory corruption in cpu_cache_level__read Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0390/1756] libbpf: Support opening bpf objects of either endianness Greg Kroah-Hartman
` (609 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 51d6888b51e0c962250311b2cbfe5666da31dc0e ]
rpmh_regulator_vrm_get_optimum_mode() returns REGULATOR_MODE_NORMAL or
REGULATOR_MODE_IDLE and cannot fail, but its kernel-doc says "0 on
success, or a negative error number on failure", which was never true.
Describe the mode.
Fixes: efb0cb50c427 ("regulator: qcom-rpmh: Implement get_optimum_mode(), not set_load()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260912000606.34614-1-kmehltretter@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/qcom-rpmh-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
index 62fd0da48407a..9cc6459d2e63d 100644
--- a/drivers/regulator/qcom-rpmh-regulator.c
+++ b/drivers/regulator/qcom-rpmh-regulator.c
@@ -319,7 +319,7 @@ static unsigned int rpmh_regulator_vrm_get_mode(struct regulator_dev *rdev)
* This function is used in the regulator_ops for VRM type RPMh regulator
* devices.
*
- * Return: 0 on success, or a negative error number on failure
+ * Return: the regulator mode to use for the load
*/
static unsigned int rpmh_regulator_vrm_get_optimum_mode(
struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0390/1756] libbpf: Support opening bpf objects of either endianness
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (388 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0389/1756] regulator: qcom-rpmh: Fix the return value in rpmh_regulator_vrm_get_optimum_mode() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0391/1756] libbpf: fix log level propagation for light skeleton loaders Greg Kroah-Hartman
` (608 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tony Ambardar, Andrii Nakryiko,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Ambardar <tony.ambardar@gmail.com>
[ Upstream commit bcc60abd67c7741a065480df4875534f62f758b1 ]
Allow bpf_object__open() to access files of either endianness, and convert
included BPF programs to native byte-order in-memory for introspection.
Loading BPF objects of non-native byte-order is still disallowed however.
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/26353c1a1887a54400e1acd6c138fa90c99cdd40.1726475448.git.tony.ambardar@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: e18e82ba9ed5 ("libbpf: fix log level propagation for light skeleton loaders")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/libbpf.c | 51 +++++++++++++++++++++++++++------
tools/lib/bpf/libbpf_internal.h | 10 +++++++
2 files changed, 52 insertions(+), 9 deletions(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 084ae70c3a768..68de6bc7ad74a 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -696,6 +696,8 @@ struct bpf_object {
/* Information when doing ELF related work. Only valid if efile.elf is not NULL */
struct elf_state efile;
+ unsigned char byteorder;
+
struct btf *btf;
struct btf_ext *btf_ext;
@@ -942,6 +944,20 @@ bpf_object__add_programs(struct bpf_object *obj, Elf_Data *sec_data,
return 0;
}
+static void bpf_object_bswap_progs(struct bpf_object *obj)
+{
+ struct bpf_program *prog = obj->programs;
+ struct bpf_insn *insn;
+ int p, i;
+
+ for (p = 0; p < obj->nr_programs; p++, prog++) {
+ insn = prog->insns;
+ for (i = 0; i < prog->insns_cnt; i++, insn++)
+ bpf_insn_bswap(insn);
+ }
+ pr_debug("converted %zu BPF programs to native byte order\n", obj->nr_programs);
+}
+
static const struct btf_member *
find_member_by_offset(const struct btf_type *t, __u32 bit_offset)
{
@@ -1507,6 +1523,7 @@ static void bpf_object__elf_finish(struct bpf_object *obj)
elf_end(obj->efile.elf);
obj->efile.elf = NULL;
+ obj->efile.ehdr = NULL;
obj->efile.symbols = NULL;
obj->efile.arena_data = NULL;
@@ -1572,6 +1589,16 @@ static int bpf_object__elf_init(struct bpf_object *obj)
goto errout;
}
+ /* Validate ELF object endianness... */
+ if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB &&
+ ehdr->e_ident[EI_DATA] != ELFDATA2MSB) {
+ err = -LIBBPF_ERRNO__ENDIAN;
+ pr_warn("elf: '%s' has unknown byte order\n", obj->path);
+ goto errout;
+ }
+ /* and save after bpf_object_open() frees ELF data */
+ obj->byteorder = ehdr->e_ident[EI_DATA];
+
if (elf_getshdrstrndx(elf, &obj->efile.shstrndx)) {
pr_warn("elf: failed to get section names section index for %s: %s\n",
obj->path, elf_errmsg(-1));
@@ -1600,19 +1627,15 @@ static int bpf_object__elf_init(struct bpf_object *obj)
return err;
}
-static int bpf_object__check_endianness(struct bpf_object *obj)
+static bool is_native_endianness(struct bpf_object *obj)
{
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- if (obj->efile.ehdr->e_ident[EI_DATA] == ELFDATA2LSB)
- return 0;
+ return obj->byteorder == ELFDATA2LSB;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- if (obj->efile.ehdr->e_ident[EI_DATA] == ELFDATA2MSB)
- return 0;
+ return obj->byteorder == ELFDATA2MSB;
#else
# error "Unrecognized __BYTE_ORDER__"
#endif
- pr_warn("elf: endianness mismatch in %s.\n", obj->path);
- return -LIBBPF_ERRNO__ENDIAN;
}
static int
@@ -3954,6 +3977,10 @@ static int bpf_object__elf_collect(struct bpf_object *obj)
return -LIBBPF_ERRNO__FORMAT;
}
+ /* change BPF program insns to native endianness for introspection */
+ if (!is_native_endianness(obj))
+ bpf_object_bswap_progs(obj);
+
/* sort BPF programs by section name and in-section instruction offset
* for faster search
*/
@@ -8054,7 +8081,6 @@ static struct bpf_object *bpf_object_open(const char *path, const void *obj_buf,
}
err = bpf_object__elf_init(obj);
- err = err ? : bpf_object__check_endianness(obj);
err = err ? : bpf_object__elf_collect(obj);
err = err ? : bpf_object__collect_externs(obj);
err = err ? : bpf_object_fixup_btf(obj);
@@ -8560,8 +8586,15 @@ static int bpf_object_load(struct bpf_object *obj, int extra_log_level, const ch
return libbpf_err(-EINVAL);
}
- if (obj->gen_loader)
+ /* Disallow kernel loading programs of non-native endianness but
+ * permit cross-endian creation of "light skeleton".
+ */
+ if (obj->gen_loader) {
bpf_gen__init(obj->gen_loader, extra_log_level, obj->nr_programs, obj->nr_maps);
+ } else if (!is_native_endianness(obj)) {
+ pr_warn("object '%s': loading non-native endianness is unsupported\n", obj->name);
+ return libbpf_err(-LIBBPF_ERRNO__ENDIAN);
+ }
err = bpf_object_prepare_token(obj);
err = err ? : bpf_object__probe_loading(obj);
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index 71a2355bba9e7..227fd84ed4a8e 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -617,6 +617,16 @@ static inline bool is_ldimm64_insn(struct bpf_insn *insn)
return insn->code == (BPF_LD | BPF_IMM | BPF_DW);
}
+static inline void bpf_insn_bswap(struct bpf_insn *insn)
+{
+ __u8 tmp_reg = insn->dst_reg;
+
+ insn->dst_reg = insn->src_reg;
+ insn->src_reg = tmp_reg;
+ insn->off = bswap_16(insn->off);
+ insn->imm = bswap_32(insn->imm);
+}
+
/* Unconditionally dup FD, ensuring it doesn't use [0, 2] range.
* Original FD is not closed or altered in any other way.
* Preserves original FD value, if it's invalid (negative).
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0391/1756] libbpf: fix log level propagation for light skeleton loaders
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (389 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0390/1756] libbpf: Support opening bpf objects of either endianness Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0392/1756] fs/ntfs3: take run_lock when freeing offs_folio in ni_decompress_file Greg Kroah-Hartman
` (607 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Borkmann, Mahe Tardy,
Alexei Starovoitov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahe Tardy <mahe.tardy@gmail.com>
[ Upstream commit e18e82ba9ed53f60acce5f9995ee357a9f7ab91d ]
bpftool's -d option is documented to enable bpf_trace_printk() messages
from the generated syscall loader when used with -L as specified in
commit d510296d331a ("bpftool: Use syscall/loader program in "prog load"
and "gen skeleton" command.")
However commit b59e4ce8bcaa ("bpftool: Switch bpf_object__load_xattr()
to bpf_object__load()") changed bpftool to use bpf_object__load() which
call the internal bpf_object_load with extra_log_level to 0 instead of
bpf_object__load_xattr with the user request log_level.
All the plumbing was still there to generate the bpf_trace_printk()
instructions from the generator but was now unreachable because
bpf_gen__init() was called with extra_log_level to 0, leaving
gen->log_level at 0.
This uses the obj->log_level field introduced in commit e0e3ea888c69
("libbpf: Allow passing user log setting through bpf_object_open_opts")
set from reading verifier_logs in do_skeleton(). This preserves both
object-level and explicit load-time logging settings.
Fixes: b59e4ce8bcaa ("bpftool: Switch bpf_object__load_xattr() to bpf_object__load()")
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
Link: https://lore.kernel.org/r/20260907170536.9996-1-mahe.tardy@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/libbpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 68de6bc7ad74a..e43dad57c1125 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -8590,7 +8590,8 @@ static int bpf_object_load(struct bpf_object *obj, int extra_log_level, const ch
* permit cross-endian creation of "light skeleton".
*/
if (obj->gen_loader) {
- bpf_gen__init(obj->gen_loader, extra_log_level, obj->nr_programs, obj->nr_maps);
+ bpf_gen__init(obj->gen_loader, obj->log_level | extra_log_level,
+ obj->nr_programs, obj->nr_maps);
} else if (!is_native_endianness(obj)) {
pr_warn("object '%s': loading non-native endianness is unsupported\n", obj->name);
return libbpf_err(-LIBBPF_ERRNO__ENDIAN);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0392/1756] fs/ntfs3: take run_lock when freeing offs_folio in ni_decompress_file
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (390 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0391/1756] libbpf: fix log level propagation for light skeleton loaders Greg Kroah-Hartman
@ 2026-11-18 14:41 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0393/1756] fs/ntfs3: update ctime only on successful setxattr Greg Kroah-Hartman
` (606 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi,
Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
[ Upstream commit ad39d8d90fa0fd99b2714d4c84c6f4e1c399f1f4 ]
attr_wof_frame_info() allocates, caches and dereferences
ni->file.offs_folio under down_write(&ni->file.run_lock).
ni_decompress_file() frees the same folio with folio_put() without
taking run_lock. When a WOF externally-compressed file is opened for
write, ni_decompress_file() can drop the last reference while a
concurrent O_RDONLY reader is dereferencing the folio in
attr_wof_frame_info(), leading to a use-after-free:
BUG: KASAN: use-after-free in attr_wof_frame_info (fs/ntfs3/attrib.c:1619)
Read of size 4 at addr ffff8880120c9000 by task exploit
Call Trace:
attr_wof_frame_info (fs/ntfs3/attrib.c:1619)
ni_read_frame (fs/ntfs3/frecord.c:2421)
ni_read_folio_cmpr (fs/ntfs3/frecord.c:1916)
ntfs_read_folio (fs/ntfs3/inode.c:648)
read_pages (mm/readahead.c:181)
page_cache_ra_unbounded (mm/readahead.c:292)
force_page_cache_ra (mm/readahead.c:364)
page_cache_sync_ra (mm/readahead.c:573)
filemap_get_pages (mm/filemap.c:2688)
filemap_read (mm/filemap.c:2806)
generic_file_read_iter (mm/filemap.c:2994)
ntfs_file_read_iter (fs/ntfs3/file.c:842)
vfs_read (fs/read_write.c:574)
__x64_sys_pread64 (fs/read_write.c:773)
Take run_lock around the folio_put(), as is done for every other
access to ni->file.offs_folio.
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Reported-by: Xiang Mei <xmei5@asu.edu>
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/frecord.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index ab8615abb981b..f3d8483c9f543 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2395,10 +2395,13 @@ int ni_decompress_file(struct ntfs_inode *ni)
/* Clear cached flag. */
ni->ni_flags &= ~NI_FLAG_COMPRESSED_MASK;
+ /* offs_folio is accessed under run_lock in attr_wof_frame_info(). */
+ down_write(&ni->file.run_lock);
if (ni->file.offs_folio) {
folio_put(ni->file.offs_folio);
ni->file.offs_folio = NULL;
}
+ up_write(&ni->file.run_lock);
mapping->a_ops = &ntfs_aops;
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0393/1756] fs/ntfs3: update ctime only on successful setxattr
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (391 preceding siblings ...)
2026-11-18 14:41 ` [PATCH 6.12 0392/1756] fs/ntfs3: take run_lock when freeing offs_folio in ni_decompress_file Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0394/1756] ntfs: Do not kmap page cache pages for compression Greg Kroah-Hartman
` (605 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Baolin Liu, Konstantin Komarov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baolin Liu <liubaolin@kylinos.cn>
[ Upstream commit bfa6296bb6a0e2333796a9507beb4605b92a9fdf ]
ntfs_setxattr() updates ctime and marks the inode dirty even when the
xattr operation fails.
Do that only on success.
Fixes: 2d44667c306e ("fs/ntfs3: Update i_ctime when xattr is added")
Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/xattr.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index f929cef0f5100..b37e8d477d3c2 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -958,8 +958,10 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler,
NULL);
out:
- inode_set_ctime_current(inode);
- mark_inode_dirty(inode);
+ if (!err) {
+ inode_set_ctime_current(inode);
+ mark_inode_dirty(inode);
+ }
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0394/1756] ntfs: Do not kmap page cache pages for compression
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (392 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0393/1756] fs/ntfs3: update ctime only on successful setxattr Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0395/1756] fs/ntfs3: zero frame pages on read error Greg Kroah-Hartman
` (604 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Wilcox (Oracle),
Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <willy@infradead.org>
[ Upstream commit 953b79a7a124c3dae86544cea581a5bc7655aa13 ]
These pages are accessed through vmap; they are not accessed
by calling page_address(), so they do not need to be kmapped.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Stable-dep-of: a32e893a077a ("fs/ntfs3: zero frame pages on read error")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/frecord.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index f3d8483c9f543..5b38d31bb13f2 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2504,9 +2504,6 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
* To simplify decompress algorithm do vmap for source
* and target pages.
*/
- for (i = 0; i < pages_per_frame; i++)
- kmap(pages[i]);
-
frame_size = pages_per_frame << PAGE_SHIFT;
frame_mem = vmap(pages, pages_per_frame, VM_MAP, PAGE_KERNEL);
if (!frame_mem) {
@@ -2763,7 +2760,6 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
out:
for (i = 0; i < pages_per_frame; i++) {
pg = pages[i];
- kunmap(pg);
SetPageUptodate(pg);
}
@@ -2850,9 +2846,6 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
goto out1;
}
- for (i = 0; i < pages_per_frame; i++)
- kmap(pages[i]);
-
/* Map in-memory frame for read-only. */
frame_mem = vmap(pages, pages_per_frame, VM_MAP, PAGE_KERNEL_RO);
if (!frame_mem) {
@@ -2918,11 +2911,7 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages,
out3:
vunmap(frame_mem);
-
out2:
- for (i = 0; i < pages_per_frame; i++)
- kunmap(pages[i]);
-
vunmap(frame_ondisk);
out1:
for (i = 0; i < pages_per_frame; i++) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0395/1756] fs/ntfs3: zero frame pages on read error
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (393 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0394/1756] ntfs: Do not kmap page cache pages for compression Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0396/1756] pinctrl: amd: Add PM debugging message for turning on/off wakes Greg Kroah-Hartman
` (603 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi,
Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
[ Upstream commit a32e893a077a4b0d3b04c86cb7f69e354a187995 ]
ni_read_frame() marks every frame page uptodate at the 'out:' label
regardless of the return value. The pages come from ntfs_lock_new_page()
and are not zeroed, and several error paths reach 'out:' before anything
is written to them (e.g. a failed decompress_lznt()/decompress_lzx_xpress()
on a corrupted chunk, or an allocation failure).
A page marked uptodate is served directly from the page cache, so a later
read() of the file returns the uninitialized page contents to userspace.
On a crafted compressed image this leaks kernel memory, including pointers.
Zero each page on the error path before marking it uptodate. The success
path is unchanged.
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Reported-by: Xiang Mei <xmei5@asu.edu>
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/frecord.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 5b38d31bb13f2..014dcf2e50422 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2760,6 +2760,8 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
out:
for (i = 0; i < pages_per_frame; i++) {
pg = pages[i];
+ if (err)
+ clear_highpage(pg);
SetPageUptodate(pg);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0396/1756] pinctrl: amd: Add PM debugging message for turning on/off wakes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (394 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0395/1756] fs/ntfs3: zero frame pages on read error Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0397/1756] pinctrl: amd: Dont access irq_datas hwirq member directly Greg Kroah-Hartman
` (602 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mario Limonciello (AMD),
Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello (AMD) <superm1@kernel.org>
[ Upstream commit 54b962fa14dc82a625436fcbcee7b3f2067a4f6d ]
The GPIOs for devices not in _AEI/_EVT such as touchpad or touchscreen
won't have wakeup turned on until the suspend sequence starts.
Due to code in amd_gpio_suspend_hibernate_common() masking the interrupt
can make this difficult to follow what's going on. Add an explicit
debugging message to tell when that was turned on/off.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://lore.kernel.org/20250814183430.3887973-2-superm1@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 44c232e80adc ("pinctrl: amd: add timeout to irq-enable readback")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/pinctrl-amd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 669a063a31688..d48b9ec6ad7c9 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -440,6 +440,9 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
int err;
+ pm_pr_dbg("Setting wake for GPIO %lu to %s\n",
+ d->hwirq, str_enable_disable(on));
+
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0397/1756] pinctrl: amd: Dont access irq_datas hwirq member directly
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (395 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0396/1756] pinctrl: amd: Add PM debugging message for turning on/off wakes Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0398/1756] pinctrl: amd: add timeout to irq-enable readback Greg Kroah-Hartman
` (601 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko,
Mario Limonciello (AMD), Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello (AMD) <superm1@kernel.org>
[ Upstream commit 7a399ce67e981f5f28afc1ff50772acd1f4e7bbf ]
There is an irqd_to_hwirq() intended to get the hwirq number. Switch
all use to it.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250821144942.2463014-1-superm1@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 44c232e80adc ("pinctrl: amd: add timeout to irq-enable readback")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/pinctrl-amd.c | 40 ++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index d48b9ec6ad7c9..d2e8c78a9a0b5 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -375,14 +375,15 @@ static void amd_gpio_irq_enable(struct irq_data *d)
unsigned long flags;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
+ irq_hw_number_t hwirq = irqd_to_hwirq(d);
- gpiochip_enable_irq(gc, d->hwirq);
+ gpiochip_enable_irq(gc, hwirq);
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
+ pin_reg = readl(gpio_dev->base + hwirq * 4);
pin_reg |= BIT(INTERRUPT_ENABLE_OFF);
pin_reg |= BIT(INTERRUPT_MASK_OFF);
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
+ writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
}
@@ -392,15 +393,16 @@ static void amd_gpio_irq_disable(struct irq_data *d)
unsigned long flags;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
+ irq_hw_number_t hwirq = irqd_to_hwirq(d);
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
+ pin_reg = readl(gpio_dev->base + hwirq * 4);
pin_reg &= ~BIT(INTERRUPT_ENABLE_OFF);
pin_reg &= ~BIT(INTERRUPT_MASK_OFF);
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
+ writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
- gpiochip_disable_irq(gc, d->hwirq);
+ gpiochip_disable_irq(gc, hwirq);
}
static void amd_gpio_irq_mask(struct irq_data *d)
@@ -409,11 +411,12 @@ static void amd_gpio_irq_mask(struct irq_data *d)
unsigned long flags;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
+ irq_hw_number_t hwirq = irqd_to_hwirq(d);
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
+ pin_reg = readl(gpio_dev->base + hwirq * 4);
pin_reg &= ~BIT(INTERRUPT_MASK_OFF);
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
+ writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
}
@@ -423,11 +426,12 @@ static void amd_gpio_irq_unmask(struct irq_data *d)
unsigned long flags;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
+ irq_hw_number_t hwirq = irqd_to_hwirq(d);
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
+ pin_reg = readl(gpio_dev->base + hwirq * 4);
pin_reg |= BIT(INTERRUPT_MASK_OFF);
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
+ writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
}
@@ -438,20 +442,21 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
+ irq_hw_number_t hwirq = irqd_to_hwirq(d);
int err;
pm_pr_dbg("Setting wake for GPIO %lu to %s\n",
- d->hwirq, str_enable_disable(on));
+ hwirq, str_enable_disable(on));
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
+ pin_reg = readl(gpio_dev->base + hwirq * 4);
if (on)
pin_reg |= wake_mask;
else
pin_reg &= ~wake_mask;
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
+ writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
if (on)
@@ -487,9 +492,10 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
unsigned long flags;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
+ irq_hw_number_t hwirq = irqd_to_hwirq(d);
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
- pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
+ pin_reg = readl(gpio_dev->base + hwirq * 4);
switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_RISING:
@@ -555,10 +561,10 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
pin_reg_irq_en = pin_reg;
pin_reg_irq_en |= mask;
pin_reg_irq_en &= ~BIT(INTERRUPT_MASK_OFF);
- writel(pin_reg_irq_en, gpio_dev->base + (d->hwirq)*4);
- while ((readl(gpio_dev->base + (d->hwirq)*4) & mask) != mask)
+ writel(pin_reg_irq_en, gpio_dev->base + hwirq * 4);
+ while ((readl(gpio_dev->base + hwirq * 4) & mask) != mask)
continue;
- writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
+ writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0398/1756] pinctrl: amd: add timeout to irq-enable readback
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (396 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0397/1756] pinctrl: amd: Dont access irq_datas hwirq member directly Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0399/1756] microblaze: uaccess: Zero out destination on failed get_user() Greg Kroah-Hartman
` (600 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linkai Gong, Linus Walleij,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <gonglinkai@kylinos.cn>
[ Upstream commit 44c232e80adc26634e40b3dbeaa20711da9ecf0d ]
amd_gpio_irq_set_type() polls INTERRUPT_ENABLE with IRQs off
and no timeout. Use readl_poll_timeout_atomic() and return
-ETIMEDOUT.
Fixes: b85bfa246efd ("pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/pinctrl-amd.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index d2e8c78a9a0b5..382d441bd5b14 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -18,6 +18,7 @@
#include <linux/errno.h>
#include <linux/log2.h>
#include <linux/io.h>
+#include <linux/iopoll.h>
#include <linux/gpio/driver.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
@@ -488,7 +489,7 @@ static void amd_gpio_irq_eoi(struct irq_data *d)
static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{
int ret = 0;
- u32 pin_reg, pin_reg_irq_en, mask;
+ u32 pin_reg, pin_reg_irq_en, mask, reg;
unsigned long flags;
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
@@ -562,8 +563,9 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
pin_reg_irq_en |= mask;
pin_reg_irq_en &= ~BIT(INTERRUPT_MASK_OFF);
writel(pin_reg_irq_en, gpio_dev->base + hwirq * 4);
- while ((readl(gpio_dev->base + hwirq * 4) & mask) != mask)
- continue;
+ if (readl_poll_timeout_atomic(gpio_dev->base + hwirq * 4, reg,
+ (reg & mask) == mask, 1, 1000))
+ ret = -ETIMEDOUT;
writel(pin_reg, gpio_dev->base + hwirq * 4);
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0399/1756] microblaze: uaccess: Zero out destination on failed get_user()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (397 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0398/1756] pinctrl: amd: add timeout to irq-enable readback Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0400/1756] microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS Greg Kroah-Hartman
` (599 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Weißschuh, David Gow,
Michal Simek, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <linux@weissschuh.net>
[ Upstream commit 54c35131e628e1a18f02365495a24a73a1fb515e ]
On failure get_user() is supposed to zero out the destination variable.
This is documented in the kdoc of the microblaze get_user()
implementation and validated in lib/tests/usercopy_kunit.c.
Currently that zeroing is missing.
Add it.
Fixes: 0d6de9532663 ("microblaze_mmu_v2: uaccess MMU update")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: David Gow <david@davidgow.net>
Link: https://patch.msgid.link/20260914-kunit-microblaze-v2-1-7d5756e858f8@weissschuh.net
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/microblaze/include/asm/uaccess.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/microblaze/include/asm/uaccess.h b/arch/microblaze/include/asm/uaccess.h
index 3aab2f17e0462..ea6653dc2e68a 100644
--- a/arch/microblaze/include/asm/uaccess.h
+++ b/arch/microblaze/include/asm/uaccess.h
@@ -95,7 +95,8 @@ extern long __user_bad(void);
#define get_user(x, ptr) ({ \
const typeof(*(ptr)) __user *__gu_ptr = (ptr); \
access_ok(__gu_ptr, sizeof(*__gu_ptr)) ? \
- __get_user(x, __gu_ptr) : -EFAULT; \
+ __get_user(x, __gu_ptr) : \
+ ((x) = 0, -EFAULT); \
})
#define __get_user(x, ptr) \
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0400/1756] microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (398 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0399/1756] microblaze: uaccess: Zero out destination on failed get_user() Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0401/1756] arm64: pi: Run the source checker on the libfdt objects under C=2 Greg Kroah-Hartman
` (598 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Weißschuh, Michal Simek,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <linux@weissschuh.net>
[ Upstream commit b9eababe8c0b9f71ce7f35f903879a7fcb6daebe ]
These parameters are also necessary for preprocessed files which do not
contain code. One example is arch/microblaze/kernel/vmlinux.lds.S which
inspects __MICROBLAZEEL__ for the definition of 'jiffies_64'.
As currently the endianness is not passed from the build system for this
file, the preprocessor will instead use the default endianness of the
toolchain. When a default big-endian toolchain is used to build a
little-endian kernel, that kernel will hang during delay calibration
as 'jiffies' never changes.
Make sure all preprocessor invocations know about the correct endianness
by passing it through KBUILD_CPPFLAGS. This will also be inherited by
CFLAGS and AFLAGS.
Fixes: 02b08045a030 ("microblaze: Add support for little-endian Microblaze")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20260914-kunit-microblaze-v2-2-7d5756e858f8@weissschuh.net
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/microblaze/Makefile | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index 02e6be9c5b0dc..9087a366ce789 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -34,12 +34,10 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
ifdef CONFIG_CPU_BIG_ENDIAN
-KBUILD_CFLAGS += -mbig-endian
-KBUILD_AFLAGS += -mbig-endian
+KBUILD_CPPFLAGS += -mbig-endian
KBUILD_LDFLAGS += -EB
else
-KBUILD_CFLAGS += -mlittle-endian
-KBUILD_AFLAGS += -mlittle-endian
+KBUILD_CPPFLAGS += -mlittle-endian
KBUILD_LDFLAGS += -EL
endif
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0401/1756] arm64: pi: Run the source checker on the libfdt objects under C=2
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (399 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0400/1756] microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0402/1756] wifi: mac80211: Fix the return value in mesh_path_add() kernel-doc Greg Kroah-Hartman
` (597 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Marc Zyngier, Fuad Tabba,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fuad Tabba <fuad.tabba@linux.dev>
[ Upstream commit 44b14ff4aebeae98663d0fd424b4ef88237ee981 ]
The custom lib-%.o rule reuses rule_cc_o_c, which hooks the source
checker only for C=1, and that only when the object is rebuilt. The
C=2 hook, cmd_force_checksrc, hangs off the standard %.o rule, so
"make C=2" silently skips the two libfdt objects. Call
cmd_force_checksrc after the compile rule, as the standard rule does.
Fixes: aacd149b6238 ("arm64: head: avoid relocating the kernel twice for KASLR")
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Link: https://patch.msgid.link/20260901140326.3812068-7-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kernel/pi/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile
index 4d11a8c291816..8a475ef279fa1 100644
--- a/arch/arm64/kernel/pi/Makefile
+++ b/arch/arm64/kernel/pi/Makefile
@@ -34,6 +34,7 @@ $(obj)/lib-%.pi.o: OBJCOPYFLAGS += --prefix-alloc-sections=.init
$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
$(call if_changed_rule,cc_o_c)
+ $(call cmd,force_checksrc)
obj-y := idreg-override.pi.o \
map_kernel.pi.o map_range.pi.o \
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0402/1756] wifi: mac80211: Fix the return value in mesh_path_add() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (400 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0401/1756] arm64: pi: Run the source checker on the libfdt objects under C=2 Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0403/1756] wifi: mac80211: dont reset the TXQ scheduling round number Greg Kroah-Hartman
` (596 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 5c7b043cb1ef4bca9aa2e793dab862c0989d59c3 ]
mesh_path_add() has returned the new (or the already existing) struct
mesh_path, or an ERR_PTR(), since commit ae76eef027f7 ("mac80211: return
new mpath from mesh_path_add()"), but its kernel-doc still says
"Returns: 0 on success". Describe the pointer.
Fixes: ae76eef027f7 ("mac80211: return new mpath from mesh_path_add()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260912072840.50710-1-kmehltretter@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/mesh_pathtbl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 0aae70e957c92..9f1b5c6a15840 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -679,7 +679,7 @@ void mesh_fast_tx_flush_addr(struct ieee80211_sub_if_data *sdata,
* @dst: destination address of the path (ETH_ALEN length)
* @sdata: local subif
*
- * Returns: 0 on success
+ * Returns: the new or the existing path on success, an ERR_PTR() on failure
*
* State: the initial state of the new path is set to 0
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0403/1756] wifi: mac80211: dont reset the TXQ scheduling round number
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (401 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0402/1756] wifi: mac80211: Fix the return value in mesh_path_add() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0404/1756] mtd: spi-nor: spansion: Remove s25fs256s0 Greg Kroah-Hartman
` (595 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Julius Bairaktaris,
Toke Høiland-Jørgensen, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julius Bairaktaris <julius@bairaktaris.de>
[ Upstream commit 8ea81827d3537db7cfcc82c008f052bb1bbe7567 ]
A round is ended when ieee80211_next_txq() meets a txq whose remembered
round number is the current one, meaning it has gone full circle.
When the AC exceeds the airtime limit, ieee80211_txq_schedule_start()
sets the round number to 0 to close the round. The next open round is
1. A txq from an earlier round 1 still remembers the "1", so the next
round stops on it and serves nothing.
Fix: use a separate open/closed flag and let the round number keep
counting.
Testing: ~4200 skipped selections per 20s without the fix and 20
skipped selections per 20s with the fix on ath11k (with my AQL series
applied) at BE 500/1000.
Fixes: 8e4bac067105 ("wifi: mac80211: add a per-PHY AQL limit to improve fairness")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Reviewed-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/20260908144155.756569-1-julius@bairaktaris.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/tx.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c0e7db6fbec38..388f728f3a03d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1355,6 +1355,7 @@ struct ieee80211_local {
spinlock_t active_txq_lock[IEEE80211_NUM_ACS];
struct list_head active_txqs[IEEE80211_NUM_ACS];
u16 schedule_round[IEEE80211_NUM_ACS];
+ bool schedule_open[IEEE80211_NUM_ACS];
/* serializes ieee80211_handle_wake_tx_queue */
spinlock_t handle_wake_tx_queue_lock;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e64811ff8ccb4..24ed731091bbd 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4166,7 +4166,7 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)
spin_lock_bh(&local->active_txq_lock[ac]);
- if (!local->schedule_round[ac])
+ if (!local->schedule_open[ac])
goto out;
begin:
@@ -4370,12 +4370,12 @@ void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
spin_lock_bh(&local->active_txq_lock[ac]);
- if (ieee80211_txq_schedule_airtime_check(local, ac)) {
+ local->schedule_open[ac] =
+ ieee80211_txq_schedule_airtime_check(local, ac);
+ if (local->schedule_open[ac]) {
local->schedule_round[ac]++;
if (!local->schedule_round[ac])
local->schedule_round[ac]++;
- } else {
- local->schedule_round[ac] = 0;
}
spin_unlock_bh(&local->active_txq_lock[ac]);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0404/1756] mtd: spi-nor: spansion: Remove s25fs256s0
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (402 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0403/1756] wifi: mac80211: dont reset the TXQ scheduling round number Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0405/1756] wifi: wfx: fix use-after-free of the cooling work on device removal Greg Kroah-Hartman
` (594 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Takahiro Kuwano, Michael Walle,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takahiro Kuwano <takahiro.kuwano@infineon.com>
[ Upstream commit f917d9edf54c3dd578efc231b8fbcd35744f99cd ]
The Spansion ID table lists s25fs256s0 and s25fs256s1 as variants
distinguished by id[4] (0x00 for 256 KB sectors and 0x01 for 64 KB
sectors), following an incorrect statement in the datasheet.
The sector size of s25fs256s is configurable between 256 KB and 64 KB.
The factory default is 64 KB, and id[4] is always 0x01 regardless of the
configured sector size. Remove the invalid s25fs256s0 entry from the ID
table.
Fixes: 075fd6dff24a ("mtd: spi-nor: spansion: Differentiate between s25fl256s and s25fs256s")
Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
Signed-off-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/spi-nor/spansion.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index 36407ea90f924..041c0dcaf4b7c 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -829,13 +829,6 @@ static const struct flash_info spansion_nor_parts[] = {
.sector_size = SZ_256K,
.no_sfdp_flags = SPI_NOR_SKIP_SFDP | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
.mfr_flags = USE_CLSR,
- }, {
- .id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x00, 0x81),
- .name = "s25fs256s0",
- .size = SZ_32M,
- .sector_size = SZ_256K,
- .no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
- .mfr_flags = USE_CLSR,
}, {
.id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x01, 0x80),
.name = "s25fl256s1",
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0405/1756] wifi: wfx: fix use-after-free of the cooling work on device removal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (403 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0404/1756] mtd: spi-nor: spansion: Remove s25fs256s0 Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0406/1756] f2fs: quota: fix stale lock holder on remount failure Greg Kroah-Hartman
` (593 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérôme Pouiller,
Alexander Sverdlin, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérôme Pouiller <jerome.pouiller@silabs.com>
[ Upstream commit 17402a869778f6c17b88fd360d7a96378779f97c ]
When the device reports that it is too hot, wfx_suspend_hot_dev() blocks
the Tx queues and arms cooling_timeout_work with a 10s delay. If the
device recovers a normal temperature before the delay expires, the work
is canceled. Else, the work declares the chip frozen and unblocks the Tx
queues.
However, this work is never canceled when the device is removed.
cooling_timeout_work is queued on the system workqueue, while struct
wfx_dev is released by wfx_free_common() (through ieee80211_free_hw()).
So, if the device is unbound during this 10s window, the work fires
after struct wfx_dev has been freed and dereferences it.
Cancel the work during the teardown. It has to be done after
wfx_bh_unregister(): the "device too hot" indication is processed by the
bh, so canceling the work earlier would allow the bh to rearm it. On the
other hand, the work calls wfx_tx_unlock(), which may in turn call
wfx_bh_request_tx(). So it has to be canceled before bh_wq is destroyed.
Note that the Tx queues are intentionally left blocked: the device is
going away, so there is nothing to unblock.
The issue was reported by the Sashiko review bot and the fix has been
written by Copilot (including the commit log). The use-case is difficult
to reproduce, so this code has not been tested. However, I don't believe
this patch could cause any regression.
Fixes: 1d52d29983e5d ("staging: wfx: add support for 'device too hot' indication")
Assisted-by: Sashiko:gemini-3.1-pro-preview
Assisted-by: Copilot:claude-opus-5
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Link: https://patch.msgid.link/20260906204831.949692-2-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/silabs/wfx/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c
index fced10c057043..a2af18d790f13 100644
--- a/drivers/net/wireless/silabs/wfx/main.c
+++ b/drivers/net/wireless/silabs/wfx/main.c
@@ -473,6 +473,7 @@ int wfx_probe(struct wfx_dev *wdev)
wdev->hwbus_ops->irq_unsubscribe(wdev->hwbus_priv);
bh_unregister:
wfx_bh_unregister(wdev);
+ cancel_delayed_work_sync(&wdev->cooling_timeout_work);
destroy_workqueue(wdev->bh_wq);
return err;
}
@@ -483,6 +484,7 @@ void wfx_release(struct wfx_dev *wdev)
wfx_hif_shutdown(wdev);
wdev->hwbus_ops->irq_unsubscribe(wdev->hwbus_priv);
wfx_bh_unregister(wdev);
+ cancel_delayed_work_sync(&wdev->cooling_timeout_work);
destroy_workqueue(wdev->bh_wq);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0406/1756] f2fs: quota: fix stale lock holder on remount failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (404 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0405/1756] wifi: wfx: fix use-after-free of the cooling work on device removal Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0407/1756] firmware: imx: dsp: fix mailbox channel leak on kasprintf failure Greg Kroah-Hartman
` (592 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jianan Huang, Chao Yu, Jaegeuk Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianan Huang <jnhuang95@gmail.com>
[ Upstream commit 3f140a60c92a5e2e9885adac70cd3686ba4ee19a ]
F2FS remount can fail while duplicating a journalled quota file name.
f2fs_remount()
- sbi->umount_lock_holder = current
- kstrdup(F2FS_OPTION(sbi).s_qf_names[i])
: fails
- free previously duplicated names
- return -ENOMEM
The direct return leaves umount_lock_holder pointing at the failed
remount context. A later checkpoint may then wrongly treat another
context as the s_umount lock holder.
Add a restore_holder cleanup path and use it before returning -ENOMEM.
Fixes: eb85c2410d6f ("f2fs: quota: fix to avoid warning in dquot_writeback_dquots()")
Signed-off-by: Jianan Huang <jnhuang95@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/super.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index facf7647b5095..7f81ac832a858 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2381,7 +2381,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
if (!org_mount_opt.s_qf_names[i]) {
for (j = 0; j < i; j++)
kfree(org_mount_opt.s_qf_names[j]);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto restore_holder;
}
} else {
org_mount_opt.s_qf_names[i] = NULL;
@@ -2645,6 +2646,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
sbi->mount_opt = org_mount_opt;
sb->s_flags = old_sb_flags;
+restore_holder:
sbi->umount_lock_holder = NULL;
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0407/1756] firmware: imx: dsp: fix mailbox channel leak on kasprintf failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (405 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0406/1756] f2fs: quota: fix stale lock holder on remount failure Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0408/1756] phy: hisilicon: hi3670: Fix OF node and device reference leaks Greg Kroah-Hartman
` (591 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linkai Gong, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <gonglinkai@kylinos.cn>
[ Upstream commit e3631d0242842940f9e902afaea98202e56277e8 ]
If kasprintf() fails while setting up mailbox channels, already
requested channels from earlier iterations were never freed. Route
the failure through the existing cleanup path.
Fixes: ffbf23d50353 ("firmware: imx: Add DSP IPC protocol interface")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/imx/imx-dsp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c
index 01c8ef14eaec3..41d1d6153923b 100644
--- a/drivers/firmware/imx/imx-dsp.c
+++ b/drivers/firmware/imx/imx-dsp.c
@@ -99,8 +99,10 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
else
chan_name = kasprintf(GFP_KERNEL, "rxdb%d", i - 2);
- if (!chan_name)
- return -ENOMEM;
+ if (!chan_name) {
+ ret = -ENOMEM;
+ goto out;
+ }
dsp_chan = &dsp_ipc->chans[i];
dsp_chan->name = chan_name;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0408/1756] phy: hisilicon: hi3670: Fix OF node and device reference leaks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (406 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0407/1756] firmware: imx: dsp: fix mailbox channel leak on kasprintf failure Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0409/1756] phy: cadence: Sierra: Do not modify register when getting parent clock Greg Kroah-Hartman
` (590 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vladimir Oltean, Haotian Zhang,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haotian Zhang <vulab@iscas.ac.cn>
[ Upstream commit 1499f3d3407f5310731bcdf324387c321258fd75 ]
hi3670_pcie_get_resources_from_pcie() leaks two references:
1) The OF node returned by of_get_child_by_name() is never released.
2) The device returned by bus_find_device_by_of_node() is never put.
Fix both leaks by calling of_node_put() right after
bus_find_device_by_of_node(), and put_device() after dev_get_regmap()
when the temporary pcie_dev reference is no longer needed.
Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260219163843.1571-1-vulab@iscas.ac.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/hisilicon/phy-hi3670-pcie.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/hisilicon/phy-hi3670-pcie.c b/drivers/phy/hisilicon/phy-hi3670-pcie.c
index 0ac9634b398da..6903148367dfc 100644
--- a/drivers/phy/hisilicon/phy-hi3670-pcie.c
+++ b/drivers/phy/hisilicon/phy-hi3670-pcie.c
@@ -565,6 +565,7 @@ static int hi3670_pcie_get_resources_from_pcie(struct hi3670_pcie_phy *phy)
}
pcie_dev = bus_find_device_by_of_node(&platform_bus_type, pcie_port);
+ of_node_put(pcie_port);
if (!pcie_dev) {
dev_err(dev, "Didn't find pcie device\n");
return -ENODEV;
@@ -579,6 +580,7 @@ static int hi3670_pcie_get_resources_from_pcie(struct hi3670_pcie_phy *phy)
* right regmap. So, let's use the named version.
*/
phy->apb = dev_get_regmap(pcie_dev, "kirin_pcie_apb");
+ put_device(pcie_dev);
if (!phy->apb) {
dev_err(dev, "Failed to get APB regmap\n");
return -ENODEV;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0409/1756] phy: cadence: Sierra: Do not modify register when getting parent clock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (407 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0408/1756] phy: hisilicon: hi3670: Fix OF node and device reference leaks Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0410/1756] memory: emif: fix device_node reference leak on np_ddr Greg Kroah-Hartman
` (589 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory CLEMENT,
Manivannan Sadhasivam, Neil Armstrong, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory CLEMENT <gregory.clement@bootlin.com>
[ Upstream commit 955e68eb3067842067b7b5395a3f8c278428802a ]
The get_parent() callback for the PLL_CMNLC1 clock was incorrectly
writing to the register while determining the parent clock index. This
unintended register access forces the PHY back into training mode. If
the PHY is already configured, this unexpected change prevents it from
exiting training mode.
Remove the register write operation to ensure the PHY remains stable
during the get_parent() callback.
Fixes: da08aab940092 ("phy: cadence: Sierra: Fix to get correct parent for mux clocks")
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260306-fix_sierra_get_parent-v2-1-cafe89ee5382@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/cadence/phy-cadence-sierra.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c
index dfc4f55d112e1..eac6819be8380 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -695,23 +695,16 @@ static const struct phy_ops noop_ops = {
static u8 cdns_sierra_pll_mux_get_parent(struct clk_hw *hw)
{
struct cdns_sierra_pll_mux *mux = to_cdns_sierra_pll_mux(hw);
- struct regmap_field *plllc1en_field = mux->plllc1en_field;
- struct regmap_field *termen_field = mux->termen_field;
struct regmap_field *field = mux->pfdclk_sel_preg;
unsigned int val;
int index;
regmap_field_read(field, &val);
- if (strstr(clk_hw_get_name(hw), clk_names[CDNS_SIERRA_PLL_CMNLC1])) {
+ if (strstr(clk_hw_get_name(hw), clk_names[CDNS_SIERRA_PLL_CMNLC1]))
index = clk_mux_val_to_index(hw, cdns_sierra_pll_mux_table[CMN_PLLLC1], 0, val);
- if (index == 1) {
- regmap_field_write(plllc1en_field, 1);
- regmap_field_write(termen_field, 1);
- }
- } else {
+ else
index = clk_mux_val_to_index(hw, cdns_sierra_pll_mux_table[CMN_PLLLC], 0, val);
- }
return index;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0410/1756] memory: emif: fix device_node reference leak on np_ddr
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (408 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0409/1756] phy: cadence: Sierra: Do not modify register when getting parent clock Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0411/1756] RDMA/rxe: Use validated num_sge in local buffer Greg Kroah-Hartman
` (588 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miles Krause, Krzysztof Kozlowski,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miles Krause <mileskrause5200@gmail.com>
[ Upstream commit 314ef67d673284d4c070455bd62d332f6d0f8634 ]
of_get_memory_device_details() takes a reference on the DDR device
node via of_parse_phandle() and stores it in emif->np_ddr for later
use, but drops that reference without calling of_node_put() on two
error paths: the devm_kzalloc() allocation-failure check and the
is_dev_data_valid() check. Both return NULL immediately, leaking the
node reference each time either failure triggers.
The same reference is also never released on the success path: it is
kept for the life of the bound device (compared against a later
instance's np_ddr in the duplicate-DDR-geometry check) but
emif_remove() never calls of_node_put() on it, leaking it every time
an EMIF device unbinds. of_node_put() on a NULL pointer is a no-op, so
this is also safe for the non-DT get_device_details() path, where
np_ddr is left NULL by devm_kzalloc().
Fixes: e6b42eb6a66c ("memory: emif: add device tree support to emif driver")
Signed-off-by: Miles Krause <mileskrause5200@gmail.com>
Link: https://patch.msgid.link/20260909-master-v1-1-8800f5647ab2@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/memory/emif.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index 99eb7d1baa5ff..e4f0f39b2a03b 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -921,6 +921,7 @@ static struct emif_data *of_get_memory_device_details(
if (!emif || !pd || !dev_info) {
dev_err(dev, "%s: Out of memory!!\n",
__func__);
+ of_node_put(np_ddr);
goto error;
}
@@ -945,6 +946,7 @@ static struct emif_data *of_get_memory_device_details(
pd->device_info->io_width, pd->phy_type, pd->ip_rev,
emif->dev)) {
dev_err(dev, "%s: invalid device data!!\n", __func__);
+ of_node_put(np_ddr);
goto error;
}
/*
@@ -1139,6 +1141,7 @@ static void emif_remove(struct platform_device *pdev)
struct emif_data *emif = platform_get_drvdata(pdev);
emif_debugfs_exit(emif);
+ of_node_put(emif->np_ddr);
}
static void emif_shutdown(struct platform_device *pdev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0411/1756] RDMA/rxe: Use validated num_sge in local buffer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (409 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0410/1756] memory: emif: fix device_node reference leak on np_ddr Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0412/1756] RDMA/uverbs: Make CQ handle mandatory for WQ creation Greg Kroah-Hartman
` (587 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhu Yanjun, Nicolas Morey,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Morey <nmorey@suse.com>
[ Upstream commit a4368022a3ac5324356ae8d88e3a42d115956fd6 ]
For both SRQ and non-SRQ receive paths, the WQE is copied into a local
buffer to provide a kernel-owned, validated copy. While calculating the
memcpy size from the validated num_sge prevents overflow during the
copy, memcpy() itself still copies num_sge from shared memory.
A concurrent userspace modification before or during memcpy() leaves
an unvalidated num_sge in the local buffer, leading to potential
out-of-bounds reads in rxe_resp_check_length() and copy_data() causing:
BUG: KASAN: slab-out-of-bounds in rxe_receiver+0x8109/0x9ec0 [rdma_rxe]
Read of size 4 at addr ffff88812c4867f8 by task kworker/u9:6/361
Workqueue: rxe_wq do_work [rdma_rxe]
Call Trace:
rxe_receiver+0x8109/0x9ec0 [rdma_rxe]
do_work+0x149/0x610 [rdma_rxe]
process_one_work+0x726/0x10a0
The buggy address belongs to the object at ffff88812c486000
which belongs to the cache kmalloc-part-13-2k of size 2048
The buggy address is located 0 bytes to the right of
allocated 2040-byte region [ffff88812c486000, ffff88812c4867f8)
Explicitly assign the validated num_sge to the local buffer after the
copy to prevent this race.
Fixes: 22b8fbded65b ("RDMA/rxe: Fix TOCTOU heap overflow in get_srq_wqe")
Fixes: d6ab440240a0 ("RDMA/rxe: Copy WQE to local buffer in non-SRQ receive path")
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
Link: https://patch.msgid.link/20260909160132.1491248-1-nmorey@suse.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/sw/rxe/rxe_resp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index abf6cf3ce986b..82bdd97ce69a3 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -287,6 +287,7 @@ static enum resp_states get_srq_wqe(struct rxe_qp *qp)
}
size = sizeof(*wqe) + num_sge * sizeof(struct rxe_sge);
memcpy(&qp->resp.srq_wqe, wqe, size);
+ qp->resp.srq_wqe.wqe.dma.num_sge = num_sge;
qp->resp.wqe = &qp->resp.srq_wqe.wqe;
queue_advance_consumer(q, QUEUE_TYPE_FROM_CLIENT);
@@ -327,6 +328,7 @@ static enum resp_states rxe_get_recv_wqe(struct rxe_qp *qp)
}
size = sizeof(*wqe) + num_sge * sizeof(struct rxe_sge);
memcpy(&qp->resp.srq_wqe, wqe, size);
+ qp->resp.srq_wqe.wqe.dma.num_sge = num_sge;
qp->resp.wqe = &qp->resp.srq_wqe.wqe;
return RESPST_CHK_LENGTH;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0412/1756] RDMA/uverbs: Make CQ handle mandatory for WQ creation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (410 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0411/1756] RDMA/rxe: Use validated num_sge in local buffer Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0413/1756] media: i2c: ar0521: remove duplicate media entity cleanup Greg Kroah-Hartman
` (586 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Kalesh AP,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit f7d28791433d373ecdab7b00f60ddb504e858e0a ]
UVERBS_ATTR_CREATE_WQ_CQ_HANDLE is declared UA_OPTIONAL in the ioctl
method definition, so the mandatory attribute bitmap does not enforce
its presence. When userspace omits it, uverbs_attr_get_obj() returns
ERR_PTR(-ENOENT) and the handler stores that error pointer into
wq_init_attr.cq without validation.
The bogus cq pointer is then passed to the driver's create_wq callback.
In the mlx5 case, create_rq() calls to_mcq(init_attr->cq) which applies
container_of to the ERR_PTR value, producing a near-NULL pointer. The
subsequent access in get_rq_ts_format() triggers a kernel NULL pointer
dereference:
BUG: kernel NULL pointer dereference, address: 0000000000000296
RIP: 0010:create_rq+0x32/0x550 [mlx5_ib]
Call Trace:
mlx5_ib_create_wq+0x14a/0x210 [mlx5_ib]
ib_uverbs_handler_UVERBS_METHOD_WQ_CREATE+0x1f0/0x320 [ib_uverbs]
ib_uverbs_run_method+0x296/0x320 [ib_uverbs]
ib_uverbs_cmd_verbs+0x1a0/0x260 [ib_uverbs]
ib_uverbs_ioctl+0xa8/0x120 [ib_uverbs]
A WQ without a CQ was never valid; the legacy write path always required
one via uobj_get_obj_read() in ib_uverbs_ex_create_wq(). Declare the
attribute UA_MANDATORY so the uverbs framework rejects the ioctl early
when the CQ handle is missing, before the handler ever runs.
Fixes: ef3bc084a8ed ("IB/uverbs: Introduce create/destroy WQ commands over ioctl")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260911021557.2113-1-lirongqing@baidu.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/uverbs_std_types_wq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/uverbs_std_types_wq.c b/drivers/infiniband/core/uverbs_std_types_wq.c
index 7ded8339346f3..c23f455231bf0 100644
--- a/drivers/infiniband/core/uverbs_std_types_wq.c
+++ b/drivers/infiniband/core/uverbs_std_types_wq.c
@@ -140,7 +140,7 @@ DECLARE_UVERBS_NAMED_METHOD(
UVERBS_ATTR_IDR(UVERBS_ATTR_CREATE_WQ_CQ_HANDLE,
UVERBS_OBJECT_CQ,
UVERBS_ACCESS_READ,
- UA_OPTIONAL),
+ UA_MANDATORY),
UVERBS_ATTR_FD(UVERBS_ATTR_CREATE_WQ_EVENT_FD,
UVERBS_OBJECT_ASYNC_EVENT,
UVERBS_ACCESS_READ,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0413/1756] media: i2c: ar0521: remove duplicate media entity cleanup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (411 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0412/1756] RDMA/uverbs: Make CQ handle mandatory for WQ creation Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0414/1756] block: Fix the thaw_bdev reference in bdev_freeze() kernel-doc Greg Kroah-Hartman
` (585 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Sakari Ailus,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 069a0343581bfcaee44bc598e2b95be2e2789807 ]
The error path taken when ar0521_power_on() fails calls
media_entity_cleanup() at the disable label and then falls through to
the entity_cleanup label, where media_entity_cleanup() is called again.
There is no need to clean up the media entity twice. Remove the first
call and let all error paths converge on the common entity_cleanup
label.
This issue was found by manual code inspection.
Fixes: 852b50aeed15 ("media: On Semi AR0521 sensor driver")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ar0521.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c
index 24873149096c1..ca5bc1894bc40 100644
--- a/drivers/media/i2c/ar0521.c
+++ b/drivers/media/i2c/ar0521.c
@@ -1140,7 +1140,6 @@ static int ar0521_probe(struct i2c_client *client)
disable:
v4l2_async_unregister_subdev(&sensor->sd);
- media_entity_cleanup(&sensor->sd.entity);
free_ctrls:
v4l2_ctrl_handler_free(&sensor->ctrls.handler);
entity_cleanup:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0414/1756] block: Fix the thaw_bdev reference in bdev_freeze() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (412 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0413/1756] media: i2c: ar0521: remove duplicate media entity cleanup Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0415/1756] remoteproc: core: Set trace buffer name for diagnostics Greg Kroah-Hartman
` (584 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Darrick J. Wong,
Christian Brauner (Amutable), Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit e14c3379be86854c203de1e0fdfdeaa0b45509df ]
The kernel-doc comment of bdev_freeze() refers to thaw_bdev, which was
renamed to bdev_thaw by commit 982c3b305843 ("bdev: rename freeze and
thaw helpers"). Say bdev_thaw.
Fixes: 982c3b305843 ("bdev: rename freeze and thaw helpers")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christian Brauner (Amutable) <brauner@kernel.org>
Link: https://patch.msgid.link/20260911233415.31271-1-kmehltretter@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/bdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/bdev.c b/block/bdev.c
index a1399a1bf9ac5..57aa344dc04a5 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -253,7 +253,7 @@ EXPORT_SYMBOL(sync_blockdev_range);
* The reference counter (bd_fsfreeze_count) guarantees that only the last
* unfreeze process can unfreeze the frozen filesystem actually when multiple
* freeze requests arrive simultaneously. It counts up in bdev_freeze() and
- * count down in bdev_thaw(). When it becomes 0, thaw_bdev() will unfreeze
+ * count down in bdev_thaw(). When it becomes 0, bdev_thaw() will unfreeze
* actually.
*
* Return: On success zero is returned, negative error code on failure.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0415/1756] remoteproc: core: Set trace buffer name for diagnostics
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (413 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0414/1756] block: Fix the thaw_bdev reference in bdev_freeze() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0416/1756] dmaengine: mv_xor: kill tasklet on channel add error path Greg Kroah-Hartman
` (583 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yonghao Zhang, Mathieu Poirier,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yonghao Zhang <hyz3367@gmail.com>
[ Upstream commit e23eab619b0d2dd796618406ba25da62f4d539a2 ]
rproc_trace_read() (in remoteproc_debugfs.c) prints the name of a
trace buffer whose device address could not be resolved, but nothing
ever assigns trace_mem.name, so that the diagnostics always prints
an empty string:
Trace not available
Copy the generated "trace%d" name into the memory entry, so the
diagnostics identifies the buffer failed to translate.
Fixes: a987e6b91a5a ("remoteproc: fix trace buffer va initialization")
Assisted-by: Claude-Code:glm-5.3
Signed-off-by: Yonghao Zhang <hyz3367@gmail.com>
Link: https://lore.kernel.org/r/20260911081810.740028-1-hyz3367@gmail.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/remoteproc_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 323d368d455c5..172e25241c834 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -579,6 +579,9 @@ static int rproc_handle_trace(struct rproc *rproc, void *ptr,
/* create the debugfs entry */
trace->tfile = rproc_create_trace_file(name, rproc, trace);
+ /* keep the name for the diagnostic in rproc_trace_read() */
+ strscpy(trace->trace_mem.name, name, sizeof(trace->trace_mem.name));
+
list_add_tail(&trace->node, &rproc->traces);
rproc->num_traces++;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0416/1756] dmaengine: mv_xor: kill tasklet on channel add error path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (414 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0415/1756] remoteproc: core: Set trace buffer name for diagnostics Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0417/1756] loadpin: Fix stale KEXEC_VERIFY_SIG reference in documentation Greg Kroah-Hartman
` (582 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit bcb4d469b19d53dc21e4a1da12d4438e7489e150 ]
If request_irq() succeeds but a later step (self-test or device
registration) fails, the error path at err_free_irq frees the IRQ
but does not kill the tasklet. A previously scheduled tasklet can
still run after the channel is freed, accessing freed memory.
Add tasklet_kill() after free_irq() on the error path.
Fixes: ff7b04796d98 ("dmaengine: DMA engine driver for Marvell XOR engine")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260909234601.101883-1-rosenp@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/mv_xor.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 33716794d50e2..c03b31a2b8453 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1162,6 +1162,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
err_free_irq:
free_irq(mv_chan->irq, mv_chan);
+ tasklet_kill(&mv_chan->irq_tasklet);
err_free_dma:
dma_free_wc(&pdev->dev, MV_XOR_POOL_SIZE,
mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0417/1756] loadpin: Fix stale KEXEC_VERIFY_SIG reference in documentation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (415 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0416/1756] dmaengine: mv_xor: kill tasklet on channel add error path Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0418/1756] wifi: rtw88: sdio: zero the padding added to a TX transfer Greg Kroah-Hartman
` (581 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Randy Dunlap,
Jonathan Corbet, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit eb0b0d222a832b6ec851e56d4922a775ac762955 ]
Commit 99d5cadfde2b ("kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG
and KEXEC_SIG_FORCE") removed CONFIG_KEXEC_VERIFY_SIG but left the
LoadPin documentation pointing at it. Refer to CONFIG_KEXEC_SIG instead.
While at it, clean up the grammar of the sentence.
Fixes: 99d5cadfde2b ("kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260905013655.58665-1-kmehltretter@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/admin-guide/LSM/LoadPin.rst | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/LSM/LoadPin.rst b/Documentation/admin-guide/LSM/LoadPin.rst
index dd3ca68b5df18..a90fd9dac9606 100644
--- a/Documentation/admin-guide/LSM/LoadPin.rst
+++ b/Documentation/admin-guide/LSM/LoadPin.rst
@@ -23,9 +23,9 @@ sysctl allows for easy testing on systems with a mutable filesystem.)
It's also possible to exclude specific file types from LoadPin using kernel
command line option "``loadpin.exclude``". By default, all files are
included, but they can be excluded using kernel command line option such
-as "``loadpin.exclude=kernel-module,kexec-image``". This allows to use
+as "``loadpin.exclude=kernel-module,kexec-image``". This allows using
different mechanisms such as ``CONFIG_MODULE_SIG`` and
-``CONFIG_KEXEC_VERIFY_SIG`` to verify kernel module and kernel image while
-still use LoadPin to protect the integrity of other files kernel loads. The
-full list of valid file types can be found in ``kernel_read_file_str``
-defined in ``include/linux/kernel_read_file.h``.
+``CONFIG_KEXEC_SIG`` to verify kernel modules and kernel images while
+still using LoadPin to protect the integrity of other files the kernel
+loads. The full list of valid file types can be found in
+``kernel_read_file_str`` defined in ``include/linux/kernel_read_file.h``.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0418/1756] wifi: rtw88: sdio: zero the padding added to a TX transfer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (416 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0417/1756] loadpin: Fix stale KEXEC_VERIFY_SIG reference in documentation Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0419/1756] ntfs3: fix out-of-bounds read in ntfs_read_mft() Greg Kroah-Hartman
` (580 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Luka Gejak, Ping-Ke Shih,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luka Gejak <luka.gejak@linux.dev>
[ Upstream commit b81ead28aeb1fd9bc3b0de4e20342b6b538ac658 ]
rtw_sdio_write_port() rounds the transfer up with sdio_align_size() and
then hands that length to sdio_memcpy_toio() while the skb still only
holds skb->len bytes. The difference, between one and 511 bytes, is read
from beyond the end of the frame and transmitted. Whether it stays
inside the skb's allocation depends on how much tailroom the skb happens
to have, so this is at best sending uninitialised memory over the air.
Pad the skb up to the transfer size first. __skb_pad() zeroes the added
bytes, reallocates a cloned skb rather than writing into a buffer a
clone still shares, and leaves skb->len alone, so nothing else in the
transmit path has to change.
It must not free the skb on failure: rtw_sdio_write_data() frees the skb
itself and rtw_sdio_process_tx_queue() requeues it, so both callers
still own it and would double free.
Found while reworking this path for the RTL8723BS. Measured on RTL8723BS
hardware, padding the transfer costs about 2% observable over transfer:
uplink is 19.5 to 19.8 Mbit/s padded against 20.9 to 21.1 Mbit/s unpadded
in an interleaved A/B, with scans, reconnection and a UDP flood clean in
both. The other SDIO parts sharing this path are untested; I have only the
RTL8723BS.
Fixes: 65371a3f14e7 ("wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets")
Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260909074556.55709-5-luka.gejak@linux.dev
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/realtek/rtw88/sdio.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
index d8db341a57315..cc0c4d97b7288 100644
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -636,6 +636,7 @@ static int rtw_sdio_write_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
enum rtw_tx_queue_type queue)
{
struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ size_t pad_size;
bool bus_claim;
size_t txsize;
u32 txaddr;
@@ -646,6 +647,17 @@ static int rtw_sdio_write_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
return -EINVAL;
txsize = sdio_align_size(rtwsdio->sdio_func, skb->len);
+ pad_size = txsize - skb->len;
+
+ if (pad_size > 0) {
+ /*
+ * __skb_pad() must not free the skb on failure: both callers
+ * still own it, one requeues it and the other frees it.
+ */
+ ret = __skb_pad(skb, pad_size, false);
+ if (ret)
+ return ret;
+ }
ret = rtw_sdio_check_free_txpg(rtwdev, queue, txsize);
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0419/1756] ntfs3: fix out-of-bounds read in ntfs_read_mft()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (417 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0418/1756] wifi: rtw88: sdio: zero the padding added to a TX transfer Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0420/1756] mm/gup_test: reject wrapped user ranges Greg Kroah-Hartman
` (579 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiang Mei, Weiming Shi,
Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <bestswngs@gmail.com>
[ Upstream commit 7a374d9be8267834dc534e55f01e5e01765cab4c ]
ntfs_read_mft() walks the attributes of an MFT record and, for each
FILE_NAME attribute, compares the resident on-disk name with the name
being looked up. The only size check before the compare is
rsize >= SIZEOF_ATTRIBUTE_FILENAME, which covers the fixed header up to
and including name_len, but not the variable-length name that follows it.
name_len comes straight from disk and is not validated against the
resident data_size. A crafted image can set name_len large while keeping
data_size at the header size, so ntfs_cmp_names_cpu() reads name_len
le16 characters past the end of the MFT record buffer:
BUG: KASAN: slab-out-of-bounds in ntfs_cmp_names_cpu (fs/ntfs3/upcase.c:84)
Read of size 2 at addr ffff888031879c00 by task a.out
ntfs_cmp_names_cpu (fs/ntfs3/upcase.c:84)
ntfs_iget5 (fs/ntfs3/inode.c:209)
dir_search_u (fs/ntfs3/dir.c:265)
ntfs_lookup (fs/ntfs3/namei.c:85)
__lookup_slow (fs/namei.c:1915)
lookup_slow (fs/namei.c:1932)
path_lookupat (fs/namei.c:2278)
vfs_statx (fs/stat.c)
vfs_fstatat (fs/stat.c)
__do_sys_newfstatat (fs/stat.c)
Allocated by task:
mi_init (fs/ntfs3/record.c)
ntfs_iget5 (fs/ntfs3/inode.c)
dir_search_u (fs/ntfs3/dir.c)
ntfs_lookup (fs/ntfs3/namei.c)
Check that the name fits in the resident data before using it.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Reported-by: Xiang Mei <xmei5@asu.edu>
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/inode.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index b371f897bcf4c..730c2ab665808 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -208,6 +208,11 @@ static struct inode *ntfs_read_mft(struct inode *inode,
names += 1;
fname = Add2Ptr(attr, roff);
+
+ /* Make sure the full name fits in the resident data. */
+ if (rsize < fname_full_size(fname))
+ goto out;
+
if (fname->type == FILE_NAME_DOS)
goto next_attr;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0420/1756] mm/gup_test: reject wrapped user ranges
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (418 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0419/1756] ntfs3: fix out-of-bounds read in ntfs_read_mft() Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0421/1756] mm/gup_test: safely calculate GUP batch size Greg Kroah-Hartman
` (578 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Samuel Moelius,
David Hildenbrand (Arm), Jason Gunthorpe, John Hubbard, Peter Xu,
Andrew Morton, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Moelius <sam.moelius@trailofbits.com>
[ Upstream commit e8ae6fd67021fafa9205330b3b248c9fc7216e0b ]
gup_test accepts an address and size from the debugfs ioctl and repeatedly
compares against addr + size. If that addition wraps, the loop can be
skipped and the ioctl returns success with size rewritten to zero.
Compute the end address once with overflow checking and use that checked
end for the loop bounds.
Assisted-by: Codex:gpt-5.5-cyber-preview
Link: https://lore.kernel.org/20260609004814.1240586.6294d614ac80.gup-test-range-end-wrap@trailofbits.com
Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 44817a536aaa ("mm/gup_test: safely calculate GUP batch size")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/gup_test.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/mm/gup_test.c b/mm/gup_test.c
index eeb3f4d87c510..c9e7c1cf5b080 100644
--- a/mm/gup_test.c
+++ b/mm/gup_test.c
@@ -104,11 +104,15 @@ static int __gup_test_ioctl(unsigned int cmd,
unsigned long i, nr_pages, addr, next;
long nr;
struct page **pages;
+ unsigned long end;
int ret = 0;
bool needs_mmap_lock =
cmd != GUP_FAST_BENCHMARK && cmd != PIN_FAST_BENCHMARK;
- if (gup->size > ULONG_MAX)
+ if (gup->addr > ULONG_MAX || gup->size > ULONG_MAX)
+ return -EINVAL;
+ if (check_add_overflow((unsigned long)gup->addr,
+ (unsigned long)gup->size, &end))
return -EINVAL;
nr_pages = gup->size / PAGE_SIZE;
@@ -124,13 +128,13 @@ static int __gup_test_ioctl(unsigned int cmd,
i = 0;
nr = gup->nr_pages_per_call;
start_time = ktime_get();
- for (addr = gup->addr; addr < gup->addr + gup->size; addr = next) {
+ for (addr = gup->addr; addr < end; addr = next) {
if (nr != gup->nr_pages_per_call)
break;
next = addr + nr * PAGE_SIZE;
- if (next > gup->addr + gup->size) {
- next = gup->addr + gup->size;
+ if (next > end) {
+ next = end;
nr = (next - addr) / PAGE_SIZE;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0421/1756] mm/gup_test: safely calculate GUP batch size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (419 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0420/1756] mm/gup_test: reject wrapped user ranges Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0422/1756] mm/gup_test: report actual pinned bytes Greg Kroah-Hartman
` (577 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kiryl Shutsemau (Meta),
Sarthak Sharma, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarthak Sharma <sarthak.sharma@arm.com>
[ Upstream commit 44817a536aaa5bfac0d316242e93e489d0a69d5f ]
__gup_test_ioctl() calculates the end of a GUP batch using:
next = addr + nr * PAGE_SIZE;
If nr is too large, it can cause next to overflow and wrap around.
If it wraps, the next > end check is bypassed and a large value
of nr is passed to the GUP call, even though the pages array was
allocated according to gup->size. This can lead to out of bounds writes.
Also, when fewer than PAGE_SIZE bytes remain, the calculated batch
contains zero pages. The code still calls GUP functions with pages + i,
which can point past the allocated array.
Calculate nr by taking the minimum of the number of pages per call and
the pages remaining in the address range. Reject zero sized and non
page aligned gup->size values and zero nr_pages_per_call value.
Fixes: 64c349f4ae78 ("mm: add infrastructure for get_user_pages_fast() benchmarking")
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Signed-off-by: Sarthak Sharma <sarthak.sharma@arm.com>
Link: https://patch.msgid.link/20260915102524.125758-1-sarthak.sharma@arm.com
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/gup_test.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/gup_test.c b/mm/gup_test.c
index c9e7c1cf5b080..6de8064090ea1 100644
--- a/mm/gup_test.c
+++ b/mm/gup_test.c
@@ -109,7 +109,8 @@ static int __gup_test_ioctl(unsigned int cmd,
bool needs_mmap_lock =
cmd != GUP_FAST_BENCHMARK && cmd != PIN_FAST_BENCHMARK;
- if (gup->addr > ULONG_MAX || gup->size > ULONG_MAX)
+ if (gup->addr > ULONG_MAX || gup->size > ULONG_MAX || !gup->size ||
+ !gup->nr_pages_per_call || !PAGE_ALIGNED(gup->size))
return -EINVAL;
if (check_add_overflow((unsigned long)gup->addr,
(unsigned long)gup->size, &end))
@@ -132,11 +133,9 @@ static int __gup_test_ioctl(unsigned int cmd,
if (nr != gup->nr_pages_per_call)
break;
+ nr = min_t(unsigned long, nr, (end - addr) / PAGE_SIZE);
+
next = addr + nr * PAGE_SIZE;
- if (next > end) {
- next = end;
- nr = (next - addr) / PAGE_SIZE;
- }
switch (cmd) {
case GUP_FAST_BENCHMARK:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0422/1756] mm/gup_test: report actual pinned bytes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (420 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0421/1756] mm/gup_test: safely calculate GUP batch size Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0423/1756] arm64: dts: mediatek: mt8173: Fix MFG_ASYNC power domain clock Greg Kroah-Hartman
` (576 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kiryl Shutsemau (Meta),
Sarthak Sharma, David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarthak Sharma <sarthak.sharma@arm.com>
[ Upstream commit 65a79b9b693d8c7bd7e5e4865c02cce922a7cc50 ]
__gup_test_ioctl() advances addr to the end of the current batch before
checking if GUP pinned the entire requested batch. If GUP pins more than
0 pages but less than the requested batch size, addr still advances by
the requested batch size.
The next iteration detects the partial pinning and breaks out of the loop.
Again gup->size is calculated using addr - gup->addr, so it also includes
the unpinned pages of the requested batch.
Calculate gup->size using the actual number of pages pinned multiplied
by PAGE_SIZE.
Fixes: 64c349f4ae78 ("mm: add infrastructure for get_user_pages_fast() benchmarking")
Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>
Signed-off-by: Sarthak Sharma <sarthak.sharma@arm.com>
Link: https://patch.msgid.link/20260901083452.115365-3-sarthak.sharma@arm.com
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/gup_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/gup_test.c b/mm/gup_test.c
index 6de8064090ea1..6014bbf2aadeb 100644
--- a/mm/gup_test.c
+++ b/mm/gup_test.c
@@ -180,7 +180,7 @@ static int __gup_test_ioctl(unsigned int cmd,
nr_pages = i;
gup->get_delta_usec = ktime_us_delta(end_time, start_time);
- gup->size = addr - gup->addr;
+ gup->size = nr_pages * PAGE_SIZE;
/*
* Take an un-benchmark-timed moment to verify DMA pinned
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0423/1756] arm64: dts: mediatek: mt8173: Fix MFG_ASYNC power domain clock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (421 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0422/1756] mm/gup_test: report actual pinned bytes Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0424/1756] ACPI: tables: handle failed initrd override mappings Greg Kroah-Hartman
` (575 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AngeloGioacchino Del Regno,
Icenowy Zheng, Chen-Yu Tsai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wenst@chromium.org>
[ Upstream commit c9b3c82c9f1f86cdb2449d47e4ca66a19159ee12 ]
The MFG_ASYNC domain, which is likely associated to the whole MFG block,
currently specifies clk26m as its domain clock. This is bogus, since the
clock is an external crystal with no controls. Also, the MFG block has
a independent CLK_TOP_AXI_MFG_IN_SEL clock, which according to the block
diagram, gates access to the hardware registers. Having this one as the
domain clock makes much more sense. This also fixes access to the MFGTOP
registers.
Change the MFG_ASYNC domain clock to CLK_TOP_AXI_MFG_IN_SEL.
Fixes: 8b6562644df9 ("arm64: dts: mediatek: Add mt8173 power domain controller")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index f49ec74959060..4fcd3e6c5f076 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -497,7 +497,7 @@ power-domain@MT8173_POWER_DOMAIN_USB {
};
mfg_async: power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>;
- clocks = <&clk26m>;
+ clocks = <&topckgen CLK_TOP_AXI_MFG_IN_SEL>;
clock-names = "mfg";
#address-cells = <1>;
#size-cells = <0>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0424/1756] ACPI: tables: handle failed initrd override mappings
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (422 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0423/1756] arm64: dts: mediatek: mt8173: Fix MFG_ASYNC power domain clock Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0425/1756] cxl/hdm: Reject switch decoder interleave ways that overflow targets Greg Kroah-Hartman
` (574 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Slavin Liu, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <bolin.liu@seu.edu.cn>
[ Upstream commit 047c834d939df75386cfc0603c7ddeaa23a349a4 ]
The runtime AML table-loading path can invoke initrd override after
permanent mappings are enabled. Mapping bookkeeping can then fail.
Return AE_NO_MEMORY in that case to prevent a NULL pointer dereference
when attempting to read the table length.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: b2a35003dfbc ("ACPI: Implement physical address table override")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
[ rjw: Added empty code line after conditional, changelog edits ]
Link: https://patch.msgid.link/20260913125123.109803-1-bolin.liu@seu.edu.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/tables.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 9e1b01c350702..75f570d66ece7 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -559,6 +559,9 @@ acpi_table_initrd_override(struct acpi_table_header *existing_table,
while (table_offset + ACPI_HEADER_SIZE <= all_tables_size) {
table = acpi_os_map_memory(acpi_tables_addr + table_offset,
ACPI_HEADER_SIZE);
+ if (!table)
+ return AE_NO_MEMORY;
+
if (table_offset + table->length > all_tables_size) {
acpi_os_unmap_memory(table, ACPI_HEADER_SIZE);
WARN_ON(1);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0425/1756] cxl/hdm: Reject switch decoder interleave ways that overflow targets
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (423 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0424/1756] ACPI: tables: handle failed initrd override mappings Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0426/1756] cxl: Add a cached copy of target_map to cxl_decoder Greg Kroah-Hartman
` (573 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Davidlohr Bueso, Richard Cheng,
Alison Schofield, Li Ming, Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 3696326ca14cf018788d64232a068fdf26b1ff31 ]
Switch decoder enumeration validates that the interleave ways encoding
is legal, but not that the resulting number of ways fits the available
targets. This can overrun the target array (target_list.target_id[])
during enumeration of 12 or 16 way interleaves.
Bound the target count where it is established rather than at each use.
Reject an HDM capability whose reported target count is zero or exceeds
the target list register capacity, and reject a zero target switch
decoder allocation in cxl_switch_decoder_init(). Enumeration is then
left with a single check: reject a decoder whose interleave ways exceed
the targets it has.
Add a clarifying comment that target_count is a direct count, not
0-based like decoder_count.
Link: https://sashiko.dev/#/patchset/20260711180755.1779002-1-alison.schofield@intel.com?part=1
Fixes: d17d0540a0db ("cxl/core/hdm: Add CXL standard decoder enumeration to the core")
Tested-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Link: https://patch.msgid.link/af094094813d7f51d86cbf608936270b7d85526e.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/hdm.c | 24 ++++++++++++++++++++++++
drivers/cxl/core/port.c | 2 +-
drivers/cxl/cxl.h | 2 ++
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 5b4ddc1262d7c..1e3b485c89051 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -81,6 +81,8 @@ static void parse_hdm_decoder_caps(struct cxl_hdm *cxlhdm)
hdm_cap = readl(cxlhdm->regs.hdm_decoder + CXL_HDM_DECODER_CAP_OFFSET);
cxlhdm->decoder_count = cxl_hdm_decoder_count(hdm_cap);
+
+ /* target_count is a direct count (1h..8h), not 0-based like decoder_count */
cxlhdm->target_count =
FIELD_GET(CXL_HDM_DECODER_TARGET_COUNT_MASK, hdm_cap);
if (FIELD_GET(CXL_HDM_DECODER_INTERLEAVE_11_8, hdm_cap))
@@ -938,6 +940,16 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
cxld->interleave_ways, cxld->interleave_granularity);
if (!cxled) {
+ struct cxl_switch_decoder *cxlsd = to_cxl_switch_decoder(&cxld->dev);
+
+ if (cxld->interleave_ways > cxlsd->nr_targets) {
+ dev_err(&port->dev,
+ "decoder%d.%d: interleave ways: %d exceeds targets: %d\n",
+ port->id, cxld->id, cxld->interleave_ways,
+ cxlsd->nr_targets);
+ return -ENXIO;
+ }
+
lo = readl(hdm + CXL_HDM_DECODER0_TL_LOW(which));
hi = readl(hdm + CXL_HDM_DECODER0_TL_HIGH(which));
target_list.value = (hi << 32) + lo;
@@ -1015,6 +1027,18 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
int i;
u64 dpa_base = 0;
+ /*
+ * Per CXL 4.0 8.2.4.20.1 Target Count is the number of target ports
+ * per decoder, max 8. Endpoint decoders have no targets.
+ */
+ if (!is_cxl_endpoint(port) &&
+ (cxlhdm->target_count < 1 ||
+ cxlhdm->target_count > CXL_HDM_DECODER0_TL_TARGETS)) {
+ dev_err(&port->dev, "Invalid decoder target count: %u\n",
+ cxlhdm->target_count);
+ return -ENXIO;
+ }
+
cxl_settle_decoders(cxlhdm);
for (i = 0; i < cxlhdm->decoder_count; i++) {
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 9c5835eaa22d7..723574f58f48c 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -1787,7 +1787,7 @@ static int cxl_switch_decoder_init(struct cxl_port *port,
struct cxl_switch_decoder *cxlsd,
int nr_targets)
{
- if (nr_targets > CXL_DECODER_MAX_INTERLEAVE)
+ if (nr_targets < 1 || nr_targets > CXL_DECODER_MAX_INTERLEAVE)
return -EINVAL;
cxlsd->nr_targets = nr_targets;
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index e2b7e398d4d57..22cd757b71936 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -65,6 +65,8 @@ extern const struct nvdimm_security_ops *cxl_security_ops;
#define CXL_HDM_DECODER0_CTRL_HOSTONLY BIT(12)
#define CXL_HDM_DECODER0_TL_LOW(i) (0x20 * (i) + 0x24)
#define CXL_HDM_DECODER0_TL_HIGH(i) (0x20 * (i) + 0x28)
+/* Target list capacity, i.e. max interleave ways for a non-endpoint decoder */
+#define CXL_HDM_DECODER0_TL_TARGETS 8
#define CXL_HDM_DECODER0_SKIP_LOW(i) CXL_HDM_DECODER0_TL_LOW(i)
#define CXL_HDM_DECODER0_SKIP_HIGH(i) CXL_HDM_DECODER0_TL_HIGH(i)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0426/1756] cxl: Add a cached copy of target_map to cxl_decoder
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (424 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0425/1756] cxl/hdm: Reject switch decoder interleave ways that overflow targets Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0427/1756] cxl/hdm: Make switch decoder target parsing endian-safe Greg Kroah-Hartman
` (572 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Robert Richter, Jonathan Cameron,
Alison Schofield, Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 02edab6ceefaaf8cb917e864d8c26dbac0ea9686 ]
Add a cached copy of the hardware port-id list that is available at init
before all @dport objects have been instantiated. Change is in preparation
of delayed dport instantiation.
Reviewed-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Tested-by: Robert Richter <rrichter@amd.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Stable-dep-of: 3f846646b3d3 ("cxl/hdm: Make switch decoder target parsing endian-safe")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/acpi.c | 7 +++----
drivers/cxl/core/hdm.c | 20 ++++++++------------
drivers/cxl/core/port.c | 22 +++++++---------------
drivers/cxl/core/region.c | 4 +++-
drivers/cxl/cxl.h | 8 ++++++--
tools/testing/cxl/test/cxl.c | 8 ++++----
6 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 01cc06a75e111..84b5986d1ebfc 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -349,7 +349,6 @@ DEFINE_FREE(del_cxl_resource, struct resource *, if (_T) del_cxl_resource(_T))
static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
struct cxl_cfmws_context *ctx)
{
- int target_map[CXL_DECODER_MAX_INTERLEAVE];
struct cxl_port *root_port = ctx->root_port;
struct cxl_cxims_context cxims_ctx;
struct device *dev = ctx->dev;
@@ -367,8 +366,6 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
rc = eig_to_granularity(cfmws->granularity, &ig);
if (rc)
return rc;
- for (i = 0; i < ways; i++)
- target_map[i] = cfmws->interleave_targets[i];
struct resource *res __free(del_cxl_resource) = alloc_cxl_resource(
cfmws->base_hpa, cfmws->window_size, ctx->id++);
@@ -394,6 +391,8 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
.end = cfmws->base_hpa + cfmws->window_size - 1,
};
cxld->interleave_ways = ways;
+ for (i = 0; i < ways; i++)
+ cxld->target_map[i] = cfmws->interleave_targets[i];
/*
* Minimize the x1 granularity to advertise support for any
* valid region granularity
@@ -424,7 +423,7 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
if (cfmws->interleave_arithmetic == ACPI_CEDT_CFMWS_ARITHMETIC_XOR)
cxlrd->hpa_to_spa = cxl_xor_hpa_to_spa;
- rc = cxl_decoder_add(cxld, target_map);
+ rc = cxl_decoder_add(cxld);
if (rc)
return rc;
return cxl_root_decoder_autoremove(dev, no_free_ptr(cxlrd));
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 1e3b485c89051..a4b81f9ce8ab2 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -18,12 +18,11 @@
DECLARE_RWSEM(cxl_dpa_rwsem);
-static int add_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
- int *target_map)
+static int add_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld)
{
int rc;
- rc = cxl_decoder_add_locked(cxld, target_map);
+ rc = cxl_decoder_add_locked(cxld);
if (rc) {
put_device(&cxld->dev);
dev_err(&port->dev, "Failed to add decoder\n");
@@ -50,7 +49,6 @@ int devm_cxl_add_passthrough_decoder(struct cxl_port *port)
{
struct cxl_switch_decoder *cxlsd;
struct cxl_dport *dport = NULL;
- int single_port_map[1];
unsigned long index;
struct cxl_hdm *cxlhdm = dev_get_drvdata(&port->dev);
@@ -69,9 +67,9 @@ int devm_cxl_add_passthrough_decoder(struct cxl_port *port)
xa_for_each(&port->dports, index, dport)
break;
- single_port_map[0] = dport->port_id;
+ cxlsd->cxld.target_map[0] = dport->port_id;
- return add_hdm_decoder(port, &cxlsd->cxld, single_port_map);
+ return add_hdm_decoder(port, &cxlsd->cxld);
}
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_passthrough_decoder, CXL);
@@ -825,7 +823,7 @@ static int cxl_setup_hdm_decoder_from_dvsec(
}
static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
- int *target_map, void __iomem *hdm, int which,
+ void __iomem *hdm, int which,
u64 *dpa_base, struct cxl_endpoint_dvsec_info *info)
{
struct cxl_endpoint_decoder *cxled = NULL;
@@ -954,7 +952,7 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
hi = readl(hdm + CXL_HDM_DECODER0_TL_HIGH(which));
target_list.value = (hi << 32) + lo;
for (i = 0; i < cxld->interleave_ways; i++)
- target_map[i] = target_list.target_id[i];
+ cxld->target_map[i] = target_list.target_id[i];
return 0;
}
@@ -1042,7 +1040,6 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
cxl_settle_decoders(cxlhdm);
for (i = 0; i < cxlhdm->decoder_count; i++) {
- int target_map[CXL_DECODER_MAX_INTERLEAVE] = { 0 };
int rc, target_count = cxlhdm->target_count;
struct cxl_decoder *cxld;
@@ -1070,8 +1067,7 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
cxld = &cxlsd->cxld;
}
- rc = init_hdm_decoder(port, cxld, target_map, hdm, i,
- &dpa_base, info);
+ rc = init_hdm_decoder(port, cxld, hdm, i, &dpa_base, info);
if (rc) {
dev_warn(&port->dev,
"Failed to initialize decoder%d.%d\n",
@@ -1079,7 +1075,7 @@ int devm_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
put_device(&cxld->dev);
return rc;
}
- rc = add_hdm_decoder(port, cxld, target_map);
+ rc = add_hdm_decoder(port, cxld);
if (rc) {
dev_warn(&port->dev,
"Failed to add decoder%d.%d\n", port->id, i);
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 723574f58f48c..5b586c60c77fe 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -1715,13 +1715,11 @@ struct cxl_port *cxl_mem_find_port(struct cxl_memdev *cxlmd,
EXPORT_SYMBOL_NS_GPL(cxl_mem_find_port, CXL);
static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
- struct cxl_port *port, int *target_map)
+ struct cxl_port *port)
{
+ struct cxl_decoder *cxld = &cxlsd->cxld;
int i;
- if (!target_map)
- return 0;
-
device_lock_assert(&port->dev);
if (xa_empty(&port->dports))
@@ -1729,7 +1727,7 @@ static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
guard(rwsem_write)(&cxl_region_rwsem);
for (i = 0; i < cxlsd->cxld.interleave_ways; i++) {
- struct cxl_dport *dport = find_dport(port, target_map[i]);
+ struct cxl_dport *dport = find_dport(port, cxld->target_map[i]);
if (!dport)
return -ENXIO;
@@ -1921,9 +1919,6 @@ EXPORT_SYMBOL_NS_GPL(cxl_endpoint_decoder_alloc, CXL);
/**
* cxl_decoder_add_locked - Add a decoder with targets
* @cxld: The cxl decoder allocated by cxl_<type>_decoder_alloc()
- * @target_map: A list of downstream ports that this decoder can direct memory
- * traffic to. These numbers should correspond with the port number
- * in the PCIe Link Capabilities structure.
*
* Certain types of decoders may not have any targets. The main example of this
* is an endpoint device. A more awkward example is a hostbridge whose root
@@ -1937,7 +1932,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_endpoint_decoder_alloc, CXL);
* Return: Negative error code if the decoder wasn't properly configured; else
* returns 0.
*/
-int cxl_decoder_add_locked(struct cxl_decoder *cxld, int *target_map)
+int cxl_decoder_add_locked(struct cxl_decoder *cxld)
{
struct cxl_port *port;
struct device *dev;
@@ -1958,7 +1953,7 @@ int cxl_decoder_add_locked(struct cxl_decoder *cxld, int *target_map)
if (!is_endpoint_decoder(dev)) {
struct cxl_switch_decoder *cxlsd = to_cxl_switch_decoder(dev);
- rc = decoder_populate_targets(cxlsd, port, target_map);
+ rc = decoder_populate_targets(cxlsd, port);
if (rc && (cxld->flags & CXL_DECODER_F_ENABLE)) {
dev_err(&port->dev,
"Failed to populate active decoder targets\n");
@@ -1977,9 +1972,6 @@ EXPORT_SYMBOL_NS_GPL(cxl_decoder_add_locked, CXL);
/**
* cxl_decoder_add - Add a decoder with targets
* @cxld: The cxl decoder allocated by cxl_<type>_decoder_alloc()
- * @target_map: A list of downstream ports that this decoder can direct memory
- * traffic to. These numbers should correspond with the port number
- * in the PCIe Link Capabilities structure.
*
* This is the unlocked variant of cxl_decoder_add_locked().
* See cxl_decoder_add_locked().
@@ -1987,7 +1979,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_decoder_add_locked, CXL);
* Context: Process context. Takes and releases the device lock of the port that
* owns the @cxld.
*/
-int cxl_decoder_add(struct cxl_decoder *cxld, int *target_map)
+int cxl_decoder_add(struct cxl_decoder *cxld)
{
struct cxl_port *port;
@@ -2000,7 +1992,7 @@ int cxl_decoder_add(struct cxl_decoder *cxld, int *target_map)
port = to_cxl_port(cxld->dev.parent);
guard(device)(&port->dev);
- return cxl_decoder_add_locked(cxld, target_map);
+ return cxl_decoder_add_locked(cxld);
}
EXPORT_SYMBOL_NS_GPL(cxl_decoder_add, CXL);
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 15253e5c28d60..e1c9e121b7c64 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -1478,8 +1478,10 @@ static int cxl_port_setup_targets(struct cxl_port *port,
cxl_rr->nr_targets_set);
return -ENXIO;
}
- } else
+ } else {
cxlsd->target[cxl_rr->nr_targets_set] = ep->dport;
+ cxlsd->cxld.target_map[cxl_rr->nr_targets_set] = ep->dport->port_id;
+ }
inc = 1;
out_target_set:
cxl_rr->nr_targets_set += inc;
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index 22cd757b71936..e3747c619ee11 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -358,6 +358,9 @@ enum cxl_decoder_type {
* @target_type: accelerator vs expander (type2 vs type3) selector
* @region: currently assigned region for this decoder
* @flags: memory type capabilities and locking
+ * @target_map: cached copy of hardware port-id list, available at init
+ * before all @dport objects have been instantiated. While
+ * dport id is 8bit, CFMWS interleave targets are 32bits.
* @commit: device/decoder-type specific callback to commit settings to hw
* @reset: device/decoder-type specific callback to reset hw settings
*/
@@ -370,6 +373,7 @@ struct cxl_decoder {
enum cxl_decoder_type target_type;
struct cxl_region *region;
unsigned long flags;
+ u32 target_map[CXL_DECODER_MAX_INTERLEAVE];
int (*commit)(struct cxl_decoder *cxld);
void (*reset)(struct cxl_decoder *cxld);
};
@@ -798,9 +802,9 @@ struct cxl_root_decoder *cxl_root_decoder_alloc(struct cxl_port *port,
unsigned int nr_targets);
struct cxl_switch_decoder *cxl_switch_decoder_alloc(struct cxl_port *port,
unsigned int nr_targets);
-int cxl_decoder_add(struct cxl_decoder *cxld, int *target_map);
+int cxl_decoder_add(struct cxl_decoder *cxld);
struct cxl_endpoint_decoder *cxl_endpoint_decoder_alloc(struct cxl_port *port);
-int cxl_decoder_add_locked(struct cxl_decoder *cxld, int *target_map);
+int cxl_decoder_add_locked(struct cxl_decoder *cxld);
int cxl_decoder_autoremove(struct device *host, struct cxl_decoder *cxld);
static inline int cxl_root_decoder_autoremove(struct device *host,
struct cxl_root_decoder *cxlrd)
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index b9236c6d30d9d..49e8b82004cb5 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -654,7 +654,7 @@ static int mock_cxl_add_passthrough_decoder(struct cxl_port *port)
struct target_map_ctx {
- int *target_map;
+ u32 *target_map;
int index;
int target_count;
};
@@ -866,9 +866,7 @@ static int mock_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
target_count = NR_CXL_SWITCH_PORTS;
for (i = 0; i < NR_CXL_PORT_DECODERS; i++) {
- int target_map[CXL_DECODER_MAX_INTERLEAVE] = { 0 };
struct target_map_ctx ctx = {
- .target_map = target_map,
.target_count = target_count,
};
struct cxl_decoder *cxld;
@@ -897,6 +895,8 @@ static int mock_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
cxld = &cxled->cxld;
}
+ ctx.target_map = cxld->target_map;
+
mock_init_hdm_decoder(cxld);
if (target_count) {
@@ -908,7 +908,7 @@ static int mock_cxl_enumerate_decoders(struct cxl_hdm *cxlhdm,
}
}
- rc = cxl_decoder_add_locked(cxld, target_map);
+ rc = cxl_decoder_add_locked(cxld);
if (rc) {
put_device(&cxld->dev);
dev_err(&port->dev, "Failed to add decoder\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0427/1756] cxl/hdm: Make switch decoder target parsing endian-safe
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (425 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0426/1756] cxl: Add a cached copy of target_map to cxl_decoder Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0428/1756] pinctrl: stm32: Declare stm32_pmx_get_mode() as static Greg Kroah-Hartman
` (571 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alison Schofield, Li Ming,
Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alison Schofield <alison.schofield@intel.com>
[ Upstream commit 3f846646b3d3b5699139e686e1107d231a725860 ]
Switch decoder target IDs are stored one per byte, starting with
target 0 in the least significant byte. The current code accesses
those bytes in memory order, which only matches register order on
little-endian hosts.
On big-endian hosts, the target IDs are reversed and the decoder is
associated with the wrong downstream ports.
Place the register values in a byte array in little-endian order and
index the target IDs from there, so the target mapping is independent
of host endianness.
Fixes: d17d0540a0db ("cxl/core/hdm: Add CXL standard decoder enumeration to the core")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Li Ming <ming.li@zohomail.com>
Link: https://patch.msgid.link/b0526825b3c3ffdb78837563e178d9aa27b6bbb8.1786143520.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/hdm.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index a4b81f9ce8ab2..24873dbb900c0 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
#include <linux/seq_file.h>
+#include <linux/unaligned.h>
#include <linux/device.h>
#include <linux/delay.h>
@@ -827,15 +828,12 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
u64 *dpa_base, struct cxl_endpoint_dvsec_info *info)
{
struct cxl_endpoint_decoder *cxled = NULL;
+ u8 target_id[CXL_HDM_DECODER0_TL_TARGETS];
u64 size, base, skip, dpa_size, lo, hi;
bool committed;
u32 remainder;
int i, rc;
u32 ctrl;
- union {
- u64 value;
- unsigned char target_id[8];
- } target_list;
if (should_emulate_decoders(info))
return cxl_setup_hdm_decoder_from_dvsec(port, cxld, dpa_base,
@@ -948,11 +946,12 @@ static int init_hdm_decoder(struct cxl_port *port, struct cxl_decoder *cxld,
return -ENXIO;
}
- lo = readl(hdm + CXL_HDM_DECODER0_TL_LOW(which));
- hi = readl(hdm + CXL_HDM_DECODER0_TL_HIGH(which));
- target_list.value = (hi << 32) + lo;
+ put_unaligned_le32(readl(hdm + CXL_HDM_DECODER0_TL_LOW(which)),
+ &target_id[0]);
+ put_unaligned_le32(readl(hdm + CXL_HDM_DECODER0_TL_HIGH(which)),
+ &target_id[4]);
for (i = 0; i < cxld->interleave_ways; i++)
- cxld->target_map[i] = target_list.target_id[i];
+ cxld->target_map[i] = target_id[i];
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0428/1756] pinctrl: stm32: Declare stm32_pmx_get_mode() as static
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (426 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0427/1756] cxl/hdm: Make switch decoder target parsing endian-safe Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0429/1756] pinctrl: stm32: Allow compile as module for stm32mp257 Greg Kroah-Hartman
` (570 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Antonio Borneo, Linus Walleij,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antonio Borneo <antonio.borneo@foss.st.com>
[ Upstream commit 9b71efc450fdd2f70d59917025da34f8b0e81135 ]
The commit acaa037970f6 ("pinctrl: stm32: Implement .get_direction
gpio_chip callback") exported the function stm32_pmx_get_mode()
and the struct stm32_gpio_bank, but these were never used outside
the file that defines them.
Declare the function as static, drop it from the include file and
drop also the struct, not anymore visible outside the file.
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Link: https://lore.kernel.org/20250610143042.295376-2-antonio.borneo@foss.st.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 01f20711d044 ("pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/stm32/pinctrl-stm32.c | 5 +++--
drivers/pinctrl/stm32/pinctrl-stm32.h | 4 ----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 79aff59b54f72..05df641874a92 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -121,6 +121,8 @@ struct stm32_pinctrl {
spinlock_t irqmux_lock;
};
+static void stm32_pmx_get_mode(struct stm32_gpio_bank *bank, int pin, u32 *mode, u32 *alt);
+
static inline int stm32_gpio_pin(int gpio)
{
return gpio % STM32_GPIO_PINS_PER_BANK;
@@ -795,8 +797,7 @@ static int stm32_pmx_set_mode(struct stm32_gpio_bank *bank,
return err;
}
-void stm32_pmx_get_mode(struct stm32_gpio_bank *bank, int pin, u32 *mode,
- u32 *alt)
+static void stm32_pmx_get_mode(struct stm32_gpio_bank *bank, int pin, u32 *mode, u32 *alt)
{
u32 val;
int alt_shift = (pin % 8) * 4;
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.h b/drivers/pinctrl/stm32/pinctrl-stm32.h
index 5e5de92ddd58c..8790fef2d58a2 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.h
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.h
@@ -65,11 +65,7 @@ struct stm32_pinctrl_match_data {
bool secure_control;
};
-struct stm32_gpio_bank;
-
int stm32_pctl_probe(struct platform_device *pdev);
-void stm32_pmx_get_mode(struct stm32_gpio_bank *bank,
- int pin, u32 *mode, u32 *alt);
int stm32_pinctrl_suspend(struct device *dev);
int stm32_pinctrl_resume(struct device *dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0429/1756] pinctrl: stm32: Allow compile as module for stm32mp257
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (427 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0428/1756] pinctrl: stm32: Declare stm32_pmx_get_mode() as static Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0430/1756] pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default Greg Kroah-Hartman
` (569 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stephane Danieau, Antonio Borneo,
Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephane Danieau <stephane.danieau@foss.st.com>
[ Upstream commit dba0aff2b89bd106601ed88dfda44fdd3218eb53 ]
Add ability to build pinctrl for stm32mp257 as a kernel module.
Add kernel-doc to the exported symbols.
Signed-off-by: Stephane Danieau <stephane.danieau@foss.st.com>
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Link: https://lore.kernel.org/20250610143042.295376-5-antonio.borneo@foss.st.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 01f20711d044 ("pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/Kconfig.platforms | 1 -
drivers/pinctrl/stm32/Kconfig | 6 +++---
drivers/pinctrl/stm32/pinctrl-stm32.c | 8 ++++++++
drivers/pinctrl/stm32/pinctrl-stm32.h | 14 ++++++++++++++
drivers/pinctrl/stm32/pinctrl-stm32mp257.c | 11 ++++++-----
5 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 6c6d11536b42e..ab77cc49b4ed7 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -308,7 +308,6 @@ config ARCH_STM32
bool "STMicroelectronics STM32 SoC Family"
select GPIOLIB
select PINCTRL
- select PINCTRL_STM32MP257
select ARM_SMC_MBOX
select ARM_SCMI_PROTOCOL
select REGULATOR
diff --git a/drivers/pinctrl/stm32/Kconfig b/drivers/pinctrl/stm32/Kconfig
index 2656d3d3ae402..297a2f088bc1f 100644
--- a/drivers/pinctrl/stm32/Kconfig
+++ b/drivers/pinctrl/stm32/Kconfig
@@ -2,7 +2,7 @@
if ARCH_STM32 || COMPILE_TEST
config PINCTRL_STM32
- bool
+ tristate
depends on OF
select PINMUX
select GENERIC_PINCONF
@@ -53,8 +53,8 @@ config PINCTRL_STM32MP157
select PINCTRL_STM32
config PINCTRL_STM32MP257
- bool "STMicroelectronics STM32MP257 pin control" if COMPILE_TEST && !MACH_STM32MP25
+ tristate "STMicroelectronics STM32MP257 pin control"
depends on OF && HAS_IOMEM
- default MACH_STM32MP25
+ default MACH_STM32MP25 || (ARCH_STM32 && ARM64)
select PINCTRL_STM32
endif
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 05df641874a92..2219f31d14935 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -7,6 +7,7 @@
* Heavily based on Mediatek's pinctrl driver
*/
#include <linux/clk.h>
+#include <linux/export.h>
#include <linux/gpio/driver.h>
#include <linux/hwspinlock.h>
#include <linux/io.h>
@@ -1666,6 +1667,7 @@ int stm32_pctl_probe(struct platform_device *pdev)
clk_bulk_disable_unprepare(banks, pctl->clks);
return ret;
}
+EXPORT_SYMBOL(stm32_pctl_probe);
static int __maybe_unused stm32_pinctrl_restore_gpio_regs(
struct stm32_pinctrl *pctl, u32 pin)
@@ -1738,6 +1740,7 @@ int __maybe_unused stm32_pinctrl_suspend(struct device *dev)
return 0;
}
+EXPORT_SYMBOL(stm32_pinctrl_suspend);
int __maybe_unused stm32_pinctrl_resume(struct device *dev)
{
@@ -1754,3 +1757,8 @@ int __maybe_unused stm32_pinctrl_resume(struct device *dev)
return 0;
}
+EXPORT_SYMBOL(stm32_pinctrl_resume);
+
+MODULE_AUTHOR("Alexandre Torgue <alexandre.torgue@foss.st.com>");
+MODULE_DESCRIPTION("STM32 core pinctrl driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.h b/drivers/pinctrl/stm32/pinctrl-stm32.h
index 8790fef2d58a2..170ccdde0796a 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.h
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.h
@@ -65,8 +65,22 @@ struct stm32_pinctrl_match_data {
bool secure_control;
};
+/**
+ * stm32_pctl_probe() - Common probe for stm32 pinctrl drivers.
+ * @pdev: Pinctrl platform device.
+ */
int stm32_pctl_probe(struct platform_device *pdev);
+
+/**
+ * stm32_pinctrl_suspend() - Common suspend for stm32 pinctrl drivers.
+ * @dev: Pinctrl device.
+ */
int stm32_pinctrl_suspend(struct device *dev);
+
+/**
+ * stm32_pinctrl_resume() - Common resume for stm32 pinctrl drivers.
+ * @dev: Pinctrl device.
+ */
int stm32_pinctrl_resume(struct device *dev);
#endif /* __PINCTRL_STM32_H */
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32mp257.c b/drivers/pinctrl/stm32/pinctrl-stm32mp257.c
index 23aebd4695e99..17cfea846dac0 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32mp257.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32mp257.c
@@ -4,6 +4,7 @@
* Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
*/
#include <linux/init.h>
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -2560,6 +2561,7 @@ static const struct of_device_id stm32mp257_pctrl_match[] = {
},
{ }
};
+MODULE_DEVICE_TABLE(of, stm32mp257_pctrl_match);
static const struct dev_pm_ops stm32_pinctrl_dev_pm_ops = {
SET_LATE_SYSTEM_SLEEP_PM_OPS(stm32_pinctrl_suspend, stm32_pinctrl_resume)
@@ -2573,9 +2575,8 @@ static struct platform_driver stm32mp257_pinctrl_driver = {
.pm = &stm32_pinctrl_dev_pm_ops,
},
};
+module_platform_driver(stm32mp257_pinctrl_driver);
-static int __init stm32mp257_pinctrl_init(void)
-{
- return platform_driver_register(&stm32mp257_pinctrl_driver);
-}
-arch_initcall(stm32mp257_pinctrl_init);
+MODULE_AUTHOR("Alexandre Torgue <alexandre.torgue@foss.st.com>");
+MODULE_DESCRIPTION("STM32MP257 pinctrl driver");
+MODULE_LICENSE("GPL");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0430/1756] pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (428 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0429/1756] pinctrl: stm32: Allow compile as module for stm32mp257 Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0431/1756] ASoC: SOF: imx: Prevent stack OOB read in DSP panic dump Greg Kroah-Hartman
` (568 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Antonio Borneo,
Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 01f20711d044f35a7a89ceec33df30e097147e8a ]
Commit 619f8ca4a73d ("pinctrl: stm32: add stm32mp257 pinctrl support")
made CONFIG_PINCTRL_STM32MP257 default to MACH_STM32MP25, following the
MACH_* pattern of the arm32 entries above it, but no Kconfig symbol of
that name exists and git log -S finds no Kconfig file that ever defined
one: the STM32MP25 family is arm64 only, where CONFIG_ARCH_STM32 covers
it. Commit dba0aff2b89b ("pinctrl: stm32: Allow compile as module for
stm32mp257") added "|| (ARCH_STM32 && ARM64)" next to it, so the first
half now evaluates to n and changes no configuration.
Drop the first half.
Fixes: 619f8ca4a73d ("pinctrl: stm32: add stm32mp257 pinctrl support")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/stm32/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/stm32/Kconfig b/drivers/pinctrl/stm32/Kconfig
index 297a2f088bc1f..e4c9b8a69a1a4 100644
--- a/drivers/pinctrl/stm32/Kconfig
+++ b/drivers/pinctrl/stm32/Kconfig
@@ -55,6 +55,6 @@ config PINCTRL_STM32MP157
config PINCTRL_STM32MP257
tristate "STMicroelectronics STM32MP257 pin control"
depends on OF && HAS_IOMEM
- default MACH_STM32MP25 || (ARCH_STM32 && ARM64)
+ default ARCH_STM32 && ARM64
select PINCTRL_STM32
endif
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0431/1756] ASoC: SOF: imx: Prevent stack OOB read in DSP panic dump
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (429 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0430/1756] pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0432/1756] scsi: pm8001: Fix SATA FIS offset in struct hw_event_resp Greg Kroah-Hartman
` (567 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ștefan Ghețu, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ștefan Ghețu <stefanghetu9@gmail.com>
[ Upstream commit 48ed992bfbe53537ad1cbc8ad68f7031e7ac0af3 ]
Commit 58bb5081cba1 ("ASoC: SOF: Xtensa: dump ar registers to restore
call stack") added a shared Xtensa helper that iterates over a flexible
array of AR registers (`ar[]`) controlled by `plat_hdr.numaregs`.
While Intel IPC4 allocates dynamic storage for the AR block, the i.MX
IPC3 path reads the oops message into a stack-allocated struct without
backing storage for `ar[]`, while leaving `numaregs` unvalidated. This
causes a stack out-of-bounds read when printing a DSP panic.
Clear `numaregs` to 0 on i.MX since the AR block is not fetched or
supported on this platform, preventing unsafe out-of-bounds memory
accesses in the shared Xtensa helper.
Fixes: 58bb5081cba1 ("ASoC: SOF: Xtensa: dump ar registers to restore call stack")
Signed-off-by: Ștefan Ghețu <stefanghetu9@gmail.com>
Link: https://patch.msgid.link/20260908170740.276800-1-stefanghetu9@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/imx/imx-common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c
index fce6d9cf6a6be..e0a99f641e3b8 100644
--- a/sound/soc/sof/imx/imx-common.c
+++ b/sound/soc/sof/imx/imx-common.c
@@ -29,6 +29,7 @@ void imx8_get_registers(struct snd_sof_dev *sdev,
/* first read registers */
sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops));
+ xoops->plat_hdr.numaregs = 0;
/* then get panic info */
if (xoops->arch_hdr.totalsize > EXCEPT_MAX_HDR_SIZE) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0432/1756] scsi: pm8001: Fix SATA FIS offset in struct hw_event_resp
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (430 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0431/1756] ASoC: SOF: imx: Prevent stack OOB read in DSP panic dump Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0433/1756] staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers Greg Kroah-Hartman
` (566 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bart Van Assche,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit cdc97921de02a0c1a8324afa03e8b3e30a72bbe6 ]
In struct hw_event_resp, sas_identify was defined using struct
sas_identify_frame, which is 32 bytes long because it includes a 4-byte CRC
field. However, PM8001 and PM80xx hardware does not send the CRC in the
event response frame, providing only the 28-byte identify payload.
Because sas_identify had a size of 32 bytes, the following sata_fis member
was located at byte offset 44 instead of the actual hardware offset 40. In
hw_event_sata_phy_up(), this discrepancy was worked around with negative
pointer arithmetic: ((u8 *)&pPayload->sata_fis - 4). This triggers a
compiler error under Clang with -Wstringop-overread:
error: 'memcpy' reading 20 bytes from a region of size 0
[-Werror,-Wstringop-overread]
memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
Move struct sas_identify_frame_local (28 bytes) into pm8001_defs.h, and
update struct hw_event_resp in both pm8001_hwi.h and pm80xx_hwi.h to use
struct sas_identify_frame_local followed by sata_fis and a 4-byte padding
word. This correctly aligns sata_fis at byte offset 40 while maintaining
the 64-byte total payload size.
Update hw_event_sata_phy_up() in pm8001_hwi.c and pm80xx_hwi.c to copy
directly from &pPayload->sata_fis.
Compile-tested only. Both the patch and its description have been generated
by Gemini.
Fixes: dbf9bfe61571 ("[SCSI] pm8001: add SAS/SATA HBA driver")
Fixes: f5860992db55 ("[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/31963d53810f42970447e78ef46030ab13d2e91f.1788198434.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/pm8001/pm8001_defs.h | 98 +++++++++++++++++++++++++++++
drivers/scsi/pm8001/pm8001_hwi.c | 2 +-
drivers/scsi/pm8001/pm8001_hwi.h | 4 +-
drivers/scsi/pm8001/pm80xx_hwi.c | 2 +-
drivers/scsi/pm8001/pm80xx_hwi.h | 100 +-----------------------------
5 files changed, 106 insertions(+), 100 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_defs.h b/drivers/scsi/pm8001/pm8001_defs.h
index 501b574239e8b..ff7b282090792 100644
--- a/drivers/scsi/pm8001/pm8001_defs.h
+++ b/drivers/scsi/pm8001/pm8001_defs.h
@@ -41,6 +41,104 @@
#ifndef _PM8001_DEFS_H_
#define _PM8001_DEFS_H_
+#include <scsi/sas.h>
+
+#ifdef __LITTLE_ENDIAN_BITFIELD
+struct sas_identify_frame_local {
+ /* Byte 0 */
+ u8 frame_type:4;
+ u8 dev_type:3;
+ u8 _un0:1;
+
+ /* Byte 1 */
+ u8 _un1;
+
+ /* Byte 2 */
+ union {
+ struct {
+ u8 _un20:1;
+ u8 smp_iport:1;
+ u8 stp_iport:1;
+ u8 ssp_iport:1;
+ u8 _un247:4;
+ };
+ u8 initiator_bits;
+ };
+
+ /* Byte 3 */
+ union {
+ struct {
+ u8 _un30:1;
+ u8 smp_tport:1;
+ u8 stp_tport:1;
+ u8 ssp_tport:1;
+ u8 _un347:4;
+ };
+ u8 target_bits;
+ };
+
+ /* Byte 4 - 11 */
+ u8 _un4_11[8];
+
+ /* Byte 12 - 19 */
+ u8 sas_addr[SAS_ADDR_SIZE];
+
+ /* Byte 20 */
+ u8 phy_id;
+
+ u8 _un21_27[7];
+
+} __packed;
+
+#elif defined(__BIG_ENDIAN_BITFIELD)
+struct sas_identify_frame_local {
+ /* Byte 0 */
+ u8 _un0:1;
+ u8 dev_type:3;
+ u8 frame_type:4;
+
+ /* Byte 1 */
+ u8 _un1;
+
+ /* Byte 2 */
+ union {
+ struct {
+ u8 _un247:4;
+ u8 ssp_iport:1;
+ u8 stp_iport:1;
+ u8 smp_iport:1;
+ u8 _un20:1;
+ };
+ u8 initiator_bits;
+ };
+
+ /* Byte 3 */
+ union {
+ struct {
+ u8 _un347:4;
+ u8 ssp_tport:1;
+ u8 stp_tport:1;
+ u8 smp_tport:1;
+ u8 _un30:1;
+ };
+ u8 target_bits;
+ };
+
+ /* Byte 4 - 11 */
+ u8 _un4_11[8];
+
+ /* Byte 12 - 19 */
+ u8 sas_addr[SAS_ADDR_SIZE];
+
+ /* Byte 20 */
+ u8 phy_id;
+
+ u8 _un21_27[7];
+} __packed;
+#else
+#error "Bitfield order not defined!"
+#endif
+
enum chip_flavors {
chip_8001,
chip_8008,
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index dec1e2d380f17..c43dc262ac826 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -3209,7 +3209,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
phy->sas_phy.oob_mode = SATA_OOB_MODE;
sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE, GFP_ATOMIC);
spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags);
- memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
+ memcpy(phy->frame_rcvd, &pPayload->sata_fis,
sizeof(struct dev_to_host_fis));
phy->frame_rcvd_size = sizeof(struct dev_to_host_fis);
phy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
index fc2127dcb58d9..b44edcd8be52f 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.h
+++ b/drivers/scsi/pm8001/pm8001_hwi.h
@@ -42,6 +42,7 @@
#include <linux/types.h>
#include <scsi/libsas.h>
+#include "pm8001_defs.h"
/* for Request Opcode of IOMB */
@@ -229,8 +230,9 @@ struct hw_event_resp {
__le32 lr_evt_status_phyid_portid;
__le32 evt_param;
__le32 npip_portstate;
- struct sas_identify_frame sas_identify;
+ struct sas_identify_frame_local sas_identify;
struct dev_to_host_fis sata_fis;
+ u32 _r_a;
} __attribute__((packed, aligned(4)));
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index e0e6bacef8c38..fd71f38d1401e 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -3241,7 +3241,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
phy->sas_phy.oob_mode = SATA_OOB_MODE;
sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE, GFP_ATOMIC);
spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags);
- memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
+ memcpy(phy->frame_rcvd, &pPayload->sata_fis,
sizeof(struct dev_to_host_fis));
phy->frame_rcvd_size = sizeof(struct dev_to_host_fis);
phy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index eb8fd37b20661..dd735102c7706 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -43,6 +43,7 @@
#include <linux/types.h>
#include <scsi/libsas.h>
+#include "pm8001_defs.h"
/* for Request Opcode of IOMB */
#define OPC_INB_ECHO 1 /* 0x000 */
@@ -236,102 +237,6 @@
/* Port recovery timeout, 10000 ms for PM8006 controller */
#define CHIP_8006_PORT_RECOVERY_TIMEOUT 0x640000
-#ifdef __LITTLE_ENDIAN_BITFIELD
-struct sas_identify_frame_local {
- /* Byte 0 */
- u8 frame_type:4;
- u8 dev_type:3;
- u8 _un0:1;
-
- /* Byte 1 */
- u8 _un1;
-
- /* Byte 2 */
- union {
- struct {
- u8 _un20:1;
- u8 smp_iport:1;
- u8 stp_iport:1;
- u8 ssp_iport:1;
- u8 _un247:4;
- };
- u8 initiator_bits;
- };
-
- /* Byte 3 */
- union {
- struct {
- u8 _un30:1;
- u8 smp_tport:1;
- u8 stp_tport:1;
- u8 ssp_tport:1;
- u8 _un347:4;
- };
- u8 target_bits;
- };
-
- /* Byte 4 - 11 */
- u8 _un4_11[8];
-
- /* Byte 12 - 19 */
- u8 sas_addr[SAS_ADDR_SIZE];
-
- /* Byte 20 */
- u8 phy_id;
-
- u8 _un21_27[7];
-
-} __packed;
-
-#elif defined(__BIG_ENDIAN_BITFIELD)
-struct sas_identify_frame_local {
- /* Byte 0 */
- u8 _un0:1;
- u8 dev_type:3;
- u8 frame_type:4;
-
- /* Byte 1 */
- u8 _un1;
-
- /* Byte 2 */
- union {
- struct {
- u8 _un247:4;
- u8 ssp_iport:1;
- u8 stp_iport:1;
- u8 smp_iport:1;
- u8 _un20:1;
- };
- u8 initiator_bits;
- };
-
- /* Byte 3 */
- union {
- struct {
- u8 _un347:4;
- u8 ssp_tport:1;
- u8 stp_tport:1;
- u8 smp_tport:1;
- u8 _un30:1;
- };
- u8 target_bits;
- };
-
- /* Byte 4 - 11 */
- u8 _un4_11[8];
-
- /* Byte 12 - 19 */
- u8 sas_addr[SAS_ADDR_SIZE];
-
- /* Byte 20 */
- u8 phy_id;
-
- u8 _un21_27[7];
-} __packed;
-#else
-#error "Bitfield order not defined!"
-#endif
-
struct mpi_msg_hdr {
__le32 header; /* Bits [11:0] - Message operation code */
/* Bits [15:12] - Message Category */
@@ -427,8 +332,9 @@ struct hw_event_resp {
__le32 lr_status_evt_portid;
__le32 evt_param;
__le32 phyid_npip_portstate;
- struct sas_identify_frame sas_identify;
+ struct sas_identify_frame_local sas_identify;
struct dev_to_host_fis sata_fis;
+ u32 _r_a;
} __attribute__((packed, aligned(4)));
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0433/1756] staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (431 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0432/1756] scsi: pm8001: Fix SATA FIS offset in struct hw_event_resp Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0434/1756] md/raid10: fix missing wakeup in wait_barrier_nolock Greg Kroah-Hartman
` (565 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abdelnasser Hussein, Joshua Crofts,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
[ Upstream commit 69fa76f0af3414cc189c3b0b807cb59e327ecc00 ]
The SPI operations in this driver are not DMA safe:
1. spi_read() uses a stack-allocated buffer.
2. spi_write() in ad7816_spi_read() uses a struct member that shares a
cacheline with other variables.
3. spi_write() in ad7816_spi_write() passes a stack parameter by
reference.
Fix these violations by replacing all spi_read() and spi_write() calls
with spi_write_then_read(). This safely handles DMA by internally
allocating a bounce buffer for the transfers, avoiding cacheline
sharing issues without needing dedicated aligned buffers.
This implicitly corrects the size argument in read to sizeof(buf).
Fixes: 7924425db04a ("staging: iio: adc: new driver for AD7816 devices")
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/iio/adc/ad7816.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 081b17f498638..a46ca0559b6a2 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -69,7 +69,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
gpiod_set_value(chip->rdwr_pin, 1);
gpiod_set_value(chip->rdwr_pin, 0);
- ret = spi_write(spi_dev, &chip->channel_id, sizeof(chip->channel_id));
+ ret = spi_write_then_read(spi_dev, &chip->channel_id, sizeof(chip->channel_id), NULL, 0);
if (ret < 0) {
dev_err(&spi_dev->dev, "SPI channel setting error\n");
return ret;
@@ -91,7 +91,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
gpiod_set_value(chip->rdwr_pin, 0);
gpiod_set_value(chip->rdwr_pin, 1);
- ret = spi_read(spi_dev, &buf, sizeof(*data));
+ ret = spi_write_then_read(spi_dev, NULL, 0, &buf, sizeof(buf));
if (ret < 0) {
dev_err(&spi_dev->dev, "SPI data read error\n");
return ret;
@@ -109,7 +109,7 @@ static int ad7816_spi_write(struct ad7816_chip_info *chip, u8 data)
gpiod_set_value(chip->rdwr_pin, 1);
gpiod_set_value(chip->rdwr_pin, 0);
- ret = spi_write(spi_dev, &data, sizeof(data));
+ ret = spi_write_then_read(spi_dev, &data, sizeof(data), NULL, 0);
if (ret < 0)
dev_err(&spi_dev->dev, "SPI oti data write error\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0434/1756] md/raid10: fix missing wakeup in wait_barrier_nolock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (432 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0433/1756] staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0435/1756] md: reject v0.90 arrays with too many devices Greg Kroah-Hartman
` (564 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zizhi Wo, Abd-Alrhman Masalkhi,
Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <wozizhi@huawei.com>
[ Upstream commit f00eb0ff45793383d5a62db2d2aea63ada0ccdbd ]
Fuzz testing triggered a hung raid10d thread:
INFO: task md0_raid10 blocked for more than 120 seconds.
Call Trace:
raid10d
md_thread
kthread
wait_barrier_nolock() speculatively increments nr_pending. If a
concurrent writer changes resync_lock's sequence, it rolls the count back
with atomic_dec_and_test(). The rollback currently wakes wait_barrier only
when nr_pending reaches zero.
freeze_array() can be waiting for nr_pending == nr_queued + extra while
array_freeze_pending is set. If the rollback changes nr_pending from 2 to
1, the condition becomes true but no wakeup is sent, leaving raid10d
blocked indefinitely.
Also wake wait_barrier when array_freeze_pending is set, matching
allow_barrier().
Fixes: b9b083f9044a ("md/raid10: convert resync_lock to use seqlock")
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
Reviewed-by: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
Link: https://patch.msgid.link/20260817033340.418119-3-wozizhi@huawei.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid10.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 875759fa86cab..fefec2b51e399 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -993,7 +993,8 @@ static bool wait_barrier_nolock(struct r10conf *conf)
if (!read_seqretry(&conf->resync_lock, seq))
return true;
- if (atomic_dec_and_test(&conf->nr_pending))
+ if (atomic_dec_and_test(&conf->nr_pending) ||
+ READ_ONCE(conf->array_freeze_pending))
wake_up_barrier(conf);
return false;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0435/1756] md: reject v0.90 arrays with too many devices
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (433 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0434/1756] md/raid10: fix missing wakeup in wait_barrier_nolock Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0436/1756] md/raid5: dont BUG() on an inconsistent reshape state from the superblock Greg Kroah-Hartman
` (563 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Yu Kuai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
[ Upstream commit 1a33a379e67853d6d778e6e80b214bdf1208f6f8 ]
The v0.90 superblock has room for MD_SB_DISKS device descriptors, but
super_90_load() only rejects nonpositive raid_disks values. A crafted
superblock can therefore copy a larger value into mddev->raid_disks. When
metadata is next updated, super_90_sync() walks sb->disks[] up to that
count and reads and writes beyond the 4 KiB superblock buffer.
A checksum-valid RAID1 member advertising 64 devices can be assembled by
mdadm --incremental --run. The first write to the array then produces
out-of-bounds writes from super_90_sync() under KASAN.
Reject device counts that cannot be represented by the v0.90 format while
loading the superblock.
Assisted-by: Codex:gpt-5
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/20260820210703.3035608-2-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/md.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e54fe6f3319a8..c7214157d12ce 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1263,7 +1263,7 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor
goto abort;
}
- if (sb->raid_disks <= 0)
+ if (sb->raid_disks <= 0 || sb->raid_disks > MD_SB_DISKS)
goto abort;
if (md_csum_fold(calc_sb_csum(sb)) != md_csum_fold(sb->sb_csum)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0436/1756] md/raid5: dont BUG() on an inconsistent reshape state from the superblock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (434 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0435/1756] md: reject v0.90 arrays with too many devices Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0437/1756] md/raid5: reject raid4/5 arrays with too few disks Greg Kroah-Hartman
` (562 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1f5a7de91d547763f4c8,
Yogesh Gaur, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yogesh Gaur <yogeshgaur.83@gmail.com>
[ Upstream commit 0669c7dbd1d375f279e607a24addc2f1dae2d4f3 ]
raid5_run() branches on mddev->reshape_position. When it is MaxSector --
no reshape in progress -- the else branch asserts that nothing else
describes one:
BUG_ON(mddev->level != mddev->new_level);
BUG_ON(mddev->layout != mddev->new_layout);
BUG_ON(mddev->chunk_sectors != mddev->new_chunk_sectors);
BUG_ON(mddev->delta_disks != 0);
Nothing enforces that invariant. Both superblock validators copy the
reshape fields straight off disk without cross-checking them against
each other: super_1_validate() takes reshape_position, delta_disks,
new_level, new_layout and new_chunk from the superblock whenever
MD_FEATURE_RESHAPE_ACTIVE is set, and super_90_validate() does the same
for minor version 91. A superblock that sets the reshape feature while
leaving reshape_position at the MaxSector sentinel therefore reaches the
else branch with a non-zero delta_disks, and assembling the array takes
the machine down:
kernel BUG at drivers/md/raid5.c:8117!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
RIP: 0010:raid5_run+0x11a7/0x1670 drivers/md/raid5.c:8117
Call Trace:
md_run+0xc2f/0x2510 drivers/md/md.c:6779
do_md_run+0x36/0x660 drivers/md/md.c:6880
array_state_store+0x9c5/0xcf0 drivers/md/md.c:4765
md_attr_store+0x1c5/0x330 drivers/md/md.c:6158
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
This is reachable by anyone who can present an md superblock, so BUG()
is the wrong response. Refuse to start the array instead, the way the
reshape_position != MaxSector branch a few lines above already refuses a
reshape it cannot resume. Nothing has been allocated at this point --
the journal-and-bitmap check just above returns -EINVAL the same way --
so there is nothing to unwind.
Reported-by: syzbot+1f5a7de91d547763f4c8@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1f5a7de91d547763f4c8
Fixes: 91adb56473fe ("md/raid5: refactor raid5 "run"")
Assisted-by: LLM
Signed-off-by: Yogesh Gaur <yogeshgaur.83@gmail.com>
Link: https://patch.msgid.link/20260910131103.988-1-yogeshgaur.83@gmail.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 605e89f95c36c..399ed941ed9c2 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7959,11 +7959,17 @@ static int raid5_run(struct mddev *mddev)
}
pr_debug("md/raid:%s: reshape will continue\n", mdname(mddev));
/* OK, we should be able to continue; */
- } else {
- BUG_ON(mddev->level != mddev->new_level);
- BUG_ON(mddev->layout != mddev->new_layout);
- BUG_ON(mddev->chunk_sectors != mddev->new_chunk_sectors);
- BUG_ON(mddev->delta_disks != 0);
+ } else if (mddev->level != mddev->new_level ||
+ mddev->layout != mddev->new_layout ||
+ mddev->chunk_sectors != mddev->new_chunk_sectors ||
+ mddev->delta_disks != 0) {
+ /* No reshape is in progress, but the array describes one.
+ * The superblock validators do not cross-check these against
+ * reshape_position, so this is reachable from disk.
+ */
+ pr_warn("md/raid:%s: inconsistent reshape state - aborting.\n",
+ mdname(mddev));
+ return -EINVAL;
}
if (test_bit(MD_HAS_JOURNAL, &mddev->flags) &&
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0437/1756] md/raid5: reject raid4/5 arrays with too few disks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (435 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0436/1756] md/raid5: dont BUG() on an inconsistent reshape state from the superblock Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0438/1756] md/raid5: setup_conf: Fix null-ptr-def in error handling path Greg Kroah-Hartman
` (561 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+de94ddbfff0c9e6fe030,
Chen Cheng, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
[ Upstream commit 0d9bbbb6fafa22659ccd4d7ab94329a43c2632d0 ]
raid4 and raid5 require at least two disks, while raid6 requires at least
four disks. setup_conf() only rejects raid6 arrays with fewer than four
disks. As a result, an invalid raid4 or raid5 array can be assembled with
no data disks and later reach raid5_set_limits().
Reject such arrays before the r5conf is created. This prevents the invalid
geometry from reaching queue limit setup, where roundup_pow_of_two() can be
called with a zero stripe size.
Reported-by: syzbot+de94ddbfff0c9e6fe030@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/6a778c82.01d0871a.3a0d52.006a.GAE@google.com/
Fixes: f63f17350e53 ("md/raid5: use the atomic queue limit update APIs")
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Link: https://patch.msgid.link/20260911041521.2433222-1-chencheng@fnnas.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 399ed941ed9c2..3a4f949e95c11 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7514,9 +7514,11 @@ static struct r5conf *setup_conf(struct mddev *mddev)
mdname(mddev), mddev->new_layout);
return ERR_PTR(-EIO);
}
- if (mddev->new_level == 6 && mddev->raid_disks < 4) {
- pr_warn("md/raid:%s: not enough configured devices (%d, minimum 4)\n",
- mdname(mddev), mddev->raid_disks);
+ if ((mddev->new_level != 6 && mddev->raid_disks < 2) ||
+ (mddev->new_level == 6 && mddev->raid_disks < 4)) {
+ pr_warn("md/raid:%s: not enough configured devices (%d, minimum %d)\n",
+ mdname(mddev), mddev->raid_disks,
+ mddev->new_level == 6 ? 4 : 2);
return ERR_PTR(-EINVAL);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0438/1756] md/raid5: setup_conf: Fix null-ptr-def in error handling path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (436 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0437/1756] md/raid5: reject raid4/5 arrays with too few disks Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0439/1756] md/raid5: reject a per-device size smaller than one chunk Greg Kroah-Hartman
` (560 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhihao Cheng, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhihao Cheng <chengzhihao1@huawei.com>
[ Upstream commit eba5f518701b1c7f2d883504f89c41611bd2de46 ]
For raid5 setup_conf, if an error(eg. bioset_init fails) happens before
'conf->mddev = mddev', following error handling path could trigger a
null-ptr-def problem:
free_conf
log_exit
raid5_has_ppl
test_bit(MD_HAS_PPL, &conf->mddev->flags) // conf->mddev is NULL !
Fix it by initializing conf->mddev in advance.
Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Link: https://patch.msgid.link/20260915081731.122933-1-chengzhihao1@huawei.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 3a4f949e95c11..2dd4a7fb83dc6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7534,6 +7534,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
if (conf == NULL)
goto abort;
+ conf->mddev = mddev;
#if PAGE_SIZE != DEFAULT_STRIPE_SIZE
conf->stripe_size = DEFAULT_STRIPE_SIZE;
conf->stripe_shift = ilog2(DEFAULT_STRIPE_SIZE) - 9;
@@ -7607,7 +7608,6 @@ static struct r5conf *setup_conf(struct mddev *mddev)
ret = bioset_init(&conf->bio_split, BIO_POOL_SIZE, 0, 0);
if (ret)
goto abort;
- conf->mddev = mddev;
ret = -ENOMEM;
conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0439/1756] md/raid5: reject a per-device size smaller than one chunk
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (437 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0438/1756] md/raid5: setup_conf: Fix null-ptr-def in error handling path Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0440/1756] clk: si521xx: correct the SI52147 OF output enable map Greg Kroah-Hartman
` (559 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+50f9bc7ab8eb224b7629,
Zizhi Wo, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zizhi Wo <wozizhi@huawei.com>
[ Upstream commit 370ca0760b18c64592a258bcb057ff0a2531aabf ]
Both raid5_run() and raid5_resize() align the per-device size down to a
whole multiple of the chunk size:
mddev->dev_sectors &= ~(chunk_sectors - 1);
Neither checks the result, so a size smaller than one chunk silently
becomes zero.
In raid5_run() that is harmless: the array size is derived from the same
zero, so the disk just ends up with no capacity.
In raid5_resize() it leaves the array inconsistent -- mddev->dev_sectors
becomes zero, while mddev->array_sectors and the gendisk capacity keep the
previous. A later raid4/raid5 -> raid0 takeover copies the zero into every
rdev->sectors (raid0_takeover_raid45()), so create_strip_zones() builds a
strip zone table whose zone_end is zero. Any read then passes
bio_check_eod() against the stale capacity and hits the BUG() in
find_zone():
kernel BUG at drivers/md/raid0.c:318!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
Call Trace:
raid0_make_request
md_handle_request
submit_bio_noacct_nocheck
block_read_full_folio
read_part_sector
bdev_disk_changed
bdev_open
Reject a size smaller than one chunk in both functions, so that a running
raid4/raid5 array always has mddev->dev_sectors >= one chunk.
The check is done where the value takes effect, not where it is assigned.
mddev->dev_sectors is written from several places, and none of them can
tell whether the value is usable: the chunk size may still change later.
raid5_run() and raid5_resize() are where every input is final, so one check
in each covers them all.
Fixes: eea136d69f9f ("md: fix buglet in RAID5 -> RAID0 conversion.")
Reported-by: syzbot+50f9bc7ab8eb224b7629@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=50f9bc7ab8eb224b7629
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
Link: https://patch.msgid.link/20260916095137.1157801-1-wozizhi@huaweicloud.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 2dd4a7fb83dc6..99660cf51f533 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -8060,6 +8060,12 @@ static int raid5_run(struct mddev *mddev)
/* device size must be a multiple of chunk size */
mddev->dev_sectors &= ~((sector_t)mddev->chunk_sectors - 1);
+ if (!mddev->dev_sectors) {
+ pr_warn("md/raid:%s: device size is smaller than one chunk\n",
+ mdname(mddev));
+ ret = -EINVAL;
+ goto abort;
+ }
mddev->resync_max_sectors = mddev->dev_sectors;
if (mddev->degraded > dirty_parity_disks &&
@@ -8393,6 +8399,8 @@ static int raid5_resize(struct mddev *mddev, sector_t sectors)
if (raid5_has_log(conf) || raid5_has_ppl(conf))
return -EINVAL;
sectors &= ~((sector_t)conf->chunk_sectors - 1);
+ if (!sectors)
+ return -EINVAL;
newsize = raid5_size(mddev, sectors, mddev->raid_disks);
if (mddev->external_size &&
mddev->array_sectors > newsize)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0440/1756] clk: si521xx: correct the SI52147 OF output enable map
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (438 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0439/1756] md/raid5: reject a per-device size smaller than one chunk Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0441/1756] clk: milbeaut: Return divider update timeouts Greg Kroah-Hartman
` (558 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Brian Masney,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 7a4cc47d715f08309089d40b8c29fb0ba79917db ]
The SI52147 data sheet assigns DIFF0 through DIFF3 output-enable bits to
0x17 in control register 1. The OF match data uses 0x15, leaving the
DIFF2 bit out of the map, while the I2C ID table already uses the
documented value.
Use 0x17 for the SI52147 OF entry so both enumeration paths expose the
documented outputs.
Fixes: edc12763a3a29 ("clk: si521xx: Clock driver for Skyworks Si521xx I2C PCIe clock generators")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-si521xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-si521xx.c b/drivers/clk/clk-si521xx.c
index 4f7b74f889f1e..b8f71ccb5e033 100644
--- a/drivers/clk/clk-si521xx.c
+++ b/drivers/clk/clk-si521xx.c
@@ -373,7 +373,7 @@ MODULE_DEVICE_TABLE(i2c, si521xx_id);
static const struct of_device_id clk_si521xx_of_match[] = {
{ .compatible = "skyworks,si52144", .data = (void *)SI521XX_OE_MAP(0x5, 0xc0) },
{ .compatible = "skyworks,si52146", .data = (void *)SI521XX_OE_MAP(0x15, 0xe0) },
- { .compatible = "skyworks,si52147", .data = (void *)SI521XX_OE_MAP(0x15, 0xf8) },
+ { .compatible = "skyworks,si52147", .data = (void *)SI521XX_OE_MAP(0x17, 0xf8) },
{ }
};
MODULE_DEVICE_TABLE(of, clk_si521xx_of_match);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0441/1756] clk: milbeaut: Return divider update timeouts
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (439 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0440/1756] clk: si521xx: correct the SI52147 OF output enable map Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0442/1756] drm/amd/pm: bound SCLK FCW range entries to the table size Greg Kroah-Hartman
` (557 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Brian Masney,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit 92d0998090d1716ee6b47174c10eb9415a12fca8 ]
m10v_clk_divider_set_rate() logs when the hardware does not clear its
write-valid request, but still returns success to the clock framework. It
also uses the sleeping poll helper while holding the divider spinlock.
Use the atomic poll helper under the lock and return its timeout so the
rate change is not reported as successful before the hardware accepts it.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 6a6ba5b55a72 ("clock: milbeaut: Add Milbeaut M10V clock controller")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-milbeaut.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/clk-milbeaut.c b/drivers/clk/clk-milbeaut.c
index 18c20aff45f76..ef4d8f862f5cb 100644
--- a/drivers/clk/clk-milbeaut.c
+++ b/drivers/clk/clk-milbeaut.c
@@ -411,8 +411,8 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
struct m10v_clk_divider *divider = to_m10v_div(hw);
- int value;
unsigned long flags = 0;
+ int value, ret = 0;
u32 val;
u32 write_en = BIT(divider->width - 1);
@@ -434,8 +434,10 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
if (divider->write_valid_reg) {
writel(M10V_DCHREQ, divider->write_valid_reg);
- if (readl_poll_timeout(divider->write_valid_reg, val,
- !val, M10V_UPOLL_RATE, M10V_UTIMEOUT))
+ ret = readl_poll_timeout_atomic(divider->write_valid_reg, val,
+ !val, M10V_UPOLL_RATE,
+ M10V_UTIMEOUT);
+ if (ret)
pr_err("%s:%s couldn't stabilize\n",
__func__, clk_hw_get_name(hw));
}
@@ -445,7 +447,7 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
else
__release(divider->lock);
- return 0;
+ return ret;
}
static const struct clk_ops m10v_clk_divider_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0442/1756] drm/amd/pm: bound SCLK FCW range entries to the table size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (440 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0441/1756] clk: milbeaut: Return divider update timeouts Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0443/1756] drm/amdgpu: Add vbios build number interface Greg Kroah-Hartman
` (556 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hari Mishal, Alex Deucher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hari Mishal <harimishal1@gmail.com>
[ Upstream commit f35aa5c77f5fca20fc269d6221df19c7b96704a5 ]
atomctrl_get_smc_sclk_range_table() copies ucSclkEntryNum entries from
the VBIOS SMU_Info table into pp_atom_ctrl_sclk_range_table. Both the
source (asSclkFcwRangeEntry[]) and destination (table->entry[]) arrays
are fixed at MAX_SCLK_RANGE (8) entries, but ucSclkEntryNum is an
unchecked u8 read straight from the VBIOS, so it can be up to 255. The
destination is stack-allocated in both callers
(polaris10_get_sclk_range_table(), vegam_get_sclk_range_table()), so a
count above 8 overflows a stack buffer, not just a heap read.
Reject counts above MAX_SCLK_RANGE rather than clamping to it. Only
one version of this VBIOS struct (ATOM_SMU_INFO_V2_1) has ever
existed, so a count above 8 corresponds to no legitimate table format
and means either a corrupted or a tampered VBIOS.
Fixes: a23eefa2f461 ("drm/amd/powerplay: enable dpm for baffin.")
Assisted-by: gkh_clanker_t1000
Signed-off-by: Hari Mishal <harimishal1@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
index 6a85a3111facf..d992b1aff5c67 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
@@ -1453,6 +1453,9 @@ int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctr
if (!psmu_info)
return -EINVAL;
+ if (psmu_info->ucSclkEntryNum > MAX_SCLK_RANGE)
+ return -EINVAL;
+
for (i = 0; i < psmu_info->ucSclkEntryNum; i++) {
table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;
table->entry[i].ucPostdiv = psmu_info->asSclkFcwRangeEntry[i].ucPostdiv;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0443/1756] drm/amdgpu: Add vbios build number interface
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (441 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0442/1756] drm/amd/pm: bound SCLK FCW range entries to the table size Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0444/1756] drm/amd: Add correct prefix for VBIOS message Greg Kroah-Hartman
` (555 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Lijo Lazar, Alex Deucher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <lijo.lazar@amd.com>
[ Upstream commit d6fa8026617896c23cb165f09f1c1d32fe22a3df ]
Fetch VBIOS build number from atom rom image. Add a sysfs interface to
read the build number.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: aee05c455ad3 ("drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 33 ++++++++++++++++++--
drivers/gpu/drm/amd/amdgpu/atom.c | 22 +++++++++++++
drivers/gpu/drm/amd/amdgpu/atom.h | 2 ++
3 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index 9254b85d4e70d..ee843869246fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1797,16 +1797,43 @@ static ssize_t amdgpu_atombios_get_vbios_version(struct device *dev,
return sysfs_emit(buf, "%s\n", ctx->vbios_pn);
}
+static ssize_t amdgpu_atombios_get_vbios_build(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct drm_device *ddev = dev_get_drvdata(dev);
+ struct amdgpu_device *adev = drm_to_adev(ddev);
+ struct atom_context *ctx = adev->mode_info.atom_context;
+
+ return sysfs_emit(buf, "%s\n", ctx->build_num);
+}
+
static DEVICE_ATTR(vbios_version, 0444, amdgpu_atombios_get_vbios_version,
NULL);
+static DEVICE_ATTR(vbios_build, 0444, amdgpu_atombios_get_vbios_build, NULL);
static struct attribute *amdgpu_vbios_version_attrs[] = {
- &dev_attr_vbios_version.attr,
- NULL
+ &dev_attr_vbios_version.attr, &dev_attr_vbios_build.attr, NULL
};
+static umode_t amdgpu_vbios_version_attrs_is_visible(struct kobject *kobj,
+ struct attribute *attr,
+ int index)
+{
+ struct device *dev = kobj_to_dev(kobj);
+ struct drm_device *ddev = dev_get_drvdata(dev);
+ struct amdgpu_device *adev = drm_to_adev(ddev);
+ struct atom_context *ctx = adev->mode_info.atom_context;
+
+ if (attr == &dev_attr_vbios_build.attr && !strlen(ctx->build_num))
+ return 0;
+
+ return attr->mode;
+}
+
const struct attribute_group amdgpu_vbios_version_attr_group = {
- .attrs = amdgpu_vbios_version_attrs
+ .attrs = amdgpu_vbios_version_attrs,
+ .is_visible = amdgpu_vbios_version_attrs_is_visible,
};
int amdgpu_atombios_sysfs_init(struct amdgpu_device *adev)
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index bed3083f317b8..286ba13f7e34c 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1497,6 +1497,27 @@ static void atom_get_vbios_version(struct atom_context *ctx)
}
}
+static void atom_get_vbios_build(struct atom_context *ctx)
+{
+ unsigned char *atom_rom_hdr;
+ unsigned char *str;
+ uint16_t base;
+
+ base = CU16(ATOM_ROM_TABLE_PTR);
+ atom_rom_hdr = CSTR(base);
+
+ str = CSTR(CU16(base + ATOM_ROM_CFG_PTR));
+ /* Skip config string */
+ while (str < atom_rom_hdr && *str++)
+ ;
+ /* Skip change list string */
+ while (str < atom_rom_hdr && *str++)
+ ;
+
+ if ((str + STRLEN_NORMAL) < atom_rom_hdr)
+ strscpy(ctx->build_num, str, STRLEN_NORMAL);
+}
+
struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
{
int base;
@@ -1557,6 +1578,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
atom_get_vbios_pn(ctx);
atom_get_vbios_date(ctx);
atom_get_vbios_version(ctx);
+ atom_get_vbios_build(ctx);
return ctx;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.h b/drivers/gpu/drm/amd/amdgpu/atom.h
index b807f6639a4c6..825ff28731f52 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.h
+++ b/drivers/gpu/drm/amd/amdgpu/atom.h
@@ -37,6 +37,7 @@ struct drm_device;
#define ATOM_ROM_MAGIC "ATOM"
#define ATOM_ROM_MAGIC_PTR 4
+#define ATOM_ROM_CFG_PTR 0xC
#define ATOM_ROM_MSG_PTR 0x10
#define ATOM_ROM_CMD_PTR 0x1E
#define ATOM_ROM_DATA_PTR 0x20
@@ -151,6 +152,7 @@ struct atom_context {
uint32_t version;
uint8_t vbios_ver_str[STRLEN_NORMAL];
uint8_t date[STRLEN_NORMAL];
+ uint8_t build_num[STRLEN_NORMAL];
};
extern int amdgpu_atom_debug;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0444/1756] drm/amd: Add correct prefix for VBIOS message
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (442 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0443/1756] drm/amdgpu: Add vbios build number interface Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0445/1756] drm/amdgpu: Print full vbios info Greg Kroah-Hartman
` (554 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mario Limonciello (AMD),
Aurabindo Pillai, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello (AMD) <superm1@kernel.org>
[ Upstream commit e6c7ebeaba4080562e71a59a788ac90b41e09240 ]
It's not obvious which GPU the ATOM BIOS message goes with. Use
drm_info() to show the correct one.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: aee05c455ad3 ("drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/atom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index 286ba13f7e34c..cb7bce00ee283 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1462,7 +1462,7 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
ctx->vbios_pn[count] = 0;
}
- pr_info("ATOM BIOS: %s\n", ctx->vbios_pn);
+ drm_info(ctx->card->dev, "ATOM BIOS: %s\n", ctx->vbios_pn);
}
static void atom_get_vbios_version(struct atom_context *ctx)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0445/1756] drm/amdgpu: Print full vbios info
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (443 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0444/1756] drm/amd: Add correct prefix for VBIOS message Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0446/1756] drm/amdgpu: bounds check ATOM IIO table parsing Greg Kroah-Hartman
` (553 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Lijo Lazar, Alex Deucher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <lijo.lazar@amd.com>
[ Upstream commit 4fd7b724a87a4051401ee2ed64c26c9249582040 ]
Add build number, version and date to the existing part number print.
Example:
[drm] ATOM BIOS: 113-PN000108-103, build: 00159017, ver: 022.040.003.043.000001, 2025/07/27
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: aee05c455ad3 ("drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/atom.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index cb7bce00ee283..d232074692ff3 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1461,8 +1461,6 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
ctx->vbios_pn[count] = 0;
}
-
- drm_info(ctx->card->dev, "ATOM BIOS: %s\n", ctx->vbios_pn);
}
static void atom_get_vbios_version(struct atom_context *ctx)
@@ -1518,6 +1516,30 @@ static void atom_get_vbios_build(struct atom_context *ctx)
strscpy(ctx->build_num, str, STRLEN_NORMAL);
}
+static inline void atom_print_vbios_info(struct atom_context *ctx)
+{
+ char vbios_info[256];
+ int off = 0;
+
+ if (ctx->vbios_pn[0])
+ off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+ "%s", ctx->vbios_pn);
+ if (ctx->build_num[0])
+ off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+ "%sbuild: %s", off ? ", " : "",
+ ctx->build_num);
+ if (ctx->vbios_ver_str[0])
+ off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+ "%sver: %s", off ? ", " : "",
+ ctx->vbios_ver_str);
+ if (ctx->date[0])
+ off += scnprintf(vbios_info + off, sizeof(vbios_info) - off,
+ "%s%.10s", off ? ", " : "",
+ ctx->date);
+ if (off)
+ drm_info(ctx->card->dev, "ATOM BIOS: %s\n", vbios_info);
+}
+
struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
{
int base;
@@ -1580,6 +1602,8 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
atom_get_vbios_version(ctx);
atom_get_vbios_build(ctx);
+ atom_print_vbios_info(ctx);
+
return ctx;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0446/1756] drm/amdgpu: bounds check ATOM IIO table parsing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (444 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0445/1756] drm/amdgpu: Print full vbios info Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0447/1756] drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters Greg Kroah-Hartman
` (552 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lijo Lazar, Alex Deucher, Asad Kamal,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <lijo.lazar@amd.com>
[ Upstream commit be88697602238c3dcb47bbc2db1eef923f63e78b ]
atom_index_iio() parsed the IIO bytecode without bounds checks, allowing
out-of-bounds reads on a malformed VBIOS. Pass the BIOS size into
amdgpu_atom_parse() and bound the parse loops by it.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Assisted-by: Claude Code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: aee05c455ad3 ("drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +-
drivers/gpu/drm/amd/amdgpu/atom.c | 25 ++++++++++++++++----
drivers/gpu/drm/amd/amdgpu/atom.h | 3 ++-
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index ee843869246fe..433757b8552f2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1893,7 +1893,7 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
atom_card_info->pll_read = cail_pll_read;
atom_card_info->pll_write = cail_pll_write;
- adev->mode_info.atom_context = amdgpu_atom_parse(atom_card_info, adev->bios);
+ adev->mode_info.atom_context = amdgpu_atom_parse(atom_card_info, adev->bios, adev->bios_size);
if (!adev->mode_info.atom_context) {
amdgpu_atombios_fini(adev);
return -ENOMEM;
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index d232074692ff3..6405d6e9f1f36 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1316,11 +1316,25 @@ static void atom_index_iio(struct atom_context *ctx, int base)
ctx->iio = kzalloc(2 * 256, GFP_KERNEL);
if (!ctx->iio)
return;
- while (CU8(base) == ATOM_IIO_START) {
- ctx->iio[CU8(base + 1)] = base + 2;
+ while (base + 1 < ctx->bios_size && CU8(base) == ATOM_IIO_START) {
+ uint8_t index = CU8(base + 1);
+ int start = base + 2;
base += 2;
- while (CU8(base) != ATOM_IIO_END)
- base += atom_iio_len[CU8(base)];
+ while (base < ctx->bios_size && CU8(base) != ATOM_IIO_END) {
+ uint8_t op = CU8(base);
+
+ /*
+ * Unknown opcode: its length is unknown so the byte
+ * stream cannot be resynced reliably.
+ */
+ if (op >= ARRAY_SIZE(atom_iio_len))
+ return;
+ base += atom_iio_len[op];
+ }
+ if (base >= ctx->bios_size)
+ return;
+ /* Only index well-formed methods, others stay 0 */
+ ctx->iio[index] = start;
base += 3;
}
}
@@ -1540,7 +1554,7 @@ static inline void atom_print_vbios_info(struct atom_context *ctx)
drm_info(ctx->card->dev, "ATOM BIOS: %s\n", vbios_info);
}
-struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
+struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios, uint32_t bios_size)
{
int base;
struct atom_context *ctx =
@@ -1554,6 +1568,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
ctx->card = card;
ctx->bios = bios;
+ ctx->bios_size = bios_size;
if (CU16(0) != ATOM_BIOS_MAGIC) {
pr_info("Invalid BIOS magic\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.h b/drivers/gpu/drm/amd/amdgpu/atom.h
index 825ff28731f52..5a3f55147c7ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.h
+++ b/drivers/gpu/drm/amd/amdgpu/atom.h
@@ -133,6 +133,7 @@ struct atom_context {
struct card_info *card;
struct mutex mutex;
void *bios;
+ uint32_t bios_size;
uint32_t cmd_table, data_table;
uint16_t *iio;
@@ -157,7 +158,7 @@ struct atom_context {
extern int amdgpu_atom_debug;
-struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios);
+struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios, uint32_t bios_size);
int amdgpu_atom_execute_table(struct atom_context *ctx, int index, uint32_t *params, int params_size);
int amdgpu_atom_asic_init(struct atom_context *ctx);
void amdgpu_atom_destroy(struct atom_context *ctx);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0447/1756] drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (445 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0446/1756] drm/amdgpu: bounds check ATOM IIO table parsing Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0448/1756] ata: sata_dwc_460ex: Dont enable interrupt if libATA core registration fails Greg Kroah-Hartman
` (551 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hari Mishal, Alex Deucher,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hari Mishal <harimishal1@gmail.com>
[ Upstream commit aee05c455ad3e72df9a0591baf0b60da518800f3 ]
atom_get_vbios_date(), atom_get_vbios_pn(), atom_get_vbios_version()
and atom_get_vbios_build() all walk the BIOS image using offsets and
counts taken from the image itself, checked only against each other
and never against ctx->bios_size:
- atom_get_vbios_date() reads 14 bytes at a fixed offset that
check_atom_bios()'s minimum size (0x49) does not cover.
- atom_get_vbios_pn() dereferences an image-supplied u16 string
offset unchecked, then walks and copies from it with only a length
cap, not an image cap.
- atom_get_vbios_version() takes its search bounds from image u16s;
atom_find_str_in_rom() already clamps the search itself, but the
match is then advanced by a fixed 18 bytes and STRLEN_NORMAL bytes
are copied from there with no check that this still lands inside
the image.
- atom_get_vbios_build() walks from an image-supplied config-string
offset toward the ROM header; a config offset at or past the
header makes the pointer difference negative, wrapping through the
u16 'len' and passing strscpy() a bound far larger than the
32-byte destination.
Bound each getter's reads, walks and copies to ctx->bios_size, falling
back to an empty string on a malformed image.
Fixes: 29b4c589b43d ("drm/amdgpu: Add vbios info ioctl interface")
Fixes: d6fa80266178 ("drm/amdgpu: Add vbios build number interface")
Assisted-by: gkh_clanker_t1000
Signed-off-by: Hari Mishal <harimishal1@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/atom.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index 6405d6e9f1f36..ceb132998fe60 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1394,6 +1394,11 @@ static void atom_get_vbios_date(struct atom_context *ctx)
p_rom = ctx->bios;
+ if (ctx->bios_size < OFFSET_TO_VBIOS_DATE + 14) {
+ ctx->date[0] = '\0';
+ return;
+ }
+
date_in_rom = p_rom + OFFSET_TO_VBIOS_DATE;
ctx->date[0] = '2';
@@ -1457,17 +1462,24 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
vbios_str = p_rom + OFFSET_TO_VBIOS_PART_NUMBER;
}
- if (*vbios_str == 0) {
+ if (vbios_str >= p_rom + ctx->bios_size)
+ vbios_str = NULL;
+
+ if (vbios_str == NULL || *vbios_str == 0) {
vbios_str = atom_find_str_in_rom(ctx, BIOS_ATOM_PREFIX, 3, 1024, 64);
if (vbios_str == NULL)
vbios_str += sizeof(BIOS_ATOM_PREFIX) - 1;
+ if (vbios_str >= p_rom + ctx->bios_size)
+ vbios_str = NULL;
}
if (vbios_str != NULL && *vbios_str == 0)
vbios_str++;
if (vbios_str != NULL) {
count = 0;
- while ((count < BIOS_STRING_LENGTH) && vbios_str[count] >= ' ' &&
+ while ((count < BIOS_STRING_LENGTH) &&
+ vbios_str + count < p_rom + ctx->bios_size &&
+ vbios_str[count] >= ' ' &&
vbios_str[count] <= 'z') {
ctx->vbios_pn[count] = vbios_str[count];
count++;
@@ -1500,9 +1512,10 @@ static void atom_get_vbios_version(struct atom_context *ctx)
/* find anchor ATOMBIOSBK-AMD */
vbios_ver =
atom_find_str_in_rom(ctx, BIOS_VERSION_PREFIX, start, end, 64);
- if (vbios_ver != NULL) {
- /* skip ATOMBIOSBK-AMD VER */
- vbios_ver += 18;
+ if (vbios_ver != NULL)
+ vbios_ver += 18; /* skip ATOMBIOSBK-AMD VER */
+
+ if (vbios_ver != NULL && vbios_ver + STRLEN_NORMAL <= p_rom + ctx->bios_size) {
memcpy(ctx->vbios_ver_str, vbios_ver, STRLEN_NORMAL);
} else {
ctx->vbios_ver_str[0] = '\0';
@@ -1518,7 +1531,13 @@ static void atom_get_vbios_build(struct atom_context *ctx)
base = CU16(ATOM_ROM_TABLE_PTR);
atom_rom_hdr = CSTR(base);
+ if ((uint32_t)base + ATOM_ROM_CFG_PTR + sizeof(uint16_t) > ctx->bios_size)
+ return;
+
str = CSTR(CU16(base + ATOM_ROM_CFG_PTR));
+ if (str >= atom_rom_hdr)
+ return;
+
/* Skip config string */
while (str < atom_rom_hdr && *str++)
;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0448/1756] ata: sata_dwc_460ex: Dont enable interrupt if libATA core registration fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (446 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0447/1756] drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0449/1756] libbpf: Reject local struct_ops bitfields before data access Greg Kroah-Hartman
` (550 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikolay Borisov, Niklas Cassel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Borisov <nik.borisov@suse.com>
[ Upstream commit e137035fcd66cb454c479bb989968561bbc60341 ]
Recent 4bbc16a353a9 commit changed the timing when interrupts are
enabled. However it didn't account for the libATA registration step. So
it's possible that interrupts are enabled when the device is not
registered with libATA core.
Resolve the issue by failing the entire registration process in case of
failure to register with libATA.
Fixes: 4bbc16a353a9 ("ata: sata_dwc_460ex: enable SATA interrupts only after IRQ handler is registered")
Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Link: https://lore.kernel.org/r/20260917150707.1643330-1-nik.borisov@suse.com
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/sata_dwc_460ex.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 23753c4ae1b56..b3fbb9f54a9c4 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1184,11 +1184,14 @@ static int sata_dwc_probe(struct platform_device *ofdev)
* error_handler() to execute a dummy Softreset EH session
*/
err = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht);
- if (err)
+ if (err) {
dev_err(dev, "failed to activate host");
+ goto error_out;
+ }
/* Enable SATA Interrupts */
sata_dwc_enable_interrupts(hsdev);
+
return 0;
error_out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0449/1756] libbpf: Reject local struct_ops bitfields before data access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (447 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0448/1756] ata: sata_dwc_460ex: Dont enable interrupt if libATA core registration fails Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0450/1756] Revert "rcu/nocb: Fix rcuog wake-up from offline softirq" Greg Kroah-Hartman
` (549 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mingpei CAO, Andrii Nakryiko,
Amery Hung, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingpei CAO <caomingpei@gmail.com>
[ Upstream commit 961b8946acb482b6d7a39c266d623e5f9c4e873f ]
A local struct_ops type can contain a bitfield absent from the
corresponding kernel BTF type. bpf_map__init_kern_struct_ops() checks
whether data for an absent local member is zero.
For a bitfield, member->offset contains the bit offset and field width.
bpf_map__init_kern_struct_ops() used the encoded value to calculate the
member data pointer before rejecting the bitfield. The zero-data check
could therefore read outside st_ops->data and crash libbpf.
Reject local bitfields before calculating the member data pointer. Keep
the existing rejection for bitfields in the kernel type.
Fixes: c911fc61a7ce ("libbpf: Skip zeroed or null fields if not found in the kernel type.")
Signed-off-by: Mingpei CAO <caomingpei@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Amery Hung <ameryhung@gmail.com>
Link: https://lore.kernel.org/bpf/20260915162252.473044-2-caomingpei@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/lib/bpf/libbpf.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index e43dad57c1125..262da96f2ca3b 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1176,6 +1176,12 @@ static int bpf_map__init_kern_struct_ops(struct bpf_map *map)
const char *mname;
mname = btf__name_by_offset(btf, member->name_off);
+ if (btf_member_bitfield_size(type, i)) {
+ pr_warn("struct_ops init_kern %s: local bitfield %s is not supported\n",
+ map->name, mname);
+ return -ENOTSUP;
+ }
+
moff = member->offset / 8;
mdata = data + moff;
msize = btf__resolve_size(btf, member->type);
@@ -1212,8 +1218,7 @@ static int bpf_map__init_kern_struct_ops(struct bpf_map *map)
}
kern_member_idx = kern_member - btf_members(kern_type);
- if (btf_member_bitfield_size(type, i) ||
- btf_member_bitfield_size(kern_type, kern_member_idx)) {
+ if (btf_member_bitfield_size(kern_type, kern_member_idx)) {
pr_warn("struct_ops init_kern %s: bitfield %s is not supported\n",
map->name, mname);
return -ENOTSUP;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0450/1756] Revert "rcu/nocb: Fix rcuog wake-up from offline softirq"
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (448 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0449/1756] libbpf: Reject local struct_ops bitfields before data access Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0451/1756] rcu/nocb: Remove unnecessary WakeOvfIsDeferred wake path Greg Kroah-Hartman
` (548 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Usama Arif, Joel Fernandes,
Frederic Weisbecker, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frederic Weisbecker <frederic@kernel.org>
[ Upstream commit b95d15980a0f2727a421392ebb50fc6338e43b02 ]
This reverts commit f7345ccc62a4b880cf76458db5f320725f28e400.
swake_up_one_online() has been removed because hrtimers can now assign
a proper online target to hrtimers queued from offline CPUs. Therefore
remove the related hackery.
Link: https://lore.kernel.org/all/20241231170712.149394-4-frederic@kernel.org/
Reviewed-by: Usama Arif <usamaarif642@gmail.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Stable-dep-of: 4c714f015d9e ("rcu: fix shrink budget underflow in lazy_rcu_shrink_scan")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/rcu/tree_nocb.h | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index a1a5942d70170..9db8a88e9e6dc 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -554,19 +554,13 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
rcu_nocb_unlock(rdp);
wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE_LAZY,
TPS("WakeLazy"));
- } else if (!irqs_disabled_flags(flags) && cpu_online(rdp->cpu)) {
+ } else if (!irqs_disabled_flags(flags)) {
/* ... if queue was empty ... */
rcu_nocb_unlock(rdp);
wake_nocb_gp(rdp, false);
trace_rcu_nocb_wake(rcu_state.name, rdp->cpu,
TPS("WakeEmpty"));
} else {
- /*
- * Don't do the wake-up upfront on fragile paths.
- * Also offline CPUs can't call swake_up_one_online() from
- * (soft-)IRQs. Rely on the final deferred wake-up from
- * rcutree_report_cpu_dead()
- */
rcu_nocb_unlock(rdp);
wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE,
TPS("WakeEmptyIsDeferred"));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0451/1756] rcu/nocb: Remove unnecessary WakeOvfIsDeferred wake path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (449 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0450/1756] Revert "rcu/nocb: Fix rcuog wake-up from offline softirq" Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0452/1756] rcu: fix shrink budget underflow in lazy_rcu_shrink_scan Greg Kroah-Hartman
` (547 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frederic Weisbecker,
Paul E. McKenney, Joel Fernandes, Boqun Feng, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joel Fernandes <joelagnelf@nvidia.com>
[ Upstream commit d92eca60fea944b2e9272603308a0fde8b6ae447 ]
The WakeOvfIsDeferred code path in __call_rcu_nocb_wake() attempts to
wake rcuog when the callback count exceeds qhimark and callbacks aren't
done with their GP (newly queued or awaiting GP). However, a lot of
testing proves this wake is always redundant or useless.
In the flooding case, rcuog is always waiting for a GP to finish. So
waking up the rcuog thread is pointless. The timer wakeup adds overhead,
rcuog simply wakes up and goes back to sleep achieving nothing.
This path also adds a full memory barrier, and additional timer expiry
modifications unnecessarily.
The root cause is that WakeOvfIsDeferred fires when
!rcu_segcblist_ready_cbs() (GP not complete), but waking rcuog cannot
accelerate GP completion.
This commit therefore removes this path.
Tested with rcutorture scenarios: TREE01, TREE05, TREE08 (all NOCB
configurations) - all pass. Also stress tested using a kernel module
that floods call_rcu() to trigger the overload conditions and made the
observations confirming the findings.
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Stable-dep-of: 4c714f015d9e ("rcu: fix shrink budget underflow in lazy_rcu_shrink_scan")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/rcu/tree.c | 2 +-
kernel/rcu/tree.h | 3 +--
kernel/rcu/tree_nocb.h | 49 ++++++++++++++----------------------------
3 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 7b073b8b5e91a..517850c738dc9 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -4547,7 +4547,7 @@ static void rcu_barrier_entrain(struct rcu_data *rdp)
}
rcu_nocb_unlock(rdp);
if (wake_nocb)
- wake_nocb_gp(rdp, false);
+ wake_nocb_gp(rdp);
smp_store_release(&rdp->barrier_seq_snap, gseq);
}
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 08c020e01425d..98856a64a266d 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -300,7 +300,6 @@ struct rcu_data {
#define RCU_NOCB_WAKE_BYPASS 1
#define RCU_NOCB_WAKE_LAZY 2
#define RCU_NOCB_WAKE 3
-#define RCU_NOCB_WAKE_FORCE 4
#define RCU_JIFFIES_TILL_FORCE_QS (1 + (HZ > 250) + (HZ > 500))
/* For jiffies_till_first_fqs and */
@@ -499,7 +498,7 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp);
static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp);
static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq);
static void rcu_init_one_nocb(struct rcu_node *rnp);
-static bool wake_nocb_gp(struct rcu_data *rdp, bool force);
+static bool wake_nocb_gp(struct rcu_data *rdp);
static bool rcu_nocb_flush_bypass(struct rcu_data *rdp, struct rcu_head *rhp,
unsigned long j, bool lazy);
static void call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *head,
diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index 9db8a88e9e6dc..6e80285872f1e 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -192,7 +192,7 @@ static void rcu_init_one_nocb(struct rcu_node *rnp)
static bool __wake_nocb_gp(struct rcu_data *rdp_gp,
struct rcu_data *rdp,
- bool force, unsigned long flags)
+ unsigned long flags)
__releases(rdp_gp->nocb_gp_lock)
{
bool needwake = false;
@@ -209,7 +209,7 @@ static bool __wake_nocb_gp(struct rcu_data *rdp_gp,
del_timer(&rdp_gp->nocb_timer);
}
- if (force || READ_ONCE(rdp_gp->nocb_gp_sleep)) {
+ if (READ_ONCE(rdp_gp->nocb_gp_sleep)) {
WRITE_ONCE(rdp_gp->nocb_gp_sleep, false);
needwake = true;
}
@@ -225,13 +225,13 @@ static bool __wake_nocb_gp(struct rcu_data *rdp_gp,
/*
* Kick the GP kthread for this NOCB group.
*/
-static bool wake_nocb_gp(struct rcu_data *rdp, bool force)
+static bool wake_nocb_gp(struct rcu_data *rdp)
{
unsigned long flags;
struct rcu_data *rdp_gp = rdp->nocb_gp_rdp;
raw_spin_lock_irqsave(&rdp_gp->nocb_gp_lock, flags);
- return __wake_nocb_gp(rdp_gp, rdp, force, flags);
+ return __wake_nocb_gp(rdp_gp, rdp, flags);
}
#ifdef CONFIG_RCU_LAZY
@@ -518,10 +518,8 @@ static bool rcu_nocb_try_bypass(struct rcu_data *rdp, struct rcu_head *rhp,
}
/*
- * Awaken the no-CBs grace-period kthread if needed, either due to it
- * legitimately being asleep or due to overload conditions.
- *
- * If warranted, also wake up the kthread servicing this CPUs queues.
+ * Awaken the no-CBs grace-period kthread if needed due to it legitimately
+ * being asleep.
*/
static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
unsigned long flags)
@@ -533,7 +531,6 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
long lazy_len;
long len;
struct task_struct *t;
- struct rcu_data *rdp_gp = rdp->nocb_gp_rdp;
// If we are being polled or there is no kthread, just leave.
t = READ_ONCE(rdp->nocb_gp_kthread);
@@ -549,22 +546,22 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
lazy_len = READ_ONCE(rdp->lazy_len);
if (was_alldone) {
rdp->qlen_last_fqs_check = len;
+ rcu_nocb_unlock(rdp);
// Only lazy CBs in bypass list
if (lazy_len && bypass_len == lazy_len) {
- rcu_nocb_unlock(rdp);
wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE_LAZY,
TPS("WakeLazy"));
} else if (!irqs_disabled_flags(flags)) {
/* ... if queue was empty ... */
- rcu_nocb_unlock(rdp);
- wake_nocb_gp(rdp, false);
+ wake_nocb_gp(rdp);
trace_rcu_nocb_wake(rcu_state.name, rdp->cpu,
TPS("WakeEmpty"));
} else {
- rcu_nocb_unlock(rdp);
wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE,
TPS("WakeEmptyIsDeferred"));
}
+
+ return;
} else if (len > rdp->qlen_last_fqs_check + qhimark) {
/* ... or if many callbacks queued. */
rdp->qlen_last_fqs_check = len;
@@ -575,21 +572,10 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone,
rcu_advance_cbs_nowake(rdp->mynode, rdp);
rdp->nocb_gp_adv_time = j;
}
- smp_mb(); /* Enqueue before timer_pending(). */
- if ((rdp->nocb_cb_sleep ||
- !rcu_segcblist_ready_cbs(&rdp->cblist)) &&
- !timer_pending(&rdp_gp->nocb_timer)) {
- rcu_nocb_unlock(rdp);
- wake_nocb_gp_defer(rdp, RCU_NOCB_WAKE_FORCE,
- TPS("WakeOvfIsDeferred"));
- } else {
- rcu_nocb_unlock(rdp);
- trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot"));
- }
- } else {
- rcu_nocb_unlock(rdp);
- trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot"));
}
+
+ rcu_nocb_unlock(rdp);
+ trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot"));
}
static void call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *head,
@@ -966,7 +952,6 @@ static bool do_nocb_deferred_wakeup_common(struct rcu_data *rdp_gp,
unsigned long flags)
__releases(rdp_gp->nocb_gp_lock)
{
- int ndw;
int ret;
if (!rcu_nocb_need_deferred_wakeup(rdp_gp, level)) {
@@ -974,8 +959,7 @@ static bool do_nocb_deferred_wakeup_common(struct rcu_data *rdp_gp,
return false;
}
- ndw = rdp_gp->nocb_defer_wakeup;
- ret = __wake_nocb_gp(rdp_gp, rdp, ndw == RCU_NOCB_WAKE_FORCE, flags);
+ ret = __wake_nocb_gp(rdp_gp, rdp, flags);
trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("DeferredWake"));
return ret;
@@ -991,7 +975,6 @@ static void do_nocb_deferred_wakeup_timer(struct timer_list *t)
trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Timer"));
raw_spin_lock_irqsave(&rdp->nocb_gp_lock, flags);
- smp_mb__after_spinlock(); /* Timer expire before wakeup. */
do_nocb_deferred_wakeup_common(rdp, rdp, RCU_NOCB_WAKE_BYPASS, flags);
}
@@ -1272,7 +1255,7 @@ lazy_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
}
rcu_nocb_try_flush_bypass(rdp, jiffies);
rcu_nocb_unlock_irqrestore(rdp, flags);
- wake_nocb_gp(rdp, false);
+ wake_nocb_gp(rdp);
sc->nr_to_scan -= _count;
count += _count;
if (sc->nr_to_scan <= 0)
@@ -1644,7 +1627,7 @@ static void rcu_init_one_nocb(struct rcu_node *rnp)
{
}
-static bool wake_nocb_gp(struct rcu_data *rdp, bool force)
+static bool wake_nocb_gp(struct rcu_data *rdp)
{
return false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0452/1756] rcu: fix shrink budget underflow in lazy_rcu_shrink_scan
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (450 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0451/1756] rcu/nocb: Remove unnecessary WakeOvfIsDeferred wake path Greg Kroah-Hartman
@ 2026-11-18 14:42 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0453/1756] PCI: dra7xx: Remove device links to PHY Greg Kroah-Hartman
` (546 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:42 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Longlong Xia, Paul E. McKenney,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Longlong Xia <xialonglong@kylinos.cn>
[ Upstream commit 4c714f015d9ecc37d7a330b31822ccbcaff5ddc9 ]
The lazy RCU shrinker decremented sc->nr_to_scan (unsigned long)
and then tested the result with <= 0. When a single CPU's lazy
callback count exceeds the remaining budget, the subtraction wraps
to a large positive value and the <= 0 comparison, which is
equivalent to == 0 for an unsigned type, never fires again. The
scan loop then iterates through every nocb CPU instead of honouring
the reclaim budget.
Accumulate into count and stop once count >= nr_to_scan.
Fixes: c945b4da7a448 ("rcu: Shrinker for lazy rcu")
Assisted-by: Zcode:GLM-5.2
Signed-off-by: Longlong Xia <xialonglong@kylinos.cn>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/rcu/tree_nocb.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index 6e80285872f1e..1dc9e096f8242 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -1256,9 +1256,8 @@ lazy_rcu_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
rcu_nocb_try_flush_bypass(rdp, jiffies);
rcu_nocb_unlock_irqrestore(rdp, flags);
wake_nocb_gp(rdp);
- sc->nr_to_scan -= _count;
count += _count;
- if (sc->nr_to_scan <= 0)
+ if (count >= sc->nr_to_scan)
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0453/1756] PCI: dra7xx: Remove device links to PHY
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (451 preceding siblings ...)
2026-11-18 14:42 ` [PATCH 6.12 0452/1756] rcu: fix shrink budget underflow in lazy_rcu_shrink_scan Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0454/1756] PCI: dra7xx: Fix clock enable leak on probe failure Greg Kroah-Hartman
` (545 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vladimir Oltean, Bjorn Helgaas,
Aksh Garg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: vladimir.oltean@nxp.com <vladimir.oltean@nxp.com>
[ Upstream commit 52cd9bb3772e82d792cb0def3c2a5a9b6bd24ffb ]
This is a full revert of commit 7a4db656a635 ("PCI: dra7xx: Create
functional dependency between PCIe and PHY").
The trouble with this is that a PHY consumer driver dereferences fields
from struct phy, which will become no longer possible.
Since commit 987351e1ea77 ("phy: core: Add consumer device link support")
from 2019, the PHY core also adds a device link to order PHY provider and
consumer suspend/resume operations. The reverted functionality is from 2017
and is redundant with the PHY core now.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Aksh Garg <a-garg7@ti.com>
Link: https://patch.msgid.link/20260912161440.1032188-3-vladimir.oltean@nxp.com
Stable-dep-of: 768e5d0936d0 ("PCI: dra7xx: Fix clock enable leak on probe failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pci-dra7xx.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index 5c62e1a3ba529..e9e361f498af8 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -9,7 +9,6 @@
#include <linux/clk.h>
#include <linux/delay.h>
-#include <linux/device.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -698,7 +697,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
int i;
int phy_count;
struct phy **phy;
- struct device_link **link;
void __iomem *base;
struct dw_pcie *pci;
struct dra7xx_pcie *dra7xx;
@@ -746,10 +744,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
if (!phy)
return -ENOMEM;
- link = devm_kcalloc(dev, phy_count, sizeof(*link), GFP_KERNEL);
- if (!link)
- return -ENOMEM;
-
dra7xx->clk = devm_clk_get_optional(dev, NULL);
if (IS_ERR(dra7xx->clk))
return dev_err_probe(dev, PTR_ERR(dra7xx->clk),
@@ -764,12 +758,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
phy[i] = devm_phy_get(dev, name);
if (IS_ERR(phy[i]))
return PTR_ERR(phy[i]);
-
- link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
- if (!link[i]) {
- ret = -EINVAL;
- goto err_link;
- }
}
dra7xx->base = base;
@@ -871,10 +859,6 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
pm_runtime_disable(dev);
dra7xx_pcie_disable_phy(dra7xx);
-err_link:
- while (--i >= 0)
- device_link_del(link[i]);
-
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0454/1756] PCI: dra7xx: Fix clock enable leak on probe failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (452 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0453/1756] PCI: dra7xx: Remove device links to PHY Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0455/1756] kconfig: fix extra output from savedefconfig on out-of-range defaults Greg Kroah-Hartman
` (544 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Gu, Manivannan Sadhasivam,
Bjorn Helgaas, Luca Ceresoli, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 768e5d0936d00d663ce2b8c192cc6ab0b61ad461 ]
dra7xx_pcie_probe() enables the optional clock but never disables it
when probing fails afterwards.
Switch to devm_clk_get_optional_enabled(), which disables the clock
automatically on failure.
Fixes: 5af9405397bf ("PCI: dra7xx: Get an optional clock")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260822-dra7xx-v1-1-23e204d5548b@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pci-dra7xx.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index e9e361f498af8..8ceca3ede34ad 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -744,15 +744,11 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
if (!phy)
return -ENOMEM;
- dra7xx->clk = devm_clk_get_optional(dev, NULL);
+ dra7xx->clk = devm_clk_get_optional_enabled(dev, NULL);
if (IS_ERR(dra7xx->clk))
return dev_err_probe(dev, PTR_ERR(dra7xx->clk),
"clock request failed");
- ret = clk_prepare_enable(dra7xx->clk);
- if (ret)
- return ret;
-
for (i = 0; i < phy_count; i++) {
snprintf(name, sizeof(name), "pcie-phy%d", i);
phy[i] = devm_phy_get(dev, name);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0455/1756] kconfig: fix extra output from savedefconfig on out-of-range defaults
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (453 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0454/1756] PCI: dra7xx: Fix clock enable leak on probe failure Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0456/1756] cxl/pci: Skip reset detection for DVSEC emulated decoders Greg Kroah-Hartman
` (543 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Julian Braha,
Nathan Chancellor, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Braha <julianbraha@gmail.com>
[ Upstream commit dbe1ae2304a3b02c3bf6ae82895ff232a29f3fee ]
The Kconfig interpreter currently allows defaults that are outside of the
range bounds.
In these cases, the 'sym_validate_range' function will adjust the default
value to the nearest range bound. For example, see this example:
config A
int
range 1 2
default 16
Here, since the default value of 16 is greater than the bounds, the
effective default value gets adjusted down to the upper bound, 2.
However, 'savedefconfig' writes non-default values, and without being
aware of the automatic adjustment to the range bound, it would write: A=2
This limitation is also documented in a comment: "The following fails to
handle the situation where a default value is further limited by the valid
range."
To resolve this, let's factor out the default-range adjustment logic from
the existing 'sym_validate_range' function into its own
'sym_get_near_range_bound' function for 'savedefconfig' to use too, so
that it compares against the effective value.
Adds tests, accordingly.
Fixes: 7cf3d73b4360 ("kconfig: add savedefconfig")
Assisted-by: Codex:gpt-5.6-sol
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Closes: https://lore.kernel.org/lkml/CAMuHMdVyUAA3L4mUkSjmnuE3cvj-+N8z-Bhxsh1wa-FQWc=fjw@mail.gmail.com/
Signed-off-by: Julian Braha <julianbraha@gmail.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260830221129.2668354-1-julianbraha@gmail.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/kconfig/symbol.c | 39 ++++++++----
.../kconfig/tests/savedefconfig_range/Kconfig | 60 +++++++++++++++++++
.../tests/savedefconfig_range/__init__.py | 8 +++
.../kconfig/tests/savedefconfig_range/config | 7 +++
.../savedefconfig_range/expected_defconfig | 0
5 files changed, 102 insertions(+), 12 deletions(-)
create mode 100644 scripts/kconfig/tests/savedefconfig_range/Kconfig
create mode 100644 scripts/kconfig/tests/savedefconfig_range/__init__.py
create mode 100644 scripts/kconfig/tests/savedefconfig_range/config
create mode 100644 scripts/kconfig/tests/savedefconfig_range/expected_defconfig
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 453721e66c4eb..3aadd9a97a1dd 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -145,7 +145,12 @@ static long long sym_get_range_val(struct symbol *sym, int base)
return strtoll(sym->curr.val, NULL, base);
}
-static void sym_validate_range(struct symbol *sym)
+/*
+ * Return the nearest range bound for an out-of-range default value.
+ * Return NULL if the value is valid or the symbol has no active range.
+ */
+static struct symbol *sym_get_near_range_bound(struct symbol *sym,
+ const char *value)
{
struct property *prop;
struct symbol *range_sym;
@@ -160,21 +165,31 @@ static void sym_validate_range(struct symbol *sym)
base = 16;
break;
default:
- return;
+ return NULL;
}
prop = sym_get_range_prop(sym);
if (!prop)
- return;
- val = strtoll(sym->curr.val, NULL, base);
+ return NULL;
+ val = strtoll(value, NULL, base);
range_sym = prop->expr->left.sym;
val2 = sym_get_range_val(range_sym, base);
if (val >= val2) {
range_sym = prop->expr->right.sym;
val2 = sym_get_range_val(range_sym, base);
if (val <= val2)
- return;
+ return NULL;
}
- sym->curr.val = range_sym->curr.val;
+
+ return range_sym;
+}
+
+static void sym_validate_range(struct symbol *sym)
+{
+ struct symbol *range_sym;
+
+ range_sym = sym_get_near_range_bound(sym, sym->curr.val);
+ if (range_sym)
+ sym->curr.val = range_sym->curr.val;
}
static void sym_set_changed(struct symbol *sym)
@@ -778,7 +793,7 @@ bool sym_set_string_value(struct symbol *sym, const char *newval)
const char *sym_get_string_default(struct symbol *sym)
{
struct property *prop;
- struct symbol *ds;
+ struct symbol *ds, *range_sym;
const char *str = "";
tristate val;
@@ -796,11 +811,6 @@ const char *sym_get_string_default(struct symbol *sym)
val = EXPR_AND(expr_calc_value(prop->expr), prop->visible.tri);
break;
default:
- /*
- * The following fails to handle the situation
- * where a default value is further limited by
- * the valid range.
- */
ds = prop_get_symbol(prop);
if (ds != NULL) {
sym_calc_value(ds);
@@ -844,6 +854,11 @@ const char *sym_get_string_default(struct symbol *sym)
default:
break;
}
+
+ range_sym = sym_get_near_range_bound(sym, str);
+ if (range_sym)
+ str = range_sym->curr.val;
+
return str;
}
diff --git a/scripts/kconfig/tests/savedefconfig_range/Kconfig b/scripts/kconfig/tests/savedefconfig_range/Kconfig
new file mode 100644
index 0000000000000..fd59d9082ed5b
--- /dev/null
+++ b/scripts/kconfig/tests/savedefconfig_range/Kconfig
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: GPL-2.0
+
+# Static default and range values
+
+config INT_DEFAULT_ABOVE_RANGE
+ int
+ range 1 1
+ default 16
+
+config INT_DEFAULT_BELOW_RANGE
+ int
+ range 4 8
+ default 2
+
+# Default and range values determined by other options
+
+config RANGE_UPPER_BOUND
+ int
+ default 3
+
+config INT_DYNAMIC_RANGE
+ int
+ range 0 RANGE_UPPER_BOUND
+ default 4
+
+# Hex
+
+config HEX_DEFAULT_ABOVE_RANGE
+ hex
+ range 0x10 0x20
+ default 0x40
+
+# Implicit default value of 0
+
+config INT_IMPLICIT_DEFAULT_ZERO
+ int
+ range 1 4
+
+# Conditional range
+
+config USE_FIRST_RANGE
+ bool
+ default y
+
+config INT_CONDITIONAL_RANGE
+ int
+ range 1 2 if USE_FIRST_RANGE
+ range 3 4 if !USE_FIRST_RANGE
+ default 3
+
+# Conditional default
+
+config USE_DEFAULT
+ bool
+ default y
+
+config INT_CONDITIONAL_DEFAULT
+ int
+ range 1 2
+ default 3 if USE_DEFAULT
diff --git a/scripts/kconfig/tests/savedefconfig_range/__init__.py b/scripts/kconfig/tests/savedefconfig_range/__init__.py
new file mode 100644
index 0000000000000..961454be732c2
--- /dev/null
+++ b/scripts/kconfig/tests/savedefconfig_range/__init__.py
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
+"""Test savedefconfig with numerical defaults outside of ranges."""
+
+
+def test(conf):
+ assert conf._run_conf('--savedefconfig=defconfig', dot_config='config',
+ out_file='defconfig') == 0
+ assert conf.config_matches('expected_defconfig')
diff --git a/scripts/kconfig/tests/savedefconfig_range/config b/scripts/kconfig/tests/savedefconfig_range/config
new file mode 100644
index 0000000000000..d939cfe5fd349
--- /dev/null
+++ b/scripts/kconfig/tests/savedefconfig_range/config
@@ -0,0 +1,7 @@
+CONFIG_INT_DEFAULT_ABOVE_RANGE=1
+CONFIG_INT_DEFAULT_BELOW_RANGE=4
+CONFIG_INT_DYNAMIC_RANGE=3
+CONFIG_HEX_DEFAULT_ABOVE_RANGE=0x20
+CONFIG_INT_IMPLICIT_DEFAULT_ZERO=1
+CONFIG_INT_CONDITIONAL_RANGE=2
+CONFIG_INT_CONDITIONAL_DEFAULT=2
diff --git a/scripts/kconfig/tests/savedefconfig_range/expected_defconfig b/scripts/kconfig/tests/savedefconfig_range/expected_defconfig
new file mode 100644
index 0000000000000..e69de29bb2d1d
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0456/1756] cxl/pci: Skip reset detection for DVSEC emulated decoders
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (454 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0455/1756] kconfig: fix extra output from savedefconfig on out-of-range defaults Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0457/1756] cxl/port: Fix uninitialized coordinates reported for RCDs Greg Kroah-Hartman
` (542 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Jonathan Cameron,
Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit 17ff3a9fd8669ea53fe83a7013871f30214d5537 ]
HDM decoders are emulated from the DVSEC range registers in two cases:
(a) the component registers expose no HDM decoder capability, or (b) the
capability is present but the DVSEC ranges were the ones in use at driver
load.
After an FLR or SBR, __cxl_endpoint_decoder_reset_detected() reads the HDM
decoder Committed bit for every decoder marked enabled, emulated ones
included. In case (a) regs.hdm_decoder is NULL and the read oopses. In case
(b) the Committed bit was never set, so a reset gets reported that never
happened.
Use the absence of cxld->commit to elide the check for emulated decoders.
Case (b) tested under QEMU: a reset on an endpoint driven down the DVSEC
emulation path no longer reports a reset or strips the decoder flags.
Fixes: 934edcd436dc ("cxl: Add post-reset warning if reset results in loss of previously committed HDM decoders")
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Link: https://lore.kernel.org/linux-cxl/20260811113608.2815625-1-kanie@linux.alibaba.com/
Link: https://patch.msgid.link/20260831110449.719086-1-kanie@linux.alibaba.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/pci.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
index 6a3f2fe772bef..17157238b3156 100644
--- a/drivers/cxl/core/pci.c
+++ b/drivers/cxl/core/pci.c
@@ -700,6 +700,15 @@ static int __cxl_endpoint_decoder_reset_detected(struct device *dev, void *data)
if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)
return 0;
+ /*
+ * Decoders emulated from the DVSEC range registers have no commit
+ * callback and no HDM decoder registers to consult.
+ */
+ if (!cxld->commit) {
+ dev_warn(dev, "DVSEC emulated decode may have been cleared by reset\n");
+ return 0;
+ }
+
cxlhdm = dev_get_drvdata(&port->dev);
hdm = cxlhdm->regs.hdm_decoder;
ctrl = readl(hdm + CXL_HDM_DECODER0_CTRL_OFFSET(cxld->id));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0457/1756] cxl/port: Fix uninitialized coordinates reported for RCDs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (455 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0456/1756] cxl/pci: Skip reset detection for DVSEC emulated decoders Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0458/1756] crypto: qat - fix active_devs leak on crypto alg registration failure Greg Kroah-Hartman
` (541 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixin Liu, Richard Cheng,
Jonathan Cameron, Dave Jiang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixin Liu <kanie@linux.alibaba.com>
[ Upstream commit 58b2b1ef28024093063de536c05aaea792226e24 ]
cxl_endpoint_get_perf_coordinates() returns success for a Restricted CXL
Device without calculating coordinates, so the caller's output array is
left uninitialized. Callers treat it as valid and can expose the stack
residue as access coordinates.
Initialize the coordinates to zero before returning for an RCD. Zeroing in
the helper rather than at the caller keeps the @coord output contract the
exported function documents.
Reported by the Sashiko review bot.
Fixes: 5d211c709059 ("cxl: Fix cxl_endpoint_get_perf_coordinate() support for RCH")
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Link: https://patch.msgid.link/20260831092216.540644-3-kanie@linux.alibaba.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/port.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 5b586c60c77fe..e78f8ebe50e81 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -2198,8 +2198,10 @@ int cxl_endpoint_get_perf_coordinates(struct cxl_port *port,
* Skip calculation for RCD. Expectation is HMAT already covers RCD case
* since RCH does not support hotplug.
*/
- if (cxlmd->cxlds->rcd)
+ if (cxlmd->cxlds->rcd) {
+ memset(coord, 0, sizeof(*coord) * ACCESS_COORDINATE_MAX);
return 0;
+ }
/*
* Exit the loop when the parent port of the current iter port is cxl
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0458/1756] crypto: qat - fix active_devs leak on crypto alg registration failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (456 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0457/1756] cxl/port: Fix uninitialized coordinates reported for RCDs Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0459/1756] crypto: atmel-sha - reject initialization without a device Greg Kroah-Hartman
` (540 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahsan Atta, Giovanni Cabiddu,
Thomas Huth, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahsan Atta <ahsan.atta@intel.com>
[ Upstream commit 178829f1b5b259938188a10f4103fdb901b6435e ]
adf_dev_start() registered both alg sets in a single condition.
If qat_algs_register() succeeds but qat_asym_algs_register() fails,
ADF_STATUS_CRYPTO_ALGS_REGISTERED is left clear, so adf_dev_stop() skips
qat_algs_unregister(): the skciphers and aeads stay registered with
active_devs stuck at 1, pinning the module.
Both helpers leak active_devs internally as well - they increment it and
return without decrementing when a crypto_register_*() call fails, and
the asym path also leaves the already-registered akcipher behind.
Split the registration in adf_dev_start() so that an asym failure
unregisters qat_algs, and unwind active_devs (and the akcipher) on the
error paths of both register helpers. While at it, propagate the error
code returned by the register helpers instead of a blanket -EFAULT.
Fixes: 9b2f33a1bfcd ("crypto: qat - fix unregistration of crypto algorithms")
Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../crypto/intel/qat/qat_common/adf_init.c | 24 ++++++++++++-----
.../crypto/intel/qat/qat_common/qat_algs.c | 15 ++++++-----
.../intel/qat/qat_common/qat_asym_algs.c | 26 ++++++++++++++-----
3 files changed, 45 insertions(+), 20 deletions(-)
diff --git a/drivers/crypto/intel/qat/qat_common/adf_init.c b/drivers/crypto/intel/qat/qat_common/adf_init.c
index 990a6aa1cf8f4..4cbb8774d2a6b 100644
--- a/drivers/crypto/intel/qat/qat_common/adf_init.c
+++ b/drivers/crypto/intel/qat/qat_common/adf_init.c
@@ -248,13 +248,23 @@ static int adf_dev_start(struct adf_accel_dev *accel_dev)
clear_bit(ADF_STATUS_STARTING, &accel_dev->status);
set_bit(ADF_STATUS_STARTED, &accel_dev->status);
- if (!list_empty(&accel_dev->crypto_list) &&
- (qat_algs_register() || qat_asym_algs_register())) {
- dev_err(&GET_DEV(accel_dev),
- "Failed to register crypto algs\n");
- set_bit(ADF_STATUS_STARTING, &accel_dev->status);
- clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
- return -EFAULT;
+ if (!list_empty(&accel_dev->crypto_list)) {
+ ret = qat_algs_register();
+ if (ret) {
+ dev_err(&GET_DEV(accel_dev), "Failed to register crypto algs\n");
+ set_bit(ADF_STATUS_STARTING, &accel_dev->status);
+ clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
+ return ret;
+ }
+
+ ret = qat_asym_algs_register();
+ if (ret) {
+ dev_err(&GET_DEV(accel_dev), "Failed to register crypto asym algs\n");
+ qat_algs_unregister();
+ set_bit(ADF_STATUS_STARTING, &accel_dev->status);
+ clear_bit(ADF_STATUS_STARTED, &accel_dev->status);
+ return ret;
+ }
}
set_bit(ADF_STATUS_CRYPTO_ALGS_REGISTERED, &accel_dev->status);
diff --git a/drivers/crypto/intel/qat/qat_common/qat_algs.c b/drivers/crypto/intel/qat/qat_common/qat_algs.c
index 274bcc83a1fc2..2ff0efb23513a 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_algs.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_algs.c
@@ -1395,19 +1395,22 @@ int qat_algs_register(void)
ret = crypto_register_skciphers(qat_skciphers,
ARRAY_SIZE(qat_skciphers));
if (ret)
- goto unlock;
+ goto err_dec;
ret = crypto_register_aeads(qat_aeads, ARRAY_SIZE(qat_aeads));
if (ret)
- goto unreg_algs;
+ goto err_unreg_skciphers;
-unlock:
mutex_unlock(&algs_lock);
- return ret;
+ return 0;
-unreg_algs:
+err_unreg_skciphers:
crypto_unregister_skciphers(qat_skciphers, ARRAY_SIZE(qat_skciphers));
- goto unlock;
+err_dec:
+ active_devs--;
+unlock:
+ mutex_unlock(&algs_lock);
+ return ret;
}
void qat_algs_unregister(void)
diff --git a/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c b/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
index aa809e6d67bfe..4292efd7c3967 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_asym_algs.c
@@ -1340,13 +1340,25 @@ int qat_asym_algs_register(void)
int ret = 0;
mutex_lock(&algs_lock);
- if (++active_devs == 1) {
- rsa.base.cra_flags = 0;
- ret = crypto_register_akcipher(&rsa);
- if (ret)
- goto unlock;
- ret = crypto_register_kpp(&dh);
- }
+ if (++active_devs != 1)
+ goto unlock;
+
+ rsa.base.cra_flags = 0;
+ ret = crypto_register_akcipher(&rsa);
+ if (ret)
+ goto err_dec;
+
+ ret = crypto_register_kpp(&dh);
+ if (ret)
+ goto err_unreg_akcipher;
+
+ mutex_unlock(&algs_lock);
+ return 0;
+
+err_unreg_akcipher:
+ crypto_unregister_akcipher(&rsa);
+err_dec:
+ active_devs--;
unlock:
mutex_unlock(&algs_lock);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0459/1756] crypto: atmel-sha - reject initialization without a device
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (457 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0458/1756] crypto: qat - fix active_devs leak on crypto alg registration failure Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0460/1756] interconnect: exynos: Remove the PM QoS request on unbind Greg Kroah-Hartman
` (539 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Slavin Liu, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <bolin.liu@seu.edu.cn>
[ Upstream commit a9a2152d292fd0bc73814eb4a127278ee7dd3f6a ]
A transform may be initialized for the first time after the last
device has been removed from the driver list. Return -ENODEV when the
lookup is empty, before the debug message reads dd->dev.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: ebc82efa1cd6 ("crypto: atmel - add Atmel SHA1/SHA256 driver")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/atmel-sha.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 4f2f57bc3bb67..06c91b0bbf22d 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -430,6 +430,9 @@ static int atmel_sha_init(struct ahash_request *req)
struct atmel_sha_reqctx *ctx = ahash_request_ctx(req);
struct atmel_sha_dev *dd = atmel_sha_find_dev(tctx);
+ if (!dd)
+ return -ENODEV;
+
ctx->dd = dd;
ctx->flags = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0460/1756] interconnect: exynos: Remove the PM QoS request on unbind
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (458 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0459/1756] crypto: atmel-sha - reject initialization without a device Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0461/1756] interconnect: qcom: icc-rpm: Handle icc_link_create() failures Greg Kroah-Hartman
` (538 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Georgi Djakov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit 601a54f00723b0b653d76caf26a2a78482d95f00 ]
The Exynos interconnect provider adds a minimum-frequency PM QoS request
to its parent devfreq device. The request is embedded in the provider's
device-managed private data.
The probe error path removes the request, but the remove callback does
not. Unbinding the provider while the parent device remains registered
therefore frees the private data with the request still on the parent's
QoS list. The child's device cleanup does not remove requests registered
against its parent.
Remove the request after deregistering the provider, before the private
data is released.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 2f95b9d5cf0b ("interconnect: Add generic interconnect driver for Exynos SoCs")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260911031750.8182-1-mhun512@gmail.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/interconnect/samsung/exynos.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/interconnect/samsung/exynos.c b/drivers/interconnect/samsung/exynos.c
index c9e5361e17c5b..1d3b4774f34f5 100644
--- a/drivers/interconnect/samsung/exynos.c
+++ b/drivers/interconnect/samsung/exynos.c
@@ -98,6 +98,7 @@ static void exynos_generic_icc_remove(struct platform_device *pdev)
struct exynos_icc_priv *priv = platform_get_drvdata(pdev);
icc_provider_deregister(&priv->provider);
+ dev_pm_qos_remove_request(&priv->qos_req);
icc_nodes_remove(&priv->provider);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0461/1756] interconnect: qcom: icc-rpm: Handle icc_link_create() failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (459 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0460/1756] interconnect: exynos: Remove the PM QoS request on unbind Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0462/1756] interconnect: qcom: use 64-bit SMD RPM bus votes Greg Kroah-Hartman
` (537 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
Abel Vesa, Georgi Djakov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit b2079a6b8e8b92c6c45a22930e5b68a9c5c34645 ]
icc_link_create() can return errors. Don't ignore them.
Assisted-by: LLM
Fixes: 30c8fa3ec61a ("interconnect: qcom: Add MSM8916 interconnect provider driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260909-topic-icc_rpm_smd_qol-v1-3-6dc5b5e97626@oss.qualcomm.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/interconnect/qcom/icc-rpm.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
index a8ed435f696c6..ce21a1a04cd50 100644
--- a/drivers/interconnect/qcom/icc-rpm.c
+++ b/drivers/interconnect/qcom/icc-rpm.c
@@ -581,8 +581,15 @@ int qnoc_probe(struct platform_device *pdev)
node->data = qnodes[i];
icc_node_add(node, provider);
- for (j = 0; j < qnodes[i]->num_links; j++)
- icc_link_create(node, qnodes[i]->links[j]);
+ for (j = 0; j < qnodes[i]->num_links; j++) {
+ ret = icc_link_create(node, qnodes[i]->links[j]);
+ if (ret) {
+ icc_nodes_remove(provider);
+ clk_bulk_disable_unprepare(qp->num_intf_clks,
+ qp->intf_clks);
+ goto err_disable_unprepare_clk;
+ }
+ }
/* Set QoS registers (we only need to do it once, generally) */
if (qnodes[i]->qos.ap_owned &&
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0462/1756] interconnect: qcom: use 64-bit SMD RPM bus votes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (460 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0461/1756] interconnect: qcom: icc-rpm: Handle icc_link_create() failures Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0463/1756] RDMA/core: Fix swapped list_add_tail() arguments in ib_add_sub_device() Greg Kroah-Hartman
` (536 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Abel Vesa,
Gopikrishna Garmidi, Georgi Djakov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit 24e7422ce31189502d07279c083646aaca513311 ]
SMD RPM bus bandwidth requests carry a 64-bit bandwidth value.
The interconnect proxy declared the KVP payload as u32, truncating
votes above 4 GiB/s and advertising the wrong payload size to RPM.
Use a little-endian 64-bit payload and accept a u64 value in the proxy
API. This has always been the right behavior, even on msm-3.10 and
32-bit SoCs.
Fixes: be06f8e7425d ("interconnect: qcom: Add interconnect RPM over SMD driver")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Gopikrishna Garmidi <gopikrishna.garmidi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260904-topic-icc_rpm_64b_req-v1-1-37e24f1991a3@oss.qualcomm.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/interconnect/qcom/icc-rpm.h | 4 ++--
drivers/interconnect/qcom/smd-rpm.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h
index f4883d43eae4d..9b1602b2d5c59 100644
--- a/drivers/interconnect/qcom/icc-rpm.h
+++ b/drivers/interconnect/qcom/icc-rpm.h
@@ -30,7 +30,7 @@ enum qcom_icc_type {
* @resource_type: RPM resource type of the clock resource
* @clock_id: index of the clock resource of a specific resource type
* @branch: whether the resource represents a branch clock
-*/
+ */
struct rpm_clk_resource {
u32 resource_type;
u32 clock_id;
@@ -164,7 +164,7 @@ int qnoc_probe(struct platform_device *pdev);
void qnoc_remove(struct platform_device *pdev);
bool qcom_icc_rpm_smd_available(void);
-int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val);
+int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u64 val);
int qcom_icc_rpm_set_bus_rate(const struct rpm_clk_resource *clk, int ctx, u32 rate);
#endif
diff --git a/drivers/interconnect/qcom/smd-rpm.c b/drivers/interconnect/qcom/smd-rpm.c
index 3816bfb4e2f39..f48d904dde195 100644
--- a/drivers/interconnect/qcom/smd-rpm.c
+++ b/drivers/interconnect/qcom/smd-rpm.c
@@ -21,7 +21,7 @@ static struct qcom_smd_rpm *icc_smd_rpm;
struct icc_rpm_smd_req {
__le32 key;
__le32 nbytes;
- __le32 value;
+ __le64 value;
};
bool qcom_icc_rpm_smd_available(void)
@@ -30,12 +30,12 @@ bool qcom_icc_rpm_smd_available(void)
}
EXPORT_SYMBOL_GPL(qcom_icc_rpm_smd_available);
-int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u32 val)
+int qcom_icc_rpm_smd_send(int ctx, int rsc_type, int id, u64 val)
{
struct icc_rpm_smd_req req = {
.key = cpu_to_le32(RPM_KEY_BW),
- .nbytes = cpu_to_le32(sizeof(u32)),
- .value = cpu_to_le32(val),
+ .nbytes = cpu_to_le32(sizeof(u64)),
+ .value = cpu_to_le64(val),
};
return qcom_rpm_smd_write(icc_smd_rpm, ctx, rsc_type, id, &req,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0463/1756] RDMA/core: Fix swapped list_add_tail() arguments in ib_add_sub_device()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (461 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0462/1756] interconnect: qcom: use 64-bit SMD RPM bus votes Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0464/1756] RDMA/restrack: Dont set RESTRACK_DD mark after a failed xa_insert() Greg Kroah-Hartman
` (535 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit fad7b0dcb0821c0f201df3d85065145857a6f55b ]
ib_add_sub_device() links a new sub-device into its parent's sub-device
list with:
list_add_tail(&parent->subdev_list_head, &sub->subdev_list);
list_add_tail(new, head) expects the node to insert as the first
argument and the list head as the second, so the call above does the
opposite of what was intended: it treats the parent's list head as the
new node and the sub-device's node as the list head.
Because _ib_alloc_device() initialises subdev_list to a self-referencing
empty head, the misplaced insertion does not crash, but it corrupts the
parent->subdev_list_head list. After adding two or more sub-devices,
only the last one is reachable through the parent's head, and
ib_del_sub_device_and_put()'s list_del() on &sub->subdev_list rewrites
the head pointers, potentially severing earlier sub-devices from the
chain. During parent teardown, the reverse iteration over
subdev_list_head then skips the orphaned sub-devices, so their
del_sub_dev() callbacks are never invoked and ib_device_put() on the
parent is never paired, leaking both the HW sub-devices and a refcount.
Swap the arguments to match the documented intent: insert the
sub-device node into the parent's list head.
Fixes: bca51197620a ("RDMA/core: Support IB sub device with type "SMI"")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260916064435.2180-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index d927270bab47c..bc9044f9978a9 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -2846,7 +2846,7 @@ int ib_add_sub_device(struct ib_device *parent,
sub->parent = parent;
mutex_lock(&parent->subdev_lock);
- list_add_tail(&parent->subdev_list_head, &sub->subdev_list);
+ list_add_tail(&sub->subdev_list, &parent->subdev_list_head);
mutex_unlock(&parent->subdev_lock);
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0464/1756] RDMA/restrack: Dont set RESTRACK_DD mark after a failed xa_insert()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (462 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0463/1756] RDMA/core: Fix swapped list_add_tail() arguments in ib_add_sub_device() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0465/1756] RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT Greg Kroah-Hartman
` (534 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit 391c5d826fd0a5dacad54613dbef74c50e966f5c ]
When adding a QP to the restrack xarray, rdma_restrack_add() does:
ret = xa_insert(&rt->xa, res->id, res, GFP_KERNEL);
if (ret)
res->id = 0;
if (qp->qp_type >= IB_QPT_DRIVER)
xa_set_mark(&rt->xa, res->id, RESTRACK_DD);
The xa_set_mark() call is not guarded by "!ret". When xa_insert() fails
(possible on a qp_num collision or memory pressure), res->id is reset to
0, yet the mark is still applied to index 0. If a legitimate QP whose
qp_num is 0 already occupies that slot - e.g. a normal QP or the SMI QP
- it is spuriously tagged as driver-private (RESTRACK_DD), and the
netlink dump path res_get_common_dumpit() then hides it from "rdma res"
output whenever the caller does not request driver details.
Only set the mark when the insertion actually succeeded by folding the
mark into the non-failure branch.
Fixes: e18fa0bbcedf8 ("RDMA/core: Add an option to display driver-specific QPs in the rdmatool")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260916073042.1746-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/restrack.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
index c03042dc1ca5a..c6ecc0d6628d4 100644
--- a/drivers/infiniband/core/restrack.c
+++ b/drivers/infiniband/core/restrack.c
@@ -246,8 +246,7 @@ void rdma_restrack_add(struct rdma_restrack_entry *res)
ret = xa_insert(&rt->xa, res->id, res, GFP_KERNEL);
if (ret)
res->id = 0;
-
- if (qp->qp_type >= IB_QPT_DRIVER)
+ else if (qp->qp_type >= IB_QPT_DRIVER)
xa_set_mark(&rt->xa, res->id, RESTRACK_DD);
} else if (res->type == RDMA_RESTRACK_COUNTER) {
/* Special case to ensure that cntn points to right counter */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0465/1756] RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (463 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0464/1756] RDMA/restrack: Dont set RESTRACK_DD mark after a failed xa_insert() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0466/1756] ACPI: CPPC: Validate the _CPC package header Greg Kroah-Hartman
` (533 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit 9dcacdc41083cccff74292851bf9fde999e0731a ]
The UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via
ib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the
kref to 1) and rdma_restrack_set_name(NULL), the latter attaching the
current task and taking a task_struct reference. When ib_init_ucontext()
subsequently fails, the error path only does:
kfree(attrs->context);
attrs->context = NULL;
without first calling rdma_restrack_put() on &attrs->context->res. The
kref therefore never reaches zero, restrack_release() is never invoked,
and put_task_struct() is never called, so the task_struct reference taken
during set_name is leaked permanently.
A local user with access to an RDMA device can repeat this path (e.g. by
hitting an RDMA cgroup limit or supplying invalid ucaps) and leak one
task_struct reference per attempt, eventually preventing those processes
from being reaped or exhausting memory.
The legacy ib_uverbs_get_context() path already handles this correctly
at its err_ucontext label, where rdma_restrack_put() precedes kfree().
Mirror that ordering here.
Fixes: a1123418ba10 ("RDMA/uverbs: Add ioctl command to get a device context")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260916085529.1838-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/uverbs_std_types_device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/core/uverbs_std_types_device.c b/drivers/infiniband/core/uverbs_std_types_device.c
index fb0555647336f..e028a1ceeb156 100644
--- a/drivers/infiniband/core/uverbs_std_types_device.c
+++ b/drivers/infiniband/core/uverbs_std_types_device.c
@@ -231,6 +231,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_GET_CONTEXT)(
return ret;
ret = ib_init_ucontext(attrs);
if (ret) {
+ rdma_restrack_put(&attrs->context->res);
kfree(attrs->context);
attrs->context = NULL;
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0466/1756] ACPI: CPPC: Validate the _CPC package header
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (464 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0465/1756] RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0467/1756] spi: mxic: fix ps_clk leak in runtime resume Greg Kroah-Hartman
` (532 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Christian Loehle,
Sumit Gupta, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <christian.loehle@arm.com>
[ Upstream commit fb345025f161d17fe7c8a6048c7e80e467fa8ddf ]
The _CPC NumEntries field includes every package element, including
NumEntries and Revision. acpi_cppc_processor_probe() nevertheless reads
those first two elements before checking that they exist and trusts
NumEntries when walking the remaining elements.
Reject packages with fewer than two elements and NumEntries values which
exceed the package count before accessing Revision or iterating over
register descriptors. Although the specification defines NumEntries as the
number of package elements, tolerate additional trailing elements because
ignoring them is safe and avoids rejecting padded firmware.
Revision is specified as a BYTE, but the parser assigns its 64-bit AML
Integer to an unsigned int before validating it. Reject values above U8_MAX
before conversion so, for example, 0x100000004 cannot truncate to revision
4.
Fixes: 337aadff8e45 ("ACPI: Introduce CPU performance controls using CPPC")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260724134251.1632824-1-christian.loehle%40arm.com
Link: https://sashiko.dev/#/patchset/20260808082644.1251332-1-christian.loehle%40arm.com
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Sumit Gupta <sumitg@nvidia.com>
Link: https://patch.msgid.link/20260916162805.1039247-2-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/cppc_acpi.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index 95ab801679e83..bc8481a8c534b 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -737,6 +737,11 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
}
out_obj = (union acpi_object *) output.pointer;
+ if (out_obj->package.count < 2) {
+ pr_debug("Unexpected _CPC package count (%u) for CPU:%d\n",
+ out_obj->package.count, pr->id);
+ goto out_buf_free;
+ }
cpc_ptr = kzalloc(sizeof(struct cpc_desc), GFP_KERNEL);
if (!cpc_ptr) {
@@ -747,12 +752,15 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
/* First entry is NumEntries. */
cpc_obj = &out_obj->package.elements[0];
if (cpc_obj->type == ACPI_TYPE_INTEGER) {
- num_ent = cpc_obj->integer.value;
- if (num_ent <= 1) {
- pr_debug("Unexpected _CPC NumEntries value (%d) for CPU:%d\n",
- num_ent, pr->id);
+ if (cpc_obj->integer.value < 2 ||
+ cpc_obj->integer.value > out_obj->package.count) {
+ pr_debug("Invalid _CPC NumEntries (%llu) for package count (%u) on CPU:%d\n",
+ cpc_obj->integer.value, out_obj->package.count,
+ pr->id);
goto out_free;
}
+
+ num_ent = cpc_obj->integer.value;
} else {
pr_debug("Unexpected _CPC NumEntries entry type (%d) for CPU:%d\n",
cpc_obj->type, pr->id);
@@ -762,6 +770,12 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
/* Second entry should be revision. */
cpc_obj = &out_obj->package.elements[1];
if (cpc_obj->type == ACPI_TYPE_INTEGER) {
+ if (cpc_obj->integer.value > U8_MAX) {
+ pr_debug("Invalid _CPC Revision (%llu) for CPU:%d\n",
+ cpc_obj->integer.value, pr->id);
+ ret = -EINVAL;
+ goto out_free;
+ }
cpc_rev = cpc_obj->integer.value;
} else {
pr_debug("Unexpected _CPC Revision entry type (%d) for CPU:%d\n",
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0467/1756] spi: mxic: fix ps_clk leak in runtime resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (465 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0466/1756] ACPI: CPPC: Validate the _CPC package header Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0468/1756] ACPI: HMAT: preserve hmat_adist_nb notifier block Greg Kroah-Hartman
` (531 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Gu, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 648e3c436032b675b339662ea9c0edd9221add76 ]
mxic_spi_runtime_resume() enables ps_clk before calling
mxic_spi_clk_enable(). If the latter fails, ps_clk was not
disabled.
Unwind ps_clk with clk_disable_unprepare() before returning
the error.
Fixes: b942d80b0a39 ("spi: Add MXIC controller driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260902-mxic-v1-1-76806325826d@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-mxic.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
index 7f88bf8d3764c..5a7d2c674252b 100644
--- a/drivers/spi/spi-mxic.c
+++ b/drivers/spi/spi-mxic.c
@@ -734,7 +734,13 @@ static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)
return ret;
}
- return mxic_spi_clk_enable(mxic);
+ ret = mxic_spi_clk_enable(mxic);
+ if (ret) {
+ clk_disable_unprepare(mxic->ps_clk);
+ return ret;
+ }
+
+ return 0;
}
static const struct dev_pm_ops mxic_spi_dev_pm_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0468/1756] ACPI: HMAT: preserve hmat_adist_nb notifier block
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (466 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0467/1756] spi: mxic: fix ps_clk leak in runtime resume Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0469/1756] dt-bindings: vendor-prefixes: add ESS Technology Greg Kroah-Hartman
` (530 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alejandro Lucero, Dave Jiang,
Jonathan Cameron, Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alejandro Lucero <alucerop@amd.com>
[ Upstream commit b1c75a77d494298b8dedf46062f2072239bbc33b ]
Remove __meminitdata from hmat_adist_nb declaration preserving it even
when CONFIG_MEMORY_HOTPLUG is not set. Otherwise further notifier
registrations using register_mt_adistance_algorithm() will find a
notifier chain likely corrupted.
This is the case when cxl_region_probe() calls
register_mt_adistance_algorithm() what can happen when CXL regions
are dynamically created at any time from Type3 device(s) or when a Type2
device is initialized at its driver probe.
Fixes: 3718c02dbd4c ("acpi, hmat: calculate abstract distance with HMAT")
Signed-off-by: Alejandro Lucero <alucerop@amd.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ rjw: Subject tweak ]
Link: https://patch.msgid.link/20260716181114.35962-2-alejandro.lucero-palau@amd.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/numa/hmat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c
index c805d63df54ad..526ca27de0ca3 100644
--- a/drivers/acpi/numa/hmat.c
+++ b/drivers/acpi/numa/hmat.c
@@ -984,7 +984,7 @@ static int hmat_calculate_adistance(struct notifier_block *self,
return NOTIFY_STOP;
}
-static struct notifier_block hmat_adist_nb __meminitdata = {
+static struct notifier_block hmat_adist_nb = {
.notifier_call = hmat_calculate_adistance,
.priority = 100,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0469/1756] dt-bindings: vendor-prefixes: add ESS Technology
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (467 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0468/1756] ACPI: HMAT: preserve hmat_adist_nb notifier block Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0470/1756] clk: raspberrypi: Handle cpufreq device registration failure Greg Kroah-Hartman
` (529 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Asseily, Krzysztof Kozlowski,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Asseily <karl@asseily.com>
[ Upstream commit beb56d1d3de522885b30bb97fee83825041d65c2 ]
Add the vendor prefix for ESS Technology, Inc., maker of the SABRE family
of audio DACs. The prefix follows the company's domain, esstech.com.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Karl Asseily <karl@asseily.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260918182317.143223-2-karl@asseily.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index af9a8d43b2479..fd7fca71564c6 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -480,6 +480,8 @@ patternProperties:
description: Seiko Epson Corp.
"^esp,.*":
description: Espressif Systems Co. Ltd.
+ "^esstech,.*":
+ description: ESS Technology, Inc.
"^est,.*":
description: ESTeem Wireless Modems
"^ettus,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0470/1756] clk: raspberrypi: Handle cpufreq device registration failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (468 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0469/1756] dt-bindings: vendor-prefixes: add ESS Technology Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0471/1756] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Greg Kroah-Hartman
` (528 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Triet Hoang, Stefan Wahren,
Brian Masney, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Triet Hoang <triet.hoang.dev@gmail.com>
[ Upstream commit e98e3d712023859af7cd78bb7fdb87ea3a9ffb83 ]
Check the return value of platform_device_register_data() when
registering the raspberrypi-cpufreq device and propagate the error
if registration fails.
This prevents the clock driver from reporting a successful probe
when the cpufreq device could not be registered.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Fixes: e2bb18347c8e5 ("clk: raspberrypi: register platform device for raspberrypi-cpufreq")
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/bcm/clk-raspberrypi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
index 6cb26b6e7347d..8fe2256e787ec 100644
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -437,6 +437,8 @@ static int raspberrypi_clk_probe(struct platform_device *pdev)
rpi->cpufreq = platform_device_register_data(dev, "raspberrypi-cpufreq",
-1, NULL, 0);
+ if (IS_ERR(rpi->cpufreq))
+ return PTR_ERR(rpi->cpufreq);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0471/1756] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (469 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0470/1756] clk: raspberrypi: Handle cpufreq device registration failure Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0472/1756] clk: starfive: jh7110: reject oscillator lookup errors Greg Kroah-Hartman
` (527 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Linus Walleij,
Brian Masney, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit c90a50d07f0c38c62ce13a60806ab5e3b841f70f ]
of_get_parent() takes a reference on the syscon parent node. The
reference is intentionally kept on the success path, but the error paths
return without dropping it, leaking the node reference. Release the
reference before returning on the error paths.
Fixes: d430819d69a5 ("clk: versatile-icst: add device tree support")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/versatile/clk-icst.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index d5cb372f0901c..9c1fbfd2c6557 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -498,16 +498,19 @@ static void __init of_syscon_icst_setup(struct device_node *np)
map = syscon_node_to_regmap(parent);
if (IS_ERR(map)) {
pr_err("no regmap for syscon ICST clock parent\n");
+ of_node_put(parent);
return;
}
if (of_property_read_u32(np, "reg", &icst_desc.vco_offset) &&
of_property_read_u32(np, "vco-offset", &icst_desc.vco_offset)) {
pr_err("no VCO register offset for ICST clock\n");
+ of_node_put(parent);
return;
}
if (of_property_read_u32(np, "lock-offset", &icst_desc.lock_offset)) {
pr_err("no lock register offset for ICST clock\n");
+ of_node_put(parent);
return;
}
@@ -534,6 +537,7 @@ static void __init of_syscon_icst_setup(struct device_node *np)
ctype = ICST_INTEGRATOR_CP_CM_MEM;
} else {
pr_err("unknown ICST clock %pOF\n", np);
+ of_node_put(parent);
return;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0472/1756] clk: starfive: jh7110: reject oscillator lookup errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (470 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0471/1756] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0473/1756] bpf, lsm: Reject writes into the BPF LSM program context Greg Kroah-Hartman
` (526 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Slavin Liu, Brian Masney,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <bolin.liu@seu.edu.cn>
[ Upstream commit 54d0b6903921d121fa750546f2b38cc3f5c7e64f ]
Clock lookup may fail while allocating a consumer reference. Return
a notifier error rather than passing ERR_PTR as the new clock parent.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: 538d5477b252 ("clk: starfive: jh7110-sys: Add notifier for PLL0 clock")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/starfive/clk-starfive-jh7110-sys.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c
index 17325f17696f6..f8bff03db80d3 100644
--- a/drivers/clk/starfive/clk-starfive-jh7110-sys.c
+++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c
@@ -401,6 +401,9 @@ static int jh7110_pll0_clk_notifier_cb(struct notifier_block *nb,
if (action == PRE_RATE_CHANGE) {
struct clk *osc = clk_get(priv->dev, "osc");
+ if (IS_ERR(osc))
+ return notifier_from_errno(PTR_ERR(osc));
+
priv->original_clk = clk_get_parent(cpu_root);
ret = clk_set_parent(cpu_root, osc);
clk_put(osc);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0473/1756] bpf, lsm: Reject writes into the BPF LSM program context
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (471 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0472/1756] clk: starfive: jh7110: reject oscillator lookup errors Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0474/1756] pinctrl: fix PINCTRL_SPPCTL=m Greg Kroah-Hartman
` (525 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Borkmann, Alexei Starovoitov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <daniel@iogearbox.net>
[ Upstream commit c42da1d3ba9d5067cf3f0676b98bcb3f5f9e3ce1 ]
The verifier types a load from a tracing-style context by its offset
alone: btf_ctx_access() looks the offset up in the attach hook's
prototype, and check_mem_access() stamps the resulting type onto the
destination register. Nothing tracks what the slot actually holds.
That is sound only as long as the context is read-only, and for BPF LSM
it is not. lsm_verifier_ops wires ->is_valid_access() straight to
btf_ctx_access(), which never looks at enum bpf_access_type, so a store
into the context passes verification. Every other user of the helper
either goes through bpf_tracing_btf_ctx_access() or open-codes the same
type != BPF_READ test first; BPF LSM is the only one that does neither.
A program can therefore store a scalar of its choosing into a context
slot, read the slot back, and get a register the verifier believes is a
trusted pointer of the hook's argument type. Handing that to a kfunc or
helper which dereferences a trusted argument turns it into an arbitrary
kernel access. Route BPF LSM through bpf_tracing_btf_ctx_access() like
everyone else.
Fixes: fc611f47f218 ("bpf: Introduce BPF_PROG_TYPE_LSM")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260915150739.284189-3-daniel@iogearbox.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/bpf_lsm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c
index 140c63a816d09..64d1769fd1584 100644
--- a/kernel/bpf/bpf_lsm.c
+++ b/kernel/bpf/bpf_lsm.c
@@ -408,8 +408,8 @@ const struct bpf_prog_ops lsm_prog_ops = {
};
const struct bpf_verifier_ops lsm_verifier_ops = {
- .get_func_proto = bpf_lsm_func_proto,
- .is_valid_access = btf_ctx_access,
+ .get_func_proto = bpf_lsm_func_proto,
+ .is_valid_access = bpf_tracing_btf_ctx_access,
};
/* hooks return 0 or 1 */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0474/1756] pinctrl: fix PINCTRL_SPPCTL=m
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (472 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0473/1756] bpf, lsm: Reject writes into the BPF LSM program context Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0475/1756] fs/ntfs3: check INDEX_ROOT resident size before use in ntfs_read_mft() Greg Kroah-Hartman
` (524 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andrew Gaylard, Linus Walleij,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Gaylard <ag@ffroot.co.za>
[ Upstream commit 7dcf87d2dbbe8c9c1efb69fe9be728a3dfd51d3d ]
The PINCTRL_SPPCTL option is defined as a tristate in Kconfig, and the
help text suggests that the user can build it as a module by setting to
'm'.
However, it cannot currently be set to 'm', because SOC_SP7021, the only
platform that supports it, is a bool option that uses 'select' on it.
Also, the SP7021 requires this driver to be built in, in order to boot.
Change the tristate to bool and fix the help text.
Tested on linux-next-2026-09-14 on a LTPP3G2 board.
This impossible tristate was detected by kconfirm, a static analysis tool
for Kconfig, by Julian Braha <julianbraha@gmail.com>.
Fixes: aa74c44be19c ("pinctrl: Add driver for Sunplus SP7021")
Signed-off-by: Andrew Gaylard <ag@ffroot.co.za>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/sunplus/Kconfig | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/sunplus/Kconfig b/drivers/pinctrl/sunplus/Kconfig
index 4b5c47c193d97..a359fdbda1b3a 100644
--- a/drivers/pinctrl/sunplus/Kconfig
+++ b/drivers/pinctrl/sunplus/Kconfig
@@ -4,8 +4,8 @@
#
config PINCTRL_SPPCTL
- tristate "Sunplus SP7021 PinMux and GPIO driver"
- depends on SOC_SP7021
+ bool "Sunplus SP7021 PinMux and GPIO driver"
+ depends on SOC_SP7021 || COMPILE_TEST
depends on OF && HAS_IOMEM
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
@@ -17,6 +17,4 @@ config PINCTRL_SPPCTL
help
Say Y here to support Sunplus SP7021 pinmux controller.
This driver requires the pinctrl framework.
- GPIO is provided by the same driver.
- To compile this driver as a module, choose M here.
- The module will be called sppinctrl.
+ This driver also provides GPIO.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0475/1756] fs/ntfs3: check INDEX_ROOT resident size before use in ntfs_read_mft()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (473 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0474/1756] pinctrl: fix PINCTRL_SPPCTL=m Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0476/1756] fs/ntfs3: fix valid_size not being updated in attr_allocate_frame() Greg Kroah-Hartman
` (523 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Xiang Mei (Microsoft), Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei (Microsoft) <xmei5@asu.edu>
[ Upstream commit d0ac69ce3af4dbae01d4f064b7482f0c5440dbde ]
When ntfs_read_mft() parses an ATTR_ROOT attribute it computes
root = Add2Ptr(attr, roff);
using the on-disk resident data offset (roff = attr->res.data_off) and
then dereferences root->type and root->rule, and later passes root on to
indx_init(). Unlike the ATTR_STD and ATTR_NAME cases, which validate that
the resident data is large enough (asize >= sizeof(struct X) + roff and
rsize >= sizeof(struct X)) before accessing it, the ATTR_ROOT case has no
such check.
mi_enum_attr() only guarantees data_off + data_size <= attribute size, so
a crafted image can set data_off such that root lands at (or past) the end
of the MFT record's slab allocation while still passing that check (e.g.
data_size == 0). The subsequent read of root->type is then a
slab-out-of-bounds read, reported by KASAN when mounting the image:
BUG: KASAN: slab-out-of-bounds in ntfs_iget5 (fs/ntfs3/inode.c:283)
Read of size 4 at addr ffff88800c06a400 by task exploit/142
Call Trace:
... [KASAN report internals]
ntfs_iget5 (fs/ntfs3/inode.c:283 fs/ntfs3/inode.c:542)
ntfs_fill_super (fs/ntfs3/super.c:1690)
get_tree_bdev_flags (fs/super.c:1634)
vfs_get_tree (fs/super.c:1694)
fc_mount (fs/namespace.c:1198)
path_mount (fs/namespace.c:3765 ...)
__x64_sys_mount (fs/namespace.c:4174 ...)
do_syscall_64 (arch/x86/entry/syscall_64.c:63)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
The buggy address is located 0 bytes to the right of
allocated 1024-byte region [ffff88800c06a000, ffff88800c06a400)
which belongs to the cache kmalloc-1k of size 1024
Validate the resident data size in the ATTR_ROOT case the same way the
neighbouring cases do, so that a truncated or mis-offset INDEX_ROOT is
rejected before root is dereferenced.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Reported-by: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/inode.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 730c2ab665808..a362ccdcf8065 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -283,7 +283,9 @@ static struct inode *ntfs_read_mft(struct inode *inode,
break;
case ATTR_ROOT:
- if (attr->non_res)
+ if (attr->non_res ||
+ asize < sizeof(struct INDEX_ROOT) + roff ||
+ rsize < sizeof(struct INDEX_ROOT))
goto out;
root = Add2Ptr(attr, roff);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0476/1756] fs/ntfs3: fix valid_size not being updated in attr_allocate_frame()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (474 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0475/1756] fs/ntfs3: check INDEX_ROOT resident size before use in ntfs_read_mft() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0477/1756] fs/ntfs3: validate EA entry layout against ef->size in ntfs_read_ea Greg Kroah-Hartman
` (522 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhan Xusheng, Konstantin Komarov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
[ Upstream commit a1972501ffb15313f7ae598989bb2cd32829e625 ]
At the end of attr_allocate_frame() the on-disk valid_size is meant to be
updated to the value passed in via @new_valid:
valid_size = le64_to_cpu(attr_b->nres.valid_size);
if (new_valid != valid_size) {
attr_b->nres.valid_size = cpu_to_le64(valid_size);
mi_b->dirty = true;
}
but it writes back the old valid_size that was just read instead of
new_valid, so the field is never actually changed even though the record
is marked dirty -- the intended update is a no-op.
ni_update_parent() spells the same read-compare-write out correctly a few
hundred lines away, storing the newly derived value:
valid_le = cpu_to_le64(new_valid);
if (valid_le != attr->nres.valid_size) {
attr->nres.valid_size = valid_le;
In practice that path, reached from ni_write_inode(), re-derives
nres.valid_size from ni->i_valid on inode write-back, which normally masks
this, so the visible impact is limited. The assignment here is still
wrong though; store @new_valid as intended.
Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations")
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/attrib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index dc928a9a272af..bfb192ec29950 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -1868,7 +1868,7 @@ int attr_allocate_frame(struct ntfs_inode *ni, CLST frame, size_t compr_size,
valid_size = le64_to_cpu(attr_b->nres.valid_size);
if (new_valid != valid_size) {
- attr_b->nres.valid_size = cpu_to_le64(valid_size);
+ attr_b->nres.valid_size = cpu_to_le64(new_valid);
mi_b->dirty = true;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0477/1756] fs/ntfs3: validate EA entry layout against ef->size in ntfs_read_ea
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (475 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0476/1756] fs/ntfs3: fix valid_size not being updated in attr_allocate_frame() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0478/1756] fs/ntfs3: validate $SDH entry size in ntfs_insert_security Greg Kroah-Hartman
` (521 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Weiming Shi, Xiang Mei,
Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
[ Upstream commit 01e56820ef52d14a5560fb7c0c6f2f75ef6f9393 ]
In ntfs_read_ea(), the ef->size branch only checks that the declared
entry size fits the remaining buffer; unlike the zero-size branch it
never verifies that the entry's own name and value fit inside ef->size.
A crafted image can thus present an in-bounds ef->size with an arbitrary
elength, which find_ea()/ntfs_get_ea() later use as the memcpy length,
reading past the allocation and leaking adjacent heap memory:
BUG: KASAN: slab-out-of-bounds in ntfs_get_ea (fs/ntfs3/xattr.c:302)
Read of size 65535 at addr ffff888010770b0f by task exploit/142
...
__asan_memcpy (mm/kasan/shadow.c:105)
ntfs_get_ea (fs/ntfs3/xattr.c:302)
ntfs_getxattr (fs/ntfs3/xattr.c:848)
__vfs_getxattr (fs/xattr.c:446)
vfs_getxattr (fs/xattr.c:479)
do_getxattr (fs/xattr.c:808)
filename_getxattr (fs/xattr.c:837)
path_getxattrat (fs/xattr.c:876)
do_syscall_64 (arch/x86/entry/syscall_64.c:94)
...
The buggy address is located 15 bytes inside of
allocated 20-byte region, cache kmalloc-32
Validate the name/value layout in the ef->size branch too, bounding it
against ef->size, as the zero-size branch validates it against the
buffer.
Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations")
Reported-by: Weiming Shi <bestswngs@gmail.com>
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Xiang Mei <xmei5@asu.edu>
[almaz.alexandrovich@paragon-software.com: remove duplicate check of need > ea_size]
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/xattr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index b37e8d477d3c2..0aef218a9b196 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -168,6 +168,8 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea,
ea_size = le32_to_cpu(ef->size);
if (ea_size > bytes || packed_size > ea_size)
goto out1;
+ if (bytes < offsetof(struct EA_FULL, name))
+ goto out1;
continue;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0478/1756] fs/ntfs3: validate $SDH entry size in ntfs_insert_security
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (476 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0477/1756] fs/ntfs3: validate EA entry layout against ef->size in ntfs_read_ea Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0479/1756] pmdomain: imx: Propagate SCU provider registration failures Greg Kroah-Hartman
` (520 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Weiming Shi, Xiang Mei,
Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei <xmei5@asu.edu>
[ Upstream commit 5b76487f94dacc2884135ce9a7bda61ce7ffa209 ]
ntfs_insert_security() walks the $Secure::$SDH index and reads
e->sec_hdr.size for every entry returned by indx_find()/indx_find_sort().
Those only guarantee the NTFS_DE envelope (e->size), so a crafted $SDH
entry shorter than a full NTFS_DE_SDH at the tail of an index buffer makes
the read of e->sec_hdr.size run past the allocation. Triggerable by an
unprivileged setxattr(2) on a crafted NTFS image.
BUG: KASAN: slab-out-of-bounds in ntfs_insert_security (fs/ntfs3/fsntfs.c:2148)
Read of size 4 at addr ffff88800fa1de00 by task exploit/142
ntfs_insert_security (fs/ntfs3/fsntfs.c:2148)
ntfs_setxattr (fs/ntfs3/xattr.c:947)
__vfs_setxattr (fs/xattr.c:223)
__vfs_setxattr_noperm (fs/xattr.c:257)
vfs_setxattr (fs/xattr.c:344)
filename_setxattr (fs/xattr.c:690)
path_setxattrat (fs/xattr.c:734)
__x64_sys_setxattr (fs/xattr.c:764)
[...]
The buggy address is located 0 bytes to the right of
allocated 512-byte region [ffff88800fa1dc00, ffff88800fa1de00)
Stop the scan when an entry is too small to hold a SECURITY_HDR.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Reported-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/fsntfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
index c9ff8293fea73..1510f2c4ced9c 100644
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -2160,6 +2160,9 @@ int ntfs_insert_security(struct ntfs_sb_info *sbi,
goto out;
while (e) {
+ if (le16_to_cpu(e->de.size) < SIZEOF_SDH_DIRENTRY)
+ break;
+
if (le32_to_cpu(e->sec_hdr.size) == new_sec_size) {
err = ntfs_read_run_nb(sbi, &ni->file.run,
le64_to_cpu(e->sec_hdr.off),
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0479/1756] pmdomain: imx: Propagate SCU provider registration failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (477 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0478/1756] fs/ntfs3: validate $SDH entry size in ntfs_insert_security Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0480/1756] dt-bindings: vendor-prefixes: add vendor prefix for Nexperia B.V Greg Kroah-Hartman
` (519 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Ulf Hansson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit d3efba7921f3ebebd91fc481910a428c78414fd8 ]
imx_scu_init_pm_domains() ignores of_genpd_add_provider_onecell() and
returns success even when none of the initialized domains are published to
DT consumers.
Return the provider error and remove the initialized domains in reverse
order before devm releases their backing storage on probe failure.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: c800cd7824bd ("firmware: imx: add SCU power domain driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pmdomain/imx/scu-pd.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/pmdomain/imx/scu-pd.c b/drivers/pmdomain/imx/scu-pd.c
index 3ec33667a308c..41dd45b48a762 100644
--- a/drivers/pmdomain/imx/scu-pd.c
+++ b/drivers/pmdomain/imx/scu-pd.c
@@ -474,7 +474,7 @@ static int imx_scu_init_pm_domains(struct device *dev,
struct genpd_onecell_data *pd_data;
struct imx_sc_pm_domain *sc_pd;
u32 count = 0;
- int i, j;
+ int i, j, ret;
for (i = 0; i < pd_soc->num_ranges; i++)
count += pd_ranges[i].num;
@@ -503,7 +503,13 @@ static int imx_scu_init_pm_domains(struct device *dev,
pd_data->num_domains = count;
pd_data->xlate = imx_scu_pd_xlate;
- of_genpd_add_provider_onecell(dev->of_node, pd_data);
+ ret = of_genpd_add_provider_onecell(dev->of_node, pd_data);
+ if (ret) {
+ while (count)
+ pm_genpd_remove(domains[--count]);
+
+ return ret;
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0480/1756] dt-bindings: vendor-prefixes: add vendor prefix for Nexperia B.V.
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (478 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0479/1756] pmdomain: imx: Propagate SCU provider registration failures Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0481/1756] bpftool: Using the right format specifiers Greg Kroah-Hartman
` (518 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Neil Armstrong, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <neil.armstrong@linaro.org>
[ Upstream commit 819a3e62d37a2fe73c1e7f241f2ac086042e7757 ]
Document the vendor prefix for the semiconductor company Nexperia B.V.
The company website is https://www.nexperia.com/
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260921-topic-sm8x50-nex10000ub-v2-1-eeeaf9b0c913@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index fd7fca71564c6..1866ea628ee6c 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1041,6 +1041,8 @@ patternProperties:
description: New Vision Display (Shenzhen) Co., Ltd.
"^nexbox,.*":
description: Nexbox
+ "^nexperia,.*":
+ description: Nexperia B.V.
"^nextthing,.*":
description: Next Thing Co.
"^ni,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0481/1756] bpftool: Using the right format specifiers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (479 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0480/1756] dt-bindings: vendor-prefixes: add vendor prefix for Nexperia B.V Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0482/1756] bpftool: Make skeleton C++ compatible with explicit casts Greg Kroah-Hartman
` (517 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiayuan Chen, Andrii Nakryiko,
Quentin Monnet, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <mrpre@163.com>
[ Upstream commit 17c3dc50294ba445ddc7d50020df6452e93d38b2 ]
Fixed some formatting specifiers errors, such as using %d for int and %u
for unsigned int, as well as other byte-length types.
Signed-off-by: Jiayuan Chen <mrpre@163.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20250207123706.727928-2-mrpre@163.com
Stable-dep-of: a885470df10b ("bpftool: Compute map size of light skeletons at runtime")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/gen.c | 12 ++++++------
tools/bpf/bpftool/link.c | 14 +++++++-------
tools/bpf/bpftool/main.c | 8 ++++----
tools/bpf/bpftool/map.c | 10 +++++-----
4 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index a89cd4f163127..ab0d780225cfa 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -670,7 +670,7 @@ static void codegen_destroy(struct bpf_object *obj, const char *obj_name)
continue;
if (bpf_map__is_internal(map) &&
(bpf_map__map_flags(map) & BPF_F_MMAPABLE))
- printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$zd);\n",
+ printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$zu);\n",
ident, bpf_map_mmap_sz(map));
codegen("\
\n\
@@ -984,7 +984,7 @@ static int walk_st_ops_shadow_vars(struct btf *btf, const char *ident,
offset = m->offset / 8;
if (next_offset < offset)
- printf("\t\t\tchar __padding_%d[%d];\n", i, offset - next_offset);
+ printf("\t\t\tchar __padding_%d[%u];\n", i, offset - next_offset);
switch (btf_kind(member_type)) {
case BTF_KIND_INT:
@@ -1052,7 +1052,7 @@ static int walk_st_ops_shadow_vars(struct btf *btf, const char *ident,
/* Cannot fail since it must be a struct type */
size = btf__resolve_size(btf, map_type_id);
if (next_offset < (__u32)size)
- printf("\t\t\tchar __padding_end[%d];\n", size - next_offset);
+ printf("\t\t\tchar __padding_end[%u];\n", size - next_offset);
out:
btf_dump__free(d);
@@ -2095,7 +2095,7 @@ btfgen_mark_type(struct btfgen_info *info, unsigned int type_id, bool follow_poi
break;
/* tells if some other type needs to be handled */
default:
- p_err("unsupported kind: %s (%d)", btf_kind_str(btf_type), type_id);
+ p_err("unsupported kind: %s (%u)", btf_kind_str(btf_type), type_id);
return -EINVAL;
}
@@ -2147,7 +2147,7 @@ static int btfgen_record_field_relo(struct btfgen_info *info, struct bpf_core_sp
btf_type = btf__type_by_id(btf, type_id);
break;
default:
- p_err("unsupported kind: %s (%d)",
+ p_err("unsupported kind: %s (%u)",
btf_kind_str(btf_type), btf_type->type);
return -EINVAL;
}
@@ -2246,7 +2246,7 @@ static int btfgen_mark_type_match(struct btfgen_info *info, __u32 type_id, bool
}
/* tells if some other type needs to be handled */
default:
- p_err("unsupported kind: %s (%d)", btf_kind_str(btf_type), type_id);
+ p_err("unsupported kind: %s (%u)", btf_kind_str(btf_type), type_id);
return -EINVAL;
}
diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
index 5cd503b763d72..52fd2c9fac56e 100644
--- a/tools/bpf/bpftool/link.c
+++ b/tools/bpf/bpftool/link.c
@@ -107,7 +107,7 @@ static int link_parse_fd(int *argc, char ***argv)
fd = bpf_link_get_fd_by_id(id);
if (fd < 0)
- p_err("failed to get link with ID %d: %s", id, strerror(errno));
+ p_err("failed to get link with ID %u: %s", id, strerror(errno));
return fd;
} else if (is_prefix(**argv, "pinned")) {
char *path;
@@ -404,7 +404,7 @@ static char *perf_config_hw_cache_str(__u64 config)
if (hw_cache)
snprintf(str, PERF_HW_CACHE_LEN, "%s-", hw_cache);
else
- snprintf(str, PERF_HW_CACHE_LEN, "%lld-", config & 0xff);
+ snprintf(str, PERF_HW_CACHE_LEN, "%llu-", config & 0xff);
op = perf_event_name(evsel__hw_cache_op, (config >> 8) & 0xff);
if (op)
@@ -412,7 +412,7 @@ static char *perf_config_hw_cache_str(__u64 config)
"%s-", op);
else
snprintf(str + strlen(str), PERF_HW_CACHE_LEN - strlen(str),
- "%lld-", (config >> 8) & 0xff);
+ "%llu-", (config >> 8) & 0xff);
result = perf_event_name(evsel__hw_cache_result, config >> 16);
if (result)
@@ -420,7 +420,7 @@ static char *perf_config_hw_cache_str(__u64 config)
"%s", result);
else
snprintf(str + strlen(str), PERF_HW_CACHE_LEN - strlen(str),
- "%lld", config >> 16);
+ "%llu", config >> 16);
return str;
}
@@ -623,7 +623,7 @@ static void show_link_ifindex_plain(__u32 ifindex)
else
snprintf(devname, sizeof(devname), "(detached)");
if (ret)
- snprintf(devname, sizeof(devname), "%s(%d)",
+ snprintf(devname, sizeof(devname), "%s(%u)",
tmpname, ifindex);
printf("ifindex %s ", devname);
}
@@ -699,7 +699,7 @@ void netfilter_dump_plain(const struct bpf_link_info *info)
if (pfname)
printf("\n\t%s", pfname);
else
- printf("\n\tpf: %d", pf);
+ printf("\n\tpf: %u", pf);
if (hookname)
printf(" %s", hookname);
@@ -773,7 +773,7 @@ static void show_uprobe_multi_plain(struct bpf_link_info *info)
printf("func_cnt %u ", info->uprobe_multi.count);
if (info->uprobe_multi.pid)
- printf("pid %d ", info->uprobe_multi.pid);
+ printf("pid %u ", info->uprobe_multi.pid);
printf("\n\t%-16s %-16s %-16s", "offset", "ref_ctr_offset", "cookies");
for (i = 0; i < info->uprobe_multi.count; i++) {
diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
index be60478b4692d..1120dbcaf66b2 100644
--- a/tools/bpf/bpftool/main.c
+++ b/tools/bpf/bpftool/main.c
@@ -152,7 +152,7 @@ static int do_version(int argc, char **argv)
BPFTOOL_MINOR_VERSION, BPFTOOL_PATCH_VERSION);
#endif
jsonw_name(json_wtr, "libbpf_version");
- jsonw_printf(json_wtr, "\"%d.%d\"",
+ jsonw_printf(json_wtr, "\"%u.%u\"",
libbpf_major_version(), libbpf_minor_version());
jsonw_name(json_wtr, "features");
@@ -374,7 +374,7 @@ static int do_batch(int argc, char **argv)
while ((cp = strstr(buf, "\\\n")) != NULL) {
if (!fgets(contline, sizeof(contline), fp) ||
strlen(contline) == 0) {
- p_err("missing continuation line on command %d",
+ p_err("missing continuation line on command %u",
lines);
err = -1;
goto err_close;
@@ -385,7 +385,7 @@ static int do_batch(int argc, char **argv)
*cp = '\0';
if (strlen(buf) + strlen(contline) + 1 > sizeof(buf)) {
- p_err("command %d is too long", lines);
+ p_err("command %u is too long", lines);
err = -1;
goto err_close;
}
@@ -427,7 +427,7 @@ static int do_batch(int argc, char **argv)
err = -1;
} else {
if (!json_output)
- printf("processed %d commands\n", lines);
+ printf("processed %u commands\n", lines);
}
err_close:
if (fp != stdin)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index a9c8af7db19ae..cbfcd4330a91b 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -285,7 +285,7 @@ static void print_entry_plain(struct bpf_map_info *info, unsigned char *key,
}
if (info->value_size) {
for (i = 0; i < n; i++) {
- printf("value (CPU %02d):%c",
+ printf("value (CPU %02u):%c",
i, info->value_size > 16 ? '\n' : ' ');
fprint_hex(stdout, value + i * step,
info->value_size, " ");
@@ -316,7 +316,7 @@ static char **parse_bytes(char **argv, const char *name, unsigned char *val,
}
if (i != n) {
- p_err("%s expected %d bytes got %d", name, n, i);
+ p_err("%s expected %u bytes got %u", name, n, i);
return NULL;
}
@@ -462,7 +462,7 @@ static void show_map_header_json(struct bpf_map_info *info, json_writer_t *wtr)
jsonw_string_field(wtr, "name", info->name);
jsonw_name(wtr, "flags");
- jsonw_printf(wtr, "%d", info->map_flags);
+ jsonw_printf(wtr, "%u", info->map_flags);
}
static int show_map_close_json(int fd, struct bpf_map_info *info)
@@ -588,7 +588,7 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info)
if (prog_type_str)
printf("owner_prog_type %s ", prog_type_str);
else
- printf("owner_prog_type %d ", prog_type);
+ printf("owner_prog_type %u ", prog_type);
}
if (owner_jited)
printf("owner%s jited",
@@ -615,7 +615,7 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info)
printf("\n\t");
if (info->btf_id)
- printf("btf_id %d", info->btf_id);
+ printf("btf_id %u", info->btf_id);
if (frozen)
printf("%sfrozen", info->btf_id ? " " : "");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0482/1756] bpftool: Make skeleton C++ compatible with explicit casts
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (480 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0481/1756] bpftool: Using the right format specifiers Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0483/1756] bpftool: Generate skeleton for global percpu data Greg Kroah-Hartman
` (516 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, WanLi Niu, Menglong Dong,
Andrii Nakryiko, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: WanLi Niu <niuwl1@chinatelecom.cn>
[ Upstream commit 4effccde0a0521b220c3585c9a0d8e677d345209 ]
Fix C++ compilation errors in generated skeleton by adding explicit
pointer casts and use char * subtraction for offset calculation
error: invalid conversion from 'void*' to '<obj_name>*' [-fpermissive]
| skel = skel_alloc(sizeof(*skel));
| ~~~~~~~~~~^~~~~~~~~~~~~~~
| |
| void*
error: arithmetic on pointers to void
| skel->ctx.sz = (void *)&skel->links - (void *)skel;
| ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
error: assigning to 'struct <obj_name>__<ident> *' from incompatible type 'void *'
| skel-><ident> = skel_prep_map_data((void *)data, 4096,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| sizeof(data) - 1);
| ~~~~~~~~~~~~~~~~~
error: assigning to 'struct <obj_name>__<ident> *' from incompatible type 'void *'
| skel-><ident> = skel_finalize_map_data(&skel->maps.<ident>.initial_value,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 4096, PROT_READ | PROT_WRITE, skel->maps.<ident>.map_fd);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Minimum reproducer:
$ cat test.bpf.c
int val; // placed in .bss section
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
SEC("raw_tracepoint/sched_wakeup_new") int handle(void *ctx) { return 0; }
$ cat test.cpp
#include <cerrno>
extern "C" {
#include "test.bpf.skel.h"
}
$ bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
$ clang -g -O2 -target bpf -c test.bpf.c -o test.bpf.o
$ bpftool gen skeleton test.bpf.o -L > test.bpf.skel.h
$ g++ -c test.cpp -I.
Co-developed-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: WanLi Niu <niuwl1@chinatelecom.cn>
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260106023123.2928-1-kiraskyler@163.com
Stable-dep-of: a885470df10b ("bpftool: Compute map size of light skeletons at runtime")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/gen.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index ab0d780225cfa..40e4b5848ee36 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -723,10 +723,10 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
{ \n\
struct %1$s *skel; \n\
\n\
- skel = skel_alloc(sizeof(*skel)); \n\
+ skel = (struct %1$s *)skel_alloc(sizeof(*skel)); \n\
if (!skel) \n\
goto cleanup; \n\
- skel->ctx.sz = (void *)&skel->links - (void *)skel; \n\
+ skel->ctx.sz = (char *)&skel->links - (char *)skel; \n\
",
obj_name, opts.data_sz);
bpf_object__for_each_map(map, obj) {
@@ -747,7 +747,7 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
\n\
\"; \n\
\n\
- skel->%1$s = skel_prep_map_data((void *)data, %2$zd,\n\
+ skel->%1$s = (__typeof__(skel->%1$s))skel_prep_map_data((void *)data, %2$zd,\n\
sizeof(data) - 1);\n\
if (!skel->%1$s) \n\
goto cleanup; \n\
@@ -805,7 +805,7 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
codegen("\
\n\
- skel->%1$s = skel_finalize_map_data(&skel->maps.%1$s.initial_value, \n\
+ skel->%1$s = (__typeof__(skel->%1$s))skel_finalize_map_data(&skel->maps.%1$s.initial_value,\n\
%2$zd, %3$s, skel->maps.%1$s.map_fd);\n\
if (!skel->%1$s) \n\
return -ENOMEM; \n\
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0483/1756] bpftool: Generate skeleton for global percpu data
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (481 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0482/1756] bpftool: Make skeleton C++ compatible with explicit casts Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0484/1756] bpftool: Compute map size of light skeletons at runtime Greg Kroah-Hartman
` (515 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Andrii Nakryiko,
Quentin Monnet, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Hwang <leon.hwang@linux.dev>
[ Upstream commit 68d4fde73cf78a7ab858ed040f54e1851cc3815c ]
Enhance bpftool to generate skeletons that properly handle global percpu
variables. The generated skeleton now includes a dedicated structure for
percpu data, allowing users to initialize and access percpu variables more
efficiently.
For global percpu variables, the skeleton now includes a nested
structure, e.g.:
struct test_global_percpu_data {
struct bpf_object_skeleton *skeleton;
struct bpf_object *obj;
struct {
struct bpf_map *percpu;
} maps;
// ...
struct test_global_percpu_data__percpu {
int data;
char run;
struct {
char set;
int i;
int nums[7];
} struct_data;
int nums[7];
} *percpu;
// ...
};
* The "struct test_global_percpu_data__percpu *percpu" points to
initialized data, which is actually "maps.percpu->mmaped".
* Before loading the skeleton, updating the
"struct test_global_percpu_data__percpu *percpu" modifies the initial
value of the corresponding global percpu variables.
* After loading the skeleton, "maps.percpu->mmaped" has been marked as
read-only in libbpf. If users want to update the global percpu
variables, they have to update the "maps.percpu" map instead.
* For lightweight skeleton, "lskel->percpu" will be protected by
"mprotect(p, sz, PROT_READ)".
* For subskeleton, those variables of global percpu data will be
skipped.
Assisted-by: Codex:gpt-5.5-xhigh
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20260813152324.97937-7-leon.hwang@linux.dev
Stable-dep-of: a885470df10b ("bpftool: Compute map size of light skeletons at runtime")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/gen.c | 53 +++++++++++++++++++++++++++--------
tools/lib/bpf/skel_internal.h | 24 ++++++++++++++--
2 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index 40e4b5848ee36..de2264da98d1c 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -101,6 +101,12 @@ static bool get_map_ident(const struct bpf_map *map, char *buf, size_t buf_sz)
return true;
}
+ if (bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY) {
+ snprintf(buf, buf_sz, "%s", name + 1);
+ sanitize_identifier(buf);
+ return true;
+ }
+
for (i = 0, n = ARRAY_SIZE(sfxs); i < n; i++) {
const char *sfx = sfxs[i], *p;
@@ -117,7 +123,7 @@ static bool get_map_ident(const struct bpf_map *map, char *buf, size_t buf_sz)
static bool get_datasec_ident(const char *sec_name, char *buf, size_t buf_sz)
{
- static const char *pfxs[] = { ".data", ".rodata", ".bss", ".kconfig" };
+ static const char *pfxs[] = { ".data", ".rodata", ".bss", ".percpu", ".kconfig" };
int i, n;
/* recognize hard coded LLVM section name */
@@ -254,7 +260,7 @@ static const struct btf_type *find_type_for_map(struct btf *btf, const char *map
return NULL;
}
-static bool is_mmapable_map(const struct bpf_map *map, char *buf, size_t sz)
+static bool is_skel_data(const struct bpf_map *map, char *buf, size_t sz)
{
size_t tmp_sz;
@@ -263,13 +269,24 @@ static bool is_mmapable_map(const struct bpf_map *map, char *buf, size_t sz)
return true;
}
- if (!bpf_map__is_internal(map) || !(bpf_map__map_flags(map) & BPF_F_MMAPABLE))
+ if (!bpf_map__is_internal(map))
return false;
if (!get_map_ident(map, buf, sz))
return false;
- return true;
+ if (bpf_map__map_flags(map) & BPF_F_MMAPABLE)
+ return true;
+
+ if (bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY)
+ return bpf_map__btf_value_type_id(map) != 0;
+
+ return false;
+}
+
+static bool is_mmapable_map(const struct bpf_map *map, char *buf, size_t sz)
+{
+ return is_skel_data(map, buf, sz) && bpf_map__type(map) != BPF_MAP_TYPE_PERCPU_ARRAY;
}
static int codegen_datasecs(struct bpf_object *obj, const char *obj_name)
@@ -287,7 +304,7 @@ static int codegen_datasecs(struct bpf_object *obj, const char *obj_name)
bpf_object__for_each_map(map, obj) {
/* only generate definitions for memory-mapped internal maps */
- if (!is_mmapable_map(map, map_ident, sizeof(map_ident)))
+ if (!is_skel_data(map, map_ident, sizeof(map_ident)))
continue;
sec = find_type_for_map(btf, map_ident);
@@ -517,7 +534,7 @@ static void codegen_asserts(struct bpf_object *obj, const char *obj_name)
", obj_name);
bpf_object__for_each_map(map, obj) {
- if (!is_mmapable_map(map, map_ident, sizeof(map_ident)))
+ if (!is_skel_data(map, map_ident, sizeof(map_ident)))
continue;
sec = find_type_for_map(btf, map_ident);
@@ -668,8 +685,7 @@ static void codegen_destroy(struct bpf_object *obj, const char *obj_name)
bpf_object__for_each_map(map, obj) {
if (!get_map_ident(map, ident, sizeof(ident)))
continue;
- if (bpf_map__is_internal(map) &&
- (bpf_map__map_flags(map) & BPF_F_MMAPABLE))
+ if (is_skel_data(map, ident, sizeof(ident)))
printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$zu);\n",
ident, bpf_map_mmap_sz(map));
codegen("\
@@ -733,7 +749,7 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
const void *mmap_data = NULL;
size_t mmap_size = 0;
- if (!is_mmapable_map(map, ident, sizeof(ident)))
+ if (!is_skel_data(map, ident, sizeof(ident)))
continue;
codegen("\
@@ -795,9 +811,23 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
bpf_object__for_each_map(map, obj) {
const char *mmap_flags;
- if (!is_mmapable_map(map, ident, sizeof(ident)))
+ if (!is_skel_data(map, ident, sizeof(ident)))
continue;
+ if (bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY) {
+ codegen("\
+ \n\
+ err = skel_protect_map_data(skel->%1$s, &skel->maps.%1$s.initial_value, %2$zd);\n\
+ if (err) \n\
+ return err; \n\
+ #ifdef __KERNEL__ \n\
+ skel->%1$s = NULL; \n\
+ #endif \n\
+ ",
+ ident, bpf_map_mmap_sz(map));
+ continue;
+ }
+
if (bpf_map__map_flags(map) & BPF_F_RDONLY_PROG)
mmap_flags = "PROT_READ";
else
@@ -901,8 +931,7 @@ codegen_maps_skeleton(struct bpf_object *obj, size_t map_cnt, bool mmaped, bool
map->map = &obj->maps.%s; \n\
",
i, bpf_map__name(map), ident);
- /* memory-mapped internal maps */
- if (mmaped && is_mmapable_map(map, ident, sizeof(ident))) {
+ if (mmaped && is_skel_data(map, ident, sizeof(ident))) {
printf("\tmap->mmaped = (void **)&obj->%s;\n", ident);
}
diff --git a/tools/lib/bpf/skel_internal.h b/tools/lib/bpf/skel_internal.h
index 0875452521e96..fe71f6df369ae 100644
--- a/tools/lib/bpf/skel_internal.h
+++ b/tools/lib/bpf/skel_internal.h
@@ -125,8 +125,10 @@ static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
{
if (addr != ~0ULL)
kvfree(p);
- /* When addr == ~0ULL the 'p' points to
- * ((struct bpf_array *)map)->value. See skel_finalize_map_data.
+ /*
+ * When addr == ~0ULL the init buffer has already been released.
+ * For skel_finalize_map_data(), 'p' points to
+ * ((struct bpf_array *)map)->value.
*/
}
@@ -164,6 +166,15 @@ static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int
return addr;
}
+static inline int skel_protect_map_data(void *p, __u64 *init_val, size_t sz)
+{
+ (void)sz;
+
+ kvfree(p);
+ *init_val = ~0ULL;
+ return 0;
+}
+
#else
static inline void *skel_alloc(size_t size)
@@ -202,6 +213,15 @@ static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int
return NULL;
return addr;
}
+
+static inline int skel_protect_map_data(void *p, __u64 *init_val, size_t sz)
+{
+ (void)init_val;
+
+ if (mprotect(p, sz, PROT_READ))
+ return -errno;
+ return 0;
+}
#endif
static inline int skel_closenz(int fd)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0484/1756] bpftool: Compute map size of light skeletons at runtime
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (482 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0483/1756] bpftool: Generate skeleton for global percpu data Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0485/1756] pstore: dont leave an ERR_PTR in the ramoops zone pointer Greg Kroah-Hartman
` (514 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Andrii Nakryiko,
Quentin Monnet, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Hwang <leon.hwang@linux.dev>
[ Upstream commit a885470df10b1c0dbc011177c19d3fd3bb8af2e9 ]
bpftool rounds memory-mapped data map sizes to the host page size when
generating a light skeleton. The generated code therefore uses a 64K
mapping size when bpftool runs on a 64K-page host, even if the skeleton
runs on a 4K-page target. The target rejects the oversized map mmap(),
causing failure of loading the light skeleton.
When try to run 64K-page selftests on 4K-page VM, the error message does
not provide the reason about page size.
test_atomics:PASS:atomics skeleton open 0 nsec
test_atomics:FAIL:atomics skeleton load unexpected error: -12 (errno 22)
#15 atomics:FAIL
Pass the original map value size and max entries to the generated code and
round mmap size to the runtime page size in the user-space light
skeleton helpers. This keeps generated light skeletons independent of the
build host page size.
Fixes: d510296d331a ("bpftool: Use syscall/loader program in "prog load" and "gen skeleton" command.")
Signed-off-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20260915161450.96249-1-leon.hwang@linux.dev
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/gen.c | 26 ++++++-------------
tools/lib/bpf/skel_internal.h | 48 +++++++++++++++++++++++++----------
2 files changed, 42 insertions(+), 32 deletions(-)
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index de2264da98d1c..49c3bcf2f9127 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -500,16 +500,6 @@ static void print_hex(const char *data, int data_sz)
}
}
-static size_t bpf_map_mmap_sz(const struct bpf_map *map)
-{
- long page_sz = sysconf(_SC_PAGE_SIZE);
- size_t map_sz;
-
- map_sz = (size_t)roundup(bpf_map__value_size(map), 8) * bpf_map__max_entries(map);
- map_sz = roundup(map_sz, page_sz);
- return map_sz;
-}
-
/* Emit type size asserts for all top-level fields in memory-mapped internal maps. */
static void codegen_asserts(struct bpf_object *obj, const char *obj_name)
{
@@ -686,8 +676,8 @@ static void codegen_destroy(struct bpf_object *obj, const char *obj_name)
if (!get_map_ident(map, ident, sizeof(ident)))
continue;
if (is_skel_data(map, ident, sizeof(ident)))
- printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$zu);\n",
- ident, bpf_map_mmap_sz(map));
+ printf("\tskel_free_map_data(skel->%1$s, skel->maps.%1$s.initial_value, %2$u, %3$u);\n",
+ ident, bpf_map__value_size(map), bpf_map__max_entries(map));
codegen("\
\n\
skel_closenz(skel->maps.%1$s.map_fd); \n\
@@ -763,13 +753,13 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
\n\
\"; \n\
\n\
- skel->%1$s = (__typeof__(skel->%1$s))skel_prep_map_data((void *)data, %2$zd,\n\
+ skel->%1$s = (__typeof__(skel->%1$s))skel_prep_map_data((void *)data, %2$u, %3$u,\n\
sizeof(data) - 1);\n\
if (!skel->%1$s) \n\
goto cleanup; \n\
skel->maps.%1$s.initial_value = (__u64) (long) skel->%1$s;\n\
} \n\
- ", ident, bpf_map_mmap_sz(map));
+ ", ident, bpf_map__value_size(map), bpf_map__max_entries(map));
}
codegen("\
\n\
@@ -817,14 +807,14 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
if (bpf_map__type(map) == BPF_MAP_TYPE_PERCPU_ARRAY) {
codegen("\
\n\
- err = skel_protect_map_data(skel->%1$s, &skel->maps.%1$s.initial_value, %2$zd);\n\
+ err = skel_protect_map_data(skel->%1$s, &skel->maps.%1$s.initial_value, %2$u, %3$u);\n\
if (err) \n\
return err; \n\
#ifdef __KERNEL__ \n\
skel->%1$s = NULL; \n\
#endif \n\
",
- ident, bpf_map_mmap_sz(map));
+ ident, bpf_map__value_size(map), bpf_map__max_entries(map));
continue;
}
@@ -836,11 +826,11 @@ static int gen_trace(struct bpf_object *obj, const char *obj_name, const char *h
codegen("\
\n\
skel->%1$s = (__typeof__(skel->%1$s))skel_finalize_map_data(&skel->maps.%1$s.initial_value,\n\
- %2$zd, %3$s, skel->maps.%1$s.map_fd);\n\
+ %2$u, %3$u, %4$s, skel->maps.%1$s.map_fd);\n\
if (!skel->%1$s) \n\
return -ENOMEM; \n\
",
- ident, bpf_map_mmap_sz(map), mmap_flags);
+ ident, bpf_map__value_size(map), bpf_map__max_entries(map), mmap_flags);
}
codegen("\
\n\
diff --git a/tools/lib/bpf/skel_internal.h b/tools/lib/bpf/skel_internal.h
index fe71f6df369ae..76aee63887138 100644
--- a/tools/lib/bpf/skel_internal.h
+++ b/tools/lib/bpf/skel_internal.h
@@ -11,6 +11,7 @@
#include <linux/bpf.h>
#else
#include <unistd.h>
+#include <sys/param.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <stdlib.h>
@@ -121,7 +122,7 @@ static inline void skel_free(const void *p)
* either bpf_probe_read_kernel() or bpf_copy_from_user() from initial_value
* depending on bpf_loader_ctx->flags.
*/
-static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
+static inline void skel_free_map_data(void *p, __u64 addr, size_t val_sz, __u32 max_entries)
{
if (addr != ~0ULL)
kvfree(p);
@@ -132,18 +133,20 @@ static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
*/
}
-static inline void *skel_prep_map_data(const void *val, size_t mmap_sz, size_t val_sz)
+static inline void *skel_prep_map_data(const void *val, size_t val_sz, __u32 max_entries,
+ size_t data_sz)
{
void *addr;
- addr = kvmalloc(val_sz, GFP_KERNEL);
+ addr = kvmalloc(data_sz, GFP_KERNEL);
if (!addr)
return NULL;
- memcpy(addr, val, val_sz);
+ memcpy(addr, val, data_sz);
return addr;
}
-static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int flags, int fd)
+static inline void *skel_finalize_map_data(__u64 *init_val, size_t val_sz, __u32 max_entries,
+ int flags, int fd)
{
struct bpf_map *map;
void *addr = NULL;
@@ -166,9 +169,10 @@ static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int
return addr;
}
-static inline int skel_protect_map_data(void *p, __u64 *init_val, size_t sz)
+static inline int skel_protect_map_data(void *p, __u64 *init_val, size_t val_sz, __u32 max_entries)
{
- (void)sz;
+ (void)val_sz;
+ (void)max_entries;
kvfree(p);
*init_val = ~0ULL;
@@ -187,25 +191,39 @@ static inline void skel_free(void *p)
free(p);
}
-static inline void skel_free_map_data(void *p, __u64 addr, size_t sz)
+static inline size_t skel_map_mmap_sz(size_t val_sz, __u32 max_entries)
{
- munmap(p, sz);
+ const long page_sz = sysconf(_SC_PAGE_SIZE);
+ size_t mmap_sz;
+
+ mmap_sz = roundup(val_sz, 8) * max_entries;
+ mmap_sz = roundup(mmap_sz, page_sz);
+ return mmap_sz;
}
-static inline void *skel_prep_map_data(const void *val, size_t mmap_sz, size_t val_sz)
+static inline void skel_free_map_data(void *p, __u64 addr, size_t val_sz, __u32 max_entries)
{
+ munmap(p, skel_map_mmap_sz(val_sz, max_entries));
+}
+
+static inline void *skel_prep_map_data(const void *val, size_t val_sz, __u32 max_entries,
+ size_t data_sz)
+{
+ size_t mmap_sz = skel_map_mmap_sz(val_sz, max_entries);
void *addr;
addr = mmap(NULL, mmap_sz, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (addr == (void *) -1)
return NULL;
- memcpy(addr, val, val_sz);
+ memcpy(addr, val, data_sz);
return addr;
}
-static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int flags, int fd)
+static inline void *skel_finalize_map_data(__u64 *init_val, size_t val_sz, __u32 max_entries,
+ int flags, int fd)
{
+ size_t mmap_sz = skel_map_mmap_sz(val_sz, max_entries);
void *addr;
addr = mmap((void *) (long) *init_val, mmap_sz, flags, MAP_SHARED | MAP_FIXED, fd, 0);
@@ -214,11 +232,13 @@ static inline void *skel_finalize_map_data(__u64 *init_val, size_t mmap_sz, int
return addr;
}
-static inline int skel_protect_map_data(void *p, __u64 *init_val, size_t sz)
+static inline int skel_protect_map_data(void *p, __u64 *init_val, size_t val_sz, __u32 max_entries)
{
+ size_t mmap_sz = skel_map_mmap_sz(val_sz, max_entries);
+
(void)init_val;
- if (mprotect(p, sz, PROT_READ))
+ if (mprotect(p, mmap_sz, PROT_READ))
return -errno;
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0485/1756] pstore: dont leave an ERR_PTR in the ramoops zone pointer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (483 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0484/1756] bpftool: Compute map size of light skeletons at runtime Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0486/1756] pstore: reject persistent RAM zones too small for the buffer header Greg Kroah-Hartman
` (513 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrea Parri, Kees Cook, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <parri.andrea@gmail.com>
[ Upstream commit 70fec428c845216da98041b1ae9f16a8f54b3d68 ]
ramoops_init_prz() stores the result of persistent_ram_new() in *prz and
returns the error without clearing it when initialization fails.
ramoops_probe() then cleans up through ramoops_free_przs(), which hands
*prz to persistent_ram_free(); that treats the ERR_PTR as a valid zone
and dereferences it, crashing the kernel.
Clear *prz before returning so that cleanup sees a NULL zone.
Fixes: b5d38e9bf1b0c ("pstore/ram: Add console messages handling")
Assisted-by: LLM
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://patch.msgid.link/20260921202317.70595-2-parri.andrea@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/pstore/ram.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 4311fcbc84f29..4657503e47120 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -605,6 +605,7 @@ static int ramoops_init_prz(const char *name,
if (IS_ERR(*prz)) {
int err = PTR_ERR(*prz);
+ *prz = NULL;
dev_err(dev, "failed to request %s mem region (0x%zx@0x%llx): %d\n",
name, sz, (unsigned long long)*paddr, err);
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0486/1756] pstore: reject persistent RAM zones too small for the buffer header
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (484 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0485/1756] pstore: dont leave an ERR_PTR in the ramoops zone pointer Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0487/1756] KMSAN: fix memset() when using fortify-source, again Greg Kroah-Hartman
` (512 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Andrea Parri, Kees Cook, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <parri.andrea@gmail.com>
[ Upstream commit 1b30df8662ac85a6759be4332f3bec7e3cb28efc ]
persistent_ram_buffer_map() computes
prz->buffer_size = size - sizeof(struct persistent_ram_buffer);
without checking that size is large enough to hold the header. A
ramoops zone configured with a tiny size (e.g. ramoops.pmsg_size=1)
underflows buffer_size to a huge value, which defeats every bounds
check in persistent_ram_write() and persistent_ram_write_user(); a
write to /dev/pmsg0 then copies user data far past the end of the zone
and corrupts kernel memory.
Reject zones that are not larger than the buffer header.
Fixes: 404a6043385de ("staging: android: persistent_ram: handle reserving and mapping memory")
Assisted-by: LLM
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://patch.msgid.link/20260921202317.70595-3-parri.andrea@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/pstore/ram_core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 95675d4bab141..4d07280768975 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -507,6 +507,12 @@ static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size,
prz->paddr = start;
prz->size = size;
+ if (size <= sizeof(struct persistent_ram_buffer)) {
+ pr_err("%s: persistent ram zone too small (%#llx bytes)\n",
+ prz->label, (unsigned long long)size);
+ return -EINVAL;
+ }
+
if (pfn_valid(start >> PAGE_SHIFT))
prz->vaddr = persistent_ram_vmap(start, size, memtype);
else
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0487/1756] KMSAN: fix memset() when using fortify-source, again
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (485 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0486/1756] pstore: reject persistent RAM zones too small for the buffer header Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0488/1756] md/raid5: give the io_unit slab caches per-array names Greg Kroah-Hartman
` (511 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Kees Cook,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <arnd@arndb.de>
[ Upstream commit 3555409e524a0279845f91273ba714998658c163 ]
Both kmsan and fortify-source replace the memset function. When both
are enabled at the same time, the kmsan version gets used, which triggers
a warning about fortify-source being nonfunctional:
warning: unsafe memset() usage lacked '__write_overflow' symbol in /home/arnd/arm-soc/lib/test_fortify/write_overflow-memset.c
warning: unsafe memset() usage lacked '__write_overflow_field' symbol in /home/arnd/arm-soc/lib/test_fortify/write_overflow_field-memset.c
Commit 78a498c3a227 already tried to address this, but this seems
to only have worked for memcpy() and memmove() but not memset(),
which is still lacking the macro definition when KMSAN is enabled.
Remove the incorrect #ifndef check around the memset() macro.
Fixes: ff901d80fff6 ("x86: kmsan: use __msan_ string functions where possible.")
Fixes: 78a498c3a227 ("x86: fortify: kmsan: fix KMSAN fortify builds")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260618142951.1739694-1-arnd@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/fortify-string.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/fortify-string.h b/include/linux/fortify-string.h
index 71f9dcf561282..bed58ec5363ff 100644
--- a/include/linux/fortify-string.h
+++ b/include/linux/fortify-string.h
@@ -508,10 +508,8 @@ __FORTIFY_INLINE bool fortify_memset_chk(__kernel_size_t size,
* __struct_size() vs __member_size() must be captured here to avoid
* evaluating argument side-effects further into the macro layers.
*/
-#ifndef CONFIG_KMSAN
#define memset(p, c, s) __fortify_memset_chk(p, c, s, \
__struct_size(p), __member_size(p))
-#endif
/*
* To make sure the compiler can enforce protection against buffer overflows,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0488/1756] md/raid5: give the io_unit slab caches per-array names
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (486 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0487/1756] KMSAN: fix memset() when using fortify-source, again Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0489/1756] leds: lp8860: Fix device_node leak in lp8860_probe() Greg Kroah-Hartman
` (510 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+2ef75c54d0b2ac5d00ba,
Yogesh Gaur, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yogesh Gaur <yogeshgaur.83@gmail.com>
[ Upstream commit 96858e2308431ff5678e0e6fab1a06e19f3d95da ]
Both raid5 log backends create their io_unit slab cache per array but
name it after the struct:
ppl_conf->io_kc = KMEM_CACHE(ppl_io_unit, 0);
log->io_kc = KMEM_CACHE(r5l_io_unit, 0);
KMEM_CACHE() passes the stringified type as the cache name, so every
array that enables PPL or attaches a journal asks for a cache called
"ppl_io_unit" or "r5l_io_unit". With two such arrays live at the same
time the second one trips kmem_cache_sanity_check():
kmem_cache of name 'ppl_io_unit' already exists
WARNING: mm/slab_common.c:112 at __kmem_cache_create_args+0xae/0x460
ppl_init_log+0x285/0x1310 drivers/md/raid5-ppl.c:1363
log_init drivers/md/raid5-log.h:138 [inline]
raid5_change_consistency_policy+0x255/0x740 drivers/md/raid5.c:9141
consistency_policy_store+0x7f/0x230 drivers/md/md.c:5883
md_attr_store+0x3b7/0x640 drivers/md/md.c:6158
which is reachable by any user that can write "ppl" to
md/consistency_policy on two arrays, and equally by assembling two
journalled arrays. The cache is created and destroyed correctly on
every path, so this is a name collision only - duplicate names confuse
slabtop and /proc/slabinfo, which is what the check is there to catch.
Build the name from the array instead, the way grow_stripes() already
does for the stripe_head cache in this driver, and fall back to the
mddev pointer for dm-raid where mdname() is the constant "mdX". The
buffer is sized like conf->cache_name[] because mdname() can return up
to DISK_NAME_LEN bytes.
The explicit size/align arguments keep what KMEM_CACHE() expanded to,
so object layout does not change.
Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
Fixes: f6bed0ef0a80 ("raid5: add basic stripe log")
Reported-by: syzbot+2ef75c54d0b2ac5d00ba@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2ef75c54d0b2ac5d00ba
Assisted-by: LLM
Signed-off-by: Yogesh Gaur <yogeshgaur.83@gmail.com>
Link: https://patch.msgid.link/20260920091533.413-1-yogeshgaur.83@gmail.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5-cache.c | 12 +++++++++++-
drivers/md/raid5-ppl.c | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 4ec111fea1da3..1f06dd27290e7 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -3085,6 +3085,7 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev)
{
struct r5l_log *log;
struct md_thread *thread;
+ char cache_name[48];
int ret;
pr_debug("md/raid:%s: using device %pg as journal\n",
@@ -3124,7 +3125,16 @@ int r5l_init_log(struct r5conf *conf, struct md_rdev *rdev)
INIT_LIST_HEAD(&log->flushing_ios);
INIT_LIST_HEAD(&log->finished_ios);
- log->io_kc = KMEM_CACHE(r5l_io_unit, 0);
+ if (mddev_is_dm(conf->mddev))
+ snprintf(cache_name, sizeof(cache_name), "r5l_io_unit-%p",
+ conf->mddev);
+ else
+ snprintf(cache_name, sizeof(cache_name), "r5l_io_unit-%s",
+ mdname(conf->mddev));
+
+ log->io_kc = kmem_cache_create(cache_name, sizeof(struct r5l_io_unit),
+ __alignof__(struct r5l_io_unit),
+ 0, NULL);
if (!log->io_kc)
goto io_kc;
diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 0c630cfbf3a01..84cb30e14a3a7 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -1318,6 +1318,7 @@ int ppl_init_log(struct r5conf *conf)
{
struct ppl_conf *ppl_conf;
struct mddev *mddev = conf->mddev;
+ char cache_name[48];
int ret = 0;
int max_disks;
int i;
@@ -1360,7 +1361,16 @@ int ppl_init_log(struct r5conf *conf)
ppl_conf->mddev = mddev;
- ppl_conf->io_kc = KMEM_CACHE(ppl_io_unit, 0);
+ if (mddev_is_dm(mddev))
+ snprintf(cache_name, sizeof(cache_name), "ppl_io_unit-%p", mddev);
+ else
+ snprintf(cache_name, sizeof(cache_name), "ppl_io_unit-%s",
+ mdname(mddev));
+
+ ppl_conf->io_kc = kmem_cache_create(cache_name,
+ sizeof(struct ppl_io_unit),
+ __alignof__(struct ppl_io_unit),
+ 0, NULL);
if (!ppl_conf->io_kc) {
ret = -ENOMEM;
goto err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0489/1756] leds: lp8860: Fix device_node leak in lp8860_probe()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (487 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0488/1756] md/raid5: give the io_unit slab caches per-array names Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0490/1756] leds: pca9532: Check i2c_smbus_read_byte_data() return value Greg Kroah-Hartman
` (509 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Miles Krause, Lee Jones, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miles Krause <mileskrause5200@gmail.com>
[ Upstream commit f9879086c4eb4b3b0f4baa80139a5720b99b229e ]
lp8860_probe() looks up the driver's single LED child node with
of_get_next_available_child() and hands it to the LED core as
init_data.fwnode, but never drops the reference that lookup returned:
child_node = of_get_next_available_child(np, NULL);
if (!child_node)
return -EINVAL;
...
init_data.fwnode = of_fwnode_handle(child_node);
of_get_next_available_child() returns the node with its refcount
incremented, and the LED core does not take a reference of its own:
led_classdev_register_ext() only reads properties out of
init_data.fwnode and then stores the bare pointer with
device_set_node(). The reference therefore stays owned by the driver
for as long as it holds the node.
Nothing in lp8860_probe() ever releases it, so it is leaked on every
error return taken after the lookup - the enable GPIO, the vled
regulator, devm_mutex_init(), the regmap allocation, the optional
EEPROM programming and the LED class registration - and on a fully
successful probe alike. A device that binds and unbinds repeatedly
leaks one device_node reference per bind.
Sibling drivers already get this right: leds-lm3692x.c, from the same
TI LED family, calls fwnode_handle_put(init_data.fwnode) once after
devm_led_classdev_register_ext() to cover both outcomes, while
leds-ktd2692.c and leds-aat1290.c take the node with __free(device_node).
Use __free(device_node) here too. Unlike a single of_node_put() at the
end of probe it also covers the intermediate error returns, and it keeps
the node alive for the whole function, which the LED core still needs
when it reads the child's properties during registration.
Fixes: 99ca0ea57309 ("leds: lp8860: Use generic support for composing LED names")
Signed-off-by: Miles Krause <mileskrause5200@gmail.com>
Link: https://patch.msgid.link/20260910-leds-lp8860-of-node-leak-v1-1-d333cff4345b@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/leds/leds-lp8860.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
index 06196d851ade7..1b24fe2fdb8f3 100644
--- a/drivers/leds/leds-lp8860.c
+++ b/drivers/leds/leds-lp8860.c
@@ -7,6 +7,7 @@
* Author: Dan Murphy <dmurphy@ti.com>
*/
+#include <linux/cleanup.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/leds.h>
@@ -377,14 +378,14 @@ static int lp8860_probe(struct i2c_client *client)
int ret;
struct lp8860_led *led;
struct device_node *np = dev_of_node(&client->dev);
- struct device_node *child_node;
struct led_init_data init_data = {};
led = devm_kzalloc(&client->dev, sizeof(*led), GFP_KERNEL);
if (!led)
return -ENOMEM;
- child_node = of_get_next_available_child(np, NULL);
+ struct device_node *child_node __free(device_node) =
+ of_get_next_available_child(np, NULL);
if (!child_node)
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0490/1756] leds: pca9532: Check i2c_smbus_read_byte_data() return value
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (488 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0489/1756] leds: lp8860: Fix device_node leak in lp8860_probe() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0491/1756] perf test: Fix a leaked map reference in the arch dwarf unwind tests Greg Kroah-Hartman
` (508 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haibo Chen, Frank Li, Lee Jones,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haibo Chen <haibo.chen@nxp.com>
[ Upstream commit 1b75f038e5f71ed32ce6593b5763f9776ec58a25 ]
Coverity report INTEGER_OVERFLOW (tainted_data_return ->
cast_underflow -> overflow) in pca9532_getled().
pca9532_getled() stored the return value of i2c_smbus_read_byte_data()
into a char and used it directly to compute the LED state without
checking for an error. i2c_smbus_read_byte_data() returns a negative
error code on failure. On an I2C read error the negative value was
assigned to an unsigned type, triggering an integer underflow/overflow,
and a meaningless LED state was returned to the caller.
Read the value into an int, check for the error, and fall back to
PCA9532_OFF while emitting a warning when the read fails.
Fixes: 28c5fe99016d ("leds: pca9532: Extend pca9532 device tree support")
Assisted-by: VeroCoder:vero-1 [cli]
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260727-led-fix-v1-1-d635c5037109@nxp.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/leds/leds-pca9532.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index e2c4aad89a7ca..5dca6b0827ea6 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -298,12 +298,15 @@ static enum pca9532_state pca9532_getled(struct pca9532_led *led)
struct i2c_client *client = led->client;
struct pca9532_data *data = i2c_get_clientdata(client);
u8 maxleds = data->chip_info->num_leds;
- char reg;
- enum pca9532_state ret;
+ int reg;
+ enum pca9532_state ret = PCA9532_OFF;
mutex_lock(&data->update_lock);
reg = i2c_smbus_read_byte_data(client, LED_REG(maxleds, led->id));
- ret = (reg & LED_MASK(led->id)) >> LED_SHIFT(led->id);
+ if (reg >= 0)
+ ret = (reg & LED_MASK(led->id)) >> LED_SHIFT(led->id);
+ else
+ dev_warn(&client->dev, "failed to read LED register: %d\n", reg);
mutex_unlock(&data->update_lock);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0491/1756] perf test: Fix a leaked map reference in the arch dwarf unwind tests
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (489 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0490/1756] leds: pca9532: Check i2c_smbus_read_byte_data() return value Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0492/1756] perf build: Check the version of the compiler that is used Greg Kroah-Hartman
` (507 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Chen Pei,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Pei <cp0613@linux.alibaba.com>
[ Upstream commit 1622c9ae39e2882fcbbae7c9d27dda13f1880b93 ]
maps__find() has returned a reference to the map it finds since
commit 42fd623b58db ("perf maps: Get map before returning in
maps__find"), which updated arch/x86/tests/dwarf-unwind.c but missed
the arm, arm64 and powerpc copies. Release the map after reading its
end, as x86 does. All other callers of maps__find() already release
what they get.
Fixes: 42fd623b58dbcc48 ("perf maps: Get map before returning in maps__find")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/arch/arm/tests/dwarf-unwind.c | 1 +
tools/perf/arch/arm64/tests/dwarf-unwind.c | 1 +
tools/perf/arch/powerpc/tests/dwarf-unwind.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c
index 9bc304cb7762b..7b5330d77b00c 100644
--- a/tools/perf/arch/arm/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm/tests/dwarf-unwind.c
@@ -34,6 +34,7 @@ static int sample_ustack(struct perf_sample *sample,
}
stack_size = map__end(map) - sp;
+ map__put(map);
stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size;
memcpy(buf, (void *) sp, stack_size);
diff --git a/tools/perf/arch/arm64/tests/dwarf-unwind.c b/tools/perf/arch/arm64/tests/dwarf-unwind.c
index b2603d0d3737a..4871041f72146 100644
--- a/tools/perf/arch/arm64/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm64/tests/dwarf-unwind.c
@@ -34,6 +34,7 @@ static int sample_ustack(struct perf_sample *sample,
}
stack_size = map__end(map) - sp;
+ map__put(map);
stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size;
memcpy(buf, (void *) sp, stack_size);
diff --git a/tools/perf/arch/powerpc/tests/dwarf-unwind.c b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
index 5ecf82893b84d..f2c5e76590ebe 100644
--- a/tools/perf/arch/powerpc/tests/dwarf-unwind.c
+++ b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
@@ -34,6 +34,7 @@ static int sample_ustack(struct perf_sample *sample,
}
stack_size = map__end(map) - sp;
+ map__put(map);
stack_size = stack_size > STACK_SIZE ? STACK_SIZE : stack_size;
memcpy(buf, (void *) sp, stack_size);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0492/1756] perf build: Check the version of the compiler that is used
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (490 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0491/1756] perf test: Fix a leaked map reference in the arch dwarf unwind tests Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0493/1756] leds: lm3692x: Fix regulator/gpio leak and wrong enabled state on last write failure Greg Kroah-Hartman
` (506 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 4f4387a07f601988e44fc6a4f4663aa1ff264f94 ]
The flex and bison flags are adjusted for clang older than 13.0.0, which
doesn't grok -Wno-unused-but-set-variable. The test is reached because
CC_NO_CLANG says CC is clang, but the version comes from $(CLANG), which
defaults to plain "clang" and needn't be the compiler in use:
$ make CC=clang-19 CLANG=clang-12
version from $(CLANG) -> 12.0.0, flag stripped
version from $(CC) -> 19.1.7, flag kept
Dropping the flag lets the warnings it suppresses in the generated flex
and bison code through, and those are errors under -Werror.
Ask $(CC) instead, as that is what compiles the code.
Fixes: 878460e8d0ff84a0 ("perf build: Remove -Wno-unused-but-set-variable from the flex flags when building with clang < 13.0.0")
Signed-off-by: Ian Rogers <irogers@google.com>
Assisted-by: Antigravity:gemini-3.1-pro
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/Build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 7659db6039367..f26016fe43941 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -319,7 +319,7 @@ bison_flags := -DYYENABLE_NLS=0 -Wno-unused-but-set-variable
# Old clangs don't grok -Wno-unused-but-set-variable, remove it
ifeq ($(CC_NO_CLANG), 0)
- CLANG_VERSION := $(shell $(CLANG) --version | head -1 | sed 's/.*clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g')
+ CLANG_VERSION := $(shell $(CC) --version | head -1 | sed 's/.*clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g')
ifeq ($(call version-lt3,$(CLANG_VERSION),13.0.0),1)
bison_flags := $(subst -Wno-unused-but-set-variable,,$(bison_flags))
flex_flags := $(subst -Wno-unused-but-set-variable,,$(flex_flags))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0493/1756] leds: lm3692x: Fix regulator/gpio leak and wrong enabled state on last write failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (491 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0492/1756] perf build: Check the version of the compiler that is used Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0494/1756] perf annotate-data: Show the sample count in the data-type browser Greg Kroah-Hartman
` (505 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Cong Nguyen, Lee Jones, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Nguyen <congnt264@gmail.com>
[ Upstream commit 145ca6bca2cc5fd8d9c7af216df58a9c75c0e84c ]
Every write in lm3692x_leds_enable() checks its return and jumps to
out: on failure -- except the last one, which falls through and sets
led->enabled = true regardless of whether it actually succeeded. Leaks
the regulator on a failing probe, and short-circuits later
brightness_set() calls without retrying.
Route it through out: like every other write here, and only set
enabled = true once it succeeds.
Fixes: 260718b3a35d ("leds: lm3692x: Disable chip on brightness 0")
Assisted-by: Claude:claude-opus-4
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
Link: https://patch.msgid.link/20260915034515.4147981-1-congnt264@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/leds/leds-lm3692x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c
index c319ff4d70b2a..03f2196836751 100644
--- a/drivers/leds/leds-lm3692x.c
+++ b/drivers/leds/leds-lm3692x.c
@@ -274,9 +274,11 @@ static int lm3692x_leds_enable(struct lm3692x_led *led)
ret = regmap_update_bits(led->regmap, LM3692X_EN, LM3692X_ENABLE_MASK,
enable_state | LM3692X_DEVICE_EN);
+ if (ret)
+ goto out;
led->enabled = true;
- return ret;
+ return 0;
out:
dev_err(&led->client->dev, "Fail writing initialization values\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0494/1756] perf annotate-data: Show the sample count in the data-type browser
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (492 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0493/1756] leds: lm3692x: Fix regulator/gpio leak and wrong enabled state on last write failure Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0495/1756] RDMA/core: Fix partial copy of IPv6 flow_lbl in LAG hash skb Greg Kroah-Hartman
` (504 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 9db4e9d6cc7c7d318fb6d6bb73abe3fed27385a8 ]
The data-type browser has a samples view, selected with -n (or with
annotate.show_nr_samples), in which browser__write_overhead() prints a
local nr_samples variable that is initialized to zero and never
updated, so every member is listed as having no samples while the
period and percent columns for the same entry are filled in.
Print the histogram entry's own count instead.
This predates the load/store counter split, so fix it ahead of that
patch: the split then only has to adapt a line that is already correct,
and this fix can be picked on its own.
Fixes: d001c7a7f4736743 ("perf annotate-data: Add hist_entry__annotate_data_tui()")
Acked-by: Namhyung Kim <namhyung@kernel.org>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/ui/browsers/annotate-data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/ui/browsers/annotate-data.c b/tools/perf/ui/browsers/annotate-data.c
index cd562a8822b7f..e5677aaa651ce 100644
--- a/tools/perf/ui/browsers/annotate-data.c
+++ b/tools/perf/ui/browsers/annotate-data.c
@@ -370,7 +370,7 @@ static void browser__write_overhead(struct ui_browser *uib,
u64 period = hist->period;
double percent = total->period ? (100.0 * period / total->period) : 0;
bool current = ui_browser__is_current_entry(uib, row);
- int nr_samples = 0;
+ int nr_samples = hist->nr_samples;
ui_browser__set_percent_color(uib, percent, current);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0495/1756] RDMA/core: Fix partial copy of IPv6 flow_lbl in LAG hash skb
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (493 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0494/1756] perf annotate-data: Show the sample count in the data-type browser Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0496/1756] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration Greg Kroah-Hartman
` (503 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit b63d21631f836528ef660d7b5a0d84890ff6dbd5 ]
rdma_build_skb() constructs a synthetic IPv6 header for LAG slave
selection and copies the flow label from the AH attribute:
memcpy(&ip6h->flow_lbl, &ah_attr->grh.flow_label,
sizeof(*ip6h->flow_lbl));
ipv6hdr.flow_lbl is __u8[3], so sizeof(*ip6h->flow_lbl) dereferences the
array to a single __u8 and yields 1. The memcpy therefore copies only
the first byte of the flow label, leaving flow_lbl[1] and flow_lbl[2]
uninitialised in the skb buffer (alloc_skb() does not zero the data).
The resulting LAG hash is computed over one byte of real flow-label
data and two bytes of kmalloc residue, so IPv6 RoCEv2 traffic on a
bonded interface can be steered to the wrong slave.
Use sizeof(ip6h->flow_lbl) (the array, 3 bytes) so the whole flow label
is copied.
Fixes: bd3920eac1331 ("RDMA/core: Add LAG functionality")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260916120926.1761-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/lag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/lag.c b/drivers/infiniband/core/lag.c
index 8fd80adfe833e..eeae4b0898ee0 100644
--- a/drivers/infiniband/core/lag.c
+++ b/drivers/infiniband/core/lag.c
@@ -59,7 +59,7 @@ static struct sk_buff *rdma_build_skb(struct net_device *netdev,
ip6h->version = 6;
ip6h->nexthdr = IPPROTO_UDP;
memcpy(&ip6h->flow_lbl, &ah_attr->grh.flow_label,
- sizeof(*ip6h->flow_lbl));
+ sizeof(ip6h->flow_lbl));
memcpy(&ip6h->saddr, ah_attr->grh.sgid_attr->gid.raw,
sizeof(struct in6_addr));
memcpy(&ip6h->daddr, ah_attr->grh.dgid.raw,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0496/1756] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (494 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0495/1756] RDMA/core: Fix partial copy of IPv6 flow_lbl in LAG hash skb Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0497/1756] leds: flash: Prevent using uninitialized variable in flash_fault_show() Greg Kroah-Hartman
` (502 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jacob Moroni, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <jmoroni@google.com>
[ Upstream commit 5bb710151753fe53047b1d34b1b54d0f179cec68 ]
Commit cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
replaced the explicit level1_only boolean with a bit mask
but did not properly convert the "if (level1_only)" check
in irdma_get_pble() to be "lvl == PBLE_LEVEL_1" and instead
left it as "if (lvl)".
User MR registration passes "lvl = PBLE_LEVEL_1 | PBLE_LEVEL_2"
so this check always evaluates to true and causes the
loop to bail after grabbing a single SD even if the region
actually requires more than one SD (as is the case for
regions larger than 1 GiB with 4k pages). As a result, these
registrations can fail with -ENOMEM even if there are
sufficient PBLE resources.
Fixes: cc8997c94bf3 ("RDMA/irdma: Refactor PBLE functions")
Signed-off-by: Jacob Moroni <jmoroni@google.com>
Link: https://patch.msgid.link/20260915170317.2901672-1-jmoroni@google.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/irdma/pble.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/irdma/pble.c b/drivers/infiniband/hw/irdma/pble.c
index bd9e7b7f6ca34..9370fce3cc8e3 100644
--- a/drivers/infiniband/hw/irdma/pble.c
+++ b/drivers/infiniband/hw/irdma/pble.c
@@ -474,7 +474,7 @@ int irdma_get_pble(struct irdma_hmc_pble_rsrc *pble_rsrc,
status = get_lvl1_lvl2_pble(pble_rsrc, palloc, lvl);
/* if level1_only, only go through it once */
- if (!status || lvl)
+ if (!status || lvl == PBLE_LEVEL_1)
break;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0497/1756] leds: flash: Prevent using uninitialized variable in flash_fault_show()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (495 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0496/1756] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0498/1756] regulator: mp886x: check get_voltage_sel() return value Greg Kroah-Hartman
` (501 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Dmitry Antipov,
Lee Jones, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <dmantipov@yandex.ru>
[ Upstream commit d229695f2162a41bfa614f175798fa56a5f1c969 ]
In flash_fault_show(), address of uninitialized 'fault' variable is
passed to device-specific .fault_get callbacks. This is not a problem
if such a callback directly assigns the value like rt4505_fault_get(),
but results in an undefined behavior if callback just performs bitwise
ORs like as3645a_get_fault(). So just initialize 'fault' with zero.
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260904054437.461706-1-dmantipov@yandex.ru?part=1
Fixes: 7aea8389a77ab ("leds: Add LED Flash class extension to the LED subsystem")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20260916161607.90106-1-dmantipov@yandex.ru
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/leds/led-class-flash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c
index 6fe9d700dfef6..e10a9c796c04c 100644
--- a/drivers/leds/led-class-flash.c
+++ b/drivers/leds/led-class-flash.c
@@ -188,7 +188,7 @@ static ssize_t flash_fault_show(struct device *dev,
{
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
- u32 fault, mask = 0x1;
+ u32 fault = 0, mask = 0x1;
char *pbuf = buf;
int i, ret, buf_len;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0498/1756] regulator: mp886x: check get_voltage_sel() return value
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (496 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0497/1756] leds: flash: Prevent using uninitialized variable in flash_fault_show() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0499/1756] regulator: mp886x: fix pontential division by zero Greg Kroah-Hartman
` (500 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jisheng Zhang, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jisheng Zhang <jszhang@kernel.org>
[ Upstream commit 87121c42fadc7683469aee96ad833bc560197a55 ]
The get_voltage_sel() can fail, resulting in negative error codes
stored in unsigned integers and corrupted state logic.
Fixes: 97be82880b61 ("regulator: add support for MP8869 regulator")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260901043123.5401-1-jszhang@kernel.org?part=1
Link: https://patch.msgid.link/20260909143957.9284-2-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/mp886x.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/mp886x.c b/drivers/regulator/mp886x.c
index 451bd7c0abe24..75c6d9e5d550a 100644
--- a/drivers/regulator/mp886x.c
+++ b/drivers/regulator/mp886x.c
@@ -256,6 +256,7 @@ static int mp886x_regulator_register(struct mp886x_device_info *di,
{
struct regulator_desc *rdesc = &di->desc;
struct regulator_dev *rdev;
+ int sel;
rdesc->name = "mp886x-reg";
rdesc->supply_name = "vin";
@@ -277,7 +278,12 @@ static int mp886x_regulator_register(struct mp886x_device_info *di,
rdev = devm_regulator_register(di->dev, &di->desc, config);
if (IS_ERR(rdev))
return PTR_ERR(rdev);
- di->sel = rdesc->ops->get_voltage_sel(rdev);
+
+ sel = rdesc->ops->get_voltage_sel(rdev);
+ if (sel < 0)
+ return sel;
+ di->sel = sel;
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0499/1756] regulator: mp886x: fix pontential division by zero
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (497 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0498/1756] regulator: mp886x: check get_voltage_sel() return value Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0500/1756] arm64: dts: ti: k3-am62-verdin: fix main_gpio0/main_gpio1 line names size Greg Kroah-Hartman
` (499 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jisheng Zhang, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jisheng Zhang <jszhang@kernel.org>
[ Upstream commit d16ef5debccc4289c1f25309a2cccfbbe879601a ]
If the "mps,fb-voltage-divider" 2nd var is 0, there will be division
by zero bug.
Fixes: 97be82880b61 ("regulator: add support for MP8869 regulator")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260901043123.5401-1-jszhang@kernel.org?part=1
Link: https://patch.msgid.link/20260909143957.9284-3-jszhang@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/mp886x.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/regulator/mp886x.c b/drivers/regulator/mp886x.c
index 75c6d9e5d550a..773da194a4e4e 100644
--- a/drivers/regulator/mp886x.c
+++ b/drivers/regulator/mp886x.c
@@ -317,6 +317,9 @@ static int mp886x_i2c_probe(struct i2c_client *client)
if (ret)
return ret;
+ if (di->r[1] == 0)
+ return -EINVAL;
+
di->en_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
if (IS_ERR(di->en_gpio))
return PTR_ERR(di->en_gpio);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0500/1756] arm64: dts: ti: k3-am62-verdin: fix main_gpio0/main_gpio1 line names size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (498 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0499/1756] regulator: mp886x: fix pontential division by zero Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0501/1756] RDMA/irdma: Use kvzalloc for lvl2 leafmem allocation Greg Kroah-Hartman
` (498 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Francesco Dolcini, Nishanth Menon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francesco Dolcini <francesco.dolcini@toradex.com>
[ Upstream commit 11a51e82e1f997975a28358a1dcffec190ea7282 ]
gpio-line-names sized main_gpio0/main_gpio1 for 87/88 lines, the SoC's
ti,ngpio values before they were corrected to 92/52 in commit
28c8f2189d80 ("arm64: dts: ti: k3-am62-main: Fix GPIO numbers in DT"),
four months before this file was written. Resize both arrays to match,
keeping every existing label at its original index.
Fixes: 316b80246b16 ("arm64: dts: ti: add verdin am62")
Assisted-by: LLM
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/20260914190943.50843-1-francesco@dolcini.it
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 41 +++-------------------
1 file changed, 5 insertions(+), 36 deletions(-)
diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
index 7cb4d28a28845..47e32b05ea62a 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
@@ -994,6 +994,11 @@ &main_gpio0 {
"",
"",
"",
+ "",
+ "",
+ "",
+ "",
+ "", /* 90 */
"";
};
@@ -1050,42 +1055,6 @@ &main_gpio1 {
"",
"SODIMM_17",
"SODIMM_155", /* 50 */
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "", /* 60 */
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "", /* 70 */
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "", /* 80 */
- "",
- "",
- "",
- "",
- "",
- "",
"";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0501/1756] RDMA/irdma: Use kvzalloc for lvl2 leafmem allocation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (499 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0500/1756] arm64: dts: ti: k3-am62-verdin: fix main_gpio0/main_gpio1 line names size Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0502/1756] ata: pata_parport: fix parport attach idr_alloc for Greg Kroah-Hartman
` (497 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeremy Bongio, Jacob Moroni,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Bongio <jbongio@google.com>
[ Upstream commit 9c40f13a63a4b87177de3e8c318af25068fc6ab4 ]
During VM live migration or when registering large memory regions
(e.g., guest memory >= 256 GB backed by 4 KiB pages), get_lvl2_pble()
calculates total leaves exceeding ~131,072. The memory required for
lvl2->leafmem.va exceeds 4 MiB (sizeof(*leaf) * total > 5.24 MiB).
Because kzalloc() requires physically contiguous pages, requests larger
than MAX_PAGE_ORDER (4 MiB on x86_64) fail and trigger a warning:
WARNING: CPU: 123 PID: 119906 at mm/page_alloc.c:5997 __alloc_frozen_pages_noprof+0x50c/0x1050
Call Trace:
<TASK>
alloc_frozen_pages_noprof+0xc0/0x240
___kmalloc_large_node+0x3d/0xd0
__kmalloc_large_node_noprof+0x1b/0x90
__kmalloc_noprof+0x254/0x660
get_lvl1_lvl2_pble+0xbc/0x270 [irdma]
irdma_get_pble+0x44/0xc0 [irdma]
irdma_setup_pbles+0x46/0x1d0 [irdma]
irdma_reg_user_mr_type_mem+0x41/0x230 [irdma]
irdma_reg_user_mr+0x194/0x1c0 [irdma]
ib_uverbs_reg_mr+0x1b0/0x2c0 [ib_uverbs]
The leafmem array is purely host software tracking structures (struct
irdma_pble_info) and does not require physically contiguous memory.
Switch the allocation from kzalloc() to kvzalloc() and free it with
kvfree() so that requests exceeding MAX_PAGE_ORDER fall back to
virtually contiguous memory via vmalloc.
Fixes: e8c4dbc2fcac ("RDMA/irdma: Add PBLE resource manager")
Assisted-by: LLM
Signed-off-by: Jeremy Bongio <jbongio@google.com>
Link: https://patch.msgid.link/20260916173203.2555458-1-jbongio@google.com
Tested-by: Jacob Moroni <jmoroni@google.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/irdma/pble.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/irdma/pble.c b/drivers/infiniband/hw/irdma/pble.c
index 9370fce3cc8e3..13bbd9d17c0a0 100644
--- a/drivers/infiniband/hw/irdma/pble.c
+++ b/drivers/infiniband/hw/irdma/pble.c
@@ -322,7 +322,7 @@ static void free_lvl2(struct irdma_hmc_pble_rsrc *pble_rsrc,
if (root->addr)
irdma_prm_return_pbles(&pble_rsrc->pinfo, &root->chunkinfo);
- kfree(lvl2->leafmem.va);
+ kvfree(lvl2->leafmem.va);
lvl2->leaf = NULL;
}
@@ -350,7 +350,7 @@ static int get_lvl2_pble(struct irdma_hmc_pble_rsrc *pble_rsrc,
lvl2->leaf_cnt = total;
lvl2->leafmem.size = (sizeof(*leaf) * total);
- lvl2->leafmem.va = kzalloc(lvl2->leafmem.size, GFP_KERNEL);
+ lvl2->leafmem.va = kvzalloc(lvl2->leafmem.size, GFP_KERNEL);
if (!lvl2->leafmem.va)
return -ENOMEM;
@@ -359,7 +359,7 @@ static int get_lvl2_pble(struct irdma_hmc_pble_rsrc *pble_rsrc,
ret_code = irdma_prm_get_pbles(&pble_rsrc->pinfo, &root->chunkinfo,
total << 3, &root->addr, &fpm_addr);
if (ret_code) {
- kfree(lvl2->leafmem.va);
+ kvfree(lvl2->leafmem.va);
lvl2->leaf = NULL;
return -ENOMEM;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0502/1756] ata: pata_parport: fix parport attach idr_alloc for
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (500 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0501/1756] RDMA/irdma: Use kvzalloc for lvl2 leafmem allocation Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0503/1756] ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device() Greg Kroah-Hartman
` (496 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pei Xiao, Niklas Cassel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pei Xiao <xiaopei01@kylinos.cn>
[ Upstream commit 193f5b84a95c02456f51fe5067750ecf73d213d5 ]
idr_alloc() expects an inclusive start and an exclusive end, so passing
port->number as both arguments produces an empty range. Because
idr_alloc() only falls back to INT_MAX when end <= 0, the allocation
succeeds solely for parport0 and returns -ENOSPC for every other port,
which pata_parport_attach() silently ignores. As a result only
parport0 gets probed and any higher-numbered parports are never
attached.
Use port->number + 1 as the end so the range [port->number,
port->number + 1) contains exactly the desired ID.
Fixes: 246a1c4c6b7f ("ata: pata_parport: add driver (PARIDE replacement)")
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://lore.kernel.org/r/cee1a15d98cd0d55f41fd65ca9d222b68a74e7d3.1790047457.git.xiaopei01@kylinos.cn
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/pata_parport/pata_parport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index 5c6651621dfbe..2096a38cb6c87 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -731,7 +731,7 @@ static void pata_parport_attach(struct parport *port)
int pr_num, id;
mutex_lock(&pi_mutex);
- id = idr_alloc(&parport_list, port, port->number, port->number,
+ id = idr_alloc(&parport_list, port, port->number, port->number + 1,
GFP_KERNEL);
if (id < 0) {
mutex_unlock(&pi_mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0503/1756] ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (501 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0502/1756] ata: pata_parport: fix parport attach idr_alloc for Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0504/1756] ASoC: amd: acp3x-es83xx: " Greg Kroah-Hartman
` (495 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 6f50ab7ab1f93e874fa75d18bf98bbca4ce0204f ]
Replace acpi_get_first_physical_node() that is slated for removal
with acpi_bus_get_primary_device() that takes a reference to the
device it is about to return.
This addresses a potential use-after-free that may occur if the
device returned by acpi_get_first_physical_node() is removed right
after dropping its ACPI companion's physical_node_lock in that
function.
It also fixes a device reference counting issue that may lead to
a premature device release if gpiod_get_optional() fails in
st_es8336_late_probe().
Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mark Brown <broonie@kerenl.org>
Link: https://patch.msgid.link/2063881.yKVeVyVuyW@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/acp-es8336.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 3756b8bef17bc..6ccaf87a080db 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -201,7 +201,7 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
if (!adev)
return -ENODEV;
- codec_dev = acpi_get_first_physical_node(adev);
+ codec_dev = acpi_bus_get_primary_device(adev);
acpi_dev_put(adev);
if (!codec_dev) {
dev_err(card->dev, "can not find codec dev\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0504/1756] ASoC: amd: acp3x-es83xx: Switch to use acpi_bus_get_primary_device()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (502 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0503/1756] ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0505/1756] wifi: rtl8xxxu: free RX skb when URB submission fails Greg Kroah-Hartman
` (494 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit aae5bd00ced5b7e42ef3b3aa46923ad72388c60b ]
Replace acpi_get_first_physical_node() that is slated for removal
with acpi_bus_get_primary_device() that takes a reference to the
device it is about to return.
This addresses a potential use-after-free that may occur if the
device returned by acpi_get_first_physical_node() is removed right
after dropping its ACPI companion's physical_node_lock in that
function.
It also fixes a device reference counting issue that may lead to a
premature device release if devm_kzalloc() fails in acp3x_es83xx_probe().
Fixes: 54fcd9dd44b2 ("ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/2310746.NgBsaNRSFp@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
index 3dc41dae158cb..ca62761ea247d 100644
--- a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
+++ b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
@@ -424,7 +424,7 @@ static int acp3x_es83xx_probe(struct snd_soc_card *card)
return -ENXIO;
}
- codec_dev = acpi_get_first_physical_node(adev);
+ codec_dev = acpi_bus_get_primary_device(adev);
acpi_dev_put(adev);
if (!codec_dev) {
dev_warn(dev, "Error cannot find codec device, will defer probe\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0505/1756] wifi: rtl8xxxu: free RX skb when URB submission fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (503 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0504/1756] ASoC: amd: acp3x-es83xx: " Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0506/1756] RDMA/cxgb4: Fix neigh reference leak in rx_pkt() Greg Kroah-Hartman
` (493 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ping-Ke Shih, Kim Wooseok,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kim Wooseok <5mghybrid@khu.ac.kr>
[ Upstream commit 9f7edf4e8584c87e3c478c6dd87c08d51b5157c2 ]
When usb_submit_urb() fails, rtl8xxxu_submit_rx_urb() unanchors the URB
but leaves the newly allocated skb in urb.context. For ENOMEM/EAGAIN,
the RX worker puts the request back on the pending list. The next
submission allocates another skb and overwrites that pointer, leaking
the previous buffer. Stopping before the retry also leaks it, because
pending-list cleanup frees only the URB.
Free the skb and clear urb.context in rtl8xxxu_submit_rx_urb() when
submission fails. This keeps buffer allocation and failure cleanup in
the same function, so a request returned for retry or teardown no longer
owns an skb. Remove the corresponding cleanup from start and the RX
worker; they only need to decide whether to retry or free the URB.
Fixes: 26f1fad29ad9 ("New driver: rtl8xxxu (mac80211)")
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Assisted-by: GPT-6 Astra
Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260921-codex-rtl-rx-v3-submit-v4-1-eeb09fe8f791@khu.ac.kr
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/realtek/rtl8xxxu/core.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c
index 97c5443496163..cce0aae3d103d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
@@ -5890,7 +5890,6 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
struct rtl8xxxu_priv *priv;
struct rtl8xxxu_rx_urb *rx_urb, *tmp;
struct list_head local;
- struct sk_buff *skb;
unsigned long flags;
int ret;
@@ -5922,8 +5921,6 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)
default:
dev_warn(&priv->udev->dev,
"failed to requeue urb with error %i\n", ret);
- skb = (struct sk_buff *)rx_urb->urb.context;
- dev_kfree_skb(skb);
usb_free_urb(&rx_urb->urb);
}
}
@@ -6618,8 +6615,11 @@ static int rtl8xxxu_submit_rx_urb(struct rtl8xxxu_priv *priv,
skb_size, rtl8xxxu_rx_complete, skb);
usb_anchor_urb(&rx_urb->urb, &priv->rx_anchor);
ret = usb_submit_urb(&rx_urb->urb, GFP_ATOMIC);
- if (ret)
+ if (ret) {
usb_unanchor_urb(&rx_urb->urb);
+ dev_kfree_skb(skb);
+ rx_urb->urb.context = NULL;
+ }
return ret;
}
@@ -7431,7 +7431,6 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
struct rtl8xxxu_priv *priv = hw->priv;
struct rtl8xxxu_rx_urb *rx_urb;
struct rtl8xxxu_tx_urb *tx_urb;
- struct sk_buff *skb;
unsigned long flags;
int ret, i;
@@ -7482,13 +7481,8 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
rx_urb->hw = hw;
ret = rtl8xxxu_submit_rx_urb(priv, rx_urb);
- if (ret) {
- if (ret != -ENOMEM) {
- skb = (struct sk_buff *)rx_urb->urb.context;
- dev_kfree_skb(skb);
- }
+ if (ret)
rtl8xxxu_queue_rx_urb(priv, rx_urb);
- }
}
schedule_delayed_work(&priv->ra_watchdog, 2 * HZ);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0506/1756] RDMA/cxgb4: Fix neigh reference leak in rx_pkt()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (504 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0505/1756] wifi: rtl8xxxu: free RX skb when URB submission fails Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0507/1756] RDMA/cxgb4: Fix skb " Greg Kroah-Hartman
` (492 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit 5fb3051aa4611ae18e304814fb1b74a30065fd85 ]
If ip_dev_find() fails on the loopback path the code jumps to
free_dst without releasing the neighbour reference taken by
dst_neigh_lookup_skb(), leaking one neigh reference.
Release the neighbour before jumping to free_dst.
Fixes: ef42520240aa ("RDMA/cxgb4: add null-ptr-check after ip_dev_find()")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260916183530.2092534-1-vulab@iscas.ac.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/cxgb4/cm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 8d753e6e0c719..07cf0026cf1e3 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -4156,6 +4156,7 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
pdev = ip_dev_find(&init_net, iph->daddr);
if (!pdev) {
pr_err("%s - failed to find device!\n", __func__);
+ neigh_release(neigh);
goto free_dst;
}
e = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0507/1756] RDMA/cxgb4: Fix skb reference leak in rx_pkt()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (505 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0506/1756] RDMA/cxgb4: Fix neigh reference leak in rx_pkt() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0508/1756] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event() Greg Kroah-Hartman
` (491 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit 5eb6ecb612841927b5ede554a0e9d88240934282 ]
rx_pkt() takes an extra reference on the received skb so it can be
handed to the firmware completion path via req->cookie. When the
work request skb allocation in send_fw_pass_open_req() fails the
function returns without releasing that extra reference, leaking
one skb reference.
Free the packet skb before returning when the allocation fails,
matching the cxgb4_ofld_send() failure path.
Fixes: 1cab775c3e75 ("RDMA/cxgb4: Fix LE hash collision bug for passive open connection")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260916183715.2092663-1-vulab@iscas.ac.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/cxgb4/cm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 07cf0026cf1e3..51b0eb021dfc1 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -4006,8 +4006,10 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb,
int ret;
req_skb = alloc_skb(sizeof(struct fw_ofld_connection_wr), GFP_KERNEL);
- if (!req_skb)
+ if (!req_skb) {
+ kfree_skb(skb);
return;
+ }
req = __skb_put_zero(req_skb, sizeof(*req));
req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F);
req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0508/1756] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (506 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0507/1756] RDMA/cxgb4: Fix skb " Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0509/1756] RDMA/siw: Fix qp use-after-free in siw_get_base_qp() Greg Kroah-Hartman
` (490 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit 65f3eab431944415bbe5e3af1bbb2736d4bb1523 ]
Since commit 312b8f79eb05 ("RDMA/mlx: Calling qp event handler in
workqueue context") rsc_event_notifier() expects the event handler to
drop the resource reference taken by mlx5_get_rsc(). mlx5_ib_wq_event()
was missed by that conversion, so every RQ event leaks one reference,
which keeps destroy_resource_common() waiting on the completion.
Put the resource reference on all exits of the handler.
Fixes: 312b8f79eb05 ("RDMA/mlx: Calling qp event handler in workqueue context")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260916183921.2092821-1-vulab@iscas.ac.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/qp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 2b0047e6fd49a..6259eeb6f9776 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -5171,11 +5171,14 @@ static void mlx5_ib_wq_event(struct mlx5_core_qp *core_qp, int type)
break;
default:
mlx5_ib_warn(dev, "Unexpected event type %d on WQ %06x\n", type, core_qp->qpn);
- return;
+ goto out;
}
rwq->ibwq.event_handler(&event, rwq->ibwq.wq_context);
}
+
+out:
+ mlx5_core_res_put(&core_qp->common);
}
static int set_delay_drop(struct mlx5_ib_dev *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0509/1756] RDMA/siw: Fix qp use-after-free in siw_get_base_qp()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (507 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0508/1756] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0510/1756] hwrng: starfive - propagate clock and reset errors Greg Kroah-Hartman
` (489 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit ef15197f81ffedf29560edf2221199d92fd83dc2 ]
The reference taken by siw_qp_id2obj() is dropped before the address
of the embedded ib_qp is taken from the QP. If that reference was
the last one the QP is freed and the pointer returned to the iwarp
core is dangling; the core only pins the QP with iw_add_ref() after
the call has returned.
Copy the pointer while the reference is still held.
Fixes: 6c52fdc244b5 ("rdma/siw: connection management")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260916184400.2093106-1-vulab@iscas.ac.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/sw/siw/siw_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c
index 14d3103aee6f8..0e53bda4f5a12 100644
--- a/drivers/infiniband/sw/siw/siw_main.c
+++ b/drivers/infiniband/sw/siw/siw_main.c
@@ -218,8 +218,11 @@ static struct ib_qp *siw_get_base_qp(struct ib_device *base_dev, int id)
/*
* siw_qp_id2obj() increments object reference count
*/
+ struct ib_qp *base_qp = &qp->base_qp;
+
siw_qp_put(qp);
- return &qp->base_qp;
+
+ return base_qp;
}
return NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0510/1756] hwrng: starfive - propagate clock and reset errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (508 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0509/1756] RDMA/siw: Fix qp use-after-free in siw_get_base_qp() Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0511/1756] crypto: starfive - handle clock enable failures Greg Kroah-Hartman
` (488 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit ace145efdd80cd2eb95e84b1087d0f1fc55bdc0d ]
The StarFive TRNG probe and resume paths ignore failures from their clock
and reset operations. That lets the driver register or resume while its
hardware access prerequisites were not established.
Check each transition, unwind only the previously enabled clock on failure,
and propagate the error to the probe or PM core.
Fixes: c388f458bc34 ("hwrng: starfive - Add TRNG driver for StarFive SoC")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/char/hw_random/jh7110-trng.c | 39 +++++++++++++++++++++-------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/drivers/char/hw_random/jh7110-trng.c b/drivers/char/hw_random/jh7110-trng.c
index 4712c3c530e42..6bfd52f5d1b1e 100644
--- a/drivers/char/hw_random/jh7110-trng.c
+++ b/drivers/char/hw_random/jh7110-trng.c
@@ -321,9 +321,17 @@ static int starfive_trng_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(trng->rst),
"Error getting hardware reset line\n");
- clk_prepare_enable(trng->hclk);
- clk_prepare_enable(trng->ahb);
- reset_control_deassert(trng->rst);
+ ret = clk_prepare_enable(trng->hclk);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(trng->ahb);
+ if (ret)
+ goto disable_hclk;
+
+ ret = reset_control_deassert(trng->rst);
+ if (ret)
+ goto disable_ahb;
trng->rng.name = dev_driver_string(&pdev->dev);
trng->rng.init = starfive_trng_init;
@@ -343,13 +351,18 @@ static int starfive_trng_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
reset_control_assert(trng->rst);
- clk_disable_unprepare(trng->ahb);
- clk_disable_unprepare(trng->hclk);
-
- return dev_err_probe(&pdev->dev, ret, "Failed to register hwrng\n");
+ ret = dev_err_probe(&pdev->dev, ret, "Failed to register hwrng\n");
+ goto disable_ahb;
}
return 0;
+
+disable_ahb:
+ clk_disable_unprepare(trng->ahb);
+disable_hclk:
+ clk_disable_unprepare(trng->hclk);
+
+ return ret;
}
static int __maybe_unused starfive_trng_suspend(struct device *dev)
@@ -365,11 +378,17 @@ static int __maybe_unused starfive_trng_suspend(struct device *dev)
static int __maybe_unused starfive_trng_resume(struct device *dev)
{
struct starfive_trng *trng = dev_get_drvdata(dev);
+ int ret;
- clk_prepare_enable(trng->hclk);
- clk_prepare_enable(trng->ahb);
+ ret = clk_prepare_enable(trng->hclk);
+ if (ret)
+ return ret;
- return 0;
+ ret = clk_prepare_enable(trng->ahb);
+ if (ret)
+ clk_disable_unprepare(trng->hclk);
+
+ return ret;
}
static const struct dev_pm_ops starfive_trng_pm_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0511/1756] crypto: starfive - handle clock enable failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (509 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0510/1756] hwrng: starfive - propagate clock and reset errors Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0512/1756] crypto: starfive - propagate clock and reset errors Greg Kroah-Hartman
` (487 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiawen Liu, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiawen Liu <1298662399@qq.com>
[ Upstream commit 5358248961ae23f7253d010ddfde1cfd2556ce22 ]
Return error from failed clock enable.
starfive_cryp_probe ignores clk_prepare_enable return for hclk/ahb, then
remove/error paths unconditionally clk_disable_unprepare both clocks.
Check consecutive clk_prepare_enable(cryp->hclk)/cryp->ahb returns in
starfive_cryp_probe.
Signed-off-by: Jiawen Liu <1298662399@qq.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: c8acdd77a623 ("crypto: starfive - propagate clock and reset errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/starfive/jh7110-cryp.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/starfive/jh7110-cryp.c b/drivers/crypto/starfive/jh7110-cryp.c
index e4dfed7ee0b01..a373eba869cc1 100644
--- a/drivers/crypto/starfive/jh7110-cryp.c
+++ b/drivers/crypto/starfive/jh7110-cryp.c
@@ -126,8 +126,15 @@ static int starfive_cryp_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(cryp->rst),
"Error getting hardware reset line\n");
- clk_prepare_enable(cryp->hclk);
- clk_prepare_enable(cryp->ahb);
+ ret = clk_prepare_enable(cryp->hclk);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(cryp->ahb);
+ if (ret) {
+ clk_disable_unprepare(cryp->hclk);
+ return ret;
+ }
reset_control_deassert(cryp->rst);
spin_lock(&dev_list.lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0512/1756] crypto: starfive - propagate clock and reset errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (510 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0511/1756] crypto: starfive - handle clock enable failures Greg Kroah-Hartman
@ 2026-11-18 14:43 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0513/1756] crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH Greg Kroah-Hartman
` (486 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:43 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit c8acdd77a62374507ed8e70d59e124269d999b75 ]
starfive_cryp_probe() publishes the crypto device after enabling its clocks
and deasserting its reset without checking whether those operations
succeeded.
Check each hardware activation step and unwind only the resources that were
actually enabled before returning the error.
Fixes: 42ef0e944b01 ("crypto: starfive - Add crypto engine support")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/starfive/jh7110-cryp.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/crypto/starfive/jh7110-cryp.c b/drivers/crypto/starfive/jh7110-cryp.c
index a373eba869cc1..9684daa3f03e5 100644
--- a/drivers/crypto/starfive/jh7110-cryp.c
+++ b/drivers/crypto/starfive/jh7110-cryp.c
@@ -131,11 +131,12 @@ static int starfive_cryp_probe(struct platform_device *pdev)
return ret;
ret = clk_prepare_enable(cryp->ahb);
- if (ret) {
- clk_disable_unprepare(cryp->hclk);
- return ret;
- }
- reset_control_deassert(cryp->rst);
+ if (ret)
+ goto disable_hclk;
+
+ ret = reset_control_deassert(cryp->rst);
+ if (ret)
+ goto disable_ahb;
spin_lock(&dev_list.lock);
list_add(&cryp->list, &dev_list.dev_list);
@@ -185,9 +186,11 @@ static int starfive_cryp_probe(struct platform_device *pdev)
list_del(&cryp->list);
spin_unlock(&dev_list.lock);
- clk_disable_unprepare(cryp->hclk);
- clk_disable_unprepare(cryp->ahb);
reset_control_assert(cryp->rst);
+disable_ahb:
+ clk_disable_unprepare(cryp->ahb);
+disable_hclk:
+ clk_disable_unprepare(cryp->hclk);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0513/1756] crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (511 preceding siblings ...)
2026-11-18 14:43 ` [PATCH 6.12 0512/1756] crypto: starfive - propagate clock and reset errors Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0514/1756] crypto: ccp - kill v3 IRQ tasklet during teardown Greg Kroah-Hartman
` (485 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Weili Qian, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weili Qian <qianweili@huawei.com>
[ Upstream commit 5b87f619cc5c0a55dcd85ce97974e3f5b9333b7b ]
In hpre_ecdh_hw_data_clr_all(), req->dst is always NULL because
hpre_ecdh_dst_data_init() sets hpre_req->dst = NULL before mapping
the user buffer with dma_map_single(). The dma_free_coherent() call
on req->dst is therefore dead code. Remove it.
Fixes: 05e7b906aa7c ("crypto: hisilicon/hpre - add 'ECDH' algorithm")
Signed-off-by: Weili Qian <qianweili@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
index e704b62d8beed..91232d2dd4ba4 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
@@ -1467,8 +1467,6 @@ static void hpre_ecdh_hw_data_clr_all(struct hpre_ctx *ctx,
if (unlikely(dma_mapping_error(dev, dma)))
return;
- if (req->dst)
- dma_free_coherent(dev, ctx->key_sz << 1, req->dst, dma);
if (dst)
dma_unmap_single(dev, dma, ctx->key_sz << 1, DMA_FROM_DEVICE);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0514/1756] crypto: ccp - kill v3 IRQ tasklet during teardown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (512 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0513/1756] crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0515/1756] crypto: ccp - kill v5 " Greg Kroah-Hartman
` (484 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit b72a639bdee6e07d8091718ac3e451d9c5cba1b5 ]
On PCI devices using MSI-X, ccp_irq_handler() schedules irq_tasklet. The
teardown paths release the IRQ but do not drain a tasklet that was
already queued, so it can access ccp after the device-managed allocation
has been released.
Kill the tasklet after releasing the IRQ in both the initialization
error path and ccp_destroy().
Fixes: 7b537b24e76a ("crypto: ccp - Change ISR handler method for a v3 CCP")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/ccp/ccp-dev-v3.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
index fe69053b2394d..e85b4ded417aa 100644
--- a/drivers/crypto/ccp/ccp-dev-v3.c
+++ b/drivers/crypto/ccp/ccp-dev-v3.c
@@ -506,6 +506,8 @@ static int ccp_init(struct ccp_device *ccp)
kthread_stop(ccp->cmd_q[i].kthread);
sp_free_ccp_irq(ccp->sp, ccp);
+ if (ccp->use_tasklet)
+ tasklet_kill(&ccp->irq_tasklet);
e_pool:
for (i = 0; i < ccp->cmd_q_count; i++)
@@ -545,6 +547,8 @@ static void ccp_destroy(struct ccp_device *ccp)
kthread_stop(ccp->cmd_q[i].kthread);
sp_free_ccp_irq(ccp->sp, ccp);
+ if (ccp->use_tasklet)
+ tasklet_kill(&ccp->irq_tasklet);
for (i = 0; i < ccp->cmd_q_count; i++)
dma_pool_destroy(ccp->cmd_q[i].dma_pool);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0515/1756] crypto: ccp - kill v5 IRQ tasklet during teardown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (513 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0514/1756] crypto: ccp - kill v3 IRQ tasklet during teardown Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0516/1756] RDMA/mlx5: Guard steering anchor resource destruction on create error Greg Kroah-Hartman
` (483 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 67aefeccc4101a93627f36abbd049f191b54f903 ]
On PCI devices using MSI-X, ccp5_irq_handler() schedules irq_tasklet.
The teardown paths release the IRQ but do not drain a tasklet that was
already queued, so it can access ccp after the device-managed allocation
has been released.
Kill the tasklet after releasing the IRQ in both the initialization
error path and ccp5_destroy().
Fixes: 6263b51eb319 ("crypto: ccp - Change ISR handler method for a v5 CCP")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/ccp/ccp-dev-v5.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index 7b73332d6aa1a..4235be5df546a 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -995,6 +995,8 @@ static int ccp5_init(struct ccp_device *ccp)
e_irq:
sp_free_ccp_irq(ccp->sp, ccp);
+ if (ccp->use_tasklet)
+ tasklet_kill(&ccp->irq_tasklet);
e_pool:
for (i = 0; i < ccp->cmd_q_count; i++)
@@ -1046,6 +1048,8 @@ static void ccp5_destroy(struct ccp_device *ccp)
kthread_stop(ccp->cmd_q[i].kthread);
sp_free_ccp_irq(ccp->sp, ccp);
+ if (ccp->use_tasklet)
+ tasklet_kill(&ccp->irq_tasklet);
/* Flush the cmd and backlog queue */
while (!list_empty(&ccp->cmd)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0516/1756] RDMA/mlx5: Guard steering anchor resource destruction on create error
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (514 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0515/1756] crypto: ccp - kill v5 " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0517/1756] swim: Assert strobe with stable outputs Greg Kroah-Hartman
` (482 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit 193aaf5b57f05d9f0403cfdaff3eda3b8d11ec13 ]
The steering anchor resources are shared between anchors with the same
priority and are protected by rule_goto_table_ref.
When steering anchor creation succeeds but uverbs_copy_to() fails, the
error path drops the reference acquired for the new anchor. However, it
unconditionally calls mlx5_steering_anchor_destroy_res(), even when
other anchors are still using the shared resources.
This can destroy the shared flow table, flow groups, and rules while
existing anchors still hold references to them, resulting in a
use-after-free when those anchors are subsequently cleaned up.
Only destroy the shared resources when dropping the reference makes
rule_goto_table_ref zero, consistent with the existing cleanup path.
Fixes: e1f4a52ac171 ("RDMA/mlx5: Create an indirect flow table for steering anchor")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260917085419.1792-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/fs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c
index 520034acf73aa..186085cfb4e9b 100644
--- a/drivers/infiniband/hw/mlx5/fs.c
+++ b/drivers/infiniband/hw/mlx5/fs.c
@@ -2466,8 +2466,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_STEERING_ANCHOR_CREATE)(
return 0;
destroy_res:
- --ft_prio->anchor.rule_goto_table_ref;
- mlx5_steering_anchor_destroy_res(ft_prio);
+ if (!--ft_prio->anchor.rule_goto_table_ref)
+ mlx5_steering_anchor_destroy_res(ft_prio);
put_flow_table:
put_flow_table(dev, ft_prio, true);
free_obj:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0517/1756] swim: Assert strobe with stable outputs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (515 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0516/1756] RDMA/mlx5: Guard steering anchor resource destruction on create error Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0518/1756] swim: Select appropriate drive once only Greg Kroah-Hartman
` (481 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Finn Thain, Stan Johnson, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit adcc410bfb41715fef198a0975db4ed594a49bb7 ]
Inside Macintosh says, "Be sure that you don't change CA0-CA2 or SEL
while LSTRB is high". Unfortunately, those bits do change. The CA0-CA2
outputs become inputs when (LSTRB << 4) | LSTRB gets written to the
phase register. Then LSTRB is driven low (with CA0-CA2 bits set).
This is a problem because the drive interprets a STEP command as an
EJECT command when these pins float high. This occurs intermittently,
perhaps because interrupts are disabled and the race condition happens
to end well. However, when I add code to step the heads with interrupts
enabled, the disk always ejects.
Keep the four phase pin directions set to output and hold their levels
constant during LSTRB signalling. Introduce the PHASE_PIN_DIRECTION
macro to separate the pin configuration from the logic level changes.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/6da86b9bfd1335fac3ebc8c435fb613d5de4a70c.1788513996.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 62 ++++++++++++++++++++++----------------------
1 file changed, 31 insertions(+), 31 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 126f151c4f2cf..bd619c57ebc96 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -87,37 +87,37 @@ struct iwm {
#define iwm_write(base, reg, v) out_8(&(base)->reg, (v))
#define iwm_read(base, reg) in_8(&(base)->reg)
-/* bits in phase register */
+/* Bits in phase register */
-#define SEEK_POSITIVE 0x070
-#define SEEK_NEGATIVE 0x074
-#define STEP 0x071
-#define MOTOR_ON 0x072
-#define MOTOR_OFF 0x076
-#define INDEX 0x073
-#define EJECT 0x077
-#define SETMFM 0x171
-#define SETGCR 0x175
-
-#define RELAX 0x033
-#define LSTRB 0x008
-
-#define CA_MASK 0x077
+#define RELAX 0x03
+#define LSTRB 0x08
+#define CA_MASK 0x07
+#define PHASE_PIN_DIR 0xF0
/* Select values for swim_select and swim_readbit */
-#define READ_DATA_0 0x074
-#define ONEMEG_DRIVE 0x075
-#define SINGLE_SIDED 0x076
-#define DRIVE_PRESENT 0x077
-#define DISK_IN 0x170
-#define WRITE_PROT 0x171
-#define TRACK_ZERO 0x172
-#define TACHO 0x173
-#define READ_DATA_1 0x174
-#define GCR_MODE 0x175
-#define SEEK_COMPLETE 0x176
-#define TWOMEG_MEDIA 0x177
+#define SEEK_POSITIVE 0x000
+#define SEEK_NEGATIVE 0x004
+#define STEP 0x001
+#define MOTOR_ON 0x002
+#define MOTOR_OFF 0x006
+#define INDEX 0x003
+#define EJECT 0x007
+#define SETMFM 0x101
+#define SETGCR 0x105
+
+#define READ_DATA_0 0x004
+#define ONEMEG_DRIVE 0x005
+#define SINGLE_SIDED 0x006
+#define DRIVE_PRESENT 0x007
+#define DISK_IN 0x100
+#define WRITE_PROT 0x101
+#define TRACK_ZERO 0x102
+#define TACHO 0x103
+#define READ_DATA_1 0x104
+#define GCR_MODE 0x105
+#define SEEK_COMPLETE 0x106
+#define TWOMEG_MEDIA 0x107
/* Bits in handshake register */
@@ -269,11 +269,11 @@ static inline int get_swim_mode(struct swim __iomem *base)
static inline void swim_select(struct swim __iomem *base, int sel)
{
- swim_write(base, phase, RELAX);
+ swim_write(base, phase, RELAX | PHASE_PIN_DIR);
via1_set_head(sel & 0x100);
- swim_write(base, phase, sel & CA_MASK);
+ swim_write(base, phase, (sel & CA_MASK) | PHASE_PIN_DIR);
}
static inline void swim_action(struct swim __iomem *base, int action)
@@ -284,9 +284,9 @@ static inline void swim_action(struct swim __iomem *base, int action)
swim_select(base, action);
udelay(1);
- swim_write(base, phase, (LSTRB<<4) | LSTRB);
+ swim_write(base, phase, LSTRB | action | PHASE_PIN_DIR);
udelay(1);
- swim_write(base, phase, (LSTRB<<4) | ((~LSTRB) & 0x0F));
+ swim_write(base, phase, action | PHASE_PIN_DIR);
udelay(1);
local_irq_restore(flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0518/1756] swim: Select appropriate drive once only
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (516 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0517/1756] swim: Assert strobe with stable outputs Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0519/1756] swim: Enable the drive when probing Greg Kroah-Hartman
` (480 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit a2d22b3f25c388f9fbce7bf36a45a8900dce4aa3 ]
Before turning off the spindle motor, call swim_drive() to select the
appropriate drive. Remove the swim_drive() call from swim_add_floppy()
because it was already called by swim_floppy_init().
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/370f73fcceb53ce4860904ce6cf4f06ade0e43d5.1788513996.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index bd619c57ebc96..83842dc667374 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -679,8 +679,10 @@ static void floppy_release(struct gendisk *disk)
else if (fs->ref_count > 0)
--fs->ref_count;
- if (fs->ref_count == 0)
+ if (fs->ref_count == 0) {
+ swim_drive(base, fs->location);
swim_motor(base, OFF);
+ }
mutex_unlock(&swim_mutex);
}
@@ -752,8 +754,6 @@ static int swim_add_floppy(struct swim_priv *swd, enum drive_location location)
fs->location = location;
- swim_drive(base, location);
-
swim_motor(base, OFF);
fs->type = HD_MEDIA;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0519/1756] swim: Enable the drive when probing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (517 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0518/1756] swim: Select appropriate drive once only Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0520/1756] swim: Dont disable drive after every sector Greg Kroah-Hartman
` (479 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 57d88c8f4ea34a4dd7c5351bd026e225c7283f3f ]
According to the ISM spec, the MOTON bit "causes the Enable 1 and Enable 2
signals to be turned on to the drive." It doesn't actually turn on the
motor. When selecting a drive, enable MOTON. Disable it upon eject or
release. This fixes detection of the Sony FDHD drive.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/f5bf5b596a33a801faaaaa6dc2844c30d3ee82b2.1788513996.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 83842dc667374..d69dfd6a824a5 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -154,8 +154,9 @@ struct iwm {
/*----------------------------------------------------------------------------*/
enum drive_location {
- INTERNAL_DRIVE = 0x02,
- EXTERNAL_DRIVE = 0x04,
+ NO_DRIVE = 0,
+ INTERNAL_DRIVE = BIT(1),
+ EXTERNAL_DRIVE = BIT(2),
};
enum media_type {
@@ -311,9 +312,15 @@ static inline void swim_drive(struct swim __iomem *base,
if (location == INTERNAL_DRIVE) {
swim_write(base, mode0, EXTERNAL_DRIVE); /* clear drive 1 bit */
swim_write(base, mode1, INTERNAL_DRIVE); /* set drive 0 bit */
+ swim_write(base, mode1, MOTON);
} else if (location == EXTERNAL_DRIVE) {
swim_write(base, mode0, INTERNAL_DRIVE); /* clear drive 0 bit */
swim_write(base, mode1, EXTERNAL_DRIVE); /* set drive 1 bit */
+ swim_write(base, mode1, MOTON);
+ } else {
+ swim_write(base, mode0, INTERNAL_DRIVE);
+ swim_write(base, mode0, EXTERNAL_DRIVE);
+ swim_write(base, mode0, MOTON);
}
}
@@ -447,6 +454,7 @@ static int floppy_eject(struct floppy_state *fs)
swim_drive(base, fs->location);
swim_motor(base, OFF);
swim_eject(base);
+ swim_drive(base, NO_DRIVE);
fs->disk_in = 0;
fs->ejected = 1;
@@ -652,8 +660,10 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
else if (fs->ref_count > 0)
--fs->ref_count;
- if (fs->ref_count == 0)
+ if (fs->ref_count == 0) {
swim_motor(base, OFF);
+ swim_drive(base, NO_DRIVE);
+ }
return err;
}
@@ -682,6 +692,7 @@ static void floppy_release(struct gendisk *disk)
if (fs->ref_count == 0) {
swim_drive(base, fs->location);
swim_motor(base, OFF);
+ swim_drive(base, NO_DRIVE);
}
mutex_unlock(&swim_mutex);
}
@@ -804,6 +815,7 @@ static int swim_floppy_init(struct swim_priv *swd)
if (swim_readbit(base, DRIVE_PRESENT) &&
!swim_readbit(base, ONEMEG_DRIVE))
swim_add_floppy(swd, EXTERNAL_DRIVE);
+ swim_drive(base, NO_DRIVE);
/* register floppy drives */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0520/1756] swim: Dont disable drive after every sector
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (518 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0519/1756] swim: Enable the drive when probing Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0521/1756] swim: Perform ISM/IWM mode switching according to specs Greg Kroah-Hartman
` (478 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 05a7c4b197279cfb3ec3df26146ce085a2438aec ]
This fixes multi-sector reads on a Sony drive. The Mitsubishi drive
doesn't seem to care either way.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/fc511e72753ae18b6f021701aa00d480335b0caf.1788513996.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index d69dfd6a824a5..6f40b057032a8 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -473,8 +473,6 @@ static inline int swim_read_sector(struct floppy_state *fs,
short i;
swim_track(fs, track);
-
- swim_write(base, mode1, MOTON);
swim_head(base, side);
swim_write(base, mode0, side);
@@ -490,8 +488,6 @@ static inline int swim_read_sector(struct floppy_state *fs,
}
local_irq_restore(flags);
- swim_write(base, mode0, MOTON);
-
if ((header.side != side) || (header.track != track) ||
(header.sector != sector))
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0521/1756] swim: Perform ISM/IWM mode switching according to specs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (519 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0520/1756] swim: Dont disable drive after every sector Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0522/1756] swim: Configure parameter memory Greg Kroah-Hartman
` (477 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 52981bb358d1b5c38040b00f81e2cf973f9148ad ]
The SWIM spec says, "MOTOREN must be low to switch modes" and "after
switching from ISM to IWM, the very first command must be a clear L7".
The ISM spec says, MOTOREN "must not be cleared until after the Action
bit is cleared". Perform those operations in the correct sequence.
When switching to ISM mode, the Mode register has to be selected with a
particular sequence of bit flips. Set q7 low then q6 low then mtrOff.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/75714ecc9a12d59511967dc9e24163dc8f3bbdd8.1788513996.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 6f40b057032a8..3e08fbf2ba2d9 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -149,6 +149,7 @@ struct iwm {
#define ACTION 0x08
#define WRITE_MODE 0x10
#define HEDSEL 0x20
+#define ISM_SELECT 0x40
#define MOTON 0x80
/*----------------------------------------------------------------------------*/
@@ -223,18 +224,21 @@ extern int swim_read_sector_data(struct swim __iomem *base,
static DEFINE_MUTEX(swim_mutex);
static inline void set_swim_mode(struct swim __iomem *base, int enable)
{
- struct iwm __iomem *iwm_base;
+ struct iwm __iomem *iwm_base = (struct iwm __iomem *)base;
unsigned long flags;
if (!enable) {
- swim_write(base, mode0, 0xf8);
+ swim_write(base, mode0, ACTION);
+ swim_write(base, mode0, ENBL1 | ENBL2 | MOTON);
+ swim_write(base, mode0, ISM_SELECT);
+ iwm_read(iwm_base, q7L);
return;
}
- iwm_base = (struct iwm __iomem *)base;
local_irq_save(flags);
iwm_read(iwm_base, q7L);
+ iwm_read(iwm_base, q6L);
iwm_read(iwm_base, mtrOff);
iwm_read(iwm_base, q6H);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0522/1756] swim: Configure parameter memory
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (520 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0521/1756] swim: Perform ISM/IWM mode switching according to specs Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0523/1756] swim: Refactor SWIM setup Greg Kroah-Hartman
` (476 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 994a778d966592d0e211deaf6e436fcb21413935 ]
The original SWIM chip has a 16 byte memory to store parameters which
control read/write timing. The SWIM 2 chip retains the last 4 parameters
which control write pre-compensation, but omits the first 12. Hence
SWIM 2 can perform reads without any parameter memory setup but SWIM 1
cannot.
Configure the SWIM parameter memory with the appropriate values so that
SWIM 1 can read too. The parameters used here were observed in SWIM chip
memory, using Macsbug, while MacOS was reading from an MFM floppy disk.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/eccb76911fd255330b05eb3174ac15c29bb41a23.1788513996.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 3e08fbf2ba2d9..b8107ee501b15 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -796,6 +796,17 @@ static void swim_cleanup_floppy_disk(struct floppy_state *fs)
blk_mq_free_tag_set(&fs->tag_set);
}
+static void swim_set_parameters(struct swim __iomem *base)
+{
+ unsigned int i;
+ static const u8 mem[] = { 0x18, 0x41, 0x2e, 0x2e, 0x18, 0x18, 0x1b, 0x1b,
+ 0x2f, 0x2f, 0x19, 0x19, 0x97, 0x1b, 0x57, 0x3b, };
+
+ swim_write(base, mode0, 0); /* reset parameter memory index */
+ for (i = 0; i < 16; ++i)
+ swim_write(base, parameter, mem[i]);
+}
+
static int swim_floppy_init(struct swim_priv *swd)
{
struct queue_limits lim = {
@@ -805,6 +816,8 @@ static int swim_floppy_init(struct swim_priv *swd)
int drive;
struct swim __iomem *base = swd->base;
+ swim_set_parameters(base);
+
/* scan floppy drives */
swim_drive(base, INTERNAL_DRIVE);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0523/1756] swim: Refactor SWIM setup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (521 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0522/1756] swim: Configure parameter memory Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0524/1756] swim: Enable clock divider only where appropriate Greg Kroah-Hartman
` (475 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joshua Thompson, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 62977e8ea98e99dbf86609e65930e6607398e1c5 ]
The write to the setup register is really chip initialization, so do it in
swim_floppy_init() rather than floppy_open(). Drop the udelay(), which was
apparently copied and pasted from swim3.c where it presumably relates to
interrupts, of which this chip has none. (See also mkLinux SWIM 3 driver.)
Cc: Joshua Thompson <funaho@jurai.org>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/e9facb07b20436a6941ec067288e84d8dd9311c0.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 3c02a14c8996 ("swim: Enable clock divider only where appropriate")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index b8107ee501b15..2c3dea0b24fe7 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -628,8 +628,7 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
fs->ref_count = -1;
else
fs->ref_count++;
- swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2);
- udelay(10);
+
swim_drive(base, fs->location);
swim_motor(base, ON);
swim_action(base, SETMFM);
@@ -816,6 +815,8 @@ static int swim_floppy_init(struct swim_priv *swd)
int drive;
struct swim __iomem *base = swd->base;
+ swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2);
+
swim_set_parameters(base);
/* scan floppy drives */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0524/1756] swim: Enable clock divider only where appropriate
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (522 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0523/1756] swim: Refactor SWIM setup Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0525/1756] swim: Dont start motor until medium is present Greg Kroah-Hartman
` (474 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joshua Thompson, Geert Uytterhoeven,
Laurent Vivier, Finn Thain, Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 3c02a14c89962c88ed0abb3cce4101021c63149c ]
Some models have a 16 MHz FCLK oscillator and others 32 MHz. Put this
information into the swim device platform_data so that the driver can
correctly enable the clock divider. When this is enabled incorrectly,
nothing can be read and failures from the Error Correction Machine are
flagged in the error register.
Cc: Joshua Thompson <funaho@jurai.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/483efa2f8ac6beb2a2d4fa2d8b431cb1a8b560c7.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/m68k/mac/config.c | 31 ++++++++++++++++++++++++++++++-
drivers/block/swim.c | 9 ++++++---
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index d26c7f4f8c360..da2b84c4b70ce 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -986,8 +986,37 @@ static int __init mac_platform_init(void)
.start = swim_base,
.end = swim_base + 0x1FFF,
};
+ bool fast_fclk = false;
+
+ /* Models in this list are supposed to run FCLK at 32 MHz */
+ switch (macintosh_config->ident) {
+ case MAC_MODEL_CCL:
+ case MAC_MODEL_CCLII:
+ case MAC_MODEL_LCIII:
+ case MAC_MODEL_Q605:
+ case MAC_MODEL_Q605_ACC:
+ case MAC_MODEL_Q610:
+ case MAC_MODEL_Q630:
+ case MAC_MODEL_Q650:
+ case MAC_MODEL_Q800:
+ case MAC_MODEL_P460:
+ case MAC_MODEL_P475:
+ case MAC_MODEL_P475F:
+ case MAC_MODEL_P520:
+ case MAC_MODEL_P550:
+ case MAC_MODEL_P575:
+ case MAC_MODEL_P588:
+ case MAC_MODEL_TV:
+ case MAC_MODEL_C610:
+ case MAC_MODEL_C650:
+ case MAC_MODEL_PB190:
+ case MAC_MODEL_PB520:
+ fast_fclk = true;
+ break;
+ }
- platform_device_register_simple("swim", -1, &swim_rsrc, 1);
+ platform_device_register_resndata(NULL, "swim", -1, &swim_rsrc, 1,
+ &fast_fclk, sizeof(fast_fclk));
}
/*
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 2c3dea0b24fe7..645db47c827c6 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -806,8 +806,11 @@ static void swim_set_parameters(struct swim __iomem *base)
swim_write(base, parameter, mem[i]);
}
-static int swim_floppy_init(struct swim_priv *swd)
+static int swim_floppy_init(struct platform_device *pdev)
{
+ struct swim_priv *swd = platform_get_drvdata(pdev);
+ bool *data = pdev->dev.platform_data;
+ bool fast_fclk = data && *data;
struct queue_limits lim = {
.features = BLK_FEAT_ROTATIONAL,
};
@@ -815,7 +818,7 @@ static int swim_floppy_init(struct swim_priv *swd)
int drive;
struct swim __iomem *base = swd->base;
- swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2);
+ swim_write(base, setup, S_IBM_DRIVE | (fast_fclk ? S_FCLK_DIV2 : 0));
swim_set_parameters(base);
@@ -931,7 +934,7 @@ static int swim_probe(struct platform_device *dev)
swd->base = swim_base;
- ret = swim_floppy_init(swd);
+ ret = swim_floppy_init(dev);
if (ret)
goto out_kfree;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0525/1756] swim: Dont start motor until medium is present
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (523 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0524/1756] swim: Enable clock divider only where appropriate Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0526/1756] swim: Recalibrate when drive is probed Greg Kroah-Hartman
` (473 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit dbbaaae83cb277d76e70426c0f0ce289e867ed77 ]
The spindle motor should not be running when a disk is to be inserted.
Don't start the motor while the drive is empty.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/7ea60e0bf6135b9bcd4be0991a257d4c5de22bb3.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 645db47c827c6..7178a2bdd0777 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -630,8 +630,7 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
fs->ref_count++;
swim_drive(base, fs->location);
- swim_motor(base, ON);
- swim_action(base, SETMFM);
+
if (fs->ejected)
setup_medium(fs);
if (!fs->disk_in) {
@@ -639,6 +638,9 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
goto out;
}
+ swim_motor(base, ON);
+ swim_action(base, SETMFM);
+
set_capacity(fs->disk, fs->total_secs);
if (mode & BLK_OPEN_NDELAY)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0526/1756] swim: Recalibrate when drive is probed
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (524 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0525/1756] swim: Dont start motor until medium is present Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0527/1756] swim: Add track zero recalibration delay Greg Kroah-Hartman
` (472 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Finn Thain, Stan Johnson, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit ba087774a1493ade524f8a783461fa8be9c75039 ]
Track zero recalibration can be slow and is normally done only once i.e.
during system POST or boot-up. Recalibrate once after the drive is probed
rather than every time the device is opened. Don't register the drive if
recalibration fails. Park the heads before ejecting.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/119e799afcc00d6bd4a479c31e0c960cb1a1d71b.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 37 +++++++++++++++++--------------------
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 7178a2bdd0777..851aaa11e80ca 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -412,6 +412,7 @@ static inline int swim_track00(struct swim __iomem *base)
if (swim_readbit(base, TRACK_ZERO))
return 0;
+ pr_err("swim: track zero recalibration failed\n");
return -1;
}
@@ -456,6 +457,7 @@ static int floppy_eject(struct floppy_state *fs)
struct swim __iomem *base = fs->swd->base;
swim_drive(base, fs->location);
+ swim_track(fs, 40);
swim_motor(base, OFF);
swim_eject(base);
swim_drive(base, NO_DRIVE);
@@ -596,13 +598,6 @@ static void setup_medium(struct floppy_state *fs)
struct floppy_struct *g;
fs->disk_in = 1;
fs->write_protected = swim_readbit(base, WRITE_PROT);
-
- if (swim_track00(base))
- printk(KERN_ERR
- "SWIM: cannot move floppy head to track 0\n");
-
- swim_track00(base);
-
fs->type = swim_readbit(base, TWOMEG_MEDIA) ?
HD_MEDIA : DD_MEDIA;
fs->head_number = swim_readbit(base, SINGLE_SIDED) ? 1 : 2;
@@ -610,7 +605,6 @@ static void setup_medium(struct floppy_state *fs)
fs->total_secs = g->size;
fs->secpercyl = g->head * g->sect;
fs->secpertrack = g->sect;
- fs->track = 0;
} else {
fs->disk_in = 0;
}
@@ -759,24 +753,33 @@ static const struct block_device_operations floppy_fops = {
.check_events = floppy_check_events,
};
-static int swim_add_floppy(struct swim_priv *swd, enum drive_location location)
+static void swim_add_floppy(struct swim_priv *swd, enum drive_location location)
{
struct floppy_state *fs = &swd->unit[swd->floppy_count];
struct swim __iomem *base = swd->base;
- fs->location = location;
+ swim_drive(base, location);
+ if (!swim_readbit(base, DRIVE_PRESENT) ||
+ swim_readbit(base, ONEMEG_DRIVE))
+ goto out;
+ if (swim_readbit(base, DISK_IN))
+ swim_motor(base, ON);
+ if (swim_track00(base))
+ goto out;
- swim_motor(base, OFF);
+ fs->location = location;
fs->type = HD_MEDIA;
fs->head_number = 2;
fs->ref_count = 0;
fs->ejected = 1;
+ fs->track = 0;
swd->floppy_count++;
- return 0;
+out:
+ swim_motor(base, OFF);
}
static const struct blk_mq_ops swim_mq_ops = {
@@ -826,14 +829,8 @@ static int swim_floppy_init(struct platform_device *pdev)
/* scan floppy drives */
- swim_drive(base, INTERNAL_DRIVE);
- if (swim_readbit(base, DRIVE_PRESENT) &&
- !swim_readbit(base, ONEMEG_DRIVE))
- swim_add_floppy(swd, INTERNAL_DRIVE);
- swim_drive(base, EXTERNAL_DRIVE);
- if (swim_readbit(base, DRIVE_PRESENT) &&
- !swim_readbit(base, ONEMEG_DRIVE))
- swim_add_floppy(swd, EXTERNAL_DRIVE);
+ swim_add_floppy(swd, INTERNAL_DRIVE);
+ swim_add_floppy(swd, EXTERNAL_DRIVE);
swim_drive(base, NO_DRIVE);
/* register floppy drives */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0527/1756] swim: Add track zero recalibration delay
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (525 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0526/1756] swim: Recalibrate when drive is probed Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0528/1756] swim: Handle FIFO timeout error Greg Kroah-Hartman
` (471 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit b9c1095048537cc9563f12d0a24f2f0df129e4d5 ]
The UPD72070 spec indicates that the track zero sensor can take 3 ms
to stabilize following a STEP command so add a call to msleep().
Remove the duplicate swim_readbit() call as there's no need for that
once the sensor signal has stabilized.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/6d17ca20a7286c1d74833b29510c506a66d96e6f.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 851aaa11e80ca..57f37bb3ece8c 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -402,16 +402,15 @@ static inline int swim_track00(struct swim __iomem *base)
for (try = 0; try < 100; try++) {
swim_select(base, RELAX);
+ msleep(3);
+
if (swim_readbit(base, TRACK_ZERO))
- break;
+ return 0;
if (swim_step(base))
- return -1;
+ break;
}
- if (swim_readbit(base, TRACK_ZERO))
- return 0;
-
pr_err("swim: track zero recalibration failed\n");
return -1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0528/1756] swim: Handle FIFO timeout error
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (526 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0527/1756] swim: Add track zero recalibration delay Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0529/1756] swim: Check for CRC errors Greg Kroah-Hartman
` (470 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 2e9bcbecee68431b689d16b23bc5529db686f8d4 ]
When polling the FIFO for a mark byte in the sector header, don't
return zero if the timeout counter has expired, return an error code.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/aadb674d27d6e6d346d9b525597bf2e339c57e04.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim_asm.S | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index 3d7a2d87595a5..208622ac4aeb9 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -79,7 +79,7 @@ wait_addr_mark_byte:
tstb %a2@
dbmi %d2, wait_addr_mark_byte
- bpl header_exit
+ bpl signal_nonyb
moveb %a3@, %d3
cmpb %a0@+, %d3
@@ -136,7 +136,6 @@ crc1: tstb %a2@
tstb %a3@(read_error - read_mark)
-header_exit:
moveq #0, %d0
moveb #0x18, %a3@(write_mode0 - read_mark)
rts
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0529/1756] swim: Check for CRC errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (527 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0528/1756] swim: Handle FIFO timeout error Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0530/1756] swim: Simplify return value initialization Greg Kroah-Hartman
` (469 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Finn Thain, Stan Johnson, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 01bff87152e6748fbac9ccd645d3d5f490d75ddc ]
After reading either the sector header or sector data, examine that flag
in the handshake register which holds the result of the CRC calculation.
CRC validation has to take place with the last byte still in the FIFO.
This flag can't be checked by the caller because by then all bytes will
have been retrieved from the FIFO. Return an error code when appropriate.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/9bfcd0414192d1b95803c16701d62732ff6e8f3f.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim_asm.S | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index 208622ac4aeb9..250e408060e8b 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -42,6 +42,8 @@
.equ max_retry, 40
.equ sector_size, 512
+ .equ .Lhr_crc_error, 0x02
+
.global swim_read_sector_header
swim_read_sector_header:
link %a6, #0
@@ -134,6 +136,10 @@ crc1: tstb %a2@
moveb %a3@, %a4@(o_crc1)
+ moveb %a2@, %d5
+ andb #.Lhr_crc_error, %d5
+ bne signal_nonyb
+
tstb %a3@(read_error - read_mark)
moveq #0, %d0
@@ -226,6 +232,10 @@ data_crc1:
moveb %a3@, %d5
+ moveb %a2@, %d5
+ andb #.Lhr_crc_error, %d5
+ bne data_exit
+
tstb %a3@(read_error - read_mark)
moveb #0x18, %a3@(write_mode0 - read_mark)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0530/1756] swim: Simplify return value initialization
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (528 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0529/1756] swim: Check for CRC errors Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0531/1756] swim: Check error register during sector read Greg Kroah-Hartman
` (468 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 385a44e78702762e2fce796cf37b6f465d86a87f ]
Initialize the error result once only. Update the result only after a
successful read.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/28322f0cbefd865bdfb679bab4352c111996795b.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: d66bdef0a308 ("swim: Check error register during sector read")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim_asm.S | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index 250e408060e8b..81c824923336c 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -49,6 +49,7 @@ swim_read_sector_header:
link %a6, #0
moveml %d1-%d5/%a0-%a4,%sp@-
movel %a6@(0x0c), %a4
+ moveq #-1, %d0
bsr mfm_read_addrmark
moveml %sp@+, %d1-%d5/%a0-%a4
unlk %a6
@@ -63,7 +64,6 @@ mfm_read_addrmark:
movel %a6@(0x08), %a3
lea %a3@(read_handshake), %a2
lea %a3@(read_mark), %a3
- moveq #-1, %d0
movew #seek_time, %d2
wait_header_init:
@@ -143,10 +143,7 @@ crc1: tstb %a2@
tstb %a3@(read_error - read_mark)
moveq #0, %d0
- moveb #0x18, %a3@(write_mode0 - read_mark)
- rts
signal_nonyb:
- moveq #-1, %d0
moveb #0x18, %a3@(write_mode0 - read_mark)
rts
@@ -155,6 +152,7 @@ swim_read_sector_data:
link %a6, #0
moveml %d1-%d5/%a0-%a5,%sp@-
movel %a6@(0x0c), %a4
+ moveq #-1, %d0
bsr mfm_read_data
moveml %sp@+, %d1-%d5/%a0-%a5
unlk %a6
@@ -238,15 +236,12 @@ data_crc1:
tstb %a3@(read_error - read_mark)
- moveb #0x18, %a3@(write_mode0 - read_mark)
-
/* return number of bytes read */
movel #sector_size, %d0
addw #1, %d4
subl %d4, %d0
- rts
+
data_exit:
moveb #0x18, %a3@(write_mode0 - read_mark)
- moveq #-1, %d0
rts
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0531/1756] swim: Check error register during sector read
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (529 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0530/1756] swim: Simplify return value initialization Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0532/1756] swim: Dont use the mark register to read data Greg Kroah-Hartman
` (467 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit d66bdef0a3083fed1a0fc4f0ee1c85b26476b21c ]
Clear the error register only once before a sector read operation. Don't
clear it afterwards -- the caller needs it. Check the error register in
swim_read_sector() and return the appropriate error when necessary. Fully
validate the sector header. Don't terminate the search loop early just
because an erroneous sector header showed up.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/efabd807f4ecf5cbc05b60e91ed69aa4c10691a8.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 13 +++++++------
drivers/block/swim_asm.S | 8 --------
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 57f37bb3ece8c..9a8362a90f036 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -483,20 +483,21 @@ static inline int swim_read_sector(struct floppy_state *fs,
local_irq_save(flags);
for (i = 0; i < 36; i++) {
- ret = swim_read_sector_header(base, &header);
- if (!ret && (header.sector == sector)) {
+ if (swim_read_sector_header(base, &header) ||
+ swim_read(base, error) || header.track != track ||
+ header.side != side || header.size != 2)
+ continue;
+ if (header.sector == sector) {
/* found */
ret = swim_read_sector_data(base, buffer);
+ if (swim_read(base, error))
+ ret = -EIO;
break;
}
}
local_irq_restore(flags);
- if ((header.side != side) || (header.track != track) ||
- (header.sector != sector))
- return 0;
-
return ret;
}
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index 81c824923336c..fcf574ced85ec 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -67,7 +67,6 @@ mfm_read_addrmark:
movew #seek_time, %d2
wait_header_init:
- tstb %a3@(read_error - read_mark)
moveb #0x18, %a3@(write_mode0 - read_mark)
moveb #0x01, %a3@(write_mode1 - read_mark)
moveb #0x01, %a3@(write_mode0 - read_mark)
@@ -140,8 +139,6 @@ crc1: tstb %a2@
andb #.Lhr_crc_error, %d5
bne signal_nonyb
- tstb %a3@(read_error - read_mark)
-
moveq #0, %d0
signal_nonyb:
moveb #0x18, %a3@(write_mode0 - read_mark)
@@ -166,7 +163,6 @@ mfm_read_data:
movew #seek_time, %d2
wait_data_init:
- tstb %a3@(read_error - read_mark)
moveb #0x18, %a3@(write_mode0 - read_mark)
moveb #0x01, %a3@(write_mode1 - read_mark)
moveb #0x01, %a3@(write_mode0 - read_mark)
@@ -191,8 +187,6 @@ wait_data_mark_byte:
/* read data */
- tstb %a3@(read_error - read_mark)
-
movel #sector_size-1, %d4 /* sector size */
read_new_data:
movew #max_retry, %d2
@@ -234,8 +228,6 @@ data_crc1:
andb #.Lhr_crc_error, %d5
bne data_exit
- tstb %a3@(read_error - read_mark)
-
/* return number of bytes read */
movel #sector_size, %d0
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0532/1756] swim: Dont use the mark register to read data
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (530 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0531/1756] swim: Check error register during sector read Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0533/1756] swim: Fix buffer overflow Greg Kroah-Hartman
` (466 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit cb7923133ec18e67e2d6718e29426a4423af6b73 ]
If an unexpected mark byte were to be read from the data register, an
error would be flagged. But no error gets flagged when such a byte is
read from the mark register, which is misleading. Always use the data
register except when a mark byte is expected.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/fecd77b141bdd8a59ebae5f9efffccb155afdc4c.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim_asm.S | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index fcf574ced85ec..699f7c90dd1c0 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -47,11 +47,11 @@
.global swim_read_sector_header
swim_read_sector_header:
link %a6, #0
- moveml %d1-%d5/%a0-%a4,%sp@-
+ moveml %d1-%d5/%a0-%a5,%sp@-
movel %a6@(0x0c), %a4
moveq #-1, %d0
bsr mfm_read_addrmark
- moveml %sp@+, %d1-%d5/%a0-%a4
+ moveml %sp@+, %d1-%d5/%a0-%a5
unlk %a6
rts
@@ -63,6 +63,7 @@ sector_data_mark:
mfm_read_addrmark:
movel %a6@(0x08), %a3
lea %a3@(read_handshake), %a2
+ lea %a3@(read_data), %a5
lea %a3@(read_mark), %a3
movew #seek_time, %d2
@@ -93,7 +94,7 @@ amark0: tstb %a2@
dbmi %d2, amark0
bpl signal_nonyb
- moveb %a3@, %a4@(o_track)
+ moveb %a5@, %a4@(o_track)
moveq #max_retry, %d2
@@ -101,7 +102,7 @@ amark1: tstb %a2@
dbmi %d2, amark1
bpl signal_nonyb
- moveb %a3@, %a4@(o_side)
+ moveb %a5@, %a4@(o_side)
moveq #max_retry, %d2
@@ -109,7 +110,7 @@ amark2: tstb %a2@
dbmi %d2, amark2
bpl signal_nonyb
- moveb %a3@, %a4@(o_sector)
+ moveb %a5@, %a4@(o_sector)
moveq #max_retry, %d2
@@ -117,7 +118,7 @@ amark3: tstb %a2@
dbmi %d2, amark3
bpl signal_nonyb
- moveb %a3@, %a4@(o_size)
+ moveb %a5@, %a4@(o_size)
moveq #max_retry, %d2
@@ -125,7 +126,7 @@ crc0: tstb %a2@
dbmi %d2, crc0
bpl signal_nonyb
- moveb %a3@, %a4@(o_crc0)
+ moveb %a5@, %a4@(o_crc0)
moveq #max_retry, %d2
@@ -133,7 +134,7 @@ crc1: tstb %a2@
dbmi %d2, crc1
bpl signal_nonyb
- moveb %a3@, %a4@(o_crc1)
+ moveb %a5@, %a4@(o_crc1)
moveb %a2@, %d5
andb #.Lhr_crc_error, %d5
@@ -212,7 +213,7 @@ data_crc0:
dbmi %d2, data_crc0
bpl data_exit
- moveb %a3@, %d5
+ moveb %a5@, %d5
moveq #max_retry, %d2
@@ -222,7 +223,7 @@ data_crc1:
dbmi %d2, data_crc1
bpl data_exit
- moveb %a3@, %d5
+ moveb %a5@, %d5
moveb %a2@, %d5
andb #.Lhr_crc_error, %d5
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0533/1756] swim: Fix buffer overflow
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (531 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0532/1756] swim: Dont use the mark register to read data Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0534/1756] block: remove BLK_MQ_F_SHOULD_MERGE Greg Kroah-Hartman
` (465 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Finn Thain, Stan Johnson, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit a54870a4ae4962acf341eb6ca010cae02af1a6ea ]
The effect of this bug can be observed as swim_read_sector_data()
inexplicably returning -5, or an error flag indicating that a mark byte
was read from the data register, or other odd behviour.
When copying bytes from the chip FIFO to the read buffer, the driver
keeps count of the remaining buffer space using register %d4. A counter
in register %d2 serves as a timeout. The driver polls (%a2), the handshake
register, until flags indicate that byte(s) have arrived in the FIFO.
movel #sector_size-1, %d4
read_new_data:
movew #max_retry, %d2
read_data_loop:
moveb %a2@, %d5
andb #0xc0, %d5
dbne %d2, read_data_loop
beq data_exit
moveb %a5@, %a4@+
andb #0x40, %d5
dbne %d4, read_new_data
beq exit_loop
Note that the exit_loop branch depends upon a flag in the handshake
register and not on the remaining buffer space. Hence there may be no
branch to exit_loop after %d4 is decremented to -1 (i.e. full buffer).
moveb %a5@, %a4@+
dbra %d4, read_new_data
exit_loop:
Here is a second decrement of %d4 which can now reach -2. But the buffer
bounds check is a comparison with -1, which is now ineffective. Hence the
loop will continue copying until %d2 eventually reaches -1.
Fix this bug by terminating the loop as soon as %d4 or %d2 reach -1.
Reset the timeout whenever a byte is copied.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/d8fceda197b840f892d9b511175e824ca2549f01.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim_asm.S | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index 699f7c90dd1c0..e06aadb411a14 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -43,6 +43,8 @@
.equ sector_size, 512
.equ .Lhr_crc_error, 0x02
+ .equ .Lhr_fifo_2bytes, 0x40
+ .equ .Lhr_fifo_1byte, 0x80
.global swim_read_sector_header
swim_read_sector_header:
@@ -189,20 +191,20 @@ wait_data_mark_byte:
/* read data */
movel #sector_size-1, %d4 /* sector size */
-read_new_data:
movew #max_retry, %d2
read_data_loop:
moveb %a2@, %d5
- andb #0xc0, %d5
+ andb #(.Lhr_fifo_1byte + .Lhr_fifo_2bytes), %d5
dbne %d2, read_data_loop
beq data_exit
+ moveq #max_retry, %d2
moveb %a5@, %a4@+
- andb #0x40, %d5
- dbne %d4, read_new_data
- beq exit_loop
+ dbra %d4, 1f
+ bra data_crc0
+1: andb #.Lhr_fifo_2bytes, %d5
+ beq read_data_loop
moveb %a5@, %a4@+
- dbra %d4, read_new_data
-exit_loop:
+ dbra %d4, read_data_loop
/* read CRC */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0534/1756] block: remove BLK_MQ_F_SHOULD_MERGE
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (532 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0533/1756] swim: Fix buffer overflow Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0535/1756] swim: Convert to blocking queue Greg Kroah-Hartman
` (464 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit cc76ace465d6977b47daa427379b7be1e0976f12 ]
BLK_MQ_F_SHOULD_MERGE is set for all tag_sets except those that purely
process passthrough commands (bsg-lib, ufs tmf, various nvme admin
queues) and thus don't even check the flag. Remove it to simplify the
driver interface.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241219060214.1928848-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 92353a047637 ("swim: Convert to blocking queue")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/um/drivers/ubd_kern.c | 1 -
block/blk-mq-debugfs.c | 1 -
block/blk-mq-sched.c | 3 +--
drivers/block/amiflop.c | 1 -
drivers/block/aoe/aoeblk.c | 1 -
drivers/block/ataflop.c | 1 -
drivers/block/floppy.c | 1 -
drivers/block/loop.c | 3 +--
drivers/block/mtip32xx/mtip32xx.c | 1 -
drivers/block/nbd.c | 3 +--
drivers/block/null_blk/main.c | 2 --
drivers/block/ps3disk.c | 3 +--
drivers/block/rbd.c | 1 -
drivers/block/rnbd/rnbd-clt.c | 3 +--
drivers/block/sunvdc.c | 2 +-
drivers/block/swim.c | 2 +-
drivers/block/swim3.c | 3 +--
drivers/block/ublk_drv.c | 1 -
drivers/block/virtio_blk.c | 1 -
drivers/block/xen-blkfront.c | 1 -
drivers/block/z2ram.c | 1 -
drivers/cdrom/gdrom.c | 2 +-
drivers/md/dm-rq.c | 2 +-
drivers/memstick/core/ms_block.c | 3 +--
drivers/memstick/core/mspro_block.c | 3 +--
drivers/mmc/core/queue.c | 2 +-
drivers/mtd/mtd_blkdevs.c | 2 +-
drivers/mtd/ubi/block.c | 2 +-
drivers/nvme/host/apple.c | 1 -
drivers/nvme/host/core.c | 1 -
drivers/s390/block/dasd_genhd.c | 1 -
drivers/s390/block/scm_blk.c | 1 -
drivers/scsi/scsi_lib.c | 1 -
include/linux/blk-mq.h | 1 -
34 files changed, 15 insertions(+), 43 deletions(-)
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 66c1a8835e362..0b1e61f72fb3c 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -865,7 +865,6 @@ static int ubd_add(int n, char **error_out)
ubd_dev->tag_set.ops = &ubd_mq_ops;
ubd_dev->tag_set.queue_depth = 64;
ubd_dev->tag_set.numa_node = NUMA_NO_NODE;
- ubd_dev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
ubd_dev->tag_set.driver_data = ubd_dev;
ubd_dev->tag_set.nr_hw_queues = 1;
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index cbc8bbde3a2bb..95c587bc9c3cc 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -181,7 +181,6 @@ static const char *const alloc_policy_name[] = {
#define HCTX_FLAG_NAME(name) [ilog2(BLK_MQ_F_##name)] = #name
static const char *const hctx_flag_name[] = {
- HCTX_FLAG_NAME(SHOULD_MERGE),
HCTX_FLAG_NAME(TAG_QUEUE_SHARED),
HCTX_FLAG_NAME(STACKING),
HCTX_FLAG_NAME(TAG_HCTX_SHARED),
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 451a2c1f1f321..7442ca27c2bf1 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -351,8 +351,7 @@ bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
ctx = blk_mq_get_ctx(q);
hctx = blk_mq_map_queue(q, bio->bi_opf, ctx);
type = hctx->type;
- if (!(hctx->flags & BLK_MQ_F_SHOULD_MERGE) ||
- list_empty_careful(&ctx->rq_lists[type]))
+ if (list_empty_careful(&ctx->rq_lists[type]))
goto out_put;
/* default per sw-queue merge */
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 7a53ee1d18d84..347f0cf1d4f65 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1872,7 +1872,6 @@ static int fd_alloc_drive(int drive)
unit[drive].tag_set.nr_maps = 1;
unit[drive].tag_set.queue_depth = 2;
unit[drive].tag_set.numa_node = NUMA_NO_NODE;
- unit[drive].tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
if (blk_mq_alloc_tag_set(&unit[drive].tag_set))
goto out_cleanup_trackbuf;
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 2028795ec61cb..00b74a8453288 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -368,7 +368,6 @@ aoeblk_gdalloc(void *vp)
set->nr_hw_queues = 1;
set->queue_depth = 128;
set->numa_node = NUMA_NO_NODE;
- set->flags = BLK_MQ_F_SHOULD_MERGE;
err = blk_mq_alloc_tag_set(set);
if (err) {
pr_err("aoe: cannot allocate tag set for %ld.%d\n",
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 4ba98c6654be2..110f9aca2667d 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -2088,7 +2088,6 @@ static int __init atari_floppy_init (void)
unit[i].tag_set.nr_maps = 1;
unit[i].tag_set.queue_depth = 2;
unit[i].tag_set.numa_node = NUMA_NO_NODE;
- unit[i].tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
ret = blk_mq_alloc_tag_set(&unit[i].tag_set);
if (ret)
goto err;
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 56e9901b4b468..f1dc62565ea5f 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4596,7 +4596,6 @@ static int __init do_floppy_init(void)
tag_sets[drive].nr_maps = 1;
tag_sets[drive].queue_depth = 2;
tag_sets[drive].numa_node = NUMA_NO_NODE;
- tag_sets[drive].flags = BLK_MQ_F_SHOULD_MERGE;
err = blk_mq_alloc_tag_set(&tag_sets[drive]);
if (err)
goto out_put_disk;
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index de111d0d47c21..739aae0d9e1e4 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2001,8 +2001,7 @@ static int loop_add(int i)
lo->tag_set.queue_depth = hw_queue_depth;
lo->tag_set.numa_node = NUMA_NO_NODE;
lo->tag_set.cmd_size = sizeof(struct loop_cmd);
- lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING |
- BLK_MQ_F_NO_SCHED_BY_DEFAULT;
+ lo->tag_set.flags = BLK_MQ_F_STACKING | BLK_MQ_F_NO_SCHED_BY_DEFAULT;
lo->tag_set.driver_data = lo;
err = blk_mq_alloc_tag_set(&lo->tag_set);
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 86a9c557a5d64..29ae6c279ab8f 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3415,7 +3415,6 @@ static int mtip_block_initialize(struct driver_data *dd)
dd->tags.reserved_tags = 1;
dd->tags.cmd_size = sizeof(struct mtip_cmd);
dd->tags.numa_node = dd->numa_node;
- dd->tags.flags = BLK_MQ_F_SHOULD_MERGE;
dd->tags.driver_data = dd;
dd->tags.timeout = MTIP_NCQ_CMD_TIMEOUT_MS;
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 958bd115a3417..0c083b9d93b2b 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1855,8 +1855,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs)
nbd->tag_set.queue_depth = 128;
nbd->tag_set.numa_node = NUMA_NO_NODE;
nbd->tag_set.cmd_size = sizeof(struct nbd_cmd);
- nbd->tag_set.flags = BLK_MQ_F_SHOULD_MERGE |
- BLK_MQ_F_BLOCKING;
+ nbd->tag_set.flags = BLK_MQ_F_BLOCKING;
nbd->tag_set.driver_data = nbd;
INIT_WORK(&nbd->remove_work, nbd_dev_remove_work);
nbd->backend = NULL;
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index a0086307b4606..ae2c286fc7e93 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1811,7 +1811,6 @@ static int null_init_global_tag_set(void)
tag_set.nr_hw_queues = g_submit_queues;
tag_set.queue_depth = g_hw_queue_depth;
tag_set.numa_node = g_home_node;
- tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
if (g_no_sched)
tag_set.flags |= BLK_MQ_F_NO_SCHED;
if (g_shared_tag_bitmap)
@@ -1837,7 +1836,6 @@ static int null_setup_tagset(struct nullb *nullb)
nullb->tag_set->nr_hw_queues = nullb->dev->submit_queues;
nullb->tag_set->queue_depth = nullb->dev->hw_queue_depth;
nullb->tag_set->numa_node = nullb->dev->home_node;
- nullb->tag_set->flags = BLK_MQ_F_SHOULD_MERGE;
if (nullb->dev->no_sched)
nullb->tag_set->flags |= BLK_MQ_F_NO_SCHED;
if (nullb->dev->shared_tag_bitmap)
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index b5b00021fe37d..8892f218a8147 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -438,8 +438,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)
ps3disk_identify(dev);
- error = blk_mq_alloc_sq_tag_set(&priv->tag_set, &ps3disk_mq_ops, 1,
- BLK_MQ_F_SHOULD_MERGE);
+ error = blk_mq_alloc_sq_tag_set(&priv->tag_set, &ps3disk_mq_ops, 1, 0);
if (error)
goto fail_teardown;
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 46f9f85400867..5d156195bb9ed 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4966,7 +4966,6 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
rbd_dev->tag_set.ops = &rbd_mq_ops;
rbd_dev->tag_set.queue_depth = rbd_dev->opts->queue_depth;
rbd_dev->tag_set.numa_node = NUMA_NO_NODE;
- rbd_dev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
rbd_dev->tag_set.nr_hw_queues = num_present_cpus();
rbd_dev->tag_set.cmd_size = sizeof(struct rbd_img_request);
diff --git a/drivers/block/rnbd/rnbd-clt.c b/drivers/block/rnbd/rnbd-clt.c
index 5be0581c3334d..6c96112623c62 100644
--- a/drivers/block/rnbd/rnbd-clt.c
+++ b/drivers/block/rnbd/rnbd-clt.c
@@ -1209,8 +1209,7 @@ static int setup_mq_tags(struct rnbd_clt_session *sess)
tag_set->ops = &rnbd_mq_ops;
tag_set->queue_depth = sess->queue_depth;
tag_set->numa_node = NUMA_NO_NODE;
- tag_set->flags = BLK_MQ_F_SHOULD_MERGE |
- BLK_MQ_F_TAG_QUEUE_SHARED;
+ tag_set->flags = BLK_MQ_F_TAG_QUEUE_SHARED;
tag_set->cmd_size = sizeof(struct rnbd_iu) + RNBD_RDMA_SGL_SIZE;
/* for HCTX_TYPE_DEFAULT, HCTX_TYPE_READ, HCTX_TYPE_POLL */
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 16953341e5013..dc5a41dfea30a 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -853,7 +853,7 @@ static int probe_disk(struct vdc_port *port)
}
err = blk_mq_alloc_sq_tag_set(&port->tag_set, &vdc_mq_ops,
- VDC_TX_RING_SIZE, BLK_MQ_F_SHOULD_MERGE);
+ VDC_TX_RING_SIZE, 0);
if (err)
return err;
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 9a8362a90f036..a9b67ca9577f2 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -846,7 +846,7 @@ static int swim_floppy_init(struct platform_device *pdev)
for (drive = 0; drive < swd->floppy_count; drive++) {
err = blk_mq_alloc_sq_tag_set(&swd->unit[drive].tag_set,
- &swim_mq_ops, 2, BLK_MQ_F_SHOULD_MERGE);
+ &swim_mq_ops, 2, 0);
if (err)
goto exit_put_disks;
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 90be1017f7bfc..9914153b365b6 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1208,8 +1208,7 @@ static int swim3_attach(struct macio_dev *mdev,
fs = &floppy_states[floppy_count];
memset(fs, 0, sizeof(*fs));
- rc = blk_mq_alloc_sq_tag_set(&fs->tag_set, &swim3_mq_ops, 2,
- BLK_MQ_F_SHOULD_MERGE);
+ rc = blk_mq_alloc_sq_tag_set(&fs->tag_set, &swim3_mq_ops, 2, 0);
if (rc)
goto out_unregister;
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index f89b36017d979..a07dfd0336e74 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -2311,7 +2311,6 @@ static int ublk_add_tag_set(struct ublk_device *ub)
ub->tag_set.queue_depth = ub->dev_info.queue_depth;
ub->tag_set.numa_node = NUMA_NO_NODE;
ub->tag_set.cmd_size = sizeof(struct ublk_rq_data);
- ub->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
ub->tag_set.driver_data = ub;
return blk_mq_alloc_tag_set(&ub->tag_set);
}
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 43884773dc3a8..3d574f4bb3ce8 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1481,7 +1481,6 @@ static int virtblk_probe(struct virtio_device *vdev)
vblk->tag_set.ops = &virtio_mq_ops;
vblk->tag_set.queue_depth = queue_depth;
vblk->tag_set.numa_node = NUMA_NO_NODE;
- vblk->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
vblk->tag_set.cmd_size =
sizeof(struct virtblk_req) +
sizeof(struct scatterlist) * VIRTIO_BLK_INLINE_SG_CNT;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 914d89aa051f4..dddd87f89914c 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1131,7 +1131,6 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity,
} else
info->tag_set.queue_depth = BLK_RING_SIZE(info);
info->tag_set.numa_node = NUMA_NO_NODE;
- info->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
info->tag_set.cmd_size = sizeof(struct blkif_req);
info->tag_set.driver_data = info;
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 4b7219be1bb86..8c1c7f4211ebe 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -354,7 +354,6 @@ static int __init z2_init(void)
tag_set.nr_maps = 1;
tag_set.queue_depth = 16;
tag_set.numa_node = NUMA_NO_NODE;
- tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
ret = blk_mq_alloc_tag_set(&tag_set);
if (ret)
goto out_unregister_blkdev;
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 71cfe7a85913c..bf6ce49b97ca1 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -777,7 +777,7 @@ static int probe_gdrom(struct platform_device *devptr)
probe_gdrom_setupcd();
err = blk_mq_alloc_sq_tag_set(&gd.tag_set, &gdrom_mq_ops, 1,
- BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING);
+ BLK_MQ_F_BLOCKING);
if (err)
goto probe_fail_free_cd_info;
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 29d6ee68d4dfb..b1c8e331af4d7 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -553,7 +553,7 @@ int dm_mq_init_request_queue(struct mapped_device *md, struct dm_table *t)
md->tag_set->ops = &dm_mq_ops;
md->tag_set->queue_depth = dm_get_blk_mq_queue_depth();
md->tag_set->numa_node = md->numa_node_id;
- md->tag_set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING;
+ md->tag_set->flags = BLK_MQ_F_STACKING;
md->tag_set->nr_hw_queues = dm_get_blk_mq_nr_hw_queues();
md->tag_set->driver_data = md;
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
index 84d9b7975b3be..b78dbe1491dc4 100644
--- a/drivers/memstick/core/ms_block.c
+++ b/drivers/memstick/core/ms_block.c
@@ -2098,8 +2098,7 @@ static int msb_init_disk(struct memstick_dev *card)
if (msb->disk_id < 0)
return msb->disk_id;
- rc = blk_mq_alloc_sq_tag_set(&msb->tag_set, &msb_mq_ops, 2,
- BLK_MQ_F_SHOULD_MERGE);
+ rc = blk_mq_alloc_sq_tag_set(&msb->tag_set, &msb_mq_ops, 2, 0);
if (rc)
goto out_release_id;
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 49accfdc89d61..9c7678afa5183 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -1139,8 +1139,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
if (disk_id < 0)
return disk_id;
- rc = blk_mq_alloc_sq_tag_set(&msb->tag_set, &mspro_mq_ops, 2,
- BLK_MQ_F_SHOULD_MERGE);
+ rc = blk_mq_alloc_sq_tag_set(&msb->tag_set, &mspro_mq_ops, 2, 0);
if (rc)
goto out_release_id;
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 73814b7529f6e..ac3787149737e 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -452,7 +452,7 @@ struct gendisk *mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
else
mq->tag_set.queue_depth = MMC_QUEUE_DEPTH;
mq->tag_set.numa_node = NUMA_NO_NODE;
- mq->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;
+ mq->tag_set.flags = BLK_MQ_F_BLOCKING;
mq->tag_set.nr_hw_queues = 1;
mq->tag_set.cmd_size = sizeof(struct mmc_queue_req);
mq->tag_set.driver_data = mq;
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 47ead84407cdc..ee7e1d9089861 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -329,7 +329,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
goto out_list_del;
ret = blk_mq_alloc_sq_tag_set(new->tag_set, &mtd_mq_ops, 2,
- BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING);
+ BLK_MQ_F_BLOCKING);
if (ret)
goto out_kfree_tag_set;
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 60d0155be869f..2836905f0152a 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -383,7 +383,7 @@ int ubiblock_create(struct ubi_volume_info *vi)
dev->tag_set.ops = &ubiblock_mq_ops;
dev->tag_set.queue_depth = 64;
dev->tag_set.numa_node = NUMA_NO_NODE;
- dev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING;
+ dev->tag_set.flags = BLK_MQ_F_BLOCKING;
dev->tag_set.cmd_size = sizeof(struct ubiblock_pdu);
dev->tag_set.driver_data = dev;
dev->tag_set.nr_hw_queues = 1;
diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
index 6606d7644186d..9f6570062febf 100644
--- a/drivers/nvme/host/apple.c
+++ b/drivers/nvme/host/apple.c
@@ -1290,7 +1290,6 @@ static int apple_nvme_alloc_tagsets(struct apple_nvme *anv)
anv->tagset.timeout = NVME_IO_TIMEOUT;
anv->tagset.numa_node = NUMA_NO_NODE;
anv->tagset.cmd_size = sizeof(struct apple_nvme_iod);
- anv->tagset.flags = BLK_MQ_F_SHOULD_MERGE;
anv->tagset.driver_data = &anv->ioq;
ret = blk_mq_alloc_tag_set(&anv->tagset);
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 37dc942af0d20..9206ad4e33508 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4721,7 +4721,6 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
/* Reserved for fabric connect */
set->reserved_tags = 1;
set->numa_node = ctrl->numa_node;
- set->flags = BLK_MQ_F_SHOULD_MERGE;
if (ctrl->ops->flags & NVME_F_BLOCKING)
set->flags |= BLK_MQ_F_BLOCKING;
set->cmd_size = cmd_size;
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 6da47a65af610..28e92fad0ca1f 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -56,7 +56,6 @@ int dasd_gendisk_alloc(struct dasd_block *block)
block->tag_set.cmd_size = sizeof(struct dasd_ccw_req);
block->tag_set.nr_hw_queues = nr_hw_queues;
block->tag_set.queue_depth = queue_depth;
- block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
block->tag_set.numa_node = NUMA_NO_NODE;
rc = blk_mq_alloc_tag_set(&block->tag_set);
if (rc)
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 3fcfe029db1b3..91bbe9d2e5acd 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -461,7 +461,6 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
bdev->tag_set.cmd_size = sizeof(blk_status_t);
bdev->tag_set.nr_hw_queues = nr_requests;
bdev->tag_set.queue_depth = nr_requests_per_io * nr_requests;
- bdev->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
bdev->tag_set.numa_node = NUMA_NO_NODE;
ret = blk_mq_alloc_tag_set(&bdev->tag_set);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ecc37da9b2449..6528596647169 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2110,7 +2110,6 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
tag_set->queue_depth = shost->can_queue;
tag_set->cmd_size = cmd_size;
tag_set->numa_node = dev_to_node(shost->dma_dev);
- tag_set->flags = BLK_MQ_F_SHOULD_MERGE;
tag_set->flags |=
BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy);
if (shost->queuecommand_may_block)
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 959f8f82a6509..0c997069cf218 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -668,7 +668,6 @@ struct blk_mq_ops {
/* Keep hctx_flag_name[] in sync with the definitions below */
enum {
- BLK_MQ_F_SHOULD_MERGE = 1 << 0,
BLK_MQ_F_TAG_QUEUE_SHARED = 1 << 1,
/*
* Set when this device requires underlying blk-mq device for
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0535/1756] swim: Convert to blocking queue
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (533 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0534/1756] block: remove BLK_MQ_F_SHOULD_MERGE Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0536/1756] swim: Remove redundant RELAX actions Greg Kroah-Hartman
` (463 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Omar Sandoval, Laurent Vivier,
Finn Thain, Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 92353a04763726f70fea6be90957c50fc18215e0 ]
These drives are slow: completing a request can take hundreds of
milliseconds. Delays are managed by disabling interrupts judiciously and
sleeping opportunistically.
As of commit e3896d77b702 ("swim: convert to blk-mq"), a spinlock is
taken in irq mode as soon as a request is issued. That lock is held for
the duration of the request. Hence the driver sleeps while holding the
lock which is forbidden.
Adopt BLK_MQ_F_BLOCKING and remove the spinlock. Use a mutex to serialize
requests from the two request queues. (The chip cannot simultaneously
process requests on both internal and external drive.)
Cc: Omar Sandoval <osandov@fb.com>
Fixes: e3896d77b702 ("swim: convert to blk-mq")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/d06b19132ec678d6168d158e10cd63e10da45607.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index a9b67ca9577f2..429c8499393d5 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -211,7 +211,6 @@ enum head {
struct swim_priv {
struct swim __iomem *base;
- spinlock_t lock;
int floppy_count;
struct floppy_state unit[FD_MAX_UNIT];
};
@@ -537,12 +536,10 @@ static blk_status_t swim_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{
struct floppy_state *fs = hctx->queue->queuedata;
- struct swim_priv *swd = fs->swd;
struct request *req = bd->rq;
blk_status_t err;
- if (!spin_trylock_irq(&swd->lock))
- return BLK_STS_DEV_RESOURCE;
+ mutex_lock(&swim_mutex);
blk_mq_start_request(req);
@@ -560,7 +557,7 @@ static blk_status_t swim_queue_rq(struct blk_mq_hw_ctx *hctx,
err = BLK_STS_OK;
out:
- spin_unlock_irq(&swd->lock);
+ mutex_unlock(&swim_mutex);
return err;
}
@@ -842,11 +839,9 @@ static int swim_floppy_init(struct platform_device *pdev)
return -EBUSY;
}
- spin_lock_init(&swd->lock);
-
for (drive = 0; drive < swd->floppy_count; drive++) {
err = blk_mq_alloc_sq_tag_set(&swd->unit[drive].tag_set,
- &swim_mq_ops, 2, 0);
+ &swim_mq_ops, 2, BLK_MQ_F_BLOCKING);
if (err)
goto exit_put_disks;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0536/1756] swim: Remove redundant RELAX actions
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (534 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0535/1756] swim: Convert to blocking queue Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0537/1756] swim: Deduplicate polling loops Greg Kroah-Hartman
` (462 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 04cb277e6841b55b950b42063fe11501b5d1676a ]
Wherever we have a swim_select() or swim_readbit() call there is an
implicit RELAX. That means the caller doesn't have to do it. Remove the
redundant code.
BTW, Inside Macintosh says, "Be sure [...] that CA0 and CA1 are set high
before changing SEL." Hence the RELAX found in swim_select(). The SwimIII
driver in mkLinux also has that. But the swim3.c driver in Linux is odd:
it scatters RELAX actions around as though SEL was not actually under its
control... In anycase, swim.c really does control SEL so there's no need
for that here.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/08ab67c2780c9107b87a1ece8b5f9cb54a8cea70.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: b736189c93c9 ("swim: Deduplicate polling loops")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 429c8499393d5..185eb47adbf58 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -336,7 +336,6 @@ static inline void swim_motor(struct swim __iomem *base,
swim_action(base, MOTOR_ON);
for (i = 0; i < 2*HZ; i++) {
- swim_select(base, RELAX);
if (swim_readbit(base, MOTOR_ON))
break;
set_current_state(TASK_INTERRUPTIBLE);
@@ -344,7 +343,7 @@ static inline void swim_motor(struct swim __iomem *base,
}
} else if (action == OFF) {
swim_action(base, MOTOR_OFF);
- swim_select(base, RELAX);
+ swim_write(base, phase, RELAX | PHASE_PIN_DIR);
}
}
@@ -355,13 +354,11 @@ static inline void swim_eject(struct swim __iomem *base)
swim_action(base, EJECT);
for (i = 0; i < 2*HZ; i++) {
- swim_select(base, RELAX);
if (!swim_readbit(base, DISK_IN))
break;
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(1);
}
- swim_select(base, RELAX);
}
static inline void swim_head(struct swim __iomem *base, enum head head)
@@ -385,7 +382,6 @@ static inline int swim_step(struct swim __iomem *base)
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(1);
- swim_select(base, RELAX);
if (!swim_readbit(base, STEP))
return 0;
}
@@ -399,8 +395,6 @@ static inline int swim_track00(struct swim __iomem *base)
swim_action(base, SEEK_NEGATIVE);
for (try = 0; try < 100; try++) {
-
- swim_select(base, RELAX);
msleep(3);
if (swim_readbit(base, TRACK_ZERO))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0537/1756] swim: Deduplicate polling loops
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (535 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0536/1756] swim: Remove redundant RELAX actions Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0538/1756] swim: Check drive ready bit Greg Kroah-Hartman
` (461 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit b736189c93c9ad1056521a4229ec2f252b714b5a ]
Replace duplicated polling loops with poll_timeout_us(). Change the
interruptible sleep to uninterruptible because signal delivery shouldn't
be allowed to shorten delays required by the drive hardware.
Change the timeout for the !STEP transition to 20 ms in accordance with
the maximum interval required by the UPD72070 spec. The existing 1 second
timeout is impractical considering the number of steps in a typical seek.
Change the return type of swim_readbit() to bool because that way the
bit names make sense i.e. the reader doesn't have to remember to invert
the active-low logic used for drive signals.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/0ea2d3313dea26f8b4c2abc4d29055ac95aeb74b.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 39 ++++++++-------------------------------
1 file changed, 8 insertions(+), 31 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 185eb47adbf58..b4148dbe27142 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -19,6 +19,7 @@
#include <linux/major.h>
#include <linux/mutex.h>
#include <linux/hdreg.h>
+#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
@@ -296,7 +297,7 @@ static inline void swim_action(struct swim __iomem *base, int action)
local_irq_restore(flags);
}
-static inline int swim_readbit(struct swim __iomem *base, int bit)
+static inline bool swim_readbit(struct swim __iomem *base, int bit)
{
int stat;
@@ -309,6 +310,9 @@ static inline int swim_readbit(struct swim __iomem *base, int bit)
return (stat & SENSE) == 0;
}
+#define swim_readbit_timeout(base, bit, val, timeout_us) \
+ poll_timeout_us(, swim_readbit(base, bit) == val, 1000, timeout_us, false)
+
static inline void swim_drive(struct swim __iomem *base,
enum drive_location location)
{
@@ -331,16 +335,8 @@ static inline void swim_motor(struct swim __iomem *base,
enum motor_action action)
{
if (action == ON) {
- int i;
-
swim_action(base, MOTOR_ON);
-
- for (i = 0; i < 2*HZ; i++) {
- if (swim_readbit(base, MOTOR_ON))
- break;
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ swim_readbit_timeout(base, MOTOR_ON, true, 2000 * 1000);
} else if (action == OFF) {
swim_action(base, MOTOR_OFF);
swim_write(base, phase, RELAX | PHASE_PIN_DIR);
@@ -349,16 +345,8 @@ static inline void swim_motor(struct swim __iomem *base,
static inline void swim_eject(struct swim __iomem *base)
{
- int i;
-
swim_action(base, EJECT);
-
- for (i = 0; i < 2*HZ; i++) {
- if (!swim_readbit(base, DISK_IN))
- break;
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
- }
+ swim_readbit_timeout(base, DISK_IN, false, 2000 * 1000);
}
static inline void swim_head(struct swim __iomem *base, enum head head)
@@ -373,19 +361,8 @@ static inline void swim_head(struct swim __iomem *base, enum head head)
static inline int swim_step(struct swim __iomem *base)
{
- int wait;
-
swim_action(base, STEP);
-
- for (wait = 0; wait < HZ; wait++) {
-
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(1);
-
- if (!swim_readbit(base, STEP))
- return 0;
- }
- return -1;
+ return swim_readbit_timeout(base, STEP, false, 20 * 1000);
}
static inline int swim_track00(struct swim __iomem *base)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0538/1756] swim: Check drive ready bit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (536 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0537/1756] swim: Deduplicate polling loops Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0539/1756] swim: Revisit delays Greg Kroah-Hartman
` (460 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit abae04f5bed924590e98fe1519566a6e0144e6b5 ]
The drive provides a readiness signal that has to be tested before
certain commands are issued to the drive. Rename the SEEK_COMPLETE flag
as READY because that's how it's known in the documentation as well as
the mkLinux source code.
Poll for that signal after stepping the heads and also after switching
to MFM mode, as that's what mkLinux does. Check for readiness when
stepping because testing shows that some drives require this.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/8d6fc833c719de2248b64ee521418b1032b1e509.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index b4148dbe27142..1de2b9f7d40a1 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -117,7 +117,7 @@ struct iwm {
#define TACHO 0x103
#define READ_DATA_1 0x104
#define GCR_MODE 0x105
-#define SEEK_COMPLETE 0x106
+#define READY 0x106
#define TWOMEG_MEDIA 0x107
/* Bits in handshake register */
@@ -313,6 +313,14 @@ static inline bool swim_readbit(struct swim __iomem *base, int bit)
#define swim_readbit_timeout(base, bit, val, timeout_us) \
poll_timeout_us(, swim_readbit(base, bit) == val, 1000, timeout_us, false)
+#define swim_READY_timeout(base) \
+({ \
+ int ret = swim_readbit_timeout(base, READY, true, 1000 * 1000); \
+ if (ret) \
+ printk(KERN_DEBUG "%s: drive not ready\n", __func__); \
+ ret; \
+})
+
static inline void swim_drive(struct swim __iomem *base,
enum drive_location location)
{
@@ -351,8 +359,6 @@ static inline void swim_eject(struct swim __iomem *base)
static inline void swim_head(struct swim __iomem *base, enum head head)
{
- /* wait drive is ready */
-
if (head == UPPER_HEAD)
swim_select(base, READ_DATA_1);
else if (head == LOWER_HEAD)
@@ -387,20 +393,25 @@ static inline int swim_track00(struct swim __iomem *base)
static inline int swim_seek(struct swim __iomem *base, int step)
{
- if (step == 0)
- return 0;
-
if (step < 0) {
swim_action(base, SEEK_NEGATIVE);
step = -step;
- } else
+ } else if (step > 0)
swim_action(base, SEEK_POSITIVE);
+ swim_READY_timeout(base);
+
+ if (step == 0)
+ return 0;
+
for ( ; step > 0; step--) {
if (swim_step(base))
return -1;
}
+ msleep(30);
+ swim_READY_timeout(base);
+
return 0;
}
@@ -482,6 +493,8 @@ static blk_status_t floppy_read_sectors(struct floppy_state *fs,
swim_drive(base, fs->location);
+ swim_READY_timeout(base);
+
for (i = req_sector; i < req_sector + sectors_nb; i++) {
int x;
track = i / fs->secpercyl;
@@ -602,6 +615,8 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
swim_motor(base, ON);
swim_action(base, SETMFM);
+ msleep(30);
+ swim_READY_timeout(base);
set_capacity(fs->disk, fs->total_secs);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0539/1756] swim: Revisit delays
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (537 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0538/1756] swim: Check drive ready bit Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0540/1756] swim: Dont search beyond the first data mark Greg Kroah-Hartman
` (459 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurent Vivier, Finn Thain,
Stan Johnson, Jens Axboe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit bbcd3e38a4f355d6b0320f3f6916df96c109f2ad ]
AFAIK, timing requirements for the various FDHD drive mechanisms aren't
well documented. But we do have the UPD72070 spec and secondary sources
like swim3.c and mkLinux source code. This patch is needed to satisfy
the requirements in the UPD72070 spec and follows mkLinux.
Change the LSTRB pulse to 2 microseconds, because this is what mkLinux
does. Inside Macintosh says, "Hold LSTRB high for at least one usec but
not more than one msec".
When a disk is ejected, pause before de-asserting /ENBL. Wait 150 us after
the STEP command for valid signalling. Pause for 1 us after setting the
step direction before sending the STEP command.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/af356248a1e6a4fd956f71acf17feead27ba4918.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 1de2b9f7d40a1..2b324b67b9ef3 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -290,7 +290,7 @@ static inline void swim_action(struct swim __iomem *base, int action)
swim_select(base, action);
udelay(1);
swim_write(base, phase, LSTRB | action | PHASE_PIN_DIR);
- udelay(1);
+ udelay(2);
swim_write(base, phase, action | PHASE_PIN_DIR);
udelay(1);
@@ -337,6 +337,7 @@ static inline void swim_drive(struct swim __iomem *base,
swim_write(base, mode0, EXTERNAL_DRIVE);
swim_write(base, mode0, MOTON);
}
+ udelay(1);
}
static inline void swim_motor(struct swim __iomem *base,
@@ -355,6 +356,7 @@ static inline void swim_eject(struct swim __iomem *base)
{
swim_action(base, EJECT);
swim_readbit_timeout(base, DISK_IN, false, 2000 * 1000);
+ msleep(1);
}
static inline void swim_head(struct swim __iomem *base, enum head head)
@@ -368,6 +370,7 @@ static inline void swim_head(struct swim __iomem *base, enum head head)
static inline int swim_step(struct swim __iomem *base)
{
swim_action(base, STEP);
+ udelay(150);
return swim_readbit_timeout(base, STEP, false, 20 * 1000);
}
@@ -398,6 +401,7 @@ static inline int swim_seek(struct swim __iomem *base, int step)
step = -step;
} else if (step > 0)
swim_action(base, SEEK_POSITIVE);
+ udelay(1);
swim_READY_timeout(base);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0540/1756] swim: Dont search beyond the first data mark
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (538 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0539/1756] swim: Revisit delays Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0541/1756] media: i2c: ov5648: Fix a data race on state->streaming Greg Kroah-Hartman
` (458 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Finn Thain, Stan Johnson, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit 79eafa4ccb74be023fd2cae87d75425d6eb903bb ]
The ISM chip does an automatic MFM gap/sync search when the Action bit
is first set. That search may stop at any of a) post-index gap, b) address
field gap or c) data field gap. To find the next sector header, the
driver need not search at all. It only has to validate the mark bytes.
Once the sector address mark has been validated, swim_read_sector_data()
is called to read the sector contents. Between the sector address and
data fields lies an intra-sector gap followed by a data field mark.
After this mark is validated, the 512-byte data area is read into the
IO request buffer.
Problem is, if any byte in the data field mark is mis-read, the driver
searches the whole sector and then reaches the data field mark in the
following sector. The wrong sector is then read into the buffer, and
swim_read_sector_data() returns success. The request is silently
corrupted.
The existing limit on polling loop iterations does constrain the search
distance but is inherently tied to CPU speed. This is probably the reason
why corruption was only observed on a 68030 system.
Discontinue the mark search when the mark bytes fail validation.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Tested-by: Stan Johnson <userm57@yahoo.com>
Link: https://patch.msgid.link/f6c97153faa0aceceffd3a61d85c0a82903a6b3e.1788513997.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim_asm.S | 73 ++++++++++++++++++++++------------------
1 file changed, 40 insertions(+), 33 deletions(-)
diff --git a/drivers/block/swim_asm.S b/drivers/block/swim_asm.S
index e06aadb411a14..4d6404234bf09 100644
--- a/drivers/block/swim_asm.S
+++ b/drivers/block/swim_asm.S
@@ -41,18 +41,45 @@
.equ seek_time, 30000
.equ max_retry, 40
.equ sector_size, 512
+ .equ .Lmark_sequence_len, 4
.equ .Lhr_crc_error, 0x02
.equ .Lhr_fifo_2bytes, 0x40
.equ .Lhr_fifo_1byte, 0x80
+.Lmfm_mark_check:
+ /*
+ * This subroutine reads and validates a mark byte sequence.
+ * On entry, %a1 and %d4 shall hold the location and length (resp.)
+ * of the mark byte array.
+ * %a2 and %a3 shall hold the locations of the handshake and mark
+ * registers.
+ * Returns zero in %d1 for success.
+ */
+
+ moveq #-1, %d1
+ subq #1, %d4
+ movew #seek_time, %d2
+
+5: tstb %a2@
+ dbmi %d2, 5b
+ bpl 6f
+
+ moveb %a3@, %d3
+ cmpb %a1@+, %d3
+ dbne %d4, 5b
+ bne 6f
+
+ moveq #0, %d1
+6: rts
+
.global swim_read_sector_header
swim_read_sector_header:
link %a6, #0
moveml %d1-%d5/%a0-%a5,%sp@-
movel %a6@(0x0c), %a4
moveq #-1, %d0
- bsr mfm_read_addrmark
+ bsr .Lmfm_read_header
moveml %sp@+, %d1-%d5/%a0-%a5
unlk %a6
rts
@@ -62,33 +89,25 @@ sector_address_mark:
sector_data_mark:
.byte 0xa1, 0xa1, 0xa1, 0xfb
-mfm_read_addrmark:
+.Lmfm_read_header:
movel %a6@(0x08), %a3
lea %a3@(read_handshake), %a2
lea %a3@(read_data), %a5
lea %a3@(read_mark), %a3
- movew #seek_time, %d2
-wait_header_init:
moveb #0x18, %a3@(write_mode0 - read_mark)
moveb #0x01, %a3@(write_mode1 - read_mark)
moveb #0x01, %a3@(write_mode0 - read_mark)
tstb %a3@(read_error - read_mark)
moveb #0x08, %a3@(write_mode1 - read_mark)
- lea sector_address_mark, %a0
- moveq #3, %d1
-
-wait_addr_mark_byte:
-
- tstb %a2@
- dbmi %d2, wait_addr_mark_byte
- bpl signal_nonyb
+ lea sector_address_mark, %a1
+ moveq #.Lmark_sequence_len, %d4
+ bsr .Lmfm_mark_check
+ tstl %d1
+ bne signal_nonyb
- moveb %a3@, %d3
- cmpb %a0@+, %d3
- dbne %d1, wait_addr_mark_byte
- bne wait_header_init
+ /* read header */
moveq #max_retry, %d2
@@ -163,30 +182,18 @@ mfm_read_data:
lea %a3@(read_handshake), %a2
lea %a3@(read_data), %a5
lea %a3@(read_mark), %a3
- movew #seek_time, %d2
-wait_data_init:
moveb #0x18, %a3@(write_mode0 - read_mark)
moveb #0x01, %a3@(write_mode1 - read_mark)
moveb #0x01, %a3@(write_mode0 - read_mark)
tstb %a3@(read_error - read_mark)
moveb #0x08, %a3@(write_mode1 - read_mark)
- lea sector_data_mark, %a0
- moveq #3, %d1
-
- /* wait data address mark */
-
-wait_data_mark_byte:
-
- tstb %a2@
- dbmi %d2, wait_data_mark_byte
- bpl data_exit
-
- moveb %a3@, %d3
- cmpb %a0@+, %d3
- dbne %d1, wait_data_mark_byte
- bne wait_data_init
+ lea sector_data_mark, %a1
+ moveq #.Lmark_sequence_len, %d4
+ bsr .Lmfm_mark_check
+ tstl %d1
+ bne data_exit
/* read data */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0541/1756] media: i2c: ov5648: Fix a data race on state->streaming
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (539 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0540/1756] swim: Dont search beyond the first data mark Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0542/1756] serial: msm: select PM_OPP Greg Kroah-Hartman
` (457 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ginger Li, Kieran Bingham,
Sakari Ailus, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ginger Li <ginger.jzllee@gmail.com>
[ Upstream commit 76c8ffbe1b9bc0ee4c977180e3f498352de0d01e ]
ov5648_s_stream() updates state->streaming after it has released
sensor->mutex, while ov5648_resume() reads that field with sensor->mutex
held. A concurrent resume can therefore observe a stale streaming state
and leave the sensor in standby while the software believes that it is
streaming, or the other way around.
Keep the update inside the sensor->mutex protected section that already
programs the standby mode.
Fixes: e43ccb0a045f ("media: i2c: Add support for the OV5648 image sensor")
Signed-off-by: Ginger Li <ginger.jzllee@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5648.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c
index 4b86d2631bd1c..9e67ce2ee11f3 100644
--- a/drivers/media/i2c/ov5648.c
+++ b/drivers/media/i2c/ov5648.c
@@ -2145,13 +2145,13 @@ static int ov5648_s_stream(struct v4l2_subdev *subdev, int enable)
mutex_lock(&sensor->mutex);
ret = ov5648_sw_standby(sensor, !enable);
+ if (!ret)
+ state->streaming = !!enable;
mutex_unlock(&sensor->mutex);
if (ret)
return ret;
- state->streaming = !!enable;
-
if (!enable)
pm_runtime_put(sensor->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0542/1756] serial: msm: select PM_OPP
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (540 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0541/1756] media: i2c: ov5648: Fix a data race on state->streaming Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0543/1756] serial: Switch back to struct platform_driver::remove() Greg Kroah-Hartman
` (456 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dmitry Sinyavin, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Sinyavin <sinyavin@gmail.com>
[ Upstream commit 6a8352bb4e4bfcf67fa23c49d2e0d14684ffe2e6 ]
Commit 173ebdedcd84 ("serial: msm: Use OPP table for DVFS support")
made the MSM serial driver unconditionally configure the core clock
through the OPP framework during probe.
When CONFIG_PM_OPP is disabled, devm_pm_opp_set_clkname() is a stub that
returns -EOPNOTSUPP, so every MSM serial port fails to probe. Select
PM_OPP to keep minimal configurations functional.
Fixes: 173ebdedcd84 ("serial: msm: Use OPP table for DVFS support")
Signed-off-by: Dmitry Sinyavin <sinyavin@gmail.com>
Link: https://patch.msgid.link/20260830085340.2542624-1-sinyavin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1e92b16b6b95e..7c83e0078de01 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -894,6 +894,7 @@ config SERIAL_JSM
config SERIAL_MSM
tristate "MSM on-chip serial port support"
depends on ARCH_QCOM || COMPILE_TEST
+ select PM_OPP
select SERIAL_CORE
config SERIAL_MSM_CONSOLE
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0543/1756] serial: Switch back to struct platform_driver::remove()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (541 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0542/1756] serial: msm: select PM_OPP Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0544/1756] serial: txx9: Drop noop probe function and dangerous remove callback Greg Kroah-Hartman
` (455 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Uwe Kleine-König, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
[ Upstream commit 5cbb9b1705ab8d98ed96affa4ec399023a22b755 ]
After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.
Convert all platform drivers below drivers/tty/serial to use .remove(),
with the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20241007205803.444994-7-u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 22c6a6ac74c2 ("serial: txx9: Drop noop probe function and dangerous remove callback")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_aspeed_vuart.c | 2 +-
drivers/tty/serial/8250/8250_bcm2835aux.c | 2 +-
drivers/tty/serial/8250/8250_bcm7271.c | 2 +-
drivers/tty/serial/8250/8250_dw.c | 2 +-
drivers/tty/serial/8250/8250_em.c | 2 +-
drivers/tty/serial/8250/8250_fsl.c | 2 +-
drivers/tty/serial/8250/8250_ingenic.c | 2 +-
drivers/tty/serial/8250/8250_ioc3.c | 2 +-
drivers/tty/serial/8250/8250_lpc18xx.c | 2 +-
drivers/tty/serial/8250/8250_mtk.c | 2 +-
drivers/tty/serial/8250/8250_of.c | 2 +-
drivers/tty/serial/8250/8250_omap.c | 2 +-
drivers/tty/serial/8250/8250_platform.c | 2 +-
drivers/tty/serial/8250/8250_pxa.c | 2 +-
drivers/tty/serial/8250/8250_tegra.c | 2 +-
drivers/tty/serial/8250/8250_uniphier.c | 2 +-
drivers/tty/serial/altera_jtaguart.c | 2 +-
drivers/tty/serial/altera_uart.c | 2 +-
drivers/tty/serial/amba-pl011.c | 2 +-
drivers/tty/serial/ar933x_uart.c | 2 +-
drivers/tty/serial/atmel_serial.c | 2 +-
drivers/tty/serial/bcm63xx_uart.c | 2 +-
drivers/tty/serial/clps711x.c | 2 +-
drivers/tty/serial/cpm_uart.c | 2 +-
drivers/tty/serial/digicolor-usart.c | 2 +-
drivers/tty/serial/esp32_acm.c | 2 +-
drivers/tty/serial/esp32_uart.c | 2 +-
drivers/tty/serial/fsl_linflexuart.c | 2 +-
drivers/tty/serial/fsl_lpuart.c | 2 +-
drivers/tty/serial/imx.c | 2 +-
drivers/tty/serial/lantiq.c | 2 +-
drivers/tty/serial/liteuart.c | 2 +-
drivers/tty/serial/lpc32xx_hs.c | 2 +-
drivers/tty/serial/ma35d1_serial.c | 2 +-
drivers/tty/serial/mcf.c | 2 +-
drivers/tty/serial/meson_uart.c | 2 +-
drivers/tty/serial/milbeaut_usio.c | 2 +-
drivers/tty/serial/mpc52xx_uart.c | 2 +-
drivers/tty/serial/msm_serial.c | 2 +-
drivers/tty/serial/mxs-auart.c | 2 +-
drivers/tty/serial/omap-serial.c | 2 +-
drivers/tty/serial/owl-uart.c | 2 +-
drivers/tty/serial/pic32_uart.c | 2 +-
drivers/tty/serial/pmac_zilog.c | 2 +-
drivers/tty/serial/qcom_geni_serial.c | 2 +-
drivers/tty/serial/rda-uart.c | 2 +-
drivers/tty/serial/sa1100.c | 2 +-
drivers/tty/serial/samsung_tty.c | 2 +-
drivers/tty/serial/sccnxp.c | 2 +-
drivers/tty/serial/serial-tegra.c | 2 +-
drivers/tty/serial/serial_txx9.c | 2 +-
drivers/tty/serial/sh-sci.c | 2 +-
drivers/tty/serial/sifive.c | 2 +-
drivers/tty/serial/sprd_serial.c | 2 +-
drivers/tty/serial/st-asc.c | 2 +-
drivers/tty/serial/stm32-usart.c | 2 +-
drivers/tty/serial/sunhv.c | 2 +-
drivers/tty/serial/sunplus-uart.c | 2 +-
drivers/tty/serial/sunsab.c | 2 +-
drivers/tty/serial/sunsu.c | 2 +-
drivers/tty/serial/sunzilog.c | 2 +-
drivers/tty/serial/tegra-tcu.c | 2 +-
drivers/tty/serial/timbuart.c | 2 +-
drivers/tty/serial/uartlite.c | 2 +-
drivers/tty/serial/ucc_uart.c | 2 +-
drivers/tty/serial/xilinx_uartps.c | 2 +-
66 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index 25c201cfb91e1..e5da9ce26006d 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -569,7 +569,7 @@ static struct platform_driver aspeed_vuart_driver = {
.of_match_table = aspeed_vuart_table,
},
.probe = aspeed_vuart_probe,
- .remove_new = aspeed_vuart_remove,
+ .remove = aspeed_vuart_remove,
};
module_platform_driver(aspeed_vuart_driver);
diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index d7a0f271263a9..fdb53b54e99e6 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -267,7 +267,7 @@ static struct platform_driver bcm2835aux_serial_driver = {
.pm = pm_ptr(&bcm2835aux_dev_pm_ops),
},
.probe = bcm2835aux_serial_probe,
- .remove_new = bcm2835aux_serial_remove,
+ .remove = bcm2835aux_serial_remove,
};
module_platform_driver(bcm2835aux_serial_driver);
diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
index aebca9338c8f1..77df6c0b25573 100644
--- a/drivers/tty/serial/8250/8250_bcm7271.c
+++ b/drivers/tty/serial/8250/8250_bcm7271.c
@@ -1204,7 +1204,7 @@ static struct platform_driver brcmuart_platform_driver = {
.of_match_table = brcmuart_dt_ids,
},
.probe = brcmuart_probe,
- .remove_new = brcmuart_remove,
+ .remove = brcmuart_remove,
};
static int __init brcmuart_init(void)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 7b2e72bfeb752..d9aef24b0b098 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -808,7 +808,7 @@ static struct platform_driver dw8250_platform_driver = {
.acpi_match_table = dw8250_acpi_match,
},
.probe = dw8250_probe,
- .remove_new = dw8250_remove,
+ .remove = dw8250_remove,
};
module_platform_driver(dw8250_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
index a754755100ffe..35094f884492c 100644
--- a/drivers/tty/serial/8250/8250_em.c
+++ b/drivers/tty/serial/8250/8250_em.c
@@ -219,7 +219,7 @@ static struct platform_driver serial8250_em_platform_driver = {
.of_match_table = serial8250_em_dt_ids,
},
.probe = serial8250_em_probe,
- .remove_new = serial8250_em_remove,
+ .remove = serial8250_em_remove,
};
module_platform_driver(serial8250_em_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c
index b4ed442082a85..1b7bd55619c66 100644
--- a/drivers/tty/serial/8250/8250_fsl.c
+++ b/drivers/tty/serial/8250/8250_fsl.c
@@ -179,7 +179,7 @@ static struct platform_driver fsl8250_platform_driver = {
.acpi_match_table = ACPI_PTR(fsl_8250_acpi_id),
},
.probe = fsl8250_acpi_probe,
- .remove_new = fsl8250_acpi_remove,
+ .remove = fsl8250_acpi_remove,
};
module_platform_driver(fsl8250_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c
index a2783e38a2e31..a73dd37736404 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -361,7 +361,7 @@ static struct platform_driver ingenic_uart_platform_driver = {
.of_match_table = of_match,
},
.probe = ingenic_uart_probe,
- .remove_new = ingenic_uart_remove,
+ .remove = ingenic_uart_remove,
};
module_platform_driver(ingenic_uart_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_ioc3.c b/drivers/tty/serial/8250/8250_ioc3.c
index 50c77c3dacf2c..499e80aa4cf96 100644
--- a/drivers/tty/serial/8250/8250_ioc3.c
+++ b/drivers/tty/serial/8250/8250_ioc3.c
@@ -84,7 +84,7 @@ static void serial8250_ioc3_remove(struct platform_device *pdev)
static struct platform_driver serial8250_ioc3_driver = {
.probe = serial8250_ioc3_probe,
- .remove_new = serial8250_ioc3_remove,
+ .remove = serial8250_ioc3_remove,
.driver = {
.name = "ioc3-serial8250",
}
diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c
index 47e1a056a60c3..d52445948da0b 100644
--- a/drivers/tty/serial/8250/8250_lpc18xx.c
+++ b/drivers/tty/serial/8250/8250_lpc18xx.c
@@ -195,7 +195,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_serial_match);
static struct platform_driver lpc18xx_serial_driver = {
.probe = lpc18xx_serial_probe,
- .remove_new = lpc18xx_serial_remove,
+ .remove = lpc18xx_serial_remove,
.driver = {
.name = "lpc18xx-uart",
.of_match_table = lpc18xx_serial_match,
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index 1c878986fcec0..f8fb9e21dd498 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -656,7 +656,7 @@ static struct platform_driver mtk8250_platform_driver = {
.of_match_table = mtk8250_of_match,
},
.probe = mtk8250_probe,
- .remove_new = mtk8250_remove,
+ .remove = mtk8250_remove,
};
module_platform_driver(mtk8250_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 04a0d51dd9195..86632ed561fa8 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -393,7 +393,7 @@ static struct platform_driver of_platform_serial_driver = {
.pm = &of_serial_pm_ops,
},
.probe = of_platform_serial_probe,
- .remove_new = of_platform_serial_remove,
+ .remove = of_platform_serial_remove,
};
module_platform_driver(of_platform_serial_driver);
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 93a2414194f62..7a2cb61666ff6 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1883,7 +1883,7 @@ static struct platform_driver omap8250_platform_driver = {
.of_match_table = omap8250_dt_ids,
},
.probe = omap8250_probe,
- .remove_new = omap8250_remove,
+ .remove = omap8250_remove,
};
module_platform_driver(omap8250_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8250/8250_platform.c
index 872d3dc89d7f6..d9588ec2675ea 100644
--- a/drivers/tty/serial/8250/8250_platform.c
+++ b/drivers/tty/serial/8250/8250_platform.c
@@ -285,7 +285,7 @@ MODULE_DEVICE_TABLE(acpi, acpi_platform_serial_table);
static struct platform_driver serial8250_isa_driver = {
.probe = serial8250_probe,
- .remove_new = serial8250_remove,
+ .remove = serial8250_remove,
.suspend = serial8250_suspend,
.resume = serial8250_resume,
.driver = {
diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c
index 96dd6126296c6..6dd0190b4843b 100644
--- a/drivers/tty/serial/8250/8250_pxa.c
+++ b/drivers/tty/serial/8250/8250_pxa.c
@@ -154,7 +154,7 @@ static void serial_pxa_remove(struct platform_device *pdev)
static struct platform_driver serial_pxa_driver = {
.probe = serial_pxa_probe,
- .remove_new = serial_pxa_remove,
+ .remove = serial_pxa_remove,
.driver = {
.name = "pxa2xx-uart",
diff --git a/drivers/tty/serial/8250/8250_tegra.c b/drivers/tty/serial/8250/8250_tegra.c
index 60a80d00d2519..2f3b0075763f2 100644
--- a/drivers/tty/serial/8250/8250_tegra.c
+++ b/drivers/tty/serial/8250/8250_tegra.c
@@ -182,7 +182,7 @@ static struct platform_driver tegra_uart_driver = {
.acpi_match_table = ACPI_PTR(tegra_uart_acpi_match),
},
.probe = tegra_uart_probe,
- .remove_new = tegra_uart_remove,
+ .remove = tegra_uart_remove,
};
module_platform_driver(tegra_uart_driver);
diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index 670d2ca0f7572..4874a9632db39 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -282,7 +282,7 @@ MODULE_DEVICE_TABLE(of, uniphier_uart_match);
static struct platform_driver uniphier_uart_platform_driver = {
.probe = uniphier_uart_probe,
- .remove_new = uniphier_uart_remove,
+ .remove = uniphier_uart_remove,
.driver = {
.name = "uniphier-uart",
.of_match_table = uniphier_uart_match,
diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c
index 232dc4b64f9ac..7194495c571a8 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -454,7 +454,7 @@ MODULE_DEVICE_TABLE(of, altera_jtaguart_match);
static struct platform_driver altera_jtaguart_platform_driver = {
.probe = altera_jtaguart_probe,
- .remove_new = altera_jtaguart_remove,
+ .remove = altera_jtaguart_remove,
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(altera_jtaguart_match),
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 897f0995b2fe7..8eed2542627e2 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -617,7 +617,7 @@ MODULE_DEVICE_TABLE(of, altera_uart_match);
static struct platform_driver altera_uart_platform_driver = {
.probe = altera_uart_probe,
- .remove_new = altera_uart_remove,
+ .remove = altera_uart_remove,
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(altera_uart_match),
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index a0e20bffefba8..949cadecd2c28 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2967,7 +2967,7 @@ MODULE_DEVICE_TABLE(acpi, sbsa_uart_acpi_match);
static struct platform_driver arm_sbsa_uart_platform_driver = {
.probe = sbsa_uart_probe,
- .remove_new = sbsa_uart_remove,
+ .remove = sbsa_uart_remove,
.driver = {
.name = "sbsa-uart",
.pm = &pl011_dev_pm_ops,
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index 47889a5571198..8bb33556b3120 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -832,7 +832,7 @@ MODULE_DEVICE_TABLE(of, ar933x_uart_of_ids);
static struct platform_driver ar933x_uart_platform_driver = {
.probe = ar933x_uart_probe,
- .remove_new = ar933x_uart_remove,
+ .remove = ar933x_uart_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = of_match_ptr(ar933x_uart_of_ids),
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 8bd39586a49f7..f9ebff2293102 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -3017,7 +3017,7 @@ static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend,
static struct platform_driver atmel_serial_driver = {
.probe = atmel_serial_probe,
- .remove_new = atmel_serial_remove,
+ .remove = atmel_serial_remove,
.driver = {
.name = "atmel_usart_serial",
.of_match_table = of_match_ptr(atmel_serial_dt_ids),
diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c
index b88cc28c94e33..51df9d2d8bfc5 100644
--- a/drivers/tty/serial/bcm63xx_uart.c
+++ b/drivers/tty/serial/bcm63xx_uart.c
@@ -884,7 +884,7 @@ MODULE_DEVICE_TABLE(of, bcm63xx_of_match);
*/
static struct platform_driver bcm_uart_platform_driver = {
.probe = bcm_uart_probe,
- .remove_new = bcm_uart_remove,
+ .remove = bcm_uart_remove,
.driver = {
.name = "bcm63xx_uart",
.of_match_table = bcm63xx_of_match,
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index 30425a3d19fbe..83186bf500027 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -529,7 +529,7 @@ static struct platform_driver clps711x_uart_platform = {
.of_match_table = of_match_ptr(clps711x_uart_dt_ids),
},
.probe = uart_clps711x_probe,
- .remove_new = uart_clps711x_remove,
+ .remove = uart_clps711x_remove,
};
static int __init uart_clps711x_init(void)
diff --git a/drivers/tty/serial/cpm_uart.c b/drivers/tty/serial/cpm_uart.c
index a927478f581d7..550712a135937 100644
--- a/drivers/tty/serial/cpm_uart.c
+++ b/drivers/tty/serial/cpm_uart.c
@@ -1573,7 +1573,7 @@ static struct platform_driver cpm_uart_driver = {
.of_match_table = cpm_uart_match,
},
.probe = cpm_uart_probe,
- .remove_new = cpm_uart_remove,
+ .remove = cpm_uart_remove,
};
static int __init cpm_uart_init(void)
diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c
index 2ccd13cc0a899..d2482df5cb9b4 100644
--- a/drivers/tty/serial/digicolor-usart.c
+++ b/drivers/tty/serial/digicolor-usart.c
@@ -522,7 +522,7 @@ static struct platform_driver digicolor_uart_platform = {
.of_match_table = of_match_ptr(digicolor_uart_dt_ids),
},
.probe = digicolor_uart_probe,
- .remove_new = digicolor_uart_remove,
+ .remove = digicolor_uart_remove,
};
static int __init digicolor_uart_init(void)
diff --git a/drivers/tty/serial/esp32_acm.c b/drivers/tty/serial/esp32_acm.c
index 85eb0392e3793..bb7cc65427f0b 100644
--- a/drivers/tty/serial/esp32_acm.c
+++ b/drivers/tty/serial/esp32_acm.c
@@ -423,7 +423,7 @@ static void esp32s3_acm_remove(struct platform_device *pdev)
static struct platform_driver esp32s3_acm_driver = {
.probe = esp32s3_acm_probe,
- .remove_new = esp32s3_acm_remove,
+ .remove = esp32s3_acm_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = esp32s3_acm_dt_ids,
diff --git a/drivers/tty/serial/esp32_uart.c b/drivers/tty/serial/esp32_uart.c
index 8c86cf9cb7630..667c2198a03a5 100644
--- a/drivers/tty/serial/esp32_uart.c
+++ b/drivers/tty/serial/esp32_uart.c
@@ -743,7 +743,7 @@ static void esp32_uart_remove(struct platform_device *pdev)
static struct platform_driver esp32_uart_driver = {
.probe = esp32_uart_probe,
- .remove_new = esp32_uart_remove,
+ .remove = esp32_uart_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = esp32_uart_dt_ids,
diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c
index e972df4b188d3..e70a56de1fced 100644
--- a/drivers/tty/serial/fsl_linflexuart.c
+++ b/drivers/tty/serial/fsl_linflexuart.c
@@ -882,7 +882,7 @@ static SIMPLE_DEV_PM_OPS(linflex_pm_ops, linflex_suspend, linflex_resume);
static struct platform_driver linflex_driver = {
.probe = linflex_probe,
- .remove_new = linflex_remove,
+ .remove = linflex_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = linflex_dt_ids,
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index f63191e4608bb..a6918e26f3317 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -3224,7 +3224,7 @@ static const struct dev_pm_ops lpuart_pm_ops = {
static struct platform_driver lpuart_driver = {
.probe = lpuart_probe,
- .remove_new = lpuart_remove,
+ .remove = lpuart_remove,
.driver = {
.name = "fsl-lpuart",
.of_match_table = lpuart_dt_ids,
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index f12cab6c82c81..b340d982ee42f 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2738,7 +2738,7 @@ static const struct dev_pm_ops imx_uart_pm_ops = {
static struct platform_driver imx_uart_platform_driver = {
.probe = imx_uart_probe,
- .remove_new = imx_uart_remove,
+ .remove = imx_uart_remove,
.driver = {
.name = "imx-uart",
diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index a0731773ce75c..58a3ab030d670 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
@@ -915,7 +915,7 @@ MODULE_DEVICE_TABLE(of, ltq_asc_match);
static struct platform_driver lqasc_driver = {
.probe = lqasc_probe,
- .remove_new = lqasc_remove,
+ .remove = lqasc_remove,
.driver = {
.name = DRVNAME,
.of_match_table = ltq_asc_match,
diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
index 3ce369f763498..6c13cf1ab646f 100644
--- a/drivers/tty/serial/liteuart.c
+++ b/drivers/tty/serial/liteuart.c
@@ -353,7 +353,7 @@ MODULE_DEVICE_TABLE(of, liteuart_of_match);
static struct platform_driver liteuart_platform_driver = {
.probe = liteuart_probe,
- .remove_new = liteuart_remove,
+ .remove = liteuart_remove,
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = liteuart_of_match,
diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index 3e4ac46de1bc3..42c5f9bc18b7c 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -695,7 +695,7 @@ MODULE_DEVICE_TABLE(of, serial_hs_lpc32xx_dt_ids);
static struct platform_driver serial_hs_lpc32xx_driver = {
.probe = serial_hs_lpc32xx_probe,
- .remove_new = serial_hs_lpc32xx_remove,
+ .remove = serial_hs_lpc32xx_remove,
.suspend = serial_hs_lpc32xx_suspend,
.resume = serial_hs_lpc32xx_resume,
.driver = {
diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c
index cea1a2427d897..f3e349ddf29cb 100644
--- a/drivers/tty/serial/ma35d1_serial.c
+++ b/drivers/tty/serial/ma35d1_serial.c
@@ -806,7 +806,7 @@ static int ma35d1serial_resume(struct platform_device *dev)
static struct platform_driver ma35d1serial_driver = {
.probe = ma35d1serial_probe,
- .remove_new = ma35d1serial_remove,
+ .remove = ma35d1serial_remove,
.suspend = ma35d1serial_suspend,
.resume = ma35d1serial_resume,
.driver = {
diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c
index 58858dd352c59..93e7dda4d39ac 100644
--- a/drivers/tty/serial/mcf.c
+++ b/drivers/tty/serial/mcf.c
@@ -616,7 +616,7 @@ static void mcf_remove(struct platform_device *pdev)
static struct platform_driver mcf_platform_driver = {
.probe = mcf_probe,
- .remove_new = mcf_remove,
+ .remove = mcf_remove,
.driver = {
.name = "mcfuart",
},
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 8eb586ac3b0da..a6cb2a535f9dc 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -842,7 +842,7 @@ MODULE_DEVICE_TABLE(of, meson_uart_dt_match);
static struct platform_driver meson_uart_platform_driver = {
.probe = meson_uart_probe,
- .remove_new = meson_uart_remove,
+ .remove = meson_uart_remove,
.driver = {
.name = "meson_uart",
.of_match_table = meson_uart_dt_match,
diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c
index 9b54f017f2e8a..4e47dca2c4ed9 100644
--- a/drivers/tty/serial/milbeaut_usio.c
+++ b/drivers/tty/serial/milbeaut_usio.c
@@ -573,7 +573,7 @@ MODULE_DEVICE_TABLE(of, mlb_usio_dt_ids);
static struct platform_driver mlb_usio_driver = {
.probe = mlb_usio_probe,
- .remove_new = mlb_usio_remove,
+ .remove = mlb_usio_remove,
.driver = {
.name = USIO_NAME,
.of_match_table = mlb_usio_dt_ids,
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 95dae5e27b286..f55aa353aed9e 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -1843,7 +1843,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
static struct platform_driver mpc52xx_uart_of_driver = {
.probe = mpc52xx_uart_of_probe,
- .remove_new = mpc52xx_uart_of_remove,
+ .remove = mpc52xx_uart_of_remove,
#ifdef CONFIG_PM
.suspend = mpc52xx_uart_of_suspend,
.resume = mpc52xx_uart_of_resume,
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index 138abadf2d617..3976d7195d943 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -1901,7 +1901,7 @@ static const struct dev_pm_ops msm_serial_dev_pm_ops = {
};
static struct platform_driver msm_platform_driver = {
- .remove_new = msm_serial_remove,
+ .remove = msm_serial_remove,
.probe = msm_serial_probe,
.driver = {
.name = "msm_serial",
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index a1c76565c3991..cc65c9fb6446c 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1704,7 +1704,7 @@ static void mxs_auart_remove(struct platform_device *pdev)
static struct platform_driver mxs_auart_driver = {
.probe = mxs_auart_probe,
- .remove_new = mxs_auart_remove,
+ .remove = mxs_auart_remove,
.driver = {
.name = "mxs-auart",
.of_match_table = mxs_auart_dt_ids,
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index d7e172eeaab15..0b85f47ff19e0 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1802,7 +1802,7 @@ MODULE_DEVICE_TABLE(of, omap_serial_of_match);
static struct platform_driver serial_omap_driver = {
.probe = serial_omap_probe,
- .remove_new = serial_omap_remove,
+ .remove = serial_omap_remove,
.driver = {
.name = OMAP_SERIAL_DRIVER_NAME,
.pm = &serial_omap_dev_pm_ops,
diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c
index ecec483d4d59d..0542882cfbbe4 100644
--- a/drivers/tty/serial/owl-uart.c
+++ b/drivers/tty/serial/owl-uart.c
@@ -730,7 +730,7 @@ static void owl_uart_remove(struct platform_device *pdev)
static struct platform_driver owl_uart_platform_driver = {
.probe = owl_uart_probe,
- .remove_new = owl_uart_remove,
+ .remove = owl_uart_remove,
.driver = {
.name = "owl-uart",
.of_match_table = owl_uart_dt_matches,
diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index 261c8115a700c..14d50bd7f1bd3 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -956,7 +956,7 @@ MODULE_DEVICE_TABLE(of, pic32_serial_dt_ids);
static struct platform_driver pic32_uart_platform_driver = {
.probe = pic32_uart_probe,
- .remove_new = pic32_uart_remove,
+ .remove = pic32_uart_remove,
.driver = {
.name = PIC32_DEV_NAME,
.of_match_table = of_match_ptr(pic32_serial_dt_ids),
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index 893c59ef2fab3..f49d6052d11be 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1776,7 +1776,7 @@ static struct macio_driver pmz_driver = {
static struct platform_driver pmz_driver = {
.probe = pmz_attach,
- .remove_new = pmz_detach,
+ .remove = pmz_detach,
.driver = {
.name = "scc",
},
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index e12be40ec4896..db80d56803250 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1864,7 +1864,7 @@ static const struct of_device_id qcom_geni_serial_match_table[] = {
MODULE_DEVICE_TABLE(of, qcom_geni_serial_match_table);
static struct platform_driver qcom_geni_serial_platform_driver = {
- .remove_new = qcom_geni_serial_remove,
+ .remove = qcom_geni_serial_remove,
.probe = qcom_geni_serial_probe,
.driver = {
.name = "qcom_geni_serial",
diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c
index 663e35e424bdb..87fa30d686878 100644
--- a/drivers/tty/serial/rda-uart.c
+++ b/drivers/tty/serial/rda-uart.c
@@ -777,7 +777,7 @@ static void rda_uart_remove(struct platform_device *pdev)
static struct platform_driver rda_uart_platform_driver = {
.probe = rda_uart_probe,
- .remove_new = rda_uart_remove,
+ .remove = rda_uart_remove,
.driver = {
.name = "rda-uart",
.of_match_table = rda_uart_dt_matches,
diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c
index 79c794fa65451..3c34027687d21 100644
--- a/drivers/tty/serial/sa1100.c
+++ b/drivers/tty/serial/sa1100.c
@@ -880,7 +880,7 @@ static void sa1100_serial_remove(struct platform_device *pdev)
static struct platform_driver sa11x0_serial_driver = {
.probe = sa1100_serial_probe,
- .remove_new = sa1100_serial_remove,
+ .remove = sa1100_serial_remove,
.suspend = sa1100_serial_suspend,
.resume = sa1100_serial_resume,
.driver = {
diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index e7c0746ffc7b7..1641e72c26184 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2645,7 +2645,7 @@ MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
static struct platform_driver samsung_serial_driver = {
.probe = s3c24xx_serial_probe,
- .remove_new = s3c24xx_serial_remove,
+ .remove = s3c24xx_serial_remove,
.id_table = s3c24xx_serial_driver_ids,
.driver = {
.name = "samsung-uart",
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index 6d1d142fd2161..4c851dae6624f 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -1052,7 +1052,7 @@ static struct platform_driver sccnxp_uart_driver = {
.name = SCCNXP_NAME,
},
.probe = sccnxp_probe,
- .remove_new = sccnxp_remove,
+ .remove = sccnxp_remove,
.id_table = sccnxp_id_table,
};
module_platform_driver(sccnxp_uart_driver);
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index 2c3d718cbe302..b0fc4ae3686f8 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -1662,7 +1662,7 @@ static const struct dev_pm_ops tegra_uart_pm_ops = {
static struct platform_driver tegra_uart_platform_driver = {
.probe = tegra_uart_probe,
- .remove_new = tegra_uart_remove,
+ .remove = tegra_uart_remove,
.driver = {
.name = "serial-tegra",
.of_match_table = tegra_uart_of_match,
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index abba397229581..436a559234dfe 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -1097,7 +1097,7 @@ static int serial_txx9_resume(struct platform_device *dev)
static struct platform_driver serial_txx9_plat_driver = {
.probe = serial_txx9_probe,
- .remove_new = serial_txx9_remove,
+ .remove = serial_txx9_remove,
#ifdef CONFIG_PM
.suspend = serial_txx9_suspend,
.resume = serial_txx9_resume,
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 1bbd59b3ab49e..ae16800ef7d44 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3662,7 +3662,7 @@ static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume);
static struct platform_driver sci_driver = {
.probe = sci_probe,
- .remove_new = sci_remove,
+ .remove = sci_remove,
.driver = {
.name = "sh-sci",
.pm = &sci_dev_pm_ops,
diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
index 7fbb170cf0f43..054a8e630acea 100644
--- a/drivers/tty/serial/sifive.c
+++ b/drivers/tty/serial/sifive.c
@@ -1046,7 +1046,7 @@ MODULE_DEVICE_TABLE(of, sifive_serial_of_match);
static struct platform_driver sifive_serial_platform_driver = {
.probe = sifive_serial_probe,
- .remove_new = sifive_serial_remove,
+ .remove = sifive_serial_remove,
.driver = {
.name = SIFIVE_SERIAL_NAME,
.pm = pm_sleep_ptr(&sifive_uart_pm_ops),
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index c575c38b513d3..2abfc36bdf0a1 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1261,7 +1261,7 @@ MODULE_DEVICE_TABLE(of, serial_ids);
static struct platform_driver sprd_platform_driver = {
.probe = sprd_probe,
- .remove_new = sprd_remove,
+ .remove = sprd_remove,
.driver = {
.name = "sprd_serial",
.of_match_table = serial_ids,
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 8aea59f8ca13d..6ed9a327702bb 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -934,7 +934,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(asc_serial_pm_ops, asc_serial_suspend,
static struct platform_driver asc_serial_driver = {
.probe = asc_serial_probe,
- .remove_new = asc_serial_remove,
+ .remove = asc_serial_remove,
.driver = {
.name = DRIVER_NAME,
.pm = pm_sleep_ptr(&asc_serial_pm_ops),
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index e685cace5c854..ad06b760cfca7 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -2186,7 +2186,7 @@ static const struct dev_pm_ops stm32_serial_pm_ops = {
static struct platform_driver stm32_serial_driver = {
.probe = stm32_usart_serial_probe,
- .remove_new = stm32_usart_serial_remove,
+ .remove = stm32_usart_serial_remove,
.driver = {
.name = DRIVER_NAME,
.pm = &stm32_serial_pm_ops,
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 7f60679fdde19..2b3ec65d595d8 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -633,7 +633,7 @@ static struct platform_driver hv_driver = {
.of_match_table = hv_match,
},
.probe = hv_probe,
- .remove_new = hv_remove,
+ .remove = hv_remove,
};
static int __init sunhv_init(void)
diff --git a/drivers/tty/serial/sunplus-uart.c b/drivers/tty/serial/sunplus-uart.c
index abf7c449308d9..38deee571b0d0 100644
--- a/drivers/tty/serial/sunplus-uart.c
+++ b/drivers/tty/serial/sunplus-uart.c
@@ -697,7 +697,7 @@ MODULE_DEVICE_TABLE(of, sp_uart_of_match);
static struct platform_driver sunplus_uart_platform_driver = {
.probe = sunplus_uart_probe,
- .remove_new = sunplus_uart_remove,
+ .remove = sunplus_uart_remove,
.driver = {
.name = "sunplus_uart",
.of_match_table = sp_uart_of_match,
diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c
index 1acbe2fba746f..df906ccf2e8a4 100644
--- a/drivers/tty/serial/sunsab.c
+++ b/drivers/tty/serial/sunsab.c
@@ -1100,7 +1100,7 @@ static struct platform_driver sab_driver = {
.of_match_table = sab_match,
},
.probe = sab_probe,
- .remove_new = sab_remove,
+ .remove = sab_remove,
};
static int __init sunsab_init(void)
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 0f463da5e7ce6..7f0fef07e141d 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -1549,7 +1549,7 @@ static struct platform_driver su_driver = {
.of_match_table = su_match,
},
.probe = su_probe,
- .remove_new = su_remove,
+ .remove = su_remove,
};
static int __init sunsu_init(void)
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index 71758ad4241c1..0551c24c06f5f 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -1538,7 +1538,7 @@ static struct platform_driver zs_driver = {
.of_match_table = zs_match,
},
.probe = zs_probe,
- .remove_new = zs_remove,
+ .remove = zs_remove,
};
static int __init sunzilog_init(void)
diff --git a/drivers/tty/serial/tegra-tcu.c b/drivers/tty/serial/tegra-tcu.c
index 21ca5fcadf499..7033dbfe8ba1e 100644
--- a/drivers/tty/serial/tegra-tcu.c
+++ b/drivers/tty/serial/tegra-tcu.c
@@ -293,7 +293,7 @@ static struct platform_driver tegra_tcu_driver = {
.of_match_table = tegra_tcu_match,
},
.probe = tegra_tcu_probe,
- .remove_new = tegra_tcu_remove,
+ .remove = tegra_tcu_remove,
};
module_platform_driver(tegra_tcu_driver);
diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c
index 43fa0938b5e33..6fa93c3872a72 100644
--- a/drivers/tty/serial/timbuart.c
+++ b/drivers/tty/serial/timbuart.c
@@ -485,7 +485,7 @@ static struct platform_driver timbuart_platform_driver = {
.name = "timb-uart",
},
.probe = timbuart_probe,
- .remove_new = timbuart_remove,
+ .remove = timbuart_remove,
};
module_platform_driver(timbuart_platform_driver);
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 94c3f5e105547..6240c3d4dfd79 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -906,7 +906,7 @@ MODULE_ALIAS("platform:uartlite");
static struct platform_driver ulite_platform_driver = {
.probe = ulite_probe,
- .remove_new = ulite_remove,
+ .remove = ulite_remove,
.driver = {
.name = "uartlite",
.of_match_table = of_match_ptr(ulite_of_match),
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index 53bb8c5ef499e..6e27843437ab0 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1484,7 +1484,7 @@ static struct platform_driver ucc_uart_of_driver = {
.of_match_table = ucc_uart_match,
},
.probe = ucc_uart_probe,
- .remove_new = ucc_uart_remove,
+ .remove = ucc_uart_remove,
};
static int __init ucc_uart_init(void)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 239d28489841f..c41d694a023f8 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1901,7 +1901,7 @@ static void cdns_uart_remove(struct platform_device *pdev)
static struct platform_driver cdns_uart_platform_driver = {
.probe = cdns_uart_probe,
- .remove_new = cdns_uart_remove,
+ .remove = cdns_uart_remove,
.driver = {
.name = CDNS_UART_NAME,
.of_match_table = cdns_uart_of_match,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0544/1756] serial: txx9: Drop noop probe function and dangerous remove callback
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (542 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0543/1756] serial: Switch back to struct platform_driver::remove() Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0545/1756] serial: 8250_uniphier: Use devm_clk_get_enabled() Greg Kroah-Hartman
` (454 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Atsushi Nemoto, Geert Uytterhoeven,
Andy Shevchenko, Uwe Kleine-König , Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
[ Upstream commit 22c6a6ac74c2434735638e7ef1101597ae263aec ]
The only platform device that can be bound to the driver is allocated by
the driver itself. That device doesn't have platdata, so the probe
function only consists of a loop that is never run and thus can be
dropped without loss of functionality.
The remove function then should better not undo things that were not
done in the first place. That happens because serial_txx9_init() calls
serial_txx9_register_ports() with the created platform device and so
up->dev == &dev->dev evaluates to true and uart_remove_one_port() is
called twice for each port.
So let serial_txx9_exit() undo exactly what serial_txx9_init() does and
remove the useless respectively wrong functions.
Fixes: 0970769aceb9 ("[SERIAL] serial_txx9 driver update")
Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/cd4fce2cef14907ebe4713c147f8896924380e44.1786697789.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/serial_txx9.c | 55 ++------------------------------
1 file changed, 3 insertions(+), 52 deletions(-)
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index 436a559234dfe..05d8c9ca01625 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -1009,7 +1009,8 @@ static void serial_txx9_unregister_port(int line)
struct uart_port *uart = &serial_txx9_ports[line];
mutex_lock(&serial_txx9_mutex);
- uart_remove_one_port(&serial_txx9_reg, uart);
+ if (uart->iobase || uart->mapbase)
+ uart_remove_one_port(&serial_txx9_reg, uart);
uart->flags = 0;
uart->type = PORT_UNKNOWN;
uart->iobase = 0;
@@ -1019,52 +1020,6 @@ static void serial_txx9_unregister_port(int line)
mutex_unlock(&serial_txx9_mutex);
}
-/*
- * Register a set of serial devices attached to a platform device.
- */
-static int serial_txx9_probe(struct platform_device *dev)
-{
- struct uart_port *p = dev_get_platdata(&dev->dev);
- struct uart_port port;
- int ret, i;
-
- memset(&port, 0, sizeof(struct uart_port));
- for (i = 0; p && p->uartclk != 0; p++, i++) {
- port.iobase = p->iobase;
- port.membase = p->membase;
- port.irq = p->irq;
- port.uartclk = p->uartclk;
- port.iotype = p->iotype;
- port.flags = p->flags;
- port.mapbase = p->mapbase;
- port.dev = &dev->dev;
- port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_TXX9_CONSOLE);
- ret = serial_txx9_register_port(&port);
- if (ret < 0) {
- dev_err(&dev->dev, "unable to register port at index %d "
- "(IO%lx MEM%llx IRQ%d): %d\n", i,
- p->iobase, (unsigned long long)p->mapbase,
- p->irq, ret);
- }
- }
- return 0;
-}
-
-/*
- * Remove serial ports registered against a platform device.
- */
-static void serial_txx9_remove(struct platform_device *dev)
-{
- int i;
-
- for (i = 0; i < UART_NR; i++) {
- struct uart_port *up = &serial_txx9_ports[i];
-
- if (up->dev == &dev->dev)
- serial_txx9_unregister_port(i);
- }
-}
-
#ifdef CONFIG_PM
static int serial_txx9_suspend(struct platform_device *dev, pm_message_t state)
{
@@ -1096,8 +1051,6 @@ static int serial_txx9_resume(struct platform_device *dev)
#endif
static struct platform_driver serial_txx9_plat_driver = {
- .probe = serial_txx9_probe,
- .remove = serial_txx9_remove,
#ifdef CONFIG_PM
.suspend = serial_txx9_suspend,
.resume = serial_txx9_resume,
@@ -1251,9 +1204,7 @@ static void __exit serial_txx9_exit(void)
platform_driver_unregister(&serial_txx9_plat_driver);
platform_device_unregister(serial_txx9_plat_devs);
for (i = 0; i < UART_NR; i++) {
- struct uart_port *up = &serial_txx9_ports[i];
- if (up->iobase || up->mapbase)
- uart_remove_one_port(&serial_txx9_reg, up);
+ serial_txx9_unregister_port(i);
}
uart_unregister_driver(&serial_txx9_reg);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0545/1756] serial: 8250_uniphier: Use devm_clk_get_enabled()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (543 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0544/1756] serial: txx9: Drop noop probe function and dangerous remove callback Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0546/1756] serial: sifive: fix off-by-one in console port bounds check Greg Kroah-Hartman
` (453 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Malathi A, Andy Shevchenko,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Malathi A <malathi.a2000@gmail.com>
[ Upstream commit 790aacba3fdfd3a227cdd5e4952c596ed66a0ed8 ]
uniphier_uart_probe() enables priv->clk by hand and is then responsible
for disabling it again on every error path. It misses one: when
uart_read_port_properties() fails the function returns directly, leaving
the clock prepared and enabled. The neighbouring path, taken when
serial8250_register_8250_port() fails, does call clk_disable_unprepare(),
which shows the leak is an oversight rather than intent.
Rather than adding another manual unwind, switch to
devm_clk_get_enabled() so the clock is released by devres. That removes
the error path entirely, along with the explicit disables in the
register failure path and in uniphier_uart_remove().
The clock is still disabled and re-enabled by hand across system sleep,
which stays balanced: only SET_SYSTEM_SLEEP_PM_OPS is used, so the
device cannot be unbound while suspended and devres always sees an
enabled clock at detach.
Found by smatch:
drivers/tty/serial/8250/8250_uniphier.c:232 uniphier_uart_probe() warn: 'priv->clk' from clk_prepare_enable() not released on lines: 205.
Fixes: 26e8349c0d76 ("serial: 8250_uniphier: Switch to use uart_read_port_properties()")
Signed-off-by: Malathi A <malathi.a2000@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260917040511.103232-1-malathi.a2000@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/8250/8250_uniphier.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index 4874a9632db39..6d8c0098bfa55 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -180,16 +180,12 @@ static int uniphier_uart_probe(struct platform_device *pdev)
memset(&up, 0, sizeof(up));
- priv->clk = devm_clk_get(dev, NULL);
+ priv->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(priv->clk)) {
- dev_err(dev, "failed to get clock\n");
+ dev_err(dev, "failed to get and enable clock\n");
return PTR_ERR(priv->clk);
}
- ret = clk_prepare_enable(priv->clk);
- if (ret)
- return ret;
-
up.port.uartclk = clk_get_rate(priv->clk);
spin_lock_init(&priv->atomic_write_lock);
@@ -222,7 +218,6 @@ static int uniphier_uart_probe(struct platform_device *pdev)
ret = serial8250_register_8250_port(&up);
if (ret < 0) {
dev_err(dev, "failed to register 8250 port\n");
- clk_disable_unprepare(priv->clk);
return ret;
}
priv->line = ret;
@@ -237,7 +232,6 @@ static void uniphier_uart_remove(struct platform_device *pdev)
struct uniphier8250_priv *priv = platform_get_drvdata(pdev);
serial8250_unregister_port(priv->line);
- clk_disable_unprepare(priv->clk);
}
static int __maybe_unused uniphier_uart_suspend(struct device *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0546/1756] serial: sifive: fix off-by-one in console port bounds check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (544 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0545/1756] serial: 8250_uniphier: Use devm_clk_get_enabled() Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0547/1756] ARM: dts: ux500: Convert HREF audio to audio-graph-card2 Greg Kroah-Hartman
` (452 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zongmin Zhou, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zongmin Zhou <zhouzongmin@kylinos.cn>
[ Upstream commit bf961847813d9edcb5a9c089714069428d141fa9 ]
sifive_serial_console_ports[] is sized SIFIVE_SERIAL_MAX_PORTS (8), so
valid indices are 0..7. The bounds check in sifive_serial_probe() uses
"id > SIFIVE_SERIAL_MAX_PORTS", which lets id == 8 pass and causes an
out-of-bounds write in __ssp_add_console_port() through
sifive_serial_console_ports[ssp->port.line].
Fix the check to use >= instead, matching the check already used in
sifive_serial_console_setup().
Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART")
Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Link: https://patch.msgid.link/20260827014524.19375-1-min_halo@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/sifive.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
index 054a8e630acea..1046ada8be444 100644
--- a/drivers/tty/serial/sifive.c
+++ b/drivers/tty/serial/sifive.c
@@ -937,7 +937,7 @@ static int sifive_serial_probe(struct platform_device *pdev)
}
#ifdef CONFIG_SERIAL_SIFIVE_CONSOLE
- if (id > SIFIVE_SERIAL_MAX_PORTS) {
+ if (id >= SIFIVE_SERIAL_MAX_PORTS) {
dev_err(&pdev->dev, "too many UARTs (%d)\n", id);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0547/1756] ARM: dts: ux500: Convert HREF audio to audio-graph-card2
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (545 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0546/1756] serial: sifive: fix off-by-one in console port bounds check Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0548/1756] dt-bindings: vendor-prefixes: add Free Mobile Greg Kroah-Hartman
` (451 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit f9b2262d1edba1b6c0abc12118105f8fa200980a ]
Describe the HREF500 and HREF520 sound hardware with two-link audio
graph cards in their PMIC-specific HREF DTSIs, and name the card
HREF-500. Connect MSP1 to codec DAI 0 for playback and MSP3 to codec
DAI 1 for capture.
Describe the DSP_A format, codec-provided bit and frame clocks,
16-by-16-bit TDM frame and active slots on the graph endpoints. Keep the
clocks running continuously, matching the legacy machine driver's normal
one- and two-channel mode.
Keep each complete card, including its endpoint graph, connector
widgets and routes, in the existing PMIC-specific HREF DTSI. The AB8500
variant exposes six digital microphone endpoints. AB8505 has neither
the digital microphone interface nor its VDMIC regulator, so leave
these endpoints out of HREF520 and remove its stale regulator and pin
configuration nodes.
Select ULPCLK as the fixed parent of the codec audio clock in the
HREF-specific codec DTSIs. This replaces the machine driver clock
control with declarative board policy.
Fixes: 4ecae2ae9535 ("ARM: dts: ux500-href: Switch HREF520 to AB8505")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/st/ste-ab8500.dtsi | 6 --
arch/arm/boot/dts/st/ste-ab8505.dtsi | 6 --
arch/arm/boot/dts/st/ste-dbx5x0.dtsi | 5 -
arch/arm/boot/dts/st/ste-href-ab8500.dtsi | 104 +++++++++++++++++++
arch/arm/boot/dts/st/ste-href-ab8505.dtsi | 118 +++++++++++++++++-----
5 files changed, 196 insertions(+), 43 deletions(-)
diff --git a/arch/arm/boot/dts/st/ste-ab8500.dtsi b/arch/arm/boot/dts/st/ste-ab8500.dtsi
index dd30d08ccb9b9..a55f365ea0200 100644
--- a/arch/arm/boot/dts/st/ste-ab8500.dtsi
+++ b/arch/arm/boot/dts/st/ste-ab8500.dtsi
@@ -364,12 +364,6 @@ ab8500_ldo_ana_reg: ab8500_ldo_ana {
};
};
- sound {
- stericsson,audio-codec = <&codec>;
- clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
- clock-names = "sysclk", "ulpclk", "intclk";
- };
-
mcde@a0350000 {
vana-supply = <&ab8500_ldo_ana_reg>;
diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
index 131c82508e820..24b12f0cf322f 100644
--- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
+++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
@@ -301,12 +301,6 @@ ab8500_ldo_ana_reg: ab8500_ldo_ana {
};
};
- sound {
- stericsson,audio-codec = <&codec>;
- clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
- clock-names = "sysclk", "ulpclk", "intclk";
- };
-
mcde@a0350000 {
vana-supply = <&ab8500_ldo_ana_reg>;
diff --git a/arch/arm/boot/dts/st/ste-dbx5x0.dtsi b/arch/arm/boot/dts/st/ste-dbx5x0.dtsi
index 0f87abeddc335..2ed9d385042f3 100644
--- a/arch/arm/boot/dts/st/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/st/ste-dbx5x0.dtsi
@@ -1071,11 +1071,6 @@ mmc@80008000 {
status = "disabled";
};
- sound {
- compatible = "stericsson,snd-soc-mop500";
- stericsson,cpu-dai = <&msp1 &msp3>;
- };
-
msp0: msp@80123000 {
compatible = "stericsson,ux500-msp-i2s";
reg = <0x80123000 0x1000>;
diff --git a/arch/arm/boot/dts/st/ste-href-ab8500.dtsi b/arch/arm/boot/dts/st/ste-href-ab8500.dtsi
index 5eeb44c5e9323..ff72f5f6d6525 100644
--- a/arch/arm/boot/dts/st/ste-href-ab8500.dtsi
+++ b/arch/arm/boot/dts/st/ste-href-ab8500.dtsi
@@ -6,6 +6,48 @@
#include "ste-ab8500.dtsi"
/ {
+ href_sound: sound {
+ compatible = "audio-graph-card2";
+ label = "HREF-500";
+ widgets =
+ "Headphone", "Headset",
+ "Speaker", "Earpiece Speaker",
+ "Speaker", "Loudspeaker",
+ "Line", "Line Out",
+ "Speaker", "Vibra 1 Motor",
+ "Speaker", "Vibra 2 Motor",
+ "Microphone", "Mic 1 Jack",
+ "Microphone", "Mic 2 Jack",
+ "Line", "Line In",
+ "Microphone", "Digital Mic 1",
+ "Microphone", "Digital Mic 2",
+ "Microphone", "Digital Mic 3",
+ "Microphone", "Digital Mic 4",
+ "Microphone", "Digital Mic 5",
+ "Microphone", "Digital Mic 6";
+ routing =
+ "Headset", "Headset Left",
+ "Headset", "Headset Right",
+ "Earpiece Speaker", "Earpiece",
+ "Loudspeaker", "Speaker Left",
+ "Loudspeaker", "Speaker Right",
+ "Line Out", "LineOut Left",
+ "Line Out", "LineOut Right",
+ "Vibra 1 Motor", "Vibra 1",
+ "Vibra 2 Motor", "Vibra 2",
+ "Mic 1", "Mic 1 Jack",
+ "Mic 2", "Mic 2 Jack",
+ "LineIn Left", "Line In",
+ "LineIn Right", "Line In",
+ "DMic 1", "Digital Mic 1",
+ "DMic 2", "Digital Mic 2",
+ "DMic 3", "Digital Mic 3",
+ "DMic 4", "Digital Mic 4",
+ "DMic 5", "Digital Mic 5",
+ "DMic 6", "Digital Mic 6";
+ links = <&href_msp1_port &href_msp3_port>;
+ };
+
soc {
prcmu@80157000 {
ab8500 {
@@ -488,3 +530,65 @@ ab8500_chargalg {
};
};
};
+
+&codec {
+ assigned-clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
+ assigned-clock-parents = <&ab8500_clock AB8500_SYSCLK_ULP>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ href_codec_playback: endpoint {
+ remote-endpoint = <&href_msp1_endpoint>;
+ bitclock-master;
+ frame-master;
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-tx-mask = <0 1 0 1>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ href_codec_capture: endpoint {
+ remote-endpoint = <&href_msp3_endpoint>;
+ bitclock-master;
+ frame-master;
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-rx-mask = <1>;
+ };
+ };
+ };
+};
+
+&msp1 {
+ href_msp1_port: port {
+ href_msp1_endpoint: endpoint {
+ continuous-clock;
+ remote-endpoint = <&href_codec_playback>;
+ dai-format = "dsp_a";
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-tx-mask = <0 1 0 1>;
+ };
+ };
+};
+
+&msp3 {
+ href_msp3_port: port {
+ href_msp3_endpoint: endpoint {
+ continuous-clock;
+ remote-endpoint = <&href_codec_capture>;
+ dai-format = "dsp_a";
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-rx-mask = <1>;
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/st/ste-href-ab8505.dtsi b/arch/arm/boot/dts/st/ste-href-ab8505.dtsi
index 268db68ccf87b..eba6f674c6911 100644
--- a/arch/arm/boot/dts/st/ste-href-ab8505.dtsi
+++ b/arch/arm/boot/dts/st/ste-href-ab8505.dtsi
@@ -6,6 +6,36 @@
#include "ste-ab8505.dtsi"
/ {
+ href_sound: sound {
+ compatible = "audio-graph-card2";
+ label = "HREF-500";
+ widgets =
+ "Headphone", "Headset",
+ "Speaker", "Earpiece Speaker",
+ "Speaker", "Loudspeaker",
+ "Line", "Line Out",
+ "Speaker", "Vibra 1 Motor",
+ "Speaker", "Vibra 2 Motor",
+ "Microphone", "Mic 1 Jack",
+ "Microphone", "Mic 2 Jack",
+ "Line", "Line In";
+ routing =
+ "Headset", "Headset Left",
+ "Headset", "Headset Right",
+ "Earpiece Speaker", "Earpiece",
+ "Loudspeaker", "Speaker Left",
+ "Loudspeaker", "Speaker Right",
+ "Line Out", "LineOut Left",
+ "Line Out", "LineOut Right",
+ "Vibra 1 Motor", "Vibra 1",
+ "Vibra 2 Motor", "Vibra 2",
+ "Mic 1", "Mic 1 Jack",
+ "Mic 2", "Mic 2 Jack",
+ "LineIn Left", "Line In",
+ "LineIn Right", "Line In";
+ links = <&href_msp1_port &href_msp3_port>;
+ };
+
soc {
prcmu@80157000 {
ab8505 {
@@ -48,10 +78,6 @@ ab8500_ldo_anamic2_reg: ab8500_ldo_anamic2 {
regulator-name = "V-AMIC2";
};
- ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
- regulator-name = "V-DMIC";
- };
-
ab8500_ldo_ana_reg: ab8500_ldo_ana {
regulator-name = "V-CSI/DSI";
};
@@ -80,7 +106,6 @@ gpio {
<&pwm_default_mode>,
<&adi1_default_mode>,
<&usbuicc_default_mode>,
- <&dmic_default_mode>,
<&extcpena_default_mode>,
<&modsclsda_default_mode>;
@@ -365,27 +390,6 @@ default_cfg {
};
};
};
- /* This sets up the microphone pins */
- dmic {
- dmic_default_mode: dmic_default {
- default_mux {
- function = "dmic";
- groups = "dmic12_d_1",
- "dmic34_d_1",
- "dmic56_d_1";
- };
- default_cfg {
- pins = "GPIO27_J6",
- "GPIO28_K6",
- "GPIO29_G6",
- "GPIO30_H6",
- "GPIO31_F5",
- "GPIO32_G5";
- input-enable;
- bias-pull-down;
- };
- };
- };
extcpena {
extcpena_default_mode: extcpena_default {
default_mux {
@@ -488,3 +492,65 @@ ab8500_chargalg {
};
};
};
+
+&codec {
+ assigned-clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
+ assigned-clock-parents = <&ab8500_clock AB8500_SYSCLK_ULP>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ href_codec_playback: endpoint {
+ remote-endpoint = <&href_msp1_endpoint>;
+ bitclock-master;
+ frame-master;
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-tx-mask = <0 1 0 1>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ href_codec_capture: endpoint {
+ remote-endpoint = <&href_msp3_endpoint>;
+ bitclock-master;
+ frame-master;
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-rx-mask = <1>;
+ };
+ };
+ };
+};
+
+&msp1 {
+ href_msp1_port: port {
+ href_msp1_endpoint: endpoint {
+ continuous-clock;
+ remote-endpoint = <&href_codec_playback>;
+ dai-format = "dsp_a";
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-tx-mask = <0 1 0 1>;
+ };
+ };
+};
+
+&msp3 {
+ href_msp3_port: port {
+ href_msp3_endpoint: endpoint {
+ continuous-clock;
+ remote-endpoint = <&href_codec_capture>;
+ dai-format = "dsp_a";
+ dai-tdm-slot-num = <16>;
+ dai-tdm-slot-width = <16>;
+ dai-tdm-slot-rx-mask = <1>;
+ };
+ };
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0548/1756] dt-bindings: vendor-prefixes: add Free Mobile
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (546 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0547/1756] ARM: dts: ux500: Convert HREF audio to audio-graph-card2 Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0549/1756] clk: qcom: dispcc-sm8450: Fix disp_cc_mdss_mdp_clk_src ops Greg Kroah-Hartman
` (450 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Vincent Jardin,
Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Jardin <vjardin@free.fr>
[ Upstream commit aa906abf611c7f37c0fe9171c1d33c40270aa5fe ]
Free Mobile is a French mobile network operator. Add its vendor
prefix, used by the Nodebox v3 CPU Module (freemobile,nbxv3).
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Vincent Jardin <vjardin@free.fr>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index e6e9aa82ce46c..600b42d555eb5 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -533,6 +533,8 @@ patternProperties:
description: Freebox SAS
"^freecom,.*":
description: Freecom Gmbh
+ "^freemobile,.*":
+ description: Free Mobile
"^frida,.*":
description: Shenzhen Frida LCD Co., Ltd.
"^friendlyarm,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0549/1756] clk: qcom: dispcc-sm8450: Fix disp_cc_mdss_mdp_clk_src ops
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (547 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0548/1756] dt-bindings: vendor-prefixes: add Free Mobile Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0550/1756] clk: qcom: alpha-pll: Check Lucid Ole PLL status before configuring Greg Kroah-Hartman
` (449 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Esteban Urrutia,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Esteban Urrutia <esteuwu@proton.me>
[ Upstream commit 8464e2284fec42d9fd05f3109d8b209d65864ece ]
If the clock frequency is changed at registration time, a flicker will be
visible at boot.
Switching to clk_rcg2_shared_no_init_park_ops fixes this.
Fixes: 16fb89f92ec4 ("clk: qcom: Add support for Display Clock Controller on SM8450")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Esteban Urrutia <esteuwu@proton.me>
Link: https://lore.kernel.org/r/20260713-sm8450-qol-dispcc-v3-1-56fd05822270@proton.me
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/qcom/dispcc-sm8450.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/dispcc-sm8450.c b/drivers/clk/qcom/dispcc-sm8450.c
index 8baaf94a119e3..8bb49da19bf03 100644
--- a/drivers/clk/qcom/dispcc-sm8450.c
+++ b/drivers/clk/qcom/dispcc-sm8450.c
@@ -569,7 +569,7 @@ static struct clk_rcg2 disp_cc_mdss_mdp_clk_src = {
.parent_data = disp_cc_parent_data_5,
.num_parents = ARRAY_SIZE(disp_cc_parent_data_5),
.flags = CLK_SET_RATE_PARENT,
- .ops = &clk_rcg2_shared_ops,
+ .ops = &clk_rcg2_shared_no_init_park_ops,
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0550/1756] clk: qcom: alpha-pll: Check Lucid Ole PLL status before configuring
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (548 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0549/1756] clk: qcom: dispcc-sm8450: Fix disp_cc_mdss_mdp_clk_src ops Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0551/1756] tools/nolibc: fix WIFSIGNALED() for status 0 Greg Kroah-Hartman
` (448 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Esteban Urrutia, Konrad Dybcio,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Esteban Urrutia <esteuwu@proton.me>
[ Upstream commit eb34e2804ce4ea56efb741e23d598469274a2f94 ]
On some platforms such as SM8475, not doing this may result in graphical
glitches when the mdss driver takes over.
This fixes the aforementioned issue.
Fixes: 3132a9a11e57 ("clk: qcom: clk-alpha-pll: Add support for lucid ole pll configure")
Signed-off-by: Esteban Urrutia <esteuwu@proton.me>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Suggested-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260713-sm8450-qol-dispcc-v3-3-56fd05822270@proton.me
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/qcom/clk-alpha-pll.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
index e76ecc4663511..9f1da888b6fb0 100644
--- a/drivers/clk/qcom/clk-alpha-pll.c
+++ b/drivers/clk/qcom/clk-alpha-pll.c
@@ -2304,6 +2304,15 @@ void clk_lucid_ole_pll_configure(struct clk_alpha_pll *pll, struct regmap *regma
{
u32 lval = config->l;
+ /*
+ * If the bootloader left the PLL enabled it's likely that there are
+ * RCGs that will lock up if we disable the PLL below.
+ */
+ if (trion_pll_is_enabled(pll, regmap)) {
+ pr_debug("Lucid Ole PLL is already enabled, skipping configuration\n");
+ return;
+ }
+
lval |= TRION_PLL_CAL_VAL << LUCID_EVO_PLL_CAL_L_VAL_SHIFT;
lval |= TRION_PLL_CAL_VAL << LUCID_OLE_PLL_RINGOSC_CAL_L_VAL_SHIFT;
clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), lval);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0551/1756] tools/nolibc: fix WIFSIGNALED() for status 0
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (549 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0550/1756] clk: qcom: alpha-pll: Check Lucid Ole PLL status before configuring Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0552/1756] bpftool: Fix CPU IDs in per-CPU map output Greg Kroah-Hartman
` (447 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Danish Khateeb,
Thomas Weißschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danish Khateeb <danishkhateeb03@gmail.com>
[ Upstream commit 368fae47c6cae28a312c5dc86e5bdb8f9369fd26 ]
WIFSIGNALED() needs the subtraction to wrap around for status 0, so that
only 1 to 0xff, a terminating signal with or without the core dump flag,
pass the check. But status is an int, and 0 - 1 is -1, which is less
than 0xff. A child that exits with 0 is therefore reported as both
exited and killed, and a caller that tests WIFSIGNALED() first sees
"killed by signal 0".
Make the subtraction unsigned, as musl does in the same macro.
Fixes: 8c934d4822c7 ("tools/nolibc: add helpers for wait() signal exits")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Link: https://patch.msgid.link/20260923205622.1123270-2-danishkhateeb03@gmail.com
[Thomas: Drop stable@ Cc]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/nolibc/types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index 9d606c7138a86..30cc9fad57ecf 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -108,7 +108,7 @@
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
#define WIFEXITED(status) (((status) & 0x7f) == 0)
#define WTERMSIG(status) ((status) & 0x7f)
-#define WIFSIGNALED(status) ((status) - 1 < 0xff)
+#define WIFSIGNALED(status) ((status) - 1U < 0xff)
/* standard exit() codes */
#define EXIT_SUCCESS 0
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0552/1756] bpftool: Fix CPU IDs in per-CPU map output
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (550 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0551/1756] tools/nolibc: fix WIFSIGNALED() for status 0 Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0553/1756] iommufd: Fix iommufd_hw_capabilities reference in kernel-doc Greg Kroah-Hartman
` (446 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hui Su, Kumar Kartikeya Dwivedi,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Su <sh_def@163.com>
[ Upstream commit dbf8cef936c7783ca909c38097a69f73173a19a7 ]
bpftool uses dense per-CPU value-buffer slots when printing per-CPU map
values. It also uses the slot index as the CPU ID, which produces
incorrect labels when the possible CPU mask is sparse, such as 0,2-3.
Parse the possible CPU mask and use the corresponding logical CPU ID in
plain, JSON, and BTF-formatted output. Keep the dense slot index for
accessing the per-CPU value buffer.
Pass the parsed CPU count together with the CPU ID array so that the
printed CPU IDs and loop bounds come from the same possible-CPU mask.
Propagate CPU-ID lookup and map output errors through the shared output
path to its callers.
Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool")
Signed-off-by: Hui Su <sh_def@163.com>
Link: https://lore.kernel.org/bpf/20260813155131.1022745-3-sh_def@163.com/
Link: https://lore.kernel.org/bpf/20260923004243.969919-2-sh_def@163.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/bpf/bpftool/common.c | 40 ++++++++++++++++
tools/bpf/bpftool/main.h | 1 +
tools/bpf/bpftool/map.c | 95 +++++++++++++++++++++++++-------------
3 files changed, 103 insertions(+), 33 deletions(-)
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c
index 0a764426d9358..e25291ce96c18 100644
--- a/tools/bpf/bpftool/common.c
+++ b/tools/bpf/bpftool/common.c
@@ -29,6 +29,7 @@
#include <bpf/bpf.h>
#include <bpf/hashmap.h>
#include <bpf/libbpf.h> /* libbpf_num_possible_cpus */
+#include <bpf/libbpf_internal.h>
#include <bpf/btf.h>
#include "main.h"
@@ -650,6 +651,45 @@ unsigned int get_possible_cpus(void)
return cpus;
}
+int get_possible_cpu_ids(int **cpu_ids)
+{
+ const char *possible_cpus_file = "/sys/devices/system/cpu/possible";
+ bool *mask = NULL;
+ int mask_sz, nr_cpus = 0;
+ int *ids = NULL;
+ int i, res;
+
+ *cpu_ids = NULL;
+
+ res = parse_cpu_mask_file(possible_cpus_file, &mask, &mask_sz);
+ if (res) {
+ p_err("failed to parse possible CPU mask: %s", strerror(-res));
+ return res;
+ }
+
+ for (i = 0; i < mask_sz; i++)
+ nr_cpus += mask[i];
+
+ ids = calloc(nr_cpus, sizeof(*ids));
+ if (!ids) {
+ p_err("mem alloc failed");
+ res = -ENOMEM;
+ goto out;
+ }
+
+ for (i = 0, nr_cpus = 0; i < mask_sz; i++) {
+ if (mask[i])
+ ids[nr_cpus++] = i;
+ }
+ *cpu_ids = ids;
+ ids = NULL;
+ res = nr_cpus;
+out:
+ free(ids);
+ free(mask);
+ return res;
+}
+
static char *
ifindex_to_name_ns(__u32 ifindex, __u32 ns_dev, __u32 ns_ino, char *buf)
{
diff --git a/tools/bpf/bpftool/main.h b/tools/bpf/bpftool/main.h
index 9eb764fe4cc8b..f1aead1096338 100644
--- a/tools/bpf/bpftool/main.h
+++ b/tools/bpf/bpftool/main.h
@@ -203,6 +203,7 @@ void print_hex_data_json(uint8_t *data, size_t len);
unsigned int get_page_size(void);
unsigned int get_possible_cpus(void);
+int get_possible_cpu_ids(int **cpu_ids);
const char *
ifindex_to_arch(__u32 ifindex, __u64 ns_dev, __u64 ns_ino, const char **opt);
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index cbfcd4330a91b..4192fc61da2e3 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -70,7 +70,7 @@ static void *alloc_value(struct bpf_map_info *info)
static int do_dump_btf(const struct btf_dumper *d,
struct bpf_map_info *map_info, void *key,
- void *value)
+ void *value, const int *cpu_ids, int cpu_cnt)
{
__u32 value_id;
int ret = 0;
@@ -93,15 +93,15 @@ static int do_dump_btf(const struct btf_dumper *d,
jsonw_name(d->jw, "value");
ret = btf_dumper_type(d, value_id, value);
} else {
- unsigned int i, n, step;
+ unsigned int step;
+ int i;
jsonw_name(d->jw, "values");
jsonw_start_array(d->jw);
- n = get_possible_cpus();
step = round_up(map_info->value_size, 8);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < cpu_cnt; i++) {
jsonw_start_object(d->jw);
- jsonw_int_field(d->jw, "cpu", i);
+ jsonw_int_field(d->jw, "cpu", cpu_ids[i]);
jsonw_name(d->jw, "value");
ret = btf_dumper_type(d, value_id, value + i * step);
jsonw_end_object(d->jw);
@@ -130,7 +130,8 @@ static json_writer_t *get_btf_writer(void)
}
static void print_entry_json(struct bpf_map_info *info, unsigned char *key,
- unsigned char *value, struct btf *btf)
+ unsigned char *value, struct btf *btf,
+ const int *cpu_ids, int cpu_cnt)
{
jsonw_start_object(json_wtr);
@@ -150,12 +151,12 @@ static void print_entry_json(struct bpf_map_info *info, unsigned char *key,
};
jsonw_name(json_wtr, "formatted");
- do_dump_btf(&d, info, key, value);
+ do_dump_btf(&d, info, key, value, cpu_ids, cpu_cnt);
}
} else {
- unsigned int i, n, step;
+ unsigned int step;
+ int i;
- n = get_possible_cpus();
step = round_up(info->value_size, 8);
jsonw_name(json_wtr, "key");
@@ -163,10 +164,10 @@ static void print_entry_json(struct bpf_map_info *info, unsigned char *key,
jsonw_name(json_wtr, "values");
jsonw_start_array(json_wtr);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < cpu_cnt; i++) {
jsonw_start_object(json_wtr);
- jsonw_int_field(json_wtr, "cpu", i);
+ jsonw_int_field(json_wtr, "cpu", cpu_ids[i]);
jsonw_name(json_wtr, "value");
print_hex_data_json(value + i * step,
@@ -183,7 +184,7 @@ static void print_entry_json(struct bpf_map_info *info, unsigned char *key,
};
jsonw_name(json_wtr, "formatted");
- do_dump_btf(&d, info, key, value);
+ do_dump_btf(&d, info, key, value, cpu_ids, cpu_cnt);
}
}
@@ -245,7 +246,7 @@ print_entry_error(struct bpf_map_info *map_info, void *key, int lookup_errno)
}
static void print_entry_plain(struct bpf_map_info *info, unsigned char *key,
- unsigned char *value)
+ unsigned char *value, const int *cpu_ids, int cpu_cnt)
{
if (!map_is_per_cpu(info->type)) {
bool single_line, break_names;
@@ -273,9 +274,9 @@ static void print_entry_plain(struct bpf_map_info *info, unsigned char *key,
printf("\n");
} else {
- unsigned int i, n, step;
+ unsigned int step;
+ int i;
- n = get_possible_cpus();
step = round_up(info->value_size, 8);
if (info->key_size) {
@@ -284,9 +285,9 @@ static void print_entry_plain(struct bpf_map_info *info, unsigned char *key,
printf("\n");
}
if (info->value_size) {
- for (i = 0; i < n; i++) {
- printf("value (CPU %02u):%c",
- i, info->value_size > 16 ? '\n' : ' ');
+ for (i = 0; i < cpu_cnt; i++) {
+ printf("value (CPU %02d):%c",
+ cpu_ids[i], info->value_size > 16 ? '\n' : ' ');
fprint_hex(stdout, value + i * step,
info->value_size, " ");
printf("\n");
@@ -739,7 +740,7 @@ static int do_show(int argc, char **argv)
static int dump_map_elem(int fd, void *key, void *value,
struct bpf_map_info *map_info, struct btf *btf,
- json_writer_t *btf_wtr)
+ json_writer_t *btf_wtr, const int *cpu_ids, int cpu_cnt)
{
if (bpf_map_lookup_elem(fd, key, value)) {
print_entry_error(map_info, key, errno);
@@ -747,7 +748,7 @@ static int dump_map_elem(int fd, void *key, void *value,
}
if (json_output) {
- print_entry_json(map_info, key, value, btf);
+ print_entry_json(map_info, key, value, btf, cpu_ids, cpu_cnt);
} else if (btf) {
struct btf_dumper d = {
.btf = btf,
@@ -755,9 +756,9 @@ static int dump_map_elem(int fd, void *key, void *value,
.is_plain_text = true,
};
- do_dump_btf(&d, map_info, key, value);
+ do_dump_btf(&d, map_info, key, value, cpu_ids, cpu_cnt);
} else {
- print_entry_plain(map_info, key, value);
+ print_entry_plain(map_info, key, value, cpu_ids, cpu_cnt);
}
return 0;
@@ -830,6 +831,8 @@ map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr,
void *key, *value, *prev_key;
unsigned int num_elems = 0;
struct btf *btf = NULL;
+ int *cpu_ids = NULL;
+ int cpu_cnt = 0;
int err;
key = malloc(info->key_size);
@@ -842,6 +845,14 @@ map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr,
prev_key = NULL;
+ if (map_is_per_cpu(info->type)) {
+ cpu_cnt = get_possible_cpu_ids(&cpu_ids);
+ if (cpu_cnt < 0) {
+ err = cpu_cnt;
+ goto exit_free;
+ }
+ }
+
if (wtr) {
err = get_map_kv_btf(info, &btf);
if (err) {
@@ -873,7 +884,8 @@ map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr,
err = 0;
break;
}
- if (!dump_map_elem(fd, key, value, info, btf, wtr))
+ if (!dump_map_elem(fd, key, value, info, btf, wtr,
+ cpu_ids, cpu_cnt))
num_elems++;
prev_key = key;
}
@@ -890,6 +902,7 @@ map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr,
exit_free:
free(key);
free(value);
+ free(cpu_ids);
free_map_kv_btf(btf);
return err;
@@ -1032,17 +1045,30 @@ static int do_update(int argc, char **argv)
return err;
}
-static void print_key_value(struct bpf_map_info *info, void *key,
- void *value)
+static int print_key_value(struct bpf_map_info *info, void *key,
+ void *value)
{
json_writer_t *btf_wtr;
struct btf *btf;
+ int *cpu_ids = NULL;
+ int cpu_cnt = 0;
+ int err = 0;
- if (get_map_kv_btf(info, &btf))
- return;
+ if (map_is_per_cpu(info->type)) {
+ cpu_cnt = get_possible_cpu_ids(&cpu_ids);
+
+ if (cpu_cnt < 0) {
+ err = cpu_cnt;
+ goto out;
+ }
+ }
+
+ err = get_map_kv_btf(info, &btf);
+ if (err)
+ goto out;
if (json_output) {
- print_entry_json(info, key, value, btf);
+ print_entry_json(info, key, value, btf, cpu_ids, cpu_cnt);
} else if (btf) {
/* if here json_wtr wouldn't have been initialised,
* so let's create separate writer for btf
@@ -1052,7 +1078,7 @@ static void print_key_value(struct bpf_map_info *info, void *key,
p_info("failed to create json writer for btf. falling back to plain output");
free_map_kv_btf(btf);
btf = NULL;
- print_entry_plain(info, key, value);
+ print_entry_plain(info, key, value, cpu_ids, cpu_cnt);
} else {
struct btf_dumper d = {
.btf = btf,
@@ -1060,13 +1086,16 @@ static void print_key_value(struct bpf_map_info *info, void *key,
.is_plain_text = true,
};
- do_dump_btf(&d, info, key, value);
+ do_dump_btf(&d, info, key, value, cpu_ids, cpu_cnt);
jsonw_destroy(&btf_wtr);
}
} else {
- print_entry_plain(info, key, value);
+ print_entry_plain(info, key, value, cpu_ids, cpu_cnt);
}
free_map_kv_btf(btf);
+out:
+ free(cpu_ids);
+ return err;
}
static int do_lookup(int argc, char **argv)
@@ -1110,7 +1139,7 @@ static int do_lookup(int argc, char **argv)
}
/* here means bpf_map_lookup_elem() succeeded */
- print_key_value(&info, key, value);
+ err = print_key_value(&info, key, value);
exit_free:
free(key);
@@ -1390,7 +1419,7 @@ static int do_pop_dequeue(int argc, char **argv)
goto exit_free;
}
- print_key_value(&info, key, value);
+ err = print_key_value(&info, key, value);
exit_free:
free(key);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0553/1756] iommufd: Fix iommufd_hw_capabilities reference in kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (551 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0552/1756] bpftool: Fix CPU IDs in per-CPU map output Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0554/1756] ext2: drain in-flight DIO before buffered write fallback Greg Kroah-Hartman
` (445 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Kevin Tian,
Jason Gunthorpe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 54dadb030c7e2350957855d3995de05ae02c2e66 ]
The kernel-doc comment of struct iommu_hw_info refers to
iommu_hw_capabilities, which does not exist. The name is
iommufd_hw_capabilities. Say iommufd_hw_capabilities.
Fixes: 7623683857e5 ("iommufd: Add capabilities to IOMMU_GET_HW_INFO")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260911231850.20737-1-kmehltretter@gmail.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/uapi/linux/iommufd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h
index e245fa295662a..e0533364ba340 100644
--- a/include/uapi/linux/iommufd.h
+++ b/include/uapi/linux/iommufd.h
@@ -529,7 +529,7 @@ enum iommufd_hw_capabilities {
* @out_data_type: Output the iommu hardware info type as defined in the enum
* iommu_hw_info_type.
* @out_capabilities: Output the generic iommu capability info type as defined
- * in the enum iommu_hw_capabilities.
+ * in the enum iommufd_hw_capabilities.
* @out_max_pasid_log2: Output the width of PASIDs. 0 means no PASID support.
* PCI devices turn to out_capabilities to check if the
* specific capabilities is supported or not.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0554/1756] ext2: drain in-flight DIO before buffered write fallback
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (552 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0553/1756] iommufd: Fix iommufd_hw_capabilities reference in kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0555/1756] mfd: rk8xx: Register poweroff handler in atomic phase Greg Kroah-Hartman
` (444 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Jan Kara, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 1e2ef9f221e142ed19d874a71b2cae7fabbaf138 ]
An asynchronous direct write can remain in flight after the inode lock is
released. If another direct write falls back to buffered I/O while the
first write is still pending, generic_perform_write() can dirty pages
before the first write completes its post-I/O page cache invalidation.
The invalidation then finds dirty pages, reports a page cache invalidation
failure, and records -EIO in the mapping error sequence. A later fsync()
therefore returns -EIO.
Commit 15cdefd0c0522f9d5e12d947fa04f4c11649b699 ("ext4: drain
in-flight DIO before buffered write fallback") fixed the same race in
ext4. Ext2 has an equivalent fallback after iomap_dio_rw() returns
-ENOTBLK or a short write, but does not drain other in-flight DIO before
dirtying the page cache.
Wait for in-flight DIO before calling generic_perform_write() in the
fallback path.
A reproducer using concurrent AIO direct writes and buffered fallback
triggered the following warning and made a subsequent fsync() return
-EIO:
Page cache invalidation failure on direct I/O. Possible data corruption
due to collision with buffered I/O!
Fixes: fb5de4358e1a ("ext2: Move direct-io to use iomap")
Link: https://lore.kernel.org/r/20260629113827.4074335-3-libaokun@linux.alibaba.com
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260924105125.577714-2-yaojiale02@163.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ext2/file.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 0f047c33e0feb..ca5466fbc79d0 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -251,6 +251,13 @@ static ssize_t ext2_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
int ret2;
iocb->ki_flags &= ~IOCB_DIRECT;
+
+ /*
+ * Prevent concurrent direct I/O and buffered I/O to the same file
+ * range. Wait for in-flight DIO to finish before dirtying pages.
+ */
+ inode_dio_wait(inode);
+
pos = iocb->ki_pos;
status = generic_perform_write(iocb, from);
if (unlikely(status < 0)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0555/1756] mfd: rk8xx: Register poweroff handler in atomic phase
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (553 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0554/1756] ext2: drain in-flight DIO before buffered write fallback Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0556/1756] mfd: intel_quark_i2c_gpio: Manage the fixed-rate clock Greg Kroah-Hartman
` (443 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Anderson, Lee Jones,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Anderson <ejona86@gmail.com>
[ Upstream commit 128115b520c6b61afbffd01809cfc3e8cbb78516 ]
This fixes a regression from v6.1 to v6.6 where Google Veyron devices
(rk3288) would not power off after being shut down.
Prior to commit 4fec8a5a85c4 ("mfd: rk808: Convert to device managed
resources"), pm_power_off was called by legacy_pm_power_off() which
itself was registered using SYS_OFF_MODE_POWER_OFF. But in that commit
the registration of rk808_power_off() moved to
SYS_OFF_MODE_POWER_OFF_PREPARE. At the very least, the code should be
consistent between SYS_OFF_MODE_POWER_OFF and SYS_OFF_MODE_RESTART; both
should be *_PREPARE or both not.
It appears interrupt delivery is already shut down (but not disabled)
when SYS_OFF_MODE_POWER_OFF_PREPARE is triggered, so
regmap_update_bits() in rk808_power_off() does not complete
successfully. Registering rk808_power_off() as SYS_OFF_MODE_POWER_OFF
runs with interrupts disabled which causes polling I/O to be used
instead, and the device to power down.
Fixes: 4fec8a5a85c4 ("mfd: rk808: Convert to device managed resources")
Signed-off-by: Eric Anderson <ejona86@gmail.com>
Assisted-by: Gemini:gemini-3.5-flash
Link: https://patch.msgid.link/20260908-veyron-shutdown-v1-1-066ecb80f5f2@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/rk8xx-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
index 39ab114ea669d..b27d14b8fd868 100644
--- a/drivers/mfd/rk8xx-core.c
+++ b/drivers/mfd/rk8xx-core.c
@@ -788,7 +788,7 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
if (device_property_read_bool(dev, "rockchip,system-power-controller") ||
device_property_read_bool(dev, "system-power-controller")) {
ret = devm_register_sys_off_handler(dev,
- SYS_OFF_MODE_POWER_OFF_PREPARE, SYS_OFF_PRIO_HIGH,
+ SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_HIGH,
&rk808_power_off, rk808);
if (ret)
return dev_err_probe(dev, ret,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0556/1756] mfd: intel_quark_i2c_gpio: Manage the fixed-rate clock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (554 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0555/1756] mfd: rk8xx: Register poweroff handler in atomic phase Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0557/1756] mfd: da9150: Balance IRQ wake on teardown Greg Kroah-Hartman
` (442 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Lee Jones,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit 14a7cf1a3730c7c2393ef5a226e90baf61aa8a9f ]
The I2C clock is allocated by clk_register_fixed_rate(), but cleanup uses
clk_unregister(), leaving the fixed-rate provider allocation behind.
Manage the provider with devm_clk_hw_register_fixed_rate() and its lookup
with devm_clk_hw_register_clkdev(). Managed resources release the lookup
before the provider, after the MFD children have been removed.
Remove the manual clock cleanup and the private structure that only
stored the clock and lookup pointers.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 60ae5b9f5cdd ("mfd: intel_quark_i2c_gpio: Add Intel Quark X1000 I2C-GPIO MFD Driver")
Assisted-by: OpenAI:GPT-5.6
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260912191223.46136-1-mhun512@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/intel_quark_i2c_gpio.c | 52 ++++--------------------------
1 file changed, 6 insertions(+), 46 deletions(-)
diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
index 9b9c76bd067b8..443a1a0cf7778 100644
--- a/drivers/mfd/intel_quark_i2c_gpio.c
+++ b/drivers/mfd/intel_quark_i2c_gpio.c
@@ -35,11 +35,6 @@
/* The Quark I2C controller source clock */
#define INTEL_QUARK_I2C_CLK_HZ 33000000
-struct intel_quark_mfd {
- struct clk *i2c_clk;
- struct clk_lookup *i2c_clk_lookup;
-};
-
static const struct property_entry intel_quark_i2c_controller_standard_properties[] = {
PROPERTY_ENTRY_U32("clock-frequency", I2C_MAX_STANDARD_MODE_FREQ),
{ }
@@ -160,37 +155,12 @@ MODULE_DEVICE_TABLE(pci, intel_quark_mfd_ids);
static int intel_quark_register_i2c_clk(struct device *dev)
{
- struct intel_quark_mfd *quark_mfd = dev_get_drvdata(dev);
- struct clk *i2c_clk;
-
- i2c_clk = clk_register_fixed_rate(dev,
- INTEL_QUARK_I2C_CONTROLLER_CLK, NULL,
- 0, INTEL_QUARK_I2C_CLK_HZ);
- if (IS_ERR(i2c_clk))
- return PTR_ERR(i2c_clk);
-
- quark_mfd->i2c_clk = i2c_clk;
- quark_mfd->i2c_clk_lookup = clkdev_create(i2c_clk, NULL,
- INTEL_QUARK_I2C_CONTROLLER_CLK);
-
- if (!quark_mfd->i2c_clk_lookup) {
- clk_unregister(quark_mfd->i2c_clk);
- dev_err(dev, "Fixed clk register failed\n");
- return -ENOMEM;
- }
-
- return 0;
-}
-
-static void intel_quark_unregister_i2c_clk(struct device *dev)
-{
- struct intel_quark_mfd *quark_mfd = dev_get_drvdata(dev);
-
- if (!quark_mfd->i2c_clk_lookup)
- return;
+ struct clk_hw *hw;
- clkdev_drop(quark_mfd->i2c_clk_lookup);
- clk_unregister(quark_mfd->i2c_clk);
+ hw = devm_clk_hw_register_fixed_rate(dev, INTEL_QUARK_I2C_CONTROLLER_CLK,
+ NULL, 0, INTEL_QUARK_I2C_CLK_HZ);
+ return devm_clk_hw_register_clkdev(dev, hw, NULL,
+ INTEL_QUARK_I2C_CONTROLLER_CLK);
}
static int intel_quark_i2c_setup(struct pci_dev *pdev)
@@ -238,19 +208,12 @@ static int intel_quark_gpio_setup(struct pci_dev *pdev)
static int intel_quark_mfd_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
- struct intel_quark_mfd *quark_mfd;
int ret;
ret = pcim_enable_device(pdev);
if (ret)
return ret;
- quark_mfd = devm_kzalloc(&pdev->dev, sizeof(*quark_mfd), GFP_KERNEL);
- if (!quark_mfd)
- return -ENOMEM;
-
- dev_set_drvdata(&pdev->dev, quark_mfd);
-
ret = intel_quark_register_i2c_clk(&pdev->dev);
if (ret)
return ret;
@@ -260,7 +223,7 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
/* This driver only requires 1 IRQ vector */
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
if (ret < 0)
- goto err_unregister_i2c_clk;
+ return ret;
ret = intel_quark_i2c_setup(pdev);
if (ret)
@@ -282,8 +245,6 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
software_node_unregister_node_group(intel_quark_gpio_node_group);
err_free_irq_vectors:
pci_free_irq_vectors(pdev);
-err_unregister_i2c_clk:
- intel_quark_unregister_i2c_clk(&pdev->dev);
return ret;
}
@@ -292,7 +253,6 @@ static void intel_quark_mfd_remove(struct pci_dev *pdev)
mfd_remove_devices(&pdev->dev);
software_node_unregister_node_group(intel_quark_gpio_node_group);
pci_free_irq_vectors(pdev);
- intel_quark_unregister_i2c_clk(&pdev->dev);
}
static struct pci_driver intel_quark_mfd_driver = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0557/1756] mfd: da9150: Balance IRQ wake on teardown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (555 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0556/1756] mfd: intel_quark_i2c_gpio: Manage the fixed-rate clock Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0558/1756] kconfig: warn about malformed KCONFIG_PROBABILITY values Greg Kroah-Hartman
` (441 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Lee Jones,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit ef464f82f3aecad4071af71074b2ceb77ffbb609 ]
DA9150 enables IRQ wake after registering its regmap IRQ chip, but does not
disable it on a later probe failure or driver removal. This leaves the wake
depth elevated after the handler is removed, and repeated bind attempts can
accumulate the imbalance.
Remember whether enabling IRQ wake succeeded and balance only a successful
call. Remove MFD children first so their nested IRQ users are gone, then
disable wake before removing the regmap IRQ chip. Preserve the existing
non-fatal behavior when IRQ wake cannot be enabled.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: b8fce55c09d3 ("mfd: Add support for DA9150 combined charger & fuel-gauge device")
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260923021936.957065-1-mhun512@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/da9150-core.c | 8 ++++++--
include/linux/mfd/da9150/core.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/da9150-core.c b/drivers/mfd/da9150-core.c
index 5c59cc869fb3e..19325d72a27e7 100644
--- a/drivers/mfd/da9150-core.c
+++ b/drivers/mfd/da9150-core.c
@@ -450,7 +450,7 @@ static int da9150_probe(struct i2c_client *client)
da9150->irq_base = regmap_irq_chip_get_base(da9150->regmap_irq_data);
- enable_irq_wake(da9150->irq);
+ da9150->irq_wake_enabled = !enable_irq_wake(da9150->irq);
ret = mfd_add_devices(da9150->dev, -1, da9150_devs,
ARRAY_SIZE(da9150_devs), NULL,
@@ -463,6 +463,8 @@ static int da9150_probe(struct i2c_client *client)
return 0;
mfd_fail:
+ if (da9150->irq_wake_enabled)
+ disable_irq_wake(da9150->irq);
regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data);
regmap_irq_fail:
i2c_unregister_device(da9150->core_qif);
@@ -474,8 +476,10 @@ static void da9150_remove(struct i2c_client *client)
{
struct da9150 *da9150 = i2c_get_clientdata(client);
- regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data);
mfd_remove_devices(da9150->dev);
+ if (da9150->irq_wake_enabled)
+ disable_irq_wake(da9150->irq);
+ regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data);
i2c_unregister_device(da9150->core_qif);
}
diff --git a/include/linux/mfd/da9150/core.h b/include/linux/mfd/da9150/core.h
index d116d5f3ef561..369698036d1aa 100644
--- a/include/linux/mfd/da9150/core.h
+++ b/include/linux/mfd/da9150/core.h
@@ -65,6 +65,7 @@ struct da9150 {
struct regmap_irq_chip_data *regmap_irq_data;
int irq;
int irq_base;
+ bool irq_wake_enabled;
};
/* Device I/O - Query Interface for FG and standard register access */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0558/1756] kconfig: warn about malformed KCONFIG_PROBABILITY values
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (556 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0557/1756] mfd: da9150: Balance IRQ wake on teardown Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0559/1756] ASoC: fsl_asrc: use regmap_write_bits to update clock source registers Greg Kroah-Hartman
` (440 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitrii Tulnov, Julian Braha,
Nathan Chancellor, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitrii Tulnov <tulnov.dl@gmail.com>
[ Upstream commit 9f01cd3a324390b235c67ae4ca3d35085369ebdd ]
randconfig checks the numeric range of each probability but does not
validate where strtol() stops. For example, KCONFIG_PROBABILITY=50% is
accepted as 50:0:0: the '%' is parsed repeatedly as zero. For the
documented value 50, tristate y/m/n probabilities are 25%/25%/50%.
With 50%, both y/m probabilities silently become zero, reducing the
coverage of random configuration builds. Empty fields and extra fields
are also accepted.
Warn when the value does not follow the documented decimal format. For
malformed inputs whose parsed probabilities are in range, preserve the
existing interpretation unless KCONFIG_WERROR is set. In that case, exit
with an error before writing the configuration. Leading whitespace and
signs are accepted by strtol(), but also trigger the warning because they
are outside the documented format.
Keep the strtol() result as long until the range check. This rejects
out-of-range values that narrowing to int previously made valid, such as
4294967296 becoming zero on a 64-bit host, regardless of KCONFIG_WERROR.
Add regression tests for one warning per malformed input, preserved
configurations, KCONFIG_WERROR, out-of-range values, the supported
probability formats, and the documented empty-value default.
Fixes: e43956e60769 ("kconfig: implement KCONFIG_PROBABILITY for randconfig")
Assisted-by: LLM
Signed-off-by: Dmitrii Tulnov <tulnov.dl@gmail.com>
Tested-by: Julian Braha <julianbraha@gmail.com>
Reviewed-by: Julian Braha <julianbraha@gmail.com>
Link: https://patch.msgid.link/20260918213430.3-1-tulnov.dl@gmail.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/kconfig/conf.c | 16 ++-
scripts/kconfig/tests/conftest.py | 6 +
.../tests/randconfig_probability/Kconfig | 12 ++
.../tests/randconfig_probability/__init__.py | 130 ++++++++++++++++++
4 files changed, 163 insertions(+), 1 deletion(-)
create mode 100644 scripts/kconfig/tests/randconfig_probability/Kconfig
create mode 100644 scripts/kconfig/tests/randconfig_probability/__init__.py
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index efc7ae166c8af..22c95c689faa5 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -186,12 +186,23 @@ static void conf_set_all_new_symbols(enum conf_def_mode mode)
if (mode == def_random) {
int n, p[3];
+ bool warned = false;
char *env = getenv("KCONFIG_PROBABILITY");
n = 0;
while (env && *env) {
char *endp;
- int tmp = strtol(env, &endp, 10);
+ long tmp = strtol(env, &endp, 10);
+
+ if (!isdigit((unsigned char)*env) ||
+ (*endp && *endp != ':') ||
+ (*endp == ':' && (!endp[1] || n == 2))) {
+ if (!warned) {
+ fprintf(stderr,
+ "warning: KCONFIG_PROBABILITY has malformed format\n");
+ warned = true;
+ }
+ }
if (tmp >= 0 && tmp <= 100) {
p[n++] = tmp;
@@ -227,6 +238,9 @@ static void conf_set_all_new_symbols(enum conf_def_mode mode)
perror("KCONFIG_PROBABILITY");
exit(1);
}
+
+ if (warned && getenv("KCONFIG_WERROR"))
+ exit(1);
}
menu_for_each_entry(menu) {
diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
index 2a2a7e2da0608..26f194ed2d400 100644
--- a/scripts/kconfig/tests/conftest.py
+++ b/scripts/kconfig/tests/conftest.py
@@ -293,6 +293,12 @@ class Conf:
return self._matches('stderr', expected)
+@pytest.fixture(autouse=True)
+def clear_werror(monkeypatch):
+ # extra_env can set strict mode, but cannot remove an inherited flag.
+ monkeypatch.delenv('KCONFIG_WERROR', raising=False)
+
+
@pytest.fixture(scope="module")
def conf(request):
"""Create a Conf instance and provide it to test functions."""
diff --git a/scripts/kconfig/tests/randconfig_probability/Kconfig b/scripts/kconfig/tests/randconfig_probability/Kconfig
new file mode 100644
index 0000000000000..84f4e5fcc51e4
--- /dev/null
+++ b/scripts/kconfig/tests/randconfig_probability/Kconfig
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config MODULES
+ bool
+ default y
+ modules
+
+config BOOL
+ bool "Bool"
+
+config TRI
+ tristate "Tristate"
diff --git a/scripts/kconfig/tests/randconfig_probability/__init__.py b/scripts/kconfig/tests/randconfig_probability/__init__.py
new file mode 100644
index 0000000000000..e6e5dda10ad92
--- /dev/null
+++ b/scripts/kconfig/tests/randconfig_probability/__init__.py
@@ -0,0 +1,130 @@
+# SPDX-License-Identifier: GPL-2.0-only
+"""Validate KCONFIG_PROBABILITY without changing the supported distributions."""
+
+
+def test_malformed_warns(conf):
+ probabilities = [
+ 'invalid', ' ', '50%', '50 ', '0x32', '10 20', '10:20x',
+ '10:20:invalid', '10:20:30x',
+ ':50', '50:', '10::20', '10:20:', '10:20:30:', '10:20:30:40',
+ '-0', '+0', '+', '-', '+100:0', ' \t100:0', '0: \t100:0',
+ ]
+ for probability in probabilities:
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': probability,
+ 'KCONFIG_SEED': '0',
+ }) == 0, repr(probability)
+ assert ('warning: KCONFIG_PROBABILITY has malformed format' in
+ conf.stderr), repr(probability)
+ assert conf.stderr.count('warning:') == 1, repr(probability)
+ assert conf.config is not None, repr(probability)
+
+
+def test_malformed_preserves_config(conf):
+ probabilities = [('50%', '50:0:0'), ('-0', '0')]
+ for seed in range(20):
+ for probability, equivalent in probabilities:
+ context = 'probability={!r}, equivalent={!r}, seed={}'.format(
+ probability, equivalent, seed)
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': probability,
+ 'KCONFIG_SEED': hex(seed),
+ }) == 0, context
+ assert ('warning: KCONFIG_PROBABILITY has malformed format' in
+ conf.stderr), context
+ assert conf.stderr.count('warning:') == 1, context
+ malformed = conf.config
+
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': equivalent,
+ 'KCONFIG_SEED': hex(seed),
+ }) == 0, context
+ assert 'warning:' not in conf.stderr, context
+ assert conf.config == malformed, context
+
+
+def test_werror(conf):
+ probabilities = [
+ ('', 0), ('50', 0), ('50%', 1), ('-0', 1), ('10:20:30:40', 1),
+ ]
+ for probability, status in probabilities:
+ for werror in ['', '0', '1']:
+ context = 'probability={!r}, werror={!r}'.format(
+ probability, werror)
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': probability,
+ 'KCONFIG_SEED': '0',
+ 'KCONFIG_WERROR': werror,
+ }) == status, context
+ if status:
+ assert ('warning: KCONFIG_PROBABILITY has malformed format' in
+ conf.stderr), context
+ assert conf.stderr.count('warning:') == 1, context
+ else:
+ assert 'warning:' not in conf.stderr, context
+
+
+def test_out_of_range(conf):
+ probabilities = [
+ '-1', '101', '+101', '0:101', '0:0:101', '60:41', '0:60:41',
+ '4294967296', '-4294967296',
+ '999999999999999999999999', '-999999999999999999999999',
+ ]
+ for probability in probabilities:
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': probability,
+ 'KCONFIG_SEED': '0',
+ }) == 1, repr(probability)
+ assert 'KCONFIG_PROBABILITY:' in conf.stderr, repr(probability)
+
+
+def test_valid(conf):
+ probabilities = [
+ ('0', 'n', 'n'),
+ ('0:0', 'n', 'n'),
+ ('100:0', 'y', 'y'),
+ ('0:100', 'y', 'm'),
+ ('100:0:0', 'y', 'n'),
+ ('0:100:0', 'n', 'y'),
+ ('0:0:100', 'n', 'm'),
+ ('000:000:100', 'n', 'm'),
+ ]
+ for probability, boolean, tristate in probabilities:
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': probability,
+ 'KCONFIG_SEED': '0',
+ }) == 0, repr(probability)
+ assert 'warning:' not in conf.stderr, repr(probability)
+ for symbol, value in [('BOOL', boolean), ('TRI', tristate)]:
+ if value == 'n':
+ expected = '# CONFIG_{} is not set'.format(symbol)
+ else:
+ expected = 'CONFIG_{}={}'.format(symbol, value)
+ assert expected in conf.config.splitlines(), repr(probability)
+
+
+def test_single_probability_matches_tristate_split(conf):
+ for seed in range(20):
+ context = 'seed={}'.format(seed)
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': '50',
+ 'KCONFIG_SEED': hex(seed),
+ }) == 0, context
+ assert 'warning:' not in conf.stderr, context
+ single = conf.config
+
+ # 50% boolean y; 25% tristate y, 25% m, and 50% n.
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': '50:25:25',
+ 'KCONFIG_SEED': hex(seed),
+ }) == 0, context
+ assert 'warning:' not in conf.stderr, context
+ assert conf.config == single, context
+
+
+def test_empty(conf):
+ assert conf._run_conf('--randconfig', extra_env={
+ 'KCONFIG_PROBABILITY': '',
+ 'KCONFIG_SEED': '0',
+ }) == 0
+ assert 'warning:' not in conf.stderr
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0559/1756] ASoC: fsl_asrc: use regmap_write_bits to update clock source registers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (557 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0558/1756] kconfig: warn about malformed KCONFIG_PROBABILITY values Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0560/1756] perf mem: Fix size tracking for mem_lvls in perf_script__meminfo_scnprintf() Greg Kroah-Hartman
` (439 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shengjiu Wang, Chancel Liu,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shengjiu Wang <shengjiu.wang@nxp.com>
[ Upstream commit 92871abc1302b852b88d86114115f8fd6b50b9b9 ]
After a warm reboot the REG_ASRCSR register may not be in its hardware
reset state. regmap caches the register value as 0 (the assumed default),
so when the desired clock source index is also 0, regmap_update_bits()
skips the actual hardware write because it believes the register already
holds the correct value. This leaves a stale clock source in the hardware.
Replace regmap_update_bits() with regmap_write_bits() so that the masked
fields are always written to hardware regardless of the cached value.
Fixes: 3117bb3109dc ("ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260916094043.1496709-1-shengjiu.wang@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/fsl/fsl_asrc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index ffd4a6ca5f3cb..f68b53ba17dd7 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -521,10 +521,10 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate)
ASRCTR_USR(index));
/* Set the input and output clock sources */
- regmap_update_bits(asrc->regmap, REG_ASRCSR,
- ASRCSR_AICSi_MASK(index) | ASRCSR_AOCSi_MASK(index),
- ASRCSR_AICS(index, clk_index[IN]) |
- ASRCSR_AOCS(index, clk_index[OUT]));
+ regmap_write_bits(asrc->regmap, REG_ASRCSR,
+ ASRCSR_AICSi_MASK(index) | ASRCSR_AOCSi_MASK(index),
+ ASRCSR_AICS(index, clk_index[IN]) |
+ ASRCSR_AOCS(index, clk_index[OUT]));
/* Calculate the input clock divisors */
indiv = fsl_asrc_cal_asrck_divisor(pair, div[IN]);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0560/1756] perf mem: Fix size tracking for mem_lvls in perf_script__meminfo_scnprintf()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (558 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0559/1756] ASoC: fsl_asrc: use regmap_write_bits to update clock source registers Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0561/1756] NFS: use TCP for MOUNT when xprtsec= selects TLS Greg Kroah-Hartman
` (438 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dapeng Mi, Ian Rogers, Namhyung Kim,
Leo Yan, Thomas Falcon, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Falcon <thomas.falcon@intel.com>
[ Upstream commit 06d5ce78e4fea2cf0738da903aa248a81101c155 ]
When printing memory info in perf script, the entire size of the
buffer is passed to perf_mem__lvl_scnprintf() instead of the remaining
size. Pass the remaining buffer size instead.
This issue was detected by sashiko during an internal code review.
Fixes: fdefc3750e847a91 ("perf mem: Print memory operation type")
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Cc: Leo Yan <leo.yan@linux.dev>
Assisted-by: Sashiko:gemini-3.1-pro-preview
Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/mem-events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index 9c4adfb45f62b..ad93fdf5a1565 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -591,7 +591,7 @@ int perf_script__meminfo_scnprintf(char *out, size_t sz, const struct mem_info *
i += scnprintf(out, sz, "|OP ");
i += perf_mem__op_scnprintf(out + i, sz - i, mem_info);
i += scnprintf(out + i, sz - i, "|LVL ");
- i += perf_mem__lvl_scnprintf(out + i, sz, mem_info);
+ i += perf_mem__lvl_scnprintf(out + i, sz - i, mem_info);
i += scnprintf(out + i, sz - i, "|SNP ");
i += perf_mem__snp_scnprintf(out + i, sz - i, mem_info);
i += scnprintf(out + i, sz - i, "|TLB ");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0561/1756] NFS: use TCP for MOUNT when xprtsec= selects TLS
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (559 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0560/1756] perf mem: Fix size tracking for mem_lvls in perf_script__meminfo_scnprintf() Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0562/1756] bpf: Adjust bpf_func to account for CFI offset in bpf_jit_free on riscv Greg Kroah-Hartman
` (437 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Prabhakar Pujeri,
Trond Myklebust, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit 72233aabc78cd0415c850641bc2a6e4fea23173f ]
An NFSv2 or NFSv3 text mount that specifies xprtsec= but no
mountproto= crashes in nfs_init_timeout_values():
RIP: 0010:nfs_init_timeout_values+0x10a/0x110 [nfs]
Call Trace:
nfs_mount+0x1c3/0x330 [nfs]
nfs_try_get_tree+0x1e5/0x460 [nfs]
nfs_get_tree+0x64d/0x6d0 [nfs]
vfs_get_tree+0x2b/0xe0
vfs_cmd_create+0x5f/0xd0
vfs_fsconfig_locked+0x50/0x130
__se_sys_fsconfig+0x2f9/0x3a0
nfs_validate_transport_protocol() sets nfs_server.protocol to
XPRT_TRANSPORT_TCP_TLS when xprtsec= is present, but the switch in
nfs_set_mount_transport_protocol() has no case for that value.
mount_server.protocol stays zero, and nfs_init_timeout_values()
calls BUG() on a transport it does not recognize.
mount.nfs always appends mountproto= after probing the server's
rpcbind, so only a caller that bypasses it, such as "mount -i" or a
program that drives fsconfig() directly, reaches the crash.
Select TCP for MOUNT when the NFS transport is XPRT_TRANSPORT_TCP_TLS.
nfs_mount() requests no transport security, so MOUNT already runs
over plain TCP whenever mount.nfs supplies mountproto=tcp.
Fixes: c8407f2e560c ("NFS: Add an "xprtsec=" NFS mount option")
Signed-off-by: Chuck Lever <cel@kernel.org>
Reviewed-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/fs_context.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
index 7e000d782e283..adff895de004c 100644
--- a/fs/nfs/fs_context.c
+++ b/fs/nfs/fs_context.c
@@ -372,6 +372,7 @@ static void nfs_set_mount_transport_protocol(struct nfs_fs_context *ctx)
ctx->mount_server.protocol = XPRT_TRANSPORT_UDP;
break;
case XPRT_TRANSPORT_TCP:
+ case XPRT_TRANSPORT_TCP_TLS:
case XPRT_TRANSPORT_RDMA:
ctx->mount_server.protocol = XPRT_TRANSPORT_TCP;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0562/1756] bpf: Adjust bpf_func to account for CFI offset in bpf_jit_free on riscv
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (560 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0561/1756] NFS: use TCP for MOUNT when xprtsec= selects TLS Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0563/1756] ASoC: fsl_asrc: check the second front-end DMA channel Greg Kroah-Hartman
` (436 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pu Lehui, Alexei Starovoitov,
Björn Töpel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pu Lehui <pulehui@huawei.com>
[ Upstream commit 93df8ae3267f19bf0c1135d26a0e21145dd0ea1c ]
When CFI is enabled, the actual BPF program entry point is shifted
forward by a CFI preamble. During bpf_jit_free(), this shifted pointer
causes the wrong ro_header to be fetched, leading to a potential invalid
memory free.
Fix this by subtracting cfi_get_offset() from prog->bpf_func to
correctly restore the original JITed allocation address before freeing.
Fixes: e63985ecd226 ("bpf, riscv64/cfi: Support kCFI + BPF on riscv64")
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Acked-by: Björn Töpel <bjorn@kernel.org>
Link: https://patch.msgid.link/20260923144216.934701-1-pulehui@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/riscv/net/bpf_jit_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/net/bpf_jit_core.c b/arch/riscv/net/bpf_jit_core.c
index 43cba6b657b72..56921fdf8f52d 100644
--- a/arch/riscv/net/bpf_jit_core.c
+++ b/arch/riscv/net/bpf_jit_core.c
@@ -262,6 +262,7 @@ void bpf_jit_free(struct bpf_prog *prog)
kfree(jit_data->ctx.offset);
kfree(jit_data);
}
+ prog->bpf_func = (void *)prog->bpf_func - cfi_get_offset();
hdr = bpf_jit_binary_pack_hdr(prog);
bpf_jit_binary_pack_free(hdr, NULL);
WARN_ON_ONCE(!bpf_prog_kallsyms_verify_off(prog));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0563/1756] ASoC: fsl_asrc: check the second front-end DMA channel
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (561 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0562/1756] bpf: Adjust bpf_func to account for CFI offset in bpf_jit_free on riscv Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0564/1756] ASoC: adau17x1: return cache sync errors from resume Greg Kroah-Hartman
` (435 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Slavin Liu, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <bolin.liu@seu.edu.cn>
[ Upstream commit b4136c0d69ead737197af741e20edd1c3574f6b4 ]
The temporary Front-End DMA request can fail independently of the
persistent channel acquired earlier in fsl_asrc_dma_hw_params(). The
returned NULL pointer is immediately used to read its private data.
Check the temporary channel and release the previously acquired
persistent Front-End channel on failure. Clear its slot so a later
hw_free cannot release it twice. ASoC marks a component's hw_params
only after success and skips unmarked components during rollback, so
returning an error alone would leak the earlier channel.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: 3117bb3109dc ("ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
Link: https://patch.msgid.link/20260913125147.109920-1-bolin.liu@seu.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/fsl/fsl_asrc_dma.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index c96369da6aec9..aba20404c7d71 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -246,6 +246,11 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
/* Get DMA request of Front-End */
tmp_chan = asrc->get_dma_channel(pair, dir);
+ if (!tmp_chan) {
+ dma_release_channel(pair->dma_chan[!dir]);
+ pair->dma_chan[!dir] = NULL;
+ return -EINVAL;
+ }
tmp_data = tmp_chan->private;
pair->dma_data.dma_request2 = tmp_data->dma_request;
pair->dma_data.peripheral_type = tmp_data->peripheral_type;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0564/1756] ASoC: adau17x1: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (562 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0563/1756] ASoC: fsl_asrc: check the second front-end DMA channel Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0565/1756] ASoC: ak4642: " Greg Kroah-Hartman
` (434 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 8ca84987c11d11e0ba60f202e3199b3b80c87721 ]
adau17x1_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The optional switch-mode callback remains ordered before the cache
replay.
The issue was found by a tool we developed.
Fixes: 4101866c743a ("ASoC: Add ADAU1X61 and ADAU1X81 CODECs common code")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-2-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/adau17x1.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c
index 4dcc984761e0a..4c56dc7522dec 100644
--- a/sound/soc/codecs/adau17x1.c
+++ b/sound/soc/codecs/adau17x1.c
@@ -989,9 +989,7 @@ int adau17x1_resume(struct snd_soc_component *component)
if (adau->switch_mode)
adau->switch_mode(component->dev);
- regcache_sync(adau->regmap);
-
- return 0;
+ return regcache_sync(adau->regmap);
}
EXPORT_SYMBOL_GPL(adau17x1_resume);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0565/1756] ASoC: ak4642: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (563 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0564/1756] ASoC: adau17x1: return cache sync errors from resume Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0566/1756] ASoC: es8316: " Greg Kroah-Hartman
` (433 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 7142c34ed92fddca7038787b8695d22c661dc6ec ]
ak4642_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: a3a83d9a7cb0 ("ASoC: Add ak4642/ak4643 codec support")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-3-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/ak4642.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index fe035d2fc9131..08846bd7f80a9 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -533,8 +533,7 @@ static int ak4642_resume(struct snd_soc_component *component)
struct regmap *regmap = dev_get_regmap(component->dev, NULL);
regcache_cache_only(regmap, false);
- regcache_sync(regmap);
- return 0;
+ return regcache_sync(regmap);
}
static int ak4642_probe(struct snd_soc_component *component)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0566/1756] ASoC: es8316: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (564 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0565/1756] ASoC: ak4642: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0567/1756] ASoC: nau8540: " Greg Kroah-Hartman
` (432 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 243d0c47e57a6af89d95aa451ef5fbf453983b1c ]
es8316_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: 4bac47a7b2f9 ("ASoC: codecs: add suspend and resume for ES8316")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-4-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/es8316.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index f508df01145bf..da02716a89401 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -808,9 +808,7 @@ static int es8316_resume(struct snd_soc_component *component)
struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component);
regcache_cache_only(es8316->regmap, false);
- regcache_sync(es8316->regmap);
-
- return 0;
+ return regcache_sync(es8316->regmap);
}
static int es8316_suspend(struct snd_soc_component *component)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0567/1756] ASoC: nau8540: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (565 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0566/1756] ASoC: es8316: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0568/1756] ASoC: rt1011: " Greg Kroah-Hartman
` (431 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 0bf2b3411537e8e4d9c03702646a9fc87198d4b1 ]
nau8540_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: c1644e3de45d ("ASoC: nau8540: new codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-6-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/nau8540.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/nau8540.c b/sound/soc/codecs/nau8540.c
index 7e59448e7ac63..8d878b573f5e1 100644
--- a/sound/soc/codecs/nau8540.c
+++ b/sound/soc/codecs/nau8540.c
@@ -897,9 +897,7 @@ static int __maybe_unused nau8540_resume(struct snd_soc_component *component)
struct nau8540 *nau8540 = snd_soc_component_get_drvdata(component);
regcache_cache_only(nau8540->regmap, false);
- regcache_sync(nau8540->regmap);
-
- return 0;
+ return regcache_sync(nau8540->regmap);
}
static const struct snd_soc_component_driver nau8540_component_driver = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0568/1756] ASoC: rt1011: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (566 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0567/1756] ASoC: nau8540: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0569/1756] ASoC: rt1016: " Greg Kroah-Hartman
` (430 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 432734a00bfae17baeff1a83b61bfc9c2ab20c12 ]
rt1011_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: d6e65bb7ff0d ("ASoC: rt1011: Add RT1011 amplifier driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-7-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1011.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt1011.c b/sound/soc/codecs/rt1011.c
index a0e75b03e9dc9..24aee0eaff810 100644
--- a/sound/soc/codecs/rt1011.c
+++ b/sound/soc/codecs/rt1011.c
@@ -2099,9 +2099,7 @@ static int rt1011_resume(struct snd_soc_component *component)
struct rt1011_priv *rt1011 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1011->regmap, false);
- regcache_sync(rt1011->regmap);
-
- return 0;
+ return regcache_sync(rt1011->regmap);
}
#else
#define rt1011_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0569/1756] ASoC: rt1016: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (567 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0568/1756] ASoC: rt1011: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0570/1756] ASoC: rt1305: " Greg Kroah-Hartman
` (429 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 98ace05793c7b80a9f49d92b78fcc88e0970f8e4 ]
rt1016_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: 79a4b670b4b4 ("ASoC: rt1016: Add the rt1016 support")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-8-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1016.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt1016.c b/sound/soc/codecs/rt1016.c
index fed4da23cba23..587c12b154a97 100644
--- a/sound/soc/codecs/rt1016.c
+++ b/sound/soc/codecs/rt1016.c
@@ -570,9 +570,7 @@ static int rt1016_resume(struct snd_soc_component *component)
struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1016->regmap, false);
- regcache_sync(rt1016->regmap);
-
- return 0;
+ return regcache_sync(rt1016->regmap);
}
#else
#define rt1016_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0570/1756] ASoC: rt1305: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (568 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0569/1756] ASoC: rt1016: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0571/1756] ASoC: rt1308: " Greg Kroah-Hartman
` (428 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 30858325aa90380c6bcdde605214f1ebdbec568c ]
rt1305_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: 29bc643ddd7e ("ASoC: rt1305: Add RT1305/RT1306 amplifier driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-9-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1305.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt1305.c b/sound/soc/codecs/rt1305.c
index c2b55be8d1653..b786d4eeca7a8 100644
--- a/sound/soc/codecs/rt1305.c
+++ b/sound/soc/codecs/rt1305.c
@@ -896,9 +896,7 @@ static int rt1305_resume(struct snd_soc_component *component)
struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1305->regmap, false);
- regcache_sync(rt1305->regmap);
-
- return 0;
+ return regcache_sync(rt1305->regmap);
}
#else
#define rt1305_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0571/1756] ASoC: rt1308: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (569 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0570/1756] ASoC: rt1305: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0572/1756] ASoC: rt1318: " Greg Kroah-Hartman
` (427 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 3db3289178b94056753f7a8c6ee4ab4b232ee6a5 ]
rt1308_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: 2b9def8c0d92 ("ASoC: rt1308: Add RT1308 amplifier driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-10-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1308.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt1308.c b/sound/soc/codecs/rt1308.c
index b366338cea711..a7c21cb95778b 100644
--- a/sound/soc/codecs/rt1308.c
+++ b/sound/soc/codecs/rt1308.c
@@ -715,9 +715,7 @@ static int rt1308_resume(struct snd_soc_component *component)
struct rt1308_priv *rt1308 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1308->regmap, false);
- regcache_sync(rt1308->regmap);
-
- return 0;
+ return regcache_sync(rt1308->regmap);
}
#else
#define rt1308_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0572/1756] ASoC: rt1318: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (570 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0571/1756] ASoC: rt1308: " Greg Kroah-Hartman
@ 2026-11-18 14:44 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0573/1756] ASoC: rt5616: " Greg Kroah-Hartman
` (426 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:44 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit a5735b341c6e8cff5f5f9480295012a5ceebb665 ]
rt1318_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: fe1ff61487ac ("ASoC: rt1318: Add RT1318 audio amplifier driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-11-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt1318.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt1318.c b/sound/soc/codecs/rt1318.c
index e12b1e96a53a5..0e8c149628bb7 100644
--- a/sound/soc/codecs/rt1318.c
+++ b/sound/soc/codecs/rt1318.c
@@ -1076,8 +1076,7 @@ static int rt1318_resume(struct snd_soc_component *component)
struct rt1318_priv *rt1318 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt1318->regmap, false);
- regcache_sync(rt1318->regmap);
- return 0;
+ return regcache_sync(rt1318->regmap);
}
#else
#define rt1318_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0573/1756] ASoC: rt5616: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (571 preceding siblings ...)
2026-11-18 14:44 ` [PATCH 6.12 0572/1756] ASoC: rt1318: " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0574/1756] ASoC: rt5659: " Greg Kroah-Hartman
` (425 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 8fc9d353d5371a946d9a9952278b96c09070374c ]
rt5616_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: b1d15059957d ("ASoC: rt5616: add rt5616 codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-12-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5616.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c
index 34461c4620092..39179fc75c981 100644
--- a/sound/soc/codecs/rt5616.c
+++ b/sound/soc/codecs/rt5616.c
@@ -1247,8 +1247,7 @@ static int rt5616_resume(struct snd_soc_component *component)
struct rt5616_priv *rt5616 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt5616->regmap, false);
- regcache_sync(rt5616->regmap);
- return 0;
+ return regcache_sync(rt5616->regmap);
}
#else
#define rt5616_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0574/1756] ASoC: rt5659: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (572 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0573/1756] ASoC: rt5616: " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0575/1756] ASoC: rt5660: " Greg Kroah-Hartman
` (424 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 3a9b5bce85a1baff95463a2bb021efac64bcf83f ]
rt5659_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: d3cb2de2479b ("ASoC: rt5659: add rt5659 codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-13-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5659.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index a2652fa6e1d74..d2944a43c205a 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -3704,9 +3704,7 @@ static int rt5659_resume(struct snd_soc_component *component)
struct rt5659_priv *rt5659 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt5659->regmap, false);
- regcache_sync(rt5659->regmap);
-
- return 0;
+ return regcache_sync(rt5659->regmap);
}
#else
#define rt5659_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0575/1756] ASoC: rt5660: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (573 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0574/1756] ASoC: rt5659: " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0576/1756] ASoC: rt5665: " Greg Kroah-Hartman
` (423 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 70fe8997b03078ff8253d985a161fef310f7c346 ]
rt5660_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The power-off resume delay remains ordered before the cache replay.
The issue was found by a tool we developed.
Fixes: 2b26dd4c1fc5 ("ASoC: rt5660: add rt5660 codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-14-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5660.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c
index 3ac41d2c279bd..cafc9615f3039 100644
--- a/sound/soc/codecs/rt5660.c
+++ b/sound/soc/codecs/rt5660.c
@@ -1147,9 +1147,7 @@ static int rt5660_resume(struct snd_soc_component *component)
msleep(350);
regcache_cache_only(rt5660->regmap, false);
- regcache_sync(rt5660->regmap);
-
- return 0;
+ return regcache_sync(rt5660->regmap);
}
#else
#define rt5660_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0576/1756] ASoC: rt5665: return cache sync errors from resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (574 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0575/1756] ASoC: rt5660: " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0577/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors Greg Kroah-Hartman
` (422 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 9f2933d9a437302d5ae32eb9022efef049d8ab22 ]
rt5665_resume() restores cached registers during component resume but
discards the regcache_sync() result and returns success. A failed replay
can therefore leave the hardware register state stale without reaching
the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper
reports a negative callback result and retains the established
best-effort resume state, so this adds observability without introducing
rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
Fixes: 33ada14a26c8 ("ASoC: add rt5665 codec driver")
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260902013256.93072-15-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5665.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c
index 4f0236b34a2d9..2f9b1c305cf0a 100644
--- a/sound/soc/codecs/rt5665.c
+++ b/sound/soc/codecs/rt5665.c
@@ -4485,9 +4485,7 @@ static int rt5665_resume(struct snd_soc_component *component)
struct rt5665_priv *rt5665 = snd_soc_component_get_drvdata(component);
regcache_cache_only(rt5665->regmap, false);
- regcache_sync(rt5665->regmap);
-
- return 0;
+ return regcache_sync(rt5665->regmap);
}
#else
#define rt5665_suspend NULL
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0577/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (575 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0576/1756] ASoC: rt5665: " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0578/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors Greg Kroah-Hartman
` (421 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit a2c3ee3349a7da91e563b9a21a355a28fa754bc7 ]
Clock enable errors are currently ignored when enabling the APLL
and tuner clocks.
Check the return values and roll back the APLL clock if the tuner
clock fails to enable.
Fixes: f6b026479b13 ("ASoC: mediatek: mt8188: support audio clock control")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260907120310.135693-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
index 7f411b8577823..b41069b752a94 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
@@ -260,15 +260,28 @@ static int mt8188_afe_enable_tuner_clk(struct mtk_base_afe *afe,
unsigned int id)
{
struct mt8188_afe_private *afe_priv = afe->platform_priv;
+ int ret;
switch (id) {
case MT8188_AUD_PLL1:
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL]);
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL1_TUNER]);
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL]);
+ if (ret)
+ return ret;
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL1_TUNER]);
+ if (ret) {
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL]);
+ return ret;
+ }
break;
case MT8188_AUD_PLL2:
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2]);
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2_TUNER]);
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2]);
+ if (ret)
+ return ret;
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2_TUNER]);
+ if (ret) {
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2]);
+ return ret;
+ }
break;
default:
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0578/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (576 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0577/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0579/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors Greg Kroah-Hartman
` (420 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 60a8112a088aee38d728457a14fa8bfb50f4c87e ]
The return values from regmap_update_bits() are currently ignored
by the clock and AFE control functions.
Propagate the errors to allow callers to handle regmap update
failures.
Fixes: f6b026479b13 ("ASoC: mediatek: mt8188: support audio clock control")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260907120310.135693-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
index b41069b752a94..516b9b4ee0339 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
@@ -574,9 +574,7 @@ static int mt8188_afe_enable_top_cg(struct mtk_base_afe *afe, unsigned int cg_ty
unsigned int mask = get_top_cg_mask(cg_type);
unsigned int val = get_top_cg_on_val(cg_type);
- regmap_update_bits(afe->regmap, reg, mask, val);
-
- return 0;
+ return regmap_update_bits(afe->regmap, reg, mask, val);
}
static int mt8188_afe_disable_top_cg(struct mtk_base_afe *afe, unsigned int cg_type)
@@ -585,9 +583,7 @@ static int mt8188_afe_disable_top_cg(struct mtk_base_afe *afe, unsigned int cg_t
unsigned int mask = get_top_cg_mask(cg_type);
unsigned int val = get_top_cg_off_val(cg_type);
- regmap_update_bits(afe->regmap, reg, mask, val);
-
- return 0;
+ return regmap_update_bits(afe->regmap, reg, mask, val);
}
int mt8188_afe_enable_reg_rw_clk(struct mtk_base_afe *afe)
@@ -627,14 +623,12 @@ int mt8188_afe_disable_reg_rw_clk(struct mtk_base_afe *afe)
static int mt8188_afe_enable_afe_on(struct mtk_base_afe *afe)
{
- regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x1);
- return 0;
+ return regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x1);
}
static int mt8188_afe_disable_afe_on(struct mtk_base_afe *afe)
{
- regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x0);
- return 0;
+ return regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x0);
}
static int mt8188_afe_enable_a1sys(struct mtk_base_afe *afe)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0579/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (577 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0578/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0580/1756] ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors Greg Kroah-Hartman
` (419 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 1b65c13d1af99170e2a855ca9212a03daa3e7f04 ]
Clock enable errors are currently ignored by several AFE clock
control functions.
Check the return values and roll back previously enabled clocks when
a subsequent clock enable fails.
Fixes: f6b026479b13 ("ASoC: mediatek: mt8188: support audio clock control")
Fixes: 9be0213a6858 ("ASoC: mediatek: mt8188: refine APLL control")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260907120310.135693-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 69 ++++++++++++++++++----
1 file changed, 58 insertions(+), 11 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
index 516b9b4ee0339..94f21cb15d23e 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
@@ -589,22 +589,47 @@ static int mt8188_afe_disable_top_cg(struct mtk_base_afe *afe, unsigned int cg_t
int mt8188_afe_enable_reg_rw_clk(struct mtk_base_afe *afe)
{
struct mt8188_afe_private *afe_priv = afe->platform_priv;
-
+ int ret;
/* bus clock for AFE external access, like DRAM */
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_TOP_AUDIO_LOCAL_BUS_SEL]);
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_TOP_AUDIO_LOCAL_BUS_SEL]);
+ if (ret)
+ goto err_local_bus;
/* bus clock for AFE internal access, like AFE SRAM */
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_TOP_AUD_INTBUS_SEL]);
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_TOP_AUD_INTBUS_SEL]);
+ if (ret)
+ goto err_intbus;
/* audio 26m clock source */
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_ADSP_AUDIO_26M]);
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_ADSP_AUDIO_26M]);
+ if (ret)
+ goto err_26m;
/* AFE hw clock */
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_AFE]);
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS_HP]);
- mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS]);
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_AFE]);
+ if (ret)
+ goto err_afe;
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS_HP]);
+ if (ret)
+ goto err_a1sys_hp;
+ ret = mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS]);
+ if (ret)
+ goto err_a1sys;
return 0;
+
+err_a1sys:
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS_HP]);
+err_a1sys_hp:
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_AFE]);
+err_afe:
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_ADSP_AUDIO_26M]);
+err_26m:
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_TOP_AUD_INTBUS_SEL]);
+err_intbus:
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_TOP_AUDIO_LOCAL_BUS_SEL]);
+err_local_bus:
+ return ret;
}
int mt8188_afe_disable_reg_rw_clk(struct mtk_base_afe *afe)
@@ -640,7 +665,13 @@ static int mt8188_afe_enable_a1sys(struct mtk_base_afe *afe)
if (ret)
return ret;
- return mt8188_afe_enable_top_cg(afe, MT8188_TOP_CG_A1SYS_TIMING);
+ ret = mt8188_afe_enable_top_cg(afe, MT8188_TOP_CG_A1SYS_TIMING);
+ if (ret) {
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A1SYS]);
+ return ret;
+ }
+
+ return 0;
}
static int mt8188_afe_disable_a1sys(struct mtk_base_afe *afe)
@@ -661,7 +692,13 @@ static int mt8188_afe_enable_a2sys(struct mtk_base_afe *afe)
if (ret)
return ret;
- return mt8188_afe_enable_top_cg(afe, MT8188_TOP_CG_A2SYS_TIMING);
+ ret = mt8188_afe_enable_top_cg(afe, MT8188_TOP_CG_A2SYS_TIMING);
+ if (ret) {
+ mt8188_afe_disable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_A2SYS]);
+ return ret;
+ }
+
+ return 0;
}
static int mt8188_afe_disable_a2sys(struct mtk_base_afe *afe)
@@ -749,8 +786,18 @@ int mt8188_apll2_disable(struct mtk_base_afe *afe)
int mt8188_afe_enable_main_clock(struct mtk_base_afe *afe)
{
- mt8188_afe_enable_top_cg(afe, MT8188_TOP_CG_26M_TIMING);
- mt8188_afe_enable_afe_on(afe);
+ int ret;
+
+ ret = mt8188_afe_enable_top_cg(afe, MT8188_TOP_CG_26M_TIMING);
+ if (ret)
+ return ret;
+
+ ret = mt8188_afe_enable_afe_on(afe);
+ if (ret) {
+ mt8188_afe_disable_top_cg(afe, MT8188_TOP_CG_26M_TIMING);
+ return ret;
+ }
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0580/1756] ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (578 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0579/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0581/1756] iio: accel: bma220: publish the SPI driver ACPI alias Greg Kroah-Hartman
` (418 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
AngeloGioacchino Del Regno, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit f5f6941d92972ba66829a99999fa825e63da5162 ]
Errors from clock enable and regcache synchronization are currently
ignored during runtime resume.
Check the return values from mt8188_afe_enable_reg_rw_clk(),
regcache_sync(), and mt8188_afe_enable_main_clock(), and abort the
runtime resume if any of them fails.
On failure, disable the previously enabled reg_rw clocks and restore
the regmap to cache-only mode.
Fixes: bf106bf09376 ("ASoC: mediatek: mt8188: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260907120310.135693-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
index d36520c6272dd..884a4656c6f11 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
@@ -3009,22 +3009,33 @@ static int mt8188_afe_runtime_resume(struct device *dev)
struct mtk_base_afe *afe = dev_get_drvdata(dev);
struct mt8188_afe_private *afe_priv = afe->platform_priv;
struct arm_smccc_res res;
+ int ret;
arm_smccc_smc(MTK_SIP_AUDIO_CONTROL,
MTK_AUDIO_SMC_OP_DOMAIN_SIDEBANDS,
0, 0, 0, 0, 0, 0, &res);
- mt8188_afe_enable_reg_rw_clk(afe);
+ ret = mt8188_afe_enable_reg_rw_clk(afe);
+ if (ret)
+ return ret;
if (!afe->regmap || afe_priv->pm_runtime_bypass_reg_ctl)
- goto skip_regmap;
+ return 0;
regcache_cache_only(afe->regmap, false);
- regcache_sync(afe->regmap);
+ ret = regcache_sync(afe->regmap);
+ if (ret)
+ goto err;
+
+ ret = mt8188_afe_enable_main_clock(afe);
+ if (ret)
+ goto err;
- mt8188_afe_enable_main_clock(afe);
-skip_regmap:
return 0;
+err:
+ mt8188_afe_disable_reg_rw_clk(afe);
+ regcache_cache_only(afe->regmap, true);
+ return ret;
}
static int init_memif_priv_data(struct mtk_base_afe *afe)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0581/1756] iio: accel: bma220: publish the SPI driver ACPI alias
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (579 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0580/1756] ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0582/1756] dt-bindings: arm: mediatek: Fix MT6779 audsys compatible Greg Kroah-Hartman
` (417 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Jonathan Cameron,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit cdc7d3dd101251a6373332726b8d6fad35e83b8a ]
The SPI driver advertises an ACPI match for BMA0220 but does not export
that table. A modular build therefore lacks the ACPI alias used to load
the driver when the device is enumerated through ACPI.
Export the ACPI table. Move the existing SPI export next to its SPI ID
table so each export is adjacent to the table it describes.
The issue was found by our static-analysis tool.
Fixes: bf2a5600a3eb ("iio: accel: Add support for Bosch BMA220")
Assisted-by: LLM
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/accel/bma220_spi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c
index fcbd695e46549..e6d1e91ed62c1 100644
--- a/drivers/iio/accel/bma220_spi.c
+++ b/drivers/iio/accel/bma220_spi.c
@@ -308,12 +308,13 @@ static const struct spi_device_id bma220_spi_id[] = {
{"bma220", 0},
{}
};
+MODULE_DEVICE_TABLE(spi, bma220_spi_id);
static const struct acpi_device_id bma220_acpi_id[] = {
{"BMA0220", 0},
{}
};
-MODULE_DEVICE_TABLE(spi, bma220_spi_id);
+MODULE_DEVICE_TABLE(acpi, bma220_acpi_id);
static struct spi_driver bma220_driver = {
.driver = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0582/1756] dt-bindings: arm: mediatek: Fix MT6779 audsys compatible
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (580 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0581/1756] iio: accel: bma220: publish the SPI driver ACPI alias Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0583/1756] powerpc/ftrace: Dont restore r13 during ftrace_regs_caller Greg Kroah-Hartman
` (416 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AngeloGioacchino Del Regno,
Rob Herring (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring (Arm) <robh@kernel.org>
[ Upstream commit 034b3b1ce25a62222920e2bb3b6a0c7ef160b108 ]
The correct name for the MediaTek MT6779 audsys compatible is
"mediatek,mt6779-audio", not "mediatek,mt6779-audsys". The original .txt
binding was correct.
Fixes: e97c618234d9 ("dt-bindings: arm: mediatek: convert audsys and mt2701-afe-pcm to yaml")
Assisted-by: LLM
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260921232819.3137721-1-robh@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../devicetree/bindings/arm/mediatek/mediatek,audsys.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml
index 45d4a6620041b..c2d263475c363 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml
@@ -19,7 +19,7 @@ properties:
- enum:
- mediatek,mt2701-audsys
- mediatek,mt6765-audsys
- - mediatek,mt6779-audsys
+ - mediatek,mt6779-audio
- mediatek,mt7622-audsys
- mediatek,mt8167-audsys
- mediatek,mt8173-audsys
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0583/1756] powerpc/ftrace: Dont restore r13 during ftrace_regs_caller
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (581 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0582/1756] dt-bindings: arm: mediatek: Fix MT6779 audsys compatible Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0584/1756] arm64: dts: qcom: x1e80100-yoga-slim7x: Mark the EC reset gpio as reserved Greg Kroah-Hartman
` (415 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Suchánek,
Christophe Leroy (CS GROUP), Hari Bathini, Shrikanth Hegde,
Samir Mulani, Madhavan Srinivasan, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shrikanth Hegde <sshegde@linux.ibm.com>
[ Upstream commit af5f0870883ae4aea7f668d06cbb7ad0e12824c8 ]
Michal reported a stack-protector failure and subsequent panic when
running kernel builds. This was observed with full/lazy preemption.
Initially it was suspected as KVM, but later turned out to be due
to a bcc tool running in parallel.
Issue was recreated using a bcc tool.
For example, running below in parallel leads to crash.
./funccount sched* -d 100 and make -j 64
The same crash was observed when running kprobe for schedule() function,
while simpler function tracer for schedule() didn't cause the crash.
This helped to narrow it down to ftrace backed kprobes area.
The crash occurs as follows:
ftrace_regs_caller entry on CPU A
|
+-> save r13 = CPU A PACA into pt_regs
|
+-> call kprobe_ftrace_handler()
|
+-> ftrace_test_recursion_unlock()
|
+-> preempt_enable
+-> task can schedule and migrate to CPU B
+-> task resumes with live r13 = CPU B PACA
|
+-> REST_GPRS(2, 31)
|
+-> restore saved r13 = CPU A PACA
|
|-> The task then continues running on CPU B with r13 pointing
| to CPU A's PACA.
The stack-protector canary is accessed through the PACA. After the task
migrates, CPU A may run a different task and update its PACA with that
task's canary. Restoring the saved r13 then causes the migrated task's
saved stack canary to be compared against the canary in CPU A's PACA,
resulting in a stack-protector failure.
Similarly, current is resolved through the PACA. With a stale r13,
preempt_count() can access the state of the task referenced by CPU A's
PACA instead of the task running on CPU B. This results in corrupted
preempt-count warnings and scheduling-while-atomic failures.
This path for example is called when using kprobes and parallel kernel
builds can cause preemptions during ftrace_test_recursion_unlock.
Do not restore r13 from the saved register frame. If the task did not
migrate, the live r13 already has the saved value. If it migrated, the
live r13 contains the correct PACA pointer for the CPU on which the task
resumed.
On PPC32, r13 is regular register. So do this fix only for PPC64
Fixes: 153086644fd1 ("powerpc/ftrace: Add support for -mprofile-kernel ftrace ABI")
Reported-by: Michal Suchánek <msuchanek@suse.de>
Closes: https://lore.kernel.org/all/aqKfsVArHHaIK6M9@kunlun.suse.cz/
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Tested-by: Samir Mulani <samir@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260921072151.35531-1-sshegde@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/kernel/trace/ftrace_entry.S | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/kernel/trace/ftrace_entry.S b/arch/powerpc/kernel/trace/ftrace_entry.S
index 76dbe9fd2c0f2..e662b2c9ed257 100644
--- a/arch/powerpc/kernel/trace/ftrace_entry.S
+++ b/arch/powerpc/kernel/trace/ftrace_entry.S
@@ -129,7 +129,13 @@
/* Restore gprs */
.if \allregs == 1
+#ifdef CONFIG_PPC64
+ REST_GPRS(2, 12, r1)
+ /* Do not restore a stale PACA pointer if the task migrated */
+ REST_GPRS(14, 31, r1)
+#else
REST_GPRS(2, 31, r1)
+#endif
.else
REST_GPRS(3, 10, r1)
#ifdef CONFIG_LIVEPATCH_64
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0584/1756] arm64: dts: qcom: x1e80100-yoga-slim7x: Mark the EC reset gpio as reserved
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (582 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0583/1756] powerpc/ftrace: Dont restore r13 during ftrace_regs_caller Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0585/1756] arm64: dts: qcom: x1e80100-qcp: " Greg Kroah-Hartman
` (414 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abel Vesa, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit a92ac66d35dfd8438b6e40bfb956ff69365798ac ]
GPIO 65 from TLMM is used by the embedded controller as its reset line.
On some devices, toggling the embedded controller reset line makes the
device not power up at all, unless the battery is unplugged.
So reserve it in order to prevent Linux from requesting or
reconfiguring it.
Fixes: 45247fe17db2 ("arm64: dts: qcom: x1e80100: add Lenovo Thinkpad Yoga slim 7x devicetree")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-dts-qcom-hamoa-reserve-ec-reset-gpio-v3-6-fde7f8a53382@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts b/arch/arm64/boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts
index 07c2fdfe7ce13..cdd3f7b09e223 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts
@@ -795,6 +795,7 @@ right_tweeter: speaker@0,1 {
&tlmm {
gpio-reserved-ranges = <34 2>, /* Unused */
<44 4>, /* SPI (TPM) */
+ <65 1>, /* EC reset */
<238 1>; /* UFS Reset */
edp_reg_en: edp-reg-en-state {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0585/1756] arm64: dts: qcom: x1e80100-qcp: Mark the EC reset gpio as reserved
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (583 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0584/1756] arm64: dts: qcom: x1e80100-yoga-slim7x: Mark the EC reset gpio as reserved Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0586/1756] dt-bindings: vendor-prefixes: Add General Mobile Greg Kroah-Hartman
` (413 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abel Vesa, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit fd7d7b5d307f3a475e9555dfd89ff80cfae46b3c ]
GPIO 65 from TLMM is used by the embedded controller as its reset line.
On some devices, toggling the embedded controller reset line makes the
device not power up at all, unless the battery is unplugged.
So reserve it in order to prevent Linux from requesting or
reconfiguring it.
Fixes: af16b00578a7 ("arm64: dts: qcom: Add base X1E80100 dtsi and the QCP dts")
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-dts-qcom-hamoa-reserve-ec-reset-gpio-v3-8-fde7f8a53382@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
index 9062eb6766f2c..8a9ddc2817e4e 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
@@ -812,6 +812,7 @@ wcd_tx: codec@0,3 {
&tlmm {
gpio-reserved-ranges = <33 3>, /* Unused */
<44 4>, /* SPI (TPM) */
+ <65 1>, /* EC reset */
<238 1>; /* UFS Reset */
edp_reg_en: edp-reg-en-state {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0586/1756] dt-bindings: vendor-prefixes: Add General Mobile
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (584 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0585/1756] arm64: dts: qcom: x1e80100-qcp: " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0587/1756] perf c2c: Fix documented default coalesce fields Greg Kroah-Hartman
` (412 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Muzaffer Kadir,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muzaffer Kadir <muzafferkadir@mainlining.org>
[ Upstream commit 7034bec693b752bcd7ebb4fa00dc3b429b4dc4f7 ]
Add vendor prefix for General Mobile.
Link: https://www.generalmobile.com
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Muzaffer Kadir <muzafferkadir@mainlining.org>
Link: https://patch.msgid.link/20260921-msm8952-initial-support-v3-6-b96fd3fe298b@mainlining.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 600b42d555eb5..442eb7e493088 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -569,6 +569,8 @@ patternProperties:
description: Gemei Digital Technology Co., Ltd.
"^gemtek,.*":
description: Gemtek Technology Co., Ltd.
+ "^generalmobile,.*":
+ description: General Mobile Fzc.
"^genesys,.*":
description: Genesys Logic, Inc.
"^geniatech,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0587/1756] perf c2c: Fix documented default coalesce fields
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (585 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0586/1756] dt-bindings: vendor-prefixes: Add General Mobile Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0588/1756] mtd: block: prevent reclaim I/O during request processing Greg Kroah-Hartman
` (411 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tianyou Li, Wangyang Guo, Jiebin Sun,
Namhyung Kim, Dapeng Mi, Ian Rogers, James Clark, Jiri Olsa,
Thomas Falcon, Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiebin Sun <jiebin.sun@intel.com>
[ Upstream commit b36a6f180baad35a962677ae181681ca60dda35b ]
The default coalesce fields dropped pid in favor of iaddr, but the man
page still documents the old pid,iaddr default. Update it to match the
command.
Fixes: 423701a0c8d754d9 ("perf c2c: Change the default coalesce setup")
Reviewed-by: Tianyou Li <tianyou.li@intel.com>
Reviewed-by: Wangyang Guo <wangyang.guo@intel.com>
Signed-off-by: Jiebin Sun <jiebin.sun@intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/Documentation/perf-c2c.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
index 856f0dfb8e5a3..d744b43769a0b 100644
--- a/tools/perf/Documentation/perf-c2c.txt
+++ b/tools/perf/Documentation/perf-c2c.txt
@@ -304,7 +304,7 @@ output fields set for cacheline offsets output:
Code address, Code symbol, Shared Object, Source line
dso - coalesced by shared object
-By default the coalescing is setup with 'pid,iaddr'.
+By default, coalescing uses `iaddr`.
STDIO OUTPUT
------------
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0588/1756] mtd: block: prevent reclaim I/O during request processing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (586 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0587/1756] perf c2c: Fix documented default coalesce fields Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0589/1756] wifi: ath11k: fix reg_info_store leak in ath11k_service_ready_ext_event() Greg Kroah-Hartman
` (410 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+e08e0a15269eefa87790,
Qingfang Deng, Miquel Raynal, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qingfang Deng <qingfang.deng@linux.dev>
[ Upstream commit d498b2ddda99eed28cde177b1620dbcea246a1c4 ]
The blktrans request callbacks run under dev->lock and may allocate
memory with GFP_KERNEL. For example, mtdblock_writesect() uses vmalloc()
to allocate its eraseblock cache. Direct reclaim can then recurse into
block I/O and deadlock on resources held by the request being processed.
syzbot reports a circular locking dependency involving the device mutex
and fs_reclaim.
Commit d5ba1c8ffd0b ("mtd: don't use PF_MEMALLOC") removed PF_MEMALLOC
from the MTD request thread. That flag had prevented direct reclaim,
so its removal made allocations during request processing eligible for
reclaim without excluding I/O.
Wrap request processing in mtd_queue_rq() in a NOIO scope. This covers
both the request and background callbacks, including allocations made
by lower MTD drivers, and prevents reclaim from initiating filesystem
or block I/O.
Fixes: d5ba1c8ffd0b ("mtd: don't use PF_MEMALLOC")
Assisted-by: Codex:gpt-6-astra
Reported-by: syzbot+e08e0a15269eefa87790@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=e08e0a15269eefa87790
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/mtd_blkdevs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index ee7e1d9089861..25c930f20ee61 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -18,6 +18,7 @@
#include <linux/spinlock.h>
#include <linux/hdreg.h>
#include <linux/mutex.h>
+#include <linux/sched/mm.h>
#include <linux/uaccess.h>
#include "mtdcore.h"
@@ -167,6 +168,7 @@ static blk_status_t mtd_queue_rq(struct blk_mq_hw_ctx *hctx,
const struct blk_mq_queue_data *bd)
{
struct mtd_blktrans_dev *dev;
+ unsigned int noio_flags;
dev = hctx->queue->queuedata;
if (!dev) {
@@ -174,10 +176,13 @@ static blk_status_t mtd_queue_rq(struct blk_mq_hw_ctx *hctx,
return BLK_STS_IOERR;
}
+ /* Reclaim must not recurse into I/O while processing requests. */
+ noio_flags = memalloc_noio_save();
spin_lock_irq(&dev->queue_lock);
list_add_tail(&bd->rq->queuelist, &dev->rq_list);
mtd_blktrans_work(dev);
spin_unlock_irq(&dev->queue_lock);
+ memalloc_noio_restore(noio_flags);
return BLK_STS_OK;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0589/1756] wifi: ath11k: fix reg_info_store leak in ath11k_service_ready_ext_event()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (587 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0588/1756] mtd: block: prevent reclaim I/O during request processing Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0590/1756] writeback: size foreign flushes by target wb dirty pages Greg Kroah-Hartman
` (409 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Baochen Qiang, Jeff Johnson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[ Upstream commit 64828f091c7de5c1324427b140fb545f93ef073f ]
Currently, while processing the WMI Service Ready Ext event, the iterator
in ath11k_service_ready_ext_event() can dispatch the HAL Regulatory
Capabilities handler ath11k_wmi_tlv_ext_soc_hal_reg_caps_parse() which can
allocate ab->reg_info_store.
If a subsequent failure occurs during iteration, the ab->reg_info_store
allocation is leaked.
Directly free and clear the pointer on the error path.
Note that the normal cleanup function ath11k_reg_free() cannot be used
since other regulatory-related fields are not yet populated at this point.
Compile tested only.
Fixes: 7004bdceef60 ("wifi: ath11k: store cur_regulatory_info for each radio")
Assisted-by: Claude:claude-sonnet-4-6
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260817-reg_info_store-leak-v1-1-77025a99b074@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath11k/wmi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 1911b4e50abb9..5a3126fce3c73 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -5084,6 +5084,15 @@ static int ath11k_service_ready_ext_event(struct ath11k_base *ab,
err:
kfree(svc_rdy_ext.mac_phy_caps);
+
+ /*
+ * During TLV iteration the WMI_TAG_SOC_HAL_REG_CAPABILITIES
+ * handler may have allocated ab->reg_info_store, so free it
+ * on error to avoid a memory leak
+ */
+ kfree(ab->reg_info_store);
+ ab->reg_info_store = NULL;
+
ath11k_wmi_free_dbring_caps(ab);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0590/1756] writeback: size foreign flushes by target wb dirty pages
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (588 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0589/1756] wifi: ath11k: fix reg_info_store leak in ath11k_service_ready_ext_event() Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0591/1756] ACPICA: Fix memory leak in acpi_ds_create_field() Greg Kroah-Hartman
` (408 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jan Kara, Tejun Heo, Xin Yin,
Christian Brauner (Amutable), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Yin <yinxin.x@bytedance.com>
[ Upstream commit 168a8c13159c6e3f0f08da6f8fa2f633a91ba9fd ]
Foreign dirty tracking records the bdi and wb memcg IDs of recently
dirtied foreign inodes. When the source memcg needs foreign writeback,
mem_cgroup_flush_foreign() queues WB_REASON_FOREIGN_FLUSH to the
recorded target bdi_writeback.
cgroup_writeback_by_id() currently sizes this best-effort work from the
target memcg's NR_FILE_DIRTY counter. The work is scoped to one target
wb, so a memcg-wide dirty count can over-size a single-bdi flush when
the target memcg has dirty pages on other devices. It can also under-size
the flush when the target wb has dirty pages charged to other memcgs.
Over-sizing keeps the target wb busy longer and can delay later
writeback work. Under-sizing can finish before enough pages are written
back for the source memcg.
Use the target wb's WB_RECLAIMABLE counter and keep the existing 25%
headroom. This keeps the budget aligned with the writeback object being
queued.
Fixes: 97b27821b485 ("writeback, memcg: Implement foreign dirty flushing")
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Link: https://patch.msgid.link/20260924065443.1650126-1-yinxin.x@bytedance.com
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs-writeback.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 3b67018191df1..c195c97717396 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1146,7 +1146,7 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
struct cgroup_subsys_state *memcg_css;
struct bdi_writeback *wb;
struct wb_writeback_work *work;
- unsigned long dirty;
+ long dirty;
int ret;
/* lookup bdi and memcg */
@@ -1175,16 +1175,13 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
}
/*
- * The caller is attempting to write out most of
- * the currently dirty pages. Let's take the current dirty page
- * count and inflate it by 25% which should be large enough to
- * flush out most dirty pages while avoiding getting livelocked by
- * concurrent dirtiers.
- *
- * BTW the memcg stats are flushed periodically and this is best-effort
- * estimation, so some potential error is ok.
+ * The caller is attempting to write out most of the target wb's
+ * currently dirty pages. Size the work from the wb's reclaimable pages
+ * and inflate the count by 25%, which should be large enough to flush
+ * out most dirty pages while avoiding getting livelocked by concurrent
+ * dirtiers.
*/
- dirty = memcg_page_state(mem_cgroup_from_css(memcg_css), NR_FILE_DIRTY);
+ dirty = wb_stat_sum(wb, WB_RECLAIMABLE);
dirty = dirty * 10 / 8;
/* issue the writeback work */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0591/1756] ACPICA: Fix memory leak in acpi_ds_create_field()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (589 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0590/1756] writeback: size foreign flushes by target wb dirty pages Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0592/1756] ACPICA: Fix PCC OperationRegion command offsets Greg Kroah-Hartman
` (407 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Breno Leitao, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
[ Upstream commit dbb3d99ee95c32711950850ddd33eb22a6042eb2 ]
acpi_ds_create_field() allocates internal_pcc_buffer for operation
regions in the PCC address space.
The function runs once per field, so a second field on the
same region overwrites the pointer and orphans the previous buffer.
The matching ACPI_FREE() in acpi_ut_delete_internal_obj() only ever sees
the last one.
An arm64 platform whose SSDT declares regions with multiple fields each
leaks two buffers at boot, as detected by kmemleak:
unreferenced object 0xffff000051e65400 (size 192):
comm "swapper/0", pid 1, jiffies 4294668436
backtrace (crc 0):
__kmalloc_noprof
acpi_ds_create_field
acpi_ds_load2_end_op
acpi_ds_exec_end_op
acpi_ps_parse_loop
acpi_ps_parse_aml
acpi_ns_load_table
acpi_load_tables
acpi_init
Do not allocate a region if it was previously allocated before,
preserving the current design, but, not leaking memory.
Fixes: aa6ec56b574d ("ACPICA: ACPI 6.3: add PCC operation region support for AML interpreter")
Link: https://github.com/open-acpica/acpica/commit/c71849d476bb5f97ca1867849e893368e12a69e6
Signed-off-by: Breno Leitao <leitao@debian.org>
[ rjw: Subject tweak, fixed the Fixes: tag ]
Link: https://patch.msgid.link/20260925-acpica-pcc-field-leak-v2-1-e37008e715af@debian.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpica/dsfield.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 532401ecdab0c..9009f4a3022e0 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -522,7 +522,8 @@ acpi_ds_create_field(union acpi_parse_object *op,
}
if (info.region_node->object->region.space_id ==
- ACPI_ADR_SPACE_PLATFORM_COMM) {
+ ACPI_ADR_SPACE_PLATFORM_COMM &&
+ !region_node->object->field.internal_pcc_buffer) {
region_node->object->field.internal_pcc_buffer =
ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
length);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0592/1756] ACPICA: Fix PCC OperationRegion command offsets
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (590 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0591/1756] ACPICA: Fix memory leak in acpi_ds_create_field() Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0593/1756] perf annotate-data: Resolve type DIEs in the debug file they came from Greg Kroah-Hartman
` (406 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sudeep Holla, Rafael J. Wysocki,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit 888dab4b04ea8725168c6d50d0bfb8057fccca18 ]
ACPI 6.3, section 5.5.2.4.7.3, states that the PCC Operation
Region is associated with the region of shared memory that follows the
PCC signature.
The generic and extended PCC shared memory layouts include the 4-byte
signature at offset 0, so their raw shared memory COMMAND fields are at
offsets 4 and 12 respectively. Since AML field offsets for the PCC
OperationRegion are relative to the region after that signature, ACPICA
must look for those COMMAND fields at OperationRegion offsets 0 and 8.
Adjust the generic and master subspace command checks to use those
OperationRegion-relative offsets. Otherwise writes to the COMMAND field
can fail to invoke the PCC address space handler at the offset described
by the PCC OperationRegion definition.
Link: https://github.com/open-acpica/acpica/pull/1205
Fixes: aa6ec56b574d ("ACPICA: ACPI 6.3: add PCC operation region support for AML interpreter")
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
[ rjw: Fixed the Fixes: tag ]
Link: https://patch.msgid.link/20260922144302.3847593-2-sudeep.holla@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpica/exfield.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index 61ff36189acea..eb44d06134b6e 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -45,12 +45,13 @@ static const u8 acpi_protocol_lengths[] = {
/*
* The following macros determine a given offset is a COMD field.
- * According to the specification, generic subspaces (types 0-2) contains a
- * 2-byte COMD field at offset 4 and master subspaces (type 3) contains a 4-byte
- * COMD field starting at offset 12.
+ * According to the specification, the PCC OperationRegion begins after
+ * the PCC signature. The raw shared memory COMD offsets of 4 for generic
+ * subspaces (types 0-2) and 12 for master subspaces (type 3) therefore
+ * appear at OperationRegion offsets 0 and 8.
*/
-#define GENERIC_SUBSPACE_COMMAND(a) (4 == a || a == 5)
-#define MASTER_SUBSPACE_COMMAND(a) (12 <= a && a <= 15)
+#define GENERIC_SUBSPACE_COMMAND(a) (0 == a || a == 1)
+#define MASTER_SUBSPACE_COMMAND(a) (8 <= a && a <= 11)
/*******************************************************************************
*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0593/1756] perf annotate-data: Resolve type DIEs in the debug file they came from
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (591 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0592/1756] ACPICA: Fix PCC OperationRegion command offsets Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0594/1756] ACPI: PCC: Simplify PCC shared memory region handling Greg Kroah-Hartman
` (405 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 14ca0a28de37849afdda6ffd4c9047f58d8906c2 ]
'perf report -s type' hangs burning CPU on the dwz compressed debug
info of libz.so.1 (zlib-ng): die_collect_vars() saves the
dwarf_dieoffset() of the type DIE, which is relative to the file it
lives in - the dwz alt file for the types shared by more than one CU -
and update_var_state() resolves that offset in the main debug file,
parsing whatever is at it, here a typedef whose DW_AT_type refers to
itself.
Record whether the type DIE came from the alt file and resolve the
offset with die_get_type_die() in that file, with no fallback.
Fixes: 06b2ce75386df04b ("perf annotate-data: Maintain variable type info")
Fixes: 55ee3d005d62279d ("perf annotate-data: Add a cache for global variable types")
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Assisted-by: LLM
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/annotate-data.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
index 976abedca09ef..b8d06ed52be25 100644
--- a/tools/perf/util/annotate-data.c
+++ b/tools/perf/util/annotate-data.c
@@ -591,6 +591,8 @@ struct global_var_entry {
u64 start;
u64 end;
u64 die_offset;
+ int die_tag;
+ bool from_alt; /* die_offset is relative to the alt (dwz) file */
};
static int global_var_cmp(const void *_key, const struct rb_node *node)
@@ -628,7 +630,7 @@ static struct global_var_entry *global_var__find(struct data_loc_info *dloc, u64
}
static bool global_var__add(struct data_loc_info *dloc, u64 addr,
- const char *name, Dwarf_Die *type_die)
+ const char *name, Dwarf_Die *type_die, bool from_alt)
{
struct dso *dso = map__dso(dloc->ms->map);
struct global_var_entry *gvar;
@@ -650,6 +652,8 @@ static bool global_var__add(struct data_loc_info *dloc, u64 addr,
gvar->start = addr;
gvar->end = addr + size;
gvar->die_offset = dwarf_dieoffset(type_die);
+ gvar->die_tag = dwarf_tag(type_die);
+ gvar->from_alt = from_alt;
rb_add(&gvar->node, dso__global_vars(dso), global_var_less);
return true;
@@ -724,7 +728,8 @@ static void global_var__collect(struct data_loc_info *dloc)
if (pos->reg != -1)
continue;
- if (!dwarf_offdie(dwarf, pos->die_off, &type_die))
+ if (!die_get_type_die(dwarf, pos->die_off, pos->die_tag,
+ pos->from_alt, &type_die))
continue;
if (!get_global_var_info(dloc, pos->addr, &var_name,
@@ -734,7 +739,8 @@ static void global_var__collect(struct data_loc_info *dloc)
if (var_offset != 0)
continue;
- global_var__add(dloc, pos->addr, var_name, &type_die);
+ global_var__add(dloc, pos->addr, var_name, &type_die,
+ pos->from_alt);
}
delete_var_types(var_types);
@@ -759,7 +765,8 @@ bool get_global_var_type(Dwarf_Die *cu_die, struct data_loc_info *dloc,
gvar = global_var__find(dloc, var_addr);
if (gvar) {
- if (!dwarf_offdie(dloc->di->dbg, gvar->die_offset, type_die))
+ if (!die_get_type_die(dloc->di->dbg, gvar->die_offset,
+ gvar->die_tag, gvar->from_alt, type_die))
return false;
*var_offset = var_addr - gvar->start;
@@ -790,7 +797,8 @@ bool get_global_var_type(Dwarf_Die *cu_die, struct data_loc_info *dloc,
ok:
/* The address should point to the start of the variable */
- global_var__add(dloc, var_addr - *var_offset, var_name, type_die);
+ global_var__add(dloc, var_addr - *var_offset, var_name, type_die,
+ !die_same_file(cu_die, type_die));
return true;
}
@@ -827,7 +835,8 @@ static void update_var_state(struct type_state *state, struct data_loc_info *dlo
if (var->addr != addr)
continue;
/* Get the type DIE using the offset */
- if (!dwarf_offdie(dloc->di->dbg, var->die_off, &mem_die))
+ if (!die_get_type_die(dloc->di->dbg, var->die_off,
+ var->die_tag, var->from_alt, &mem_die))
continue;
if (var->reg == DWARF_REG_FB || var->reg == fbreg) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0594/1756] ACPI: PCC: Simplify PCC shared memory region handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (592 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0593/1756] perf annotate-data: Resolve type DIEs in the debug file they came from Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0595/1756] ACPI: PCC: Preserve shared memory signature in OpRegion handler Greg Kroah-Hartman
` (404 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adam Young, Sudeep Holla,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@arm.com>
[ Upstream commit 8960c45a0f41399770d408921180231395604e2f ]
The PCC driver now handles mapping and unmapping of shared memory
areas as part of pcc_mbox_{request,free}_channel(). Without these before,
this ACPI PCC opregion driver did handling of those mappings like several
other PCC mailbox client drivers.
There were redundant operations, leading to unnecessary code. Maintaining
the consistency across these driver was harder due to scattered handling
of shmem.
Just use the mapped shmem and remove all redundant operations from this
driver.
Tested-by: Adam Young <admiyo@os.amperecomputing.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://patch.msgid.link/20250411113144.1151094-1-sudeep.holla@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 46c263c21387 ("ACPI: PCC: Preserve shared memory signature in OpRegion handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpi_pcc.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index 59d2308259cb2..e3f302b9dee5f 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -31,7 +31,6 @@
struct pcc_data {
struct pcc_mbox_chan *pcc_chan;
- void __iomem *pcc_comm_addr;
struct completion done;
struct mbox_client cl;
struct acpi_pcc_info ctx;
@@ -81,14 +80,6 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
ret = AE_SUPPORT;
goto err_free_channel;
}
- data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr,
- pcc_chan->shmem_size);
- if (!data->pcc_comm_addr) {
- pr_err("Failed to ioremap PCC comm region mem for %d\n",
- ctx->subspace_id);
- ret = AE_NO_MEMORY;
- goto err_free_channel;
- }
*region_context = data;
return AE_OK;
@@ -113,7 +104,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
reinit_completion(&data->done);
/* Write to Shared Memory */
- memcpy_toio(data->pcc_comm_addr, (void *)value, data->ctx.length);
+ memcpy_toio(data->pcc_chan->shmem, (void *)value, data->ctx.length);
ret = mbox_send_message(data->pcc_chan->mchan, NULL);
if (ret < 0)
@@ -134,7 +125,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
mbox_chan_txdone(data->pcc_chan->mchan, ret);
- memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length);
+ memcpy_fromio(value, data->pcc_chan->shmem, data->ctx.length);
return AE_OK;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0595/1756] ACPI: PCC: Preserve shared memory signature in OpRegion handler
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (593 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0594/1756] ACPI: PCC: Simplify PCC shared memory region handling Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0596/1756] ASoC: mediatek: mt8183: Fix wrong clock cleanup on clk_set_parent() failure Greg Kroah-Hartman
` (403 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Huisong Li, Sudeep Holla,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit 46c263c213876bdc2297ef61aa90f0b210ebac73 ]
ACPI 6.3 introduced PCC OperationRegions. Section 5.5.2.4.7.3,
"Declaring message fields within a PCC OperationRegion", states that,
for all PCC subspace types, the PCC Operation Region pertains to the
region of PCC subspace that succeeds the PCC signature. Its length
therefore excludes the 4-byte signature.
The PCC address space handler currently copies the OperationRegion
buffer to and from the start of the shared memory. This overwrites or
exposes the platform-populated signature and omits the final four bytes
of the OperationRegion.
Offset the copies by the size of the signature and reject an
OperationRegion that does not fit in the remaining shared memory.
The example added by commit 77e2a04745ff ("ACPI: PCC: Implement
OperationRegion handler for the PCC Type 3 subtype") incorrectly
included the signature as an OperationRegion field. A Type 3
OperationRegion containing a 100-byte communication area is declared
as follows:
OperationRegion (PFRM, PCC, 2, 0x70)
Field (PFRM, ByteAcc, NoLock, Preserve)
{
FLGS, 32,
LEN, 32,
CMD, 32,
DATA, 800
}
This contains three 32-bit fields followed by a 100-byte DATA field.
The fields correspond to the Type 3 shared memory layout in ACPI 6.3,
Table 14-372, after excluding its 4-byte signature.
Fixes: 77e2a04745ff ("ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype")
Reviewed-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://patch.msgid.link/20260922144302.3847593-3-sudeep.holla@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/acpi_pcc.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpi_pcc.c b/drivers/acpi/acpi_pcc.c
index e3f302b9dee5f..683924a708ba0 100644
--- a/drivers/acpi/acpi_pcc.c
+++ b/drivers/acpi/acpi_pcc.c
@@ -28,6 +28,7 @@
* to PCC commands
*/
#define PCC_CMD_WAIT_RETRIES_NUM 500ULL
+#define PCC_SIGNATURE_SIZE sizeof(u32)
struct pcc_data {
struct pcc_mbox_chan *pcc_chan;
@@ -74,6 +75,14 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
}
pcc_chan = data->pcc_chan;
+ if (pcc_chan->shmem_size < PCC_SIGNATURE_SIZE ||
+ ctx->length > pcc_chan->shmem_size - PCC_SIGNATURE_SIZE) {
+ pr_err("PCC channel-%d shared memory is too small.\n",
+ ctx->subspace_id);
+ ret = AE_AML_REGION_LIMIT;
+ goto err_free_channel;
+ }
+
if (!pcc_chan->mchan->mbox->txdone_irq) {
pr_err("This channel-%d does not support interrupt.\n",
ctx->subspace_id);
@@ -97,14 +106,17 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
u32 bits, acpi_integer *value,
void *handler_context, void *region_context)
{
- int ret;
struct pcc_data *data = region_context;
+ void __iomem *pcc_opregion;
u64 usecs_lat;
+ int ret;
+
+ pcc_opregion = data->pcc_chan->shmem + PCC_SIGNATURE_SIZE;
reinit_completion(&data->done);
- /* Write to Shared Memory */
- memcpy_toio(data->pcc_chan->shmem, (void *)value, data->ctx.length);
+ /* Write to the PCC OperationRegion after the shared memory signature. */
+ memcpy_toio(pcc_opregion, (void *)value, data->ctx.length);
ret = mbox_send_message(data->pcc_chan->mchan, NULL);
if (ret < 0)
@@ -125,7 +137,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
mbox_chan_txdone(data->pcc_chan->mchan, ret);
- memcpy_fromio(value, data->pcc_chan->shmem, data->ctx.length);
+ memcpy_fromio(value, pcc_opregion, data->ctx.length);
return AE_OK;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0596/1756] ASoC: mediatek: mt8183: Fix wrong clock cleanup on clk_set_parent() failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (594 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0595/1756] ACPI: PCC: Preserve shared memory signature in OpRegion handler Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0597/1756] ASoC: mediatek: mt8183: Fix clock handling in mux disable path Greg Kroah-Hartman
` (402 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cezary Rojewski, bui duc phuc,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 7f05596bd4047e4623eeb1f3c6921d6f71481c3b ]
In mt8183_afe_enable_clock(), when clk_set_parent() fails, the current
error path incorrectly cleans up the previously enabled clock instead of
the clock used by clk_set_parent().
Fix the error path to clean up the correct clock when clk_set_parent()
fails.
Fixes: a94aec035a12 ("ASoC: mediatek: mt8183: add platform driver")
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903045203.175337-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
index cc4f8f4d3dab9..6ab0734ad1365 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
@@ -137,7 +137,7 @@ int mt8183_afe_enable_clock(struct mtk_base_afe *afe)
dev_err(afe->dev, "%s(), clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIO],
aud_clks[CLK_CLK26M], ret);
- goto CLK_MUX_AUDIO_ERR;
+ goto CLK_MUX_AUDIO_INTBUS_ERR;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]);
@@ -153,7 +153,7 @@ int mt8183_afe_enable_clock(struct mtk_base_afe *afe)
dev_err(afe->dev, "%s(), clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIOINTBUS],
aud_clks[CLK_TOP_SYSPLL_D2_D4], ret);
- goto CLK_MUX_AUDIO_INTBUS_ERR;
+ goto CLK_AFE_ERR;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_AFE]);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0597/1756] ASoC: mediatek: mt8183: Fix clock handling in mux disable path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (595 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0596/1756] ASoC: mediatek: mt8183: Fix wrong clock cleanup on clk_set_parent() failure Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0598/1756] ASoC: mediatek: mt8183: Fix APLL enable error handling Greg Kroah-Hartman
` (401 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cezary Rojewski, bui duc phuc,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 4a0f9566ae0c3ad32620254342b266f37f4757de ]
In the disable path of the appl*_mux_setting() functions,
clk_disable_unprepare() is called after clk_set_parent().
If clk_set_parent() fails, clk_disable_unprepare() is skipped,
potentially leaving one of the clocks enabled.
Remove the goto exit paths so that all teardown steps are attempted
and any errors are only reported.
Fixes: a94aec035a12 ("ASoC: mediatek: mt8183: add platform driver")
Suggested-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260903045203.175337-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
index 6ab0734ad1365..dd1a5925af96d 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
@@ -271,7 +271,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
@@ -281,7 +280,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
}
@@ -298,7 +296,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
afe_priv->clk[CLK_CLK26M]);
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
ERR_ENABLE_CLK_TOP_MUX_AUD_1:
-EXIT:
return ret;
}
@@ -345,7 +342,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]);
@@ -355,7 +351,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
}
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
}
@@ -372,7 +367,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
afe_priv->clk[CLK_CLK26M]);
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
ERR_ENABLE_CLK_TOP_MUX_AUD_2:
-EXIT:
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0598/1756] ASoC: mediatek: mt8183: Fix APLL enable error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (596 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0597/1756] ASoC: mediatek: mt8183: Fix clock handling in mux disable path Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0599/1756] dt-bindings: vendor-prefixes: Add Chip Wealth Technology Greg Kroah-Hartman
` (400 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cezary Rojewski, bui duc phuc,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 30cf48383006579d7cd35380cc6e766260b72bff ]
Currently, the mt8183_apll*_enable() functions call mux_setting(afe, true)
but do not check its return value to handle failures.
In addition, the cleanup paths of mt8183_apll*_enable() do not call
mux_setting(afe, false) when the enable operation fails, while the
mt8183_apll*_disable() functions do.
Add error handling for apll*_mux_setting() and call mux_setting(afe, false)
in the cleanup paths when mt8183_apll*_enable() fails.
Fixes: a94aec035a12 ("ASoC: mediatek: mt8183: add platform driver")
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903045203.175337-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
index dd1a5925af96d..06556689976db 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-clk.c
@@ -376,7 +376,9 @@ int mt8183_apll1_enable(struct mtk_base_afe *afe)
int ret;
/* setting for APLL */
- apll1_mux_setting(afe, true);
+ ret = apll1_mux_setting(afe, true);
+ if (ret)
+ return ret;
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]);
if (ret) {
@@ -405,6 +407,8 @@ int mt8183_apll1_enable(struct mtk_base_afe *afe)
ERR_CLK_APLL1_TUNER:
clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]);
ERR_CLK_APLL22M:
+ apll1_mux_setting(afe, false);
+
return ret;
}
@@ -430,7 +434,9 @@ int mt8183_apll2_enable(struct mtk_base_afe *afe)
int ret;
/* setting for APLL */
- apll2_mux_setting(afe, true);
+ ret = apll2_mux_setting(afe, true);
+ if (ret)
+ return ret;
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]);
if (ret) {
@@ -459,6 +465,8 @@ int mt8183_apll2_enable(struct mtk_base_afe *afe)
ERR_CLK_APLL2_TUNER:
clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]);
ERR_CLK_APLL24M:
+ apll2_mux_setting(afe, false);
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0599/1756] dt-bindings: vendor-prefixes: Add Chip Wealth Technology
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (597 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0598/1756] ASoC: mediatek: mt8183: Fix APLL enable error handling Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0600/1756] arm64: dts: qcom: sdm845-lg: fix sdcard pinctrl nodes Greg Kroah-Hartman
` (399 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aaron Kling, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Kling <webgeek1234@gmail.com>
[ Upstream commit 058ee00216a1356e710446b59a800065d2abbd80 ]
Add an entry for Chip Wealth Technology (https://www.chipwealth.com/)
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://patch.msgid.link/20260727-ayn-qcs8550-v9-1-e3db456e10e5@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 442eb7e493088..3db3503567422 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -282,6 +282,8 @@ patternProperties:
description: ChipOne
"^chipspark,.*":
description: ChipSPARK
+ "^chipwealth,.*":
+ description: Chip Wealth Technology
"^chongzhou,.*":
description: Shenzhen Chongzhou Electronic Technology Co., Ltd
"^chrontel,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0600/1756] arm64: dts: qcom: sdm845-lg: fix sdcard pinctrl nodes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (598 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0599/1756] dt-bindings: vendor-prefixes: Add Chip Wealth Technology Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0601/1756] hfs/hfsplus: serialize B-tree close against folio release Greg Kroah-Hartman
` (398 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paul Sajna, David Heidelberg,
Konrad Dybcio, Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Sajna <sajattack@postmarketos.org>
[ Upstream commit e57d572ed779eb53e7eb5b8f9546731eff21bc93 ]
sdcard was previously rather unreliable during boot on sdm845-lg-judyln
Identified and applied correct settings from downstream lineageos kernel.
Verified card was properly detected over 5 reboots with rootfs on sdcard.
Refer to downstream: https://github.com/LineageOS/android_kernel_lge_sdm845/blob/efa8458f79dffeb380d43b38b9403407f87d9f05/arch/arm64/boot/dts/qcom/sdm845-pinctrl.dtsi#L148-L303
Fixes: 28ae8aa3923c ("arm64: dts: qcom: add device tree for LG G7 and LG V35")
Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
Reviewed-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260802-judyln-sdcard-fix-v1-1-b3477cfc42cc@postmarketos.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
index 99dafc6716e76..db05fb2e99cf2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
@@ -556,33 +556,26 @@ &tlmm {
sdc2_clk: sdc2-clk-state {
pins = "sdc2_clk";
bias-disable;
-
- /*
- * It seems that mmc_test reports errors if drive
- * strength is not 16 on clk, cmd, and data pins.
- *
- * TODO: copy-pasted from mtp, try other values
- * on these devices.
- */
drive-strength = <16>;
};
sdc2_cmd: sdc2-cmd-state {
pins = "sdc2_cmd";
bias-pull-up;
- drive-strength = <16>;
+ drive-strength = <10>;
};
sdc2_data: sdc2-data-state {
pins = "sdc2_data";
bias-pull-up;
- drive-strength = <16>;
+ drive-strength = <10>;
};
sd_card_det_n: sd-card-det-n-state {
pins = "gpio126";
function = "gpio";
bias-pull-up;
+ drive-strength = <2>;
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0601/1756] hfs/hfsplus: serialize B-tree close against folio release
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (599 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0600/1756] arm64: dts: qcom: sdm845-lg: fix sdcard pinctrl nodes Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0602/1756] arm64: dts: qcom: lemans-ride-common: fix SerDes PHY regulator supplies Greg Kroah-Hartman
` (397 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+d729df28d933979e017a,
syzbot+2eac7d175baf21e6a5d5, syzbot+7155b2fe09e033c91381,
syzbot+adeb387cede15eb11607, syzbot+ae7f2423f3648100506d,
Kyle Zeng, Bruno Produit, Viacheslav Dubeyko, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bruno Produit <bruno.produit@trailofbits.com>
[ Upstream commit dce0e0248205bb3dc5b4c6793cd2ecb453152259 ]
B-tree nodes with a zero reference count remain in the node hash until
folio reclaim or tree teardown frees them. The folio release callbacks
remove nodes while holding hash_lock, but hfs_btree_close() walks and
frees the same hash without that lock. Reclaim can therefore unhash and
free a node after close has loaded its pointer, causing a use-after-free
or double-free.
The following syzkaller crashes seem to be the same UAF in
{hfs,hfsplus}_btree_close() (or {hfs,hfsplus}_bnode_unhash()) and follow
the same pattern, but do not contain a reproducer to confirm.
Detach each node with hfs_bnode_unhash() while holding hash_lock before
inspecting and freeing it. Drop the lock before hfs_bnode_free() so a
large tree is not freed while holding a spinlock. Apply the same fix to
the matching HFS+ implementation.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+d729df28d933979e017a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d729df28d933979e017a
Reported-by: syzbot+2eac7d175baf21e6a5d5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2eac7d175baf21e6a5d5
Reported-by: syzbot+7155b2fe09e033c91381@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7155b2fe09e033c91381
Reported-by: syzbot+adeb387cede15eb11607@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=adeb387cede15eb11607
Reported-by: syzbot+ae7f2423f3648100506d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ae7f2423f3648100506d
Assisted-by: Codex:gpt-5.6-sol
Reported-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Bruno Produit <bruno.produit@trailofbits.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Tested-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/20260921153729.600313-1-bruno.produit@trailofbits.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/hfs/btree.c | 7 +++++--
fs/hfsplus/btree.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index e748d92d84105..c04f0cb6ee7d7 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -180,15 +180,18 @@ void hfs_btree_close(struct hfs_btree *tree)
return;
for (i = 0; i < NODE_HASH_SIZE; i++) {
+ spin_lock(&tree->hash_lock);
while ((node = tree->node_hash[i])) {
- tree->node_hash[i] = node->next_hash;
+ hfs_bnode_unhash(node);
+ spin_unlock(&tree->hash_lock);
if (atomic_read(&node->refcnt))
pr_err("node %d:%d still has %d user(s)!\n",
node->tree->cnid, node->this,
atomic_read(&node->refcnt));
hfs_bnode_free(node);
- tree->node_hash_cnt--;
+ spin_lock(&tree->hash_lock);
}
+ spin_unlock(&tree->hash_lock);
}
iput(tree->inode);
kfree(tree);
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index 72c593308bbaa..9754ec76d9251 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -265,16 +265,19 @@ void hfs_btree_close(struct hfs_btree *tree)
return;
for (i = 0; i < NODE_HASH_SIZE; i++) {
+ spin_lock(&tree->hash_lock);
while ((node = tree->node_hash[i])) {
- tree->node_hash[i] = node->next_hash;
+ hfs_bnode_unhash(node);
+ spin_unlock(&tree->hash_lock);
if (atomic_read(&node->refcnt))
pr_crit("node %d:%d "
"still has %d user(s)!\n",
node->tree->cnid, node->this,
atomic_read(&node->refcnt));
hfs_bnode_free(node);
- tree->node_hash_cnt--;
+ spin_lock(&tree->hash_lock);
}
+ spin_unlock(&tree->hash_lock);
}
iput(tree->inode);
kfree(tree);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0602/1756] arm64: dts: qcom: lemans-ride-common: fix SerDes PHY regulator supplies
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (600 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0601/1756] hfs/hfsplus: serialize B-tree close against folio release Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0603/1756] ARM: dts: qcom: msm8974: Use the header with DSI phy clock IDs Greg Kroah-Hartman
` (396 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mohd Ayaan Anwar,
Bartosz Golaszewski, Manivannan Sadhasivam, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
[ Upstream commit 0d567fb7def9564d15c334ec0fa5f5f6a0114ffa ]
Both SerDes PHY nodes were configured with 'phy-supply = <&vreg_l5a>',
which was incorrect on two counts: vreg_l5a is not a supply the PHY
requires, and only one rail was described where the hardware needs two.
The PHY requires vdda-0p9 (vreg_l4a) and vdda-1p2 (vreg_l1c). Replace
the incorrect phy-supply with these two named properties on both nodes.
Fixes: 5ef26fb8b3ed ("arm64: dts: qcom: sa8775p-ride: enable the SerDes PHY")
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260804-b4-sgmiieth_serdes_regulator-v2-4-c4bc688177dd@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi b/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi
index adb71aeff339b..76592e643801e 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi
@@ -507,12 +507,16 @@ &qupv3_id_2 {
};
&serdes0 {
- phy-supply = <&vreg_l5a>;
+ vdda-0p9-supply = <&vreg_l4a>;
+ vdda-1p2-supply = <&vreg_l1c>;
+
status = "okay";
};
&serdes1 {
- phy-supply = <&vreg_l5a>;
+ vdda-0p9-supply = <&vreg_l4a>;
+ vdda-1p2-supply = <&vreg_l1c>;
+
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0603/1756] ARM: dts: qcom: msm8974: Use the header with DSI phy clock IDs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (601 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0602/1756] arm64: dts: qcom: lemans-ride-common: fix SerDes PHY regulator supplies Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0604/1756] ARM: dts: qcom: msm8974: Sort header includes alphabetically Greg Kroah-Hartman
` (395 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Neil Armstrong,
Krzysztof Kozlowski, Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[ Upstream commit 1afdd80d1e021f758c975d857c6beb6da5c891bd ]
Use the header with DSI phy clock IDs to make code more readable.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250408-dts-qcom-dsi-phy-clocks-v2-2-73b482a6dd02@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: 542991a1d77e ("ARM: dts: qcom: msm8974: add MDSS reset")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 1bd87170252df..0fd2134934b92 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -3,6 +3,7 @@
#include <dt-bindings/interconnect/qcom,msm8974.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/qcom,dsi-phy-28nm.h>
#include <dt-bindings/clock/qcom,gcc-msm8974.h>
#include <dt-bindings/clock/qcom,mmcc-msm8974.h>
#include <dt-bindings/clock/qcom,rpmcc.h>
@@ -1871,10 +1872,10 @@ mmcc: clock-controller@fd8c0000 {
<&gcc GPLL0_VOTE>,
<&gcc GPLL1_VOTE>,
<&rpmcc RPM_SMD_GFX3D_CLK_SRC>,
- <&mdss_dsi0_phy 1>,
- <&mdss_dsi0_phy 0>,
- <&mdss_dsi1_phy 1>,
- <&mdss_dsi1_phy 0>,
+ <&mdss_dsi0_phy DSI_PIXEL_PLL_CLK>,
+ <&mdss_dsi0_phy DSI_BYTE_PLL_CLK>,
+ <&mdss_dsi1_phy DSI_PIXEL_PLL_CLK>,
+ <&mdss_dsi1_phy DSI_BYTE_PLL_CLK>,
<0>,
<0>,
<0>;
@@ -1961,8 +1962,10 @@ mdss_dsi0: dsi@fd922800 {
interrupt-parent = <&mdss>;
interrupts = <4>;
- assigned-clocks = <&mmcc BYTE0_CLK_SRC>, <&mmcc PCLK0_CLK_SRC>;
- assigned-clock-parents = <&mdss_dsi0_phy 0>, <&mdss_dsi0_phy 1>;
+ assigned-clocks = <&mmcc BYTE0_CLK_SRC>,
+ <&mmcc PCLK0_CLK_SRC>;
+ assigned-clock-parents = <&mdss_dsi0_phy DSI_BYTE_PLL_CLK>,
+ <&mdss_dsi0_phy DSI_PIXEL_PLL_CLK>;
clocks = <&mmcc MDSS_MDP_CLK>,
<&mmcc MDSS_AHB_CLK>,
@@ -2032,8 +2035,10 @@ mdss_dsi1: dsi@fd922e00 {
interrupt-parent = <&mdss>;
interrupts = <4>;
- assigned-clocks = <&mmcc BYTE1_CLK_SRC>, <&mmcc PCLK1_CLK_SRC>;
- assigned-clock-parents = <&mdss_dsi1_phy 0>, <&mdss_dsi1_phy 1>;
+ assigned-clocks = <&mmcc BYTE1_CLK_SRC>,
+ <&mmcc PCLK1_CLK_SRC>;
+ assigned-clock-parents = <&mdss_dsi1_phy DSI_BYTE_PLL_CLK>,
+ <&mdss_dsi1_phy DSI_PIXEL_PLL_CLK>;
clocks = <&mmcc MDSS_MDP_CLK>,
<&mmcc MDSS_AHB_CLK>,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0604/1756] ARM: dts: qcom: msm8974: Sort header includes alphabetically
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (602 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0603/1756] ARM: dts: qcom: msm8974: Use the header with DSI phy clock IDs Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0605/1756] ARM: dts: qcom: msm8974: add MDSS reset Greg Kroah-Hartman
` (394 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Luca Weiss, Konrad Dybcio,
Dmitry Baryshkov, Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luca Weiss <luca@lucaweiss.eu>
[ Upstream commit 4cf8d541f4716444b61a919e3fe6f04814165782 ]
Before adding more headers in a random order, let's sort the includes
once so that's done.
Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250621-msm8974-rpmpd-switch-v1-3-0a2cb303c446@lucaweiss.eu
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: 542991a1d77e ("ARM: dts: qcom: msm8974: add MDSS reset")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 0fd2134934b92..2f540414807f0 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
-#include <dt-bindings/interconnect/qcom,msm8974.h>
-#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,dsi-phy-28nm.h>
#include <dt-bindings/clock/qcom,gcc-msm8974.h>
#include <dt-bindings/clock/qcom,mmcc-msm8974.h>
#include <dt-bindings/clock/qcom,rpmcc.h>
-#include <dt-bindings/reset/qcom,gcc-msm8974.h>
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interconnect/qcom,msm8974.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/qcom,gcc-msm8974.h>
/ {
#address-cells = <1>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0605/1756] ARM: dts: qcom: msm8974: add MDSS reset
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (603 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0604/1756] ARM: dts: qcom: msm8974: Sort header includes alphabetically Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0606/1756] dt-bindings: vendor-prefixes: Add LeEco Greg Kroah-Hartman
` (393 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stephan Gerhold, Dmitry Baryshkov,
Konrad Dybcio, Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
[ Upstream commit 542991a1d77e5fea5263c2406773a0cd09a8ec48 ]
Commit 13a4b7fb6260 ("pmdomain: core: Leave powered-on genpds on until
late_initcall_sync") kept power-domains on longer during boot which is
causing DSI clock to get stuck and fail to acquire its configuration on
DSI bringup. Follow the example of other platforms and add MDSS reset to
the display subsystem node, fixing DSI issues.
Fixes: 5a9fc531f6ec ("ARM: dts: msm8974: add display support")
Suggested-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260810-msm8974-mmcc-fix-v2-1-5c787d79c0fa@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 2f540414807f0..87d02f4113b65 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -9,6 +9,7 @@
#include <dt-bindings/interconnect/qcom,msm8974.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/reset/qcom,gcc-msm8974.h>
+#include <dt-bindings/reset/qcom,mmcc-msm8974.h>
/ {
#address-cells = <1>;
@@ -1910,6 +1911,8 @@ mdss: display-subsystem@fd900000 {
interrupt-controller;
#interrupt-cells = <1>;
+ resets = <&mmcc MDSS_RESET>;
+
status = "disabled";
#address-cells = <1>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0606/1756] dt-bindings: vendor-prefixes: Add LeEco
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (604 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0605/1756] ARM: dts: qcom: msm8974: add MDSS reset Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0607/1756] dt-bindings: vendor-prefixes: Add Retronix Technology Inc Greg Kroah-Hartman
` (392 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adam Skladowski, Krzysztof Kozlowski,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Skladowski <a39.skl@gmail.com>
[ Upstream commit 1658af4d25bd3133d1b3403ccdda6214d40c0ebb ]
Add vendor prefix for now dead ecosystem company LeEco
Signed-off-by: Adam Skladowski <a39.skl@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260821-next-patches-v5-1-ec81cee63e09@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 3db3503567422..10038744243b2 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -822,6 +822,8 @@ patternProperties:
description: Shenzen LC Technology Co., Ltd.
"^leadtek,.*":
description: Shenzhen Leadtek Technology Co., Ltd.
+ "^leeco,.*":
+ description: Leshi Holding Beijing.
"^leez,.*":
description: Leez
"^lego,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0607/1756] dt-bindings: vendor-prefixes: Add Retronix Technology Inc.
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (605 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0606/1756] dt-bindings: vendor-prefixes: Add LeEco Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0608/1756] dt-bindings: vendor-prefixes: Add Retroid Pocket Greg Kroah-Hartman
` (391 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski,
Geert Uytterhoeven, Niklas Söderlund, Marek Vasut,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <marek.vasut+renesas@mailbox.org>
[ Upstream commit da076d5562d2fc99138ff8ab04ff82eee7a4a3d8 ]
Add vendor prefix for Retronix Technology Inc.
https://www.retronix.com.tw/en/about.html
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/20250420173829.200553-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Stable-dep-of: ea55bba4c68a ("dt-bindings: vendor-prefixes: Add Retroid Pocket")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 10038744243b2..a5202c82e7f21 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1248,6 +1248,8 @@ patternProperties:
description: Renesas Electronics Corporation
"^rervision,.*":
description: Shenzhen Rervision Technology Co., Ltd.
+ "^retronix,.*":
+ description: Retronix Technology Inc.
"^revotics,.*":
description: Revolution Robotics, Inc. (Revotics)
"^rex,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0608/1756] dt-bindings: vendor-prefixes: Add Retroid Pocket
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (606 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0607/1756] dt-bindings: vendor-prefixes: Add Retronix Technology Inc Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0609/1756] scsi: ufs: core: Serialize AHIT register access between sysfs and host driver Greg Kroah-Hartman
` (390 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Aaron Kling,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Kling <webgeek1234@gmail.com>
[ Upstream commit ea55bba4c68a49fcb527da6c71dd48879b705fd1 ]
Add an entry for Retroid Pocket (https://www.goretroid.com/)
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://patch.msgid.link/20260829-rp-qcs8550-v3-1-198d5b2fc475@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index a5202c82e7f21..633d540e504b3 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1248,6 +1248,8 @@ patternProperties:
description: Renesas Electronics Corporation
"^rervision,.*":
description: Shenzhen Rervision Technology Co., Ltd.
+ "^retroidpocket,.*":
+ description: Retroid Pocket
"^retronix,.*":
description: Retronix Technology Inc.
"^revotics,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0609/1756] scsi: ufs: core: Serialize AHIT register access between sysfs and host driver
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (607 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0608/1756] dt-bindings: vendor-prefixes: Add Retroid Pocket Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0610/1756] MIPS: Octeon: size the swiotlb for a modular OHCI platform driver Greg Kroah-Hartman
` (389 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Wang, Chun-Hung Wu,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Wang <peter.wang@mediatek.com>
[ Upstream commit 7dec5cedf7b248036da606c16f9f3f9aa350b417 ]
A race exists between ufshcd_auto_hibern8_update() and
ufs_mtk_pwr_change_notify() when both paths concurrently access
REG_AUTO_HIBERNATE_IDLE_TIMER. Additionally, the static local variable used
to save/restore AHIT in the power change path is not re-entrant and may
hold a stale value if a sysfs write races with a gear change.
Introduce ahit_mutex and ahit_disable_depth in struct ufs_hba to
serialize AHIT register access. The depth counter tracks how many
host-driver paths have forced AHIT off; sysfs writes are suppressed
while it is non-zero and the register is restored from hba->ahit
only when the last disabler drops it to zero.
Fixes: f5ca8d0c7a63 ("scsi: ufs: host: mediatek: Disable auto-hibern8 during power mode changes")
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Link: https://patch.msgid.link/20260914085148.136429-3-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ufs/core/ufshcd.c | 14 +++++++++++++-
drivers/ufs/host/ufs-mediatek.c | 16 ++++++++++++----
include/ufs/ufshcd.h | 8 ++++++++
3 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 798ad0338cd97..9dd1607c49d07 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -4544,7 +4544,17 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
if (!pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) {
ufshcd_rpm_get_sync(hba);
ufshcd_hold(hba);
- ufshcd_configure_auto_hibern8(hba);
+ /*
+ * Serialize with the host driver's AHIT control. Skip the
+ * register write while the driver has AHIT forced off; the
+ * driver programs hba->ahit back when it re-enables it.
+ * Mutex is taken here (not across the rpm calls above) so it
+ * never blocks a resume that the driver's path may need.
+ */
+ mutex_lock(&hba->ahit_mutex);
+ if (!hba->ahit_disable_depth)
+ ufshcd_configure_auto_hibern8(hba);
+ mutex_unlock(&hba->ahit_mutex);
ufshcd_release(hba);
ufshcd_rpm_put_sync(hba);
}
@@ -10668,6 +10678,8 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
mutex_init(&hba->wb_mutex);
+ mutex_init(&hba->ahit_mutex);
+
init_rwsem(&hba->clk_scaling_lock);
ufshcd_init_clk_gating(hba);
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index e4156238f51d9..ffce98cca2d81 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1266,20 +1266,28 @@ static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba,
struct ufs_pa_layer_attr *dev_req_params)
{
int ret = 0;
- static u32 reg;
switch (stage) {
case PRE_CHANGE:
if (ufshcd_is_auto_hibern8_supported(hba)) {
- reg = ufshcd_readl(hba, REG_AUTO_HIBERNATE_IDLE_TIMER);
+ /* Block sysfs AHIT writes while we force AHIT off */
+ mutex_lock(&hba->ahit_mutex);
+ hba->ahit_disable_depth++;
+ mutex_unlock(&hba->ahit_mutex);
ufs_mtk_auto_hibern8_disable(hba);
}
ret = ufs_mtk_pre_pwr_change(hba, dev_max_params,
dev_req_params);
break;
case POST_CHANGE:
- if (ufshcd_is_auto_hibern8_supported(hba))
- ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER);
+ if (ufshcd_is_auto_hibern8_supported(hba)) {
+ mutex_lock(&hba->ahit_mutex);
+ /* re-enable only when the last disabler drops off */
+ if (!--hba->ahit_disable_depth)
+ ufshcd_writel(hba, hba->ahit,
+ REG_AUTO_HIBERNATE_IDLE_TIMER);
+ mutex_unlock(&hba->ahit_mutex);
+ }
break;
default:
ret = -EINVAL;
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 70dcc13d136d6..cca831cc800f3 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -1001,6 +1001,14 @@ struct ufs_hba {
/* Auto-Hibernate Idle Timer register value */
u32 ahit;
+ /* Serializes AHIT register access between sysfs and the host driver */
+ struct mutex ahit_mutex;
+ /*
+ * Nesting count of host-driver paths that have AHIT forced off.
+ * Non-zero blocks sysfs AHIT writes; AHIT is reprogrammed only when
+ * the last disabler drops it back to zero. Guarded by ahit_mutex.
+ */
+ int ahit_disable_depth;
struct ufshcd_lrb *lrb;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0610/1756] MIPS: Octeon: size the swiotlb for a modular OHCI platform driver
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (608 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0609/1756] scsi: ufs: core: Serialize AHIT register access between sysfs and host driver Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0611/1756] MIPS: Only check -msym32 when need-compiler Greg Kroah-Hartman
` (388 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Orgad Shaneh, Thomas Bogendoerfer,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Orgad Shaneh <orgads@gmail.com>
[ Upstream commit f1dd1f0c8d595a019be503d40060d25721313b4a ]
plat_swiotlb_setup() raises the swiotlb to 64 MB on OCTEON II with
memory above 4 GB, because that OHCI can only DMA to 32 bits. The test
is "#ifdef CONFIG_USB_OHCI_HCD_PLATFORM", which is false when the driver
is a module - the usual way to build it - so the bump is silently
skipped.
What is left depends on the rest of the function: with PCI enabled the
"memory past the BAR1 hole" branch happens to ask for the same 64 MB,
but with CONFIG_PCI off - which is normal on these SoCs when no PCI
devices are wired - swiotlbsize stays at the PAGE_SIZE it was
initialised to. A full- or low-speed device on an OCTEON II board with
more than 4 GB of RAM then has no bounce buffer to speak of.
Use IS_ENABLED() so a modular OHCI gets the same sizing as a built-in
one. Seen on a CN6635 board with 8 GB of RAM and
CONFIG_USB_OHCI_HCD_PLATFORM=m.
Fixes: a8667d706dfa ("MIPS: OCTEON: dma-octeon: fix OHCI USB config check")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/cavium-octeon/dma-octeon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index 9fbba6a8fa4c5..c049632fbcc33 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -228,7 +228,7 @@ void __init plat_swiotlb_setup(void)
swiotlbsize = 64 * (1<<20);
}
#endif
-#ifdef CONFIG_USB_OHCI_HCD_PLATFORM
+#if IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM)
/* OCTEON II ohci is only 32-bit. */
if (OCTEON_IS_OCTEON2() && max_addr >= 0x100000000ul)
swiotlbsize = 64 * (1<<20);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0611/1756] MIPS: Only check -msym32 when need-compiler
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (609 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0610/1756] MIPS: Octeon: size the swiotlb for a modular OHCI platform driver Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0612/1756] bitmap: bitmap_parse(): reject non-hex character before 8 digits Greg Kroah-Hartman
` (387 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej W. Rozycki, Chen Linxuan,
WangYuli, Chen Linxuan, Thomas Bogendoerfer, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: WangYuli <wangyuli@uniontech.com>
[ Upstream commit 7a8f286c235f5d308208cfdcb025b2a0e0c84742 ]
During 'make modules_install', the need-compiler variable is null, so
Makefile.compiler isn't included. This results in call cc-option-yn
returning nothing and consequently an error is issued:
*** CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32. Stop.
and the invocation terminated for configurations that set the Kconfig
option named.
Previously commit a79a404e6c22 ("MIPS: Fix CONFIG_CPU_DADDI_WORKAROUNDS
`modules_install' regression") addressed the same issue for GCC versions
now supported for Linux compilation, but caused a build error with Clang
because it doesn't support '-msym32'. Then commit 18ca63a2e23c ("MIPS:
Probe toolchain support of -msym32") fixed the issue with Clang, but
reintroduced the 'make modules_install' error listed above.
Wrap the handling of the '-msym32' option then with ifdef need-compiler,
fixing said error for 'make modules_install'.
For more technical details on why need-compiler is null during 'make
modules_install' and why no compiler invocation is actually needed at
this point, please refer to commit 4fe4a6374c4d ("MIPS: Only fiddle with
CHECKFLAGS if need-compiler") and commit 805b2e1d427a ("kbuild: include
Makefile.compiler only when compiler is needed").
NB leading 8 spaces rather than tabs required due to `make' syntax.
Link: https://lore.kernel.org/all/alpine.DEB.2.21.2502120612000.65342@angie.orcam.me.uk/
Link: https://lore.kernel.org/all/alpine.DEB.2.21.2307180025120.62448@angie.orcam.me.uk/
Fixes: a79a404e6c22 ("MIPS: Fix CONFIG_CPU_DADDI_WORKAROUNDS `modules_install' regression")
Reported-by: Maciej W. Rozycki <macro@orcam.me.uk>
Closes: https://lore.kernel.org/all/alpine.DEB.2.21.2501030535080.49841@angie.orcam.me.uk/
Co-developed-by: Chen Linxuan <chenlinxuan@uniontech.com>
Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Reviewed-by: Chen Linxuan <me@black-desk.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/Makefile | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 5785a3d5ccfbb..dd34815ee23d0 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -294,18 +294,20 @@ drivers-$(CONFIG_PCI) += arch/mips/pci/
# We can always force a build with a 64-bits symbol format by
# passing 'KBUILD_SYM32=no' option to the make's command line.
#
-ifdef CONFIG_64BIT
- ifndef KBUILD_SYM32
- ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
- KBUILD_SYM32 = $(call cc-option-yn, -msym32)
+ifdef need-compiler
+ ifdef CONFIG_64BIT
+ ifndef KBUILD_SYM32
+ ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
+ KBUILD_SYM32 = $(call cc-option-yn, -msym32)
+ endif
endif
- endif
- ifeq ($(KBUILD_SYM32), y)
- cflags-$(KBUILD_SYM32) += -msym32 -DKBUILD_64BIT_SYM32
- else
- ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y)
- $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32)
+ ifeq ($(KBUILD_SYM32), y)
+ cflags-$(KBUILD_SYM32) += -msym32 -DKBUILD_64BIT_SYM32
+ else
+ ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y)
+ $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32)
+ endif
endif
endif
endif
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0612/1756] bitmap: bitmap_parse(): reject non-hex character before 8 digits
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (610 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0611/1756] MIPS: Only check -msym32 when need-compiler Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0613/1756] bitmap: bitmap_parselist(): reject trailing characters after group size Greg Kroah-Hartman
` (386 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain, Yury Norov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
[ Upstream commit 7cee2fb210a198667d3d4200705215e6f315cab0 ]
bitmap_parse() is documented to return -EINVAL for illegal characters,
and it does so everywhere except when the illegal character directly
precedes a chunk of exactly eight hex digits.
bitmap_get_x32_reverse() parses a chunk from right to left. After it
has consumed eight digits it looks at one more character: a hex digit
means the chunk is wider than 32 bits and -EOVERFLOW is returned. Any
other character is silently consumed as if it were a separator, and the
remaining input is parsed as the next chunk. As a result:
"x12345678" -> 0x12345678, returns 0 (expected -EINVAL)
"1g12345678" -> 0x1_12345678, returns 0 (expected -EINVAL)
"0x0000000f" -> 0xf, returns 0, while "0xf" returns -EINVAL
bitmap_parse() backs cpumask_parse() and cpumask_parse_user(), so the
same inconsistency is visible when writing masks such as
/proc/irq/*/smp_affinity or the network queue rps_cpus/xps_cpus files.
__bitmap_parse(), which this function replaced in commit 2d6261583be0
("lib: rework bitmap_parse()"), rejected all three strings with -EINVAL,
and a "0x" prefix is accepted today only when exactly eight digits
follow it, so no reliably working input is lost.
When the loop falls through, *end is known to be a non-separator
character inside the buffer, so return -EOVERFLOW if it is a hex digit
and -EINVAL otherwise.
Fixes: 2d6261583be0 ("lib: rework bitmap_parse()")
Assisted-by: LLM
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/bitmap-str.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/bitmap-str.c b/lib/bitmap-str.c
index be745209507a4..692a150a4d65c 100644
--- a/lib/bitmap-str.c
+++ b/lib/bitmap-str.c
@@ -447,8 +447,12 @@ static const char *bitmap_get_x32_reverse(const char *start,
goto out;
}
- if (hex_to_bin(*end--) >= 0)
- return ERR_PTR(-EOVERFLOW);
+ /*
+ * Eight digits have been consumed and the next character is not a
+ * separator: another hex digit means the chunk does not fit in 32
+ * bits, anything else is an illegal character.
+ */
+ return ERR_PTR(hex_to_bin(*end) >= 0 ? -EOVERFLOW : -EINVAL);
out:
*num = ret;
return end;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0613/1756] bitmap: bitmap_parselist(): reject trailing characters after group size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (611 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0612/1756] bitmap: bitmap_parse(): reject non-hex character before 8 digits Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0614/1756] bitmap: bitmap_parselist(): dont wrap around on a huge " Greg Kroah-Hartman
` (385 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain, Yury Norov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
[ Upstream commit c55d102257fa31271c6f11fea595b78c48fd7aa2 ]
bitmap_parse_region() checks that every region ends at a separator
(',', whitespace, '\n' or '\0'), except in the "range:used/group" form:
after parsing the group size it returns the pointer to the following
character without looking at it. The caller then starts a new region
at that character.
Before 'N' and 'all' were accepted as region starts this happened to be
harmless, because any other character would fail to parse as a new
region. Now text directly following the group size is silently parsed
as another region:
"0-7:1/2N" -> bits 0,2,4,6,7 (nbits = 8), returns 0
"0-7:1/2all" -> all bits set, returns 0
while "0-7N", "5N" or "0-7:1/2x" are correctly rejected with -EINVAL.
bitmap_parselist() is documented to return -EINVAL for an invalid
character. It parses cpu lists from sysfs, cgroup cpuset files and
boot parameters such as isolcpus= and nohz_full=, so a typo there is
accepted and yields a different mask than intended.
Check for the end of the region after the group size as well, like the
other forms do.
Fixes: 2c4885d24e64 ("lib: bitmap: support "N" as an alias for size of bitmap")
Assisted-by: LLM
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/bitmap-str.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/bitmap-str.c b/lib/bitmap-str.c
index 692a150a4d65c..65cd6f60d4360 100644
--- a/lib/bitmap-str.c
+++ b/lib/bitmap-str.c
@@ -332,7 +332,14 @@ static const char *bitmap_parse_region(const char *str, struct region *r)
if (*str != '/')
return ERR_PTR(-EINVAL);
- return bitmap_getnum(str + 1, &r->group_len, lastbit);
+ str = bitmap_getnum(str + 1, &r->group_len, lastbit);
+ if (IS_ERR(str))
+ return str;
+
+ if (!end_of_region(*str))
+ return ERR_PTR(-EINVAL);
+
+ return end_of_str(*str) ? NULL : str;
no_end:
r->end = r->start;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0614/1756] bitmap: bitmap_parselist(): dont wrap around on a huge group size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (612 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0613/1756] bitmap: bitmap_parselist(): reject trailing characters after group size Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0615/1756] m68k: apollo: Fix interrupt setup Greg Kroah-Hartman
` (384 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Shashank Mohan Jain, Yury Norov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashank Mohan Jain <jain.sm@gmail.com>
[ Upstream commit d075c4dc0b3c8ed91a4f67ebdf3384aa59fd4fbb ]
In the "range:used/group" form bitmap_set_region() walks the range with
for (start = r->start; start <= r->end; start += r->group_len)
where all values are unsigned int. bitmap_getnum() accepts any group
size up to UINT_MAX, and bitmap_check_region() only requires it to be
non-zero and at least the used size. If start + group_len exceeds
UINT_MAX, start wraps around to a small value that is still <= end, and
bits below the start of the range get set:
"1-1:1/4294967295" -> bits 0,1 (expected bit 1)
"15-15:1/4294967281" -> bits 0,15 (expected bit 15)
The loop still terminates, because start keeps decreasing until it
wraps past zero again, but the resulting mask contains bits outside
the requested range.
This needs a group size within 'start' of UINT_MAX, so it is unlikely
to be hit by accident; all bits set stay below the end of the range,
so there is no out-of-bounds write.
A group larger than the range simply means that the range contains a
single group, so stop the walk when the next group would start beyond
UINT_MAX.
Fixes: 0a5ce0831d04 ("lib/bitmap.c: make bitmap_parselist() thread-safe and much faster")
Assisted-by: LLM
Signed-off-by: Shashank Mohan Jain <jain.sm@gmail.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/bitmap-str.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/bitmap-str.c b/lib/bitmap-str.c
index 65cd6f60d4360..777c89bc772cd 100644
--- a/lib/bitmap-str.c
+++ b/lib/bitmap-str.c
@@ -8,6 +8,7 @@
#include <linux/hex.h>
#include <linux/kernel.h>
#include <linux/mm.h>
+#include <linux/overflow.h>
#include <linux/string.h>
#include "kstrtox.h"
@@ -219,10 +220,12 @@ struct region {
static void bitmap_set_region(const struct region *r, unsigned long *bitmap)
{
- unsigned int start;
+ unsigned int start = r->start;
- for (start = r->start; start <= r->end; start += r->group_len)
+ do {
bitmap_set(bitmap, start, min(r->end - start + 1, r->off));
+ } while (!check_add_overflow(start, r->group_len, &start) &&
+ start <= r->end);
}
static int bitmap_check_region(const struct region *r)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0615/1756] m68k: apollo: Fix interrupt setup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (613 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0614/1756] bitmap: bitmap_parselist(): dont wrap around on a huge " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0616/1756] drm/msm/a6xx: Fix secondary rail vote in ARC votes Greg Kroah-Hartman
` (383 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daniel Palmer, Geert Uytterhoeven,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Palmer <daniel@0x0f.com>
[ Upstream commit 6cdbe63badcb524c88f2c8b3cee08f2ffc099a1b ]
The user interrupt vector needs to be installed before the interrupts
are unmasked otherwise the timer tick isn't handled and boot up gets
stuck in calibrate_delay().
Assisted-by: Claude:claude-fable-5 # Wrote Apollo DN3000 emulator using QEMU
Fixes: 0aa78106c661cf6c ("[PATCH] m68k: convert apollo irq code")
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://patch.msgid.link/20260828094940.3882602-1-daniel@0x0f.com
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/m68k/apollo/dn_ints.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c
index ba96a92f8f18f..89bfb5aaad9df 100644
--- a/arch/m68k/apollo/dn_ints.c
+++ b/arch/m68k/apollo/dn_ints.c
@@ -2,6 +2,7 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/apollohw.h>
@@ -11,10 +12,13 @@ static unsigned int apollo_irq_startup(struct irq_data *data)
{
unsigned int irq = data->irq;
+ m68k_irq_startup(data);
+
if (irq < 8)
*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
else
*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
+
return 0;
}
@@ -26,6 +30,8 @@ static void apollo_irq_shutdown(struct irq_data *data)
*(volatile unsigned char *)(pica+1) |= (1 << irq);
else
*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
+
+ m68k_irq_shutdown(data);
}
static void apollo_irq_eoi(struct irq_data *data)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0616/1756] drm/msm/a6xx: Fix secondary rail vote in ARC votes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (614 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0615/1756] m68k: apollo: Fix interrupt setup Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0617/1756] netfilter: synproxy: fix reset of ct seqadj when reopening a connection Greg Kroah-Hartman
` (382 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Akhil P Oommen,
Rob Clark, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akhil P Oommen <akhilpo@oss.qualcomm.com>
[ Upstream commit 128a0edde50780ed9eb93ab5d2e18ca24c1f1c43 ]
Using the requested level can pick a secondary corner lower than the one
required to support the chosen primary corner, under-voting the
dependent rail. To fix this, match against the selected primary voltage
instead.
Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support")
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/755592/
Message-ID: <20260923-hawi-gpu-v1-2-0c3c79a1a470@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 99c3abd90c190..c65c8442acc76 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -1380,10 +1380,14 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,
/*
* Look for a level in in the secondary list that matches. If
* nothing fits, use the maximum non zero vote
+ *
+ * The secondary rail depends on the primary rail, so match it
+ * against the quantized primary voltage (which is >= the
+ * requested level), not the requested level itself.
*/
for (j = 0; j < sec_count; j++) {
- if (sec[j] >= level) {
+ if (sec[j] >= pri[pindex]) {
sindex = j;
break;
} else if (sec[j]) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0617/1756] netfilter: synproxy: fix reset of ct seqadj when reopening a connection
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (615 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0616/1756] drm/msm/a6xx: Fix secondary rail vote in ARC votes Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0618/1756] ARM: dts: gemini: Use a level-high interrupt for TVE200 Greg Kroah-Hartman
` (381 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Fernando Fernandez Mancera,
Pablo Neira Ayuso, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <fmancera@suse.de>
[ Upstream commit a8708aa9fe1095ca7859cb3f102b6a3fa0fb98bd ]
SYNPROXY is resetting conntrack seqadj when a closed connection is
re-opened, but it was using nf_ct_seqadj_init() which is a no-op for a
zero offset.
This patch introduces nf_ct_seqadj_reset() which sets the offset values
directly to zero and avoid setting IPS_SEQ_ADJUST_BIT flag, it changes
SYNPROXY code to use it when needed.
Fixes: 48b1de4c110a ("netfilter: add SYNPROXY core/target")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_conntrack_seqadj.h | 1 +
net/netfilter/nf_conntrack_seqadj.c | 17 +++++++++++++++++
net/netfilter/nf_synproxy_core.c | 4 ++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/include/net/netfilter/nf_conntrack_seqadj.h b/include/net/netfilter/nf_conntrack_seqadj.h
index 883c414b768ee..0f5bbb14a25aa 100644
--- a/include/net/netfilter/nf_conntrack_seqadj.h
+++ b/include/net/netfilter/nf_conntrack_seqadj.h
@@ -33,6 +33,7 @@ static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
s32 off);
+void nf_ct_seqadj_reset(struct nf_conn *ct, enum ip_conntrack_info ctinfo);
int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
__be32 seq, s32 off);
void nf_ct_tcp_seqadj_set(struct sk_buff *skb, struct nf_conn *ct,
diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
index b7e99f34dfce8..8dba6a0d5dc21 100644
--- a/net/netfilter/nf_conntrack_seqadj.c
+++ b/net/netfilter/nf_conntrack_seqadj.c
@@ -29,6 +29,23 @@ int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
}
EXPORT_SYMBOL_GPL(nf_ct_seqadj_init);
+void nf_ct_seqadj_reset(struct nf_conn *ct, enum ip_conntrack_info ctinfo)
+{
+ struct nf_conn_seqadj *seqadj = nfct_seqadj(ct);
+ enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
+ struct nf_ct_seqadj *this_way;
+
+ if (unlikely(!seqadj))
+ return;
+
+ spin_lock_bh(&ct->lock);
+ this_way = &seqadj->seq[dir];
+ this_way->offset_before = 0;
+ this_way->offset_after = 0;
+ spin_unlock_bh(&ct->lock);
+}
+EXPORT_SYMBOL_GPL(nf_ct_seqadj_reset);
+
int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
__be32 seq, s32 off)
{
diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
index 69f84c44801dc..309bee4e1ed65 100644
--- a/net/netfilter/nf_synproxy_core.c
+++ b/net/netfilter/nf_synproxy_core.c
@@ -685,7 +685,7 @@ ipv4_synproxy_hook(void *priv, struct sk_buff *skb,
* adjustments, they will get initialized once the connection is
* reestablished.
*/
- nf_ct_seqadj_init(ct, ctinfo, 0);
+ nf_ct_seqadj_reset(ct, ctinfo);
synproxy->tsoff = 0;
this_cpu_inc(snet->stats->conn_reopened);
fallthrough;
@@ -1115,7 +1115,7 @@ ipv6_synproxy_hook(void *priv, struct sk_buff *skb,
* adjustments, they will get initialized once the connection is
* reestablished.
*/
- nf_ct_seqadj_init(ct, ctinfo, 0);
+ nf_ct_seqadj_reset(ct, ctinfo);
synproxy->tsoff = 0;
this_cpu_inc(snet->stats->conn_reopened);
fallthrough;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0618/1756] ARM: dts: gemini: Use a level-high interrupt for TVE200
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (616 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0617/1756] netfilter: synproxy: fix reset of ct seqadj when reopening a connection Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0619/1756] PCI: aardvark: Disable PHY on probe failures Greg Kroah-Hartman
` (380 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 5bf1bb010712bba28eda926ed453db3cab91381a ]
TVE200's interrupt is configured as rising-edge. On the D-Link DIR-685,
this can stop interrupt delivery after the first vertical interrupt,
causing vblank and page-flip timeouts and delaying framebuffer console
startup.
The vertical interrupt can remain pending after acknowledgment. Use
level-high triggering so the pending condition is delivered again
without requiring another edge.
Fixes: d2b85241a9f5 ("ARM: dts: Add TVE200 to the Gemini SoC DTSI")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Message-ID: <20260921-gemini-tve200-fix-v1-2-8be03ac2a8f7@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/gemini/gemini.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/gemini/gemini.dtsi b/arch/arm/boot/dts/gemini/gemini.dtsi
index befe322bd7de9..c95faa197bcf1 100644
--- a/arch/arm/boot/dts/gemini/gemini.dtsi
+++ b/arch/arm/boot/dts/gemini/gemini.dtsi
@@ -428,7 +428,7 @@ dma-controller@67000000 {
display-controller@6a000000 {
compatible = "cortina,gemini-tvc", "faraday,tve200";
reg = <0x6a000000 0x1000>;
- interrupts = <13 IRQ_TYPE_EDGE_RISING>;
+ interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
resets = <&syscon GEMINI_RESET_TVC>;
clocks = <&syscon GEMINI_CLK_GATE_TVC>,
<&syscon GEMINI_CLK_TVC>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0619/1756] PCI: aardvark: Disable PHY on probe failures
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (617 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0618/1756] ARM: dts: gemini: Use a level-high interrupt for TVE200 Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0620/1756] arm64: dts: qcom: sm8150: Use SM8150_CX for the SDHC power domain Greg Kroah-Hartman
` (379 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Manivannan Sadhasivam, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit 28cc5bc5a6c6cffbe7ba27c0acbfbe06747fa173 ]
advk_pcie_setup_phy() initializes and powers on the PHY before the
emulated bridge and IRQ domains are created. If any of those later
initialization steps or pci_host_probe() fails, probe returns without
powering off or exiting the PHY.
Replace the direct returns with staged cleanup labels. Remove IRQ
domains in reverse order, release the emulated bridge allocation only
after successful initialization, and disable the PHY on every failure
after advk_pcie_setup_phy() succeeds. A setup_phy() failure still
returns directly, so its partial internal cleanup is not repeated.
Fixes: 366697018c9a ("PCI: aardvark: Add PHY support")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260910221725.91980-1-mhun512@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/pci-aardvark.c | 31 ++++++++++++++++-----------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index a598a98247ce9..e65fe2ca2515d 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -1881,28 +1881,25 @@ static int advk_pcie_probe(struct platform_device *pdev)
ret = advk_sw_pci_bridge_init(pcie);
if (ret) {
dev_err(dev, "Failed to register emulated root PCI bridge\n");
- return ret;
+ goto err_disable_phy;
}
ret = advk_pcie_init_irq_domain(pcie);
if (ret) {
dev_err(dev, "Failed to initialize irq\n");
- return ret;
+ goto err_cleanup_bridge;
}
ret = advk_pcie_init_msi_irq_domain(pcie);
if (ret) {
dev_err(dev, "Failed to initialize irq\n");
- advk_pcie_remove_irq_domain(pcie);
- return ret;
+ goto err_remove_irq_domain;
}
ret = advk_pcie_init_rp_irq_domain(pcie);
if (ret) {
dev_err(dev, "Failed to initialize irq\n");
- advk_pcie_remove_msi_irq_domain(pcie);
- advk_pcie_remove_irq_domain(pcie);
- return ret;
+ goto err_remove_msi_irq_domain;
}
bridge->sysdata = pcie;
@@ -1910,14 +1907,22 @@ static int advk_pcie_probe(struct platform_device *pdev)
bridge->map_irq = advk_pcie_map_irq;
ret = pci_host_probe(bridge);
- if (ret < 0) {
- advk_pcie_remove_rp_irq_domain(pcie);
- advk_pcie_remove_msi_irq_domain(pcie);
- advk_pcie_remove_irq_domain(pcie);
- return ret;
- }
+ if (ret < 0)
+ goto err_remove_rp_irq_domain;
return 0;
+
+err_remove_rp_irq_domain:
+ advk_pcie_remove_rp_irq_domain(pcie);
+err_remove_msi_irq_domain:
+ advk_pcie_remove_msi_irq_domain(pcie);
+err_remove_irq_domain:
+ advk_pcie_remove_irq_domain(pcie);
+err_cleanup_bridge:
+ pci_bridge_emul_cleanup(&pcie->bridge);
+err_disable_phy:
+ advk_pcie_disable_phy(pcie);
+ return ret;
}
static void advk_pcie_remove(struct platform_device *pdev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0620/1756] arm64: dts: qcom: sm8150: Use SM8150_CX for the SDHC power domain
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (618 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0619/1756] PCI: aardvark: Disable PHY on probe failures Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0621/1756] iommu/vt-d: Fix IQE handling to cover all descriptors in submission range Greg Kroah-Hartman
` (378 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Abel Vesa,
Konrad Dybcio, Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit 475aab59d9870d250f521e202d191899c50a3ded ]
Replace the raw power-domain index of SDHC2 with the SM8150_CX binding
constant, which is the correct power domain in this case.
Fixes: 876644c76034 ("arm64: dts: qcom: sm8150: Add support for SDC2")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260914-qcom-tie-cx-to-gcc-v4-0-9d5a606ada33@oss.qualcomm.com?part=45
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-dts-qcom-sm8150-sdhc-use-mss-for-pd-index-v2-1-a8610199483d@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 0aeceffd872c0..e52c1a4677946 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -3562,7 +3562,7 @@ sdhc_2: mmc@8804000 {
iommus = <&apps_smmu 0x6a0 0x0>;
qcom,dll-config = <0x0007642c>;
qcom,ddr-config = <0x80040868>;
- power-domains = <&rpmhpd 0>;
+ power-domains = <&rpmhpd SM8150_CX>;
operating-points-v2 = <&sdhc2_opp_table>;
status = "disabled";
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0621/1756] iommu/vt-d: Fix IQE handling to cover all descriptors in submission range
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (619 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0620/1756] arm64: dts: qcom: sm8150: Use SM8150_CX for the SDHC power domain Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0622/1756] arm64: dts: st: introduce stm32mp23 SoCs family Greg Kroah-Hartman
` (377 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guanghui Feng, Lu Baolu,
Joerg Roedel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guanghui Feng <guanghuifeng@linux.alibaba.com>
[ Upstream commit 754d07b940c4ce025fab022b548fb5c3d11bf766 ]
When an Invalidation Queue Error (IQE) occurs, hardware halts fetching
and IQH points at the faulting descriptor. The previous code only
checked whether IQH matched the first descriptor index of the current
submission, missing faults on any other descriptor within the batch.
Expand the check to cover the entire submission range [index, wait_index],
accounting for circular wrap-around.
Furthermore, after detecting IQE, the old recovery only replaced the
single faulting slot with a copy of the wait descriptor and immediately
returned -EINVAL. This left two problems:
a) Hardware resumed fetching and could hit another invalid descriptor
in the same abandoned batch, raising a second IQE that no submitter
would claim — permanently deadlocking the queue.
b) The caller reclaimed all batch slots (QI_FREE) while hardware might
still be asynchronously processing descriptors from that batch,
allowing concurrent overwrite and descriptor corruption.
Fix both by introducing qi_drain_remaining_descs(): upon IQE detection,
overwrite the stranded slots in [IQH, wait_index) with fenced no-op wait
descriptors, resubmit the wait descriptor at wait_index, clear IQE, and
spin until hardware signals QI_DONE (with DMAR_OPERATION_TIMEOUT). This
guarantees hardware has fully drained the batch before the caller
reclaims slots.
Fixes: 8a1d82462540 ("iommu/vt-d: Multiple descriptors per qi_submit_sync()")
Signed-off-by: Guanghui Feng <guanghuifeng@linux.alibaba.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/intel/dmar.c | 72 ++++++++++++++++++++++++++++++++------
1 file changed, 61 insertions(+), 11 deletions(-)
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 5598cd77c5378..cd169eaa65552 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1278,6 +1278,49 @@ static void qi_dump_fault(struct intel_iommu *iommu, u32 fault)
(unsigned long long)desc->qw1);
}
+static int qi_drain_remaining_descs(struct intel_iommu *iommu, int head,
+ int wait_index)
+{
+ struct q_inval *qi = iommu->qi;
+ int shift = qi_shift(iommu);
+ struct qi_desc wait_desc = {};
+ struct qi_desc nop_desc = {};
+ cycles_t start;
+
+ nop_desc.qw0 = QI_IWD_FENCE | QI_IWD_TYPE;
+
+ wait_desc.qw0 = QI_IWD_STATUS_DATA(QI_DONE) | QI_IWD_PRQ_DRAIN |
+ QI_IWD_STATUS_WRITE | QI_IWD_FENCE | QI_IWD_TYPE;
+ wait_desc.qw1 = virt_to_phys(&qi->desc_status[wait_index]);
+
+ while (head != wait_index) {
+ memcpy(qi->desc + (head << shift), &nop_desc, 1 << shift);
+ head = (head + 1) % QI_LENGTH;
+ }
+
+ WRITE_ONCE(qi->desc_status[wait_index], QI_IN_USE);
+ memcpy(qi->desc + (wait_index << shift), &wait_desc, 1 << shift);
+
+ /*
+ * Order the descriptor rewrites before the writel() that restarts
+ * the fetch engine.
+ */
+ wmb();
+
+ writel(DMA_FSTS_IQE, iommu->reg + DMAR_FSTS_REG);
+
+ start = get_cycles();
+ while (READ_ONCE(qi->desc_status[wait_index]) != QI_DONE) {
+ if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start)) {
+ pr_err("Timeout draining invalidation queue after IQE\n");
+ return -ETIMEDOUT;
+ }
+ cpu_relax();
+ }
+
+ return 0;
+}
+
static int qi_check_fault(struct intel_iommu *iommu, int index, int wait_index)
{
u32 fault;
@@ -1300,18 +1343,25 @@ static int qi_check_fault(struct intel_iommu *iommu, int index, int wait_index)
* is cleared.
*/
if (fault & DMA_FSTS_IQE) {
+ int head_idx, ret;
+
head = readl(iommu->reg + DMAR_IQH_REG);
- if ((head >> shift) == index) {
- struct qi_desc *desc = qi->desc + head;
-
- /*
- * desc->qw2 and desc->qw3 are either reserved or
- * used by software as private data. We won't print
- * out these two qw's for security consideration.
- */
- memcpy(desc, qi->desc + (wait_index << shift),
- 1 << shift);
- writel(DMA_FSTS_IQE, iommu->reg + DMAR_FSTS_REG);
+ head_idx = (head >> shift) % QI_LENGTH;
+
+ /*
+ * The faulting descriptor can be anywhere within the current
+ * submission's range [index, wait_index]. Since the queue is
+ * circular, this submission may wrap around QI_LENGTH
+ * (index > wait_index in that case), so check both the
+ * non-wrapped and wrapped cases of the range.
+ */
+ if (index <= wait_index ?
+ (head_idx >= index && head_idx <= wait_index) :
+ (head_idx >= index || head_idx <= wait_index)) {
+ ret = qi_drain_remaining_descs(iommu, head_idx, wait_index);
+ if (ret)
+ return ret;
+
pr_info("Invalidation Queue Error (IQE) cleared\n");
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0622/1756] arm64: dts: st: introduce stm32mp23 SoCs family
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (620 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0621/1756] iommu/vt-d: Fix IQE handling to cover all descriptors in submission range Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0623/1756] arm64: dts: st: fix arm,smc-id of the SMC watchdog on stm32mp2 Greg Kroah-Hartman
` (376 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Torgue, Amelie Delaunay,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Torgue <alexandre.torgue@foss.st.com>
[ Upstream commit e9b03ef21386e7583806e1e624a8b44c6722b365 ]
STM32MP23 family is composed of 3 SoCs defined as following:
-STM32MP231: common part composed of 1*Cortex-A35, common peripherals
like SDMMC, UART, SPI, I2C, parallel display, 1*ETH ...
-STM32MP233: STM32MP231 + 1*Cortex-A35 (dual CPU), a second ETH, CAN-FD.
-STM32MP235: STM32MP233 + GPU/AI and video encode/decode, DSI and LDVS
display.
A second diversity layer exists for security features/ A35 frequency:
-STM32MP23xY, "Y" gives information:
-Y = A means A35@1.2GHz + no cryp IP and no secure boot.
-Y = C means A35@1.2GHz + cryp IP and secure boot.
-Y = D means A35@1.5GHz + no cryp IP and no secure boot.
-Y = F means A35@1.5GHz + cryp IP and secure boot.
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250225-b4-stm32mp2_new_dts-v2-5-1a628c1580c7@foss.st.com
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Stable-dep-of: ae4d08bbe3f4 ("arm64: dts: st: fix arm,smc-id of the SMC watchdog on stm32mp2")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/st/stm32mp231.dtsi | 1214 +++++++++++++++++++++++
arch/arm64/boot/dts/st/stm32mp233.dtsi | 94 ++
arch/arm64/boot/dts/st/stm32mp235.dtsi | 16 +
arch/arm64/boot/dts/st/stm32mp23xc.dtsi | 8 +
arch/arm64/boot/dts/st/stm32mp23xf.dtsi | 8 +
5 files changed, 1340 insertions(+)
create mode 100644 arch/arm64/boot/dts/st/stm32mp231.dtsi
create mode 100644 arch/arm64/boot/dts/st/stm32mp233.dtsi
create mode 100644 arch/arm64/boot/dts/st/stm32mp235.dtsi
create mode 100644 arch/arm64/boot/dts/st/stm32mp23xc.dtsi
create mode 100644 arch/arm64/boot/dts/st/stm32mp23xf.dtsi
diff --git a/arch/arm64/boot/dts/st/stm32mp231.dtsi b/arch/arm64/boot/dts/st/stm32mp231.dtsi
new file mode 100644
index 0000000000000..8820d219a33e6
--- /dev/null
+++ b/arch/arm64/boot/dts/st/stm32mp231.dtsi
@@ -0,0 +1,1214 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2025 - All Rights Reserved
+ * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
+ */
+#include <dt-bindings/clock/st,stm32mp25-rcc.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/regulator/st,stm32mp25-regulator.h>
+#include <dt-bindings/reset/st,stm32mp25-rcc.h>
+
+/ {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu0: cpu@0 {
+ compatible = "arm,cortex-a35";
+ reg = <0>;
+ device_type = "cpu";
+ enable-method = "psci";
+ power-domains = <&cpu0_pd>;
+ power-domain-names = "psci";
+ };
+ };
+
+ arm-pmu {
+ compatible = "arm,cortex-a35-pmu";
+ interrupts = <GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-affinity = <&cpu0>;
+ interrupt-parent = <&intc>;
+ };
+
+ arm_wdt: watchdog {
+ compatible = "arm,smc-wdt";
+ arm,smc-id = <0xb200005a>;
+ status = "disabled";
+ };
+
+ clk_dsi_txbyte: clock-0 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <0>;
+ };
+
+ clk_rcbsec: clk-64000000 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <64000000>;
+ };
+
+ firmware {
+ optee: optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ interrupt-parent = <&intc>;
+ interrupts = <GIC_PPI 15 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
+ };
+
+ scmi {
+ compatible = "linaro,scmi-optee";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ linaro,optee-channel-id = <0>;
+
+ scmi_clk: protocol@14 {
+ reg = <0x14>;
+ #clock-cells = <1>;
+ };
+
+ scmi_reset: protocol@16 {
+ reg = <0x16>;
+ #reset-cells = <1>;
+ };
+
+ scmi_voltd: protocol@17 {
+ reg = <0x17>;
+
+ scmi_regu: regulators {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ scmi_vddio1: regulator@0 {
+ reg = <VOLTD_SCMI_VDDIO1>;
+ regulator-name = "vddio1";
+ };
+ scmi_vddio2: regulator@1 {
+ reg = <VOLTD_SCMI_VDDIO2>;
+ regulator-name = "vddio2";
+ };
+ scmi_vddio3: regulator@2 {
+ reg = <VOLTD_SCMI_VDDIO3>;
+ regulator-name = "vddio3";
+ };
+ scmi_vddio4: regulator@3 {
+ reg = <VOLTD_SCMI_VDDIO4>;
+ regulator-name = "vddio4";
+ };
+ scmi_vdd33ucpd: regulator@5 {
+ reg = <VOLTD_SCMI_UCPD>;
+ regulator-name = "vdd33ucpd";
+ };
+ scmi_vdda18adc: regulator@7 {
+ reg = <VOLTD_SCMI_ADC>;
+ regulator-name = "vdda18adc";
+ };
+ };
+ };
+ };
+ };
+
+ psci {
+ compatible = "arm,psci-1.0";
+ method = "smc";
+
+ cpu0_pd: power-domain-cpu0 {
+ #power-domain-cells = <0>;
+ power-domains = <&cluster_pd>;
+ };
+
+ cluster_pd: power-domain-cluster {
+ #power-domain-cells = <0>;
+ power-domains = <&ret_pd>;
+ };
+
+ ret_pd: power-domain-retention {
+ #power-domain-cells = <0>;
+ };
+ };
+
+ timer {
+ compatible = "arm,armv8-timer";
+ interrupt-parent = <&intc>;
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
+ always-on;
+ };
+
+ soc@0 {
+ compatible = "simple-bus";
+ ranges = <0x0 0x0 0x0 0x80000000>;
+ interrupt-parent = <&intc>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hpdma: dma-controller@40400000 {
+ compatible = "st,stm32mp25-dma3";
+ reg = <0x40400000 0x1000>;
+ interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&scmi_clk CK_SCMI_HPDMA1>;
+ #dma-cells = <3>;
+ };
+
+ hpdma2: dma-controller@40410000 {
+ compatible = "st,stm32mp25-dma3";
+ reg = <0x40410000 0x1000>;
+ interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&scmi_clk CK_SCMI_HPDMA2>;
+ #dma-cells = <3>;
+ };
+
+ hpdma3: dma-controller@40420000 {
+ compatible = "st,stm32mp25-dma3";
+ reg = <0x40420000 0x1000>;
+ interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&scmi_clk CK_SCMI_HPDMA3>;
+ #dma-cells = <3>;
+ };
+
+ rifsc: bus@42080000 {
+ compatible = "st,stm32mp25-rifsc", "simple-bus";
+ reg = <0x42080000 0x1000>;
+ ranges;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #access-controller-cells = <1>;
+
+ i2s2: audio-controller@400b0000 {
+ compatible = "st,stm32mp25-i2s";
+ reg = <0x400b0000 0x400>;
+ #sound-dai-cells = <0>;
+ interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_BUS_SPI2>, <&rcc CK_KER_SPI2>;
+ clock-names = "pclk", "i2sclk";
+ resets = <&rcc SPI2_R>;
+ dmas = <&hpdma 51 0x43 0x12>,
+ <&hpdma 52 0x43 0x21>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 23>;
+ status = "disabled";
+ };
+
+ spi2: spi@400b0000 {
+ compatible = "st,stm32mp25-spi";
+ reg = <0x400b0000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SPI2>;
+ resets = <&rcc SPI2_R>;
+ dmas = <&hpdma 51 0x20 0x3012>,
+ <&hpdma 52 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 23>;
+ status = "disabled";
+ };
+
+ i2s3: audio-controller@400c0000 {
+ compatible = "st,stm32mp25-i2s";
+ reg = <0x400c0000 0x400>;
+ #sound-dai-cells = <0>;
+ interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_BUS_SPI3>, <&rcc CK_KER_SPI3>;
+ clock-names = "pclk", "i2sclk";
+ resets = <&rcc SPI3_R>;
+ dmas = <&hpdma 53 0x43 0x12>,
+ <&hpdma 54 0x43 0x21>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 24>;
+ status = "disabled";
+ };
+
+ spi3: spi@400c0000 {
+ compatible = "st,stm32mp25-spi";
+ reg = <0x400c0000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SPI3>;
+ resets = <&rcc SPI3_R>;
+ dmas = <&hpdma 53 0x20 0x3012>,
+ <&hpdma 54 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 24>;
+ status = "disabled";
+ };
+
+ spdifrx: audio-controller@400d0000 {
+ compatible = "st,stm32h7-spdifrx";
+ reg = <0x400d0000 0x400>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SPDIFRX>;
+ clock-names = "kclk";
+ interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&hpdma 71 0x43 0x212>,
+ <&hpdma 72 0x43 0x212>;
+ dma-names = "rx", "rx-ctrl";
+ access-controllers = <&rifsc 30>;
+ status = "disabled";
+ };
+
+ usart2: serial@400e0000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x400e0000 0x400>;
+ interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_USART2>;
+ dmas = <&hpdma 11 0x20 0x10012>,
+ <&hpdma 12 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 32>;
+ status = "disabled";
+ };
+
+ usart3: serial@400f0000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x400f0000 0x400>;
+ interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_USART3>;
+ dmas = <&hpdma 13 0x20 0x10012>,
+ <&hpdma 14 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 33>;
+ status = "disabled";
+ };
+
+ uart4: serial@40100000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x40100000 0x400>;
+ interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_UART4>;
+ dmas = <&hpdma 15 0x20 0x10012>,
+ <&hpdma 16 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 34>;
+ status = "disabled";
+ };
+
+ uart5: serial@40110000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x40110000 0x400>;
+ interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_UART5>;
+ dmas = <&hpdma 17 0x20 0x10012>,
+ <&hpdma 18 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 35>;
+ status = "disabled";
+ };
+
+ i2c1: i2c@40120000 {
+ compatible = "st,stm32mp25-i2c";
+ reg = <0x40120000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupt-names = "event";
+ interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_I2C1>;
+ resets = <&rcc I2C1_R>;
+ dmas = <&hpdma 27 0x20 0x3012>,
+ <&hpdma 28 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 41>;
+ status = "disabled";
+ };
+
+ i2c2: i2c@40130000 {
+ compatible = "st,stm32mp25-i2c";
+ reg = <0x40130000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupt-names = "event";
+ interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_I2C2>;
+ resets = <&rcc I2C2_R>;
+ dmas = <&hpdma 30 0x20 0x3012>,
+ <&hpdma 31 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 42>;
+ status = "disabled";
+ };
+
+ i2c7: i2c@40180000 {
+ compatible = "st,stm32mp25-i2c";
+ reg = <0x40180000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupt-names = "event";
+ interrupts = <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_I2C7>;
+ resets = <&rcc I2C7_R>;
+ dmas = <&hpdma 45 0x20 0x3012>,
+ <&hpdma 46 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 47>;
+ status = "disabled";
+ };
+
+ usart6: serial@40220000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x40220000 0x400>;
+ interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_USART6>;
+ dmas = <&hpdma 19 0x20 0x10012>,
+ <&hpdma 20 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 36>;
+ status = "disabled";
+ };
+
+ i2s1: audio-controller@40230000 {
+ compatible = "st,stm32mp25-i2s";
+ reg = <0x40230000 0x400>;
+ #sound-dai-cells = <0>;
+ interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_BUS_SPI1>, <&rcc CK_KER_SPI1>;
+ clock-names = "pclk", "i2sclk";
+ resets = <&rcc SPI1_R>;
+ dmas = <&hpdma 49 0x43 0x12>,
+ <&hpdma 50 0x43 0x21>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 22>;
+ status = "disabled";
+ };
+
+ spi1: spi@40230000 {
+ compatible = "st,stm32mp25-spi";
+ reg = <0x40230000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SPI1>;
+ resets = <&rcc SPI1_R>;
+ dmas = <&hpdma 49 0x20 0x3012>,
+ <&hpdma 50 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 22>;
+ status = "disabled";
+ };
+
+ spi4: spi@40240000 {
+ compatible = "st,stm32mp25-spi";
+ reg = <0x40240000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SPI4>;
+ resets = <&rcc SPI4_R>;
+ dmas = <&hpdma 55 0x20 0x3012>,
+ <&hpdma 56 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 25>;
+ status = "disabled";
+ };
+
+ spi5: spi@40280000 {
+ compatible = "st,stm32mp25-spi";
+ reg = <0x40280000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SPI5>;
+ resets = <&rcc SPI5_R>;
+ dmas = <&hpdma 57 0x20 0x3012>,
+ <&hpdma 58 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 26>;
+ status = "disabled";
+ };
+
+ sai1: sai@40290000 {
+ compatible = "st,stm32mp25-sai";
+ reg = <0x40290000 0x4>, <0x4029a3f0 0x10>;
+ ranges = <0 0x40290000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&rcc CK_BUS_SAI1>;
+ clock-names = "pclk";
+ interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc SAI1_R>;
+ access-controllers = <&rifsc 49>;
+ status = "disabled";
+
+ sai1a: audio-controller@40290004 {
+ compatible = "st,stm32-sai-sub-a";
+ reg = <0x4 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI1>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 73 0x43 0x21>;
+ status = "disabled";
+ };
+
+ sai1b: audio-controller@40290024 {
+ compatible = "st,stm32-sai-sub-b";
+ reg = <0x24 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI1>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 74 0x43 0x12>;
+ status = "disabled";
+ };
+ };
+
+ sai2: sai@402a0000 {
+ compatible = "st,stm32mp25-sai";
+ reg = <0x402a0000 0x4>, <0x402aa3f0 0x10>;
+ ranges = <0 0x402a0000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&rcc CK_BUS_SAI2>;
+ clock-names = "pclk";
+ interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc SAI2_R>;
+ access-controllers = <&rifsc 50>;
+ status = "disabled";
+
+ sai2a: audio-controller@402a0004 {
+ compatible = "st,stm32-sai-sub-a";
+ reg = <0x4 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI2>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 75 0x43 0x21>;
+ status = "disabled";
+ };
+
+ sai2b: audio-controller@402a0024 {
+ compatible = "st,stm32-sai-sub-b";
+ reg = <0x24 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI2>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 76 0x43 0x12>;
+ status = "disabled";
+ };
+ };
+
+ sai3: sai@402b0000 {
+ compatible = "st,stm32mp25-sai";
+ reg = <0x402b0000 0x4>, <0x402ba3f0 0x10>;
+ ranges = <0 0x402b0000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&rcc CK_BUS_SAI3>;
+ clock-names = "pclk";
+ interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc SAI3_R>;
+ access-controllers = <&rifsc 51>;
+ status = "disabled";
+
+ sai3a: audio-controller@402b0004 {
+ compatible = "st,stm32-sai-sub-a";
+ reg = <0x4 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI3>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 77 0x43 0x21>;
+ status = "disabled";
+ };
+
+ sai3b: audio-controller@502b0024 {
+ compatible = "st,stm32-sai-sub-b";
+ reg = <0x24 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI3>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 78 0x43 0x12>;
+ status = "disabled";
+ };
+ };
+
+ usart1: serial@40330000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x40330000 0x400>;
+ interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_USART1>;
+ dmas = <&hpdma 9 0x20 0x10012>,
+ <&hpdma 10 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 31>;
+ status = "disabled";
+ };
+
+ sai4: sai@40340000 {
+ compatible = "st,stm32mp25-sai";
+ reg = <0x40340000 0x4>, <0x4034a3f0 0x10>;
+ ranges = <0 0x40340000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&rcc CK_BUS_SAI4>;
+ clock-names = "pclk";
+ interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc SAI4_R>;
+ access-controllers = <&rifsc 52>;
+ status = "disabled";
+
+ sai4a: audio-controller@40340004 {
+ compatible = "st,stm32-sai-sub-a";
+ reg = <0x4 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI4>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 79 0x63 0x21>;
+ status = "disabled";
+ };
+
+ sai4b: audio-controller@40340024 {
+ compatible = "st,stm32-sai-sub-b";
+ reg = <0x24 0x20>;
+ #sound-dai-cells = <0>;
+ clocks = <&rcc CK_KER_SAI4>;
+ clock-names = "sai_ck";
+ dmas = <&hpdma 80 0x43 0x12>;
+ status = "disabled";
+ };
+ };
+
+ uart7: serial@40370000 {
+ compatible = "st,stm32h7-uart";
+ reg = <0x40370000 0x400>;
+ interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_UART7>;
+ dmas = <&hpdma 21 0x20 0x10012>,
+ <&hpdma 22 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 37>;
+ status = "disabled";
+ };
+
+ rng: rng@42020000 {
+ compatible = "st,stm32mp25-rng";
+ reg = <0x42020000 0x400>;
+ clocks = <&clk_rcbsec>, <&rcc CK_BUS_RNG>;
+ clock-names = "core", "bus";
+ resets = <&rcc RNG_R>;
+ access-controllers = <&rifsc 92>;
+ status = "disabled";
+ };
+
+ spi8: spi@46020000 {
+ compatible = "st,stm32mp25-spi";
+ reg = <0x46020000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SPI8>;
+ resets = <&rcc SPI8_R>;
+ dmas = <&hpdma 171 0x20 0x3012>,
+ <&hpdma 172 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 29>;
+ status = "disabled";
+ };
+
+ i2c8: i2c@46040000 {
+ compatible = "st,stm32mp25-i2c";
+ reg = <0x46040000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupt-names = "event";
+ interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_I2C8>;
+ resets = <&rcc I2C8_R>;
+ dmas = <&hpdma 168 0x20 0x3012>,
+ <&hpdma 169 0x20 0x3021>;
+ dma-names = "rx", "tx";
+ access-controllers = <&rifsc 48>;
+ status = "disabled";
+ };
+
+ csi: csi@48020000 {
+ compatible = "st,stm32mp25-csi";
+ reg = <0x48020000 0x2000>;
+ interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc CSI_R>;
+ clocks = <&rcc CK_KER_CSI>, <&rcc CK_KER_CSITXESC>,
+ <&rcc CK_KER_CSIPHY>;
+ clock-names = "pclk", "txesc", "csi2phy";
+ access-controllers = <&rifsc 86>;
+ status = "disabled";
+ };
+
+ dcmipp: dcmipp@48030000 {
+ compatible = "st,stm32mp25-dcmipp";
+ reg = <0x48030000 0x1000>;
+ interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rcc DCMIPP_R>;
+ clocks = <&rcc CK_BUS_DCMIPP>, <&rcc CK_KER_CSI>;
+ clock-names = "kclk", "mclk";
+ access-controllers = <&rifsc 87>;
+ status = "disabled";
+ };
+
+ sdmmc1: mmc@48220000 {
+ compatible = "st,stm32mp25-sdmmc2", "arm,pl18x", "arm,primecell";
+ reg = <0x48220000 0x400>, <0x44230400 0x8>;
+ arm,primecell-periphid = <0x00353180>;
+ interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_KER_SDMMC1 >;
+ clock-names = "apb_pclk";
+ resets = <&rcc SDMMC1_R>;
+ cap-sd-highspeed;
+ cap-mmc-highspeed;
+ max-frequency = <120000000>;
+ access-controllers = <&rifsc 76>;
+ status = "disabled";
+ };
+
+ ethernet1: ethernet@482c0000 {
+ compatible = "st,stm32mp25-dwmac", "snps,dwmac-5.20";
+ reg = <0x482c0000 0x4000>;
+ reg-names = "stmmaceth";
+ interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clock-names = "stmmaceth",
+ "mac-clk-tx",
+ "mac-clk-rx",
+ "ptp_ref",
+ "ethstp",
+ "eth-ck";
+ clocks = <&rcc CK_ETH1_MAC>,
+ <&rcc CK_ETH1_TX>,
+ <&rcc CK_ETH1_RX>,
+ <&rcc CK_KER_ETH1PTP>,
+ <&rcc CK_ETH1_STP>,
+ <&rcc CK_KER_ETH1>;
+ snps,axi-config = <&stmmac_axi_config_1>;
+ snps,mixed-burst;
+ snps,mtl-rx-config = <&mtl_rx_setup_1>;
+ snps,mtl-tx-config = <&mtl_tx_setup_1>;
+ snps,pbl = <2>;
+ snps,tso;
+ st,syscon = <&syscfg 0x3000>;
+ access-controllers = <&rifsc 60>;
+ status = "disabled";
+
+ mtl_rx_setup_1: rx-queues-config {
+ snps,rx-queues-to-use = <2>;
+ queue0 {};
+ queue1 {};
+ };
+
+ mtl_tx_setup_1: tx-queues-config {
+ snps,tx-queues-to-use = <4>;
+ queue0 {};
+ queue1 {};
+ queue2 {};
+ queue3 {};
+ };
+
+ stmmac_axi_config_1: stmmac-axi-config {
+ snps,blen = <0 0 0 0 16 8 4>;
+ snps,rd_osr_lmt = <0x7>;
+ snps,wr_osr_lmt = <0x7>;
+ };
+ };
+ };
+
+ bsec: efuse@44000000 {
+ compatible = "st,stm32mp25-bsec";
+ reg = <0x44000000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ part_number_otp@24 {
+ reg = <0x24 0x4>;
+ };
+
+ package_otp@1e8 {
+ reg = <0x1e8 0x1>;
+ bits = <0 3>;
+ };
+ };
+
+ rcc: clock-controller@44200000 {
+ compatible = "st,stm32mp25-rcc";
+ reg = <0x44200000 0x10000>;
+ #clock-cells = <1>;
+ #reset-cells = <1>;
+ clocks = <&scmi_clk CK_SCMI_HSE>,
+ <&scmi_clk CK_SCMI_HSI>,
+ <&scmi_clk CK_SCMI_MSI>,
+ <&scmi_clk CK_SCMI_LSE>,
+ <&scmi_clk CK_SCMI_LSI>,
+ <&scmi_clk CK_SCMI_HSE_DIV2>,
+ <&scmi_clk CK_SCMI_ICN_HS_MCU>,
+ <&scmi_clk CK_SCMI_ICN_LS_MCU>,
+ <&scmi_clk CK_SCMI_ICN_SDMMC>,
+ <&scmi_clk CK_SCMI_ICN_DDR>,
+ <&scmi_clk CK_SCMI_ICN_DISPLAY>,
+ <&scmi_clk CK_SCMI_ICN_HSL>,
+ <&scmi_clk CK_SCMI_ICN_NIC>,
+ <&scmi_clk CK_SCMI_ICN_VID>,
+ <&scmi_clk CK_SCMI_FLEXGEN_07>,
+ <&scmi_clk CK_SCMI_FLEXGEN_08>,
+ <&scmi_clk CK_SCMI_FLEXGEN_09>,
+ <&scmi_clk CK_SCMI_FLEXGEN_10>,
+ <&scmi_clk CK_SCMI_FLEXGEN_11>,
+ <&scmi_clk CK_SCMI_FLEXGEN_12>,
+ <&scmi_clk CK_SCMI_FLEXGEN_13>,
+ <&scmi_clk CK_SCMI_FLEXGEN_14>,
+ <&scmi_clk CK_SCMI_FLEXGEN_15>,
+ <&scmi_clk CK_SCMI_FLEXGEN_16>,
+ <&scmi_clk CK_SCMI_FLEXGEN_17>,
+ <&scmi_clk CK_SCMI_FLEXGEN_18>,
+ <&scmi_clk CK_SCMI_FLEXGEN_19>,
+ <&scmi_clk CK_SCMI_FLEXGEN_20>,
+ <&scmi_clk CK_SCMI_FLEXGEN_21>,
+ <&scmi_clk CK_SCMI_FLEXGEN_22>,
+ <&scmi_clk CK_SCMI_FLEXGEN_23>,
+ <&scmi_clk CK_SCMI_FLEXGEN_24>,
+ <&scmi_clk CK_SCMI_FLEXGEN_25>,
+ <&scmi_clk CK_SCMI_FLEXGEN_26>,
+ <&scmi_clk CK_SCMI_FLEXGEN_27>,
+ <&scmi_clk CK_SCMI_FLEXGEN_28>,
+ <&scmi_clk CK_SCMI_FLEXGEN_29>,
+ <&scmi_clk CK_SCMI_FLEXGEN_30>,
+ <&scmi_clk CK_SCMI_FLEXGEN_31>,
+ <&scmi_clk CK_SCMI_FLEXGEN_32>,
+ <&scmi_clk CK_SCMI_FLEXGEN_33>,
+ <&scmi_clk CK_SCMI_FLEXGEN_34>,
+ <&scmi_clk CK_SCMI_FLEXGEN_35>,
+ <&scmi_clk CK_SCMI_FLEXGEN_36>,
+ <&scmi_clk CK_SCMI_FLEXGEN_37>,
+ <&scmi_clk CK_SCMI_FLEXGEN_38>,
+ <&scmi_clk CK_SCMI_FLEXGEN_39>,
+ <&scmi_clk CK_SCMI_FLEXGEN_40>,
+ <&scmi_clk CK_SCMI_FLEXGEN_41>,
+ <&scmi_clk CK_SCMI_FLEXGEN_42>,
+ <&scmi_clk CK_SCMI_FLEXGEN_43>,
+ <&scmi_clk CK_SCMI_FLEXGEN_44>,
+ <&scmi_clk CK_SCMI_FLEXGEN_45>,
+ <&scmi_clk CK_SCMI_FLEXGEN_46>,
+ <&scmi_clk CK_SCMI_FLEXGEN_47>,
+ <&scmi_clk CK_SCMI_FLEXGEN_48>,
+ <&scmi_clk CK_SCMI_FLEXGEN_49>,
+ <&scmi_clk CK_SCMI_FLEXGEN_50>,
+ <&scmi_clk CK_SCMI_FLEXGEN_51>,
+ <&scmi_clk CK_SCMI_FLEXGEN_52>,
+ <&scmi_clk CK_SCMI_FLEXGEN_53>,
+ <&scmi_clk CK_SCMI_FLEXGEN_54>,
+ <&scmi_clk CK_SCMI_FLEXGEN_55>,
+ <&scmi_clk CK_SCMI_FLEXGEN_56>,
+ <&scmi_clk CK_SCMI_FLEXGEN_57>,
+ <&scmi_clk CK_SCMI_FLEXGEN_58>,
+ <&scmi_clk CK_SCMI_FLEXGEN_59>,
+ <&scmi_clk CK_SCMI_FLEXGEN_60>,
+ <&scmi_clk CK_SCMI_FLEXGEN_61>,
+ <&scmi_clk CK_SCMI_FLEXGEN_62>,
+ <&scmi_clk CK_SCMI_FLEXGEN_63>,
+ <&scmi_clk CK_SCMI_ICN_APB1>,
+ <&scmi_clk CK_SCMI_ICN_APB2>,
+ <&scmi_clk CK_SCMI_ICN_APB3>,
+ <&scmi_clk CK_SCMI_ICN_APB4>,
+ <&scmi_clk CK_SCMI_ICN_APBDBG>,
+ <&scmi_clk CK_SCMI_TIMG1>,
+ <&scmi_clk CK_SCMI_TIMG2>,
+ <&scmi_clk CK_SCMI_PLL3>,
+ <&clk_dsi_txbyte>;
+ access-controllers = <&rifsc 156>;
+ };
+
+ exti1: interrupt-controller@44220000 {
+ compatible = "st,stm32mp1-exti", "syscon";
+ reg = <0x44220000 0x400>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ interrupts-extended =
+ <&intc GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_0 */
+ <&intc GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_10 */
+ <&intc GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
+ <0>, /* EXTI_20 */
+ <&intc GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_30 */
+ <&intc GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <&intc GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_40 */
+ <&intc GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_50 */
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>,
+ <0>, /* EXTI_60 */
+ <&intc GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <&intc GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_70 */
+ <0>,
+ <&intc GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>,
+ <0>, /* EXTI_80 */
+ <0>,
+ <0>,
+ <&intc GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ syscfg: syscon@44230000 {
+ compatible = "st,stm32mp23-syscfg", "syscon";
+ reg = <0x44230000 0x10000>;
+ };
+
+ pinctrl: pinctrl@44240000 {
+ compatible = "st,stm32mp257-pinctrl";
+ ranges = <0 0x44240000 0xa0400>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ interrupt-parent = <&exti1>;
+ st,syscfg = <&exti1 0x60 0xff>;
+ pins-are-numbered;
+
+ gpioa: gpio@44240000 {
+ reg = <0x0 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOA>;
+ st,bank-name = "GPIOA";
+ status = "disabled";
+ };
+
+ gpiob: gpio@44250000 {
+ reg = <0x10000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOB>;
+ st,bank-name = "GPIOB";
+ status = "disabled";
+ };
+
+ gpioc: gpio@44260000 {
+ reg = <0x20000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOC>;
+ st,bank-name = "GPIOC";
+ status = "disabled";
+ };
+
+ gpiod: gpio@44270000 {
+ reg = <0x30000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOD>;
+ st,bank-name = "GPIOD";
+ status = "disabled";
+ };
+
+ gpioe: gpio@44280000 {
+ reg = <0x40000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOE>;
+ st,bank-name = "GPIOE";
+ status = "disabled";
+ };
+
+ gpiof: gpio@44290000 {
+ reg = <0x50000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOF>;
+ st,bank-name = "GPIOF";
+ status = "disabled";
+ };
+
+ gpiog: gpio@442a0000 {
+ reg = <0x60000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOG>;
+ st,bank-name = "GPIOG";
+ status = "disabled";
+ };
+
+ gpioh: gpio@442b0000 {
+ reg = <0x70000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOH>;
+ st,bank-name = "GPIOH";
+ status = "disabled";
+ };
+
+ gpioi: gpio@442c0000 {
+ reg = <0x80000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOI>;
+ st,bank-name = "GPIOI";
+ status = "disabled";
+ };
+
+ gpioj: gpio@442d0000 {
+ reg = <0x90000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOJ>;
+ st,bank-name = "GPIOJ";
+ status = "disabled";
+ };
+
+ gpiok: gpio@442e0000 {
+ reg = <0xa0000 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOK>;
+ st,bank-name = "GPIOK";
+ status = "disabled";
+ };
+ };
+
+ rtc: rtc@46000000 {
+ compatible = "st,stm32mp25-rtc";
+ reg = <0x46000000 0x400>;
+ clocks = <&scmi_clk CK_SCMI_RTC>,
+ <&scmi_clk CK_SCMI_RTCCK>;
+ clock-names = "pclk", "rtc_ck";
+ interrupts-extended = <&exti2 17 IRQ_TYPE_LEVEL_HIGH>;
+ status = "disabled";
+ };
+
+ pinctrl_z: pinctrl@46200000 {
+ compatible = "st,stm32mp257-z-pinctrl";
+ ranges = <0 0x46200000 0x400>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ interrupt-parent = <&exti1>;
+ st,syscfg = <&exti1 0x60 0xff>;
+ pins-are-numbered;
+
+ gpioz: gpio@46200000 {
+ reg = <0 0x400>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ clocks = <&scmi_clk CK_SCMI_GPIOZ>;
+ st,bank-name = "GPIOZ";
+ st,bank-ioport = <11>;
+ status = "disabled";
+ };
+
+ };
+
+ exti2: interrupt-controller@46230000 {
+ compatible = "st,stm32mp1-exti", "syscon";
+ reg = <0x46230000 0x400>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ interrupts-extended =
+ <&intc GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_0 */
+ <&intc GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_10 */
+ <&intc GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <0>, /* EXTI_20 */
+ <&intc GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <&intc GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_30 */
+ <&intc GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <&intc GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_40 */
+ <0>,
+ <0>,
+ <&intc GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <&intc GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, /* EXTI_50 */
+ <&intc GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>,
+ <0>, /* EXTI_60 */
+ <&intc GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <&intc GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
+ <0>,
+ <0>,
+ <&intc GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH>; /* EXTI_70 */
+ };
+
+ intc: interrupt-controller@4ac10000 {
+ compatible = "arm,cortex-a7-gic";
+ reg = <0x4ac10000 0x1000>,
+ <0x4ac20000 0x2000>,
+ <0x4ac40000 0x2000>,
+ <0x4ac60000 0x2000>;
+ #interrupt-cells = <3>;
+ #address-cells = <1>;
+ interrupt-controller;
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/st/stm32mp233.dtsi b/arch/arm64/boot/dts/st/stm32mp233.dtsi
new file mode 100644
index 0000000000000..78f4059fca5db
--- /dev/null
+++ b/arch/arm64/boot/dts/st/stm32mp233.dtsi
@@ -0,0 +1,94 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2025 - All Rights Reserved
+ * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
+ */
+#include "stm32mp231.dtsi"
+
+/ {
+ cpus {
+ cpu1: cpu@1 {
+ compatible = "arm,cortex-a35";
+ reg = <1>;
+ device_type = "cpu";
+ enable-method = "psci";
+ power-domains = <&cpu1_pd>;
+ power-domain-names = "psci";
+ };
+ };
+
+ arm-pmu {
+ interrupts = <GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 369 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-affinity = <&cpu0>, <&cpu1>;
+ };
+
+ psci {
+ cpu1_pd: power-domain-cpu1 {
+ #power-domain-cells = <0>;
+ power-domains = <&cluster_pd>;
+ };
+ };
+
+ timer {
+ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+ };
+};
+
+&optee {
+ interrupts = <GIC_PPI 15 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+};
+
+&rifsc {
+ ethernet2: ethernet@482d0000 {
+ compatible = "st,stm32mp25-dwmac", "snps,dwmac-5.20";
+ reg = <0x482d0000 0x4000>;
+ reg-names = "stmmaceth";
+ interrupts-extended = <&intc GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clock-names = "stmmaceth",
+ "mac-clk-tx",
+ "mac-clk-rx",
+ "ptp_ref",
+ "ethstp",
+ "eth-ck";
+ clocks = <&rcc CK_ETH2_MAC>,
+ <&rcc CK_ETH2_TX>,
+ <&rcc CK_ETH2_RX>,
+ <&rcc CK_KER_ETH2PTP>,
+ <&rcc CK_ETH2_STP>,
+ <&rcc CK_KER_ETH2>;
+ snps,axi-config = <&stmmac_axi_config_2>;
+ snps,mixed-burst;
+ snps,mtl-rx-config = <&mtl_rx_setup_2>;
+ snps,mtl-tx-config = <&mtl_tx_setup_2>;
+ snps,pbl = <2>;
+ snps,tso;
+ st,syscon = <&syscfg 0x3400>;
+ access-controllers = <&rifsc 61>;
+ status = "disabled";
+
+ mtl_rx_setup_2: rx-queues-config {
+ snps,rx-queues-to-use = <2>;
+ queue0 {};
+ queue1 {};
+ };
+
+ mtl_tx_setup_2: tx-queues-config {
+ snps,tx-queues-to-use = <4>;
+ queue0 {};
+ queue1 {};
+ queue2 {};
+ queue3 {};
+ };
+
+ stmmac_axi_config_2: stmmac-axi-config {
+ snps,blen = <0 0 0 0 16 8 4>;
+ snps,rd_osr_lmt = <0x7>;
+ snps,wr_osr_lmt = <0x7>;
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/st/stm32mp235.dtsi b/arch/arm64/boot/dts/st/stm32mp235.dtsi
new file mode 100644
index 0000000000000..2719c088dd594
--- /dev/null
+++ b/arch/arm64/boot/dts/st/stm32mp235.dtsi
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2025 - All Rights Reserved
+ * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
+ */
+#include "stm32mp233.dtsi"
+
+&rifsc {
+ vdec: vdec@480d0000 {
+ compatible = "st,stm32mp25-vdec";
+ reg = <0x480d0000 0x3c8>;
+ interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&rcc CK_BUS_VDEC>;
+ access-controllers = <&rifsc 89>;
+ };
+};
diff --git a/arch/arm64/boot/dts/st/stm32mp23xc.dtsi b/arch/arm64/boot/dts/st/stm32mp23xc.dtsi
new file mode 100644
index 0000000000000..e33b00b424e12
--- /dev/null
+++ b/arch/arm64/boot/dts/st/stm32mp23xc.dtsi
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2025 - All Rights Reserved
+ * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
+ */
+
+/ {
+};
diff --git a/arch/arm64/boot/dts/st/stm32mp23xf.dtsi b/arch/arm64/boot/dts/st/stm32mp23xf.dtsi
new file mode 100644
index 0000000000000..e33b00b424e12
--- /dev/null
+++ b/arch/arm64/boot/dts/st/stm32mp23xf.dtsi
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2025 - All Rights Reserved
+ * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
+ */
+
+/ {
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0623/1756] arm64: dts: st: fix arm,smc-id of the SMC watchdog on stm32mp2
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (621 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0622/1756] arm64: dts: st: introduce stm32mp23 SoCs family Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0624/1756] wifi: mac80211: Fix a race when expiring a mesh path Greg Kroah-Hartman
` (375 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mateusz Nowicki, Antonio Borneo,
Alexandre Torgue, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mateusz Nowicki <mateusz.nowicki@posteo.net>
[ Upstream commit ae4d08bbe3f4f5ec920dbdba26091adf0ae6ba71 ]
OP-TEE implements the STM32MP2 watchdog SMC service with function ID
0xbc000000 (CFG_WDT_SM_HANDLER_ID), not 0xb200005a. With the current
value the arm_smc_wdt probe fails with -EIO and the IWDG started by the
bootloader is never refreshed.
Fixes: 89fca38168c9 ("arm64: dts: st: add arm-wdt node for watchdog support on stm32mp251")
Fixes: e9b03ef21386 ("arm64: dts: st: introduce stm32mp23 SoCs family")
Signed-off-by: Mateusz Nowicki <mateusz.nowicki@posteo.net>
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Link: https://lore.kernel.org/r/20260907091400.55954-1-mateusz.nowicki@posteo.net
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/st/stm32mp231.dtsi | 2 +-
arch/arm64/boot/dts/st/stm32mp251.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/st/stm32mp231.dtsi b/arch/arm64/boot/dts/st/stm32mp231.dtsi
index 8820d219a33e6..39f67d80c3645 100644
--- a/arch/arm64/boot/dts/st/stm32mp231.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp231.dtsi
@@ -35,7 +35,7 @@ arm-pmu {
arm_wdt: watchdog {
compatible = "arm,smc-wdt";
- arm,smc-id = <0xb200005a>;
+ arm,smc-id = <0xbc000000>;
status = "disabled";
};
diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts/st/stm32mp251.dtsi
index ed7804f061895..777652026bb64 100644
--- a/arch/arm64/boot/dts/st/stm32mp251.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi
@@ -35,7 +35,7 @@ arm-pmu {
arm_wdt: watchdog {
compatible = "arm,smc-wdt";
- arm,smc-id = <0xb200005a>;
+ arm,smc-id = <0xbc000000>;
status = "disabled";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0624/1756] wifi: mac80211: Fix a race when expiring a mesh path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (622 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0623/1756] arm64: dts: st: fix arm,smc-id of the SMC watchdog on stm32mp2 Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0625/1756] RDMA/hns: Pin CQ buffer writable to match device DMA write access Greg Kroah-Hartman
` (374 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ginger Li, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ginger Li <ginger.jzllee@gmail.com>
[ Upstream commit 6571b6a24cc37c650a1815b1c320e30db5de466f ]
My static analyzer identified a potential issue in 'net/mac80211/mesh_pathtbl.c':
mpath_expired() reads mpath->flags and mpath->exp_time without holding
mpath->state_lock, while mesh_path_fix_nexthop() and the other writers update
both fields under that lock. In mpath_lookup() and
__mesh_path_lookup_by_idx() the unlocked check is followed by taking the lock
and clearing MESH_PATH_ACTIVE, so the check and the update are not atomic:
CPU0 (mpath_lookup) CPU1 (mesh_path_fix_nexthop)
mpath_expired() reads the stale
flags/exp_time and returns true
spin_lock_bh(&mpath->state_lock)
mpath->exp_time = 0;
mpath->flags = FIXED|SN_VALID;
mesh_path_activate(mpath);
spin_unlock_bh(&mpath->state_lock)
spin_lock_bh(&mpath->state_lock)
mpath->flags &= ~MESH_PATH_ACTIVE;
spin_unlock_bh(&mpath->state_lock)
A path which mesh_path_fix_nexthop() has just set up as MESH_PATH_FIXED and
MESH_PATH_ACTIVE then has MESH_PATH_ACTIVE cleared again, and forwarding to
that destination silently stops.
Take mpath->state_lock before evaluating mpath_expired() so that the check and
the clearing of MESH_PATH_ACTIVE are atomic with respect to the writers.
Fixes: 60854fd94573 ("mac80211: mesh: convert path table to rhashtable")
Signed-off-by: Ginger Li <ginger.jzllee@gmail.com>
Link: https://patch.msgid.link/20260922054253.11976-1-ginger.jzllee@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/mesh_pathtbl.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 9f1b5c6a15840..26a34458fb792 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -247,9 +247,10 @@ static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst,
mpath = rhashtable_lookup(&tbl->rhead, dst, mesh_rht_params);
- if (mpath && mpath_expired(mpath)) {
+ if (mpath) {
spin_lock_bh(&mpath->state_lock);
- mpath->flags &= ~MESH_PATH_ACTIVE;
+ if (mpath_expired(mpath))
+ mpath->flags &= ~MESH_PATH_ACTIVE;
spin_unlock_bh(&mpath->state_lock);
}
return mpath;
@@ -290,11 +291,11 @@ __mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx)
if (!mpath)
return NULL;
- if (mpath_expired(mpath)) {
- spin_lock_bh(&mpath->state_lock);
+ spin_lock_bh(&mpath->state_lock);
+ if (mpath_expired(mpath))
mpath->flags &= ~MESH_PATH_ACTIVE;
- spin_unlock_bh(&mpath->state_lock);
- }
+ spin_unlock_bh(&mpath->state_lock);
+
return mpath;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0625/1756] RDMA/hns: Pin CQ buffer writable to match device DMA write access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (623 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0624/1756] wifi: mac80211: Fix a race when expiring a mesh path Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0626/1756] RDMA/mlx5: Set WQ event handler before firmware RQ insertion Greg Kroah-Hartman
` (373 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit ce29f6e741844a78ad1977f2a550ede27ecf95f8 ]
alloc_cq_buf() leaves user_access zero-initialized, but the device
writes CQEs into the CQ buffer. Set IB_ACCESS_LOCAL_WRITE so the buffer
is pinned writable, matching the device's write access.
Fixes: 744b7bdfa79e ("RDMA/hns: Support 0 hop addressing for CQE buffer")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-3-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hns/hns_roce_cq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/hns/hns_roce_cq.c b/drivers/infiniband/hw/hns/hns_roce_cq.c
index 150f5052d0b01..59c88b418c511 100644
--- a/drivers/infiniband/hw/hns/hns_roce_cq.c
+++ b/drivers/infiniband/hw/hns/hns_roce_cq.c
@@ -258,6 +258,7 @@ static int alloc_cq_buf(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq,
buf_attr.region[0].size = hr_cq->cq_depth * hr_cq->cqe_size;
buf_attr.region[0].hopnum = hr_dev->caps.cqe_hop_num;
buf_attr.region_count = 1;
+ buf_attr.user_access = IB_ACCESS_LOCAL_WRITE;
ret = hns_roce_mtr_create(hr_dev, &hr_cq->mtr, &buf_attr,
hr_dev->caps.cqe_ba_pg_sz + PAGE_SHIFT,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0626/1756] RDMA/mlx5: Set WQ event handler before firmware RQ insertion
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (624 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0625/1756] RDMA/hns: Pin CQ buffer writable to match device DMA write access Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0627/1756] RDMA/mlx5: Set SRQ event handler before xarray insertion Greg Kroah-Hartman
` (372 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 28c559d1e25de46bb6dd39e6fa1e93ea6abdf1f6 ]
create_rq() inserts the RQ into dev->qp_table.tree, making it visible to
rsc_event_notifier() before rwq->core_qp.event was assigned. A firmware
WQ_CATAS_ERROR event in that window finds a NULL event pointer.
Move the assignment before create_rq().
Fixes: 350d0e4c7e4b ("IB/mlx5: Track asynchronous events on a receive work queue")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-11-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 6259eeb6f9776..44c16bbe3cc17 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -5461,6 +5461,7 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd,
rwq = kzalloc(sizeof(*rwq), GFP_KERNEL);
if (!rwq)
return ERR_PTR(-ENOMEM);
+ rwq->core_qp.event = mlx5_ib_wq_event;
err = prepare_user_rq(pd, init_attr, udata, rwq);
if (err)
goto err;
@@ -5484,7 +5485,6 @@ struct ib_wq *mlx5_ib_create_wq(struct ib_pd *pd,
goto err_copy;
}
- rwq->core_qp.event = mlx5_ib_wq_event;
rwq->ibwq.event_handler = init_attr->event_handler;
return &rwq->ibwq;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0627/1756] RDMA/mlx5: Set SRQ event handler before xarray insertion
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (625 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0626/1756] RDMA/mlx5: Set WQ event handler before firmware RQ insertion Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0628/1756] RDMA/mlx5: Set RQ event handler for raw-packet QP Greg Kroah-Hartman
` (371 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit d2aa15620e98dc4c6516944397ebea03b7a62b90 ]
mlx5_cmd_create_srq() stores the SRQ into the xarray before
srq->msrq.event was assigned. A firmware SRQ event arriving in that
window calls through a NULL pointer.
Move the assignment before mlx5_cmd_create_srq().
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-12-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/srq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c
index bcb6b324af506..38def085ee267 100644
--- a/drivers/infiniband/hw/mlx5/srq.c
+++ b/drivers/infiniband/hw/mlx5/srq.c
@@ -284,6 +284,7 @@ int mlx5_ib_create_srq(struct ib_srq *ib_srq,
in.pd = to_mpd(ib_srq->pd)->pdn;
in.db_record = srq->db.dma;
+ srq->msrq.event = mlx5_ib_srq_event;
err = mlx5_cmd_create_srq(dev, &srq->msrq, &in);
kvfree(in.pas);
if (err) {
@@ -292,8 +293,6 @@ int mlx5_ib_create_srq(struct ib_srq *ib_srq,
}
mlx5_ib_dbg(dev, "create SRQ with srqn 0x%x\n", srq->msrq.srqn);
-
- srq->msrq.event = mlx5_ib_srq_event;
srq->ibsrq.ext.xrc.srq_num = srq->msrq.srqn;
if (udata) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0628/1756] RDMA/mlx5: Set RQ event handler for raw-packet QP
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (626 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0627/1756] RDMA/mlx5: Set SRQ event handler before xarray insertion Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0629/1756] RDMA/mlx5: Initialize QP/RQ/SQ resource refcount before publishing it Greg Kroah-Hartman
` (370 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit a4fa6497002c80b55ebe597242a1bba2ff268886 ]
create_raw_packet_qp() creates a separate firmware RQ object but never
assigned rq->base.mqp.event. Any firmware event on this resource (e.g.
WQ_CATAS_ERROR, WQ_ACCESS_ERROR) calls through a NULL pointer.
Set the event pointer before the RQ is inserted into the resource table.
Fixes: 0fb2ed66a14c ("IB/mlx5: Add create and destroy functionality for Raw Packet QP")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-13-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/qp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 44c16bbe3cc17..2a71aed3b25ac 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1617,6 +1617,7 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
if (qp->rq.wqe_cnt) {
rq->base.container_mibqp = qp;
+ rq->base.mqp.event = mlx5_ib_qp_event;
if (qp->flags & IB_QP_CREATE_CVLAN_STRIPPING)
rq->flags |= MLX5_IB_RQ_CVLAN_STRIPPING;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0629/1756] RDMA/mlx5: Initialize QP/RQ/SQ resource refcount before publishing it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (627 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0628/1756] RDMA/mlx5: Set RQ event handler for raw-packet QP Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0630/1756] ASoC: amd: acp-es8336: Use an owned codec device reference Greg Kroah-Hartman
` (369 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yishai Hadas, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yishai Hadas <yishaih@nvidia.com>
[ Upstream commit 829a0e65deff3f826a7870a52404aeaf1a3fec3f ]
create_resource_common() inserted the resource into the radix tree
before its initialization was complete. A firmware EQE in that window
finds a zero refcount_t and calls refcount_inc() on it; the refcount API
treats this as a use-after-free, saturates the counter, and permanently
breaks the resource's lifecycle tracking.
Move the initialization before the radix_tree_insert().
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://patch.msgid.link/20260915140933.40580-15-yishaih@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/qpc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/qpc.c b/drivers/infiniband/hw/mlx5/qpc.c
index 146d03ae40bd9..67ed45f3ae17f 100644
--- a/drivers/infiniband/hw/mlx5/qpc.c
+++ b/drivers/infiniband/hw/mlx5/qpc.c
@@ -165,6 +165,10 @@ static int create_resource_common(struct mlx5_ib_dev *dev,
int err;
qp->common.res = rsc_type;
+ refcount_set(&qp->common.refcount, 1);
+ init_completion(&qp->common.free);
+ qp->pid = current->pid;
+
spin_lock_irq(&table->lock);
err = radix_tree_insert(&table->tree,
qp->qpn | (rsc_type << MLX5_USER_INDEX_LEN),
@@ -173,10 +177,6 @@ static int create_resource_common(struct mlx5_ib_dev *dev,
if (err)
return err;
- refcount_set(&qp->common.refcount, 1);
- init_completion(&qp->common.free);
- qp->pid = current->pid;
-
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0630/1756] ASoC: amd: acp-es8336: Use an owned codec device reference
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (628 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0629/1756] RDMA/mlx5: Initialize QP/RQ/SQ resource refcount before publishing it Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0631/1756] ASoC: amd: acp3x-es83xx: Keep " Greg Kroah-Hartman
` (368 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yibo Tan, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yibo Tan <lhfff@tju.edu.cn>
[ Upstream commit c257e3bcb36f4597d6dbb6fbc546e466ef53e385 ]
acpi_get_first_physical_node() returns a borrowed device pointer. If the
pa-enable GPIO lookup fails, st_es8336_late_probe() puts that pointer
despite not owning a reference. A later physical-node teardown can then
release the device while device_del() is still using it.
This was reproduced on current mainline with the real static late-probe
callback and normal platform-device unregister. The GPIO lookup returned
-EPROBE_DEFER and KASAN reported a slab-use-after-free in device_del(),
with the object freed by acpi_unbind_one().
Use acpi_bus_get_primary_device(), which obtains a stable device
reference under the physical-node lock, and release it at callback exit
with scoped cleanup. Keep the reference callback-local because late probe
can be retried; registering one devres action per attempt would accumulate
references.
The same KASAN guest with this change reached the same -EPROBE_DEFER and
unregister path without KASAN, WARNING, Oops or panic. The test directly
invoked the production callback and did not emulate a complete ASoC card or
physical AMD hardware.
Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Yibo Tan <lhfff@tju.edu.cn>
Link: https://patch.msgid.link/20260922185057.954150-2-lhfff@tju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/acp-es8336.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c
index 6ccaf87a080db..6ccf9ccd03fd9 100644
--- a/sound/soc/amd/acp-es8336.c
+++ b/sound/soc/amd/acp-es8336.c
@@ -31,7 +31,6 @@
static unsigned long acp2x_machine_id;
static struct snd_soc_jack st_jack;
-static struct device *codec_dev;
static struct gpio_desc *gpio_pa;
static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
@@ -194,6 +193,7 @@ static const struct acpi_gpio_mapping acpi_es8336_gpios[] = {
static int st_es8336_late_probe(struct snd_soc_card *card)
{
+ struct device *codec_dev __free(put_device) = NULL;
struct acpi_device *adev;
int ret;
@@ -216,7 +216,6 @@ static int st_es8336_late_probe(struct snd_soc_card *card)
if (IS_ERR(gpio_pa)) {
ret = dev_err_probe(card->dev, PTR_ERR(gpio_pa),
"could not get pa-enable GPIO\n");
- put_device(codec_dev);
return ret;
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0631/1756] ASoC: amd: acp3x-es83xx: Keep an owned codec device reference
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (629 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0630/1756] ASoC: amd: acp-es8336: Use an owned codec device reference Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0632/1756] ALSA: oxygen: Use guard() for mutex locks Greg Kroah-Hartman
` (367 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yibo Tan, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yibo Tan <lhfff@tju.edu.cn>
[ Upstream commit 095025078dc3a1b4f0fcdc8b8d9dcb4d192a2a14 ]
acpi_get_first_physical_node() returns a borrowed device pointer. The
private data allocation failure path in acp3x_es83xx_probe() puts that
pointer despite not owning a reference. The successful path also saves the
borrowed pointer for later card operations.
This was reproduced on current mainline with failslab restricted to the
real static callback. The rejected devm_kzalloc() returned -ENOMEM, and
normal codec platform-device unregister then produced a KASAN
slab-use-after-free in device_del(), with allocation in
acpi_create_platform_device() and release in acpi_unbind_one().
Use acpi_bus_get_primary_device() to acquire the reference while the
physical-node lock is held. After allocating private data, register a
devres put action before publishing the pointer. This balances action
allocation and later probe failures, keeps the saved pointer alive during
card use, and drops the reference after ASoC card unregister during
successful teardown. The existing OOM put now correctly balances the owned
lookup.
The same filtered KASAN guest with this change reached the same -ENOMEM and
unregister path without KASAN, WARNING, Oops or panic. The test directly
invoked the production callback and did not emulate a complete ACP/ASoC
card or physical Huawei hardware.
Fixes: 54fcd9dd44b2 ("ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec")
Signed-off-by: Yibo Tan <lhfff@tju.edu.cn>
Link: https://patch.msgid.link/20260922185057.954150-3-lhfff@tju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
index ca62761ea247d..d39907b65afd2 100644
--- a/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
+++ b/sound/soc/amd/acp/acp3x-es83xx/acp3x-es83xx.c
@@ -10,6 +10,7 @@
#include <sound/soc-dapm.h>
#include <sound/jack.h>
#include <sound/soc-acpi.h>
+#include <acpi/acpi_bus.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
@@ -41,6 +42,11 @@ struct acp3x_es83xx_private {
struct snd_soc_dapm_route mic_map[2];
};
+static void acp3x_es83xx_put_codec_device(void *data)
+{
+ put_device(data);
+}
+
static const unsigned int channels[] = {
DUAL_CHANNEL,
};
@@ -437,6 +443,12 @@ static int acp3x_es83xx_probe(struct snd_soc_card *card)
return -ENOMEM;
}
+ ret = devm_add_action_or_reset(dev,
+ acp3x_es83xx_put_codec_device,
+ codec_dev);
+ if (ret)
+ return ret;
+
priv->codec_dev = codec_dev;
priv->quirk = (unsigned long)dmi_id->driver_data;
acp_drvdata->mach_priv = priv;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0632/1756] ALSA: oxygen: Use guard() for mutex locks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (630 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0631/1756] ASoC: amd: acp3x-es83xx: Keep " Greg Kroah-Hartman
@ 2026-11-18 14:45 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0633/1756] ALSA: oxygen: use helper to activate the SPDIF PCM control Greg Kroah-Hartman
` (366 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:45 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 8ecafe5dacc2d98312315b83902ce7b7dbcdfa86 ]
Replace the manual mutex lock/unlock pairs with guard() for code
simplification.
Only code refactoring, and no behavior change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829144342.4290-47-tiwai@suse.de
Stable-dep-of: 5bdc232c3094 ("ALSA: oxygen: use helper to activate the SPDIF PCM control")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/oxygen/oxygen.c | 12 +++----
sound/pci/oxygen/oxygen_mixer.c | 60 +++++++++++--------------------
sound/pci/oxygen/oxygen_pcm.c | 21 ++++-------
sound/pci/oxygen/xonar_cs43xx.c | 3 +-
sound/pci/oxygen/xonar_dg_mixer.c | 33 ++++++-----------
sound/pci/oxygen/xonar_pcm179x.c | 18 ++++------
sound/pci/oxygen/xonar_wm87x6.c | 31 ++++++----------
7 files changed, 59 insertions(+), 119 deletions(-)
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c
index c346f42befc27..ed4d0ec3abe2d 100644
--- a/sound/pci/oxygen/oxygen.c
+++ b/sound/pci/oxygen/oxygen.c
@@ -450,7 +450,7 @@ static int rolloff_put(struct snd_kcontrol *ctl,
int changed;
u8 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->ak4396_regs[0][AK4396_CONTROL_2];
if (value->value.enumerated.item[0])
reg |= AK4396_SLOW;
@@ -461,7 +461,6 @@ static int rolloff_put(struct snd_kcontrol *ctl,
for (i = 0; i < data->dacs; ++i)
ak4396_write(chip, i, AK4396_CONTROL_2, reg);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -499,14 +498,13 @@ static int hpf_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
unsigned int reg;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->wm8785_regs[WM8785_R2] & ~(WM8785_HPFR | WM8785_HPFL);
if (value->value.enumerated.item[0])
reg |= WM8785_HPFR | WM8785_HPFL;
changed = reg != data->wm8785_regs[WM8785_R2];
if (changed)
wm8785_write(chip, WM8785_R2, reg);
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -563,7 +561,7 @@ static int meridian_dig_source_put(struct snd_kcontrol *ctl,
u16 old_reg, new_reg;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
old_reg = oxygen_read16(chip, OXYGEN_GPIO_DATA);
new_reg = old_reg & ~GPIO_MERIDIAN_DIG_MASK;
if (value->value.enumerated.item[0] == 0)
@@ -573,7 +571,6 @@ static int meridian_dig_source_put(struct snd_kcontrol *ctl,
changed = new_reg != old_reg;
if (changed)
oxygen_write16(chip, OXYGEN_GPIO_DATA, new_reg);
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -584,7 +581,7 @@ static int claro_dig_source_put(struct snd_kcontrol *ctl,
u16 old_reg, new_reg;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
old_reg = oxygen_read16(chip, OXYGEN_GPIO_DATA);
new_reg = old_reg & ~GPIO_CLARO_DIG_COAX;
if (value->value.enumerated.item[0])
@@ -592,7 +589,6 @@ static int claro_dig_source_put(struct snd_kcontrol *ctl,
changed = new_reg != old_reg;
if (changed)
oxygen_write16(chip, OXYGEN_GPIO_DATA, new_reg);
- mutex_unlock(&chip->mutex);
return changed;
}
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index eb3aca16359c5..be35f5582485c 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -31,10 +31,9 @@ static int dac_volume_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
unsigned int i;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
for (i = 0; i < chip->model.dac_channels_mixer; ++i)
value->value.integer.value[i] = chip->dac_volume[i];
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -46,7 +45,7 @@ static int dac_volume_put(struct snd_kcontrol *ctl,
int changed;
changed = 0;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
for (i = 0; i < chip->model.dac_channels_mixer; ++i)
if (value->value.integer.value[i] != chip->dac_volume[i]) {
chip->dac_volume[i] = value->value.integer.value[i];
@@ -54,7 +53,6 @@ static int dac_volume_put(struct snd_kcontrol *ctl,
}
if (changed)
chip->model.update_dac_volume(chip);
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -63,9 +61,8 @@ static int dac_mute_get(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.integer.value[0] = !chip->dac_mute;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -75,13 +72,12 @@ static int dac_mute_put(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = (!value->value.integer.value[0]) != chip->dac_mute;
if (changed) {
chip->dac_mute = !value->value.integer.value[0];
chip->model.update_dac_mute(chip);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -114,9 +110,8 @@ static int upmix_get(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
{
struct oxygen *chip = ctl->private_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.enumerated.item[0] = chip->dac_routing;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -188,13 +183,12 @@ static int upmix_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
if (value->value.enumerated.item[0] >= count)
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = value->value.enumerated.item[0] != chip->dac_routing;
if (changed) {
chip->dac_routing = value->value.enumerated.item[0];
oxygen_update_dac_routing(chip);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -203,9 +197,8 @@ static int spdif_switch_get(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.integer.value[0] = chip->spdif_playback_enable;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -279,7 +272,7 @@ static int spdif_switch_put(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = value->value.integer.value[0] != chip->spdif_playback_enable;
if (changed) {
chip->spdif_playback_enable = !!value->value.integer.value[0];
@@ -287,7 +280,6 @@ static int spdif_switch_put(struct snd_kcontrol *ctl,
oxygen_update_spdif_source(chip);
spin_unlock_irq(&chip->reg_lock);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -336,9 +328,8 @@ static int spdif_default_get(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
oxygen_to_iec958(chip->spdif_bits, value);
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -350,14 +341,13 @@ static int spdif_default_put(struct snd_kcontrol *ctl,
int changed;
new_bits = iec958_to_oxygen(value);
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = new_bits != chip->spdif_bits;
if (changed) {
chip->spdif_bits = new_bits;
if (!(chip->pcm_active & (1 << PCM_SPDIF)))
write_spdif_bits(chip, new_bits);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -376,9 +366,8 @@ static int spdif_pcm_get(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
oxygen_to_iec958(chip->spdif_pcm_bits, value);
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -390,14 +379,13 @@ static int spdif_pcm_put(struct snd_kcontrol *ctl,
int changed;
new_bits = iec958_to_oxygen(value);
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = new_bits != chip->spdif_pcm_bits;
if (changed) {
chip->spdif_pcm_bits = new_bits;
if (chip->pcm_active & (1 << PCM_SPDIF))
write_spdif_bits(chip, new_bits);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -511,9 +499,8 @@ static int ac97_switch_get(struct snd_kcontrol *ctl,
int invert = ctl->private_value & (1 << 16);
u16 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = oxygen_read_ac97(chip, codec, index);
- mutex_unlock(&chip->mutex);
if (!(reg & (1 << bitnr)) ^ !invert)
value->value.integer.value[0] = 1;
else
@@ -550,7 +537,7 @@ static int ac97_switch_put(struct snd_kcontrol *ctl,
u16 oldreg, newreg;
int change;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
oldreg = oxygen_read_ac97(chip, codec, index);
newreg = oldreg;
if (!value->value.integer.value[0] ^ !invert)
@@ -579,7 +566,6 @@ static int ac97_switch_put(struct snd_kcontrol *ctl,
CM9780_GPO0, CM9780_GPO0);
}
}
- mutex_unlock(&chip->mutex);
return change;
}
@@ -604,9 +590,8 @@ static int ac97_volume_get(struct snd_kcontrol *ctl,
unsigned int index = ctl->private_value & 0xff;
u16 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = oxygen_read_ac97(chip, codec, index);
- mutex_unlock(&chip->mutex);
if (!stereo) {
value->value.integer.value[0] = 31 - (reg & 0x1f);
} else {
@@ -626,7 +611,7 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
u16 oldreg, newreg;
int change;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
oldreg = oxygen_read_ac97(chip, codec, index);
if (!stereo) {
newreg = oldreg & ~0x1f;
@@ -639,7 +624,6 @@ static int ac97_volume_put(struct snd_kcontrol *ctl,
change = newreg != oldreg;
if (change)
oxygen_write_ac97(chip, codec, index, newreg);
- mutex_unlock(&chip->mutex);
return change;
}
@@ -656,10 +640,9 @@ static int mic_fmic_source_get(struct snd_kcontrol *ctl,
{
struct oxygen *chip = ctl->private_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.enumerated.item[0] =
!!(oxygen_read_ac97(chip, 0, CM9780_JACK) & CM9780_FMIC2MIC);
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -670,7 +653,7 @@ static int mic_fmic_source_put(struct snd_kcontrol *ctl,
u16 oldreg, newreg;
int change;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
oldreg = oxygen_read_ac97(chip, 0, CM9780_JACK);
if (value->value.enumerated.item[0])
newreg = oldreg | CM9780_FMIC2MIC;
@@ -679,7 +662,6 @@ static int mic_fmic_source_put(struct snd_kcontrol *ctl,
change = newreg != oldreg;
if (change)
oxygen_write_ac97(chip, 0, CM9780_JACK, newreg);
- mutex_unlock(&chip->mutex);
return change;
}
@@ -699,9 +681,8 @@ static int ac97_fp_rec_volume_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
u16 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = oxygen_read_ac97(chip, 1, AC97_REC_GAIN);
- mutex_unlock(&chip->mutex);
value->value.integer.value[0] = reg & 7;
value->value.integer.value[1] = (reg >> 8) & 7;
return 0;
@@ -714,7 +695,7 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl,
u16 oldreg, newreg;
int change;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
oldreg = oxygen_read_ac97(chip, 1, AC97_REC_GAIN);
newreg = oldreg & ~0x0707;
newreg = newreg | (value->value.integer.value[0] & 7);
@@ -722,7 +703,6 @@ static int ac97_fp_rec_volume_put(struct snd_kcontrol *ctl,
change = newreg != oldreg;
if (change)
oxygen_write_ac97(chip, 1, AC97_REC_GAIN, newreg);
- mutex_unlock(&chip->mutex);
return change;
}
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
index b2a3fcfe31d44..8b4f7269753ad 100644
--- a/sound/pci/oxygen/oxygen_pcm.c
+++ b/sound/pci/oxygen/oxygen_pcm.c
@@ -171,7 +171,7 @@ static int oxygen_open(struct snd_pcm_substream *substream,
snd_pcm_set_sync(substream);
chip->streams[channel] = substream;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
chip->pcm_active |= 1 << channel;
if (channel == PCM_SPDIF) {
chip->spdif_pcm_bits = chip->spdif_bits;
@@ -181,7 +181,6 @@ static int oxygen_open(struct snd_pcm_substream *substream,
SNDRV_CTL_EVENT_MASK_INFO,
&chip->controls[CONTROL_SPDIF_PCM]->id);
}
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -221,7 +220,7 @@ static int oxygen_close(struct snd_pcm_substream *substream)
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = oxygen_substream_channel(substream);
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
chip->pcm_active &= ~(1 << channel);
if (channel == PCM_SPDIF) {
chip->controls[CONTROL_SPDIF_PCM]->vd[0].access |=
@@ -232,7 +231,6 @@ static int oxygen_close(struct snd_pcm_substream *substream)
}
if (channel == PCM_SPDIF || channel == PCM_MULTICH)
oxygen_update_spdif_source(chip);
- mutex_unlock(&chip->mutex);
chip->streams[channel] = NULL;
return 0;
@@ -366,9 +364,8 @@ static int oxygen_rec_a_hw_params(struct snd_pcm_substream *substream,
OXYGEN_I2S_BITS_MASK);
spin_unlock_irq(&chip->reg_lock);
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
chip->model.set_adc_params(chip, hw_params);
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -403,9 +400,8 @@ static int oxygen_rec_b_hw_params(struct snd_pcm_substream *substream,
spin_unlock_irq(&chip->reg_lock);
if (!is_ac97) {
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
chip->model.set_adc_params(chip, hw_params);
- mutex_unlock(&chip->mutex);
}
return 0;
}
@@ -440,9 +436,8 @@ static int oxygen_rec_c_hw_params(struct snd_pcm_substream *substream,
spin_unlock_irq(&chip->reg_lock);
if (!is_spdif) {
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
chip->model.set_adc_params(chip, hw_params);
- mutex_unlock(&chip->mutex);
}
return 0;
}
@@ -457,7 +452,7 @@ static int oxygen_spdif_hw_params(struct snd_pcm_substream *substream,
if (err < 0)
return err;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
spin_lock_irq(&chip->reg_lock);
oxygen_clear_bits32(chip, OXYGEN_SPDIF_CONTROL,
OXYGEN_SPDIF_OUT_ENABLE);
@@ -469,7 +464,6 @@ static int oxygen_spdif_hw_params(struct snd_pcm_substream *substream,
OXYGEN_SPDIF_OUT_RATE_MASK);
oxygen_update_spdif_source(chip);
spin_unlock_irq(&chip->reg_lock);
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -483,7 +477,7 @@ static int oxygen_multich_hw_params(struct snd_pcm_substream *substream,
if (err < 0)
return err;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
spin_lock_irq(&chip->reg_lock);
oxygen_write8_masked(chip, OXYGEN_PLAY_CHANNELS,
oxygen_play_channels(hw_params),
@@ -505,7 +499,6 @@ static int oxygen_multich_hw_params(struct snd_pcm_substream *substream,
chip->model.set_dac_params(chip, hw_params);
oxygen_update_dac_routing(chip);
- mutex_unlock(&chip->mutex);
return 0;
}
diff --git a/sound/pci/oxygen/xonar_cs43xx.c b/sound/pci/oxygen/xonar_cs43xx.c
index 664b7759dd628..d608803fd8747 100644
--- a/sound/pci/oxygen/xonar_cs43xx.c
+++ b/sound/pci/oxygen/xonar_cs43xx.c
@@ -309,7 +309,7 @@ static int rolloff_put(struct snd_kcontrol *ctl,
int changed;
u8 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->cs4398_regs[7];
if (value->value.enumerated.item[0])
reg |= CS4398_FILT_SEL;
@@ -324,7 +324,6 @@ static int rolloff_put(struct snd_kcontrol *ctl,
reg = data->cs4362a_regs[0x04] & ~CS4362A_FILT_SEL;
cs4362a_write(chip, 0x04, reg);
}
- mutex_unlock(&chip->mutex);
return changed;
}
diff --git a/sound/pci/oxygen/xonar_dg_mixer.c b/sound/pci/oxygen/xonar_dg_mixer.c
index 198588562880b..2179ff8e4d864 100644
--- a/sound/pci/oxygen/xonar_dg_mixer.c
+++ b/sound/pci/oxygen/xonar_dg_mixer.c
@@ -62,9 +62,8 @@ static int output_select_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.enumerated.item[0] = data->output_sel;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -77,14 +76,13 @@ static int output_select_put(struct snd_kcontrol *ctl,
int changed = 0;
int ret;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
if (data->output_sel != new) {
data->output_sel = new;
ret = output_select_apply(chip);
changed = ret >= 0 ? 1 : ret;
oxygen_update_dac_routing(chip);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -108,12 +106,11 @@ static int hp_stereo_volume_get(struct snd_kcontrol *ctl,
struct dg *data = chip->model_data;
unsigned int tmp;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
tmp = (~data->cs4245_shadow[CS4245_DAC_A_CTRL]) & 255;
val->value.integer.value[0] = tmp;
tmp = (~data->cs4245_shadow[CS4245_DAC_B_CTRL]) & 255;
val->value.integer.value[1] = tmp;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -130,7 +127,7 @@ static int hp_stereo_volume_put(struct snd_kcontrol *ctl,
if ((new1 > 255) || (new1 < 0) || (new2 > 255) || (new2 < 0))
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
if ((data->cs4245_shadow[CS4245_DAC_A_CTRL] != ~new1) ||
(data->cs4245_shadow[CS4245_DAC_B_CTRL] != ~new2)) {
data->cs4245_shadow[CS4245_DAC_A_CTRL] = ~new1;
@@ -140,7 +137,6 @@ static int hp_stereo_volume_put(struct snd_kcontrol *ctl,
ret = cs4245_write_spi(chip, CS4245_DAC_B_CTRL);
changed = ret >= 0 ? 1 : ret;
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -153,10 +149,9 @@ static int hp_mute_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
val->value.integer.value[0] =
!(data->cs4245_shadow[CS4245_DAC_CTRL_1] & CS4245_MUTE_DAC);
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -170,13 +165,12 @@ static int hp_mute_put(struct snd_kcontrol *ctl,
if (val->value.integer.value[0] > 1)
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
data->cs4245_shadow[CS4245_DAC_CTRL_1] &= ~CS4245_MUTE_DAC;
data->cs4245_shadow[CS4245_DAC_CTRL_1] |=
(~val->value.integer.value[0] << 2) & CS4245_MUTE_DAC;
ret = cs4245_write_spi(chip, CS4245_DAC_CTRL_1);
changed = ret >= 0 ? 1 : ret;
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -212,10 +206,9 @@ static int input_vol_get(struct snd_kcontrol *ctl,
struct dg *data = chip->model_data;
unsigned int idx = ctl->private_value;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.integer.value[0] = data->input_vol[idx][0];
value->value.integer.value[1] = data->input_vol[idx][1];
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -233,7 +226,7 @@ static int input_vol_put(struct snd_kcontrol *ctl,
value->value.integer.value[1] < 2 * -12 ||
value->value.integer.value[1] > 2 * 12)
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = data->input_vol[idx][0] != value->value.integer.value[0] ||
data->input_vol[idx][1] != value->value.integer.value[1];
if (changed) {
@@ -246,7 +239,6 @@ static int input_vol_put(struct snd_kcontrol *ctl,
}
changed = ret >= 0 ? 1 : ret;
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -282,9 +274,8 @@ static int input_sel_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
struct dg *data = chip->model_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.enumerated.item[0] = data->input_sel;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -299,7 +290,7 @@ static int input_sel_put(struct snd_kcontrol *ctl,
if (value->value.enumerated.item[0] > 3)
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = value->value.enumerated.item[0] != data->input_sel;
if (changed) {
data->input_sel = value->value.enumerated.item[0];
@@ -311,7 +302,6 @@ static int input_sel_put(struct snd_kcontrol *ctl,
data->input_vol[data->input_sel][1]);
changed = ret >= 0 ? 1 : ret;
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -341,7 +331,7 @@ static int hpf_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
u8 reg;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->cs4245_shadow[CS4245_ADC_CTRL] & ~CS4245_HPF_FREEZE;
if (value->value.enumerated.item[0])
reg |= CS4245_HPF_FREEZE;
@@ -350,7 +340,6 @@ static int hpf_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
data->cs4245_shadow[CS4245_ADC_CTRL] = reg;
cs4245_write_spi(chip, CS4245_ADC_CTRL);
}
- mutex_unlock(&chip->mutex);
return changed;
}
diff --git a/sound/pci/oxygen/xonar_pcm179x.c b/sound/pci/oxygen/xonar_pcm179x.c
index cf801a235df92..a491c9c92989e 100644
--- a/sound/pci/oxygen/xonar_pcm179x.c
+++ b/sound/pci/oxygen/xonar_pcm179x.c
@@ -762,7 +762,7 @@ static int rolloff_put(struct snd_kcontrol *ctl,
int changed;
u8 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->pcm1796_regs[0][19 - PCM1796_REG_BASE];
reg &= ~PCM1796_FLT_MASK;
if (!value->value.enumerated.item[0])
@@ -774,7 +774,6 @@ static int rolloff_put(struct snd_kcontrol *ctl,
for (i = 0; i < data->dacs; ++i)
pcm1796_write(chip, i, 19, reg);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -806,7 +805,7 @@ static int deemph_put(struct snd_kcontrol *ctl,
int changed;
u8 reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->pcm1796_regs[0][18 - PCM1796_REG_BASE];
if (!value->value.integer.value[0])
reg &= ~PCM1796_DME;
@@ -817,7 +816,6 @@ static int deemph_put(struct snd_kcontrol *ctl,
for (i = 0; i < data->dacs; ++i)
pcm1796_write(chip, i, 18, reg);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -872,7 +870,7 @@ static int st_output_switch_put(struct snd_kcontrol *ctl,
struct xonar_pcm179x *data = chip->model_data;
u16 gpio_old, gpio;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
gpio_old = oxygen_read16(chip, OXYGEN_GPIO_DATA);
gpio = gpio_old;
switch (value->value.enumerated.item[0]) {
@@ -889,7 +887,6 @@ static int st_output_switch_put(struct snd_kcontrol *ctl,
oxygen_write16(chip, OXYGEN_GPIO_DATA, gpio);
data->hp_active = gpio & GPIO_ST_HP;
update_pcm1796_volume(chip);
- mutex_unlock(&chip->mutex);
return gpio != gpio_old;
}
@@ -909,7 +906,7 @@ static int st_hp_volume_offset_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
struct xonar_pcm179x *data = chip->model_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
if (data->hp_gain_offset < 2*-12)
value->value.enumerated.item[0] = 0;
else if (data->hp_gain_offset < 2*-6)
@@ -918,7 +915,6 @@ static int st_hp_volume_offset_get(struct snd_kcontrol *ctl,
value->value.enumerated.item[0] = 2;
else
value->value.enumerated.item[0] = 3;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -935,13 +931,12 @@ static int st_hp_volume_offset_put(struct snd_kcontrol *ctl,
if (value->value.enumerated.item[0] > 3)
return -EINVAL;
offset = offsets[value->value.enumerated.item[0]];
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = offset != data->hp_gain_offset;
if (changed) {
data->hp_gain_offset = offset;
update_pcm1796_volume(chip);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -985,7 +980,7 @@ static int xense_output_switch_put(struct snd_kcontrol *ctl,
struct xonar_pcm179x *data = chip->model_data;
u16 gpio_old, gpio;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
gpio_old = oxygen_read16(chip, OXYGEN_GPIO_DATA);
gpio = gpio_old;
switch (value->value.enumerated.item[0]) {
@@ -1002,7 +997,6 @@ static int xense_output_switch_put(struct snd_kcontrol *ctl,
oxygen_write16(chip, OXYGEN_GPIO_DATA, gpio);
data->hp_active = !(gpio & GPIO_XENSE_SPEAKERS);
update_pcm1796_volume(chip);
- mutex_unlock(&chip->mutex);
return gpio != gpio_old;
}
diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c
index 8aa92f3e5ee88..7d92e6e20c395 100644
--- a/sound/pci/oxygen/xonar_wm87x6.c
+++ b/sound/pci/oxygen/xonar_wm87x6.c
@@ -237,7 +237,7 @@ static void xonar_ds_handle_hp_jack(struct oxygen *chip)
bool hp_plugged;
unsigned int reg;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
hp_plugged = !(oxygen_read16(chip, OXYGEN_GPIO_DATA) &
GPIO_DS_HP_DETECT);
@@ -252,8 +252,6 @@ static void xonar_ds_handle_hp_jack(struct oxygen *chip)
wm8766_write_cached(chip, WM8766_DAC_CTRL, reg);
snd_jack_report(data->hp_jack, hp_plugged ? SND_JACK_HEADPHONE : 0);
-
- mutex_unlock(&chip->mutex);
}
static void xonar_ds_init(struct oxygen *chip)
@@ -521,14 +519,13 @@ static int wm8776_bit_switch_put(struct snd_kcontrol *ctl,
bool invert = (ctl->private_value >> 24) & 1;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg_value = data->wm8776_regs[reg_index] & ~bit;
if (value->value.integer.value[0] ^ invert)
reg_value |= bit;
changed = reg_value != data->wm8776_regs[reg_index];
if (changed)
wm8776_write(chip, reg_index, reg_value);
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -648,13 +645,12 @@ static int wm8776_field_set(struct snd_kcontrol *ctl, unsigned int value)
max = (ctl->private_value >> 12) & 0xf;
if (value < min || value > max)
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = value != (ctl->private_value & 0xf);
if (changed) {
ctl->private_value = (ctl->private_value & ~0xf) | value;
wm8776_field_set_from_ctl(ctl);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -700,12 +696,11 @@ static int wm8776_hp_vol_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
struct xonar_wm87x6 *data = chip->model_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.integer.value[0] =
data->wm8776_regs[WM8776_HPLVOL] & WM8776_HPATT_MASK;
value->value.integer.value[1] =
data->wm8776_regs[WM8776_HPRVOL] & WM8776_HPATT_MASK;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -716,7 +711,7 @@ static int wm8776_hp_vol_put(struct snd_kcontrol *ctl,
struct xonar_wm87x6 *data = chip->model_data;
u8 to_update;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
to_update = (value->value.integer.value[0] !=
(data->wm8776_regs[WM8776_HPLVOL] & WM8776_HPATT_MASK))
<< 0;
@@ -744,7 +739,6 @@ static int wm8776_hp_vol_put(struct snd_kcontrol *ctl,
value->value.integer.value[1] |
WM8776_HPZCEN | WM8776_UPDATE);
}
- mutex_unlock(&chip->mutex);
return to_update != 0;
}
@@ -770,7 +764,7 @@ static int wm8776_input_mux_put(struct snd_kcontrol *ctl,
u16 reg;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->wm8776_regs[WM8776_ADCMUX];
if (value->value.integer.value[0]) {
reg |= mux_bit;
@@ -794,7 +788,6 @@ static int wm8776_input_mux_put(struct snd_kcontrol *ctl,
GPIO_DS_INPUT_ROUTE);
wm8776_write(chip, WM8776_ADCMUX, reg);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -814,12 +807,11 @@ static int wm8776_input_vol_get(struct snd_kcontrol *ctl,
struct oxygen *chip = ctl->private_data;
struct xonar_wm87x6 *data = chip->model_data;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
value->value.integer.value[0] =
data->wm8776_regs[WM8776_ADCLVOL] & WM8776_AGMASK;
value->value.integer.value[1] =
data->wm8776_regs[WM8776_ADCRVOL] & WM8776_AGMASK;
- mutex_unlock(&chip->mutex);
return 0;
}
@@ -830,7 +822,7 @@ static int wm8776_input_vol_put(struct snd_kcontrol *ctl,
struct xonar_wm87x6 *data = chip->model_data;
int changed = 0;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = (value->value.integer.value[0] !=
(data->wm8776_regs[WM8776_ADCLVOL] & WM8776_AGMASK)) ||
(value->value.integer.value[1] !=
@@ -839,7 +831,6 @@ static int wm8776_input_vol_put(struct snd_kcontrol *ctl,
value->value.integer.value[0] | WM8776_ZCA);
wm8776_write_cached(chip, WM8776_ADCRVOL,
value->value.integer.value[1] | WM8776_ZCA);
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -895,7 +886,7 @@ static int wm8776_level_control_put(struct snd_kcontrol *ctl,
if (value->value.enumerated.item[0] >= 3)
return -EINVAL;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
changed = value->value.enumerated.item[0] != ctl->private_value;
if (changed) {
ctl->private_value = value->value.enumerated.item[0];
@@ -926,7 +917,6 @@ static int wm8776_level_control_put(struct snd_kcontrol *ctl,
for (i = 0; i < ARRAY_SIZE(data->lc_controls); ++i)
activate_control(chip, data->lc_controls[i], mode);
}
- mutex_unlock(&chip->mutex);
return changed;
}
@@ -956,14 +946,13 @@ static int hpf_put(struct snd_kcontrol *ctl, struct snd_ctl_elem_value *value)
unsigned int reg;
int changed;
- mutex_lock(&chip->mutex);
+ guard(mutex)(&chip->mutex);
reg = data->wm8776_regs[WM8776_ADCIFCTRL] & ~WM8776_ADCHPD;
if (!value->value.enumerated.item[0])
reg |= WM8776_ADCHPD;
changed = reg != data->wm8776_regs[WM8776_ADCIFCTRL];
if (changed)
wm8776_write(chip, WM8776_ADCIFCTRL, reg);
- mutex_unlock(&chip->mutex);
return changed;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0633/1756] ALSA: oxygen: use helper to activate the SPDIF PCM control
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (631 preceding siblings ...)
2026-11-18 14:45 ` [PATCH 6.12 0632/1756] ALSA: oxygen: Use guard() for mutex locks Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0634/1756] ALSA: via82xx: use helper to activate DXS controls Greg Kroah-Hartman
` (365 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Runyu Xiao, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Runyu Xiao <runyu.xiao@seu.edu.cn>
[ Upstream commit 5bdc232c3094304a7e17df5ddb66dcdacbead6bf ]
oxygen_open() and oxygen_close() modify the SPDIF PCM control access
flags while holding chip->mutex. Direct access changes bypass the control
core locking and notification path.
Move the access transition outside the driver mutex and use
snd_ctl_activate_id(), which serializes the control update with the control
core.
Fixes: d0ce9946c52e ("[ALSA] add CMI8788 driver")
Assisted-by: LLM
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Link: https://patch.msgid.link/20260927121709.742840-1-runyu.xiao@seu.edu.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/oxygen/oxygen_pcm.c | 37 +++++++++++++++--------------------
1 file changed, 16 insertions(+), 21 deletions(-)
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
index 8b4f7269753ad..dda8d9897b4ad 100644
--- a/sound/pci/oxygen/oxygen_pcm.c
+++ b/sound/pci/oxygen/oxygen_pcm.c
@@ -171,16 +171,14 @@ static int oxygen_open(struct snd_pcm_substream *substream,
snd_pcm_set_sync(substream);
chip->streams[channel] = substream;
- guard(mutex)(&chip->mutex);
- chip->pcm_active |= 1 << channel;
- if (channel == PCM_SPDIF) {
- chip->spdif_pcm_bits = chip->spdif_bits;
- chip->controls[CONTROL_SPDIF_PCM]->vd[0].access &=
- ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
- snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
- SNDRV_CTL_EVENT_MASK_INFO,
- &chip->controls[CONTROL_SPDIF_PCM]->id);
+ scoped_guard(mutex, &chip->mutex) {
+ chip->pcm_active |= 1 << channel;
+ if (channel == PCM_SPDIF)
+ chip->spdif_pcm_bits = chip->spdif_bits;
}
+ if (channel == PCM_SPDIF)
+ snd_ctl_activate_id(chip->card,
+ &chip->controls[CONTROL_SPDIF_PCM]->id, 1);
return 0;
}
@@ -220,19 +218,16 @@ static int oxygen_close(struct snd_pcm_substream *substream)
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = oxygen_substream_channel(substream);
- guard(mutex)(&chip->mutex);
- chip->pcm_active &= ~(1 << channel);
- if (channel == PCM_SPDIF) {
- chip->controls[CONTROL_SPDIF_PCM]->vd[0].access |=
- SNDRV_CTL_ELEM_ACCESS_INACTIVE;
- snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
- SNDRV_CTL_EVENT_MASK_INFO,
- &chip->controls[CONTROL_SPDIF_PCM]->id);
- }
- if (channel == PCM_SPDIF || channel == PCM_MULTICH)
- oxygen_update_spdif_source(chip);
+ scoped_guard(mutex, &chip->mutex) {
+ chip->pcm_active &= ~(1 << channel);
+ if (channel == PCM_SPDIF || channel == PCM_MULTICH)
+ oxygen_update_spdif_source(chip);
- chip->streams[channel] = NULL;
+ chip->streams[channel] = NULL;
+ }
+ if (channel == PCM_SPDIF)
+ snd_ctl_activate_id(chip->card,
+ &chip->controls[CONTROL_SPDIF_PCM]->id, 0);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0634/1756] ALSA: via82xx: use helper to activate DXS controls
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (632 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0633/1756] ALSA: oxygen: use helper to activate the SPDIF PCM control Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0635/1756] drm/exynos/fimd: fix register offset type in fimd_trigger() Greg Kroah-Hartman
` (364 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Runyu Xiao, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Runyu Xiao <runyu.xiao@seu.edu.cn>
[ Upstream commit aee7c43126e3184d7eefde6545b3b88628e5591a ]
The VIA DXS playback callbacks modify control access flags directly when
a stream opens or closes. This bypasses the control core locking and
notification path.
Use snd_ctl_activate_id() for both transitions so access changes are
serialized by the control core and reported with the expected info event.
Fixes: 3d00941371a7 ("sound: via82xx: deactivate DXS controls of inactive streams")
Assisted-by: LLM
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Link: https://patch.msgid.link/20260927141447.788664-1-runyu.xiao@seu.edu.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/via82xx.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 89838b4fb118a..278516107f62d 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1249,11 +1249,7 @@ static int snd_via8233_playback_open(struct snd_pcm_substream *substream)
VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31);
chip->playback_volume[stream][1] =
VIA_DXS_MAX_VOLUME - (dxs_init_volume & 31);
- chip->dxs_controls[stream]->vd[0].access &=
- ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
- snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
- SNDRV_CTL_EVENT_MASK_INFO,
- &chip->dxs_controls[stream]->id);
+ snd_ctl_activate_id(chip->card, &chip->dxs_controls[stream]->id, 1);
}
return 0;
}
@@ -1340,10 +1336,7 @@ static int snd_via8233_playback_close(struct snd_pcm_substream *substream)
stream = viadev->reg_offset / 0x10;
if (chip->dxs_controls[stream]) {
- chip->dxs_controls[stream]->vd[0].access |=
- SNDRV_CTL_ELEM_ACCESS_INACTIVE;
- snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_INFO,
- &chip->dxs_controls[stream]->id);
+ snd_ctl_activate_id(chip->card, &chip->dxs_controls[stream]->id, 0);
}
return snd_via82xx_pcm_close(substream);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0635/1756] drm/exynos/fimd: fix register offset type in fimd_trigger()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (633 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0634/1756] ALSA: via82xx: use helper to activate DXS controls Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0636/1756] staging: iio: adc: ad7816: Sort headers alphabetically Greg Kroah-Hartman
` (363 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chen-Yu Tsai, Marek Szyprowski,
Inki Dae, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wenst@chromium.org>
[ Upstream commit f901c9b986b6355716822d5c6ad34ae5edd71085 ]
Sparse reports:
exynos_drm_fimd.c:992:39: warning: incorrect type in initializer (different address spaces)
exynos_drm_fimd.c:992:39: expected void *timing_base
exynos_drm_fimd.c:992:39: got void [noderef] __iomem *
exynos_drm_fimd.c:1005:33: warning: incorrect type in argument 1 (different address spaces)
exynos_drm_fimd.c:1005:33: expected void const volatile [noderef] __iomem *addr
exynos_drm_fimd.c:1005:33: got void *
exynos_drm_fimd.c:1007:33: warning: incorrect type in argument 2 (different address spaces)
exynos_drm_fimd.c:1007:33: expected void volatile [noderef] __iomem *addr
exynos_drm_fimd.c:1007:33: got void *
Add "__iomem" to *timing_base to fix its type.
Fixes: 3854fab24e89 ("drm/exynos: fimd: support LCD I80 interface")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 05e4a5a63f5d8..e7f96b3568808 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -988,7 +988,7 @@ static void fimd_trigger(struct device *dev)
{
struct fimd_context *ctx = dev_get_drvdata(dev);
const struct fimd_driver_data *driver_data = ctx->driver_data;
- void *timing_base = ctx->regs + driver_data->timing_base;
+ void __iomem *timing_base = ctx->regs + driver_data->timing_base;
u32 reg;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0636/1756] staging: iio: adc: ad7816: Sort headers alphabetically
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (634 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0635/1756] drm/exynos/fimd: fix register offset type in fimd_trigger() Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0637/1756] staging: iio: adc: ad7816: Serialize SPI operations Greg Kroah-Hartman
` (362 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abdelnasser Hussein, Joshua Crofts,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
[ Upstream commit 8c7b99ff159d64679c9b3b4d5878e44459f7272a ]
Sort the include directives alphabetically to improve readability and
maintainability. This is a precursor cleanup patch to prepare for the
addition of new headers in subsequent changes.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: b96187644664 ("staging: iio: adc: ad7816: Protect sysfs attributes with mutex")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/iio/adc/ad7816.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index a46ca0559b6a2..6a402e8877605 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -5,19 +5,19 @@
* Copyright 2010 Analog Devices Inc.
*/
-#include <linux/interrupt.h>
-#include <linux/gpio/consumer.h>
#include <linux/device.h>
+#include <linux/gpio/consumer.h>
+#include <linux/interrupt.h>
#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
#include <linux/list.h>
-#include <linux/spi/spi.h>
#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/spi/spi.h>
+#include <linux/sysfs.h>
+#include <linux/iio/events.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
-#include <linux/iio/events.h>
/*
* AD7816 config masks
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0637/1756] staging: iio: adc: ad7816: Serialize SPI operations
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (635 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0636/1756] staging: iio: adc: ad7816: Sort headers alphabetically Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0638/1756] staging: iio: adc: ad7816: Protect sysfs attributes with mutex Greg Kroah-Hartman
` (361 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abdelnasser Hussein, Maxwell Doose,
Joshua Crofts, Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
[ Upstream commit 8f99c766605a484663764b52da56a0b160f9d9c3 ]
The ad7816_spi_read() and ad7816_spi_write() functions perform a
sequence of GPIO state changes followed by an SPI transfer. If multiple
operations occur simultaneously, the GPIO state could be changed by one
thread while another is in the middle of a transfer, leading to a race
condition.
Introduce a mutex to serialize the operations, ensuring that the GPIO
toggling and the SPI transfer are treated as a single atomic operation.
The mutex is placed right after the pointers in the device state
structure to avoid padding holes.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Reviewed-by: Maxwell Doose <maxwell@maxwelld.cc>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: b96187644664 ("staging: iio: adc: ad7816: Protect sysfs attributes with mutex")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/iio/adc/ad7816.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 6a402e8877605..ade1b8db197d4 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -5,12 +5,14 @@
* Copyright 2010 Analog Devices Inc.
*/
+#include <linux/cleanup.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/sysfs.h>
@@ -47,6 +49,7 @@ struct ad7816_chip_info {
struct gpio_desc *rdwr_pin;
struct gpio_desc *convert_pin;
struct gpio_desc *busy_pin;
+ struct mutex lock; /* protect device state during SPI transfers */
u8 oti_data[AD7816_CS_MAX + 1];
u8 channel_id; /* 0 always be temperature */
u8 mode;
@@ -67,6 +70,8 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
int ret;
__be16 buf;
+ guard(mutex)(&chip->lock);
+
gpiod_set_value(chip->rdwr_pin, 1);
gpiod_set_value(chip->rdwr_pin, 0);
ret = spi_write_then_read(spi_dev, &chip->channel_id, sizeof(chip->channel_id), NULL, 0);
@@ -107,6 +112,8 @@ static int ad7816_spi_write(struct ad7816_chip_info *chip, u8 data)
struct spi_device *spi_dev = chip->spi_dev;
int ret;
+ guard(mutex)(&chip->lock);
+
gpiod_set_value(chip->rdwr_pin, 1);
gpiod_set_value(chip->rdwr_pin, 0);
ret = spi_write_then_read(spi_dev, &data, sizeof(data), NULL, 0);
@@ -362,6 +369,10 @@ static int ad7816_probe(struct spi_device *spi_dev)
/* this is only used for device removal purposes */
dev_set_drvdata(&spi_dev->dev, indio_dev);
+ ret = devm_mutex_init(&spi_dev->dev, &chip->lock);
+ if (ret)
+ return ret;
+
chip->spi_dev = spi_dev;
for (i = 0; i <= AD7816_CS_MAX; i++)
chip->oti_data[i] = 203;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0638/1756] staging: iio: adc: ad7816: Protect sysfs attributes with mutex
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (636 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0637/1756] staging: iio: adc: ad7816: Serialize SPI operations Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0639/1756] iio: dac: ad5758: Fix alignment for DMA safety Greg Kroah-Hartman
` (360 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joshua Crofts, Abdelnasser Hussein,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
[ Upstream commit b96187644664d10b641dddeb7ca2eeef97a77c41 ]
The sysfs store functions modify driver state that is critical during
SPI transactions. ad7816_store_mode toggles hardware GPIO pins, while
ad7816_store_channel updates the internal software state
(chip->channel_id).
If these are modified concurrently by userspace while an SPI transfer
is in progress, it could corrupt the hardware transaction or cause the
driver to communicate with the wrong channel.
Add the existing chip->lock guard to these functions to serialize
access and prevent these race conditions.
Fixes: 7924425db04a ("staging: iio: adc: new driver for AD7816 devices")
Suggested-by: Joshua Crofts <joshua.crofts1@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/iio/adc/ad7816.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index ade1b8db197d4..aac3de84e0a87 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -143,6 +143,8 @@ static ssize_t ad7816_store_mode(struct device *dev,
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ guard(mutex)(&chip->lock);
+
if (strcmp(buf, "full") == 0) {
gpiod_set_value(chip->rdwr_pin, 1);
chip->mode = AD7816_FULL;
@@ -207,6 +209,8 @@ static ssize_t ad7816_store_channel(struct device *dev,
return -EINVAL;
}
+ guard(mutex)(&chip->lock);
+
chip->channel_id = data;
return len;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0639/1756] iio: dac: ad5758: Fix alignment for DMA safety
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (637 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0638/1756] staging: iio: adc: ad7816: Protect sysfs attributes with mutex Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0640/1756] iio: dac: ad5758: Reject out-of-range raw values Greg Kroah-Hartman
` (359 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arka Mondal, Nuno Sá,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arka Mondal <arka@arkamondal.net>
[ Upstream commit 465bdce79a9fe140a4b46b95f6bdfd880d197148 ]
ad5758_spi_reg_read() reads into st->d32[2] with spi_sync_transfer(),
but d32 is not marked __aligned(IIO_DMA_MINALIGN), so it can share a
cacheline with the fields before it. When DMA is not cache coherent,
the cache invalidation after the read can discard CPU writes to those
fields.
Mark d32 __aligned(IIO_DMA_MINALIGN). It is the last member of the
struct, so nothing comes after it.
Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support")
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/dac/ad5758.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index 98771e37a7b52..d7fd2acd7dfee 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -118,7 +118,7 @@ struct ad5758_state {
unsigned int dc_dc_ilim;
unsigned int slew_time;
bool pwr_down;
- __be32 d32[3];
+ __be32 d32[3] __aligned(IIO_DMA_MINALIGN);
};
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0640/1756] iio: dac: ad5758: Reject out-of-range raw values
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (638 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0639/1756] iio: dac: ad5758: Fix alignment for DMA safety Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0641/1756] iio: dac: ad5758: Fix the offset calculation Greg Kroah-Hartman
` (358 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arka Mondal, Nuno Sá,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arka Mondal <arka@arkamondal.net>
[ Upstream commit ebc026be1b719e47bd7f2f1e72fabc875b590f87 ]
ad5758_write_raw() passes the value from userspace straight to
ad5758_spi_reg_write(), which keeps only the low 16 bits. Writing -1
to the raw attribute gives full-scale output, and 65536 gives code 0.
Return -EINVAL for values outside 0 to U16_MAX, as ad5755 does.
Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support")
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/dac/ad5758.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index d7fd2acd7dfee..19e8397b6ca05 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -557,6 +557,9 @@ static int ad5758_write_raw(struct iio_dev *indio_dev,
switch (info) {
case IIO_CHAN_INFO_RAW:
+ if (val < 0 || val > U16_MAX)
+ return -EINVAL;
+
mutex_lock(&st->lock);
ret = ad5758_spi_reg_write(st, AD5758_DAC_INPUT, val);
mutex_unlock(&st->lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0641/1756] iio: dac: ad5758: Fix the offset calculation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (639 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0640/1756] iio: dac: ad5758: Reject out-of-range raw values Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0642/1756] ALSA: caiaq: Serialize access to the EP1 command buffer Greg Kroah-Hartman
` (357 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arka Mondal, Nuno Sá,
Jonathan Cameron, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arka Mondal <arka@arkamondal.net>
[ Upstream commit a3b3580713f3ac5a32dc2874ee546828977a1d68 ]
The offset is a count of DAC codes, so the microamp or microvolt units
of min and max cancel out and the final division by 1000 is wrong. For
the +-20 mA range the driver reports -32 instead of -32768. For the
+-5 V and +-10 V ranges min * (1 << 16) also overflows int, and the
reported offset is 0.
Drop the division and do the multiplication in 64 bits.
Fixes: 28d1a7ac2a0d ("iio: dac: Add AD5758 support")
Signed-off-by: Arka Mondal <arka@arkamondal.net>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/dac/ad5758.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index 19e8397b6ca05..b444c21719853 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -9,6 +9,7 @@
#include <linux/bsearch.h>
#include <linux/delay.h>
#include <linux/kernel.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/property.h>
@@ -541,7 +542,7 @@ static int ad5758_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_OFFSET:
min = st->out_range.min;
max = st->out_range.max;
- *val = ((min * (1 << 16)) / (max - min)) / 1000;
+ *val = div_s64((s64)min * (1 << 16), max - min);
return IIO_VAL_INT;
default:
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0642/1756] ALSA: caiaq: Serialize access to the EP1 command buffer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (640 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0641/1756] iio: dac: ad5758: Fix the offset calculation Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0643/1756] ALSA: caiaq: Fix the Kore controller key map Greg Kroah-Hartman
` (356 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niko Huuskonen, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niko Huuskonen <niko.huuskonen.00@gmail.com>
[ Upstream commit a718fd03e1e00211cf4662f5ab82d33f4c18e2a7 ]
snd_usb_caiaq_send_command() and snd_usb_caiaq_send_command_bank() copy
the command into cdev->ep1_out_buf and send it with a synchronous bulk
transfer. Nothing serializes their callers. An ALSA control write, which
sets the LEDs on the Kore controllers and several other devices, can run
at the same time as a PCM prepare, which sends the audio parameters
through the same buffer. One caller can then overwrite the buffer while
the transfer of the other is still in flight, and the device receives a
mix of both commands.
Protect the buffer with a mutex. All callers run in process context and
already sleep in usb_bulk_msg().
The problem was found by code review while adding another user of the
buffer, the Kore LCD support later in this series. It has not been
observed or reproduced.
Fixes: 8e3cd08ed8e5 ("[ALSA] caiaq - add control API and more input features")
Assisted-by: LLM
Signed-off-by: Niko Huuskonen <niko.huuskonen.00@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260927003532.289468-2-niko.huuskonen.00@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/caiaq/device.c | 5 +++++
sound/usb/caiaq/device.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index f604846ec6e6f..e8619bb743581 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -212,6 +212,8 @@ int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *cdev,
if (len > EP1_BUFSIZE - 1)
len = EP1_BUFSIZE - 1;
+ guard(mutex)(&cdev->ep1_out_mutex);
+
if (buffer && len > 0)
memcpy(cdev->ep1_out_buf+1, buffer, len);
@@ -235,6 +237,8 @@ int snd_usb_caiaq_send_command_bank(struct snd_usb_caiaqdev *cdev,
if (len > EP1_BUFSIZE - 2)
len = EP1_BUFSIZE - 2;
+ guard(mutex)(&cdev->ep1_out_mutex);
+
if (buffer && len > 0)
memcpy(cdev->ep1_out_buf+2, buffer, len);
@@ -443,6 +447,7 @@ static int create_card(struct usb_device *usb_dev,
cdev->chip.usb_id = USB_ID(le16_to_cpu(usb_dev->descriptor.idVendor),
le16_to_cpu(usb_dev->descriptor.idProduct));
spin_lock_init(&cdev->spinlock);
+ mutex_init(&cdev->ep1_out_mutex);
*cardp = card;
return 0;
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h
index 1c6f34693fa81..822d872c8ad1a 100644
--- a/sound/usb/caiaq/device.h
+++ b/sound/usb/caiaq/device.h
@@ -2,6 +2,8 @@
#ifndef CAIAQ_DEVICE_H
#define CAIAQ_DEVICE_H
+#include <linux/mutex.h>
+
#include "../usbaudio.h"
#define USB_VID_NATIVEINSTRUMENTS 0x17cc
@@ -68,6 +70,7 @@ struct snd_usb_caiaqdev {
unsigned char ep1_in_buf[EP1_BUFSIZE];
unsigned char ep1_out_buf[EP1_BUFSIZE];
+ struct mutex ep1_out_mutex; /* protects ep1_out_buf */
unsigned char midi_out_buf[EP1_BUFSIZE];
struct caiaq_device_spec spec;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0643/1756] ALSA: caiaq: Fix the Kore controller key map
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (641 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0642/1756] ALSA: caiaq: Serialize access to the EP1 command buffer Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0644/1756] spi: rspi: Fix DMA mode when the DMA controller is built as a module Greg Kroah-Hartman
` (355 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niko Huuskonen, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niko Huuskonen <niko.huuskonen.00@gmail.com>
[ Upstream commit c0508fc6895137f9e2dd43c1a09cc834254cc149 ]
keycode_kore does not match the hardware in two places:
- Softkeys 5 to 8 are listed in reverse order, so pressing the fifth
softkey reports BTN_8, the sixth BTN_7 and so on. Softkeys 1 to 4 are
correct. The OpenKoreBridge project, which drives a Kore 2 through
this driver, works around the same reversal in userspace.
- On the first Kore controller the touch sensors of the eight knobs are
scrambled: touching knob 1 reports KEY_BRL_DOT6, knob 2 KEY_BRL_DOT8,
knob 3 KEY_BRL_DOT2, knob 6 KEY_BRL_DOT7, knob 7 KEY_BRL_DOT1 and
knob 8 KEY_BRL_DOT3. Only knobs 4 and 5 are right.
Put the softkeys in order for both controllers, and give the first Kore
controller its own touch sensor order, so that BTN_n and KEY_BRL_DOTn
belong to the n-th knob. The touch sensor order of the Kore 2 is left
alone, as it could not be checked.
Userspace that compensates for the old order needs to follow. It can
read the key map with EVIOCGKEYCODE, which also makes it possible to
support kernels with and without this change.
Tested on a Kore controller (USB ID 17cc:4711).
Link: https://github.com/OpenKoreBridge/OpenKoreBridge
Fixes: 8e3cd08ed8e5 ("[ALSA] caiaq - add control API and more input features")
Assisted-by: LLM
Signed-off-by: Niko Huuskonen <niko.huuskonen.00@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260927003532.289468-3-niko.huuskonen.00@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/caiaq/input.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c
index 6a5adb8d1e6a7..aee526e0da36a 100644
--- a/sound/usb/caiaq/input.c
+++ b/sound/usb/caiaq/input.c
@@ -41,11 +41,11 @@ static const unsigned short keycode_kore[] = {
BTN_3,
BTN_2,
BTN_1,
- BTN_8,
- BTN_7,
- BTN_6,
BTN_5,
- KEY_BRL_DOT4, /* touch sensitive knobs */
+ BTN_6,
+ BTN_7,
+ BTN_8,
+ KEY_BRL_DOT4, /* touch sensitive knobs (Kore 2 order) */
KEY_BRL_DOT3,
KEY_BRL_DOT2,
KEY_BRL_DOT1,
@@ -55,6 +55,21 @@ static const unsigned short keycode_kore[] = {
KEY_BRL_DOT5
};
+/* index of the first touch sensor in keycode_kore */
+#define KORE_TOUCH_KEYS 24
+
+/* the first Kore controller reports its touch sensors in this order */
+static const unsigned short keycode_kore1_touch[] = {
+ KEY_BRL_DOT4,
+ KEY_BRL_DOT8,
+ KEY_BRL_DOT3,
+ KEY_BRL_DOT7,
+ KEY_BRL_DOT2,
+ KEY_BRL_DOT6,
+ KEY_BRL_DOT1,
+ KEY_BRL_DOT5
+};
+
#define MASCHINE_BUTTONS (42)
#define MASCHINE_BUTTON(X) ((X) + BTN_MISC)
#define MASCHINE_PADS (16)
@@ -656,6 +671,12 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev)
input->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);
BUILD_BUG_ON(sizeof(cdev->keycode) < sizeof(keycode_kore));
memcpy(cdev->keycode, keycode_kore, sizeof(keycode_kore));
+ BUILD_BUG_ON(KORE_TOUCH_KEYS + ARRAY_SIZE(keycode_kore1_touch) >
+ ARRAY_SIZE(keycode_kore));
+ if (cdev->chip.usb_id ==
+ USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER))
+ memcpy(cdev->keycode + KORE_TOUCH_KEYS, keycode_kore1_touch,
+ sizeof(keycode_kore1_touch));
input->keycodemax = ARRAY_SIZE(keycode_kore);
input_set_abs_params(input, ABS_HAT0X, 0, 999, 0, 10);
input_set_abs_params(input, ABS_HAT0Y, 0, 999, 0, 10);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0644/1756] spi: rspi: Fix DMA mode when the DMA controller is built as a module
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (642 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0643/1756] ALSA: caiaq: Fix the Kore controller key map Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0645/1756] ASoC: mediatek: mt8192: fix APLL mux error handling Greg Kroah-Hartman
` (354 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
[ Upstream commit 7b85114d47f693b709b2e8e22e44cdf58c04b111 ]
On the Renesas RZ/G2L platform, the RSPI driver falls back to PIO mode
instead of using DMA when the DMA controller driver is built as a module
(CONFIG_RZ_DMAC=m):
renesas_spi 1004b000.spi: dma_request_slave_channel_compat failed
renesas_spi 1004b000.spi: DMA not available, using PIO
The driver requests DMA channels through dma_request_slave_channel_compat()
which returns either a valid pointer or NULL and cannot handle
-EPROBE_DEFER. If the DMA controller has not probed yet, the driver falls
back to PIO directly.
Fix this by replacing the dma_request_slave_channel_compat() call with a
regular dma_request_chan() call. dma_request_slave_channel_compat() is
always passed a NULL fn_param in all code paths, so it actually behaves
like a plain dma_request_chan() call.
Fixes: e825b8dd2b36 ("spi: rspi: Add DT support to DMA setup")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Link: https://patch.msgid.link/20260921195943.107247-1-ovidiu.panait.rb@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-rspi.c | 49 ++++++++++++++++--------------------------
1 file changed, 19 insertions(+), 30 deletions(-)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 77809e3a5dba7..81323671a7e99 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -22,7 +22,6 @@
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
-#include <linux/sh_dma.h>
#include <linux/spi/spi.h>
#include <linux/spinlock.h>
@@ -1091,24 +1090,15 @@ static irqreturn_t rspi_irq_tx(int irq, void *_sr)
static struct dma_chan *rspi_request_dma_chan(struct device *dev,
enum dma_transfer_direction dir,
- unsigned int id,
dma_addr_t port_addr)
{
- dma_cap_mask_t mask;
struct dma_chan *chan;
struct dma_slave_config cfg;
int ret;
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
-
- chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
- (void *)(unsigned long)id, dev,
- dir == DMA_MEM_TO_DEV ? "tx" : "rx");
- if (!chan) {
- dev_warn(dev, "dma_request_slave_channel_compat failed\n");
- return NULL;
- }
+ chan = dma_request_chan(dev, dir == DMA_MEM_TO_DEV ? "tx" : "rx");
+ if (IS_ERR(chan))
+ return chan;
memset(&cfg, 0, sizeof(cfg));
cfg.dst_addr = port_addr + RSPI_SPDR;
@@ -1121,7 +1111,7 @@ static struct dma_chan *rspi_request_dma_chan(struct device *dev,
if (ret) {
dev_warn(dev, "dmaengine_slave_config failed %d\n", ret);
dma_release_channel(chan);
- return NULL;
+ return ERR_PTR(ret);
}
return chan;
@@ -1130,29 +1120,23 @@ static struct dma_chan *rspi_request_dma_chan(struct device *dev,
static int rspi_request_dma(struct device *dev, struct spi_controller *ctlr,
const struct resource *res)
{
- unsigned int dma_tx_id, dma_rx_id;
+ struct dma_chan *chan;
- if (dev->of_node) {
- /* In the OF case we will get the slave IDs from the DT */
- dma_tx_id = 0;
- dma_rx_id = 0;
- } else {
- /* The driver assumes no error. */
+ if (!dev->of_node)
return 0;
- }
- ctlr->dma_tx = rspi_request_dma_chan(dev, DMA_MEM_TO_DEV, dma_tx_id,
- res->start);
- if (!ctlr->dma_tx)
- return -ENODEV;
+ chan = rspi_request_dma_chan(dev, DMA_MEM_TO_DEV, res->start);
+ if (IS_ERR(chan))
+ return PTR_ERR(chan);
+ ctlr->dma_tx = chan;
- ctlr->dma_rx = rspi_request_dma_chan(dev, DMA_DEV_TO_MEM, dma_rx_id,
- res->start);
- if (!ctlr->dma_rx) {
+ chan = rspi_request_dma_chan(dev, DMA_DEV_TO_MEM, res->start);
+ if (IS_ERR(chan)) {
dma_release_channel(ctlr->dma_tx);
ctlr->dma_tx = NULL;
- return -ENODEV;
+ return PTR_ERR(chan);
}
+ ctlr->dma_rx = chan;
ctlr->can_dma = rspi_can_dma;
dev_info(dev, "DMA available");
@@ -1380,6 +1364,11 @@ static int rspi_probe(struct platform_device *pdev)
}
ret = rspi_request_dma(&pdev->dev, ctlr, res);
+ if (ret == -EPROBE_DEFER) {
+ dev_err_probe(&pdev->dev, ret,
+ "failed to request DMA channels\n");
+ goto error2;
+ }
if (ret < 0)
dev_warn(&pdev->dev, "DMA not available, using PIO\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0645/1756] ASoC: mediatek: mt8192: fix APLL mux error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (643 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0644/1756] spi: rspi: Fix DMA mode when the DMA controller is built as a module Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0646/1756] ASoC: mediatek: mt8192: fix AFE clock " Greg Kroah-Hartman
` (353 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit e8c263e0ef957fd8286e299b2be9266b902cec16 ]
Propagate errors from clock operations in the enable path and clean up
previously enabled clocks when a later operation fails.
For the disable path, continue disabling all clocks even if a clock
operation fails. Log the error without returning it, so the disable path
can perform as much cleanup as possible.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-clk.c | 54 +++++++++++++---------
1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
index 416aff7262539..bd778e5663b56 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
@@ -87,7 +87,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1], ret);
- goto EXIT;
+ return ret;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1],
afe_priv->clk[CLK_TOP_APLL1_CK]);
@@ -95,7 +95,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1],
aud_clks[CLK_TOP_APLL1_CK], ret);
- goto EXIT;
+ goto err_disable_mux_aud_1;
}
/* 180.6336 / 4 = 45.1584MHz */
@@ -103,7 +103,7 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1], ret);
- goto EXIT;
+ goto err_set_parent_mux_aud_1;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1],
afe_priv->clk[CLK_TOP_APLL1_D4]);
@@ -111,31 +111,36 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
aud_clks[CLK_TOP_APLL1_D4], ret);
- goto EXIT;
+ goto err_disable_mux_aud_eng1;
}
} else {
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1],
afe_priv->clk[CLK_CLK26M]);
- if (ret) {
+ if (ret)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
- }
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1],
afe_priv->clk[CLK_CLK26M]);
- if (ret) {
+ if (ret)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_1],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
- }
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
}
-EXIT:
+ return 0;
+
+err_disable_mux_aud_eng1:
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
+err_set_parent_mux_aud_1:
+ clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1],
+ afe_priv->clk[CLK_CLK26M]);
+err_disable_mux_aud_1:
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
+
return ret;
}
@@ -149,7 +154,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2], ret);
- goto EXIT;
+ return ret;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2],
afe_priv->clk[CLK_TOP_APLL2_CK]);
@@ -157,7 +162,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2],
aud_clks[CLK_TOP_APLL2_CK], ret);
- goto EXIT;
+ goto err_disable_mux_aud_2;
}
/* 196.608 / 4 = 49.152MHz */
@@ -165,7 +170,7 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2], ret);
- goto EXIT;
+ goto err_set_parent_mux_aud_2;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2],
afe_priv->clk[CLK_TOP_APLL2_D4]);
@@ -173,31 +178,36 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2],
aud_clks[CLK_TOP_APLL2_D4], ret);
- goto EXIT;
+ goto err_disable_mux_aud_eng2;
}
} else {
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2],
afe_priv->clk[CLK_CLK26M]);
- if (ret) {
+ if (ret)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_ENG2],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
- }
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]);
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2],
afe_priv->clk[CLK_CLK26M]);
- if (ret) {
+ if (ret)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUD_2],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
- }
clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
}
-EXIT:
+ return 0;
+
+err_disable_mux_aud_eng2:
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]);
+err_set_parent_mux_aud_2:
+ clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2],
+ afe_priv->clk[CLK_CLK26M]);
+err_disable_mux_aud_2:
+ clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]);
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0646/1756] ASoC: mediatek: mt8192: fix AFE clock error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (644 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0645/1756] ASoC: mediatek: mt8192: fix APLL mux error handling Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0647/1756] ASoC: mediatek: mt8192: fix error handling in APLL enable functions Greg Kroah-Hartman
` (352 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 7c54781e6e60681af8d0858148d613becb582328 ]
If a clock operation fails in mt8192_afe_enable_clock(), the function
returns immediately via the EXIT label without disabling the clocks
that were successfully enabled earlier in the sequence. This leaves
unneeded clocks running and causes a resource leak.
Properly unwind clocks enabled before an error by jumping to appropriate
cleanup labels on failure.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-clk.c | 28 +++++++++++++++-------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
index bd778e5663b56..7647bdd463d9c 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
@@ -220,21 +220,21 @@ int mt8192_afe_enable_clock(struct mtk_base_afe *afe)
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_INFRA_SYS_AUDIO], ret);
- goto EXIT;
+ return ret;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_INFRA_AUDIO_26M]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_INFRA_AUDIO_26M], ret);
- goto EXIT;
+ goto err_disable_infra_sys_audio;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIO]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIO], ret);
- goto EXIT;
+ goto err_disable_infra_audio_26m;
}
ret = clk_set_parent(afe_priv->clk[CLK_MUX_AUDIO],
afe_priv->clk[CLK_CLK26M]);
@@ -242,14 +242,14 @@ int mt8192_afe_enable_clock(struct mtk_base_afe *afe)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIO],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
+ goto err_disable_mux_audio;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIOINTBUS], ret);
- goto EXIT;
+ goto err_disable_mux_audio;
}
ret = mt8192_set_audio_int_bus_parent(afe, CLK_CLK26M);
@@ -257,7 +257,7 @@ int mt8192_afe_enable_clock(struct mtk_base_afe *afe)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_MUX_AUDIOINTBUS],
aud_clks[CLK_CLK26M], ret);
- goto EXIT;
+ goto err_disable_mux_audiointbus;
}
ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUDIO_H],
@@ -266,17 +266,27 @@ int mt8192_afe_enable_clock(struct mtk_base_afe *afe)
dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[CLK_TOP_MUX_AUDIO_H],
aud_clks[CLK_TOP_APLL2_CK], ret);
- goto EXIT;
+ goto err_disable_mux_audiointbus;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_AFE]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_AFE], ret);
- goto EXIT;
+ goto err_disable_mux_audiointbus;
}
-EXIT:
+ return 0;
+
+err_disable_mux_audiointbus:
+ clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]);
+err_disable_mux_audio:
+ clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIO]);
+err_disable_infra_audio_26m:
+ clk_disable_unprepare(afe_priv->clk[CLK_INFRA_AUDIO_26M]);
+err_disable_infra_sys_audio:
+ clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]);
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0647/1756] ASoC: mediatek: mt8192: fix error handling in APLL enable functions
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (645 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0646/1756] ASoC: mediatek: mt8192: fix AFE clock " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0648/1756] ASoC: mediatek: mt8192: fix MCK clock error handling Greg Kroah-Hartman
` (351 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 88760524ca995acd229c30ec69ced7d883a90a72 ]
If a clock operation fails in mt8192_apll1_enable() or apll2_enable(),
the functions return without checking the return value of mux settings or
unwinding previously enabled clocks and MUX configurations.
Fix this by checking the return value of apll1_mux_setting() and
apll2_mux_setting(), and adding proper unwind handling on failure.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-4-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-clk.c | 32 ++++++++++++++++------
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
index 7647bdd463d9c..118dd48196828 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
@@ -308,20 +308,22 @@ int mt8192_apll1_enable(struct mtk_base_afe *afe)
int ret;
/* setting for APLL */
- apll1_mux_setting(afe, true);
+ ret = apll1_mux_setting(afe, true);
+ if (ret)
+ return ret;
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_APLL22M], ret);
- goto EXIT;
+ goto err_disable_mux_setting;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL1_TUNER]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_APLL1_TUNER], ret);
- goto EXIT;
+ goto err_disable_apll22m;
}
regmap_update_bits(afe->regmap, AFE_APLL1_TUNER_CFG,
@@ -332,7 +334,13 @@ int mt8192_apll1_enable(struct mtk_base_afe *afe)
AFE_22M_ON_MASK_SFT,
0x1 << AFE_22M_ON_SFT);
-EXIT:
+ return 0;
+
+err_disable_apll22m:
+ clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]);
+err_disable_mux_setting:
+ apll1_mux_setting(afe, false);
+
return ret;
}
@@ -358,20 +366,22 @@ int mt8192_apll2_enable(struct mtk_base_afe *afe)
int ret;
/* setting for APLL */
- apll2_mux_setting(afe, true);
+ ret = apll2_mux_setting(afe, true);
+ if (ret)
+ return ret;
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_APLL24M], ret);
- goto EXIT;
+ goto err_disable_mux_setting;
}
ret = clk_prepare_enable(afe_priv->clk[CLK_APLL2_TUNER]);
if (ret) {
dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n",
__func__, aud_clks[CLK_APLL2_TUNER], ret);
- goto EXIT;
+ goto err_disable_apll24m;
}
regmap_update_bits(afe->regmap, AFE_APLL2_TUNER_CFG,
@@ -382,7 +392,13 @@ int mt8192_apll2_enable(struct mtk_base_afe *afe)
AFE_24M_ON_MASK_SFT,
0x1 << AFE_24M_ON_SFT);
-EXIT:
+ return 0;
+
+err_disable_apll24m:
+ clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]);
+err_disable_mux_setting:
+ apll2_mux_setting(afe, false);
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0648/1756] ASoC: mediatek: mt8192: fix MCK clock error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (646 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0647/1756] ASoC: mediatek: mt8192: fix error handling in APLL enable functions Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0649/1756] ASoC: mediatek: mt8192: switch to devm_clk_get_optional() Greg Kroah-Hartman
` (350 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 4a0ab266cb1594f8c6aef3c79726476ad99618c5 ]
If an error occurs after enabling 'm_sel_id' or 'div_clk_id' in
mt8192_mck_enable(), the function returns directly without disabling
the previously enabled clocks, leading to a resource leak.
Fix this by jumping to proper cleanup labels to unwind enabled clocks on
failure paths.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-clk.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
index 118dd48196828..77f596cab92da 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
@@ -619,7 +619,7 @@ int mt8192_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate)
dev_err(afe->dev, "%s(), clk_set_parent %s-%s fail %d\n",
__func__, aud_clks[m_sel_id],
aud_clks[apll_clk_id], ret);
- return ret;
+ goto err_disable_m_sel;
}
}
@@ -628,17 +628,25 @@ int mt8192_mck_enable(struct mtk_base_afe *afe, int mck_id, int rate)
if (ret) {
dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n",
__func__, aud_clks[div_clk_id], ret);
- return ret;
+ goto err_disable_m_sel;
}
ret = clk_set_rate(afe_priv->clk[div_clk_id], rate);
if (ret) {
dev_err(afe->dev, "%s(), clk_set_rate %s, rate %d, fail %d\n",
__func__, aud_clks[div_clk_id],
rate, ret);
- return ret;
+ goto err_disable_div_clk;
}
return 0;
+
+err_disable_div_clk:
+ clk_disable_unprepare(afe_priv->clk[div_clk_id]);
+err_disable_m_sel:
+ if (m_sel_id >= 0)
+ clk_disable_unprepare(afe_priv->clk[m_sel_id]);
+
+ return ret;
}
void mt8192_mck_disable(struct mtk_base_afe *afe, int mck_id)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0649/1756] ASoC: mediatek: mt8192: switch to devm_clk_get_optional()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (647 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0648/1756] ASoC: mediatek: mt8192: fix MCK clock error handling Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0650/1756] ASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks Greg Kroah-Hartman
` (349 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 6f4edfdce0099dc0c346c78c85f58a23d4ee646e ]
Switch from devm_clk_get() to devm_clk_get_optional() when requesting
clocks, as optional clocks automatically return NULL when not present
instead of requiring manual check and NULL assignment.
Additionally, handle clock errors properly using dev_err_probe() to
propagate error codes (such as -EPROBE_DEFER) on failure instead of
just printing a warning and continuing with NULL pointers.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-clk.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
index 77f596cab92da..9b9a3465ddb52 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-clk.c
@@ -672,13 +672,10 @@ int mt8192_init_clock(struct mtk_base_afe *afe)
return -ENOMEM;
for (i = 0; i < CLK_NUM; i++) {
- afe_priv->clk[i] = devm_clk_get(afe->dev, aud_clks[i]);
- if (IS_ERR(afe_priv->clk[i])) {
- dev_warn(afe->dev, "%s devm_clk_get %s fail, ret %ld\n",
- __func__,
- aud_clks[i], PTR_ERR(afe_priv->clk[i]));
- afe_priv->clk[i] = NULL;
- }
+ afe_priv->clk[i] = devm_clk_get_optional(afe->dev, aud_clks[i]);
+ if (IS_ERR(afe_priv->clk[i]))
+ return dev_err_probe(afe->dev, PTR_ERR(afe_priv->clk[i]),
+ "failed to get clock %s\n", aud_clks[i]);
}
afe_priv->apmixedsys = syscon_regmap_lookup_by_phandle(of_node,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0650/1756] ASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (648 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0649/1756] ASoC: mediatek: mt8192: switch to devm_clk_get_optional() Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0651/1756] ASoC: mediatek: mt8192: Propagate errors in mt8192_afe_gpio_request() Greg Kroah-Hartman
` (348 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 14edf39daefbf7aa689ea2bb8811a85c498e0ff6 ]
Convert the explicit mutex_lock()/mutex_unlock() pair to guard(mutex)
to simplify the locking logic and automatically release the mutex on
all exit paths.
This changes the mutex release point from immediately before dev_warn()
to automatic cleanup at scope exit. However, the affected path only emits
a warning and immediately returns -EINVAL, without any further processing.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-6-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 411be3902fa8 ("ASoC: mediatek: mt8192: Propagate errors in mt8192_afe_gpio_request()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-gpio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
index de5e1deaa167d..b993ca2dbd7c8 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
@@ -208,7 +208,7 @@ static int mt8192_afe_gpio_adda_ch34_ul(struct device *dev, bool enable)
int mt8192_afe_gpio_request(struct device *dev, bool enable,
int dai, int uplink)
{
- mutex_lock(&gpio_request_mutex);
+ guard(mutex)(&gpio_request_mutex);
switch (dai) {
case MT8192_DAI_ADDA:
if (uplink)
@@ -296,11 +296,9 @@ int mt8192_afe_gpio_request(struct device *dev, bool enable,
}
break;
default:
- mutex_unlock(&gpio_request_mutex);
dev_warn(dev, "%s(), invalid dai %d\n", __func__, dai);
return -EINVAL;
}
- mutex_unlock(&gpio_request_mutex);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0651/1756] ASoC: mediatek: mt8192: Propagate errors in mt8192_afe_gpio_request()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (649 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0650/1756] ASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0652/1756] ASoC: mediatek: mt8192: check return values in mt8192_afe_gpio_init() Greg Kroah-Hartman
` (347 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 411be3902fa8f879db6f2f55d0c15507efe09c92 ]
Currently, mt8192_afe_gpio_request() ignores the return values from
mt8192_afe_gpio_select() and other helper functions. If configuring
a GPIO state fails, the function still returns 0, hiding the failure
from callers.
Fix this by capturing and returning the error codes properly.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-8-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-gpio.c | 74 +++++++++++----------
1 file changed, 40 insertions(+), 34 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
index b993ca2dbd7c8..ed6dfdf2589bb 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
@@ -208,98 +208,104 @@ static int mt8192_afe_gpio_adda_ch34_ul(struct device *dev, bool enable)
int mt8192_afe_gpio_request(struct device *dev, bool enable,
int dai, int uplink)
{
+ int ret;
+
guard(mutex)(&gpio_request_mutex);
switch (dai) {
case MT8192_DAI_ADDA:
if (uplink)
- mt8192_afe_gpio_adda_ul(dev, enable);
+ ret = mt8192_afe_gpio_adda_ul(dev, enable);
else
- mt8192_afe_gpio_adda_dl(dev, enable);
+ ret = mt8192_afe_gpio_adda_dl(dev, enable);
break;
case MT8192_DAI_ADDA_CH34:
if (uplink)
- mt8192_afe_gpio_adda_ch34_ul(dev, enable);
+ ret = mt8192_afe_gpio_adda_ch34_ul(dev, enable);
else
- mt8192_afe_gpio_adda_ch34_dl(dev, enable);
+ ret = mt8192_afe_gpio_adda_ch34_dl(dev, enable);
break;
case MT8192_DAI_I2S_0:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S0_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S0_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S0_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S0_OFF);
break;
case MT8192_DAI_I2S_1:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S1_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S1_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S1_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S1_OFF);
break;
case MT8192_DAI_I2S_2:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S2_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S2_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S2_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S2_OFF);
break;
case MT8192_DAI_I2S_3:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S3_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S3_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S3_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S3_OFF);
break;
case MT8192_DAI_I2S_5:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S5_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S5_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S5_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S5_OFF);
break;
case MT8192_DAI_I2S_6:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S6_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S6_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S6_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S6_OFF);
break;
case MT8192_DAI_I2S_7:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S7_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S7_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S7_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S7_OFF);
break;
case MT8192_DAI_I2S_8:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S8_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S8_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S8_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S8_OFF);
break;
case MT8192_DAI_I2S_9:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S9_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S9_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S9_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_I2S9_OFF);
break;
case MT8192_DAI_TDM:
if (enable)
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_TDM_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_TDM_ON);
else
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_TDM_OFF);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_TDM_OFF);
break;
case MT8192_DAI_VOW:
if (enable) {
- mt8192_afe_gpio_select(dev,
- MT8192_AFE_GPIO_VOW_CLK_ON);
- mt8192_afe_gpio_select(dev,
- MT8192_AFE_GPIO_VOW_DAT_ON);
+ ret = mt8192_afe_gpio_select(dev,
+ MT8192_AFE_GPIO_VOW_CLK_ON);
+ if (ret)
+ break;
+ ret = mt8192_afe_gpio_select(dev,
+ MT8192_AFE_GPIO_VOW_DAT_ON);
} else {
- mt8192_afe_gpio_select(dev,
- MT8192_AFE_GPIO_VOW_CLK_OFF);
- mt8192_afe_gpio_select(dev,
- MT8192_AFE_GPIO_VOW_DAT_OFF);
+ ret = mt8192_afe_gpio_select(dev,
+ MT8192_AFE_GPIO_VOW_CLK_OFF);
+ if (ret)
+ break;
+ ret = mt8192_afe_gpio_select(dev,
+ MT8192_AFE_GPIO_VOW_DAT_OFF);
}
break;
default:
dev_warn(dev, "%s(), invalid dai %d\n", __func__, dai);
- return -EINVAL;
+ ret = -EINVAL;
}
- return 0;
+ return ret;
}
EXPORT_SYMBOL(mt8192_afe_gpio_request);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0652/1756] ASoC: mediatek: mt8192: check return values in mt8192_afe_gpio_init()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (650 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0651/1756] ASoC: mediatek: mt8192: Propagate errors in mt8192_afe_gpio_request() Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0653/1756] ASoC: mediatek: mt8192: Handle regcache_sync() failure in runtime resume Greg Kroah-Hartman
` (346 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 7cca184ad434436e8f4648f71756bab0c3593ed9 ]
Currently, mt8192_afe_gpio_init() ignores the return values of
mt8192_afe_gpio_select() and mt8192_afe_gpio_request(). If configuring
GPIO states or requesting GPIOs fails during initialization, the function
still proceeds and returns 0, masking the initialization failure.
Fix this by checking and propagating the return values properly.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-10-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-gpio.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
index ed6dfdf2589bb..f2d5e61fbb639 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-gpio.c
@@ -151,13 +151,17 @@ int mt8192_afe_gpio_init(struct device *dev)
}
}
- mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_CLK_MOSI_ON);
+ ret = mt8192_afe_gpio_select(dev, MT8192_AFE_GPIO_CLK_MOSI_ON);
+ if (ret)
+ return ret;
/* gpio status init */
- mt8192_afe_gpio_request(dev, false, MT8192_DAI_ADDA, 0);
- mt8192_afe_gpio_request(dev, false, MT8192_DAI_ADDA, 1);
+ ret = mt8192_afe_gpio_request(dev, false, MT8192_DAI_ADDA, 0);
+ if (ret)
+ return ret;
+ ret = mt8192_afe_gpio_request(dev, false, MT8192_DAI_ADDA, 1);
- return 0;
+ return ret;
}
EXPORT_SYMBOL(mt8192_afe_gpio_init);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0653/1756] ASoC: mediatek: mt8192: Handle regcache_sync() failure in runtime resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (651 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0652/1756] ASoC: mediatek: mt8192: check return values in mt8192_afe_gpio_init() Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0654/1756] ASoC: mediatek: mt8192: Propagate mt8192_afe_gpio_request() errors in ADDA DAI Greg Kroah-Hartman
` (345 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit d9e264741b041fc9dffc555bc1ab68708658cefd ]
Currently, the return value of regcache_sync() in
mt8192_afe_runtime_resume() is ignored. If regcache_sync() fails, the
function continues execution with clocks enabled and regcache out of sync.
Fix this by checking the return value of regcache_sync(). On failure,
restore regcache to cache-only mode and disable the clocks enabled
earlier in the function.
Fixes: 125ab5d588b0 ("ASoC: mediatek: mt8192: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-11-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
index a65e21b19da49..e574f4fb64a92 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
@@ -2104,7 +2104,11 @@ static int mt8192_afe_runtime_resume(struct device *dev)
goto skip_regmap;
regcache_cache_only(afe->regmap, false);
- regcache_sync(afe->regmap);
+ ret = regcache_sync(afe->regmap);
+ if (ret) {
+ regcache_cache_only(afe->regmap, true);
+ mt8192_afe_disable_clock(afe);
+ }
/* enable audio sys DCM for power saving */
regmap_update_bits(afe_priv->infracfg,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0654/1756] ASoC: mediatek: mt8192: Propagate mt8192_afe_gpio_request() errors in ADDA DAI
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (652 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0653/1756] ASoC: mediatek: mt8192: Handle regcache_sync() failure in runtime resume Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0655/1756] ASoC: mediatek: mt8192: Propagate errors in TDM DAI DAPM event handlers Greg Kroah-Hartman
` (344 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit eed9414a1b075e2df308e7222e3786981bd42b32 ]
Currently, DAPM event handlers in mt8192-dai-adda.c ignore the return
value of mt8192_afe_gpio_request(). If GPIO configuration fails during
PRE_PMU or POST_PMD events, the error is silently ignored.
Fix this by checking and propagating error codes from
mt8192_afe_gpio_request() in all ADDA DAPM event handlers.
Fixes: 607ac4859564 ("ASoC: mediatek: mt8192: support adda in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-13-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 44 +++++++++++++++------
1 file changed, 32 insertions(+), 12 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c
index 99de85b876435..9a29f2feb174d 100644
--- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c
+++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c
@@ -218,10 +218,13 @@ static int mtk_adda_ul_event(struct snd_soc_dapm_widget *w,
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mt8192_afe_private *afe_priv = afe->platform_priv;
int mtkaif_dmic = afe_priv->mtkaif_dmic;
+ int ret;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1);
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1);
+ if (ret)
+ return ret;
/* update setting to dmic */
if (mtkaif_dmic) {
@@ -239,7 +242,9 @@ static int mtk_adda_ul_event(struct snd_soc_dapm_widget *w,
case SND_SOC_DAPM_POST_PMD:
/* should delayed 1/fs(smallest is 8k) = 125us before afe off */
usleep_range(125, 135);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 1);
+ ret = mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 1);
+ if (ret)
+ return ret;
break;
default:
break;
@@ -257,11 +262,14 @@ static int mtk_adda_ch34_ul_event(struct snd_soc_dapm_widget *w,
struct mt8192_afe_private *afe_priv = afe->platform_priv;
int mtkaif_dmic = afe_priv->mtkaif_dmic_ch34;
int mtkaif_adda6_only = afe_priv->mtkaif_adda6_only;
+ int ret;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34,
- 1);
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34,
+ 1);
+ if (ret)
+ return ret;
/* update setting to dmic */
if (mtkaif_dmic) {
@@ -291,8 +299,10 @@ static int mtk_adda_ch34_ul_event(struct snd_soc_dapm_widget *w,
case SND_SOC_DAPM_POST_PMD:
/* should delayed 1/fs(smallest is 8k) = 125us before afe off */
usleep_range(125, 135);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34,
- 1);
+ ret = mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34,
+ 1);
+ if (ret)
+ return ret;
/* reset dmic */
afe_priv->mtkaif_dmic_ch34 = 0;
@@ -446,15 +456,20 @@ static int mtk_adda_dl_event(struct snd_soc_dapm_widget *w,
{
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
+ int ret;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 0);
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 0);
+ if (ret)
+ return ret;
break;
case SND_SOC_DAPM_POST_PMD:
/* should delayed 1/fs(smallest is 8k) = 125us before afe off */
usleep_range(125, 135);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 0);
+ ret = mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 0);
+ if (ret)
+ return ret;
break;
default:
break;
@@ -469,17 +484,22 @@ static int mtk_adda_ch34_dl_event(struct snd_soc_dapm_widget *w,
{
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
+ int ret;
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34,
- 0);
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34,
+ 0);
+ if (ret)
+ return ret;
break;
case SND_SOC_DAPM_POST_PMD:
/* should delayed 1/fs(smallest is 8k) = 125us before afe off */
usleep_range(125, 135);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34,
- 0);
+ ret = mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34,
+ 0);
+ if (ret)
+ return ret;
break;
default:
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0655/1756] ASoC: mediatek: mt8192: Propagate errors in TDM DAI DAPM event handlers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (653 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0654/1756] ASoC: mediatek: mt8192: Propagate mt8192_afe_gpio_request() errors in ADDA DAI Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0656/1756] ASoC: mediatek: mt8192: Propagate errors in I2S " Greg Kroah-Hartman
` (343 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit d0bc9613bc2d9e20a7e4f3e447cd9427c95d194a ]
Currently, DAPM event handlers in mt8192-dai-tdm.c ignore return values
from mt8192_afe_gpio_request() and mt8192_mck_enable().
If GPIO configuration or master clock setup fails during DAPM events,
the error is silently ignored.
Fix this by checking and propagating error codes properly in all
TDM DAI DAPM event handlers.
Fixes: 52fcd65414ab ("ASoC: mediatek: mt8192: support tdm in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-14-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-dai-tdm.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c b/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c
index 49440db370af0..36fa0f32ed1cb 100644
--- a/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c
+++ b/sound/soc/mediatek/mt8192/mt8192-dai-tdm.c
@@ -250,6 +250,7 @@ static int mtk_tdm_en_event(struct snd_soc_dapm_widget *w,
struct mt8192_afe_private *afe_priv = afe->platform_priv;
int dai_id = get_tdm_id_by_name(w->name);
struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id];
+ int ret;
if (!tdm_priv) {
dev_warn(afe->dev, "%s(), tdm_priv == NULL", __func__);
@@ -261,16 +262,17 @@ static int mtk_tdm_en_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_afe_gpio_request(afe->dev, true, tdm_priv->id, 0);
+ ret = mt8192_afe_gpio_request(afe->dev, true, tdm_priv->id, 0);
break;
case SND_SOC_DAPM_POST_PMD:
- mt8192_afe_gpio_request(afe->dev, false, tdm_priv->id, 0);
+ ret = mt8192_afe_gpio_request(afe->dev, false, tdm_priv->id, 0);
break;
default:
+ ret = 0;
break;
}
- return 0;
+ return ret;
}
static int mtk_tdm_bck_en_event(struct snd_soc_dapm_widget *w,
@@ -282,6 +284,7 @@ static int mtk_tdm_bck_en_event(struct snd_soc_dapm_widget *w,
struct mt8192_afe_private *afe_priv = afe->platform_priv;
int dai_id = get_tdm_id_by_name(w->name);
struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id];
+ int ret;
if (!tdm_priv) {
dev_warn(afe->dev, "%s(), tdm_priv == NULL", __func__);
@@ -293,7 +296,9 @@ static int mtk_tdm_bck_en_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_mck_enable(afe, tdm_priv->bck_id, tdm_priv->bck_rate);
+ ret = mt8192_mck_enable(afe, tdm_priv->bck_id, tdm_priv->bck_rate);
+ if (ret)
+ return ret;
break;
case SND_SOC_DAPM_POST_PMD:
mt8192_mck_disable(afe, tdm_priv->bck_id);
@@ -314,6 +319,7 @@ static int mtk_tdm_mck_en_event(struct snd_soc_dapm_widget *w,
struct mt8192_afe_private *afe_priv = afe->platform_priv;
int dai_id = get_tdm_id_by_name(w->name);
struct mtk_afe_tdm_priv *tdm_priv = afe_priv->dai_priv[dai_id];
+ int ret;
if (!tdm_priv) {
dev_warn(afe->dev, "%s(), tdm_priv == NULL", __func__);
@@ -325,7 +331,9 @@ static int mtk_tdm_mck_en_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_mck_enable(afe, tdm_priv->mclk_id, tdm_priv->mclk_rate);
+ ret = mt8192_mck_enable(afe, tdm_priv->mclk_id, tdm_priv->mclk_rate);
+ if (ret)
+ return ret;
break;
case SND_SOC_DAPM_POST_PMD:
tdm_priv->mclk_rate = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0656/1756] ASoC: mediatek: mt8192: Propagate errors in I2S DAI DAPM event handlers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (654 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0655/1756] ASoC: mediatek: mt8192: Propagate errors in TDM DAI DAPM event handlers Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0657/1756] ASoC: mediatek: mt8192-mt6359: Fix error handling in MTKAIF calibration Greg Kroah-Hartman
` (342 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 49aeb628d10ef3d5694c39b7a3427d34bde06bb2 ]
Currently, DAPM event handlers in mt8192-dai-i2s.c ignore return values
from mt8192_afe_gpio_request(), mt8192_apll1_enable(),
mt8192_apll2_enable(), and mt8192_mck_enable(). If GPIO configuration or
clock setup fails during DAPM events, the error is silently ignored.
Fix this by checking and propagating error codes properly in all I2S DAI
DAPM event handlers.
Fixes: 2c37b4ed730b ("ASoC: mediatek: mt8192: support i2s in platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-15-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8192/mt8192-dai-i2s.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c b/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
index 47dc7ec4cae7e..374df85411b7c 100644
--- a/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
+++ b/sound/soc/mediatek/mt8192/mt8192-dai-i2s.c
@@ -586,6 +586,7 @@ static int mtk_i2s_en_event(struct snd_soc_dapm_widget *w,
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mtk_afe_i2s_priv *i2s_priv;
+ int ret;
i2s_priv = get_i2s_priv_by_name(afe, w->name);
@@ -599,16 +600,17 @@ static int mtk_i2s_en_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_afe_gpio_request(afe->dev, true, i2s_priv->id, 0);
+ ret = mt8192_afe_gpio_request(afe->dev, true, i2s_priv->id, 0);
break;
case SND_SOC_DAPM_POST_PMD:
- mt8192_afe_gpio_request(afe->dev, false, i2s_priv->id, 0);
+ ret = mt8192_afe_gpio_request(afe->dev, false, i2s_priv->id, 0);
break;
default:
+ ret = 0;
break;
}
- return 0;
+ return ret;
}
static int mtk_apll_event(struct snd_soc_dapm_widget *w,
@@ -617,6 +619,7 @@ static int mtk_apll_event(struct snd_soc_dapm_widget *w,
{
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
+ int ret;
dev_dbg(cmpnt->dev, "%s(), name %s, event 0x%x\n",
__func__, w->name, event);
@@ -624,9 +627,11 @@ static int mtk_apll_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
if (snd_soc_dapm_widget_name_cmp(w, APLL1_W_NAME) == 0)
- mt8192_apll1_enable(afe);
+ ret = mt8192_apll1_enable(afe);
else
- mt8192_apll2_enable(afe);
+ ret = mt8192_apll2_enable(afe);
+ if (ret)
+ return ret;
break;
case SND_SOC_DAPM_POST_PMD:
if (snd_soc_dapm_widget_name_cmp(w, APLL1_W_NAME) == 0)
@@ -704,6 +709,7 @@ static int mtk_mclk_en_event(struct snd_soc_dapm_widget *w,
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt);
struct mtk_afe_i2s_priv *i2s_priv;
+ int ret;
dev_dbg(cmpnt->dev, "%s(), name %s, event 0x%x\n",
__func__, w->name, event);
@@ -716,7 +722,9 @@ static int mtk_mclk_en_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
- mt8192_mck_enable(afe, i2s_priv->mclk_id, i2s_priv->mclk_rate);
+ ret = mt8192_mck_enable(afe, i2s_priv->mclk_id, i2s_priv->mclk_rate);
+ if (ret)
+ return ret;
break;
case SND_SOC_DAPM_POST_PMD:
i2s_priv->mclk_rate = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0657/1756] ASoC: mediatek: mt8192-mt6359: Fix error handling in MTKAIF calibration
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (655 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0656/1756] ASoC: mediatek: mt8192: Propagate errors in I2S " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0658/1756] perf machine: Factor creating a "live" machine out of dwarf-unwind Greg Kroah-Hartman
` (341 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit d6c8a0b5bf696d89350e43bf554362de8929f801 ]
mt8192_mt6359_mtkaif_calibration() ignored the return values of
pm_runtime_get_sync() and mt8192_afe_gpio_request(), which could
leave PM runtime references or GPIO state unbalanced on failure.
Switch to pm_runtime_resume_and_get(), check each GPIO request,
and unwind on error.
Fixes: 18b13ff23fab ("ASoC: mediatek: mt8192: add machine driver with mt6359, rt1015 and rt5682")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260918133912.133799-16-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../mt8192/mt8192-mt6359-rt1015-rt5682.c | 37 +++++++++++++------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
index dd1d43ce2af62..5f50b4cf19c28 100644
--- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
+++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
@@ -163,12 +163,23 @@ static int mt8192_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
int chosen_phase_1, chosen_phase_2, chosen_phase_3;
int counter;
int mtkaif_calib_ok;
+ int ret = 0;
- pm_runtime_get_sync(afe->dev);
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1);
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 0);
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, 1);
- mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, 0);
+ ret = pm_runtime_resume_and_get(afe->dev);
+ if (ret < 0)
+ return ret;
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1);
+ if (ret)
+ goto err_pm_put;
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 0);
+ if (ret)
+ goto err_disable_adda_1;
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, 1);
+ if (ret)
+ goto err_disable_adda_0;
+ ret = mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, 0);
+ if (ret)
+ goto err_disable_adda_ch34_1;
mt6359_mtkaif_calibration_enable(cmpnt_codec);
@@ -289,10 +300,14 @@ static int mt8192_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
mt6359_mtkaif_calibration_disable(cmpnt_codec);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 1);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 0);
- mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34, 1);
mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34, 0);
+err_disable_adda_ch34_1:
+ mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34, 1);
+err_disable_adda_0:
+ mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 0);
+err_disable_adda_1:
+ mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 1);
+err_pm_put:
pm_runtime_put(afe->dev);
dev_dbg(afe->dev, "%s(), mtkaif_chosen_phase[0/1/2]:%d/%d/%d\n",
@@ -301,7 +316,7 @@ static int mt8192_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
afe_priv->mtkaif_chosen_phase[1],
afe_priv->mtkaif_chosen_phase[2]);
- return 0;
+ return ret;
}
static int mt8192_mt6359_init(struct snd_soc_pcm_runtime *rtd)
@@ -319,9 +334,7 @@ static int mt8192_mt6359_init(struct snd_soc_pcm_runtime *rtd)
afe_priv->mtkaif_protocol = MTKAIF_PROTOCOL_2_CLK_P2;
/* mtkaif calibration */
- mt8192_mt6359_mtkaif_calibration(rtd);
-
- return 0;
+ return mt8192_mt6359_mtkaif_calibration(rtd);
}
static int mt8192_rt5682_init(struct snd_soc_pcm_runtime *rtd)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0658/1756] perf machine: Factor creating a "live" machine out of dwarf-unwind
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (656 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0657/1756] ASoC: mediatek: mt8192-mt6359: Fix error handling in MTKAIF calibration Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0659/1756] perf debug: Add function symbols to dump_stack Greg Kroah-Hartman
` (340 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Adrian Hunter,
Alexander Shishkin, Andi Kleen, Anne Macedo, Dmitriy Vyukov,
Dr. David Alan Gilbert, Howard Chu, Ingo Molnar, James Clark,
Jiri Olsa, Kan Liang, Mark Rutland, Michael Petlan, Namhyung Kim,
Peter Zijlstra, Yicong Yang, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 4c04654455c09b4905b84c350d88f718260a4cd4 ]
Factor out for use in places other than the dwarf unwinding tests for
libunwind.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Anne Macedo <retpolanne@posteo.net>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20250313052952.871958-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 58bf7b7af359 ("perf test code-reading: Fix duplicate kernel maps and machine leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/dwarf-unwind.c | 35 ++++------------------
tools/perf/util/machine.c | 53 +++++++++++++++++++++++++++------
tools/perf/util/machine.h | 1 +
3 files changed, 51 insertions(+), 38 deletions(-)
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 4803ab2d97ba6..525c46b7971ad 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -15,7 +15,6 @@
#include "symbol.h"
#include "thread.h"
#include "callchain.h"
-#include "util/synthetic-events.h"
/* For bsearch. We try to unwind functions in shared object. */
#include <stdlib.h>
@@ -37,24 +36,6 @@
#define NO_TAIL_CALL_BARRIER __asm__ __volatile__("" : : : "memory");
#endif
-static int mmap_handler(const struct perf_tool *tool __maybe_unused,
- union perf_event *event,
- struct perf_sample *sample,
- struct machine *machine)
-{
- return machine__process_mmap2_event(machine, event, sample);
-}
-
-static int init_live_machine(struct machine *machine)
-{
- union perf_event event;
- pid_t pid = getpid();
-
- memset(&event, 0, sizeof(event));
- return perf_event__synthesize_mmap_events(NULL, &event, pid, pid,
- mmap_handler, machine, true);
-}
-
/*
* We need to keep these functions global, despite the
* fact that they are used only locally in this object,
@@ -202,8 +183,12 @@ noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused,
struct machine *machine;
struct thread *thread;
int err = -1;
+ pid_t pid = getpid();
- machine = machine__new_host();
+ callchain_param.record_mode = CALLCHAIN_DWARF;
+ dwarf_callchain_users = true;
+
+ machine = machine__new_live(/*kernel_maps=*/true, pid);
if (!machine) {
pr_err("Could not get machine\n");
return -1;
@@ -214,18 +199,10 @@ noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused,
return -1;
}
- callchain_param.record_mode = CALLCHAIN_DWARF;
- dwarf_callchain_users = true;
-
- if (init_live_machine(machine)) {
- pr_err("Could not init machine\n");
- goto out;
- }
-
if (verbose > 1)
machine__fprintf(machine, stderr);
- thread = machine__find_thread(machine, getpid(), getpid());
+ thread = machine__find_thread(machine, pid, pid);
if (!thread) {
pr_err("Could not get thread\n");
goto out;
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 78c021b246a6c..d124a196ad4cc 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -20,6 +20,7 @@
#include "path.h"
#include "srcline.h"
#include "symbol.h"
+#include "synthetic-events.h"
#include "sort.h"
#include "strlist.h"
#include "target.h"
@@ -125,23 +126,57 @@ int machine__init(struct machine *machine, const char *root_dir, pid_t pid)
return 0;
}
-struct machine *machine__new_host(void)
+static struct machine *__machine__new_host(bool kernel_maps)
{
struct machine *machine = malloc(sizeof(*machine));
- if (machine != NULL) {
- machine__init(machine, "", HOST_KERNEL_ID);
+ if (!machine)
+ return NULL;
- if (machine__create_kernel_maps(machine) < 0)
- goto out_delete;
+ machine__init(machine, "", HOST_KERNEL_ID);
- machine->env = &perf_env;
+ if (kernel_maps && machine__create_kernel_maps(machine) < 0) {
+ free(machine);
+ return NULL;
}
+ machine->env = &perf_env;
+ return machine;
+}
+
+struct machine *machine__new_host(void)
+{
+ return __machine__new_host(/*kernel_maps=*/true);
+}
+
+static int mmap_handler(const struct perf_tool *tool __maybe_unused,
+ union perf_event *event,
+ struct perf_sample *sample,
+ struct machine *machine)
+{
+ return machine__process_mmap2_event(machine, event, sample);
+}
+static int machine__init_live(struct machine *machine, pid_t pid)
+{
+ union perf_event event;
+
+ memset(&event, 0, sizeof(event));
+ return perf_event__synthesize_mmap_events(NULL, &event, pid, pid,
+ mmap_handler, machine, true);
+}
+
+struct machine *machine__new_live(bool kernel_maps, pid_t pid)
+{
+ struct machine *machine = __machine__new_host(kernel_maps);
+
+ if (!machine)
+ return NULL;
+
+ if (machine__init_live(machine, pid)) {
+ machine__delete(machine);
+ return NULL;
+ }
return machine;
-out_delete:
- free(machine);
- return NULL;
}
struct machine *machine__new_kallsyms(void)
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 2e5a4cb342d82..a3314f87a350e 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -165,6 +165,7 @@ void machines__set_comm_exec(struct machines *machines, bool comm_exec);
struct machine *machine__new_host(void);
struct machine *machine__new_kallsyms(void);
+struct machine *machine__new_live(bool kernel_maps, pid_t pid);
int machine__init(struct machine *machine, const char *root_dir, pid_t pid);
void machine__exit(struct machine *machine);
void machine__delete_threads(struct machine *machine);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0659/1756] perf debug: Add function symbols to dump_stack
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (657 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0658/1756] perf machine: Factor creating a "live" machine out of dwarf-unwind Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0660/1756] perf test: Avoid use perf_env Greg Kroah-Hartman
` (339 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 9c9f4a27eb1096beb650f312a1ce996a9960b56c ]
Symbolize stack traces by creating a live machine. Add this
functionality to dump_stack and switch dump_stack users to use
it. Switch TUI to use it. Add stack traces to the child test function
which can be useful to diagnose blocked code.
Example output:
```
$ perf test -vv PERF_RECORD_
...
7: PERF_RECORD_* events & perf_sample fields:
7: PERF_RECORD_* events & perf_sample fields : Running (1 active)
^C
Signal (2) while running tests.
Terminating tests with the same signal
Internal test harness failure. Completing any started tests:
: 7: PERF_RECORD_* events & perf_sample fields:
---- unexpected signal (2) ----
#0 0x55788c6210a3 in child_test_sig_handler builtin-test.c:0
#1 0x7fc12fe49df0 in __restore_rt libc_sigaction.c:0
#2 0x7fc12fe99687 in __internal_syscall_cancel cancellation.c:64
#3 0x7fc12fee5f7a in clock_nanosleep@GLIBC_2.2.5 clock_nanosleep.c:72
#4 0x7fc12fef1393 in __nanosleep nanosleep.c:26
#5 0x7fc12ff02d68 in __sleep sleep.c:55
#6 0x55788c63196b in test__PERF_RECORD perf-record.c:0
#7 0x55788c620fb0 in run_test_child builtin-test.c:0
#8 0x55788c5bd18d in start_command run-command.c:127
#9 0x55788c621ef3 in __cmd_test builtin-test.c:0
#10 0x55788c6225bf in cmd_test ??:0
#11 0x55788c5afbd0 in run_builtin perf.c:0
#12 0x55788c5afeeb in handle_internal_command perf.c:0
#13 0x55788c52b383 in main ??:0
#14 0x7fc12fe33ca8 in __libc_start_call_main libc_start_call_main.h:74
#15 0x7fc12fe33d65 in __libc_start_main@@GLIBC_2.34 libc-start.c:128
#16 0x55788c52b9d1 in _start ??:0
---- unexpected signal (2) ----
#0 0x55788c6210a3 in child_test_sig_handler builtin-test.c:0
#1 0x7fc12fe49df0 in __restore_rt libc_sigaction.c:0
#2 0x7fc12fea3a14 in pthread_sigmask@GLIBC_2.2.5 pthread_sigmask.c:45
#3 0x7fc12fe49fd9 in __GI___sigprocmask sigprocmask.c:26
#4 0x7fc12ff2601b in __longjmp_chk longjmp.c:36
#5 0x55788c6210c0 in print_test_result.isra.0 builtin-test.c:0
#6 0x7fc12fe49df0 in __restore_rt libc_sigaction.c:0
#7 0x7fc12fe99687 in __internal_syscall_cancel cancellation.c:64
#8 0x7fc12fee5f7a in clock_nanosleep@GLIBC_2.2.5 clock_nanosleep.c:72
#9 0x7fc12fef1393 in __nanosleep nanosleep.c:26
#10 0x7fc12ff02d68 in __sleep sleep.c:55
#11 0x55788c63196b in test__PERF_RECORD perf-record.c:0
#12 0x55788c620fb0 in run_test_child builtin-test.c:0
#13 0x55788c5bd18d in start_command run-command.c:127
#14 0x55788c621ef3 in __cmd_test builtin-test.c:0
#15 0x55788c6225bf in cmd_test ??:0
#16 0x55788c5afbd0 in run_builtin perf.c:0
#17 0x55788c5afeeb in handle_internal_command perf.c:0
#18 0x55788c52b383 in main ??:0
#19 0x7fc12fe33ca8 in __libc_start_call_main libc_start_call_main.h:74
#20 0x7fc12fe33d65 in __libc_start_main@@GLIBC_2.34 libc-start.c:128
#21 0x55788c52b9d1 in _start ??:0
7: PERF_RECORD_* events & perf_sample fields : Skip (permissions)
```
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250624210500.2121303-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Stable-dep-of: 58bf7b7af359 ("perf test code-reading: Fix duplicate kernel maps and machine leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/builtin-test.c | 15 +++++++-
tools/perf/ui/tui/setup.c | 2 +-
tools/perf/util/debug.c | 68 +++++++++++++++++++++++++++------
tools/perf/util/debug.h | 1 +
4 files changed, 73 insertions(+), 13 deletions(-)
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index e35b138f4bd0e..4698b48d15a5c 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -6,6 +6,9 @@
*/
#include <fcntl.h>
#include <errno.h>
+#ifdef HAVE_BACKTRACE_SUPPORT
+#include <execinfo.h>
+#endif
#include <poll.h>
#include <unistd.h>
#include <setjmp.h>
@@ -233,6 +236,16 @@ static jmp_buf run_test_jmp_buf;
static void child_test_sig_handler(int sig)
{
+#ifdef HAVE_BACKTRACE_SUPPORT
+ void *stackdump[32];
+ size_t stackdump_size;
+#endif
+
+ fprintf(stderr, "\n---- unexpected signal (%d) ----\n", sig);
+#ifdef HAVE_BACKTRACE_SUPPORT
+ stackdump_size = backtrace(stackdump, ARRAY_SIZE(stackdump));
+ __dump_stack(stderr, stackdump, stackdump_size);
+#endif
siglongjmp(run_test_jmp_buf, sig);
}
@@ -246,7 +259,7 @@ static int run_test_child(struct child_process *process)
err = sigsetjmp(run_test_jmp_buf, 1);
if (err) {
- fprintf(stderr, "\n---- unexpected signal (%d) ----\n", err);
+ /* Received signal. */
err = err > 0 ? -err : -1;
goto err_out;
}
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c
index 16c6eff4d2411..022534eed68cc 100644
--- a/tools/perf/ui/tui/setup.c
+++ b/tools/perf/ui/tui/setup.c
@@ -108,7 +108,7 @@ static void ui__signal_backtrace(int sig)
printf("-------- backtrace --------\n");
size = backtrace(stackdump, ARRAY_SIZE(stackdump));
- backtrace_symbols_fd(stackdump, size, STDOUT_FILENO);
+ __dump_stack(stdout, stackdump, size);
exit(0);
}
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index e56330c85fe7e..a561eb97a9a86 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -14,11 +14,18 @@
#ifdef HAVE_BACKTRACE_SUPPORT
#include <execinfo.h>
#endif
+#include "addr_location.h"
#include "color.h"
-#include "event.h"
#include "debug.h"
+#include "event.h"
+#include "machine.h"
+#include "map.h"
#include "print_binary.h"
+#include "srcline.h"
+#include "symbol.h"
+#include "synthetic-events.h"
#include "target.h"
+#include "thread.h"
#include "trace-event.h"
#include "ui/helpline.h"
#include "ui/ui.h"
@@ -298,21 +305,60 @@ void perf_debug_setup(void)
libapi_set_print(pr_warning_wrapper, pr_warning_wrapper, pr_debug_wrapper);
}
+void __dump_stack(FILE *file, void **stackdump, size_t stackdump_size)
+{
+ /* TODO: async safety. printf, malloc, etc. aren't safe inside a signal handler. */
+ pid_t pid = getpid();
+ struct machine *machine = machine__new_live(/*kernel_maps=*/false, pid);
+ struct thread *thread = NULL;
+
+ if (machine)
+ thread = machine__find_thread(machine, pid, pid);
+
+#ifdef HAVE_BACKTRACE_SUPPORT
+ if (!machine || !thread) {
+ /*
+ * Backtrace functions are async signal safe. Fall back on them
+ * if machine/thread creation fails.
+ */
+ backtrace_symbols_fd(stackdump, stackdump_size, fileno(file));
+ machine__delete(machine);
+ return;
+ }
+#endif
+
+ for (size_t i = 0; i < stackdump_size; i++) {
+ struct addr_location al;
+ u64 addr = (u64)(uintptr_t)stackdump[i];
+ bool printed = false;
+
+ addr_location__init(&al);
+ if (thread && thread__find_map(thread, PERF_RECORD_MISC_USER, addr, &al)) {
+ al.sym = map__find_symbol(al.map, al.addr);
+ if (al.sym) {
+ fprintf(file, " #%zd %p in %s ", i, stackdump[i], al.sym->name);
+ printed = true;
+ }
+ }
+ if (!printed)
+ fprintf(file, " #%zd %p ", i, stackdump[i]);
+
+ map__fprintf_srcline(al.map, al.addr, "", file);
+ fprintf(file, "\n");
+ addr_location__exit(&al);
+ }
+ thread__put(thread);
+ machine__delete(machine);
+}
+
/* Obtain a backtrace and print it to stdout. */
#ifdef HAVE_BACKTRACE_SUPPORT
void dump_stack(void)
{
- void *array[16];
- size_t size = backtrace(array, ARRAY_SIZE(array));
- char **strings = backtrace_symbols(array, size);
- size_t i;
-
- printf("Obtained %zd stack frames.\n", size);
-
- for (i = 0; i < size; i++)
- printf("%s\n", strings[i]);
+ void *stackdump[32];
+ size_t size = backtrace(stackdump, ARRAY_SIZE(stackdump));
- free(strings);
+ __dump_stack(stdout, stackdump, size);
}
#else
void dump_stack(void) {}
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h
index a4026d1fd6a31..6b737e195ce1b 100644
--- a/tools/perf/util/debug.h
+++ b/tools/perf/util/debug.h
@@ -85,6 +85,7 @@ void debug_set_display_time(bool set);
void perf_debug_setup(void);
int perf_quiet_option(void);
+void __dump_stack(FILE *file, void **stackdump, size_t stackdump_size);
void dump_stack(void);
void sighandler_dump_stack(int sig);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0660/1756] perf test: Avoid use perf_env
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (658 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0659/1756] perf debug: Add function symbols to dump_stack Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0661/1756] perf machine: Explicitly pass in host perf_env Greg Kroah-Hartman
` (338 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 5a156353e55e994627ac584e90b3b802e51e1ee2 ]
The perf_env global variable holds the host perf_env data but its use
is hit and miss. Switch to using local perf_env variables and ensure
scoped perf_env__init and perf_env__exit. This loses command line
setting of the perf_env, but this doesn't matter for tests. So the
perf_env is fully initialized, clear it with memset in perf_env__init.
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250724163302.596743-13-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Stable-dep-of: 58bf7b7af359 ("perf test code-reading: Fix duplicate kernel maps and machine leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/code-reading.c | 5 +++-
tools/perf/tests/dlfilter-test.c | 50 ++++++++++++++++++--------------
tools/perf/util/env.c | 1 +
3 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 638816544c3f6..8d40541abf681 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -561,11 +561,13 @@ static int do_test_code_reading(bool try_kcore)
struct dso *dso;
const char *events[] = { "cycles", "cycles:u", "cpu-clock", "cpu-clock:u", NULL };
int evidx = 0;
+ struct perf_env host_env;
pid = getpid();
machine = machine__new_host();
- machine->env = &perf_env;
+ perf_env__init(&host_env);
+ machine->env = &host_env;
ret = machine__create_kernel_maps(machine);
if (ret < 0) {
@@ -708,6 +710,7 @@ static int do_test_code_reading(bool try_kcore)
perf_cpu_map__put(cpus);
perf_thread_map__put(threads);
machine__delete(machine);
+ perf_env__exit(&host_env);
return err;
}
diff --git a/tools/perf/tests/dlfilter-test.c b/tools/perf/tests/dlfilter-test.c
index 54f59d1246bc5..6427e3382711f 100644
--- a/tools/perf/tests/dlfilter-test.c
+++ b/tools/perf/tests/dlfilter-test.c
@@ -319,11 +319,12 @@ static int run_perf_script(struct test_data *td)
static int test__dlfilter_test(struct test_data *td)
{
+ struct perf_env host_env;
u64 sample_type = TEST_SAMPLE_TYPE;
pid_t pid = 12345;
pid_t tid = 12346;
u64 id = 99;
- int err;
+ int err = TEST_OK;
if (get_dlfilters_path(td->name, td->dlfilters, PATH_MAX))
return test_result("dlfilters not found", TEST_SKIP);
@@ -353,37 +354,42 @@ static int test__dlfilter_test(struct test_data *td)
pr_debug("Creating new host machine structure\n");
td->machine = machine__new_host();
- td->machine->env = &perf_env;
+ perf_env__init(&host_env);
+ td->machine->env = &host_env;
td->fd = creat(td->perf_data_file_name, 0644);
if (td->fd < 0)
return test_result("Failed to create test perf.data file", TEST_FAIL);
err = perf_header__write_pipe(td->fd);
- if (err < 0)
- return test_result("perf_header__write_pipe() failed", TEST_FAIL);
-
+ if (err < 0) {
+ err = test_result("perf_header__write_pipe() failed", TEST_FAIL);
+ goto out;
+ }
err = write_attr(td, sample_type, &id);
- if (err)
- return test_result("perf_event__synthesize_attr() failed", TEST_FAIL);
-
- if (write_comm(td->fd, pid, tid, "test-prog"))
- return TEST_FAIL;
-
- if (write_mmap(td->fd, pid, tid, MAP_START, 0x10000, 0, td->prog_file_name))
- return TEST_FAIL;
-
- if (write_sample(td, sample_type, id, pid, tid) != TEST_OK)
- return TEST_FAIL;
-
+ if (err) {
+ err = test_result("perf_event__synthesize_attr() failed", TEST_FAIL);
+ goto out;
+ }
+ if (write_comm(td->fd, pid, tid, "test-prog")) {
+ err = TEST_FAIL;
+ goto out;
+ }
+ if (write_mmap(td->fd, pid, tid, MAP_START, 0x10000, 0, td->prog_file_name)) {
+ err = TEST_FAIL;
+ goto out;
+ }
+ if (write_sample(td, sample_type, id, pid, tid) != TEST_OK) {
+ err = TEST_FAIL;
+ goto out;
+ }
if (verbose > 1)
system_cmd("%s script -i %s -D", td->perf, td->perf_data_file_name);
- err = run_perf_script(td);
- if (err)
- return TEST_FAIL;
-
- return TEST_OK;
+ err = run_perf_script(td) ? TEST_FAIL : TEST_OK;
+out:
+ perf_env__exit(&host_env);
+ return err;
}
static void unlink_path(const char *path)
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index d981b6f4bc5ea..47d6110da4658 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -252,6 +252,7 @@ void perf_env__exit(struct perf_env *env)
void perf_env__init(struct perf_env *env)
{
+ memset(env, 0, sizeof(*env));
#ifdef HAVE_LIBBPF_SUPPORT
env->bpf_progs.infos = RB_ROOT;
env->bpf_progs.btfs = RB_ROOT;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0661/1756] perf machine: Explicitly pass in host perf_env
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (659 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0660/1756] perf test: Avoid use perf_env Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0662/1756] perf test code-reading: Fix duplicate kernel maps and machine leak Greg Kroah-Hartman
` (337 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit e481066388fe8003916461a54bf0ecffc02505a8 ]
When creating a machine for the host explicitly pass in a scoped
perf_env. This removes a use of the global perf_env.
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250724163302.596743-17-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Stable-dep-of: 58bf7b7af359 ("perf test code-reading: Fix duplicate kernel maps and machine leak")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-buildid-list.c | 5 ++++-
tools/perf/builtin-kallsyms.c | 21 ++++++++++++++++-----
tools/perf/builtin-trace.c | 24 +++++++++++++++++-------
tools/perf/tests/code-reading.c | 3 +--
tools/perf/tests/dlfilter-test.c | 3 +--
tools/perf/tests/dwarf-unwind.c | 10 +++++++---
tools/perf/tests/mmap-thread-lookup.c | 6 +++++-
tools/perf/tests/symbols.c | 8 +++++++-
tools/perf/util/debug.c | 9 ++++++++-
tools/perf/util/machine.c | 16 ++++++++--------
tools/perf/util/machine.h | 6 +++---
tools/perf/util/probe-event.c | 5 ++++-
12 files changed, 81 insertions(+), 35 deletions(-)
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 52dfacaff8e39..4307a1afa279f 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -45,11 +45,14 @@ static int buildid__map_cb(struct map *map, void *arg __maybe_unused)
static void buildid__show_kernel_maps(void)
{
+ struct perf_env host_env;
struct machine *machine;
- machine = machine__new_host();
+ perf_env__init(&host_env);
+ machine = machine__new_host(&host_env);
machine__for_each_kernel_map(machine, buildid__map_cb, NULL);
machine__delete(machine);
+ perf_env__exit(&host_env);
}
static int sysfs__fprintf_build_id(FILE *fp)
diff --git a/tools/perf/builtin-kallsyms.c b/tools/perf/builtin-kallsyms.c
index a3c2ffdc1af83..3c4339982b16e 100644
--- a/tools/perf/builtin-kallsyms.c
+++ b/tools/perf/builtin-kallsyms.c
@@ -12,18 +12,28 @@
#include <subcmd/parse-options.h>
#include "debug.h"
#include "dso.h"
+#include "env.h"
#include "machine.h"
#include "map.h"
#include "symbol.h"
static int __cmd_kallsyms(int argc, const char **argv)
{
- int i;
- struct machine *machine = machine__new_kallsyms();
+ int i, err;
+ struct perf_env host_env;
+ struct machine *machine = NULL;
+
+ perf_env__init(&host_env);
+ err = perf_env__set_cmdline(&host_env, argc, argv);
+ if (err)
+ goto out;
+
+ machine = machine__new_kallsyms(&host_env);
if (machine == NULL) {
pr_err("Couldn't read /proc/kallsyms\n");
- return -1;
+ err = -1;
+ goto out;
}
for (i = 0; i < argc; ++i) {
@@ -42,9 +52,10 @@ static int __cmd_kallsyms(int argc, const char **argv)
map__unmap_ip(map, symbol->start), map__unmap_ip(map, symbol->end),
symbol->start, symbol->end);
}
-
+out:
machine__delete(machine);
- return 0;
+ perf_env__exit(&host_env);
+ return err;
}
int cmd_kallsyms(int argc, const char **argv)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d3bd36e12080b..983dbe1bda935 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -141,6 +141,7 @@ struct syscall_fmt {
};
struct trace {
+ struct perf_env host_env;
struct perf_tool tool;
struct syscalltbl *sctbl;
struct {
@@ -1975,17 +1976,24 @@ static char *trace__machine__resolve_kernel_addr(void *vmachine, unsigned long l
return machine__resolve_kernel_addr(vmachine, addrp, modp);
}
-static int trace__symbols_init(struct trace *trace, struct evlist *evlist)
+static int trace__symbols_init(struct trace *trace, int argc, const char **argv,
+ struct evlist *evlist)
{
int err = symbol__init(NULL);
if (err)
return err;
- trace->host = machine__new_host();
- if (trace->host == NULL)
- return -ENOMEM;
+ perf_env__init(&trace->host_env);
+ err = perf_env__set_cmdline(&trace->host_env, argc, argv);
+ if (err)
+ goto out;
+ trace->host = machine__new_host(&trace->host_env);
+ if (trace->host == NULL) {
+ err = -ENOMEM;
+ goto out;
+ }
thread__set_priv_destructor(thread_trace__delete);
err = trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr);
@@ -1996,9 +2004,10 @@ static int trace__symbols_init(struct trace *trace, struct evlist *evlist)
evlist->core.threads, trace__tool_process,
true, false, 1);
out:
- if (err)
+ if (err) {
+ perf_env__exit(&trace->host_env);
symbol__exit();
-
+ }
return err;
}
@@ -2007,6 +2016,7 @@ static void trace__symbols__exit(struct trace *trace)
machine__exit(trace->host);
trace->host = NULL;
+ perf_env__exit(&trace->host_env);
symbol__exit();
}
@@ -4361,7 +4371,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
goto out_delete_evlist;
}
- err = trace__symbols_init(trace, evlist);
+ err = trace__symbols_init(trace, argc, argv, evlist);
if (err < 0) {
fprintf(trace->output, "Problems initializing symbol libraries!\n");
goto out_delete_evlist;
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 8d40541abf681..6f89b06cb5432 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -565,9 +565,8 @@ static int do_test_code_reading(bool try_kcore)
pid = getpid();
- machine = machine__new_host();
perf_env__init(&host_env);
- machine->env = &host_env;
+ machine = machine__new_host(&host_env);
ret = machine__create_kernel_maps(machine);
if (ret < 0) {
diff --git a/tools/perf/tests/dlfilter-test.c b/tools/perf/tests/dlfilter-test.c
index 6427e3382711f..80a1c941138d3 100644
--- a/tools/perf/tests/dlfilter-test.c
+++ b/tools/perf/tests/dlfilter-test.c
@@ -353,9 +353,8 @@ static int test__dlfilter_test(struct test_data *td)
return test_result("Failed to find program symbols", TEST_FAIL);
pr_debug("Creating new host machine structure\n");
- td->machine = machine__new_host();
perf_env__init(&host_env);
- td->machine->env = &host_env;
+ td->machine = machine__new_host(&host_env);
td->fd = creat(td->perf_data_file_name, 0644);
if (td->fd < 0)
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 525c46b7971ad..9ed78d00fb872 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -7,6 +7,7 @@
#include <unistd.h>
#include "tests.h"
#include "debug.h"
+#include "env.h"
#include "machine.h"
#include "event.h"
#include "../util/unwind.h"
@@ -180,6 +181,7 @@ NO_TAIL_CALL_ATTRIBUTE noinline int test_dwarf_unwind__krava_1(struct thread *th
noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused,
int subtest __maybe_unused)
{
+ struct perf_env host_env;
struct machine *machine;
struct thread *thread;
int err = -1;
@@ -188,15 +190,16 @@ noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused,
callchain_param.record_mode = CALLCHAIN_DWARF;
dwarf_callchain_users = true;
- machine = machine__new_live(/*kernel_maps=*/true, pid);
+ perf_env__init(&host_env);
+ machine = machine__new_live(&host_env, /*kernel_maps=*/true, pid);
if (!machine) {
pr_err("Could not get machine\n");
- return -1;
+ goto out;
}
if (machine__create_kernel_maps(machine)) {
pr_err("Failed to create kernel maps\n");
- return -1;
+ goto out;
}
if (verbose > 1)
@@ -213,6 +216,7 @@ noinline int test__dwarf_unwind(struct test_suite *test __maybe_unused,
out:
machine__delete(machine);
+ perf_env__exit(&host_env);
return err;
}
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index ddd1da9a4ba9a..ab372cf438e55 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "debug.h"
+#include "env.h"
#include "event.h"
#include "tests.h"
#include "machine.h"
@@ -155,6 +156,7 @@ static int synth_process(struct machine *machine)
static int mmap_events(synth_cb synth)
{
+ struct perf_env host_env;
struct machine *machine;
int err, i;
@@ -167,7 +169,8 @@ static int mmap_events(synth_cb synth)
*/
TEST_ASSERT_VAL("failed to create threads", !threads_create());
- machine = machine__new_host();
+ perf_env__init(&host_env);
+ machine = machine__new_host(&host_env);
dump_trace = verbose > 1 ? 1 : 0;
@@ -209,6 +212,7 @@ static int mmap_events(synth_cb synth)
}
machine__delete(machine);
+ perf_env__exit(&host_env);
return err;
}
diff --git a/tools/perf/tests/symbols.c b/tools/perf/tests/symbols.c
index ee20a366f32f5..c947a83699cc0 100644
--- a/tools/perf/tests/symbols.c
+++ b/tools/perf/tests/symbols.c
@@ -5,6 +5,7 @@
#include <limits.h>
#include "debug.h"
#include "dso.h"
+#include "env.h"
#include "machine.h"
#include "thread.h"
#include "symbol.h"
@@ -13,15 +14,18 @@
#include "tests.h"
struct test_info {
+ struct perf_env host_env;
struct machine *machine;
struct thread *thread;
};
static int init_test_info(struct test_info *ti)
{
- ti->machine = machine__new_host();
+ perf_env__init(&ti->host_env);
+ ti->machine = machine__new_host(&ti->host_env);
if (!ti->machine) {
pr_debug("machine__new_host() failed!\n");
+ perf_env__exit(&ti->host_env);
return TEST_FAIL;
}
@@ -29,6 +33,7 @@ static int init_test_info(struct test_info *ti)
ti->thread = machine__findnew_thread(ti->machine, 100, 100);
if (!ti->thread) {
pr_debug("machine__findnew_thread() failed!\n");
+ perf_env__exit(&ti->host_env);
return TEST_FAIL;
}
@@ -39,6 +44,7 @@ static void exit_test_info(struct test_info *ti)
{
thread__put(ti->thread);
machine__delete(ti->machine);
+ perf_env__exit(&ti->host_env);
}
struct dso_map {
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index a561eb97a9a86..bd968b4883cbd 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -17,6 +17,7 @@
#include "addr_location.h"
#include "color.h"
#include "debug.h"
+#include "env.h"
#include "event.h"
#include "machine.h"
#include "map.h"
@@ -309,8 +310,12 @@ void __dump_stack(FILE *file, void **stackdump, size_t stackdump_size)
{
/* TODO: async safety. printf, malloc, etc. aren't safe inside a signal handler. */
pid_t pid = getpid();
- struct machine *machine = machine__new_live(/*kernel_maps=*/false, pid);
+ struct machine *machine;
struct thread *thread = NULL;
+ struct perf_env host_env;
+
+ perf_env__init(&host_env);
+ machine = machine__new_live(&host_env, /*kernel_maps=*/false, pid);
if (machine)
thread = machine__find_thread(machine, pid, pid);
@@ -323,6 +328,7 @@ void __dump_stack(FILE *file, void **stackdump, size_t stackdump_size)
*/
backtrace_symbols_fd(stackdump, stackdump_size, fileno(file));
machine__delete(machine);
+ perf_env__exit(&host_env);
return;
}
#endif
@@ -349,6 +355,7 @@ void __dump_stack(FILE *file, void **stackdump, size_t stackdump_size)
}
thread__put(thread);
machine__delete(machine);
+ perf_env__exit(&host_env);
}
/* Obtain a backtrace and print it to stdout. */
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index d124a196ad4cc..5886a40d35b0d 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -126,7 +126,7 @@ int machine__init(struct machine *machine, const char *root_dir, pid_t pid)
return 0;
}
-static struct machine *__machine__new_host(bool kernel_maps)
+static struct machine *__machine__new_host(struct perf_env *host_env, bool kernel_maps)
{
struct machine *machine = malloc(sizeof(*machine));
@@ -139,13 +139,13 @@ static struct machine *__machine__new_host(bool kernel_maps)
free(machine);
return NULL;
}
- machine->env = &perf_env;
+ machine->env = host_env;
return machine;
}
-struct machine *machine__new_host(void)
+struct machine *machine__new_host(struct perf_env *host_env)
{
- return __machine__new_host(/*kernel_maps=*/true);
+ return __machine__new_host(host_env, /*kernel_maps=*/true);
}
static int mmap_handler(const struct perf_tool *tool __maybe_unused,
@@ -165,9 +165,9 @@ static int machine__init_live(struct machine *machine, pid_t pid)
mmap_handler, machine, true);
}
-struct machine *machine__new_live(bool kernel_maps, pid_t pid)
+struct machine *machine__new_live(struct perf_env *host_env, bool kernel_maps, pid_t pid)
{
- struct machine *machine = __machine__new_host(kernel_maps);
+ struct machine *machine = __machine__new_host(host_env, kernel_maps);
if (!machine)
return NULL;
@@ -179,9 +179,9 @@ struct machine *machine__new_live(bool kernel_maps, pid_t pid)
return machine;
}
-struct machine *machine__new_kallsyms(void)
+struct machine *machine__new_kallsyms(struct perf_env *host_env)
{
- struct machine *machine = machine__new_host();
+ struct machine *machine = machine__new_host(host_env);
/*
* FIXME:
* 1) We should switch to machine__load_kallsyms(), i.e. not explicitly
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index a3314f87a350e..5568c58fd07c7 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -163,9 +163,9 @@ struct thread *machine__findnew_guest_code(struct machine *machine, pid_t pid);
void machines__set_id_hdr_size(struct machines *machines, u16 id_hdr_size);
void machines__set_comm_exec(struct machines *machines, bool comm_exec);
-struct machine *machine__new_host(void);
-struct machine *machine__new_kallsyms(void);
-struct machine *machine__new_live(bool kernel_maps, pid_t pid);
+struct machine *machine__new_host(struct perf_env *host_env);
+struct machine *machine__new_kallsyms(struct perf_env *host_env);
+struct machine *machine__new_live(struct perf_env *host_env, bool kernel_maps, pid_t pid);
int machine__init(struct machine *machine, const char *root_dir, pid_t pid);
void machine__exit(struct machine *machine);
void machine__delete_threads(struct machine *machine);
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index a17c9b8a7a792..109400ea76841 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -71,12 +71,14 @@ int e_snprintf(char *str, size_t size, const char *format, ...)
}
static struct machine *host_machine;
+static struct perf_env host_env;
/* Initialize symbol maps and path of vmlinux/modules */
int init_probe_symbol_maps(bool user_only)
{
int ret;
+ perf_env__init(&host_env);
symbol_conf.allow_aliases = true;
ret = symbol__init(NULL);
if (ret < 0) {
@@ -90,7 +92,7 @@ int init_probe_symbol_maps(bool user_only)
if (symbol_conf.vmlinux_name)
pr_debug("Use vmlinux: %s\n", symbol_conf.vmlinux_name);
- host_machine = machine__new_host();
+ host_machine = machine__new_host(&host_env);
if (!host_machine) {
pr_debug("machine__new_host() failed.\n");
symbol__exit();
@@ -107,6 +109,7 @@ void exit_probe_symbol_maps(void)
machine__delete(host_machine);
host_machine = NULL;
symbol__exit();
+ perf_env__exit(&host_env);
}
static struct ref_reloc_sym *kernel_get_ref_reloc_sym(struct map **pmap)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0662/1756] perf test code-reading: Fix duplicate kernel maps and machine leak
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (660 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0661/1756] perf machine: Explicitly pass in host perf_env Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0663/1756] perf build: Clean libperf-gtk.so in make clean Greg Kroah-Hartman
` (336 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 58bf7b7af359d4c6f1af29fd8d2067bbcff1d8c7 ]
In do_test_code_reading(), machine__new_host(&host_env) already calls
machine__create_kernel_maps(machine). Calling
machine__create_kernel_maps(machine) a second time immediately
afterwards duplicates all kernel module maps in machine->kmaps, causing
dso__load_kcore()'s module validation (do_validate_kcore_modules()) to
fail and fall back to /proc/kallsyms.
Furthermore, when try_kcore is true and !have_kcore, returning
TEST_CODE_READING_NO_KCORE directly bypasses out_err, leaking the entire
struct machine, its kernel/module maps and DSOs, all kallsyms symbols,
and host_env.
Remove the redundant machine__create_kernel_maps() call, check for
!machine after machine__new_host(), and jump to out_err when returning
TEST_CODE_READING_NO_KCORE.
Fixes: 0fd4008ed755c52d ("perf test: Use machine__new_host in mmap thread code reading test")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/code-reading.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 6f89b06cb5432..6a8efa99ddcd3 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -567,10 +567,8 @@ static int do_test_code_reading(bool try_kcore)
perf_env__init(&host_env);
machine = machine__new_host(&host_env);
-
- ret = machine__create_kernel_maps(machine);
- if (ret < 0) {
- pr_debug("machine__create_kernel_maps failed\n");
+ if (!machine) {
+ pr_debug("machine__new_host failed\n");
goto out_err;
}
@@ -590,8 +588,10 @@ static int do_test_code_reading(bool try_kcore)
have_kcore = dso__is_kcore(dso);
/* 2nd time through we just try kcore */
- if (try_kcore && !have_kcore)
- return TEST_CODE_READING_NO_KCORE;
+ if (try_kcore && !have_kcore) {
+ err = TEST_CODE_READING_NO_KCORE;
+ goto out_err;
+ }
/* No point getting kernel events if there is no kernel object */
if (!have_vmlinux && !have_kcore)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0663/1756] perf build: Clean libperf-gtk.so in make clean
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (661 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0662/1756] perf test code-reading: Fix duplicate kernel maps and machine leak Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0664/1756] perf vendor events intel: Fix sierraforest umask encoding Greg Kroah-Hartman
` (335 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit fb0da4af899ab1d6a66d29b21189bda3c68c2ce0 ]
When GTK support was made opt-in (first via GTK2=1 and recently ported
to GTK4=1), $(OUTPUT)libperf-gtk.so is only added to ALL_PROGRAMS when
GTK4 is defined. As a result, running 'make clean' without GTK4=1 does
not remove $(OUTPUT)libperf-gtk.so.
Add $(OUTPUT)libperf-gtk.so explicitly to the core-progs clean list so
it is always removed by 'make clean'.
Fixes: 4751bddd3f983af2 ("perf tools: Make GTK2 support opt-in")
Closes: https://lore.kernel.org/linux-perf-users/CAP-5=fV6+mzN3Lf_mCAJ4aP42JFZsF55ekvt8XrX505xOWwrmA@mail.gmail.com/
Reported-by: Ian Rogers <irogers@google.com>
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/Makefile.perf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index b61c355fbdeed..839880b1a42cd 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1275,7 +1275,7 @@ clean:: $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBSYMBOL)-clean $(
-name '\.*.cmd' -delete -o -name '\.*.d' -delete -o -name '*.shellcheck_log' -delete
$(Q)$(RM) $(OUTPUT).config-detected
$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 \
- perf-read-vdsox32 $(OUTPUT)$(LIBJVMTI).so
+ perf-read-vdsox32 $(OUTPUT)$(LIBJVMTI).so $(OUTPUT)libperf-gtk.so
$(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo \
$(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE \
$(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0664/1756] perf vendor events intel: Fix sierraforest umask encoding.
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (662 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0663/1756] perf build: Clean libperf-gtk.so in make clean Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0665/1756] perf vendor events intel: Fix skylakex " Greg Kroah-Hartman
` (334 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit a86bd28b6e71101a1b11b7768f9bbc648b7b14d3 ]
Fix UMaskExt that was wrongly encoded when the UMask was 0.
Fixes: 9626368d429a ("perf vendor events intel: Update sierraforst events to v1.01")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../perf/pmu-events/arch/x86/sierraforest/uncore-cache.json | 5 +++++
.../arch/x86/sierraforest/uncore-interconnect.json | 2 ++
2 files changed, 7 insertions(+)
diff --git a/tools/perf/pmu-events/arch/x86/sierraforest/uncore-cache.json b/tools/perf/pmu-events/arch/x86/sierraforest/uncore-cache.json
index f37107373e3bf..981ae71e5c0f6 100644
--- a/tools/perf/pmu-events/arch/x86/sierraforest/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/sierraforest/uncore-cache.json
@@ -682,6 +682,7 @@
"EventName": "UNC_CHA_REMOTE_SF.DIRBACKED_ONLY",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x4000",
"Unit": "CHA"
},
{
@@ -711,6 +712,7 @@
"EventName": "UNC_CHA_REMOTE_SF.INCLUSIVE_ONLY",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -729,6 +731,7 @@
"EventName": "UNC_CHA_REMOTE_SF.UPDATE_EXCLUSIVE",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -748,6 +751,7 @@
"EventName": "UNC_CHA_REMOTE_SF.VICTIM_EXCLUSIVE",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -757,6 +761,7 @@
"EventName": "UNC_CHA_REMOTE_SF.VICTIM_SHARED",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
diff --git a/tools/perf/pmu-events/arch/x86/sierraforest/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/sierraforest/uncore-interconnect.json
index 80440edac4319..67a1a7f79ffb6 100644
--- a/tools/perf/pmu-events/arch/x86/sierraforest/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/sierraforest/uncore-interconnect.json
@@ -515,6 +515,7 @@
"EventName": "UNC_B2CMI_IMC_WRITES.NI",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x300",
"Unit": "B2CMI"
},
{
@@ -524,6 +525,7 @@
"EventName": "UNC_B2CMI_IMC_WRITES.NI_MISS",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x500",
"Unit": "B2CMI"
},
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0665/1756] perf vendor events intel: Fix skylakex umask encoding.
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (663 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0664/1756] perf vendor events intel: Fix sierraforest umask encoding Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0666/1756] perf vendor events intel: Fix snowridgex " Greg Kroah-Hartman
` (333 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit f37e7dfbd34c4e48d2bea4c5e0e64c398671e87b ]
Fix UMaskExt that was wrongly encoded when the UMask was 0.
Fixes: 748d5cf71948 ("perf vendor events intel: Fix uncore topics for skylakex")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../pmu-events/arch/x86/skylakex/uncore-interconnect.json | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/pmu-events/arch/x86/skylakex/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/skylakex/uncore-interconnect.json
index 216a00237cd1b..59fdd7fa7ba09 100644
--- a/tools/perf/pmu-events/arch/x86/skylakex/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/skylakex/uncore-interconnect.json
@@ -13462,6 +13462,7 @@
"EventName": "UNC_UPI_TxL_HDR_MATCH.DATA_HDR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x800",
"Unit": "UPI"
},
{
@@ -13472,6 +13473,7 @@
"EventName": "UNC_UPI_TxL_HDR_MATCH.DUAL_SLOT_HDR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x2000",
"Unit": "UPI"
},
{
@@ -13482,6 +13484,7 @@
"EventName": "UNC_UPI_TxL_HDR_MATCH.LOC",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x200",
"Unit": "UPI"
},
{
@@ -13514,6 +13517,7 @@
"EventName": "UNC_UPI_TxL_HDR_MATCH.NON_DATA_HDR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x1000",
"Unit": "UPI"
},
{
@@ -13524,6 +13528,7 @@
"EventName": "UNC_UPI_TxL_HDR_MATCH.REM",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x400",
"Unit": "UPI"
},
{
@@ -13567,6 +13572,7 @@
"EventName": "UNC_UPI_TxL_HDR_MATCH.SGL_SLOT_HDR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x4000",
"Unit": "UPI"
},
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0666/1756] perf vendor events intel: Fix snowridgex umask encoding.
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (664 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0665/1756] perf vendor events intel: Fix skylakex " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0667/1756] soc: ti: k3-ringacc: Correct ring API kernel-doc Greg Kroah-Hartman
` (332 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 8a0b9c9ff582258aafc6d6c8fe3fb104d9686a7b ]
Fix UMaskExt that was wrongly encoded when the UMask was 0.
Fixes: 2bb848f820a5 ("perf vendor events intel: Fix uncore topics for snowridgex")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../arch/x86/snowridgex/uncore-cache.json | 68 +++++++++++++++++++
.../x86/snowridgex/uncore-interconnect.json | 10 +++
2 files changed, 78 insertions(+)
diff --git a/tools/perf/pmu-events/arch/x86/snowridgex/uncore-cache.json b/tools/perf/pmu-events/arch/x86/snowridgex/uncore-cache.json
index a81776deb2e61..c32f1f3f826ac 100644
--- a/tools/perf/pmu-events/arch/x86/snowridgex/uncore-cache.json
+++ b/tools/perf/pmu-events/arch/x86/snowridgex/uncore-cache.json
@@ -1592,6 +1592,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : All Request Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Any local or remote transaction to the LLC, including prefetch.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -1624,6 +1625,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : CRd Request Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Local or remote CRd transactions to the LLC. This includes CRd prefetch.",
+ "UMask": "0x1000",
"Unit": "CHA"
},
{
@@ -1645,6 +1647,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : Local request Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Any local transaction to the LLC, including prefetches from the Core",
+ "UMask": "0x4000",
"Unit": "CHA"
},
{
@@ -1687,6 +1690,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : Data Read Request Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Read transactions.",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -1752,6 +1756,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : Flush or Invalidate Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing.",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -1773,6 +1778,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : Transactions homed locally Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Transaction whose address resides in the local MC.",
+ "UMask": "0x80000",
"Unit": "CHA"
},
{
@@ -1805,6 +1811,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : Write Request Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Writeback transactions to the LLC This includes all write transactions -- both Cacheable and UC.",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
@@ -1925,6 +1932,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Cache Lookups : RFO Request Filter : Counts the number of times the LLC was accessed - this includes code, data, prefetches and hints coming from L2. This has numerous filters available. Note the non-standard filtering equation. This event will count requests that lookup the cache multiple times with multiple increments. One must ALWAYS select a state or states (in the umask field) to match. Otherwise, the event will count nothing. : Local or remote RFO transactions to the LLC. This includes RFO prefetch.",
+ "UMask": "0x800",
"Unit": "CHA"
},
{
@@ -2077,6 +2085,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Lines Victimized : Local Only : Counts the number of lines that were victimized on a fill. This can be filtered by the state that the line was in.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -2195,6 +2204,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x10000000",
"Unit": "CHA"
},
{
@@ -2205,6 +2215,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x20000000",
"Unit": "CHA"
},
{
@@ -2215,6 +2226,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x80000",
"Unit": "CHA"
},
{
@@ -2225,6 +2237,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x8000000",
"Unit": "CHA"
},
{
@@ -2235,6 +2248,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
@@ -2289,6 +2303,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x40000000",
"Unit": "CHA"
},
{
@@ -2299,6 +2314,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x10000",
"Unit": "CHA"
},
{
@@ -2309,6 +2325,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -2319,6 +2336,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -2329,6 +2347,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x200000",
"Unit": "CHA"
},
{
@@ -2339,6 +2358,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x4000000",
"Unit": "CHA"
},
{
@@ -2349,6 +2369,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x800000",
"Unit": "CHA"
},
{
@@ -2359,6 +2380,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x1000000",
"Unit": "CHA"
},
{
@@ -2369,6 +2391,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -2379,6 +2402,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x8000",
"Unit": "CHA"
},
{
@@ -2411,6 +2435,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x100000",
"Unit": "CHA"
},
{
@@ -2421,6 +2446,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x20000",
"Unit": "CHA"
},
{
@@ -2431,6 +2457,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x400000",
"Unit": "CHA"
},
{
@@ -2441,6 +2468,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x2000000",
"Unit": "CHA"
},
{
@@ -2451,6 +2479,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x1000",
"Unit": "CHA"
},
{
@@ -2461,6 +2490,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x80000000",
"Unit": "CHA"
},
{
@@ -2471,6 +2501,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x100000000",
"Unit": "CHA"
},
{
@@ -2481,6 +2512,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x200000000",
"Unit": "CHA"
},
{
@@ -2491,6 +2523,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "Pipe Rejects : More Miscellaneous events in the Cbo.",
+ "UMask": "0x4000",
"Unit": "CHA"
},
{
@@ -2523,6 +2556,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx READ Credits Empty : MC10 : Counts the number of times when there are no credits available for sending reads from the CHA into the iMC. In order to send reads into the memory controller, the HA must first acquire a credit for the iMC's AD Ingress queue. : Filter for memory controller 10 only.",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -2533,6 +2567,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx READ Credits Empty : MC11 : Counts the number of times when there are no credits available for sending reads from the CHA into the iMC. In order to send reads into the memory controller, the HA must first acquire a credit for the iMC's AD Ingress queue. : Filter for memory controller 11 only.",
+ "UMask": "0x800",
"Unit": "CHA"
},
{
@@ -2543,6 +2578,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx READ Credits Empty : MC12 : Counts the number of times when there are no credits available for sending reads from the CHA into the iMC. In order to send reads into the memory controller, the HA must first acquire a credit for the iMC's AD Ingress queue. : Filter for memory controller 12 only.",
+ "UMask": "0x1000",
"Unit": "CHA"
},
{
@@ -2553,6 +2589,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx READ Credits Empty : MC13 : Counts the number of times when there are no credits available for sending reads from the CHA into the iMC. In order to send reads into the memory controller, the HA must first acquire a credit for the iMC's AD Ingress queue. : Filter for memory controller 13 only.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -2629,6 +2666,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx READ Credits Empty : MC8 : Counts the number of times when there are no credits available for sending reads from the CHA into the iMC. In order to send reads into the memory controller, the HA must first acquire a credit for the iMC's AD Ingress queue. : Filter for memory controller 8 only.",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -2639,6 +2677,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx READ Credits Empty : MC9 : Counts the number of times when there are no credits available for sending reads from the CHA into the iMC. In order to send reads into the memory controller, the HA must first acquire a credit for the iMC's AD Ingress queue. : Filter for memory controller 9 only.",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
@@ -5047,6 +5086,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : DDR4 Access : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -5057,6 +5097,7 @@
"EventName": "UNC_CHA_TOR_INSERTS.DDR4",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -5078,6 +5119,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just Hits : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -5687,6 +5729,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just ISOC : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x200000000",
"Unit": "CHA"
},
{
@@ -5697,6 +5740,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just Local Targets : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x8000",
"Unit": "CHA"
},
{
@@ -5740,6 +5784,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Match the Opcode in b[29:19] of the extended umask field : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x20000",
"Unit": "CHA"
},
{
@@ -5750,6 +5795,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just Misses : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
@@ -5760,6 +5806,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : MMCFG Access : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -5770,6 +5817,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just NearMem : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x40000000",
"Unit": "CHA"
},
{
@@ -5780,6 +5828,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just NonCoherent : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x100000000",
"Unit": "CHA"
},
{
@@ -5790,6 +5839,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Just NotNearMem : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x80000000",
"Unit": "CHA"
},
{
@@ -5800,6 +5850,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Inserts : Match the PreMorphed Opcode in b[29:19] of the extended umask field : Counts the number of entries successfully inserted into the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x40000",
"Unit": "CHA"
},
{
@@ -5832,6 +5883,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : DDR4 Access : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -5853,6 +5905,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just Hits : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -6440,6 +6493,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just ISOC : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x200000000",
"Unit": "CHA"
},
{
@@ -6450,6 +6504,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just Local Targets : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x8000",
"Unit": "CHA"
},
{
@@ -6493,6 +6548,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Match the Opcode in b[29:19] of the extended umask field : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x20000",
"Unit": "CHA"
},
{
@@ -6503,6 +6559,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just Misses : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
@@ -6513,6 +6570,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : MMCFG Access : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -6523,6 +6581,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just NearMem : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x40000000",
"Unit": "CHA"
},
{
@@ -6533,6 +6592,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just NonCoherent : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x100000000",
"Unit": "CHA"
},
{
@@ -6543,6 +6603,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Just NotNearMem : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x80000000",
"Unit": "CHA"
},
{
@@ -6553,6 +6614,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "TOR Occupancy : Match the PreMorphed Opcode in b[29:19] of the extended umask field : For each cycle, this event accumulates the number of valid entries in the TOR that match qualifications specified by the subevent. Does not include addressless requests such as locks and interrupts.",
+ "UMask": "0x40000",
"Unit": "CHA"
},
{
@@ -8356,6 +8418,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx WRITE Credits Empty : MC10 : Counts the number of times when there are no credits available for sending WRITEs from the CHA into the iMC. In order to send WRITEs into the memory controller, the HA must first acquire a credit for the iMC's BL Ingress queue. : Filter for memory controller 10 only.",
+ "UMask": "0x400",
"Unit": "CHA"
},
{
@@ -8366,6 +8429,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx WRITE Credits Empty : MC11 : Counts the number of times when there are no credits available for sending WRITEs from the CHA into the iMC. In order to send WRITEs into the memory controller, the HA must first acquire a credit for the iMC's BL Ingress queue. : Filter for memory controller 11 only.",
+ "UMask": "0x800",
"Unit": "CHA"
},
{
@@ -8376,6 +8440,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx WRITE Credits Empty : MC12 : Counts the number of times when there are no credits available for sending WRITEs from the CHA into the iMC. In order to send WRITEs into the memory controller, the HA must first acquire a credit for the iMC's BL Ingress queue. : Filter for memory controller 12 only.",
+ "UMask": "0x1000",
"Unit": "CHA"
},
{
@@ -8386,6 +8451,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx WRITE Credits Empty : MC13 : Counts the number of times when there are no credits available for sending WRITEs from the CHA into the iMC. In order to send WRITEs into the memory controller, the HA must first acquire a credit for the iMC's BL Ingress queue. : Filter for memory controller 13 only.",
+ "UMask": "0x2000",
"Unit": "CHA"
},
{
@@ -8462,6 +8528,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx WRITE Credits Empty : MC8 : Counts the number of times when there are no credits available for sending WRITEs from the CHA into the iMC. In order to send WRITEs into the memory controller, the HA must first acquire a credit for the iMC's BL Ingress queue. : Filter for memory controller 8 only.",
+ "UMask": "0x100",
"Unit": "CHA"
},
{
@@ -8472,6 +8539,7 @@
"Experimental": "1",
"PerPkg": "1",
"PublicDescription": "CHA iMC CHNx WRITE Credits Empty : MC9 : Counts the number of times when there are no credits available for sending WRITEs from the CHA into the iMC. In order to send WRITEs into the memory controller, the HA must first acquire a credit for the iMC's BL Ingress queue. : Filter for memory controller 9 only.",
+ "UMask": "0x200",
"Unit": "CHA"
},
{
diff --git a/tools/perf/pmu-events/arch/x86/snowridgex/uncore-interconnect.json b/tools/perf/pmu-events/arch/x86/snowridgex/uncore-interconnect.json
index 88ee90b8a2d9f..9667e4f48c13a 100644
--- a/tools/perf/pmu-events/arch/x86/snowridgex/uncore-interconnect.json
+++ b/tools/perf/pmu-events/arch/x86/snowridgex/uncore-interconnect.json
@@ -2210,6 +2210,7 @@
"EventName": "UNC_M2M_IMC_WRITES.CH0_FROM_TGR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x500",
"Unit": "M2M"
},
{
@@ -2239,6 +2240,7 @@
"EventName": "UNC_M2M_IMC_WRITES.CH0_NI_MISS",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x2000",
"Unit": "M2M"
},
{
@@ -2278,6 +2280,7 @@
"EventName": "UNC_M2M_IMC_WRITES.CH1_FROM_TGR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x900",
"Unit": "M2M"
},
{
@@ -2307,6 +2310,7 @@
"EventName": "UNC_M2M_IMC_WRITES.CH1_NI_MISS",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0xc00",
"Unit": "M2M"
},
{
@@ -2336,6 +2340,7 @@
"EventName": "UNC_M2M_IMC_WRITES.FROM_TGR",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x1d00",
"Unit": "M2M"
},
{
@@ -2365,6 +2370,7 @@
"EventName": "UNC_M2M_IMC_WRITES.NI_MISS",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x1c00",
"Unit": "M2M"
},
{
@@ -2837,6 +2843,7 @@
"EventName": "UNC_M2M_PREFCAM_DROP_REASONS_CH0.RPQ_PROXY",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x100",
"Unit": "M2M"
},
{
@@ -2866,6 +2873,7 @@
"EventName": "UNC_M2M_PREFCAM_DROP_REASONS_CH0.XPT_THRESH",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x200",
"Unit": "M2M"
},
{
@@ -2935,6 +2943,7 @@
"EventName": "UNC_M2M_PREFCAM_DROP_REASONS_CH1.RPQ_PROXY",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x100",
"Unit": "M2M"
},
{
@@ -2964,6 +2973,7 @@
"EventName": "UNC_M2M_PREFCAM_DROP_REASONS_CH1.XPT_THRESH",
"Experimental": "1",
"PerPkg": "1",
+ "UMask": "0x200",
"Unit": "M2M"
},
{
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0667/1756] soc: ti: k3-ringacc: Correct ring API kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (665 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0666/1756] perf vendor events intel: Fix snowridgex " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0668/1756] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc Greg Kroah-Hartman
` (331 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Nishanth Menon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 45ea6911ad16859d4ce4f25780b0ebcf5660e43a ]
The ring accelerator header labels k3_ring_cfg as an enum, uses
propname instead of property, and gives the DMA reset helper the
ordinary reset helper's name. The DMA reset comment also omits occ,
including the convention that zero requests a hardware occupancy read.
The proxy flag is parsed as a separate parameter, and the pop helpers
describe pushing elements. Proxy access is supported in Message mode;
the listed Credentials and Queue modes are not implemented. The phandle
lookup returns encoded error pointers rather than integer error values.
Match the declarations and document these argument and operation roles.
Fixes: 3277e8aa2504 ("soc: ti: k3: add navss ringacc driver")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260923061658.20140-1-kmehltretter@gmail.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/soc/ti/k3-ringacc.h | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/include/linux/soc/ti/k3-ringacc.h b/include/linux/soc/ti/k3-ringacc.h
index 39b022b925986..2de6031b94241 100644
--- a/include/linux/soc/ti/k3-ringacc.h
+++ b/include/linux/soc/ti/k3-ringacc.h
@@ -57,13 +57,13 @@ struct k3_ringacc;
struct k3_ring;
/**
- * enum k3_ring_cfg - RA ring configuration structure
+ * struct k3_ring_cfg - RA ring configuration structure
*
* @size: Ring size, number of elements
* @elm_size: Ring element size
* @mode: Ring operational mode
* @flags: Ring configuration flags. Possible values:
- * @K3_RINGACC_RING_SHARED: when set allows to request the same ring
+ * %K3_RINGACC_RING_SHARED: when set allows to request the same ring
* few times. It's usable when the same ring is used as Free Host PD ring
* for different flows, for example.
* Note: Locking should be done by consumer if required
@@ -88,11 +88,10 @@ struct k3_ring_cfg {
/**
* of_k3_ringacc_get_by_phandle - find a RA by phandle property
* @np: device node
- * @propname: property name containing phandle on RA node
+ * @property: property name containing phandle on RA node
*
- * Returns pointer on the RA - struct k3_ringacc
- * or -ENODEV if not found,
- * or -EPROBE_DEFER if not yet registered
+ * Return: Pointer to the RA, or ERR_PTR(-ENODEV) if the phandle cannot
+ * be resolved, or ERR_PTR(-EPROBE_DEFER) if the RA is not yet registered.
*/
struct k3_ringacc *of_k3_ringacc_get_by_phandle(struct device_node *np,
const char *property);
@@ -103,10 +102,8 @@ struct k3_ringacc *of_k3_ringacc_get_by_phandle(struct device_node *np,
* k3_ringacc_request_ring - request ring from ringacc
* @ringacc: pointer on ringacc
* @id: ring id or K3_RINGACC_RING_ID_ANY for any general purpose ring
- * @flags:
- * @K3_RINGACC_RING_USE_PROXY: if set - proxy will be allocated and
- * used to access ring memory. Sopported only for rings in
- * Message/Credentials/Queue mode.
+ * @flags: Set %K3_RINGACC_RING_USE_PROXY to allocate a proxy for
+ * accessing ring memory in Message mode.
*
* Returns pointer on the Ring - struct k3_ring
* or NULL in case of failure.
@@ -126,8 +123,9 @@ int k3_ringacc_request_rings_pair(struct k3_ringacc *ringacc,
*/
void k3_ringacc_ring_reset(struct k3_ring *ring);
/**
- * k3_ringacc_ring_reset - ring reset for DMA rings
+ * k3_ringacc_ring_reset_dma - ring reset for DMA rings
* @ring: pointer on Ring
+ * @occ: occupancy used by the DMA reset quirk, or zero to read it from hardware
*
* Resets ring internal state ((hw)occ, (hw)idx). Should be used for rings
* which are read by K3 UDMA, like TX or Free Host PD rings.
@@ -217,8 +215,8 @@ int k3_ringacc_ring_push(struct k3_ring *ring, void *elem);
* @ring: pointer on ring
* @elem: pointer on ring element buffer
*
- * Push one ring element from the ring head. Size of the ring element is
- * determined by ring configuration &struct k3_ring_cfg elm_size..
+ * Pop one ring element from the ring head. Size of the ring element is
+ * determined by ring configuration &struct k3_ring_cfg elm_size.
*
* Returns 0 on success, errno otherwise.
*/
@@ -242,7 +240,7 @@ int k3_ringacc_ring_push_head(struct k3_ring *ring, void *elem);
* @ring: pointer on ring
* @elem: pointer on ring element buffer
*
- * Push one ring element from the ring tail. Size of the ring element is
+ * Pop one ring element from the ring tail. Size of the ring element is
* determined by ring configuration &struct k3_ring_cfg elm_size.
*
* Returns 0 on success, errno otherwise.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0668/1756] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (666 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0667/1756] soc: ti: k3-ringacc: Correct ring API kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0669/1756] fs/ntfs3: fix slab-out-of-bounds write in attr_insert_range() Greg Kroah-Hartman
` (330 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Udit Kumar,
Nishanth Menon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 6c4e6e8f5cf95f7e0d4f04928a9ae70e20c73d4b ]
The heading for k3_ringacc_init_data repeats struct, so kernel-doc
cannot match it to the declaration. Its three fields are also missing
descriptions.
Use the structure name and describe the firmware handle, device ID,
and total number of available rings used during DMA ring initialization.
Fixes: d782298c6f6b ("soc: ti: k3-ringacc: add AM64 DMA rings support.")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Link: https://patch.msgid.link/20260923061658.20140-2-kmehltretter@gmail.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/soc/ti/k3-ringacc.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/soc/ti/k3-ringacc.h b/include/linux/soc/ti/k3-ringacc.h
index 2de6031b94241..7b7fc237c08f5 100644
--- a/include/linux/soc/ti/k3-ringacc.h
+++ b/include/linux/soc/ti/k3-ringacc.h
@@ -254,7 +254,10 @@ u32 k3_ringacc_get_tisci_dev_id(struct k3_ring *ring);
struct ti_sci_handle;
/**
- * struct struct k3_ringacc_init_data - Initialization data for DMA rings
+ * struct k3_ringacc_init_data - Initialization data for DMA rings
+ * @tisci: TI SCI firmware handle
+ * @tisci_dev_id: TI SCI device ID of the DMA controller
+ * @num_rings: Total number of available rings
*/
struct k3_ringacc_init_data {
const struct ti_sci_handle *tisci;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0669/1756] fs/ntfs3: fix slab-out-of-bounds write in attr_insert_range()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (667 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0668/1756] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0670/1756] cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing Greg Kroah-Hartman
` (329 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Xiang Mei (Microsoft), Konstantin Komarov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei (Microsoft) <xmei5@asu.edu>
[ Upstream commit bf9a6578e03b065335836e025356b4b9170b9449 ]
When fallocate(FALLOC_FL_INSERT_RANGE) grows a still-resident ntfs3
attribute, attr_insert_range() shifts the inline data using the insert
length 'bytes' as both the destination offset and the copy size:
memmove(data + bytes, data, bytes);
Both are wrong: the shift must start at the insertion point 'vbo' and
move only the data past it (data_size - vbo). When bytes > data_size the
memmove runs off the end of the data_size + bytes buffer and overflows
the adjacent slab object.
Since vbo < data_size is already enforced above, the reworked offsets stay
within the data_size + bytes buffer and cannot under/overflow.
BUG: KASAN: slab-out-of-bounds in attr_insert_range (fs/ntfs3/attrib.c:2581)
Write of size 512 at addr ffff8880135e8b10 by task exploit/142
...
__asan_memmove (mm/kasan/shadow.c:95)
attr_insert_range (fs/ntfs3/attrib.c:2581)
ntfs_fallocate (fs/ntfs3/file.c:618)
vfs_fallocate (fs/open.c:338)
__x64_sys_fallocate (fs/open.c:362)
...
Fixes: 9256ec35359f ("fs/ntfs3: Refactoring attr_insert_range to restore after errors")
Reported-by: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ntfs3/attrib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index bfb192ec29950..f7b42cc15f6d7 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -2438,8 +2438,8 @@ int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
char *data = Add2Ptr(attr_b,
le16_to_cpu(attr_b->res.data_off));
- memmove(data + bytes, data, bytes);
- memset(data, 0, bytes);
+ memmove(data + vbo + bytes, data + vbo, data_size - vbo);
+ memset(data + vbo, 0, bytes);
goto done;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0670/1756] cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (668 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0669/1756] fs/ntfs3: fix slab-out-of-bounds write in attr_insert_range() Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0671/1756] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only Greg Kroah-Hartman
` (328 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Waiman Long, Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit fbfbf86685b3270dc27d1c5d6108532334aaf329 ]
With some recent proposed changes [1] in the deadline server code,
it has caused a test failure in test_cpuset_prs.sh when a change
is being made to an isolated partition. This is due to failing
the cpuset_cpumask_can_shrink() check for SCHED_DEADLINE tasks at
validate_change().
This is actually a false positive as the failed test case involves an
isolated partition with load balancing disabled. The deadline check
is not meaningful in this case and the users should know what they
are doing.
Fix this by doing the cpuset_cpumask_can_shrink() check only when loading
balanced is enabled. Also change its arguments to use effective_cpus
for the current cpuset and user_xcpus() as an approiximation for the
target effective_cpus as the real effective_cpus hasn't been fully
computed yet as this early stage.
As the check isn't comprehensive, there may be false positives or
negatives. We may have to revise the code to do a more thorough check
in the future if this becomes a concern.
[1] https://lore.kernel.org/lkml/82be06c1-6d6d-4651-86c9-bcc828cbcb80@redhat.com/T/#t
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Stable-dep-of: 8a1c0f5c8284 ("cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 5991a9a354aad..02f02ab517fdb 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -616,12 +616,24 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
/*
* We can't shrink if we won't have enough room for SCHED_DEADLINE
- * tasks.
+ * tasks. This check is not done when scheduling is disabled as the
+ * users should know what they are doing.
+ *
+ * For v1, effective_cpus == cpus_allowed & user_xcpus() returns
+ * cpus_allowed.
+ *
+ * For v2, is_cpu_exclusive() & is_sched_load_balance() are true only
+ * for non-isolated partition root. At this point, the target
+ * effective_cpus isn't computed yet. user_xcpus() is the best
+ * approximation.
+ *
+ * TBD: May need to precompute the real effective_cpus here in case
+ * incorrect scheduling of SCHED_DEADLINE tasks in a partition
+ * becomes an issue.
*/
ret = -EBUSY;
- if (is_cpu_exclusive(cur) &&
- !cpuset_cpumask_can_shrink(cur->cpus_allowed,
- trial->cpus_allowed))
+ if (is_cpu_exclusive(cur) && is_sched_load_balance(cur) &&
+ !cpuset_cpumask_can_shrink(cur->effective_cpus, user_xcpus(trial)))
goto out;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0671/1756] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (669 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0670/1756] cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0672/1756] RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment Greg Kroah-Hartman
` (327 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Waiman Long, Ridong Chen,
Guopeng Zhang, Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit 8a1c0f5c82843104d9bef2bc3726c89da70a9b91 ]
Commit f82f80426f7a ("sched/deadline: Ensure that updates to exclusive
cpusets don't break AC") adds a check in validate_change() to make
sure that there is enough bandwidth for SCHED_DEADLINE tasks if we
shrink a v1 exclusive cpuset that has CS_CPU_EXCLUSIVE flag set.
With the introduction of cpuset partition in cgroup v2, we keep setting
the CS_CPU_EXCLUSIVE flag for a partition root so that the SCHED_DEADLINE
check will continue to work as intended. However it turns out that the
current code isn't perfect and there are cases where a cpuset isn't
a valid partition root, but the exclusive flag is still incorrectly
set. This can leads to SCHED_DEADLINE check being incorrectly triggered
when there are deadline tasks in the system. This can result in unexpected
-EBUSY failure when making changes to cpuset control files. Fix that
by checking for a valid partition root for v2 and is_cpu_exclusive()
for v1. It is far easier and less cumbersome than to make sure that
the exclusive flag is only set for valid partition roots.
Even though commit a86ce68078b2 ("cgroup/cpuset: Extract out
CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling") is marked as a
commit to be fixed, the problem may exist before that.
Fixes: a86ce68078b2 ("cgroup/cpuset: Extract out CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling")
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Ridong Chen <ridong.chen@linux.dev>
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 02f02ab517fdb..24ec9fa748998 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -622,8 +622,8 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
* For v1, effective_cpus == cpus_allowed & user_xcpus() returns
* cpus_allowed.
*
- * For v2, is_cpu_exclusive() & is_sched_load_balance() are true only
- * for non-isolated partition root. At this point, the target
+ * For v2, is_partition_valid(cur) & is_sched_load_balance() are true
+ * only for non-isolated partition root. At this point, the target
* effective_cpus isn't computed yet. user_xcpus() is the best
* approximation.
*
@@ -632,7 +632,8 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
* becomes an issue.
*/
ret = -EBUSY;
- if (is_cpu_exclusive(cur) && is_sched_load_balance(cur) &&
+ if ((is_partition_valid(cur) || (!cpuset_v2() && is_cpu_exclusive(cur))) &&
+ is_sched_load_balance(cur) &&
!cpuset_cpumask_can_shrink(cur->effective_cpus, user_xcpus(trial)))
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0672/1756] RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (670 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0671/1756] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0673/1756] IB/isert: Dont share drop_cmd_list across concurrent connection teardowns Greg Kroah-Hartman
` (326 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit 9728effe43d8fc4d58e12b697d0d6127355abdd5 ]
In handle_reg_mr_integrity, when mr->pi_mr is NULL (physical-address
optimization path), the code points mr->pi_mr at a stack-local pa_pi_mr
so set_pi_umr_wr can read it during this call. The pointer is never
restored, so after the function returns mr->pi_mr dangles at a freed stack
frame. A second IB_WR_REG_MR_INTEGRITY posted on the same MR without
remapping reads the stale pointer and dereferences it.
Save the original pi_mr (captured at function entry) and restore it on
the out path.
Fixes: 2563e2f30acb ("RDMA/mlx5: Use PA mapping for PI handover")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260919100848.2442-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx5/wr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/mlx5/wr.c b/drivers/infiniband/hw/mlx5/wr.c
index 9947feb7fb8a0..1748c633213ed 100644
--- a/drivers/infiniband/hw/mlx5/wr.c
+++ b/drivers/infiniband/hw/mlx5/wr.c
@@ -925,6 +925,7 @@ static int handle_reg_mr_integrity(struct mlx5_ib_dev *dev,
qp->next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
out:
+ mr->pi_mr = pi_mr;
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0673/1756] IB/isert: Dont share drop_cmd_list across concurrent connection teardowns
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (671 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0672/1756] RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0674/1756] arm64: dts: imx8dxl-evk: fix reserved memory node names for remoteproc Greg Kroah-Hartman
` (325 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li RongQing, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <lirongqing@baidu.com>
[ Upstream commit d30e9b1bc47bd9be4b2fc97b0e4074bc02c4203a ]
isert_put_unsol_pending_cmds() declares drop_cmd_list as a static
LIST_HEAD, so the list is shared across all invocations of the function.
It is called from isert_wait_conn(), the per-connection .iscsit_wait_conn
transport callback, which runs independently for each connection during
teardown.
conn->cmd_lock only protects each connection's own conn_cmd_list, not the
shared drop_cmd_list. If two connections tear down at the same time, both
threads list_move_tail() commands into the same drop_cmd_list without any
mutual exclusion, and then both iterate and list_del/put it concurrently.
This corrupts the linked list and can double-free iscsit_cmd structures.
Make drop_cmd_list a stack-local list, matching the pattern already used
in isert_free_np().
Fixes: 3e03c4b01da3 ("iser-target: Put the reference on commands waiting for unsol data")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260921031100.2199-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/ulp/isert/ib_isert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index b3fc753982a38..e3ff99c75b308 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -2586,7 +2586,7 @@ static void
isert_put_unsol_pending_cmds(struct iscsit_conn *conn)
{
struct iscsit_cmd *cmd, *tmp;
- static LIST_HEAD(drop_cmd_list);
+ LIST_HEAD(drop_cmd_list);
spin_lock_bh(&conn->cmd_lock);
list_for_each_entry_safe(cmd, tmp, &conn->conn_cmd_list, i_conn_node) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0674/1756] arm64: dts: imx8dxl-evk: fix reserved memory node names for remoteproc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (672 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0673/1756] IB/isert: Dont share drop_cmd_list across concurrent connection teardowns Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0675/1756] arm64: dts: imx8qm-mek: " Greg Kroah-Hartman
` (324 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peng Fan, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit c4e5f1a143799651aba2c4f66860b63b56786306 ]
The imx_rproc driver uses node names to identify reserved memory regions.
It checks for "vdev0buffer" to skip mapping, "rsc-table" to locate the
resource table, and "vdev" prefix to filter vdev regions.
Rename the reserved memory nodes to use the expected names so the driver
can correctly identify and handle each region.
Fixes: ee39dbd9a6cb ("arm64: dts: imx8dxl-evk: add imx8dxl_cm4, lsio mu5, related memory region")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx8dxl-evk.dts | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
index 4caaecc192277..f6232014ffb15 100644
--- a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
@@ -29,7 +29,7 @@ imx8dxl-cm4 {
clocks = <&clk_dummy>;
mbox-names = "tx", "rx", "rxdb";
mboxes = <&lsio_mu5 0 1 &lsio_mu5 1 1 &lsio_mu5 3 1>;
- memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
+ memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>,
<&vdev1vring0>, <&vdev1vring1>, <&rsc_table>;
power-domains = <&pd IMX_SC_R_M4_0_PID0>, <&pd IMX_SC_R_M4_0_MU_1A>;
fsl,resource-id = <IMX_SC_R_M4_0_PID0>;
@@ -65,32 +65,32 @@ linux,cma {
linux,cma-default;
};
- vdev0vring0: memory0@90000000 {
+ vdev0vring0: vdev0vring0@90000000 {
reg = <0 0x90000000 0 0x8000>;
no-map;
};
- vdev0vring1: memory@90008000 {
+ vdev0vring1: vdev0vring1@90008000 {
reg = <0 0x90008000 0 0x8000>;
no-map;
};
- vdev1vring0: memory@90010000 {
+ vdev1vring0: vdev1vring0@90010000 {
reg = <0 0x90010000 0 0x8000>;
no-map;
};
- vdev1vring1: memory@90018000 {
+ vdev1vring1: vdev1vring1@90018000 {
reg = <0 0x90018000 0 0x8000>;
no-map;
};
- rsc_table: memory-rsc-table@900ff000 {
+ rsc_table: rsc-table@900ff000 {
reg = <0 0x900ff000 0 0x1000>;
no-map;
};
- vdevbuffer: memory-vdevbuffer@90400000 {
+ vdev0buffer: vdev0buffer@90400000 {
compatible = "shared-dma-pool";
reg = <0 0x90400000 0 0x100000>;
no-map;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0675/1756] arm64: dts: imx8qm-mek: fix reserved memory node names for remoteproc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (673 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0674/1756] arm64: dts: imx8dxl-evk: fix reserved memory node names for remoteproc Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0676/1756] arm64: dts: imx8ulp-evk: " Greg Kroah-Hartman
` (323 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peng Fan, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit c712a46c10d38ce7869a9d81d7986e844a4e9f24 ]
The imx_rproc driver uses node names to identify reserved memory regions.
It checks for "vdev0buffer" to skip mapping, "rsc-table" to locate the
resource table, and "vdev" prefix to filter vdev regions.
Rename the reserved memory nodes to use the expected names so the driver
can correctly identify and handle each region.
Fixes: 52c9971edd4f ("arm64: dts: imx8qm-mek: add cm4 remote-proc and related memory region")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx8qm-mek.dts | 26 ++++++++++----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
index 32a37e0d0b425..b7bb7dcc1d77c 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
+++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts
@@ -37,57 +37,57 @@ reserved-memory {
#size-cells = <2>;
ranges;
- vdev0vring0: memory@90000000 {
+ vdev0vring0: vdev0vring0@90000000 {
reg = <0 0x90000000 0 0x8000>;
no-map;
};
- vdev0vring1: memory@90008000 {
+ vdev0vring1: vdev0vring1@90008000 {
reg = <0 0x90008000 0 0x8000>;
no-map;
};
- vdev1vring0: memory@90010000 {
+ vdev1vring0: vdev1vring0@90010000 {
reg = <0 0x90010000 0 0x8000>;
no-map;
};
- vdev1vring1: memory@90018000 {
+ vdev1vring1: vdev1vring1@90018000 {
reg = <0 0x90018000 0 0x8000>;
no-map;
};
- rsc_table0: memory@900ff000 {
+ rsc_table0: rsc-table@900ff000 {
reg = <0 0x900ff000 0 0x1000>;
no-map;
};
- vdev2vring0: memory@90100000 {
+ vdev2vring0: vdev2vring0@90100000 {
reg = <0 0x90100000 0 0x8000>;
no-map;
};
- vdev2vring1: memory@90108000 {
+ vdev2vring1: vdev2vring1@90108000 {
reg = <0 0x90108000 0 0x8000>;
no-map;
};
- vdev3vring0: memory@90110000 {
+ vdev3vring0: vdev3vring0@90110000 {
reg = <0 0x90110000 0 0x8000>;
no-map;
};
- vdev3vring1: memory@90118000 {
+ vdev3vring1: vdev3vring1@90118000 {
reg = <0 0x90118000 0 0x8000>;
no-map;
};
- rsc_table1: memory@901ff000 {
+ rsc_table1: rsc-table@901ff000 {
reg = <0 0x901ff000 0 0x1000>;
no-map;
};
- vdevbuffer: memory@90400000 {
+ vdev0buffer: vdev0buffer@90400000 {
compatible = "shared-dma-pool";
reg = <0 0x90400000 0 0x100000>;
no-map;
@@ -236,7 +236,7 @@ imx8qm-cm4-0 {
mboxes = <&lsio_mu5 0 1
&lsio_mu5 1 1
&lsio_mu5 3 1>;
- memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
+ memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>,
<&vdev1vring0>, <&vdev1vring1>, <&rsc_table0>;
power-domains = <&pd IMX_SC_R_M4_0_PID0>, <&pd IMX_SC_R_M4_0_MU_1A>;
@@ -251,7 +251,7 @@ imx8qm-cm4-1 {
mboxes = <&lsio_mu6 0 1
&lsio_mu6 1 1
&lsio_mu6 3 1>;
- memory-region = <&vdevbuffer>, <&vdev2vring0>, <&vdev2vring1>,
+ memory-region = <&vdev0buffer>, <&vdev2vring0>, <&vdev2vring1>,
<&vdev3vring0>, <&vdev3vring1>, <&rsc_table1>;
power-domains = <&pd IMX_SC_R_M4_1_PID0>, <&pd IMX_SC_R_M4_1_MU_1A>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0676/1756] arm64: dts: imx8ulp-evk: fix reserved memory node names for remoteproc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (674 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0675/1756] arm64: dts: imx8qm-mek: " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0677/1756] arm64: dts: imx93-14x14-evk: " Greg Kroah-Hartman
` (322 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peng Fan, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit f55e49b75c65c3e38e7bbe1d735f79128a50126e ]
The imx_rproc driver checks for the name "vdev0buffer" to skip mapping
the vdev buffer region, as it is handled by rproc_add_virtio_dev.
With the node named "vdevbuffer", the check fails and the region gets
unnecessarily mapped. Rename it to "vdev0buffer" to match what the
driver expects.
Fixes: 014fbffa25a7 ("arm64: dts: imx8ulp-evk: enable CM33 node")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
index 54f55fa083fb7..ed681e0661d6d 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
@@ -62,7 +62,7 @@ vdev1vring1: vdev1vring1@aff18000 {
no-map;
};
- vdevbuffer: vdevbuffer@a8400000 {
+ vdev0buffer: vdev0buffer@a8400000 {
compatible = "shared-dma-pool";
reg = <0 0xa8400000 0 0x100000>;
no-map;
@@ -90,7 +90,7 @@ &cm33 {
mboxes = <&mu 0 1>,
<&mu 1 1>,
<&mu 3 1>;
- memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
+ memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>,
<&vdev1vring0>, <&vdev1vring1>, <&rsc_table>;
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0677/1756] arm64: dts: imx93-14x14-evk: fix reserved memory node names for remoteproc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (675 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0676/1756] arm64: dts: imx8ulp-evk: " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0678/1756] arm64: dts: imx93-9x9-qsb: " Greg Kroah-Hartman
` (321 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peng Fan, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit e62f7ef5320d05361ee7f665568d05361b0c59d9 ]
The imx_rproc driver checks for the name "vdev0buffer" to skip mapping
the vdev buffer region, as it is handled by rproc_add_virtio_dev.
With the node named "vdevbuffer", the check fails and the region gets
unnecessarily mapped. Rename it to "vdev0buffer" to match what the
driver expects.
Fixes: 0481dadbc5e5 ("arm64: dts: imx93: support i.MX93-14x14-EVK board")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts b/arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts
index 236a44c1782ae..6d036a72d2b69 100644
--- a/arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts
@@ -54,7 +54,7 @@ rsc_table: rsc-table@2021e000 {
no-map;
};
- vdevbuffer: vdevbuffer@a4020000 {
+ vdev0buffer: vdev0buffer@a4020000 {
compatible = "shared-dma-pool";
reg = <0 0xa4020000 0 0x100000>;
no-map;
@@ -138,7 +138,7 @@ &cm33 {
mboxes = <&mu1 0 1>,
<&mu1 1 1>,
<&mu1 3 1>;
- memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
+ memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>,
<&vdev1vring0>, <&vdev1vring1>, <&rsc_table>;
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0678/1756] arm64: dts: imx93-9x9-qsb: fix reserved memory node names for remoteproc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (676 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0677/1756] arm64: dts: imx93-14x14-evk: " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0679/1756] PCI/IOV: Read VF config values that need not match PF Greg Kroah-Hartman
` (320 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peng Fan, Frank Li, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 475a58b82921cc89805b31e0bc1df91681124a3d ]
The imx_rproc driver checks for the name "vdev0buffer" to skip mapping
the vdev buffer region, as it is handled by rproc_add_virtio_dev.
With the node named "vdevbuffer", the check fails and the region gets
unnecessarily mapped. Rename it to "vdev0buffer" to match what the
driver expects.
Fixes: 0565d20cd8c2 ("arm64: dts: freescale: Support i.MX93 9x9 Quick Start Board")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts b/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts
index 8856835834a04..8fd209e847d09 100644
--- a/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts
+++ b/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts
@@ -53,7 +53,7 @@ rsc_table: rsc-table@2021e000 {
no-map;
};
- vdevbuffer: vdevbuffer@a4020000 {
+ vdev0buffer: vdev0buffer@a4020000 {
compatible = "shared-dma-pool";
reg = <0 0xa4020000 0 0x100000>;
no-map;
@@ -100,7 +100,7 @@ &cm33 {
mboxes = <&mu1 0 1>,
<&mu1 1 1>,
<&mu1 3 1>;
- memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
+ memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>,
<&vdev1vring0>, <&vdev1vring1>, <&rsc_table>;
status = "okay";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0679/1756] PCI/IOV: Read VF config values that need not match PF
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (677 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0678/1756] arm64: dts: imx93-9x9-qsb: " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0680/1756] swim: Return -EROFS when opened with BLK_OPEN_WRITE flag Greg Kroah-Hartman
` (319 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Logan Odell, Bjorn Helgaas,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Logan Odell <loganodell@google.com>
[ Upstream commit ae43799529c480510dcc14bd0ed141a1d85b9259 ]
Per PCIe r7.0, sec 7.5.1.1.5 and 7.5.1.2.3, VF Revision IDs and Subsystem
IDs may differ from the PF's. Read these values from VF config space
instead of using cached values from VF 0.
Per 7.5.1.1.6 and 7.5.1.2.3, VF Class Codes and Subsystem Vendor IDs must
be the same as the PF's. Use the PF's value instead of reading from VF
config space.
Per 7.5.1.1.9, the Header Type for a VF must be 0, so hardcode that
assignment.
Fixes: cf0921bea66c ("PCI/IOV: Use VF0 cached config registers for other VFs")
Signed-off-by: Logan Odell <loganodell@google.com>
[bhelgaas: commit log, move "rev" decl inside block that uses it]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260910173648.1304517-1-loganodell@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/iov.c | 25 -------------------------
drivers/pci/pci.h | 4 ----
drivers/pci/probe.c | 15 ++++++++++-----
3 files changed, 10 insertions(+), 34 deletions(-)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index d595a345a7d47..829c2be7ba956 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -153,29 +153,6 @@ resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno)
return dev->sriov->barsz[resno - PCI_IOV_RESOURCES];
}
-static void pci_read_vf_config_common(struct pci_dev *virtfn)
-{
- struct pci_dev *physfn = virtfn->physfn;
-
- /*
- * Some config registers are the same across all associated VFs.
- * Read them once from VF0 so we can skip reading them from the
- * other VFs.
- *
- * PCIe r4.0, sec 9.3.4.1, technically doesn't require all VFs to
- * have the same Revision ID and Subsystem ID, but we assume they
- * do.
- */
- pci_read_config_dword(virtfn, PCI_CLASS_REVISION,
- &physfn->sriov->class);
- pci_read_config_byte(virtfn, PCI_HEADER_TYPE,
- &physfn->sriov->hdr_type);
- pci_read_config_word(virtfn, PCI_SUBSYSTEM_VENDOR_ID,
- &physfn->sriov->subsystem_vendor);
- pci_read_config_word(virtfn, PCI_SUBSYSTEM_ID,
- &physfn->sriov->subsystem_device);
-}
-
int pci_iov_sysfs_link(struct pci_dev *dev,
struct pci_dev *virtfn, int id)
{
@@ -310,8 +287,6 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id)
virtfn->physfn = pci_dev_get(dev);
virtfn->no_command_memory = 1;
- if (id == 0)
- pci_read_vf_config_common(virtfn);
rc = pci_setup_device(virtfn);
if (rc)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f60d0eb600645..a61b387aa5220 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -445,10 +445,6 @@ struct pci_sriov {
u16 driver_max_VFs; /* Max num VFs driver supports */
struct pci_dev *dev; /* Lowest numbered PF */
struct pci_dev *self; /* This PF */
- u32 class; /* VF device */
- u8 hdr_type; /* VF header type */
- u16 subsystem_vendor; /* VF subsystem vendor */
- u16 subsystem_device; /* VF subsystem device */
resource_size_t barsz[PCI_SRIOV_NUM_BARS]; /* VF BAR size */
bool drivers_autoprobe; /* Auto probing of VFs by driver */
};
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5ff2ad01235c4..a8e963dcd661a 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1808,8 +1808,13 @@ static u32 pci_class(struct pci_dev *dev)
u32 class;
#ifdef CONFIG_PCI_IOV
- if (dev->is_virtfn)
- return dev->physfn->sriov->class;
+ if (dev->is_virtfn) {
+ u8 rev;
+
+ if (pci_read_config_byte(dev, PCI_REVISION_ID, &rev))
+ rev = 0;
+ return (dev->physfn->class << 8) | rev;
+ }
#endif
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
return class;
@@ -1819,8 +1824,8 @@ static void pci_subsystem_ids(struct pci_dev *dev, u16 *vendor, u16 *device)
{
#ifdef CONFIG_PCI_IOV
if (dev->is_virtfn) {
- *vendor = dev->physfn->sriov->subsystem_vendor;
- *device = dev->physfn->sriov->subsystem_device;
+ *vendor = dev->physfn->subsystem_vendor;
+ pci_read_config_word(dev, PCI_SUBSYSTEM_ID, device);
return;
}
#endif
@@ -1834,7 +1839,7 @@ static u8 pci_hdr_type(struct pci_dev *dev)
#ifdef CONFIG_PCI_IOV
if (dev->is_virtfn)
- return dev->physfn->sriov->hdr_type;
+ return 0;
#endif
pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type);
return hdr_type;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0680/1756] swim: Return -EROFS when opened with BLK_OPEN_WRITE flag
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (678 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0679/1756] PCI/IOV: Read VF config values that need not match PF Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0681/1756] swim: Fix FDEJECT ioctl for exclusive open Greg Kroah-Hartman
` (318 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stan Johnson, Finn Thain, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit d8fe777978a12a96cb5d10d6d888720fcba2da2b ]
Write requests are not supported by the driver and produce IO errors as
shown below. Avoid this by returning -EROFS when opened for writing.
[ 4111.690000] I/O error, dev fd0, sector 2 op 0x1:(WRITE) flags 0x800800 phys_seg 1 prio class 2
[ 4111.700000] Buffer I/O error on dev fd0, logical block 2, lost async page write
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Link: https://patch.msgid.link/327be6ca3c92c3411b5dfaeede014ed65a2d0f0f.1790641175.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 2b324b67b9ef3..0271e59f25ad7 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -630,7 +630,8 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode)
if (mode & (BLK_OPEN_READ | BLK_OPEN_WRITE)) {
if (disk_check_media_change(disk) && fs->disk_in)
fs->ejected = 0;
- if ((mode & BLK_OPEN_WRITE) && fs->write_protected) {
+ if (mode & BLK_OPEN_WRITE) {
+ /* Write support isn't implemented. */
err = -EROFS;
goto out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0681/1756] swim: Fix FDEJECT ioctl for exclusive open
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (679 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0680/1756] swim: Return -EROFS when opened with BLK_OPEN_WRITE flag Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0682/1756] swim3: " Greg Kroah-Hartman
` (317 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stan Johnson, Finn Thain, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit c76b93df9ae61d8ddebf6aa3bc218252f85e80c6 ]
The eject command from the util-linux package does not work with the swim
driver: the drive doesn't eject anything and the command fails.
Apparently, ioctl(fd, FDEJECT) returns -EBUSY when fd is opened O_EXCL.
Fix this by checking ref_count for either 1 or -1. Either value means that
the caller is the sole user of the disk.
Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Link: https://patch.msgid.link/ae3ee8e86833a2739d7857460cbe2addf4146088.1790641175.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index 0271e59f25ad7..968bb296bfe04 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -691,10 +691,11 @@ static int floppy_ioctl(struct block_device *bdev, blk_mode_t mode,
switch (cmd) {
case FDEJECT:
- if (fs->ref_count != 1)
- return -EBUSY;
mutex_lock(&swim_mutex);
- err = floppy_eject(fs);
+ if (fs->ref_count == -1 || fs->ref_count == 1)
+ err = floppy_eject(fs);
+ else
+ err = -EBUSY;
mutex_unlock(&swim_mutex);
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0682/1756] swim3: Fix FDEJECT ioctl for exclusive open
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (680 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0681/1756] swim: Fix FDEJECT ioctl for exclusive open Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0683/1756] RDMA/bnxt_re: Fix integer overflow in send payload size computation Greg Kroah-Hartman
` (316 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stan Johnson, Finn Thain, Jens Axboe,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <fthain@linux-m68k.org>
[ Upstream commit ce054fbe9a4bf4ffefef0f8e2504ea54da058ed2 ]
The eject command from the util-linux package does not work with the
swim3 driver: the drive doesn't eject anything and the command fails.
Apparently, ioctl(fd, FDEJECT) returns -EBUSY after fd was opened O_EXCL.
Fix this by checking ref_count for either 1 or -1. Either value means that
the caller is the sole user of the disk.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Link: https://patch.msgid.link/f4cb43726ee6f1cf159a6208f77b4cceea670a3c.1790641175.git.fthain@linux-m68k.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/swim3.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 9914153b365b6..64671ef9f18c9 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -886,7 +886,6 @@ static int floppy_locked_ioctl(struct block_device *bdev, blk_mode_t mode,
unsigned int cmd, unsigned long param)
{
struct floppy_state *fs = bdev->bd_disk->private_data;
- int err;
if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -897,10 +896,9 @@ static int floppy_locked_ioctl(struct block_device *bdev, blk_mode_t mode,
switch (cmd) {
case FDEJECT:
- if (fs->ref_count != 1)
- return -EBUSY;
- err = fd_eject(fs);
- return err;
+ if (fs->ref_count == -1 || fs->ref_count == 1)
+ return fd_eject(fs);
+ return -EBUSY;
case FDGETPRM:
if (copy_to_user((void __user *) param, &floppy_type,
sizeof(struct floppy_struct)))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0683/1756] RDMA/bnxt_re: Fix integer overflow in send payload size computation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (681 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0682/1756] swim3: " Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0684/1756] RDMA/bnxt_re: Detect wrong sge_len passed for inline Greg Kroah-Hartman
` (315 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Selvin Xavier, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <selvin.xavier@broadcom.com>
[ Upstream commit 3483cbbd7487163345b4b4d5eb8cad8540d1c3ba ]
bnxt_re_build_sgl() summed SGE lengths into a signed int, which could
overflow. Make it return u32, and have bnxt_re_copy_wr_payload() report
the size via a u32 out-parameter with the return value carrying only
the error status, instead of overloading a signed int with both.
Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 44 +++++++++++++-----------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 8231fd9b665ce..2266eab78c22b 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -123,10 +123,11 @@ static void bnxt_re_check_and_set_relaxed_ordering(struct bnxt_re_dev *rdev,
qplib_mr->flags |= CMDQ_REGISTER_MR_FLAGS_ENABLE_RO;
}
-static int bnxt_re_build_sgl(struct ib_sge *ib_sg_list,
+static u32 bnxt_re_build_sgl(struct ib_sge *ib_sg_list,
struct bnxt_qplib_sge *sg_list, int num)
{
- int i, total = 0;
+ u32 total = 0;
+ int i;
for (i = 0; i < num; i++) {
sg_list[i].addr = ib_sg_list[i].addr;
@@ -2688,17 +2689,22 @@ static int bnxt_re_copy_inline_data(struct bnxt_re_dev *rdev,
static int bnxt_re_copy_wr_payload(struct bnxt_re_dev *rdev,
const struct ib_send_wr *wr,
- struct bnxt_qplib_swqe *wqe)
+ struct bnxt_qplib_swqe *wqe,
+ u32 *payload_sz)
{
- int payload_sz = 0;
+ int rc;
- if (wr->send_flags & IB_SEND_INLINE)
- payload_sz = bnxt_re_copy_inline_data(rdev, wr, wqe);
- else
- payload_sz = bnxt_re_build_sgl(wr->sg_list, wqe->sg_list,
- wqe->num_sge);
+ if (wr->send_flags & IB_SEND_INLINE) {
+ rc = bnxt_re_copy_inline_data(rdev, wr, wqe);
+ if (rc < 0)
+ return rc;
+ *payload_sz = rc;
+ } else {
+ *payload_sz = bnxt_re_build_sgl(wr->sg_list, wqe->sg_list,
+ wqe->num_sge);
+ }
- return payload_sz;
+ return 0;
}
static void bnxt_ud_qp_hw_stall_workaround(struct bnxt_re_qp *qp)
@@ -2721,7 +2727,8 @@ static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,
struct bnxt_re_qp *qp,
const struct ib_send_wr *wr)
{
- int rc = 0, payload_sz = 0;
+ int rc = 0;
+ u32 payload_sz = 0;
unsigned long flags;
spin_lock_irqsave(&qp->sq_lock, flags);
@@ -2737,11 +2744,9 @@ static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,
goto bad;
}
- payload_sz = bnxt_re_copy_wr_payload(qp->rdev, wr, &wqe);
- if (payload_sz < 0) {
- rc = -EINVAL;
+ rc = bnxt_re_copy_wr_payload(qp->rdev, wr, &wqe, &payload_sz);
+ if (rc)
goto bad;
- }
wqe.wr_id = wr->wr_id;
wqe.type = BNXT_QPLIB_SWQE_TYPE_SEND;
@@ -2782,7 +2787,8 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
{
struct bnxt_re_qp *qp = container_of(ib_qp, struct bnxt_re_qp, ib_qp);
struct bnxt_qplib_swqe wqe;
- int rc = 0, payload_sz = 0;
+ int rc = 0;
+ u32 payload_sz = 0;
unsigned long flags;
spin_lock_irqsave(&qp->sq_lock, flags);
@@ -2799,11 +2805,9 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
goto bad;
}
- payload_sz = bnxt_re_copy_wr_payload(qp->rdev, wr, &wqe);
- if (payload_sz < 0) {
- rc = -EINVAL;
+ rc = bnxt_re_copy_wr_payload(qp->rdev, wr, &wqe, &payload_sz);
+ if (rc)
goto bad;
- }
wqe.wr_id = wr->wr_id;
switch (wr->opcode) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0684/1756] RDMA/bnxt_re: Detect wrong sge_len passed for inline
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (682 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0683/1756] RDMA/bnxt_re: Fix integer overflow in send payload size computation Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0685/1756] RDMA/bnxt_re: Validate SRQ max_sge at create time Greg Kroah-Hartman
` (314 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kalesh AP, Selvin Xavier,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <selvin.xavier@broadcom.com>
[ Upstream commit 81551ece0864c346080d241719d458c93f0e7fc9 ]
Avoid handling wrong sge_len by adding extra check
to see if the passed length is more than the inline
size supported.
Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 2266eab78c22b..c180936e908b3 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -2672,8 +2672,9 @@ static int bnxt_re_copy_inline_data(struct bnxt_re_dev *rdev,
wr->sg_list[i].addr;
sge_len = wr->sg_list[i].length;
- if ((sge_len + wqe->inline_len) >
- BNXT_QPLIB_SWQE_MAX_INLINE_LENGTH) {
+ if (sge_len > BNXT_QPLIB_SWQE_MAX_INLINE_LENGTH ||
+ ((sge_len + wqe->inline_len) >
+ BNXT_QPLIB_SWQE_MAX_INLINE_LENGTH)) {
ibdev_err(&rdev->ibdev,
"Inline data size requested > supported value");
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0685/1756] RDMA/bnxt_re: Validate SRQ max_sge at create time
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (683 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0684/1756] RDMA/bnxt_re: Detect wrong sge_len passed for inline Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0686/1756] RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv() Greg Kroah-Hartman
` (313 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Selvin Xavier, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <selvin.xavier@broadcom.com>
[ Upstream commit 1894ed9a664d19c190ce1bd2146759efbae77e4b ]
bnxt_re_create_srq() stored attr.max_sge into srq->qplib_srq.max_sge
unvalidated, which defeats the num_sge check in
bnxt_re_post_srq_recv() since that check compares against this same
attacker-chosen value. Reject max_sge > dev_attr->max_srq_sges at
create time, and clamp dev_attr->max_srq_sges to BNXT_STATIC_MAX_SGE
since SRQ WQEs use the fixed-size SGE array.
Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 8 ++++++++
drivers/infiniband/hw/bnxt_re/qplib_sp.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index c180936e908b3..cabed393390dc 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -1791,6 +1791,14 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq,
goto exit;
}
+ if (srq_init_attr->attr.max_sge > dev_attr->max_srq_sges) {
+ ibdev_err(&rdev->ibdev,
+ "Create SRQ failed - max_sge %d exceeds supported %d",
+ srq_init_attr->attr.max_sge, dev_attr->max_srq_sges);
+ rc = -EINVAL;
+ goto exit;
+ }
+
if (srq_init_attr->srq_type != IB_SRQT_BASIC) {
rc = -EOPNOTSUPP;
goto exit;
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
index b09ac66e64466..f757cc10533ef 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c
@@ -159,7 +159,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw)
attr->max_srq = le16_to_cpu(sb->max_srq);
attr->max_srq_wqes = le32_to_cpu(sb->max_srq_wr) - 1;
- attr->max_srq_sges = sb->max_srq_sge;
+ attr->max_srq_sges = min_t(u32, sb->max_srq_sge, BNXT_STATIC_MAX_SGE);
attr->max_pkey = 1;
attr->max_inline_data = attr->max_qp_sges * sizeof(struct sq_sge);
if (!bnxt_qplib_is_chip_gen_p7(rcfw->res->cctx))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0686/1756] RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (684 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0685/1756] RDMA/bnxt_re: Validate SRQ max_sge at create time Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0687/1756] RDMA/bnxt_re: Fix the PD and DPI table size Greg Kroah-Hartman
` (312 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Selvin Xavier, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <selvin.xavier@broadcom.com>
[ Upstream commit 4d8168a3b7c93385c11dc836df569d337089b218 ]
wqe is declared once above the WR loop and never zeroed, so
wqe.flags holds indeterminate stack contents on the first WR and the
previous WR's stale value thereafter. This propagates straight into
the hardware-visible srqe->flags in bnxt_qplib_post_srq_recv().
Most values of the wqe struct is set except flags. So initialize
flags also.
Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index cabed393390dc..e9f47f96be1ea 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -1936,6 +1936,7 @@ int bnxt_re_post_srq_recv(struct ib_srq *ib_srq, const struct ib_recv_wr *wr,
spin_lock_irqsave(&srq->lock, flags);
while (wr) {
/* Transcribe each ib_recv_wr to qplib_swqe */
+ wqe.flags = 0;
wqe.num_sge = wr->num_sge;
bnxt_re_build_sgl(wr->sg_list, wqe.sg_list, wr->num_sge);
wqe.wr_id = wr->wr_id;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0687/1756] RDMA/bnxt_re: Fix the PD and DPI table size
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (685 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0686/1756] RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv() Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0688/1756] RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection Greg Kroah-Hartman
` (311 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Selvin Xavier, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <selvin.xavier@broadcom.com>
[ Upstream commit aa6c2ef821a6ba7f3fd58cfcc031b2d16f3811c6 ]
The PD and DPI bitmaps were sized as max >> 3 (bytes),
but bitmap ops (set_bit(), clear_bit(), find_first_bit(),
test_and_set_bit()) operate on whole unsigned long words,
so whenever max isn't a multiple of BITS_PER_LONG,
the buffer under-allocates and the top word's bitops
read/write past the end of the kmalloc()'d buffer.
Most exposed on the DPI table, since dpit->max comes from the
firmware-reported dev_attr->max_dpi with no alignment guarantee.
Fix the size of both allocations with
BITS_TO_LONGS(max) * sizeof(unsigned long).
Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/bnxt_re/qplib_res.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c
index 5a99fa8e9be39..d43cbb953750c 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_res.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c
@@ -45,6 +45,7 @@
#include <linux/dma-mapping.h>
#include <linux/if_vlan.h>
#include <linux/vmalloc.h>
+#include <linux/bitops.h>
#include <rdma/ib_verbs.h>
#include <rdma/iter.h>
@@ -684,9 +685,9 @@ static int bnxt_qplib_alloc_pd_tbl(struct bnxt_qplib_res *res,
{
u32 bytes;
- bytes = max >> 3;
+ bytes = BITS_TO_LONGS(max) * sizeof(unsigned long);
if (!bytes)
- bytes = 1;
+ bytes = sizeof(unsigned long);
pdt->tbl = kmalloc(bytes, GFP_KERNEL);
if (!pdt->tbl)
return -ENOMEM;
@@ -821,9 +822,9 @@ static int bnxt_qplib_alloc_dpi_tbl(struct bnxt_qplib_res *res,
if (!dpit->app_tbl)
return -ENOMEM;
- bytes = dpit->max >> 3;
+ bytes = BITS_TO_LONGS(dpit->max) * sizeof(unsigned long);
if (!bytes)
- bytes = 1;
+ bytes = sizeof(unsigned long);
dpit->tbl = kmalloc(bytes, GFP_KERNEL);
if (!dpit->tbl) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0688/1756] RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (686 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0687/1756] RDMA/bnxt_re: Fix the PD and DPI table size Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0689/1756] media: venus: Drop session events without an instance Greg Kroah-Hartman
` (310 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kalesh AP, Selvin Xavier,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <selvin.xavier@broadcom.com>
[ Upstream commit 7cc8ccb157a4769c8fbce8296532dcb8a8ea0d5e ]
Selecting between BNXT_RE_NUM_EXT_COUNTERS and
BNXT_RE_NUM_STD_COUNTERS relied only on
bnxt_qplib_is_chip_gen_p5_p7(), which doesn't account for the
extended stats capability flag or the PF/VF restriction. Use
bnxt_ext_stats_supported() instead, matching the check already
used to populate the extended stats, so the counter count stays
consistent with what gets filled in.
Fixes: 8238c7bd8420 ("RDMA/bnxt_re: Fix the statistics for Gen P7 VF")
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/bnxt_re/hw_counters.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/bnxt_re/hw_counters.c b/drivers/infiniband/hw/bnxt_re/hw_counters.c
index f51adb0a97e66..699ef8537e4eb 100644
--- a/drivers/infiniband/hw/bnxt_re/hw_counters.c
+++ b/drivers/infiniband/hw/bnxt_re/hw_counters.c
@@ -371,7 +371,8 @@ int bnxt_re_ib_get_hw_stats(struct ib_device *ibdev,
}
done:
- return bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx) ?
+ return bnxt_ext_stats_supported(rdev->chip_ctx, rdev->dev_attr->dev_cap_flags,
+ rdev->is_virtfn) ?
BNXT_RE_NUM_EXT_COUNTERS : BNXT_RE_NUM_STD_COUNTERS;
}
@@ -381,7 +382,8 @@ struct rdma_hw_stats *bnxt_re_ib_alloc_hw_port_stats(struct ib_device *ibdev,
struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibdev, ibdev);
int num_counters = 0;
- if (bnxt_qplib_is_chip_gen_p5_p7(rdev->chip_ctx))
+ if (bnxt_ext_stats_supported(rdev->chip_ctx, rdev->dev_attr->dev_cap_flags,
+ rdev->is_virtfn))
num_counters = BNXT_RE_NUM_EXT_COUNTERS;
else
num_counters = BNXT_RE_NUM_STD_COUNTERS;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0689/1756] media: venus: Drop session events without an instance
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (687 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0688/1756] RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0690/1756] IB/mad: fix UAF and double-free in RMPP receive reassembly Greg Kroah-Hartman
` (309 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ruoyu Wang, Bryan ODonoghue,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <ruoyuw560@gmail.com>
[ Upstream commit 8921f6da06fd869b6f1aa8d02e40a4e2e2a45fe4 ]
hfi_process_msg_packet() intentionally allows HFI_MSG_EVENT_NOTIFY
packets without a matching session instance because HFI_EVENT_SYS_ERROR
is a system event and has no session attached.
That exception currently applies to every event-notify packet. If the
firmware reports a late or otherwise invalid session event after
to_instance() fails, hfi_event_notify() can dispatch it to session-only
handlers such as event_seq_changed() or event_release_buffer_ref(), which
dereference inst.
Only system errors are valid without a session instance. Drop other
event notifications before the session event handlers can dereference a
NULL inst.
This issue was found by a static analysis checker and confirmed by
manual source review.
Fixes: 09c2845e8fe4 ("[media] media: venus: hfi: add Host Firmware Interface (HFI)")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/venus/hfi_msgs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c
index cf0d97cbc4631..2e6354d267d91 100644
--- a/drivers/media/platform/qcom/venus/hfi_msgs.c
+++ b/drivers/media/platform/qcom/venus/hfi_msgs.c
@@ -230,6 +230,9 @@ static void hfi_event_notify(struct venus_core *core, struct venus_inst *inst,
if (!packet)
return;
+ if (!inst && pkt->event_id != HFI_EVENT_SYS_ERROR)
+ return;
+
switch (pkt->event_id) {
case HFI_EVENT_SYS_ERROR:
event_sys_error(core, EVT_SYS_ERROR, pkt);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0690/1756] IB/mad: fix UAF and double-free in RMPP receive reassembly
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (688 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0689/1756] media: venus: Drop session events without an instance Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0691/1756] clk: ti: adpll: unregister OF clock provider on remove Greg Kroah-Hartman
` (308 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dairui Zhang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dairui Zhang <zhangdairui@gmail.com>
[ Upstream commit 90e9b6357bec75f627cde1a85b5887215c80aad8 ]
mad_rmpp_recv.state is protected by two locks that do not exclude
each other: recv_timeout_handler() (port workqueue) uses agent->lock,
continue_rmpp() (CQ softirq) uses rmpp_recv->lock. Nothing serializes
the check-then-set sequence on the state word:
T1 (CQ softirq) T2 (port workqueue)
continue_rmpp()
lock(rmpp_recv->lock)
state == ACTIVE [passes]
recv_timeout_handler()
lock(agent->lock)
state = TIMEOUT
list_del(&rmpp_recv->list)
unlock(agent->lock)
destroy_rmpp_recv()
wait_for_completion()
[blocks on T1's ref]
state = COMPLETE
unlock(rmpp_recv->lock)
complete_rmpp()
queue cleanup_work (+10s)
deref()
[unblocks]
kfree(rmpp_recv)
ib_free_recv_mad(done_wc)
+10s: recv_cleanup_handler() runs lock/list_del/destroy on the
freed rmpp_recv -> UAF write and double free; nothing can
cancel that cleanup_work anymore, the entry is already off
agent->rmpp_list. done_wc is also returned to
ib_mad_complete_recv() and freed again -> UAF read and
double free.
Reaching this requires sending MADs to a kernel RMPP agent from the
InfiniBand/RoCE fabric: the per-port sa_query agent accepts subnet
manager responses whose SLID/GID/TID are not authenticated on the
fabric, and legacy user_mad agents registered without
IB_USER_MAD_USER_RMPP start reassembly on any incoming RMPP DATA
MAD with an attacker-chosen TID, no in-flight send required. The
attacker controls segment timing and can run many transactions in
parallel (agent->rmpp_list has no cap), so landing the
microseconds-wide receive critical section on the 40-second timeout
boundary is a matter of patience, not luck.
Unify state transitions under rmpp_recv->lock in
recv_timeout_handler(), keeping list manipulation under agent->lock
(which preserves the agent->lock -> rmpp_recv->lock ordering used
by continue_rmpp()). State check/set in both paths is then
serialized, so the loser of the race always observes the final
state and bails out. recv_cleanup_handler() needs no change: with
transitions serialized, a cleanup_work can only be pending after
COMPLETE, in which case the timeout handler exits early.
The race is as old as the RMPP implementation itself.
Fixes: fa619a77046b ("[PATCH] IB: Add RMPP implementation")
Assisted-by: LLM
Signed-off-by: Dairui Zhang <zhangdairui@gmail.com>
Link: https://patch.msgid.link/20260922152342.1474845-1-zhangdairui@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/mad_rmpp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c
index 8af0619a39cda..2bdebd011dac5 100644
--- a/drivers/infiniband/core/mad_rmpp.c
+++ b/drivers/infiniband/core/mad_rmpp.c
@@ -245,12 +245,15 @@ static void recv_timeout_handler(struct work_struct *work)
struct ib_mad_recv_wc *rmpp_wc;
unsigned long flags;
- spin_lock_irqsave(&rmpp_recv->agent->lock, flags);
+ spin_lock_irqsave(&rmpp_recv->lock, flags);
if (rmpp_recv->state != RMPP_STATE_ACTIVE) {
- spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
+ spin_unlock_irqrestore(&rmpp_recv->lock, flags);
return;
}
rmpp_recv->state = RMPP_STATE_TIMEOUT;
+ spin_unlock_irqrestore(&rmpp_recv->lock, flags);
+
+ spin_lock_irqsave(&rmpp_recv->agent->lock, flags);
list_del(&rmpp_recv->list);
spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0691/1756] clk: ti: adpll: unregister OF clock provider on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (689 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0690/1756] IB/mad: fix UAF and double-free in RMPP receive reassembly Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0692/1756] clk: si5351: fail prepare when PLL reset times out Greg Kroah-Hartman
` (307 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Brian Masney, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit 4c943ddfc24340f1b899762b1ff35c38306b7a35 ]
ti_adpll_probe() registers the driver's onecell clock provider with
of_clk_add_provider(). The remove path only frees the clock resources,
leaving the provider registered after the backing data has been torn
down.
Unregister the OF clock provider before freeing the ADPLL resources so
the provider no longer points at released driver data after device
removal.
Fixes: 21330497f303 ("clk: ti: Add support for dm814x ADPLL")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/ti/adpll.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/ti/adpll.c b/drivers/clk/ti/adpll.c
index 8885d28face50..0d729c9980a55 100644
--- a/drivers/clk/ti/adpll.c
+++ b/drivers/clk/ti/adpll.c
@@ -925,6 +925,7 @@ static void ti_adpll_remove(struct platform_device *pdev)
{
struct ti_adpll_data *d = dev_get_drvdata(&pdev->dev);
+ of_clk_del_provider(d->np);
ti_adpll_free_resources(d);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0692/1756] clk: si5351: fail prepare when PLL reset times out
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (690 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0691/1756] clk: ti: adpll: unregister OF clock provider on remove Greg Kroah-Hartman
@ 2026-11-18 14:46 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0693/1756] RDMA/nldev: Fix NULL deref in dumps of objects abandoned by DRIVER_FAILURE Greg Kroah-Hartman
` (306 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:46 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Brian Masney, Pengpeng Hou,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <hppiscas@163.com>
[ Upstream commit b6685c30d15cd7f28c40b2daaeacc00f21b2f12a ]
The clock prepare path requests a PLL reset when the platform data
requires a deterministic output phase. The reset helper logs polling
errors but returns no status, so prepare still enables the output and
reports success when the reset did not complete.
Return the poll result to prepare, restore the output power-down bit on
failure, and leave the output disabled. XTAL and CLKIN inputs continue
to bypass PLL reset successfully.
The issue was found by our static-analysis tool.
Fixes: 5142cbcea324 ("clk: si5351: Wait for bit clear after PLL reset")
Reviewed-by: Brian Masney <bmasney@redhat.com>
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-si5351.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c
index a4c92c5ef3ff7..e4d165e2b5c2f 100644
--- a/drivers/clk/clk-si5351.c
+++ b/drivers/clk/clk-si5351.c
@@ -907,7 +907,7 @@ static int _si5351_clkout_set_disable_state(
return 0;
}
-static void _si5351_clkout_reset_pll(struct si5351_driver_data *drvdata, int num)
+static int _si5351_clkout_reset_pll(struct si5351_driver_data *drvdata, int num)
{
u8 val = si5351_reg_read(drvdata, SI5351_CLK0_CTRL + num);
u8 mask = val & SI5351_CLK_PLL_SELECT ? SI5351_PLL_RESET_B :
@@ -918,7 +918,7 @@ static void _si5351_clkout_reset_pll(struct si5351_driver_data *drvdata, int num
switch (val & SI5351_CLK_INPUT_MASK) {
case SI5351_CLK_INPUT_XTAL:
case SI5351_CLK_INPUT_CLKIN:
- return; /* pll not used, no need to reset */
+ return 0; /* pll not used, no need to reset */
}
si5351_reg_write(drvdata, SI5351_PLL_RESET, mask);
@@ -931,6 +931,8 @@ static void _si5351_clkout_reset_pll(struct si5351_driver_data *drvdata, int num
dev_dbg(&drvdata->client->dev, "%s - %s: pll = %d\n",
__func__, clk_hw_get_name(&drvdata->clkout[num].hw),
(val & SI5351_CLK_PLL_SELECT) ? 1 : 0);
+
+ return err;
}
static int si5351_clkout_prepare(struct clk_hw *hw)
@@ -947,8 +949,18 @@ static int si5351_clkout_prepare(struct clk_hw *hw)
* Do a pll soft reset on the parent pll -- needed to get a
* deterministic phase relationship between the output clocks.
*/
- if (pdata->clkout[hwdata->num].pll_reset)
- _si5351_clkout_reset_pll(hwdata->drvdata, hwdata->num);
+ if (pdata->clkout[hwdata->num].pll_reset) {
+ int ret;
+
+ ret = _si5351_clkout_reset_pll(hwdata->drvdata, hwdata->num);
+ if (ret) {
+ si5351_set_bits(hwdata->drvdata,
+ SI5351_CLK0_CTRL + hwdata->num,
+ SI5351_CLK_POWERDOWN,
+ SI5351_CLK_POWERDOWN);
+ return ret;
+ }
+ }
si5351_set_bits(hwdata->drvdata, SI5351_OUTPUT_ENABLE_CTRL,
(1 << hwdata->num), 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0693/1756] RDMA/nldev: Fix NULL deref in dumps of objects abandoned by DRIVER_FAILURE
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (691 preceding siblings ...)
2026-11-18 14:46 ` [PATCH 6.12 0692/1756] clk: si5351: fail prepare when PLL reset times out Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0694/1756] RDMA/rtrs-clt: Reject invalid queue_depth from the peer Greg Kroah-Hartman
` (305 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yili Zhang, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yili Zhang <zhangyili01@baidu.com>
[ Upstream commit 9f4c322be27bf617cad2f4a15f6c6024a69e220c ]
fill_res_cq_entry() dereferences cq->uobject->uevent.uobject.context->res.id
unconditionally for user resources.
This is normally safe by ordering: destroy_hw() removes the resource
from the restrack before uverbs_destroy_uobject() clears ->context,
and the XA_ZERO_ENTRY marker set by rdma_restrack_begin_del() hides
the entry from concurrent netlink dumps.
The ordering breaks when a driver keeps failing to destroy an object
during ucontext teardown. uverbs_destroy_ufile_hw() then falls back to
__uverbs_cleanup_ufile(RDMA_REMOVE_DRIVER_FAILURE), which
abandons the object in place: the HW object and its restrack entry
are intentionally leaked, while the uobject bookkeeping is torn down
and ->context is explicitly set to NULL by uverbs_destroy_uobject().
rdma_restrack_del() is never reached, so the orphaned entry stays in
the device restrack with a valid kref, reachable by any subsequent
netlink dump.
Observed on 6.1.52 with MLNX_OFED 24.10, after an mlx5 FW failure
left a process unable to tear down its CQ (destroy_cq FW command
failing during FD close):
WARNING: ... uverbs_destroy_ufile_hw+0xe3/0x100
BUG: kernel NULL pointer dereference, address: 0000000000000058
RIP: 0010:fill_res_cq_entry+0x15e/0x180 [ib_core]
res_get_common_dumpit+0x304/0x530 [ib_core]
nldev_res_get_cq_dumpit+0x1a/0x20 [ib_core]
The faulting chain maps to the source (CR2 = 0x58):
cq->uobject (struct ib_cq +0x08, res at +0x98)
uobject->context (struct ib_uobject +0x10, NULL after abandon)
context->res.id (struct ib_ucontext +0x58)
The recent restrack rework (8d186210677c and its series) moved the
restrack deletion to the start of the destroy flow and thus fences
concurrent dumps from an object being destroyed, but it does not
cover this case: when destroy fails, rdma_restrack_abort_del()
restores the entry, and the RDMA_REMOVE_DRIVER_FAILURE sweep still
never removes it from the restrack.
>From the fallback until the device is unregistered, any "rdma res
show cq" deterministically takes the NULL pointer dereference; this
is a long-lived state, NOT A RACE. The dump path holds neither the
restrack lock (dropped before the fill callback runs) nor
ufile->hw_destroy_rwsem, and rdma_restrack_get() only guarantees
that the res memory stays alive, not that ->context is still valid.
Fix the dump side: check the uobject context directly instead of the
rdma_is_kernel_res() marker. A non-NULL uobject already implies a
user resource, so kernel resources keep being skipped, and the
additional ->context check skips the RES_CTXN attribute for
orphaned entries instead of crashing the dump. The orphaned resource
itself remains visible in "rdma res show" (cqn/cqe/usecnt/pid),
which is what an operator needs after the accompanying uverbs WARN
to diagnose the driver destroy failure.
fill_res_pd_entry() has the same pattern (pd->uobject->context->res.id)
and is fixed the same way; a PD can even reach the fallback without
its own driver callback failing, e.g. uverbs_free_pd() returns -EBUSY
while another object that failed to destroy still holds the PD usecnt.
Fixes: c3d02788b45a ("RDMA/nldev: Provide parent IDs for PD, MR and QP objects")
Signed-off-by: Yili Zhang <zhangyili01@baidu.com>
Link: https://patch.msgid.link/20260923131239.6521-1-zhangyili01@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/nldev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 98d33ad6a397a..b5892ab187e4e 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -651,7 +651,8 @@ static int fill_res_cq_entry(struct sk_buff *msg, bool has_cap_net_admin,
if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CQN, res->id))
return -EMSGSIZE;
- if (!rdma_is_kernel_res(res) &&
+
+ if (cq->uobject && cq->uobject->uevent.uobject.context &&
nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CTXN,
cq->uobject->uevent.uobject.context->res.id))
return -EMSGSIZE;
@@ -741,7 +742,7 @@ static int fill_res_pd_entry(struct sk_buff *msg, bool has_cap_net_admin,
if (nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_PDN, res->id))
goto err;
- if (!rdma_is_kernel_res(res) &&
+ if (pd->uobject && pd->uobject->context &&
nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CTXN,
pd->uobject->context->res.id))
goto err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0694/1756] RDMA/rtrs-clt: Reject invalid queue_depth from the peer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (692 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0693/1756] RDMA/nldev: Fix NULL deref in dumps of objects abandoned by DRIVER_FAILURE Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0695/1756] perf python: Initialize debug output on module load Greg Kroah-Hartman
` (304 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Farhad Alemi, Quanye Yang, Jack Wang,
Leon Romanovsky, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanye Yang <quanyeyang@proton.me>
[ Upstream commit 724cd362162ca7ca5a250bec65efd74f7dad9f5c ]
queue_depth is taken from the server's CM private_data and later
used as a session invariant. A peer can send 0, which the client
stores and then trips WARN_ON() in create_con_cq_qp() when the
next connection is set up.
Reject a zero queue_depth on ESTABLISHED, same as a bad
magic or version, and fail the handshake with -ECONNRESET.
Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Closes: https://lore.kernel.org/linux-rdma/CA+0ovCg_sG8gaZXXj9zmOrpxRt=8+-x9wvycVNUKwWmMbr6-Yg@mail.gmail.com
Signed-off-by: Quanye Yang <quanyeyang@proton.me>
Link: https://patch.msgid.link/20260922-rtrs-fix-warning-rtrs-clt-rdma-cm-handler-v1-1-2076c0ee1455@proton.me
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index fea3b17611c50..96f76dfe18619 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -1859,6 +1859,10 @@ static int rtrs_rdma_conn_established(struct rtrs_clt_con *con,
}
if (con->c.cid == 0) {
queue_depth = le16_to_cpu(msg->queue_depth);
+ if (!queue_depth) {
+ rtrs_err(clt, "Invalid queue depth %u\n", queue_depth);
+ return -ECONNRESET;
+ }
if (clt_path->queue_depth > 0 && queue_depth != clt_path->queue_depth) {
rtrs_err(clt, "Error: queue depth changed\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0695/1756] perf python: Initialize debug output on module load
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (693 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0694/1756] RDMA/rtrs-clt: Reject invalid queue_depth from the peer Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0696/1756] RDMA/mad: Reject receive completions shorter than GRH Greg Kroah-Hartman
` (303 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 3d13b3f1f3a7cd33d1847a4b87c3198089b6c4a7 ]
Unlike the perf binary's main(), PyInit_perf() does not call
perf_debug_setup(). As a result, the first warning or error printed from
the perf Python C extension hits debug_file() with _debug_file == NULL
and emits 'debug_file not set' without a trailing newline before the
actual diagnostic message.
Call perf_debug_setup() in PyInit_perf() and add the missing trailing
newline to the fallback warning in debug_file().
Fixes: ec49230cf6dda704 ("perf debug: Expose debug file")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/debug.c | 2 +-
tools/perf/util/python.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index bd968b4883cbd..5b53c9f8ec66f 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -55,7 +55,7 @@ FILE *debug_file(void)
{
if (!_debug_file) {
debug_set_file(stderr);
- pr_warning_once("debug_file not set");
+ pr_warning_once("%s not set\n", __func__);
}
return _debug_file;
}
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 66d3b0c633b25..7b9b6d464a3e0 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -1371,6 +1371,7 @@ PyMODINIT_FUNC PyInit_perf(void)
/* The page_size is placed in util object. */
page_size = sysconf(_SC_PAGE_SIZE);
+ perf_debug_setup();
Py_INCREF(&pyrf_evlist__type);
PyModule_AddObject(module, "evlist", (PyObject*)&pyrf_evlist__type);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0696/1756] RDMA/mad: Reject receive completions shorter than GRH
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (694 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0695/1756] perf python: Initialize debug output on module load Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0697/1756] RDMA/mlx4: Do not allow the user to write to the clock page Greg Kroah-Hartman
` (302 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 2dc2126e690203d6adbddc7675927a242d810e43 ]
ib_mad_recv_done() derives the OPA MAD length by subtracting the GRH
size from wc->byte_len without ensuring the receive completion covers
the GRH. If it is shorter, the subtraction wraps before the result is
stored in mad_len and an invalid length can be passed downstream.
Reject receive completions shorter than the GRH before inspecting the
MAD header or deriving the MAD length.
Fixes: 8e4349d13f33 ("IB/mad: Add final OPA MAD processing")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260926105927.3183294-1-yaojiale02@163.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/core/mad.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 21f482e0243f2..d68803faa336d 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -2084,6 +2084,8 @@ static void ib_mad_recv_done(struct ib_cq *cq, struct ib_wc *wc)
recv->header.mapping,
mad_priv_dma_size(recv),
DMA_FROM_DEVICE);
+ if (unlikely(wc->byte_len < sizeof(struct ib_grh)))
+ goto out;
/* Setup MAD receive work completion from "normal" work completion */
recv->header.wc = *wc;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0697/1756] RDMA/mlx4: Do not allow the user to write to the clock page
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (695 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0696/1756] RDMA/mad: Reject receive completions shorter than GRH Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0698/1756] RDMA/cxgb4: Do not allow userspace to write the status page Greg Kroah-Hartman
` (301 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 33db1d9683b8fb00bc233d0bea093e694ed9afc5 ]
mlx4_ib_mmap() maps the internal clock page to userspace through
rdma_user_mmap_io(), which does not restrict write access. Userspace can
request PROT_WRITE directly, or upgrade a read-only mapping later with
mprotect() because VM_MAYWRITE remains set.
Reject VM_WRITE, VM_EXEC and clear VM_MAYWRITE, applying the same read-only
policy as commit c660133c339f ("RDMA/mlx5: Do not allow the user to write to the
clock page"). The rdma-core mlx4 provider requests this mapping with
PROT_READ, so its existing behavior is unchanged.
Fixes: 52033cfb5aab ("IB/mlx4: Add mmap call to map the hardware clock")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260926111150.3197004-1-yaojiale02@163.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/mlx4/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index b1bbdcff631d5..27bd03078d3c2 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1176,6 +1176,10 @@ static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
struct mlx4_clock_params params;
int ret;
+ if (vma->vm_flags & (VM_WRITE | VM_EXEC))
+ return -EPERM;
+ vm_flags_clear(vma, VM_MAYWRITE);
+
ret = mlx4_get_internal_clock_params(dev->dev, ¶ms);
if (ret)
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0698/1756] RDMA/cxgb4: Do not allow userspace to write the status page
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (696 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0697/1756] RDMA/mlx4: Do not allow the user to write to the clock page Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0699/1756] time: Prevent time64_to_tm() day truncation on 32-bit Greg Kroah-Hartman
` (300 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 1c5335a6902639596a795705349da7f76027e103 ]
The device status page is shared by all userspace contexts and contains
db_off, which the driver updates to control doorbell flow. The rdma-core
provider maps it with PROT_READ, but c4iw_mmap() passes the requested page
protection through when handling CXGB4_MMAP_CONTIG.
A process can therefore request PROT_WRITE directly or later upgrade a
read-only mapping with mprotect() because VM_MAYWRITE remains set. This
lets userspace alter device-wide flow-control state seen by the kernel and
other contexts.
Reject initially writable mappings and clear VM_MAYWRITE before mapping the
page. This preserves the existing read-only userspace ABI.
Fixes: 05eb23893c2c ("cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260926112611.3214382-1-yaojiale02@163.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/cxgb4/provider.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index e059f92d90fd4..4b2c7ec348176 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -171,6 +171,11 @@ static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
len, t4_pgprot_wc(vma->vm_page_prot));
break;
case CXGB4_MMAP_CONTIG:
+ if (vma->vm_flags & (VM_WRITE | VM_EXEC)) {
+ ret = -EPERM;
+ break;
+ }
+ vm_flags_clear(vma, VM_MAYWRITE);
ret = io_remap_pfn_range(vma, vma->vm_start,
addr >> PAGE_SHIFT,
len, vma->vm_page_prot);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0699/1756] time: Prevent time64_to_tm() day truncation on 32-bit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (697 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0698/1756] RDMA/cxgb4: Do not allow userspace to write the status page Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0700/1756] RDMA/rtrs-clt: Dont WARN on unexpected info-response opcode Greg Kroah-Hartman
` (299 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Thomas Gleixner,
Thomas Weißschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 2927f7ca78448781e11a4623d347cd653c28adf6 ]
time64_to_tm() accepts a 64-bit seconds value, but stores the quotient in
long. On a 32-bit kernel the day count therefore wraps when it reaches
2^31, even though the corresponding year remains representable in
struct tm.
This is reachable when formatting externally supplied timestamps. For
example, NILFS recovery copies the little-endian 64-bit ss_create field
from an on-disk segment summary into time64_t. Its sysfs attributes then
print that value with %ptTs, whose formatter calls time64_to_tm(). A
corrupted image can consequently produce an architecture-dependent printed
date.
Keep the day quotient in s64 while leaving the seconds-within-day remainder
as long. Use div_s64_rem() for the weekday calculation so 32-bit builds do
not require compiler runtime division helpers.
Fixes: e6c2682a1da3 ("time: Add time64_to_tm()")
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Assisted-by: LLM
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20260925165702.51677-2-kmehltretter@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/time/timeconv.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timeconv.c b/kernel/time/timeconv.c
index 59b922c826e77..aed3af950fa0b 100644
--- a/kernel/time/timeconv.c
+++ b/kernel/time/timeconv.c
@@ -49,8 +49,9 @@ void time64_to_tm(time64_t totalsecs, int offset, struct tm *result)
u32 u32tmp, day_of_century, year_of_century, day_of_year, month, day;
u64 u64tmp, udays, century, year;
bool is_Jan_or_Feb, is_leap_year;
- long days, rem;
int remainder;
+ long rem;
+ s64 days;
days = div_s64_rem(totalsecs, SECS_PER_DAY, &remainder);
rem = remainder;
@@ -70,7 +71,8 @@ void time64_to_tm(time64_t totalsecs, int offset, struct tm *result)
result->tm_sec = rem % 60;
/* January 1, 1970 was a Thursday. */
- result->tm_wday = (4 + days) % 7;
+ div_s64_rem(days + 4, 7, &remainder);
+ result->tm_wday = remainder;
if (result->tm_wday < 0)
result->tm_wday += 7;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0700/1756] RDMA/rtrs-clt: Dont WARN on unexpected info-response opcode
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (698 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0699/1756] time: Prevent time64_to_tm() day truncation on 32-bit Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0701/1756] vfio/platform: prevent read-only region mappings from becoming writable Greg Kroah-Hartman
` (298 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Farhad Alemi, Quanye Yang, Jack Wang,
Jason Gunthorpe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanye Yang <quanyeyang@proton.me>
[ Upstream commit 49c5691ad76f000e66c4f2635d5f196db5d038f9 ]
The info-response receive is posted for a SEND. The completion
opcode comes from the peer, so RDMA WRITE with Immediate is a
legal WC on that WQE even though it violates the RTRS handshake.
WARN_ON(wc->opcode != IB_WC_RECV) treats that peer-controlled
field as an internal invariant and panics with panic_on_warn.
Treat a non-SEND completion as a handshake failure: log it and
keep the existing CONNECTING_ERR cleanup.
Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Link: https://patch.msgid.link/r/20260921-rtrs-fix-rtrs-clt-info-rsp-done-v1-1-c64281ed97c0@proton.me
Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Closes: https://lore.kernel.org/linux-rdma/CA+0ovCge-K+hcGHXZ4R3Ww5+cg159uxHBeVbKeUSLBRSMT8OWA@mail.gmail.com/
Signed-off-by: Quanye Yang <quanyeyang@proton.me>
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index 96f76dfe18619..99de772e99afb 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -2499,7 +2499,12 @@ static void rtrs_clt_info_rsp_done(struct ib_cq *cq, struct ib_wc *wc)
ib_wc_status_msg(wc->status));
goto out;
}
- WARN_ON(wc->opcode != IB_WC_RECV);
+ if (wc->opcode != IB_WC_RECV) {
+ rtrs_err(clt_path->clt,
+ "Path info response has unexpected opcode %d\n",
+ wc->opcode);
+ goto out;
+ }
if (wc->byte_len < sizeof(*msg)) {
rtrs_err(clt_path->clt, "Path info response is malformed: size %d\n",
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0701/1756] vfio/platform: prevent read-only region mappings from becoming writable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (699 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0700/1756] RDMA/rtrs-clt: Dont WARN on unexpected info-response opcode Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0702/1756] vfio/fsl-mc: " Greg Kroah-Hartman
` (297 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mostafa Saleh, Eric Auger,
Pranjal Shrivastava, Abdifatah Suruur, Alex Williamson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdifatah Suruur <suruurism@gmail.com>
[ Upstream commit 420bed9131dbbe37abe9d6b32af51219875811e0 ]
vfio_platform_mmap() rejects writable mappings of regions without the
WRITE flag, but leaves VM_MAYWRITE set. Userspace can map such a region
read-only and then upgrade the mapping to writable with mprotect().
Clear VM_MAYWRITE for regions without the WRITE flag, as i915 does for
its read-only objects and as fixed in drm/vc4 (CVE-2026-68445),
drm/panthor (CVE-2024-53071) and commit a5edadbae57e ("ptp: vmclock:
prevent read-only mappings from becoming writable").
Note this is defensive hardening: no in-tree platform driver currently
publishes a region without the WRITE flag. The guard costs nothing and
keeps the mmap() interface honest if a read-only region ever appears.
Fixes: fad4d5b1f042 ("vfio/platform: support MMAP of MMIO regions")
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Link: https://lore.kernel.org/r/20260929094848.7439-2-suruurism@gmail.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vfio/platform/vfio_platform_common.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c
index 3bf1043cd7957..bd7600c6b9de7 100644
--- a/drivers/vfio/platform/vfio_platform_common.c
+++ b/drivers/vfio/platform/vfio_platform_common.c
@@ -595,9 +595,13 @@ int vfio_platform_mmap(struct vfio_device *core_vdev, struct vm_area_struct *vma
&& (vma->vm_flags & VM_READ))
return -EINVAL;
- if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)
- && (vma->vm_flags & VM_WRITE))
- return -EINVAL;
+ /* Prevent read-only region mappings from being upgraded with mprotect() */
+ if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) {
+ if (vma->vm_flags & VM_WRITE)
+ return -EINVAL;
+
+ vm_flags_clear(vma, VM_MAYWRITE);
+ }
vma->vm_private_data = vdev;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0702/1756] vfio/fsl-mc: prevent read-only region mappings from becoming writable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (700 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0701/1756] vfio/platform: prevent read-only region mappings from becoming writable Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0703/1756] vfio/cdx: " Greg Kroah-Hartman
` (296 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ioana Ciornei, Abdifatah Suruur,
Alex Williamson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdifatah Suruur <suruurism@gmail.com>
[ Upstream commit 25fd8b27ee8d4f59cc2ad99cf67aef4570b82096 ]
vfio_fsl_mc_mmap() rejects writable mappings of regions without the
WRITE flag, but leaves VM_MAYWRITE set. Userspace can map such a region
read-only and then upgrade the mapping to writable with mprotect().
Clear VM_MAYWRITE for regions without the WRITE flag, as i915 does for
its read-only objects and as fixed in drm/vc4 (CVE-2026-68445),
drm/panthor (CVE-2024-53071) and commit a5edadbae57e ("ptp: vmclock:
prevent read-only mappings from becoming writable").
Note this is defensive hardening: the fsl-mc bus publishes all device
regions with the WRITE flag set, so no device can currently reach the
read-only path. The guard costs nothing and keeps the mmap() interface
honest if a read-only region ever appears.
Fixes: 67247289688d4 ("vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions")
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Link: https://lore.kernel.org/r/20260929094848.7439-3-suruurism@gmail.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vfio/fsl-mc/vfio_fsl_mc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
index 03600872c4809..4a7fac70f103e 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c
@@ -409,9 +409,13 @@ static int vfio_fsl_mc_mmap(struct vfio_device *core_vdev,
&& (vma->vm_flags & VM_READ))
return -EINVAL;
- if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)
- && (vma->vm_flags & VM_WRITE))
- return -EINVAL;
+ /* Prevent read-only region mappings from being upgraded with mprotect() */
+ if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) {
+ if (vma->vm_flags & VM_WRITE)
+ return -EINVAL;
+
+ vm_flags_clear(vma, VM_MAYWRITE);
+ }
vma->vm_private_data = mc_dev;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0703/1756] vfio/cdx: prevent read-only region mappings from becoming writable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (701 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0702/1756] vfio/fsl-mc: " Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0704/1756] selftests/timers: clocksource-switch: Fix unchecked open()/read() Greg Kroah-Hartman
` (295 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abdifatah Suruur, Alex Williamson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdifatah Suruur <suruurism@gmail.com>
[ Upstream commit 9c5cd385d295fa8621dff0e9f6063e3f6ff24159 ]
vfio_cdx_mmap() rejects writable mappings of regions without the WRITE
flag, but leaves VM_MAYWRITE set. Userspace can map such a region
read-only and then upgrade the mapping to writable with mprotect(),
writing to MMIO regions the device marks read-only.
Clear VM_MAYWRITE for regions without the WRITE flag, as i915 does for
its read-only objects and as fixed in drm/vc4 (CVE-2026-68445),
drm/panthor (CVE-2024-53071) and commit a5edadbae57e ("ptp: vmclock:
prevent read-only mappings from becoming writable").
Note this is defensive hardening: no in-tree cdx device currently
publishes a region without the WRITE flag. The guard costs nothing and
keeps the mmap() interface honest if a read-only region ever appears.
Fixes: 234489ac56130 ("vfio/cdx: add support for CDX bus")
Signed-off-by: Abdifatah Suruur <suruurism@gmail.com>
Link: https://lore.kernel.org/r/20260929094848.7439-4-suruurism@gmail.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vfio/cdx/main.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/vfio/cdx/main.c b/drivers/vfio/cdx/main.c
index 4cf2e4fb02c81..921e259c0288e 100644
--- a/drivers/vfio/cdx/main.c
+++ b/drivers/vfio/cdx/main.c
@@ -289,9 +289,13 @@ static int vfio_cdx_mmap(struct vfio_device *core_vdev,
(vma->vm_flags & VM_READ))
return -EPERM;
- if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE) &&
- (vma->vm_flags & VM_WRITE))
- return -EPERM;
+ /* Prevent read-only region mappings from being upgraded with mprotect() */
+ if (!(vdev->regions[index].flags & VFIO_REGION_INFO_FLAG_WRITE)) {
+ if (vma->vm_flags & VM_WRITE)
+ return -EPERM;
+
+ vm_flags_clear(vma, VM_MAYWRITE);
+ }
return vfio_cdx_mmap_mmio(vdev->regions[index], vma);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0704/1756] selftests/timers: clocksource-switch: Fix unchecked open()/read()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (702 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0703/1756] vfio/cdx: " Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0705/1756] perf symbols: Dont let a modules last symbol overlap the next module Greg Kroah-Hartman
` (294 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qingshuang Fu, Thomas Gleixner,
John Stultz, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qingshuang Fu <fuqingshuang@kylinos.cn>
[ Upstream commit 348f54c435bf3177baa78201952810b255d44b30 ]
get_clocksources() and get_cur_clocksource() open and read the
clocksource sysfs files without checking the return values and without
NUL-terminating the buffer.
If open() fails, read() is called on fd -1 and returns -1, which is
stored in a size_t as SIZE_MAX. The token-scanning loop in
get_clocksources() then walks past the uninitialized stack buffer,
reading and writing out of bounds. Even on success the buffer is not
NUL-terminated, so a fully read buffer makes the inner scan run past the
data, and get_cur_clocksource() lets change_clocksource() call strlen()
on a non-terminated buffer.
Check the open()/read() results, use ssize_t for the read length,
NUL-terminate the buffer, and close the fd in get_cur_clocksource().
Fixes: 7290ce1423c3 ("selftests/timers: Add clocksource-switch test from timetest suite")
Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: John Stultz <jstultz@google.com>
Link: https://patch.msgid.link/20260825064605.472889-1-fffsqian@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../selftests/timers/clocksource-switch.c | 23 ++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c
index 83faa4e354e38..4e7f81ffe0a35 100644
--- a/tools/testing/selftests/timers/clocksource-switch.c
+++ b/tools/testing/selftests/timers/clocksource-switch.c
@@ -40,16 +40,23 @@
int get_clocksources(char list[][30])
{
int fd, i;
- size_t size;
+ ssize_t size;
char buf[512];
char *head, *tmp;
fd = open("/sys/devices/system/clocksource/clocksource0/available_clocksource", O_RDONLY);
+ if (fd < 0)
+ return 0;
- size = read(fd, buf, 512);
+ size = read(fd, buf, sizeof(buf) - 1);
close(fd);
+ if (size <= 0)
+ return 0;
+
+ buf[size] = '\0';
+
for (i = 0; i < 10; i++)
list[i][0] = '\0';
@@ -74,11 +81,21 @@ int get_clocksources(char list[][30])
int get_cur_clocksource(char *buf, size_t size)
{
+ ssize_t len;
int fd;
fd = open("/sys/devices/system/clocksource/clocksource0/current_clocksource", O_RDONLY);
+ if (fd < 0)
+ return -1;
+
+ len = read(fd, buf, size - 1);
+
+ close(fd);
+
+ if (len <= 0)
+ return -1;
- size = read(fd, buf, size);
+ buf[len] = '\0';
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0705/1756] perf symbols: Dont let a modules last symbol overlap the next module
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (703 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0704/1756] selftests/timers: clocksource-switch: Fix unchecked open()/read() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0706/1756] RDMA/rtrs-clt: Validate peer-supplied IO completion msg_id Greg Kroah-Hartman
` (293 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alireza Haghdoost, Namhyung Kim,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alireza Haghdoost <haghdoost@uber.com>
[ Upstream commit 45d15e89a783a0a279b7a54f9018c230127380d7 ]
symbols__fixup_end() extends a zero-size symbol that is the last one in
the kernel or in a module to the end of the next page. On x86 the next
module can start in that page, so the stretched symbol overlaps it, and
a lookup can return the wrong symbol. For example:
ffffffffc0c4aa50 t dca_sysfs_exit [dca]
ffffffffc0c4b000 t __nft_trace_packet [nf_tables]
ffffffffc0c4b0b0 t nft_do_chain [nf_tables]
dca_sysfs_exit gets end 0xffffffffc0c4c000, and samples in nft_do_chain
are reported as dca_sysfs_exit.
This patch clamps the end to the next symbol's start. The ARM case this
code was added for, where the next module is far away, is unchanged.
Add a "Kallsyms symbol ends" test case to the Symbols suite that covers
the kernel/module boundary, adjacent modules and a distant module.
Fixes: 8799ebce84d672aa ("perf symbol: Update symbols__fixup_end()")
Fixes: bacefe0c7b77b752 ("perf tools: Fixup module symbol end address properly")
Signed-off-by: Alireza Haghdoost <haghdoost@uber.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/tests/symbols.c | 96 +++++++++++++++++++++++++++++++++++++-
tools/perf/util/symbol.c | 4 ++
2 files changed, 99 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/symbols.c b/tools/perf/tests/symbols.c
index c947a83699cc0..f110763c42c2b 100644
--- a/tools/perf/tests/symbols.c
+++ b/tools/perf/tests/symbols.c
@@ -2,6 +2,7 @@
#include <linux/compiler.h>
#include <linux/string.h>
#include <sys/mman.h>
+#include <inttypes.h>
#include <limits.h>
#include "debug.h"
#include "dso.h"
@@ -223,4 +224,97 @@ static int test__symbols(struct test_suite *test __maybe_unused, int subtest __m
return ret;
}
-DEFINE_SUITE("Symbols", symbols);
+struct kallsyms_sym {
+ u64 start;
+ const char *name;
+};
+
+/*
+ * kallsyms from an x86 host where nf_tables was loaded in the page right
+ * after the last symbol of dca, plus a kernel symbol followed closely by a
+ * module and a module far away from the others.
+ */
+static const struct kallsyms_sym kallsyms_syms[] = {
+ { 0xffffffff81000000, "_stext" },
+ { 0xffffffff81000ff0, "last_kernel_symbol" },
+ { 0xffffffff81001000, "near_module_symbol\t[near]" },
+ { 0xffffffffc0c4aa40, "dca_exit\t[dca]" },
+ { 0xffffffffc0c4aa50, "dca_sysfs_exit\t[dca]" },
+ { 0xffffffffc0c4b000, "__nft_trace_packet\t[nf_tables]" },
+ { 0xffffffffc0c4b0b0, "nft_do_chain\t[nf_tables]" },
+ { 0xffffffffc0c4b4e0, "nf_tables_core_module_exit\t[nf_tables]" },
+ { 0xffffffffc2000000, "far_module_symbol\t[far]" },
+};
+
+static int check_symbol(struct dso *dso, u64 addr, const char *name, u64 end)
+{
+ struct symbol *sym = dso__find_symbol_nocache(dso, addr);
+
+ if (!sym || strcmp(sym->name, name)) {
+ pr_debug("%#" PRIx64 ": expected %s, got %s\n", addr, name,
+ sym ? sym->name : "no symbol");
+ return TEST_FAIL;
+ }
+ if (sym->end != end) {
+ pr_debug("%s: expected end %#" PRIx64 ", got %#" PRIx64 "\n",
+ name, end, sym->end);
+ return TEST_FAIL;
+ }
+ return TEST_OK;
+}
+
+static int test__kallsyms_fixup_end(struct test_suite *test __maybe_unused,
+ int subtest __maybe_unused)
+{
+ struct dso *dso = dso__new("[kernel.kallsyms]");
+ int ret = TEST_FAIL;
+
+ if (!dso)
+ return TEST_FAIL;
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(kallsyms_syms); i++) {
+ struct symbol *sym = symbol__new(kallsyms_syms[i].start, 0, 0, 0,
+ kallsyms_syms[i].name);
+
+ if (!sym)
+ goto out;
+ symbols__insert(dso__symbols(dso), sym);
+ }
+
+ symbols__fixup_end(dso__symbols(dso), true);
+
+ ret = TEST_OK;
+ /* The next symbol is too close for the end of the page. */
+ if (check_symbol(dso, 0xffffffff81000ff8, "last_kernel_symbol",
+ 0xffffffff81001000))
+ ret = TEST_FAIL;
+ if (check_symbol(dso, 0xffffffffc0c4aa58, "dca_sysfs_exit\t[dca]",
+ 0xffffffffc0c4b000))
+ ret = TEST_FAIL;
+ if (check_symbol(dso, 0xffffffffc0c4b280, "nft_do_chain\t[nf_tables]",
+ 0xffffffffc0c4b4e0))
+ ret = TEST_FAIL;
+
+ /* Far from the next module, the end of the page is still used. */
+ if (check_symbol(dso, 0xffffffffc0c4b4f0,
+ "nf_tables_core_module_exit\t[nf_tables]",
+ 0xffffffffc0c4d000))
+ ret = TEST_FAIL;
+ if (check_symbol(dso, 0xffffffff81001008, "near_module_symbol\t[near]",
+ 0xffffffff81002000))
+ ret = TEST_FAIL;
+out:
+ dso__put(dso);
+ return ret;
+}
+
+static struct test_case tests__symbols[] = {
+ TEST_CASE("Symbols", symbols),
+ TEST_CASE("Kallsyms symbol ends", kallsyms_fixup_end),
+ { .name = NULL, }
+};
+
+struct test_suite suite__symbols = {
+ .desc = "Symbols",
+ .test_cases = tests__symbols,
+};
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b3f25a937b71e..99ee76bc6c513 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -278,6 +278,10 @@ void symbols__fixup_end(struct rb_root_cached *symbols, bool is_kallsyms)
else
prev->end = curr->start;
+ /* The next module can start within that page */
+ if (prev->end > curr->start)
+ prev->end = curr->start;
+
pr_debug4("%s sym:%s end:%#" PRIx64 "\n",
__func__, prev->name, prev->end);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0706/1756] RDMA/rtrs-clt: Validate peer-supplied IO completion msg_id
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (704 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0705/1756] perf symbols: Dont let a modules last symbol overlap the next module Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0707/1756] RDMA/siw: Fix length of first chunk in siw_try_1seg() Greg Kroah-Hartman
` (292 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Farhad Alemi, Quanye Yang, Jack Wang,
Jason Gunthorpe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanye Yang <quanyeyang@proton.me>
[ Upstream commit c1fcde82f7b68181553af7efb4410df04109a9a8 ]
process_io_rsp() indexes clt_path->reqs[] with the 19-bit msg_id
taken from a WRITE_WITH_IMM immediate. That value is chosen by the
peer. The only check was WARN_ON(msg_id >= queue_depth), which still
lets a completion run after free_path_reqs() has set reqs to NULL,
or against a slot whose FRWR is already gone. Either path
dereferences req->mr and can GPF; KASAN reports a null-ptr-deref at
offsetof(struct rtrs_clt_io_req, mr).
Treat a missing reqs array, an out-of-range msg_id, or a req
without an MR as a protocol error and recover the connection.
Link: https://patch.msgid.link/r/20260923-rtrs-warning-inrtrs-clt-rdma-done-v1-1-0827a9a77c0b@proton.me
Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Closes: https://lore.kernel.org/r/CA+0ovCiJZz6O8LzsS9Dq1-JE1OE1L_OTA6Mr-WratpUE6jczHw@mail.gmail.com
Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Signed-off-by: Quanye Yang <quanyeyang@proton.me>
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/ulp/rtrs/rtrs-clt.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index 99de772e99afb..dbce23eabcfd1 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -489,18 +489,22 @@ static int rtrs_post_send_rdma(struct rtrs_clt_con *con,
imm, flags, wr, NULL);
}
-static void process_io_rsp(struct rtrs_clt_path *clt_path, u32 msg_id,
+static bool process_io_rsp(struct rtrs_clt_path *clt_path, u32 msg_id,
s16 errno, bool w_inval)
{
struct rtrs_clt_io_req *req;
- if (WARN_ON(msg_id >= clt_path->queue_depth))
- return;
+ if (!clt_path->reqs || msg_id >= clt_path->queue_depth)
+ return false;
req = &clt_path->reqs[msg_id];
+ if (!req->mr)
+ return false;
+
/* Drop need_inv if server responded with send with invalidation */
req->mr->need_inval &= !w_inval;
complete_rdma_req(req, errno, true, false);
+ return true;
}
static void rtrs_clt_recv_done(struct rtrs_clt_con *con, struct ib_wc *wc)
@@ -562,7 +566,8 @@ static void rtrs_clt_rkey_rsp_done(struct rtrs_clt_con *con, struct ib_wc *wc)
if (WARN_ON(buf_id != msg_id))
goto out;
clt_path->rbufs[buf_id].rkey = le32_to_cpu(msg->rkey);
- process_io_rsp(clt_path, msg_id, err, w_inval);
+ if (!process_io_rsp(clt_path, msg_id, err, w_inval))
+ goto out;
}
ib_dma_sync_single_for_device(clt_path->s.dev->ib_dev, iu->dma_addr,
iu->size, DMA_FROM_DEVICE);
@@ -634,7 +639,13 @@ static void rtrs_clt_rdma_done(struct ib_cq *cq, struct ib_wc *wc)
w_inval = (imm_type == RTRS_IO_RSP_W_INV_IMM);
rtrs_from_io_rsp_imm(imm_payload, &msg_id, &err);
- process_io_rsp(clt_path, msg_id, err, w_inval);
+ if (!process_io_rsp(clt_path, msg_id, err, w_inval)) {
+ rtrs_err(clt_path->clt,
+ "Invalid IO rsp: msg_id %u queue_depth %zu\n",
+ msg_id, clt_path->queue_depth);
+ rtrs_rdma_error_recovery(con);
+ return;
+ }
} else if (imm_type == RTRS_HB_MSG_IMM) {
WARN_ON(con->c.cid);
rtrs_send_hb_ack(&clt_path->s);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0707/1756] RDMA/siw: Fix length of first chunk in siw_try_1seg()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (705 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0706/1756] RDMA/rtrs-clt: Validate peer-supplied IO completion msg_id Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0708/1756] RDMA/hfi1: shut down the trap timer before unregistering Greg Kroah-Hartman
` (291 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Serhat Kumral, Bernard Metzler,
Jason Gunthorpe, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Serhat Kumral <serhatkumral1@gmail.com>
[ Upstream commit aac27aa8c5cfe3c3c6029b9c0f1113e0a53329de ]
When a short-single SGE payload crosses a page boundary, siw_try_1seg()
computes the length of the first chunk as the amount that spills into
the second page instead of the amount left in the first page
part = bytes - (PAGE_SIZE - off);
Use the remaining length of the first page as the first chunk.
Fixes: b9be6f18cf9e ("rdma/siw: transmit path")
Link: https://patch.msgid.link/r/20260927115351.12245-1-serhatkumral1@gmail.com
Assisted-by: LLM
Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com>
Acked-by: Bernard Metzler <bernard.metzler@linux.dev>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
index 43ff1afd3d018..4abea56ac45d6 100644
--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -85,7 +85,7 @@ static int siw_try_1seg(struct siw_iwarp_tx *c_tx, void *paddr)
if (likely(PAGE_SIZE - off >= bytes)) {
memcpy(paddr, buffer + off, bytes);
} else {
- unsigned long part = bytes - (PAGE_SIZE - off);
+ unsigned long part = PAGE_SIZE - off;
memcpy(paddr, buffer + off, part);
kunmap_local(buffer);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0708/1756] RDMA/hfi1: shut down the trap timer before unregistering
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (706 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0707/1756] RDMA/siw: Fix length of first chunk in siw_try_1seg() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0709/1756] RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit Greg Kroah-Hartman
` (290 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongyan Xu, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongyan Xu <getshell@seu.edu.cn>
[ Upstream commit a1c9d476c2316685f85fffb6450ad88d01836357 ]
MAD processing arms a trap timer embedded in each hfi1_ibport. Device
unregistration does not stop the timer, so its callback can run after
the port and its containing hfi1_devdata have been released.
Shut down every port timer before unregistering the IB device. The
shutdown form also prevents a concurrent path from rearming the timer.
Fixes: bf90aadd630c ("IB/hfi1: Send MAD traps until repressed")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
Link: https://patch.msgid.link/20260928134151.1213-1-getshell@seu.edu.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hfi1/verbs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
index 33af2196ef319..f9c333f22f4ff 100644
--- a/drivers/infiniband/hw/hfi1/verbs.c
+++ b/drivers/infiniband/hw/hfi1/verbs.c
@@ -1890,6 +1890,10 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
void hfi1_unregister_ib_device(struct hfi1_devdata *dd)
{
struct hfi1_ibdev *dev = &dd->verbs_dev;
+ int i;
+
+ for (i = 0; i < dd->num_pports; i++)
+ timer_shutdown_sync(&dd->pport[i].ibport_data.rvp.trap_timer);
hfi1_verbs_unregister_sysfs(dd);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0709/1756] RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (707 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0708/1756] RDMA/hfi1: shut down the trap timer before unregistering Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0710/1756] pinctrl: nuvoton: Fix clock reference leak in ma35_get_bank_data() Greg Kroah-Hartman
` (289 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongyan Xu, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongyan Xu <getshell@seu.edu.cn>
[ Upstream commit e95d076bc1fca7cc36fc8f2f0e9687f79fd314bd ]
The SDMA state reference and completion cover the software cleanup
tasklet, but not the hardware cleanup tasklet, err_halt_worker, or
flush_worker. Queued instances can therefore access an SDMA engine after
per_sdma is released.
After the state machine has stopped, cancel err_halt_worker first
because it can publish the hardware cleanup tasklet. Then kill that
tasklet and drain the remaining flush work.
Fixes: 7724105686e7 ("IB/hfi1: add driver files")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
Link: https://patch.msgid.link/20260928134148.977-1-getshell@seu.edu.cn
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/hfi1/sdma.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
index b67d23b1f2862..3e54b3b390b3f 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -1583,6 +1583,9 @@ void sdma_exit(struct hfi1_devdata *dd)
* it is not running.
*/
sdma_finalput(&sde->state);
+ cancel_work_sync(&sde->err_halt_worker);
+ tasklet_kill(&sde->sdma_hw_clean_up_task);
+ cancel_work_sync(&sde->flush_worker);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0710/1756] pinctrl: nuvoton: Fix clock reference leak in ma35_get_bank_data()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (708 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0709/1756] RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0711/1756] pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe() Greg Kroah-Hartman
` (288 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Linus Walleij,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit a854aa8e550502ef05c2836a4b426141d735bed1 ]
ma35_get_bank_data() obtains the bank clock with of_clk_get() and
stores it in bank->clk, but returns clk_prepare_enable() directly. If
that call fails, the reference taken by of_clk_get() is never dropped,
and the driver has no other clk_put() for it.
Drop the reference when clk_prepare_enable() fails.
Fixes: f805e356313b ("pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/nuvoton/pinctrl-ma35.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvoton/pinctrl-ma35.c
index 3330e444ede18..4ab1904c56f90 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c
@@ -570,6 +570,8 @@ static int ma35_gpiolib_register(struct platform_device *pdev, struct ma35_pinct
static int ma35_get_bank_data(struct ma35_pin_bank *bank)
{
+ int ret;
+
bank->reg_base = fwnode_iomap(bank->fwnode, 0);
if (!bank->reg_base)
return -ENOMEM;
@@ -582,7 +584,11 @@ static int ma35_get_bank_data(struct ma35_pin_bank *bank)
if (IS_ERR(bank->clk))
return PTR_ERR(bank->clk);
- return clk_prepare_enable(bank->clk);
+ ret = clk_prepare_enable(bank->clk);
+ if (ret)
+ clk_put(bank->clk);
+
+ return ret;
}
static int ma35_pinctrl_get_soc_data(struct ma35_pinctrl *pctl, struct platform_device *pdev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0711/1756] pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (709 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0710/1756] pinctrl: nuvoton: Fix clock reference leak in ma35_get_bank_data() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0712/1756] kconfig: tests: Provide defconfig outfile for savedefconfig Greg Kroah-Hartman
` (287 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Linus Walleij,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit dfd8259507c53a3c7eb0dd11c1152c88e12aa316 ]
stm32_pctl_probe() obtains one clock per bank with
of_clk_get_by_name(), but none of the error paths drop those
references: the loop returns directly when a later clock lookup fails,
and both the clk_bulk_prepare_enable() failure and the err_register
path return without calling clk_bulk_put(). clk_bulk_disable_unprepare()
only disables the clocks, it does not release them.
Release the references on these paths; the success path keeps them as
the driver needs them for suspend/resume.
Fixes: 451bc9aea9a1 ("pinctrl: stm32: Add check for clk_enable()")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/stm32/pinctrl-stm32.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index 2219f31d14935..9e8b8b82c232b 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1631,6 +1631,7 @@ int stm32_pctl_probe(struct platform_device *pdev)
pctl->clks[i].clk = of_clk_get_by_name(np, NULL);
if (IS_ERR(pctl->clks[i].clk)) {
fwnode_handle_put(child);
+ clk_bulk_put(i, pctl->clks);
return dev_err_probe(dev, PTR_ERR(pctl->clks[i].clk),
"failed to get clk\n");
}
@@ -1641,6 +1642,7 @@ int stm32_pctl_probe(struct platform_device *pdev)
ret = clk_bulk_prepare_enable(banks, pctl->clks);
if (ret) {
dev_err(dev, "failed to prepare_enable clk (%d)\n", ret);
+ clk_bulk_put(banks, pctl->clks);
return ret;
}
@@ -1665,6 +1667,7 @@ int stm32_pctl_probe(struct platform_device *pdev)
}
clk_bulk_disable_unprepare(banks, pctl->clks);
+ clk_bulk_put(banks, pctl->clks);
return ret;
}
EXPORT_SYMBOL(stm32_pctl_probe);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0712/1756] kconfig: tests: Provide defconfig outfile for savedefconfig
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (710 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0711/1756] pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0713/1756] RDMA/irdma: Do not move a fresh RoCE QP to ERROR on RESET Greg Kroah-Hartman
` (286 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Julian Braha, Nicolas Schier,
Nathan Chancellor, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Schier <n.schier@fritz.com>
[ Upstream commit 09bd92ba15bd00d937deea38a10a439458393043 ]
Let kconfig test framework's 'savedefconfig' forward the requested
output 'defconfig' filename to 'conf'.
The original implementation was calling 'conf' with '--savedefconfig'
but missed the mandatory filename for the defconfig output file.
While at it, honour the 'dot_config' argument which points to the input
config file.
Fixes: 022a4bf6b59d ("kconfig: tests: add framework for Kconfig unit testing")
Reviewed-by: Julian Braha <julianbraha@gmail.com>
Signed-off-by: Nicolas Schier <n.schier@fritz.com>
Link: https://patch.msgid.link/20260929-kconfig-tests-minor-updates-v2-2-c5902bee1d0c@fritz.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/kconfig/tests/conftest.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
index 26f194ed2d400..a6d52684036c2 100644
--- a/scripts/kconfig/tests/conftest.py
+++ b/scripts/kconfig/tests/conftest.py
@@ -213,7 +213,8 @@ class Conf:
dot_config: .config file for input
returncode: exit status of the Kconfig executable
"""
- return self._run_conf('--savedefconfig', out_file='defconfig')
+ return self._run_conf('--savedefconfig={}'.format(out_file),
+ dot_config=dot_config, out_file='defconfig')
def listnewconfig(self, dot_config=None):
"""Run listnewconfig.
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0713/1756] RDMA/irdma: Do not move a fresh RoCE QP to ERROR on RESET
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (711 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0712/1756] kconfig: tests: Provide defconfig outfile for savedefconfig Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0714/1756] rtc: bd70528: properly enable wakeup Greg Kroah-Hartman
` (285 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches,
Nguyễn Văn Cao Nguyên, Leon Romanovsky,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nguyễn Văn Cao Nguyên <nguyennvc@greennode.ai>
[ Upstream commit 6de34bfb56ad8c24bf63b243b5f32b345d9cdd4d ]
irdma_modify_qp_roce() handles IB_QPS_RESET like IB_QPS_ERR and moves
the QP to ERROR. On a QP that was never moved to INIT, this makes the
following RESET->INIT fail with -EINVAL, while ibv_query_qp() still
reports RESET.
RESET->RESET is a valid transition. The Mooncake transfer engine
resets every new QP before INIT, so it cannot connect over an E810,
while mlx5 accepts the same sequence:
ibv_create_qp(RC) -> RESET
ibv_modify_qp(RESET) -> 0
ibv_modify_qp(INIT, ...) -> -EINVAL
Skip the hardware modify when the QP has not been moved to INIT yet
(iwarp_state is IRDMA_QP_STATE_INVALID), as there is nothing to flush.
RESET after INIT still goes to ERROR.
Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Assisted-by: LLM
Signed-off-by: Nguyễn Văn Cao Nguyên <nguyennvc@greennode.ai>
Link: https://patch.msgid.link/20260930-irdma-reset-fresh-qp-v1-1-065327274e2b@greennode.ai
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/infiniband/hw/irdma/verbs.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 8a3c08679953d..d1caa78b8184b 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -1437,9 +1437,17 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
issue_modify_qp = 1;
iwqp->suspend_pending = true;
break;
+ case IB_QPS_RESET:
+ /*
+ * A QP that was never moved to INIT has nothing to
+ * flush, so skip the hardware modify. Moving it to
+ * ERROR would make the following INIT fail.
+ */
+ if (iwqp->iwarp_state == IRDMA_QP_STATE_INVALID)
+ break;
+ fallthrough;
case IB_QPS_SQE:
case IB_QPS_ERR:
- case IB_QPS_RESET:
if (iwqp->iwarp_state == IRDMA_QP_STATE_ERROR) {
iwqp->ibqp_state = attr->qp_state;
spin_unlock_irqrestore(&iwqp->lock, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0714/1756] rtc: bd70528: properly enable wakeup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (712 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0713/1756] RDMA/irdma: Do not move a fresh RoCE QP to ERROR on RESET Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0715/1756] f2fs: quota: fix unused-label warning Greg Kroah-Hartman
` (284 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matti Vaittinen, Andreas Kemnade,
Alexandre Belloni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Kemnade <andreas@kemnade.info>
[ Upstream commit cb8a6249236fd970fc3418d5d2b27dc37376f3ff ]
Wakeup on RTC alarm now only accidentially works when wakeup for the power
button connected to the same PMIC is also enabled. Fix that by properly
specifying the wakeup irq.
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260922-rtc-bd-v3-1-7f2580c55d58@kemnade.info
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-bd70528.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
index 59b627fc1ecfa..7f10f2f4f468b 100644
--- a/drivers/rtc/rtc-bd70528.c
+++ b/drivers/rtc/rtc-bd70528.c
@@ -10,6 +10,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
@@ -318,6 +319,10 @@ static int bd70528_probe(struct platform_device *pdev)
device_set_wakeup_capable(&pdev->dev, true);
device_wakeup_enable(&pdev->dev);
+ ret = devm_pm_set_wake_irq(&pdev->dev, irq);
+ if (ret)
+ return ret;
+
rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc)) {
dev_err(&pdev->dev, "RTC device creation failed\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0715/1756] f2fs: quota: fix unused-label warning
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (713 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0714/1756] rtc: bd70528: properly enable wakeup Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0716/1756] tools/nolibc: stop rounding malloc() sizes up to 4096 bytes Greg Kroah-Hartman
` (283 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Randy Dunlap, Chao Yu,
Jaegeuk Kim, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <arnd@arndb.de>
[ Upstream commit 4faeea625cf730bb20f609f061ff81c9b6852931 ]
The newly added label causes a warning when QUOTA is turned off:
fs/f2fs/super.c: In function '__f2fs_remount':
fs/f2fs/super.c:3142:1: error: label 'restore_holder' defined but not used [-Werror=unused-label]
3142 | restore_holder:
| ^~~~~~~~~~~~~~
Fixes: 3f140a60c92a ("f2fs: quota: fix stale lock holder on remount failure")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/super.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 7f81ac832a858..acf6bdea8a451 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2646,7 +2646,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
sbi->mount_opt = org_mount_opt;
sb->s_flags = old_sb_flags;
+#ifdef CONFIG_QUOTA
restore_holder:
+#endif
sbi->umount_lock_holder = NULL;
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0716/1756] tools/nolibc: stop rounding malloc() sizes up to 4096 bytes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (714 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0715/1756] f2fs: quota: fix unused-label warning Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0717/1756] tools/nolibc: check for overflow in malloc() Greg Kroah-Hartman
` (282 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Danish Khateeb, Willy Tarreau,
Thomas Weißschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danish Khateeb <danishkhateeb03@gmail.com>
[ Upstream commit b7db3ba9434cbad3d15f62500104525bfa28a304 ]
malloc() rounds the size of each mapping up to a multiple of 4096,
presumably to align it to a page boundary. But the page size is not 4096
on all architectures, and mmap() and munmap() round the length up to the
page size themselves.
Drop the rounding. As heap->len is no longer rounded up, growing a block
with realloc() now always creates a new mapping.
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Reviewed-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260926152414.251214-2-danishkhateeb03@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Stable-dep-of: 2111eb4273e7 ("tools/nolibc: check for overflow in malloc()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/nolibc/stdlib.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h
index 75aa273c23a61..4c2da9731b1e7 100644
--- a/tools/include/nolibc/stdlib.h
+++ b/tools/include/nolibc/stdlib.h
@@ -132,9 +132,7 @@ void *malloc(size_t len)
{
struct nolibc_heap *heap;
- /* Always allocate memory with size multiple of 4096. */
len = sizeof(*heap) + len;
- len = (len + 4095UL) & -4096UL;
heap = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE,
-1, 0);
if (__builtin_expect(heap == MAP_FAILED, 0))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0717/1756] tools/nolibc: check for overflow in malloc()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (715 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0716/1756] tools/nolibc: stop rounding malloc() sizes up to 4096 bytes Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0718/1756] dt-bindings: vendor-prefixes: Add Sophos Greg Kroah-Hartman
` (281 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Danish Khateeb,
Thomas Weißschuh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Danish Khateeb <danishkhateeb03@gmail.com>
[ Upstream commit 2111eb4273e7fda0815de85319653104f323c441 ]
malloc() adds the size of its header to the requested size without
checking for overflow. For a size within the header size of SIZE_MAX,
the sum wraps around to a few bytes, and malloc() returns a single page
instead of NULL.
calloc() checks its multiplication for overflow, but then passes the
product to malloc(), so calloc(SIZE_MAX, 1) returns a single page too.
So does realloc(ptr, SIZE_MAX).
Such a size is usually a bug in the caller, for instance a length of -1
used as a size_t, and returning a page instead of NULL can turn it into
a heap overflow.
Fail with ENOMEM when adding the header overflows, as glibc does for
sizes this large.
Fixes: 0e0ff638400b ("tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()`")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
Link: https://patch.msgid.link/20260926152414.251214-3-danishkhateeb03@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/nolibc/stdlib.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/include/nolibc/stdlib.h b/tools/include/nolibc/stdlib.h
index 4c2da9731b1e7..577cd2966f093 100644
--- a/tools/include/nolibc/stdlib.h
+++ b/tools/include/nolibc/stdlib.h
@@ -132,7 +132,11 @@ void *malloc(size_t len)
{
struct nolibc_heap *heap;
- len = sizeof(*heap) + len;
+ if (__builtin_expect(__builtin_add_overflow(len, sizeof(*heap), &len), 0)) {
+ SET_ERRNO(ENOMEM);
+ return NULL;
+ }
+
heap = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE,
-1, 0);
if (__builtin_expect(heap == MAP_FAILED, 0))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0718/1756] dt-bindings: vendor-prefixes: Add Sophos
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (716 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0717/1756] tools/nolibc: check for overflow in malloc() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0719/1756] x86/hibernate: Ignore page-zero RAM in E820 checksum Greg Kroah-Hartman
` (280 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Nicolo Giuliani,
Gregory CLEMENT, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolo Giuliani <nicolo.giuliani6@studio.unibo.it>
[ Upstream commit 538f8ec6b9c711833c5217a8bd8207a282265303 ]
Add the "sophos" vendor prefix for Sophos Ltd., a vendor of network
security appliances.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Assisted-by: LLM
Signed-off-by: Nicolo Giuliani <nicolo.giuliani6@studio.unibo.it>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 633d540e504b3..fb89e413e3d24 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1406,6 +1406,8 @@ patternProperties:
description: Sony Corporation
"^sophgo,.*":
description: Sophgo Technology Inc.
+ "^sophos,.*":
+ description: Sophos Ltd.
"^sourceparts,.*":
description: Source Parts Inc.
"^spansion,.*":
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0719/1756] x86/hibernate: Ignore page-zero RAM in E820 checksum
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (717 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0718/1756] dt-bindings: vendor-prefixes: Add Sophos Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0720/1756] ARM: mvebu: fix Cortex-A9 errata selection for Armada 38x Greg Kroah-Hartman
` (279 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roberto Ricci, Matthias Goergens,
Rafael J. Wysocki, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Goergens <matthias.goergens@gmail.com>
[ Upstream commit 29671cabfc09afb1ee2426b21173cdde276a95ac ]
The legacy kexec_load path reconstructs the E820 map exported through
sysfs. kexec-tools leaves the first 1 KiB unavailable for the real-mode
transition, so a kernel entered through kexec_load can see conventional
RAM starting at 0x400. A subsequent firmware boot reports the same RAM
range starting at zero.
The hibernation E820 checksum compares those byte representations and
rejects the image, even though the maps agree from page one onwards.
A QEMU guest showed this transition:
firmware: RAM [0-0x9fbff]
kexec_load: gap [0-0x3ff], RAM [0x400-0x9fbff]
firmware: RAM [0-0x9fbff]
The checksum covers e820_table_firmware, which trim_bios_range() leaves
alone. The nosave regions come from e820_table instead, where
trim_bios_range() has already turned conventional RAM in page zero into
reserved memory, so page zero never occurs in the image, whatever the
firmware map says about it.
Canonicalise only the conventional-RAM portion below PAGE_SIZE before
calculating the checksum. Preserve RESERVED, ACPI, NVS, UNUSABLE, PMEM
and all other E820 types so that changes to exceptional mappings remain
detectable.
This is deliberately narrower than Marco Scardovi's June proposal to
checksum only RAM and its opt-in relaxed_memmap successor. Rafael
noted that ignoring non-RAM changes could hide moved ACPI or UEFI
regions still used by the resumed kernel. This patch preserves every
non-RAM entry and ignores only RAM within page zero, which common setup
already reserves and excludes from the image.
Bump RESTORE_MAGIC, since the checksum semantics change, so that an
image written by a kernel without this change is refused by the magic
check instead of being compared under different rules.
In the same guest, with the page-zero difference kept, hibernation and
resume now work after both a direct boot and a kexec_load boot. An
image written by an unpatched kernel is refused at resume with
"Unrecognized hibernate image header format!", and the firmware-booted
kernel carries on.
Fixes: 62a03defeabd ("PM / hibernate: Verify the consistent of e820 memory map by md5 digest")
Reported-by: Roberto Ricci <io@r-ricci.it>
Signed-off-by: Matthias Goergens <matthias.goergens@gmail.com>
Link: https://lore.kernel.org/all/Z-hYWc9LtBU1Yhtg@desktop0a/
Link: https://lists.openwall.net/linux-kernel/2025/04/04/1372
Link: https://lore.kernel.org/all/CAJZ5v0jmOj0WBtMTvbnaD+2b0bTFowA=JWrqRzaaCYpHpai1Nw@mail.gmail.com/
Link: https://lore.kernel.org/all/20260623165724.10753-1-scardracs@disroot.org/
Link: https://patch.msgid.link/20260926052117.3613637-1-matthias.goergens@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/power/hibernate.c | 51 +++++++++++++++++++++++++++++++++-----
1 file changed, 45 insertions(+), 6 deletions(-)
diff --git a/arch/x86/power/hibernate.c b/arch/x86/power/hibernate.c
index 5b81d19cd114c..4430f158c7476 100644
--- a/arch/x86/power/hibernate.c
+++ b/arch/x86/power/hibernate.c
@@ -62,6 +62,25 @@ struct restore_data_record {
unsigned long e820_checksum;
};
+static bool trim_e820_page_zero_ram(struct e820_entry *entry)
+{
+ u64 lowmem_size;
+
+ /*
+ * Page zero is BIOS-owned and registered as nosave. Boot loaders may
+ * therefore omit part of its conventional RAM entry without changing
+ * any memory available to the image. Preserve all other E820 types.
+ */
+ if (entry->type != E820_TYPE_RAM || entry->addr >= PAGE_SIZE)
+ return true;
+
+ lowmem_size = min_t(u64, entry->size, PAGE_SIZE - entry->addr);
+ entry->addr += lowmem_size;
+ entry->size -= lowmem_size;
+
+ return entry->size;
+}
+
/**
* compute_e820_crc32 - calculate crc32 of a given e820 table
*
@@ -69,18 +88,38 @@ struct restore_data_record {
*
* Return: the resulting checksum
*/
-static inline u32 compute_e820_crc32(struct e820_table *table)
+static u32 compute_e820_crc32(struct e820_table *table)
{
- int size = offsetof(struct e820_table, entries) +
- sizeof(struct e820_entry) * table->nr_entries;
+ struct e820_entry entry;
+ u32 crc = ~0;
+ u32 nr_entries = 0;
+ u32 i;
+
+ for (i = 0; i < table->nr_entries; i++) {
+ entry = table->entries[i];
+ if (trim_e820_page_zero_ram(&entry))
+ nr_entries++;
+ }
+
+ crc = crc32_le(crc, (unsigned char const *)&nr_entries,
+ sizeof(nr_entries));
+
+ for (i = 0; i < table->nr_entries; i++) {
+ entry = table->entries[i];
+ if (!trim_e820_page_zero_ram(&entry))
+ continue;
+
+ crc = crc32_le(crc, (unsigned char const *)&entry,
+ sizeof(entry));
+ }
- return ~crc32_le(~0, (unsigned char const *)table, size);
+ return ~crc;
}
#ifdef CONFIG_X86_64
-#define RESTORE_MAGIC 0x23456789ABCDEF02UL
+#define RESTORE_MAGIC 0x23456789ABCDEF03UL
#else
-#define RESTORE_MAGIC 0x12345679UL
+#define RESTORE_MAGIC 0x1234567AUL
#endif
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0720/1756] ARM: mvebu: fix Cortex-A9 errata selection for Armada 38x
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (718 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0719/1756] x86/hibernate: Ignore page-zero RAM in E820 checksum Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0721/1756] ice: skip stats handling for channel VSIs on rebuild Greg Kroah-Hartman
` (278 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qingfang Deng, Gregory CLEMENT,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qingfang Deng <qingfang.deng@linux.dev>
[ Upstream commit 76e67df8bc1cb72157368c3669119e64cdb0a6a6 ]
Armada 38x uses Cortex-A9 r4p1, but MACH_ARMADA_38X selects the
workaround for erratum 720789, which was fixed in r2p0, and omits
workarounds for errata that still affect r4p1.
Drop ARM_ERRATA_720789 and select ARM_ERRATA_754322 for faulty MMU
translations following an ASID switch and ARM_ERRATA_764319 for
unexpected undefined instruction exceptions when reading debug
registers. Also select ARM_ERRATA_764369 when SMP is enabled to work
around cache maintenance by MVA failing to reach other agents.
The Cortex-A9 r4 Software Developers Errata Notice (ARM UAN 0009D)
lists these errata in sections 2.3.3, 2.5.10 and 2.3.4, respectively.
Link: https://documentation-service.arm.com/static/608118675e70d934bc69f143
Fixes: 9aa30f1c13d1 ("ARM: mvebu: add initial support for the Armada 380/385 SOCs")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-mvebu/Kconfig | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 9f60a6fe0eafb..5203b5cfa4577 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -55,7 +55,9 @@ config MACH_ARMADA_375
config MACH_ARMADA_38X
bool "Marvell Armada 380/385 boards"
depends on ARCH_MULTI_V7
- select ARM_ERRATA_720789
+ select ARM_ERRATA_754322
+ select ARM_ERRATA_764319
+ select ARM_ERRATA_764369 if SMP
select PL310_ERRATA_753970
select ARM_GIC
select ARM_GLOBAL_TIMER
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0721/1756] ice: skip stats handling for channel VSIs on rebuild
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (719 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0720/1756] ARM: mvebu: fix Cortex-A9 errata selection for Armada 38x Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0722/1756] drm/msm: Properly handle msm_ioremap() without name Greg Kroah-Hartman
` (277 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Przemek Kitszel, Aleksandr Loktionov,
Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
[ Upstream commit 3fca849c965333f387aa02dca02326ce3abd1305 ]
ice_vsi_alloc_stat_arrays() returns early for ICE_VSI_CHNL, so a channel
VSI never gets an entry in pf->vsi_stats[]. ice_vsi_realloc_stat_arrays()
dereferences that entry unconditionally, and ice_vsi_rebuild() calls it
before anything else, so the NULL is not filtered out anywhere.
The path is live. ice_prepare_for_reset() removes the queue channels only
for resets other than a PFR, so a PFR leaves the channel VSIs in place,
and ice_rebuild() then calls ice_rebuild_channels(), which rebuilds every
ICE_VSI_CHNL VSI it finds. A PF reset with ADQ (mqprio hardware offload)
configured thus dereferences NULL.
That combination is reset recovery on top of an active mqprio offload,
which is why it went unnoticed. It was found while refactoring this code,
not reported by a user.
I'm leaning towards removing our limited (compared to OOT ADQ) support,
but it's outside of this series. Bug could be triggered by:
tc qdisc del dev "$IF" root 2>/dev/null || true
tc qdisc add dev "$IF" root mqprio num_tc 2 \
map 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 \
queues 2@0 2@2 hw 1 mode channel
sleep 3
ethtool --reset "$IF" irq dma filter offload
Workqueue: ice ice_service_task [ice]
RIP: 0010:ice_vsi_rebuild+0x289/0x380 [ice]
ice_rebuild_channels+0xd6/0x320 [ice]
ice_rebuild+0x4f6/0x540 [ice]
ice_do_reset+0x9f/0x1a0 [ice]
ice_service_task+0x4a/0x460 [ice]
Fixes: 5995ef88e3a8 ("ice: realloc VSI stats arrays")
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Link: https://patch.msgid.link/20260925132636.123300-2-przemyslaw.kitszel@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_lib.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 7d982a2b001c4..5505cdb131cdb 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -2961,6 +2961,10 @@ ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi)
u16 prev_rxq = vsi->alloc_rxq;
int i;
+ /* channel VSIs have no entry in pf->vsi_stats[] */
+ if (vsi->type == ICE_VSI_CHNL)
+ return 0;
+
vsi_stat = pf->vsi_stats[vsi->idx];
if (req_txq < prev_txq) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0722/1756] drm/msm: Properly handle msm_ioremap() without name
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (720 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0721/1756] ice: skip stats handling for channel VSIs on rebuild Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0723/1756] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies Greg Kroah-Hartman
` (276 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abel Vesa, Krzysztof Kozlowski,
Konrad Dybcio, Dmitry Baryshkov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
[ Upstream commit 14fe0ea79e0e25efc603f6f4bc81cb5b813f0e69 ]
msm_ioremap() accepts being called without name of the region to map and
in such case maps by index 0. However error paths still use the name in
error message.
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/752660/
Link: https://lore.kernel.org/r/20260911-drm-msm-hdmi-fixes-before-eliza-v4-5-87bdb9f1987f@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_io_utils.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c
index afedd61c3e288..780899c7f6fac 100644
--- a/drivers/gpu/drm/msm/msm_io_utils.c
+++ b/drivers/gpu/drm/msm/msm_io_utils.c
@@ -77,7 +77,8 @@ static void __iomem *_msm_ioremap(struct platform_device *pdev, const char *name
if (!res) {
if (!quiet)
- DRM_DEV_ERROR(&pdev->dev, "failed to get memory resource: %s\n", name);
+ DRM_DEV_ERROR(&pdev->dev, "failed to get memory resource: %s\n",
+ (name ?: "#0"));
return ERR_PTR(-EINVAL);
}
@@ -86,7 +87,8 @@ static void __iomem *_msm_ioremap(struct platform_device *pdev, const char *name
ptr = devm_ioremap(&pdev->dev, res->start, size);
if (!ptr) {
if (!quiet)
- DRM_DEV_ERROR(&pdev->dev, "failed to ioremap: %s\n", name);
+ DRM_DEV_ERROR(&pdev->dev, "failed to ioremap: %s\n",
+ (name ?: "#0"));
return ERR_PTR(-ENOMEM);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0723/1756] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (721 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0722/1756] drm/msm: Properly handle msm_ioremap() without name Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0724/1756] drm/msm/mdp5: drop cursor pipe for msm8x76 Greg Kroah-Hartman
` (275 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Conor Dooley, Krzysztof Kozlowski,
Dmitry Baryshkov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
[ Upstream commit 3309f5c888602c647f50c1921c9b60759fa86c21 ]
There are no properties in DTS or Linux drivers called
"core-vcc-supplies" or "hdmi-mux-supplies", so the binding probably
wanted "-supply" properties instead (which are defined in the top-level
properties of the binding).
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Fixes: 2f14bc38d88a ("dt-bindings: display/msm: hdmi: split and convert to yaml")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/752661/
Link: https://lore.kernel.org/r/20260911-drm-msm-hdmi-fixes-before-eliza-v4-7-87bdb9f1987f@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/devicetree/bindings/display/msm/hdmi.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/msm/hdmi.yaml b/Documentation/devicetree/bindings/display/msm/hdmi.yaml
index d4a2033afea8d..680d88d3ced3b 100644
--- a/Documentation/devicetree/bindings/display/msm/hdmi.yaml
+++ b/Documentation/devicetree/bindings/display/msm/hdmi.yaml
@@ -128,7 +128,7 @@ allOf:
- const: core
- const: master_iface
- const: slave_iface
- core-vcc-supplies: false
+ core-vcc-supply: false
- if:
properties:
@@ -151,7 +151,7 @@ allOf:
- const: core
- const: alt_iface
- const: extp
- hdmi-mux-supplies: false
+ hdmi-mux-supply: false
- if:
properties:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0724/1756] drm/msm/mdp5: drop cursor pipe for msm8x76
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (722 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0723/1756] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0725/1756] drm/msm/dp: Initialize the debugfs connector pointer Greg Kroah-Hartman
` (274 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
[ Upstream commit c33cee4c07f1533ad48ed8e3eef75df57edf44c1 ]
The MSM8976/56 family of platforms doe't have a separate cursor plane.
Instead the cursor is a part of the LM block. Drop the erroneously added
pipe configuration, letting LM to provide a legacy cursor instead.
Fixes: 1860f2a8b8b1 ("drm/msm/mdp5: Add configuration for msm8x76")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/753150/
Link: https://lore.kernel.org/r/20260914-mdp5-fix-cursor-v1-1-9fba3ace6cb9@oss.qualcomm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
index df464f7c05bfa..97e75c1a0a344 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c
@@ -787,15 +787,6 @@ static const struct mdp5_cfg_hw msm8x76_config = {
MDP_PIPE_CAP_SW_PIX_EXT |
0,
},
- .pipe_cursor = {
- .count = 1,
- .base = { 0x440DC },
- .caps = MDP_PIPE_CAP_HFLIP |
- MDP_PIPE_CAP_VFLIP |
- MDP_PIPE_CAP_SW_PIX_EXT |
- MDP_PIPE_CAP_CURSOR |
- 0,
- },
.lm = {
.count = 2,
.base = { 0x44000, 0x45000 },
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0725/1756] drm/msm/dp: Initialize the debugfs connector pointer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (723 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0724/1756] drm/msm/mdp5: drop cursor pipe for msm8x76 Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0726/1756] staging: sm750fb: free cmap on framebuffer release Greg Kroah-Hartman
` (273 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xilin Wu, Dmitry Baryshkov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xilin Wu <sophon@radxa.com>
[ Upstream commit c2f772ec52898a3f6967d17035da7b739465f81c ]
The debugfs cleanup removed the connector assignment from the debug
context, but the video-pattern test files still dereference that pointer
to check connector status. Reading those files can therefore dereference
NULL.
Store the supplied connector before creating the debugfs files.
Fixes: ab8420418c2e ("drm/msm/dp: cleanup debugfs handling")
Assisted-by: LLM
Signed-off-by: Xilin Wu <sophon@radxa.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757261/
Link: https://lore.kernel.org/r/20260930-msm-dp-hdr10-v1-11-dbbf8b2b42bc@radxa.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/dp/dp_debug.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c
index b8611f6d22967..78f88d80a1472 100644
--- a/drivers/gpu/drm/msm/dp/dp_debug.c
+++ b/drivers/gpu/drm/msm/dp/dp_debug.c
@@ -215,6 +215,7 @@ int dp_debug_init(struct device *dev, struct dp_panel *panel,
debug->link = link;
debug->panel = panel;
+ debug->connector = connector;
debugfs_create_file("dp_debug", 0444, root,
debug, &dp_debug_fops);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0726/1756] staging: sm750fb: free cmap on framebuffer release
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (724 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0725/1756] drm/msm/dp: Initialize the debugfs connector pointer Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0727/1756] OPP: Fix the return value in dev_pm_opp_get_of_node() kernel-doc Greg Kroah-Hartman
` (272 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Lucas Costa,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lucas Costa <2000.costalucas@gmail.com>
[ Upstream commit b7c885194b81a0376d1fdb457eac40d21d6fb65f ]
The cmap is allocated by lynxfb_set_fbinfo() but never freed, so it is
leaked when the framebuffer is torn down. This happens on every unbind,
and on the register_framebuffer() error path in
sm750fb_framebuffer_alloc().
Add a lynxfb_unset_fbinfo() cleanup counterpart to lynxfb_set_fbinfo()
which deallocates the cmap, and call it on teardown. In the alloc error
path it is only called once lynxfb_set_fbinfo() has succeeded, so the
cmap is only freed when it was actually allocated.
Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Lucas Costa <2000.costalucas@gmail.com>
Link: https://patch.msgid.link/20260922142851.46724-1-2000.costalucas@gmail.com
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/sm750fb/sm750.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 2d9eab9ad1171..e84d2114fcd51 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -906,6 +906,11 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
return ret;
}
+static void lynxfb_unset_fbinfo(struct fb_info *info)
+{
+ fb_dealloc_cmap(&info->cmap);
+}
+
/* chip specific g_option configuration routine */
static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
{
@@ -992,6 +997,7 @@ static void sm750fb_framebuffer_release(struct sm750_dev *sm750_dev)
while (sm750_dev->fb_count) {
fb_info = sm750_dev->fbinfo[sm750_dev->fb_count - 1];
unregister_framebuffer(fb_info);
+ lynxfb_unset_fbinfo(fb_info);
framebuffer_release(fb_info);
sm750_dev->fb_count--;
}
@@ -1018,12 +1024,14 @@ static int sm750fb_framebuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
err = register_framebuffer(fb_info);
if (err < 0)
- goto release_fb;
+ goto unset_fb;
sm750_dev->fb_count++;
return 0;
+unset_fb:
+ lynxfb_unset_fbinfo(fb_info);
release_fb:
framebuffer_release(fb_info);
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0727/1756] OPP: Fix the return value in dev_pm_opp_get_of_node() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (725 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0726/1756] staging: sm750fb: free cmap on framebuffer release Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0728/1756] drm/imx/lcdc: avoid duplicate clk_per enable Greg Kroah-Hartman
` (271 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Viresh Kumar,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 706081c6b9327dd611dd72b20130a77f0f059b6e ]
dev_pm_opp_get_of_node() returns NULL when the OPP is invalid, but its
kernel-doc says "else 0 on success", which was never true. Say NULL.
Fixes: e2f4b5f8dc59 ("PM / OPP: Implement dev_pm_opp_get_of_node()")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/opp/of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 286036abf4ca4..c01f142305d22 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -1482,7 +1482,7 @@ bool dev_pm_opp_of_has_required_opp(struct device *dev)
* dev_pm_opp_get_of_node() - Gets the DT node corresponding to an opp
* @opp: opp for which DT node has to be returned for
*
- * Return: DT node corresponding to the opp, else 0 on success.
+ * Return: DT node corresponding to the opp, else NULL.
*
* The caller needs to put the node with of_node_put() after using it.
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0728/1756] drm/imx/lcdc: avoid duplicate clk_per enable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (726 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0727/1756] OPP: Fix the return value in dev_pm_opp_get_of_node() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0729/1756] rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member Greg Kroah-Hartman
` (270 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann, Ze Huang,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ze Huang <ze.huang@oss.qualcomm.com>
[ Upstream commit b08f4d9b21a7846b91bb6c4064f58c3a7ab997c7 ]
The simple-KMS helper calls the pipe update after enabling the CRTC.
On an enable commit, imx_lcdc_pipe_enable() already programs the
mode and enables clk_per. The following pipe update sees the plane move
from no CRTC to the active CRTC, treats it as a mode update, and calls
imx_lcdc_update_hw_registers() again.
That second call has no old CRTC state to disable clk_per first, but it
enables clk_per again at the end. The disable path only drops one
reference, leaving clk_per enabled after each on/off cycle.
Skip the register update from the pipe update path when the CRTC already
needs a modeset. The enable path has already programmed the hardware for
that commit; keep the event handling in pipe update unchanged.
Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25")
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260919-b4-imx-simple-kms-v4-v4-1-53b1fdf4589e@oss.qualcomm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index 36668455aee8c..18954e9d6c087 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -309,7 +309,8 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
else if (old_crtc != crtc)
mode_changed = true;
- imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
+ if (!drm_atomic_crtc_needs_modeset(crtc->state))
+ imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
if (event) {
crtc->state->event = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0729/1756] rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (727 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0728/1756] drm/imx/lcdc: avoid duplicate clk_per enable Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0730/1756] rtc: ftrtc010: fix clock resource leak on probe failure Greg Kroah-Hartman
` (269 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, André Draszik,
Alexandre Belloni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: André Draszik <andre.draszik@linaro.org>
[ Upstream commit a55d44807b63f171f8079d770c9d82fa87046cdd ]
The memory pointed to by the ::rtc_dev member is managed via devres,
and no code in this driver uses it past _probe().
We can drop it from the structure and just use a local temporary
variable, reducing runtime memory consumption by a few bytes.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250304-rtc-cleanups-v2-6-d4689a71668c@linaro.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Stable-dep-of: c60478875a44 ("rtc: ftrtc010: fix clock resource leak on probe failure")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-ftrtc010.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index cb4a5d101f537..02608d3784958 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -28,7 +28,6 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
struct ftrtc010_rtc {
- struct rtc_device *rtc_dev;
void __iomem *rtc_base;
int rtc_irq;
struct clk *pclk;
@@ -113,6 +112,7 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
struct ftrtc010_rtc *rtc;
struct device *dev = &pdev->dev;
struct resource *res;
+ struct rtc_device *rtc_dev;
int ret;
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
@@ -160,29 +160,28 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
goto err_disable_extclk;
}
- rtc->rtc_dev = devm_rtc_allocate_device(dev);
- if (IS_ERR(rtc->rtc_dev)) {
- ret = PTR_ERR(rtc->rtc_dev);
+ rtc_dev = devm_rtc_allocate_device(dev);
+ if (IS_ERR(rtc_dev)) {
+ ret = PTR_ERR(rtc_dev);
goto err_disable_extclk;
}
- rtc->rtc_dev->ops = &ftrtc010_rtc_ops;
+ rtc_dev->ops = &ftrtc010_rtc_ops;
sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND);
min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE);
hour = readl(rtc->rtc_base + FTRTC010_RTC_HOUR);
days = readl(rtc->rtc_base + FTRTC010_RTC_DAYS);
- rtc->rtc_dev->range_min = (u64)days * 86400 + hour * 3600 +
- min * 60 + sec;
- rtc->rtc_dev->range_max = U32_MAX + rtc->rtc_dev->range_min;
+ rtc_dev->range_min = (u64)days * 86400 + hour * 3600 + min * 60 + sec;
+ rtc_dev->range_max = U32_MAX + rtc_dev->range_min;
ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
IRQF_SHARED, pdev->name, dev);
if (unlikely(ret))
goto err_disable_extclk;
- return devm_rtc_register_device(rtc->rtc_dev);
+ return devm_rtc_register_device(rtc_dev);
err_disable_extclk:
clk_disable_unprepare(rtc->extclk);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0730/1756] rtc: ftrtc010: fix clock resource leak on probe failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (728 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0729/1756] rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0731/1756] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Greg Kroah-Hartman
` (268 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Liu Dalin, Linus Walleij,
Alexandre Belloni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Dalin <liudalin@kylinsec.com.cn>
[ Upstream commit c60478875a445dee1206aad6285c18cd8c91f7f2 ]
When devm_rtc_register_device() fails, ftrtc010_rtc_probe() returns
the error directly without releasing clocks obtained via
clk_prepare_enable(). This leaks both extclk and pclk resources,
which may prevent subsequent probe attempts or module removal.
Capture the return value and jump to the error handling path to
properly release clocks via clk_disable_unprepare().
Fixes smatch warnings:
- drivers/rtc/rtc-ftrtc010.c:189 ftrtc010_rtc_probe() warn:
'rtc->extclk' from clk_prepare_enable() not released on lines: 183.
- drivers/rtc/rtc-ftrtc010.c:189 ftrtc010_rtc_probe() warn:
'rtc->pclk' from clk_prepare_enable() not released on lines: 183.
Fixes: fdcfd854333b ("rtc: rework rtc_register_device() resource management")
Assisted-by: smatch:2.0 [static analysis]
Signed-off-by: Liu Dalin <liudalin@kylinsec.com.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Tested-by: Liu Dalin <liudalin@kylinsec.com.cn>
Link: https://patch.msgid.link/AC51B5F2C5FFEBB0+20260827080320.3351155-2-liudalin@kylinsec.com.cn
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-ftrtc010.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index 02608d3784958..f398d6dc85ae4 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -181,7 +181,11 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
if (unlikely(ret))
goto err_disable_extclk;
- return devm_rtc_register_device(rtc_dev);
+ ret = devm_rtc_register_device(rtc_dev);
+ if (ret)
+ goto err_disable_extclk;
+
+ return 0;
err_disable_extclk:
clk_disable_unprepare(rtc->extclk);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0731/1756] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (729 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0730/1756] rtc: ftrtc010: fix clock resource leak on probe failure Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0732/1756] ARM: vexpress: fix device_node refcount leak in vexpress_flags_set() Greg Kroah-Hartman
` (267 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Liu Dalin, Linus Walleij,
Alexandre Belloni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Dalin <liudalin@kylinsec.com.cn>
[ Upstream commit d41ee317c9907d714014d0d5e4726fbd6acf338e ]
The driver mixes devm_rtc_register_device() with manual clock
disabling in ftrtc010_rtc_remove(). Because the RTC device was
registered via devm, it remains registered until devres cleanup
runs after .remove() returns. An unprivileged process holding an
open /dev/rtc0 file descriptor could issue ioctl(RTC_RD_TIME)
during this window, triggering MMIO reads on clock-gated hardware
and causing a synchronous external abort.
Replace devm_clk_get() + clk_prepare_enable() with
devm_clk_get_enabled() to tie clock lifecycle to devres. Remove
the manual .remove() callback and the corresponding error handling
labels in ftrtc010_rtc_probe().
Fixes: 1d61d2592c1f ("rtc: ftrtc010: Rename to Faraday FTRTC010")
Assisted-by: Sashiko AI [static analysis]
Signed-off-by: Liu Dalin <liudalin@kylinsec.com.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Tested-by: Liu Dalin <liudalin@kylinsec.com.cn>
Link: https://patch.msgid.link/0238203A74C9B9F6+20260827080320.3351155-3-liudalin@kylinsec.com.cn
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-ftrtc010.c | 67 +++++++++-----------------------------
1 file changed, 16 insertions(+), 51 deletions(-)
diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index f398d6dc85ae4..2f610a0fc6e9b 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -120,51 +120,33 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, rtc);
- rtc->pclk = devm_clk_get(dev, "PCLK");
- if (IS_ERR(rtc->pclk)) {
+ rtc->pclk = devm_clk_get_enabled(dev, "PCLK");
+ if (IS_ERR_OR_NULL(rtc->pclk)) {
dev_err(dev, "could not get PCLK\n");
- } else {
- ret = clk_prepare_enable(rtc->pclk);
- if (ret) {
- dev_err(dev, "failed to enable PCLK\n");
- return ret;
- }
+ return PTR_ERR_OR_ZERO(rtc->pclk);
}
- rtc->extclk = devm_clk_get(dev, "EXTCLK");
- if (IS_ERR(rtc->extclk)) {
+ rtc->extclk = devm_clk_get_enabled(dev, "EXTCLK");
+ if (IS_ERR_OR_NULL(rtc->extclk)) {
dev_err(dev, "could not get EXTCLK\n");
- } else {
- ret = clk_prepare_enable(rtc->extclk);
- if (ret) {
- dev_err(dev, "failed to enable EXTCLK\n");
- goto err_disable_pclk;
- }
+ return PTR_ERR_OR_ZERO(rtc->extclk);
}
rtc->rtc_irq = platform_get_irq(pdev, 0);
- if (rtc->rtc_irq < 0) {
- ret = rtc->rtc_irq;
- goto err_disable_extclk;
- }
+ if (rtc->rtc_irq < 0)
+ return rtc->rtc_irq;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- ret = -ENODEV;
- goto err_disable_extclk;
- }
+ if (!res)
+ return -ENODEV;
rtc->rtc_base = devm_ioremap(dev, res->start,
resource_size(res));
- if (!rtc->rtc_base) {
- ret = -ENOMEM;
- goto err_disable_extclk;
- }
+ if (!rtc->rtc_base)
+ return -ENOMEM;
rtc_dev = devm_rtc_allocate_device(dev);
- if (IS_ERR(rtc_dev)) {
- ret = PTR_ERR(rtc_dev);
- goto err_disable_extclk;
- }
+ if (IS_ERR(rtc_dev))
+ return PTR_ERR(rtc_dev);
rtc_dev->ops = &ftrtc010_rtc_ops;
@@ -179,29 +161,13 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, rtc->rtc_irq, ftrtc010_rtc_interrupt,
IRQF_SHARED, pdev->name, dev);
if (unlikely(ret))
- goto err_disable_extclk;
+ return ret;
ret = devm_rtc_register_device(rtc_dev);
if (ret)
- goto err_disable_extclk;
+ return ret;
return 0;
-
-err_disable_extclk:
- clk_disable_unprepare(rtc->extclk);
-err_disable_pclk:
- clk_disable_unprepare(rtc->pclk);
- return ret;
-}
-
-static void ftrtc010_rtc_remove(struct platform_device *pdev)
-{
- struct ftrtc010_rtc *rtc = platform_get_drvdata(pdev);
-
- if (!IS_ERR(rtc->extclk))
- clk_disable_unprepare(rtc->extclk);
- if (!IS_ERR(rtc->pclk))
- clk_disable_unprepare(rtc->pclk);
}
static const struct of_device_id ftrtc010_rtc_dt_match[] = {
@@ -217,7 +183,6 @@ static struct platform_driver ftrtc010_rtc_driver = {
.of_match_table = ftrtc010_rtc_dt_match,
},
.probe = ftrtc010_rtc_probe,
- .remove = ftrtc010_rtc_remove,
};
module_platform_driver_probe(ftrtc010_rtc_driver, ftrtc010_rtc_probe);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0732/1756] ARM: vexpress: fix device_node refcount leak in vexpress_flags_set()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (730 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0731/1756] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0733/1756] ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus() Greg Kroah-Hartman
` (266 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Weigang He, Liviu Dudau,
Sudeep Holla, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weigang He <geoffreyhe2@gmail.com>
[ Upstream commit 62b9ae8ae4a7f0b93efa1efa230782b37057b1e7 ]
vexpress_flags_set() obtains a reference to the "arm,vexpress-sysreg"
device node via of_find_compatible_node() and passes it to of_iomap(),
but never calls of_node_put() on it. of_iomap() only reads the node's
reg property to create the mapping and does not take ownership, so the
node reference is leaked. The function runs from the __init SMP prepare
path and caches the mapping in a static, so this is a one-shot leak of a
single refcount during boot, with no functional impact.
The lookup was added to drivers/mfd/vexpress-sysreg.c by the commit
below and later moved here by commit 9b06fc39084e ("ARM: vexpress: Move
vexpress_flags_set() into arch code").
Annotate node with the __free(device_node) cleanup attribute so the
reference is released when it goes out of scope.
Found by static analysis tool CodeQL.
Fixes: 974cc7b93441 ("mfd: vexpress: Define the device as MFD cells")
Assisted-by: LLM codeql
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260925173252.933705-2-geoffreyhe2@gmail.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-versatile/v2m.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-versatile/v2m.c b/arch/arm/mach-versatile/v2m.c
index 79afdf2a90b6f..c86b38386cf7c 100644
--- a/arch/arm/mach-versatile/v2m.c
+++ b/arch/arm/mach-versatile/v2m.c
@@ -13,8 +13,8 @@ void vexpress_flags_set(u32 data)
static void __iomem *base;
if (!base) {
- struct device_node *node = of_find_compatible_node(NULL, NULL,
- "arm,vexpress-sysreg");
+ struct device_node *node __free(device_node) =
+ of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg");
base = of_iomap(node, 0);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0733/1756] ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (731 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0732/1756] ARM: vexpress: fix device_node refcount leak in vexpress_flags_set() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0734/1756] arm64: dts: st: fix sai3b unit address on stm32mp231 Greg Kroah-Hartman
` (265 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Weigang He, Liviu Dudau,
Sudeep Holla, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weigang He <geoffreyhe2@gmail.com>
[ Upstream commit 27b98d331f1dcebe088ab51a7061a387a7440cb2 ]
vexpress_smp_dt_prepare_cpus() obtains a reference to the SCU device
node via of_find_matching_node() and passes it to of_iomap(), but never
calls of_node_put() on it. of_iomap() does not take ownership of the
node, so the reference is leaked. The function is the .smp_prepare_cpus
hook invoked once from the __init SMP bring-up path, so this is a
one-shot leak of a single refcount during boot, with no functional
impact.
Annotate scu with the __free(device_node) cleanup attribute so the
reference is released when the function returns.
Found while reviewing a CodeQL report for vexpress_flags_set() on the
same SMP bring-up path.
Fixes: d2606f81d563 ("ARM: vexpress: Simplify SMP operations for DT-powered system")
Assisted-by: LLM codeql
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260925173252.933705-3-geoffreyhe2@gmail.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-versatile/platsmp-vexpress.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-versatile/platsmp-vexpress.c b/arch/arm/mach-versatile/platsmp-vexpress.c
index 1ee3c45e71c99..b810ad50b98ce 100644
--- a/arch/arm/mach-versatile/platsmp-vexpress.c
+++ b/arch/arm/mach-versatile/platsmp-vexpress.c
@@ -61,8 +61,8 @@ static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = {
static void __init vexpress_smp_dt_prepare_cpus(unsigned int max_cpus)
{
- struct device_node *scu = of_find_matching_node(NULL,
- vexpress_smp_dt_scu_match);
+ struct device_node *scu __free(device_node) =
+ of_find_matching_node(NULL, vexpress_smp_dt_scu_match);
if (scu)
scu_enable(of_iomap(scu, 0));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0734/1756] arm64: dts: st: fix sai3b unit address on stm32mp231
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (732 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0733/1756] ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0735/1756] seg6: fix HMAC validation when an extension header precedes the SRH Greg Kroah-Hartman
` (264 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mateusz Nowicki, Alexandre Torgue,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mateusz Nowicki <mateusz.nowicki@posteo.net>
[ Upstream commit 4b14dbc4c636e760f5db5a2e4e1b4589d484a7d2 ]
The unit address of the sai3b node, 502b0024, is the address of the
SAI_BCR1 register in the secure alias of SAI3. The reg property of the
node translates to the non-secure address 0x402b0024, which all other
SAI nodes use. Fix the unit address to match.
Fixes: e9b03ef21386 ("arm64: dts: st: introduce stm32mp23 SoCs family")
Signed-off-by: Mateusz Nowicki <mateusz.nowicki@posteo.net>
Link: https://lore.kernel.org/r/20260924193759.27881-3-mateusz.nowicki@posteo.net
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/st/stm32mp231.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/st/stm32mp231.dtsi b/arch/arm64/boot/dts/st/stm32mp231.dtsi
index 39f67d80c3645..ec03993c4135d 100644
--- a/arch/arm64/boot/dts/st/stm32mp231.dtsi
+++ b/arch/arm64/boot/dts/st/stm32mp231.dtsi
@@ -557,7 +557,7 @@ sai3a: audio-controller@402b0004 {
status = "disabled";
};
- sai3b: audio-controller@502b0024 {
+ sai3b: audio-controller@402b0024 {
compatible = "st,stm32-sai-sub-b";
reg = <0x24 0x20>;
#sound-dai-cells = <0>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0735/1756] seg6: fix HMAC validation when an extension header precedes the SRH
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (733 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0734/1756] arm64: dts: st: fix sai3b unit address on stm32mp231 Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0736/1756] amt: pull the AMT header behind the transport header in amt_parse_type() Greg Kroah-Hartman
` (263 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuya Kusakabe, Andrea Mayer,
Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuya Kusakabe <yuya.kusakabe@gmail.com>
[ Upstream commit f9cb4d296d81adb0923546ca5d54fae57a81af52 ]
seg6_hmac_validate_skb() derived the SRH from skb_transport_header().
That only holds while the two coincide, which is not true on the
seg6_local input path.
ip6_rcv_core() leaves the transport header just past the IPv6 header.
A Hop-by-Hop options header is consumed before the route lookup and
advances it, but a Destination Options header is not: the seg6_local
lwtunnel is entered through an input redirect from the route lookup,
which bypasses the extension header handlers. The transport header
then still points at the Destination Options header while
seg6_get_srh() has located the real SRH further down the chain.
The HMAC is therefore computed over the Destination Options header,
and a packet carrying a valid HMAC TLV is dropped when
seg6_require_hmac is set. Such a packet is legitimate: RFC 8200 allows
Destination Options before a routing header, and get_srh() has walked
the header chain since commit 5829d70b0b6c ("ipv6: sr: fix get_srh() to
comply with IPv6 standard "RFC 8200"").
With a Fragment or an Authentication header in front of the SRH, the
same mistake also reads past the data pulled by seg6_get_srh(). This
happens before seg6_require_hmac is read, so the default configuration
is affected.
Reproduce by giving a node a seg6local End SID with
net.ipv6.conf.<dev>.seg6_require_hmac=1 and a key installed with
"ip sr hmac set <keyid> sha1", then sending
IPv6 -> Destination Options -> SRH (carrying a valid HMAC TLV) -> payload
to that SID: it is dropped, while the same packet without the
Destination Options header passes.
Fixes: 5829d70b0b6c ("ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"")
Assisted-by: LLM
Signed-off-by: Yuya Kusakabe <yuya.kusakabe@gmail.com>
Reviewed-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Link: https://patch.msgid.link/20260926-b4-seg6-hmac-transport-header-v2-1-8087b76f6375@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/seg6_hmac.h | 3 ++-
net/ipv6/exthdrs.c | 2 +-
net/ipv6/seg6_hmac.c | 5 +----
net/ipv6/seg6_local.c | 6 +++---
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/include/net/seg6_hmac.h b/include/net/seg6_hmac.h
index 24f733b3e3fe9..0544e0595ff5d 100644
--- a/include/net/seg6_hmac.h
+++ b/include/net/seg6_hmac.h
@@ -48,7 +48,8 @@ extern int seg6_hmac_info_add(struct net *net, u32 key,
extern int seg6_hmac_info_del(struct net *net, u32 key);
extern int seg6_push_hmac(struct net *net, struct in6_addr *saddr,
struct ipv6_sr_hdr *srh);
-extern bool seg6_hmac_validate_skb(struct sk_buff *skb);
+extern bool seg6_hmac_validate_skb(struct sk_buff *skb,
+ struct ipv6_sr_hdr *srh);
#ifdef CONFIG_IPV6_SEG6_HMAC
extern int seg6_hmac_init(void);
extern void seg6_hmac_exit(void);
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 5d1e98ae18187..c4c541b1ef5d8 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -390,7 +390,7 @@ static int ipv6_srh_rcv(struct sk_buff *skb, struct inet6_dev *idev)
}
#ifdef CONFIG_IPV6_SEG6_HMAC
- if (!seg6_hmac_validate_skb(skb)) {
+ if (!seg6_hmac_validate_skb(skb, hdr)) {
kfree_skb(skb);
return -1;
}
diff --git a/net/ipv6/seg6_hmac.c b/net/ipv6/seg6_hmac.c
index 214d137d545e7..fe3f12c2e6d9e 100644
--- a/net/ipv6/seg6_hmac.c
+++ b/net/ipv6/seg6_hmac.c
@@ -234,13 +234,12 @@ EXPORT_SYMBOL(seg6_hmac_compute);
*
* called with rcu_read_lock()
*/
-bool seg6_hmac_validate_skb(struct sk_buff *skb)
+bool seg6_hmac_validate_skb(struct sk_buff *skb, struct ipv6_sr_hdr *srh)
{
u8 hmac_output[SEG6_HMAC_FIELD_LEN];
struct net *net = dev_net(skb->dev);
struct seg6_hmac_info *hinfo;
struct sr6_tlv_hmac *tlv;
- struct ipv6_sr_hdr *srh;
struct inet6_dev *idev;
int require_hmac;
@@ -248,8 +247,6 @@ bool seg6_hmac_validate_skb(struct sk_buff *skb)
if (!idev)
return false;
- srh = (struct ipv6_sr_hdr *)skb_transport_header(skb);
-
tlv = seg6_get_tlv_hmac(srh);
require_hmac = READ_ONCE(idev->cnf.seg6_require_hmac);
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 191b99b073b06..9259b2d2da059 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -222,7 +222,7 @@ static struct ipv6_sr_hdr *get_and_validate_srh(struct sk_buff *skb)
return NULL;
#ifdef CONFIG_IPV6_SEG6_HMAC
- if (!seg6_hmac_validate_skb(skb))
+ if (!seg6_hmac_validate_skb(skb, srh))
return NULL;
#endif
@@ -239,7 +239,7 @@ static bool decap_and_validate(struct sk_buff *skb, int proto)
return false;
#ifdef CONFIG_IPV6_SEG6_HMAC
- if (srh && !seg6_hmac_validate_skb(skb))
+ if (srh && !seg6_hmac_validate_skb(skb, srh))
return false;
#endif
@@ -768,7 +768,7 @@ static int end_flv8986_core(struct sk_buff *skb, struct seg6_local_lwt *slwt)
srhoff = srh ? ((unsigned char *)srh - skb->data) : 0;
pinfo = seg6_get_srh_pktinfo(srh);
#ifdef CONFIG_IPV6_SEG6_HMAC
- if (srh && !seg6_hmac_validate_skb(skb))
+ if (srh && !seg6_hmac_validate_skb(skb, srh))
goto drop;
#endif
flvmask = finfo->flv_ops;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0736/1756] amt: pull the AMT header behind the transport header in amt_parse_type()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (734 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0735/1756] seg6: fix HMAC validation when an extension header precedes the SRH Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0737/1756] misc: enclosure: fix UAF on device_register() failure Greg Kroah-Hartman
` (262 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Omar Ramadan, Eric Dumazet,
Paolo Abeni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Ramadan <omar@blockcast.net>
[ Upstream commit eb0c18404c8943356f4aa164e5db9067b79ea93c ]
A gateway's encap socket passes ICMP errors to amt_err_lookup(), which
calls amt_parse_type() on the quoted datagram to see which AMT message
failed. On that path skb->data points at the quoted IP header and the
transport header at the quoted UDP header, and icmp_socket_deliver()
only guarantees the quoted IP header plus 8 bytes, that is, up to the
end of the UDP header.
amt_parse_type() pulls sizeof(struct udphdr) + sizeof(struct amt_header)
bytes from skb->data, which on this path stays inside the quoted IP
header, and then reads the AMT header behind udp_hdr(skb). An ICMP error
that quotes only the IP and UDP headers of a Request, the minimum RFC 792
asks for, therefore makes it read past the pulled data, and past the end
of the packet when nothing follows.
Pull up to the transport header plus the UDP and AMT headers, as
vxlan_err_lookup() does. amt_rcv() is called with the transport header
at skb->data, so the pull on the receive path does not change.
Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface")
Signed-off-by: Omar Ramadan <omar@blockcast.net>
Reviewed-by: Eric Dumazet <edumazet@@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20260928181557.85796-1-omar@blockcast.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/amt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 54199c3babccb..a4255eb000840 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -1284,8 +1284,12 @@ static int amt_parse_type(struct sk_buff *skb)
{
struct amt_header *amth;
- if (!pskb_may_pull(skb, sizeof(struct udphdr) +
- sizeof(struct amt_header)))
+ /* skb->data is the UDP header on receive, but the quoted IP header
+ * when amt_err_lookup() parses an ICMP error, so pull up to the
+ * transport header rather than from skb->data.
+ */
+ if (!pskb_may_pull(skb, skb_transport_offset(skb) +
+ sizeof(struct udphdr) + sizeof(struct amt_header)))
return -1;
amth = (struct amt_header *)(udp_hdr(skb) + 1);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0737/1756] misc: enclosure: fix UAF on device_register() failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (735 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0736/1756] amt: pull the AMT header behind the transport header in amt_parse_type() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0738/1756] misc: nsm: mark device ready before registering the hwrng and misc device Greg Kroah-Hartman
` (261 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linkai Gong, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <gonglinkai@kylinos.cn>
[ Upstream commit 0f3b12bab74e13a2b8686a49c5b83099da61e032 ]
After device_register() fails, the embedded struct device has already been
initialized and must be released with put_device() so that
enclosure_release() can drop the parent reference and free edev.
The error path currently does put_device(parent) + kfree(edev), which
skips the device lifetime rules and can free the object while the device
core still owns a reference (use-after-free).
Fixes: d569d5bb3fd9 ("[SCSI] enclosure: add support for enclosure services")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Link: https://patch.msgid.link/20260806070358.1599627-1-gonglinkai@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/misc/enclosure.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 76511d279aff8..7cc0505f694af 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -147,8 +147,7 @@ enclosure_register(struct device *dev, const char *name, int components,
return edev;
err:
- put_device(edev->edev.parent);
- kfree(edev);
+ put_device(&edev->edev);
return ERR_PTR(err);
}
EXPORT_SYMBOL_GPL(enclosure_register);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0738/1756] misc: nsm: mark device ready before registering the hwrng and misc device
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (736 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0737/1756] misc: enclosure: fix UAF on device_register() failure Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0739/1756] misc: nsm: fix CBOR short-length decoding Greg Kroah-Hartman
` (260 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jasper Wise, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jasper Wise <jaspwise@amazon.co.uk>
[ Upstream commit e15596e84c818a2b727d2a7cf742a29331e44c43 ]
nsm_device_probe() registers an hwrng provider and /dev/nsm.
hwrng_register() can make this the current RNG, and the hwrng fill kthread
finds it through the RCU-protected get_current_rng() rather than under the
rng_mutex that hwrng_register() holds, so it can be in nsm_rng_read()
offering buffers and kicking the queue before probe has returned.
The driver never calls virtio_device_ready(), so DRIVER_OK is set on its
behalf by virtio_dev_probe(), only once probe has returned. The virtio
spec is explicit about that ordering in 3.1 Device Initialization:
| The driver MUST NOT send any buffer available notifications to the
| device before setting DRIVER_OK.
A device that waits for DRIVER_OK before servicing the queue therefore
leaves that read unanswered.
Set DRIVER_OK once the virtqueue exists and before either interface is
registered, so that the queue is usable by the time anything that can reach
it is published; commit f5866db64f34 ("virtio_console: enable VQs early")
and commit 1d774589f924 ("i2c: virtio: mark device ready before registering
the adapter") do the same for the same reason. The err_hwrng and err_misc
paths then unwind a device that is live, so reset it before deleting the
virtqueue - the core only adds VIRTIO_CONFIG_S_FAILED to the status when
probe fails, it does not reset.
Fixes: b9873755a6c8 ("misc: Add Nitro Secure Module driver")
Signed-off-by: Jasper Wise <jaspwise@amazon.co.uk>
Link: https://patch.msgid.link/20260813083752.581981-1-jaspwise@amazon.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/misc/nsm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/misc/nsm.c b/drivers/misc/nsm.c
index c3b474450d159..ba43946b9e39a 100644
--- a/drivers/misc/nsm.c
+++ b/drivers/misc/nsm.c
@@ -440,6 +440,8 @@ static int nsm_device_probe(struct virtio_device *vdev)
mutex_init(&nsm->lock);
+ virtio_device_ready(vdev);
+
/* Register as hwrng provider */
nsm->hwrng = (struct hwrng) {
.read = nsm_rng_read,
@@ -472,6 +474,7 @@ static int nsm_device_probe(struct virtio_device *vdev)
err_misc:
hwrng_unregister(&nsm->hwrng);
err_hwrng:
+ virtio_reset_device(vdev);
vdev->config->del_vqs(vdev);
err_init_vq:
return rc;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0739/1756] misc: nsm: fix CBOR short-length decoding
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (737 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0738/1756] misc: nsm: mark device ready before registering the hwrng and misc device Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0740/1756] debugfs: make debugfs_create_str() read-only Greg Kroah-Hartman
` (259 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ruoyu Wang, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <ruoyuw560@gmail.com>
[ Upstream commit 6edddc1d101bfd5cafc94ca2dffaf13e4394662d ]
CBOR encodes byte-string lengths from 0 through 23 directly in the
additional-information field. cbor_object_get_array() only handles 23,
so shorter byte strings leave array_len uninitialized. Reserved values
28 through 30 and the unsupported indefinite-length encoding also fall
through without assigning it.
parse_resp_get_random() then uses the indeterminate value for bounds
checking and as the byte count returned to the hwrng core. This can
reject a valid short response or report an incorrect amount of entropy.
Decode the complete inline-length range and reject unsupported values.
Extended definite-length encodings retain their existing behavior, and
the existing size and INT_MAX checks continue to bound the returned
slice.
This issue was found by a static analysis checker and confirmed by
manual source review.
Fixes: b9873755a6c8 ("misc: Add Nitro Secure Module driver")
Assisted-by: unnamed:claude-opus-4.8 typestate
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Link: https://patch.msgid.link/20260815151745.3758574-1-ruoyuw560@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/misc/nsm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/nsm.c b/drivers/misc/nsm.c
index ba43946b9e39a..d303f48af2bdb 100644
--- a/drivers/misc/nsm.c
+++ b/drivers/misc/nsm.c
@@ -117,7 +117,7 @@ static int cbor_object_get_array(u8 *cbor_object, size_t cbor_object_size, u8 **
array_len_p = &cbor_object[1];
switch (cbor_short_size) {
- case CBOR_SHORT_SIZE_MAX_VALUE: /* short encoding */
+ case 0 ... CBOR_SHORT_SIZE_MAX_VALUE: /* short encoding */
array_len = cbor_short_size;
break;
case CBOR_LONG_SIZE_U8:
@@ -132,6 +132,8 @@ static int cbor_object_get_array(u8 *cbor_object, size_t cbor_object_size, u8 **
case CBOR_LONG_SIZE_U64:
array_len = be64_to_cpup((__be64 *)array_len_p);
break;
+ default:
+ return -EFAULT;
}
if (cbor_object_size < array_offset)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0740/1756] debugfs: make debugfs_create_str() read-only
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (738 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0739/1756] misc: nsm: fix CBOR short-length decoding Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0741/1756] ASoC: rt712: avoid duplicate reset in io_init Greg Kroah-Hartman
` (258 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yichong Chen, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yichong Chen <chenyichong@uniontech.com>
[ Upstream commit 5ec78be9552035e1e71de218f968c03c44181bf0 ]
debugfs_create_str() supports replacing the backing string from userspace.
Concurrent writers can race and free the same old string twice.
All writable in-tree users have been converted to local file operations.
Remove the generic write support from debugfs_create_str(), and refuse to
create a file when the caller passes write permission bits.
This makes unsupported writable use visible instead of silently creating a
file with different permissions.
Fixes: 86b5488121db ("debugfs: Add write support to debugfs_create_str()")
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Link: https://patch.msgid.link/20260807100053.1089834-4-chenyichong@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/debugfs/file.c | 81 ++++++-----------------------------------------
1 file changed, 10 insertions(+), 71 deletions(-)
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index cc9587a1c9a9f..b1940faa4020d 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -992,98 +992,37 @@ ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf,
return ret;
}
-static ssize_t debugfs_write_file_str(struct file *file, const char __user *user_buf,
- size_t count, loff_t *ppos)
-{
- struct dentry *dentry = F_DENTRY(file);
- char *old, *new = NULL;
- int pos = *ppos;
- int r;
-
- r = debugfs_file_get(dentry);
- if (unlikely(r))
- return r;
-
- old = *(char **)file->private_data;
-
- /* only allow strict concatenation */
- r = -EINVAL;
- if (pos && pos != strlen(old))
- goto error;
-
- r = -E2BIG;
- if (pos + count + 1 > PAGE_SIZE)
- goto error;
-
- r = -ENOMEM;
- new = kmalloc(pos + count + 1, GFP_KERNEL);
- if (!new)
- goto error;
-
- if (pos)
- memcpy(new, old, pos);
-
- r = -EFAULT;
- if (copy_from_user(new + pos, user_buf, count))
- goto error;
-
- new[pos + count] = '\0';
- strim(new);
-
- rcu_assign_pointer(*(char __rcu **)file->private_data, new);
- synchronize_rcu();
- kfree(old);
-
- debugfs_file_put(dentry);
- return count;
-
-error:
- kfree(new);
- debugfs_file_put(dentry);
- return r;
-}
-
static const struct file_operations fops_str = {
.read = debugfs_read_file_str,
- .write = debugfs_write_file_str,
- .open = simple_open,
- .llseek = default_llseek,
-};
-
-static const struct file_operations fops_str_ro = {
- .read = debugfs_read_file_str,
- .open = simple_open,
- .llseek = default_llseek,
-};
-
-static const struct file_operations fops_str_wo = {
- .write = debugfs_write_file_str,
.open = simple_open,
.llseek = default_llseek,
};
/**
- * debugfs_create_str - create a debugfs file that is used to read and write a string value
+ * debugfs_create_str - create a debugfs file that is used to read a string value
* @name: a pointer to a string containing the name of the file to create.
* @mode: the permission that the file should have
* @parent: a pointer to the parent dentry for this file. This should be a
* directory dentry if set. If this parameter is %NULL, then the
* file will be created in the root of the debugfs filesystem.
- * @value: a pointer to the variable that the file should read to and write
- * from. This pointer and the string it points to must not be %NULL.
+ * @value: a pointer to the variable that the file should read from. This
+ * pointer and the string it points to must not be %NULL.
*
* This function creates a file in debugfs with the given name that
- * contains the value of the variable @value. If the @mode variable is so
- * set, it can be read from, and written to.
+ * contains the value of the variable @value. The file can be read from.
+ * Writable files are not supported; if @mode contains write permission bits,
+ * no file is created.
*/
void debugfs_create_str(const char *name, umode_t mode,
struct dentry *parent, char **value)
{
if (WARN_ON(!value || !*value))
return;
+ if (WARN(mode & 0222,
+ "%s() does not support writable files\n", __func__))
+ return;
- debugfs_create_mode_unsafe(name, mode, parent, value, &fops_str,
- &fops_str_ro, &fops_str_wo);
+ debugfs_create_file_unsafe(name, mode, parent, value, &fops_str);
}
EXPORT_SYMBOL_GPL(debugfs_create_str);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0741/1756] ASoC: rt712: avoid duplicate reset in io_init
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (739 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0740/1756] debugfs: make debugfs_create_str() read-only Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0742/1756] perf trace: Copy sockaddr arguments by their length Greg Kroah-Hartman
` (257 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shuming Fan, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuming Fan <shumingf@realtek.com>
[ Upstream commit 923ff8155ef6e83b73b852300d50f2053b969552 ]
The codec should be reset only once during io_init, regardless of
whether the system performs a warm or cold reboot.
Fixes: 4c9854ad3cdc ("ASoC: rt712-sdca: reset codec at io_init to fix silent headphone")
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20261001090219.797880-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt712-sdca.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt712-sdca.c b/sound/soc/codecs/rt712-sdca.c
index f48ebdf6b6226..69db35e47a328 100644
--- a/sound/soc/codecs/rt712-sdca.c
+++ b/sound/soc/codecs/rt712-sdca.c
@@ -1834,7 +1834,8 @@ int rt712_sdca_io_init(struct device *dev, struct sdw_slave *slave)
pm_runtime_get_noresume(&slave->dev);
- rt712_sdca_reset(rt712);
+ if (!rt712->first_hw_init)
+ rt712_sdca_reset(rt712);
rt712_sdca_index_read(rt712, RT712_VENDOR_REG, RT712_JD_PRODUCT_NUM, &val);
rt712->hw_id = (val & 0xf000) >> 12;
@@ -1858,7 +1859,7 @@ int rt712_sdca_io_init(struct device *dev, struct sdw_slave *slave)
* if set_jack callback occurred early than io_init,
* we set up the jack detection function now
*/
- if (rt712->hs_jack)
+ if (rt712->hs_jack && (!rt712->first_hw_init))
rt712_sdca_jack_init(rt712);
rt712_sdca_index_write(rt712, RT712_VENDOR_REG, RT712_SW_CONFIG1, 0x0001);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0742/1756] perf trace: Copy sockaddr arguments by their length
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (740 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0741/1756] ASoC: rt712: avoid duplicate reset in io_init Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0743/1756] perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h Greg Kroah-Hartman
` (256 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Arnaldo Carvalho de Melo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 1c443dfc3202048b2cb1d3c2534b39b28701e929 ]
The BTF augmenter copies sizeof(struct sockaddr), 16 bytes, for the
sockaddr arguments of connect, bind and sendto, and runs before the
sys_enter_connect and sys_enter_sendto programs that copy their length.
An IPv6 address needs 24 or 28 bytes, so the rest was read from past the
payload, and now that the printers are bounded only its family is shown.
Copy them as buffers sized by the length argument after them, up to the
32 bytes augmented buffers are limited to. That holds an IPv6 address
and doubles the AF_LOCAL path shown.
Committer testing:
Is using BPF:
root@x2:~# strace -e bpf perf trace -e connect,bind |& head -5
bpf(BPF_TOKEN_CREATE, {token_create={flags=0, bpffs_fd=12}}, 8) = -1 EOPNOTSUPP (Operation not supported)
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffea3054260, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, core_relo_cnt=0, fd_array=NULL, core_relos=NULL, core_relo_rec_size=0, log_true_size=0, prog_token_fd=0}, 148) = 12
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffea3054390, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, core_relo_cnt=0, fd_array=NULL, core_relos=NULL, core_relo_rec_size=0, log_true_size=0, prog_token_fd=0, fd_array_cnt=0, signature=NULL, signature_size=0, keyring_id=0}, 168) = 12
bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffea3053f80, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="libbpf_nametest", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, core_relo_cnt=0, fd_array=NULL, core_relos=NULL, core_relo_rec_size=0, log_true_size=0, prog_token_fd=0}, 148) = 12
bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=4, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="libbpf_mmap", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0, value_type_btf_obj_fd=0, map_token_fd=0, excl_prog_hash=NULL, excl_prog_hash_size=0}, 92) = 12
root@x2:~#
And btf:
root@x2:~# strace -e openat perf trace -e connect,bind |& grep "/sys/kernel/btf/vmlinux"
openat(AT_FDCWD, "/sys/kernel/btf/vmlinux", O_RDONLY) = 12
^C
root@x2:~#
And copying the sockaddr parameters according to its addrlen or the cap
in the augmented bpf, that probably needs to be a bit bigger for local
sockets:
⬢ [acme@toolbx perf-tools-next]$ echo -n /var/run/.heim_org.h5l.kcm-soc | wc -c
30
⬢ [acme@toolbx perf-tools-next]$ ls -la /var/run/.heim_org.h5l.kcm-socket
srw-rw-rw-. 1 nobody nobody 0 Sep 14 23:13 /var/run/.heim_org.h5l.kcm-socket
⬢ [acme@toolbx perf-tools-next]$
root@x2:~# perf trace -e connect,bind --max-events 10
0.000 ( 0.717 ms): pool-0/29901 connect(fd: 9, uservaddr: { .family: LOCAL, path: /var/run/.heim_org.h5l.kcm-soc }, addrlen: 110) = 0
3.733 ( 0.059 ms): pool-0/29901 connect(fd: 10, uservaddr: { .family: LOCAL, path: /var/run/.heim_org.h5l.kcm-soc }, addrlen: 110) = 0
8.859 ( 0.054 ms): pool-0/29901 connect(fd: 9, uservaddr: { .family: LOCAL, path: /var/run/.heim_org.h5l.kcm-soc }, addrlen: 110) = 0
10.880 ( 0.053 ms): pool-0/29901 connect(fd: 9, uservaddr: { .family: LOCAL, path: /var/run/.heim_org.h5l.kcm-soc }, addrlen: 110) = 0
1225.303 ( 0.081 ms): systemd-resolv/103685 connect(fd: 30, uservaddr: { .family: INET6, port: 53, addr: fd55:6f31:c26b::1, scope_id: 4 }, addrlen: 28) = 0
1226.000 ( 0.046 ms): systemd-resolv/103685 connect(fd: 31, uservaddr: { .family: INET6, port: 53, addr: fd55:6f31:c26b::1, scope_id: 4 }, addrlen: 28) = 0
1371.972 ( 0.055 ms): systemd-resolv/103685 connect(fd: 27, uservaddr: { .family: INET6, port: 53, addr: fd55:6f31:c26b::1, scope_id: 4 }, addrlen: 28) = 0
1382.266 ( 0.260 ms): Socket Thread/2663038 connect(fd: 178, uservaddr: { .family: INET, port: 443, addr: 186.192.83.34 }, addrlen: 16) = -1 (unknown) (Operation now in progress)
5003.508 ( 0.063 ms): pool-0/29901 connect(fd: 9, uservaddr: { .family: LOCAL, path: /var/run/.heim_org.h5l.kcm-soc }, addrlen: 110) = 0
5007.007 ( 0.054 ms): pool-0/29901 connect(fd: 10, uservaddr: { .family: LOCAL, path: /var/run/.heim_org.h5l.kcm-soc }, addrlen: 110) = 0
root@x2:~#
Fixes: a68fd6a6cdd309bb ("perf trace: Collect augmented data using BPF")
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/builtin-trace.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 983dbe1bda935..11b5e26bbdeb1 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -3770,7 +3770,12 @@ static int trace__bpf_sys_enter_beauty_map(struct trace *trace, int key, unsigne
continue;
bt = sc->arg_fmt[i].type;
- beauty_array[i] = bt->size;
+ /* Copy a sockaddr as a buffer sized by the next argument, e.g. addrlen. */
+ if (strcmp(name, "sockaddr") == 0 && field->next &&
+ strstr(field->next->name, "len"))
+ beauty_array[i] = -((i + 1) + 1);
+ else
+ beauty_array[i] = bt->size;
can_augment = true;
} else if (field->flags & TEP_FIELD_IS_POINTER && /* string */
strcmp(field->type, "const char *") == 0 &&
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0743/1756] perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (741 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0742/1756] perf trace: Copy sockaddr arguments by their length Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0744/1756] perf thread_map: Add thread_map__tgid() Greg Kroah-Hartman
` (255 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
Adrian Hunter, Andrii Nakryiko, James Clark, Jiri Olsa, Kan Liang,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaldo Carvalho de Melo <acme@redhat.com>
[ Upstream commit 5a022bf88fb0f4edde14b1f6f9029d96bffbf3e6 ]
We need it to fix some other libbpf version dependent issues when
building with LIBBPF_DYNAMIC=1.
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Stable-dep-of: 1fdf657871b9 ("perf thread_map: Add thread_map__tgid()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/bpf-filter.c | 1 +
tools/perf/util/bpf-utils.h | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/tools/perf/util/bpf-filter.c b/tools/perf/util/bpf-filter.c
index a4fdf6911ec1c..535290000c447 100644
--- a/tools/perf/util/bpf-filter.c
+++ b/tools/perf/util/bpf-filter.c
@@ -55,6 +55,7 @@
#include "util/debug.h"
#include "util/evsel.h"
#include "util/target.h"
+#include "util/bpf-utils.h"
#include "util/bpf-filter.h"
#include <util/bpf-filter-flex.h>
diff --git a/tools/perf/util/bpf-utils.h b/tools/perf/util/bpf-utils.h
index 86a5055cdfad6..eafc43b8731f1 100644
--- a/tools/perf/util/bpf-utils.h
+++ b/tools/perf/util/bpf-utils.h
@@ -8,6 +8,11 @@
#ifdef HAVE_LIBBPF_SUPPORT
#include <bpf/libbpf.h>
+#include <bpf/libbpf_version.h>
+
+#define LIBBPF_CURRENT_VERSION_GEQ(major, minor) \
+ (LIBBPF_MAJOR_VERSION > (major) || \
+ (LIBBPF_MAJOR_VERSION == (major) && LIBBPF_MINOR_VERSION >= (minor)))
/*
* Get bpf_prog_info in continuous memory
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0744/1756] perf thread_map: Add thread_map__tgid()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (742 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0743/1756] perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0745/1756] cpufreq: amd-pstate: Restore previous mode when changing driver mode fails Greg Kroah-Hartman
` (254 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Namhyung Kim, Ian Rogers,
Arnaldo Carvalho de Melo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <irogers@google.com>
[ Upstream commit 1fdf657871b9240edcaaf1d15caaac5b78a84317 ]
bpf-filter reads the tgid of each thread in a thread map from /proc, to
key its BPF map by process, and perf trace is about to do the same. Move
convert_to_tgid() to thread_map.c as thread_map__tgid(), taking the
thread map and index both users have.
While moving it, fix two bugs. Match Tgid: at the start of a line, as a
task can set its comm, shown on the Name: line before it, to contain
"Tgid: <n>". And check the character after the number before freeing the
buffer it points into, rather than after.
Fixes: eb1693b1150d4b99 ("perf bpf-filter: Split per-task filter use case")
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/perf/util/bpf-filter.c | 29 ++---------------------------
tools/perf/util/thread_map.c | 26 ++++++++++++++++++++++++++
tools/perf/util/thread_map.h | 1 +
3 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/tools/perf/util/bpf-filter.c b/tools/perf/util/bpf-filter.c
index 535290000c447..3faa67206bc69 100644
--- a/tools/perf/util/bpf-filter.c
+++ b/tools/perf/util/bpf-filter.c
@@ -55,6 +55,7 @@
#include "util/debug.h"
#include "util/evsel.h"
#include "util/target.h"
+#include "util/thread_map.h"
#include "util/bpf-utils.h"
#include "util/bpf-filter.h"
@@ -201,31 +202,6 @@ static int get_filter_entries(struct evsel *evsel, struct perf_bpf_filter_entry
return 0;
}
-static int convert_to_tgid(int tid)
-{
- char path[128];
- char *buf, *p, *q;
- int tgid;
- size_t len;
-
- scnprintf(path, sizeof(path), "%d/status", tid);
- if (procfs__read_str(path, &buf, &len) < 0)
- return -1;
-
- p = strstr(buf, "Tgid:");
- if (p == NULL) {
- free(buf);
- return -1;
- }
-
- tgid = strtol(p + 6, &q, 0);
- free(buf);
- if (*q != '\n')
- return -1;
-
- return tgid;
-}
-
/*
* The event might be closed already so we cannot get the list of ids using FD
* like in create_event_hash() below, let's iterate the event_hash map and
@@ -406,14 +382,13 @@ static int create_idx_hash(struct evsel *evsel, struct perf_bpf_filter_entry *en
last = -1;
nr = perf_thread_map__nr(threads);
for (int i = 0; i < nr; i++) {
- int pid = perf_thread_map__pid(threads, i);
int tgid;
struct idx_hash_key key = {
.evt_id = event_id,
};
/* it actually needs tgid, let's get tgid from /proc. */
- tgid = convert_to_tgid(pid);
+ tgid = thread_map__tgid(threads, i);
if (tgid < 0) {
/* the thread may be dead, ignore. */
continue;
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index b5f12390c3558..b3a188bcbab4f 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -427,3 +427,29 @@ int thread_map__remove(struct perf_thread_map *threads, int idx)
threads->nr--;
return 0;
}
+
+/* The tgid of the thread at idx, read from /proc, or -1 if it has exited. */
+pid_t thread_map__tgid(struct perf_thread_map *threads, int idx)
+{
+ char path[128];
+ char *buf, *p, *q;
+ pid_t tgid;
+ size_t len;
+
+ snprintf(path, sizeof(path), "%d/status", perf_thread_map__pid(threads, idx));
+ if (procfs__read_str(path, &buf, &len) < 0)
+ return -1;
+
+ /* From a line start, as the Name: line before it can contain "Tgid:". */
+ p = strstr(buf, "\nTgid:");
+ if (p == NULL) {
+ free(buf);
+ return -1;
+ }
+
+ tgid = strtol(p + 6, &q, 0);
+ if (*q != '\n')
+ tgid = -1;
+ free(buf);
+ return tgid;
+}
diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h
index 00ec05fc1656d..39592d8f53daa 100644
--- a/tools/perf/util/thread_map.h
+++ b/tools/perf/util/thread_map.h
@@ -26,4 +26,5 @@ size_t thread_map__fprintf(struct perf_thread_map *threads, FILE *fp);
void thread_map__read_comms(struct perf_thread_map *threads);
bool thread_map__has(struct perf_thread_map *threads, pid_t pid);
int thread_map__remove(struct perf_thread_map *threads, int idx);
+pid_t thread_map__tgid(struct perf_thread_map *threads, int idx);
#endif /* __PERF_THREAD_MAP_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0745/1756] cpufreq: amd-pstate: Restore previous mode when changing driver mode fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (743 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0744/1756] perf thread_map: Add thread_map__tgid() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0746/1756] cpufreq: amd-pstate: Propagate cppc_set_auto_sel() errors on mode change Greg Kroah-Hartman
` (253 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Mario Limonciello,
Mario Limonciello, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
[ Upstream commit f6d3cbc63935fa8911da87e91ed768824d495470 ]
amd_pstate_change_driver_mode() unregisters the currently active driver
before registering the requested mode. If amd_pstate_register_driver()
fails for the new mode, the function returns the error without restoring
anything, leaving the system with no cpufreq scaling driver at all until
a valid mode is manually re-selected.
Remember the mode that was active before the transition and, if
registering the requested mode fails, register the previous mode again so
the system keeps a working scaling driver. The original error is still
returned to the caller so the sysfs write reports the failure.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-5b138ddb-c88b-4f82-8a2d-f39446b625d4
Fixes: 3ca7bc818d8c ("cpufreq: amd-pstate: Add guided mode control support via sysfs")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20260921190235.3651688-1-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/amd-pstate.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 7d51877c536f1..c80eed5e93529 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1235,6 +1235,7 @@ static int amd_pstate_change_mode_without_dvr_change(int mode)
static int amd_pstate_change_driver_mode(int mode)
{
+ int old_mode = cppc_state;
int ret;
ret = amd_pstate_unregister_driver(0);
@@ -1242,10 +1243,16 @@ static int amd_pstate_change_driver_mode(int mode)
return ret;
ret = amd_pstate_register_driver(mode);
- if (ret)
- return ret;
+ if (ret) {
+ pr_err("Failed to register %s mode, restoring %s mode\n",
+ amd_pstate_get_mode_string(mode),
+ amd_pstate_get_mode_string(old_mode));
+ if (amd_pstate_register_driver(old_mode))
+ pr_err("Failed to restore %s mode\n",
+ amd_pstate_get_mode_string(old_mode));
+ }
- return 0;
+ return ret;
}
static cppc_mode_transition_fn mode_state_machine[AMD_PSTATE_MAX][AMD_PSTATE_MAX] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0746/1756] cpufreq: amd-pstate: Propagate cppc_set_auto_sel() errors on mode change
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (744 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0745/1756] cpufreq: amd-pstate: Restore previous mode when changing driver mode fails Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0747/1756] pinctrl: mediatek: mt7629: fix the 2.4 GHz Wi-Fi pin mode array Greg Kroah-Hartman
` (252 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Mario Limonciello,
Mario Limonciello, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
[ Upstream commit 8de705037124dd1cd49bd8cae6536d63ec4e1807 ]
amd_pstate_change_mode_without_dvr_change() iterates over the online CPUs
and calls cppc_set_auto_sel() to enable or disable hardware autonomous
selection, but discards its return value and unconditionally returns 0.
If the firmware rejects the request, the failure is hidden: the cpufreq
core records the mode transition as successful while the hardware stays in
its previous autonomous-selection state. The software mode and the actual
hardware behaviour then disagree, breaking the expected frequency scaling.
Check the return value of cppc_set_auto_sel() and propagate the first
error to the caller so the sysfs write reports the failure.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-d114a94a-655b-43a6-91b1-9484889726c9
Fixes: 3ca7bc818d8c ("cpufreq: amd-pstate: Add guided mode control support via sysfs")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20260921190235.3651688-2-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <superm1@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/amd-pstate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index c80eed5e93529..0f195c15147a8 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1220,6 +1220,7 @@ static int amd_pstate_unregister_driver(int dummy)
static int amd_pstate_change_mode_without_dvr_change(int mode)
{
int cpu = 0;
+ int ret;
cppc_state = mode;
@@ -1227,7 +1228,9 @@ static int amd_pstate_change_mode_without_dvr_change(int mode)
return 0;
for_each_online_cpu(cpu) {
- cppc_set_auto_sel(cpu, (cppc_state == AMD_PSTATE_PASSIVE) ? 0 : 1);
+ ret = cppc_set_auto_sel(cpu, (cppc_state == AMD_PSTATE_PASSIVE) ? 0 : 1);
+ if (ret)
+ return ret;
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0747/1756] pinctrl: mediatek: mt7629: fix the 2.4 GHz Wi-Fi pin mode array
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (745 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0746/1756] cpufreq: amd-pstate: Propagate cppc_set_auto_sel() errors on mode change Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0748/1756] mm/memory_hotplug: fix missing rollback in __add_pages() Greg Kroah-Hartman
` (251 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuanhong Guo, Linus Walleij,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuanhong Guo <gch981213@gmail.com>
[ Upstream commit 0b056aef31602cd10d2b35adc4746781b4fb8609 ]
The wf0_2g group contains nine pins but only eight mux values.
mtk_pinmux_set_mux() indexes the mode array once for each pin, reading
past its end when configuring pin 78 (WF0_2G_HB6). This can select an
unrelated mux value or fail with -EINVAL, preventing the Wi-Fi device
from probing.
Add the missing mode 1 entry for WF0_2G_HB6.
Fixes: b44677375fee ("pinctrl: mediatek: add pinctrl support for MT7629 SoC")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/mediatek/pinctrl-mt7629.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7629.c b/drivers/pinctrl/mediatek/pinctrl-mt7629.c
index 98142e8c98011..b536ac32e57d9 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt7629.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7629.c
@@ -294,7 +294,7 @@ static int mt7629_pwm_1_funcs[] = { 2, };
/* WF 2G */
static int mt7629_wf0_2g_pins[] = { 70, 71, 72, 73, 74, 75, 76, 77, 78, };
-static int mt7629_wf0_2g_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, };
+static int mt7629_wf0_2g_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, };
/* WF 5G */
static int mt7629_wf0_5g_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, };
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0748/1756] mm/memory_hotplug: fix missing rollback in __add_pages()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (746 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0747/1756] pinctrl: mediatek: mt7629: fix the 2.4 GHz Wi-Fi pin mode array Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0749/1756] drm/tegra: Fix syncobj_in wait return value check Greg Kroah-Hartman
` (250 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Muchun Song, Lance Yang,
David Hildenbrand (Arm), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lance Yang <lance.yang@linux.dev>
[ Upstream commit c31bb839fb829958101250ee5acfa4f94fdb7ecd ]
__add_pages() returns on a sparse_add_section() failure without removing
the sections already added in the same request.
For memremap_pages(), the failed range is not counted in pgmap->nr_range,
so memunmap_pages() skips it. The sections already added in that range
retain their vmemmap mappings and subsection bits. Retrying a
section-aligned range can then fail with -EEXIST.
Save the initial PFN and remove [start_pfn, pfn) on failure. For a vmemmap
population failure, section_activate() already cleans up the current
section, so the rollback excludes it. If the first section fails,
__remove_pages() receives an empty range and does nothing.
Link: https://lore.kernel.org/all/BAD58999-1EDD-4A37-ABA0-DB1BD8AB3453@linux.dev/
Suggested-by: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Lance Yang <lance.yang@linux.dev>
Fixes: ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug")
Acked-by: Muchun Song <muchun.song@linux.dev>
Link: https://patch.msgid.link/20260930160432.5564-1-lance.yang@linux.dev
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory_hotplug.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index e21f59cf29d9f..28fb4587ed8b0 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -388,6 +388,7 @@ EXPORT_SYMBOL_GPL(pfn_to_online_page);
int __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
struct mhp_params *params)
{
+ const unsigned long start_pfn = pfn;
const unsigned long end_pfn = pfn + nr_pages;
unsigned long cur_nr_pages;
int err;
@@ -421,8 +422,11 @@ int __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
SECTION_ALIGN_UP(pfn + 1) - pfn);
err = sparse_add_section(nid, pfn, cur_nr_pages, altmap,
params->pgmap);
- if (err)
+ if (err) {
+ __remove_pages(start_pfn, pfn - start_pfn, altmap,
+ params->pgmap);
break;
+ }
cond_resched();
}
vmemmap_populate_print_last();
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0749/1756] drm/tegra: Fix syncobj_in wait return value check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (747 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0748/1756] mm/memory_hotplug: fix missing rollback in __add_pages() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0750/1756] drm/tegra: Dont pass an ERR_PTR to drm_syncobj_replace_fence() Greg Kroah-Hartman
` (249 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Mikko Perttunen,
Thierry Reding, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikko Perttunen <mperttunen@nvidia.com>
[ Upstream commit 27836c46a3db5a7869a9f7e181136f0c4d8bc0d1 ]
dma_fence_wait_timeout() returns the remaining timeout in jiffies on
success, zero on timeout, and a negative error code if interrupted. The
return value was assigned to 'err' and checked as if it were an errno,
the opposite of the correct logic.
Fix the code to use a properly typed variable and check each condition
correctly.
Fixes: 13abe0bb15ce ("drm/tegra: Implement job submission part of new UAPI")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aJM_te551jUwnRv7@stanley.mountain/
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260730-b4-host1x-syncobj-wait-v1-1-afa730410392@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tegra/submit.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c
index 705382035f5f6..f35e5c3ff37cd 100644
--- a/drivers/gpu/drm/tegra/submit.c
+++ b/drivers/gpu/drm/tegra/submit.c
@@ -530,6 +530,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
if (args->syncobj_in) {
struct dma_fence *fence;
+ long wait_err;
err = drm_syncobj_find_fence(file, args->syncobj_in, 0, 0, &fence);
if (err) {
@@ -537,10 +538,15 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
goto unlock;
}
- err = dma_fence_wait_timeout(fence, true, msecs_to_jiffies(10000));
+ wait_err = dma_fence_wait_timeout(fence, true, msecs_to_jiffies(10000));
dma_fence_put(fence);
- if (err) {
+ if (wait_err == 0) {
SUBMIT_ERR(context, "wait for syncobj_in timed out");
+ err = -ETIMEDOUT;
+ goto unlock;
+ } else if (wait_err < 0) {
+ /* In practice, -ERESTARTSYS */
+ err = wait_err;
goto unlock;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0750/1756] drm/tegra: Dont pass an ERR_PTR to drm_syncobj_replace_fence()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (748 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0749/1756] drm/tegra: Fix syncobj_in wait return value check Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0751/1756] drm/tegra: Drop reference on postfence Greg Kroah-Hartman
` (248 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikko Perttunen, Thierry Reding,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikko Perttunen <mperttunen@nvidia.com>
[ Upstream commit 7fce3d34eddfff6361cb4de2c5b8789b88a552b6 ]
When host1x_fence_create() fails, avoid trying to attach the error
pointer to the out syncobj.
Fixes: 13abe0bb15ce ("drm/tegra: Implement job submission part of new UAPI")
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260730-b4-host1x-syncobj-wait-v1-2-afa730410392@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tegra/submit.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c
index f35e5c3ff37cd..43720a69d0f0d 100644
--- a/drivers/gpu/drm/tegra/submit.c
+++ b/drivers/gpu/drm/tegra/submit.c
@@ -655,6 +655,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
if (IS_ERR(fence)) {
err = PTR_ERR(fence);
SUBMIT_ERR(context, "failed to create postfence: %d", err);
+ goto put_job;
}
drm_syncobj_replace_fence(syncobj, fence);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0751/1756] drm/tegra: Drop reference on postfence
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (749 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0750/1756] drm/tegra: Dont pass an ERR_PTR to drm_syncobj_replace_fence() Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0752/1756] nvdimm/pmem: Release gendisk on probe failure Greg Kroah-Hartman
` (247 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikko Perttunen, Thierry Reding,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikko Perttunen <mperttunen@nvidia.com>
[ Upstream commit 5ba3dfe724448f308ad7b28ef8d4f41bca4896ae ]
drm_syncobj_replace_fence() calls dma_fence_get() on the parameter
fence, so we need to drop ours. Add a call to dma_fence_put() to do
that.
Fixes: 13abe0bb15ce ("drm/tegra: Implement job submission part of new UAPI")
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260730-b4-host1x-syncobj-wait-v1-3-afa730410392@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tegra/submit.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c
index 43720a69d0f0d..fd88e28124f6f 100644
--- a/drivers/gpu/drm/tegra/submit.c
+++ b/drivers/gpu/drm/tegra/submit.c
@@ -659,6 +659,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
}
drm_syncobj_replace_fence(syncobj, fence);
+ dma_fence_put(fence);
}
goto put_job;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0752/1756] nvdimm/pmem: Release gendisk on probe failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (750 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0751/1756] drm/tegra: Drop reference on postfence Greg Kroah-Hartman
@ 2026-11-18 14:47 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0753/1756] platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data Greg Kroah-Hartman
` (246 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:47 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hemanth Selam, Dave Jiang,
Alison Schofield, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hemanth Selam <hemanth.selam@gmail.com>
[ Upstream commit 855a46681e0ba601952c346e5b62d867e51ecb23 ]
pmem_attach_disk() allocates the gendisk with blk_alloc_disk() and hands
it to devres only once device_add_disk() has succeeded. Until that
point the probe path owns the disk itself, which is why every failure
after the allocation jumps to the out: label and puts it there.
The devm_init_badblocks() failure returns directly instead, so the disk
allocated a few lines earlier is never released. Nothing releases it
afterwards either: the devres action that would have done so has not
been registered yet, so unbinding the namespace or destroying it does
not reach the disk, and it stays allocated along with its queue and its
bdev inode until the machine is rebooted.
devm_init_badblocks() only fails when a single page allocation fails, so
reaching this at all needs memory exhaustion during namespace probe, and
because device_add_disk() has not run there is nothing user visible left
behind: no device node, no sysfs entry, only the leaked memory.
Release the gendisk through the existing cleanup path on this failure.
Fixes: 3dd60fb9d95d ("nvdimm/pmem: stop using q_usage_count as external pgmap refcount")
Signed-off-by: Hemanth Selam <hemanth.selam@gmail.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260911082543.473670-1-hemanth.selam@gmail.com
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvdimm/pmem.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 53f6587674d34..4ee50aa39607d 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -561,8 +561,10 @@ static int pmem_attach_disk(struct device *dev,
nvdimm_namespace_disk_name(ndns, disk->disk_name);
set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)
/ 512);
- if (devm_init_badblocks(dev, &pmem->bb))
- return -ENOMEM;
+ if (devm_init_badblocks(dev, &pmem->bb)) {
+ rc = -ENOMEM;
+ goto out;
+ }
nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_range);
disk->bb = &pmem->bb;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0753/1756] platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (751 preceding siblings ...)
2026-11-18 14:47 ` [PATCH 6.12 0752/1756] nvdimm/pmem: Release gendisk on probe failure Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0754/1756] crypto: atmel - handle authenc requests without plaintext Greg Kroah-Hartman
` (245 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bartosz Szpila, Andrei Kuchynski,
Tzung-Bi Shih, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Szpila <bszpila@google.com>
[ Upstream commit 317e7abcaf60b79765dcf35c014edac8b9d37a6e ]
cros_typec_register_altmodes() iterates over sop_disc->svid_count and
sop_disc->svids[i].mode_count from the EC_CMD_TYPEC_DISCOVERY response
without validating their bounds.
port->disc_data is allocated as a buffer of EC_PROTO2_MAX_RESPONSE_SIZE
bytes, and each SVID entry contains a fixed mode_vdo[6] array. If the EC
returns an out-of-bounds svid_count or mode_count, the loops read past
the end of the mode_vdo array or the disc_data buffer.
Validate that the discovery response with svid_count entries fits within
EC_PROTO2_MAX_RESPONSE_SIZE using struct_size(), and ensure each SVID's
mode_count does not exceed ARRAY_SIZE(sop_disc->svids[i].mode_vdo)
before registering altmodes.
Fixes: de0f49487db3 ("platform/chrome: cros_ec_typec: Register partner altmodes")
Signed-off-by: Bartosz Szpila <bszpila@google.com>
Reviewed-by: Andrei Kuchynski <akuchynski@chromium.org>
Link: https://lore.kernel.org/r/20261001085714.1086242-1-bszpila@google.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/chrome/cros_ec_typec.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 8c0b814973c04..742325f6218e0 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -7,8 +7,10 @@
*/
#include <linux/acpi.h>
+#include <linux/array_size.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/overflow.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_usbpd_notify.h>
#include <linux/platform_device.h>
@@ -764,7 +766,15 @@ static int cros_typec_register_altmodes(struct cros_typec_data *typec, int port_
int ret = 0;
int i, j;
+ if (struct_size(sop_disc, svids, sop_disc->svid_count) > EC_PROTO2_MAX_RESPONSE_SIZE)
+ return -EINVAL;
+
for (i = 0; i < sop_disc->svid_count; i++) {
+ if (sop_disc->svids[i].mode_count > ARRAY_SIZE(sop_disc->svids[i].mode_vdo)) {
+ ret = -EINVAL;
+ goto err_cleanup;
+ }
+
for (j = 0; j < sop_disc->svids[i].mode_count; j++) {
memset(&desc, 0, sizeof(desc));
desc.svid = sop_disc->svids[i].svid;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0754/1756] crypto: atmel - handle authenc requests without plaintext
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (752 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0753/1756] platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0755/1756] crypto: tcrypt - Avoid reading req->base after submission Greg Kroah-Hartman
` (244 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit ccbd95b3efbc0580b6abde2a905823417ca56022 ]
Authenc permits a nonempty associated-data string with no plaintext. The
Atmel driver accepts such a request, has SHA process the associated data,
and then unconditionally asks AES DMA to transfer zero bytes. The Atmel
DMA engines reject the zero-length descriptor, so the valid request fails,
normally with -ENOMEM.
Skip the AES transfer when textlen is zero and proceed directly to SHA
finalization.
Once an HMAC transform has cached its inner and outer states, SHA can
complete this path synchronously. The forced ahash completion callback
then invokes the AES finalizer through a void function and discards its
return value. This loses -EBADMSG for a mismatched tag and reports
successful decryption.
For synchronous SHA completion, release the SHA device without invoking
the ahash callback and call the AES finalizer directly. Its result then
propagates through the synchronous call chain. Keep the existing callback
path for asynchronous completion.
On a SAM9X75, the unpatched driver failed valid AAD-only requests and
returned success for a bad tag after the transform had been used once. With
this change, bad tags return -EBADMSG for both fresh and reused transforms.
Fixes: 89a82ef87e01 ("crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/atmel-aes.c | 2 ++
drivers/crypto/atmel-sha.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index 6a29656f3951f..5b6f594a3086d 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -1830,6 +1830,8 @@ static int atmel_aes_authenc_transfer(struct atmel_aes_dev *dd, int err,
dd->is_async = true;
if (err)
return atmel_aes_complete(dd, err);
+ if (!rctx->textlen)
+ return atmel_aes_authenc_digest(dd);
/* Prepare src and dst scatter-lists to transfer cipher/plain texts. */
src = scatterwalk_ffwd(rctx->src, req->src, req->assoclen);
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 06c91b0bbf22d..2494a58b437a6 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -2393,11 +2393,25 @@ static int atmel_sha_authenc_final_done(struct atmel_sha_dev *dd)
{
struct ahash_request *req = dd->req;
struct atmel_sha_authenc_reqctx *authctx = ahash_request_ctx(req);
+ atmel_aes_authenc_fn_t cb;
+ struct atmel_aes_dev *aes_dev;
size_t i, num_words = authctx->digestlen / sizeof(u32);
for (i = 0; i < num_words; ++i)
authctx->digest[i] = atmel_sha_read(dd, SHA_REG_DIGEST(i));
+ if (!dd->is_async) {
+ /*
+ * Return the AES finalizer's status directly for synchronous requests.
+ * The ahash callback cannot propagate it.
+ */
+ cb = authctx->cb;
+ aes_dev = authctx->aes_dev;
+ dd->force_complete = false;
+ (void)atmel_sha_complete(dd, 0);
+ return cb(aes_dev, 0, false);
+ }
+
return atmel_sha_complete(dd, 0);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0755/1756] crypto: tcrypt - Avoid reading req->base after submission
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (753 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0754/1756] crypto: atmel - handle authenc requests without plaintext Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0756/1756] hwrng: intel - return -ENOMEM when kmalloc_obj() fails Greg Kroah-Hartman
` (243 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, T Pratham, Herbert Xu, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <herbert@gondor.apana.org.au>
[ Upstream commit 3a31a4baad6726bf974bcc58a6398f6a36d10aa0 ]
Once a request has been submitted to the Crypto API, the value
of req->base.data must not be read by the caller as it may change
while the request is processed.
Avoid reading it in tcrypt by combining the crypto_wait struct
with the request object into a tcrypt request object and pass that
around instead of the request object.
Reported-by: T Pratham <t-pratham@ti.com>
Fixes: beb63da739f7 ("crypto: tcrypt - Add speed tests for async hashing")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
crypto/tcrypt.c | 182 +++++++++++++++++++++++++++---------------------
1 file changed, 101 insertions(+), 81 deletions(-)
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index e9e7dceb606e1..8c56c26e2a2ac 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -56,6 +56,21 @@
*/
#define get_driver_name(tfm_type, tfm) crypto_tfm_alg_driver_name(tfm_type ## _tfm(tfm))
+struct tcrypt_aead_request {
+ struct aead_request *req;
+ struct crypto_wait wait;
+};
+
+struct tcrypt_ahash_request {
+ struct ahash_request *req;
+ struct crypto_wait wait;
+};
+
+struct tcrypt_skcipher_request {
+ struct skcipher_request *req;
+ struct crypto_wait wait;
+};
+
/*
* Used by test_cipher_speed()
*/
@@ -129,18 +144,15 @@ static void sg_init_aead(struct scatterlist *sg, char *xbuf[XBUFSIZE],
sg_set_buf(&sg[k + 1], xbuf[k], rem);
}
-static inline int do_one_aead_op(struct aead_request *req, int ret)
+static inline int do_one_aead_op(struct tcrypt_aead_request *req, int ret)
{
- struct crypto_wait *wait = req->base.data;
-
- return crypto_wait_req(ret, wait);
+ return crypto_wait_req(ret, &req->wait);
}
struct test_mb_aead_data {
struct scatterlist sg[XBUFSIZE];
struct scatterlist sgout[XBUFSIZE];
- struct aead_request *req;
- struct crypto_wait wait;
+ struct tcrypt_aead_request req;
char *xbuf[XBUFSIZE];
char *xoutbuf[XBUFSIZE];
char *axbuf[XBUFSIZE];
@@ -154,14 +166,14 @@ static int do_mult_aead_op(struct test_mb_aead_data *data, int enc,
/* Fire up a bunch of concurrent requests */
for (i = 0; i < num_mb; i++) {
if (enc == ENCRYPT)
- rc[i] = crypto_aead_encrypt(data[i].req);
+ rc[i] = crypto_aead_encrypt(data[i].req.req);
else
- rc[i] = crypto_aead_decrypt(data[i].req);
+ rc[i] = crypto_aead_decrypt(data[i].req.req);
}
/* Wait for all requests to finish */
for (i = 0; i < num_mb; i++) {
- rc[i] = crypto_wait_req(rc[i], &data[i].wait);
+ rc[i] = crypto_wait_req(rc[i], &data[i].req.wait);
if (rc[i]) {
pr_info("concurrent request %d error %d\n", i, rc[i]);
@@ -310,21 +322,21 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
}
for (i = 0; i < num_mb; ++i) {
- data[i].req = aead_request_alloc(tfm, GFP_KERNEL);
- if (!data[i].req) {
+ data[i].req.req = aead_request_alloc(tfm, GFP_KERNEL);
+ if (!data[i].req.req) {
pr_err("alg: aead: Failed to allocate request for %s\n",
algo);
while (i--)
- aead_request_free(data[i].req);
+ aead_request_free(data[i].req.req);
goto out_free_xoutbuf;
}
}
for (i = 0; i < num_mb; ++i) {
- crypto_init_wait(&data[i].wait);
- aead_request_set_callback(data[i].req,
+ crypto_init_wait(&data[i].req.wait);
+ aead_request_set_callback(data[i].req.req,
CRYPTO_TFM_REQ_MAY_BACKLOG,
- crypto_req_done, &data[i].wait);
+ crypto_req_done, &data[i].req.wait);
}
pr_info("testing speed of multibuffer %s (%s) %s\n", algo,
@@ -386,16 +398,16 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
bs + (enc ? authsize : 0),
assoc, aad_size);
- aead_request_set_ad(cur->req, aad_size);
+ aead_request_set_ad(cur->req.req, aad_size);
if (!enc) {
- aead_request_set_crypt(cur->req,
+ aead_request_set_crypt(cur->req.req,
cur->sgout,
cur->sg,
bs, iv);
- ret = crypto_aead_encrypt(cur->req);
- ret = do_one_aead_op(cur->req, ret);
+ ret = crypto_aead_encrypt(cur->req.req);
+ ret = do_one_aead_op(&cur->req, ret);
if (ret) {
pr_err("calculating auth failed (%d)\n",
@@ -404,7 +416,7 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
}
}
- aead_request_set_crypt(cur->req, cur->sg,
+ aead_request_set_crypt(cur->req.req, cur->sg,
cur->sgout, bs +
(enc ? 0 : authsize),
iv);
@@ -432,7 +444,7 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
out:
for (i = 0; i < num_mb; ++i)
- aead_request_free(data[i].req);
+ aead_request_free(data[i].req.req);
out_free_xoutbuf:
for (i = 0; i < num_mb; ++i)
testmgr_free_buf(data[i].xoutbuf);
@@ -450,9 +462,10 @@ static void test_mb_aead_speed(const char *algo, int enc, int secs,
kfree(iv);
}
-static int test_aead_jiffies(struct aead_request *req, int enc,
+static int test_aead_jiffies(struct tcrypt_aead_request *treq, int enc,
int blen, int secs)
{
+ struct aead_request *req = treq->req;
unsigned long start, end;
int bcount;
int ret;
@@ -460,9 +473,9 @@ static int test_aead_jiffies(struct aead_request *req, int enc,
for (start = jiffies, end = start + secs * HZ, bcount = 0;
time_before(jiffies, end); bcount++) {
if (enc)
- ret = do_one_aead_op(req, crypto_aead_encrypt(req));
+ ret = do_one_aead_op(treq, crypto_aead_encrypt(req));
else
- ret = do_one_aead_op(req, crypto_aead_decrypt(req));
+ ret = do_one_aead_op(treq, crypto_aead_decrypt(req));
if (ret)
return ret;
@@ -473,8 +486,9 @@ static int test_aead_jiffies(struct aead_request *req, int enc,
return 0;
}
-static int test_aead_cycles(struct aead_request *req, int enc, int blen)
+static int test_aead_cycles(struct tcrypt_aead_request *treq, int enc, int blen)
{
+ struct aead_request *req = treq->req;
unsigned long cycles = 0;
int ret = 0;
int i;
@@ -482,9 +496,9 @@ static int test_aead_cycles(struct aead_request *req, int enc, int blen)
/* Warm-up run. */
for (i = 0; i < 4; i++) {
if (enc)
- ret = do_one_aead_op(req, crypto_aead_encrypt(req));
+ ret = do_one_aead_op(treq, crypto_aead_encrypt(req));
else
- ret = do_one_aead_op(req, crypto_aead_decrypt(req));
+ ret = do_one_aead_op(treq, crypto_aead_decrypt(req));
if (ret)
goto out;
@@ -496,9 +510,9 @@ static int test_aead_cycles(struct aead_request *req, int enc, int blen)
start = get_cycles();
if (enc)
- ret = do_one_aead_op(req, crypto_aead_encrypt(req));
+ ret = do_one_aead_op(treq, crypto_aead_encrypt(req));
else
- ret = do_one_aead_op(req, crypto_aead_decrypt(req));
+ ret = do_one_aead_op(treq, crypto_aead_decrypt(req));
end = get_cycles();
if (ret)
@@ -520,6 +534,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
unsigned int tcount, u8 authsize,
unsigned int aad_size, u8 *keysize)
{
+ struct tcrypt_aead_request treq;
unsigned int i, j;
struct crypto_aead *tfm;
int ret = -ENOMEM;
@@ -535,7 +550,6 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
char *axbuf[XBUFSIZE];
const int *b_size;
unsigned int iv_len;
- struct crypto_wait wait;
iv = kzalloc(MAX_IVLEN, GFP_KERNEL);
if (!iv)
@@ -577,7 +591,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
goto out_noreq;
}
- crypto_init_wait(&wait);
+ crypto_init_wait(&treq.wait);
pr_info("testing speed of %s (%s) %s\n", algo,
get_driver_name(crypto_aead, tfm), e);
@@ -587,9 +601,10 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
algo);
goto out_noreq;
}
+ treq.req = req;
aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
- crypto_req_done, &wait);
+ crypto_req_done, &treq.wait);
i = 0;
do {
@@ -650,7 +665,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
*/
aead_request_set_crypt(req, sgout, sg,
bs, iv);
- ret = do_one_aead_op(req,
+ ret = do_one_aead_op(&treq,
crypto_aead_encrypt(req));
if (ret) {
@@ -665,11 +680,11 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs,
iv);
if (secs) {
- ret = test_aead_jiffies(req, enc, bs,
+ ret = test_aead_jiffies(&treq, enc, bs,
secs);
cond_resched();
} else {
- ret = test_aead_cycles(req, enc, bs);
+ ret = test_aead_cycles(&treq, enc, bs);
}
if (ret) {
@@ -709,23 +724,22 @@ static void test_hash_sg_init(struct scatterlist *sg)
}
}
-static inline int do_one_ahash_op(struct ahash_request *req, int ret)
+static inline int do_one_ahash_op(struct tcrypt_ahash_request *treq, int ret)
{
- struct crypto_wait *wait = req->base.data;
-
- return crypto_wait_req(ret, wait);
+ return crypto_wait_req(ret, &treq->wait);
}
-static int test_ahash_jiffies_digest(struct ahash_request *req, int blen,
- char *out, int secs)
+static int test_ahash_jiffies_digest(struct tcrypt_ahash_request *treq,
+ int blen, char *out, int secs)
{
+ struct ahash_request *req = treq->req;
unsigned long start, end;
int bcount;
int ret;
for (start = jiffies, end = start + secs * HZ, bcount = 0;
time_before(jiffies, end); bcount++) {
- ret = do_one_ahash_op(req, crypto_ahash_digest(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_digest(req));
if (ret)
return ret;
}
@@ -736,28 +750,29 @@ static int test_ahash_jiffies_digest(struct ahash_request *req, int blen,
return 0;
}
-static int test_ahash_jiffies(struct ahash_request *req, int blen,
+static int test_ahash_jiffies(struct tcrypt_ahash_request *treq, int blen,
int plen, char *out, int secs)
{
+ struct ahash_request *req = treq->req;
unsigned long start, end;
int bcount, pcount;
int ret;
if (plen == blen)
- return test_ahash_jiffies_digest(req, blen, out, secs);
+ return test_ahash_jiffies_digest(treq, blen, out, secs);
for (start = jiffies, end = start + secs * HZ, bcount = 0;
time_before(jiffies, end); bcount++) {
- ret = do_one_ahash_op(req, crypto_ahash_init(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_init(req));
if (ret)
return ret;
for (pcount = 0; pcount < blen; pcount += plen) {
- ret = do_one_ahash_op(req, crypto_ahash_update(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_update(req));
if (ret)
return ret;
}
/* we assume there is enough space in 'out' for the result */
- ret = do_one_ahash_op(req, crypto_ahash_final(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_final(req));
if (ret)
return ret;
}
@@ -768,15 +783,16 @@ static int test_ahash_jiffies(struct ahash_request *req, int blen,
return 0;
}
-static int test_ahash_cycles_digest(struct ahash_request *req, int blen,
- char *out)
+static int test_ahash_cycles_digest(struct tcrypt_ahash_request *treq,
+ int blen, char *out)
{
+ struct ahash_request *req = treq->req;
unsigned long cycles = 0;
int ret, i;
/* Warm-up run. */
for (i = 0; i < 4; i++) {
- ret = do_one_ahash_op(req, crypto_ahash_digest(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_digest(req));
if (ret)
goto out;
}
@@ -787,7 +803,7 @@ static int test_ahash_cycles_digest(struct ahash_request *req, int blen,
start = get_cycles();
- ret = do_one_ahash_op(req, crypto_ahash_digest(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_digest(req));
if (ret)
goto out;
@@ -806,26 +822,27 @@ static int test_ahash_cycles_digest(struct ahash_request *req, int blen,
return 0;
}
-static int test_ahash_cycles(struct ahash_request *req, int blen,
+static int test_ahash_cycles(struct tcrypt_ahash_request *treq, int blen,
int plen, char *out)
{
+ struct ahash_request *req = treq->req;
unsigned long cycles = 0;
int i, pcount, ret;
if (plen == blen)
- return test_ahash_cycles_digest(req, blen, out);
+ return test_ahash_cycles_digest(treq, blen, out);
/* Warm-up run. */
for (i = 0; i < 4; i++) {
- ret = do_one_ahash_op(req, crypto_ahash_init(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_init(req));
if (ret)
goto out;
for (pcount = 0; pcount < blen; pcount += plen) {
- ret = do_one_ahash_op(req, crypto_ahash_update(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_update(req));
if (ret)
goto out;
}
- ret = do_one_ahash_op(req, crypto_ahash_final(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_final(req));
if (ret)
goto out;
}
@@ -836,15 +853,15 @@ static int test_ahash_cycles(struct ahash_request *req, int blen,
start = get_cycles();
- ret = do_one_ahash_op(req, crypto_ahash_init(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_init(req));
if (ret)
goto out;
for (pcount = 0; pcount < blen; pcount += plen) {
- ret = do_one_ahash_op(req, crypto_ahash_update(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_update(req));
if (ret)
goto out;
}
- ret = do_one_ahash_op(req, crypto_ahash_final(req));
+ ret = do_one_ahash_op(treq, crypto_ahash_final(req));
if (ret)
goto out;
@@ -867,7 +884,7 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
struct hash_speed *speed, unsigned mask)
{
struct scatterlist sg[TVMEMSIZE];
- struct crypto_wait wait;
+ struct tcrypt_ahash_request treq;
struct ahash_request *req;
struct crypto_ahash *tfm;
char *output;
@@ -896,9 +913,10 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
goto out;
}
- crypto_init_wait(&wait);
+ treq.req = req;
+ crypto_init_wait(&treq.wait);
ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
- crypto_req_done, &wait);
+ crypto_req_done, &treq.wait);
output = kmalloc(MAX_DIGEST_SIZE, GFP_KERNEL);
if (!output)
@@ -921,11 +939,11 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
ahash_request_set_crypt(req, sg, output, speed[i].plen);
if (secs) {
- ret = test_ahash_jiffies(req, speed[i].blen,
+ ret = test_ahash_jiffies(&treq, speed[i].blen,
speed[i].plen, output, secs);
cond_resched();
} else {
- ret = test_ahash_cycles(req, speed[i].blen,
+ ret = test_ahash_cycles(&treq, speed[i].blen,
speed[i].plen, output);
}
@@ -1211,16 +1229,16 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs,
kfree(data);
}
-static inline int do_one_acipher_op(struct skcipher_request *req, int ret)
+static inline int do_one_acipher_op(struct tcrypt_skcipher_request *req,
+ int ret)
{
- struct crypto_wait *wait = req->base.data;
-
- return crypto_wait_req(ret, wait);
+ return crypto_wait_req(ret, &req->wait);
}
-static int test_acipher_jiffies(struct skcipher_request *req, int enc,
+static int test_acipher_jiffies(struct tcrypt_skcipher_request *treq, int enc,
int blen, int secs)
{
+ struct skcipher_request *req = treq->req;
unsigned long start, end;
int bcount;
int ret;
@@ -1228,10 +1246,10 @@ static int test_acipher_jiffies(struct skcipher_request *req, int enc,
for (start = jiffies, end = start + secs * HZ, bcount = 0;
time_before(jiffies, end); bcount++) {
if (enc)
- ret = do_one_acipher_op(req,
+ ret = do_one_acipher_op(treq,
crypto_skcipher_encrypt(req));
else
- ret = do_one_acipher_op(req,
+ ret = do_one_acipher_op(treq,
crypto_skcipher_decrypt(req));
if (ret)
@@ -1243,9 +1261,10 @@ static int test_acipher_jiffies(struct skcipher_request *req, int enc,
return 0;
}
-static int test_acipher_cycles(struct skcipher_request *req, int enc,
+static int test_acipher_cycles(struct tcrypt_skcipher_request *treq, int enc,
int blen)
{
+ struct skcipher_request *req = treq->req;
unsigned long cycles = 0;
int ret = 0;
int i;
@@ -1253,10 +1272,10 @@ static int test_acipher_cycles(struct skcipher_request *req, int enc,
/* Warm-up run. */
for (i = 0; i < 4; i++) {
if (enc)
- ret = do_one_acipher_op(req,
+ ret = do_one_acipher_op(treq,
crypto_skcipher_encrypt(req));
else
- ret = do_one_acipher_op(req,
+ ret = do_one_acipher_op(treq,
crypto_skcipher_decrypt(req));
if (ret)
@@ -1269,10 +1288,10 @@ static int test_acipher_cycles(struct skcipher_request *req, int enc,
start = get_cycles();
if (enc)
- ret = do_one_acipher_op(req,
+ ret = do_one_acipher_op(treq,
crypto_skcipher_encrypt(req));
else
- ret = do_one_acipher_op(req,
+ ret = do_one_acipher_op(treq,
crypto_skcipher_decrypt(req));
end = get_cycles();
@@ -1294,8 +1313,8 @@ static void test_skcipher_speed(const char *algo, int enc, unsigned int secs,
struct cipher_speed_template *template,
unsigned int tcount, u8 *keysize, bool async)
{
+ struct tcrypt_skcipher_request treq;
unsigned int ret, i, j, k, iv_len;
- struct crypto_wait wait;
const char *key;
char iv[128];
struct skcipher_request *req;
@@ -1308,7 +1327,7 @@ static void test_skcipher_speed(const char *algo, int enc, unsigned int secs,
else
e = "decryption";
- crypto_init_wait(&wait);
+ crypto_init_wait(&treq.wait);
tfm = crypto_alloc_skcipher(algo, 0, async ? 0 : CRYPTO_ALG_ASYNC);
@@ -1327,8 +1346,9 @@ static void test_skcipher_speed(const char *algo, int enc, unsigned int secs,
goto out;
}
+ treq.req = req;
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
- crypto_req_done, &wait);
+ crypto_req_done, &treq.wait);
i = 0;
do {
@@ -1395,11 +1415,11 @@ static void test_skcipher_speed(const char *algo, int enc, unsigned int secs,
skcipher_request_set_crypt(req, sg, sg, bs, iv);
if (secs) {
- ret = test_acipher_jiffies(req, enc,
+ ret = test_acipher_jiffies(&treq, enc,
bs, secs);
cond_resched();
} else {
- ret = test_acipher_cycles(req, enc,
+ ret = test_acipher_cycles(&treq, enc,
bs);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0756/1756] hwrng: intel - return -ENOMEM when kmalloc_obj() fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (754 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0755/1756] crypto: tcrypt - Avoid reading req->base after submission Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0757/1756] rtc: ftrtc010: fix integer overflow in time calculation Greg Kroah-Hartman
` (242 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Thorsten Blum, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thorsten Blum <blum@kernel.org>
[ Upstream commit a0590c556cdbf88373d38494a23f1503d39b0ab2 ]
intel_rng_mod_init() incorrectly returns -ENODEV when kmalloc_obj()
fails. Return -ENOMEM instead.
Fixes: ee527cd3a20c ("Use stop_machine_run in the Intel RNG driver")
Signed-off-by: Thorsten Blum <blum@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/char/hw_random/intel-rng.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index 7b171cb3b825f..94f7116e96682 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -349,6 +349,7 @@ static int __init intel_rng_mod_init(void)
intel_rng_hw = kmalloc(sizeof(*intel_rng_hw), GFP_KERNEL);
if (!intel_rng_hw) {
pci_dev_put(dev);
+ err = -ENOMEM;
goto out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0757/1756] rtc: ftrtc010: fix integer overflow in time calculation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (755 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0756/1756] hwrng: intel - return -ENOMEM when kmalloc_obj() fails Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0758/1756] ALSA: ump: Avoid dereference with max_src_size=0 Greg Kroah-Hartman
` (241 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Liu Dalin, Linus Walleij,
Alexandre Belloni, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Dalin <liudalin@kylinsec.com.cn>
[ Upstream commit 32f04694fa87b8ac9fa58f9ceb2dc6cbc476e2a1 ]
In ftrtc010_rtc_read_time() and ftrtc010_rtc_set_time(), all
variables (offset, days, hour, min, sec) are u32. The expression
"days * 86400 + hour * 3600 + min * 60 + sec" is evaluated in
32-bit arithmetic, which silently wraps around for dates beyond
approximately year 2106 (U32_MAX / 86400 ≈ 49710 days).
In ftrtc010_rtc_read_time(), perform the addition in 32-bit
arithmetic first to preserve two's complement wrapping for negative
offsets, then cast the result to timeu64_t. In
ftrtc010_rtc_set_time(), cast individual u32 operands to timeu64_t
before multiplication to prevent overflow in the right-hand side
of the offset calculation.
Fixes: 1d61d2592c1f ("rtc: gemini/ftrtc010: rename driver and symbols")
Assisted-by: Sashiko AI [static analysis]
Signed-off-by: Liu Dalin <liudalin@kylinsec.com.cn>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Tested-by: Liu Dalin <liudalin@kylinsec.com.cn>
Link: https://patch.msgid.link/42C8FBD59AA34EA9+20260827080320.3351155-4-liudalin@kylinsec.com.cn
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-ftrtc010.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index 2f610a0fc6e9b..c989574b1fbc6 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -73,7 +73,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm)
days = readl(rtc->rtc_base + FTRTC010_RTC_DAYS);
offset = readl(rtc->rtc_base + FTRTC010_RTC_RECORD);
- time = offset + days * 86400 + hour * 3600 + min * 60 + sec;
+ time = (timeu64_t)(offset + days * 86400 + hour * 3600 + min * 60 + sec);
rtc_time64_to_tm(time, tm);
@@ -93,7 +93,8 @@ static int ftrtc010_rtc_set_time(struct device *dev, struct rtc_time *tm)
hour = readl(rtc->rtc_base + FTRTC010_RTC_HOUR);
day = readl(rtc->rtc_base + FTRTC010_RTC_DAYS);
- offset = time - (day * 86400 + hour * 3600 + min * 60 + sec);
+ offset = time - ((timeu64_t)day * 86400 + (timeu64_t)hour * 3600 +
+ (timeu64_t)min * 60 + (timeu64_t)sec);
writel(offset, rtc->rtc_base + FTRTC010_RTC_RECORD);
writel(0x01, rtc->rtc_base + FTRTC010_RTC_CR);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0758/1756] ALSA: ump: Avoid dereference with max_src_size=0
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (756 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0757/1756] rtc: ftrtc010: fix integer overflow in time calculation Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0759/1756] hwrng: intel - return -ENOMEM when ioremap() fails Greg Kroah-Hartman
` (240 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit b61a2369085fd995c8ad44245d3fbd45b1216f71 ]
safe_copy_string() refers the source pointer for a NUL terminator
before verifying the source size. When max_src_size=0, it may
dereference wrongly. Fix the verification order.
Only hypothetical hardening, and we see no actual issue in the current
code, as they are all valid sources.
Fixes: e3f035edadcc ("ALSA: ump: Copy FB name string more safely")
Link: https://patch.msgid.link/20261002081823.680131-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/ump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/ump.c b/sound/core/ump.c
index 6542206747a3d..e35253cc019d2 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -66,7 +66,7 @@ static void safe_copy_string(void *dst, size_t max_dst_size,
if (!max_dst_size--)
return;
- for (s = src; max_dst_size && *s && max_src_size--; s++) {
+ for (s = src; max_dst_size && max_src_size-- && *s; s++) {
if (!isascii(*s) || !isprint(*s))
continue;
*d++ = *s;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0759/1756] hwrng: intel - return -ENOMEM when ioremap() fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (757 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0758/1756] ALSA: ump: Avoid dereference with max_src_size=0 Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0760/1756] clocksource/drivers/dbx500-prcmu: Check timer register mapping Greg Kroah-Hartman
` (239 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Thorsten Blum, Herbert Xu,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thorsten Blum <blum@kernel.org>
[ Upstream commit 4c3ca7c8c152278332590bfd3df1b0f086364759 ]
intel_init_hw_struct() incorrectly returns -EBUSY when ioremap() fails.
Return -ENOMEM instead.
Fixes: c24c95a085c6 ("[PATCH] fix Intel RNG detection")
Signed-off-by: Thorsten Blum <blum@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/char/hw_random/intel-rng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index 94f7116e96682..789a5c709ba87 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -318,8 +318,8 @@ PFX "RNG, try using the 'no_fwh_detect' option.\n";
}
intel_rng_hw->mem = ioremap(INTEL_FWH_ADDR, INTEL_FWH_ADDR_LEN);
- if (intel_rng_hw->mem == NULL)
- return -EBUSY;
+ if (!intel_rng_hw->mem)
+ return -ENOMEM;
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0760/1756] clocksource/drivers/dbx500-prcmu: Check timer register mapping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (758 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0759/1756] hwrng: intel - return -ENOMEM when ioremap() fails Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0761/1756] isofs: return long Joliet names whole Greg Kroah-Hartman
` (238 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Slavin Liu, Daniel Lezcano,
Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <bolin.liu@seu.edu.cn>
[ Upstream commit 8f30b035a6676e292ee8e54334711d9905dd0495 ]
Return -ENOMEM if of_iomap() fails, before reading or configuring
the timer register block.
Detected by static analysis and reviewed with AI-assisted source auditing.
Fixes: 9d2aa8c7961a ("ARM/clocksource: use automatic DT probing for ux500 PRCMU")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260911060917.94310-1-bolin.liu@seu.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clocksource/clksrc-dbx500-prcmu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clocksource/clksrc-dbx500-prcmu.c b/drivers/clocksource/clksrc-dbx500-prcmu.c
index 2fc93e46cea38..1af223b0e8963 100644
--- a/drivers/clocksource/clksrc-dbx500-prcmu.c
+++ b/drivers/clocksource/clksrc-dbx500-prcmu.c
@@ -52,6 +52,8 @@ static struct clocksource clocksource_dbx500_prcmu = {
static int __init clksrc_dbx500_prcmu_init(struct device_node *node)
{
clksrc_dbx500_timer_base = of_iomap(node, 0);
+ if (!clksrc_dbx500_timer_base)
+ return -ENOMEM;
/*
* The A9 sub system expects the timer to be configured as
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0761/1756] isofs: return long Joliet names whole
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (759 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0760/1756] clocksource/drivers/dbx500-prcmu: Check timer register mapping Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0762/1756] ASoC: dwc: Use OF match data again for StarFive JH7110 Greg Kroah-Hartman
` (237 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthias Goergens, Jan Kara,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Goergens <matthias.goergens@gmail.com>
[ Upstream commit b8253bcf92d6365b20eea6465f5a93c9fc4aa029 ]
get_joliet_filename() writes into a buffer allocated by its caller but
is not told how big that buffer is. It hardcodes PAGE_SIZE as the
output limit for utf16s_to_utf8s() and gives uni16_to_x8() no limit at
all. PAGE_SIZE was never the right bound. Before commit b2eb2e288604
("isofs: Drop support of directory entries straddling blocks") both
callers allocated a page, but only its first 1024 bytes were for the
name, the rest holding a copy of a directory record that straddled a
block. It could not overflow only because a directory record holds at
most 222 bytes of name (255 bytes, 33 of them fixed), which no converter
expands beyond 1024 bytes.
It also keeps the converted length in an unsigned char. 222 bytes of
name are 111 UTF-16 units, and the UTF-8 converter, used for
iocharset=utf8 and when CONFIG_NLS_DEFAULT is "utf8", needs three bytes
for each CJK, Thai or Devanagari character, so such a name can take up
to 333 bytes. Past 255 the length wraps. readdir then reports a short
name that usually ends in the middle of a UTF-8 sequence, and lookup
finds the file only under that name, never under its real one; a name
that wraps to exactly 0 bytes is not listed at all.
Such names are out of spec, since Joliet allows 64 units, but common
tools write them: PowerISO 9.5 and UltraISO 9.76 both keep up to 110
units by default. Windows, for which Joliet was made, returns them
whole, including 111-unit names in records that leave out the padding
byte.
Return them whole here too. Pass the buffer size down and have both
converters respect it. utf16s_to_utf8s() stops before a character that
does not fit, and uni16_to_x8() now hands uni2char() the space that
actually remains and stops on -ENAMETOOLONG, as fs/hfsplus/unicode.c
does. Both callers pass JOLIET_NAME_MAX + 1, room for 111 units at
three bytes each plus the terminator; no character set needs more than
three bytes for a UTF-16 unit, and isofs_dir_record_valid() already
rejects a record whose name_len claims more than the record holds, so no
name is cut. Make the length an int, which is what both converters
return.
These names are longer than NAME_MAX. POSIX lets the limit vary by
filesystem, reported by pathconf(_PC_NAME_MAX), and the VFS limits a
name only by PATH_MAX (verify_dirent_name() in fs/readdir.c).
vfat, exfat, hfsplus and ntfs3 already return names of up to 255 UTF-16
units, 765 bytes of UTF-8, and such names break the same things there:
copying the file to a filesystem with a 255-byte limit, such as ext4 or
tmpfs, fails with ENAMETOOLONG, and cp, tar, rsync and Python's shutil
report that file and carry on with the rest, so the copy is incomplete
but says so. glibc's readdir() returns the names, but the deprecated
readdir_r() skips them and fails with ENAMETOOLONG, and an inotify
reader with the buffer size inotify(7) suggests gets EINVAL. In the
kernel, fanotify reports events on such a file without its name and
warns once in fanotify_info_copy_name(), and a directory with such a
name cannot be reconnected from a file handle, because the generic
get_name() in fs/exportfs, which isofs uses, skips names longer than
NAME_MAX. Cutting at NAME_MAX would avoid these, but would list names
that Windows does not show and that can coincide within a directory.
Every name of at most 255 bytes is returned exactly as before.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Matthias Goergens <matthias.goergens@gmail.com>
Link: https://patch.msgid.link/20260926042916.3277409-2-matthias.goergens@gmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/isofs/dir.c | 4 +++-
fs/isofs/isofs.h | 11 ++++++++++-
fs/isofs/joliet.c | 27 ++++++++++++++++++++-------
fs/isofs/namei.c | 3 ++-
4 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index 09df40b612fbf..f55528bb376af 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -215,7 +215,9 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
if (map) {
#ifdef CONFIG_JOLIET
if (sbi->s_joliet_level) {
- len = get_joliet_filename(de, tmpname, inode);
+ len = get_joliet_filename(de, tmpname,
+ JOLIET_NAME_MAX + 1,
+ inode);
p = tmpname;
} else
#endif
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h
index a36a634797435..0070c163b7250 100644
--- a/fs/isofs/isofs.h
+++ b/fs/isofs/isofs.h
@@ -118,7 +118,16 @@ extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *,
extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
extern int isofs_name_translate(struct iso_directory_record *, char *, struct inode *);
-int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct inode *);
+/*
+ * The longest name the Joliet converter returns, in bytes. A directory
+ * record is at most 255 bytes long, which leaves room for 111 UTF-16 units
+ * of name, and no character set needs more than three bytes for one unit.
+ */
+#define JOLIET_NAME_MAX \
+ ((255 - sizeof(struct iso_directory_record)) / 2 * 3)
+
+int get_joliet_filename(struct iso_directory_record *de, unsigned char *outname,
+ int outsize, struct inode *inode);
int get_acorn_filename(struct iso_directory_record *, char *, struct inode *);
extern struct dentry *isofs_lookup(struct inode *, struct dentry *, unsigned int flags);
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
index c0f04a1e7f695..d37e67c5e36f4 100644
--- a/fs/isofs/joliet.c
+++ b/fs/isofs/joliet.c
@@ -15,19 +15,26 @@
* Convert Unicode 16 to UTF-8 or ASCII.
*/
static int
-uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
+uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls,
+ int outsize)
{
__be16 *ip, ch;
- unsigned char *op;
+ unsigned char *op, *end;
ip = uni;
op = ascii;
+ end = ascii + outsize - 1; /* leave room for the terminator */
while ((ch = get_unaligned(ip)) && len) {
int llen;
- llen = nls->uni2char(be16_to_cpu(ch), op, NLS_MAX_CHARSET_SIZE);
+
+ if (op >= end)
+ break;
+ llen = nls->uni2char(be16_to_cpu(ch), op, end - op);
if (llen > 0)
op += llen;
+ else if (llen == -ENAMETOOLONG)
+ break;
else
*op++ = '?';
ip++;
@@ -38,21 +45,27 @@ uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
return (op - ascii);
}
+/*
+ * Convert the Joliet name of @de into @outname, a buffer of @outsize bytes.
+ * The result is at most @outsize - 1 bytes long; a longer name is cut at a
+ * character boundary.
+ */
int
-get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, struct inode * inode)
+get_joliet_filename(struct iso_directory_record *de, unsigned char *outname,
+ int outsize, struct inode *inode)
{
struct nls_table *nls;
- unsigned char len = 0;
+ int len = 0;
nls = ISOFS_SB(inode->i_sb)->s_nls_iocharset;
if (!nls) {
len = utf16s_to_utf8s((const wchar_t *) de->name,
de->name_len[0] >> 1, UTF16_BIG_ENDIAN,
- outname, PAGE_SIZE);
+ outname, outsize - 1);
} else {
len = uni16_to_x8(outname, (__be16 *) de->name,
- de->name_len[0] >> 1, nls);
+ de->name_len[0] >> 1, nls, outsize);
}
if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1'))
len -= 2;
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index 58f80e1b3ac0d..62c2f15fc6004 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -112,7 +112,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
dpnt = tmpname;
#ifdef CONFIG_JOLIET
} else if (sbi->s_joliet_level) {
- dlen = get_joliet_filename(de, tmpname, dir);
+ dlen = get_joliet_filename(de, tmpname,
+ JOLIET_NAME_MAX + 1, dir);
dpnt = tmpname;
#endif
} else if (sbi->s_mapping == 'a') {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0762/1756] ASoC: dwc: Use OF match data again for StarFive JH7110
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (760 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0761/1756] isofs: return long Joliet names whole Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0763/1756] iommu/arm-smmu-v3: Ensure L2 tables are visible before L1 ptrs Greg Kroah-Hartman
` (236 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuri Zaporozhets, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuri Zaporozhets <yuriz@vodafonemail.de>
[ Upstream commit d532e2f5c288556075dc429941861391118787a0 ]
Commit d6d6c513f5d2 ("ASoC: dwc: Use ops to get platform data") made
dw_i2s_probe() fetch its platform data with of_device_get_match_data(),
and commit 52ea7c0543f8 ("ASoC: dwc: i2s: Add StarFive JH7110 SoC
support") put the JH7110 configuration into the OF match table. Commit
9c97790a07dc ("ASoC: dwc: Fix non-DT instantiation") then went back to
pdev->dev.platform_data so that non-DT users such as AMD work again.
Since then the JH7110 match data is never read. The probe runs neither
the JH7110 clock and reset setup (i2s_pd_init) nor uses its capability
flags; it configures the DAI from COMP_PARAM_1 instead. On the
VisionFive 2, i2stx0 drives the bit and frame clocks for HDMI audio, but
COMP_PARAM_1 reports it as slave-only, so the sound card fails to probe:
designware-i2s 120b0000.i2s: ASoC error (-22): at snd_soc_dai_set_fmt() on 120b0000.i2s
asoc-simple-card sound-hdmi: probe with driver asoc-simple-card failed with error -22
Take the OF match data first and fall back to the platform data when
there is none, so that both DT and non-DT users get their configuration.
Tested on a VisionFive 2 v1.3B (v7.0.3 with local HDMI audio patches):
the HDMI sound card now probes and plays through i2stx0. The non-DT
path is build-tested only.
Fixes: 9c97790a07dc ("ASoC: dwc: Fix non-DT instantiation")
Assisted-by: LLM
Signed-off-by: Yuri Zaporozhets <yuriz@vodafonemail.de>
Link: https://patch.msgid.link/20261001192552.2904-1-yuriz@vodafonemail.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/dwc/dwc-i2s.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c
index 5b4f20dbf7bba..2ca74a02b30ac 100644
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -21,6 +21,7 @@
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
+#include <linux/property.h>
#include <sound/designware_i2s.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -916,13 +917,16 @@ static int jh7110_i2stx0_clk_cfg(struct i2s_clk_config_data *config)
static int dw_i2s_probe(struct platform_device *pdev)
{
- const struct i2s_platform_data *pdata = pdev->dev.platform_data;
+ const struct i2s_platform_data *pdata = device_get_match_data(&pdev->dev);
struct dw_i2s_dev *dev;
struct resource *res;
int ret, irq;
struct snd_soc_dai_driver *dw_i2s_dai;
const char *clk_id;
+ if (!pdata)
+ pdata = dev_get_platdata(&pdev->dev);
+
dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0763/1756] iommu/arm-smmu-v3: Ensure L2 tables are visible before L1 ptrs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (761 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0762/1756] ASoC: dwc: Use OF match data again for StarFive JH7110 Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0764/1756] iommu/arm-smmu-v3-test: Fix arm_smmu_v3_test_debug_print_used_bits() Greg Kroah-Hartman
` (235 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolin Chen, Jason Gunthorpe,
Mostafa Saleh, Pranjal Shrivastava, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mostafa Saleh <smostafa@google.com>
[ Upstream commit 84366fb547ed987c4857311da0e5127d95bf97e6 ]
Commit 6fabce53f6b9 ("iommu/arm-smmu-v3: Add a missing dma_wmb() for hitless STE update")
adds a dma_wmb() to arm_smmu_write_entry() to make sure stream tables
and context descriptors are observed first.
However, STE L1 table descriptors are configured directly
via WRITE_ONCE(), where before that they were zeroed with memset()
inside dma_direct_alloc() then written to abort in via memset() also
in arm_smmu_init_initial_stes() without a barrier in both cases which
means that the SMMUv3 can observe the allocated table before the
written descriptors causing it to fetch random data.
Similarly in arm_smmu_write_cd_l1_desc() where the L1 CD is written
after dma_alloc_coherent() with no barriers.
Add dma_wmb() in both cases.
Fixes: 48ec83bcbcf5 ("iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices")
Reported-by: Sashiko <>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 28331d9118b63..af3070db47460 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -1240,6 +1240,9 @@ static void arm_smmu_write_cd_l1_desc(struct arm_smmu_cdtab_l1 *dst,
{
u64 val = (l2ptr_dma & CTXDESC_L1_DESC_L2PTR_MASK) | CTXDESC_L1_DESC_V;
+ /* Ensure the zero-cleared L2 table is fully visible. */
+ dma_wmb();
+
/* The HW has 64 bit atomicity with stores to the L2 CD table */
WRITE_ONCE(dst->l2ptr, cpu_to_le64(val));
}
@@ -1511,6 +1514,9 @@ static void arm_smmu_write_strtab_l1_desc(struct arm_smmu_strtab_l1 *dst,
val |= FIELD_PREP(STRTAB_L1_DESC_SPAN, STRTAB_SPLIT + 1);
val |= l2ptr_dma & STRTAB_L1_DESC_L2PTR_MASK;
+ /* Ensure the new L2 table is fully visible. */
+ dma_wmb();
+
/* The HW has 64 bit atomicity with stores to the L2 STE table */
WRITE_ONCE(dst->l2ptr, cpu_to_le64(val));
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0764/1756] iommu/arm-smmu-v3-test: Fix arm_smmu_v3_test_debug_print_used_bits()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (762 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0763/1756] iommu/arm-smmu-v3: Ensure L2 tables are visible before L1 ptrs Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0765/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Greg Kroah-Hartman
` (234 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolin Chen, Jason Gunthorpe,
Mostafa Saleh, Pranjal Shrivastava, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mostafa Saleh <smostafa@google.com>
[ Upstream commit ce58940ccc3d1a377d238d93666c140405f8ce05 ]
arm_smmu_v3_test_debug_print_used_bits() hardcodes arm_smmu_get_ste_used()
instead of using the provided writer->ops->get_used() callback.
This caused Context Descriptors to be incorrectly parsed as STEs.
Fixes: 56e1a4cc2588 ("iommu/arm-smmu-v3: Add unit tests for arm_smmu_write_entry")
Reported-by: Sashiko <>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c
index 84baa021370a8..2c0e3b5806b9c 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c
@@ -97,8 +97,8 @@ arm_smmu_v3_test_debug_print_used_bits(struct arm_smmu_entry_writer *writer,
{
__le64 used_bits[NUM_ENTRY_QWORDS] = {};
- arm_smmu_get_ste_used(ste, used_bits);
- pr_debug("STE used bits: ");
+ writer->ops->get_used(ste, used_bits);
+ pr_debug("Entry used bits: ");
print_hex_dump_debug(" ", DUMP_PREFIX_NONE, 16, 8, used_bits,
sizeof(used_bits), false);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0765/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (763 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0764/1756] iommu/arm-smmu-v3-test: Fix arm_smmu_v3_test_debug_print_used_bits() Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0766/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Greg Kroah-Hartman
` (233 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Neil Armstrong,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
[ Upstream commit 0b825126590879812321cdab53786fcd906f7761 ]
The SPI NOR flash uses six lines, but nor_pins covers only four: data,
clock and chip select. Nothing claims HOLD# (BOOT_3) and WP# (BOOT_7),
so they keep the boot ROM setting. After a boot from SPI they are in
the nor function and the flash works. After a boot from SD with the
button under the board, they stay eMMC data lines pulled low, and
spi-nor reports "unrecognized JEDEC id bytes: 00 00 00 00 00 00".
Add them as a separate group in meson-g12-common.dtsi rather than to
nor_pins: whether HOLD# and WP# reach the SoC depends on the board. The
HC4 has eMMC disabled and takes both groups.
Tested on ODROID-HC4: with BOOT_3 and BOOT_7 set back to eMMC with
pull-down and spifc rebound, the flash fails as above without this
patch and probes as a 16 MiB mtd0 with it.
Fixes: 7178f340e929 ("arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4")
Assisted-by: LLM
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20261002-hc4-spi-nor-v2-1-8366a4f91049@iav.lv
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 9 +++++++++
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index e0ddb28a34c29..340abeb0bfdae 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -615,6 +615,15 @@ mux {
};
};
+ nor_hold_wp_pins: nor-hold-wp {
+ mux {
+ groups = "nor_hold",
+ "nor_wp";
+ function = "nor";
+ bias-disable;
+ };
+ };
+
pdm_din0_a_pins: pdm-din0-a {
mux {
groups = "pdm_din0_a";
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
index 0170139b8d32f..68d0bf032efd4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
@@ -124,7 +124,7 @@ &sd_emmc_c {
&spifc {
status = "okay";
- pinctrl-0 = <&nor_pins>;
+ pinctrl-0 = <&nor_pins>, <&nor_hold_wp_pins>;
pinctrl-names = "default";
flash@0 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0766/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (764 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0765/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0767/1756] soc/tegra: flowctrl: Release OF node reference on error Greg Kroah-Hartman
` (232 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Neil Armstrong, Igor Velkov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
[ Upstream commit b44e2be772f866985cafdf90355285069ea68495 ]
At 104 MHz, reads return corrupted data: bit 0 of the first byte of a
transfer flips from 0 to 1 part of the time. The same byte read as the
second byte of a transfer was correct in all 100 reads. One 4 KiB block
read 200 times came back wrong 157 times. Writes are unaffected.
flashcp verifies while it writes, so a bootloader update erases blocks
it should skip and can abort halfway, with the flash half written.
The Hardkernel vendor device tree for this board uses 40 MHz. At 40 MHz
the same tests pass: 200 block reads with no mismatch, and 14 flashcp
runs with no block erased.
Tested on ODROID-HC4 with an XT25F128B.
Fixes: 7178f340e929 ("arm64: dts: meson-sm1-odroid-hc4: add spifc node to ODROID-HC4")
Assisted-by: LLM
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Igor Velkov <iav@iav.lv>
Link: https://patch.msgid.link/20261002-hc4-spi-nor-v2-2-8366a4f91049@iav.lv
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
index 68d0bf032efd4..b14b713414f73 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
@@ -132,7 +132,7 @@ flash@0 {
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <0>;
- spi-max-frequency = <104000000>;
+ spi-max-frequency = <40000000>;
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0767/1756] soc/tegra: flowctrl: Release OF node reference on error
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (765 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0766/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0768/1756] drm/msm/dp: dont report link training success after a reinit Greg Kroah-Hartman
` (231 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yuho Choi, Thierry Reding,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yuho Choi <dbgh9129@gmail.com>
[ Upstream commit 4eaed7ea6ab36e1160d660b05551702c36dfed6c ]
tegra_flowctrl_init() obtains a reference from
of_find_matching_node() and currently releases it only after
of_address_to_resource() succeeds.
Release the reference before checking the resource conversion result so
the error path is balanced as well.
Fixes: 1fd09e5d884a ("soc/tegra: Add initial flowctrl support for Tegra132/210")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/tegra/flowctrl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/tegra/flowctrl.c b/drivers/soc/tegra/flowctrl.c
index 221202db33130..d5c3af586d31f 100644
--- a/drivers/soc/tegra/flowctrl.c
+++ b/drivers/soc/tegra/flowctrl.c
@@ -195,11 +195,14 @@ static int __init tegra_flowctrl_init(void)
np = of_find_matching_node(NULL, tegra_flowctrl_match);
if (np) {
- if (of_address_to_resource(np, 0, &res) < 0) {
+ int err = of_address_to_resource(np, 0, &res);
+
+ of_node_put(np);
+
+ if (err < 0) {
pr_err("failed to get flowctrl register\n");
return -ENXIO;
}
- of_node_put(np);
} else if (IS_ENABLED(CONFIG_ARM)) {
/*
* Hardcoded fallback for 32-bit Tegra
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0768/1756] drm/msm/dp: dont report link training success after a reinit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (766 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0767/1756] soc/tegra: flowctrl: Release OF node reference on error Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0769/1756] drm/msm/dpu: disable the slave encoder before the master Greg Kroah-Hartman
` (230 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Keri, Dmitry Baryshkov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Keri <okerixx@gmail.com>
[ Upstream commit a47987366e7fc2c05aeffc97f8e1f776e583f792 ]
When every training attempt fails, the retry loop in
msm_dp_ctrl_on_link() ends on a successful
msm_dp_ctrl_reinitialize_mainlink(), leaving rc at 0. The caller then
enables the stream on an untrained link and the display stays dark.
The retry counter only reaches zero in that case, so treat it as a
training failure.
Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
Signed-off-by: Oleg Keri <okerixx@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/756528/
Link: https://lore.kernel.org/r/20260925125314.16563-1-okerixx@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/dp/dp_ctrl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
index f342fc5ae41ec..90deffb9fbddc 100644
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
+++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
@@ -1915,6 +1915,9 @@ int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl)
if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN)
return rc;
+ if (!link_train_max_retries)
+ rc = -ETIMEDOUT;
+
if (rc == 0) { /* link train successfully */
/*
* do not stop train pattern here
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0769/1756] drm/msm/dpu: disable the slave encoder before the master
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (767 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0768/1756] drm/msm/dp: dont report link training success after a reinit Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0770/1756] drm/msm/dpu: extract bandwidth aggregation function Greg Kroah-Hartman
` (229 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Joonhoe Kim,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonhoe Kim <26rote@gmail.com>
[ Upstream commit 32d04280ddebb6eb964990931b0f1001f63b35e7 ]
dpu_encoder_virt_atomic_disable() disables the physical encoders in
phys_encs[] order, i.e. the master first. With a split display (two
interfaces on one CTL, e.g. bonded DSI) the master's
dpu_encoder_helper_phys_cleanup() then resets the shared CTL while the
slave's timing engine is still running, and the source pipe is left
stalled half-way through the slave's next frame.
A power collapse of the MDSS core GDSC clears the stall, so it normally
goes unnoticed. When MDSS stays powered across the disable (a full
modeset, or an active DP controller), the next enable scans out
nothing: black screen with the backlight on.
Disable the slave before the master, as atomic_enable() enables them in
that order. The slave's cleanup still resets the CTL while the master is
running, but the last reset, from the master's cleanup, now happens with
both timing engines stopped.
Tested on a Lenovo Legion Tab Y700 gen 5 (SM8850, bonded DSI video-mode
panel) with MDSS kept active:
echo on > /sys/bus/platform/devices/9800000.display-subsystem/power/control
DPMS off/on: black 10/10 before, picture 10/10 after. Full modesets were
not retested with this version. Only tested on this device.
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Fixes: 22cb02bc96ff ("drm/msm/disp/dpu: reset the datapath after timing engine disable")
Assisted-by: LLM
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757684/
Link: https://lore.kernel.org/r/20261002130712.50612-1-26rote@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 170d60bb7602d..66759c8a3d8b5 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1320,7 +1320,6 @@ static void dpu_encoder_virt_atomic_disable(struct drm_encoder *drm_enc,
struct dpu_encoder_virt *dpu_enc = NULL;
struct drm_crtc *crtc;
struct drm_crtc_state *old_state = NULL;
- int i = 0;
dpu_enc = to_dpu_encoder_virt(drm_enc);
DPU_DEBUG_ENC(dpu_enc, "\n");
@@ -1346,12 +1345,11 @@ static void dpu_encoder_virt_atomic_disable(struct drm_encoder *drm_enc,
dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_PRE_STOP);
- for (i = 0; i < dpu_enc->num_phys_encs; i++) {
- struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
+ if (dpu_enc->cur_slave && dpu_enc->cur_slave->ops.disable)
+ dpu_enc->cur_slave->ops.disable(dpu_enc->cur_slave);
- if (phys->ops.disable)
- phys->ops.disable(phys);
- }
+ if (dpu_enc->cur_master && dpu_enc->cur_master->ops.disable)
+ dpu_enc->cur_master->ops.disable(dpu_enc->cur_master);
/* after phys waits for frame-done, should be no more frames pending */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0770/1756] drm/msm/dpu: extract bandwidth aggregation function
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (768 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0769/1756] drm/msm/dpu: disable the slave encoder before the master Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0771/1756] drm/msm/dpu: change ib values to u32 Greg Kroah-Hartman
` (228 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abhinav Kumar, Dmitry Baryshkov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[ Upstream commit b9aedd32a81792f5b4b7716815aba375ebaff526 ]
In preparation to refactoring the dpu_core_perf debugfs interface,
extract the bandwidth aggregation function from
_dpu_core_perf_crtc_update_bus().
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/636058/
Link: https://lore.kernel.org/r/20250209-dpu-perf-rework-v5-1-87e936cf3004@linaro.org
Stable-dep-of: 480ba24aa340 ("drm/msm/dpu: compute the CRTC bandwidth from the state being checked")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 45 ++++++++++---------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index d29df73c02c5f..63080510456cf 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -204,36 +204,41 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,
return 0;
}
-static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
- struct drm_crtc *crtc)
+static void dpu_core_perf_aggregate(struct drm_device *ddev,
+ enum dpu_crtc_client_type curr_client_type,
+ struct dpu_core_perf_params *perf)
{
- struct dpu_core_perf_params perf = { 0 };
- enum dpu_crtc_client_type curr_client_type
- = dpu_crtc_get_client_type(crtc);
- struct drm_crtc *tmp_crtc;
struct dpu_crtc_state *dpu_cstate;
- int i, ret = 0;
- u64 avg_bw;
-
- if (!kms->num_paths)
- return 0;
+ struct drm_crtc *tmp_crtc;
- drm_for_each_crtc(tmp_crtc, crtc->dev) {
+ drm_for_each_crtc(tmp_crtc, ddev) {
if (tmp_crtc->enabled &&
- curr_client_type ==
- dpu_crtc_get_client_type(tmp_crtc)) {
+ curr_client_type == dpu_crtc_get_client_type(tmp_crtc)) {
dpu_cstate = to_dpu_crtc_state(tmp_crtc->state);
- perf.max_per_pipe_ib = max(perf.max_per_pipe_ib,
- dpu_cstate->new_perf.max_per_pipe_ib);
+ perf->max_per_pipe_ib = max(perf->max_per_pipe_ib,
+ dpu_cstate->new_perf.max_per_pipe_ib);
- perf.bw_ctl += dpu_cstate->new_perf.bw_ctl;
+ perf->bw_ctl += dpu_cstate->new_perf.bw_ctl;
- DRM_DEBUG_ATOMIC("crtc=%d bw=%llu paths:%d\n",
- tmp_crtc->base.id,
- dpu_cstate->new_perf.bw_ctl, kms->num_paths);
+ DRM_DEBUG_ATOMIC("crtc=%d bw=%llu\n",
+ tmp_crtc->base.id,
+ dpu_cstate->new_perf.bw_ctl);
}
}
+}
+
+static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
+ struct drm_crtc *crtc)
+{
+ struct dpu_core_perf_params perf = { 0 };
+ int i, ret = 0;
+ u64 avg_bw;
+
+ if (!kms->num_paths)
+ return 0;
+
+ dpu_core_perf_aggregate(crtc->dev, dpu_crtc_get_client_type(crtc), &perf);
avg_bw = perf.bw_ctl;
do_div(avg_bw, (kms->num_paths * 1000)); /*Bps_to_icc*/
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0771/1756] drm/msm/dpu: change ib values to u32
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (769 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0770/1756] drm/msm/dpu: extract bandwidth aggregation function Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0772/1756] drm/msm/dpu: make fix_core_ab_vote consistent with fix_core_ib_vote Greg Kroah-Hartman
` (227 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abhinav Kumar, Dmitry Baryshkov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[ Upstream commit c54b61102f468cef440423a57341a95763a287a3 ]
The IB values in core_perf calculations (max_per_pipe_ib,
fix_core_ib_vote) are expressed in KBps and are passed to icc_set_bw
without additional division. Change type of those values to u32.
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/636061/
Link: https://lore.kernel.org/r/20250209-dpu-perf-rework-v5-3-87e936cf3004@linaro.org
Stable-dep-of: 480ba24aa340 ("drm/msm/dpu: compute the CRTC bandwidth from the state being checked")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++--
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 +++---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 63080510456cf..4f30e8e0276fe 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -135,7 +135,7 @@ static void _dpu_core_perf_calc_crtc(const struct dpu_core_perf *core_perf,
}
DRM_DEBUG_ATOMIC(
- "crtc=%d clk_rate=%llu core_ib=%llu core_ab=%llu\n",
+ "crtc=%d clk_rate=%llu core_ib=%u core_ab=%llu\n",
crtc->base.id, perf->core_clk_rate,
perf->max_per_pipe_ib, perf->bw_ctl);
}
@@ -482,7 +482,7 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent)
(u32 *)perf, &dpu_core_perf_mode_fops);
debugfs_create_u64("fix_core_clk_rate", 0600, entry,
&perf->fix_core_clk_rate);
- debugfs_create_u64("fix_core_ib_vote", 0600, entry,
+ debugfs_create_u32("fix_core_ib_vote", 0600, entry,
&perf->fix_core_ib_vote);
debugfs_create_u64("fix_core_ab_vote", 0600, entry,
&perf->fix_core_ab_vote);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
index 4186977390bd8..bfbcb84a27064 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
@@ -19,7 +19,7 @@
* @core_clk_rate: core clock rate request
*/
struct dpu_core_perf_params {
- u64 max_per_pipe_ib;
+ u32 max_per_pipe_ib;
u64 bw_ctl;
u64 core_clk_rate;
};
@@ -40,7 +40,7 @@ struct dpu_core_perf_tune {
* @perf_tune: debug control for performance tuning
* @enable_bw_release: debug control for bandwidth release
* @fix_core_clk_rate: fixed core clock request in Hz used in mode 2
- * @fix_core_ib_vote: fixed core ib vote in bps used in mode 2
+ * @fix_core_ib_vote: fixed core ib vote in KBps used in mode 2
* @fix_core_ab_vote: fixed core ab vote in bps used in mode 2
*/
struct dpu_core_perf {
@@ -50,7 +50,7 @@ struct dpu_core_perf {
struct dpu_core_perf_tune perf_tune;
u32 enable_bw_release;
u64 fix_core_clk_rate;
- u64 fix_core_ib_vote;
+ u32 fix_core_ib_vote;
u64 fix_core_ab_vote;
};
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index ecd595215a6be..7486c19bb35d9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1386,7 +1386,7 @@ static int dpu_crtc_debugfs_state_show(struct seq_file *s, void *v)
seq_printf(s, "core_clk_rate: %llu\n",
dpu_crtc->cur_perf.core_clk_rate);
seq_printf(s, "bw_ctl: %llu\n", dpu_crtc->cur_perf.bw_ctl);
- seq_printf(s, "max_per_pipe_ib: %llu\n",
+ seq_printf(s, "max_per_pipe_ib: %u\n",
dpu_crtc->cur_perf.max_per_pipe_ib);
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0772/1756] drm/msm/dpu: make fix_core_ab_vote consistent with fix_core_ib_vote
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (770 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0771/1756] drm/msm/dpu: change ib values to u32 Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0773/1756] drm/msm/dpu: drop core_clk_rate overrides from _dpu_core_perf_calc_crtc Greg Kroah-Hartman
` (226 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Abhinav Kumar,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[ Upstream commit 879a7f8c8c2d727bc4c8ae3238f0dbf52eada6db ]
The fix_core_ab_vote is an average bandwidth value, used for bandwidth
overrides in several cases. However there is an internal inconsistency:
fix_core_ib_vote is defined in KBps, while fix_core_ab_vote is defined
in Bps.
Fix that by changing the type of the variable to u32 and using * 1000ULL
multiplier when setting up the dpu_core_perf_params::bw_ctl value.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/636064/
Link: https://lore.kernel.org/r/20250209-dpu-perf-rework-v5-4-87e936cf3004@linaro.org
Stable-dep-of: 480ba24aa340 ("drm/msm/dpu: compute the CRTC bandwidth from the state being checked")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++--
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 4f30e8e0276fe..9ddeafe8f8f54 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -125,7 +125,7 @@ static void _dpu_core_perf_calc_crtc(const struct dpu_core_perf *core_perf,
perf->max_per_pipe_ib = 0;
perf->core_clk_rate = 0;
} else if (core_perf->perf_tune.mode == DPU_PERF_MODE_FIXED) {
- perf->bw_ctl = core_perf->fix_core_ab_vote;
+ perf->bw_ctl = core_perf->fix_core_ab_vote * 1000ULL;
perf->max_per_pipe_ib = core_perf->fix_core_ib_vote;
perf->core_clk_rate = core_perf->fix_core_clk_rate;
} else {
@@ -484,7 +484,7 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent)
&perf->fix_core_clk_rate);
debugfs_create_u32("fix_core_ib_vote", 0600, entry,
&perf->fix_core_ib_vote);
- debugfs_create_u64("fix_core_ab_vote", 0600, entry,
+ debugfs_create_u32("fix_core_ab_vote", 0600, entry,
&perf->fix_core_ab_vote);
return 0;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
index bfbcb84a27064..7d99dcebb6feb 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h
@@ -41,7 +41,7 @@ struct dpu_core_perf_tune {
* @enable_bw_release: debug control for bandwidth release
* @fix_core_clk_rate: fixed core clock request in Hz used in mode 2
* @fix_core_ib_vote: fixed core ib vote in KBps used in mode 2
- * @fix_core_ab_vote: fixed core ab vote in bps used in mode 2
+ * @fix_core_ab_vote: fixed core ab vote in KBps used in mode 2
*/
struct dpu_core_perf {
const struct dpu_perf_cfg *perf_cfg;
@@ -51,7 +51,7 @@ struct dpu_core_perf {
u32 enable_bw_release;
u64 fix_core_clk_rate;
u32 fix_core_ib_vote;
- u64 fix_core_ab_vote;
+ u32 fix_core_ab_vote;
};
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0773/1756] drm/msm/dpu: drop core_clk_rate overrides from _dpu_core_perf_calc_crtc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (771 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0772/1756] drm/msm/dpu: make fix_core_ab_vote consistent with fix_core_ib_vote Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0774/1756] drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus() Greg Kroah-Hartman
` (225 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Abhinav Kumar,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[ Upstream commit e7e2495595e01839b117e9c08500ff80cd218f6a ]
core_clk_rate override is handled in _dpu_core_perf_get_core_clk_rate().
Drop imperfect duplicating code from _dpu_core_perf_calc_crtc().
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/636070/
Link: https://lore.kernel.org/r/20250209-dpu-perf-rework-v5-7-87e936cf3004@linaro.org
Stable-dep-of: 480ba24aa340 ("drm/msm/dpu: compute the CRTC bandwidth from the state being checked")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 9ddeafe8f8f54..2c805356ae207 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -123,16 +123,14 @@ static void _dpu_core_perf_calc_crtc(const struct dpu_core_perf *core_perf,
if (core_perf->perf_tune.mode == DPU_PERF_MODE_MINIMUM) {
perf->bw_ctl = 0;
perf->max_per_pipe_ib = 0;
- perf->core_clk_rate = 0;
} else if (core_perf->perf_tune.mode == DPU_PERF_MODE_FIXED) {
perf->bw_ctl = core_perf->fix_core_ab_vote * 1000ULL;
perf->max_per_pipe_ib = core_perf->fix_core_ib_vote;
- perf->core_clk_rate = core_perf->fix_core_clk_rate;
} else {
perf->bw_ctl = _dpu_core_perf_calc_bw(perf_cfg, crtc);
perf->max_per_pipe_ib = perf_cfg->min_dram_ib;
- perf->core_clk_rate = _dpu_core_perf_calc_clk(perf_cfg, crtc, state);
}
+ perf->core_clk_rate = _dpu_core_perf_calc_clk(perf_cfg, crtc, state);
DRM_DEBUG_ATOMIC(
"crtc=%d clk_rate=%llu core_ib=%u core_ab=%llu\n",
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0774/1756] drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (772 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0773/1756] drm/msm/dpu: drop core_clk_rate overrides from _dpu_core_perf_calc_crtc Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0775/1756] drm/msm/dpu: compute the CRTC bandwidth from the state being checked Greg Kroah-Hartman
` (224 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Abhinav Kumar,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[ Upstream commit 6d3175a72cc07e90f81fb35841048a8a9b5134cb ]
Move perf mode handling for the bandwidth to
_dpu_core_perf_crtc_update_bus() rather than overriding per-CRTC data
and then aggregating known values.
Note, this changes the fix_core_ab_vote. Previously it would be
multiplied per the CRTC number, now it will be used directly for
interconnect voting. This better reflects user requirements in the case
of different resolutions being set on different CRTCs: instead of using
the same bandwidth for each CRTC (which is incorrect) user can now
calculate overall bandwidth required by all outputs and use that value.
Note #2: this also disables threshold checks for user-entered bandwidth
values. First of all, it doesn't make sense to fail atomic commits
because of the debugfs input. Compositors have no way to correlate
failing commits with debugfs settings. Second, it makes sense to allow
users to go beyond these values and check whether this makes any
difference or fixes the issue.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/636072/
Link: https://lore.kernel.org/r/20250209-dpu-perf-rework-v5-8-87e936cf3004@linaro.org
Stable-dep-of: 480ba24aa340 ("drm/msm/dpu: compute the CRTC bandwidth from the state being checked")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 36 +++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index 2c805356ae207..f9631806ec807 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -118,20 +118,9 @@ static void _dpu_core_perf_calc_crtc(const struct dpu_core_perf *core_perf,
return;
}
- memset(perf, 0, sizeof(struct dpu_core_perf_params));
-
- if (core_perf->perf_tune.mode == DPU_PERF_MODE_MINIMUM) {
- perf->bw_ctl = 0;
- perf->max_per_pipe_ib = 0;
- } else if (core_perf->perf_tune.mode == DPU_PERF_MODE_FIXED) {
- perf->bw_ctl = core_perf->fix_core_ab_vote * 1000ULL;
- perf->max_per_pipe_ib = core_perf->fix_core_ib_vote;
- } else {
- perf->bw_ctl = _dpu_core_perf_calc_bw(perf_cfg, crtc);
- perf->max_per_pipe_ib = perf_cfg->min_dram_ib;
- }
+ perf->bw_ctl = _dpu_core_perf_calc_bw(perf_cfg, crtc);
+ perf->max_per_pipe_ib = perf_cfg->min_dram_ib;
perf->core_clk_rate = _dpu_core_perf_calc_clk(perf_cfg, crtc, state);
-
DRM_DEBUG_ATOMIC(
"crtc=%d clk_rate=%llu core_ib=%u core_ab=%llu\n",
crtc->base.id, perf->core_clk_rate,
@@ -231,18 +220,29 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
{
struct dpu_core_perf_params perf = { 0 };
int i, ret = 0;
- u64 avg_bw;
+ u32 avg_bw;
+ u32 peak_bw;
if (!kms->num_paths)
return 0;
- dpu_core_perf_aggregate(crtc->dev, dpu_crtc_get_client_type(crtc), &perf);
+ if (kms->perf.perf_tune.mode == DPU_PERF_MODE_MINIMUM) {
+ avg_bw = 0;
+ peak_bw = 0;
+ } else if (kms->perf.perf_tune.mode == DPU_PERF_MODE_FIXED) {
+ avg_bw = kms->perf.fix_core_ab_vote;
+ peak_bw = kms->perf.fix_core_ib_vote;
+ } else {
+ dpu_core_perf_aggregate(crtc->dev, dpu_crtc_get_client_type(crtc), &perf);
+
+ avg_bw = div_u64(perf.bw_ctl, 1000); /*Bps_to_icc*/
+ peak_bw = perf.max_per_pipe_ib;
+ }
- avg_bw = perf.bw_ctl;
- do_div(avg_bw, (kms->num_paths * 1000)); /*Bps_to_icc*/
+ avg_bw /= kms->num_paths;
for (i = 0; i < kms->num_paths; i++)
- icc_set_bw(kms->path[i], avg_bw, perf.max_per_pipe_ib);
+ icc_set_bw(kms->path[i], avg_bw, peak_bw);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0775/1756] drm/msm/dpu: compute the CRTC bandwidth from the state being checked
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (773 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0774/1756] drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus() Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0776/1756] phy: HiSilicon: Fix error handling in hi3670_pcie_allclk_ctrl() Greg Kroah-Hartman
` (223 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joonhoe Kim, Dmitry Baryshkov,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonhoe Kim <26rote@gmail.com>
[ Upstream commit 480ba24aa34031c898d0a711405664cd947bbee4 ]
_dpu_core_perf_calc_bw() is called with the new CRTC state but sums
plane_fetch_bw over drm_atomic_crtc_for_each_plane(), i.e. the planes
of the committed state. When the CRTC is re-enabled (DPMS on, system
resume) the committed state has no planes attached, so the check
computes bw_ctl = 0 and the display runs without an average bandwidth
vote on the MDP path until some later commit changes a plane -- which
may not happen for a long time on a static screen such as a lock
screen.
Seen on a Lenovo TB323FU (SM8850) through the interconnect and DPU
tracepoints: after DPMS off/on or s2idle, dpu_perf_crtc_update reported
bw_ctl=0 and qnm_mdp was left at avg_bw=0 (peak 800000) instead of the
3728793 kBps voted before, until the next mode change.
Iterate the plane states of the CRTC state being checked instead.
drm_atomic_crtc_state_for_each_plane_state() falls back to the current
plane state for planes that are not part of the commit, so the result
is unchanged for commits that do touch the planes.
With this, bw_ctl is 3728793600 right after DPMS on and after resume.
Only tested on this device.
Fixes: c33b7c0389e1 ("drm/msm/dpu: add support for clk and bw scaling for display")
Assisted-by: LLM
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757683/
Link: https://lore.kernel.org/r/20261002130656.50577-1-26rote@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
index f9631806ec807..170184941b1f2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
@@ -34,24 +34,19 @@ enum dpu_perf_mode {
/**
* _dpu_core_perf_calc_bw() - to calculate BW per crtc
* @perf_cfg: performance configuration
- * @crtc: pointer to a crtc
+ * @state: the CRTC state
* Return: returns aggregated BW for all planes in crtc.
*/
static u64 _dpu_core_perf_calc_bw(const struct dpu_perf_cfg *perf_cfg,
- struct drm_crtc *crtc)
+ struct drm_crtc_state *state)
{
struct drm_plane *plane;
- struct dpu_plane_state *pstate;
+ const struct drm_plane_state *plane_state;
u64 crtc_plane_bw = 0;
u32 bw_factor;
- drm_atomic_crtc_for_each_plane(plane, crtc) {
- pstate = to_dpu_plane_state(plane->state);
- if (!pstate)
- continue;
-
- crtc_plane_bw += pstate->plane_fetch_bw;
- }
+ drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, state)
+ crtc_plane_bw += to_dpu_plane_state(plane_state)->plane_fetch_bw;
bw_factor = perf_cfg->bw_inefficiency_factor;
if (bw_factor) {
@@ -118,7 +113,7 @@ static void _dpu_core_perf_calc_crtc(const struct dpu_core_perf *core_perf,
return;
}
- perf->bw_ctl = _dpu_core_perf_calc_bw(perf_cfg, crtc);
+ perf->bw_ctl = _dpu_core_perf_calc_bw(perf_cfg, state);
perf->max_per_pipe_ib = perf_cfg->min_dram_ib;
perf->core_clk_rate = _dpu_core_perf_calc_clk(perf_cfg, crtc, state);
DRM_DEBUG_ATOMIC(
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0776/1756] phy: HiSilicon: Fix error handling in hi3670_pcie_allclk_ctrl()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (774 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0775/1756] drm/msm/dpu: compute the CRTC bandwidth from the state being checked Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0777/1756] phy: rockchip: usbdp: Update mode_change after error handling Greg Kroah-Hartman
` (222 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Akash Sukhavasi,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akash Sukhavasi <akash.sukhavasi@gmail.com>
[ Upstream commit 7540fc0a4f667b6773d10753a602a42a3113087b ]
When hi3670_pcie_pll_ctrl() fails, hi3670_pcie_allclk_ctrl() returns
-EINVAL directly, skipping the close_clocks cleanup path. This leaves
the PLL with its power-down bit cleared.
Use goto close_clocks instead, which disables the PLL and propagates
the original error code from hi3670_pcie_pll_ctrl().
Found while investigating a Smatch warning.
Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY")
Signed-off-by: Akash Sukhavasi <akash.sukhavasi@gmail.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260708-b4-hi3670-v1-1-f9236f3e585c@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/hisilicon/phy-hi3670-pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/hisilicon/phy-hi3670-pcie.c b/drivers/phy/hisilicon/phy-hi3670-pcie.c
index 6903148367dfc..e99ef06d41c81 100644
--- a/drivers/phy/hisilicon/phy-hi3670-pcie.c
+++ b/drivers/phy/hisilicon/phy-hi3670-pcie.c
@@ -476,7 +476,7 @@ static int hi3670_pcie_allclk_ctrl(struct hi3670_pcie_phy *phy, bool clk_on)
ret = hi3670_pcie_pll_ctrl(phy, true);
if (ret) {
dev_err(dev, "Failed to enable pll\n");
- return -EINVAL;
+ goto close_clocks;
}
hi3670_pcie_hp_debounce_gt(phy, true);
hi3670_pcie_phyref_gt(phy, true);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0777/1756] phy: rockchip: usbdp: Update mode_change after error handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (775 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0776/1756] phy: HiSilicon: Fix error handling in hi3670_pcie_allclk_ctrl() Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0778/1756] phy: rockchip: usbdp: Do not lose USB3 PHY status Greg Kroah-Hartman
` (221 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 3f2181226d7708349c69cd4a4b21372a8049576b ]
If rk_udphy_init() or rk_udphy_setup() fails, the reinit will not be
tried again. Fix this by only updating the variable after all potential
errors have been handled.
Note, that no errors have been seen on real hardware and failures would
most likely be fatal and require at least a full reboot as the function
already asserts the PHY reset lines. So this is more of a theoretical
issue.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-phy/20260612163835.8D5471F000E9@smtp.kernel.org/
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://lore.kernel.org/linux-phy/20260612163835.8D5471F000E9@smtp.kernel.org/
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-2-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index d2021f7941e3e..cc798a8344eb8 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1000,15 +1000,14 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
}
if (udphy->status == UDPHY_MODE_NONE) {
- udphy->mode_change = false;
ret = rk_udphy_setup(udphy);
if (ret)
return ret;
if (udphy->mode & UDPHY_MODE_USB)
rk_udphy_u3_port_disable(udphy, false);
- } else if (udphy->mode_change) {
udphy->mode_change = false;
+ } else if (udphy->mode_change) {
udphy->status = UDPHY_MODE_NONE;
if (udphy->mode == UDPHY_MODE_DP)
rk_udphy_u3_port_disable(udphy, true);
@@ -1017,6 +1016,7 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
ret = rk_udphy_setup(udphy);
if (ret)
return ret;
+ udphy->mode_change = false;
}
udphy->status |= mode;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0778/1756] phy: rockchip: usbdp: Do not lose USB3 PHY status
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (776 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0777/1756] phy: rockchip: usbdp: Update mode_change after error handling Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0779/1756] phy: rockchip: usbdp: Fix devm_clk_bulk_get_all check Greg Kroah-Hartman
` (220 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit b322403c294b67fd6bcf6719b4fc9f8a9e313129 ]
By default (i.e. without manually enabling runtime PM) DWC3 requests the
USB3 PHY once and keeps it enabled all the time. When DisplayPort is
being requested later on, a mode change is needed. This re-initializes
the PHY. During re-initialization the status variable has incorrectly
been cleared, which means the tracking information for USB3 is lost.
This is not an immediate problem, since the DP side keeps the PHY
enabled. But once DP is toggled off, the whole PHY will be disabled.
This is a problem, because the USB side still needs it powered.
Fix things by not clearing the status flags.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-3-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index cc798a8344eb8..469908926d5bf 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1008,7 +1008,6 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
rk_udphy_u3_port_disable(udphy, false);
udphy->mode_change = false;
} else if (udphy->mode_change) {
- udphy->status = UDPHY_MODE_NONE;
if (udphy->mode == UDPHY_MODE_DP)
rk_udphy_u3_port_disable(udphy, true);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0779/1756] phy: rockchip: usbdp: Fix devm_clk_bulk_get_all check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (777 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0778/1756] phy: rockchip: usbdp: Do not lose USB3 PHY status Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0780/1756] phy: rockchip: usbdp: Handle missing clock-names DT property gracefully Greg Kroah-Hartman
` (219 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit a2ddfc60a7d3ba0f571f037371b261642f8ed208 ]
If devm_clk_bulk_get_all() returns -EPROBE_DEFER, it is replaced with
-ENODEV, permanently failing the driver probe instead of allowing it to
defer. Avoid masking the error code to fix the issue.
This effectively drops returning -ENODEV in case no clocks are being
described in DT. This special case will now be handled by the follow-up
check searching for "refclk" and exit with -EINVAL.
None of this will be hit in practice, since the driver is only used by
RK3588 and RK3576 - on these platforms the DT is validated to contain
the clocks and the clock driver is force probed early. Thus there is
no need to backport this.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-phy/20260612164107.C7DB21F000E9@smtp.kernel.org/
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://lore.kernel.org/linux-phy/20260612164107.C7DB21F000E9@smtp.kernel.org/
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-4-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 469908926d5bf..f8288f9875913 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -427,8 +427,8 @@ static int rk_udphy_clk_init(struct rk_udphy *udphy, struct device *dev)
int i;
udphy->num_clks = devm_clk_bulk_get_all(dev, &udphy->clks);
- if (udphy->num_clks < 1)
- return -ENODEV;
+ if (udphy->num_clks < 0)
+ return udphy->num_clks;
/* used for configure phy reference clock frequency */
for (i = 0; i < udphy->num_clks; i++) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0780/1756] phy: rockchip: usbdp: Handle missing clock-names DT property gracefully
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (778 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0779/1756] phy: rockchip: usbdp: Fix devm_clk_bulk_get_all check Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0781/1756] phy: rockchip: usbdp: Drop seamless DP takeover Greg Kroah-Hartman
` (218 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 17cd5e026a6e806b811f915b8e02a8b9d14f6f41 ]
The rk_udphy_clk_init() function would currently try to do a strncmp for
a NULL pointer, if DT specifies 'clocks' property, but no 'clock-names'
property. Fix this by making sure the clock has an id string set.
Note that DT binding requires setting clock-names, so this is only a
problem when booting a non-compliant device tree.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/message/20260619154349.071321F000E9%40smtp.kernel.org
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-5-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index f8288f9875913..aa58b1555b9c7 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -432,6 +432,9 @@ static int rk_udphy_clk_init(struct rk_udphy *udphy, struct device *dev)
/* used for configure phy reference clock frequency */
for (i = 0; i < udphy->num_clks; i++) {
+ if (!udphy->clks[i].id)
+ continue;
+
if (!strncmp(udphy->clks[i].id, "refclk", 6)) {
udphy->refclk = udphy->clks[i].clk;
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0781/1756] phy: rockchip: usbdp: Drop seamless DP takeover
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (779 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0780/1756] phy: rockchip: usbdp: Handle missing clock-names DT property gracefully Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0782/1756] phy: rockchip: usbdp: Limit DP lane count to muxed lanes Greg Kroah-Hartman
` (217 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 1ab628ce8f3ab694c28dcfcd5b1eec0cf9f499b8 ]
Right now the DRM drivers do not support seamless DP takeover and I'm
I'm not aware of any bootloader implementing this feature either.
In any case this feature would be limited to boards using the USBDP PHY
for a DP or eDP connection instead of the more commonly USB-C connector.
With USB-C's DP AltMode a seamless DP takeover requires handing over the
state of the TCPM state machine from the bootloader to the kernel. This
in turn requires a huge amount of work to keep the state machine
implementations synchronized. It's very unlikely we will see somebody
implementing that in the foreseeable future.
As the current code is obviously buggy and untested, let's simply drop
support for seamless DP takeover. It can be re-implemented cleanly once
somebody adds all missing bits.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-phy/20260612164107.C7DB21F000E9@smtp.kernel.org/
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-6-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 31 -----------------------
1 file changed, 31 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index aa58b1555b9c7..022218e64f48e 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -452,11 +452,6 @@ static int rk_udphy_reset_assert_all(struct rk_udphy *udphy)
return reset_control_bulk_assert(udphy->num_rsts, udphy->rsts);
}
-static int rk_udphy_reset_deassert_all(struct rk_udphy *udphy)
-{
- return reset_control_bulk_deassert(udphy->num_rsts, udphy->rsts);
-}
-
static int rk_udphy_reset_deassert(struct rk_udphy *udphy, char *name)
{
struct reset_control_bulk_data *list = udphy->rsts;
@@ -924,28 +919,6 @@ static int rk_udphy_parse_lane_mux_data(struct rk_udphy *udphy)
return 0;
}
-static int rk_udphy_get_initial_status(struct rk_udphy *udphy)
-{
- int ret;
- u32 value;
-
- ret = clk_bulk_prepare_enable(udphy->num_clks, udphy->clks);
- if (ret) {
- dev_err(udphy->dev, "failed to enable clk\n");
- return ret;
- }
-
- rk_udphy_reset_deassert_all(udphy);
-
- regmap_read(udphy->pma_regmap, CMN_LANE_MUX_AND_EN_OFFSET, &value);
- if (FIELD_GET(CMN_DP_LANE_MUX_ALL, value) && FIELD_GET(CMN_DP_LANE_EN_ALL, value))
- udphy->status = UDPHY_MODE_DP;
- else
- rk_udphy_disable(udphy);
-
- return 0;
-}
-
static int rk_udphy_parse_dt(struct rk_udphy *udphy)
{
struct device *dev = udphy->dev;
@@ -1496,10 +1469,6 @@ static int rk_udphy_probe(struct platform_device *pdev)
if (ret)
return ret;
- ret = rk_udphy_get_initial_status(udphy);
- if (ret)
- return ret;
-
mutex_init(&udphy->mutex);
platform_set_drvdata(pdev, udphy);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0782/1756] phy: rockchip: usbdp: Limit DP lane count to muxed lanes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (780 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0781/1756] phy: rockchip: usbdp: Drop seamless DP takeover Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0783/1756] phy: rockchip: usbdp: add rk3576 device match data Greg Kroah-Hartman
` (216 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 443997ca8d797375ff35e8f3ad3828799e88f71b ]
In theory the DP controller could request 4 lanes when the PHY is
restricted to 2 lanes as the other half is used by USB3.
With the current user (DW-DP) this cannot happen, but as the check is
cheap and users might change in the future protect things accordingly.
Not doing so would corrupt USB3 usage by the following code configuring
the voltages.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-phy/20260612165546.98E1F1F000E9@smtp.kernel.org/
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://lore.kernel.org/linux-phy/20260612165546.98E1F1F000E9@smtp.kernel.org/
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-12-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 022218e64f48e..fa6446c1c6c0e 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1102,6 +1102,9 @@ static int rk_udphy_dp_phy_verify_link_rate(struct rk_udphy *udphy,
static int rk_udphy_dp_phy_verify_lanes(struct rk_udphy *udphy,
struct phy_configure_opts_dp *dp)
{
+ if (dp->lanes > udphy->dp_lanes)
+ return -EINVAL;
+
switch (dp->lanes) {
case 1:
case 2:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0783/1756] phy: rockchip: usbdp: add rk3576 device match data
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (781 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0782/1756] phy: rockchip: usbdp: Limit DP lane count to muxed lanes Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0784/1756] phy: rockchip: usbdp: Add missing mode_change update Greg Kroah-Hartman
` (215 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Wang, Dragan Simic,
Heiko Stuebner, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Wang <frank.wang@rock-chips.com>
[ Upstream commit a76de028c619dd18f89786805bcc7bb4d379ea9f ]
This adds RK3576 device match data support.
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Acked-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20241014020342.15974-2-frawang.cn@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: b1ca8de219ae ("phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 41 +++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index fa6446c1c6c0e..b2845070231b9 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1530,6 +1530,43 @@ static const char * const rk_udphy_rst_list[] = {
"init", "cmn", "lane", "pcs_apb", "pma_apb"
};
+static const struct rk_udphy_cfg rk3576_udphy_cfgs = {
+ .num_phys = 1,
+ .phy_ids = { 0x2b010000 },
+ .num_rsts = ARRAY_SIZE(rk_udphy_rst_list),
+ .rst_list = rk_udphy_rst_list,
+ .grfcfg = {
+ /* u2phy-grf */
+ .bvalid_phy_con = RK_UDPHY_GEN_GRF_REG(0x0010, 1, 0, 0x2, 0x3),
+ .bvalid_grf_con = RK_UDPHY_GEN_GRF_REG(0x0000, 15, 14, 0x1, 0x3),
+
+ /* usb-grf */
+ .usb3otg0_cfg = RK_UDPHY_GEN_GRF_REG(0x0030, 15, 0, 0x1100, 0x0188),
+
+ /* usbdpphy-grf */
+ .low_pwrn = RK_UDPHY_GEN_GRF_REG(0x0004, 13, 13, 0, 1),
+ .rx_lfps = RK_UDPHY_GEN_GRF_REG(0x0004, 14, 14, 0, 1),
+ },
+ .vogrfcfg = {
+ {
+ .hpd_trigger = RK_UDPHY_GEN_GRF_REG(0x0000, 11, 10, 1, 3),
+ .dp_lane_reg = 0x0000,
+ },
+ },
+ .dp_tx_ctrl_cfg = {
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+ rk3588_dp_tx_drv_ctrl_hbr2,
+ rk3588_dp_tx_drv_ctrl_hbr3,
+ },
+ .dp_tx_ctrl_cfg_typec = {
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+ rk3588_dp_tx_drv_ctrl_rbr_hbr_typec,
+ rk3588_dp_tx_drv_ctrl_hbr2,
+ rk3588_dp_tx_drv_ctrl_hbr3,
+ },
+};
+
static const struct rk_udphy_cfg rk3588_udphy_cfgs = {
.num_phys = 2,
.phy_ids = {
@@ -1576,6 +1613,10 @@ static const struct rk_udphy_cfg rk3588_udphy_cfgs = {
};
static const struct of_device_id rk_udphy_dt_match[] = {
+ {
+ .compatible = "rockchip,rk3576-usbdp-phy",
+ .data = &rk3576_udphy_cfgs
+ },
{
.compatible = "rockchip,rk3588-usbdp-phy",
.data = &rk3588_udphy_cfgs
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0784/1756] phy: rockchip: usbdp: Add missing mode_change update
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (782 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0783/1756] phy: rockchip: usbdp: add rk3576 device match data Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0785/1756] phy: rockchip: usbdp: Support single-lane DP Greg Kroah-Hartman
` (214 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Neil Armstrong, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 5def5d61ea5ac6f391364f6fdcff13a27a52026e ]
rk_udphy_set_typec_default_mapping() updates the available modes,
but does not set the mode_change as required. This results in
missing re-initialization and thus non-working DisplayPort.
Fix this issue by introducing a new helper to update the available
modes.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-10-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: b1ca8de219ae ("phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index b2845070231b9..d5f5ae05a5bdd 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -616,6 +616,15 @@ static void rk_udphy_dp_hpd_event_trigger(struct rk_udphy *udphy, bool hpd)
rk_udphy_grfreg_write(udphy->vogrf, &cfg->vogrfcfg[udphy->id].hpd_trigger, hpd);
}
+static void rk_udphy_mode_set(struct rk_udphy *udphy, u8 mode)
+{
+ if (udphy->mode == mode)
+ return;
+
+ udphy->mode_change = true;
+ udphy->mode = mode;
+}
+
static void rk_udphy_set_typec_default_mapping(struct rk_udphy *udphy)
{
if (udphy->flip) {
@@ -646,7 +655,7 @@ static void rk_udphy_set_typec_default_mapping(struct rk_udphy *udphy)
gpiod_set_value_cansleep(udphy->sbu2_dc_gpio, 1);
}
- udphy->mode = UDPHY_MODE_DP_USB;
+ rk_udphy_mode_set(udphy, UDPHY_MODE_DP_USB);
}
static int rk_udphy_orien_sw_set(struct typec_switch_dev *sw,
@@ -1364,10 +1373,7 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
usleep_range(750, 800);
rk_udphy_dp_hpd_event_trigger(udphy, true);
} else if (data->status & DP_STATUS_HPD_STATE) {
- if (udphy->mode != mode) {
- udphy->mode = mode;
- udphy->mode_change = true;
- }
+ rk_udphy_mode_set(udphy, mode);
rk_udphy_dp_hpd_event_trigger(udphy, true);
} else {
rk_udphy_dp_hpd_event_trigger(udphy, false);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0785/1756] phy: rockchip: usbdp: Support single-lane DP
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (783 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0784/1756] phy: rockchip: usbdp: Add missing mode_change update Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0786/1756] phy: rockchip: usbdp: Drop DP HPD handling Greg Kroah-Hartman
` (213 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhang Yubing, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Yubing <yubing.zhang@rock-chips.com>
[ Upstream commit ae9b60ef1d626d1a4fdf8854f66d58f6ac56e37d ]
Implement support for using just a single DisplayPort line.
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-v15-11-80e2c11d1ce8@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: b1ca8de219ae ("phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 64 ++++++++++-------------
1 file changed, 27 insertions(+), 37 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index d5f5ae05a5bdd..5eb5c8fe58b53 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -193,6 +193,7 @@ struct rk_udphy {
int id;
bool dp_in_use;
+ int dp_lanes;
/* PHY const config */
const struct rk_udphy_cfg *cfgs;
@@ -534,6 +535,13 @@ static void rk_udphy_usb_bvalid_enable(struct rk_udphy *udphy, u8 enable)
* <0 1> dpln0 dpln1 usbrx usbtx
* <2 3> usbrx usbtx dpln0 dpln1
* ---------------------------------------------------------------------------
+ * if 1 lane for dp function, 2 lane for usb function, define rockchip,dp-lane-mux = <x>;
+ * sample as follow:
+ * ---------------------------------------------------------------------------
+ * B11-B10 A2-A3 A11-A10 B2-B3
+ * rockchip,dp-lane-mux ln0(tx/rx) ln1(tx) ln2(tx/rx) ln3(tx)
+ * <0> dpln0 \ usbrx usbtx
+ * ---------------------------------------------------------------------------
*/
static void rk_udphy_dplane_select(struct rk_udphy *udphy)
@@ -541,18 +549,18 @@ static void rk_udphy_dplane_select(struct rk_udphy *udphy)
const struct rk_udphy_cfg *cfg = udphy->cfgs;
u32 value = 0;
- switch (udphy->mode) {
- case UDPHY_MODE_DP:
- value |= 2 << udphy->dp_lane_sel[2] * 2;
+ switch (udphy->dp_lanes) {
+ case 4:
value |= 3 << udphy->dp_lane_sel[3] * 2;
+ value |= 2 << udphy->dp_lane_sel[2] * 2;
fallthrough;
- case UDPHY_MODE_DP_USB:
- value |= 0 << udphy->dp_lane_sel[0] * 2;
+ case 2:
value |= 1 << udphy->dp_lane_sel[1] * 2;
- break;
+ fallthrough;
- case UDPHY_MODE_USB:
+ case 1:
+ value |= 0 << udphy->dp_lane_sel[0] * 2;
break;
default:
@@ -565,28 +573,6 @@ static void rk_udphy_dplane_select(struct rk_udphy *udphy)
FIELD_PREP(DP_AUX_DOUT_SEL, udphy->dp_aux_dout_sel) | value);
}
-static int rk_udphy_dplane_get(struct rk_udphy *udphy)
-{
- int dp_lanes;
-
- switch (udphy->mode) {
- case UDPHY_MODE_DP:
- dp_lanes = 4;
- break;
-
- case UDPHY_MODE_DP_USB:
- dp_lanes = 2;
- break;
-
- case UDPHY_MODE_USB:
- default:
- dp_lanes = 0;
- break;
- }
-
- return dp_lanes;
-}
-
static void rk_udphy_dplane_enable(struct rk_udphy *udphy, int dp_lanes)
{
u32 val = 0;
@@ -656,6 +642,7 @@ static void rk_udphy_set_typec_default_mapping(struct rk_udphy *udphy)
}
rk_udphy_mode_set(udphy, UDPHY_MODE_DP_USB);
+ udphy->dp_lanes = 2;
}
static int rk_udphy_orien_sw_set(struct typec_switch_dev *sw,
@@ -894,7 +881,7 @@ static int rk_udphy_parse_lane_mux_data(struct rk_udphy *udphy)
return 0;
}
- if (num_lanes != 2 && num_lanes != 4)
+ if (num_lanes != 1 && num_lanes != 2 && num_lanes != 4)
return dev_err_probe(udphy->dev, -EINVAL,
"invalid number of lane mux\n");
@@ -920,9 +907,11 @@ static int rk_udphy_parse_lane_mux_data(struct rk_udphy *udphy)
}
udphy->mode = UDPHY_MODE_DP;
- if (num_lanes == 2) {
+ udphy->dp_lanes = num_lanes;
+ if (num_lanes == 1 || num_lanes == 2) {
udphy->mode |= UDPHY_MODE_USB;
- udphy->flip = (udphy->lane_mux_sel[0] == PHY_LANE_MUX_DP);
+ udphy->flip = (udphy->lane_mux_sel[0] == PHY_LANE_MUX_DP) ||
+ (udphy->lane_mux_sel[1] == PHY_LANE_MUX_DP);
}
return 0;
@@ -1050,18 +1039,17 @@ static int rk_udphy_dp_phy_exit(struct phy *phy)
static int rk_udphy_dp_phy_power_on(struct phy *phy)
{
struct rk_udphy *udphy = phy_get_drvdata(phy);
- int ret, dp_lanes;
+ int ret;
mutex_lock(&udphy->mutex);
- dp_lanes = rk_udphy_dplane_get(udphy);
- phy_set_bus_width(phy, dp_lanes);
+ phy_set_bus_width(phy, udphy->dp_lanes);
ret = rk_udphy_power_on(udphy, UDPHY_MODE_DP);
if (ret)
goto unlock;
- rk_udphy_dplane_enable(udphy, dp_lanes);
+ rk_udphy_dplane_enable(udphy, udphy->dp_lanes);
rk_udphy_dplane_select(udphy);
@@ -1344,6 +1332,7 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
udphy->lane_mux_sel[2] = PHY_LANE_MUX_DP;
udphy->lane_mux_sel[3] = PHY_LANE_MUX_DP;
mode = UDPHY_MODE_DP;
+ udphy->dp_lanes = 4;
break;
case TYPEC_DP_STATE_D:
@@ -1360,6 +1349,7 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
udphy->lane_mux_sel[3] = PHY_LANE_MUX_DP;
}
mode = UDPHY_MODE_DP_USB;
+ udphy->dp_lanes = 2;
break;
}
@@ -1505,7 +1495,7 @@ static int rk_udphy_probe(struct platform_device *pdev)
ret = PTR_ERR(udphy->phy_dp);
return dev_err_probe(dev, ret, "failed to create DP phy\n");
}
- phy_set_bus_width(udphy->phy_dp, rk_udphy_dplane_get(udphy));
+ phy_set_bus_width(udphy->phy_dp, udphy->dp_lanes);
udphy->phy_dp->attrs.max_link_rate = 8100;
phy_set_drvdata(udphy->phy_dp, udphy);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0786/1756] phy: rockchip: usbdp: Drop DP HPD handling
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (784 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0785/1756] phy: rockchip: usbdp: Support single-lane DP Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0787/1756] phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB Greg Kroah-Hartman
` (212 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 4fd2c13cbb11f5483a43cc789cb8de1c3bd23238 ]
Drop the HPD handling logic from the USBDP PHY. The registers involved
require the display controller power domain being enabled and thus the
HPD signal should be handled by the displayport controller itself.
Apart from that the HPD handling as it is done here is incorrect and
misses hotplug events happening after the USB-C connector (e.g. when
a USB-C to HDMI adapter is involved and the HDMI cable is replugged).
Proper USB-C DP HPD support requires some restructuring of the DP
controller driver, which will happen independent of this patch. The
mainline kernel does not yet support USB-C DP AltMode on RK3588 and
RK3576, so it is fine to drop this code without adding the counterpart
in the DRM in an atomic change.
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-1-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: b1ca8de219ae ("phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 85 +++--------------------
1 file changed, 9 insertions(+), 76 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 5eb5c8fe58b53..71d144af18a76 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -127,7 +127,6 @@ struct rk_udphy_grf_cfg {
struct rk_udphy_vogrf_cfg {
/* vo-grf */
- struct rk_udphy_grf_reg hpd_trigger;
u32 dp_lane_reg;
};
@@ -185,14 +184,11 @@ struct rk_udphy {
u32 dp_lane_sel[4];
u32 dp_aux_dout_sel;
u32 dp_aux_din_sel;
- bool dp_sink_hpd_sel;
- bool dp_sink_hpd_cfg;
unsigned int link_rate;
unsigned int lanes;
u8 bw;
int id;
- bool dp_in_use;
int dp_lanes;
/* PHY const config */
@@ -589,19 +585,6 @@ static void rk_udphy_dplane_enable(struct rk_udphy *udphy, int dp_lanes)
CMN_DP_CMN_RSTN, FIELD_PREP(CMN_DP_CMN_RSTN, 0x0));
}
-static void rk_udphy_dp_hpd_event_trigger(struct rk_udphy *udphy, bool hpd)
-{
- const struct rk_udphy_cfg *cfg = udphy->cfgs;
-
- udphy->dp_sink_hpd_sel = true;
- udphy->dp_sink_hpd_cfg = hpd;
-
- if (!udphy->dp_in_use)
- return;
-
- rk_udphy_grfreg_write(udphy->vogrf, &cfg->vogrfcfg[udphy->id].hpd_trigger, hpd);
-}
-
static void rk_udphy_mode_set(struct rk_udphy *udphy, u8 mode)
{
if (udphy->mode == mode)
@@ -1013,29 +996,6 @@ static void rk_udphy_power_off(struct rk_udphy *udphy, u8 mode)
rk_udphy_disable(udphy);
}
-static int rk_udphy_dp_phy_init(struct phy *phy)
-{
- struct rk_udphy *udphy = phy_get_drvdata(phy);
-
- mutex_lock(&udphy->mutex);
-
- udphy->dp_in_use = true;
-
- mutex_unlock(&udphy->mutex);
-
- return 0;
-}
-
-static int rk_udphy_dp_phy_exit(struct phy *phy)
-{
- struct rk_udphy *udphy = phy_get_drvdata(phy);
-
- mutex_lock(&udphy->mutex);
- udphy->dp_in_use = false;
- mutex_unlock(&udphy->mutex);
- return 0;
-}
-
static int rk_udphy_dp_phy_power_on(struct phy *phy)
{
struct rk_udphy *udphy = phy_get_drvdata(phy);
@@ -1267,8 +1227,6 @@ static int rk_udphy_dp_phy_configure(struct phy *phy,
}
static const struct phy_ops rk_udphy_dp_phy_ops = {
- .init = rk_udphy_dp_phy_init,
- .exit = rk_udphy_dp_phy_exit,
.power_on = rk_udphy_dp_phy_power_on,
.power_off = rk_udphy_dp_phy_power_off,
.configure = rk_udphy_dp_phy_configure,
@@ -1322,6 +1280,14 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
struct rk_udphy *udphy = typec_mux_get_drvdata(mux);
u8 mode;
+ /*
+ * Ignore mux events not involving DP AltMode, because
+ * the mode field is being reused, e.g. state->mode == 4
+ * could be either TYPEC_MODE_USB4 or TYPEC_DP_STATE_C.
+ */
+ if (!state->alt || state->alt->svid != USB_TYPEC_DP_SID)
+ return 0;
+
mutex_lock(&udphy->mutex);
switch (state->mode) {
@@ -1353,22 +1319,7 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
break;
}
- if (state->alt && state->alt->svid == USB_TYPEC_DP_SID) {
- struct typec_displayport_data *data = state->data;
-
- if (!data) {
- rk_udphy_dp_hpd_event_trigger(udphy, false);
- } else if (data->status & DP_STATUS_IRQ_HPD) {
- rk_udphy_dp_hpd_event_trigger(udphy, false);
- usleep_range(750, 800);
- rk_udphy_dp_hpd_event_trigger(udphy, true);
- } else if (data->status & DP_STATUS_HPD_STATE) {
- rk_udphy_mode_set(udphy, mode);
- rk_udphy_dp_hpd_event_trigger(udphy, true);
- } else {
- rk_udphy_dp_hpd_event_trigger(udphy, false);
- }
- }
+ rk_udphy_mode_set(udphy, mode);
mutex_unlock(&udphy->mutex);
return 0;
@@ -1508,20 +1459,6 @@ static int rk_udphy_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused rk_udphy_resume(struct device *dev)
-{
- struct rk_udphy *udphy = dev_get_drvdata(dev);
-
- if (udphy->dp_sink_hpd_sel)
- rk_udphy_dp_hpd_event_trigger(udphy, udphy->dp_sink_hpd_cfg);
-
- return 0;
-}
-
-static const struct dev_pm_ops rk_udphy_pm_ops = {
- SET_LATE_SYSTEM_SLEEP_PM_OPS(NULL, rk_udphy_resume)
-};
-
static const char * const rk_udphy_rst_list[] = {
"init", "cmn", "lane", "pcs_apb", "pma_apb"
};
@@ -1545,7 +1482,6 @@ static const struct rk_udphy_cfg rk3576_udphy_cfgs = {
},
.vogrfcfg = {
{
- .hpd_trigger = RK_UDPHY_GEN_GRF_REG(0x0000, 11, 10, 1, 3),
.dp_lane_reg = 0x0000,
},
},
@@ -1586,11 +1522,9 @@ static const struct rk_udphy_cfg rk3588_udphy_cfgs = {
},
.vogrfcfg = {
{
- .hpd_trigger = RK_UDPHY_GEN_GRF_REG(0x0000, 11, 10, 1, 3),
.dp_lane_reg = 0x0000,
},
{
- .hpd_trigger = RK_UDPHY_GEN_GRF_REG(0x0008, 11, 10, 1, 3),
.dp_lane_reg = 0x0008,
},
},
@@ -1626,7 +1560,6 @@ static struct platform_driver rk_udphy_driver = {
.driver = {
.name = "rockchip-usbdp-phy",
.of_match_table = rk_udphy_dt_match,
- .pm = &rk_udphy_pm_ops,
},
};
module_platform_driver(rk_udphy_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0787/1756] phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (785 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0786/1756] phy: rockchip: usbdp: Drop DP HPD handling Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0788/1756] phy: rockchip: usbdp: Hold mutex in DP PHY configure Greg Kroah-Hartman
` (211 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit b1ca8de219ae6e4d9eec22acfbe4357d8addd94c ]
Handle TYPEC_STATE_SAFE and TYPEC_STATE_USB Type-C state events,
so that the muxing is properly updated when exiting DP AltMode.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/message/20260619155020.CC7361F000E9%40smtp.kernel.org
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-5-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 71d144af18a76..05edd03761c37 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1274,18 +1274,27 @@ static const struct phy_ops rk_udphy_usb3_phy_ops = {
.owner = THIS_MODULE,
};
+static bool rk_udphy_is_supported_mode(struct typec_mux_state *state)
+{
+ /* Handle Safe State and USB State */
+ if (state->mode < TYPEC_STATE_MODAL)
+ return true;
+
+ /* Handle DP AltMode */
+ if (state->alt && state->alt->svid == USB_TYPEC_DP_SID)
+ return true;
+
+ return false;
+}
+
static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
struct typec_mux_state *state)
{
struct rk_udphy *udphy = typec_mux_get_drvdata(mux);
u8 mode;
- /*
- * Ignore mux events not involving DP AltMode, because
- * the mode field is being reused, e.g. state->mode == 4
- * could be either TYPEC_MODE_USB4 or TYPEC_DP_STATE_C.
- */
- if (!state->alt || state->alt->svid != USB_TYPEC_DP_SID)
+ /* Ignore mux events not involving USB or DP */
+ if (!rk_udphy_is_supported_mode(state))
return 0;
mutex_lock(&udphy->mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0788/1756] phy: rockchip: usbdp: Hold mutex in DP PHY configure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (786 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0787/1756] phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0789/1756] phy: rockchip: usbdp: Rename mode_change to phy_needs_reinit Greg Kroah-Hartman
` (210 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 619233ce6b2329529c9f0ff9682d6e22d160ebd6 ]
rk_udphy_dp_phy_configure() accesses some variables from the struct
rk_udphy, which are updated independently from the USB-C framework.
The USB-C mux/orientation switch functions already hold a mutex to
ensure mutual exclusive access to the struct rk_udphy states, so
simply hold the same one in the DP PHY configuration function.
Reproducing problems due to this on real hardware would be really hard,
but could be possible when quickly re-connecting the USB-C connector.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-phy/20260612164627.23D391F000E9@smtp.kernel.org/
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-7-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index 05edd03761c37..f611018171e34 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -1136,6 +1136,8 @@ static int rk_udphy_dp_phy_configure(struct phy *phy,
u32 i, val, lane;
int ret;
+ guard(mutex)(&udphy->mutex);
+
if (dp->set_rate) {
ret = rk_udphy_dp_phy_verify_link_rate(udphy, dp);
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0789/1756] phy: rockchip: usbdp: Rename mode_change to phy_needs_reinit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (787 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0788/1756] phy: rockchip: usbdp: Hold mutex in DP PHY configure Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0790/1756] phy: rockchip: usbdp: Avoid xHCI SErrors Greg Kroah-Hartman
` (209 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit fbce9cc28cadb24026a6c061819d42e50d3bfea0 ]
Right now the mode_change property is set whenever the mode changes
between USB-only, DP-only and USB-DP. It is needed, because on any
mode change the PHY needs to be re-initialized. Apparently at least
DP also requires a re-init when the cable orientation is changed,
which is currently not being done (except when the orientation switch
also involves a mode change). Prepare for this by renaming mode_change
to phy_needs_reinit.
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-2-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: cf3aa34e6f07 ("phy: rockchip: usbdp: Avoid xHCI SErrors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index f611018171e34..b256672b3405b 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -170,7 +170,7 @@ struct rk_udphy {
/* PHY status management */
bool flip;
- bool mode_change;
+ bool phy_needs_reinit;
u8 mode;
u8 status;
@@ -590,7 +590,7 @@ static void rk_udphy_mode_set(struct rk_udphy *udphy, u8 mode)
if (udphy->mode == mode)
return;
- udphy->mode_change = true;
+ udphy->phy_needs_reinit = true;
udphy->mode = mode;
}
@@ -963,8 +963,8 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
if (udphy->mode & UDPHY_MODE_USB)
rk_udphy_u3_port_disable(udphy, false);
- udphy->mode_change = false;
- } else if (udphy->mode_change) {
+ udphy->phy_needs_reinit = false;
+ } else if (udphy->phy_needs_reinit) {
if (udphy->mode == UDPHY_MODE_DP)
rk_udphy_u3_port_disable(udphy, true);
@@ -972,7 +972,7 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
ret = rk_udphy_setup(udphy);
if (ret)
return ret;
- udphy->mode_change = false;
+ udphy->phy_needs_reinit = false;
}
udphy->status |= mode;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0790/1756] phy: rockchip: usbdp: Avoid xHCI SErrors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (788 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0789/1756] phy: rockchip: usbdp: Rename mode_change to phy_needs_reinit Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0791/1756] phy: rockchip: usbdp: Handle rk_udphy_reset_deassert errors Greg Kroah-Hartman
` (208 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit cf3aa34e6f0798544c26ad93a6c3c2231ab09738 ]
The USBDP PHY provides the PIPE clock to the USB3 controller, which
means the PHY must be fully running when anything tries to access
the xHCI registers.
When switching between USB3-only, USB3 + DP and DP-only mode, the
PHY must be re-initialized resulting in a short period of the PHY
being disabled. If the DWC3 driver decides to access the xHCI at
this point the system will fail with an SError.
This patch avoids the problems by disabling the USB3 port before
re-initializing it. This does a couple of things:
- forces phystatus to 0 from GRF (not from PHY)
- switches PIPE clock source from PHY to UTMI (safe fallback clock)
- num_u3_port=0
The last part will be ignored, as DWC3 already probed, but the
clock re-routing will avoid the SError. There is a small delay
afterwards to make sure the mux happened. The datasheet gives
no hints how long it takes, so delay time is a guess.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-9-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index b256672b3405b..ce39a2d828716 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -965,13 +965,16 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
rk_udphy_u3_port_disable(udphy, false);
udphy->phy_needs_reinit = false;
} else if (udphy->phy_needs_reinit) {
- if (udphy->mode == UDPHY_MODE_DP)
- rk_udphy_u3_port_disable(udphy, true);
+ rk_udphy_u3_port_disable(udphy, true);
+ udelay(10);
rk_udphy_disable(udphy);
ret = rk_udphy_setup(udphy);
if (ret)
return ret;
+
+ if (!udphy->hs && udphy->mode & UDPHY_MODE_USB)
+ rk_udphy_u3_port_disable(udphy, false);
udphy->phy_needs_reinit = false;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0791/1756] phy: rockchip: usbdp: Handle rk_udphy_reset_deassert errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (789 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0790/1756] phy: rockchip: usbdp: Avoid xHCI SErrors Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0792/1756] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode Greg Kroah-Hartman
` (207 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit 35101e2f49c04bf1cfc69b8a0d3f85c742369ccc ]
Handle rk_udphy_reset_deassert returning errors to avoid theoretical
(Rockchip reset controller driver does not return errors) SError.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/message/20260626211151.2332F1F000E9%40smtp.kernel.org
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-10-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 25 +++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index ce39a2d828716..a2af4443fc067 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -771,8 +771,12 @@ static int rk_udphy_init(struct rk_udphy *udphy)
/* Step 1: power on pma and deassert apb rstn */
rk_udphy_grfreg_write(udphy->udphygrf, &cfg->grfcfg.low_pwrn, true);
- rk_udphy_reset_deassert(udphy, "pma_apb");
- rk_udphy_reset_deassert(udphy, "pcs_apb");
+ ret = rk_udphy_reset_deassert(udphy, "pma_apb");
+ if (ret)
+ goto assert_resets;
+ ret = rk_udphy_reset_deassert(udphy, "pcs_apb");
+ if (ret)
+ goto assert_resets;
/* Step 2: set init sequence and phy refclk */
ret = regmap_multi_reg_write(udphy->pma_regmap, rk_udphy_init_sequence,
@@ -798,8 +802,11 @@ static int rk_udphy_init(struct rk_udphy *udphy)
FIELD_PREP(CMN_DP_LANE_EN_ALL, 0));
/* Step 4: deassert init rstn and wait for 200ns from datasheet */
- if (udphy->mode & UDPHY_MODE_USB)
- rk_udphy_reset_deassert(udphy, "init");
+ if (udphy->mode & UDPHY_MODE_USB) {
+ ret = rk_udphy_reset_deassert(udphy, "init");
+ if (ret)
+ goto assert_resets;
+ }
if (udphy->mode & UDPHY_MODE_DP) {
regmap_update_bits(udphy->pma_regmap, CMN_DP_RSTN_OFFSET,
@@ -811,8 +818,14 @@ static int rk_udphy_init(struct rk_udphy *udphy)
/* Step 5: deassert cmn/lane rstn */
if (udphy->mode & UDPHY_MODE_USB) {
- rk_udphy_reset_deassert(udphy, "cmn");
- rk_udphy_reset_deassert(udphy, "lane");
+ ret = rk_udphy_reset_deassert(udphy, "cmn");
+ if (ret)
+ goto assert_resets;
+
+ ret = rk_udphy_reset_deassert(udphy, "lane");
+ if (ret)
+ goto assert_resets;
+
}
/* Step 6: wait for lock done of pll */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0792/1756] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (790 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0791/1756] phy: rockchip: usbdp: Handle rk_udphy_reset_deassert errors Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0793/1756] scsi: scsi_debug: Refuse a negative physblk_exp Greg Kroah-Hartman
` (206 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Sebastian Reichel,
Manivannan Sadhasivam, Vinod Koul, Sasha Levin, Igor Paunovic
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Reichel <sebastian.reichel@collabora.com>
[ Upstream commit fbbf6c85b08008bf68ef49931175edeaa36ba82f ]
Ensure that USB3 mode is not accidently enabled during PHY re-init
for systems that are configured as high-speed only via DT.
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/message/20260626212424.C215E1F000E9%40smtp.kernel.org
Tested-by: Igor Paunovic <royalnet026@gmail.com> # Orange Pi 5 Plus
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260915-rockchip-usbdp-cleanup-part2-v15-11-8d507cb1174f@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/rockchip/phy-rockchip-usbdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
index a2af4443fc067..896000513e4b6 100644
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
@@ -974,7 +974,7 @@ static int rk_udphy_power_on(struct rk_udphy *udphy, u8 mode)
if (ret)
return ret;
- if (udphy->mode & UDPHY_MODE_USB)
+ if (!udphy->hs && udphy->mode & UDPHY_MODE_USB)
rk_udphy_u3_port_disable(udphy, false);
udphy->phy_needs_reinit = false;
} else if (udphy->phy_needs_reinit) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0793/1756] scsi: scsi_debug: Refuse a negative physblk_exp
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (791 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0792/1756] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0794/1756] scsi: scsi_debug: Take the zone metadata lock before the data lock Greg Kroah-Hartman
` (205 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niklas Cassel, Damien Le Moal,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit a349876633f7a583429367daf16f9a4282118255 ]
sdebug_init() refuses a physblk_exp above 15, but the parameter is a signed
int, so a negative value is accepted. The driver then shifts by it when it
builds the Block Limits VPD page, which is undefined behaviour, and READ
CAPACITY (16) reports an exponent of 15 for -1.
Refuse a negative value as well, and print it as a signed value.
Assisted-by: LLM
Fixes: ea61fca58c13 ("scsi_debug: Add support for physical block exponent and alignment")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-18-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index de54596bbae9b..ee129f23a7c58 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -7809,8 +7809,8 @@ static int __init scsi_debug_init(void)
return -EINVAL;
}
- if (sdebug_physblk_exp > 15) {
- pr_err("invalid physblk_exp %u\n", sdebug_physblk_exp);
+ if (sdebug_physblk_exp < 0 || sdebug_physblk_exp > 15) {
+ pr_err("invalid physblk_exp %d\n", sdebug_physblk_exp);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0794/1756] scsi: scsi_debug: Take the zone metadata lock before the data lock
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (792 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0793/1756] scsi: scsi_debug: Refuse a negative physblk_exp Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0795/1756] scsi: scsi_debug: Refuse a short WRITE ATOMIC (16) before writing it Greg Kroah-Hartman
` (204 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, Niklas Cassel,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit c9aedbcbff0fe31fabdea09600609eb30e05441d ]
resp_comp_write() takes the data lock and then the zone metadata lock,
while every other command that takes both takes the metadata lock first and
reaches the data lock through do_device_access(). A COMPARE AND WRITE and
any other write to the same store can therefore deadlock each other.
Take the locks in the same order as everywhere else.
Correct the comment above map_region() while here: the provisioning map is
covered by the metadata lock rather than the data lock, which is why
resp_unmap() takes only the metadata lock.
Assisted-by: LLM
Fixes: 84f3a3c01d70 ("scsi: scsi_debug: Atomic write support")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-19-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index ee129f23a7c58..289f298c759fc 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4756,20 +4756,20 @@ static int resp_comp_write(struct scsi_cmnd *scp,
"indicated=%u, IO sent=%d bytes\n", my_name,
dnum * lb_size, ret);
- sdeb_data_write_lock(sip);
sdeb_meta_write_lock(sip);
+ sdeb_data_write_lock(sip);
if (!comp_write_worker(sip, lba, num, arr, false)) {
mk_sense_buffer(scp, MISCOMPARE, MISCOMPARE_VERIFY_ASC, 0);
retval = check_condition_result;
goto cleanup_unlock;
}
- /* Cover sip->map_storep (which map_region()) sets with data lock */
+ /* Cover sip->map_storep (which map_region() sets) with the meta lock */
if (scsi_debug_lbp())
map_region(sip, lba, num);
cleanup_unlock:
- sdeb_meta_write_unlock(sip);
sdeb_data_write_unlock(sip);
+ sdeb_meta_write_unlock(sip);
cleanup_free:
kfree(arr);
return retval;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0795/1756] scsi: scsi_debug: Refuse a short WRITE ATOMIC (16) before writing it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (793 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0794/1756] scsi: scsi_debug: Take the zone metadata lock before the data lock Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0796/1756] scsi: scsi_debug: Map the region written by WRITE ATOMIC (16) Greg Kroah-Hartman
` (203 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, John Garry,
Niklas Cassel, Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit b81608b17c5d04c797e6fc1cfb95182c842a4db9 ]
A write whose data-out buffer is shorter than its transfer length is
short. An ordinary write transfers what the buffer holds and reports the
rest as a residual, but an atomic write cannot be short: SBC-6 r02 (T10/BSR
INCITS 587), 4.28.1, requires each atomic write operation to write either
all of its data or none of it, and 4.28.2 requires one that cannot complete
to leave the LBAs that it specifies unaltered.
resp_atomic_write() does fail a short WRITE ATOMIC (16) with DID_ERROR, but
only after do_device_access() has returned, and do_device_access() copies
one logical block at a time, so by then the blocks that the buffer did hold
have been written. An eight block WRITE ATOMIC (16) with a buffer of four
fails having overwritten the first four.
Check the length of the buffer before writing anything, and fail the
command with the same DID_ERROR as before.
Assisted-by: LLM
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: John Garry <john.garry@linux.dev>
Fixes: 84f3a3c01d70 ("scsi: scsi_debug: Atomic write support")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-26-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 289f298c759fc..961496432fcb3 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -5379,6 +5379,14 @@ static int resp_atomic_write(struct scsi_cmnd *scp,
}
}
+ /*
+ * Short atomic writes are not allowed: SBC-6 4.28.2 requires an
+ * atomic write that cannot complete to leave its LBAs unaltered, and
+ * do_device_access() would already have written part of it.
+ */
+ if (scsi_bufflen(scp) < len * sdebug_sector_size)
+ return DID_ERROR << 16;
+
ret = do_device_access(sip, scp, 0, lba, len, 0, true, true);
if (unlikely(ret == -1))
return DID_ERROR << 16;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0796/1756] scsi: scsi_debug: Map the region written by WRITE ATOMIC (16)
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (794 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0795/1756] scsi: scsi_debug: Refuse a short WRITE ATOMIC (16) before writing it Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0797/1756] scsi: scsi_debug: Validate the access parameters of " Greg Kroah-Hartman
` (202 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, John Garry,
Niklas Cassel, Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 491bd55c35cbb1ce059f22e7f3c6284551970fef ]
When logical block provisioning is enabled, every command that writes user
data calls map_region() so that GET LBA STATUS reports the region as
mapped. resp_atomic_write() does not, so GET LBA STATUS keeps reporting a
region as deallocated after a WRITE ATOMIC (16) has written it.
Call map_region() the way resp_write_dt0() does, holding the zone metadata
write lock across the access. That lock is what serialises the map against
resp_unmap(), which does nothing unless logical block provisioning is
enabled.
Assisted-by: LLM
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: John Garry <john.garry@linux.dev>
Fixes: 84f3a3c01d70 ("scsi: scsi_debug: Atomic write support")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-27-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 961496432fcb3..1d9947dc14351 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4173,6 +4173,11 @@ static unsigned int map_state(struct sdeb_store_info *sip, sector_t lba,
return mapped;
}
+/*
+ * Callers may map the whole range of a write without checking how much of
+ * it was written. SBC-6 4.7.4.6.2 allows a deallocated LBA to become mapped
+ * at any time, and only requires an LBA that was written to be mapped.
+ */
static void map_region(struct sdeb_store_info *sip, sector_t lba,
unsigned int len)
{
@@ -5335,6 +5340,7 @@ static int resp_atomic_write(struct scsi_cmnd *scp,
u8 *cmd = scp->cmnd;
u16 boundary, len;
u64 lba, lba_tmp;
+ bool lbp = scsi_debug_lbp();
int ret;
if (!scsi_debug_atomic_write()) {
@@ -5387,7 +5393,15 @@ static int resp_atomic_write(struct scsi_cmnd *scp,
if (scsi_bufflen(scp) < len * sdebug_sector_size)
return DID_ERROR << 16;
+ if (lbp)
+ sdeb_meta_write_lock(sip);
+
ret = do_device_access(sip, scp, 0, lba, len, 0, true, true);
+ if (lbp) {
+ map_region(sip, lba, len);
+ sdeb_meta_write_unlock(sip);
+ }
+
if (unlikely(ret == -1))
return DID_ERROR << 16;
if (unlikely(ret != len * sdebug_sector_size))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0797/1756] scsi: scsi_debug: Validate the access parameters of WRITE ATOMIC (16)
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (795 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0796/1756] scsi: scsi_debug: Map the region written by WRITE ATOMIC (16) Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0798/1756] scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN Greg Kroah-Hartman
` (201 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Damien Le Moal, John Garry,
Niklas Cassel, Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit a6c339feb830daa097ccc4c50c339c1733c12d42 ]
resp_atomic_write() validates the fields that are specific to an atomic
write, but never the range that the command addresses. Every other command
that writes user data calls check_device_access_params() first, which
rejects a transfer that ends beyond the capacity of the device, one whose
length exceeds the size of the store, and any write to a write protected
device.
Call check_device_access_params(). The zone checks that it ends with are
unreachable, as atomic writes and ZBC emulation are mutually exclusive.
Assisted-by: LLM
Fixes: 84f3a3c01d70 ("scsi: scsi_debug: Atomic write support")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: John Garry <john.garry@linux.dev>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260929082456.857423-28-cassel@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/scsi_debug.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 1d9947dc14351..0906ef5d7798e 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -5385,6 +5385,10 @@ static int resp_atomic_write(struct scsi_cmnd *scp,
}
}
+ ret = check_device_access_params(scp, lba, len, true);
+ if (ret)
+ return ret;
+
/*
* Short atomic writes are not allowed: SBC-6 4.28.2 requires an
* atomic write that cannot complete to leave its LBAs unaltered, and
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0798/1756] scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (796 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0797/1756] scsi: scsi_debug: Validate the access parameters of " Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0799/1756] scsi: st: Record the tape position after a successful MTLOAD Greg Kroah-Hartman
` (200 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurence Oberman, Kai Mäkisara,
Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurence Oberman <loberman@redhat.com>
[ Upstream commit 8d1cc285194dbcba88c136e1ff7c25cb10e38a5b ]
A device reset returns the drive's density and block size to their
defaults. Commit 7081dc75df79 ("scsi: st: Restore some drive settings
after reset") re-applies values changed by the user when the position is
recovered with MTREW, MTSEEK or MTEOM. MTLOAD and MTRETEN are also allowed
to clear the reset condition and also leave the same medium at BOT, but
they restore nothing.
Because check_tape() reads the drive's block size with MODE SENSE on every
open, the driver silently switches to the drive default after the reset.
An application that set fixed-block mode with MTSETBLK and recovers with
MTLOAD or MTRETEN keeps writing, but variable-length blocks, without any
error.
Restore the changed density and block size for MTLOAD and MTRETEN as well.
Both operations may make the drive report a new medium, and the new session
started by check_tape() clears the "changed" flags and applies the mode
defaults. So save the values before the operation, let check_tape() run
first (do_load_unload() already calls it for MTLOAD; call it after
MTRETEN), and then re-apply them. Retry the restore once in case a unit
attention is still pending. Only restore when the drive is ready after the
operation: with an immediate-mode load and O_NONBLOCK, check_tape() does
not wait and the drive may still be loading. In immediate mode
(MT_ST_NOWAIT) MTRETEN may return before the retension has finished; do not
wait for it there.
MTOFFL is not changed: the medium is unloaded and a different one may be
loaded next, for which the mode defaults apply.
Reproduced with scsi_debug (which reports a new medium after MTRETEN and
MTLOAD) and with IBM LTO drives on FC (which do not).
Fixes: 7081dc75df79 ("scsi: st: Restore some drive settings after reset")
Assisted-by: Claude sashiko
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Link: https://patch.msgid.link/20260929192821.997675-2-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/st.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 53d37c8497714..39c9b1dfe6b67 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3513,6 +3513,23 @@ static int partition_tape(struct scsi_tape *STp, int size)
\f
+/*
+ * Re-apply a density and block size that were changed by the user before a
+ * device reset (a negative value means "not changed"). A unit attention
+ * still pending after the operation (e.g. new medium after a load) fails the
+ * first MODE SELECT, so retry each once. As in the other post-reset restore
+ * path, errors are ignored and one setting failing does not prevent
+ * restoring the other.
+ */
+static void st_restore_changed_settings(struct scsi_tape *STp, int density,
+ int blksize)
+{
+ if (density >= 0 && st_int_ioctl(STp, MTSETDENSITY, density))
+ st_int_ioctl(STp, MTSETDENSITY, density);
+ if (blksize >= 0 && st_int_ioctl(STp, MTSETBLK, blksize))
+ st_int_ioctl(STp, MTSETBLK, blksize);
+}
+
/* The ioctl command */
static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
{
@@ -3521,6 +3538,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
int retval = 0;
unsigned int blk;
bool cmd_mtiocget;
+ int restore_density = -1, restore_blksize = -1;
struct scsi_tape *STp = file->private_data;
struct st_modedef *STm;
struct st_partstat *STps;
@@ -3660,6 +3678,17 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
st_int_ioctl(STp, MTSETDENSITY, STp->changed_density);
if (STp->blksize_changed)
st_int_ioctl(STp, MTSETBLK, STp->changed_blksize);
+ } else if (mtc.mt_op == MTLOAD || mtc.mt_op == MTRETEN) {
+ /*
+ * The same medium ends up at BOT, so the settings
+ * apply as with MTREW. The operation may start a
+ * new session, which clears the "changed" flags:
+ * save the values and restore them afterwards.
+ */
+ if (STp->density_changed)
+ restore_density = STp->changed_density;
+ if (STp->blksize_changed)
+ restore_blksize = STp->changed_blksize;
}
}
@@ -3739,6 +3768,14 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
if (mtc.mt_op == MTLOAD) {
retval = do_load_unload(STp, file, max(1, mtc.mt_count));
+ /*
+ * Restore only if the drive is ready: after an
+ * immediate-mode load with O_NONBLOCK, check_tape()
+ * does not wait and the drive may still be loading.
+ */
+ if (!retval && STp->ready == ST_READY)
+ st_restore_changed_settings(STp, restore_density,
+ restore_blksize);
goto out;
}
@@ -3757,6 +3794,20 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
retval = st_compression(STp, (mtc.mt_count & 1));
else
retval = st_int_ioctl(STp, mtc.mt_op, mtc.mt_count);
+ if (!retval && mtc.mt_op == MTRETEN && !STp->immediate &&
+ (restore_density >= 0 || restore_blksize >= 0)) {
+ /*
+ * Retension reloads the medium and the drive may
+ * report a new medium. Let check_tape() start the new
+ * session (applying the mode defaults) now, as for
+ * MTLOAD; otherwise it happens at the next open and
+ * overrides the restored settings.
+ */
+ if (check_tape(STp, file) >= 0 &&
+ STp->ready == ST_READY)
+ st_restore_changed_settings(STp, restore_density,
+ restore_blksize);
+ }
goto out;
}
if (!STm->defined) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0799/1756] scsi: st: Record the tape position after a successful MTLOAD
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (797 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0798/1756] scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0800/1756] phy: freescale: fsl-samsung-hdmi: Replace register defines with macro Greg Kroah-Hartman
` (199 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kai Mäkisara, Laurence Oberman,
Kai Mäkisara, Martin K. Petersen (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurence Oberman <loberman@redhat.com>
[ Upstream commit 54ee0ee9bdeb7e9d3b70cc5c2bdf7e58c4423e8d ]
Commit 0b120edb37dc ("scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed
after device reset") allows MTLOAD to clear the reset condition because the
tape location is known after MTLOAD. But the driver does not record it:
reset_state() sets the file and block numbers to -1, and do_load_unload()
leaves them there. check_tape() sets them to 0 only for a new session,
which requires a new-medium unit attention. Drives that do not report one
when the medium was already loaded (seen with IBM LTO drives) keep
reporting file/block -1 in MTIOCGET and no BOT, although the tape is at the
beginning.
After a successful load, reset the partition and the state of all
partitions, as the new-session path in check_tape() does: partition 0,
position at BOT, EOF state cleared and no pending write. Otherwise the
driver may still record the previous partition, so that a later MTSETPART
to that partition is not performed; a read after loading at EOD fails with
EIO; and a partition left in the ST_WRITING state by a partition switch in
read() or write() makes st_flush() write a filemark at the beginning of
partition 0 when the device is closed.
Fixes: 0b120edb37dc ("scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset")
Suggested-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
Assisted-by: Claude sashiko
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Link: https://patch.msgid.link/20260929192821.997675-3-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/st.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 39c9b1dfe6b67..0ce9454cdb3e5 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -2663,6 +2663,30 @@ static int do_load_unload(struct scsi_tape *STp, struct file *filp, int load_cod
else {
STp->rew_at_close = STp->autorew_dev;
retval = check_tape(STp, filp);
+ /*
+ * LOAD leaves the medium at the beginning of partition
+ * 0. check_tape() records that only for a new session;
+ * without a new-medium unit attention (the medium was
+ * already loaded) the partition and the partition state
+ * would be left as before the load. Reset them as a
+ * new session does, for all partitions: a stale
+ * ST_WRITING state would make st_flush() write a
+ * filemark at the beginning of partition 0.
+ */
+ if (retval == CHKRES_READY) {
+ int i;
+
+ STp->partition = STp->new_partition = 0;
+ for (i = 0; i < ST_NBR_PARTITIONS; i++) {
+ STps = &(STp->ps[i]);
+ STps->rw = ST_IDLE;
+ STps->eof = ST_NOEOF;
+ STps->at_sm = 0;
+ STps->last_block_valid = 0;
+ STps->drv_block = 0;
+ STps->drv_file = 0;
+ }
+ }
if (retval > 0)
retval = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0800/1756] phy: freescale: fsl-samsung-hdmi: Replace register defines with macro
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (798 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0799/1756] scsi: st: Record the tape position after a successful MTLOAD Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0801/1756] phy: freescale: fsl-samsung-hdmi: Simplify REG21_PMS_S_MASK lookup Greg Kroah-Hartman
` (198 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adam Ford, Marco Felsch,
Frieder Schrempf, Dominique Martinet, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Ford <aford173@gmail.com>
[ Upstream commit 4a5a9e2577d61a4ee3e9788e0c2b0c1cbc5ba7b3 ]
There are 47 registers defined as PHY_REG_xx were xx goes from 00 to
47. Simplify this by replacing them all with a macro which is passed
the register number to return the proper register offset.
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Tested-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Link: https://lore.kernel.org/r/20240914112816.520224-2-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: c01ccf91b257 ("phy: freescale: fsl-samsung-hdmi: initialize default rate")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 133 ++++++-------------
1 file changed, 43 insertions(+), 90 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 9048cdc760c21..acea7008aefc5 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -14,76 +14,29 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
-#define PHY_REG_00 0x00
-#define PHY_REG_01 0x04
-#define PHY_REG_02 0x08
-#define PHY_REG_08 0x20
-#define PHY_REG_09 0x24
-#define PHY_REG_10 0x28
-#define PHY_REG_11 0x2c
-
-#define PHY_REG_12 0x30
-#define REG12_CK_DIV_MASK GENMASK(5, 4)
-
-#define PHY_REG_13 0x34
-#define REG13_TG_CODE_LOW_MASK GENMASK(7, 0)
-
-#define PHY_REG_14 0x38
-#define REG14_TOL_MASK GENMASK(7, 4)
-#define REG14_RP_CODE_MASK GENMASK(3, 1)
-#define REG14_TG_CODE_HIGH_MASK GENMASK(0, 0)
-
-#define PHY_REG_15 0x3c
-#define PHY_REG_16 0x40
-#define PHY_REG_17 0x44
-#define PHY_REG_18 0x48
-#define PHY_REG_19 0x4c
-#define PHY_REG_20 0x50
-
-#define PHY_REG_21 0x54
-#define REG21_SEL_TX_CK_INV BIT(7)
-#define REG21_PMS_S_MASK GENMASK(3, 0)
-
-#define PHY_REG_22 0x58
-#define PHY_REG_23 0x5c
-#define PHY_REG_24 0x60
-#define PHY_REG_25 0x64
-#define PHY_REG_26 0x68
-#define PHY_REG_27 0x6c
-#define PHY_REG_28 0x70
-#define PHY_REG_29 0x74
-#define PHY_REG_30 0x78
-#define PHY_REG_31 0x7c
-#define PHY_REG_32 0x80
+#define PHY_REG(reg) (reg * 4)
+#define REG12_CK_DIV_MASK GENMASK(5, 4)
+
+#define REG13_TG_CODE_LOW_MASK GENMASK(7, 0)
+
+#define REG14_TOL_MASK GENMASK(7, 4)
+#define REG14_RP_CODE_MASK GENMASK(3, 1)
+#define REG14_TG_CODE_HIGH_MASK GENMASK(0, 0)
+
+#define REG21_SEL_TX_CK_INV BIT(7)
+#define REG21_PMS_S_MASK GENMASK(3, 0)
/*
* REG33 does not match the ref manual. According to Sandor Yu from NXP,
* "There is a doc issue on the i.MX8MP latest RM"
* REG33 is being used per guidance from Sandor
*/
+#define REG33_MODE_SET_DONE BIT(7)
+#define REG33_FIX_DA BIT(1)
-#define PHY_REG_33 0x84
-#define REG33_MODE_SET_DONE BIT(7)
-#define REG33_FIX_DA BIT(1)
-
-#define PHY_REG_34 0x88
-#define REG34_PHY_READY BIT(7)
-#define REG34_PLL_LOCK BIT(6)
-#define REG34_PHY_CLK_READY BIT(5)
-
-#define PHY_REG_35 0x8c
-#define PHY_REG_36 0x90
-#define PHY_REG_37 0x94
-#define PHY_REG_38 0x98
-#define PHY_REG_39 0x9c
-#define PHY_REG_40 0xa0
-#define PHY_REG_41 0xa4
-#define PHY_REG_42 0xa8
-#define PHY_REG_43 0xac
-#define PHY_REG_44 0xb0
-#define PHY_REG_45 0xb4
-#define PHY_REG_46 0xb8
-#define PHY_REG_47 0xbc
+#define REG34_PHY_READY BIT(7)
+#define REG34_PLL_LOCK BIT(6)
+#define REG34_PHY_CLK_READY BIT(5)
#define PHY_PLL_DIV_REGS_NUM 6
@@ -369,29 +322,29 @@ struct reg_settings {
};
static const struct reg_settings common_phy_cfg[] = {
- { PHY_REG_00, 0x00 }, { PHY_REG_01, 0xd1 },
- { PHY_REG_08, 0x4f }, { PHY_REG_09, 0x30 },
- { PHY_REG_10, 0x33 }, { PHY_REG_11, 0x65 },
+ { PHY_REG(0), 0x00 }, { PHY_REG(1), 0xd1 },
+ { PHY_REG(8), 0x4f }, { PHY_REG(9), 0x30 },
+ { PHY_REG(10), 0x33 }, { PHY_REG(11), 0x65 },
/* REG12 pixclk specific */
/* REG13 pixclk specific */
/* REG14 pixclk specific */
- { PHY_REG_15, 0x80 }, { PHY_REG_16, 0x6c },
- { PHY_REG_17, 0xf2 }, { PHY_REG_18, 0x67 },
- { PHY_REG_19, 0x00 }, { PHY_REG_20, 0x10 },
+ { PHY_REG(15), 0x80 }, { PHY_REG(16), 0x6c },
+ { PHY_REG(17), 0xf2 }, { PHY_REG(18), 0x67 },
+ { PHY_REG(19), 0x00 }, { PHY_REG(20), 0x10 },
/* REG21 pixclk specific */
- { PHY_REG_22, 0x30 }, { PHY_REG_23, 0x32 },
- { PHY_REG_24, 0x60 }, { PHY_REG_25, 0x8f },
- { PHY_REG_26, 0x00 }, { PHY_REG_27, 0x00 },
- { PHY_REG_28, 0x08 }, { PHY_REG_29, 0x00 },
- { PHY_REG_30, 0x00 }, { PHY_REG_31, 0x00 },
- { PHY_REG_32, 0x00 }, { PHY_REG_33, 0x80 },
- { PHY_REG_34, 0x00 }, { PHY_REG_35, 0x00 },
- { PHY_REG_36, 0x00 }, { PHY_REG_37, 0x00 },
- { PHY_REG_38, 0x00 }, { PHY_REG_39, 0x00 },
- { PHY_REG_40, 0x00 }, { PHY_REG_41, 0xe0 },
- { PHY_REG_42, 0x83 }, { PHY_REG_43, 0x0f },
- { PHY_REG_44, 0x3E }, { PHY_REG_45, 0xf8 },
- { PHY_REG_46, 0x00 }, { PHY_REG_47, 0x00 }
+ { PHY_REG(22), 0x30 }, { PHY_REG(23), 0x32 },
+ { PHY_REG(24), 0x60 }, { PHY_REG(25), 0x8f },
+ { PHY_REG(26), 0x00 }, { PHY_REG(27), 0x00 },
+ { PHY_REG(28), 0x08 }, { PHY_REG(29), 0x00 },
+ { PHY_REG(30), 0x00 }, { PHY_REG(31), 0x00 },
+ { PHY_REG(32), 0x00 }, { PHY_REG(33), 0x80 },
+ { PHY_REG(34), 0x00 }, { PHY_REG(35), 0x00 },
+ { PHY_REG(36), 0x00 }, { PHY_REG(37), 0x00 },
+ { PHY_REG(38), 0x00 }, { PHY_REG(39), 0x00 },
+ { PHY_REG(40), 0x00 }, { PHY_REG(41), 0xe0 },
+ { PHY_REG(42), 0x83 }, { PHY_REG(43), 0x0f },
+ { PHY_REG(44), 0x3E }, { PHY_REG(45), 0xf8 },
+ { PHY_REG(46), 0x00 }, { PHY_REG(47), 0x00 }
};
struct fsl_samsung_hdmi_phy {
@@ -442,7 +395,7 @@ fsl_samsung_hdmi_phy_configure_pixclk(struct fsl_samsung_hdmi_phy *phy,
}
writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK, div),
- phy->regs + PHY_REG_21);
+ phy->regs + PHY_REG(21));
}
static void
@@ -469,7 +422,7 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
break;
}
- writeb(FIELD_PREP(REG12_CK_DIV_MASK, ilog2(div)), phy->regs + PHY_REG_12);
+ writeb(FIELD_PREP(REG12_CK_DIV_MASK, ilog2(div)), phy->regs + PHY_REG(12));
/*
* Calculation for the frequency lock detector target code (fld_tg_code)
@@ -489,11 +442,11 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
/* FLD_TOL and FLD_RP_CODE taken from downstream driver */
writeb(FIELD_PREP(REG13_TG_CODE_LOW_MASK, fld_tg_code),
- phy->regs + PHY_REG_13);
+ phy->regs + PHY_REG(13));
writeb(FIELD_PREP(REG14_TOL_MASK, 2) |
FIELD_PREP(REG14_RP_CODE_MASK, 2) |
FIELD_PREP(REG14_TG_CODE_HIGH_MASK, fld_tg_code >> 8),
- phy->regs + PHY_REG_14);
+ phy->regs + PHY_REG(14));
}
static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
@@ -503,7 +456,7 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
u8 val;
/* HDMI PHY init */
- writeb(REG33_FIX_DA, phy->regs + PHY_REG_33);
+ writeb(REG33_FIX_DA, phy->regs + PHY_REG(33));
/* common PHY registers */
for (i = 0; i < ARRAY_SIZE(common_phy_cfg); i++)
@@ -511,14 +464,14 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
/* set individual PLL registers PHY_REG2 ... PHY_REG7 */
for (i = 0; i < PHY_PLL_DIV_REGS_NUM; i++)
- writeb(cfg->pll_div_regs[i], phy->regs + PHY_REG_02 + i * 4);
+ writeb(cfg->pll_div_regs[i], phy->regs + PHY_REG(2) + i * 4);
fsl_samsung_hdmi_phy_configure_pixclk(phy, cfg);
fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
- writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG_33);
+ writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG(33));
- ret = readb_poll_timeout(phy->regs + PHY_REG_34, val,
+ ret = readb_poll_timeout(phy->regs + PHY_REG(34), val,
val & REG34_PLL_LOCK, 50, 20000);
if (ret)
dev_err(phy->dev, "PLL failed to lock\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0801/1756] phy: freescale: fsl-samsung-hdmi: Simplify REG21_PMS_S_MASK lookup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (799 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0800/1756] phy: freescale: fsl-samsung-hdmi: Replace register defines with macro Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0802/1756] phy: freescale: fsl-samsung-hdmi: Support dynamic integer Greg Kroah-Hartman
` (197 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adam Ford, Marco Felsch,
Frieder Schrempf, Dominique Martinet, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Ford <aford173@gmail.com>
[ Upstream commit 375ee44adb3640099508c5c0c01d86f0bdb16e97 ]
The value of 'S' is writen to two places, PHY_REG3[7:4] and
PHY_REG21[3:0]. There is a lookup table which contains
the value of PHY_REG3. Rather than using a switch statement
based on the pixel clock to search for the value of 'S' again,
just shift the contents of PHY_REG3[7:4] >> 4 and place the value
in PHY_REG21[3:0]. Doing this can eliminate an entire function.
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Tested-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Link: https://lore.kernel.org/r/20240914112816.520224-3-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: c01ccf91b257 ("phy: freescale: fsl-samsung-hdmi: initialize default rate")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 39 ++------------------
1 file changed, 4 insertions(+), 35 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index acea7008aefc5..4f6874226f9ab 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -364,40 +364,6 @@ to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
}
-static void
-fsl_samsung_hdmi_phy_configure_pixclk(struct fsl_samsung_hdmi_phy *phy,
- const struct phy_config *cfg)
-{
- u8 div = 0x1;
-
- switch (cfg->pixclk) {
- case 22250000 ... 33750000:
- div = 0xf;
- break;
- case 35000000 ... 40000000:
- div = 0xb;
- break;
- case 43200000 ... 47500000:
- div = 0x9;
- break;
- case 50349650 ... 63500000:
- div = 0x7;
- break;
- case 67500000 ... 90000000:
- div = 0x5;
- break;
- case 94000000 ... 148500000:
- div = 0x3;
- break;
- case 154000000 ... 297000000:
- div = 0x1;
- break;
- }
-
- writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK, div),
- phy->regs + PHY_REG(21));
-}
-
static void
fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
const struct phy_config *cfg)
@@ -466,7 +432,10 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
for (i = 0; i < PHY_PLL_DIV_REGS_NUM; i++)
writeb(cfg->pll_div_regs[i], phy->regs + PHY_REG(2) + i * 4);
- fsl_samsung_hdmi_phy_configure_pixclk(phy, cfg);
+ /* High nibble of pll_div_regs[1] contains S which also gets written to REG21 */
+ writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK,
+ cfg->pll_div_regs[1] >> 4), phy->regs + PHY_REG(21));
+
fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG(33));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0802/1756] phy: freescale: fsl-samsung-hdmi: Support dynamic integer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (800 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0801/1756] phy: freescale: fsl-samsung-hdmi: Simplify REG21_PMS_S_MASK lookup Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0803/1756] phy: freescale: fsl-samsung-hdmi: Use helper function devm_clk_get_enabled() Greg Kroah-Hartman
` (196 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adam Ford, Dominique Martinet,
Frieder Schrempf, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Ford <aford173@gmail.com>
[ Upstream commit 1951dbb41d1dff7c135eed4fa1a6330df6971549 ]
There is currently a look-up table for a variety of resolutions.
Since the phy has the ability to dynamically calculate the values
necessary to use the intger divider which should allow more
resolutions without having to update the look-up-table.
If the lookup table cannot find an exact match, fall back to the
dynamic calculator of the integer divider.
Previously, the value of P was hard-coded to 1, this required an
update to the phy_pll_cfg table to add in the extra value into the
table, so if the value of P is calculated to be something else
by the PMS calculator, the calculated_phy_pll_cfg structure
can be used instead without having to keep track of which method
was used.
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Tested-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20240914112816.520224-4-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: c01ccf91b257 ("phy: freescale: fsl-samsung-hdmi: initialize default rate")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 377 +++++++++++++------
1 file changed, 270 insertions(+), 107 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 4f6874226f9ab..029de69fbeaf4 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -16,6 +16,8 @@
#define PHY_REG(reg) (reg * 4)
+#define REG01_PMS_P_MASK GENMASK(3, 0)
+#define REG03_PMS_S_MASK GENMASK(7, 4)
#define REG12_CK_DIV_MASK GENMASK(5, 4)
#define REG13_TG_CODE_LOW_MASK GENMASK(7, 0)
@@ -38,281 +40,296 @@
#define REG34_PLL_LOCK BIT(6)
#define REG34_PHY_CLK_READY BIT(5)
-#define PHY_PLL_DIV_REGS_NUM 6
+#ifndef MHZ
+#define MHZ (1000UL * 1000UL)
+#endif
+
+#define PHY_PLL_DIV_REGS_NUM 7
struct phy_config {
u32 pixclk;
u8 pll_div_regs[PHY_PLL_DIV_REGS_NUM];
};
+/*
+ * The calculated_phy_pll_cfg only handles integer divider for PMS,
+ * meaning the last four entries will be fixed, but the first three will
+ * be calculated by the PMS calculator.
+ */
+static struct phy_config calculated_phy_pll_cfg = {
+ .pixclk = 0,
+ .pll_div_regs = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00 },
+};
+
+/* The lookup table contains values for which the fractional divder is used */
static const struct phy_config phy_pll_cfg[] = {
{
.pixclk = 22250000,
- .pll_div_regs = { 0x4b, 0xf1, 0x89, 0x88, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x4b, 0xf1, 0x89, 0x88, 0x80, 0x40 },
}, {
.pixclk = 23750000,
- .pll_div_regs = { 0x50, 0xf1, 0x86, 0x85, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x50, 0xf1, 0x86, 0x85, 0x80, 0x40 },
}, {
.pixclk = 24000000,
- .pll_div_regs = { 0x50, 0xf0, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x50, 0xf0, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 24024000,
- .pll_div_regs = { 0x50, 0xf1, 0x99, 0x02, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x50, 0xf1, 0x99, 0x02, 0x80, 0x40 },
}, {
.pixclk = 25175000,
- .pll_div_regs = { 0x54, 0xfc, 0xcc, 0x91, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x54, 0xfc, 0xcc, 0x91, 0x80, 0x40 },
}, {
.pixclk = 25200000,
- .pll_div_regs = { 0x54, 0xf0, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x54, 0xf0, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 26750000,
- .pll_div_regs = { 0x5a, 0xf2, 0x89, 0x88, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0xf2, 0x89, 0x88, 0x80, 0x40 },
}, {
.pixclk = 27000000,
- .pll_div_regs = { 0x5a, 0xf0, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0xf0, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 27027000,
- .pll_div_regs = { 0x5a, 0xf2, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0xf2, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 29500000,
- .pll_div_regs = { 0x62, 0xf4, 0x95, 0x08, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x62, 0xf4, 0x95, 0x08, 0x80, 0x40 },
}, {
.pixclk = 30750000,
- .pll_div_regs = { 0x66, 0xf4, 0x82, 0x01, 0x88, 0x45 },
+ .pll_div_regs = { 0xd1, 0x66, 0xf4, 0x82, 0x01, 0x88, 0x45 },
}, {
.pixclk = 30888000,
- .pll_div_regs = { 0x66, 0xf4, 0x99, 0x18, 0x88, 0x45 },
+ .pll_div_regs = { 0xd1, 0x66, 0xf4, 0x99, 0x18, 0x88, 0x45 },
}, {
.pixclk = 33750000,
- .pll_div_regs = { 0x70, 0xf4, 0x82, 0x01, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x70, 0xf4, 0x82, 0x01, 0x80, 0x40 },
}, {
.pixclk = 35000000,
- .pll_div_regs = { 0x58, 0xb8, 0x8b, 0x88, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x58, 0xb8, 0x8b, 0x88, 0x80, 0x40 },
}, {
.pixclk = 36000000,
- .pll_div_regs = { 0x5a, 0xb0, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0xb0, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 36036000,
- .pll_div_regs = { 0x5a, 0xb2, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0xb2, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 40000000,
- .pll_div_regs = { 0x64, 0xb0, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x64, 0xb0, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 43200000,
- .pll_div_regs = { 0x5a, 0x90, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x90, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 43243200,
- .pll_div_regs = { 0x5a, 0x92, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x92, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 44500000,
- .pll_div_regs = { 0x5c, 0x92, 0x98, 0x11, 0x84, 0x41 },
+ .pll_div_regs = { 0xd1, 0x5c, 0x92, 0x98, 0x11, 0x84, 0x41 },
}, {
.pixclk = 47000000,
- .pll_div_regs = { 0x62, 0x94, 0x95, 0x82, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x62, 0x94, 0x95, 0x82, 0x80, 0x40 },
}, {
.pixclk = 47500000,
- .pll_div_regs = { 0x63, 0x96, 0xa1, 0x82, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x63, 0x96, 0xa1, 0x82, 0x80, 0x40 },
}, {
.pixclk = 50349650,
- .pll_div_regs = { 0x54, 0x7c, 0xc3, 0x8f, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x54, 0x7c, 0xc3, 0x8f, 0x80, 0x40 },
}, {
.pixclk = 50400000,
- .pll_div_regs = { 0x54, 0x70, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x54, 0x70, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 53250000,
- .pll_div_regs = { 0x58, 0x72, 0x84, 0x03, 0x82, 0x41 },
+ .pll_div_regs = { 0xd1, 0x58, 0x72, 0x84, 0x03, 0x82, 0x41 },
}, {
.pixclk = 53500000,
- .pll_div_regs = { 0x5a, 0x72, 0x89, 0x88, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x72, 0x89, 0x88, 0x80, 0x40 },
}, {
.pixclk = 54000000,
- .pll_div_regs = { 0x5a, 0x70, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x70, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 54054000,
- .pll_div_regs = { 0x5a, 0x72, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x72, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 59000000,
- .pll_div_regs = { 0x62, 0x74, 0x95, 0x08, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x62, 0x74, 0x95, 0x08, 0x80, 0x40 },
}, {
.pixclk = 59340659,
- .pll_div_regs = { 0x62, 0x74, 0xdb, 0x52, 0x88, 0x47 },
+ .pll_div_regs = { 0xd1, 0x62, 0x74, 0xdb, 0x52, 0x88, 0x47 },
}, {
.pixclk = 59400000,
- .pll_div_regs = { 0x63, 0x70, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x63, 0x70, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 61500000,
- .pll_div_regs = { 0x66, 0x74, 0x82, 0x01, 0x88, 0x45 },
+ .pll_div_regs = { 0xd1, 0x66, 0x74, 0x82, 0x01, 0x88, 0x45 },
}, {
.pixclk = 63500000,
- .pll_div_regs = { 0x69, 0x74, 0x89, 0x08, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x69, 0x74, 0x89, 0x08, 0x80, 0x40 },
}, {
.pixclk = 67500000,
- .pll_div_regs = { 0x54, 0x52, 0x87, 0x03, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x54, 0x52, 0x87, 0x03, 0x80, 0x40 },
}, {
.pixclk = 70000000,
- .pll_div_regs = { 0x58, 0x58, 0x8b, 0x88, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x58, 0x58, 0x8b, 0x88, 0x80, 0x40 },
}, {
.pixclk = 72000000,
- .pll_div_regs = { 0x5a, 0x50, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x50, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 72072000,
- .pll_div_regs = { 0x5a, 0x52, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x52, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 74176000,
- .pll_div_regs = { 0x5d, 0x58, 0xdb, 0xA2, 0x88, 0x41 },
+ .pll_div_regs = { 0xd1, 0x5d, 0x58, 0xdb, 0xA2, 0x88, 0x41 },
}, {
.pixclk = 74250000,
- .pll_div_regs = { 0x5c, 0x52, 0x90, 0x0d, 0x84, 0x41 },
+ .pll_div_regs = { 0xd1, 0x5c, 0x52, 0x90, 0x0d, 0x84, 0x41 },
}, {
.pixclk = 78500000,
- .pll_div_regs = { 0x62, 0x54, 0x87, 0x01, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x62, 0x54, 0x87, 0x01, 0x80, 0x40 },
}, {
.pixclk = 80000000,
- .pll_div_regs = { 0x64, 0x50, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x64, 0x50, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 82000000,
- .pll_div_regs = { 0x66, 0x54, 0x82, 0x01, 0x88, 0x45 },
+ .pll_div_regs = { 0xd1, 0x66, 0x54, 0x82, 0x01, 0x88, 0x45 },
}, {
.pixclk = 82500000,
- .pll_div_regs = { 0x67, 0x54, 0x88, 0x01, 0x90, 0x49 },
+ .pll_div_regs = { 0xd1, 0x67, 0x54, 0x88, 0x01, 0x90, 0x49 },
}, {
.pixclk = 89000000,
- .pll_div_regs = { 0x70, 0x54, 0x84, 0x83, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x70, 0x54, 0x84, 0x83, 0x80, 0x40 },
}, {
.pixclk = 90000000,
- .pll_div_regs = { 0x70, 0x54, 0x82, 0x01, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x70, 0x54, 0x82, 0x01, 0x80, 0x40 },
}, {
.pixclk = 94000000,
- .pll_div_regs = { 0x4e, 0x32, 0xa7, 0x10, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x4e, 0x32, 0xa7, 0x10, 0x80, 0x40 },
}, {
.pixclk = 95000000,
- .pll_div_regs = { 0x50, 0x31, 0x86, 0x85, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x50, 0x31, 0x86, 0x85, 0x80, 0x40 },
}, {
.pixclk = 98901099,
- .pll_div_regs = { 0x52, 0x3a, 0xdb, 0x4c, 0x88, 0x47 },
+ .pll_div_regs = { 0xd1, 0x52, 0x3a, 0xdb, 0x4c, 0x88, 0x47 },
}, {
.pixclk = 99000000,
- .pll_div_regs = { 0x52, 0x32, 0x82, 0x01, 0x88, 0x47 },
+ .pll_div_regs = { 0xd1, 0x52, 0x32, 0x82, 0x01, 0x88, 0x47 },
}, {
.pixclk = 100699300,
- .pll_div_regs = { 0x54, 0x3c, 0xc3, 0x8f, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x54, 0x3c, 0xc3, 0x8f, 0x80, 0x40 },
}, {
.pixclk = 100800000,
- .pll_div_regs = { 0x54, 0x30, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x54, 0x30, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 102500000,
- .pll_div_regs = { 0x55, 0x32, 0x8c, 0x05, 0x90, 0x4b },
+ .pll_div_regs = { 0xd1, 0x55, 0x32, 0x8c, 0x05, 0x90, 0x4b },
}, {
.pixclk = 104750000,
- .pll_div_regs = { 0x57, 0x32, 0x98, 0x07, 0x90, 0x49 },
+ .pll_div_regs = { 0xd1, 0x57, 0x32, 0x98, 0x07, 0x90, 0x49 },
}, {
.pixclk = 106500000,
- .pll_div_regs = { 0x58, 0x32, 0x84, 0x03, 0x82, 0x41 },
+ .pll_div_regs = { 0xd1, 0x58, 0x32, 0x84, 0x03, 0x82, 0x41 },
}, {
.pixclk = 107000000,
- .pll_div_regs = { 0x5a, 0x32, 0x89, 0x88, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x32, 0x89, 0x88, 0x80, 0x40 },
}, {
.pixclk = 108000000,
- .pll_div_regs = { 0x5a, 0x30, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x30, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 108108000,
- .pll_div_regs = { 0x5a, 0x32, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x32, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 118000000,
- .pll_div_regs = { 0x62, 0x34, 0x95, 0x08, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x62, 0x34, 0x95, 0x08, 0x80, 0x40 },
}, {
.pixclk = 118800000,
- .pll_div_regs = { 0x63, 0x30, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x63, 0x30, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 123000000,
- .pll_div_regs = { 0x66, 0x34, 0x82, 0x01, 0x88, 0x45 },
+ .pll_div_regs = { 0xd1, 0x66, 0x34, 0x82, 0x01, 0x88, 0x45 },
}, {
.pixclk = 127000000,
- .pll_div_regs = { 0x69, 0x34, 0x89, 0x08, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x69, 0x34, 0x89, 0x08, 0x80, 0x40 },
}, {
.pixclk = 135000000,
- .pll_div_regs = { 0x70, 0x34, 0x82, 0x01, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x70, 0x34, 0x82, 0x01, 0x80, 0x40 },
}, {
.pixclk = 135580000,
- .pll_div_regs = { 0x71, 0x39, 0xe9, 0x82, 0x9c, 0x5b },
+ .pll_div_regs = { 0xd1, 0x71, 0x39, 0xe9, 0x82, 0x9c, 0x5b },
}, {
.pixclk = 137520000,
- .pll_div_regs = { 0x72, 0x38, 0x99, 0x10, 0x85, 0x41 },
+ .pll_div_regs = { 0xd1, 0x72, 0x38, 0x99, 0x10, 0x85, 0x41 },
}, {
.pixclk = 138750000,
- .pll_div_regs = { 0x73, 0x35, 0x88, 0x05, 0x90, 0x4d },
+ .pll_div_regs = { 0xd1, 0x73, 0x35, 0x88, 0x05, 0x90, 0x4d },
}, {
.pixclk = 140000000,
- .pll_div_regs = { 0x75, 0x36, 0xa7, 0x90, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x75, 0x36, 0xa7, 0x90, 0x80, 0x40 },
}, {
.pixclk = 144000000,
- .pll_div_regs = { 0x78, 0x30, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x78, 0x30, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 148352000,
- .pll_div_regs = { 0x7b, 0x35, 0xdb, 0x39, 0x90, 0x45 },
+ .pll_div_regs = { 0xd1, 0x7b, 0x35, 0xdb, 0x39, 0x90, 0x45 },
}, {
.pixclk = 148500000,
- .pll_div_regs = { 0x7b, 0x35, 0x84, 0x03, 0x90, 0x45 },
+ .pll_div_regs = { 0xd1, 0x7b, 0x35, 0x84, 0x03, 0x90, 0x45 },
}, {
.pixclk = 154000000,
- .pll_div_regs = { 0x40, 0x18, 0x83, 0x01, 0x00, 0x40 },
+ .pll_div_regs = { 0xd1, 0x40, 0x18, 0x83, 0x01, 0x00, 0x40 },
}, {
.pixclk = 157000000,
- .pll_div_regs = { 0x41, 0x11, 0xa7, 0x14, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x41, 0x11, 0xa7, 0x14, 0x80, 0x40 },
}, {
.pixclk = 160000000,
- .pll_div_regs = { 0x42, 0x12, 0xa1, 0x20, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x42, 0x12, 0xa1, 0x20, 0x80, 0x40 },
}, {
.pixclk = 162000000,
- .pll_div_regs = { 0x43, 0x18, 0x8b, 0x08, 0x96, 0x55 },
+ .pll_div_regs = { 0xd1, 0x43, 0x18, 0x8b, 0x08, 0x96, 0x55 },
}, {
.pixclk = 164000000,
- .pll_div_regs = { 0x45, 0x11, 0x83, 0x82, 0x90, 0x4b },
+ .pll_div_regs = { 0xd1, 0x45, 0x11, 0x83, 0x82, 0x90, 0x4b },
}, {
.pixclk = 165000000,
- .pll_div_regs = { 0x45, 0x11, 0x84, 0x81, 0x90, 0x4b },
+ .pll_div_regs = { 0xd1, 0x45, 0x11, 0x84, 0x81, 0x90, 0x4b },
}, {
.pixclk = 180000000,
- .pll_div_regs = { 0x4b, 0x10, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x4b, 0x10, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 185625000,
- .pll_div_regs = { 0x4e, 0x12, 0x9a, 0x95, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x4e, 0x12, 0x9a, 0x95, 0x80, 0x40 },
}, {
.pixclk = 188000000,
- .pll_div_regs = { 0x4e, 0x12, 0xa7, 0x10, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x4e, 0x12, 0xa7, 0x10, 0x80, 0x40 },
}, {
.pixclk = 198000000,
- .pll_div_regs = { 0x52, 0x12, 0x82, 0x01, 0x88, 0x47 },
+ .pll_div_regs = { 0xd1, 0x52, 0x12, 0x82, 0x01, 0x88, 0x47 },
}, {
.pixclk = 205000000,
- .pll_div_regs = { 0x55, 0x12, 0x8c, 0x05, 0x90, 0x4b },
+ .pll_div_regs = { 0xd1, 0x55, 0x12, 0x8c, 0x05, 0x90, 0x4b },
}, {
.pixclk = 209500000,
- .pll_div_regs = { 0x57, 0x12, 0x98, 0x07, 0x90, 0x49 },
+ .pll_div_regs = { 0xd1, 0x57, 0x12, 0x98, 0x07, 0x90, 0x49 },
}, {
.pixclk = 213000000,
- .pll_div_regs = { 0x58, 0x12, 0x84, 0x03, 0x82, 0x41 },
+ .pll_div_regs = { 0xd1, 0x58, 0x12, 0x84, 0x03, 0x82, 0x41 },
}, {
.pixclk = 216000000,
- .pll_div_regs = { 0x5a, 0x10, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x10, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 216216000,
- .pll_div_regs = { 0x5a, 0x12, 0xfd, 0x0c, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x5a, 0x12, 0xfd, 0x0c, 0x80, 0x40 },
}, {
.pixclk = 237600000,
- .pll_div_regs = { 0x63, 0x10, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x63, 0x10, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 254000000,
- .pll_div_regs = { 0x69, 0x14, 0x89, 0x08, 0x80, 0x40 },
+ .pll_div_regs = { 0xd1, 0x69, 0x14, 0x89, 0x08, 0x80, 0x40 },
}, {
.pixclk = 277500000,
- .pll_div_regs = { 0x73, 0x15, 0x88, 0x05, 0x90, 0x4d },
+ .pll_div_regs = { 0xd1, 0x73, 0x15, 0x88, 0x05, 0x90, 0x4d },
}, {
.pixclk = 288000000,
- .pll_div_regs = { 0x78, 0x10, 0x00, 0x00, 0x80, 0x00 },
+ .pll_div_regs = { 0xd1, 0x78, 0x10, 0x00, 0x00, 0x80, 0x00 },
}, {
.pixclk = 297000000,
- .pll_div_regs = { 0x7b, 0x15, 0x84, 0x03, 0x90, 0x45 },
+ .pll_div_regs = { 0xd1, 0x7b, 0x15, 0x84, 0x03, 0x90, 0x45 },
},
};
@@ -322,7 +339,8 @@ struct reg_settings {
};
static const struct reg_settings common_phy_cfg[] = {
- { PHY_REG(0), 0x00 }, { PHY_REG(1), 0xd1 },
+ { PHY_REG(0), 0x00 },
+ /* PHY_REG(1-7) pix clk specific */
{ PHY_REG(8), 0x4f }, { PHY_REG(9), 0x30 },
{ PHY_REG(10), 0x33 }, { PHY_REG(11), 0x65 },
/* REG12 pixclk specific */
@@ -415,6 +433,83 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
phy->regs + PHY_REG(14));
}
+static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u16 *m, u8 *s)
+{
+ unsigned long best_freq = 0;
+ u32 min_delta = 0xffffffff;
+ u8 _p, best_p;
+ u16 _m, best_m;
+ u8 _s, best_s;
+
+ /*
+ * Figure 13-78 of the reference manual states the PLL should be TMDS x 5
+ * while the TMDS_CLKO should be the PLL / 5. So to calculate the PLL,
+ * take the pix clock x 5, then return the value of the PLL / 5.
+ */
+ fout *= 5;
+
+ /* The ref manual states the values of 'P' range from 1 to 11 */
+ for (_p = 1; _p <= 11; ++_p) {
+ for (_s = 1; _s <= 16; ++_s) {
+ u64 tmp;
+ u32 delta;
+
+ /* s must be one or even */
+ if (_s > 1 && (_s & 0x01) == 1)
+ _s++;
+
+ /* _s cannot be 14 per the TRM */
+ if (_s == 14)
+ continue;
+
+ /*
+ * TODO: Ref Manual doesn't state the range of _m
+ * so this should be further refined if possible.
+ * This range was set based on the original values
+ * in the lookup table
+ */
+ tmp = (u64)fout * (_p * _s);
+ do_div(tmp, 24 * MHZ);
+ _m = tmp;
+ if (_m < 0x30 || _m > 0x7b)
+ continue;
+
+ /*
+ * Rev 2 of the Ref Manual states the
+ * VCO can range between 750MHz and
+ * 3GHz. The VCO is assumed to be
+ * Fvco = (M * f_ref) / P,
+ * where f_ref is 24MHz.
+ */
+ tmp = (u64)_m * 24 * MHZ;
+ do_div(tmp, _p);
+ if (tmp < 750 * MHZ ||
+ tmp > 3000 * MHZ)
+ continue;
+
+ /* Final frequency after post-divider */
+ do_div(tmp, _s);
+
+ delta = abs(fout - tmp);
+ if (delta < min_delta) {
+ best_p = _p;
+ best_s = _s;
+ best_m = _m;
+ min_delta = delta;
+ best_freq = tmp;
+ }
+ }
+ }
+
+ if (best_freq) {
+ *p = best_p;
+ *m = best_m;
+ *s = best_s;
+ }
+
+ return best_freq / 5;
+}
+
static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
const struct phy_config *cfg)
{
@@ -428,13 +523,13 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
for (i = 0; i < ARRAY_SIZE(common_phy_cfg); i++)
writeb(common_phy_cfg[i].val, phy->regs + common_phy_cfg[i].reg);
- /* set individual PLL registers PHY_REG2 ... PHY_REG7 */
+ /* set individual PLL registers PHY_REG1 ... PHY_REG7 */
for (i = 0; i < PHY_PLL_DIV_REGS_NUM; i++)
- writeb(cfg->pll_div_regs[i], phy->regs + PHY_REG(2) + i * 4);
+ writeb(cfg->pll_div_regs[i], phy->regs + PHY_REG(1) + i * 4);
- /* High nibble of pll_div_regs[1] contains S which also gets written to REG21 */
+ /* High nibble of PHY_REG3 and low nibble of PHY_REG21 both contain 'S' */
writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK,
- cfg->pll_div_regs[1] >> 4), phy->regs + PHY_REG(21));
+ cfg->pll_div_regs[2] >> 4), phy->regs + PHY_REG(21));
fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
@@ -459,34 +554,102 @@ static unsigned long phy_clk_recalc_rate(struct clk_hw *hw,
return phy->cur_cfg->pixclk;
}
-static long phy_clk_round_rate(struct clk_hw *hw,
- unsigned long rate, unsigned long *parent_rate)
+/* Helper function to lookup the available fractional-divider rate */
+static const struct phy_config *fsl_samsung_hdmi_phy_lookup_rate(unsigned long rate)
{
int i;
+ /* Search the lookup table */
for (i = ARRAY_SIZE(phy_pll_cfg) - 1; i >= 0; i--)
if (phy_pll_cfg[i].pixclk <= rate)
- return phy_pll_cfg[i].pixclk;
+ break;
+
+ return &phy_pll_cfg[i];
+}
+
+static void fsl_samsung_hdmi_calculate_phy(struct phy_config *cal_phy, unsigned long rate,
+ u8 p, u16 m, u8 s)
+{
+ cal_phy->pixclk = rate;
+ cal_phy->pll_div_regs[0] = FIELD_PREP(REG01_PMS_P_MASK, p);
+ cal_phy->pll_div_regs[1] = m;
+ cal_phy->pll_div_regs[2] = FIELD_PREP(REG03_PMS_S_MASK, s-1);
+ /* pll_div_regs 3-6 are fixed and pre-defined already */
+}
+
+static long phy_clk_round_rate(struct clk_hw *hw,
+ unsigned long rate, unsigned long *parent_rate)
+{
+ const struct phy_config *fract_div_phy;
+ u32 int_div_clk;
+ u16 m;
+ u8 p, s;
+
+ /* If the clock is out of range return error instead of searching */
+ if (rate > 297000000 || rate < 22250000)
+ return -EINVAL;
+
+ /* Search the fractional divider lookup table */
+ fract_div_phy = fsl_samsung_hdmi_phy_lookup_rate(rate);
- return -EINVAL;
+ /* If the rate is an exact match, return that value */
+ if (rate == fract_div_phy->pixclk)
+ return fract_div_phy->pixclk;
+
+ /* If the exact match isn't found, calculate the integer divider */
+ int_div_clk = fsl_samsung_hdmi_phy_find_pms(rate, &p, &m, &s);
+
+ /* If the int_div_clk rate is an exact match, return that value */
+ if (int_div_clk == rate)
+ return int_div_clk;
+
+ /* If neither rate is an exact match, use the value from the LUT */
+ return fract_div_phy->pixclk;
+}
+
+static int phy_use_fract_div(struct fsl_samsung_hdmi_phy *phy, const struct phy_config *fract_div_phy)
+{
+ phy->cur_cfg = fract_div_phy;
+ dev_dbg(phy->dev, "fsl_samsung_hdmi_phy: using fractional divider rate = %u\n",
+ phy->cur_cfg->pixclk);
+ return fsl_samsung_hdmi_phy_configure(phy, phy->cur_cfg);
}
static int phy_clk_set_rate(struct clk_hw *hw,
unsigned long rate, unsigned long parent_rate)
{
struct fsl_samsung_hdmi_phy *phy = to_fsl_samsung_hdmi_phy(hw);
- int i;
+ const struct phy_config *fract_div_phy;
+ u32 int_div_clk;
+ u16 m;
+ u8 p, s;
- for (i = ARRAY_SIZE(phy_pll_cfg) - 1; i >= 0; i--)
- if (phy_pll_cfg[i].pixclk <= rate)
- break;
+ /* Search the fractional divider lookup table */
+ fract_div_phy = fsl_samsung_hdmi_phy_lookup_rate(rate);
- if (i < 0)
- return -EINVAL;
+ /* If the rate is an exact match, use that value */
+ if (fract_div_phy->pixclk == rate)
+ return phy_use_fract_div(phy, fract_div_phy);
- phy->cur_cfg = &phy_pll_cfg[i];
+ /*
+ * If the rate from the fractional divider is not exact, check the integer divider,
+ * and use it if that value is an exact match.
+ */
+ int_div_clk = fsl_samsung_hdmi_phy_find_pms(rate, &p, &m, &s);
+ if (int_div_clk == rate) {
+ dev_dbg(phy->dev, "fsl_samsung_hdmi_phy: integer divider rate = %u\n",
+ int_div_clk);
+
+ fsl_samsung_hdmi_calculate_phy(&calculated_phy_pll_cfg, int_div_clk, p, m, s);
+ phy->cur_cfg = &calculated_phy_pll_cfg;
+ return fsl_samsung_hdmi_phy_configure(phy, phy->cur_cfg);
+ }
- return fsl_samsung_hdmi_phy_configure(phy, phy->cur_cfg);
+ /*
+ * If neither the fractional divider nor the integer divider can find an exact value
+ * fall back to using the fractional divider
+ */
+ return phy_use_fract_div(phy, fract_div_phy);
}
static const struct clk_ops phy_clk_ops = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0803/1756] phy: freescale: fsl-samsung-hdmi: Use helper function devm_clk_get_enabled()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (801 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0802/1756] phy: freescale: fsl-samsung-hdmi: Support dynamic integer Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0804/1756] phy: freescale: fsl-samsung-hdmi: initialize default rate Greg Kroah-Hartman
` (195 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Pei Xiao, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pei Xiao <xiaopei01@kylinos.cn>
[ Upstream commit 279950205dde78bc0e3ca73a8dfee6842f0e1edc ]
Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables the clocks for the
whole lifetime of the device. Moreover, it is no longer necessary to
unprepare and disable the clocks explicitly.
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://lore.kernel.org/r/tencent_9087BCE04E38E6AA5C4B2252B82FA99C2009@qq.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: c01ccf91b257 ("phy: freescale: fsl-samsung-hdmi: initialize default rate")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 029de69fbeaf4..0c7a107bba307 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -706,7 +706,7 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
if (IS_ERR(phy->regs))
return PTR_ERR(phy->regs);
- phy->apbclk = devm_clk_get(phy->dev, "apb");
+ phy->apbclk = devm_clk_get_enabled(phy->dev, "apb");
if (IS_ERR(phy->apbclk))
return dev_err_probe(phy->dev, PTR_ERR(phy->apbclk),
"failed to get apb clk\n");
@@ -716,12 +716,6 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
return dev_err_probe(phy->dev, PTR_ERR(phy->refclk),
"failed to get ref clk\n");
- ret = clk_prepare_enable(phy->apbclk);
- if (ret) {
- dev_err(phy->dev, "failed to enable apbclk\n");
- return ret;
- }
-
pm_runtime_get_noresume(phy->dev);
pm_runtime_set_active(phy->dev);
pm_runtime_enable(phy->dev);
@@ -737,8 +731,6 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
return 0;
register_clk_failed:
- clk_disable_unprepare(phy->apbclk);
-
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0804/1756] phy: freescale: fsl-samsung-hdmi: initialize default rate
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (802 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0803/1756] phy: freescale: fsl-samsung-hdmi: Use helper function devm_clk_get_enabled() Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0805/1756] md: take reconfig_mutex when enabling PPL on an inactive array Greg Kroah-Hartman
` (194 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aristo Chen, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aristo Chen <aristo.chen@canonical.com>
[ Upstream commit c01ccf91b257741e9edc374a465126bae9ae4711 ]
The HDMI PHY clock reports 74.25 MHz when cur_cfg is unset, but does
not establish that rate in hardware. The common clock framework caches
the reported rate when registering the clock and skips a first
clk_set_rate(74250000) request because the rate appears unchanged.
Consequently, a display whose initial mode uses a 74.25 MHz pixel clock
can leave the PHY with its bootloader register state and receive no
TMDS signal. Requesting another rate first avoids the issue because the
set_rate callback configures the PHY.
Program the 74.25 MHz table entry with the reference clock enabled
before registering the clock provider. recalc_rate can then report the
configured rate, and a skipped first rate change is safe. Also enable
the reference clock when restoring that configuration on resume.
Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY")
Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Link: https://patch.msgid.link/20260903054811.9720-1-aristo.chen@canonical.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 59 +++++++++++++++-----
1 file changed, 44 insertions(+), 15 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 0c7a107bba307..fead0063452c4 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -44,6 +44,8 @@
#define MHZ (1000UL * 1000UL)
#endif
+#define PHY_DEFAULT_RATE 74250000
+
#define PHY_PLL_DIV_REGS_NUM 7
struct phy_config {
@@ -543,17 +545,6 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
return ret;
}
-static unsigned long phy_clk_recalc_rate(struct clk_hw *hw,
- unsigned long parent_rate)
-{
- struct fsl_samsung_hdmi_phy *phy = to_fsl_samsung_hdmi_phy(hw);
-
- if (!phy->cur_cfg)
- return 74250000;
-
- return phy->cur_cfg->pixclk;
-}
-
/* Helper function to lookup the available fractional-divider rate */
static const struct phy_config *fsl_samsung_hdmi_phy_lookup_rate(unsigned long rate)
{
@@ -567,6 +558,14 @@ static const struct phy_config *fsl_samsung_hdmi_phy_lookup_rate(unsigned long r
return &phy_pll_cfg[i];
}
+static unsigned long phy_clk_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct fsl_samsung_hdmi_phy *phy = to_fsl_samsung_hdmi_phy(hw);
+
+ return phy->cur_cfg->pixclk;
+}
+
static void fsl_samsung_hdmi_calculate_phy(struct phy_config *cal_phy, unsigned long rate,
u8 p, u16 m, u8 s)
{
@@ -692,6 +691,7 @@ static int phy_clk_register(struct fsl_samsung_hdmi_phy *phy)
static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
{
+ const struct phy_config *default_cfg;
struct fsl_samsung_hdmi_phy *phy;
int ret;
@@ -716,6 +716,23 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
return dev_err_probe(phy->dev, PTR_ERR(phy->refclk),
"failed to get ref clk\n");
+ /*
+ * Establish the rate reported by recalc_rate() before registering the
+ * clock. Otherwise CCF may skip the first set_rate() when it requests
+ * the assumed default rate, leaving the PHY unconfigured.
+ */
+ ret = clk_prepare_enable(phy->refclk);
+ if (ret)
+ return dev_err_probe(phy->dev, ret,
+ "failed to enable ref clk\n");
+
+ default_cfg = fsl_samsung_hdmi_phy_lookup_rate(PHY_DEFAULT_RATE);
+ ret = fsl_samsung_hdmi_phy_configure(phy, default_cfg);
+ clk_disable_unprepare(phy->refclk);
+ if (ret)
+ return dev_err_probe(phy->dev, ret,
+ "failed to configure default rate\n");
+
pm_runtime_get_noresume(phy->dev);
pm_runtime_set_active(phy->dev);
pm_runtime_enable(phy->dev);
@@ -751,7 +768,7 @@ static int __maybe_unused fsl_samsung_hdmi_phy_suspend(struct device *dev)
static int __maybe_unused fsl_samsung_hdmi_phy_resume(struct device *dev)
{
struct fsl_samsung_hdmi_phy *phy = dev_get_drvdata(dev);
- int ret = 0;
+ int ret;
ret = clk_prepare_enable(phy->apbclk);
if (ret) {
@@ -759,11 +776,23 @@ static int __maybe_unused fsl_samsung_hdmi_phy_resume(struct device *dev)
return ret;
}
- if (phy->cur_cfg)
- ret = fsl_samsung_hdmi_phy_configure(phy, phy->cur_cfg);
+ if (!phy->cur_cfg)
+ return 0;
- return ret;
+ ret = clk_prepare_enable(phy->refclk);
+ if (ret) {
+ dev_err(phy->dev, "failed to enable ref clk\n");
+ goto disable_apbclk;
+ }
+
+ ret = fsl_samsung_hdmi_phy_configure(phy, phy->cur_cfg);
+ clk_disable_unprepare(phy->refclk);
+ if (!ret)
+ return 0;
+disable_apbclk:
+ clk_disable_unprepare(phy->apbclk);
+ return ret;
}
static DEFINE_RUNTIME_DEV_PM_OPS(fsl_samsung_hdmi_phy_pm_ops,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0805/1756] md: take reconfig_mutex when enabling PPL on an inactive array
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (803 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0804/1756] phy: freescale: fsl-samsung-hdmi: initialize default rate Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0806/1756] md/raid5: drain released_stripes before destroying the cache Greg Kroah-Hartman
` (193 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+75d7e96ad03ac2dbbd9f,
Nguyen Ngoc Thang, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
[ Upstream commit 900bf42e0ff8009f66ffd4a679c56264957019dd ]
consistency_policy_store() sets MD_HAS_PPL for an external-metadata array
that is not running yet, without holding reconfig_mutex. But ->pers is
only assigned after pers->run() returns, so "not running" also covers an
md_run() that is in progress under the lock.
If the write lands inside raid5_run() after log_init() has decided not to
set up PPL, or after a failed ppl_init_log() has cleared the flag, the
flag ends up set with conf->log_private still NULL. The next idle pass
of raid5d() then does:
raid5d() -> handle_active_stripes() -> log_flush_stripe_to_raid()
-> ppl_write_stripe_run()
and dereferences the NULL ppl_conf:
Oops: general protection fault, probably for non-canonical address
0xdffffc0000000002
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
RIP: 0010:ppl_write_stripe_run+0x60/0x1320 drivers/md/raid5-ppl.c:538
Take reconfig_mutex around the update and refuse it with -EBUSY once the
array is running, in which case ->change_consistency_policy() is the
right interface.
Fixes: 664aed04446c ("md: add sysfs entries for PPL")
Reported-by: syzbot+75d7e96ad03ac2dbbd9f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=75d7e96ad03ac2dbbd9f
Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Link: https://patch.msgid.link/20260924171345.75894-1-ngocthang2710.1999@gmail.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/md.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c7214157d12ce..d5b46a6e61384 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5641,7 +5641,15 @@ consistency_policy_store(struct mddev *mddev, const char *buf, size_t len)
else
err = -EBUSY;
} else if (mddev->external && strncmp(buf, "ppl", 3) == 0) {
- set_bit(MD_HAS_PPL, &mddev->flags);
+ /* md_run() holds the lock until ->pers is set */
+ err = mddev_lock(mddev);
+ if (err)
+ return err;
+ if (mddev->pers)
+ err = -EBUSY;
+ else
+ set_bit(MD_HAS_PPL, &mddev->flags);
+ mddev_unlock(mddev);
} else {
err = -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0806/1756] md/raid5: drain released_stripes before destroying the cache
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (804 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0805/1756] md: take reconfig_mutex when enabling PPL on an inactive array Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0807/1756] clk: imx: composite-93: return timeout from gate enable Greg Kroah-Hartman
` (192 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+6a132745caefcf42cb0d,
Li Youhong, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Youhong <liyouhong@kylinos.cn>
[ Upstream commit af560e357a81964544be40c549e241b032ef7565 ]
grow_one_stripe() calls raid5_release_stripe() for each new stripe.
When mddev->thread is already set, that queues the stripe on
conf->released_stripes and wakes the thread. Only raid5d moves that
list onto inactive_list.
Takeover calls setup_conf() while mddev->thread still belongs to the
previous personality, so those stripes stay on released_stripes. If
setup_conf() then fails, shrink_stripes() only frees inactive_list and
kmem_cache_destroy() warns that objects remain.
Move stripes still queued on released_stripes onto inactive_list
before shrink_stripes() frees them.
Fixes: 773ca82fa1ee ("raid5: make release_stripe lockless")
Reported-by: syzbot+6a132745caefcf42cb0d@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-raid/6ab6b743.7eec07f4.c25c.0006.GAE@google.com/T/#t
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
Link: https://patch.msgid.link/20260929083916.50620-1-dayou5941@163.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 99660cf51f533..84b3d60605189 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2706,6 +2706,37 @@ static int drop_one_stripe(struct r5conf *conf)
static void shrink_stripes(struct r5conf *conf)
{
+ struct list_head temp[NR_STRIPE_HASH_LOCKS];
+ int i;
+
+ /*
+ * grow_one_stripe() parks new stripes on released_stripes when
+ * mddev->thread is already set. Takeover leaves the previous
+ * personality's thread there, so raid5d never moves them to
+ * inactive_list. Drain them before the cache is destroyed.
+ * slab_cache is assigned only after device_lock and the hash
+ * lists exist; earlier abort paths have nothing to drain.
+ */
+ if (conf->slab_cache) {
+ for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++)
+ INIT_LIST_HEAD(&temp[i]);
+
+ spin_lock_irq(&conf->device_lock);
+ release_stripe_list(conf, temp);
+ spin_unlock_irq(&conf->device_lock);
+
+ for (i = 0; i < NR_STRIPE_HASH_LOCKS; i++) {
+ if (list_empty(&temp[i]))
+ continue;
+ spin_lock_irq(conf->hash_locks + i);
+ if (list_empty(conf->inactive_list + i))
+ atomic_dec(&conf->empty_inactive_list_nr);
+ list_splice_tail_init(&temp[i],
+ conf->inactive_list + i);
+ spin_unlock_irq(conf->hash_locks + i);
+ }
+ }
+
while (conf->max_nr_stripes &&
drop_one_stripe(conf))
;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0807/1756] clk: imx: composite-93: return timeout from gate enable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (805 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0806/1756] md/raid5: drain released_stripes before destroying the cache Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0808/1756] md/raid5: protect big_stripe_tree lookup with RCU Greg Kroah-Hartman
` (191 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linkai Gong, Peng Fan, Frank Li,
Abel Vesa, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <gonglinkai@kylinos.cn>
[ Upstream commit 246d9fa6b83d2d3c524aad28de1ab5db5cecf048 ]
imx93_clk_composite_wait_ready() already reports a busy timeout, but
imx93_clk_composite_gate_enable() ignores that and always returns 0.
The clk framework then marks the clock enabled and lets consumers run
while the CCM slice is still busy.
Propagate the timeout so enable fails instead of looking successful.
Fixes: 4a3de5aa7743 ("clk: imx: clk-composite-93: check slice busy")
Signed-off-by: Linkai Gong <gonglinkai@kylinos.cn>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260907022214.1076402-1-gonglinkai@kylinos.cn
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/imx/clk-composite-93.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/imx/clk-composite-93.c b/drivers/clk/imx/clk-composite-93.c
index 6c6c5a30f3282..c2c4140c7f7e0 100644
--- a/drivers/clk/imx/clk-composite-93.c
+++ b/drivers/clk/imx/clk-composite-93.c
@@ -43,11 +43,12 @@ static int imx93_clk_composite_wait_ready(struct clk_hw *hw, void __iomem *reg)
return ret;
}
-static void imx93_clk_composite_gate_endisable(struct clk_hw *hw, int enable)
+static int imx93_clk_composite_gate_endisable(struct clk_hw *hw, int enable)
{
struct clk_gate *gate = to_clk_gate(hw);
unsigned long flags;
u32 reg;
+ int ret;
if (gate->lock)
spin_lock_irqsave(gate->lock, flags);
@@ -61,17 +62,17 @@ static void imx93_clk_composite_gate_endisable(struct clk_hw *hw, int enable)
writel(reg, gate->reg);
- imx93_clk_composite_wait_ready(hw, gate->reg);
+ ret = imx93_clk_composite_wait_ready(hw, gate->reg);
if (gate->lock)
spin_unlock_irqrestore(gate->lock, flags);
+
+ return ret;
}
static int imx93_clk_composite_gate_enable(struct clk_hw *hw)
{
- imx93_clk_composite_gate_endisable(hw, 1);
-
- return 0;
+ return imx93_clk_composite_gate_endisable(hw, 1);
}
static void imx93_clk_composite_gate_disable(struct clk_hw *hw)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0808/1756] md/raid5: protect big_stripe_tree lookup with RCU
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (806 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0807/1756] clk: imx: composite-93: return timeout from gate enable Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0809/1756] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Greg Kroah-Hartman
` (190 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sang-Hoon Choi, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sang-Hoon Choi <csh0052@gmail.com>
[ Upstream commit 73b0df929494522acf9ccc8dafea4f721166965b ]
big_stripe_tree is updated under tree_lock, and deleted radix-tree
nodes are freed after an RCU grace period. r5c_big_stripe_cached()
used to run under an RCU read-side critical section, but that protection
was removed together with unrelated rdev lookup protection.
The lookup can now be preempted while walking the tree, allowing a
concurrent deletion and grace period to complete before the walk
resumes. Protect the lookup locally with rcu_read_lock(). Only the
presence of the entry is used after unlocking.
Fixes: ad8606702f26 ("md/raid5: remove rcu protection to access rdev from conf")
Assisted-by: LLM
Signed-off-by: Sang-Hoon Choi <csh0052@gmail.com>
Link: https://patch.msgid.link/179070265341.12871.12495446593114993799.idr-bug-88@gmail.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/raid5-cache.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 1f06dd27290e7..668a54fb86e6a 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -2971,7 +2971,9 @@ bool r5c_big_stripe_cached(struct r5conf *conf, sector_t sect)
return false;
tree_index = r5c_tree_index(conf, sect);
+ rcu_read_lock();
slot = radix_tree_lookup(&log->big_stripe_tree, tree_index);
+ rcu_read_unlock();
return slot != NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0809/1756] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (807 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0808/1756] md/raid5: protect big_stripe_tree lookup with RCU Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0810/1756] power: supply: bq24190: Remove redundant pm_runtime_mark_last_busy() calls Greg Kroah-Hartman
` (189 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jernej Skrabec, Rob Herring (Arm),
Chen-Yu Tsai, Nicolas Dufresne, Hans Verkuil, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wens@kernel.org>
[ Upstream commit ca9a67831805dc788407a05f276abb6b86b1174d ]
On the H6 SoC, the Video Engine has two memory ports, thus two IOMMU
connections. The secondary one that is missing is likely used for
reading reference frames. The newer H616 is the same. On the other
hand, the D1 only has one memory port.
Add the missing IOMMU connection for the Video Engine.
Fixes: 62a8ccf3a248 ("arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../allwinner,sun4i-a10-video-engine.yaml | 21 ++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
index 01f2afa023f04..932043d7f0cc4 100644
--- a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -55,7 +55,10 @@ properties:
description: Phandle to the device SRAM
iommus:
- maxItems: 1
+ minItems: 1
+ items:
+ - description: VE port on IOMMU
+ - description: VE_R port on IOMMU
memory-region:
maxItems: 1
@@ -82,6 +85,22 @@ required:
- resets
- allwinner,sram
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - allwinner,sun50i-h6-video-engine
+ then:
+ properties:
+ iommus:
+ minItems: 2
+ else:
+ properties:
+ iommus:
+ maxItems: 1
+
additionalProperties: false
examples:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0810/1756] power: supply: bq24190: Remove redundant pm_runtime_mark_last_busy() calls
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (808 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0809/1756] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0811/1756] power: supply: bq24190_charger: dont reset registers across system suspend Greg Kroah-Hartman
` (188 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sakari Ailus, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <sakari.ailus@linux.intel.com>
[ Upstream commit 2453753f395e68af947d9ac6ce37bf0eb40f7123 ]
pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20250704075442.3221283-1-sakari.ailus@linux.intel.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Stable-dep-of: e0844bd22a9f ("power: supply: bq24190_charger: don't reset registers across system suspend")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/bq24190_charger.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index 35611eca057e1..08ba33a1aae6b 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -502,7 +502,6 @@ static ssize_t bq24190_sysfs_show(struct device *dev,
else
count = sysfs_emit(buf, "%hhx\n", v);
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return count;
@@ -533,7 +532,6 @@ static ssize_t bq24190_sysfs_store(struct device *dev,
if (ret)
count = ret;
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return count;
@@ -560,7 +558,6 @@ static int bq24190_set_otg_vbus(struct bq24190_dev_info *bdi, bool enable)
else
ret = bq24190_charger_set_charge_type(bdi, &val);
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return ret;
@@ -603,7 +600,6 @@ static int bq24296_set_otg_vbus(struct bq24190_dev_info *bdi, bool enable)
}
out:
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return ret;
@@ -636,7 +632,6 @@ static int bq24190_vbus_is_enabled(struct regulator_dev *dev)
BQ24190_REG_POC_CHG_CONFIG_MASK,
BQ24190_REG_POC_CHG_CONFIG_SHIFT, &val);
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
if (ret)
@@ -673,7 +668,6 @@ static int bq24296_vbus_is_enabled(struct regulator_dev *dev)
BQ24296_REG_POC_OTG_CONFIG_MASK,
BQ24296_REG_POC_OTG_CONFIG_SHIFT, &val);
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
if (ret)
@@ -1373,7 +1367,6 @@ static int bq24190_charger_get_property(struct power_supply *psy,
ret = -ENODATA;
}
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return ret;
@@ -1415,7 +1408,6 @@ static int bq24190_charger_set_property(struct power_supply *psy,
ret = -EINVAL;
}
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return ret;
@@ -1673,7 +1665,6 @@ static int bq24190_battery_get_property(struct power_supply *psy,
ret = -ENODATA;
}
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return ret;
@@ -1704,7 +1695,6 @@ static int bq24190_battery_set_property(struct power_supply *psy,
ret = -EINVAL;
}
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
return ret;
@@ -1852,7 +1842,6 @@ static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
return IRQ_NONE;
}
bq24190_check_status(bdi);
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
bdi->irq_event = false;
@@ -2160,7 +2149,6 @@ static int bq24190_probe(struct i2c_client *client)
if (ret < 0)
goto out_charger;
- pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
return 0;
@@ -2247,7 +2235,6 @@ static __maybe_unused int bq24190_pm_suspend(struct device *dev)
bq24190_register_reset(bdi);
if (error >= 0) {
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
}
@@ -2272,7 +2259,6 @@ static __maybe_unused int bq24190_pm_resume(struct device *dev)
bq24190_read(bdi, BQ24190_REG_SS, &bdi->ss_reg);
if (error >= 0) {
- pm_runtime_mark_last_busy(bdi->dev);
pm_runtime_put_autosuspend(bdi->dev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0811/1756] power: supply: bq24190_charger: dont reset registers across system suspend
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (809 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0810/1756] power: supply: bq24190: Remove redundant pm_runtime_mark_last_busy() calls Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0812/1756] md: Fix the null-ptr-deref of mddev->private while submitting IO Greg Kroah-Hartman
` (187 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ryan Brue, Hans de Goede,
Sebastian Reichel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Brue <ryanbrue.dev@gmail.com>
[ Upstream commit e0844bd22a9f97885882bde3c4a441710e895240 ]
bq24190_pm_suspend() calls bq24190_register_reset(), which returns every
register to its power-on default, and bq24190_pm_resume() does it again
before re-applying the probe-time configuration. On any board that wires
the charger's interrupt this makes system suspend unusable.
The reset re-arms the chip's 40 s i2c watchdog. bq24190_set_config() turns
that watchdog off at probe, deliberately: as the comment there explains,
the same write also takes the part out of default mode into host mode.
Nothing pets it while the system is asleep, so it expires, resets the
registers again and pulses INT. The charger interrupt is a system wake
source -- armed unconditionally in probe since commit f385e6e2a153 ("power:
bq24190_charger: Use PM runtime autosuspend"), and still enabled by default
after the conversion to the wake irq API [1] -- so the pulse wakes the
machine.
Measured on an MT8173 board (Amazon Fire HD 10 2017, BQ24297) by swapping
only this driver between builds with and without this change, asking for
a 150 s suspend each time:
on charger, with the reset: 41-43 s, 7 runs of 7
on charger, without the reset: 150 s, 3 runs of 3
on battery, with the reset: 40-41 s, 3 runs of 3
on battery, without the reset: 150 s, 3 runs of 3
It is not a charging-only problem. The watchdog runs from VBUS or from
the battery, so an unplugged tablet loses suspend in the same way.
ftrace names the wake source. Across the resume, the first device
interrupt after the machine comes back is the charger:
1270.760799: suspend_resume: machine_suspend[3] end
1270.775683: irq_handler_entry: irq=25 name=bq24190-charger
1270.776156: irq_handler_entry: irq=250 name=11010000.i2c
Everything between is IPI and arch_timer from bringing the secondary CPUs
back up, and no RTC interrupt appears anywhere in the trace -- the 150 s
wake alarm never fired. The cause leaves nothing behind for userspace to
find, because WATCHDOG_FAULT is in the latch-on-read fault register and
the driver's own interrupt handler has already consumed it.
The reset also discards host configuration that nothing restores. Resume
calls bq24190_set_config(), which writes only the watchdog, SYS_MIN,
IPRECHG, ITERM, ICHG and VREG, so:
- IINLIM returns to its power-on default. Boards without a charger-type
detector set the input limit from userspace; measured here, one ordinary
suspend/resume silently took input_current_limit from 1500 mA to 500 mA,
and to 100 mA when running from the battery, where the default differs.
- EN_HIZ is cleared, so a charger the host put into high-impedance mode
starts drawing from VBUS again the moment the system sleeps.
There is no way to have both. Default mode is what the reset is for, and on
this part default mode and a disarmed watchdog are mutually exclusive: a
write to any register moves the chip into host mode, and it only returns to
default mode when the watchdog times out. Parking it in default mode for
the sleep therefore always leaves a timer armed that will fire, and on any
board that wires INT that firing is a wake. A per-board opt-out would not
be choosing between two workable configurations, only between a working
suspend and a broken one.
Resetting in suspend buys nothing worth this. The part is in host mode with
its watchdog off; it charges on its own, switching from constant current to
constant voltage and terminating when the battery is full, and nothing in
it can expire or change while the host sleeps. Resetting on resume is
weaker
still: the host is awake and about to reconfigure the chip, so the reset
only guarantees the loss.
The one thing the reset does guard against is a host that never comes back:
a chip in host mode keeps whatever it was last told, where default mode
would revert to the power-on values. But that is the state the driver
leaves it in for all of normal runtime operation already, so sleep is not
special, and the part still makes its own constant-current to
constant-voltage transition and terminates when the battery is full.
So drop it in both directions. The suspend callback has nothing left to do
and goes away. Resume re-applies the probe-time configuration, which is
idempotent and also recovers a part that did somehow fall back to default
mode, since bq24190_set_config() starts by turning the watchdog off.
This has been proposed before. Hans de Goede sent the same change in 2017
[2] and Sebastian Reichel agreed with the reasoning [3], but v6 kept the
reset on by default and added the "disable-reset" device property instead
[4]. That property cannot answer this: it is set only from x86 platform
code -- i2c-cht-wc and x86-android-tablets -- and is not in bq24190.yaml,
so no DT board can reach it. Every in-tree DT user of this driver
(tegra124-xiaomi-mocha, qcom-msm8974-lge-nexus5-hammerhead,
qcom-msm8974pro-oneplus-bacon, rk3188-bqedison2qc) wires the charger
interrupt and so has the same wake armed, with no way to opt out. If some
board does want the reset, it would be better expressed the other way
round.
The vendor kernel for this board does not reset across suspend either: its
driver, drivers/power/mt81xx/bq24297.c, only masks the charger interrupt on
suspend and unmasks it on resume.
Reproduced on a BQ24297. The reasoning applies to the family, but the other
parts were not available to test.
[1] https://lore.kernel.org/all/20260908-rbrue-suez-upstreaming-bq24190_charger-use-wake-irq-api-v1-1-c3f10ae2a34a@gmail.com/
[2] https://lore.kernel.org/all/20170322145536.30570-5-hdegoede@redhat.com/
[3] https://lore.kernel.org/all/20170323112052.ukyazi4pnji7n6st@earth/
[4] https://lore.kernel.org/all/20170414165233.4532-1-hdegoede@redhat.com/
Fixes: d7bf353fd0aa ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Assisted-by: LLM
Signed-off-by: Ryan Brue <ryanbrue.dev@gmail.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Link: https://patch.msgid.link/20260928-rbrue-suez-upstreaming-bq24190_charger-no-reset-regs-sys-suspend-v1-1-9a7689f12c05@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/bq24190_charger.c | 30 ++++++++------------------
1 file changed, 9 insertions(+), 21 deletions(-)
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index 08ba33a1aae6b..4bb74108b5d84 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -2222,25 +2222,6 @@ static __maybe_unused int bq24190_runtime_resume(struct device *dev)
return 0;
}
-static __maybe_unused int bq24190_pm_suspend(struct device *dev)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
- int error;
-
- error = pm_runtime_resume_and_get(bdi->dev);
- if (error < 0)
- dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error);
-
- bq24190_register_reset(bdi);
-
- if (error >= 0) {
- pm_runtime_put_autosuspend(bdi->dev);
- }
-
- return 0;
-}
-
static __maybe_unused int bq24190_pm_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -2254,7 +2235,14 @@ static __maybe_unused int bq24190_pm_resume(struct device *dev)
if (error < 0)
dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error);
- bq24190_register_reset(bdi);
+ /*
+ * The chip kept its configuration through the sleep: it is in host
+ * mode with the i2c watchdog off, so nothing expired and nothing was
+ * reset. Do not reset it here either -- a userspace setting such as
+ * EN_HIZ or IINLIM would otherwise be silently lost on every resume.
+ * Re-applying the probe-time configuration is idempotent and cheap,
+ * and covers a part that did somehow fall back to default mode.
+ */
bq24190_set_config(bdi);
bq24190_read(bdi, BQ24190_REG_SS, &bdi->ss_reg);
@@ -2273,7 +2261,7 @@ static __maybe_unused int bq24190_pm_resume(struct device *dev)
static const struct dev_pm_ops bq24190_pm_ops = {
SET_RUNTIME_PM_OPS(bq24190_runtime_suspend, bq24190_runtime_resume,
NULL)
- SET_SYSTEM_SLEEP_PM_OPS(bq24190_pm_suspend, bq24190_pm_resume)
+ SET_SYSTEM_SLEEP_PM_OPS(NULL, bq24190_pm_resume)
};
static const struct i2c_device_id bq24190_i2c_ids[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0812/1756] md: Fix the null-ptr-deref of mddev->private while submitting IO
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (810 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0811/1756] power: supply: bq24190_charger: dont reset registers across system suspend Greg Kroah-Hartman
@ 2026-11-18 14:48 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0813/1756] dt-bindings: power: supply: ab8500: Add AB8505 charger Greg Kroah-Hartman
` (186 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:48 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+3fe892ea5fc292e1353f,
Zhihao Cheng, Yu Kuai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhihao Cheng <chengzhihao1@huawei.com>
[ Upstream commit 4c90b76e0198deb89376988daa8d96b48bea7fcf ]
Concurrent processes md_stop and IO submission can trigger a NULL
pointer dereference of mddev->private:
BUG: kernel NULL pointer dereference, address: 0000000000000070
RIP: 0010:_wait_barrier+0x2f/0x250
Call Trace:
raid1_make_request+0x150/0xf50
md_handle_request+0x104/0x530
md_submit_bio+0x76/0x130
submit_bio+0xdd/0x250
submit_bio_wait+0x1f/0x40
__blkdev_direct_IO_simple+0x1f6/0x370
blkdev_write_iter+0x3b2/0x520
ksys_write+0x7d/0x190
One process can submit I/O through an open file while a forked process
uses the same file to issue STOP_ARRAY. The opener check permits this
because md_open() was called only once. do_md_stop() can then clear
mddev->private while the I/O is entering the personality make_request
callback.
This affects raid0, raid1, raid10, and raid5. Suspend STOP_ARRAY while
holding the reconfiguration lock so teardown waits for active_io
references to drain. Fail I/O in md_handle_request() if mddev->pers is
NULL after the array resumes.
The sysfs stopping paths are protected by
mddev_set_closing_and_sync_blockdev(). Apply that protection to both
clear and inactive transitions even when the array is read-only.
dm-raid teardown is already invoked with the device suspended.
Fetch a reproducer in
https://bugzilla.kernel.org/show_bug.cgi?id=222020
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+3fe892ea5fc292e1353f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3fe892ea5fc292e1353f
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Link: https://patch.msgid.link/20260922030538.1634904-1-chengzhihao1@huawei.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/md.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index d5b46a6e61384..ed125819c61c0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -398,6 +398,20 @@ bool md_handle_request(struct mddev *mddev, struct bio *bio)
if (!percpu_ref_tryget_live(&mddev->active_io))
goto check_suspended;
}
+ if (!mddev->pers) {
+ /*
+ * The __md_stop() sets 'mddev->private' to NULL during
+ * the IO submitting, check 'mddev->pers' before the IO
+ * being processed by specific driver to avoid the
+ * null-ptr-deref of 'mddev-><member>'. The check is
+ * safe because the IO has got the 'mddev->active_io'
+ * reference, and all __md_stop() callers will wait for
+ * the reference to be zero.
+ */
+ bio_io_error(bio);
+ percpu_ref_put(&mddev->active_io);
+ return true;
+ }
if (!mddev->pers->make_request(mddev, bio)) {
percpu_ref_put(&mddev->active_io);
if (!mddev->gendisk && mddev->pers->prepare_suspend)
@@ -4468,7 +4482,8 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len)
case readonly:
case inactive:
case read_auto:
- if (!mddev->pers || !md_is_rdwr(mddev))
+ if (!mddev->pers ||
+ (st != clear && st != inactive && !md_is_rdwr(mddev)))
break;
/* write sysfs will not open mddev and opener should be 0 */
err = mddev_set_closing_and_sync_blockdev(mddev, 0);
@@ -7736,6 +7751,7 @@ static bool md_ioctl_need_suspend(unsigned int cmd)
case HOT_REMOVE_DISK:
case SET_BITMAP_FILE:
case SET_ARRAY_INFO:
+ case STOP_ARRAY:
return true;
default:
return false;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0813/1756] dt-bindings: power: supply: ab8500: Add AB8505 charger
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (811 preceding siblings ...)
2026-11-18 14:48 ` [PATCH 6.12 0812/1756] md: Fix the null-ptr-deref of mddev->private while submitting IO Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0814/1756] .gitignore: drop Module.markers Greg Kroah-Hartman
` (185 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Linus Walleij,
Sebastian Reichel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 80d28539c1f9baab72210501729d67e3d9daa4b8 ]
AB8500 and AB8505 expose different charger interrupt sets. Add a unique
AB8505 charger compatible with the AB8500 compatible as its fallback.
Use the variant-specific string to require the fourteen main and USB
charger interrupts on AB8500 and the nine USB charger interrupts on
AB8505.
Also clarify that autopower_cfg describes the AB8500 facility, since the
corresponding AB8505 register bit is reserved.
Fixes: eb917497734c ("dt-bindings: power: supply: ab8500: Convert to DT schema format")
Assisted-by: LLM
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260925-ab8500-charger-dt-v3-1-f80b8d295e2d@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../supply/stericsson,ab8500-charger.yaml | 76 ++++++++++++++-----
1 file changed, 56 insertions(+), 20 deletions(-)
diff --git a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
index e33329b3af619..b653fc9c45436 100644
--- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
@@ -10,12 +10,13 @@ title: AB8500 Charger
maintainers:
- Sebastian Reichel <sre@kernel.org>
-allOf:
- - $ref: power-supply.yaml#
-
properties:
compatible:
- const: stericsson,ab8500-charger
+ oneOf:
+ - const: stericsson,ab8500-charger
+ - items:
+ - const: stericsson,ab8505-charger
+ - const: stericsson,ab8500-charger
monitored-battery:
$ref: /schemas/types.yaml#/definitions/phandle
@@ -30,27 +31,15 @@ properties:
autopower_cfg:
type: boolean
- description: automatic poweron after powerloss
+ description: AB8500 automatic poweron after powerloss
interrupts:
+ minItems: 9
maxItems: 14
interrupt-names:
- items:
- - const: MAIN_CH_UNPLUG_DET
- - const: MAIN_CHARGE_PLUG_DET
- - const: MAIN_EXT_CH_NOT_OK
- - const: MAIN_CH_TH_PROT_R
- - const: MAIN_CH_TH_PROT_F
- - const: VBUS_DET_F
- - const: VBUS_DET_R
- - const: USB_LINK_STATUS
- - const: USB_CH_TH_PROT_R
- - const: USB_CH_TH_PROT_F
- - const: USB_CHARGER_NOT_OKR
- - const: VBUS_OVV
- - const: CH_WD_EXP
- - const: VBUS_CH_DROP_END
+ minItems: 9
+ maxItems: 14
io-channels:
minItems: 2
@@ -77,6 +66,53 @@ required:
- io-channels
- io-channel-names
+allOf:
+ - $ref: power-supply.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: stericsson,ab8505-charger
+ then:
+ properties:
+ interrupts:
+ minItems: 9
+ maxItems: 9
+
+ interrupt-names:
+ items:
+ - const: VBUS_DET_F
+ - const: VBUS_DET_R
+ - const: USB_LINK_STATUS
+ - const: USB_CH_TH_PROT_R
+ - const: USB_CH_TH_PROT_F
+ - const: USB_CHARGER_NOT_OKR
+ - const: VBUS_OVV
+ - const: CH_WD_EXP
+ - const: VBUS_CH_DROP_END
+ else:
+ properties:
+ interrupts:
+ minItems: 14
+ maxItems: 14
+
+ interrupt-names:
+ items:
+ - const: MAIN_CH_UNPLUG_DET
+ - const: MAIN_CHARGE_PLUG_DET
+ - const: MAIN_EXT_CH_NOT_OK
+ - const: MAIN_CH_TH_PROT_R
+ - const: MAIN_CH_TH_PROT_F
+ - const: VBUS_DET_F
+ - const: VBUS_DET_R
+ - const: USB_LINK_STATUS
+ - const: USB_CH_TH_PROT_R
+ - const: USB_CH_TH_PROT_F
+ - const: USB_CHARGER_NOT_OKR
+ - const: VBUS_OVV
+ - const: CH_WD_EXP
+ - const: VBUS_CH_DROP_END
+
additionalProperties: false
examples:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0814/1756] .gitignore: drop Module.markers
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (812 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0813/1756] dt-bindings: power: supply: ab8500: Add AB8505 charger Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0815/1756] perf/cxl: Program the requested event group on configurable counters Greg Kroah-Hartman
` (184 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jan Stancek, Nicolas Schier,
Nathan Chancellor, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Stancek <jstancek@redhat.com>
[ Upstream commit a7d32fa14bc74d1786a2f0513b6f0815bd4be311 ]
commit fc5377668c3d ("tracing: Remove markers") deleted the marker code
and the modpost output. Follow-up commit 8723eaeff59a ("Kbuild: clean up
marker") removed it from clean and mrproper targets. Both are from 2009,
so the file is hopefully no longer in anyone's tree, drop it from
.gitignore as well.
Fixes: 8723eaeff59a ("Kbuild: clean up marker")
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/8cbe913b9f80dc6fea73a9e3d51429db2b38905f.1790838401.git.jstancek@redhat.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.gitignore | 1 -
1 file changed, 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index a61e4778d011c..f94178a69e328 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,7 +67,6 @@ modules.order
/vmlinux-gdb.py
/vmlinuz
/System.map
-/Module.markers
/modules.builtin
/modules.builtin.modinfo
/modules.builtin.ranges
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0815/1756] perf/cxl: Program the requested event group on configurable counters
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (813 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0814/1756] .gitignore: drop Module.markers Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0816/1756] perf/cxl: Clear stale event fields before reprogramming a counter Greg Kroah-Hartman
` (183 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Dave Jiang, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit b22dcc11429866e07dc54299255e8ca13c26d38a ]
cxl_pmu_get_event_idx() sets *counter_idx for a configurable counter but
never *event_idx. hwc->event_base stays 0, so cxl_pmu_event_start()
programs event group 0 no matter which group the user asked for.
Return the matched capability's event_idx.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index ce97062a66190..968b72dba88a0 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -510,7 +510,10 @@ static const struct attribute_group *cxl_pmu_attr_groups[] = {
NULL
};
-/* If counter_idx == NULL, don't try to allocate a counter. */
+/*
+ * If counter_idx == NULL, don't try to allocate a counter. Callers that
+ * allocate pass both counter_idx and event_idx.
+ */
static int cxl_pmu_get_event_idx(struct perf_event *event, int *counter_idx,
int *event_idx)
{
@@ -538,7 +541,7 @@ static int cxl_pmu_get_event_idx(struct perf_event *event, int *counter_idx,
pmu_ev = cxl_pmu_find_config_counter_ev_cap(info, vid, gid, mask);
if (!IS_ERR(pmu_ev)) {
- if (!counter_idx)
+ if (!counter_idx || !event_idx)
return 0;
bitmap_andnot(configurable_and_free, info->conf_counter_bm,
@@ -549,6 +552,7 @@ static int cxl_pmu_get_event_idx(struct perf_event *event, int *counter_idx,
return -EINVAL;
*counter_idx = i;
+ *event_idx = pmu_ev->event_idx;
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0816/1756] perf/cxl: Clear stale event fields before reprogramming a counter
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (814 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0815/1756] perf/cxl: Program the requested event group on configurable counters Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0817/1756] perf/cxl: Fix the counter overflow delta fixup Greg Kroah-Hartman
` (182 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Dave Jiang,
Jonathan Cameron, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 7406d6cf76b1dad53084f3988dc65ab967209344 ]
cxl_pmu_event_start() ORs the event group id, event mask, edge and invert
selections into a configurable counter's config register without clearing
them first, and cxl_pmu_event_stop() leaves them set. Reuse the counter for
another event and the new selection lands on top of the old one, so the
counter counts the wrong events with stale edge and invert behaviour.
Use FIELD_MODIFY() so each field is replaced rather than accumulated.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Link: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index 968b72dba88a0..401c7ba3efbd9 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -643,17 +643,17 @@ static void cxl_pmu_event_start(struct perf_event *event, int flags)
cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_INT_ON_OVRFLW, 1);
cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_FREEZE_ON_OVRFLW, 1);
cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_ENABLE, 1);
- cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_EDGE,
- cxl_pmu_config1_get_edge(event) ? 1 : 0);
- cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_INVERT,
- cxl_pmu_config1_get_invert(event) ? 1 : 0);
+ FIELD_MODIFY(CXL_PMU_COUNTER_CFG_EDGE, &cfg,
+ cxl_pmu_config1_get_edge(event) ? 1 : 0);
+ FIELD_MODIFY(CXL_PMU_COUNTER_CFG_INVERT, &cfg,
+ cxl_pmu_config1_get_invert(event) ? 1 : 0);
/* Fixed purpose counters have next two fields RO */
if (test_bit(hwc->idx, info->conf_counter_bm)) {
- cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_EVENT_GRP_ID_IDX_MSK,
- hwc->event_base);
- cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_EVENTS_MSK,
- cxl_pmu_config_get_mask(event));
+ FIELD_MODIFY(CXL_PMU_COUNTER_CFG_EVENT_GRP_ID_IDX_MSK, &cfg,
+ hwc->event_base);
+ FIELD_MODIFY(CXL_PMU_COUNTER_CFG_EVENTS_MSK, &cfg,
+ cxl_pmu_config_get_mask(event));
}
cfg &= ~CXL_PMU_COUNTER_CFG_THRESHOLD_MSK;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0817/1756] perf/cxl: Fix the counter overflow delta fixup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (815 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0816/1756] perf/cxl: Clear stale event fields before reprogramming a counter Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0818/1756] perf/cxl: Accept an overflow interrupt on MSI message number 0 Greg Kroah-Hartman
` (181 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Dave Jiang,
Jonathan Cameron, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 0326269ed73529cdf821664b6176814cde9ca374 ]
The counter is masked to counter_width, so the subtraction in
__cxl_pmu_read() throws away the bit that records the wrap. A delta of one
whole period reads back as 0, the same as no events at all, and only the
overflow status tells the two apart - which is why __cxl_pmu_read() takes
an overflow argument.
The fixup keys off the delta rather than the operands:
delta = (new_cnt - prev_cnt) & GENMASK_ULL(counter_width - 1, 0);
if (overflow && delta < GENMASK_ULL(counter_width - 1, 0))
delta += (1UL << counter_width);
so it cannot tell which of these it is looking at:
event_start polled read wrap
ctr = 0 .......... ctr = P/2 ......... mask -> 0 (+r)
prev = 0 prev = P/2 IRQ reads new = r
prev = 0 (no read yet): new >= prev, fell short -> add period
prev = P/2 (polled): new < prev, spans wrap -> add nothing
Both rows are the same interrupt and the old guard adds a period in both,
so a mid-period read makes the event over-count. 'perf stat -I' hits that.
Condition the fixup on new_cnt >= prev_cnt, the one case the subtraction
cannot express. Dropping it outright would break the first row. It stays
exact whatever the residual r is, which matters because some events
increment by more than 1 per cycle (CXL r4.0 8.2.7.2.1, Threshold) and can
step past 0 as they wrap.
Use mask + 1 for the period rather than a shift. It is 0 for a 64-bit
counter, and avoids the old 1UL << counter_width - undefined for width 64,
and for >= 32 on 32-bit kernels.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index 401c7ba3efbd9..5fc4799d1ec14 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -686,7 +686,7 @@ static void __cxl_pmu_read(struct perf_event *event, bool overflow)
{
struct cxl_pmu_info *info = pmu_to_cxl_pmu_info(event->pmu);
struct hw_perf_event *hwc = &event->hw;
- u64 new_cnt, prev_cnt, delta;
+ u64 new_cnt, prev_cnt, delta, mask;
do {
prev_cnt = local64_read(&hwc->prev_count);
@@ -694,12 +694,16 @@ static void __cxl_pmu_read(struct perf_event *event, bool overflow)
} while (local64_cmpxchg(&hwc->prev_count, prev_cnt, new_cnt) != prev_cnt);
/*
- * If we know an overflow occur then take that into account.
- * Note counter is not reset as that would lose events
+ * The mask discards the bit that says the counter wrapped, so a delta of
+ * one whole period reads back as 0 - the same as no events at all. Only
+ * the overflow status separates them, and new_cnt >= prev_cnt is that
+ * case, so add the period back. mask + 1 is 2^counter_width, which comes
+ * out as 0 for a 64-bit counter and avoids an undefined 1 << 64.
*/
- delta = (new_cnt - prev_cnt) & GENMASK_ULL(info->counter_width - 1, 0);
- if (overflow && delta < GENMASK_ULL(info->counter_width - 1, 0))
- delta += (1UL << info->counter_width);
+ mask = GENMASK_ULL(info->counter_width - 1, 0);
+ delta = (new_cnt - prev_cnt) & mask;
+ if (overflow && new_cnt >= prev_cnt)
+ delta += mask + 1;
local64_add(delta, &event->count);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0818/1756] perf/cxl: Accept an overflow interrupt on MSI message number 0
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (816 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0817/1756] perf/cxl: Fix the counter overflow delta fixup Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0819/1756] perf/cxl: Dont share the overflow interrupt, and keep it pinned Greg Kroah-Hartman
` (180 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Davidlohr Bueso, Richard Cheng, Dave Jiang, Will Deacon,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit af06fba45746058ba8f983a0ac2f457a3404edba ]
cxl_pmu_probe() rejects the PMU when info->irq <= 0, but at that point the
field still holds the MSI/MSI-X message number the device signals overflow
on, not a Linux virq. That number is 0-based, and -1 means no interrupt
support. Message number 0 is valid and pci_irq_vector() takes a 0-based
index, so a compliant device signalling on the first vector fails to probe.
Reject only the no-interrupt case, matching how the CXL mailbox and event
interrupts handle it.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-by: Richard Cheng <icheng@nvidia.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index 5fc4799d1ec14..09b9eca802525 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -870,7 +870,7 @@ static int cxl_pmu_probe(struct device *dev)
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
};
- if (info->irq <= 0)
+ if (info->irq < 0)
return -EINVAL;
rc = pci_irq_vector(pdev, info->irq);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0819/1756] perf/cxl: Dont share the overflow interrupt, and keep it pinned
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (817 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0818/1756] perf/cxl: Accept an overflow interrupt on MSI message number 0 Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0820/1756] perf/cxl: Unfreeze counters after handling an overflow interrupt Greg Kroah-Hartman
` (179 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Davidlohr Bueso, Dave Jiang, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit b899fd3487b0d4066d60ebcf5b73e77c9617de54 ]
The PMU pins its overflow interrupt to info->on_cpu in the hotplug
callbacks, but requests it with only IRQF_SHARED | IRQF_NO_THREAD. Without
IRQF_NOBALANCING, irqbalance or a userspace smp_affinity write can move it
elsewhere, and cxl_pmu_irq() then runs local64_cmpxchg() and local64_add()
on hwc->prev_count and event->count at the same time as the managing CPU.
local64_t is only atomic against same-CPU access, so the counts corrupt.
The flag alone does not fix that while the line is shared. __setup_irq()
only acts on it for the first action on a line, and a co-owner has no
reason to want our affinity - it would keep taking the interrupt wherever
its own points, running our handler on the wrong CPU.
Drop IRQF_SHARED and add IRQF_NOBALANCING. The spec only recommends a
distinct Interrupt Message Number per CPMU instance (CXL r4.0 8.2.7.1.1),
so a device may put several on one vector, or share with the mailbox or
event log. Such a device now loses a PMU rather than silently miscounting -
and only the PMU, since the preceding patch adds the CPMUs after the event
configuration.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index 09b9eca802525..f8195774213c4 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -779,7 +779,7 @@ static irqreturn_t cxl_pmu_irq(int irq, void *data)
overflowed = readq(base + CXL_PMU_OVERFLOW_REG);
- /* Interrupt may be shared, so maybe it isn't ours */
+ /* Nothing overflowed, so the device did not raise this */
if (!overflowed)
return IRQ_NONE;
@@ -882,7 +882,14 @@ static int cxl_pmu_probe(struct device *dev)
if (!irq_name)
return -ENOMEM;
- rc = devm_request_irq(dev, irq, cxl_pmu_irq, IRQF_SHARED | IRQF_NO_THREAD,
+ /*
+ * The handler must run on info->on_cpu, so the interrupt cannot be
+ * shared - IRQF_NOBALANCING is only honoured for the first action on a
+ * line, and a co-owner would keep taking the interrupt wherever its own
+ * affinity points.
+ */
+ rc = devm_request_irq(dev, irq, cxl_pmu_irq,
+ IRQF_NO_THREAD | IRQF_NOBALANCING,
irq_name, info);
if (rc)
return rc;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0820/1756] perf/cxl: Unfreeze counters after handling an overflow interrupt
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (818 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0819/1756] perf/cxl: Dont share the overflow interrupt, and keep it pinned Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0821/1756] perf/cxl: Validate the hardware-reported counter width Greg Kroah-Hartman
` (178 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Dave Jiang, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 2e4fe234c72d65a09bbfd421240a0cfd7c8046a2 ]
The counters run with Freeze on Overflow set, so one overflow freezes every
counter in the block (CXL r4.0 8.2.7.2.1), and a frozen counter "remains
frozen until explicitly unfrozen by software" (8.2.7.1.3, Table 8-183).
cxl_pmu_irq() reads the overflowed counters and clears the overflow status
but never unfreezes, so everything stays frozen until the next pmu_enable()
and events in that window are lost.
Unfreeze after clearing the status, unless the PMU has been disabled in the
meantime - cxl_pmu_disable() freezes the block deliberately. Track the
enabled state and leave it frozen in that case.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index f8195774213c4..e5ce595a965d4 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -107,6 +107,8 @@ struct cxl_pmu_info {
struct hlist_node node;
bool filter_hdm;
int irq;
+ /* Set between pmu_enable() and pmu_disable(), read by the IRQ handler */
+ bool enabled;
};
#define pmu_to_cxl_pmu_info(_pmu) container_of(_pmu, struct cxl_pmu_info, pmu)
@@ -592,6 +594,7 @@ static void cxl_pmu_enable(struct pmu *pmu)
void __iomem *base = info->base;
/* Can assume frozen at this stage */
+ WRITE_ONCE(info->enabled, true);
writeq(0, base + CXL_PMU_FREEZE_REG);
}
@@ -600,6 +603,7 @@ static void cxl_pmu_disable(struct pmu *pmu)
struct cxl_pmu_info *info = pmu_to_cxl_pmu_info(pmu);
void __iomem *base = info->base;
+ WRITE_ONCE(info->enabled, false);
/*
* Whilst bits above number of counters are RsvdZ
* they are unlikely to be repurposed given
@@ -798,6 +802,21 @@ static irqreturn_t cxl_pmu_irq(int irq, void *data)
writeq(overflowed, base + CXL_PMU_OVERFLOW_REG);
+ /*
+ * An overflow freezes every counter in the CPMU, so unfreeze once the
+ * overflowed ones have been read and their status cleared. Otherwise
+ * they stay frozen until the next pmu_enable() and events are lost.
+ *
+ * Not while the PMU is disabled, so as not to undo an intentional freeze.
+ * The check is advisory, not exclusive: pmu_disable() normally runs on
+ * info->on_cpu with interrupts off, where the pinned handler cannot
+ * preempt it. In the one window where it does not - the migration in
+ * cxl_pmu_offline_cpu() - the counters are legitimately running again,
+ * so unfreezing is correct there anyway.
+ */
+ if (READ_ONCE(info->enabled))
+ writeq(0, base + CXL_PMU_FREEZE_REG);
+
return IRQ_HANDLED;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0821/1756] perf/cxl: Validate the hardware-reported counter width
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (819 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0820/1756] perf/cxl: Unfreeze counters after handling an overflow interrupt Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0822/1756] perf/cxl: Dont log through pmu.dev in the overflow interrupt handler Greg Kroah-Hartman
` (177 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Dave Jiang, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 1c5499e67303a9393388197fb14b39ed06a3dc55 ]
cxl_pmu_parse_caps() takes the Counter Width straight from the CPMU
Capability register without a bounds check. The Counter Data register is 64
bits wide, so a device reporting 0 or more than 64 is reporting nonsense,
and GENMASK_ULL(width - 1, 0) in the read path then shifts out of range.
That is undefined behaviour, and a UBSAN splat where it is enabled.
Reject a counter width outside 1..64 at probe.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index e5ce595a965d4..aec8bacd212c8 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -141,6 +141,15 @@ static int cxl_pmu_parse_caps(struct device *dev, struct cxl_pmu_info *info)
info->num_counters = FIELD_GET(CXL_PMU_CAP_NUM_COUNTERS_MSK, val) + 1;
info->counter_width = FIELD_GET(CXL_PMU_CAP_COUNTER_WIDTH_MSK, val);
+ /*
+ * The Counter Data register is 64 bits wide, so a Counter Width of 0 or
+ * >64 is invalid. Reject it rather than let GENMASK_ULL(width - 1, 0) in
+ * the read path shift out of range.
+ */
+ if (info->counter_width == 0 || info->counter_width > 64) {
+ dev_err(dev, "Invalid counter width %d\n", info->counter_width);
+ return -ENODEV;
+ }
info->num_event_capabilities = FIELD_GET(CXL_PMU_CAP_NUM_EVN_CAP_REG_SUP_MSK, val) + 1;
info->filter_hdm = FIELD_GET(CXL_PMU_CAP_FILTERS_SUP_MSK, val) & CXL_PMU_FILTER_HDM;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0822/1756] perf/cxl: Dont log through pmu.dev in the overflow interrupt handler
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (820 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0821/1756] perf/cxl: Validate the hardware-reported counter width Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0823/1756] perf/cxl: Clear stale overflow status before using a counter Greg Kroah-Hartman
` (176 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Jonathan Cameron,
Dave Jiang, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 984920c893f0e6832351bc03deeb5ef9a42fbdbb ]
perf_pmu_unregister() frees pmu->dev without clearing the pointer, and
cxl_pmu_probe() orders its devm actions so that teardown runs it before
free_irq(). Nothing in between masks the interrupt, and
cxl_pmu_event_stop() leaves the overflow status bit set, so an overflow
taken just before teardown is still delivered and still reaches the
dev_dbg() in the !event branch - by which point info->pmu.dev is freed.
Log through info->pmu.parent instead, which is devm-managed and outlives
every teardown action.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260715191454.459673-1-dave@stgolabs.net?part=1
Assisted-by: Claude:claude-opus-4-8
Acked-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index aec8bacd212c8..6a8201b704072 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -801,7 +801,7 @@ static irqreturn_t cxl_pmu_irq(int irq, void *data)
struct perf_event *event = info->hw_events[i];
if (!event) {
- dev_dbg(info->pmu.dev,
+ dev_dbg(info->pmu.parent,
"overflow but on non enabled counter %d\n", i);
continue;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0823/1756] perf/cxl: Clear stale overflow status before using a counter
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (821 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0822/1756] perf/cxl: Dont log through pmu.dev in the overflow interrupt handler Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0824/1756] perf/dwc_pcie: Fix PCI device reference leak in probe Greg Kroah-Hartman
` (175 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Richard Cheng, Dave Jiang,
Jonathan Cameron, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 05d82cf377f706d0b566b572bc66e3a2057bd68e ]
cxl_pmu_event_stop() leaves the counter's bit set in the overflow status
register and only cxl_pmu_irq() ever clears it, so a counter handed from
one event to the next starts with the previous owner's overflow pending.
The perf core stops and starts back to back with interrupts off, so an
interrupt latched over the handover lands on the new event. prev_count is 0
by then, so the read path adds a full period: 2^counter_width phantom
counts.
Clear the bit in cxl_pmu_event_start(), before the config write arms
Interrupt on Overflow. Clear the whole register at probe too, for counters
no event ever owns - the driver never touched it, so firmware or a previous
kernel can leave a bit set there.
Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Reported-by: Richard Cheng <icheng@nvidia.com>
Closes: https://lore.kernel.org/linux-cxl/anAVpO--i5heVfz9@MWDK4CY14F/
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/cxl_pmu.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index 6a8201b704072..45a63f604c482 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -679,6 +679,15 @@ static void cxl_pmu_event_start(struct perf_event *event, int flags)
*/
cfg |= FIELD_PREP(CXL_PMU_COUNTER_CFG_THRESHOLD_MSK,
cxl_pmu_config1_get_threshold(event));
+
+ /*
+ * Drop any overflow the previous owner of this counter left pending;
+ * cxl_pmu_event_stop() does not. Otherwise an interrupt latched over
+ * the handover gets charged to this event. Do it before arming Interrupt
+ * on Overflow below, and note RW1C leaves the other counters alone.
+ */
+ writeq(BIT_ULL(hwc->idx), base + CXL_PMU_OVERFLOW_REG);
+
writeq(cfg, base + CXL_PMU_COUNTER_CFG_REG(hwc->idx));
local64_set(&hwc->prev_count, 0);
@@ -910,6 +919,14 @@ static int cxl_pmu_probe(struct device *dev)
if (!irq_name)
return -ENOMEM;
+ /*
+ * Same for counters no event owns yet: clear whatever firmware or a
+ * previous kernel left set before the handler goes live. Bits above the
+ * implemented counters are reserved, so only write those.
+ */
+ writeq(GENMASK_ULL(info->num_counters - 1, 0),
+ info->base + CXL_PMU_OVERFLOW_REG);
+
/*
* The handler must run on info->on_cpu, so the interrupt cannot be
* shared - IRQF_NOBALANCING is only honoured for the first action on a
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0824/1756] perf/dwc_pcie: Fix PCI device reference leak in probe
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (822 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0823/1756] perf/cxl: Clear stale overflow status before using a counter Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0825/1756] spi: fsl: switch to managed controller allocation Greg Kroah-Hartman
` (174 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Markus Elfring, Ruoyu Wang,
Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruoyu Wang <ruoyuw560@gmail.com>
[ Upstream commit 3a4067658363e34bf4e1d7039e5b52951fcb4012 ]
pci_get_domain_bus_and_slot() returns a referenced PCI device. When the
subsequent RAS DES capability lookup fails, dwc_pcie_pmu_probe() returns
-ENODEV without releasing that reference. Repeated failed probes can
therefore keep the PCI device allocated after removal.
Declare the looked-up device with __free(pci_dev_put), so the temporary
reference is released on every return path. Keeping the reference scoped
to the whole probe also covers all later uses of the device during
initialization.
This issue was found by a static analysis checker and confirmed by manual
source review.
Fixes: 7f35b429802a ("perf/dwc_pcie: fix duplicate pci_dev devices")
Suggested-by: Markus Elfring <Markus.Elfring@web.de>
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/dwc_pcie_pmu.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c
index bde0a0a06cff5..e334b09dddf00 100644
--- a/drivers/perf/dwc_pcie_pmu.c
+++ b/drivers/perf/dwc_pcie_pmu.c
@@ -613,16 +613,16 @@ static struct notifier_block dwc_pcie_pmu_nb = {
static int dwc_pcie_pmu_probe(struct platform_device *plat_dev)
{
- struct pci_dev *pdev;
+ u32 sbdf = plat_dev->id;
+ struct pci_dev *pdev __free(pci_dev_put) =
+ pci_get_domain_bus_and_slot(sbdf >> 16,
+ PCI_BUS_NUM(sbdf & 0xffff),
+ sbdf & 0xff);
struct dwc_pcie_pmu *pcie_pmu;
char *name;
- u32 sbdf;
u16 vsec;
int ret;
- sbdf = plat_dev->id;
- pdev = pci_get_domain_bus_and_slot(sbdf >> 16, PCI_BUS_NUM(sbdf & 0xffff),
- sbdf & 0xff);
if (!pdev) {
pr_err("No pdev found for the sbdf 0x%x\n", sbdf);
return -ENODEV;
@@ -632,7 +632,6 @@ static int dwc_pcie_pmu_probe(struct platform_device *plat_dev)
if (!vsec)
return -ENODEV;
- pci_dev_put(pdev);
name = devm_kasprintf(&plat_dev->dev, GFP_KERNEL, "dwc_rootport_%x", sbdf);
if (!name)
return -ENOMEM;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0825/1756] spi: fsl: switch to managed controller allocation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (823 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0824/1756] perf/dwc_pcie: Fix PCI device reference leak in probe Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0826/1756] spi: fsl: unmap immr_spi_cs on remove Greg Kroah-Hartman
` (173 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
[ Upstream commit 6afe041c2ce9068b2b6c64eddb5537911752050c ]
Switch to device managed controller allocation to simplify error
handling and to avoid having to take another reference during
deregistration.
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260429091333.165363-12-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: af1d882d421d ("spi: fsl: unmap immr_spi_cs on remove")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-fsl-spi.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 358c2a7e4cad3..94d81f6163bea 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -535,7 +535,7 @@ static struct spi_controller *fsl_spi_probe(struct device *dev,
u32 regval;
int ret = 0;
- host = spi_alloc_host(dev, sizeof(struct mpc8xxx_spi));
+ host = devm_spi_alloc_host(dev, sizeof(struct mpc8xxx_spi));
if (host == NULL) {
ret = -ENOMEM;
goto err;
@@ -559,7 +559,7 @@ static struct spi_controller *fsl_spi_probe(struct device *dev,
ret = fsl_spi_cpm_init(mpc8xxx_spi);
if (ret)
- goto err_cpm_init;
+ goto err;
mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem);
if (IS_ERR(mpc8xxx_spi->reg_base)) {
@@ -625,8 +625,6 @@ static struct spi_controller *fsl_spi_probe(struct device *dev,
err_probe:
fsl_spi_cpm_free(mpc8xxx_spi);
-err_cpm_init:
- spi_controller_put(host);
err:
return ERR_PTR(ret);
}
@@ -705,13 +703,9 @@ static void of_fsl_spi_remove(struct platform_device *ofdev)
struct spi_controller *host = platform_get_drvdata(ofdev);
struct mpc8xxx_spi *mpc8xxx_spi = spi_controller_get_devdata(host);
- spi_controller_get(host);
-
spi_unregister_controller(host);
fsl_spi_cpm_free(mpc8xxx_spi);
-
- spi_controller_put(host);
}
static struct platform_driver of_fsl_spi_driver = {
@@ -757,13 +751,9 @@ static void plat_mpc8xxx_spi_remove(struct platform_device *pdev)
struct spi_controller *host = platform_get_drvdata(pdev);
struct mpc8xxx_spi *mpc8xxx_spi = spi_controller_get_devdata(host);
- spi_controller_get(host);
-
spi_unregister_controller(host);
fsl_spi_cpm_free(mpc8xxx_spi);
-
- spi_controller_put(host);
}
MODULE_ALIAS("platform:mpc8xxx_spi");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0826/1756] spi: fsl: unmap immr_spi_cs on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (824 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0825/1756] spi: fsl: switch to managed controller allocation Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0827/1756] spi: bcm63xx-hsspi: Disable runtime PM " Greg Kroah-Hartman
` (172 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit af1d882d421de504a1e5fac92eb06947b6cbdd8f ]
of_fsl_spi_remove() does not unmap pinfo->immr_spi_cs after a
successful probe when CONFIG_FSL_SOC is enabled and fsl,spisel_boot
causes of_fsl_spi_probe() to map it with ioremap(). The probe error
path already performs the matching iounmap().
Retrieve pinfo from the platform data and call iounmap() when
pinfo->immr_spi_cs is present, pairing normal removal with the mapping
established by of_fsl_spi_probe().
Fixes: 0f0581b24bd0 ("spi: fsl: Convert to use CS GPIO descriptors")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260924112329.1566051-2-lgs201920130244@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-fsl-spi.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 94d81f6163bea..42dc40242b9b4 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -702,10 +702,18 @@ static void of_fsl_spi_remove(struct platform_device *ofdev)
{
struct spi_controller *host = platform_get_drvdata(ofdev);
struct mpc8xxx_spi *mpc8xxx_spi = spi_controller_get_devdata(host);
+#if IS_ENABLED(CONFIG_FSL_SOC)
+ struct fsl_spi_platform_data *pdata = dev_get_platdata(&ofdev->dev);
+ struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
+#endif
spi_unregister_controller(host);
fsl_spi_cpm_free(mpc8xxx_spi);
+#if IS_ENABLED(CONFIG_FSL_SOC)
+ if (pinfo->immr_spi_cs)
+ iounmap(pinfo->immr_spi_cs);
+#endif
}
static struct platform_driver of_fsl_spi_driver = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0827/1756] spi: bcm63xx-hsspi: Disable runtime PM on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (825 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0826/1756] spi: fsl: unmap immr_spi_cs on remove Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0828/1756] selftests/alsa: Do not take another controls event as our own Greg Kroah-Hartman
` (171 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 38232bd3cea74845c2064eb9f7eac77fa5a21d85 ]
bcm63xx_hsspi_probe() enables runtime PM before creating the sysfs
group, but bcm63xx_hsspi_remove() does not perform the matching
pm_runtime_disable() after a successful probe.
The probe error paths already disable runtime PM when sysfs group
creation or controller registration fails.
Add pm_runtime_disable() to the remove path after removing the sysfs
group to balance pm_runtime_enable() from bcm63xx_hsspi_probe().
Fixes: fb8695e3749e ("spi: bcm63xx-hsspi: fix pm_runtime")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260924112329.1566051-4-lgs201920130244@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-bcm63xx-hsspi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index 87ec22627c6d6..3cb643340b3d0 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -888,6 +888,7 @@ static void bcm63xx_hsspi_remove(struct platform_device *pdev)
clk_disable_unprepare(bs->pll_clk);
clk_disable_unprepare(bs->clk);
sysfs_remove_group(&pdev->dev.kobj, &bcm63xx_hsspi_group);
+ pm_runtime_disable(&pdev->dev);
}
#ifdef CONFIG_PM_SLEEP
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0828/1756] selftests/alsa: Do not take another controls event as our own
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (826 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0827/1756] spi: bcm63xx-hsspi: Disable runtime PM " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0829/1756] power: supply: ab8500_btemp: Fix event temperature reporting Greg Kroah-Hartman
` (170 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Takashi Iwai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit c9b0768669976a1beb0a1537b4257bd6b76dfbac ]
The wait_for_event() skips an event for a different control with a
continue inside its do-while loop. But continue goes straight to the
loop condition, and that tests the mask of the event just skipped. So
a value event for another control ends the wait as if it were ours.
A driver that notifies a second control from its put() queues that
event first. The core only sends ours once put() returns. So the wait
returns early and leaves ours in the queue. The next test then
reports it as spurious. And event_missing passes for a control whose
put() said nothing changed, as long as it notified a neighbour.
To fix this, clear the mask before skipping the event.
Fixes: b1446bda5645 ("kselftest: alsa: Check for event generation when we write to controls")
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260930111534.3782264-2-sammiee5311@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/alsa/mixer-test.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/alsa/mixer-test.c b/tools/testing/selftests/alsa/mixer-test.c
index a3793ef939321..423494c2f92e2 100644
--- a/tools/testing/selftests/alsa/mixer-test.c
+++ b/tools/testing/selftests/alsa/mixer-test.c
@@ -261,6 +261,8 @@ static int wait_for_event(struct ctl_data *ctl, int timeout)
if (ev_id != snd_ctl_elem_info_get_numid(ctl->info)) {
ksft_print_msg("Event for unexpected ctl %s\n",
snd_ctl_event_elem_get_name(event));
+ /* The loop condition must not see the other control's mask */
+ mask = 0;
continue;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0829/1756] power: supply: ab8500_btemp: Fix event temperature reporting
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (827 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0828/1756] selftests/alsa: Do not take another controls event as our own Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0830/1756] power: supply: ab8500: Preserve battery termination current Greg Kroah-Hartman
` (169 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 95990cda8e42dda4bd3f1475d578323981bd8579 ]
The event-aware path initializes its local temperature to zero and
compares that zero against the thermal thresholds. Consequently some
events report the measured temperature after it crosses the event
threshold, while others always report the threshold.
Start with the measured temperature, clamp it according to the active
event, and convert to tenths of a degree only once. This path is used
by AB8505 and later variants.
Fixes: 1f855824757e ("ab8500-btemp: AB8500 battery temperature driver")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-5-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_btemp.c | 28 +++++++++-------------------
1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
index 56f136b2d071d..082bd09cbedfd 100644
--- a/drivers/power/supply/ab8500_btemp.c
+++ b/drivers/power/supply/ab8500_btemp.c
@@ -468,39 +468,29 @@ static void ab8500_btemp_periodic(struct ab8500_btemp *di,
*/
static int ab8500_btemp_get_temp(struct ab8500_btemp *di)
{
- int temp = 0;
+ int temp = di->bat_temp;
/*
* The BTEMP events are not reliabe on AB8500 cut3.3
* and prior versions
*/
- if (is_ab8500_3p3_or_earlier(di->parent)) {
- temp = di->bat_temp * 10;
- } else {
+ if (!is_ab8500_3p3_or_earlier(di->parent)) {
if (di->events.btemp_low) {
if (temp > di->btemp_ranges.btemp_low_limit)
- temp = di->btemp_ranges.btemp_low_limit * 10;
- else
- temp = di->bat_temp * 10;
+ temp = di->btemp_ranges.btemp_low_limit;
} else if (di->events.btemp_high) {
if (temp < di->btemp_ranges.btemp_high_limit)
- temp = di->btemp_ranges.btemp_high_limit * 10;
- else
- temp = di->bat_temp * 10;
+ temp = di->btemp_ranges.btemp_high_limit;
} else if (di->events.btemp_lowmed) {
if (temp > di->btemp_ranges.btemp_med_limit)
- temp = di->btemp_ranges.btemp_med_limit * 10;
- else
- temp = di->bat_temp * 10;
+ temp = di->btemp_ranges.btemp_med_limit;
} else if (di->events.btemp_medhigh) {
if (temp < di->btemp_ranges.btemp_med_limit)
- temp = di->btemp_ranges.btemp_med_limit * 10;
- else
- temp = di->bat_temp * 10;
- } else
- temp = di->bat_temp * 10;
+ temp = di->btemp_ranges.btemp_med_limit;
+ }
}
- return temp;
+
+ return temp * 10;
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0830/1756] power: supply: ab8500: Preserve battery termination current
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (828 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0829/1756] power: supply: ab8500_btemp: Fix event temperature reporting Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0831/1756] power: supply: ab8500_charger: Fix AC charger re-enable Greg Kroah-Hartman
` (168 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 3b33eda4067494658d51db0792377fef98787e3f ]
The battery-info parser uses a negative value for an unspecified
termination current. Testing the value as a boolean instead replaces
every valid positive current from the battery description with 200 mA.
Apply the default only when the property is unspecified so batteries
retain their described charging termination current.
Fixes: 9c20899da46b ("power: supply: ab8500: Standardize termination current")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-6-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_bmdata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/ab8500_bmdata.c b/drivers/power/supply/ab8500_bmdata.c
index 3e6ea22372b2d..0a6ea935fdc0f 100644
--- a/drivers/power/supply/ab8500_bmdata.c
+++ b/drivers/power/supply/ab8500_bmdata.c
@@ -174,7 +174,7 @@ int ab8500_bm_of_probe(struct power_supply *psy,
if (bi->constant_charge_voltage_max_uv < 0)
bi->constant_charge_voltage_max_uv = 4100000;
- if (bi->charge_term_current_ua)
+ if (bi->charge_term_current_ua < 0)
/* Charging stops when we drop below this current */
bi->charge_term_current_ua = 200000;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0831/1756] power: supply: ab8500_charger: Fix AC charger re-enable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (829 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0830/1756] power: supply: ab8500: Preserve battery termination current Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0832/1756] power: supply: ab8500_charger: Decode AB8505 USB status Greg Kroah-Hartman
` (167 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 3e1d2517347f6bb72f74e63ec77d1634385fbf21 ]
The AC check-enable callback passes the embedded USB charger object to
ab8500_charger_ac_en(). That helper derives the parent with the AC
charger offset, so the wrong object yields an invalid ab8500_charger
pointer.
Pass the AC charger object when re-enabling AC charging.
Fixes: bc6e02871402 ("power: supply: ab8500: Standardize CV voltage")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-7-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_charger.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 5da3b12d9f0bb..b3b1fd7f82f2b 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -1778,7 +1778,7 @@ static int ab8500_charger_usb_check_enable(struct ux500_charger *charger,
}
/**
- * ab8500_charger_ac_check_enable() - enable usb charging
+ * ab8500_charger_ac_check_enable() - enable AC charging
* @charger: pointer to the ux500_charger structure
* @vset_uv: charging voltage in microvolt
* @iset_ua: charger output current in micrompere
@@ -1817,7 +1817,7 @@ static int ab8500_charger_ac_check_enable(struct ux500_charger *charger,
return ret;
}
- ret = ab8500_charger_ac_en(&di->usb_chg, true, vset_uv, iset_ua);
+ ret = ab8500_charger_ac_en(&di->ac_chg, true, vset_uv, iset_ua);
if (ret < 0) {
dev_err(di->dev, "failed to enable AC charger %d\n",
__LINE__);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0832/1756] power: supply: ab8500_charger: Decode AB8505 USB status
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (830 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0831/1756] power: supply: ab8500_charger: Fix AC charger re-enable Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0833/1756] power: supply: ab8500_charger: Respect AB8505 register layout Greg Kroah-Hartman
` (166 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 2b697df2b6394613a3bb168adfa8a845ad7c83d9 ]
AB8505 keeps USB link status in the same bit position as AB8500 but
defines a different five-bit value table. Reusing the AB8500 enum
treats several reserved AB8505 values as chargers and misidentifies
the AB8505 charger-fault and DM-high states.
Add an AB8505 decoder, reject reserved and non-charging states, and
retain conservative current limits for supported charger types.
Restrict the invalid-link workaround to AB8500 and stop processing
when the status register cannot be read.
Fixes: d4337660d069 ("ab8500-charger: Add AB8505_USB_LINK_STATUS")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-8-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_charger.c | 170 +++++++++++++++++++++-----
1 file changed, 142 insertions(+), 28 deletions(-)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index b3b1fd7f82f2b..8715f54f0a3ca 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -136,6 +136,33 @@ enum ab8500_charger_link_status {
USB_STAT_ACA_DOCK_CHARGER,
};
+/* UsbLink1Status register values used by AB8505 */
+enum ab8505_charger_link_status {
+ AB8505_USB_STAT_OFF,
+ AB8505_USB_STAT_SDP_NOT_CHARGING,
+ AB8505_USB_STAT_SDP_CHARGING,
+ AB8505_USB_STAT_SDP_SUSPENDED,
+ AB8505_USB_STAT_CDP,
+ AB8505_USB_STAT_RESERVED_5,
+ AB8505_USB_STAT_RESERVED_6,
+ AB8505_USB_STAT_DCP,
+ AB8505_USB_STAT_ACA_RID_A,
+ AB8505_USB_STAT_ACA_RID_B,
+ AB8505_USB_STAT_ACA_RID_C,
+ AB8505_USB_STAT_RESERVED_11,
+ AB8505_USB_STAT_RESERVED_12,
+ AB8505_USB_STAT_UPSTREAM_IDGND,
+ AB8505_USB_STAT_CHARGER_NOT_OK,
+ AB8505_USB_STAT_CHARGER_DM_HIGH,
+ AB8505_USB_STAT_PHY_ENABLED,
+ AB8505_USB_STAT_UPSTREAM_NO_IDGND,
+ AB8505_USB_STAT_UPSTREAM_IDGND_VBUS,
+ AB8505_USB_STAT_CHARGER_SE1,
+ AB8505_USB_STAT_CARKIT_1,
+ AB8505_USB_STAT_CARKIT_2,
+ AB8505_USB_STAT_ACA_DOCK_CHARGER,
+};
+
enum ab8500_usb_state {
AB8500_BM_USB_STATE_RESET_HS, /* HighSpeed Reset */
AB8500_BM_USB_STATE_RESET_FS, /* FullSpeed/LowSpeed Reset */
@@ -699,20 +726,102 @@ static int ab8500_charger_detect_chargers(struct ab8500_charger *di, bool probe)
}
/**
- * ab8500_charger_max_usb_curr() - get the max curr for the USB type
+ * ab8505_charger_max_usb_curr() - get the max current for the USB type
* @di: pointer to the ab8500_charger structure
* @link_status: the identified USB type
*
- * Get the maximum current that is allowed to be drawn from the host
- * based on the USB type.
+ * Decode AB8505-specific UsbLink1Status values and get the maximum current
+ * that is allowed to be drawn based on the USB type.
* Returns error code in case of failure else 0 on success
*/
+static int ab8505_charger_max_usb_curr(struct ab8500_charger *di,
+ u8 link_status)
+{
+ int ret = 0;
+
+ di->is_aca_rid = 0;
+
+ switch (link_status) {
+ case AB8505_USB_STAT_SDP_NOT_CHARGING:
+ case AB8505_USB_STAT_SDP_CHARGING:
+ case AB8505_USB_STAT_SDP_SUSPENDED:
+ case AB8505_USB_STAT_CDP:
+ case AB8505_USB_STAT_CHARGER_DM_HIGH:
+ case AB8505_USB_STAT_UPSTREAM_NO_IDGND:
+ case AB8505_USB_STAT_UPSTREAM_IDGND_VBUS:
+ case AB8505_USB_STAT_CHARGER_SE1:
+ case AB8505_USB_STAT_CARKIT_1:
+ case AB8505_USB_STAT_CARKIT_2:
+ case AB8505_USB_STAT_ACA_DOCK_CHARGER:
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_0P5;
+ break;
+ case AB8505_USB_STAT_DCP:
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_1P5;
+ break;
+ case AB8505_USB_STAT_ACA_RID_A:
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_0P5;
+ di->is_aca_rid = 1;
+ break;
+ case AB8505_USB_STAT_ACA_RID_B:
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_1P3;
+ di->is_aca_rid = 1;
+ break;
+ case AB8505_USB_STAT_ACA_RID_C:
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_1P5;
+ di->is_aca_rid = 1;
+ break;
+ case AB8505_USB_STAT_OFF:
+ if (di->vbus_detected) {
+ di->usb_device_is_unrecognised = true;
+ di->max_usb_in_curr.usb_type_max_ua =
+ USB_CH_IP_CUR_LVL_1P5;
+ break;
+ }
+ fallthrough;
+ case AB8505_USB_STAT_UPSTREAM_IDGND:
+ case AB8505_USB_STAT_PHY_ENABLED:
+ dev_err(di->dev, "USB Type - Charging not allowed\n");
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_0P05;
+ ret = -ENXIO;
+ break;
+ case AB8505_USB_STAT_CHARGER_NOT_OK:
+ di->flags.vbus_collapse = true;
+ dev_err(di->dev, "USB Type - VBUS has collapsed\n");
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_0P05;
+ ret = -ENXIO;
+ break;
+ case AB8505_USB_STAT_RESERVED_5:
+ case AB8505_USB_STAT_RESERVED_6:
+ case AB8505_USB_STAT_RESERVED_11:
+ case AB8505_USB_STAT_RESERVED_12:
+ default:
+ dev_err(di->dev, "USB Type - Unknown\n");
+ di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_0P05;
+ ret = -ENXIO;
+ break;
+ }
+
+ return ret;
+}
+
+/**
+ * ab8500_charger_max_usb_curr() - get the max current for the USB type
+ * @di: pointer to the ab8500_charger structure
+ * @link_status: the identified USB type
+ *
+ * Get the maximum current that is allowed to be drawn based on the USB type.
+ * Returns error code in case of failure else 0 on success.
+ */
static int ab8500_charger_max_usb_curr(struct ab8500_charger *di,
- enum ab8500_charger_link_status link_status)
+ u8 link_status)
{
int ret = 0;
di->usb_device_is_unrecognised = false;
+ if (is_ab8505(di->parent)) {
+ ret = ab8505_charger_max_usb_curr(di, link_status);
+ goto out;
+ }
/*
* Platform only supports USB 2.0.
@@ -721,7 +830,7 @@ static int ab8500_charger_max_usb_curr(struct ab8500_charger *di,
* should set USB_CH_IP_CUR_LVL_0P5.
*/
- switch (link_status) {
+ switch ((enum ab8500_charger_link_status)link_status) {
case USB_STAT_STD_HOST_NC:
case USB_STAT_STD_HOST_C_NS:
case USB_STAT_STD_HOST_C_S:
@@ -825,6 +934,7 @@ static int ab8500_charger_max_usb_curr(struct ab8500_charger *di,
break;
}
+out:
di->max_usb_in_curr.set_max_ua = di->max_usb_in_curr.usb_type_max_ua;
dev_dbg(di->dev, "USB Type - 0x%02x MaxCurr: %d",
link_status, di->max_usb_in_curr.set_max_ua);
@@ -866,8 +976,7 @@ static int ab8500_charger_read_usb_type(struct ab8500_charger *di)
val = (val & AB8500_USB_LINK_STATUS) >> USB_LINK_STATUS_SHIFT;
else
val = (val & AB8505_USB_LINK_STATUS) >> USB_LINK_STATUS_SHIFT;
- ret = ab8500_charger_max_usb_curr(di,
- (enum ab8500_charger_link_status) val);
+ ret = ab8500_charger_max_usb_curr(di, val);
return ret;
}
@@ -929,8 +1038,7 @@ static int ab8500_charger_detect_usb_type(struct ab8500_charger *di)
if (val)
break;
}
- ret = ab8500_charger_max_usb_curr(di,
- (enum ab8500_charger_link_status) val);
+ ret = ab8500_charger_max_usb_curr(di, val);
return ret;
}
@@ -2278,6 +2386,7 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
int ret;
u8 val;
u8 link_status;
+ u8 link_status_mask;
struct ab8500_charger *di = container_of(work,
struct ab8500_charger, usb_link_status_work);
@@ -2304,20 +2413,22 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
ret = abx500_get_register_interruptible(di->dev, AB8500_USB,
AB8500_USB_LINK1_STAT_REG, &val);
- if (ret >= 0)
- dev_dbg(di->dev, "UsbLineStatus register = 0x%02x\n", val);
- else
- dev_dbg(di->dev, "Error reading USB link status\n");
+ if (ret < 0) {
+ dev_err(di->dev, "Error reading USB link status\n");
+ return;
+ }
+ dev_dbg(di->dev, "UsbLineStatus register = 0x%02x\n", val);
if (is_ab8500(di->parent))
- link_status = AB8500_USB_LINK_STATUS;
+ link_status_mask = AB8500_USB_LINK_STATUS;
else
- link_status = AB8505_USB_LINK_STATUS;
+ link_status_mask = AB8505_USB_LINK_STATUS;
+ link_status = (val & link_status_mask) >> USB_LINK_STATUS_SHIFT;
if (detected_chargers & USB_PW_CONN) {
- if (((val & link_status) >> USB_LINK_STATUS_SHIFT) ==
- USB_STAT_NOT_VALID_LINK &&
- di->invalid_charger_detect_state == 0) {
+ if (is_ab8500(di->parent) &&
+ link_status == USB_STAT_NOT_VALID_LINK &&
+ di->invalid_charger_detect_state == 0) {
dev_dbg(di->dev,
"Invalid charger detected, state= 0\n");
/*Enable charger*/
@@ -2340,18 +2451,21 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
abx500_mask_and_set_register_interruptible(di->dev,
AB8500_USB, AB8500_USB_LINE_CTRL2_REG,
USB_CH_DET, 0x00);
- /*Check link status*/
- if (is_ab8500(di->parent))
- ret = abx500_get_register_interruptible(di->dev,
- AB8500_USB, AB8500_USB_LINE_STAT_REG,
- &val);
- else
- ret = abx500_get_register_interruptible(di->dev,
- AB8500_USB, AB8500_USB_LINK1_STAT_REG,
- &val);
+ /* Check link status */
+ ret = abx500_get_register_interruptible(di->dev,
+ AB8500_USB,
+ AB8500_USB_LINE_STAT_REG,
+ &val);
+ if (ret < 0) {
+ dev_err(di->dev,
+ "Error reading USB link status\n");
+ return;
+ }
+ link_status = (val & link_status_mask) >>
+ USB_LINK_STATUS_SHIFT;
dev_dbg(di->dev, "USB link status= 0x%02x\n",
- (val & link_status) >> USB_LINK_STATUS_SHIFT);
+ link_status);
di->invalid_charger_detect_state = 2;
}
} else {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0833/1756] power: supply: ab8500_charger: Respect AB8505 register layout
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (831 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0832/1756] power: supply: ab8500_charger: Decode AB8505 USB status Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0834/1756] power: supply: ab8500_charger: Handle detection errors Greg Kroah-Hartman
` (165 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit dcecf527632297011153f088573689a1ad1de790 ]
Several AB8505 charger fields differ from AB8500. Its long VBUS
falling debounce is 300 ms rather than 100 ms, and its VBUS
overvoltage selector has a different encoding programmed through OTP.
Writing the AB8500 6.3 V value selects 9 V on AB8505.
AB8505 revision 3 also defines SwControlFallback as reserved,
correcting older documentation which led the driver to support
autopower there. Preserve the AB8505 overvoltage setting, wait for its
documented debounce, and reject the unsupported autopower setting.
Fixes: 0ed5107fa860 ("ab8500-charger: Do not touch VBUSOVV bits")
Fixes: b016322293c7 ("ab8500-charger: Add support for autopower on AB8505 and AB9540")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-9-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_charger.c | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 8715f54f0a3ca..9c81f79502870 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -52,7 +52,7 @@
#define MAIN_CH_DET 0x01
#define MAIN_CH_CV_ON 0x04
#define USB_CH_CV_ON 0x08
-#define VBUS_DET_DBNC100 0x02
+#define VBUS_DET_DBNC_LONG 0x02
#define VBUS_DET_DBNC1 0x01
#define OTP_ENABLE_WD 0x01
#define DROP_COUNT_RESET 0x01
@@ -383,6 +383,10 @@ static void ab8500_enable_disable_sw_fallback(struct ab8500_charger *di,
u8 bit;
int ret;
+ /* SwControlFallback is reserved and must remain clear on AB8505. */
+ if (is_ab8505(di->parent))
+ return;
+
dev_dbg(di->dev, "SW Fallback: %d\n", fallback);
if (is_ab8500(di->parent)) {
@@ -703,12 +707,16 @@ static int ab8500_charger_detect_chargers(struct ab8500_charger *di, bool probe)
if (!probe) {
/*
- * AB8500 says VBUS_DET_DBNC1 & VBUS_DET_DBNC100
+ * AB8500 says VBUS_DET_DBNC1 & VBUS_DET_DBNC_LONG
* when disconnecting ACA even though no
* charger was connected. Try waiting a little
- * longer than the 100 ms of VBUS_DET_DBNC100...
+ * longer than its 100 ms debounce. AB8505 uses
+ * a 300 ms falling debounce for the same bit.
*/
- msleep(110);
+ if (is_ab8505(di->parent))
+ msleep(310);
+ else
+ msleep(110);
}
ret = abx500_get_register_interruptible(di->dev, AB8500_CHARGER,
AB8500_CH_USBCH_STAT1_REG, &val);
@@ -719,7 +727,7 @@ static int ab8500_charger_detect_chargers(struct ab8500_charger *di, bool probe)
dev_dbg(di->dev,
"%s AB8500_CH_USBCH_STAT1_REG %x\n", __func__,
val);
- if ((val & VBUS_DET_DBNC1) && (val & VBUS_DET_DBNC100))
+ if ((val & VBUS_DET_DBNC1) && (val & VBUS_DET_DBNC_LONG))
result |= USB_PW_CONN;
return result;
@@ -3186,7 +3194,7 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
}
}
- if (is_ab8505_2p0(di->parent))
+ if (is_ab8505(di->parent))
ret = abx500_mask_and_set_register_interruptible(di->dev,
AB8500_CHARGER,
AB8500_USBCH_CTRL2_REG,
@@ -3535,11 +3543,14 @@ static int ab8500_charger_probe(struct platform_device *pdev)
di->bm = &ab8500_bm_data;
- di->autopower_cfg = of_property_read_bool(np, "autopower_cfg");
-
/* get parent data */
di->dev = dev;
di->parent = dev_get_drvdata(pdev->dev.parent);
+ di->autopower_cfg = of_property_read_bool(np, "autopower_cfg");
+ if (di->autopower_cfg && is_ab8505(di->parent)) {
+ dev_warn(dev, "autopower is not supported on AB8505\n");
+ di->autopower_cfg = false;
+ }
/* Get ADC channels */
if (!is_ab8505(di->parent)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0834/1756] power: supply: ab8500_charger: Handle detection errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (832 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0833/1756] power: supply: ab8500_charger: Respect AB8505 register layout Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0835/1756] power: supply: ab8500_charger: Skip absent AB8505 main charger Greg Kroah-Hartman
` (164 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 1098c619ce7595a77a8c2e366a703e9fc5f29bf7 ]
ab8500_charger_detect_chargers() returns either a charger bitmask or
a negative register-access error. The probe and component-bind paths
use a negative return value as a bitmask, making failed reads appear
as both AC and USB connections.
Propagate detection errors and release the bind-time workqueue on
failure.
Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver")
Fixes: 1c1f13a006ed ("power: supply: ab8500: Move to componentized binding")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-10-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_charger.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 9c81f79502870..f530682bfd1e8 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -3463,6 +3463,10 @@ static int ab8500_charger_bind(struct device *dev)
}
ch_stat = ab8500_charger_detect_chargers(di, false);
+ if (ch_stat < 0) {
+ destroy_workqueue(di->charger_wq);
+ return ch_stat;
+ }
if (ch_stat & AC_PW_CONN) {
if (is_ab8500(di->parent))
@@ -3751,6 +3755,10 @@ static int ab8500_charger_probe(struct platform_device *pdev)
/* Identify the connected charger types during startup */
charger_status = ab8500_charger_detect_chargers(di, true);
+ if (charger_status < 0) {
+ ret = charger_status;
+ goto remove_ab8500_bm;
+ }
if (charger_status & AC_PW_CONN) {
di->ac.charger_connected = 1;
di->ac_conn = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0835/1756] power: supply: ab8500_charger: Skip absent AB8505 main charger
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (833 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0834/1756] power: supply: ab8500_charger: Handle detection errors Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0836/1756] power: supply: ab8500_charger: Retry AB8505 USB detection Greg Kroah-Hartman
` (163 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 52c8cdcc1146d86fae524a589d4512c8d59ea8b4 ]
AB8505 contains only the USB charger. It has no integrated main
charger, main-charger status register, or main-charger interrupts.
Avoid reading the missing status register, requesting the five missing
interrupts, or disabling an AC charger which was never enabled. This
lets the driver bind using only the AB8505 USB charger resources.
Fixes: d4337660d069 ("ab8500-charger: Add AB8505_USB_LINK_STATUS")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-11-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_charger.c | 32 ++++++++++++++++++---------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index f530682bfd1e8..d384004dd42a8 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -692,16 +692,19 @@ static int ab8500_charger_detect_chargers(struct ab8500_charger *di, bool probe)
int ret;
u8 val;
- /* Check for AC charger */
- ret = abx500_get_register_interruptible(di->dev, AB8500_CHARGER,
- AB8500_CH_STATUS1_REG, &val);
- if (ret < 0) {
- dev_err(di->dev, "%s ab8500 read failed\n", __func__);
- return ret;
- }
+ /* AB8505 has no integrated main charger. */
+ if (!is_ab8505(di->parent)) {
+ ret = abx500_get_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_CH_STATUS1_REG, &val);
+ if (ret < 0) {
+ dev_err(di->dev, "%s ab8500 read failed\n", __func__);
+ return ret;
+ }
- if (val & MAIN_CH_DET)
- result = AC_PW_CONN;
+ if (val & MAIN_CH_DET)
+ result = AC_PW_CONN;
+ }
/* Check for USB charger */
@@ -3501,7 +3504,8 @@ static void ab8500_charger_unbind(struct device *dev)
int ret;
/* Disable AC charging */
- ab8500_charger_ac_en(&di->ac_chg, false, 0, 0);
+ if (di->ac_chg.enabled)
+ ab8500_charger_ac_en(&di->ac_chg, false, 0, 0);
/* Disable USB charging */
ab8500_charger_usb_en(&di->usb_chg, false, 0, 0);
@@ -3725,7 +3729,13 @@ static int ab8500_charger_probe(struct platform_device *pdev)
}
/* Request interrupts */
- for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
+ /* The first five interrupts belong to the AB8500 main charger. */
+ if (is_ab8505(di->parent))
+ i = 5;
+ else
+ i = 0;
+
+ for (; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
if (irq < 0)
return irq;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0836/1756] power: supply: ab8500_charger: Retry AB8505 USB detection
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (834 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0835/1756] power: supply: ab8500_charger: Skip absent AB8505 main charger Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0837/1756] power: supply: ab8500_charger: Recover inactive AB8505 charger Greg Kroah-Hartman
` (162 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 95fba2e3055df99ed19e7d6399101bac42b3e7d5 ]
AB8505 reports UsbLink1Status state 14 when the USB charger port is
not OK. The manual says that software can return the port detector to
the detection state by setting the self-clearing
ChargerCtrl.DropCountReset bit.
The Samsung-GT-S7710-Skomer, Samsung-SGH-I407-Kyle, and
Samsung-SGH-T599-Codina-TMO product trees are reference points for a
workaround that cycles the USB charger and retries detection three times
before rejecting VBUS. Only the Kyle tree writes 1 to DropCountReset;
the other two write 0 and therefore do not request the documented reset.
Add the same bounded recovery for AB8505, preserving the configured USB
charger control bits across each cycle. Keep the charger connected while
recovering, then report the fault and disconnect it if all three attempts
fail. Leave AB8500 behavior unchanged.
Fixes: d4337660d069 ("ab8500-charger: Add AB8505_USB_LINK_STATUS")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-12-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_charger.c | 114 ++++++++++++++++++++++++--
1 file changed, 109 insertions(+), 5 deletions(-)
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index d384004dd42a8..c162979da7799 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -99,6 +99,8 @@
#define CHARGER_STATUS_POLL 10 /* in ms */
+#define AB8505_USB_CHARGER_NOT_OK_RETRIES 3
+
#define CHG_WD_INTERVAL (60 * HZ)
#define AB8500_SW_CONTROL_FALLBACK 0x03
@@ -261,6 +263,8 @@ struct ab8500_charger_max_usb_in_curr {
* @is_aca_rid: Incicate if accessory is ACA type
* @current_stepping_sessions:
* Counter for current stepping sessions
+ * @usb_charger_not_ok_retries:
+ * Number of AB8505 USB charger recovery attempts
* @parent: Pointer to the struct ab8500
* @adc_main_charger_v ADC channel for main charger voltage
* @adc_main_charger_c ADC channel for main charger current
@@ -314,6 +318,7 @@ struct ab8500_charger {
int invalid_charger_detect_state;
int is_aca_rid;
atomic_t current_stepping_sessions;
+ unsigned int usb_charger_not_ok_retries;
struct ab8500 *parent;
struct iio_channel *adc_main_charger_v;
struct iio_channel *adc_main_charger_c;
@@ -473,6 +478,9 @@ static void ab8500_power_supply_changed(struct ab8500_charger *di,
static void ab8500_charger_set_usb_connected(struct ab8500_charger *di,
bool connected)
{
+ if (!connected && !di->vbus_detected)
+ di->usb_charger_not_ok_retries = 0;
+
if (connected != di->usb.charger_connected) {
dev_dbg(di->dev, "USB connected:%i\n", connected);
di->usb.charger_connected = connected;
@@ -796,10 +804,19 @@ static int ab8505_charger_max_usb_curr(struct ab8500_charger *di,
ret = -ENXIO;
break;
case AB8505_USB_STAT_CHARGER_NOT_OK:
- di->flags.vbus_collapse = true;
- dev_err(di->dev, "USB Type - VBUS has collapsed\n");
di->max_usb_in_curr.usb_type_max_ua = USB_CH_IP_CUR_LVL_0P05;
- ret = -ENXIO;
+ if (di->usb_charger_not_ok_retries <
+ AB8505_USB_CHARGER_NOT_OK_RETRIES) {
+ dev_warn(di->dev,
+ "USB Type - VBUS has collapsed, retrying\n");
+ queue_delayed_work(di->charger_wq,
+ &di->check_usbchgnotok_work, 0);
+ ret = -EAGAIN;
+ } else {
+ dev_err(di->dev,
+ "USB Type - VBUS recovery failed\n");
+ ret = -ENXIO;
+ }
break;
case AB8505_USB_STAT_RESERVED_5:
case AB8505_USB_STAT_RESERVED_6:
@@ -2588,6 +2605,48 @@ static void ab8500_charger_usb_state_changed_work(struct work_struct *work)
}
}
+static int ab8505_charger_retry_usb_detection(struct ab8500_charger *di)
+{
+ u8 usbch_ctrl1;
+ bool usb_enabled;
+ int restore_ret;
+ int ret;
+
+ ret = abx500_get_register_interruptible(di->dev, AB8500_CHARGER,
+ AB8500_USBCH_CTRL1_REG,
+ &usbch_ctrl1);
+ if (ret < 0)
+ return ret;
+
+ usb_enabled = usbch_ctrl1 & USB_CH_ENA;
+ if (usb_enabled) {
+ ret = abx500_mask_and_set_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_USBCH_CTRL1_REG,
+ USB_CH_ENA, 0);
+ if (ret < 0)
+ return ret;
+ }
+
+ ret = abx500_mask_and_set_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_CHARGER_CTRL,
+ DROP_COUNT_RESET,
+ DROP_COUNT_RESET);
+
+ if (usb_enabled) {
+ restore_ret = abx500_mask_and_set_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_USBCH_CTRL1_REG,
+ USB_CH_ENA,
+ USB_CH_ENA);
+ if (restore_ret < 0)
+ return restore_ret;
+ }
+
+ return ret;
+}
+
/**
* ab8500_charger_check_usbchargernotok_work() - check USB chg not ok status
* @work: pointer to the work_struct structure
@@ -2597,7 +2656,10 @@ static void ab8500_charger_usb_state_changed_work(struct work_struct *work)
static void ab8500_charger_check_usbchargernotok_work(struct work_struct *work)
{
int ret;
+ u8 link_status = 0;
u8 reg_value;
+ bool charger_not_ok;
+ bool prev_collapse;
bool prev_status;
struct ab8500_charger *di = container_of(work,
@@ -2610,19 +2672,61 @@ static void ab8500_charger_check_usbchargernotok_work(struct work_struct *work)
dev_err(di->dev, "%s ab8500 read failed\n", __func__);
return;
}
+ charger_not_ok = reg_value & VBUS_CH_NOK;
+ if (is_ab8505(di->parent)) {
+ ret = abx500_get_register_interruptible(di->dev, AB8500_USB,
+ AB8500_USB_LINK1_STAT_REG,
+ &link_status);
+ if (ret < 0) {
+ dev_err(di->dev, "%s USB link status read failed\n",
+ __func__);
+ return;
+ }
+
+ link_status = (link_status & AB8505_USB_LINK_STATUS) >>
+ USB_LINK_STATUS_SHIFT;
+ charger_not_ok |=
+ link_status == AB8505_USB_STAT_CHARGER_NOT_OK;
+ }
+
prev_status = di->flags.usbchargernotok;
+ prev_collapse = di->flags.vbus_collapse;
+
+ if (is_ab8505(di->parent) &&
+ link_status == AB8505_USB_STAT_CHARGER_NOT_OK &&
+ di->usb_charger_not_ok_retries <
+ AB8505_USB_CHARGER_NOT_OK_RETRIES) {
+ di->usb_charger_not_ok_retries++;
+ di->flags.usbchargernotok = false;
+ di->flags.vbus_collapse = true;
+ dev_warn(di->dev, "Retrying USB charger detection (%u/%u)\n",
+ di->usb_charger_not_ok_retries,
+ AB8505_USB_CHARGER_NOT_OK_RETRIES);
- if (reg_value & VBUS_CH_NOK) {
+ ret = ab8505_charger_retry_usb_detection(di);
+ if (ret < 0)
+ dev_err(di->dev, "USB charger retry failed: %d\n", ret);
+
+ queue_delayed_work(di->charger_wq,
+ &di->check_usbchgnotok_work, HZ);
+ } else if (charger_not_ok) {
di->flags.usbchargernotok = true;
+ if (is_ab8505(di->parent) &&
+ link_status == AB8505_USB_STAT_CHARGER_NOT_OK) {
+ di->flags.vbus_collapse = false;
+ ab8500_charger_set_usb_connected(di, false);
+ }
/* Check again in 1sec */
queue_delayed_work(di->charger_wq,
&di->check_usbchgnotok_work, HZ);
} else {
di->flags.usbchargernotok = false;
di->flags.vbus_collapse = false;
+ di->usb_charger_not_ok_retries = 0;
}
- if (prev_status != di->flags.usbchargernotok)
+ if (prev_status != di->flags.usbchargernotok ||
+ prev_collapse != di->flags.vbus_collapse)
ab8500_power_supply_changed(di, di->usb_chg.psy);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0837/1756] power: supply: ab8500_charger: Recover inactive AB8505 charger
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (835 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0836/1756] power: supply: ab8500_charger: Retry AB8505 USB detection Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0838/1756] power: supply: ab8500_fg: Finalize current measurements Greg Kroah-Hartman
` (161 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 76bdf9d78245bb068207c23e9bf43d4b9bb201c3 ]
UsbChCtrl1.UsbChEna can remain set while UsbChStatus1.UsbChOn is
clear. The existing recovery only checks the control bit, so it considers
the charger enabled and leaves charging stopped.
The Samsung-GT-S7710-Skomer, Samsung-SGH-I407-Kyle, and
Samsung-SGH-T599-Codina-TMO product trees are reference points for
checking both bits and cycling the charger when they disagree.
Extend the USB charger check to detect this AB8505 state and enable the
check in the charging algorithm for AB8505. Only cycle the charger when
VBUS is debounced and no charger-not-OK, thermal, overvoltage, or
watchdog fault accounts for the inactive hardware.
Fixes: 4dcdf57773fd ("ab8500-bm: Quick re-attach charging behaviour")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-13-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_chargalg.c | 9 ++---
drivers/power/supply/ab8500_charger.c | 51 +++++++++++++++++++++++++-
2 files changed, 53 insertions(+), 7 deletions(-)
diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
index 854491ad3ecd5..b450299dcbd67 100644
--- a/drivers/power/supply/ab8500_chargalg.c
+++ b/drivers/power/supply/ab8500_chargalg.c
@@ -1239,12 +1239,9 @@ static void ab8500_chargalg_algorithm(struct ab8500_chargalg *di)
charger_status = ab8500_chargalg_check_charger_connection(di);
- if (is_ab8500(di->parent)) {
- ret = ab8500_chargalg_check_charger_enable(di);
- if (ret < 0)
- dev_err(di->dev, "Checking charger is enabled error"
- ": Returned Value %d\n", ret);
- }
+ ret = ab8500_chargalg_check_charger_enable(di);
+ if (ret < 0)
+ dev_err(di->dev, "Checking charger enable failed: %d\n", ret);
/*
* First check if we have a charger connected.
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index c162979da7799..7764821cb9266 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -52,6 +52,7 @@
#define MAIN_CH_DET 0x01
#define MAIN_CH_CV_ON 0x04
#define USB_CH_CV_ON 0x08
+#define USB_CH_ON 0x04
#define VBUS_DET_DBNC_LONG 0x02
#define VBUS_DET_DBNC1 0x01
#define OTP_ENABLE_WD 0x01
@@ -1877,6 +1878,9 @@ static int ab8500_charger_usb_check_enable(struct ux500_charger *charger,
int vset_uv, int iset_ua)
{
u8 usbch_ctrl1 = 0;
+ u8 usbch_status1;
+ u8 usbch_status2;
+ bool reenable;
int ret = 0;
struct ab8500_charger *di = to_ab8500_charger_usb_device_info(charger);
@@ -1892,7 +1896,52 @@ static int ab8500_charger_usb_check_enable(struct ux500_charger *charger,
}
dev_dbg(di->dev, "USB charger ctrl: 0x%02x\n", usbch_ctrl1);
- if (!(usbch_ctrl1 & USB_CH_ENA)) {
+ reenable = !(usbch_ctrl1 & USB_CH_ENA);
+ if (is_ab8505(di->parent)) {
+ ret = abx500_get_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_CH_USBCH_STAT1_REG,
+ &usbch_status1);
+ if (ret < 0) {
+ dev_err(di->dev, "USB charger status read failed\n");
+ return ret;
+ }
+
+ if (!reenable && (usbch_status1 & USB_CH_ON))
+ return 0;
+
+ if (!(usbch_status1 & VBUS_DET_DBNC_LONG))
+ return 0;
+
+ ret = abx500_get_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_CH_USBCH_STAT2_REG,
+ &usbch_status2);
+ if (ret < 0) {
+ dev_err(di->dev, "USB charger fault status read failed\n");
+ return ret;
+ }
+
+ if ((usbch_status2 &
+ (VBUS_CH_NOK | USB_CH_TH_PROT | VBUS_OVV_TH)) ||
+ di->flags.usbchargernotok || di->flags.usb_thermal_prot ||
+ di->flags.vbus_ovv || di->usb.wd_expired)
+ return 0;
+
+ if (!reenable) {
+ dev_info(di->dev,
+ "USB charger enabled but inactive, cycling it\n");
+ ret = abx500_mask_and_set_register_interruptible(di->dev,
+ AB8500_CHARGER,
+ AB8500_USBCH_CTRL1_REG,
+ USB_CH_ENA, 0);
+ if (ret < 0)
+ return ret;
+ reenable = true;
+ }
+ }
+
+ if (reenable) {
dev_info(di->dev, "Charging has been disabled abnormally and will be re-enabled\n");
ret = abx500_mask_and_set_register_interruptible(di->dev,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0838/1756] power: supply: ab8500_fg: Finalize current measurements
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (836 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0837/1756] power: supply: ab8500_charger: Recover inactive AB8505 charger Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0839/1756] power: supply: ab8500_fg: Avoid reserved AB8505 CCConf bit Greg Kroah-Hartman
` (160 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 9a0461fb5e7cc64ed303bee3661452879ee139a1 ]
ab8500_fg_inst_curr_start() returns with cc_lock held and the CCEOC
IRQ enabled. The bounded sampling loop in the load-compensated voltage
path returns without calling ab8500_fg_inst_curr_finalize() when it
expires, leaving both resources active. The next fuel-gauge work item
then blocks on cc_lock and all cached power-supply values stop updating.
The Samsung-GT-I8530-Gavini, Samsung-GT-S7710-Skomer,
Samsung-SGH-I407-Kyle and Samsung-SGH-T599-Codina-TMO product trees use
a bounded sampling loop in drivers/battery/abb_fuelgauge.c but still
call the finalizer. Follow that pattern so the normal completion timeout
also performs the required cleanup.
Check the start result as well and return an uncompensated voltage if
the instantaneous current transaction cannot be started or completed.
Fixes: edc400e1632f ("power: supply: ab8500_fg: Break loop for measurement")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-14-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_fg.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
index fe143d13718c4..3e530a37535de 100644
--- a/drivers/power/supply/ab8500_fg.c
+++ b/drivers/power/supply/ab8500_fg.c
@@ -934,9 +934,15 @@ static int ab8500_load_comp_fg_bat_voltage(struct ab8500_fg *di, bool always)
int i = 0;
int vbat_uv = 0;
int rcomp;
+ int ret;
/* Average the instant current to get a stable current measurement */
- ab8500_fg_inst_curr_start(di);
+ ret = ab8500_fg_inst_curr_start(di);
+ if (ret) {
+ dev_err(di->dev, "failed to start instantaneous current measurement\n");
+ di->vbat_uv = ab8500_fg_bat_voltage(di);
+ return di->vbat_uv;
+ }
do {
vbat_uv += ab8500_fg_bat_voltage(di);
@@ -945,15 +951,14 @@ static int ab8500_load_comp_fg_bat_voltage(struct ab8500_fg *di, bool always)
} while (!ab8500_fg_inst_curr_done(di) &&
i <= WAIT_FOR_INST_CURRENT_MAX);
- if (i > WAIT_FOR_INST_CURRENT_MAX) {
+ ret = ab8500_fg_inst_curr_finalize(di, &di->inst_curr_ua);
+ if (ret) {
dev_err(di->dev,
"TIMEOUT: return uncompensated measurement of VBAT\n");
di->vbat_uv = vbat_uv / i;
return di->vbat_uv;
}
- ab8500_fg_inst_curr_finalize(di, &di->inst_curr_ua);
-
/*
* If there is too high current dissipation, the compensation cannot be
* trusted so return an error unless we must return something here, as
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0839/1756] power: supply: ab8500_fg: Avoid reserved AB8505 CCConf bit
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (837 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0838/1756] power: supply: ab8500_fg: Finalize current measurements Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0840/1756] ASoC: rt5682-sdw: always cancel jack work on remove Greg Kroah-Hartman
` (159 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sebastian Reichel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit edafb2e4642b72b0f86ce5990d5c29c116bb642b ]
AB8500 defines CCConf bit 1 as CCDeepSleepEna, but AB8505 reserves
bits 7:1 and only defines bit 0, CCPwrUpEna. The fuel-gauge driver
currently writes both bits whenever it starts the coulomb counter.
The Samsung-GT-S7710-Skomer and related Samsung product trees use the
same unconditional value in their fuel-gauge drivers, so they provide
no AB8505 workaround to carry over. Select the value from the detected
PMIC variant instead, retaining the deep-sleep enable bit on all
existing non-AB8505 paths and avoiding the reserved bit on AB8505.
Fixes: a982362c1723 ("mfd: Support for the AB8500 AB8505 variant")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260916-ab8500-charging-v1-15-e986ed321cc6@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_fg.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
index 3e530a37535de..5b7159fe4e296 100644
--- a/drivers/power/supply/ab8500_fg.c
+++ b/drivers/power/supply/ab8500_fg.c
@@ -451,6 +451,16 @@ static void ab8500_fg_fill_cap_sample(struct ab8500_fg *di, int sample)
avg->avg = sample;
}
+static u8 ab8500_fg_cc_config(struct ab8500_fg *di)
+{
+ u8 config = CC_PWR_UP_ENA;
+
+ if (!is_ab8505(di->parent))
+ config |= CC_DEEP_SLEEP_ENA;
+
+ return config;
+}
+
/**
* ab8500_fg_coulomb_counter() - enable coulomb counter
* @di: pointer to the ab8500_fg structure
@@ -481,7 +491,7 @@ static int ab8500_fg_coulomb_counter(struct ab8500_fg *di, bool enable)
/* Start the CC */
ret = abx500_set_register_interruptible(di->dev, AB8500_RTC,
AB8500_RTC_CC_CONF_REG,
- (CC_DEEP_SLEEP_ENA | CC_PWR_UP_ENA));
+ ab8500_fg_cc_config(di));
if (ret)
goto cc_err;
@@ -555,7 +565,7 @@ int ab8500_fg_inst_curr_start(struct ab8500_fg *di)
/* Start the CC */
ret = abx500_set_register_interruptible(di->dev, AB8500_RTC,
AB8500_RTC_CC_CONF_REG,
- (CC_DEEP_SLEEP_ENA | CC_PWR_UP_ENA));
+ ab8500_fg_cc_config(di));
if (ret)
goto fail;
} else {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0840/1756] ASoC: rt5682-sdw: always cancel jack work on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (838 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0839/1756] power: supply: ab8500_fg: Avoid reserved AB8505 CCConf bit Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0841/1756] ASoC: rt711-sdw: " Greg Kroah-Hartman
` (158 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 9a98f7e955d35e0831fb179e88e98cf9bc0e001e ]
rt5682_sdw_remove() cancels jack_detect_work only when hw_init is true.
rt5682_update_status() clears hw_init when the SoundWire slave becomes
unattached, but jack_detect_work may already have been queued by
rt5682_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave delayed work pending after the codec private data has been freed.
The work object is initialized during probe, so cancel it unconditionally
instead of relying on the mutable hw_init state.
Fixes: ac63716da307 ("ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925145019.2290367-2-yaojiale02@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5682-sdw.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c
index 5edf11e136b43..24cd4a5e25199 100644
--- a/sound/soc/codecs/rt5682-sdw.c
+++ b/sound/soc/codecs/rt5682-sdw.c
@@ -695,8 +695,7 @@ static int rt5682_sdw_remove(struct sdw_slave *slave)
{
struct rt5682_priv *rt5682 = dev_get_drvdata(&slave->dev);
- if (rt5682->hw_init)
- cancel_delayed_work_sync(&rt5682->jack_detect_work);
+ cancel_delayed_work_sync(&rt5682->jack_detect_work);
pm_runtime_disable(&slave->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0841/1756] ASoC: rt711-sdw: always cancel jack work on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (839 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0840/1756] ASoC: rt5682-sdw: always cancel jack work on remove Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0842/1756] ASoC: rt711-sdca: " Greg Kroah-Hartman
` (157 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 4bf78e3d9e324f9f2e39feecedd4f70b05baeb16 ]
rt711_sdw_remove() cancels the jack and calibration work only when
hw_init is true. rt711_update_status() clears hw_init when the SoundWire
slave becomes unattached, but work may already have been queued by
rt711_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave work pending after the codec private data has been freed.
The work objects are initialized during probe, so cancel them
unconditionally instead of relying on the mutable hw_init state.
Fixes: ac63716da307 ("ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925145019.2290367-3-yaojiale02@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt711-sdw.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index dfda6bb5c6f8b..f2e662c210d2d 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -462,11 +462,9 @@ static int rt711_sdw_remove(struct sdw_slave *slave)
{
struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev);
- if (rt711->hw_init) {
- cancel_delayed_work_sync(&rt711->jack_detect_work);
- cancel_delayed_work_sync(&rt711->jack_btn_check_work);
- cancel_work_sync(&rt711->calibration_work);
- }
+ cancel_delayed_work_sync(&rt711->jack_detect_work);
+ cancel_delayed_work_sync(&rt711->jack_btn_check_work);
+ cancel_work_sync(&rt711->calibration_work);
pm_runtime_disable(&slave->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0842/1756] ASoC: rt711-sdca: always cancel jack work on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (840 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0841/1756] ASoC: rt711-sdw: " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0843/1756] ASoC: rt712-sdca: " Greg Kroah-Hartman
` (156 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit ecc2fca6decefe27d8cf40a4c9815798eec24d30 ]
rt711_sdca_sdw_remove() cancels the jack work only when hw_init is true.
rt711_sdca_update_status() clears hw_init when the SoundWire slave
becomes unattached, but jack work may already have been queued by
rt711_sdca_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave delayed work pending after the codec private data has been freed.
The work objects are initialized during probe, so cancel them
unconditionally instead of relying on the mutable hw_init state.
Fixes: ac63716da307 ("ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925145019.2290367-4-yaojiale02@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt711-sdca-sdw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/rt711-sdca-sdw.c b/sound/soc/codecs/rt711-sdca-sdw.c
index f5933d2e085e9..74452eee98d08 100644
--- a/sound/soc/codecs/rt711-sdca-sdw.c
+++ b/sound/soc/codecs/rt711-sdca-sdw.c
@@ -361,10 +361,8 @@ static int rt711_sdca_sdw_remove(struct sdw_slave *slave)
{
struct rt711_sdca_priv *rt711 = dev_get_drvdata(&slave->dev);
- if (rt711->hw_init) {
- cancel_delayed_work_sync(&rt711->jack_detect_work);
- cancel_delayed_work_sync(&rt711->jack_btn_check_work);
- }
+ cancel_delayed_work_sync(&rt711->jack_detect_work);
+ cancel_delayed_work_sync(&rt711->jack_btn_check_work);
pm_runtime_disable(&slave->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0843/1756] ASoC: rt712-sdca: always cancel jack work on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (841 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0842/1756] ASoC: rt711-sdca: " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0844/1756] ASoC: rt722-sdca: " Greg Kroah-Hartman
` (155 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit c7d07df95ee7ce7859e6c873a76d19ea9c64b6fd ]
rt712_sdca_sdw_remove() cancels the jack work only when hw_init is true.
rt712_sdca_update_status() clears hw_init when the SoundWire slave
becomes unattached, but jack work may already have been queued by
rt712_sdca_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave delayed work pending after the codec private data has been freed.
The work objects are initialized during probe, so cancel them
unconditionally instead of relying on the mutable hw_init state.
Fixes: 6c39710da75c ("ASoC: rt712-sdca: Add RT712 SDCA driver for Jack and Amp topology")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925145019.2290367-5-yaojiale02@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt712-sdca-sdw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/rt712-sdca-sdw.c b/sound/soc/codecs/rt712-sdca-sdw.c
index 90d5aaddbd5b9..9c970e6235994 100644
--- a/sound/soc/codecs/rt712-sdca-sdw.c
+++ b/sound/soc/codecs/rt712-sdca-sdw.c
@@ -378,10 +378,8 @@ static int rt712_sdca_sdw_remove(struct sdw_slave *slave)
{
struct rt712_sdca_priv *rt712 = dev_get_drvdata(&slave->dev);
- if (rt712->hw_init) {
- cancel_delayed_work_sync(&rt712->jack_detect_work);
- cancel_delayed_work_sync(&rt712->jack_btn_check_work);
- }
+ cancel_delayed_work_sync(&rt712->jack_detect_work);
+ cancel_delayed_work_sync(&rt712->jack_btn_check_work);
pm_runtime_disable(&slave->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0844/1756] ASoC: rt722-sdca: always cancel jack work on remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (842 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0843/1756] ASoC: rt712-sdca: " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0845/1756] arm64: dts: rockchip: Rename rk3328 HDMI audio card Greg Kroah-Hartman
` (154 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 9d29132d81a7f269177be676c3b81cc575899975 ]
rt722_sdca_sdw_remove() cancels the jack work only when hw_init is true.
rt722_sdca_update_status() clears hw_init when the SoundWire slave
becomes unattached, but jack work may already have been queued by
rt722_sdca_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave delayed work pending after the codec private data has been freed.
The work objects are initialized during probe, so cancel them
unconditionally instead of relying on the mutable hw_init state.
Fixes: 7f5d6036ca00 ("ASoC: rt722-sdca: Add RT722 SDCA driver")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925145019.2290367-7-yaojiale02@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt722-sdca-sdw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/rt722-sdca-sdw.c b/sound/soc/codecs/rt722-sdca-sdw.c
index bf83f4bc94fc1..90ecc44997e10 100644
--- a/sound/soc/codecs/rt722-sdca-sdw.c
+++ b/sound/soc/codecs/rt722-sdca-sdw.c
@@ -438,10 +438,8 @@ static int rt722_sdca_sdw_remove(struct sdw_slave *slave)
{
struct rt722_sdca_priv *rt722 = dev_get_drvdata(&slave->dev);
- if (rt722->hw_init) {
- cancel_delayed_work_sync(&rt722->jack_detect_work);
- cancel_delayed_work_sync(&rt722->jack_btn_check_work);
- }
+ cancel_delayed_work_sync(&rt722->jack_detect_work);
+ cancel_delayed_work_sync(&rt722->jack_btn_check_work);
if (rt722->first_hw_init)
pm_runtime_disable(&slave->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0845/1756] arm64: dts: rockchip: Rename rk3328 HDMI audio card
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (843 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0844/1756] ASoC: rt722-sdca: " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0846/1756] ARM: dts: ux500: Use AB8505 charger compatible Greg Kroah-Hartman
` (153 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Detlev Casanova, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Detlev Casanova <detlev.casanova@collabora.com>
[ Upstream commit daa0db717771d43c25d98c2798fa6a7b0252deb7 ]
Rename the card from "HDMI" to "RK3328 HDMI" so it identifies the SoC
in user-visible ALSA fields and no longer collides with the identical
"HDMI" string used by other Rockchip SoCs.
Fixes: 29e8976e604f1 ("arm64: dts: rockchip: Add RK3328 audio pipelines")
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Link: https://patch.msgid.link/20260910-fix-rockchip-hdmi-audio-names-v2-4-1396a6168e20@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index d16a13d6442f8..a6db5ce407970 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -207,7 +207,7 @@ hdmi_sound: hdmi-sound {
compatible = "simple-audio-card";
simple-audio-card,format = "i2s";
simple-audio-card,mclk-fs = <128>;
- simple-audio-card,name = "HDMI";
+ simple-audio-card,name = "RK3328 HDMI";
status = "disabled";
simple-audio-card,cpu {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0846/1756] ARM: dts: ux500: Use AB8505 charger compatible
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (844 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0845/1756] arm64: dts: rockchip: Rename rk3328 HDMI audio card Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0847/1756] arm64: dts: rockchip: Update CPU OPP voltages in RK356x SoC dtsi Greg Kroah-Hartman
` (152 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit ff1501cbb825de117267124ecb8898112b4051c5 ]
Identify the AB8505 charger using its variant-specific compatible and
retain the AB8500 compatible as a fallback for the existing driver. This
selects the AB8505 interrupt constraints from the binding.
The AB8505 interrupt table explicitly omits the five interrupt sources
belonging to the AB8500 main charger. Remove these nonexistent interrupts
from the AB8505 charger node, leaving its nine USB charger interrupts.
Fixes: bc324d447fba ("ARM: dts: ux500: Add interrupts to charger")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/st/ste-ab8505.dtsi | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
index 24b12f0cf322f..434251f36ff68 100644
--- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
+++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
@@ -137,13 +137,9 @@ ab8500_btemp {
};
ab8500_charger {
- compatible = "stericsson,ab8500-charger";
- interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
- <11 IRQ_TYPE_LEVEL_HIGH>,
- <0 IRQ_TYPE_LEVEL_HIGH>,
- <107 IRQ_TYPE_LEVEL_HIGH>,
- <106 IRQ_TYPE_LEVEL_HIGH>,
- <14 IRQ_TYPE_LEVEL_HIGH>,
+ compatible = "stericsson,ab8505-charger",
+ "stericsson,ab8500-charger";
+ interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
<15 IRQ_TYPE_LEVEL_HIGH>,
<79 IRQ_TYPE_LEVEL_HIGH>,
<105 IRQ_TYPE_LEVEL_HIGH>,
@@ -152,12 +148,7 @@ ab8500_charger {
<22 IRQ_TYPE_LEVEL_HIGH>,
<21 IRQ_TYPE_LEVEL_HIGH>,
<16 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "MAIN_CH_UNPLUG_DET",
- "MAIN_CHARGE_PLUG_DET",
- "MAIN_EXT_CH_NOT_OK",
- "MAIN_CH_TH_PROT_R",
- "MAIN_CH_TH_PROT_F",
- "VBUS_DET_F",
+ interrupt-names = "VBUS_DET_F",
"VBUS_DET_R",
"USB_LINK_STATUS",
"USB_CH_TH_PROT_R",
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0847/1756] arm64: dts: rockchip: Update CPU OPP voltages in RK356x SoC dtsi
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (845 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0846/1756] ARM: dts: ux500: Use AB8505 charger compatible Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0848/1756] arm64: dts: rockchip: Prepare RK356x SoC dtsi files for per-variant OPPs Greg Kroah-Hartman
` (151 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dragan Simic, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dragan Simic <dsimic@manjaro.org>
[ Upstream commit 0e183fcc92b0eaa13b33b39846d86c3d65b8330a ]
Update the lower/upper voltage limits and the exact voltages for the Rockchip
RK356x CPU OPPs, using the most conservative values (i.e. the highest per-OPP
voltages) found in the vendor kernel source. [1]
Using the most conservative per-OPP voltages ensures reliable CPU operation
regardless of the actual CPU binning, with the downside of possibly using
a bit more power for the CPU cores than absolutely needed.
Additionally, fill in the missing "clock-latency-ns" CPU OPP properties, using
the values found in the vendor kernel source. [1]
[1] https://raw.githubusercontent.com/rockchip-linux/kernel/f8b9431ee38ed561650be7092ab93f564598daa9/arch/arm64/boot/dts/rockchip/rk3568.dtsi
Related-to: eb665b1c06bc ("arm64: dts: rockchip: Update GPU OPP voltages in RK356x SoC dtsi")
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/f816cd24b62742dd05a1b7c6fe162bb581c9b3bf.1730516702.git.dsimic@manjaro.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Stable-dep-of: 8043ed0f40fe ("arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3568.dtsi | 1 +
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 18 ++++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
index 0d16f74949b6a..1a66230f3d89e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
@@ -274,6 +274,7 @@ &cpu0_opp_table {
opp-1992000000 {
opp-hz = /bits/ 64 <1992000000>;
opp-microvolt = <1150000 1150000 1150000>;
+ clock-latency-ns = <40000>;
};
};
diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
index 32ccc57555545..d62c81849f4bd 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
@@ -134,39 +134,45 @@ cpu0_opp_table: opp-table-0 {
opp-408000000 {
opp-hz = /bits/ 64 <408000000>;
- opp-microvolt = <900000 900000 1150000>;
+ opp-microvolt = <850000 850000 1150000>;
clock-latency-ns = <40000>;
};
opp-600000000 {
opp-hz = /bits/ 64 <600000000>;
- opp-microvolt = <900000 900000 1150000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
};
opp-816000000 {
opp-hz = /bits/ 64 <816000000>;
- opp-microvolt = <900000 900000 1150000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
opp-suspend;
};
opp-1104000000 {
opp-hz = /bits/ 64 <1104000000>;
opp-microvolt = <900000 900000 1150000>;
+ clock-latency-ns = <40000>;
};
opp-1416000000 {
opp-hz = /bits/ 64 <1416000000>;
- opp-microvolt = <900000 900000 1150000>;
+ opp-microvolt = <1025000 1025000 1150000>;
+ clock-latency-ns = <40000>;
};
opp-1608000000 {
opp-hz = /bits/ 64 <1608000000>;
- opp-microvolt = <975000 975000 1150000>;
+ opp-microvolt = <1100000 1100000 1150000>;
+ clock-latency-ns = <40000>;
};
opp-1800000000 {
opp-hz = /bits/ 64 <1800000000>;
- opp-microvolt = <1050000 1050000 1150000>;
+ opp-microvolt = <1150000 1150000 1150000>;
+ clock-latency-ns = <40000>;
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0848/1756] arm64: dts: rockchip: Prepare RK356x SoC dtsi files for per-variant OPPs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (846 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0847/1756] arm64: dts: rockchip: Update CPU OPP voltages in RK356x SoC dtsi Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0849/1756] arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards Greg Kroah-Hartman
` (150 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dragan Simic, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dragan Simic <dsimic@manjaro.org>
[ Upstream commit 853f9632a17624e9264c68be5c9587f13d04be54 ]
Rename the Rockchip RK356x SoC dtsi files and, consequently, adjust their
contents appropriately, to prepare them for the ability to specify different
CPU and GPU OPPs for each of the supported RK356x SoC variants.
The first new RK356x SoC variant to be introduced is the RK3566T, which the
Pine64 Quartz64 Zero SBC is officially based on. [1] Some other SBCs are
also based on the RK3566T variant, including Radxa ROCK 3C and ZERO 3E/3W,
but the slight trouble is that Radxa doesn't state that officially. Though,
it's rather easy to spot the RK3566T on such boards, because their official
specifications state that the maximum frequency for the Cortex-A55 cores is
lower than the "full-fat" RK3566's 1.8 GHz. [2][3][4]
These changes follow the approach used for the Rockchip RK3588 SoC variants,
which was introduced and described further in commit def88eb4d836 ("arm64:
dts: rockchip: Prepare RK3588 SoC dtsi files for per-variant OPPs"). Please
see that commit for a more detailed explanation.
No functional changes are introduced, which was validated by decompiling and
comparing all affected board dtb files before and after these changes. In
more detail, the affected dtb files have some of their blocks shuffled around
a bit and some of their phandles have different values, as a result of the
changes to the order in which the building blocks from the parent dtsi files
are included, but they effectively remain the same as the originals.
As a side note, due to the nature of introduced changes, this commit is a bit
more readable when viewed using the --break-rewrites option for git-log(1).
[1] https://wiki.pine64.org/wiki/Quartz64
[2] https://dl.radxa.com/rock3/docs/hw/3c/radxa_rock3c_product_brief.pdf
[3] https://dl.radxa.com/zero3/docs/hw/3e/radxa_zero_3e_product_brief.pdf
[4] https://dl.radxa.com/zero3/docs/hw/3w/radxa_zero_3w_product_brief.pdf
Related-to: def88eb4d836 ("arm64: dts: rockchip: Prepare RK3588 SoC dtsi files for per-variant OPPs")
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/77e7450b8280bbdf4e2dc47366c9da85d4d8d1de.1730516702.git.dsimic@manjaro.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Stable-dep-of: 8043ed0f40fe ("arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3566-base.dtsi | 35 ++++++
arch/arm64/boot/dts/rockchip/rk3566.dtsi | 116 ++++++++++++++----
arch/arm64/boot/dts/rockchip/rk3568.dtsi | 114 +++++++++++++++--
.../{rk356x.dtsi => rk356x-base.dtsi} | 87 -------------
4 files changed, 236 insertions(+), 116 deletions(-)
create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-base.dtsi
rename arch/arm64/boot/dts/rockchip/{rk356x.dtsi => rk356x-base.dtsi} (96%)
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi
new file mode 100644
index 0000000000000..e56e0b6ba9411
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk356x-base.dtsi"
+
+/ {
+ compatible = "rockchip,rk3566";
+};
+
+&pipegrf {
+ compatible = "rockchip,rk3566-pipe-grf", "syscon";
+};
+
+&power {
+ power-domain@RK3568_PD_PIPE {
+ reg = <RK3568_PD_PIPE>;
+ clocks = <&cru PCLK_PIPE>;
+ pm_qos = <&qos_pcie2x1>,
+ <&qos_sata1>,
+ <&qos_sata2>,
+ <&qos_usb3_0>,
+ <&qos_usb3_1>;
+ #power-domain-cells = <0>;
+ };
+};
+
+&usb_host0_xhci {
+ phys = <&usb2phy0_otg>;
+ phy-names = "usb2-phy";
+ extcon = <&usb2phy0>;
+ maximum-speed = "high-speed";
+};
+
+&vop {
+ compatible = "rockchip,rk3566-vop";
+};
diff --git a/arch/arm64/boot/dts/rockchip/rk3566.dtsi b/arch/arm64/boot/dts/rockchip/rk3566.dtsi
index 6c4b17d27bdc5..3fcca79279f7c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi
@@ -1,35 +1,107 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-#include "rk356x.dtsi"
+#include "rk3566-base.dtsi"
/ {
- compatible = "rockchip,rk3566";
+ cpu0_opp_table: opp-table-0 {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp-408000000 {
+ opp-hz = /bits/ 64 <408000000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-816000000 {
+ opp-hz = /bits/ 64 <816000000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
+ opp-suspend;
+ };
+
+ opp-1104000000 {
+ opp-hz = /bits/ 64 <1104000000>;
+ opp-microvolt = <900000 900000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1416000000 {
+ opp-hz = /bits/ 64 <1416000000>;
+ opp-microvolt = <1025000 1025000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1608000000 {
+ opp-hz = /bits/ 64 <1608000000>;
+ opp-microvolt = <1100000 1100000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <1150000 1150000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+ };
+
+ gpu_opp_table: opp-table-1 {
+ compatible = "operating-points-v2";
+
+ opp-200000000 {
+ opp-hz = /bits/ 64 <200000000>;
+ opp-microvolt = <850000 850000 1000000>;
+ };
+
+ opp-300000000 {
+ opp-hz = /bits/ 64 <300000000>;
+ opp-microvolt = <850000 850000 1000000>;
+ };
+
+ opp-400000000 {
+ opp-hz = /bits/ 64 <400000000>;
+ opp-microvolt = <850000 850000 1000000>;
+ };
+
+ opp-600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ opp-microvolt = <900000 900000 1000000>;
+ };
+
+ opp-700000000 {
+ opp-hz = /bits/ 64 <700000000>;
+ opp-microvolt = <950000 950000 1000000>;
+ };
+
+ opp-800000000 {
+ opp-hz = /bits/ 64 <800000000>;
+ opp-microvolt = <1000000 1000000 1000000>;
+ };
+ };
};
-&pipegrf {
- compatible = "rockchip,rk3566-pipe-grf", "syscon";
+&cpu0 {
+ operating-points-v2 = <&cpu0_opp_table>;
};
-&power {
- power-domain@RK3568_PD_PIPE {
- reg = <RK3568_PD_PIPE>;
- clocks = <&cru PCLK_PIPE>;
- pm_qos = <&qos_pcie2x1>,
- <&qos_sata1>,
- <&qos_sata2>,
- <&qos_usb3_0>,
- <&qos_usb3_1>;
- #power-domain-cells = <0>;
- };
+&cpu1 {
+ operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu2 {
+ operating-points-v2 = <&cpu0_opp_table>;
};
-&usb_host0_xhci {
- phys = <&usb2phy0_otg>;
- phy-names = "usb2-phy";
- extcon = <&usb2phy0>;
- maximum-speed = "high-speed";
+&cpu3 {
+ operating-points-v2 = <&cpu0_opp_table>;
};
-&vop {
- compatible = "rockchip,rk3566-vop";
+&gpu {
+ operating-points-v2 = <&gpu_opp_table>;
};
diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
index 1a66230f3d89e..c43c8dee7a0e5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
@@ -3,11 +3,99 @@
* Copyright (c) 2021 Rockchip Electronics Co., Ltd.
*/
-#include "rk356x.dtsi"
+#include "rk356x-base.dtsi"
/ {
compatible = "rockchip,rk3568";
+ cpu0_opp_table: opp-table-0 {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp-408000000 {
+ opp-hz = /bits/ 64 <408000000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-816000000 {
+ opp-hz = /bits/ 64 <816000000>;
+ opp-microvolt = <850000 850000 1150000>;
+ clock-latency-ns = <40000>;
+ opp-suspend;
+ };
+
+ opp-1104000000 {
+ opp-hz = /bits/ 64 <1104000000>;
+ opp-microvolt = <900000 900000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1416000000 {
+ opp-hz = /bits/ 64 <1416000000>;
+ opp-microvolt = <1025000 1025000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1608000000 {
+ opp-hz = /bits/ 64 <1608000000>;
+ opp-microvolt = <1100000 1100000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1800000000 {
+ opp-hz = /bits/ 64 <1800000000>;
+ opp-microvolt = <1150000 1150000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+
+ opp-1992000000 {
+ opp-hz = /bits/ 64 <1992000000>;
+ opp-microvolt = <1150000 1150000 1150000>;
+ clock-latency-ns = <40000>;
+ };
+ };
+
+ gpu_opp_table: opp-table-1 {
+ compatible = "operating-points-v2";
+
+ opp-200000000 {
+ opp-hz = /bits/ 64 <200000000>;
+ opp-microvolt = <850000 850000 1000000>;
+ };
+
+ opp-300000000 {
+ opp-hz = /bits/ 64 <300000000>;
+ opp-microvolt = <850000 850000 1000000>;
+ };
+
+ opp-400000000 {
+ opp-hz = /bits/ 64 <400000000>;
+ opp-microvolt = <850000 850000 1000000>;
+ };
+
+ opp-600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ opp-microvolt = <900000 900000 1000000>;
+ };
+
+ opp-700000000 {
+ opp-hz = /bits/ 64 <700000000>;
+ opp-microvolt = <950000 950000 1000000>;
+ };
+
+ opp-800000000 {
+ opp-hz = /bits/ 64 <800000000>;
+ opp-microvolt = <1000000 1000000 1000000>;
+ };
+ };
+
sata0: sata@fc000000 {
compatible = "rockchip,rk3568-dwc-ahci", "snps,dwc-ahci";
reg = <0 0xfc000000 0 0x1000>;
@@ -270,12 +358,24 @@ combphy0: phy@fe820000 {
};
};
-&cpu0_opp_table {
- opp-1992000000 {
- opp-hz = /bits/ 64 <1992000000>;
- opp-microvolt = <1150000 1150000 1150000>;
- clock-latency-ns = <40000>;
- };
+&cpu0 {
+ operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu1 {
+ operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu2 {
+ operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu3 {
+ operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&gpu {
+ operating-points-v2 = <&gpu_opp_table>;
};
&pipegrf {
diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
similarity index 96%
rename from arch/arm64/boot/dts/rockchip/rk356x.dtsi
rename to arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
index d62c81849f4bd..c30e5737b44d5 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
@@ -56,7 +56,6 @@ cpu0: cpu@0 {
clocks = <&scmi_clk 0>;
#cooling-cells = <2>;
enable-method = "psci";
- operating-points-v2 = <&cpu0_opp_table>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <128>;
@@ -72,7 +71,6 @@ cpu1: cpu@100 {
reg = <0x0 0x100>;
#cooling-cells = <2>;
enable-method = "psci";
- operating-points-v2 = <&cpu0_opp_table>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <128>;
@@ -88,7 +86,6 @@ cpu2: cpu@200 {
reg = <0x0 0x200>;
#cooling-cells = <2>;
enable-method = "psci";
- operating-points-v2 = <&cpu0_opp_table>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <128>;
@@ -104,7 +101,6 @@ cpu3: cpu@300 {
reg = <0x0 0x300>;
#cooling-cells = <2>;
enable-method = "psci";
- operating-points-v2 = <&cpu0_opp_table>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <128>;
@@ -128,54 +124,6 @@ l3_cache: l3-cache {
cache-sets = <512>;
};
- cpu0_opp_table: opp-table-0 {
- compatible = "operating-points-v2";
- opp-shared;
-
- opp-408000000 {
- opp-hz = /bits/ 64 <408000000>;
- opp-microvolt = <850000 850000 1150000>;
- clock-latency-ns = <40000>;
- };
-
- opp-600000000 {
- opp-hz = /bits/ 64 <600000000>;
- opp-microvolt = <850000 850000 1150000>;
- clock-latency-ns = <40000>;
- };
-
- opp-816000000 {
- opp-hz = /bits/ 64 <816000000>;
- opp-microvolt = <850000 850000 1150000>;
- clock-latency-ns = <40000>;
- opp-suspend;
- };
-
- opp-1104000000 {
- opp-hz = /bits/ 64 <1104000000>;
- opp-microvolt = <900000 900000 1150000>;
- clock-latency-ns = <40000>;
- };
-
- opp-1416000000 {
- opp-hz = /bits/ 64 <1416000000>;
- opp-microvolt = <1025000 1025000 1150000>;
- clock-latency-ns = <40000>;
- };
-
- opp-1608000000 {
- opp-hz = /bits/ 64 <1608000000>;
- opp-microvolt = <1100000 1100000 1150000>;
- clock-latency-ns = <40000>;
- };
-
- opp-1800000000 {
- opp-hz = /bits/ 64 <1800000000>;
- opp-microvolt = <1150000 1150000 1150000>;
- clock-latency-ns = <40000>;
- };
- };
-
display_subsystem: display-subsystem {
compatible = "rockchip,display-subsystem";
ports = <&vop_out>;
@@ -196,40 +144,6 @@ scmi_clk: protocol@14 {
};
};
- gpu_opp_table: opp-table-1 {
- compatible = "operating-points-v2";
-
- opp-200000000 {
- opp-hz = /bits/ 64 <200000000>;
- opp-microvolt = <850000 850000 1000000>;
- };
-
- opp-300000000 {
- opp-hz = /bits/ 64 <300000000>;
- opp-microvolt = <850000 850000 1000000>;
- };
-
- opp-400000000 {
- opp-hz = /bits/ 64 <400000000>;
- opp-microvolt = <850000 850000 1000000>;
- };
-
- opp-600000000 {
- opp-hz = /bits/ 64 <600000000>;
- opp-microvolt = <900000 900000 1000000>;
- };
-
- opp-700000000 {
- opp-hz = /bits/ 64 <700000000>;
- opp-microvolt = <950000 950000 1000000>;
- };
-
- opp-800000000 {
- opp-hz = /bits/ 64 <800000000>;
- opp-microvolt = <1000000 1000000 1000000>;
- };
- };
-
hdmi_sound: hdmi-sound {
compatible = "simple-audio-card";
simple-audio-card,name = "HDMI";
@@ -635,7 +549,6 @@ gpu: gpu@fde60000 {
clocks = <&scmi_clk 1>, <&cru CLK_GPU>;
clock-names = "gpu", "bus";
#cooling-cells = <2>;
- operating-points-v2 = <&gpu_opp_table>;
power-domains = <&power RK3568_PD_GPU>;
status = "disabled";
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0849/1756] arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (847 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0848/1756] arm64: dts: rockchip: Prepare RK356x SoC dtsi files for per-variant OPPs Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0850/1756] arm64: dts: rockchip: fix analog headphone output on rk3399-firefly Greg Kroah-Hartman
` (149 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Detlev Casanova, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Detlev Casanova <detlev.casanova@collabora.com>
[ Upstream commit 8043ed0f40fe2b49df1c2c25409ab6bd3f88e806 ]
Move the HDMI audio card name for RK3566 and RK3568 to their
corresponding dtsi files so the name can be set to match the SoC
in user-visible ALSA fields and no longer collides with the identical
"HDMI" string used by other Rockchip SoCs.
Fixes: 697ee8546e241 ("arm64: dts: rockchip: Add HDMI audio nodes to rk356x")
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Link: https://patch.msgid.link/20260910-fix-rockchip-hdmi-audio-names-v2-6-1396a6168e20@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3566-base.dtsi | 4 ++++
arch/arm64/boot/dts/rockchip/rk3568.dtsi | 4 ++++
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 1 -
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi
index e56e0b6ba9411..3c365a1188d7b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3566-base.dtsi
@@ -6,6 +6,10 @@ / {
compatible = "rockchip,rk3566";
};
+&hdmi_sound {
+ simple-audio-card,name = "RK3566 HDMI";
+};
+
&pipegrf {
compatible = "rockchip,rk3566-pipe-grf", "syscon";
};
diff --git a/arch/arm64/boot/dts/rockchip/rk3568.dtsi b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
index c43c8dee7a0e5..1b527d8c3b8ce 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi
@@ -378,6 +378,10 @@ &gpu {
operating-points-v2 = <&gpu_opp_table>;
};
+&hdmi_sound {
+ simple-audio-card,name = "RK3568 HDMI";
+};
+
&pipegrf {
compatible = "rockchip,rk3568-pipe-grf", "syscon";
};
diff --git a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
index c30e5737b44d5..6e764edab4985 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
@@ -146,7 +146,6 @@ scmi_clk: protocol@14 {
hdmi_sound: hdmi-sound {
compatible = "simple-audio-card";
- simple-audio-card,name = "HDMI";
simple-audio-card,format = "i2s";
simple-audio-card,mclk-fs = <256>;
status = "disabled";
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0850/1756] arm64: dts: rockchip: fix analog headphone output on rk3399-firefly
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (848 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0849/1756] arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0851/1756] arm64: dts: rockchip: disable unused i2s0 " Greg Kroah-Hartman
` (148 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yaozhong Li, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yaozhong Li <yaozhonguwl@gmail.com>
[ Upstream commit 23eab1a5e36099fd1269f8a18dc389e04dc19011 ]
The analog headphone jack on this board has never produced any sound
with a mainline kernel.
GPIO4_C5 has to be high for audio to reach the jack. The board file
muxes the pin to GPIO through the rt5640_hpcon pinctrl group and
references that group from the codec node, but nothing ever requests or
drives the line.
Describe it the way rk3399-roc-pc-plus.dts already does something similar,
as a simple-audio-amplifier auxiliary component, so that DAPM asserts the
GPIO while the headphone path is active.
Measured on a Firefly-RK3399 by toggling only this line while a 1 kHz
tone kept playing, with the playback PCM in state: RUNNING throughout:
high -> audible, low -> silent, high -> audible
With this change the line is claimed and follows the audio path:
pin 149 (gpio4-21): headphones-amp gpio4:149
idle: gpio-21 (|enable) out lo
playing: gpio-21 (|enable) out hi
Fixes: 171582e00db1 ("arm64: dts: rockchip: add support for firefly-rk3399 board")
Assisted-by: LLM
Signed-off-by: Yaozhong Li <yaozhonguwl@gmail.com>
Link: https://patch.msgid.link/20260921063431.103-2-yaozhonguwl@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../arm64/boot/dts/rockchip/rk3399-firefly.dts | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index f4491317a1b03..1dddc26efed95 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -96,6 +96,15 @@ key-power {
};
};
+ /* GPIO that enables the headphone output path */
+ headphones_amp: headphones-amp {
+ compatible = "simple-audio-amplifier";
+ enable-gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rt5640_hpcon>;
+ sound-name-prefix = "Headphone Amp";
+ };
+
ir-receiver {
compatible = "gpio-ir-receiver";
gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
@@ -132,8 +141,11 @@ rt5640-sound {
simple-audio-card,routing =
"Mic Jack", "MICBIAS1",
"IN1P", "Mic Jack",
- "Headphone Jack", "HPOL",
- "Headphone Jack", "HPOR";
+ "Headphone Amp INL", "HPOL",
+ "Headphone Amp INR", "HPOR",
+ "Headphone Jack", "Headphone Amp OUTL",
+ "Headphone Jack", "Headphone Amp OUTR";
+ simple-audio-card,aux-devs = <&headphones_amp>;
simple-audio-card,cpu {
sound-dai = <&i2s1>;
@@ -547,8 +559,6 @@ rt5640: rt5640@1c {
clock-names = "mclk";
realtek,in1-differential;
#sound-dai-cells = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&rt5640_hpcon>;
};
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0851/1756] arm64: dts: rockchip: disable unused i2s0 on rk3399-firefly
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (849 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0850/1756] arm64: dts: rockchip: fix analog headphone output on rk3399-firefly Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0852/1756] ASoC: mt6359-accdet: manage private workqueues with devres Greg Kroah-Hartman
` (147 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yaozhong Li, Heiko Stuebner,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yaozhong Li <yaozhonguwl@gmail.com>
[ Upstream commit 9416a641cfe5b75dd9178c15960ee741c1091b45 ]
The board file enables i2s0, but no sound card references it: the
on-board RT5640 is wired to i2s1 and the S/PDIF transmitter has its own
controller. Keeping it enabled starves the other controllers, due to the
pl330 instance that serves the audio block only having six channels.
The i2s0 pin groups also lists GPIO4_A0, which carries SCLK_I2S_8CH_OUT,
providing the MCLK the codec runs on.
So add the pinmux for the MCLK signal to the i2s1 node.
The RT5640 and S/PDIF cards then register with no DMA errors, and a
1 kHz tone measured through the codec's internal HPOL/HPOR loopback is
unchanged (L 2135 -> 2138, R 2202 -> 2203), confirming that MCLK still
reaches the codec.
Fixes: 171582e00db1 ("arm64: dts: rockchip: add support for firefly-rk3399 board")
Assisted-by: LLM
Signed-off-by: Yaozhong Li <yaozhonguwl@gmail.com>
Link: https://patch.msgid.link/20260921063431.103-3-yaozhonguwl@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index 1dddc26efed95..7e5452cdceabd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -628,13 +628,9 @@ accelerometer@68 {
};
};
-&i2s0 {
- rockchip,playback-channels = <8>;
- rockchip,capture-channels = <8>;
- status = "okay";
-};
-
&i2s1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
rockchip,playback-channels = <2>;
rockchip,capture-channels = <2>;
status = "okay";
@@ -689,6 +685,12 @@ ir_int: ir-int {
};
};
+ i2s1 {
+ i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
+ rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
+ };
+ };
+
lcd-panel {
lcd_panel_reset: lcd-panel-reset {
rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0852/1756] ASoC: mt6359-accdet: manage private workqueues with devres
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (850 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0851/1756] arm64: dts: rockchip: disable unused i2s0 " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0853/1756] perf/marvell: cn10k_tad: Publish the OF module alias Greg Kroah-Hartman
` (146 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hongyan Xu, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongyan Xu <getshell@seu.edu.cn>
[ Upstream commit 9a773d9d21fa909e8babbe11e93c811cf1a6d22d ]
The threaded jack-detect interrupts queue work on two private
workqueues. Neither queue is destroyed on device removal, so queued
callbacks can retain pointers to devm-allocated state after it is
released. Probe error paths also leak the queues.
Create and initialize both workqueues before requesting interrupts, then
add a managed cleanup action. Since the managed IRQs are acquired
afterwards, devres releases and synchronizes them before draining and
destroying the workqueues on both removal and probe failure.
Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
Link: https://patch.msgid.link/20260928134054.312-1-getshell@seu.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/mt6359-accdet.c | 50 ++++++++++++++++++--------------
1 file changed, 28 insertions(+), 22 deletions(-)
diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c
index ed34cc15b80e8..daac670ab7600 100644
--- a/sound/soc/codecs/mt6359-accdet.c
+++ b/sound/soc/codecs/mt6359-accdet.c
@@ -919,6 +919,14 @@ int mt6359_accdet_enable_jack_detect(struct snd_soc_component *component,
}
EXPORT_SYMBOL_GPL(mt6359_accdet_enable_jack_detect);
+static void mt6359_accdet_destroy_workqueues(void *data)
+{
+ struct mt6359_accdet *priv = data;
+
+ destroy_workqueue(priv->jd_workqueue);
+ destroy_workqueue(priv->accdet_workqueue);
+}
+
static int mt6359_accdet_probe(struct platform_device *pdev)
{
struct mt6359_accdet *priv;
@@ -960,6 +968,26 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
}
mutex_init(&priv->res_lock);
+ priv->accdet_workqueue = create_singlethread_workqueue("accdet");
+ INIT_WORK(&priv->accdet_work, mt6359_accdet_work);
+ if (!priv->accdet_workqueue) {
+ dev_err(&pdev->dev, "Failed to create accdet workqueue\n");
+ return -ENOMEM;
+ }
+
+ priv->jd_workqueue = create_singlethread_workqueue("mt6359_accdet_jd");
+ INIT_WORK(&priv->jd_work, mt6359_accdet_jd_work);
+ if (!priv->jd_workqueue) {
+ dev_err(&pdev->dev, "Failed to create jack detect workqueue\n");
+ destroy_workqueue(priv->accdet_workqueue);
+ return -ENOMEM;
+ }
+
+ ret = devm_add_action_or_reset(&pdev->dev,
+ mt6359_accdet_destroy_workqueues, priv);
+ if (ret)
+ return ret;
+
priv->accdet_irq = platform_get_irq(pdev, 0);
if (priv->accdet_irq >= 0) {
ret = devm_request_threaded_irq(&pdev->dev, priv->accdet_irq,
@@ -1005,22 +1033,6 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
}
}
- priv->accdet_workqueue = create_singlethread_workqueue("accdet");
- INIT_WORK(&priv->accdet_work, mt6359_accdet_work);
- if (!priv->accdet_workqueue) {
- dev_err(&pdev->dev, "Failed to create accdet workqueue\n");
- ret = -1;
- goto err_accdet_wq;
- }
-
- priv->jd_workqueue = create_singlethread_workqueue("mt6359_accdet_jd");
- INIT_WORK(&priv->jd_work, mt6359_accdet_jd_work);
- if (!priv->jd_workqueue) {
- dev_err(&pdev->dev, "Failed to create jack detect workqueue\n");
- ret = -1;
- goto err_eint_wq;
- }
-
platform_set_drvdata(pdev, priv);
ret = devm_snd_soc_register_component(&pdev->dev,
&mt6359_accdet_soc_driver,
@@ -1039,12 +1051,6 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
mt6359_accdet_jack_report(priv);
return 0;
-
-err_eint_wq:
- destroy_workqueue(priv->accdet_workqueue);
-err_accdet_wq:
- dev_err(&pdev->dev, "%s error. now exit.!\n", __func__);
- return ret;
}
static struct platform_driver mt6359_accdet_driver = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0853/1756] perf/marvell: cn10k_tad: Publish the OF module alias
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (851 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0852/1756] ASoC: mt6359-accdet: manage private workqueues with devres Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0854/1756] svcrdma: Fix svc_rdma_recv_cid_init() kernel-doc Greg Kroah-Hartman
` (145 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, hpp.iscas, Will Deacon, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: hpp.iscas <hppiscas@163.com>
[ Upstream commit 848468c86f716e4552bd478d2f3c3f5d81bec7ac ]
The TAD PMU platform driver has ACPI and OF match tables, but only
the ACPI table is published. A Device Tree platform device emits an
OF modalias, so the ACPI alias does not select this module for it.
Publish the OF table inside CONFIG_OF and retain ACPI support.
Fixes: 036a7584bede ("drivers: perf: Add LLC-TAD perf counter support")
Signed-off-by: hpp.iscas <hppiscas@163.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/marvell_cn10k_tad_pmu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c
index 9e635f3554709..3e2e5e2e48a69 100644
--- a/drivers/perf/marvell_cn10k_tad_pmu.c
+++ b/drivers/perf/marvell_cn10k_tad_pmu.c
@@ -365,6 +365,7 @@ static const struct of_device_id tad_pmu_of_match[] = {
{ .compatible = "marvell,cn10k-tad-pmu", },
{},
};
+MODULE_DEVICE_TABLE(of, tad_pmu_of_match);
#endif
#ifdef CONFIG_ACPI
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0854/1756] svcrdma: Fix svc_rdma_recv_cid_init() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (852 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0853/1756] perf/marvell: cn10k_tad: Publish the OF module alias Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0855/1756] cpufreq: sparc-us2e: fix frequency table index copy-paste error Greg Kroah-Hartman
` (144 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Chuck Lever,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit d1caedce2d015573b4c26b127c488059f25aabc4 ]
svc_rdma_recv_cid_init() initializes a Receive Queue completion ID,
but its kernel-doc heading names svc_rdma_send_cid_init(). The latter is
a separate helper immediately below it, so kernel-doc cannot match this
comment to the receive helper.
Fix the copied function name.
Fixes: 28ee0ec8948a ("svcrdma: De-duplicate completion ID initialization helpers")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260909064343.90437-1-kmehltretter@gmail.com
Signed-off-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sunrpc/svc_rdma.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 65ce45d95f1c2..c7bd7ba2fd83a 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -138,7 +138,7 @@ enum {
#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
/**
- * svc_rdma_send_cid_init - Initialize a Receive Queue completion ID
+ * svc_rdma_recv_cid_init - Initialize a Receive Queue completion ID
* @rdma: controlling transport
* @cid: completion ID to initialize
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0855/1756] cpufreq: sparc-us2e: fix frequency table index copy-paste error
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (853 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0854/1756] svcrdma: Fix svc_rdma_recv_cid_init() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0856/1756] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv Greg Kroah-Hartman
` (143 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Viresh Kumar,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit e5b33fa47792375ca7fc49ccadee87d8e4b72929 ]
In us2e_freq_cpu_init(), the last two frequency writes both use
index [2] instead of [3] and [4] respectively, and the terminator
uses [3] instead of [5]. This is a copy-paste error where the index
was not incremented, causing the divider-6 and divider-8 entries to
overwrite the already-written divider-4 entry.
As a result, only three frequency steps (div 1, 2, and 4) are actually
available to the cpufreq core, while the intended dividers 6 and 8 are
silently lost. The struct us2e_freq_percpu_info::table[6] has room for
5 entries plus a terminator, matching the 5 hardware dividers.
Fix the indices so all five frequency steps are correctly populated:
table[0]=div1, table[1]=div2, table[2]=div4, table[3]=div6,
table[4]=div8, table[5]=TABLE_END.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/sparc-us2e-cpufreq.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
index 8a0cd5312a593..6d9a7d788550a 100644
--- a/drivers/cpufreq/sparc-us2e-cpufreq.c
+++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
@@ -282,12 +282,11 @@ static int us2e_freq_cpu_init(struct cpufreq_policy *policy)
table[1].frequency = clock_tick / 2;
table[2].driver_data = 2;
table[2].frequency = clock_tick / 4;
- table[2].driver_data = 3;
- table[2].frequency = clock_tick / 6;
- table[2].driver_data = 4;
- table[2].frequency = clock_tick / 8;
- table[2].driver_data = 5;
- table[3].frequency = CPUFREQ_TABLE_END;
+ table[3].driver_data = 3;
+ table[3].frequency = clock_tick / 6;
+ table[4].driver_data = 4;
+ table[4].frequency = clock_tick / 8;
+ table[5].frequency = CPUFREQ_TABLE_END;
policy->cpuinfo.transition_latency = 0;
policy->cur = clock_tick;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0856/1756] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (854 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0855/1756] cpufreq: sparc-us2e: fix frequency table index copy-paste error Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0857/1756] cpufreq: sti: avoid NULL dereference in dev_err() Greg Kroah-Hartman
` (142 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Sumit Gupta,
Viresh Kumar, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit f0a750dad7da1c653e85f0698063235453b43831 ]
ndiv is already a u64 pointer, passing &ndiv to smp_call_function_single()
results in a u64** being written to instead of the caller's u64 variable,
so the caller always reads back an uninitialized ndiv. Drop the spurious
'&'.
Fixes: 0839ed1fd7ac ("cpufreq: tegra194: add soc data to support multiple soc")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/tegra194-cpufreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c
index 07ea7ed61b687..877a3dad06fc6 100644
--- a/drivers/cpufreq/tegra194-cpufreq.c
+++ b/drivers/cpufreq/tegra194-cpufreq.c
@@ -367,7 +367,7 @@ static void tegra194_get_cpu_ndiv_sysreg(void *ndiv)
static int tegra194_get_cpu_ndiv(u32 cpu, u32 cpuid, u32 clusterid, u64 *ndiv)
{
- return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, &ndiv, true);
+ return smp_call_function_single(cpu, tegra194_get_cpu_ndiv_sysreg, ndiv, true);
}
static void tegra194_set_cpu_ndiv_sysreg(void *data)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0857/1756] cpufreq: sti: avoid NULL dereference in dev_err()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (855 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0856/1756] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0858/1756] drm/msm/dpu: round up the compressed INTF width Greg Kroah-Hartman
` (141 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Viresh Kumar,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit fdbe4cae71c8196cd7681ad47254b5b0560d3c1e ]
ddata.cpu is NULL-checked, then immediately passed to dev_err().
Replace with pr_err() to avoid dereferencing NULL.
Fixes: ab0ea257fc58 ("cpufreq: st: Provide runtime initialised driver for ST's platforms")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/sti-cpufreq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
index b15b3142b5fec..144ac0f1d85d7 100644
--- a/drivers/cpufreq/sti-cpufreq.c
+++ b/drivers/cpufreq/sti-cpufreq.c
@@ -263,7 +263,7 @@ static int __init sti_cpufreq_init(void)
ddata.cpu = get_cpu_device(0);
if (!ddata.cpu) {
- dev_err(ddata.cpu, "Failed to get device for CPU0\n");
+ pr_err("Failed to get device for CPU0\n");
goto skip_voltage_scaling;
}
@@ -281,7 +281,7 @@ static int __init sti_cpufreq_init(void)
goto register_cpufreq_dt;
skip_voltage_scaling:
- dev_err(ddata.cpu, "Not doing voltage scaling\n");
+ pr_err("Not doing voltage scaling\n");
register_cpufreq_dt:
platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0858/1756] drm/msm/dpu: round up the compressed INTF width
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (856 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0857/1756] cpufreq: sti: avoid NULL dereference in dev_err() Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0859/1756] firmware: qcom: tzmem: Use DO_ONCE_SLEEPABLE() in qcom_tzmem_enable() Greg Kroah-Hartman
` (140 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joonhoe Kim, Pengyu Luo,
Dmitry Baryshkov, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joonhoe Kim <26rote@gmail.com>
[ Upstream commit 6b93e8b453fa27a1b6a1d472f3ff8663e6811fae ]
For DSI with DSC, drm_mode_to_intf_timing_params() scales the INTF
active width by bpp / (3 * bits_per_component) and rounds down. The DSI
host computes the same width with DIV_ROUND_UP, both for the pixel clock
(dsi_adjust_pclk_for_compression()) and for the active width it programs
(dsi_timing_setup(), from bytes per line). When the division is not
exact the INTF line is one pclk shorter than the DSI line, and the DSI
FIFO overflows.
Example: a bonded DSI video-mode panel, 952 pixels per link, DSC 8 bpp at
10 bpc: 952 * 8 / 30 = 253.87, so the INTF uses 253 and the DSI 254.
Round up, as the DSI host does. Qualcomm's downstream SDE driver also
rounds this width up, and Pengyu Luo needed the same rounding on the
Legion Y700 gen 4 [1].
Tested on a Lenovo Legion Tab Y700 gen 5 (SM8850) with that panel, with a
module parameter selecting the rounding: rounding down, DPMS off/on gives
no vblank and 14000-17000 DSI FIFO error interrupts per second
(dsi_err_worker: status=4); rounding up, the picture comes back and there
are no errors. Only tested on this device.
Link: https://lore.kernel.org/all/CAH2e8h6oinKxN1ndcvHCSc+=bFLXVVDZVAVF0cQHoiaMvEwhPQ@mail.gmail.com/ [1]
Fixes: f9ce482d7dc0 ("drm/msm/dpu: fix video mode DSC for DSI")
Assisted-by: LLM
Signed-off-by: Joonhoe Kim <26rote@gmail.com>
Reviewed-by: Pengyu Luo <mitltlatltl@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757958/
Link: https://lore.kernel.org/r/20261004102758.84436-1-26rote@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index b7699ca89dcc5..cbb35636ddde0 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -133,8 +133,8 @@ static void drm_mode_to_intf_timing_params(
* TODO: replace drm_dsc_get_bpp_int with logic to handle
* fractional part if there is fraction
*/
- timing->width = timing->width * drm_dsc_get_bpp_int(dsc) /
- (dsc->bits_per_component * 3);
+ timing->width = DIV_ROUND_UP(timing->width * drm_dsc_get_bpp_int(dsc),
+ dsc->bits_per_component * 3);
timing->xres = timing->width;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0859/1756] firmware: qcom: tzmem: Use DO_ONCE_SLEEPABLE() in qcom_tzmem_enable()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (857 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0858/1756] drm/msm/dpu: round up the compressed INTF width Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0860/1756] soc: qcom: pmic_glink: simplify locking with guard() Greg Kroah-Hartman
` (139 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Szyprowski,
Bartosz Golaszewski, Mukesh Ojha, Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
[ Upstream commit 60d4a6edea9ec617725db6dd1e66d96a13bc8d0a ]
qcom_tzmem_enable() is called from qcom_scm_probe() in a sleepable process
context. The helper it wraps, qcom_tzmem_init(), calls
qcom_scm_shm_bridge_enable() -> qcom_scm_call(), which invokes
might_sleep() and later acquires the qcom_scm_lock mutex via
__scm_smc_do().
DO_ONCE() takes the once_lock spinlock with IRQs disabled, so invoking
qcom_tzmem_init() from inside DO_ONCE() runs a sleepable call chain in
atomic context. CONFIG_DEBUG_ATOMIC_SLEEP=y catches this on boot:
BUG: sleeping function called from invalid context at drivers/firmware/qcom/qcom_scm.c:334
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 49, name: kworker/u16:2
...
__might_resched+0x148/0x24c
__might_sleep+0x48/0x7c
qcom_scm_call+0x30/0xc0
__qcom_scm_is_call_available+0x98/0x100
qcom_scm_shm_bridge_enable+0x60/0xbc
qcom_tzmem_enable+0xf8/0x118
qcom_scm_probe+0x2d0/0x680
[ BUG: Invalid wait context ]
...
kworker/u16:2/49 is trying to lock:
ffffa83e8a485e38 (qcom_scm_lock){....}-{4:4}, at: __scm_smc_do+0x70/0x488
Switch to DO_ONCE_SLEEPABLE(), which guards the one-shot init with a
mutex-style path (__do_once_sleepable_start/done) that is safe to hold
across sleeping callees. All callers of qcom_tzmem_enable() are in
process context (driver probe), so this is safe.
Fixes: 9941fe8a04f3 ("firmware: qcom: scm: Fix tzmem state on probe retry")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/lkml/5ea74dd3-7471-4c7c-9242-c2005312b1ab@samsung.com/
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Link: https://patch.msgid.link/20260921195636.1925869-1-mukesh.ojha@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/qcom/qcom_tzmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/qcom/qcom_tzmem.c b/drivers/firmware/qcom/qcom_tzmem.c
index 91f1efd83d712..6f4ea4ce8d95d 100644
--- a/drivers/firmware/qcom/qcom_tzmem.c
+++ b/drivers/firmware/qcom/qcom_tzmem.c
@@ -476,7 +476,7 @@ int qcom_tzmem_enable(struct device *dev)
static int result;
qcom_tzmem_dev = dev;
- DO_ONCE(qcom_tzmem_do_init, &result);
+ DO_ONCE_SLEEPABLE(qcom_tzmem_do_init, &result);
return result;
}
EXPORT_SYMBOL_GPL(qcom_tzmem_enable);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0860/1756] soc: qcom: pmic_glink: simplify locking with guard()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (858 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0859/1756] firmware: qcom: tzmem: Use DO_ONCE_SLEEPABLE() in qcom_tzmem_enable() Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0861/1756] soc: qcom: pmic_glink: Avoid losing early rpmsg probe Greg Kroah-Hartman
` (138 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Bjorn Andersson,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[ Upstream commit e9f826b0459f1376b9c8beba019b84f9878419c6 ]
Simplify error handling over locks with guard(). In few places this
elimiates error gotos and local variables. Switch to guard() everywhere
(except when jumps would go over scoped guard) for consistency, even if
it does not bring benefit in such places.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240822164815.230167-2-krzysztof.kozlowski@linaro.org
[bjorn: Rebased ontop of v6.13-rc1]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: 0c79a829af36 ("soc: qcom: pmic_glink: Avoid losing early rpmsg probe")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/qcom/pmic_glink.c | 70 +++++++++++++++--------------------
1 file changed, 29 insertions(+), 41 deletions(-)
diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c
index 22b81b9758b59..be64a4ce8e0ca 100644
--- a/drivers/soc/qcom/pmic_glink.c
+++ b/drivers/soc/qcom/pmic_glink.c
@@ -4,6 +4,7 @@
* Copyright (c) 2022, Linaro Ltd
*/
#include <linux/auxiliary_bus.h>
+#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -100,15 +101,13 @@ void pmic_glink_client_register(struct pmic_glink_client *client)
struct pmic_glink *pg = client->pg;
unsigned long flags;
- mutex_lock(&pg->state_lock);
+ guard(mutex)(&pg->state_lock);
spin_lock_irqsave(&pg->client_lock, flags);
list_add(&client->node, &pg->clients);
client->pdr_notify(client->priv, pg->client_state);
spin_unlock_irqrestore(&pg->client_lock, flags);
- mutex_unlock(&pg->state_lock);
-
}
EXPORT_SYMBOL_GPL(pmic_glink_client_register);
@@ -119,26 +118,25 @@ int pmic_glink_send(struct pmic_glink_client *client, void *data, size_t len)
unsigned long start;
int ret;
- mutex_lock(&pg->state_lock);
+ guard(mutex)(&pg->state_lock);
if (!pg->ept) {
- ret = -ECONNRESET;
- } else {
- start = jiffies;
- for (;;) {
- ret = rpmsg_send(pg->ept, data, len);
- if (ret != -EAGAIN)
- break;
-
- if (timeout_reached) {
- ret = -ETIMEDOUT;
- break;
- }
-
- usleep_range(1000, 5000);
- timeout_reached = time_after(jiffies, start + PMIC_GLINK_SEND_TIMEOUT);
+ return -ECONNRESET;
+ }
+
+ start = jiffies;
+ for (;;) {
+ ret = rpmsg_send(pg->ept, data, len);
+ if (ret != -EAGAIN)
+ break;
+
+ if (timeout_reached) {
+ ret = -ETIMEDOUT;
+ break;
}
+
+ usleep_range(1000, 5000);
+ timeout_reached = time_after(jiffies, start + PMIC_GLINK_SEND_TIMEOUT);
}
- mutex_unlock(&pg->state_lock);
return ret;
}
@@ -232,51 +230,42 @@ static void pmic_glink_pdr_callback(int state, char *svc_path, void *priv)
{
struct pmic_glink *pg = priv;
- mutex_lock(&pg->state_lock);
+ guard(mutex)(&pg->state_lock);
pg->pdr_state = state;
pmic_glink_state_notify_clients(pg);
- mutex_unlock(&pg->state_lock);
}
static int pmic_glink_rpmsg_probe(struct rpmsg_device *rpdev)
{
struct pmic_glink *pg = __pmic_glink;
- int ret = 0;
- mutex_lock(&__pmic_glink_lock);
- if (!pg) {
- ret = dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n");
- goto out_unlock;
- }
+ guard(mutex)(&__pmic_glink_lock);
+ pg = __pmic_glink;
+ if (!pg)
+ return dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n");
dev_set_drvdata(&rpdev->dev, pg);
- mutex_lock(&pg->state_lock);
+ guard(mutex)(&pg->state_lock);
pg->ept = rpdev->ept;
pmic_glink_state_notify_clients(pg);
- mutex_unlock(&pg->state_lock);
-out_unlock:
- mutex_unlock(&__pmic_glink_lock);
- return ret;
+ return 0;
}
static void pmic_glink_rpmsg_remove(struct rpmsg_device *rpdev)
{
struct pmic_glink *pg;
- mutex_lock(&__pmic_glink_lock);
+ guard(mutex)(&__pmic_glink_lock);
pg = __pmic_glink;
if (!pg)
- goto out_unlock;
+ return;
- mutex_lock(&pg->state_lock);
+ guard(mutex)(&pg->state_lock);
pg->ept = NULL;
pmic_glink_state_notify_clients(pg);
- mutex_unlock(&pg->state_lock);
-out_unlock:
- mutex_unlock(&__pmic_glink_lock);
}
static const struct rpmsg_device_id pmic_glink_rpmsg_id_match[] = {
@@ -383,9 +372,8 @@ static void pmic_glink_remove(struct platform_device *pdev)
if (pg->client_mask & BIT(PMIC_GLINK_CLIENT_UCSI))
pmic_glink_del_aux_device(pg, &pg->ucsi_aux);
- mutex_lock(&__pmic_glink_lock);
+ guard(mutex)(&__pmic_glink_lock);
__pmic_glink = NULL;
- mutex_unlock(&__pmic_glink_lock);
}
static const unsigned long pmic_glink_sc8280xp_client_mask = BIT(PMIC_GLINK_CLIENT_BATT) |
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0861/1756] soc: qcom: pmic_glink: Avoid losing early rpmsg probe
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (859 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0860/1756] soc: qcom: pmic_glink: simplify locking with guard() Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0862/1756] soc: qcom: pmic_pdcharger_ulog: prevent work requeue during remove Greg Kroah-Hartman
` (137 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit 0c79a829af36a94143c747a0ab8f0a8563b17cfa ]
The PMIC GLINK rpmsg device can appear before the platform device has
finished probing. In that case pmic_glink_rpmsg_probe() sees
__pmic_glink as NULL and returns -ENODEV, which is treated as a fatal
probe failure for the rpmsg endpoint.
If this race is hit, pg->ept is never installed and PMIC GLINK clients
never receive the service-up notification. This may leave the system
with no Type-C functionality and without battery/power supply
management.
Return -EPROBE_DEFER when the rpmsg endpoint arrives before the platform
device is ready.
Fixes: 58ef4ece1e41 ("soc: qcom: pmic_glink: Introduce base PMIC GLINK driver")
Assisted-by: Codex:GPT-5.5
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260720-topic-pmic_glink_defer-v1-1-94c0f233f2f7@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/qcom/pmic_glink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c
index be64a4ce8e0ca..7e954db8e7ae0 100644
--- a/drivers/soc/qcom/pmic_glink.c
+++ b/drivers/soc/qcom/pmic_glink.c
@@ -243,7 +243,8 @@ static int pmic_glink_rpmsg_probe(struct rpmsg_device *rpdev)
guard(mutex)(&__pmic_glink_lock);
pg = __pmic_glink;
if (!pg)
- return dev_err_probe(&rpdev->dev, -ENODEV, "no pmic_glink device to attach to\n");
+ return dev_err_probe(&rpdev->dev, -EPROBE_DEFER,
+ "no pmic_glink device to attach to\n");
dev_set_drvdata(&rpdev->dev, pg);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0862/1756] soc: qcom: pmic_pdcharger_ulog: prevent work requeue during remove
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (860 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0861/1756] soc: qcom: pmic_glink: Avoid losing early rpmsg probe Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0863/1756] wifi: cfg80211: allow zero HE OBSS PD offsets Greg Kroah-Hartman
` (136 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yibo Tan, Konrad Dybcio, Abel Vesa,
Bjorn Andersson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yibo Tan <lhfff@tju.edu.cn>
[ Upstream commit 66894a1c51366cc2d5c498178105dfe3bcccc1e4 ]
pmic_pdcharger_ulog_rpmsg_remove() cancels the delayed worker while the
RPMsg endpoint can still deliver callbacks. The RPMsg core invokes the
driver remove callback before destroying the endpoint, so a response
callback can run after cancel_delayed_work_sync() returns and queue the
worker again.
Device cleanup then frees the devm-allocated pmic_pdcharger_ulog while the
requeued delayed work still embeds and dereferences that object. KASAN
reports a slab-use-after-free in pmic_pdcharger_ulog_work().
Use disable_delayed_work_sync() to drain the worker and reject queue
attempts that race with removal.
The issue was reproduced in four of four runs with the real target driver,
RPMsg bus removal, endpoint teardown, workqueue code and devres cleanup.
The test provider delivered a valid response in the window between the
driver remove callback and endpoint destruction. With this change, the
same late callback occurred in four of four runs without a KASAN report,
warning, Oops or panic.
The reproducer uses a test RPMsg provider to control the teardown timing.
No unprivileged trigger or physical Qualcomm-device result is claimed.
Fixes: 086fdb48bc65 ("soc: qcom: add ADSP PDCharger ULOG driver")
Assisted-by: Codex:GPT-5
Signed-off-by: Yibo Tan <lhfff@tju.edu.cn>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260912161210.1683266-1-lhfff@tju.edu.cn
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/qcom/pmic_pdcharger_ulog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/pmic_pdcharger_ulog.c b/drivers/soc/qcom/pmic_pdcharger_ulog.c
index 39f412bbf2c1e..06cd9c4411c2f 100644
--- a/drivers/soc/qcom/pmic_pdcharger_ulog.c
+++ b/drivers/soc/qcom/pmic_pdcharger_ulog.c
@@ -143,7 +143,7 @@ static void pmic_pdcharger_ulog_rpmsg_remove(struct rpmsg_device *rpdev)
{
struct pmic_pdcharger_ulog *pg = dev_get_drvdata(&rpdev->dev);
- cancel_delayed_work_sync(&pg->ulog_work);
+ disable_delayed_work_sync(&pg->ulog_work);
}
static const struct rpmsg_device_id pmic_pdcharger_ulog_rpmsg_id_match[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0863/1756] wifi: cfg80211: allow zero HE OBSS PD offsets
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (861 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0862/1756] soc: qcom: pmic_pdcharger_ulog: prevent work requeue during remove Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0864/1756] wifi: b43: dont pass unterminated string to sscanf() Greg Kroah-Hartman
` (135 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dominic White, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dominic White <github@singe.za.net>
[ Upstream commit d9ecaa0a31732014a128e3b03243de54bbbd8394 ]
IEEE Std 802.11 permits the OBSS PD offset fields in the Spatial Reuse
Parameter Set element to have a value of zero. (IEEE Std 802.11-2024,
26.10.2.4)
The standard specifies the offsets as unsigned values added to -82 dBm,
with field presence signalled independently. The valid offset range is
therefore 0..20.
nl80211 currently rejects zero for all three HE OBSS PD offset
attributes during nested netlink policy validation, before the values
reach cfg80211 or the driver. Allow zero while retaining the upper bound
and the existing minimum/maximum relationship validation.
Fixes: 796e90f42b7e ("cfg80211: add support for parsing OBBS_PD attributes")
Signed-off-by: Dominic White <github@singe.za.net>
Link: https://patch.msgid.link/20260903081804.96532-1-github@singe.za.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/wireless/nl80211.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 443ee72e58e0e..0062ce34d4efb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -365,11 +365,11 @@ nl80211_pmsr_attr_policy[NL80211_PMSR_ATTR_MAX + 1] = {
static const struct nla_policy
he_obss_pd_policy[NL80211_HE_OBSS_PD_ATTR_MAX + 1] = {
[NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET] =
- NLA_POLICY_RANGE(NLA_U8, 1, 20),
+ NLA_POLICY_RANGE(NLA_U8, 0, 20),
[NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET] =
- NLA_POLICY_RANGE(NLA_U8, 1, 20),
+ NLA_POLICY_RANGE(NLA_U8, 0, 20),
[NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET] =
- NLA_POLICY_RANGE(NLA_U8, 1, 20),
+ NLA_POLICY_RANGE(NLA_U8, 0, 20),
[NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP] =
NLA_POLICY_EXACT_LEN(8),
[NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP] =
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0864/1756] wifi: b43: dont pass unterminated string to sscanf()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (862 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0863/1756] wifi: cfg80211: allow zero HE OBSS PD offsets Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0865/1756] wifi: b43legacy: debugfs: NUL terminate string in debugfs Greg Kroah-Hartman
` (134 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <error27@gmail.com>
[ Upstream commit 9b6cb072f9249e2cdb7c32be2b8069774c7e01e6 ]
The "buf" buffer is a PAGE_SIZE and allocated with kzalloc(). We store
a string from the user in it and then pass it to sscanf() in the write
functions such as shm32write__write_file(). Only a few numbers are
stored in the buffer so it never comes close to filling up the whole
PAGE_SIZE. Reserve the last character of the page for a NUL terminator.
This is debugfs so it's root only.
Fixes: 75388acd0cd8 ("[B43LEGACY]: add mac80211-based driver for legacy BCM43xx devices")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/b396713e697c7411b23a2157e2102c347ac900bc.1790839793.git.error27@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/broadcom/b43/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/b43/debugfs.c b/drivers/net/wireless/broadcom/b43/debugfs.c
index efa98444e3fb0..3dcf830315b8f 100644
--- a/drivers/net/wireless/broadcom/b43/debugfs.c
+++ b/drivers/net/wireless/broadcom/b43/debugfs.c
@@ -561,7 +561,7 @@ static ssize_t b43_debugfs_write(struct file *file,
if (!count)
return 0;
- if (count > PAGE_SIZE)
+ if (count >= PAGE_SIZE)
return -E2BIG;
dev = file->private_data;
if (!dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0865/1756] wifi: b43legacy: debugfs: NUL terminate string in debugfs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (863 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0864/1756] wifi: b43: dont pass unterminated string to sscanf() Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0866/1756] wifi: carl9170: " Greg Kroah-Hartman
` (133 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <error27@gmail.com>
[ Upstream commit f94595252b318a9ae3c01d78b3bcd33b01b1c082 ]
The "buf" buffer is PAGE_SIZE and allocated with kzalloc(). We store a
string from the user in it and then pass it to sscanf() in the write
functions such as tsf_write_file(). The buffer is only used to store a
number so we never come close to filling up the whole PAGE_SIZE. Reserve
the last character of the page for a NUL terminator.
This is debugfs so it's root only.
Fixes: 75388acd0cd8 ("[B43LEGACY]: add mac80211-based driver for legacy BCM43xx devices")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/909ea7a88658b5e7c183bf0fda31687a91d73818.1790839793.git.error27@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/broadcom/b43legacy/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/b43legacy/debugfs.c b/drivers/net/wireless/broadcom/b43legacy/debugfs.c
index 6b0e8d1170611..86f0c4b717c66 100644
--- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c
+++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c
@@ -263,7 +263,7 @@ static ssize_t b43legacy_debugfs_write(struct file *file,
if (!count)
return 0;
- if (count > PAGE_SIZE)
+ if (count >= PAGE_SIZE)
return -E2BIG;
dev = file->private_data;
if (!dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0866/1756] wifi: carl9170: NUL terminate string in debugfs
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (864 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0865/1756] wifi: b43legacy: debugfs: NUL terminate string in debugfs Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0867/1756] Revert "wifi: mac80211: do not use old MBSSID elements" Greg Kroah-Hartman
` (132 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Christian Lamparter,
Jeff Johnson, Johannes Berg, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <error27@gmail.com>
[ Upstream commit ece30e1daf6a9c95d6f9d0518534a0b9c8c7fd42 ]
The "buf" buffer comes from the user. We use it to store a number or
two so it doesn't need to be large. It gets passed to sscanf() in the
write functions such as carl9170_debugfs_erp_write(). Ensure that
buffer is NUL terminated.
This is debugfs so it's root only.
Fixes: 00c4da27a421 ("carl9170: firmware parser and debugfs code")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Acked-by: Jeff Johnson <jjohnson@kernel.org>
Link: https://patch.msgid.link/674270ab4aeefa1982362c0ea4132427e14f15eb.1790839793.git.error27@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/carl9170/debug.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/carl9170/debug.c b/drivers/net/wireless/ath/carl9170/debug.c
index bb40889d7c720..6bbcca46358cf 100644
--- a/drivers/net/wireless/ath/carl9170/debug.c
+++ b/drivers/net/wireless/ath/carl9170/debug.c
@@ -121,7 +121,7 @@ static ssize_t carl9170_debugfs_write(struct file *file,
if (!count)
return 0;
- if (count > PAGE_SIZE)
+ if (count >= PAGE_SIZE)
return -E2BIG;
ar = file->private_data;
@@ -134,7 +134,7 @@ static ssize_t carl9170_debugfs_write(struct file *file,
if (!dfops->write)
return -ENOSYS;
- buf = vmalloc(count);
+ buf = vmalloc(count + 1);
if (!buf)
return -ENOMEM;
@@ -142,6 +142,7 @@ static ssize_t carl9170_debugfs_write(struct file *file,
err = -EFAULT;
goto out_free;
}
+ buf[count] = '\0';
if (mutex_trylock(&ar->mutex) == 0) {
err = -EAGAIN;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0867/1756] Revert "wifi: mac80211: do not use old MBSSID elements"
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (865 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0866/1756] wifi: carl9170: " Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0868/1756] dmaengine: ioat: disable relaxed ordering before registering the device Greg Kroah-Hartman
` (131 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aloka Dixit, Johannes Berg,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aloka Dixit <aloka.dixit@oss.qualcomm.com>
[ Upstream commit 56fb2334c86cef0b6d44099a6b21de4c8d80a7cb ]
Commit a519be2f5d95 ("wifi: mac80211: do not use old MBSSID
elements") fixed the incorrect inclusion of stopped/removed
non-transmitted profiles from the Beacon frames, but it caused
a regression for channel switch (CSA) and BSS color change (CCA)
operations initiated from hostapd.
Hostapd passes two Beacon templates to kernel for CSA and CCA -
(1) beacon_csa/beacon_color_change used during the countdown.
(2) beacon_after/beacon_next used after the countdown completes.
Hostapd relies on the kernel to include the old MBSSID elements
while sending beacon_csa/beacon_color_change templates to the
driver.
This path is now broken and results in CSA/CCA failure.
Including existing MBSSID elements explicitly makes the netlink
buffer larger than default 4 KB depending on the number of APs
which would need unnecessary complication to pre-calculate the
buffer length.
Revert the commit to fix the regression.
Regarding the original issue fixed by the reverted commit -
Hostapd now has a new commit which always includes at least one
MBSSID element when the feature is enabled, hence when all
non-transmitted profiles are removed, this empty element ensures
that stopped profiles are not advertised.
Fixes: a519be2f5d95 ("wifi: mac80211: do not use old MBSSID elements")
Signed-off-by: Aloka Dixit <aloka.dixit@oss.qualcomm.com>
Link: https://patch.msgid.link/20261002-csa_cca_fix-v1-1-b83a998aeb44@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/cfg.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5b65788f2f82f..1e47db63b5289 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1165,6 +1165,7 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
size = sizeof(*new) + new_head_len + new_tail_len;
+ /* new or old multiple BSSID elements? */
if (params->mbssid_ies) {
mbssid = params->mbssid_ies;
size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
@@ -1174,6 +1175,15 @@ ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
}
size += ieee80211_get_mbssid_beacon_len(mbssid, rnr,
mbssid->cnt);
+ } else if (old && old->mbssid_ies) {
+ mbssid = old->mbssid_ies;
+ size += struct_size(new->mbssid_ies, elem, mbssid->cnt);
+ if (old && old->rnr_ies) {
+ rnr = old->rnr_ies;
+ size += struct_size(new->rnr_ies, elem, rnr->cnt);
+ }
+ size += ieee80211_get_mbssid_beacon_len(mbssid, rnr,
+ mbssid->cnt);
}
new = kzalloc(size, GFP_KERNEL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0868/1756] dmaengine: ioat: disable relaxed ordering before registering the device
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (866 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0867/1756] Revert "wifi: mac80211: do not use old MBSSID elements" Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0869/1756] dmaengine: plx_dma: fix NULL pointer deref in plx_dma_isr() Greg Kroah-Hartman
` (130 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Dave Jiang, Frank Li,
Logan Gunthorpe, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Logan Gunthorpe <logang@deltatee.com>
[ Upstream commit 10d34fbca6e09a6a18d64fa3ebaa3db9f27fc1a6 ]
ioat3_dma_probe() disabled PCIe relaxed ordering after calling
dma_async_device_register(), so if an error occurs and the code jumps
to err_disable_interrupts, the function returns with the device still
registered in the core's dma_device_list while the caller frees the
ioatdma_device struct, leaving a dangling registration that anything
walking the device list can dereference after it's been freed.
Move the capability read/write ahead of dma_async_device_register()
instead. Nothing after registration depends on relaxed ordering
already being disabled, and nothing before it depends on the device
being registered, so this is a plain reordering. It also means every
remaining step after registration can't fail, so there's no need to
ever have to unregister the device once registered.
Fixes: 511deae0261c ("dmaengine: ioatdma: disable relaxed ordering for ioatdma")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/dmaengine/20260707165906.249F41F000E9@smtp.kernel.org
Acked-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://lore.kernel.org/dmaengine/20260707165906.249F41F000E9@smtp.kernel.org/T/#u
Link: https://patch.msgid.link/20260902062153.31048-9-logang@deltatee.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ioat/init.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index cc9ddd6c325ba..6b2a14ade781c 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -1170,15 +1170,6 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
ioat_chan->reg_base + IOAT_DCACTRL_OFFSET);
}
- err = dma_async_device_register(&ioat_dma->dma_dev);
- if (err)
- goto err_disable_interrupts;
-
- ioat_kobject_add(ioat_dma, &ioat_ktype);
-
- if (dca)
- ioat_dma->dca = ioat_dca_init(pdev, ioat_dma->reg_base);
-
/* disable relaxed ordering */
err = pcie_capability_read_word(pdev, PCI_EXP_DEVCTL, &val16);
if (err) {
@@ -1194,6 +1185,15 @@ static int ioat3_dma_probe(struct ioatdma_device *ioat_dma, int dca)
goto err_disable_interrupts;
}
+ err = dma_async_device_register(&ioat_dma->dma_dev);
+ if (err)
+ goto err_disable_interrupts;
+
+ ioat_kobject_add(ioat_dma, &ioat_ktype);
+
+ if (dca)
+ ioat_dma->dca = ioat_dca_init(pdev, ioat_dma->reg_base);
+
if (ioat_dma->cap & IOAT_CAP_DPS)
writeb(ioat_pending_level + 1,
ioat_dma->reg_base + IOAT_PREFETCH_LIMIT_OFFSET);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0869/1756] dmaengine: plx_dma: fix NULL pointer deref in plx_dma_isr()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (867 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0868/1756] dmaengine: ioat: disable relaxed ordering before registering the device Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0870/1756] SUNRPC: reject a client-side TLS alert record that is not two octets Greg Kroah-Hartman
` (129 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sangyun Kim, Kyungwook Boo, Frank Li,
Logan Gunthorpe, Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Logan Gunthorpe <logang@deltatee.com>
[ Upstream commit f3017892457d8bb664ea4b912910dc254e2dd825 ]
plx_dma_create() registered the interrupt handler with request_irq()
before initializing plxdev->bar. If the device raised an interrupt in
that window, plx_dma_isr() would dereference the still-NULL bar.
Move the bar assignment ahead of request_irq() so everything the
handler can touch is initialized before it can run.
Reported-by: Sangyun Kim <sangyun.kim@snu.ac.kr>
Reported-by: Kyungwook Boo <bookyungwook@gmail.com>
Link: https://lore.kernel.org/all/20260610112121.676561-1-jjy600901@snu.ac.kr
Fixes: c2dbcaa8c672 ("dmaengine: plx-dma: Implement hardware initialization and cleanup")
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Link: https://lore.kernel.org/all/20260610112121.676561-1-jjy600901@snu.ac.kr/T/#u
Link: https://patch.msgid.link/20260902062153.31048-11-logang@deltatee.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/plx_dma.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/plx_dma.c b/drivers/dma/plx_dma.c
index 34b6416c3287e..5e98a8509aa46 100644
--- a/drivers/dma/plx_dma.c
+++ b/drivers/dma/plx_dma.c
@@ -505,17 +505,17 @@ static int plx_dma_create(struct pci_dev *pdev)
if (!plxdev)
return -ENOMEM;
- rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0,
- KBUILD_MODNAME, plxdev);
- if (rc)
- goto free_plx;
-
spin_lock_init(&plxdev->ring_lock);
tasklet_setup(&plxdev->desc_task, plx_dma_desc_task);
RCU_INIT_POINTER(plxdev->pdev, pdev);
plxdev->bar = pcim_iomap_table(pdev)[0];
+ rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0,
+ KBUILD_MODNAME, plxdev);
+ if (rc)
+ goto free_plx;
+
dma = &plxdev->dma_dev;
INIT_LIST_HEAD(&dma->channels);
dma_cap_set(DMA_MEMCPY, dma->cap_mask);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0870/1756] SUNRPC: reject a client-side TLS alert record that is not two octets
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (868 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0869/1756] dmaengine: plx_dma: fix NULL pointer deref in plx_dma_isr() Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0871/1756] SUNRPC: treat every client-side TLS error alert as fatal Greg Kroah-Hartman
` (128 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Anna Schumaker,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit 1e87497aac8d2d4aee9b288ba43f58d1690b9a89 ]
tls_alert_recv() reads two octets from the kvec it is handed and does
not check the length (net/handshake/alert.c). xs_sock_process_cmsg()
calls it for any alert record, and the alert[] buffer that
xs_sock_recv_cmsg() supplies carries no initializer. A one-octet alert
body leaves the description read from uninitialized stack and reported
through trace_tls_alert_recv().
The peer controls that length. Neither tls_rx_msg_size() nor
tls_rx_one_record() enforces the two-octet Alert payload. A TLS 1.3
record carrying only the inner content-type octet decrypts to a
zero-length payload. RFC 8446 Section 5.1 requires a record with an
Alert type to carry exactly one message, so any other length is
malformed. RFC 9289 Section 5 bars RPC-with-TLS from negotiating a
version below TLS 1.3, so no other alert framing applies.
Require exactly two octets before parsing and return -EACCES
otherwise. xs_stream_data_receive() already treats -EACCES as a fatal
alert and reports it to the pending tasks. Gate the path on a control
message rather than a positive count so that a zero-length record
reaches the check.
Fixes: cc5d59081fa2 ("sunrpc: fix client side handling of tls alerts")
Signed-off-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/xprtsock.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index b021c9b8477c1..ec7b29780eb94 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -407,9 +407,25 @@ xs_sock_recv_cmsg(struct socket *sock, unsigned int *msg_flags, int flags)
iov_iter_kvec(&msg.msg_iter, ITER_DEST, &alert_kvec, 1,
alert_kvec.iov_len);
ret = sock_recvmsg(sock, &msg, flags);
- if (ret > 0) {
- if (tls_get_record_type(sock->sk, &u.cmsg) == TLS_RECORD_TYPE_ALERT)
+ /* put_cmsg() shrinks msg_controllen, so a short one means
+ * kTLS filled in u.cmsg.
+ */
+ if (ret >= 0 && msg.msg_controllen < sizeof(u)) {
+ if (tls_get_record_type(sock->sk, &u.cmsg) ==
+ TLS_RECORD_TYPE_ALERT) {
+ /* RFC 8446 Section 5.1 requires a record with an
+ * Alert type to carry exactly one message. An alert
+ * is two octets. tls_alert_recv() reads both without
+ * checking the length. alert_kvec caps the count at
+ * two, so a longer record fills it as well. kTLS
+ * sets MSG_EOR only once the record has been
+ * drained.
+ */
+ if (ret != sizeof(alert) ||
+ !(msg.msg_flags & MSG_EOR))
+ return -EACCES;
iov_iter_revert(&msg.msg_iter, ret);
+ }
ret = xs_sock_process_cmsg(sock, &msg, msg_flags, &u.cmsg,
-EAGAIN);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0871/1756] SUNRPC: treat every client-side TLS error alert as fatal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (869 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0870/1756] SUNRPC: reject a client-side TLS alert record that is not two octets Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0872/1756] NFS: filelayout: calculate dense stripe width in 64 bits Greg Kroah-Hartman
` (127 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Anna Schumaker,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <cel@kernel.org>
[ Upstream commit 9b7b1f89b93a3ec1ed121e1ab28450acde815bff ]
xs_sock_process_cmsg() decides whether an alert ends the session by
reading the alert's level octet. RFC 8446 Section 6 retired that
field. The severity is implicit in the description, and a receiver
treats every alert listed in Section 6.2 as an error alert
"regardless of the AlertLevel in the message". A peer that aborts
with unexpected_message but leaves the legacy octet set to warning
makes the client return -EAGAIN. xs_stream_data_receive() wakes no
pending task for that error, so RPC Calls queued on a dead TLS
session wait for their timeouts to expire.
Decide from the alert description instead. close_notify and
user_canceled are the closure alerts (RFC 8446 Section 6.1). Every
other description ends the session, including one this kernel does
not recognize.
Fixes: 39067dda1d86 ("SUNRPC: Use new helpers to handle TLS Alerts")
Signed-off-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sunrpc/xprtsock.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index ec7b29780eb94..a1f4fd26029e5 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -375,8 +375,18 @@ xs_sock_process_cmsg(struct socket *sock, struct msghdr *msg,
break;
case TLS_RECORD_TYPE_ALERT:
tls_alert_recv(sock->sk, msg, &level, &description);
- ret = (level == TLS_ALERT_LEVEL_FATAL) ?
- -EACCES : -EAGAIN;
+ /* RFC 8446 Section 6: every alert but a closure alert is
+ * an error alert, whatever the legacy AlertLevel octet
+ * says.
+ */
+ switch (description) {
+ case TLS_ALERT_DESC_CLOSE_NOTIFY:
+ case TLS_ALERT_DESC_USER_CANCELED:
+ ret = -EAGAIN;
+ break;
+ default:
+ ret = -EACCES;
+ }
break;
default:
/* discard this record type */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0872/1756] NFS: filelayout: calculate dense stripe width in 64 bits
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (870 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0871/1756] SUNRPC: treat every client-side TLS error alert as fatal Greg Kroah-Hartman
@ 2026-11-18 14:49 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0873/1756] floppy: flush pending work before releasing resources on init failure Greg Kroah-Hartman
` (126 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:49 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean,
Anna Schumaker, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
[ Upstream commit 9ba13ef0e3ad033d3ddbaeb740b12d135a88363d ]
filelayout_get_dense_offset() calculates the stripe width from the
stripe unit and count, where both values are provided by the server.
Their product is stored on 32 bits, and can wrap to zero despite
passing individual checks. For example, a 1 GiB stripe unit (0x40000000)
and four stripes (4) cause the following div_u64() to raise a divide
error during the first read through the dense layout.
Update u32 to u64 and use div64_u64() instead of div_u64().
stripe_unit is a u32 and stripe_count is limited to 4096, so the
product cannot overflow a u64.
Fixes: cfe7f4120f8b ("NFSv4.1: filelayout i/o helpers")
Assisted-by: Codex:gpt-5
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/filelayout/filelayout.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index e1eff85b2ded5..caa5eaca24ebc 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -55,12 +55,13 @@ static loff_t
filelayout_get_dense_offset(struct nfs4_filelayout_segment *flseg,
loff_t offset)
{
- u32 stripe_width = flseg->stripe_unit * flseg->dsaddr->stripe_count;
+ u64 stripe_width = (u64)flseg->stripe_unit *
+ flseg->dsaddr->stripe_count;
u64 stripe_no;
u32 rem;
offset -= flseg->pattern_offset;
- stripe_no = div_u64(offset, stripe_width);
+ stripe_no = div64_u64(offset, stripe_width);
div_u64_rem(offset, flseg->stripe_unit, &rem);
return stripe_no * flseg->stripe_unit + rem;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0873/1756] floppy: flush pending work before releasing resources on init failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (871 preceding siblings ...)
2026-11-18 14:49 ` [PATCH 6.12 0872/1756] NFS: filelayout: calculate dense stripe width in 64 bits Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0874/1756] floppy: avoid NULL deref in reset_interrupt when cont is cleared Greg Kroah-Hartman
` (125 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter,
Denis Efremov (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 74c2e2eeb7e51cdeb5e3eceaf324cfcf8dcd0d32 ]
do_floppy_init() probes each FDC with user_reset_fdc(), which queues a
redo_fd_request() work item on floppy_wq that may still be pending when
the probe finishes. When no controller is found, the error path calls
floppy_release_irq_and_dma() to free the IRQ and DMA channel, and only
later destroys the workqueue. destroy_workqueue() drains the queued work
last, so it can run after the IRQ and DMA are already gone:
floppy0: no floppy controllers found
work still pending
The flush used to be here. Commit 070ad7e793dc ("floppy: convert to
delayed work and single-thread wq") renamed the label out_flush_work to
out_release_dma and dropped it. Restore it so the work drains before the
IRQ and DMA are released, as floppy_module_exit() already does.
Fixes: 070ad7e793dc ("floppy: convert to delayed work and single-thread wq")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260722034435.13432-1-kmehltretter@gmail.com
Signed-off-by: Denis Efremov (Oracle) <efremov@linux.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/floppy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index f1dc62565ea5f..95fa91a5f7f89 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4751,6 +4751,8 @@ static int __init do_floppy_init(void)
}
}
out_release_dma:
+ /* Drain the queued redo_fd_request() before releasing IRQ and DMA. */
+ flush_workqueue(floppy_wq);
if (atomic_read(&usage_count))
floppy_release_irq_and_dma();
out_unreg_driver:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0874/1756] floppy: avoid NULL deref in reset_interrupt when cont is cleared
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (872 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0873/1756] floppy: flush pending work before releasing resources on init failure Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0875/1756] floppy: unregister platform device on add_disk failure Greg Kroah-Hartman
` (124 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+619e27617b2abe6b9b72,
Yang Xiuwei, Denis Efremov (Oracle), Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yang Xiuwei <yangxiuwei@kylinos.cn>
[ Upstream commit 7c82781039c03a3e47b70d3259f336adbb9d2692 ]
reset_fdc() arms do_floppy = reset_interrupt; the IRQ handler then
queues that function via schedule_bh(). If unlock_fdc() or do_wakeup()
clears cont before the work runs, reset_interrupt() dereferences a NULL
cont and oopses.
Example crash excerpt:
[ 1070.468148] status=80
[ 1070.468152] fdc_busy=1
[ 1070.468158] cont= (null)
[ 1070.468161] current_req= (null)
[ 1070.468162] command_status=-1
[ 1070.468163]
[ 1070.557051] floppy0: floppy timeout called
[ 1070.557053] no cont in shutdown!
[ 1070.557056] floppy0: floppy_shutdown: timeout handler died.
[ 1074.419509] floppy0: FDC access conflict!
[ 1074.419782] BUG: unable to handle kernel NULL pointer dereference at
0000000000000008
[ 1074.421969] PGD 0 P4D 0
[ 1074.422320] Oops: 0000 [#1] SMP NOPTI
[ 1074.422648] CPU: 10 PID: 3269 Comm: kworker/u256:4 Kdump: loaded
[ 1074.423830] Hardware name: inspur Standard PC (i440FX + PIIX, 1996),
BIOS 0.0.0 02/06/2015
[ 1074.424284] Workqueue: floppy floppy_work_workfn [floppy]
[ 1074.424757] RIP: 0010:reset_interrupt+0x3a/0xa0 [floppy]
The same NULL deref has also been reported by syzbot on upstream.
Return early if cont is already NULL after result(). The hardware reset
has completed; result() still drains the FDC. A later request can lock
the FDC and reset again. This is a defensive fix for stale work, not a
rewrite of the floppy continuation state machine.
Reported-by: syzbot+619e27617b2abe6b9b72@syzkaller.appspotmail.com
Link: https://lore.kernel.org/linux-block/00000000000093c4d105f9aa34d6@google.com/
Link: https://lists.openwall.net/linux-kernel/2021/10/27/56
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Link: https://patch.msgid.link/20260723073512.11120-1-yangxiuwei@kylinos.cn
Signed-off-by: Denis Efremov (Oracle) <efremov@linux.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/floppy.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 95fa91a5f7f89..c38082f192a1f 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -1788,6 +1788,9 @@ static void reset_interrupt(void)
{
debugt(__func__, "");
result(current_fdc); /* get the status ready for set_fdc */
+ /* Stale work: unlock_fdc()/do_wakeup() may have cleared cont. */
+ if (!cont)
+ return;
if (fdc_state[current_fdc].reset) {
pr_info("reset set in interrupt, calling %ps\n", cont->error);
cont->error(); /* a reset just after a reset. BAD! */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0875/1756] floppy: unregister platform device on add_disk failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (873 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0874/1756] floppy: avoid NULL deref in reset_interrupt when cont is cleared Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0876/1756] wifi: ath12k: Reserve space for a string terminator Greg Kroah-Hartman
` (123 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Denis Efremov (Oracle),
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit f1e72d80ad4ac5ff3573796d07bd1a1e74909f94 ]
The change referenced by the Fixes tag reverted a previous fix because
that fix added incorrect cleanup for the platform_device_register()
failure path.
However, reverting the whole change also removed the cleanup for a later
failure path. If platform_device_register() succeeds but device_add_disk()
fails, the current floppy platform device has already been registered and
registered[drive] has been set.
The common out_remove_drives path uses while (drive--), so it starts from
the previous drive and does not unregister the current one. As a result,
the platform device registered for the failing drive is leaked.
Unregister the current platform device directly on the device_add_disk()
failure path, where platform_device_register() is known to have
succeeded. Leave the platform_device_register() failure path unchanged.
Fixes: 895a9b37917d ("Revert "floppy: fix reference leak on platform_device_register() failure"")
Fixes: 47d34aa2d211 ("floppy: add error handling support for add_disk()")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Link: https://patch.msgid.link/20260708105703.747262-1-lgs201920130244@gmail.com
Signed-off-by: Denis Efremov (Oracle) <efremov@linux.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/floppy.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index c38082f192a1f..4ca47544dbbcb 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4739,8 +4739,11 @@ static int __init do_floppy_init(void)
err = device_add_disk(&floppy_device[drive].dev,
disks[drive][0], NULL);
- if (err)
+ if (err) {
+ platform_device_unregister(&floppy_device[drive]);
+ registered[drive] = false;
goto out_remove_drives;
+ }
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0876/1756] wifi: ath12k: Reserve space for a string terminator
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (874 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0875/1756] floppy: unregister platform device on add_disk failure Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0877/1756] drm/msm/a6xx: fix use-after-free of OPP in a6xx_pm_resume Greg Kroah-Hartman
` (122 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Rameshkumar Sundaram,
Baochen Qiang, Jiale Yao, Jeff Johnson, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 13b15eabe2c541b80406166964cdc8ccb5e9c32a ]
ath12k_write_htt_stats_type() accepts count == size, which fills the
zero-initialized buffer without a terminating NUL. sscanf() then reads
beyond the buffer.
Reject input that leaves no room for the trailing NUL.
Fixes: 8c7a5031a6b0 ("wifi: ath12k: Fix buffer overflow in debugfs")
Reviewed-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20261003095913.575108-1-yaojiale02@163.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
index 6f2e7ecc66af7..df95a4ebace84 100644
--- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
+++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
@@ -1646,7 +1646,7 @@ static ssize_t ath12k_write_htt_stats_type(struct file *file,
const int size = 32;
int num_args;
- if (count > size)
+ if (count >= size)
return -EINVAL;
char *buf __free(kfree) = kzalloc(size, GFP_KERNEL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0877/1756] drm/msm/a6xx: fix use-after-free of OPP in a6xx_pm_resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (875 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0876/1756] wifi: ath12k: Reserve space for a string terminator Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0878/1756] dmaengine: ste_dma40: Fix physical cyclic capability Greg Kroah-Hartman
` (121 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roman Demidov, Dmitry Baryshkov,
Konrad Dybcio, Rob Clark, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roman Demidov <roman.demidov.nn@gmail.com>
[ Upstream commit 8128ae7af6b4dc95e486c5c0a80839a069df578e ]
The OPP reference obtained via dev_pm_opp_find_freq_ceil() is dropped
with dev_pm_opp_put() before being passed to dev_pm_opp_set_opp(). If
the reference count reaches zero, the OPP object may be freed, leading
to a use-after-free when dev_pm_opp_set_opp() dereferences it.
Fix the order of calls: first use the OPP to set the required
performance state, then release the reference.
Fixes: 5a903a44a984 ("drm/msm/a6xx: Introduce GMU wrapper support")
Signed-off-by: Roman Demidov <roman.demidov.nn@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/757104/
Message-ID: <20260929142103.81854-1-roman.demidov.nn@gmail.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 4bae3813d90b5..4dc095f74c32b 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1879,10 +1879,10 @@ static int a6xx_pm_resume(struct msm_gpu *gpu)
ret = PTR_ERR(opp);
goto err_set_opp;
}
- dev_pm_opp_put(opp);
/* Set the core clock and bus bw, having VDD scaling in mind */
dev_pm_opp_set_opp(&gpu->pdev->dev, opp);
+ dev_pm_opp_put(opp);
pm_runtime_resume_and_get(gmu->dev);
pm_runtime_resume_and_get(gmu->gxpd);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0878/1756] dmaengine: ste_dma40: Fix physical cyclic capability
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (876 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0877/1756] drm/msm/a6xx: fix use-after-free of OPP in a6xx_pm_resume Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0879/1756] dmaengine: ste_dma40: Fix failed start cleanup Greg Kroah-Hartman
` (120 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Linus Walleij, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 11101a8e3e42273a5910a149f6324040b88f4747 ]
d40_dmaengine_init() configures dma_both for physical channels that can
handle both slave and memcpy transfers. Physical DMA40 channel setup has
supported cyclic LLIs since cyclic transfer support was added, but the
DMA_CYCLIC capability is set on dma_slave a second time instead of
dma_both.
Set DMA_CYCLIC on dma_both so d40_ops_init() installs
device_prep_dma_cyclic and physical channels advertise cyclic support.
Fixes: 0c842b551063 ("dma40: cyclic xfer support")
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-1-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index d52e1685aed53..28b34a279cef3 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2907,7 +2907,7 @@ static int __init d40_dmaengine_init(struct d40_base *base,
dma_cap_zero(base->dma_both.cap_mask);
dma_cap_set(DMA_SLAVE, base->dma_both.cap_mask);
dma_cap_set(DMA_MEMCPY, base->dma_both.cap_mask);
- dma_cap_set(DMA_CYCLIC, base->dma_slave.cap_mask);
+ dma_cap_set(DMA_CYCLIC, base->dma_both.cap_mask);
d40_ops_init(base, &base->dma_both);
err = dmaenginem_async_device_register(&base->dma_both);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0879/1756] dmaengine: ste_dma40: Fix failed start cleanup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (877 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0878/1756] dmaengine: ste_dma40: Fix physical cyclic capability Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0880/1756] dmaengine: ste_dma40: Fix probe runtime PM disable Greg Kroah-Hartman
` (119 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 8175ead5727173d4b96d1e830e696765d75ade71 ]
If d40_start() fails after a queued descriptor has been moved to the
active list, d40_queue_start() currently returns NULL without unwinding
the transfer state or clearing the channel busy flag.
Fix this pre-existing error path by completing the descriptor through the
normal tasklet path, clearing the busy flag, balancing the runtime PM
reference and returning an error pointer to distinguish the failure from
the no-work case. Do not free the descriptor directly, since it has
already been submitted and has a DMA cookie.
When starting the next queued transfer from the completion handler, put
the completed descriptor on the done list first. This preserves FIFO
completion order if the new transfer fails to start and prevents the
completed cookie from moving backwards.
Use done-list membership rather than the cyclic flag to identify terminal
descriptors in the tasklet. A cyclic descriptor that failed to start is
then completed and removed instead of remaining permanently at the head
of the done list.
Fixes: 7d83a854a1a4 ("dma40: remove "hardware link with previous jobs" code")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Assisted-by: LLM
Link: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-4-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 28b34a279cef3..2f636c7333d24 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1533,8 +1533,15 @@ static struct d40_desc *d40_queue_start(struct d40_chan *d40c)
/* Start dma job */
err = d40_start(d40c);
- if (err)
- return NULL;
+ if (err) {
+ d40_desc_remove(d40d);
+ d40_desc_done(d40c, d40d);
+ d40c->pending_tx++;
+ d40c->busy = false;
+ pm_runtime_put_autosuspend(d40c->base->dev);
+ tasklet_schedule(&d40c->tasklet);
+ return ERR_PTR(err);
+ }
}
return d40d;
@@ -1578,15 +1585,15 @@ static void dma_tc_handle(struct d40_chan *d40c)
return;
}
+ d40_desc_remove(d40d);
+ d40_desc_done(d40c, d40d);
+
if (d40_queue_start(d40c) == NULL) {
d40c->busy = false;
pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
}
-
- d40_desc_remove(d40d);
- d40_desc_done(d40c, d40d);
}
d40c->pending_tx++;
@@ -1600,20 +1607,22 @@ static void dma_tasklet(struct tasklet_struct *t)
struct d40_desc *d40d;
unsigned long flags;
bool callback_active;
+ bool from_done;
struct dmaengine_desc_callback cb;
spin_lock_irqsave(&d40c->lock, flags);
/* Get first entry from the done list */
d40d = d40_first_done(d40c);
- if (d40d == NULL) {
+ from_done = !!d40d;
+ if (!from_done) {
/* Check if we have reached here for cyclic job */
d40d = d40_first_active_get(d40c);
if (d40d == NULL || !d40d->cyclic)
goto check_pending_tx;
}
- if (!d40d->cyclic)
+ if (from_done)
dma_cookie_complete(&d40d->txd);
/*
@@ -1629,7 +1638,7 @@ static void dma_tasklet(struct tasklet_struct *t)
callback_active = !!(d40d->txd.flags & DMA_PREP_INTERRUPT);
dmaengine_desc_get_callback(&d40d->txd, &cb);
- if (!d40d->cyclic) {
+ if (from_done) {
if (async_tx_test_ack(&d40d->txd)) {
d40_desc_remove(d40d);
d40_desc_free(d40c, d40d);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0880/1756] dmaengine: ste_dma40: Fix probe runtime PM disable
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (878 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0879/1756] dmaengine: ste_dma40: Fix failed start cleanup Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0881/1756] dmaengine: ste_dma40: Check runtime PM in IRQ Greg Kroah-Hartman
` (118 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit c6809b381e34f8966cc3d9e5d7d658775a408f83 ]
Some d40_probe() error paths jump to destroy_cache before runtime PM has
been enabled for the DMA controller device. The label unconditionally calls
pm_runtime_disable(), which increments disable_depth even though this probe
attempt never enabled runtime PM.
Use devm_pm_runtime_set_active_enabled() to mark the controller active,
enable runtime PM and register balanced cleanup for probe failure. This
avoids both the disable-depth imbalance and ad-hoc probe state tracking.
The interrupt handler uses pm_runtime_get_if_active() and cannot
acknowledge a pending interrupt while runtime PM is disabled. Request the
IRQ only after enabling runtime PM so the handler cannot enter an
unacknowledged interrupt loop during probe.
Fixes: 0618c077a8c2 ("dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-5-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 2f636c7333d24..08d1c2197ded5 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3602,12 +3602,6 @@ static int __init d40_probe(struct platform_device *pdev)
goto destroy_cache;
}
- ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base);
- if (ret) {
- d40_err(dev, "No IRQ defined\n");
- goto destroy_cache;
- }
-
if (base->plat_data->use_esram_lcla) {
base->lcpa_regulator = regulator_get(base->dev, "lcla_esram");
@@ -3632,10 +3626,20 @@ static int __init d40_probe(struct platform_device *pdev)
pm_runtime_irq_safe(base->dev);
pm_runtime_set_autosuspend_delay(base->dev, DMA40_AUTOSUSPEND_DELAY);
- pm_runtime_use_autosuspend(base->dev);
pm_runtime_mark_last_busy(base->dev);
- pm_runtime_set_active(base->dev);
- pm_runtime_enable(base->dev);
+
+ ret = devm_pm_runtime_set_active_enabled(base->dev);
+ if (ret) {
+ d40_err(dev, "Failed to enable runtime PM: %d\n", ret);
+ goto destroy_cache;
+ }
+ pm_runtime_use_autosuspend(base->dev);
+
+ ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base);
+ if (ret) {
+ d40_err(dev, "No IRQ defined\n");
+ goto destroy_cache;
+ }
ret = d40_dmaengine_init(base, num_reserved_chans);
if (ret)
@@ -3671,7 +3675,6 @@ static int __init d40_probe(struct platform_device *pdev)
regulator_disable(base->lcpa_regulator);
regulator_put(base->lcpa_regulator);
}
- pm_runtime_disable(base->dev);
report_failure:
d40_err(dev, "probe failed\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0881/1756] dmaengine: ste_dma40: Check runtime PM in IRQ
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (879 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0880/1756] dmaengine: ste_dma40: Fix probe runtime PM disable Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0882/1756] dmaengine: ste_dma40: Remove redundant pm_runtime_mark_last_busy() calls Greg Kroah-Hartman
` (117 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 12787e3f2f93f3af59769b08ee4fcb044531120b ]
d40_handle_interrupt() reads DMA40 interrupt registers unconditionally. A
spurious interrupt can arrive while the device is runtime suspended, after
dma40_runtime_suspend() has disabled the GCC clock.
Avoid touching the registers unless the device is runtime active by taking
a conditional runtime PM reference. Return IRQ_NONE when the device is
suspended, and drop the reference after handling an active interrupt.
When CONFIG_PM is disabled, pm_runtime_get_if_active() returns -EINVAL even
though the registers remain accessible. Keep handling interrupts in that
configuration and only drop the runtime PM reference when one was acquired.
Fixes: 7fb3e75e1833 ("dmaengine/ste_dma40: support pm in dma40")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225114.AE1511F000E9@smtp.kernel.org/
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-6-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 08d1c2197ded5..df373c5b6b9f2 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1679,6 +1679,11 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
u32 *regs = base->regs_interrupt;
struct d40_interrupt_lookup *il = base->gen_dmac.il;
u32 il_size = base->gen_dmac.il_size;
+ int ret;
+
+ ret = pm_runtime_get_if_active(base->dev);
+ if (IS_ENABLED(CONFIG_PM) && ret <= 0)
+ return IRQ_NONE;
spin_lock(&base->interrupt_lock);
@@ -1727,6 +1732,9 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
spin_unlock(&base->interrupt_lock);
+ if (ret > 0)
+ pm_runtime_put_autosuspend(base->dev);
+
return IRQ_HANDLED;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0882/1756] dmaengine: ste_dma40: Remove redundant pm_runtime_mark_last_busy() calls
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (880 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0881/1756] dmaengine: ste_dma40: Check runtime PM in IRQ Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0883/1756] dmaengine: ste_dma40: Handle runtime PM resume errors Greg Kroah-Hartman
` (116 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sakari Ailus, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <sakari.ailus@linux.intel.com>
[ Upstream commit 01f2bcf06d7e0e3c4badd03c030cf634ca10a172 ]
pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patch.msgid.link/20251027133232.392898-4-sakari.ailus@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: 55a35231b8ce ("dmaengine: ste_dma40: Handle runtime PM resume errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index df373c5b6b9f2..f196bfe416001 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1452,7 +1452,6 @@ static int d40_pause(struct dma_chan *chan)
res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
- pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
return res;
@@ -1479,7 +1478,6 @@ static int d40_resume(struct dma_chan *chan)
if (d40_residue(d40c) || d40_tx_is_linked(d40c))
res = d40_channel_execute_command(d40c, D40_DMA_RUN);
- pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
return res;
@@ -1591,7 +1589,6 @@ static void dma_tc_handle(struct d40_chan *d40c)
if (d40_queue_start(d40c) == NULL) {
d40c->busy = false;
- pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
}
}
@@ -2071,16 +2068,13 @@ static int d40_free_dma(struct d40_chan *d40c)
else
d40c->base->lookup_phy_chans[phy->num] = NULL;
- if (d40c->busy) {
- pm_runtime_mark_last_busy(d40c->base->dev);
+ if (d40c->busy)
pm_runtime_put_autosuspend(d40c->base->dev);
- }
d40c->busy = false;
d40c->phy_chan = NULL;
d40c->configured = false;
mark_last_busy:
- pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
return res;
}
@@ -2483,7 +2477,6 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
if (is_free_phy)
d40_config_write(d40c);
mark_last_busy:
- pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
return err;
@@ -2635,12 +2628,9 @@ static int d40_terminate_all(struct dma_chan *chan)
chan_err(d40c, "Failed to stop channel\n");
d40_term_all(d40c);
- pm_runtime_mark_last_busy(d40c->base->dev);
pm_runtime_put_autosuspend(d40c->base->dev);
- if (d40c->busy) {
- pm_runtime_mark_last_busy(d40c->base->dev);
+ if (d40c->busy)
pm_runtime_put_autosuspend(d40c->base->dev);
- }
d40c->busy = false;
spin_unlock_irqrestore(&d40c->lock, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0883/1756] dmaengine: ste_dma40: Handle runtime PM resume errors
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (881 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0882/1756] dmaengine: ste_dma40: Remove redundant pm_runtime_mark_last_busy() calls Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0884/1756] dmaengine: ste_dma40: Return IRQ_NONE when no interrupt is pending Greg Kroah-Hartman
` (115 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Linus Walleij, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 55a35231b8ced2250a7743ec350a9566d553780e ]
Several channel operations use pm_runtime_get_sync() and access DMA40
registers without checking whether runtime resume succeeded. If resume
fails, the registers may be inaccessible. pm_runtime_get_sync() also
increments the usage counter on failure, making error unwinding easy to
unbalance.
Use pm_runtime_resume_and_get() and avoid register access when resume
fails. Acquire the runtime PM reference before allocating a channel so
failure needs no channel-allocation rollback.
If a queued transfer cannot be started because resume failed, retire all
issued descriptors through the normal tasklet path. Since
dma_async_issue_pending() cannot return an error, leaving them queued would
make clients wait indefinitely for callbacks.
Termination and channel release must also clean up software state when the
controller cannot resume. d40_term_all() only releases descriptor state and
does not access DMA40 registers, so it remains unconditional.
Balance each transient runtime PM reference in its successful acquisition
block, without bookkeeping flags. Release the outstanding busy reference
and channel allocation state when freeing a channel. Skip only the hardware
stop that requires register access.
Fixes: 7fb3e75e1833 ("dmaengine/ste_dma40: support pm in dma40")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-7-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 74 +++++++++++++++++++++++++++++------------
1 file changed, 52 insertions(+), 22 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index f196bfe416001..a1c126a3a499b 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1448,11 +1448,14 @@ static int d40_pause(struct dma_chan *chan)
return 0;
spin_lock_irqsave(&d40c->lock, flags);
- pm_runtime_get_sync(d40c->base->dev);
+ res = pm_runtime_resume_and_get(d40c->base->dev);
+ if (res < 0)
+ goto unlock;
res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
pm_runtime_put_autosuspend(d40c->base->dev);
+ unlock:
spin_unlock_irqrestore(&d40c->lock, flags);
return res;
}
@@ -1472,13 +1475,16 @@ static int d40_resume(struct dma_chan *chan)
return 0;
spin_lock_irqsave(&d40c->lock, flags);
- pm_runtime_get_sync(d40c->base->dev);
+ res = pm_runtime_resume_and_get(d40c->base->dev);
+ if (res < 0)
+ goto unlock;
/* If bytes left to transfer or linked tx resume job */
if (d40_residue(d40c) || d40_tx_is_linked(d40c))
res = d40_channel_execute_command(d40c, D40_DMA_RUN);
pm_runtime_put_autosuspend(d40c->base->dev);
+ unlock:
spin_unlock_irqrestore(&d40c->lock, flags);
return res;
}
@@ -1515,8 +1521,20 @@ static struct d40_desc *d40_queue_start(struct d40_chan *d40c)
if (d40d != NULL) {
if (!d40c->busy) {
+ err = pm_runtime_resume_and_get(d40c->base->dev);
+ if (err < 0) {
+ chan_err(d40c, "Failed to resume DMA: %d\n",
+ err);
+ do {
+ d40_desc_remove(d40d);
+ d40_desc_done(d40c, d40d);
+ d40c->pending_tx++;
+ d40d = d40_first_queued(d40c);
+ } while (d40d);
+ tasklet_schedule(&d40c->tasklet);
+ return ERR_PTR(err);
+ }
d40c->busy = true;
- pm_runtime_get_sync(d40c->base->dev);
}
/* Remove from queue */
@@ -2030,9 +2048,6 @@ static int d40_free_dma(struct d40_chan *d40c)
struct d40_phy_res *phy = d40c->phy_chan;
bool is_src;
- /* Terminate all queued and active transfers */
- d40_term_all(d40c);
-
if (phy == NULL) {
chan_err(d40c, "phy == null\n");
return -EINVAL;
@@ -2054,11 +2069,18 @@ static int d40_free_dma(struct d40_chan *d40c)
return -EINVAL;
}
- pm_runtime_get_sync(d40c->base->dev);
- res = d40_channel_execute_command(d40c, D40_DMA_STOP);
- if (res) {
- chan_err(d40c, "stop failed\n");
- goto mark_last_busy;
+ /* Release descriptor state; this does not access DMA40 registers. */
+ d40_term_all(d40c);
+
+ res = pm_runtime_resume_and_get(d40c->base->dev);
+ if (res >= 0) {
+ res = d40_channel_execute_command(d40c, D40_DMA_STOP);
+ if (res)
+ chan_err(d40c, "stop failed\n");
+
+ pm_runtime_put_autosuspend(d40c->base->dev);
+ if (res)
+ return res;
}
d40_alloc_mask_free(phy, is_src, chan_is_logical(d40c) ? event : 0);
@@ -2074,8 +2096,6 @@ static int d40_free_dma(struct d40_chan *d40c)
d40c->busy = false;
d40c->phy_chan = NULL;
d40c->configured = false;
- mark_last_busy:
- pm_runtime_put_autosuspend(d40c->base->dev);
return res;
}
@@ -2434,10 +2454,14 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
err = d40_config_memcpy(d40c);
if (err) {
chan_err(d40c, "Failed to configure memcpy channel\n");
- goto mark_last_busy;
+ goto unlock;
}
}
+ err = pm_runtime_resume_and_get(d40c->base->dev);
+ if (err < 0)
+ goto unlock;
+
err = d40_allocate_channel(d40c, &is_free_phy);
if (err) {
chan_err(d40c, "Failed to allocate channel\n");
@@ -2445,8 +2469,6 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
goto mark_last_busy;
}
- pm_runtime_get_sync(d40c->base->dev);
-
d40_set_prio_realtime(d40c);
if (chan_is_logical(d40c)) {
@@ -2478,6 +2500,7 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
d40_config_write(d40c);
mark_last_busy:
pm_runtime_put_autosuspend(d40c->base->dev);
+ unlock:
spin_unlock_irqrestore(&d40c->lock, flags);
return err;
}
@@ -2622,19 +2645,26 @@ static int d40_terminate_all(struct dma_chan *chan)
spin_lock_irqsave(&d40c->lock, flags);
- pm_runtime_get_sync(d40c->base->dev);
- ret = d40_channel_execute_command(d40c, D40_DMA_STOP);
- if (ret)
- chan_err(d40c, "Failed to stop channel\n");
+ ret = pm_runtime_resume_and_get(d40c->base->dev);
+ if (ret >= 0) {
+ ret = d40_channel_execute_command(d40c, D40_DMA_STOP);
+ if (ret)
+ chan_err(d40c, "Failed to stop channel\n");
+
+ pm_runtime_put_autosuspend(d40c->base->dev);
+ }
+ /*
+ * Always release software state, even when the controller cannot
+ * resume. d40_term_all() does not access DMA40 registers.
+ */
d40_term_all(d40c);
- pm_runtime_put_autosuspend(d40c->base->dev);
if (d40c->busy)
pm_runtime_put_autosuspend(d40c->base->dev);
d40c->busy = false;
spin_unlock_irqrestore(&d40c->lock, flags);
- return 0;
+ return ret;
}
static int
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0884/1756] dmaengine: ste_dma40: Return IRQ_NONE when no interrupt is pending
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (882 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0883/1756] dmaengine: ste_dma40: Handle runtime PM resume errors Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0885/1756] dmaengine: ste_dma40: Init hardware before registration Greg Kroah-Hartman
` (114 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Linus Walleij, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit b96967644c524d34b2fdd2e58c31e7b36e3469e6 ]
d40_handle_interrupt() returns IRQ_HANDLED even when no terminal-count or
error status bit is pending.
IRQ_NONE is not only used to identify a device on a shared interrupt.
The generic IRQ core also counts it as unhandled for spurious IRQ
detection. DMA40 does not request this IRQ with IRQF_SHARED, so interrupt
sharing is not the purpose of this change.
If the line remains asserted without matching DMA40 status, returning
IRQ_HANDLED hides the stuck interrupt and can leave the CPU servicing it
indefinitely. Track whether any DMA40 status is pending and return IRQ_NONE
when none is present, allowing the generic IRQ core to diagnose and
eventually disable the faulty line.
DMA40 channels can be owned by other SoC cores. Their status means that
the interrupt is real, but Linux must not acknowledge it. Treat foreign
status as handled and leave its acknowledgment to the owning core, while
acknowledging and dispatching only registered Linux channels.
Fixes: 8d318a50b3d7 ("DMAENGINE: Support for ST-Ericssons DMA40 block v3")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-8-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index a1c126a3a499b..4e5907f6840fd 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1685,6 +1685,7 @@ static void dma_tasklet(struct tasklet_struct *t)
static irqreturn_t d40_handle_interrupt(int irq, void *data)
{
+ irqreturn_t handled = IRQ_NONE;
int i;
u32 idx;
u32 row;
@@ -1718,6 +1719,12 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
row = chan / BITS_PER_LONG;
idx = chan & (BITS_PER_LONG - 1);
+ /*
+ * Status for a channel owned by another core still explains
+ * the interrupt, but only ACK Linux-owned channels below.
+ */
+ handled = IRQ_HANDLED;
+
if (il[row].offset == D40_PHY_CHAN)
d40c = base->lookup_phy_chans[idx];
else
@@ -1750,7 +1757,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
if (ret > 0)
pm_runtime_put_autosuspend(base->dev);
- return IRQ_HANDLED;
+ return handled;
}
static int d40_validate_conf(struct d40_chan *d40c,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0885/1756] dmaengine: ste_dma40: Init hardware before registration
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (883 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0884/1756] dmaengine: ste_dma40: Return IRQ_NONE when no interrupt is pending Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0886/1756] dmaengine: ste_dma40: Fix probe IRQ leak Greg Kroah-Hartman
` (113 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Linus Walleij, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit ffd583a734dc4bdafb9e18d9aa48b6efafd1a628 ]
d40_probe() enables the interrupt handler and registers DMAengine devices
before calling d40_hw_init(). An interrupt pending from the bootloader can
therefore reach the handler while the hardware interrupt state is not
initialized and channel lookup entries are empty. The handler deliberately
does not acknowledge an interrupt for an unknown channel, so a level IRQ
can retrigger continuously.
Initialize the hardware and set the DMA segment limit before requesting
the IRQ or registering DMAengine devices. d40_hw_init() clears pending
logical and physical interrupt status, so request_irq() can enable the
line normally after the hardware state is initialized.
This ensures that the handler and clients only observe initialized
hardware.
Fixes: 8d318a50b3d7 ("DMAENGINE: Support for ST-Ericssons DMA40 block v3")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225215.5EA2F1F000E9@smtp.kernel.org/
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-9-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 4e5907f6840fd..c88de0dc7c6eb 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3670,20 +3670,19 @@ static int __init d40_probe(struct platform_device *pdev)
}
pm_runtime_use_autosuspend(base->dev);
+ dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE);
+
+ d40_hw_init(base);
+
ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base);
if (ret) {
d40_err(dev, "No IRQ defined\n");
goto destroy_cache;
}
-
ret = d40_dmaengine_init(base, num_reserved_chans);
if (ret)
goto destroy_cache;
- dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE);
-
- d40_hw_init(base);
-
ret = of_dma_controller_register(np, d40_xlate, NULL);
if (ret) {
dev_err(dev,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0886/1756] dmaengine: ste_dma40: Fix probe IRQ leak
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (884 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0885/1756] dmaengine: ste_dma40: Init hardware before registration Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0887/1756] dmaengine: ste_dma40: Fix DMA registration unwind Greg Kroah-Hartman
` (112 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Linus Walleij, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 7ca608cf6b842685bbbe131d4f7d638f7cdc2b5d ]
d40_probe() registers the hardware interrupt before several later probe
steps that can fail. Those error paths jump to destroy_cache without
freeing the IRQ, leaving the handler registered after probe resources have
been released.
Route failures after a successful IRQ request through a dedicated cleanup
label. Keep the request before DMAengine registration because that
registration publishes channels to clients.
Fixes: 8d318a50b3d7 ("DMAENGINE: Support for ST-Ericssons DMA40 block v3")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-10-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index c88de0dc7c6eb..1b833fa77fba9 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3681,18 +3681,20 @@ static int __init d40_probe(struct platform_device *pdev)
}
ret = d40_dmaengine_init(base, num_reserved_chans);
if (ret)
- goto destroy_cache;
+ goto release_irq;
ret = of_dma_controller_register(np, d40_xlate, NULL);
if (ret) {
dev_err(dev,
"could not register of_dma_controller\n");
- goto destroy_cache;
+ goto release_irq;
}
dev_info(base->dev, "initialized\n");
return 0;
+ release_irq:
+ free_irq(base->irq, base);
destroy_cache:
if (base->lcla_pool.dma_addr)
dma_unmap_single(base->dev, base->lcla_pool.dma_addr,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0887/1756] dmaengine: ste_dma40: Fix DMA registration unwind
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (885 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0886/1756] dmaengine: ste_dma40: Fix probe IRQ leak Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0888/1756] dmaengine: ste_dma40: Fix LCLA allocation order Greg Kroah-Hartman
` (111 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Linus Walleij, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit f71ef686f913c8e9771a54466a76d653b83cd3dd ]
d40_dmaengine_init() registers DMAengine devices using devres-managed
unregister actions. If probe fails after one of those registrations, the
DMAengine devices stay visible until devres unwinds after d40_probe()
returns.
The channel tasklets are also initialized before each DMAengine device is
registered. An interrupt can therefore have queued a tasklet by the time a
later registration step fails, but unregistering the DMAengine devices
does not drain that tasklet before probe-owned storage is released.
Add tasklet cleanup actions to the DMAengine registration devres group.
Install each action before publishing its DMAengine device. If action
registration fails, those tasklets have never been exposed and cannot have
been scheduled, so use devm_add_action() without immediate reset cleanup.
On later failure, free the IRQ before releasing the group so no new
tasklets can be scheduled, then unregister the DMAengine devices and drain
their tasklets before freeing the remaining probe resources. Keep the
managed registrations and cleanup actions in place on successful probe by
removing only the temporary group markers.
Fixes: 42ae6f1695be ("dmaengine: ste_dma40: Remove platform data")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225215.5EA2F1F000E9@smtp.kernel.org/
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-11-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 45 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 43 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 1b833fa77fba9..c7c727411a275 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2876,6 +2876,18 @@ static void __init d40_chan_init(struct d40_base *base, struct dma_device *dma,
}
}
+static void d40_kill_tasklets(void *data)
+{
+ struct dma_device *dma = data;
+ struct d40_chan *d40c;
+ struct dma_chan *chan;
+
+ list_for_each_entry(chan, &dma->channels, device_node) {
+ d40c = container_of(chan, struct d40_chan, chan);
+ tasklet_kill(&d40c->tasklet);
+ }
+}
+
static void d40_ops_init(struct d40_base *base, struct dma_device *dev)
{
if (dma_has_cap(DMA_SLAVE, dev->cap_mask)) {
@@ -2922,6 +2934,11 @@ static int __init d40_dmaengine_init(struct d40_base *base,
d40_ops_init(base, &base->dma_slave);
+ err = devm_add_action(base->dev, d40_kill_tasklets,
+ &base->dma_slave);
+ if (err)
+ goto exit;
+
err = dmaenginem_async_device_register(&base->dma_slave);
if (err) {
@@ -2937,6 +2954,11 @@ static int __init d40_dmaengine_init(struct d40_base *base,
d40_ops_init(base, &base->dma_memcpy);
+ err = devm_add_action(base->dev, d40_kill_tasklets,
+ &base->dma_memcpy);
+ if (err)
+ goto exit;
+
err = dmaenginem_async_device_register(&base->dma_memcpy);
if (err) {
@@ -2954,6 +2976,12 @@ static int __init d40_dmaengine_init(struct d40_base *base,
dma_cap_set(DMA_CYCLIC, base->dma_both.cap_mask);
d40_ops_init(base, &base->dma_both);
+
+ err = devm_add_action(base->dev, d40_kill_tasklets,
+ &base->dma_both);
+ if (err)
+ goto exit;
+
err = dmaenginem_async_device_register(&base->dma_both);
if (err) {
@@ -3549,6 +3577,7 @@ static int __init d40_probe(struct platform_device *pdev)
struct d40_base *base;
struct resource *res;
struct resource res_lcpa;
+ void *dmaenginem_reg_group;
int num_reserved_chans;
u32 val;
int ret;
@@ -3679,20 +3708,32 @@ static int __init d40_probe(struct platform_device *pdev)
d40_err(dev, "No IRQ defined\n");
goto destroy_cache;
}
+
+ dmaenginem_reg_group = devres_open_group(dev, NULL, GFP_KERNEL);
+ if (!dmaenginem_reg_group) {
+ ret = -ENOMEM;
+ goto release_irq;
+ }
+
ret = d40_dmaengine_init(base, num_reserved_chans);
if (ret)
- goto release_irq;
+ goto release_dmaenginem;
ret = of_dma_controller_register(np, d40_xlate, NULL);
if (ret) {
dev_err(dev,
"could not register of_dma_controller\n");
- goto release_irq;
+ goto release_dmaenginem;
}
+ devres_remove_group(dev, dmaenginem_reg_group);
dev_info(base->dev, "initialized\n");
return 0;
+ release_dmaenginem:
+ free_irq(base->irq, base);
+ devres_release_group(dev, dmaenginem_reg_group);
+ goto destroy_cache;
release_irq:
free_irq(base->irq, base);
destroy_cache:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0888/1756] dmaengine: ste_dma40: Fix LCLA allocation order
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (886 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0887/1756] dmaengine: ste_dma40: Fix DMA registration unwind Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0889/1756] dmaengine: ste_dma40: Fix probe LCLA free Greg Kroah-Hartman
` (110 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 7d4dc355c574d414d2402ac481a2fc4ee51e2771 ]
d40_lcla_allocate() calculates the number of pages needed for LCLA, but
passes that raw page count as the allocation order to __get_free_pages().
The same value is later passed to free_pages().
Store the allocation order with get_order() instead, and use a separate
byte size for allocation diagnostics, fallback kmalloc() sizing and DMA
mapping.
Fixes: 508849ade23c ("DMAENGINE: ste_dma40: allocate LCLA dynamically")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225114.AE1511F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-12-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index c7c727411a275..9b38672db3d90 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -411,8 +411,8 @@ struct d40_desc {
* @dma_addr: DMA address, if mapped
* @base_unaligned: The original kmalloc pointer, if kmalloc is used.
* This pointer is only there for clean-up on error.
- * @pages: The number of pages needed for all physical channels.
- * Only used later for clean-up on error
+ * @alloc_order: Order used for the LCLA page allocation.
+ * Only used later for clean-up on error.
* @lock: Lock to protect the content in this struct.
* @alloc_map: big map over which LCLA entry is own by which job.
*/
@@ -420,7 +420,7 @@ struct d40_lcla_pool {
void *base;
dma_addr_t dma_addr;
void *base_unaligned;
- int pages;
+ unsigned int alloc_order;
spinlock_t lock;
struct d40_desc **alloc_map;
};
@@ -3438,6 +3438,7 @@ static void __init d40_hw_init(struct d40_base *base)
static int __init d40_lcla_allocate(struct d40_base *base)
{
struct d40_lcla_pool *pool = &base->lcla_pool;
+ size_t lcla_size = SZ_1K * base->num_phy_chans;
unsigned long *page_list;
int i, j;
int ret;
@@ -3453,20 +3454,20 @@ static int __init d40_lcla_allocate(struct d40_base *base)
if (!page_list)
return -ENOMEM;
- /* Calculating how many pages that are required */
- base->lcla_pool.pages = SZ_1K * base->num_phy_chans / PAGE_SIZE;
+ base->lcla_pool.alloc_order = get_order(lcla_size);
for (i = 0; i < MAX_LCLA_ALLOC_ATTEMPTS; i++) {
page_list[i] = __get_free_pages(GFP_KERNEL,
- base->lcla_pool.pages);
+ base->lcla_pool.alloc_order);
if (!page_list[i]) {
- d40_err(base->dev, "Failed to allocate %d pages.\n",
- base->lcla_pool.pages);
+ d40_err(base->dev, "Failed to allocate %zu bytes.\n",
+ lcla_size);
ret = -ENOMEM;
for (j = 0; j < i; j++)
- free_pages(page_list[j], base->lcla_pool.pages);
+ free_pages(page_list[j],
+ base->lcla_pool.alloc_order);
goto free_page_list;
}
@@ -3476,7 +3477,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
}
for (j = 0; j < i; j++)
- free_pages(page_list[j], base->lcla_pool.pages);
+ free_pages(page_list[j], base->lcla_pool.alloc_order);
if (i < MAX_LCLA_ALLOC_ATTEMPTS) {
base->lcla_pool.base = (void *)page_list[i];
@@ -3486,10 +3487,9 @@ static int __init d40_lcla_allocate(struct d40_base *base)
* alignment, try with allocating a big buffer.
*/
dev_warn(base->dev,
- "[%s] Failed to get %d pages @ 18 bit align.\n",
- __func__, base->lcla_pool.pages);
- base->lcla_pool.base_unaligned = kmalloc(SZ_1K *
- base->num_phy_chans +
+ "[%s] Failed to get %zu bytes @ 18 bit align.\n",
+ __func__, lcla_size);
+ base->lcla_pool.base_unaligned = kmalloc(lcla_size +
LCLA_ALIGNMENT,
GFP_KERNEL);
if (!base->lcla_pool.base_unaligned) {
@@ -3501,8 +3501,7 @@ static int __init d40_lcla_allocate(struct d40_base *base)
LCLA_ALIGNMENT);
}
- pool->dma_addr = dma_map_single(base->dev, pool->base,
- SZ_1K * base->num_phy_chans,
+ pool->dma_addr = dma_map_single(base->dev, pool->base, lcla_size,
DMA_TO_DEVICE);
if (dma_mapping_error(base->dev, pool->dma_addr)) {
pool->dma_addr = 0;
@@ -3744,7 +3743,7 @@ static int __init d40_probe(struct platform_device *pdev)
if (!base->lcla_pool.base_unaligned && base->lcla_pool.base)
free_pages((unsigned long)base->lcla_pool.base,
- base->lcla_pool.pages);
+ base->lcla_pool.alloc_order);
kfree(base->lcla_pool.base_unaligned);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0889/1756] dmaengine: ste_dma40: Fix probe LCLA free
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (887 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0888/1756] dmaengine: ste_dma40: Fix LCLA allocation order Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0890/1756] dmaengine: ste_dma40: Put the LCPA SRAM node Greg Kroah-Hartman
` (109 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 750dfcdb7a406bdd52d604099a631bbe96ddda91 ]
When LCLA is placed in ESRAM, d40_probe() stores a devm_ioremap()
address in lcla_pool.base and leaves base_unaligned unset. The
destroy_cache error path can then pass the ioremap address to
free_pages().
Only free lcla_pool.base with free_pages() when the driver allocated the
LCLA pool from normal memory. The ESRAM mapping is devm-managed.
Fixes: 339f5041089a ("dmaengine: ste_dma40: Use managed resources")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225114.AE1511F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-13-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 9b38672db3d90..2dea28bdd5e8a 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3741,7 +3741,8 @@ static int __init d40_probe(struct platform_device *pdev)
SZ_1K * base->num_phy_chans,
DMA_TO_DEVICE);
- if (!base->lcla_pool.base_unaligned && base->lcla_pool.base)
+ if (!base->plat_data->use_esram_lcla &&
+ !base->lcla_pool.base_unaligned && base->lcla_pool.base)
free_pages((unsigned long)base->lcla_pool.base,
base->lcla_pool.alloc_order);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0890/1756] dmaengine: ste_dma40: Put the LCPA SRAM node
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (888 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0889/1756] dmaengine: ste_dma40: Fix probe LCLA free Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0891/1756] dmaengine: ste_dma40: turn d40_base phy_chans into a flexible array Greg Kroah-Hartman
` (108 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Linus Walleij, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 9a3762b470421658214baeb6cce3eed7344bb435 ]
of_parse_phandle() takes a reference to the LCPA SRAM node, but d40_probe()
does not release it after translating the node into a resource. This leaks
the node reference for the lifetime of the system.
Put the node immediately after of_address_to_resource() so both the success
and error paths release the reference.
Fixes: 5a1a3b9c19dd ("dmaengine: ste_dma40: Get LCPA SRAM from SRAM node")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-14-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 2dea28bdd5e8a..1e17a4fff6d54 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3606,6 +3606,7 @@ static int __init d40_probe(struct platform_device *pdev)
}
/* This is no device so read the address directly from the node */
ret = of_address_to_resource(np_lcpa, 0, &res_lcpa);
+ of_node_put(np_lcpa);
if (ret) {
dev_err(dev, "no LCPA SRAM resource\n");
goto report_failure;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0891/1756] dmaengine: ste_dma40: turn d40_base phy_chans into a flexible array
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (889 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0890/1756] dmaengine: ste_dma40: Put the LCPA SRAM node Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0892/1756] dmaengine: ste_dma40: Fix memcpy channel parsing Greg Kroah-Hartman
` (107 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit cc4fea19daeb0460fe3569e0a2d523f427b2bac1 ]
Convert the separately-offset phy_chans pointer to a C99 flexible array
member at the end of struct d40_base, and switch the allocation to
struct_size(). The log_chans and memcpy_chans slots continue to live
in the same allocation immediately after phy_chans, indexed via
base->log_chans. This removes the hand-rolled pointer fixup that
recomputed phy_chans from base + ALIGN(sizeof(struct d40_base), 4).
The ALIGN(sizeof(struct d40_base), 4) requirement is met implicitly by the
C compiler when using a flexible array member. With struct d40_chan
phy_chans[] as the last member, the C standard guarantees
sizeof(struct d40_base) includes trailing padding to satisfy the alignment
of the flexible array element type (struct d40_chan). Since struct d40_chan
contains members like spinlock_t, pointers, and struct dma_chan — all with
alignment ≥ 4 — the compiler ensures sizeof(struct d40_base) is already a
multiple of _Alignof(struct d40_chan) >= 4. The struct_size() macro then
computes sizeof(struct d40_base) + sizeof(struct d40_chan) * num_phy_chans,
so phy_chans[0] lands at a properly aligned offset without needing the manual
ALIGN.
Assisted-by: Claude:Opus-4.7
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260531020843.594892-1-rosenp@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Stable-dep-of: f2baf04a695d ("dmaengine: ste_dma40: Fix memcpy channel parsing")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 1e17a4fff6d54..0a91166061e90 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -602,7 +602,6 @@ struct d40_base {
struct dma_device dma_both;
struct dma_device dma_slave;
struct dma_device dma_memcpy;
- struct d40_chan *phy_chans;
struct d40_chan *log_chans;
struct d40_chan **lookup_log_chans;
struct d40_chan **lookup_phy_chans;
@@ -621,6 +620,7 @@ struct d40_base {
u32 *regs_interrupt;
u16 gcc_pwr_off_mask;
struct d40_gen_dmac gen_dmac;
+ struct d40_chan phy_chans[];
};
static struct device *chan2dev(struct d40_chan *d40c)
@@ -3210,6 +3210,7 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
struct clk *clk;
void __iomem *virtbase;
struct d40_base *base;
+ size_t alloc_size;
int num_log_chans;
int num_phy_chans;
int num_memcpy_chans;
@@ -3267,22 +3268,24 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
else
num_phy_chans = 4 * (readl(virtbase + D40_DREG_ICFG) & 0x7) + 4;
+ num_phy_chans = min(num_phy_chans, STEDMA40_MAX_PHYS);
+
/* The number of channels used for memcpy */
if (plat_data->num_of_memcpy_chans)
num_memcpy_chans = plat_data->num_of_memcpy_chans;
else
num_memcpy_chans = ARRAY_SIZE(dma40_memcpy_channels);
+ num_memcpy_chans = min(num_memcpy_chans, D40_MEMCPY_MAX_CHANS);
num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY;
dev_info(dev,
"hardware rev: %d with %d physical and %d logical channels\n",
rev, num_phy_chans, num_log_chans);
- base = devm_kzalloc(dev,
- ALIGN(sizeof(struct d40_base), 4) +
- (num_phy_chans + num_log_chans + num_memcpy_chans) *
- sizeof(struct d40_chan), GFP_KERNEL);
+ alloc_size = struct_size(base, phy_chans, num_phy_chans);
+ alloc_size += sizeof(*base->log_chans) * (num_log_chans + num_memcpy_chans);
+ base = devm_kzalloc(dev, alloc_size, GFP_KERNEL);
if (!base)
return -ENOMEM;
@@ -3295,7 +3298,6 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
base->virtbase = virtbase;
base->plat_data = plat_data;
base->dev = dev;
- base->phy_chans = ((void *)base) + ALIGN(sizeof(struct d40_base), 4);
base->log_chans = &base->phy_chans[num_phy_chans];
if (base->plat_data->num_of_phy_chans == 14) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0892/1756] dmaengine: ste_dma40: Fix memcpy channel parsing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (890 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0891/1756] dmaengine: ste_dma40: turn d40_base phy_chans into a flexible array Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0893/1756] dmaengine: ste_dma40: Validate disabled channel indexes Greg Kroah-Hartman
` (106 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit f2baf04a695de4f952513cb00ccf0338c6db2e00 ]
d40_of_probe() validates the memcpy-channels property against
D40_MEMCPY_MAX_CHANS, but reads the property directly into a smaller global
array. A long property can therefore overwrite adjacent data. The mutable
global also lets a later DMA40 instance replace the memcpy channel mapping
used for future allocations on an earlier instance.
Store the mapping in the per-device platform data, validate the property
against that storage, and check the property read result. The property is
required and d40_probe() always populates the platform data, so remove the
obsolete global mapping and fallback.
Fixes: a7dacb68b35a ("dmaengine: ste_dma40: Allow memcpy channels to be configured from DT")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225215.5EA2F1F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-15-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 45 +++++++++++++----------------------------
1 file changed, 14 insertions(+), 31 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 0a91166061e90..ac3f1f2a4cd10 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -28,6 +28,8 @@
#include "ste_dma40.h"
#include "ste_dma40_ll.h"
+#define D40_MEMCPY_MAX_CHANS 8
+
/**
* struct stedma40_platform_data - Configuration struct for the dma device.
*
@@ -41,6 +43,7 @@
* to use SoftLLI.
* @use_esram_lcla: flag for mapping the lcla into esram region
* @num_of_memcpy_chans: The number of channels reserved for memcpy.
+ * @memcpy_channels: The event lines used for memcpy.
* @num_of_phy_chans: The number of physical channels implemented in HW.
* 0 means reading the number of channels from DMA HW but this is only valid
* for 'multiple of 4' channels, like 8.
@@ -51,6 +54,7 @@ struct stedma40_platform_data {
int num_of_soft_lli_chans;
bool use_esram_lcla;
int num_of_memcpy_chans;
+ u32 memcpy_channels[D40_MEMCPY_MAX_CHANS];
int num_of_phy_chans;
};
@@ -86,25 +90,6 @@ struct stedma40_platform_data {
#define D40_ALLOC_PHY BIT(30)
#define D40_ALLOC_LOG_FREE 0
-#define D40_MEMCPY_MAX_CHANS 8
-
-/* Reserved event lines for memcpy only. */
-#define DB8500_DMA_MEMCPY_EV_0 51
-#define DB8500_DMA_MEMCPY_EV_1 56
-#define DB8500_DMA_MEMCPY_EV_2 57
-#define DB8500_DMA_MEMCPY_EV_3 58
-#define DB8500_DMA_MEMCPY_EV_4 59
-#define DB8500_DMA_MEMCPY_EV_5 60
-
-static int dma40_memcpy_channels[] = {
- DB8500_DMA_MEMCPY_EV_0,
- DB8500_DMA_MEMCPY_EV_1,
- DB8500_DMA_MEMCPY_EV_2,
- DB8500_DMA_MEMCPY_EV_3,
- DB8500_DMA_MEMCPY_EV_4,
- DB8500_DMA_MEMCPY_EV_5,
-};
-
/* Default configuration for physical memcpy */
static const struct stedma40_chan_cfg dma40_memcpy_conf_phy = {
.mode = STEDMA40_MODE_PHYSICAL,
@@ -2023,7 +2008,8 @@ static int d40_config_memcpy(struct d40_chan *d40c)
if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) {
d40c->dma_cfg = dma40_memcpy_conf_log;
- d40c->dma_cfg.dev_type = dma40_memcpy_channels[d40c->chan.chan_id];
+ d40c->dma_cfg.dev_type =
+ d40c->base->plat_data->memcpy_channels[d40c->chan.chan_id];
d40_log_cfg(&d40c->dma_cfg,
&d40c->log_def.lcsp1, &d40c->log_def.lcsp3);
@@ -3271,12 +3257,7 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
num_phy_chans = min(num_phy_chans, STEDMA40_MAX_PHYS);
/* The number of channels used for memcpy */
- if (plat_data->num_of_memcpy_chans)
- num_memcpy_chans = plat_data->num_of_memcpy_chans;
- else
- num_memcpy_chans = ARRAY_SIZE(dma40_memcpy_channels);
-
- num_memcpy_chans = min(num_memcpy_chans, D40_MEMCPY_MAX_CHANS);
+ num_memcpy_chans = plat_data->num_of_memcpy_chans;
num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY;
dev_info(dev,
@@ -3525,6 +3506,7 @@ static int __init d40_of_probe(struct device *dev,
struct stedma40_platform_data *pdata;
int num_phy = 0, num_memcpy = 0, num_disabled = 0;
const __be32 *list;
+ int ret;
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
@@ -3538,18 +3520,19 @@ static int __init d40_of_probe(struct device *dev,
list = of_get_property(np, "memcpy-channels", &num_memcpy);
num_memcpy /= sizeof(*list);
- if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) {
+ if (num_memcpy > ARRAY_SIZE(pdata->memcpy_channels) ||
+ num_memcpy <= 0) {
d40_err(dev,
"Invalid number of memcpy channels specified (%d)\n",
num_memcpy);
return -EINVAL;
}
+ ret = of_property_read_u32_array(np, "memcpy-channels",
+ pdata->memcpy_channels, num_memcpy);
+ if (ret)
+ return ret;
pdata->num_of_memcpy_chans = num_memcpy;
- of_property_read_u32_array(np, "memcpy-channels",
- dma40_memcpy_channels,
- num_memcpy);
-
list = of_get_property(np, "disabled-channels", &num_disabled);
num_disabled /= sizeof(*list);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0893/1756] dmaengine: ste_dma40: Validate disabled channel indexes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (891 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0892/1756] dmaengine: ste_dma40: Fix memcpy channel parsing Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0894/1756] dmaengine: ste_dma40: Validate DMA specifier length Greg Kroah-Hartman
` (105 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Linus Walleij, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit c96e9f056095825b5f8d4a11f4107fc174892f92 ]
d40_of_probe() checks how many entries disabled-channels contains, but not
the channel numbers themselves. d40_phy_res_init() later uses every value
as an index into base->phy_res, whose size is the number of channels found
in this DMA40 instance. An out-of-range value can therefore write beyond
the allocation.
Validate each disabled channel against the detected hardware channel count
before allocating and initializing the channel resources.
Fixes: 499c2bc3cc89 ("dmaengine: ste_dma40: Fetch disabled channels from DT")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-16-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index ac3f1f2a4cd10..d51b7c19d42dc 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3256,6 +3256,15 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
num_phy_chans = min(num_phy_chans, STEDMA40_MAX_PHYS);
+ for (i = 0; plat_data->disabled_channels[i] != -1; i++) {
+ int chan = plat_data->disabled_channels[i];
+
+ if (chan < 0 || chan >= num_phy_chans) {
+ dev_err(dev, "Invalid disabled channel %d\n", chan);
+ return -EINVAL;
+ }
+ }
+
/* The number of channels used for memcpy */
num_memcpy_chans = plat_data->num_of_memcpy_chans;
num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0894/1756] dmaengine: ste_dma40: Validate DMA specifier length
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (892 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0893/1756] dmaengine: ste_dma40: Validate disabled channel indexes Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0895/1756] dmaengine: ste_dma40: Reject direction changes after allocation Greg Kroah-Hartman
` (104 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Linus Walleij, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 9f1064ebe17cf3ab65ac6eb166398e02678aea33 ]
The DMA40 binding requires three cells, but d40_xlate() reads args[0],
args[1], and args[2] without checking args_count. A malformed provider node
can specify fewer cells, leaving some of these values uninitialized when
the OF DMA core invokes the translation callback.
Reject specifiers that do not contain exactly three cells before reading
the argument array.
Fixes: fa332de5c6b3 ("dmaengine: ste_dma40: Supply full Device Tree parsing support")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-17-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index d51b7c19d42dc..bc4e30d46bdc9 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2395,6 +2395,9 @@ static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec,
dma_cap_mask_t cap;
u32 flags;
+ if (dma_spec->args_count != 3)
+ return NULL;
+
memset(&cfg, 0, sizeof(struct stedma40_chan_cfg));
dma_cap_zero(cap);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0895/1756] dmaengine: ste_dma40: Reject direction changes after allocation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (893 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0894/1756] dmaengine: ste_dma40: Validate DMA specifier length Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0896/1756] dmaengine: ste_dma40: Fix logical channel bounds check Greg Kroah-Hartman
` (103 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 77ebc64f40717b8501793b5f5ee717a141e62e8e ]
Logical channel allocation uses the configured direction to select the
source or destination allocation mask, derive the logical channel number,
and choose the LCPA location.
d40_set_runtime_config_write() nevertheless overwrites the configured
direction when a transfer is prepared for the opposite direction.
d40_free_dma() then clears the wrong allocation mask, leaking the original
resource and potentially releasing one used by another client.
Reject directions that differ from the direction used during allocation
and propagate runtime configuration errors to callers. Skip slave runtime
configuration for memcpy transfers, which also use d40_prep_sg() but do
not require it.
Fixes: 95e1400fa131 ("DMAENGINE: add runtime slave config to DMA40 v3")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-18-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index bc4e30d46bdc9..5c2a13b2f826d 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2268,7 +2268,13 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src,
return NULL;
}
- d40_set_runtime_config_write(dchan, &chan->slave_config, direction);
+ if (direction != DMA_MEM_TO_MEM) {
+ ret = d40_set_runtime_config_write(dchan,
+ &chan->slave_config,
+ direction);
+ if (ret)
+ return NULL;
+ }
spin_lock_irqsave(&chan->lock, flags);
@@ -2723,6 +2729,13 @@ static int d40_set_runtime_config_write(struct dma_chan *chan,
return -EINVAL;
}
+ if (direction != cfg->dir) {
+ chan_err(d40c,
+ "transfer direction %d differs from allocated direction %d\n",
+ direction, cfg->dir);
+ return -EINVAL;
+ }
+
src_addr_width = config->src_addr_width;
src_maxburst = config->src_maxburst;
dst_addr_width = config->dst_addr_width;
@@ -2731,13 +2744,6 @@ static int d40_set_runtime_config_write(struct dma_chan *chan,
if (direction == DMA_DEV_TO_MEM) {
config_addr = config->src_addr;
- if (cfg->dir != DMA_DEV_TO_MEM)
- dev_dbg(d40c->base->dev,
- "channel was not configured for peripheral "
- "to memory transfer (%d) overriding\n",
- cfg->dir);
- cfg->dir = DMA_DEV_TO_MEM;
-
/* Configure the memory side */
if (dst_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
dst_addr_width = src_addr_width;
@@ -2747,13 +2753,6 @@ static int d40_set_runtime_config_write(struct dma_chan *chan,
} else if (direction == DMA_MEM_TO_DEV) {
config_addr = config->dst_addr;
- if (cfg->dir != DMA_MEM_TO_DEV)
- dev_dbg(d40c->base->dev,
- "channel was not configured for memory "
- "to peripheral transfer (%d) overriding\n",
- cfg->dir);
- cfg->dir = DMA_MEM_TO_DEV;
-
/* Configure the memory side */
if (src_addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED)
src_addr_width = dst_addr_width;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0896/1756] dmaengine: ste_dma40: Fix logical channel bounds check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (894 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0895/1756] dmaengine: ste_dma40: Reject direction changes after allocation Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0897/1756] dmaengine: ste_dma40: Fix event group bounds Greg Kroah-Hartman
` (102 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Linus Walleij, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 57938e0c2a24f9f792fe9f611391ef6b58d1aa21 ]
d40_validate_conf() checks the raw dev_type against num_log_chans,
but d40_allocate_channel() derives the lookup_log_chans index as either
2 * dev_type or 2 * dev_type + 1.
Validate the dev_type against the derived logical channel index limit so
channel allocation cannot write past lookup_log_chans.
Fixes: 26955c07dcf3 ("dmaengine: ste_dma40: Amalgamate DMA source and destination channel numbers")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-19-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 5c2a13b2f826d..c0c495e89ef27 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1750,15 +1750,26 @@ static int d40_validate_conf(struct d40_chan *d40c,
{
int res = 0;
bool is_log = conf->mode == STEDMA40_MODE_LOGICAL;
+ bool invalid_dev_type = conf->dev_type < 0;
if (!conf->dir) {
chan_err(d40c, "Invalid direction.\n");
res = -EINVAL;
}
- if ((is_log && conf->dev_type > d40c->base->num_log_chans) ||
- (!is_log && conf->dev_type > d40c->base->num_phy_chans) ||
- (conf->dev_type < 0)) {
+ if (!invalid_dev_type && is_log) {
+ int max_dev_type;
+
+ if (conf->dir == DMA_DEV_TO_MEM)
+ max_dev_type = DIV_ROUND_UP(d40c->base->num_log_chans, 2);
+ else
+ max_dev_type = d40c->base->num_log_chans / 2;
+
+ invalid_dev_type = conf->dev_type >= max_dev_type;
+ }
+
+ if (invalid_dev_type ||
+ (!is_log && conf->dev_type > d40c->base->num_phy_chans)) {
chan_err(d40c, "Invalid device type (%d)\n", conf->dev_type);
res = -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0897/1756] dmaengine: ste_dma40: Fix event group bounds
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (895 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0896/1756] dmaengine: ste_dma40: Fix logical channel bounds check Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0898/1756] dmaengine: ste_dma40: Fix V4B event group mapping Greg Kroah-Hartman
` (101 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Linus Walleij, Frank Li,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit e66a9dbe04c71249cfb2a544c9c25d1b3b761fba ]
The dev_type validation can allow values whose derived event group has no
matching physical channel pair. d40_allocate_channel() then indexes
phy_res with j + event_group * 2, and __d40_set_prio_rt() uses the same
group to select priority and realtime registers.
The physical-mode validation also compares dev_type with the number of
physical channels. However, dev_type identifies an event line: DB8500 has
eight physical channels but 64 source and 64 destination event lines. The
event group determines which physical channel pair can serve an event, so
the physical channel count is not a valid dev_type limit.
Reject dev_type values outside the hardware event-group range, remove the
incorrect physical channel count limit, and stop the physical-channel
search before a partial final channel group can index past phy_res.
Fixes: 26955c07dcf3 ("dmaengine: ste_dma40: Amalgamate DMA source and destination channel numbers")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225008.5F9651F000E9@smtp.kernel.org/
Assisted-by: LLM
Link: https://lore.kernel.org/dmaengine/20260819225008.5F9651F000E9@smtp.kernel.org/
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-20-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index c0c495e89ef27..aeb0e66dbfdbe 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -79,6 +79,10 @@ struct stedma40_platform_data {
#define D40_LCLA_LINK_PER_EVENT_GRP 128
#define D40_LCLA_END D40_LCLA_LINK_PER_EVENT_GRP
+/* Number of event groups per hardware register layout */
+#define D40_EVENT_GROUPS_V4A 4
+#define D40_EVENT_GROUPS_V4B 5
+
/* Max number of logical channels per physical channel */
#define D40_MAX_LOG_CHAN_PER_PHY 32
@@ -507,6 +511,7 @@ struct d40_chan {
* @high_prio_clear: the high priority clear register
* @interrupt_en: the interrupt enable register
* @interrupt_clear: the interrupt clear register
+ * @num_event_groups: number of supported event groups
* @il: the pointer to struct d40_interrupt_lookup
* @il_size: the size of d40_interrupt_lookup array
* @init_reg: the pointer to the struct d40_reg_val
@@ -521,6 +526,7 @@ struct d40_gen_dmac {
u32 high_prio_clear;
u32 interrupt_en;
u32 interrupt_clear;
+ u32 num_event_groups;
struct d40_interrupt_lookup *il;
u32 il_size;
struct d40_reg_val *init_reg;
@@ -1752,6 +1758,11 @@ static int d40_validate_conf(struct d40_chan *d40c,
bool is_log = conf->mode == STEDMA40_MODE_LOGICAL;
bool invalid_dev_type = conf->dev_type < 0;
+ if (!invalid_dev_type &&
+ D40_TYPE_TO_GROUP(conf->dev_type) >=
+ d40c->base->gen_dmac.num_event_groups)
+ invalid_dev_type = true;
+
if (!conf->dir) {
chan_err(d40c, "Invalid direction.\n");
res = -EINVAL;
@@ -1768,8 +1779,7 @@ static int d40_validate_conf(struct d40_chan *d40c,
invalid_dev_type = conf->dev_type >= max_dev_type;
}
- if (invalid_dev_type ||
- (!is_log && conf->dev_type > d40c->base->num_phy_chans)) {
+ if (invalid_dev_type) {
chan_err(d40c, "Invalid device type (%d)\n", conf->dev_type);
res = -EINVAL;
}
@@ -1934,8 +1944,12 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
}
}
} else
- for (j = 0; j < d40c->base->num_phy_chans; j += 8) {
+ for (j = 0; j < d40c->base->num_phy_chans;
+ j += D40_GROUP_SIZE) {
int phy_num = j + event_group * 2;
+ if (phy_num + 1 >= num_phy_chans)
+ break;
+
for (i = phy_num; i < phy_num + 2; i++) {
if (d40_alloc_mask_set(&phys[i],
is_src,
@@ -1955,8 +1969,10 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
return -EINVAL;
/* Find logical channel */
- for (j = 0; j < d40c->base->num_phy_chans; j += 8) {
+ for (j = 0; j < d40c->base->num_phy_chans; j += D40_GROUP_SIZE) {
int phy_num = j + event_group * 2;
+ if (phy_num + 1 >= num_phy_chans)
+ break;
if (d40c->dma_cfg.use_fixed_channel) {
i = d40c->dma_cfg.phy_channel;
@@ -3304,6 +3320,7 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
base->log_chans = &base->phy_chans[num_phy_chans];
if (base->plat_data->num_of_phy_chans == 14) {
+ base->gen_dmac.num_event_groups = D40_EVENT_GROUPS_V4B;
base->gen_dmac.backup = d40_backup_regs_v4b;
base->gen_dmac.backup_size = BACKUP_REGS_SZ_V4B;
base->gen_dmac.interrupt_en = D40_DREG_CPCMIS;
@@ -3317,6 +3334,7 @@ static int __init d40_hw_detect_init(struct platform_device *pdev,
base->gen_dmac.init_reg = dma_init_reg_v4b;
base->gen_dmac.init_reg_size = ARRAY_SIZE(dma_init_reg_v4b);
} else {
+ base->gen_dmac.num_event_groups = D40_EVENT_GROUPS_V4A;
if (base->rev >= 3) {
base->gen_dmac.backup = d40_backup_regs_v4a;
base->gen_dmac.backup_size = BACKUP_REGS_SZ_V4A;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0898/1756] dmaengine: ste_dma40: Fix V4B event group mapping
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (896 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0897/1756] dmaengine: ste_dma40: Fix event group bounds Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0899/1756] dmaengine: ste_dma40: Validate fixed physical channel indexes Greg Kroah-Hartman
` (100 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Frank Li, Vinod Koul,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit b36f8fce7314fed53563c60e683ff86deb8a51ae ]
DMA40 physical resources are connected in pairs to event groups. The
mapping repeats after each complete set of groups.
D40_GROUP_SIZE and D40_PHYS_TO_GROUP() encode the four-group V4A layout.
On V4B, which has five groups, resources 8 and 9 are consequently offered
both to event groups 0 and 4. The GCC clock bookkeeping also treats these
resources as group 0 instead of group 4.
Derive the physical-resource stride and reverse mapping from the
variant-specific number of event groups. This preserves the V4A mapping
and gives V4B a ten-resource stride: resources 8 and 9 belong only to
group 4, while resources 10 and 11 repeat group 0.
Fixes: 3cb645dc85a0 ("dmaengine: ste_dma40: support more than 128 event lines")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-21-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 47 ++++++++++++++++++++++++++------------
drivers/dma/ste_dma40_ll.h | 2 --
2 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index aeb0e66dbfdbe..da0c85a9fabb5 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -82,6 +82,7 @@ struct stedma40_platform_data {
/* Number of event groups per hardware register layout */
#define D40_EVENT_GROUPS_V4A 4
#define D40_EVENT_GROUPS_V4B 5
+#define D40_PHYS_PER_EVENT_GROUP 2
/* Max number of logical channels per physical channel */
#define D40_MAX_LOG_CHAN_PER_PHY 32
@@ -1896,6 +1897,12 @@ static bool d40_alloc_mask_free(struct d40_phy_res *phy, bool is_src,
return is_free;
}
+static int d40_phy_to_group(struct d40_base *base, int phy)
+{
+ return (phy / D40_PHYS_PER_EVENT_GROUP) %
+ base->gen_dmac.num_event_groups;
+}
+
static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
{
int dev_type = d40c->dma_cfg.dev_type;
@@ -1906,11 +1913,14 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
int j;
int log_num;
int num_phy_chans;
+ int phy_group_stride;
bool is_src;
bool is_log = d40c->dma_cfg.mode == STEDMA40_MODE_LOGICAL;
phys = d40c->base->phy_res;
num_phy_chans = d40c->base->num_phy_chans;
+ phy_group_stride = D40_PHYS_PER_EVENT_GROUP *
+ d40c->base->gen_dmac.num_event_groups;
if (d40c->dma_cfg.dir == DMA_DEV_TO_MEM) {
log_num = 2 * dev_type;
@@ -1944,13 +1954,18 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
}
}
} else
- for (j = 0; j < d40c->base->num_phy_chans;
- j += D40_GROUP_SIZE) {
- int phy_num = j + event_group * 2;
- if (phy_num + 1 >= num_phy_chans)
+ for (j = 0; j < num_phy_chans;
+ j += phy_group_stride) {
+ int phy_num = j + event_group *
+ D40_PHYS_PER_EVENT_GROUP;
+
+ if (phy_num + D40_PHYS_PER_EVENT_GROUP >
+ num_phy_chans)
break;
- for (i = phy_num; i < phy_num + 2; i++) {
+ for (i = phy_num;
+ i < phy_num + D40_PHYS_PER_EVENT_GROUP;
+ i++) {
if (d40_alloc_mask_set(&phys[i],
is_src,
0,
@@ -1969,9 +1984,10 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
return -EINVAL;
/* Find logical channel */
- for (j = 0; j < d40c->base->num_phy_chans; j += D40_GROUP_SIZE) {
- int phy_num = j + event_group * 2;
- if (phy_num + 1 >= num_phy_chans)
+ for (j = 0; j < num_phy_chans; j += phy_group_stride) {
+ int phy_num = j + event_group * D40_PHYS_PER_EVENT_GROUP;
+
+ if (phy_num + D40_PHYS_PER_EVENT_GROUP > num_phy_chans)
break;
if (d40c->dma_cfg.use_fixed_channel) {
@@ -1998,14 +2014,17 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
* channels.
*/
if (is_src) {
- for (i = phy_num; i < phy_num + 2; i++) {
+ for (i = phy_num;
+ i < phy_num + D40_PHYS_PER_EVENT_GROUP;
+ i++) {
if (d40_alloc_mask_set(&phys[i], is_src,
event_line, is_log,
first_phy_user))
goto found_log;
}
} else {
- for (i = phy_num + 1; i >= phy_num; i--) {
+ for (i = phy_num + D40_PHYS_PER_EVENT_GROUP - 1;
+ i >= phy_num; i--) {
if (d40_alloc_mask_set(&phys[i], is_src,
event_line, is_log,
first_phy_user))
@@ -3144,9 +3163,9 @@ static int __init d40_phy_res_init(struct d40_base *base)
base->phy_res[i].allocated_src = D40_ALLOC_PHY;
base->phy_res[i].allocated_dst = D40_ALLOC_PHY;
base->phy_res[i].reserved = true;
- gcc |= D40_DREG_GCC_EVTGRP_ENA(D40_PHYS_TO_GROUP(i),
+ gcc |= D40_DREG_GCC_EVTGRP_ENA(d40_phy_to_group(base, i),
D40_DREG_GCC_SRC);
- gcc |= D40_DREG_GCC_EVTGRP_ENA(D40_PHYS_TO_GROUP(i),
+ gcc |= D40_DREG_GCC_EVTGRP_ENA(d40_phy_to_group(base, i),
D40_DREG_GCC_DST);
@@ -3166,9 +3185,9 @@ static int __init d40_phy_res_init(struct d40_base *base)
base->phy_res[chan].allocated_src = D40_ALLOC_PHY;
base->phy_res[chan].allocated_dst = D40_ALLOC_PHY;
base->phy_res[chan].reserved = true;
- gcc |= D40_DREG_GCC_EVTGRP_ENA(D40_PHYS_TO_GROUP(chan),
+ gcc |= D40_DREG_GCC_EVTGRP_ENA(d40_phy_to_group(base, chan),
D40_DREG_GCC_SRC);
- gcc |= D40_DREG_GCC_EVTGRP_ENA(D40_PHYS_TO_GROUP(chan),
+ gcc |= D40_DREG_GCC_EVTGRP_ENA(d40_phy_to_group(base, chan),
D40_DREG_GCC_DST);
num_phy_chans_avail--;
}
diff --git a/drivers/dma/ste_dma40_ll.h b/drivers/dma/ste_dma40_ll.h
index 2e30e9a94a1e3..55090cb310579 100644
--- a/drivers/dma/ste_dma40_ll.h
+++ b/drivers/dma/ste_dma40_ll.h
@@ -16,8 +16,6 @@
#define D40_TYPE_TO_GROUP(type) (type / 16)
#define D40_TYPE_TO_EVENT(type) (type % 16)
-#define D40_GROUP_SIZE 8
-#define D40_PHYS_TO_GROUP(phys) ((phys & (D40_GROUP_SIZE - 1)) / 2)
/* Most bits of the CFG register are the same in log as in phy mode */
#define D40_SREG_CFG_MST_POS 15
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0899/1756] dmaengine: ste_dma40: Validate fixed physical channel indexes
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (897 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0898/1756] dmaengine: ste_dma40: Fix V4B event group mapping Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0900/1756] dmaengine: ste_dma40: Validate memcpy configuration Greg Kroah-Hartman
` (99 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 884e01160bc727509b4fdf04e763a86b936df464 ]
Fixed physical memcpy allocation uses dma_cfg.phy_channel directly as an
index into phy_res when use_fixed_channel is set. d40_validate_conf()
validates dev_type but not the fixed physical channel, allowing an invalid
configuration to access memory outside the array.
Validate the fixed physical channel centrally before accepting the channel
configuration.
Fixes: f000df8c5a0e ("dmaengine: ste_dma40: support fixed physical channel allocation")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225008.5F9651F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-23-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index da0c85a9fabb5..6fb0d8f61261f 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1785,6 +1785,14 @@ static int d40_validate_conf(struct d40_chan *d40c,
res = -EINVAL;
}
+ if (conf->use_fixed_channel &&
+ (conf->phy_channel < 0 ||
+ conf->phy_channel >= d40c->base->num_phy_chans)) {
+ chan_err(d40c, "Invalid physical channel (%d)\n",
+ conf->phy_channel);
+ res = -EINVAL;
+ }
+
if (conf->dir == DMA_DEV_TO_DEV) {
/*
* DMAC HW supports it. Will be added to this driver,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0900/1756] dmaengine: ste_dma40: Validate memcpy configuration
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (898 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0899/1756] dmaengine: ste_dma40: Validate fixed physical channel indexes Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0901/1756] pNFS/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS over the mdsthreshold hint Greg Kroah-Hartman
` (98 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, sashiko-bot, Frank Li, Linus Walleij,
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 0ac4a90c4805b41013044fdefff051ae59a54302 ]
d40_config_memcpy() builds a default memcpy configuration without passing
it through d40_validate_conf(). A dev_type supplied through the
memcpy-channels device tree property can therefore bypass the bounds
checks added for client configurations.
The generic DMA direction enum assigns zero to DMA_MEM_TO_MEM, unlike
DMA40's old private enum. Allow memory-to-memory directions in the
validator so checking the generated configuration does not reject all
memcpy channels.
Validate the generated memcpy configuration before deriving logical
channel registers or allocating the channel.
Fixes: 2c2b62d5d911 ("dmaengine: ste_dma40: Replace ST-E's home-brew DMA direction defs with generic ones")
Reported-by: sashiko-bot@kernel.org
Closes: https://lore.kernel.org/dmaengine/20260819225008.5F9651F000E9@smtp.kernel.org/
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260927-dma40-fixes-v7-24-89f595e8851d@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/dma/ste_dma40.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 6fb0d8f61261f..21469034495d7 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1764,7 +1764,8 @@ static int d40_validate_conf(struct d40_chan *d40c,
d40c->base->gen_dmac.num_event_groups)
invalid_dev_type = true;
- if (!conf->dir) {
+ if (conf->dir != DMA_MEM_TO_MEM &&
+ !is_slave_direction(conf->dir)) {
chan_err(d40c, "Invalid direction.\n");
res = -EINVAL;
}
@@ -2059,12 +2060,17 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user)
static int d40_config_memcpy(struct d40_chan *d40c)
{
dma_cap_mask_t cap = d40c->chan.device->cap_mask;
+ int ret;
if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) {
d40c->dma_cfg = dma40_memcpy_conf_log;
d40c->dma_cfg.dev_type =
d40c->base->plat_data->memcpy_channels[d40c->chan.chan_id];
+ ret = d40_validate_conf(d40c, &d40c->dma_cfg);
+ if (ret)
+ return ret;
+
d40_log_cfg(&d40c->dma_cfg,
&d40c->log_def.lcsp1, &d40c->log_def.lcsp3);
@@ -2072,6 +2078,10 @@ static int d40_config_memcpy(struct d40_chan *d40c)
dma_has_cap(DMA_SLAVE, cap)) {
d40c->dma_cfg = dma40_memcpy_conf_phy;
+ ret = d40_validate_conf(d40c, &d40c->dma_cfg);
+ if (ret)
+ return ret;
+
/* Generate interrupt at end of transfer or relink. */
d40c->dst_def_cfg |= BIT(D40_SREG_CFG_TIM_POS);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0901/1756] pNFS/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS over the mdsthreshold hint
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (899 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0900/1756] dmaengine: ste_dma40: Validate memcpy configuration Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0902/1756] pNFS/flexfiles: dont read through MDS when previous layout forbid it Greg Kroah-Hartman
` (97 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Snitzer, Anna Schumaker,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@kernel.org>
[ Upstream commit 78422f623c1e150e3cdfe62598c6e352a2dcfc5f ]
A flexfiles layout may carry FF_FLAGS_NO_IO_THRU_MDS, which tells the
client that this file's data must not be read or written through the
metadata server.
The RFC 5661 mdsthreshold hint pulls the other way. When a server returns
one, pnfs_within_mdsthreshold() answers "use MDS I/O" for every I/O below
the threshold, pnfs_update_layout() then hands back no segment, and
ff_layout_pg_init_read() reads through the MDS - the very thing the
layout forbids. A server that sets both is asking for two incompatible
things; the layout flag is the stronger statement, and the one whose
violation the client cannot recover from.
Record the policy on the inode, where it outlives the layout hdr that
carried it, and consult it before the hint:
- ff_layout_alloc_lseg() sets NFS_INO_NO_IO_THRU_MDS beside the existing
sticky hdr-level NFS4_FF_HDR_NO_IO_THRU_MDS bit.
- pnfs_within_mdsthreshold() returns false at once for such an inode, so
no I/O is diverted to the MDS on the strength of the hint.
The bit is never cleared for the life of the in-core inode. Servers are
assumed to be consistent in their no-fallback policy per file, which is
the assumption ff_layout_hdr_no_fallback_to_mds() already makes; a server
that was not would lose the effect of its mdsthreshold hint - a SHOULD -
on an inode that is already in core, and nothing else.
Fixes: 260074cd8413 ("pNFS/flexfiles: Add support for FF_FLAGS_NO_IO_THRU_MDS")
Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 5 ++++-
fs/nfs/internal.h | 29 ++++++++++++++++++++++++++
fs/nfs/pnfs.c | 12 ++++++++++-
3 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index d8751f1d519d1..d40f0c253b9b4 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -574,9 +574,12 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
if (!p)
goto out_sort_mirrors;
fls->flags = be32_to_cpup(p);
- if (fls->flags & FF_FLAGS_NO_IO_THRU_MDS)
+ if (fls->flags & FF_FLAGS_NO_IO_THRU_MDS) {
set_bit(NFS4_FF_HDR_NO_IO_THRU_MDS,
&FF_LAYOUT_FROM_HDR(lh)->flags);
+ /* Outlives this layout hdr; see NFS_INO_NO_IO_THRU_MDS */
+ nfs_set_no_io_thru_mds(lh->plh_inode);
+ }
p = xdr_inline_decode(&stream, 4);
if (!p)
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 7808b06f23323..da7087c80ceab 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -529,6 +529,35 @@ static inline bool nfs_file_io_is_buffered(struct nfs_inode *nfsi)
return test_bit(NFS_INO_ODIRECT, &nfsi->flags) == 0;
}
+/*
+ * Module-private nfs_inode->flags bit (not in <linux/nfs_fs.h>, so no
+ * exported layout changes): set, and never cleared for the life of the
+ * in-core inode, once a layout driver has seen the server forbid I/O
+ * through the MDS for this file (flexfiles sets it from
+ * FF_FLAGS_NO_IO_THRU_MDS in ff_layout_alloc_lseg()). The RFC 5661
+ * mdsthreshold hint must not be acted on for such a file, since the only
+ * thing pnfs_within_mdsthreshold() can ask for is the one thing the
+ * layout forbids. Servers are assumed to be consistent in their
+ * no-fallback policy per file, the same assumption
+ * ff_layout_hdr_no_fallback_to_mds() already makes; if one were not, the
+ * only effect is that its mdsthreshold hint - a SHOULD - stops being
+ * honored for an inode that is already in core.
+ */
+#define NFS_INO_NO_IO_THRU_MDS (30)
+
+static inline void nfs_set_no_io_thru_mds(struct inode *inode)
+{
+ struct nfs_inode *nfsi = NFS_I(inode);
+
+ if (!test_bit(NFS_INO_NO_IO_THRU_MDS, &nfsi->flags))
+ set_bit(NFS_INO_NO_IO_THRU_MDS, &nfsi->flags);
+}
+
+static inline bool nfs_no_io_thru_mds(struct inode *inode)
+{
+ return test_bit(NFS_INO_NO_IO_THRU_MDS, &NFS_I(inode)->flags);
+}
+
/* Must be called with exclusively locked inode->i_rwsem */
static inline void nfs_file_block_o_direct(struct nfs_inode *nfsi)
{
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 94028a881d443..33e8f8e816bd5 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1992,7 +1992,9 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo,
* is set to IOMODE_READ for a READ request, and set to IOMODE_RW for a
* WRITE request.
*
- * A return of true means use MDS I/O.
+ * A return of true means use MDS I/O, so for a file whose layout forbids
+ * that (see NFS_INO_NO_IO_THRU_MDS) the hint is not evaluated at all:
+ * there is no answer it could give that this client may act on.
*
* From rfc 5661:
* If a file's size is smaller than the file size threshold, data accesses
@@ -2013,6 +2015,14 @@ static bool pnfs_within_mdsthreshold(struct nfs_open_context *ctx,
if (t == NULL)
return ret;
+ /*
+ * The server has told a layout driver that this file's I/O may not
+ * go through the MDS (flexfiles FF_FLAGS_NO_IO_THRU_MDS). Honor
+ * that over its own mdsthreshold hint.
+ */
+ if (nfs_no_io_thru_mds(ino))
+ return ret;
+
dprintk("%s bm=0x%x rd_sz=%llu wr_sz=%llu rd_io=%llu wr_io=%llu\n",
__func__, t->bm, t->rd_sz, t->wr_sz, t->rd_io_sz, t->wr_io_sz);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0902/1756] pNFS/flexfiles: dont read through MDS when previous layout forbid it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (900 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0901/1756] pNFS/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS over the mdsthreshold hint Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0903/1756] pNFS/flexfiles: dont reset to MDS for v4 error " Greg Kroah-Hartman
` (96 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Snitzer, Anna Schumaker,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@kernel.org>
[ Upstream commit 2f007ba074ad77e70d941e16956d1937dc3080c6 ]
ff_layout_pg_init_read() falls back to the MDS whenever
pnfs_update_layout() returns no segment and no error: a bulk
CB_LAYOUTRECALL (FSID, DEVICEID or ALL), LAYOUTGETs blocked behind a
layout being returned, or a LAYOUTGET refused with
NFS4ERR_LAYOUTUNAVAILABLE or NFS4ERR_TOOSMALL, which set the per-iomode
fail bit for PNFS_LAYOUTGET_RETRY_TIMEOUT. That is the read-side twin
of the write path fixed by commit 1d62e659c0bf ("NFSv4/flexfiles:
honor FF_FLAGS_NO_IO_THRU_MDS in pg_get_mirror_count_write"), and it
is reached in exactly the situation that matters most: the file had a
valid layout, the layout had to go back, and the next one has not
arrived yet.
The write side could answer -EAGAIN because writeback owns the retry and
redirties the page. A read has no such owner, so -EAGAIN here would
surface as an I/O error to the application. Wait for a layout instead,
on the same terms the function already uses when the layout lookup
itself returns -EAGAIN: sleep a second and retry, bounded by
pg_maxretrans, which ff_layout_pg_init_read() sets only for soft and
softerr mounts. A hard mount therefore waits, which is what a hard
mount is for, and matches what the FF_FLAGS_NO_IO_THRU_MDS check on the
data server selection a few lines above already does. That includes
waiting out NFS4ERR_LAYOUTUNAVAILABLE: a file that was given a layout
with this flag must not be read off the MDS, whatever the server says
afterwards.
The test asks the inode (NFS_INO_NO_IO_THRU_MDS) rather than the layout
hdr, because in this path there is no segment, and the hdr that carried
the flag may already have been destroyed. Where a segment is in hand -
the data server selection above, ff_layout_read_pagelist() - the
existing per-segment ff_layout_no_fallback_to_mds() test stays, since it
is the more precise question.
Fixes: 260074cd8413 ("pNFS/flexfiles: Add support for FF_FLAGS_NO_IO_THRU_MDS")
Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 38 ++++++++++++++++++--------
1 file changed, 26 insertions(+), 12 deletions(-)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index d40f0c253b9b4..cfb2a24aa2c9e 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -918,19 +918,33 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio,
if (pgio->pg_error < 0) {
if (pgio->pg_error != -EAGAIN)
return;
- /* Retry getting layout segment if lower layer returned -EAGAIN */
- if (pgio->pg_maxretrans && req->wb_nio++ > pgio->pg_maxretrans) {
- if (NFS_SERVER(pgio->pg_inode)->flags & NFS_MOUNT_SOFTERR)
- pgio->pg_error = -ETIMEDOUT;
- else
- pgio->pg_error = -EIO;
- return;
- }
- pgio->pg_error = 0;
- /* Sleep for 1 second before retrying */
- ssleep(1);
- goto retry;
+ goto retry_nolseg;
+ }
+ /*
+ * No segment, and no error to report either: pnfs_update_layout()
+ * simply has nothing to give (NFS_LAYOUT_BULK_RECALL, a failed
+ * pnfs_layout_io_test, blocked LAYOUTGETs, a layout being
+ * returned). If the server forbids reading this file through the
+ * MDS there is no fallback to take, so wait for a layout on the
+ * same terms as the -EAGAIN above. The layout hdr that carried
+ * FF_FLAGS_NO_IO_THRU_MDS may itself be gone by now, which is why
+ * this asks the inode and not the hdr.
+ */
+ if (!nfs_no_io_thru_mds(pgio->pg_inode))
+ goto out_mds;
+retry_nolseg:
+ /* Retry getting layout segment if lower layer returned -EAGAIN */
+ if (pgio->pg_maxretrans && req->wb_nio++ > pgio->pg_maxretrans) {
+ if (NFS_SERVER(pgio->pg_inode)->flags & NFS_MOUNT_SOFTERR)
+ pgio->pg_error = -ETIMEDOUT;
+ else
+ pgio->pg_error = -EIO;
+ return;
}
+ pgio->pg_error = 0;
+ /* Sleep for 1 second before retrying */
+ ssleep(1);
+ goto retry;
out_mds:
trace_pnfs_mds_fallback_pg_init_read(pgio->pg_inode,
0, NFS4_MAX_UINT64, IOMODE_READ,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0903/1756] pNFS/flexfiles: dont reset to MDS for v4 error when previous layout forbid it
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (901 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0902/1756] pNFS/flexfiles: dont read through MDS when previous layout forbid it Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0904/1756] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Greg Kroah-Hartman
` (95 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Snitzer, Anna Schumaker,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Snitzer <snitzer@kernel.org>
[ Upstream commit ec906cf7bee60f3bbc8500bac14e65813e38ac93 ]
ff_layout_async_handle_error_v4() ends in -NFS4ERR_RESET_TO_MDS, which
makes ff_layout_read_release() / ff_layout_write_release() call
ff_layout_reset_read() or ff_layout_reset_write(hdr, false), and those
call pnfs_read_done_resend_to_mds() / pnfs_write_done_resend_to_mds().
Those build a page I/O descriptor with force_mds set, so the flexfiles
->pg_init() never runs and no layout is consulted anywhere on the way:
the READ or WRITE goes to the metadata server unconditionally. For a
layout carrying FF_FLAGS_NO_IO_THRU_MDS that is exactly what the server
forbade.
The fall-through into reset: is already safe, because
ff_layout_avoid_mds_available_ds() returns true for a segment with the
flag and so answers -NFS4ERR_RESET_TO_PNFS first. What is not safe is
the goto: the invalid-layout errors (NFS4ERR_PNFS_NO_LAYOUT, STALE,
BADHANDLE, ISDIR, FHEXPIRED, WRONG_TYPE) call pnfs_destroy_layout() and
jump straight to reset:, over that check. That is the case where the
file had a perfectly good layout, something forced it to be given back,
and the client answers by writing to the MDS behind the server's back.
Test at reset: itself, so it covers the goto and any future one, and ask
the inode (NFS_INO_NO_IO_THRU_MDS): the callers that jump here have just
destroyed the layout hdr, so the hdr-level flag is no longer reachable,
while the inode-level one is set for the life of the in-core inode.
-NFS4ERR_RESET_TO_PNFS is the right answer rather than an error. It is
what the fall-through already returns for the same flag, and the
resends it drives - ff_layout_resend_pnfs_read() and
ff_layout_reset_write(hdr, true) - re-enter the pgio path with force_mds
clear, so a fresh LAYOUTGET is taken, which is precisely what a
destroyed layout needs. A LAYOUTGET that fails fatally makes
pnfs_update_layout() return an error, which ->pg_init() reports; a
non-fatal refusal (NFS4ERR_LAYOUTUNAVAILABLE, NFS4ERR_TOOSMALL) returns
no segment instead, and the client keeps retrying through pNFS rather
than falling back.
ff_layout_async_handle_error_v3() needs no such change: it returns only
-NFS4ERR_RESET_TO_PNFS or -EAGAIN.
Fixes: 260074cd8413 ("pNFS/flexfiles: Add support for FF_FLAGS_NO_IO_THRU_MDS")
Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index cfb2a24aa2c9e..06861f9536502 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1250,6 +1250,23 @@ static int ff_layout_async_handle_error_v4(struct rpc_task *task,
if (ff_layout_avoid_mds_available_ds(lseg))
return -NFS4ERR_RESET_TO_PNFS;
reset:
+ /*
+ * FF_FLAGS_NO_IO_THRU_MDS: never resend through the MDS. The
+ * caller would do so with force_mds set (ff_layout_reset_read(),
+ * ff_layout_reset_write(hdr, false) -> pnfs_*_done_resend_to_mds()),
+ * which builds a descriptor out of the plain MDS page ops and so
+ * consults no layout at all -- this is the last point at which the
+ * policy can still be applied. Retry through pNFS instead, which
+ * takes a fresh LAYOUTGET; that is also the right answer for the
+ * invalid-layout cases that jump here, since they have just called
+ * pnfs_destroy_layout(). Having done so they can no longer ask the
+ * layout hdr about the flag, hence the inode.
+ */
+ if (nfs_no_io_thru_mds(inode)) {
+ dprintk("%s Retry through pNFS, no MDS fallback. Error %d\n",
+ __func__, task->tk_status);
+ return -NFS4ERR_RESET_TO_PNFS;
+ }
dprintk("%s Retry through MDS. Error %d\n", __func__,
task->tk_status);
return -NFS4ERR_RESET_TO_MDS;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0904/1756] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (902 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0903/1756] pNFS/flexfiles: dont reset to MDS for v4 error " Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0905/1756] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Greg Kroah-Hartman
` (94 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jernej Skrabec, Chen-Yu Tsai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wens@kernel.org>
[ Upstream commit d7287d940f3cd8d5945009076058a8120281744b ]
The SRAM C region contains a partial alias to the VE SRAM already
referenced by the video engine. To avoid access through this alias
window, the region should also be claimed by the video engine.
Add a reference to the SRAM C region to the video engine node.
Fixes: b542570e5605 ("arm64: dts: allwinner: h6: Add Video Engine node")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20260712030011.3778169-6-wens@kernel.org
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 2301c59b41b18..ba9b026677665 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -209,7 +209,7 @@ video-codec@1c0e000 {
clock-names = "ahb", "mod", "ram";
resets = <&ccu RST_BUS_VE>;
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
- allwinner,sram = <&ve_sram 1>;
+ allwinner,sram = <&ve_sram 1>, <&de2_sram 1>;
iommus = <&iommu 3>;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0905/1756] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU for video engine
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (903 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0904/1756] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0906/1756] ipv4: fix IP ID reuse in ip_select_ident_segs() Greg Kroah-Hartman
` (93 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jernej Skrabec, Chen-Yu Tsai,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wens@kernel.org>
[ Upstream commit 965a49fc413d996eba9bae2a3132f03f45a2ea1b ]
The video engine on the H6 actually has two IOMMU ports. The one already
listed is simply named "VE" in the user manual. The missing one is named
"VE_R" and is probably either read-only or used for reference frames.
Either way, it should be listed.
Add a reference to the "VE_R" IOMMU port to the video engine node.
Fixes: 62a8ccf3a248 ("arm64: dts: allwinner: h6: Fix Cedrus IOMMU usage")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20260712030011.3778169-7-wens@kernel.org
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index ba9b026677665..a00cf51debd73 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -210,7 +210,7 @@ video-codec@1c0e000 {
resets = <&ccu RST_BUS_VE>;
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
allwinner,sram = <&ve_sram 1>, <&de2_sram 1>;
- iommus = <&iommu 3>;
+ iommus = <&iommu 3>, <&iommu 1>;
};
gpu: gpu@1800000 {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0906/1756] ipv4: fix IP ID reuse in ip_select_ident_segs()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (904 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0905/1756] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0907/1756] ipv4: reserve one IP ID per segment for UDP GSO packets Greg Kroah-Hartman
` (92 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jiayuan Chen,
David Ahern, Willem de Bruijn, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit fe7ca0c13f7d477d6f461114815c57fde3f930ca ]
ip_select_ident_segs() must put the first of the @segs reserved IP IDs
in iph->id, as GSO assigns id, id + 1, ..., id + segs - 1 to segments.
Commit f866fbc842de ("ipv4: fix data-races around inet->inet_id")
used atomic_add_return() for non-TCP sockets, which returns the first
ID of the next packet instead. Consecutive GSO packets can then reuse
IP IDs.
SCTP GSO is affected. Other callers use segs == 1, and only see
a harmless off-by-one (UDP GSO has a separate, older issue).
Use atomic_fetch_add() instead, like the TCP path.
Fixes: f866fbc842de ("ipv4: fix data-races around inet->inet_id")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260930144018.1174068-2-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/ip.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/ip.h b/include/net/ip.h
index f00719e1863f7..8a81a177862a3 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -582,7 +582,7 @@ static inline void ip_select_ident_segs(struct net *net, struct sk_buff *skb,
val = atomic_read(&inet_sk(sk)->inet_id);
atomic_set(&inet_sk(sk)->inet_id, val + segs);
} else {
- val = atomic_add_return(segs, &inet_sk(sk)->inet_id);
+ val = atomic_fetch_add(segs, &inet_sk(sk)->inet_id);
}
iph->id = htons(val);
return;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0907/1756] ipv4: reserve one IP ID per segment for UDP GSO packets
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (905 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0906/1756] ipv4: fix IP ID reuse in ip_select_ident_segs() Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0908/1756] riscv: fix RVG_SYSTEM_CSR_MASK width mask Greg Kroah-Hartman
` (91 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Jiayuan Chen,
Willem de Bruijn, Jakub Kicinski, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit 852c08d6a99149dc71c51cea125b5083f555237e ]
__ip_make_skb() reserves a single IP ID for UDP GSO packets, but GSO
assigns one IP ID per segment. Following packets then reuse these IDs,
either from inet->inet_id or from the shared generator.
Unless IP_PMTUDISC_DO/PROBE is used, DF is not set on UDP GSO packets,
so segments can be fragmented on the path and IP ID reuse can lead to
incorrect reassembly.
Reserve one IP ID per segment, using the same test as udp_send_skb().
Fixes: bec1f6f69736 ("udp: generate gso with UDP_SEGMENT")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260930144018.1174068-3-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/ip_output.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 5db785eb9ef97..903ad073995eb 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1412,6 +1412,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
struct iphdr *iph;
u8 pmtudisc, ttl;
__be16 df = 0;
+ int segs;
skb = __skb_dequeue(queue);
if (!skb)
@@ -1466,7 +1467,19 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
iph->ttl = ttl;
iph->protocol = sk->sk_protocol;
ip_copy_addrs(iph, fl4);
- ip_select_ident(net, skb, sk);
+
+ /* UDP GSO packets are segmented later (see udp_send_skb()):
+ * reserve one IP ID per segment.
+ */
+ segs = 1;
+ if (cork->gso_size && sk_is_udp(sk)) {
+ int datalen = skb->len - skb_transport_offset(skb) -
+ sizeof(struct udphdr);
+
+ if (datalen > cork->gso_size)
+ segs = DIV_ROUND_UP(datalen, cork->gso_size);
+ }
+ ip_select_ident_segs(net, skb, sk, segs);
if (opt) {
iph->ihl += opt->optlen >> 2;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0908/1756] riscv: fix RVG_SYSTEM_CSR_MASK width mask
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (906 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0907/1756] ipv4: reserve one IP ID per segment for UDP GSO packets Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0909/1756] sh: uaccess: Require offsettable operands for 64-bit user access Greg Kroah-Hartman
` (90 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aurelien Jarno, Jisheng Zhang,
Paul Walmsley, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aurelien Jarno <aurelien@aurel32.net>
[ Upstream commit f89e5ee4d8c6cd56499cd87e550d4d4e19cf7e17 ]
RVG_SYSTEM_CSR_MASK should be 12 bits [31:20], shifted down by 20 bits.
Replace GENMASK(12, 0) by GENMASK(11, 0).
Fixes: cd054837243b ("riscv: Allocate user's vector context in the first-use trap")
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://patch.msgid.link/20260911194233.3379532-1-aurelien@aurel32.net
Signed-off-by: Paul Walmsley <pjw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/riscv/include/asm/insn.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/insn.h b/arch/riscv/include/asm/insn.h
index 09fde95a5e8f7..b4feda0622f63 100644
--- a/arch/riscv/include/asm/insn.h
+++ b/arch/riscv/include/asm/insn.h
@@ -141,7 +141,7 @@
#define RVG_OPCODE_JAL 0x6f
#define RVG_OPCODE_SYSTEM 0x73
#define RVG_SYSTEM_CSR_OFF 20
-#define RVG_SYSTEM_CSR_MASK GENMASK(12, 0)
+#define RVG_SYSTEM_CSR_MASK GENMASK(11, 0)
/* parts of opcode for RVF, RVD and RVQ */
#define RVFDQ_FL_FS_WIDTH_OFF 12
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0909/1756] sh: uaccess: Require offsettable operands for 64-bit user access
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (907 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0908/1756] riscv: fix RVG_SYSTEM_CSR_MASK width mask Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0910/1756] sh: defconfig: Enable the current M66592 UDC symbol Greg Kroah-Hartman
` (89 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Fuchs,
John Paul Adrian Glaubitz, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Fuchs <fuchsfl@gmail.com>
[ Upstream commit 8b5dba9ea4a3f5ed994f03d6ca7686c49491b426 ]
The 64-bit __get_user_u64()/__put_user_u64() paths address the memory
operand as %T2 (base+4). This base+4 requires an offsettable address,
but "m" also allows the indexed mode @(R0,Rn) (e.g. for a variable-
indexed array element), which has no displacement field for the +4.
Depending on optimization this build fails with "invalid 'asm'" or an
ICE in GCC's change_address_1.
Require an offsettable memory operand, allowing GCC to reload an
unsuitable indexed address into an appropriate form.
Fixes: 2d2b308a8b7d ("sh: Implement __get_user_u64() required for 64-bit get_user()")
Signed-off-by: Florian Fuchs <fuchsfl@gmail.com>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/sh/include/asm/uaccess_32.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h
index 5d7ddc092afd7..cef40414bfb13 100644
--- a/arch/sh/include/asm/uaccess_32.h
+++ b/arch/sh/include/asm/uaccess_32.h
@@ -92,7 +92,7 @@ __asm__ __volatile__( \
".long 1b + 2, 3b\n\t" \
".previous" \
:"=&r" (err), "=&r" (x) \
- :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+ :"o" (__m(addr)), "i" (-EFAULT), "0" (err)); })
#else
#define __get_user_u64(x, addr, err) \
({ \
@@ -116,7 +116,7 @@ __asm__ __volatile__( \
".long 1b + 2, 3b\n\t" \
".previous" \
:"=&r" (err), "=&r" (x) \
- :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+ :"o" (__m(addr)), "i" (-EFAULT), "0" (err)); })
#endif
#define __put_user_size(x,ptr,size,retval) \
@@ -196,7 +196,7 @@ __asm__ __volatile__( \
".long 1b, 3b\n\t" \
".previous" \
: "=r" (retval) \
- : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+ : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
: "memory"); })
#else
#define __put_user_u64(val,addr,retval) \
@@ -218,7 +218,7 @@ __asm__ __volatile__( \
".long 1b, 3b\n\t" \
".previous" \
: "=r" (retval) \
- : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+ : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
: "memory"); })
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0910/1756] sh: defconfig: Enable the current M66592 UDC symbol
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (908 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0909/1756] sh: uaccess: Require offsettable operands for 64-bit user access Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0911/1756] efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot() Greg Kroah-Hartman
` (88 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Geert Uytterhoeven,
John Paul Adrian Glaubitz, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 9b65dcd94222c37febf98127b1ac5452c94a16d0 ]
The M66592 UDC provider is built under CONFIG_USB_M66592. Several
SuperH defconfigs still enable the removed CONFIG_USB_GADGET_M66592
symbol.
Replace the stale entries with the current provider symbol.
Fixes: 193ab2a6070039e7 ("usb: gadget: allow multiple gadgets to be built")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Assisted-by: Codex:gpt-5
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> # build-tested
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/sh/configs/migor_defconfig | 2 +-
arch/sh/configs/sdk7786_defconfig | 2 +-
arch/sh/configs/shx3_defconfig | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig
index 2d1e65cad2398..b203a46354363 100644
--- a/arch/sh/configs/migor_defconfig
+++ b/arch/sh/configs/migor_defconfig
@@ -74,7 +74,7 @@ CONFIG_LOGO=y
# CONFIG_LOGO_SUPERH_MONO is not set
# CONFIG_LOGO_SUPERH_CLUT224 is not set
CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
CONFIG_USB_G_SERIAL=m
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_RS5C372=y
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
index 07894f13441ef..919709fdf92b4 100644
--- a/arch/sh/configs/sdk7786_defconfig
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -147,7 +147,7 @@ CONFIG_USB_MON=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_MAX6900=y
CONFIG_RTC_DRV_SH=y
diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig
index 9a0df5ea3866a..d0f642fc2438b 100644
--- a/arch/sh/configs/shx3_defconfig
+++ b/arch/sh/configs/shx3_defconfig
@@ -79,7 +79,7 @@ CONFIG_USB=y
CONFIG_USB_MON=y
CONFIG_USB_R8A66597_HCD=m
CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_M66592=y
+CONFIG_USB_M66592=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_SH=y
CONFIG_UIO=m
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0911/1756] efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (909 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0910/1756] sh: defconfig: Enable the current M66592 UDC symbol Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0912/1756] efi/riscv: libstub: Dont set image_size in handle_kernel_image() Greg Kroah-Hartman
` (87 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jonathan Cameron, Jason Gunthorpe,
Ard Biesheuvel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit d83fe67339f2032d8facf0fe8a047a4c5d15394f ]
Sashiko says fdt_addr can point to either an allocated fdt or the fdt from
get_fdt() which is memory owned by FW.
Only the allocated fdt should be freed on the error unwind path. Use a
dedicated variable for the allocation's size so that the free does not get
confused.
Fixes: 4fc8e738ff3e ("efi: libstub: remove DT dependency from generic stub")
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/fdt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c
index 6a337f1f8787b..b7a2d7aa61b4e 100644
--- a/drivers/firmware/efi/libstub/fdt.c
+++ b/drivers/firmware/efi/libstub/fdt.c
@@ -229,6 +229,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
u32 desc_ver;
efi_status_t status;
struct exit_boot_struct priv;
+ unsigned long fdt_size_allocated = 0;
unsigned long fdt_addr = 0;
unsigned long fdt_size = 0;
@@ -251,12 +252,13 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
if (strstr(cmdline_ptr, "dtb="))
efi_err("Ignoring DTB from command line.\n");
} else {
- status = efi_load_dtb(image, &fdt_addr, &fdt_size);
+ status = efi_load_dtb(image, &fdt_addr, &fdt_size_allocated);
if (status != EFI_SUCCESS && status != EFI_NOT_READY) {
efi_err("Failed to load device tree!\n");
goto fail;
}
+ fdt_size = fdt_size_allocated;
}
if (fdt_addr) {
@@ -334,7 +336,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle,
efi_free(MAX_FDT_SIZE, *new_fdt_addr);
fail:
- efi_free(fdt_size, fdt_addr);
+ efi_free(fdt_size_allocated, fdt_addr);
if (!efi_novamap)
efi_bs_call(free_pool, priv.runtime_map);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0912/1756] efi/riscv: libstub: Dont set image_size in handle_kernel_image()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (910 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0911/1756] efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot() Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0913/1756] x86/efi: Drop support for the EFI_PROPERTIES_TABLE Greg Kroah-Hartman
` (86 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason Gunthorpe, Ard Biesheuvel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit fd4465f49b53c7379d10610f8edb71f77366a5b7 ]
Sashiko points out the image_size should only be set if image_addr was
reassigned to some allocated memory. If image_size is not zero then the
caller will free the image_addr pointer.
efi_kaslr_relocate_kernel() never works like that, if it changes
image_addr to allocated memory the free is done through reserve_size.
Fixes: b7ac4b8ee73d ("riscv: libstub: Implement KASLR by using generic functions")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/riscv-stub.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/firmware/efi/libstub/riscv-stub.c b/drivers/firmware/efi/libstub/riscv-stub.c
index e7d9204baee31..725b634c51791 100644
--- a/drivers/firmware/efi/libstub/riscv-stub.c
+++ b/drivers/firmware/efi/libstub/riscv-stub.c
@@ -37,17 +37,14 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
kernel_codesize = __init_text_end - _start;
kernel_memsize = kernel_size + (_end - _edata);
*image_addr = (unsigned long)_start;
- *image_size = kernel_memsize;
- *reserve_size = *image_size;
+ *reserve_size = kernel_memsize;
status = efi_kaslr_relocate_kernel(image_addr,
reserve_addr, reserve_size,
kernel_size, kernel_codesize, kernel_memsize,
efi_kaslr_get_phys_seed(image_handle));
- if (status != EFI_SUCCESS) {
+ if (status != EFI_SUCCESS)
efi_err("Failed to relocate kernel\n");
- *image_size = 0;
- }
return status;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0913/1756] x86/efi: Drop support for the EFI_PROPERTIES_TABLE
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (911 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0912/1756] efi/riscv: libstub: Dont set image_size in handle_kernel_image() Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0914/1756] x86/efistub: Drop long obsolete UGA support Greg Kroah-Hartman
` (85 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel,
Nicolas Saenz Julienne, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Saenz Julienne <nsaenz@amazon.com>
[ Upstream commit 7eb4e1dd71009472215bc1f8226ee9a041da8d37 ]
Drop support for the EFI_PROPERTIES_TABLE. It was a failed, short-lived
experiment that broke the boot both on Linux and Windows, and was
replaced by the EFI_MEMORY_ATTRIBUTES_TABLE shortly after.
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Nicolas Saenz Julienne <nsaenz@amazon.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/platform/efi/efi.c | 19 ---------------
arch/x86/platform/efi/efi_64.c | 42 ----------------------------------
include/linux/efi.h | 17 +++-----------
3 files changed, 3 insertions(+), 75 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index e005d0a4143e6..152b0b43c68b2 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -54,14 +54,12 @@
#include <asm/uv/uv.h>
static unsigned long efi_systab_phys __initdata;
-static unsigned long prop_phys = EFI_INVALID_TABLE_ADDR;
static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR;
static unsigned long efi_runtime, efi_nr_tables;
unsigned long efi_fw_vendor, efi_config_table;
static const efi_config_table_type_t arch_tables[] __initconst = {
- {EFI_PROPERTIES_TABLE_GUID, &prop_phys, "PROP" },
{UGA_IO_PROTOCOL_GUID, &uga_phys, "UGA" },
#ifdef CONFIG_X86_UV
{UV_SYSTEM_TABLE_GUID, &uv_systab_phys, "UVsystab" },
@@ -82,7 +80,6 @@ static const unsigned long * const efi_tables[] = {
&efi_runtime,
&efi_config_table,
&efi.esrt,
- &prop_phys,
&efi_mem_attr_table,
#ifdef CONFIG_EFI_RCI2_TABLE
&rci2_table_phys,
@@ -502,22 +499,6 @@ void __init efi_init(void)
return;
}
- /* Parse the EFI Properties table if it exists */
- if (prop_phys != EFI_INVALID_TABLE_ADDR) {
- efi_properties_table_t *tbl;
-
- tbl = early_memremap_ro(prop_phys, sizeof(*tbl));
- if (tbl == NULL) {
- pr_err("Could not map Properties table!\n");
- } else {
- if (tbl->memory_protection_attribute &
- EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA)
- set_bit(EFI_NX_PE_DATA, &efi.flags);
-
- early_memunmap(tbl, sizeof(*tbl));
- }
- }
-
set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
efi_clean_memmap();
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index 91d31ac422d6c..ac57259a432b8 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -412,51 +412,9 @@ static int __init efi_update_mem_attr(struct mm_struct *mm, efi_memory_desc_t *m
void __init efi_runtime_update_mappings(void)
{
- efi_memory_desc_t *md;
-
- /*
- * Use the EFI Memory Attribute Table for mapping permissions if it
- * exists, since it is intended to supersede EFI_PROPERTIES_TABLE.
- */
if (efi_enabled(EFI_MEM_ATTR)) {
efi_disable_ibt_for_runtime = false;
efi_memattr_apply_permissions(NULL, efi_update_mem_attr);
- return;
- }
-
- /*
- * EFI_MEMORY_ATTRIBUTES_TABLE is intended to replace
- * EFI_PROPERTIES_TABLE. So, use EFI_PROPERTIES_TABLE to update
- * permissions only if EFI_MEMORY_ATTRIBUTES_TABLE is not
- * published by the firmware. Even if we find a buggy implementation of
- * EFI_MEMORY_ATTRIBUTES_TABLE, don't fall back to
- * EFI_PROPERTIES_TABLE, because of the same reason.
- */
-
- if (!efi_enabled(EFI_NX_PE_DATA))
- return;
-
- for_each_efi_memory_desc(md) {
- unsigned long pf = 0;
-
- if (!(md->attribute & EFI_MEMORY_RUNTIME))
- continue;
-
- if (!(md->attribute & EFI_MEMORY_WB))
- pf |= _PAGE_PCD;
-
- if ((md->attribute & EFI_MEMORY_XP) ||
- (md->type == EFI_RUNTIME_SERVICES_DATA))
- pf |= _PAGE_NX;
-
- if (!(md->attribute & EFI_MEMORY_RO) &&
- (md->type != EFI_RUNTIME_SERVICES_CODE))
- pf |= _PAGE_RW;
-
- if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
- pf |= _PAGE_ENC;
-
- efi_update_mappings(md, pf);
}
}
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 06e8d3c69f9e6..244e4e4efe1d6 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -380,7 +380,6 @@ void efi_native_runtime_setup(void);
#define EFI_SYSTEM_RESOURCE_TABLE_GUID EFI_GUID(0xb122a263, 0x3661, 0x4f68, 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80)
#define EFI_FILE_SYSTEM_GUID EFI_GUID(0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
#define DEVICE_TREE_GUID EFI_GUID(0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0)
-#define EFI_PROPERTIES_TABLE_GUID EFI_GUID(0x880aaca3, 0x4adc, 0x4a04, 0x90, 0x79, 0xb7, 0x47, 0x34, 0x08, 0x25, 0xe5)
#define EFI_RNG_PROTOCOL_GUID EFI_GUID(0x3152bca5, 0xeade, 0x433d, 0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44)
#define EFI_RNG_ALGORITHM_RAW EFI_GUID(0xe43176d7, 0xb6e8, 0x4827, 0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61)
#define EFI_MEMORY_ATTRIBUTES_TABLE_GUID EFI_GUID(0xdcfa911d, 0x26eb, 0x469f, 0xa2, 0x20, 0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20)
@@ -581,15 +580,6 @@ struct efi_mem_range {
u64 attribute;
};
-typedef struct {
- u32 version;
- u32 length;
- u64 memory_protection_attribute;
-} efi_properties_table_t;
-
-#define EFI_PROPERTIES_TABLE_VERSION 0x00010000
-#define EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA 0x1
-
typedef struct {
u16 version;
u16 length;
@@ -872,10 +862,9 @@ static inline int efi_range_is_wc(unsigned long start, unsigned long len)
#define EFI_PARAVIRT 6 /* Access is via a paravirt interface */
#define EFI_ARCH_1 7 /* First arch-specific bit */
#define EFI_DBG 8 /* Print additional debug info at runtime */
-#define EFI_NX_PE_DATA 9 /* Can runtime data regions be mapped non-executable? */
-#define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
-#define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */
-#define EFI_PRESERVE_BS_REGIONS 12 /* Are EFI boot-services memory segments available? */
+#define EFI_MEM_ATTR 9 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
+#define EFI_MEM_NO_SOFT_RESERVE 10 /* Is the kernel configured to ignore soft reservations? */
+#define EFI_PRESERVE_BS_REGIONS 11 /* Are EFI boot-services memory segments available? */
#ifdef CONFIG_EFI
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0914/1756] x86/efistub: Drop long obsolete UGA support
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (912 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0913/1756] x86/efi: Drop support for the EFI_PROPERTIES_TABLE Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0915/1756] efi/libstub: Use C99-style for loop to traverse handle buffer Greg Kroah-Hartman
` (84 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit 144d52dd8fc83a082a275e1b663e7454d2b616a4 ]
UGA is the EFI graphical output protocol that preceded GOP, and has been
long obsolete. Drop support for it from the x86 implementation of the
EFI stub - other architectures never bothered to implement it (save for
ia64)
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/platform/efi/efi.c | 10 ---
drivers/firmware/efi/efi.c | 3 -
drivers/firmware/efi/libstub/x86-stub.c | 90 -------------------------
include/linux/efi.h | 4 --
4 files changed, 107 deletions(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 152b0b43c68b2..b74f7d510801e 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -54,13 +54,11 @@
#include <asm/uv/uv.h>
static unsigned long efi_systab_phys __initdata;
-static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR;
static unsigned long efi_runtime, efi_nr_tables;
unsigned long efi_fw_vendor, efi_config_table;
static const efi_config_table_type_t arch_tables[] __initconst = {
- {UGA_IO_PROTOCOL_GUID, &uga_phys, "UGA" },
#ifdef CONFIG_X86_UV
{UV_SYSTEM_TABLE_GUID, &uv_systab_phys, "UVsystab" },
#endif
@@ -72,7 +70,6 @@ static const unsigned long * const efi_tables[] = {
&efi.acpi20,
&efi.smbios,
&efi.smbios3,
- &uga_phys,
#ifdef CONFIG_X86_UV
&uv_systab_phys,
#endif
@@ -890,13 +887,6 @@ bool efi_is_table_address(unsigned long phys_addr)
return false;
}
-char *efi_systab_show_arch(char *str)
-{
- if (uga_phys != EFI_INVALID_TABLE_ADDR)
- str += sprintf(str, "UGA=0x%lx\n", uga_phys);
- return str;
-}
-
#define EFI_FIELD(var) efi_ ## var
#define EFI_ATTR_SHOW(name) \
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index fcafaed37f93e..19d2966cf7dc2 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -148,9 +148,6 @@ static ssize_t systab_show(struct kobject *kobj,
if (efi.smbios != EFI_INVALID_TABLE_ADDR)
str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
- if (IS_ENABLED(CONFIG_X86))
- str = efi_systab_show_arch(str);
-
return str - buf;
}
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index f8e465da344d5..f8f9e043c283c 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -405,96 +405,13 @@ static void setup_quirks(struct boot_params *boot_params)
}
}
-/*
- * See if we have Universal Graphics Adapter (UGA) protocol
- */
-static efi_status_t
-setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size)
-{
- efi_status_t status;
- u32 width, height;
- void **uga_handle = NULL;
- efi_uga_draw_protocol_t *uga = NULL, *first_uga;
- efi_handle_t handle;
- int i;
-
- status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, size,
- (void **)&uga_handle);
- if (status != EFI_SUCCESS)
- return status;
-
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
- uga_proto, NULL, &size, uga_handle);
- if (status != EFI_SUCCESS)
- goto free_handle;
-
- height = 0;
- width = 0;
-
- first_uga = NULL;
- for_each_efi_handle(handle, uga_handle, size, i) {
- efi_guid_t pciio_proto = EFI_PCI_IO_PROTOCOL_GUID;
- u32 w, h, depth, refresh;
- void *pciio;
-
- status = efi_bs_call(handle_protocol, handle, uga_proto,
- (void **)&uga);
- if (status != EFI_SUCCESS)
- continue;
-
- pciio = NULL;
- efi_bs_call(handle_protocol, handle, &pciio_proto, &pciio);
-
- status = efi_call_proto(uga, get_mode, &w, &h, &depth, &refresh);
- if (status == EFI_SUCCESS && (!first_uga || pciio)) {
- width = w;
- height = h;
-
- /*
- * Once we've found a UGA supporting PCIIO,
- * don't bother looking any further.
- */
- if (pciio)
- break;
-
- first_uga = uga;
- }
- }
-
- if (!width && !height)
- goto free_handle;
-
- /* EFI framebuffer */
- si->orig_video_isVGA = VIDEO_TYPE_EFI;
-
- si->lfb_depth = 32;
- si->lfb_width = width;
- si->lfb_height = height;
-
- si->red_size = 8;
- si->red_pos = 16;
- si->green_size = 8;
- si->green_pos = 8;
- si->blue_size = 8;
- si->blue_pos = 0;
- si->rsvd_size = 8;
- si->rsvd_pos = 24;
-
-free_handle:
- efi_bs_call(free_pool, uga_handle);
-
- return status;
-}
-
static void setup_graphics(struct boot_params *boot_params)
{
efi_guid_t graphics_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
struct screen_info *si;
- efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
efi_status_t status;
unsigned long size;
void **gop_handle = NULL;
- void **uga_handle = NULL;
si = &boot_params->screen_info;
memset(si, 0, sizeof(*si));
@@ -505,13 +422,6 @@ static void setup_graphics(struct boot_params *boot_params)
if (status == EFI_BUFFER_TOO_SMALL)
status = efi_setup_gop(si, &graphics_proto, size);
- if (status != EFI_SUCCESS) {
- size = 0;
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
- &uga_proto, NULL, &size, uga_handle);
- if (status == EFI_BUFFER_TOO_SMALL)
- setup_uga(si, &uga_proto, size);
- }
}
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 244e4e4efe1d6..4456a9d51c0de 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -364,7 +364,6 @@ void efi_native_runtime_setup(void);
#define ACPI_20_TABLE_GUID EFI_GUID(0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81)
#define SMBIOS_TABLE_GUID EFI_GUID(0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
#define SMBIOS3_TABLE_GUID EFI_GUID(0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94)
-#define UGA_IO_PROTOCOL_GUID EFI_GUID(0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2)
#define EFI_GLOBAL_VARIABLE_GUID EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c)
#define UV_SYSTEM_TABLE_GUID EFI_GUID(0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93)
#define LINUX_EFI_CRASH_GUID EFI_GUID(0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0)
@@ -374,7 +373,6 @@ void efi_native_runtime_setup(void);
#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID EFI_GUID(0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c)
#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID EFI_GUID(0x05c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e)
#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a)
-#define EFI_UGA_PROTOCOL_GUID EFI_GUID(0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39)
#define EFI_PCI_IO_PROTOCOL_GUID EFI_GUID(0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a)
#define EFI_FILE_INFO_ID EFI_GUID(0x09576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
#define EFI_SYSTEM_RESOURCE_TABLE_GUID EFI_GUID(0xb122a263, 0x3661, 0x4f68, 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80)
@@ -1287,8 +1285,6 @@ struct linux_efi_memreserve {
void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size);
-char *efi_systab_show_arch(char *str);
-
/*
* The LINUX_EFI_MOK_VARIABLE_TABLE_GUID config table can be provided
* to the kernel by an EFI boot loader. The table contains a packed
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0915/1756] efi/libstub: Use C99-style for loop to traverse handle buffer
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (913 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0914/1756] x86/efistub: Drop long obsolete UGA support Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0916/1756] efi/libstub: Simplify GOP handling code Greg Kroah-Hartman
` (83 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit c14bca3f7aa94fd8d3f5e621ce5b56535ef2396b ]
Tweak the for_each_efi_handle() macro in order to avoid the need on the
part of the caller to provide a loop counter variable.
Also move efi_get_handle_num() to the callers, so that each occurrence
can be replaced with the actual number returned by the simplified
LocateHandleBuffer API.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/efistub.h | 9 ++++-----
drivers/firmware/efi/libstub/gop.c | 3 +--
drivers/firmware/efi/libstub/pci.c | 5 ++---
drivers/firmware/efi/libstub/x86-stub.c | 3 +--
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index a2838e36f3f9f..21986fd151426 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -122,11 +122,10 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
#define efi_get_handle_num(size) \
((size) / (efi_is_native() ? sizeof(efi_handle_t) : sizeof(u32)))
-#define for_each_efi_handle(handle, array, size, i) \
- for (i = 0; \
- i < efi_get_handle_num(size) && \
- ((handle = efi_get_handle_at((array), i)) || true); \
- i++)
+#define for_each_efi_handle(handle, array, num) \
+ for (int __i = 0; __i < (num) && \
+ ((handle = efi_get_handle_at((array), __i)) || true); \
+ __i++)
static inline
void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c
index ea5da307d542f..8eef63c48288d 100644
--- a/drivers/firmware/efi/libstub/gop.c
+++ b/drivers/firmware/efi/libstub/gop.c
@@ -466,11 +466,10 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles)
{
efi_graphics_output_protocol_t *first_gop;
efi_handle_t h;
- int i;
first_gop = NULL;
- for_each_efi_handle(h, handles, size, i) {
+ for_each_efi_handle(h, handles, efi_get_handle_num(size)) {
efi_status_t status;
efi_graphics_output_protocol_t *gop;
diff --git a/drivers/firmware/efi/libstub/pci.c b/drivers/firmware/efi/libstub/pci.c
index 99fb25d2bcf54..b0ba372c26c55 100644
--- a/drivers/firmware/efi/libstub/pci.c
+++ b/drivers/firmware/efi/libstub/pci.c
@@ -21,7 +21,6 @@ void efi_pci_disable_bridge_busmaster(void)
efi_handle_t handle;
efi_status_t status;
u16 class, command;
- int i;
status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, &pci_proto,
NULL, &pci_handle_size, NULL);
@@ -46,7 +45,7 @@ void efi_pci_disable_bridge_busmaster(void)
goto free_handle;
}
- for_each_efi_handle(handle, pci_handle, pci_handle_size, i) {
+ for_each_efi_handle(handle, pci_handle, efi_get_handle_num(pci_handle_size)) {
efi_pci_io_protocol_t *pci;
unsigned long segment_nr, bus_nr, device_nr, func_nr;
@@ -82,7 +81,7 @@ void efi_pci_disable_bridge_busmaster(void)
efi_bs_call(disconnect_controller, handle, NULL, NULL);
}
- for_each_efi_handle(handle, pci_handle, pci_handle_size, i) {
+ for_each_efi_handle(handle, pci_handle, efi_get_handle_num(pci_handle_size)) {
efi_pci_io_protocol_t *pci;
status = efi_bs_call(handle_protocol, handle, &pci_proto,
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index f8f9e043c283c..f77d6fd7e1154 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -124,7 +124,6 @@ static void setup_efi_pci(struct boot_params *params)
unsigned long size = 0;
struct setup_data *data;
efi_handle_t h;
- int i;
status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
&pci_proto, NULL, &size, pci_handle);
@@ -150,7 +149,7 @@ static void setup_efi_pci(struct boot_params *params)
while (data && data->next)
data = (struct setup_data *)(unsigned long)data->next;
- for_each_efi_handle(h, pci_handle, size, i) {
+ for_each_efi_handle(h, pci_handle, efi_get_handle_num(size)) {
efi_pci_io_protocol_t *pci = NULL;
struct pci_setup_rom *rom;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0916/1756] efi/libstub: Simplify GOP handling code
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (914 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0915/1756] efi/libstub: Use C99-style for loop to traverse handle buffer Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0917/1756] efi/libstub: Simplify PCI I/O handle buffer traversal Greg Kroah-Hartman
` (82 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit 60a34085c36d6eb292c1e03bc355b1aa3a74a689 ]
Use the LocateHandleBuffer() API and a __free() function to simplify the
logic that allocates a handle buffer to iterate over all GOP protocols
in the EFI database.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/efi.h | 3 ++
drivers/firmware/efi/libstub/efi-stub.c | 28 +++++-------
drivers/firmware/efi/libstub/efistub.h | 9 ++--
drivers/firmware/efi/libstub/gop.c | 57 +++++++++----------------
drivers/firmware/efi/libstub/x86-stub.c | 17 +-------
5 files changed, 40 insertions(+), 74 deletions(-)
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index 222410af815cf..dc8fe1361c18e 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -250,6 +250,9 @@ static inline u32 efi64_convert_status(efi_status_t status)
#define __efi64_argmap_allocate_pool(type, size, buffer) \
((type), (size), efi64_zero_upper(buffer))
+#define __efi64_argmap_locate_handle_buffer(type, proto, key, num, buf) \
+ ((type), (proto), (key), efi64_zero_upper(num), efi64_zero_upper(buf))
+
#define __efi64_argmap_create_event(type, tpl, f, c, event) \
((type), (tpl), (f), (c), efi64_zero_upper(event))
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 438c7aed2d287..52b7029707642 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -10,6 +10,7 @@
*/
#include <linux/efi.h>
+#include <linux/screen_info.h>
#include <asm/efi.h>
#include "efistub.h"
@@ -53,25 +54,16 @@ void __weak free_screen_info(struct screen_info *si)
static struct screen_info *setup_graphics(void)
{
- efi_guid_t gop_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
- efi_status_t status;
- unsigned long size;
- void **gop_handle = NULL;
- struct screen_info *si = NULL;
+ struct screen_info *si, tmp = {};
- size = 0;
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
- &gop_proto, NULL, &size, gop_handle);
- if (status == EFI_BUFFER_TOO_SMALL) {
- si = alloc_screen_info();
- if (!si)
- return NULL;
- status = efi_setup_gop(si, &gop_proto, size);
- if (status != EFI_SUCCESS) {
- free_screen_info(si);
- return NULL;
- }
- }
+ if (efi_setup_gop(&tmp) != EFI_SUCCESS)
+ return NULL;
+
+ si = alloc_screen_info();
+ if (!si)
+ return NULL;
+
+ *si = tmp;
return si;
}
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index 21986fd151426..154d15901a1c6 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -4,6 +4,7 @@
#define _DRIVERS_FIRMWARE_EFI_EFISTUB_H
#include <linux/compiler.h>
+#include <linux/cleanup.h>
#include <linux/efi.h>
#include <linux/kernel.h>
#include <linux/kern_levels.h>
@@ -313,7 +314,9 @@ union efi_boot_services {
void *close_protocol;
void *open_protocol_information;
void *protocols_per_handle;
- void *locate_handle_buffer;
+ efi_status_t (__efiapi *locate_handle_buffer)(int, efi_guid_t *,
+ void *, unsigned long *,
+ efi_handle_t **);
efi_status_t (__efiapi *locate_protocol)(efi_guid_t *, void *,
void **);
efi_status_t (__efiapi *install_multiple_protocol_interfaces)(efi_handle_t *, ...);
@@ -1052,6 +1055,7 @@ void efi_puts(const char *str);
__printf(1, 2) int efi_printk(char const *fmt, ...);
void efi_free(unsigned long size, unsigned long addr);
+DEFINE_FREE(efi_pool, void *, if (_T) efi_bs_call(free_pool, _T));
void efi_apply_loadoptions_quirk(const void **load_options, u32 *load_options_size);
@@ -1081,8 +1085,7 @@ efi_status_t efi_parse_options(char const *cmdline);
void efi_parse_option_graphics(char *option);
-efi_status_t efi_setup_gop(struct screen_info *si, efi_guid_t *proto,
- unsigned long size);
+efi_status_t efi_setup_gop(struct screen_info *si);
efi_status_t handle_cmdline_files(efi_loaded_image_t *image,
const efi_char16_t *optstr,
diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c
index 8eef63c48288d..a4b3d18f91da8 100644
--- a/drivers/firmware/efi/libstub/gop.c
+++ b/drivers/firmware/efi/libstub/gop.c
@@ -461,25 +461,25 @@ setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line,
}
}
-static efi_graphics_output_protocol_t *
-find_gop(efi_guid_t *proto, unsigned long size, void **handles)
+static efi_graphics_output_protocol_t *find_gop(unsigned long num,
+ const efi_handle_t handles[])
{
efi_graphics_output_protocol_t *first_gop;
efi_handle_t h;
first_gop = NULL;
- for_each_efi_handle(h, handles, efi_get_handle_num(size)) {
+ for_each_efi_handle(h, handles, num) {
efi_status_t status;
efi_graphics_output_protocol_t *gop;
efi_graphics_output_protocol_mode_t *mode;
efi_graphics_output_mode_info_t *info;
-
- efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID;
void *dummy = NULL;
- status = efi_bs_call(handle_protocol, h, proto, (void **)&gop);
+ status = efi_bs_call(handle_protocol, h,
+ &EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID,
+ (void **)&gop);
if (status != EFI_SUCCESS)
continue;
@@ -499,7 +499,8 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles)
* Once we've found a GOP supporting ConOut,
* don't bother looking any further.
*/
- status = efi_bs_call(handle_protocol, h, &conout_proto, &dummy);
+ status = efi_bs_call(handle_protocol, h,
+ &EFI_CONSOLE_OUT_DEVICE_GUID, &dummy);
if (status == EFI_SUCCESS)
return gop;
@@ -510,16 +511,22 @@ find_gop(efi_guid_t *proto, unsigned long size, void **handles)
return first_gop;
}
-static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
- unsigned long size, void **handles)
+efi_status_t efi_setup_gop(struct screen_info *si)
{
- efi_graphics_output_protocol_t *gop;
+ efi_handle_t *handles __free(efi_pool) = NULL;
efi_graphics_output_protocol_mode_t *mode;
efi_graphics_output_mode_info_t *info;
+ efi_graphics_output_protocol_t *gop;
+ efi_status_t status;
+ unsigned long num;
- gop = find_gop(proto, size, handles);
+ status = efi_bs_call(locate_handle_buffer, EFI_LOCATE_BY_PROTOCOL,
+ &EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID, NULL, &num,
+ &handles);
+ if (status != EFI_SUCCESS)
+ return status;
- /* Did we find any GOPs? */
+ gop = find_gop(num, handles);
if (!gop)
return EFI_NOT_FOUND;
@@ -551,29 +558,3 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
return EFI_SUCCESS;
}
-
-/*
- * See if we have Graphics Output Protocol
- */
-efi_status_t efi_setup_gop(struct screen_info *si, efi_guid_t *proto,
- unsigned long size)
-{
- efi_status_t status;
- void **gop_handle = NULL;
-
- status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, size,
- (void **)&gop_handle);
- if (status != EFI_SUCCESS)
- return status;
-
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, proto, NULL,
- &size, gop_handle);
- if (status != EFI_SUCCESS)
- goto free_handle;
-
- status = setup_gop(si, proto, size, gop_handle);
-
-free_handle:
- efi_bs_call(free_pool, gop_handle);
- return status;
-}
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index f77d6fd7e1154..76e611ffadccb 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -406,24 +406,11 @@ static void setup_quirks(struct boot_params *boot_params)
static void setup_graphics(struct boot_params *boot_params)
{
- efi_guid_t graphics_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
- struct screen_info *si;
- efi_status_t status;
- unsigned long size;
- void **gop_handle = NULL;
-
- si = &boot_params->screen_info;
- memset(si, 0, sizeof(*si));
-
- size = 0;
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
- &graphics_proto, NULL, &size, gop_handle);
- if (status == EFI_BUFFER_TOO_SMALL)
- status = efi_setup_gop(si, &graphics_proto, size);
+ struct screen_info *si = memset(&boot_params->screen_info, 0, sizeof(*si));
+ efi_setup_gop(si);
}
-
static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
{
efi_bs_call(exit, handle, status, 0, NULL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0917/1756] efi/libstub: Simplify PCI I/O handle buffer traversal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (915 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0916/1756] efi/libstub: Simplify GOP handling code Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0918/1756] efi/libstub: Use cleanup helpers for freeing copies of the memory map Greg Kroah-Hartman
` (81 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit 90534e689d2e52202c276ade5cf1dfc13d9e116f ]
Use LocateHandleBuffer() and a __free() cleanup helper to simplify the
PCI I/O handle buffer traversal code.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/pci.c | 33 ++++++-------------------
drivers/firmware/efi/libstub/x86-stub.c | 29 +++++-----------------
2 files changed, 13 insertions(+), 49 deletions(-)
diff --git a/drivers/firmware/efi/libstub/pci.c b/drivers/firmware/efi/libstub/pci.c
index b0ba372c26c55..1dccf77958d3a 100644
--- a/drivers/firmware/efi/libstub/pci.c
+++ b/drivers/firmware/efi/libstub/pci.c
@@ -16,36 +16,20 @@
void efi_pci_disable_bridge_busmaster(void)
{
efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
- unsigned long pci_handle_size = 0;
- efi_handle_t *pci_handle = NULL;
+ efi_handle_t *pci_handle __free(efi_pool) = NULL;
+ unsigned long pci_handle_num;
efi_handle_t handle;
efi_status_t status;
u16 class, command;
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, &pci_proto,
- NULL, &pci_handle_size, NULL);
-
- if (status != EFI_BUFFER_TOO_SMALL) {
- if (status != EFI_SUCCESS && status != EFI_NOT_FOUND)
- efi_err("Failed to locate PCI I/O handles'\n");
- return;
- }
-
- status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, pci_handle_size,
- (void **)&pci_handle);
+ status = efi_bs_call(locate_handle_buffer, EFI_LOCATE_BY_PROTOCOL,
+ &pci_proto, NULL, &pci_handle_num, &pci_handle);
if (status != EFI_SUCCESS) {
- efi_err("Failed to allocate memory for 'pci_handle'\n");
+ efi_err("Failed to locate PCI I/O handles\n");
return;
}
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL, &pci_proto,
- NULL, &pci_handle_size, pci_handle);
- if (status != EFI_SUCCESS) {
- efi_err("Failed to locate PCI I/O handles'\n");
- goto free_handle;
- }
-
- for_each_efi_handle(handle, pci_handle, efi_get_handle_num(pci_handle_size)) {
+ for_each_efi_handle(handle, pci_handle, pci_handle_num) {
efi_pci_io_protocol_t *pci;
unsigned long segment_nr, bus_nr, device_nr, func_nr;
@@ -81,7 +65,7 @@ void efi_pci_disable_bridge_busmaster(void)
efi_bs_call(disconnect_controller, handle, NULL, NULL);
}
- for_each_efi_handle(handle, pci_handle, efi_get_handle_num(pci_handle_size)) {
+ for_each_efi_handle(handle, pci_handle, pci_handle_num) {
efi_pci_io_protocol_t *pci;
status = efi_bs_call(handle_protocol, handle, &pci_proto,
@@ -107,7 +91,4 @@ void efi_pci_disable_bridge_busmaster(void)
if (status != EFI_SUCCESS)
efi_err("Failed to disable PCI busmastering\n");
}
-
-free_handle:
- efi_bs_call(free_pool, pci_handle);
}
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 76e611ffadccb..b11c46215a81f 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -119,37 +119,23 @@ preserve_pci_rom_image(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom)
static void setup_efi_pci(struct boot_params *params)
{
efi_status_t status;
- void **pci_handle = NULL;
+ efi_handle_t *pci_handle __free(efi_pool) = NULL;
efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
- unsigned long size = 0;
struct setup_data *data;
+ unsigned long num;
efi_handle_t h;
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
- &pci_proto, NULL, &size, pci_handle);
-
- if (status == EFI_BUFFER_TOO_SMALL) {
- status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, size,
- (void **)&pci_handle);
-
- if (status != EFI_SUCCESS) {
- efi_err("Failed to allocate memory for 'pci_handle'\n");
- return;
- }
-
- status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
- &pci_proto, NULL, &size, pci_handle);
- }
-
+ status = efi_bs_call(locate_handle_buffer, EFI_LOCATE_BY_PROTOCOL,
+ &pci_proto, NULL, &num, &pci_handle);
if (status != EFI_SUCCESS)
- goto free_handle;
+ return;
data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
while (data && data->next)
data = (struct setup_data *)(unsigned long)data->next;
- for_each_efi_handle(h, pci_handle, efi_get_handle_num(size)) {
+ for_each_efi_handle(h, pci_handle, num) {
efi_pci_io_protocol_t *pci = NULL;
struct pci_setup_rom *rom;
@@ -169,9 +155,6 @@ static void setup_efi_pci(struct boot_params *params)
data = (struct setup_data *)rom;
}
-
-free_handle:
- efi_bs_call(free_pool, pci_handle);
}
static void retrieve_apple_device_properties(struct boot_params *boot_params)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0918/1756] efi/libstub: Use cleanup helpers for freeing copies of the memory map
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (916 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0917/1756] efi/libstub: Simplify PCI I/O handle buffer traversal Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0919/1756] x86/efistub: Merge PE and handover entrypoints Greg Kroah-Hartman
` (80 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit ad69b0b6f9954796875ee4faf6c16c9caca21999 ]
The EFI stub may obtain the memory map from the firmware numerous times,
and this involves doing a EFI pool allocation first, which needs to be
freed after use.
Streamline this using a cleanup helper, which makes the code easier to
follow.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/kaslr.c | 4 +---
drivers/firmware/efi/libstub/mem.c | 20 ++++++++------------
drivers/firmware/efi/libstub/randomalloc.c | 4 +---
drivers/firmware/efi/libstub/relocate.c | 10 ++++------
drivers/firmware/efi/libstub/x86-stub.c | 11 ++++++-----
5 files changed, 20 insertions(+), 29 deletions(-)
diff --git a/drivers/firmware/efi/libstub/kaslr.c b/drivers/firmware/efi/libstub/kaslr.c
index 6318c40bda38a..4bc963e999eb9 100644
--- a/drivers/firmware/efi/libstub/kaslr.c
+++ b/drivers/firmware/efi/libstub/kaslr.c
@@ -57,7 +57,7 @@ u32 efi_kaslr_get_phys_seed(efi_handle_t image_handle)
*/
static bool check_image_region(u64 base, u64 size)
{
- struct efi_boot_memmap *map;
+ struct efi_boot_memmap *map __free(efi_pool) = NULL;
efi_status_t status;
bool ret = false;
int map_offset;
@@ -80,8 +80,6 @@ static bool check_image_region(u64 base, u64 size)
}
}
- efi_bs_call(free_pool, map);
-
return ret;
}
diff --git a/drivers/firmware/efi/libstub/mem.c b/drivers/firmware/efi/libstub/mem.c
index 4f1fa302234d8..9c82259eea816 100644
--- a/drivers/firmware/efi/libstub/mem.c
+++ b/drivers/firmware/efi/libstub/mem.c
@@ -20,10 +20,10 @@
efi_status_t efi_get_memory_map(struct efi_boot_memmap **map,
bool install_cfg_tbl)
{
+ struct efi_boot_memmap tmp, *m __free(efi_pool) = NULL;
int memtype = install_cfg_tbl ? EFI_ACPI_RECLAIM_MEMORY
: EFI_LOADER_DATA;
efi_guid_t tbl_guid = LINUX_EFI_BOOT_MEMMAP_GUID;
- struct efi_boot_memmap *m, tmp;
efi_status_t status;
unsigned long size;
@@ -48,24 +48,20 @@ efi_status_t efi_get_memory_map(struct efi_boot_memmap **map,
*/
status = efi_bs_call(install_configuration_table, &tbl_guid, m);
if (status != EFI_SUCCESS)
- goto free_map;
+ return status;
}
m->buff_size = m->map_size = size;
status = efi_bs_call(get_memory_map, &m->map_size, m->map, &m->map_key,
&m->desc_size, &m->desc_ver);
- if (status != EFI_SUCCESS)
- goto uninstall_table;
+ if (status != EFI_SUCCESS) {
+ if (install_cfg_tbl)
+ efi_bs_call(install_configuration_table, &tbl_guid, NULL);
+ return status;
+ }
- *map = m;
+ *map = no_free_ptr(m);
return EFI_SUCCESS;
-
-uninstall_table:
- if (install_cfg_tbl)
- efi_bs_call(install_configuration_table, &tbl_guid, NULL);
-free_map:
- efi_bs_call(free_pool, m);
- return status;
}
/**
diff --git a/drivers/firmware/efi/libstub/randomalloc.c b/drivers/firmware/efi/libstub/randomalloc.c
index 593e98e3b993e..fd80b2f3233aa 100644
--- a/drivers/firmware/efi/libstub/randomalloc.c
+++ b/drivers/firmware/efi/libstub/randomalloc.c
@@ -62,9 +62,9 @@ efi_status_t efi_random_alloc(unsigned long size,
unsigned long alloc_min,
unsigned long alloc_max)
{
+ struct efi_boot_memmap *map __free(efi_pool) = NULL;
unsigned long total_slots = 0, target_slot;
unsigned long total_mirrored_slots = 0;
- struct efi_boot_memmap *map;
efi_status_t status;
int map_offset;
@@ -137,7 +137,5 @@ efi_status_t efi_random_alloc(unsigned long size,
break;
}
- efi_bs_call(free_pool, map);
-
return status;
}
diff --git a/drivers/firmware/efi/libstub/relocate.c b/drivers/firmware/efi/libstub/relocate.c
index bf676dd127a14..d4264bfb6dc17 100644
--- a/drivers/firmware/efi/libstub/relocate.c
+++ b/drivers/firmware/efi/libstub/relocate.c
@@ -23,14 +23,14 @@
efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align,
unsigned long *addr, unsigned long min)
{
- struct efi_boot_memmap *map;
+ struct efi_boot_memmap *map __free(efi_pool) = NULL;
efi_status_t status;
unsigned long nr_pages;
int i;
status = efi_get_memory_map(&map, false);
if (status != EFI_SUCCESS)
- goto fail;
+ return status;
/*
* Enforce minimum alignment that EFI or Linux requires when
@@ -82,11 +82,9 @@ efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align,
}
if (i == map->map_size / map->desc_size)
- status = EFI_NOT_FOUND;
+ return EFI_NOT_FOUND;
- efi_bs_call(free_pool, map);
-fail:
- return status;
+ return EFI_SUCCESS;
}
/**
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index b11c46215a81f..d54454cbab1c3 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -617,7 +617,7 @@ static efi_status_t allocate_e820(struct boot_params *params,
struct setup_data **e820ext,
u32 *e820ext_size)
{
- struct efi_boot_memmap *map;
+ struct efi_boot_memmap *map __free(efi_pool) = NULL;
efi_status_t status;
__u32 nr_desc;
@@ -631,13 +631,14 @@ static efi_status_t allocate_e820(struct boot_params *params,
EFI_MMAP_NR_SLACK_SLOTS;
status = alloc_e820ext(nr_e820ext, e820ext, e820ext_size);
+ if (status != EFI_SUCCESS)
+ return status;
}
- if (IS_ENABLED(CONFIG_UNACCEPTED_MEMORY) && status == EFI_SUCCESS)
- status = allocate_unaccepted_bitmap(nr_desc, map);
+ if (IS_ENABLED(CONFIG_UNACCEPTED_MEMORY))
+ return allocate_unaccepted_bitmap(nr_desc, map);
- efi_bs_call(free_pool, map);
- return status;
+ return EFI_SUCCESS;
}
struct exit_boot_struct {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0919/1756] x86/efistub: Merge PE and handover entrypoints
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (917 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0918/1756] efi/libstub: Use cleanup helpers for freeing copies of the memory map Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0920/1756] efi/libstub: make local GUID variables static Greg Kroah-Hartman
` (79 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ingo Molnar, Ard Biesheuvel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit dac628e9563640e2de7878decc03a508b1ba319a ]
The difference between the PE and handover entrypoints in the EFI stub
is that the former allocates a struct boot_params whereas the latter
expects one from the caller. Currently, these are two completely
separate entrypoints, duplicating some logic and both relying of
efi_exit() to return straight back to the firmware on an error.
Simplify this by making the PE entrypoint call the handover entrypoint
with NULL as the argument for the struct boot_params parameter. This
makes the code easier to follow, and removes the need to support two
different calling conventions in the mixed mode asm code.
While at it, move the assignment of boot_params_ptr into the function
that actually calls into the legacy decompressor, which is where its
value is required.
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/boot/compressed/efi_mixed.S | 16 +-------
drivers/firmware/efi/libstub/x86-stub.c | 52 ++++++++++++++-----------
2 files changed, 30 insertions(+), 38 deletions(-)
diff --git a/arch/x86/boot/compressed/efi_mixed.S b/arch/x86/boot/compressed/efi_mixed.S
index 876fc6d46a131..d681e30c6732c 100644
--- a/arch/x86/boot/compressed/efi_mixed.S
+++ b/arch/x86/boot/compressed/efi_mixed.S
@@ -56,22 +56,8 @@ SYM_FUNC_START(startup_64_mixed_mode)
movl efi32_boot_sp(%rip), %esp
andl $~7, %esp
-#ifdef CONFIG_EFI_HANDOVER_PROTOCOL
mov 8(%rdx), %edx // saved bootparams pointer
- test %edx, %edx
- jnz efi_stub_entry
-#endif
- /*
- * efi_pe_entry uses MS calling convention, which requires 32 bytes of
- * shadow space on the stack even if all arguments are passed in
- * registers. We also need an additional 8 bytes for the space that
- * would be occupied by the return address, and this also results in
- * the correct stack alignment for entry.
- */
- sub $40, %rsp
- mov %rdi, %rcx // MS calling convention
- mov %rsi, %rdx
- jmp efi_pe_entry
+ call efi_stub_entry
SYM_FUNC_END(startup_64_mixed_mode)
SYM_FUNC_START(__efi64_thunk)
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index d54454cbab1c3..2d7c6817af4b7 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -401,17 +401,13 @@ static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
asm("hlt");
}
-void __noreturn efi_stub_entry(efi_handle_t handle,
- efi_system_table_t *sys_table_arg,
- struct boot_params *boot_params);
-
/*
* Because the x86 boot code expects to be passed a boot_params we
* need to create one ourselves (usually the bootloader would create
* one for us).
*/
-efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
- efi_system_table_t *sys_table_arg)
+static efi_status_t efi_allocate_bootparams(efi_handle_t handle,
+ struct boot_params **bp)
{
efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
struct boot_params *boot_params;
@@ -421,21 +417,15 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
unsigned long alloc;
char *cmdline_ptr;
- efi_system_table = sys_table_arg;
-
- /* Check if we were booted by the EFI firmware */
- if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
- efi_exit(handle, EFI_INVALID_PARAMETER);
-
status = efi_bs_call(handle_protocol, handle, &proto, (void **)&image);
if (status != EFI_SUCCESS) {
efi_err("Failed to get handle for LOADED_IMAGE_PROTOCOL\n");
- efi_exit(handle, status);
+ return status;
}
status = efi_allocate_pages(PARAM_SIZE, &alloc, ULONG_MAX);
if (status != EFI_SUCCESS)
- efi_exit(handle, status);
+ return status;
boot_params = memset((void *)alloc, 0x0, PARAM_SIZE);
hdr = &boot_params->hdr;
@@ -451,14 +441,14 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
cmdline_ptr = efi_convert_cmdline(image, &options_size);
if (!cmdline_ptr) {
efi_free(PARAM_SIZE, alloc);
- efi_exit(handle, EFI_OUT_OF_RESOURCES);
+ return EFI_OUT_OF_RESOURCES;
}
efi_set_u64_split((unsigned long)cmdline_ptr, &hdr->cmd_line_ptr,
&boot_params->ext_cmd_line_ptr);
- efi_stub_entry(handle, sys_table_arg, boot_params);
- /* not reached */
+ *bp = boot_params;
+ return EFI_SUCCESS;
}
static void add_e820ext(struct boot_params *params,
@@ -745,13 +735,16 @@ static efi_status_t parse_options(const char *cmdline)
return efi_parse_options(cmdline);
}
-static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry)
+static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry,
+ struct boot_params *boot_params)
{
unsigned long virt_addr = LOAD_PHYSICAL_ADDR;
unsigned long addr, alloc_size, entry;
efi_status_t status;
u32 seed[2] = {};
+ boot_params_ptr = boot_params;
+
/* determine the required size of the allocation */
alloc_size = ALIGN(max_t(unsigned long, output_len, kernel_total_size),
MIN_KERNEL_ALIGN);
@@ -782,7 +775,7 @@ static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry)
seed[0] = 0;
}
- boot_params_ptr->hdr.loadflags |= KASLR_FLAG;
+ boot_params->hdr.loadflags |= KASLR_FLAG;
}
status = efi_random_alloc(alloc_size, CONFIG_PHYSICAL_ALIGN, &addr,
@@ -820,20 +813,27 @@ static void __noreturn enter_kernel(unsigned long kernel_addr,
void __noreturn efi_stub_entry(efi_handle_t handle,
efi_system_table_t *sys_table_arg,
struct boot_params *boot_params)
+
{
efi_guid_t guid = EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID;
- struct setup_header *hdr = &boot_params->hdr;
const struct linux_efi_initrd *initrd = NULL;
unsigned long kernel_entry;
+ struct setup_header *hdr;
efi_status_t status;
- boot_params_ptr = boot_params;
-
efi_system_table = sys_table_arg;
/* Check if we were booted by the EFI firmware */
if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
efi_exit(handle, EFI_INVALID_PARAMETER);
+ if (!IS_ENABLED(CONFIG_EFI_HANDOVER_PROTOCOL) || !boot_params) {
+ status = efi_allocate_bootparams(handle, &boot_params);
+ if (status != EFI_SUCCESS)
+ efi_exit(handle, status);
+ }
+
+ hdr = &boot_params->hdr;
+
if (have_unsupported_snp_features())
efi_exit(handle, EFI_UNSUPPORTED);
@@ -875,7 +875,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
if (efi_mem_encrypt > 0)
hdr->xloadflags |= XLF_MEM_ENCRYPTION;
- status = efi_decompress_kernel(&kernel_entry);
+ status = efi_decompress_kernel(&kernel_entry, boot_params);
if (status != EFI_SUCCESS) {
efi_err("Failed to decompress kernel\n");
goto fail;
@@ -945,6 +945,12 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
efi_exit(handle, status);
}
+efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
+ efi_system_table_t *sys_table_arg)
+{
+ efi_stub_entry(handle, sys_table_arg, NULL);
+}
+
#ifdef CONFIG_EFI_HANDOVER_PROTOCOL
void efi_handover_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg,
struct boot_params *boot_params)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0920/1756] efi/libstub: make local GUID variables static
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (918 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0919/1756] x86/efistub: Merge PE and handover entrypoints Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0921/1756] efi/libstub: Free cmdline_ptr in efi_pe_entry Greg Kroah-Hartman
` (78 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vincent Mailhol, Ard Biesheuvel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Mailhol <mailhol@kernel.org>
[ Upstream commit e57b05932a49b1ef54c6f116b9b044ce37db7dcc ]
Local efi_guid_t variables with automatic storage produce assembly
similar to passing the address of the GUID macro directly. For the same
reason, make these GUID variables static.
Put the static declarations first in their local declaration block to
visually separate them from the automatic variables.
For an x86_64 build with gcc 15.3.0, bloat-o-meter reports:
add/remove: 15/0 grow/shrink: 0/10 up/down: 336/-742 (-406)
Function old new delta
tbl_guid - 32 +32
rng_proto - 32 +32
pci_proto - 32 +32
guid - 32 +32
fs_proto - 32 +32
cc_guid - 32 +32
tpm2_guid - 16 +16
text_to_dp_guid - 16 +16
tcg2_guid - 16 +16
rng_table_guid - 16 +16
rng_algo_raw - 16 +16
proto - 16 +16
linux_eventlog_guid - 16 +16
lf2_proto_guid - 16 +16
info_guid - 16 +16
efi_get_memory_map 707 696 -11
efi_pci_disable_bridge_busmaster 1199 1184 -15
efi_get_random_bytes 216 188 -28
efi_remap_image 357 328 -29
efi_load_initrd 1113 1065 -48
efi_random_get_seed 1368 1297 -71
efi_measure_tagged_event 935 854 -81
efi_retrieve_eventlog 1686 1570 -116
handle_cmdline_files 2501 2341 -160
efi_stub_entry 4136 3953 -183
Total: Before=28877, After=28471, chg -1.41%
Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Stable-dep-of: 8ea857a2bb54 ("efi/libstub: Free cmdline_ptr in efi_pe_entry")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/efi-stub-entry.c | 2 +-
drivers/firmware/efi/libstub/efi-stub-helper.c | 10 +++++-----
drivers/firmware/efi/libstub/efi-stub.c | 2 +-
drivers/firmware/efi/libstub/file.c | 8 ++++----
drivers/firmware/efi/libstub/kaslr.c | 2 +-
drivers/firmware/efi/libstub/mem.c | 2 +-
drivers/firmware/efi/libstub/pci.c | 2 +-
drivers/firmware/efi/libstub/random.c | 8 ++++----
drivers/firmware/efi/libstub/riscv.c | 2 +-
drivers/firmware/efi/libstub/tpm.c | 8 ++++----
drivers/firmware/efi/libstub/unaccepted_memory.c | 2 +-
drivers/firmware/efi/libstub/x86-stub.c | 10 +++++-----
12 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/firmware/efi/libstub/efi-stub-entry.c b/drivers/firmware/efi/libstub/efi-stub-entry.c
index a6c0498351905..2ebb81fd9f42a 100644
--- a/drivers/firmware/efi/libstub/efi-stub-entry.c
+++ b/drivers/firmware/efi/libstub/efi-stub-entry.c
@@ -30,13 +30,13 @@ struct screen_info *alloc_screen_info(void)
efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
efi_system_table_t *systab)
{
+ static efi_guid_t loaded_image_proto = LOADED_IMAGE_PROTOCOL_GUID;
efi_loaded_image_t *image;
efi_status_t status;
unsigned long image_addr;
unsigned long image_size = 0;
/* addr/point and size pairs for memory management*/
char *cmdline_ptr = NULL;
- efi_guid_t loaded_image_proto = LOADED_IMAGE_PROTOCOL_GUID;
unsigned long reserve_addr = 0;
unsigned long reserve_size = 0;
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index 1ad414da9920a..c1a25d8d9adb3 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -244,6 +244,7 @@ static efi_status_t efi_measure_tagged_event(unsigned long load_addr,
unsigned long load_size,
enum efistub_event_type event)
{
+ static efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID;
union {
efi_status_t
(__efiapi *hash_log_extend_event)(void *, u64, efi_physical_addr_t,
@@ -253,7 +254,6 @@ static efi_status_t efi_measure_tagged_event(unsigned long load_addr,
struct efistub_measured_event *evt;
int size = struct_size(evt, tagged_event.tagged_event_data,
events[event].event_data_len);
- efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID;
efi_tcg2_protocol_t *tcg2 = NULL;
union efistub_event ev;
efi_status_t status;
@@ -272,7 +272,7 @@ static efi_status_t efi_measure_tagged_event(unsigned long load_addr,
method.hash_log_extend_event =
(void *)efi_table_attr(tcg2, hash_log_extend_event);
} else {
- efi_guid_t cc_guid = EFI_CC_MEASUREMENT_PROTOCOL_GUID;
+ static efi_guid_t cc_guid = EFI_CC_MEASUREMENT_PROTOCOL_GUID;
efi_cc_protocol_t *cc = NULL;
efi_bs_call(locate_protocol, &cc_guid, NULL, (void **)&cc);
@@ -550,7 +550,7 @@ static
efi_status_t efi_load_initrd_dev_path(struct linux_efi_initrd *initrd,
unsigned long max)
{
- efi_guid_t lf2_proto_guid = EFI_LOAD_FILE2_PROTOCOL_GUID;
+ static efi_guid_t lf2_proto_guid = EFI_LOAD_FILE2_PROTOCOL_GUID;
efi_device_path_protocol_t *dp;
efi_load_file2_protocol_t *lf2;
efi_handle_t handle;
@@ -612,7 +612,7 @@ efi_status_t efi_load_initrd(efi_loaded_image_t *image,
unsigned long hard_limit,
const struct linux_efi_initrd **out)
{
- efi_guid_t tbl_guid = LINUX_EFI_INITRD_MEDIA_GUID;
+ static efi_guid_t tbl_guid = LINUX_EFI_INITRD_MEDIA_GUID;
efi_status_t status = EFI_SUCCESS;
struct linux_efi_initrd initrd, *tbl;
@@ -722,7 +722,7 @@ efi_status_t efi_wait_for_key(unsigned long usec, efi_input_key_t *key)
void efi_remap_image(unsigned long image_base, unsigned alloc_size,
unsigned long code_size)
{
- efi_guid_t guid = EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID;
+ static efi_guid_t guid = EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID;
efi_memory_attribute_protocol_t *memattr;
efi_status_t status;
u64 attr;
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 52b7029707642..8d627f3d316a5 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -69,8 +69,8 @@ static struct screen_info *setup_graphics(void)
static void install_memreserve_table(void)
{
+ static efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;
struct linux_efi_memreserve *rsv;
- efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;
efi_status_t status;
/*
diff --git a/drivers/firmware/efi/libstub/file.c b/drivers/firmware/efi/libstub/file.c
index d6a025df07dcf..f91965b2067cf 100644
--- a/drivers/firmware/efi/libstub/file.c
+++ b/drivers/firmware/efi/libstub/file.c
@@ -39,7 +39,7 @@ static efi_status_t efi_open_file(efi_file_protocol_t *volume,
efi_file_protocol_t **handle,
unsigned long *file_size)
{
- efi_guid_t info_guid = EFI_FILE_INFO_ID;
+ static efi_guid_t info_guid = EFI_FILE_INFO_ID;
efi_file_protocol_t *fh;
unsigned long info_sz;
efi_status_t status;
@@ -74,7 +74,7 @@ static efi_status_t efi_open_file(efi_file_protocol_t *volume,
static efi_status_t efi_open_volume(efi_loaded_image_t *image,
efi_file_protocol_t **fh)
{
- efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
+ static efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
efi_simple_file_system_protocol_t *io;
efi_status_t status;
@@ -128,9 +128,9 @@ static int find_file_option(const efi_char16_t *cmdline, int cmdline_len,
static efi_status_t efi_open_device_path(efi_file_protocol_t **volume,
struct finfo *fi)
{
- efi_guid_t text_to_dp_guid = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
+ static efi_guid_t text_to_dp_guid = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
+ static efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
static efi_device_path_from_text_protocol_t *text_to_dp = NULL;
- efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
efi_device_path_protocol_t *initrd_dp;
efi_simple_file_system_protocol_t *io;
struct efi_file_path_dev_path *fpath;
diff --git a/drivers/firmware/efi/libstub/kaslr.c b/drivers/firmware/efi/libstub/kaslr.c
index 4bc963e999eb9..f5074656457a6 100644
--- a/drivers/firmware/efi/libstub/kaslr.c
+++ b/drivers/firmware/efi/libstub/kaslr.c
@@ -18,7 +18,7 @@
*/
u32 efi_kaslr_get_phys_seed(efi_handle_t image_handle)
{
- efi_guid_t li_fixed_proto = LINUX_EFI_LOADED_IMAGE_FIXED_GUID;
+ static efi_guid_t li_fixed_proto = LINUX_EFI_LOADED_IMAGE_FIXED_GUID;
void *p;
if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE))
diff --git a/drivers/firmware/efi/libstub/mem.c b/drivers/firmware/efi/libstub/mem.c
index 9c82259eea816..fe623a0126ecb 100644
--- a/drivers/firmware/efi/libstub/mem.c
+++ b/drivers/firmware/efi/libstub/mem.c
@@ -20,10 +20,10 @@
efi_status_t efi_get_memory_map(struct efi_boot_memmap **map,
bool install_cfg_tbl)
{
+ static efi_guid_t tbl_guid = LINUX_EFI_BOOT_MEMMAP_GUID;
struct efi_boot_memmap tmp, *m __free(efi_pool) = NULL;
int memtype = install_cfg_tbl ? EFI_ACPI_RECLAIM_MEMORY
: EFI_LOADER_DATA;
- efi_guid_t tbl_guid = LINUX_EFI_BOOT_MEMMAP_GUID;
efi_status_t status;
unsigned long size;
diff --git a/drivers/firmware/efi/libstub/pci.c b/drivers/firmware/efi/libstub/pci.c
index 1dccf77958d3a..5daa7a0a0e87a 100644
--- a/drivers/firmware/efi/libstub/pci.c
+++ b/drivers/firmware/efi/libstub/pci.c
@@ -15,7 +15,7 @@
void efi_pci_disable_bridge_busmaster(void)
{
- efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
+ static efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
efi_handle_t *pci_handle __free(efi_pool) = NULL;
unsigned long pci_handle_num;
efi_handle_t handle;
diff --git a/drivers/firmware/efi/libstub/random.c b/drivers/firmware/efi/libstub/random.c
index 7109b8a2dcba8..3ca230fa7aa3e 100644
--- a/drivers/firmware/efi/libstub/random.c
+++ b/drivers/firmware/efi/libstub/random.c
@@ -38,7 +38,7 @@ union efi_rng_protocol {
*/
efi_status_t efi_get_random_bytes(unsigned long size, u8 *out)
{
- efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
+ static efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
efi_status_t status;
efi_rng_protocol_t *rng = NULL;
@@ -64,9 +64,9 @@ efi_status_t efi_get_random_bytes(unsigned long size, u8 *out)
*/
efi_status_t efi_random_get_seed(void)
{
- efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
- efi_guid_t rng_algo_raw = EFI_RNG_ALGORITHM_RAW;
- efi_guid_t rng_table_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID;
+ static efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
+ static efi_guid_t rng_algo_raw = EFI_RNG_ALGORITHM_RAW;
+ static efi_guid_t rng_table_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID;
struct linux_efi_random_seed *prev_seed, *seed = NULL;
int prev_seed_size = 0, seed_size = EFI_RANDOM_SEED_SIZE;
unsigned long nv_seed_size = 0, offset = 0;
diff --git a/drivers/firmware/efi/libstub/riscv.c b/drivers/firmware/efi/libstub/riscv.c
index f66f33ceb99e3..49db47c05bfe9 100644
--- a/drivers/firmware/efi/libstub/riscv.c
+++ b/drivers/firmware/efi/libstub/riscv.c
@@ -45,7 +45,7 @@ static int get_boot_hartid_from_fdt(void)
static efi_status_t get_boot_hartid_from_efi(void)
{
- efi_guid_t boot_protocol_guid = RISCV_EFI_BOOT_PROTOCOL_GUID;
+ static efi_guid_t boot_protocol_guid = RISCV_EFI_BOOT_PROTOCOL_GUID;
struct riscv_efi_boot_protocol *boot_protocol;
efi_status_t status;
diff --git a/drivers/firmware/efi/libstub/tpm.c b/drivers/firmware/efi/libstub/tpm.c
index 1fd6823248ab6..bf5dcde25d82a 100644
--- a/drivers/firmware/efi/libstub/tpm.c
+++ b/drivers/firmware/efi/libstub/tpm.c
@@ -28,8 +28,8 @@ static const efi_char16_t efi_MemoryOverWriteRequest_name[] =
*/
void efi_enable_reset_attack_mitigation(void)
{
+ static efi_guid_t var_guid = MEMORY_ONLY_RESET_CONTROL_GUID;
u8 val = 1;
- efi_guid_t var_guid = MEMORY_ONLY_RESET_CONTROL_GUID;
efi_status_t status;
unsigned long datasize = 0;
@@ -52,7 +52,7 @@ static void efi_retrieve_tcg2_eventlog(int version, efi_physical_addr_t log_loca
efi_bool_t truncated,
struct efi_tcg2_final_events_table *final_events_table)
{
- efi_guid_t linux_eventlog_guid = LINUX_EFI_TPM_EVENT_LOG_GUID;
+ static efi_guid_t linux_eventlog_guid = LINUX_EFI_TPM_EVENT_LOG_GUID;
efi_status_t status;
struct linux_efi_tpm_eventlog *log_tbl = NULL;
unsigned long first_entry_addr, last_entry_addr;
@@ -147,9 +147,9 @@ static void efi_retrieve_tcg2_eventlog(int version, efi_physical_addr_t log_loca
void efi_retrieve_eventlog(void)
{
+ static efi_guid_t tpm2_guid = EFI_TCG2_PROTOCOL_GUID;
struct efi_tcg2_final_events_table *final_events_table = NULL;
efi_physical_addr_t log_location = 0, log_last_entry = 0;
- efi_guid_t tpm2_guid = EFI_TCG2_PROTOCOL_GUID;
int version = EFI_TCG2_EVENT_LOG_FORMAT_TCG_2;
efi_tcg2_protocol_t *tpm2 = NULL;
efi_bool_t truncated;
@@ -170,7 +170,7 @@ void efi_retrieve_eventlog(void)
get_efi_config_table(EFI_TCG2_FINAL_EVENTS_TABLE_GUID);
}
} else {
- efi_guid_t cc_guid = EFI_CC_MEASUREMENT_PROTOCOL_GUID;
+ static efi_guid_t cc_guid = EFI_CC_MEASUREMENT_PROTOCOL_GUID;
efi_cc_protocol_t *cc = NULL;
status = efi_bs_call(locate_protocol, &cc_guid, NULL, (void **)&cc);
diff --git a/drivers/firmware/efi/libstub/unaccepted_memory.c b/drivers/firmware/efi/libstub/unaccepted_memory.c
index 757dbe734a47a..2a7eac7fef862 100644
--- a/drivers/firmware/efi/libstub/unaccepted_memory.c
+++ b/drivers/firmware/efi/libstub/unaccepted_memory.c
@@ -9,7 +9,7 @@ struct efi_unaccepted_memory *unaccepted_table;
efi_status_t allocate_unaccepted_bitmap(__u32 nr_desc,
struct efi_boot_memmap *map)
{
- efi_guid_t unaccepted_table_guid = LINUX_EFI_UNACCEPTED_MEM_TABLE_GUID;
+ static efi_guid_t unaccepted_table_guid = LINUX_EFI_UNACCEPTED_MEM_TABLE_GUID;
u64 unaccepted_start = ULLONG_MAX, unaccepted_end = 0, bitmap_size;
efi_status_t status;
int i;
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 2d7c6817af4b7..731990c22e789 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -118,9 +118,9 @@ preserve_pci_rom_image(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom)
*/
static void setup_efi_pci(struct boot_params *params)
{
+ static efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
efi_status_t status;
efi_handle_t *pci_handle __free(efi_pool) = NULL;
- efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
struct setup_data *data;
unsigned long num;
efi_handle_t h;
@@ -159,7 +159,7 @@ static void setup_efi_pci(struct boot_params *params)
static void retrieve_apple_device_properties(struct boot_params *boot_params)
{
- efi_guid_t guid = APPLE_PROPERTIES_PROTOCOL_GUID;
+ static efi_guid_t guid = APPLE_PROPERTIES_PROTOCOL_GUID;
struct setup_data *data, *new;
efi_status_t status;
u32 size = 0;
@@ -347,7 +347,7 @@ efi_status_t efi_adjust_memory_range_protection(unsigned long start,
static void setup_unaccepted_memory(void)
{
- efi_guid_t mem_acceptance_proto = OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL_GUID;
+ static efi_guid_t mem_acceptance_proto = OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL_GUID;
sev_memory_acceptance_protocol_t *proto;
efi_status_t status;
@@ -409,7 +409,7 @@ static void __noreturn efi_exit(efi_handle_t handle, efi_status_t status)
static efi_status_t efi_allocate_bootparams(efi_handle_t handle,
struct boot_params **bp)
{
- efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
+ static efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
struct boot_params *boot_params;
struct setup_header *hdr;
int options_size = 0;
@@ -815,7 +815,7 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
struct boot_params *boot_params)
{
- efi_guid_t guid = EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID;
+ static efi_guid_t guid = EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID;
const struct linux_efi_initrd *initrd = NULL;
unsigned long kernel_entry;
struct setup_header *hdr;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0921/1756] efi/libstub: Free cmdline_ptr in efi_pe_entry
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (919 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0920/1756] efi/libstub: make local GUID variables static Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0922/1756] dt-bindings: dma: dma40: Restore disabled-channels Greg Kroah-Hartman
` (77 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason Gunthorpe, Ard Biesheuvel,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit 8ea857a2bb547e388e86ca42c58a97e162e09f83 ]
Sashiko points out that efi_handle_cmdline() allocates this memory and
hands it over to the caller. If efi_pe_entry() ever returns it should be
freed. Add a __free annotation.
Fixes: 42c8ea3dca09 ("efi: libstub: Factor out EFI stub entrypoint into separate file")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/efi/libstub/efi-stub-entry.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/libstub/efi-stub-entry.c b/drivers/firmware/efi/libstub/efi-stub-entry.c
index 2ebb81fd9f42a..06934278677d6 100644
--- a/drivers/firmware/efi/libstub/efi-stub-entry.c
+++ b/drivers/firmware/efi/libstub/efi-stub-entry.c
@@ -36,7 +36,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
unsigned long image_addr;
unsigned long image_size = 0;
/* addr/point and size pairs for memory management*/
- char *cmdline_ptr = NULL;
unsigned long reserve_addr = 0;
unsigned long reserve_size = 0;
@@ -58,6 +57,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
return status;
}
+ char *cmdline_ptr __free(efi_pool) = NULL;
status = efi_handle_cmdline(image, &cmdline_ptr);
if (status != EFI_SUCCESS)
return status;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0922/1756] dt-bindings: dma: dma40: Restore disabled-channels
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (920 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0921/1756] efi/libstub: Free cmdline_ptr in efi_pe_entry Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0923/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix transfers for SUN4I_FIFO_DEPTH Greg Kroah-Hartman
` (76 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Rob Herring (Arm),
Vinod Koul, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <linusw@kernel.org>
[ Upstream commit 38d97b1122e02f6b8859e660990aaeda1c32e00f ]
The conversion of the DMA40 binding to YAML omitted the optional
disabled-channels property from the original text binding. The driver still
parses this property, but additionalProperties: false rejects any device
tree using it.
Restore disabled-channels and constrain it to the physical channel range.
Also constrain memcpy-channels to the limits enforced by the driver and
reject duplicate channel entries in both properties.
Fixes: 23fbc87c8ae6 ("dt-bindings: dma: Rewrite ST-Ericsson DMA40 to YAML")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260918-dma40-dt-disabled-channels-v1-1-0f691109d8d3@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../devicetree/bindings/dma/stericsson,dma40.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/devicetree/bindings/dma/stericsson,dma40.yaml b/Documentation/devicetree/bindings/dma/stericsson,dma40.yaml
index 7b94d24d5ef42..73a69a1547701 100644
--- a/Documentation/devicetree/bindings/dma/stericsson,dma40.yaml
+++ b/Documentation/devicetree/bindings/dma/stericsson,dma40.yaml
@@ -145,8 +145,22 @@ properties:
items:
maxItems: 1
+ disabled-channels:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ minItems: 1
+ maxItems: 31
+ uniqueItems: true
+ items:
+ maximum: 31
+ description: Physical channels that cannot be used by the DMA engine.
+
memcpy-channels:
$ref: /schemas/types.yaml#/definitions/uint32-array
+ minItems: 1
+ maxItems: 8
+ uniqueItems: true
+ items:
+ maximum: 63
description: Array of u32 elements indicating which channels on the DMA
engine are eligible for memcpy transfers
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0923/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix transfers for SUN4I_FIFO_DEPTH
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (921 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0922/1756] dt-bindings: dma: dma40: Restore disabled-channels Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0924/1756] spi: spi-sun4i: sun4i_spi_fill_fifo(): always apply A10 FIFO fill level workaround Greg Kroah-Hartman
` (75 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marc Kleine-Budde, Jonas Rebmann,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <mkl@pengutronix.de>
[ Upstream commit f3ce7a3ca82bd9cda9ef61250aeff65fe6b44809 ]
In commit 6d9fe44bd73d ("spi: sun4i: fix FIFO limit"), the TX-FIFO is
filled max to SUN4I_FIFO_DEPTH - 1 (= 63) bytes to work around timeouts
observed on A10s SoCs.
Commit 196737912da5 ("spi: sun4i: Allow transfers larger than FIFO
size") added support for transfers larger than the FIFO size. But this
commit only enabled the TX-FIFO empty interrupt for transfers larger
than the FIFO (= 64) bytes.
This breaks transfers with exactly 64 bytes: the TX-FIFO is only filled
with 63 bytes but the interrupt to refill the FIFO is not triggered. The
problem can be reproduced with the following command:
| spidev_test -D /dev/spidev0.1 -S 64 -s 20000000 -I 1
|
| [ 7797.548745] spi_master spi0: spi0.1: timeout transferring 64 bytes@20000000Hz for 110(100)ms
| [ 7797.557237] spidev spi0.1: SPI transfer failed: -110
| [ 7797.562308] spi_master spi0: failed to transfer one message from queue
| [ 7797.568936] spi_master spi0: noqueue transfer failed
To fix the problem enable the TX-FIFO interrupt if the total TX length
is larger than SUN4I_FIFO_DEPTH - 1 (= 63) bytes.
Fixes: 196737912da5 ("spi: sun4i: Allow transfers larger than FIFO size")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://patch.msgid.link/20260914-spi-sun4i-fixes-v3-1-9fe919d5cecf@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sun4i.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 4e33e0cec1b21..406a28728fb2c 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -322,7 +322,7 @@ static int sun4i_spi_transfer_one(struct spi_controller *host,
sun4i_spi_enable_interrupt(sspi, SUN4I_INT_CTL_TC |
SUN4I_INT_CTL_RF_F34);
/* Only enable Tx FIFO interrupt if we really need it */
- if (tx_len > SUN4I_FIFO_DEPTH)
+ if (tx_len > SUN4I_FIFO_DEPTH - 1)
sun4i_spi_enable_interrupt(sspi, SUN4I_INT_CTL_TF_E34);
/* Start the transfer */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0924/1756] spi: spi-sun4i: sun4i_spi_fill_fifo(): always apply A10 FIFO fill level workaround
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (922 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0923/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix transfers for SUN4I_FIFO_DEPTH Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0925/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix setting of clock rate Greg Kroah-Hartman
` (74 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marc Kleine-Budde, Jonas Rebmann,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <mkl@pengutronix.de>
[ Upstream commit ee109e2bbea0986f6ad34bfbcba90fce36f17538 ]
In commit 6d9fe44bd73d ("spi: sun4i: fix FIFO limit"), the TX FIFO is
filled max to SUN4I_FIFO_DEPTH - 1 (= 63) bytes to work around
timeouts observed on A10s SoCs.
Commit 196737912da5 ("spi: sun4i: Allow transfers larger than FIFO
size") added support for transfers larger than the FIFO size. This
commit did not consider the A10 workaround (limit the TX FIFO fill
size to SUN4I_FIFO_DEPTH - 1 (= 63) bytes) for refilling the TX FIFO
in the IRQ handler.
To apply the workaround independent from where sun4i_spi_fill_fifo()
is called, remove the length argument from the function and directly
take the max fill level of SUN4I_FIFO_DEPTH - 1 into account when
calculating the free space in the FIFO.
Due to the lack of HW this patch has not been tested on an A10 SoC,
but on an A20 SoC. It was not possible to reproduce the timeout on the
A20.
Fixes: 196737912da5 ("spi: sun4i: Allow transfers larger than FIFO size")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://patch.msgid.link/20260914-spi-sun4i-fixes-v3-2-9fe919d5cecf@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sun4i.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 406a28728fb2c..9b21d3b945b35 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -142,15 +142,21 @@ static inline void sun4i_spi_drain_fifo(struct sun4i_spi *sspi, int len)
}
}
-static inline void sun4i_spi_fill_fifo(struct sun4i_spi *sspi, int len)
+static inline void sun4i_spi_fill_fifo(struct sun4i_spi *sspi)
{
u32 cnt;
+ int len;
u8 byte;
- /* See how much data we can fit */
- cnt = SUN4I_FIFO_DEPTH - sun4i_spi_get_tx_fifo_count(sspi);
+ /*
+ * See how much data we can fit
+ *
+ * Filling the FIFO fully causes timeout for some reason
+ * at least on spi2 on A10s
+ */
+ cnt = SUN4I_FIFO_DEPTH - 1 - sun4i_spi_get_tx_fifo_count(sspi);
- len = min3(len, (int)cnt, sspi->len);
+ len = min_t(int, cnt, sspi->len);
while (len--) {
byte = sspi->tx_buf ? *sspi->tx_buf++ : 0;
@@ -311,12 +317,8 @@ static int sun4i_spi_transfer_one(struct spi_controller *host,
sun4i_spi_write(sspi, SUN4I_BURST_CNT_REG, SUN4I_BURST_CNT(tfr->len));
sun4i_spi_write(sspi, SUN4I_XMIT_CNT_REG, SUN4I_XMIT_CNT(tx_len));
- /*
- * Fill the TX FIFO
- * Filling the FIFO fully causes timeout for some reason
- * at least on spi2 on A10s
- */
- sun4i_spi_fill_fifo(sspi, SUN4I_FIFO_DEPTH - 1);
+ /* Fill the TX FIFO */
+ sun4i_spi_fill_fifo(sspi);
/* Enable the interrupts */
sun4i_spi_enable_interrupt(sspi, SUN4I_INT_CTL_TC |
@@ -373,7 +375,7 @@ static irqreturn_t sun4i_spi_handler(int irq, void *dev_id)
/* Transmit FIFO 3/4 empty */
if (status & SUN4I_INT_CTL_TF_E34) {
- sun4i_spi_fill_fifo(sspi, SUN4I_FIFO_DEPTH);
+ sun4i_spi_fill_fifo(sspi);
if (!sspi->len)
/* nothing left to transmit */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0925/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix setting of clock rate
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (923 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0924/1756] spi: spi-sun4i: sun4i_spi_fill_fifo(): always apply A10 FIFO fill level workaround Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0926/1756] spi: spi-sun4i: sun4i_spi_handler(): fix race condition between transfer completion and RX FIFO interrupt Greg Kroah-Hartman
` (73 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marc Kleine-Budde, Jonas Rebmann,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <mkl@pengutronix.de>
[ Upstream commit 672ba6d88324f223634dd2dc4098f6fb6b346b25 ]
A SPI transfer defines the _maximum_ speed of the SPI transfer. However
the driver doesn't take into account that the clock divider is always
rounded down (due to integer arithmetic). This results in a too high
clock rate for the SPI transfer.
E.g.: with an mclk_rate of 24 MHz and an SPI transfer speed of 10 MHz,
the original code calculates a reg of "0", which results in an effective
divider of "2" and a 12 MHz clock for the SPI transfer.
Use DIV_ROUND_UP() instead of a plain integer division to fix the
problem.
While there simplify the divider calculation for the CDR1 case, use
order_base_2() instead of two ilog2() calculations.
Fixes: b5f6517948cc ("spi: sunxi: Add Allwinner A10 SPI controller driver")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://patch.msgid.link/20260914-spi-sun4i-fixes-v3-3-9fe919d5cecf@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sun4i.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 9b21d3b945b35..59e8a82cd8b64 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -212,7 +212,7 @@ static int sun4i_spi_transfer_one(struct spi_controller *host,
struct spi_transfer *tfr)
{
struct sun4i_spi *sspi = spi_controller_get_devdata(host);
- unsigned int mclk_rate, div;
+ unsigned int mclk_rate, div, div_cdr1, div_cdr2;
unsigned long time_left;
unsigned int start, end, tx_time;
unsigned int tx_len = 0;
@@ -296,15 +296,13 @@ static int sun4i_spi_transfer_one(struct spi_controller *host,
* First try CDR2, and if we can't reach the expected
* frequency, fall back to CDR1.
*/
- div = mclk_rate / (2 * tfr->speed_hz);
- if (div <= (SUN4I_CLK_CTL_CDR2_MASK + 1)) {
- if (div > 0)
- div--;
-
- reg = SUN4I_CLK_CTL_CDR2(div) | SUN4I_CLK_CTL_DRS;
+ div_cdr1 = DIV_ROUND_UP(mclk_rate, tfr->speed_hz);
+ div_cdr2 = DIV_ROUND_UP(div_cdr1, 2);
+ if (div_cdr2 <= (SUN4I_CLK_CTL_CDR2_MASK + 1)) {
+ reg = SUN4I_CLK_CTL_CDR2(div_cdr2 - 1) | SUN4I_CLK_CTL_DRS;
} else {
- div = ilog2(mclk_rate) - ilog2(tfr->speed_hz);
- reg = SUN4I_CLK_CTL_CDR1(div);
+ div = min(SUN4I_CLK_CTL_CDR1_MASK + 1, order_base_2(div_cdr1));
+ reg = SUN4I_CLK_CTL_CDR1(div - 1);
}
sun4i_spi_write(sspi, SUN4I_CLK_CTL_REG, reg);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0926/1756] spi: spi-sun4i: sun4i_spi_handler(): fix race condition between transfer completion and RX FIFO interrupt
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (924 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0925/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix setting of clock rate Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0927/1756] NFS: return DENIED in decode_lock_denied if we cannot decode owner Greg Kroah-Hartman
` (72 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tobias Schramm, Marc Kleine-Budde,
Jonas Rebmann, Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <mkl@pengutronix.de>
[ Upstream commit b8f09251da7871fbb9c62bd83516af422641d816 ]
In commit 196737912da5 ("spi: sun4i: Allow transfers larger than FIFO
size"), support for transfers larger than the FIFO size was added.
This commit moves the draining of the RX-FIFO from
sun4i_spi_transfer_one() (after completion of the transfer) to the IRQ
handler when the IRQ "transfer complete" is handled. In addition, the
IRQ "RX-FIFO 3/4 full" is activated for all transfers.
However, this does not take into account that the RX-IRQ for transfers
that exceed 3/4 of the FIFO size is still pending after the IRQ
"transfer complete" has been processed. All interrupt sources are only
deactivated after the wait_for_completion_timeout() in
sun4i_spi_transfer_one().
This opens a race window for "RX-FIFO 3/4 full" interrupts to come.
The sequence is as follows:
| sun4i_spi_transfer_one()
| sun4i_spi_fill_fifo() // fill TX-FIFO with 48 bytes
| // enable RX-FIFO 3/4 full IRQ
| wait_for_completion_timeout();
|
| // SPI controller transfers 48 bytes
| // SPI controller issues "transfer complete" and "RX-FIFO 3/4 full" IRQ
|
| // IRQ handler start
| sun4i_spi_handler()
| // ACK "transfer complete" IRQ
| sun4i_spi_drain_fifo();
| complete(); ----.
| return IRQ_HANDLED; \
| // IRQ handler end \__ race
| / window
| // wait_for_completion_timeout() continues /
| // disable all IRQ sources ----'
Avoid the race condition by disabling all interrupts when handling the
"transfer complete" IRQ and before calling complete(). Also move the
draining of the RX-FIFO back into sun4i_spi_transfer_one() where it
was before commit 196737912da5 ("spi: sun4i: Allow transfers larger than
FIFO size").
This has the added benefit of spending a little less time in the IRQ
handler.
With all interrupts disabled once the transfer completed, omit the
clearing of the Transfer Complete bit in sun4i_spi_handler. This is safe
because sun4i_spi_transfer_one() takes care of this before enabling any
interrupts again.
Cc: Tobias Schramm <t.schramm@manjaro.org>
Fixes: 196737912da5 ("spi: sun4i: Allow transfers larger than FIFO size")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://patch.msgid.link/20260914-spi-sun4i-fixes-v3-4-9fe919d5cecf@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-sun4i.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 59e8a82cd8b64..ad0200d8dce8c 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -82,6 +82,8 @@ struct sun4i_spi {
struct completion done;
+ int irq;
+
const u8 *tx_buf;
u8 *rx_buf;
int len;
@@ -333,6 +335,7 @@ static int sun4i_spi_transfer_one(struct spi_controller *host,
start = jiffies;
time_left = wait_for_completion_timeout(&sspi->done,
msecs_to_jiffies(tx_time));
+
end = jiffies;
if (!time_left) {
dev_warn(&host->dev,
@@ -340,12 +343,11 @@ static int sun4i_spi_transfer_one(struct spi_controller *host,
dev_name(&spi->dev), tfr->len, tfr->speed_hz,
jiffies_to_msecs(end - start), tx_time);
ret = -ETIMEDOUT;
- goto out;
+ sun4i_spi_write(sspi, SUN4I_INT_CTL_REG, 0);
+ synchronize_irq(sspi->irq);
}
-
-out:
- sun4i_spi_write(sspi, SUN4I_INT_CTL_REG, 0);
+ sun4i_spi_drain_fifo(sspi, SUN4I_FIFO_DEPTH);
return ret;
}
@@ -357,8 +359,7 @@ static irqreturn_t sun4i_spi_handler(int irq, void *dev_id)
/* Transfer complete */
if (status & SUN4I_INT_CTL_TC) {
- sun4i_spi_write(sspi, SUN4I_INT_STA_REG, SUN4I_INT_CTL_TC);
- sun4i_spi_drain_fifo(sspi, SUN4I_FIFO_DEPTH);
+ sun4i_spi_write(sspi, SUN4I_INT_CTL_REG, 0);
complete(&sspi->done);
return IRQ_HANDLED;
}
@@ -462,6 +463,7 @@ static int sun4i_spi_probe(struct platform_device *pdev)
goto err_free_host;
}
+ sspi->irq = irq;
sspi->host = host;
host->max_speed_hz = 100 * 1000 * 1000;
host->min_speed_hz = 3 * 1000;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0927/1756] NFS: return DENIED in decode_lock_denied if we cannot decode owner
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (925 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0926/1756] spi: spi-sun4i: sun4i_spi_handler(): fix race condition between transfer completion and RX FIFO interrupt Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0928/1756] nilfs2: fix link count underflow when removing corrupted directory Greg Kroah-Hartman
` (71 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Roberto Bergantinos Corpas,
Prabhakar Pujeri, Jeff Layton, Anna Schumaker, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roberto Bergantinos Corpas <rbergant@redhat.com>
[ Upstream commit 4fdfe2312cbed99b1438dcf20b348e72393f9633 ]
After commit 43502f6e8d1e ("NFS: fix open_owner_id_maxsz and related
fields.") we dramatically changed the size of the LOCK/LOCKT reply buffer
from 164 to 52 bytes. This made visible a situation on a buggy NFS
server that sent oversized denied responses which led to us returning
EIO instead of DENIED.
Now, apart from buggy server issue, this poses an interesting question:
what if other implementations have legitimate but bigger than we expect
lock owner response, especially now that we have reduced the size we
allocate for it (20 bytes for the lock owner part).
This change proposes to tackle that issue returning DENIED instead of
EIO regardless of whether we manage to decode the owner or not:
- At this point of decode_lock_denied we know there is an owner.
- Server legitimately denied the lock request, with an owner that fits on
NFS4_OPAQUE_LIMIT but we returned EIO instead to userspace.
- The owner data is decoded but actually never used, decode_lock path
simply retries, and decode_lockt turns it into 0 on file_lock and
returns it to userspace.
- LOCK/LOCKT are the last operations on the compound so it's not relevant
if we didn't advance the pointer.
- Also removes an inverted likely(!p) hint.
Fixes: 43502f6e8d1e ("NFS: fix open_owner_id_maxsz and related fields.")
Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com>
Reviewed-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/nfs4xdr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 71f45cc0ca74d..1fbe66b460b3f 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -5102,8 +5102,7 @@ static int decode_lock_denied(struct xdr_stream *xdr, struct file_lock *fl)
p = xdr_decode_hyper(p, &clientid); /* read 8 bytes */
namelen = be32_to_cpup(p); /* read 4 bytes */ /* have read all 32 bytes now */
p = xdr_inline_decode(xdr, namelen); /* variable size field */
- if (likely(!p))
- return -EIO;
+ /* We have an owner here, return DENIED */
return -NFS4ERR_DENIED;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0928/1756] nilfs2: fix link count underflow when removing corrupted directory
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (926 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0927/1756] NFS: return DENIED in decode_lock_denied if we cannot decode owner Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0929/1756] selftests: cgroup: Optionally set up v1 environment Greg Kroah-Hartman
` (70 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+c388db0347b7fc88fa7a,
Ryusuke Konishi, Viacheslav Dubeyko, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryusuke Konishi <konishi.ryusuke@gmail.com>
[ Upstream commit 814f5a53b4724798795b15690ff3d1c1d9ac1eb6 ]
When removing an empty directory with a corrupted link count (e.g.,
i_nlink is 1 due to filesystem corruption), nilfs_rmdir() calls
drop_nlink() via nilfs_do_unlink() and then calls drop_nlink() again
on the directory inode. This second call causes an underflow of
i_nlink, triggering a kernel WARNING in drop_nlink().
Fix this issue by using clear_nlink() instead of drop_nlink() to
finalize the link count reset for the target directory in nilfs_rmdir().
Additionally, log a warning message when i_nlink is not 2 before
removing an empty directory to notify about the link count inconsistency.
Reported-by: syzbot+c388db0347b7fc88fa7a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c388db0347b7fc88fa7a
Fixes: d25006523d0b ("nilfs2: pathname operations")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nilfs2/namei.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index e02fae6757f12..1e56f52a22376 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -341,10 +341,16 @@ static int nilfs_rmdir(struct inode *dir, struct dentry *dentry)
err = -ENOTEMPTY;
if (nilfs_empty_dir(inode)) {
+ if (unlikely(inode->i_nlink != 2))
+ nilfs_warn(dir->i_sb,
+ "inconsistent empty directory link count %u (ino=%llu)",
+ inode->i_nlink,
+ (unsigned long long)inode->i_ino);
+
err = nilfs_do_unlink(dir, dentry);
if (!err) {
inode->i_size = 0;
- drop_nlink(inode);
+ clear_nlink(inode);
nilfs_mark_inode_dirty(inode);
drop_nlink(dir);
nilfs_mark_inode_dirty(dir);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0929/1756] selftests: cgroup: Optionally set up v1 environment
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (927 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0928/1756] nilfs2: fix link count underflow when removing corrupted directory Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0930/1756] selftests/cgroup: conform test to KTAP format output Greg Kroah-Hartman
` (69 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Koutný, Tejun Heo,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Koutný <mkoutny@suse.com>
[ Upstream commit d74cd7864ffa6913f1d70f80858bd3fd19101cdf ]
Use the missing mount of the unifier hierarchy as a hint of legacy
system and prepare our own named v1 hierarchy for tests.
The code is only in test_core.c and not cgroup_util.c because other
selftests are related to controllers which will be exposed on v2
hierarchy but named hierarchies are only v1 thing.
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_core.c | 44 +++++++++++++++++++++-
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
index a5672a91d273c..3b982a3ef547a 100644
--- a/tools/testing/selftests/cgroup/test_core.c
+++ b/tools/testing/selftests/cgroup/test_core.c
@@ -5,6 +5,8 @@
#include <linux/sched.h>
#include <sys/types.h>
#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>
@@ -842,6 +844,38 @@ static int test_cgcore_lesser_ns_open(const char *root)
return ret;
}
+static int setup_named_v1_root(char *root, size_t len, const char *name)
+{
+ char options[PATH_MAX];
+ int r;
+
+ r = snprintf(root, len, "/mnt/cg_selftest");
+ if (r < 0)
+ return r;
+
+ r = snprintf(options, sizeof(options), "none,name=%s", name);
+ if (r < 0)
+ return r;
+
+ r = mkdir(root, 0755);
+ if (r < 0 && errno != EEXIST)
+ return r;
+
+ r = mount("none", root, "cgroup", 0, options);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
+static void cleanup_named_v1_root(char *root)
+{
+ if (!cg_test_v1_named)
+ return;
+ umount(root);
+ rmdir(root);
+}
+
#define T(x) { x, #x }
struct corecg_test {
int (*fn)(const char *root);
@@ -867,13 +901,18 @@ int main(int argc, char *argv[])
char root[PATH_MAX];
int i, ret = EXIT_SUCCESS;
- if (cg_find_unified_root(root, sizeof(root), &nsdelegate))
- ksft_exit_skip("cgroup v2 isn't mounted\n");
+ if (cg_find_unified_root(root, sizeof(root), &nsdelegate)) {
+ if (setup_named_v1_root(root, sizeof(root), CG_NAMED_NAME))
+ ksft_exit_skip("cgroup v2 isn't mounted and could not setup named v1 hierarchy\n");
+ cg_test_v1_named = true;
+ goto post_v2_setup;
+ }
if (cg_read_strstr(root, "cgroup.subtree_control", "memory"))
if (cg_write(root, "cgroup.subtree_control", "+memory"))
ksft_exit_skip("Failed to set memory controller\n");
+post_v2_setup:
for (i = 0; i < ARRAY_SIZE(tests); i++) {
switch (tests[i].fn(root)) {
case KSFT_PASS:
@@ -889,5 +928,6 @@ int main(int argc, char *argv[])
}
}
+ cleanup_named_v1_root(root);
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0930/1756] selftests/cgroup: conform test to KTAP format output
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (928 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0929/1756] selftests: cgroup: Optionally set up v1 environment Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0931/1756] selftests/cgroup: add test for zswap incompressible pages Greg Kroah-Hartman
` (68 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guopeng Zhang, Sebastian Chlad,
Michal Koutný, Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guopeng Zhang <zhangguopeng@kylinos.cn>
[ Upstream commit 1dc830ee4c155bff572a43a66b948e1c46483d6a ]
Conform the layout, informational and status messages to KTAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Suggested-by: Sebastian Chlad <sebastian.chlad@suse.com>
Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_core.c | 7 ++++---
tools/testing/selftests/cgroup/test_cpu.c | 7 ++++---
tools/testing/selftests/cgroup/test_cpuset.c | 7 ++++---
tools/testing/selftests/cgroup/test_freezer.c | 7 ++++---
tools/testing/selftests/cgroup/test_kill.c | 7 ++++---
tools/testing/selftests/cgroup/test_kmem.c | 7 ++++---
tools/testing/selftests/cgroup/test_memcontrol.c | 7 ++++---
tools/testing/selftests/cgroup/test_zswap.c | 7 ++++---
8 files changed, 32 insertions(+), 24 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
index 3b982a3ef547a..61878a45740f7 100644
--- a/tools/testing/selftests/cgroup/test_core.c
+++ b/tools/testing/selftests/cgroup/test_core.c
@@ -899,8 +899,10 @@ struct corecg_test {
int main(int argc, char *argv[])
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), &nsdelegate)) {
if (setup_named_v1_root(root, sizeof(root), CG_NAMED_NAME))
ksft_exit_skip("cgroup v2 isn't mounted and could not setup named v1 hierarchy\n");
@@ -922,12 +924,11 @@ int main(int argc, char *argv[])
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
cleanup_named_v1_root(root);
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_cpu.c b/tools/testing/selftests/cgroup/test_cpu.c
index dad2ed82f3ef7..f60a5d8102a7c 100644
--- a/tools/testing/selftests/cgroup/test_cpu.c
+++ b/tools/testing/selftests/cgroup/test_cpu.c
@@ -698,8 +698,10 @@ struct cpucg_test {
int main(int argc, char *argv[])
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
@@ -716,11 +718,10 @@ int main(int argc, char *argv[])
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_cpuset.c b/tools/testing/selftests/cgroup/test_cpuset.c
index 4034d14ba69ac..8086d2ea394f6 100644
--- a/tools/testing/selftests/cgroup/test_cpuset.c
+++ b/tools/testing/selftests/cgroup/test_cpuset.c
@@ -247,8 +247,10 @@ struct cpuset_test {
int main(int argc, char *argv[])
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
@@ -265,11 +267,10 @@ int main(int argc, char *argv[])
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_freezer.c b/tools/testing/selftests/cgroup/test_freezer.c
index 8730645d363a7..2d348b894bbf0 100644
--- a/tools/testing/selftests/cgroup/test_freezer.c
+++ b/tools/testing/selftests/cgroup/test_freezer.c
@@ -825,8 +825,10 @@ struct cgfreezer_test {
int main(int argc, char *argv[])
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
for (i = 0; i < ARRAY_SIZE(tests); i++) {
@@ -838,11 +840,10 @@ int main(int argc, char *argv[])
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_kill.c b/tools/testing/selftests/cgroup/test_kill.c
index 0e5bb6c7307a5..ed590b150a17a 100644
--- a/tools/testing/selftests/cgroup/test_kill.c
+++ b/tools/testing/selftests/cgroup/test_kill.c
@@ -274,8 +274,10 @@ struct cgkill_test {
int main(int argc, char *argv[])
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
for (i = 0; i < ARRAY_SIZE(tests); i++) {
@@ -287,11 +289,10 @@ int main(int argc, char *argv[])
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c
index 4f5dbedbce757..bc48b294cbe0f 100644
--- a/tools/testing/selftests/cgroup/test_kmem.c
+++ b/tools/testing/selftests/cgroup/test_kmem.c
@@ -418,8 +418,10 @@ struct kmem_test {
int main(int argc, char **argv)
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
@@ -443,11 +445,10 @@ int main(int argc, char **argv)
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c
index d817aec949fe4..4ca5c5fd7af5c 100644
--- a/tools/testing/selftests/cgroup/test_memcontrol.c
+++ b/tools/testing/selftests/cgroup/test_memcontrol.c
@@ -1649,8 +1649,10 @@ struct memcg_test {
int main(int argc, char **argv)
{
char root[PATH_MAX];
- int i, proc_status, ret = EXIT_SUCCESS;
+ int i, proc_status;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
@@ -1684,11 +1686,10 @@ int main(int argc, char **argv)
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index 40de679248b89..656125c5b4758 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -597,8 +597,10 @@ static bool zswap_configured(void)
int main(int argc, char **argv)
{
char root[PATH_MAX];
- int i, ret = EXIT_SUCCESS;
+ int i;
+ ksft_print_header();
+ ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
@@ -625,11 +627,10 @@ int main(int argc, char **argv)
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
- ret = EXIT_FAILURE;
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
- return ret;
+ ksft_finished();
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0931/1756] selftests/cgroup: add test for zswap incompressible pages
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (929 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0930/1756] selftests/cgroup: conform test to KTAP format output Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0932/1756] selftests/cgroup: skip test_zswap if zswap is globally disabled Greg Kroah-Hartman
` (67 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiayuan Chen, Shakeel Butt,
Nhat Pham, SeongJae Park, Chengming Zhou, Johannes Weiner,
Jonathan Corbet, Michal Hocko, Michal Koutný, Muchun Song,
Roman Gushchin, Shuah Khan, Tejun Heo, Yosry Ahmed, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <jiayuan.chen@shopee.com>
[ Upstream commit 4e89004eebc559595e58d75fd7f7f8ecd5aa600d ]
Add test_zswap_incompressible() to verify that the zswap_incomp memcg stat
correctly tracks incompressible pages.
The test allocates memory filled with random data from /dev/urandom, which
cannot be effectively compressed by zswap. When this data is swapped out
to zswap, it should be stored as-is and tracked by the zswap_incomp
counter.
The test verifies that:
1. Pages are swapped out to zswap (zswpout increases)
2. Incompressible pages are tracked (zswap_incomp increases)
test:
dd if=/dev/zero of=/swapfile bs=1M count=2048
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo Y > /sys/module/zswap/parameters/enabled
./test_zswap
TAP version 13
1..8
ok 1 test_zswap_usage
ok 2 test_swapin_nozswap
ok 3 test_zswapin
ok 4 test_zswap_writeback_enabled
ok 5 test_zswap_writeback_disabled
ok 6 test_no_kmem_bypass
ok 7 test_no_invasive_cgroup_shrink
ok 8 test_zswap_incompressible
Totals: pass:8 fail:0 xfail:0 xpass:0 skip:0 error:0
Link: https://lkml.kernel.org/r/20260213071827.5688-3-jiayuan.chen@linux.dev
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yosry Ahmed <yosry.ahmed@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 136 ++++++++++++++++++++
1 file changed, 136 insertions(+)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index 656125c5b4758..3af3608bf578c 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -5,6 +5,8 @@
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
+#include <errno.h>
+#include <fcntl.h>
#include <sys/sysinfo.h>
#include <string.h>
#include <sys/wait.h>
@@ -574,6 +576,139 @@ static int test_no_kmem_bypass(const char *root)
return ret;
}
+struct incomp_child_args {
+ size_t size;
+ int pipefd[2];
+ int madvise_ret;
+ int madvise_errno;
+};
+
+static int allocate_random_and_wait(const char *cgroup, void *arg)
+{
+ struct incomp_child_args *values = arg;
+ size_t size = values->size;
+ char *mem;
+ int fd;
+ ssize_t n;
+
+ close(values->pipefd[0]);
+
+ mem = mmap(NULL, size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ if (mem == MAP_FAILED)
+ return -1;
+
+ /* Fill with random data from /dev/urandom - incompressible */
+ fd = open("/dev/urandom", O_RDONLY);
+ if (fd < 0) {
+ munmap(mem, size);
+ return -1;
+ }
+
+ for (size_t i = 0; i < size; ) {
+ n = read(fd, mem + i, size - i);
+ if (n <= 0)
+ break;
+ i += n;
+ }
+ close(fd);
+
+ /* Touch all pages to ensure they're faulted in */
+ for (size_t i = 0; i < size; i += PAGE_SIZE)
+ mem[i] = mem[i];
+
+ /* Use MADV_PAGEOUT to push pages into zswap */
+ values->madvise_ret = madvise(mem, size, MADV_PAGEOUT);
+ values->madvise_errno = errno;
+
+ /* Notify parent that allocation and pageout are done */
+ write(values->pipefd[1], "x", 1);
+ close(values->pipefd[1]);
+
+ /* Keep memory alive for parent to check stats */
+ pause();
+ munmap(mem, size);
+ return 0;
+}
+
+static long get_zswap_incomp(const char *cgroup)
+{
+ return cg_read_key_long(cgroup, "memory.stat", "zswap_incomp ");
+}
+
+/*
+ * Test that incompressible pages (random data) are tracked by zswap_incomp.
+ *
+ * The child process allocates random data within memory.max, then uses
+ * MADV_PAGEOUT to push pages into zswap. The parent waits on a pipe for
+ * the child to finish, then checks the zswap_incomp stat before the child
+ * exits (zswap_incomp is a gauge that decreases on free).
+ */
+static int test_zswap_incompressible(const char *root)
+{
+ int ret = KSFT_FAIL;
+ struct incomp_child_args *values;
+ char *test_group;
+ long zswap_incomp;
+ pid_t child_pid;
+ int child_status;
+ char buf;
+
+ values = mmap(0, sizeof(struct incomp_child_args), PROT_READ |
+ PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ if (values == MAP_FAILED)
+ return KSFT_FAIL;
+
+ if (pipe(values->pipefd)) {
+ munmap(values, sizeof(struct incomp_child_args));
+ return KSFT_FAIL;
+ }
+
+ test_group = cg_name(root, "zswap_incompressible_test");
+ if (!test_group)
+ goto out;
+ if (cg_create(test_group))
+ goto out;
+ if (cg_write(test_group, "memory.max", "32M"))
+ goto out;
+
+ values->size = MB(4);
+ child_pid = cg_run_nowait(test_group, allocate_random_and_wait, values);
+ if (child_pid < 0)
+ goto out;
+
+ close(values->pipefd[1]);
+
+ /* Wait for child to finish allocating and pageout */
+ read(values->pipefd[0], &buf, 1);
+ close(values->pipefd[0]);
+
+ zswap_incomp = get_zswap_incomp(test_group);
+ if (zswap_incomp <= 0) {
+ long zswpout = get_zswpout(test_group);
+ long zswapped = cg_read_key_long(test_group, "memory.stat", "zswapped ");
+ long zswap_b = cg_read_key_long(test_group, "memory.stat", "zswap ");
+
+ ksft_print_msg("zswap_incomp not increased: %ld\n", zswap_incomp);
+ ksft_print_msg("debug: zswpout=%ld zswapped=%ld zswap_b=%ld\n",
+ zswpout, zswapped, zswap_b);
+ ksft_print_msg("debug: madvise ret=%d errno=%d\n",
+ values->madvise_ret, values->madvise_errno);
+ goto out_kill;
+ }
+
+ ret = KSFT_PASS;
+
+out_kill:
+ kill(child_pid, SIGTERM);
+ waitpid(child_pid, &child_status, 0);
+out:
+ cg_destroy(test_group);
+ free(test_group);
+ munmap(values, sizeof(struct incomp_child_args));
+ return ret;
+}
+
#define T(x) { x, #x }
struct zswap_test {
int (*fn)(const char *root);
@@ -586,6 +721,7 @@ struct zswap_test {
T(test_zswap_writeback_disabled),
T(test_no_kmem_bypass),
T(test_no_invasive_cgroup_shrink),
+ T(test_zswap_incompressible),
};
#undef T
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0932/1756] selftests/cgroup: skip test_zswap if zswap is globally disabled
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (930 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0931/1756] selftests/cgroup: add test for zswap incompressible pages Greg Kroah-Hartman
@ 2026-11-18 14:50 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0933/1756] selftests/cgroup: avoid OOM in test_swapin_nozswap Greg Kroah-Hartman
` (66 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:50 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li Wang, Yosry Ahmed, Nhat Pham,
Johannes Weiner, Michal Hocko, Michal Koutný, Muchun Song,
Tejun Heo, Roman Gushchin, Shakeel Butt, Chengming Zhou,
Jiayuan Chen, Waiman Long, Yosry Ahmed, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <li.wang@linux.dev>
[ Upstream commit 9f40c3cdf0fa3011c3a15f8acc0b9ffb3ed11171 ]
Patch series "selftests/cgroup: improve zswap tests robustness and support
large page sizes", v7.
This patchset aims to fix various spurious failures and improve the
overall robustness of the cgroup zswap selftests.
The primary motivation is to make the tests compatible with architectures
that use non-4K page sizes (such as 64K on ppc64le and arm64). Currently,
the tests rely heavily on hardcoded 4K page sizes and fixed memory limits.
On 64K page size systems, these hardcoded values lead to sub-page
granularity accesses, incorrect page count calculations, and insufficient
memory pressure to trigger zswap writeback, ultimately causing the tests
to fail.
Additionally, this series addresses OOM kills occurring in
test_swapin_nozswap by dynamically scaling memory limits, and prevents
spurious test failures when zswap is built into the kernel but globally
disabled.
This patch (of 8):
test_zswap currently only checks whether zswap is present by testing
/sys/module/zswap. This misses the runtime global state exposed in
/sys/module/zswap/parameters/enabled.
When zswap is built/loaded but globally disabled, the zswap cgroup
selftests run in an invalid environment and may fail spuriously.
Check the runtime enabled state before running the tests:
- skip if zswap is not configured,
- fail if the enabled knob cannot be read,
- skip if zswap is globally disabled.
Also print a hint in the skip message on how to enable zswap.
Link: https://lore.kernel.org/20260424040059.12940-1-li.wang@linux.dev
Link: https://lore.kernel.org/20260424040059.12940-2-li.wang@linux.dev
Signed-off-by: Li Wang <li.wang@linux.dev>
Acked-by: Yosry Ahmed <yosry@kernel.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Waiman Long <longman@redhat.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index 3af3608bf578c..aed674269c269 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -15,6 +15,9 @@
#include "../kselftest.h"
#include "cgroup_util.h"
+#define PATH_ZSWAP "/sys/module/zswap"
+#define PATH_ZSWAP_ENABLED "/sys/module/zswap/parameters/enabled"
+
static int read_int(const char *path, size_t *value)
{
FILE *file;
@@ -725,9 +728,18 @@ struct zswap_test {
};
#undef T
-static bool zswap_configured(void)
+static void check_zswap_enabled(void)
{
- return access("/sys/module/zswap", F_OK) == 0;
+ char value[2];
+
+ if (access(PATH_ZSWAP, F_OK))
+ ksft_exit_skip("zswap isn't configured\n");
+
+ if (read_text(PATH_ZSWAP_ENABLED, value, sizeof(value)) <= 0)
+ ksft_exit_fail_msg("Failed to read " PATH_ZSWAP_ENABLED "\n");
+
+ if (value[0] == 'N')
+ ksft_exit_skip("zswap is disabled (hint: echo 1 > " PATH_ZSWAP_ENABLED ")\n");
}
int main(int argc, char **argv)
@@ -740,8 +752,7 @@ int main(int argc, char **argv)
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
- if (!zswap_configured())
- ksft_exit_skip("zswap isn't configured\n");
+ check_zswap_enabled();
/*
* Check that memory controller is available:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0933/1756] selftests/cgroup: avoid OOM in test_swapin_nozswap
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (931 preceding siblings ...)
2026-11-18 14:50 ` [PATCH 6.12 0932/1756] selftests/cgroup: skip test_zswap if zswap is globally disabled Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0934/1756] selftests/cgroup: use runtime page size for zswpin check Greg Kroah-Hartman
` (65 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li Wang, Yosry Ahmed, Nhat Pham,
Johannes Weiner, Michal Hocko, Michal Koutný, Muchun Song,
Tejun Heo, Roman Gushchin, Shakeel Butt, Chengming Zhou,
Jiayuan Chen, Waiman Long, Yosry Ahmed, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <li.wang@linux.dev>
[ Upstream commit 0d38cded3c6294b0dfa38e3fc92077b5d381951e ]
test_swapin_nozswap can hit OOM before reaching its assertions on some
setups. The test currently sets memory.max=8M and then allocates/reads
32M with memory.zswap.max=0, which may over-constrain reclaim and kill the
workload process.
Replace hardcoded sizes with PAGE_SIZE-based values:
- control_allocation_size = PAGE_SIZE * 512
- memory.max = control_allocation_size * 3 / 4
- minimum expected swap = control_allocation_size / 4
This keeps the test pressure model intact (allocate/read beyond memory.max
to force swap-in/out) while making it more robust across different
environments.
The test intent is unchanged: confirm that swapping occurs while zswap remains
unused when memory.zswap.max=0.
=== Error Logs ===
# ./test_zswap
TAP version 13
1..7
ok 1 test_zswap_usage
not ok 2 test_swapin_nozswap
...
# dmesg
[271641.879153] test_zswap invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0
[271641.879168] CPU: 1 UID: 0 PID: 177372 Comm: test_zswap Kdump: loaded Not tainted 6.12.0-211.el10.ppc64le #1 VOLUNTARY
[271641.879171] Hardware name: IBM,9009-41A POWER9 (architected) 0x4e0202 0xf000005 of:IBM,FW940.02 (UL940_041) hv:phyp pSeries
[271641.879173] Call Trace:
[271641.879174] [c00000037540f730] [c00000000127ec44] dump_stack_lvl+0x88/0xc4 (unreliable)
[271641.879184] [c00000037540f760] [c0000000005cc594] dump_header+0x5c/0x1e4
[271641.879188] [c00000037540f7e0] [c0000000005cb464] oom_kill_process+0x324/0x3b0
[271641.879192] [c00000037540f860] [c0000000005cbe48] out_of_memory+0x118/0x420
[271641.879196] [c00000037540f8f0] [c00000000070d8ec] mem_cgroup_out_of_memory+0x18c/0x1b0
[271641.879200] [c00000037540f990] [c000000000713888] try_charge_memcg+0x598/0x890
[271641.879204] [c00000037540fa70] [c000000000713dbc] charge_memcg+0x5c/0x110
[271641.879207] [c00000037540faa0] [c0000000007159f8] __mem_cgroup_charge+0x48/0x120
[271641.879211] [c00000037540fae0] [c000000000641914] alloc_anon_folio+0x2b4/0x5a0
[271641.879215] [c00000037540fb60] [c000000000641d58] do_anonymous_page+0x158/0x6b0
[271641.879218] [c00000037540fbd0] [c000000000642f8c] __handle_mm_fault+0x4bc/0x910
[271641.879221] [c00000037540fcf0] [c000000000643500] handle_mm_fault+0x120/0x3c0
[271641.879224] [c00000037540fd40] [c00000000014bba0] ___do_page_fault+0x1c0/0x980
[271641.879228] [c00000037540fdf0] [c00000000014c44c] hash__do_page_fault+0x2c/0xc0
[271641.879232] [c00000037540fe20] [c0000000001565d8] do_hash_fault+0x128/0x1d0
[271641.879236] [c00000037540fe50] [c000000000008be0] data_access_common_virt+0x210/0x220
[271641.879548] Tasks state (memory values in pages):
...
[271641.879550] [ pid ] uid tgid total_vm rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name
[271641.879555] [ 177372] 0 177372 571 0 0 0 0 51200 96 0 test_zswap
[271641.879562] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=/,mems_allowed=0,oom_memcg=/no_zswap_test,task_memcg=/no_zswap_test,task=test_zswap,pid=177372,uid=0
[271641.879578] Memory cgroup out of memory: Killed process 177372 (test_zswap) total-vm:36544kB, anon-rss:0kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:50kB oom_score_adj:0
Link: https://lore.kernel.org/20260424040059.12940-3-li.wang@linux.dev
Signed-off-by: Li Wang <li.wang@linux.dev>
Acked-by: Yosry Ahmed <yosry@kernel.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Waiman Long <longman@redhat.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index aed674269c269..ea0d61424de40 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -165,21 +165,25 @@ static int test_zswap_usage(const char *root)
static int test_swapin_nozswap(const char *root)
{
int ret = KSFT_FAIL;
- char *test_group;
- long swap_peak, zswpout;
+ char *test_group, mem_max_buf[32];
+ long swap_peak, zswpout, min_swap;
+ size_t allocation_size = sysconf(_SC_PAGESIZE) * 512;
+
+ min_swap = allocation_size / 4;
+ snprintf(mem_max_buf, sizeof(mem_max_buf), "%zu", allocation_size * 3/4);
test_group = cg_name(root, "no_zswap_test");
if (!test_group)
goto out;
if (cg_create(test_group))
goto out;
- if (cg_write(test_group, "memory.max", "8M"))
+ if (cg_write(test_group, "memory.max", mem_max_buf))
goto out;
if (cg_write(test_group, "memory.zswap.max", "0"))
goto out;
/* Allocate and read more than memory.max to trigger swapin */
- if (cg_run(test_group, allocate_and_read_bytes, (void *)MB(32)))
+ if (cg_run(test_group, allocate_and_read_bytes, (void *)allocation_size))
goto out;
/* Verify that pages are swapped out, but no zswap happened */
@@ -189,8 +193,9 @@ static int test_swapin_nozswap(const char *root)
goto out;
}
- if (swap_peak < MB(24)) {
- ksft_print_msg("at least 24MB of memory should be swapped out\n");
+ if (swap_peak < min_swap) {
+ ksft_print_msg("at least %ldKB of memory should be swapped out\n",
+ min_swap / 1024);
goto out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0934/1756] selftests/cgroup: use runtime page size for zswpin check
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (932 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0933/1756] selftests/cgroup: avoid OOM in test_swapin_nozswap Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0935/1756] selftests/cgroup: replace hardcoded page size values in test_zswap Greg Kroah-Hartman
` (64 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li Wang, Yosry Ahmed, Nhat Pham,
Johannes Weiner, Michal Hocko, Michal Koutný, Muchun Song,
Tejun Heo, Roman Gushchin, Shakeel Butt, Chengming Zhou,
Jiayuan Chen, Waiman Long, Yosry Ahmed, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <li.wang@linux.dev>
[ Upstream commit b19ee588e159c71f0d314246a944dcfc3e2a6009 ]
test_zswapin compares memory.stat:zswpin (counted in pages) against a byte
threshold converted with PAGE_SIZE. In cgroup selftests, PAGE_SIZE is
hardcoded to 4096, which makes the conversion wrong on systems with non-4K
base pages (e.g. 64K).
As a result, the test requires too many pages to pass and fails spuriously
even when zswap is working.
Use sysconf(_SC_PAGESIZE) for the zswpin threshold conversion so the check
matches the actual system page size.
Link: https://lore.kernel.org/20260424040059.12940-4-li.wang@linux.dev
Signed-off-by: Li Wang <li.wang@linux.dev>
Reviewed-by: Yosry Ahmed <yosry@kernel.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Waiman Long <longman@redhat.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index ea0d61424de40..e2a4f97e90910 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -245,7 +245,7 @@ static int test_zswapin(const char *root)
goto out;
}
- if (zswpin < MB(24) / PAGE_SIZE) {
+ if (zswpin < MB(24) / sysconf(_SC_PAGESIZE)) {
ksft_print_msg("at least 24MB should be brought back from zswap\n");
goto out;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0935/1756] selftests/cgroup: replace hardcoded page size values in test_zswap
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (933 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0934/1756] selftests/cgroup: use runtime page size for zswpin check Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0936/1756] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Greg Kroah-Hartman
` (63 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Li Wang, Yosry Ahmed, Jiayuan Chen,
Johannes Weiner, Michal Hocko, Michal Koutný, Muchun Song,
Tejun Heo, Roman Gushchin, Shakeel Butt, Chengming Zhou,
Nhat Pham, Waiman Long, Yosry Ahmed, Andrew Morton, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <li.wang@linux.dev>
[ Upstream commit 43743cc516684e40faf15afbb123eccd3d90e244 ]
test_zswap uses hardcoded values of 4095 and 4096 throughout as page
stride and page size, which are only correct on systems with a 4K page
size. On architectures with larger pages (e.g., 64K on arm64 or ppc64),
these constants cause memory to be touched at sub-page granularity,
leading to inefficient access patterns and incorrect page count
calculations, which can cause test failures.
Replace all hardcoded 4095 and 4096 values with a global pagesize variable
initialized from sysconf(_SC_PAGESIZE) at startup, and remove the
redundant local sysconf() calls scattered across individual functions. No
functional change on 4K page size systems.
Link: https://lore.kernel.org/20260424040059.12940-6-li.wang@linux.dev
Signed-off-by: Li Wang <li.wang@linux.dev>
Acked-by: Yosry Ahmed <yosry@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 0567c7eaefd7 ("selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 45 ++++++++++++---------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index e2a4f97e90910..aa25806169639 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -15,6 +15,8 @@
#include "../kselftest.h"
#include "cgroup_util.h"
+static int page_size;
+
#define PATH_ZSWAP "/sys/module/zswap"
#define PATH_ZSWAP_ENABLED "/sys/module/zswap/parameters/enabled"
@@ -73,11 +75,11 @@ static int allocate_and_read_bytes(const char *cgroup, void *arg)
if (!mem)
return -1;
- for (int i = 0; i < size; i += 4095)
+ for (int i = 0; i < size; i += page_size)
mem[i] = 'a';
/* Go through the allocated memory to (z)swap in and out pages */
- for (int i = 0; i < size; i += 4095) {
+ for (int i = 0; i < size; i += page_size) {
if (mem[i] != 'a')
ret = -1;
}
@@ -93,7 +95,7 @@ static int allocate_bytes(const char *cgroup, void *arg)
if (!mem)
return -1;
- for (int i = 0; i < size; i += 4095)
+ for (int i = 0; i < size; i += page_size)
mem[i] = 'a';
free(mem);
return 0;
@@ -167,7 +169,7 @@ static int test_swapin_nozswap(const char *root)
int ret = KSFT_FAIL;
char *test_group, mem_max_buf[32];
long swap_peak, zswpout, min_swap;
- size_t allocation_size = sysconf(_SC_PAGESIZE) * 512;
+ size_t allocation_size = page_size * 512;
min_swap = allocation_size / 4;
snprintf(mem_max_buf, sizeof(mem_max_buf), "%zu", allocation_size * 3/4);
@@ -245,7 +247,7 @@ static int test_zswapin(const char *root)
goto out;
}
- if (zswpin < MB(24) / sysconf(_SC_PAGESIZE)) {
+ if (zswpin < MB(24) / page_size) {
ksft_print_msg("at least 24MB should be brought back from zswap\n");
goto out;
}
@@ -272,9 +274,8 @@ static int test_zswapin(const char *root)
*/
static int attempt_writeback(const char *cgroup, void *arg)
{
- long pagesize = sysconf(_SC_PAGESIZE);
size_t memsize = MB(4);
- char buf[pagesize];
+ char buf[page_size];
long zswap_usage;
bool wb_enabled = *(bool *) arg;
int ret = -1;
@@ -289,11 +290,11 @@ static int attempt_writeback(const char *cgroup, void *arg)
* half empty, this will result in data that is still compressible
* and ends up in zswap, with material zswap usage.
*/
- for (int i = 0; i < pagesize; i++)
- buf[i] = i < pagesize/2 ? (char) i : 0;
+ for (int i = 0; i < page_size; i++)
+ buf[i] = i < page_size/2 ? (char) i : 0;
- for (int i = 0; i < memsize; i += pagesize)
- memcpy(&mem[i], buf, pagesize);
+ for (int i = 0; i < memsize; i += page_size)
+ memcpy(&mem[i], buf, page_size);
/* Try and reclaim allocated memory */
if (cg_write_numeric(cgroup, "memory.reclaim", memsize)) {
@@ -304,8 +305,8 @@ static int attempt_writeback(const char *cgroup, void *arg)
zswap_usage = cg_read_long(cgroup, "memory.zswap.current");
/* zswpin */
- for (int i = 0; i < memsize; i += pagesize) {
- if (memcmp(&mem[i], buf, pagesize)) {
+ for (int i = 0; i < memsize; i += page_size) {
+ if (memcmp(&mem[i], buf, page_size)) {
ksft_print_msg("invalid memory\n");
goto out;
}
@@ -441,7 +442,7 @@ static int test_no_invasive_cgroup_shrink(const char *root)
if (cg_enter_current(control_group))
goto out;
control_allocation = malloc(control_allocation_size);
- for (int i = 0; i < control_allocation_size; i += 4095)
+ for (int i = 0; i < control_allocation_size; i += page_size)
control_allocation[i] = 'a';
if (cg_read_key_long(control_group, "memory.stat", "zswapped") < 1)
goto out;
@@ -481,7 +482,7 @@ static int no_kmem_bypass_child(const char *cgroup, void *arg)
values->child_allocated = true;
return -1;
}
- for (long i = 0; i < values->target_alloc_bytes; i += 4095)
+ for (long i = 0; i < values->target_alloc_bytes; i += page_size)
((char *)allocation)[i] = 'a';
values->child_allocated = true;
pause();
@@ -529,7 +530,7 @@ static int test_no_kmem_bypass(const char *root)
min_free_kb_low = sys_info.totalram / 500000;
values->target_alloc_bytes = (sys_info.totalram - min_free_kb_high * 1000) +
sys_info.totalram * 5 / 100;
- stored_pages_threshold = sys_info.totalram / 5 / 4096;
+ stored_pages_threshold = sys_info.totalram / 5 / page_size;
trigger_allocation_size = sys_info.totalram / 20;
/* Set up test memcg */
@@ -556,7 +557,7 @@ static int test_no_kmem_bypass(const char *root)
if (!trigger_allocation)
break;
- for (int i = 0; i < trigger_allocation_size; i += 4095)
+ for (int i = 0; i < trigger_allocation_size; i += page_size)
trigger_allocation[i] = 'b';
usleep(100000);
free(trigger_allocation);
@@ -567,8 +568,8 @@ static int test_no_kmem_bypass(const char *root)
/* If memory was pushed to zswap, verify it belongs to memcg */
if (stored_pages > stored_pages_threshold) {
int zswapped = cg_read_key_long(test_group, "memory.stat", "zswapped ");
- int delta = stored_pages * 4096 - zswapped;
- int result_ok = delta < stored_pages * 4096 / 4;
+ int delta = stored_pages * page_size - zswapped;
+ int result_ok = delta < stored_pages * page_size / 4;
ret = result_ok ? KSFT_PASS : KSFT_FAIL;
break;
@@ -622,7 +623,7 @@ static int allocate_random_and_wait(const char *cgroup, void *arg)
close(fd);
/* Touch all pages to ensure they're faulted in */
- for (size_t i = 0; i < size; i += PAGE_SIZE)
+ for (size_t i = 0; i < size; i += page_size)
mem[i] = mem[i];
/* Use MADV_PAGEOUT to push pages into zswap */
@@ -752,6 +753,10 @@ int main(int argc, char **argv)
char root[PATH_MAX];
int i;
+ page_size = sysconf(_SC_PAGE_SIZE);
+ if (page_size <= 0)
+ page_size = BUF_SIZE;
+
ksft_print_header();
ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0936/1756] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (934 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0935/1756] selftests/cgroup: replace hardcoded page size values in test_zswap Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0937/1756] checkpatch: skip CamelCase cache for --no-tree without root Greg Kroah-Hartman
` (62 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wilson Felipe Pereira, Andrew Morton,
Michal Koutný, Chengming Zhou, Johannes Weiner, Nhat Pham,
Shuah Khan, Tejun Heo, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wilson Felipe Pereira <wfelipe@google.com>
[ Upstream commit 0567c7eaefd7ea1b26d76c46964f9a1d92120d7d ]
In test_no_kmem_bypass(), delta (stored_pages * page_size - zswapped) is
checked against stored_pages * page_size / 4 to verify that the pages
pushed to zswap belong to the test memory cgroup.
Due to slight stat update timing differences, delta can evaluate to a
small negative number (e.g. -5MB out of 1GB). Because delta is declared
as a signed int and stored_pages is an unsigned size_t, C's usual
arithmetic conversions implicitly promote a negative delta to a large
unsigned 64-bit integer, causing `delta < stored_pages * page_size / 4` to
falsely evaluate to 0 and fail the test.
Fix this by declaring zswapped and delta as signed long long and comparing
against a signed threshold, ensuring negative deltas correctly evaluate to
true.
Link: https://lore.kernel.org/20260828033741.2184560-3-wfelipe@google.com
Fixes: a549f9f31561a ("selftests: cgroup: add test_zswap with no kmem bypass test")
Signed-off-by: Wilson Felipe Pereira <wfelipe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Koutný <mkoutny@suse.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/cgroup/test_zswap.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c
index aa25806169639..2c4b28724c637 100644
--- a/tools/testing/selftests/cgroup/test_zswap.c
+++ b/tools/testing/selftests/cgroup/test_zswap.c
@@ -567,11 +567,14 @@ static int test_no_kmem_bypass(const char *root)
break;
/* If memory was pushed to zswap, verify it belongs to memcg */
if (stored_pages > stored_pages_threshold) {
- int zswapped = cg_read_key_long(test_group, "memory.stat", "zswapped ");
- int delta = stored_pages * page_size - zswapped;
- int result_ok = delta < stored_pages * page_size / 4;
-
- ret = result_ok ? KSFT_PASS : KSFT_FAIL;
+ long zswapped = cg_read_key_long(
+ test_group, "memory.stat", "zswapped ");
+ long long delta =
+ (long long)stored_pages * page_size - zswapped;
+ long long max_delta =
+ (long long)stored_pages * page_size / 4;
+
+ ret = (delta < max_delta) ? KSFT_PASS : KSFT_FAIL;
break;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0937/1756] checkpatch: skip CamelCase cache for --no-tree without root
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (935 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0936/1756] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0938/1756] ocfs2: fix deadlock in inline-data truncate transactions Greg Kroah-Hartman
` (61 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Petr Vorel, Andrew Morton,
Andy Whitcroft, Dwaipayan Ray, Joe Perches, Lukas Bulwahn,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Vorel <pvorel@suse.cz>
[ Upstream commit d41ebc7f9e2cc80cb57139c05e71415a79582ab0 ]
Running outside tree (--no-tree) without git root (--root DIR) is not
doable because we have no include/ directory which could be cached. But
3445686af721 expected that we are always in Linux tree (w/a git). But
--no-tree does not require --root. Therefore skip whole caching in that
case.
This fixes perl and find errors when running checkpatch.pl *with*
--no-tree --strict and *without* --root:
No structs that should be const will be found - file 'scripts/const_structs.checkpatch': No such file or directory
Use of uninitialized value $root in concatenation (.) or string at scripts/checkpatch.pl line 1213.
find: `/include': No such file or directory
Link: https://lore.kernel.org/20260810161159.1044160-1-pvorel@suse.cz
Fixes: 3445686af721 ("checkpatch: ignore existing CamelCase uses from include/...")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 726576e8fdd65..089426e3cfb56 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1174,6 +1174,8 @@ sub seed_camelcase_includes {
my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`;
chomp $git_last_include_commit;
$camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit";
+ } elsif (not defined $root) {
+ return;
} else {
my $last_mod_date = 0;
$files = `find $root/include -name "*.h"`;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0938/1756] ocfs2: fix deadlock in inline-data truncate transactions
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (936 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0937/1756] checkpatch: skip CamelCase cache for --no-tree without root Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0939/1756] selftests/epoll: fix race condition in multi-waiter wakeup tests Greg Kroah-Hartman
` (60 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joseph Qi, Andrew Morton,
ZhengYuan Huang, Mark Fasheh, Joel Becker, Junxiao Bi,
Changwei Ge, Jun Piao, Heming Zhao, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
[ Upstream commit c204bf5ac3eeb66648904d0374d6f7b84d843aac ]
Updating an inode xattr can cause an ABBA deadlock with inline file
truncation:
ocfs2_truncate_file()
down_write(&oi->ip_alloc_sem)
ocfs2_truncate_inline()
ocfs2_start_trans()
ocfs2_xattr_set()
ocfs2_start_trans()
ocfs2_xattr_ibody_set()
down_write(&oi->ip_alloc_sem)
The xattr set path starts the merged transaction before the inode-body
xattr helper acquires ip_alloc_sem, reversing the ip_alloc_sem ->
transaction order used by the allocation and truncate paths. The
transaction merge in commit 85db90e77806 ("ocfs2/xattr: Merge xattr set
transaction.") introduced this ordering.
Fix it by acquiring ip_alloc_sem once in ocfs2_xattr_set(), before xattr
preparation, allocation reservations and ocfs2_start_trans(), and removing
the per-helper acquisition from ocfs2_xattr_ibody_find(),
ocfs2_xattr_ibody_set() and ocfs2_xattr_create_index_block(). These
helpers now assert via lockdep that the caller holds ip_alloc_sem.
ocfs2_xattr_set_handle(), which only sets initial ACL or security xattrs
on unpublished inodes inside the create transaction, takes ip_alloc_sem
under a dedicated lockdep subclass so that the assertions hold without
creating a transaction -> ip_alloc_sem cycle against the ip_alloc_sem ->
transaction order. The inode is unpublished, so the acquisition can never
contend.
This keeps the established ip_alloc_sem -> transaction order and makes the
locking unconditional, so lockdep can verify a single plain ordering
instead of conditional acquisitions.
Link: https://lore.kernel.org/20260826112659.246574-1-joseph.qi@linux.alibaba.com
Fixes: 85db90e77806 ("ocfs2/xattr: Merge xattr set transaction.")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: ZhengYuan Huang <gality369@gmail.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/xattr.c | 79 ++++++++++++++++++++++++++++++++----------------
1 file changed, 53 insertions(+), 26 deletions(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 037ae2200c83d..58bc60babf4c4 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -2912,6 +2912,9 @@ static int ocfs2_xattr_has_space_inline(struct inode *inode,
*
* Find extended attribute in inode block and
* fill search info into struct ocfs2_xattr_search.
+ *
+ * The inline free-space check races with truncate and allocation, so
+ * callers must hold ip_alloc_sem for writing.
*/
static int ocfs2_xattr_ibody_find(struct inode *inode,
int name_index,
@@ -2923,13 +2926,13 @@ static int ocfs2_xattr_ibody_find(struct inode *inode,
int ret;
int has_space = 0;
+ lockdep_assert_held_write(&oi->ip_alloc_sem);
+
if (inode->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE)
return 0;
if (!(oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL)) {
- down_read(&oi->ip_alloc_sem);
has_space = ocfs2_xattr_has_space_inline(inode, di);
- up_read(&oi->ip_alloc_sem);
if (!has_space)
return 0;
}
@@ -3008,6 +3011,7 @@ static int ocfs2_xattr_ibody_init(struct inode *inode,
*
* Set, replace or remove an extended attribute into inode block.
*
+ * Callers must hold ip_alloc_sem for writing.
*/
static int ocfs2_xattr_ibody_set(struct inode *inode,
struct ocfs2_xattr_info *xi,
@@ -3018,16 +3022,17 @@ static int ocfs2_xattr_ibody_set(struct inode *inode,
struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_xa_loc loc;
+ lockdep_assert_held_write(&oi->ip_alloc_sem);
+
if (inode->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE)
return -ENOSPC;
- down_write(&oi->ip_alloc_sem);
if (!(oi->ip_dyn_features & OCFS2_INLINE_XATTR_FL)) {
ret = ocfs2_xattr_ibody_init(inode, xs->inode_bh, ctxt);
if (ret) {
if (ret != -ENOSPC)
mlog_errno(ret);
- goto out;
+ return ret;
}
}
@@ -3037,13 +3042,10 @@ static int ocfs2_xattr_ibody_set(struct inode *inode,
if (ret) {
if (ret != -ENOSPC)
mlog_errno(ret);
- goto out;
+ return ret;
}
xs->here = loc.xl_entry;
-out:
- up_write(&oi->ip_alloc_sem);
-
return ret;
}
@@ -3701,6 +3703,18 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
return ret;
}
+/*
+ * ip_alloc_sem subclass for inodes being initialized before publication.
+ * ocfs2_xattr_set_handle() runs inside the create transaction, so taking
+ * ip_alloc_sem there adds a transaction -> ip_alloc_sem order that would
+ * form a lockdep cycle with the ip_alloc_sem -> transaction order used
+ * elsewhere, if not for this separate subclass. The inode is unpublished
+ * so the acquisition can never contend.
+ */
+enum {
+ OCFS2_IP_ALLOC_SEM_UNPUBLISHED = 1,
+};
+
/*
* This helper is only for setting initial ACL or security xattrs on an inode
* that is still unpublished, unhashed, and unattached to a dentry.
@@ -3762,6 +3776,13 @@ int ocfs2_xattr_set_handle(handle_t *handle,
xis.inode_bh = xbs.inode_bh = di_bh;
di = (struct ocfs2_dinode *)di_bh->b_data;
+ /*
+ * The inode is unpublished and cannot contend, but take the
+ * semaphore anyway so the helpers' lockdep assertions hold.
+ */
+ down_write_nested(&OCFS2_I(inode)->ip_alloc_sem,
+ OCFS2_IP_ALLOC_SEM_UNPUBLISHED);
+
ret = ocfs2_xattr_ibody_find(inode, name_index, name, &xis);
if (ret)
goto cleanup;
@@ -3774,6 +3795,7 @@ int ocfs2_xattr_set_handle(handle_t *handle,
ret = __ocfs2_xattr_set_handle(inode, di, &xi, &xis, &xbs, &ctxt);
cleanup:
+ up_write(&OCFS2_I(inode)->ip_alloc_sem);
brelse(xbs.xattr_bh);
ocfs2_xattr_bucket_free(xbs.bucket);
@@ -3842,30 +3864,38 @@ int ocfs2_xattr_set(struct inode *inode,
di = (struct ocfs2_dinode *)di_bh->b_data;
down_write(&OCFS2_I(inode)->ip_xattr_sem);
+ /*
+ * The allocation and truncate paths take ip_alloc_sem before
+ * starting a transaction, so take it here before xattr
+ * preparation, allocation reservations and ocfs2_start_trans()
+ * to keep that order. The xattr helpers below no longer take
+ * it themselves.
+ */
+ down_write(&OCFS2_I(inode)->ip_alloc_sem);
/*
* Scan inode and external block to find the same name
* extended attribute and collect search information.
*/
ret = ocfs2_xattr_ibody_find(inode, name_index, name, &xis);
if (ret)
- goto cleanup;
+ goto out_free_ac;
if (xis.not_found) {
ret = ocfs2_xattr_block_find(inode, name_index, name, &xbs);
if (ret)
- goto cleanup;
+ goto out_free_ac;
}
if (xis.not_found && xbs.not_found) {
ret = -ENODATA;
if (flags & XATTR_REPLACE)
- goto cleanup;
+ goto out_free_ac;
ret = 0;
if (!value)
- goto cleanup;
+ goto out_free_ac;
} else {
ret = -EEXIST;
if (flags & XATTR_CREATE)
- goto cleanup;
+ goto out_free_ac;
}
/* Check whether the value is refcounted and do some preparation. */
@@ -3876,7 +3906,7 @@ int ocfs2_xattr_set(struct inode *inode,
&ref_meta, &ref_credits);
if (ret) {
mlog_errno(ret);
- goto cleanup;
+ goto out_free_ac;
}
}
@@ -3887,7 +3917,7 @@ int ocfs2_xattr_set(struct inode *inode,
if (ret < 0) {
inode_unlock(tl_inode);
mlog_errno(ret);
- goto cleanup;
+ goto out_free_ac;
}
}
inode_unlock(tl_inode);
@@ -3896,7 +3926,7 @@ int ocfs2_xattr_set(struct inode *inode,
&xbs, &ctxt, ref_meta, &credits);
if (ret) {
mlog_errno(ret);
- goto cleanup;
+ goto out_free_ac;
}
/* we need to update inode's ctime field, so add credit for it. */
@@ -3914,6 +3944,7 @@ int ocfs2_xattr_set(struct inode *inode,
ocfs2_commit_trans(osb, ctxt.handle);
out_free_ac:
+ up_write(&OCFS2_I(inode)->ip_alloc_sem);
if (ctxt.data_ac)
ocfs2_free_alloc_context(ctxt.data_ac);
if (ctxt.meta_ac)
@@ -3922,7 +3953,6 @@ int ocfs2_xattr_set(struct inode *inode,
ocfs2_schedule_truncate_log_flush(osb, 1);
ocfs2_run_deallocs(osb, &ctxt.dealloc);
-cleanup:
if (ref_tree)
ocfs2_unlock_refcount_tree(osb, ref_tree, 1);
up_write(&OCFS2_I(inode)->ip_xattr_sem);
@@ -4623,6 +4653,10 @@ static void ocfs2_xattr_update_xattr_search(struct inode *inode,
xs->here = xs->header->xh_entries;
}
+/*
+ * Caller must hold ip_alloc_sem for writing, since a new xattr block
+ * is allocated and the xattr block header is rewritten.
+ */
static int ocfs2_xattr_create_index_block(struct inode *inode,
struct ocfs2_xattr_info *xi,
struct ocfs2_xattr_search *xs,
@@ -4639,19 +4673,14 @@ static int ocfs2_xattr_create_index_block(struct inode *inode,
struct ocfs2_xattr_tree_root *xr;
u16 xb_flags = le16_to_cpu(xb->xb_flags);
+ lockdep_assert_held_write(&oi->ip_alloc_sem);
+
trace_ocfs2_xattr_create_index_block_begin(
(unsigned long long)xb_bh->b_blocknr);
BUG_ON(xb_flags & OCFS2_XATTR_INDEXED);
BUG_ON(!xs->bucket);
- /*
- * XXX:
- * We can use this lock for now, and maybe move to a dedicated mutex
- * if performance becomes a problem later.
- */
- down_write(&oi->ip_alloc_sem);
-
ret = ocfs2_journal_access_xb(handle, INODE_CACHE(inode), xb_bh,
OCFS2_JOURNAL_ACCESS_WRITE);
if (ret) {
@@ -4713,8 +4742,6 @@ static int ocfs2_xattr_create_index_block(struct inode *inode,
ocfs2_journal_dirty(handle, xb_bh);
out:
- up_write(&oi->ip_alloc_sem);
-
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0939/1756] selftests/epoll: fix race condition in multi-waiter wakeup tests
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (937 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0938/1756] ocfs2: fix deadlock in inline-data truncate transactions Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0940/1756] init/main: fix off-by-one in argv_init cleanup Greg Kroah-Hartman
` (59 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Schmaus, Andrew Morton,
Heiher, Roman Penyaev, Shuah Khan, Christian Brauner, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Schmaus <florian.schmaus@codasip.com>
[ Upstream commit 4238e66c82b6ee888a768cb298c85083b4566726 ]
In tests with multiple concurrent waiters on edge-triggered epoll
instances where an emitter writes to multiple sockets (epoll16, epoll56,
epoll58):
When the emitter performs its first write(), ep_poll_callback() fires and
wakes up both waiters because one waiter uses epoll_wait() and the other
one uses poll(). This translates to different wait queues, ep->wq for
epoll and ep->poll_wait for poll/select, which are both awoken by the
kernel because of that single write. Next, both waiter threads invoke
epoll_wait(), but since there is only one event, only one epoll_wait()
will return non-zero because of the edge-triggered mode being used (in
level-triggered mode, the kernel would re-queue the event because of
remaining unread data).
Since the second waiter sees an empty ready list, it does not increment
ctx.count and the test fails spuriously with ctx.count == 1 instead of 2.
Emitter (CPU 0) Thread 0 (CPU 1) Thread 1 (CPU 2)
=============== ================ ================
epoll_wait(e0, -1) poll(e0, -1)
[on e0->wq] [on e0->poll_wait]
write(sfd[1])
|
+--(Kernel wakes BOTH e0->wq and e0->poll_wait via callback)--+
| |
| wakes up wakes up |
| epoll_wait() reaps e1 poll() returns 1 |
| (e1 removed via ET) (wants event) |
| e0->rdllist is EMPTY | |
| count++ (count = 1) v |
| epoll_wait(e0, 0) |
| sees EMPTY list! |
| returns 0! |
| thread exits |
v |
write(sfd[3]) |
(event arrives too late!) v
EXPECT_EQ(count, 2) <-- SPURIOUS FAILURE!
Introduce waiter_entry1ap_loop() to retry poll() if the initial
epoll_wait(..., 0) yielded no events. This ensures the thread waits for
the subsequent write rather than failing immediately. Apply this helper
in epoll16, epoll56, and for both waiter threads in epoll58.
Link: https://lore.kernel.org/20260828-selftest-epoll-fix-race-v2-1-953ab57fd60a@codasip.com
Fixes: f2728fe80cef ("selftests: add epoll selftests")
Signed-off-by: Florian Schmaus <florian.schmaus@codasip.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Heiher <r@hev.cc>
Cc: Roman Penyaev <rpenyaev@suse.de>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../filesystems/epoll/epoll_wakeup_test.c | 32 +++++++++++++------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c b/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c
index 65ede506305c8..9805aa3a22754 100644
--- a/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c
+++ b/tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c
@@ -74,6 +74,24 @@ static void *waiter_entry1ap(void *data)
return NULL;
}
+static void *waiter_entry1ap_loop(void *data)
+{
+ struct pollfd pfd;
+ struct epoll_event e;
+ struct epoll_mtcontext *ctx = data;
+
+ pfd.fd = ctx->efd[0];
+ pfd.events = POLLIN;
+ while (poll(&pfd, 1, 2000) > 0) {
+ if (epoll_wait(ctx->efd[0], &e, 1, 0) > 0) {
+ __sync_fetch_and_add(&ctx->count, 1);
+ break;
+ }
+ }
+
+ return NULL;
+}
+
static void *waiter_entry1o(void *data)
{
struct epoll_event e;
@@ -809,7 +827,7 @@ TEST(epoll16)
ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[2], events), 0);
ctx.main = pthread_self();
- ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1ap, &ctx), 0);
+ ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1ap_loop, &ctx), 0);
ASSERT_EQ(pthread_create(&emitter, NULL, emitter_entry2, &ctx), 0);
if (epoll_wait(ctx.efd[0], events, 1, -1) > 0)
@@ -2925,7 +2943,7 @@ TEST(epoll56)
ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0);
ctx.main = pthread_self();
- ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1ap, &ctx), 0);
+ ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1ap_loop, &ctx), 0);
ASSERT_EQ(pthread_create(&emitter, NULL, emitter_entry2, &ctx), 0);
if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0)
@@ -3030,7 +3048,6 @@ TEST(epoll57)
TEST(epoll58)
{
pthread_t emitter;
- struct pollfd pfd;
struct epoll_event e;
struct epoll_mtcontext ctx = { 0 };
@@ -3061,15 +3078,10 @@ TEST(epoll58)
ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0);
ctx.main = pthread_self();
- ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1ap, &ctx), 0);
+ ASSERT_EQ(pthread_create(&ctx.waiter, NULL, waiter_entry1ap_loop, &ctx), 0);
ASSERT_EQ(pthread_create(&emitter, NULL, emitter_entry2, &ctx), 0);
- pfd.fd = ctx.efd[0];
- pfd.events = POLLIN;
- if (poll(&pfd, 1, -1) > 0) {
- if (epoll_wait(ctx.efd[0], &e, 1, 0) > 0)
- __sync_fetch_and_add(&ctx.count, 1);
- }
+ waiter_entry1ap_loop(&ctx);
ASSERT_EQ(pthread_join(ctx.waiter, NULL), 0);
EXPECT_EQ(ctx.count, 2);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0940/1756] init/main: fix off-by-one in argv_init cleanup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (938 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0939/1756] selftests/epoll: fix race condition in multi-waiter wakeup tests Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0941/1756] init/main: fix false-positive kernel panic on environment variable overwrite Greg Kroah-Hartman
` (58 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wilson Felipe Pereira, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wilson Felipe Pereira <wfelipe@google.com>
[ Upstream commit b82ed0e3a1dafe41577b095318a3ea6c0eec6f46 ]
Patch series "init: fix array boundary bugs in boot parameter parsing".
This series fixes two distinct boundary logic edge-case bugs in
`init/main.c` related to parsing boot command-line arguments and
environment variables. Both bugs have been present since the early git
history (Linux-2.6.12-rc2).
1. The first patch fixes an off-by-one error in `init_setup()` where
the final slot of the `argv_init` array was left uncleared. This
allowed a stale kernel parameter to leak into the `init` process's
user-space command line if exactly `MAX_INIT_ARGS` unknown
parameters were passed.
2. The second patch fixes a false-positive kernel panic in
`unknown_bootoption()`. If a user filled the environment variable
array up to its exact limit (32) and then attempted to overwrite
the final variable, the kernel would panic before evaluating
whether it was a harmless duplicate.
Exact QEMU reproduction steps for both edge cases are documented inside
their respective commit descriptions.
This patch (of 2):
When cleaning up argv_init in init_setup() and rdinit_setup(), the loop
terminates one element early due to using '<' instead of '<='. Since
argv_init is sized MAX_INIT_ARGS+2, index MAX_INIT_ARGS is a valid element
that should be cleared to NULL.
If exactly MAX_INIT_ARGS unknown arguments are passed before 'init=', the
uncleared argv_init[MAX_INIT_ARGS] can act as a ghost argument to
/sbin/init or cause a spurious kernel panic when later appended to.
To verify the argument leak, boot a VM into a shell with 32 unknown kernel
arguments, the init parameter, and 31 user arguments:
STALE_ARGS=$(for i in {1..32}; do echo -n "stale$i "; done)
USER_ARGS=$(for i in {1..31}; do echo -n "user$i "; done)
qemu-system-x86_64 -kernel bzImage \
-append "$STALE_ARGS init=/bin/sh $USER_ARGS"
Running `cat /proc/1/cmdline` inside the shell reveals that the 32nd
kernel argument ('stale32') incorrectly leaked into the init process's
command line. This patch zeroes the final slot, cleanly terminating the
array.
Link: https://lore.kernel.org/20260818045357.4123784-1-wfelipe@google.com
Link: https://lore.kernel.org/20260818045357.4123784-2-wfelipe@google.com
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Fixes: ffdfc40976dd ("[PATCH] Add rdinit parameter to pick early userspace init")
Signed-off-by: Wilson Felipe Pereira <wfelipe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
init/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/init/main.c b/init/main.c
index bad880340de43..92397b5a3a6e3 100644
--- a/init/main.c
+++ b/init/main.c
@@ -570,7 +570,7 @@ static int __init init_setup(char *str)
* the shell think it should execute a script with such name.
* So we ignore all arguments entered _before_ init=... [MJ]
*/
- for (i = 1; i < MAX_INIT_ARGS; i++)
+ for (i = 1; i <= MAX_INIT_ARGS; i++)
argv_init[i] = NULL;
return 1;
}
@@ -582,7 +582,7 @@ static int __init rdinit_setup(char *str)
ramdisk_execute_command = str;
/* See "auto" comment in init_setup */
- for (i = 1; i < MAX_INIT_ARGS; i++)
+ for (i = 1; i <= MAX_INIT_ARGS; i++)
argv_init[i] = NULL;
return 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0941/1756] init/main: fix false-positive kernel panic on environment variable overwrite
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (939 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0940/1756] init/main: fix off-by-one in argv_init cleanup Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0942/1756] ocfs2: allow xattr bucket entries to span multiple blocks Greg Kroah-Hartman
` (57 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wilson Felipe Pereira, Andrew Morton,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wilson Felipe Pereira <wfelipe@google.com>
[ Upstream commit 51e766bcd35e706d8df29dd0fac98871fdced261 ]
In unknown_bootoption(), the limit checking for environment variables sets
panic_later *before* checking if the variable already exists in envp_init.
If a user passes exactly MAX_INIT_ENVS custom variables and then
overwrites the final variable by matching its key, it causes a
false-positive hard panic on boot despite not actually exceeding the array
bounds or increasing the total variable count.
Swapping the order of these checks allows the duplicate check to break out
of the loop before the panic flag is erroneously latched.
To verify, boot a VM with 31 custom variables (filling the array up to its
limit of 32) and then overwrite the very last variable:
ENV_VARS=$(for i in {1..31}; do echo -n "var$i=$i "; done)
qemu-system-x86_64 -kernel bzImage -append "$ENV_VARS var31=overwrite"
Without this patch, the kernel crashes instantly with:
Kernel panic - not syncing: Too many boot env vars at 'var31=overwrite'
With this patch, the kernel safely overwrites the variable and boots.
Link: https://lore.kernel.org/20260818045357.4123784-3-wfelipe@google.com
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Wilson Felipe Pereira <wfelipe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
init/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/init/main.c b/init/main.c
index 92397b5a3a6e3..79ca15273730f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -537,12 +537,12 @@ static int __init unknown_bootoption(char *param, char *val,
/* Environment option */
unsigned int i;
for (i = 0; envp_init[i]; i++) {
+ if (!strncmp(param, envp_init[i], len+1))
+ break;
if (i == MAX_INIT_ENVS) {
panic_later = "env";
panic_param = param;
}
- if (!strncmp(param, envp_init[i], len+1))
- break;
}
envp_init[i] = param;
} else {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0942/1756] ocfs2: allow xattr bucket entries to span multiple blocks
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (940 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0941/1756] init/main: fix false-positive kernel panic on environment variable overwrite Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0943/1756] ocfs2: reject inconsistent xattr bucket during defrag Greg Kroah-Hartman
` (56 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joseph Qi, Andrew Morton,
Mark Fasheh, Joel Becker, Junxiao Bi, Changwei Ge, Jun Piao,
Heming Zhao, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
[ Upstream commit 78cce2082d22d3c56bd3a6146ef0dcf7cd661a33 ]
Patch series "ocfs2: xattr bucket validation fixes", v2.
This series fixes two problems around xattr bucket validation.
Patch 1 fixes a false-corruption failure on blocksize-512 volumes: the
bucket validator limited the entry array to the first bucket block while
the write path stores entries across the whole 4096-byte bucket region, so
a legitimately written, fsck-clean bucket could be rejected and force the
filesystem read-only. It also adds an alignment check on the bucket block
number, since the entry array is accessed as one contiguous region and a
corrupted xattr tree could otherwise point a bucket at blocks straddling a
page boundary.
Patch 2 converts two mlog_bug_on_msg() checks in the bucket defrag path to
ocfs2_error() returns, so that a corrupt bucket holding overlapping
entries or an inflated xh_free_start marks the filesystem read-only and
fails the setxattr instead of panicking the kernel.
Both patches have been tested in QEMU: the blocksize-512 reproducer (40
xattrs with 100-byte values, previously failing with "entry count 32
exceeds maximum 31") now passes with a clean fsck.ocfs2 result, and the
ocfs2 testsuite xattr tests pass 48/48 across blocksize combinations.
This patch (of 2):
ocfs2_validate_xattr_bucket() limits the entry array to the first bucket
block, but the write path stores entries across the whole
OCFS2_XATTR_BUCKET_SIZE region. With 512-byte blocks a bucket spans eight
blocks, and a bucket filled with small xattrs places its last entries past
offset 512. Reading such a bucket back errors out:
OCFS2: ERROR (device loop0): ocfs2_validate_xattr_bucket: Invalid xattr bucket 86072: entry count 32 exceeds maximum 31
On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
OCFS2: File system is now read-only.
This is reproducible by setting ~33 xattrs with 100-byte values on a file
on a blocksize-512 volume; fsck.ocfs2 reports the resulting image clean.
Check the entry count against the full bucket region instead. The
per-block bounds checks for names and values stay as they are, since
ocfs2_bucket_align_free_start() keeps each name+value pair within a single
block.
The entry array is one contiguous region, so a bucket from a corrupted
xattr tree whose first block is not aligned to OCFS2_XATTR_BUCKET_SIZE
could straddle a page and make the validation loop read out of bounds.
Buckets allocated within clusters are always aligned, so reject any other
block number while validating.
Link: https://lore.kernel.org/20260903131313.2396208-1-joseph.qi@linux.alibaba.com
Link: https://lore.kernel.org/20260903131313.2396208-2-joseph.qi@linux.alibaba.com
Fixes: 2cf82b46d5e4 ("ocfs2: validate external xattr entries when reading metadata")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/xattr.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 58bc60babf4c4..391998626cf0b 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -1121,11 +1121,30 @@ static int ocfs2_validate_xattr_bucket(struct ocfs2_xattr_bucket *bucket,
struct ocfs2_xattr_header *xh = bucket_xh(bucket);
u16 xattr_count = le16_to_cpu(xh->xh_count);
size_t region_size = (size_t)sb->s_blocksize * bucket->bu_blocks;
- size_t entries_limit = sb->s_blocksize;
+ /*
+ * The entry array grows up from the header across the whole
+ * bucket region, so it may extend beyond the first bucket block
+ * when the blocksize is smaller than OCFS2_XATTR_BUCKET_SIZE.
+ * Name/value pairs, however, always live within a single block.
+ */
+ size_t entries_limit = region_size;
size_t nv_limit = sb->s_blocksize;
size_t max_entries;
int i;
+ /*
+ * The entry array is one contiguous region that may span the
+ * bucket's buffer_heads. Buckets are allocated within clusters,
+ * so their first block is always aligned to
+ * OCFS2_XATTR_BUCKET_SIZE and the whole bucket fits in one page.
+ * A corrupted xattr tree can point a bucket at blocks straddling
+ * a page, so reject it before touching the entry array.
+ */
+ if (blkno & (bucket->bu_blocks - 1))
+ return ocfs2_error(sb,
+ "Invalid xattr bucket %llu: unaligned block number\n",
+ (unsigned long long)blkno);
+
if (region_size < sizeof(*xh))
return ocfs2_error(sb,
"Invalid xattr bucket %llu: region size %zu is too small\n",
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0943/1756] ocfs2: reject inconsistent xattr bucket during defrag
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (941 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0942/1756] ocfs2: allow xattr bucket entries to span multiple blocks Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0944/1756] PCI/AER: Fix struct pci_dev reference leak in aer_process_err_devices() Greg Kroah-Hartman
` (55 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Joseph Qi, Andrew Morton,
Changwei Ge, Heming Zhao, Joel Becker, Jun Piao, Junxiao Bi,
Mark Fasheh, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
[ Upstream commit bd40b997f04542869afeabe94f2cf1a016fc9bfa ]
ocfs2_defrag_xattr_bucket() has two mlog_bug_on_msg() checks that assume
the name/value pairs in a bucket are disjoint and that xh_free_start is
not below the compacted region.
ocfs2_validate_xattr_bucket() only checks each entry in isolation, so a
corrupt bucket holding overlapping entries, or one with an inflated
xh_free_start, passes validation and then hits BUG() in defrag when a
setxattr triggers it.
Defrag works on a linear copy of the bucket and does not touch the real
blocks before the copy back, so the checks can return an error instead of
calling BUG().
Link: https://lore.kernel.org/20260903131313.2396208-3-joseph.qi@linux.alibaba.com
Fixes: 012255961c9e ("ocfs2: Enable xattr set in index btree")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/xattr.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 391998626cf0b..f9f07d9115a66 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -4856,16 +4856,22 @@ static int ocfs2_defrag_xattr_bucket(struct inode *inode,
memmove(bucket_buf + end - len,
bucket_buf + offset, len);
xe->xe_name_offset = cpu_to_le16(end - len);
+ } else if (end < offset + len) {
+ ret = ocfs2_error(inode->i_sb,
+ "Defrag check failed for bucket %llu\n",
+ (unsigned long long)blkno);
+ goto out;
}
- mlog_bug_on_msg(end < offset + len, "Defrag check failed for "
- "bucket %llu\n", (unsigned long long)blkno);
-
end -= len;
}
- mlog_bug_on_msg(xh_free_start > end, "Defrag check failed for "
- "bucket %llu\n", (unsigned long long)blkno);
+ if (xh_free_start > end) {
+ ret = ocfs2_error(inode->i_sb,
+ "Defrag check failed for bucket %llu\n",
+ (unsigned long long)blkno);
+ goto out;
+ }
if (xh_free_start == end)
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0944/1756] PCI/AER: Fix struct pci_dev reference leak in aer_process_err_devices()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (942 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0943/1756] ocfs2: reject inconsistent xattr bucket during defrag Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0945/1756] ALSA: caiaq: Allow zero-length packet handling for EP1 Greg Kroah-Hartman
` (54 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Priyank Rathod, Bjorn Helgaas,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Priyank Rathod <rathodpriyank@google.com>
[ Upstream commit e86ac10110d00e6c3801f38bde1863951315222b ]
When an AER error occurs, candidate error-source devices are added to
e_info->dev[] by add_error_device(), which takes a reference with
pci_dev_get().
A device can be recorded without any error status being present: the
Requester ID fast path in is_error_source(),
if (e_info->id == pci_dev_id(dev))
return true;
matches purely on the ID reported by the Root Port and returns true without
reading the device's AER status registers.
In aer_process_err_devices(), handle_error_source() is called only if
aer_get_device_error_info() returns non-zero, i.e. only if an unmasked
error status bit is actually set. It returns 0 if the device has become
inaccessible (status and mask both read as all ones, so
status & ~mask == 0) or if no unmasked status bit is set.
Because handle_error_source() was responsible for calling pci_dev_put(),
skipping it permanently leaks the reference taken in add_error_device().
Decouple reference lifetime from error handling by moving pci_dev_put() out
of handle_error_source() and into the aer_process_err_devices() loop, so
every recorded device is put exactly once.
handle_error_source() is static and aer_process_err_devices() is its only
caller, so no other path is affected.
Fixes: 60271ab044a5 ("PCI/AER: Take reference on error devices")
Signed-off-by: Priyank Rathod <rathodpriyank@google.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260918-fix-aer-refcount-leak-v2-1-bdd1ff1c35a9@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pcie/aer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 44fac6c2f437e..39b03f0945996 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1124,7 +1124,6 @@ static void handle_error_source(struct pci_dev *dev, struct aer_err_info *info)
{
cxl_rch_handle_error(dev, info);
pci_aer_handle_error(dev, info);
- pci_dev_put(dev);
}
#ifdef CONFIG_ACPI_APEI_PCIEAER
@@ -1277,6 +1276,7 @@ static inline void aer_process_err_devices(struct aer_err_info *e_info)
for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
if (aer_get_device_error_info(e_info->dev[i], e_info))
handle_error_source(e_info->dev[i], e_info);
+ pci_dev_put(e_info->dev[i]);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0945/1756] ALSA: caiaq: Allow zero-length packet handling for EP1
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (943 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0944/1756] PCI/AER: Fix struct pci_dev reference leak in aer_process_err_devices() Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0946/1756] gen_init_cpio: stop parsing on lines with a missing argument list Greg Kroah-Hartman
` (53 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit ccfe6ab672c020fca56988e634088bfb7764e2a7 ]
The recent fix to avoid OOB access for malformed packets added a
packet length check and returns immediately if it's too short.
However, this can be lead to a regression because the completion
handler doesn't resubmit the packet, while a zero-length packet itself
is valid, per se.
For addressing the potential regression above, change the handling for
a zero-length packet to just resubmit without processing the incoming
contents.
Fixes: aba30af07d4f ("ALSA: usb-audio: caiaq: validate EP1 reply lengths")
Link: https://patch.msgid.link/20261006134405.479603-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/caiaq/device.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index e8619bb743581..993858d18b680 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -142,7 +142,7 @@ static void usb_ep1_command_reply_dispatch (struct urb* urb)
return;
}
if (urb->actual_length < 1)
- return;
+ goto resubmit;
payload_len = urb->actual_length - 1;
@@ -192,6 +192,7 @@ static void usb_ep1_command_reply_dispatch (struct urb* urb)
break;
}
+ resubmit:
cdev->ep1_in_urb->actual_length = 0;
ret = usb_submit_urb(cdev->ep1_in_urb, GFP_ATOMIC);
if (ret < 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0946/1756] gen_init_cpio: stop parsing on lines with a missing argument list
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (944 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0945/1756] ALSA: caiaq: Allow zero-length packet handling for EP1 Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0947/1756] pinctrl: sprd: free maps on DT map failure Greg Kroah-Hartman
` (52 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leizhen Zhang, Nathan Chancellor,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leizhen Zhang <lzsx618@gmail.com>
[ Upstream commit c8dd1aa0274d8ad3df82ec1b064065f410ce99ed ]
When a line in the cpio list consists of a file type followed only by
whitespace and no newline (e.g. "slink " as the last line of the file),
strtok(NULL, "\n") returns NULL. main() prints an error and sets ec, but
then carries on and passes the NULL args pointer to the type handler,
which hands it to sscanf() and crashes:
AddressSanitizer: SEGV on unknown address 0x000000000000
#4 __isoc99_sscanf
#5 cpio_mkslink_line usr/gen_init_cpio.c:169
Break out of the loop as is already done for the other format error, so
that the error is reported and gen_init_cpio exits with a failure status.
Found by fuzzing gen_init_cpio built with ASan/UBSan.
Reproducer:
printf 'slink ' > list && usr/gen_init_cpio list
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by: Claude:claude-opus-5-5 ASan UBSan
Signed-off-by: Leizhen Zhang <lzsx618@gmail.com>
Link: https://patch.msgid.link/20261005085729.872402-1-lzsx618@gmail.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
usr/gen_init_cpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index edcdb8abfa31c..38df4800f6066 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -672,6 +672,7 @@ int main (int argc, char *argv[])
"ERROR: incorrect format, newline required line %d: '%s'\n",
line_nr, line);
ec = -1;
+ break;
}
for (type_idx = 0; file_handler_table[type_idx].type; type_idx++) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0947/1756] pinctrl: sprd: free maps on DT map failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (945 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0946/1756] gen_init_cpio: stop parsing on lines with a missing argument list Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0948/1756] wifi: mt76: mt7915: check default EEPROM firmware size before copying Greg Kroah-Hartman
` (51 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jiale Yao, Baolin Wang,
Linus Walleij, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit e873c665e503ebfb6dafaf9346c3956695686226 ]
sprd_dt_node_to_map() reserves map storage before adding mux and
configuration entries. If a later operation fails, the error path only
frees the temporary configurations and leaves the map allocation reachable
through the output pointer.
Free the partially built map on failure. The caller ignores the output
parameters when the mapping callback returns an error, so they do not need
to be reset after freeing the map.
Fixes: 41d32cfce1ae ("pinctrl: sprd: Add Spreadtrum pin control driver")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/sprd/pinctrl-sprd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index c4a1d99dfed04..1db542731a1c7 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -329,6 +329,9 @@ static int sprd_dt_node_to_map(struct pinctrl_dev *pctldev,
out:
kfree(configs);
+ if (ret < 0)
+ pinctrl_utils_free_map(pctldev, *map, *num_maps);
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0948/1756] wifi: mt76: mt7915: check default EEPROM firmware size before copying
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (946 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0947/1756] pinctrl: sprd: free maps on DT map failure Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0949/1756] wifi: mt76: mt7996: validate firmware event lengths before parsing Greg Kroah-Hartman
` (50 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit bce4aef211b3941af9ca297162406fc84f22ed5d ]
mt7915_eeprom_load_default() copied mt7915_eeprom_size() bytes from the
firmware blob after only checking that it was non-NULL. A truncated
default bin caused an out-of-bounds read past the firmware buffer into
the EEPROM image. Reject a blob smaller than the EEPROM size.
Fixes: beed8bea8d74 ("mt76: mt7915: add mt7916 calibrated data support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
index 14c0770229bc5..c636b082f0334 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
@@ -111,6 +111,12 @@ mt7915_eeprom_load_default(struct mt7915_dev *dev)
goto out;
}
+ if (fw->size < mt7915_eeprom_size(dev)) {
+ dev_err(dev->mt76.dev, "Invalid default bin size\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
memcpy(eeprom, fw->data, mt7915_eeprom_size(dev));
dev->flash_mode = true;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0949/1756] wifi: mt76: mt7996: validate firmware event lengths before parsing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (947 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0948/1756] wifi: mt76: mt7915: check default EEPROM firmware size before copying Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0950/1756] wifi: mt76: mt7915: unregister thermal cooling device on hwmon failure Greg Kroah-Hartman
` (49 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit c88f880c6430948492a4eee00d90e48fa800febf ]
Two unsolicited event handlers trusted firmware-provided lengths:
mt7996_mcu_rx_all_sta_info_event() looped over res->sta_num without
checking it against skb->len, reading the flex array out of bounds; and
mt7996_mcu_rx_log_message() could compute a negative or oversized length
from tlv->len and feed it to %.*s and the debugfs log path. Bound both
against the actual skb length.
Fixes: adde3eed4a75 ("wifi: mt76: mt7996: Add mcu commands for getting sta tx statistic")
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/mediatek/mt76/mt7996/mcu.c | 46 +++++++++++++++++--
1 file changed, 41 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 991efc9977be3..a8a0737635d27 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -380,21 +380,32 @@ mt7996_mcu_rx_log_message(struct mt7996_dev *dev, struct sk_buff *skb)
{
#define UNI_EVENT_FW_LOG_FORMAT 0
struct mt7996_mcu_rxd *rxd = (struct mt7996_mcu_rxd *)skb->data;
- const char *data = (char *)&rxd[1] + 4, *type;
- struct tlv *tlv = (struct tlv *)data;
+ const char *data, *type;
+ struct tlv *tlv;
int len;
+ if (skb->len < sizeof(*rxd))
+ return;
+
if (!(rxd->option & MCU_UNI_CMD_EVENT)) {
- len = skb->len - sizeof(*rxd);
data = (char *)&rxd[1];
+ len = skb->len - sizeof(*rxd);
goto out;
}
+ if (skb->len < sizeof(*rxd) + 4 + sizeof(*tlv))
+ return;
+
+ tlv = (struct tlv *)((char *)&rxd[1] + 4);
if (le16_to_cpu(tlv->tag) != UNI_EVENT_FW_LOG_FORMAT)
return;
- data += sizeof(*tlv) + 4;
+ if (le16_to_cpu(tlv->len) < sizeof(*tlv) + 4)
+ return;
+
+ data = (char *)tlv + sizeof(*tlv) + 4;
len = le16_to_cpu(tlv->len) - sizeof(*tlv) - 4;
+ len = min_t(int, len, skb->len - (int)(data - (char *)skb->data));
out:
switch (rxd->s2d_index) {
@@ -507,13 +518,38 @@ static void
mt7996_mcu_rx_all_sta_info_event(struct mt7996_dev *dev, struct sk_buff *skb)
{
struct mt7996_mcu_all_sta_info_event *res;
+ u32 elem_size;
+ u16 sta_num;
u16 i;
+ if (skb->len < sizeof(struct mt7996_mcu_rxd))
+ return;
+
skb_pull(skb, sizeof(struct mt7996_mcu_rxd));
res = (struct mt7996_mcu_all_sta_info_event *)skb->data;
+ if (skb->len < sizeof(*res))
+ return;
+
+ sta_num = le16_to_cpu(res->sta_num);
+ switch (le16_to_cpu(res->tag)) {
+ case UNI_ALL_STA_TXRX_RATE:
+ elem_size = sizeof(res->rate[0]);
+ break;
+ case UNI_ALL_STA_TXRX_ADM_STAT:
+ elem_size = sizeof(res->adm_stat[0]);
+ break;
+ case UNI_ALL_STA_TXRX_MSDU_COUNT:
+ elem_size = sizeof(res->msdu_cnt[0]);
+ break;
+ default:
+ return;
+ }
+
+ if (sta_num > (skb->len - sizeof(*res)) / elem_size)
+ sta_num = (skb->len - sizeof(*res)) / elem_size;
- for (i = 0; i < le16_to_cpu(res->sta_num); i++) {
+ for (i = 0; i < sta_num; i++) {
u8 ac;
u16 wlan_idx;
struct mt76_wcid *wcid;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0950/1756] wifi: mt76: mt7915: unregister thermal cooling device on hwmon failure
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (948 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0949/1756] wifi: mt76: mt7996: validate firmware event lengths before parsing Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0951/1756] wifi: mt76: mt7915: guard firmware memory dump write on disabled memdump Greg Kroah-Hartman
` (48 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit b8286bc7fe520e7117e7b6e1a1fd4c0df439aa3a ]
mt7915_thermal_init() registered the thermal cooling device and its sysfs
link, then returned the hwmon registration error without undoing them.
The cooling device (not devm-managed) and the link then leaked, and its
callbacks referenced the freed phy. Unregister the cooling device before
returning the error.
Fixes: 0ae3ff568451 ("mt76: mt7915: fix hwmon temp sensor mem use-after-free")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7915/init.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index cd18540dc98ae..b7a5dcfd27848 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -215,7 +215,12 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, phy,
mt7915_hwmon_groups);
- return PTR_ERR_OR_ZERO(hwmon);
+ if (IS_ERR(hwmon)) {
+ mt7915_unregister_thermal(phy);
+ return PTR_ERR(hwmon);
+ }
+
+ return 0;
}
static void mt7915_led_set_config(struct led_classdev *led_cdev,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0951/1756] wifi: mt76: mt7915: guard firmware memory dump write on disabled memdump
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (949 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0950/1756] wifi: mt76: mt7915: unregister thermal cooling device on hwmon failure Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0952/1756] wifi: mt76: mt7921: fix lock inversion between dev->mutex and iflist_mtx Greg Kroah-Hartman
` (47 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit decf5142c2d4c295684da8644d4cb93dcf956c5d ]
mt7915_coredump_build()/mt7996_coredump_build() wrote dump_mem->len
unconditionally, but the allocation only reserves room for the memory
dump header when coredump_memdump is enabled and memdump_buf_len is
non-zero. In the default configuration the allocation ends right after
the fixed header, so the write landed one struct past the buffer. Only
populate the memory-dump section when it was actually allocated.
Fixes: 4dbcb9125cc3 ("wifi: mt76: mt7915: enable coredump support")
Fixes: 878161d5d4a4 ("wifi: mt76: mt7996: enable coredump support")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7915/coredump.c | 7 ++++---
drivers/net/wireless/mediatek/mt76/mt7996/coredump.c | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/coredump.c b/drivers/net/wireless/mediatek/mt76/mt7915/coredump.c
index 5daf2258dfe6f..56d9b64ec6b06 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/coredump.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/coredump.c
@@ -345,11 +345,12 @@ static struct mt7915_coredump *mt7915_coredump_build(struct mt7915_dev *dev)
mt7915_coredump_fw_stack(dev, dump, exception);
/* gather memory content */
- dump_mem = (struct mt7915_coredump_mem *)(buf + sofar);
- dump_mem->len = crash_data->memdump_buf_len;
- if (coredump_memdump && crash_data->memdump_buf_len)
+ if (coredump_memdump && crash_data->memdump_buf_len) {
+ dump_mem = (struct mt7915_coredump_mem *)(buf + sofar);
+ dump_mem->len = crash_data->memdump_buf_len;
memcpy(dump_mem->data, crash_data->memdump_buf,
crash_data->memdump_buf_len);
+ }
mutex_unlock(&dev->dump_mutex);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/coredump.c b/drivers/net/wireless/mediatek/mt76/mt7996/coredump.c
index ccab0d7b9be47..d5ecac6b742a0 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/coredump.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/coredump.c
@@ -202,11 +202,12 @@ static struct mt7996_coredump *mt7996_coredump_build(struct mt7996_dev *dev)
mt7996_coredump_fw_stack(dev, dump, exception);
/* gather memory content */
- dump_mem = (struct mt7996_coredump_mem *)(buf + sofar);
- dump_mem->len = crash_data->memdump_buf_len;
- if (coredump_memdump && crash_data->memdump_buf_len)
+ if (coredump_memdump && crash_data->memdump_buf_len) {
+ dump_mem = (struct mt7996_coredump_mem *)(buf + sofar);
+ dump_mem->len = crash_data->memdump_buf_len;
memcpy(dump_mem->data, crash_data->memdump_buf,
crash_data->memdump_buf_len);
+ }
mutex_unlock(&dev->dump_mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0952/1756] wifi: mt76: mt7921: fix lock inversion between dev->mutex and iflist_mtx
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (950 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0951/1756] wifi: mt76: mt7915: guard firmware memory dump write on disabled memdump Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0953/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
` (46 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit 3dcb98c5cb51a70750ae8dc006d6d787ca09f425 ]
mt7921_config() holds dev->mutex across
ieee80211_iterate_active_interfaces(), which takes local->iflist_mtx.
mac80211 uses the opposite order: ieee80211_del_virtual_monitor() holds
iflist_mtx while calling drv_unassign_vif_chanctx(), and
mt792x_unassign_vif_chanctx() takes dev->mutex.
Deleting a monitor interface that has a channel assigned reaches the
second order and lockdep reports the cycle. The driver side of it:
-> #1 (&local->iflist_mtx){+.+.}-{4:4}:
__mutex_lock+0xda/0x1070
ieee80211_iterate_interfaces+0x34/0x70 [mac80211]
mt7921_config+0xb8/0xe0 [mt7921_common]
drv_config+0x63/0x1d0 [mac80211]
.config is only reached through drv_config(), which asserts the wiphy
mutex, so ieee80211_iterate_active_interfaces_mtx() can be used. It walks
the same list under the wiphy mutex and never takes iflist_mtx, which
drops the driver's dev->mutex -> iflist_mtx edge.
Fixes: cbaa0a404f8d ("mt76: mt7921: fix up the monitor mode")
Link: https://lore.kernel.org/linux-wireless/20260730053916.109426-1-lucid_duck@justthetip.ca/
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260810045338.118923-2-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 18eb934da570a..0160268d02740 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -645,9 +645,9 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
}
if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
- ieee80211_iterate_active_interfaces(hw,
- IEEE80211_IFACE_ITER_RESUME_ALL,
- mt7921_sniffer_interface_iter, dev);
+ ieee80211_iterate_active_interfaces_mtx(hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ mt7921_sniffer_interface_iter, dev);
}
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0953/1756] wifi: mt76: mt7925: fix lock inversion between dev->mutex and iflist_mtx
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (951 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0952/1756] wifi: mt76: mt7921: fix lock inversion between dev->mutex and iflist_mtx Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0954/1756] wifi: mt76: mt7921: check drv_pmctrl return in the PCIe reset path Greg Kroah-Hartman
` (45 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit 3208623121309a42f878364aff3c770f597d6a70 ]
mt7925_config() has the same inversion as mt7921_config(): it holds
dev->mutex across ieee80211_iterate_active_interfaces(), which takes
local->iflist_mtx, while mac80211 calls drv_unassign_vif_chanctx() with
iflist_mtx already held.
.config is only reached through drv_config(), which asserts the wiphy
mutex, so use ieee80211_iterate_active_interfaces_mtx() here too.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260810045338.118923-3-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index dba0f48922072..7cf75e1422637 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -792,9 +792,9 @@ static int mt7925_config(struct ieee80211_hw *hw, u32 changed)
}
if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
- ieee80211_iterate_active_interfaces(hw,
- IEEE80211_IFACE_ITER_RESUME_ALL,
- mt7925_sniffer_interface_iter, dev);
+ ieee80211_iterate_active_interfaces_mtx(hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ mt7925_sniffer_interface_iter, dev);
}
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0954/1756] wifi: mt76: mt7921: check drv_pmctrl return in the PCIe reset path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (952 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0953/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0955/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
` (44 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, moosager, Devin Wittmayer,
Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit 75673ab3c0e4186628e0a76b94443cddfbeca255 ]
mt7921e_mac_reset() ignores the return value of
mt792xe_mcu_drv_pmctrl(). When the driver-own handshake fails,
__mt792xe_mcu_drv_pmctrl() returns -EIO without reinitialising WPDMA or
clearing MT76_STATE_PM, and the reset carries on: it writes the
interrupt enable registers, cycles NAPI, resets WPDMA and downloads
firmware to a chip the driver does not own.
Return the error instead. The call is the first statement in the
function, before any teardown, so nothing needs unwinding.
Reported-by: moosager <moosager90@gmail.com>
Link: https://lore.kernel.org/linux-wireless/anG46qbvCqCHGF-f@fedora.fritz.box/
Fixes: dfc7743de1eb ("mt76: mt7921: refactor mcu.c to be bus independent")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Tested-by: moosager <moosager90@gmail.com>
Link: https://patch.msgid.link/20260809012309.43657-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
index 2452b1a2d1187..d38cc0d90d2d7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
@@ -57,7 +57,9 @@ int mt7921e_mac_reset(struct mt792x_dev *dev)
{
int i, err;
- mt792xe_mcu_drv_pmctrl(dev);
+ err = mt792xe_mcu_drv_pmctrl(dev);
+ if (err)
+ return err;
mt76_connac_free_pending_tx_skbs(&dev->pm, NULL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0955/1756] wifi: mt76: mt7925: check drv_pmctrl return in the PCIe reset path
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (953 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0954/1756] wifi: mt76: mt7921: check drv_pmctrl return in the PCIe reset path Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0956/1756] wifi: mt76: mt7925: restore the reset state when fw_pmctrl fails Greg Kroah-Hartman
` (43 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit d12a54be2604ecd23a1e9ac863583e34034aadde ]
mt7925e_mac_reset() ignores the return value of
mt792xe_mcu_drv_pmctrl(), unlike the two pmctrl calls later in the same
function. When the driver-own handshake fails,
__mt792xe_mcu_drv_pmctrl() returns -EIO without reinitialising WPDMA or
clearing MT76_STATE_PM, and the reset carries on: it writes the
interrupt enable registers, cycles NAPI, resets WPDMA and calls
mt7925_run_firmware() on a chip the driver does not own.
Return the error instead. The call is the first statement in the
function, before MT76_RESET is set and before the TX worker and NAPI
are disabled, so nothing needs unwinding.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260809205559.32116-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
index faedbf766d1a0..4587bf849a354 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
@@ -72,7 +72,9 @@ int mt7925e_mac_reset(struct mt792x_dev *dev)
const struct mt792x_irq_map *irq_map = dev->irq_map;
int i, err;
- mt792xe_mcu_drv_pmctrl(dev);
+ err = mt792xe_mcu_drv_pmctrl(dev);
+ if (err)
+ return err;
mt76_connac_free_pending_tx_skbs(&dev->pm, NULL);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0956/1756] wifi: mt76: mt7925: restore the reset state when fw_pmctrl fails
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (954 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0955/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0957/1756] wifi: mt76: mt7921: fix the lock inversion in suspend and resume Greg Kroah-Hartman
` (42 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit 8d2f5990cd429a2fe5fff05f7acf84d6799d4324 ]
mt7925e_mac_reset() returns directly when mt792xe_mcu_fw_pmctrl()
fails, leaving MT76_RESET set and the TX worker parked. Every other
error path jumps to out, which clears both. mt7925_mac_reset_work()
clears neither, so once every reset attempt fails there, TX stays
blocked until another reset succeeds.
Jump to out instead.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Link: https://patch.msgid.link/20260827162115.1449757-1-nbd@nbd.name
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
index 4587bf849a354..db0567177a2f5 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
@@ -122,7 +122,7 @@ int mt7925e_mac_reset(struct mt792x_dev *dev)
err = mt792xe_mcu_fw_pmctrl(dev);
if (err)
- return err;
+ goto out;
err = __mt792xe_mcu_drv_pmctrl(dev);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0957/1756] wifi: mt76: mt7921: fix the lock inversion in suspend and resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (955 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0956/1756] wifi: mt76: mt7925: restore the reset state when fw_pmctrl fails Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0958/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
` (41 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit 0e6472108d51a42272332f5b6a95871244b64301 ]
Same inversion as the config path, same one word fix, missed the
first time. Both are called with the wiphy mutex held, so the walk
can rely on that instead of taking the list mutex.
No new splat: same class pair as the accepted fix, and lockdep
reports a pair once per boot.
Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support")
Link: https://patch.msgid.link/20260810045338.118923-2-lucid_duck@justthetip.ca
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260830064201.92285-2-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 0160268d02740..71abaeaeda3ec 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -1136,10 +1136,10 @@ static int mt7921_suspend(struct ieee80211_hw *hw,
mt792x_mutex_acquire(dev);
clear_bit(MT76_STATE_RUNNING, &phy->mt76->state);
- ieee80211_iterate_active_interfaces(hw,
- IEEE80211_IFACE_ITER_RESUME_ALL,
- mt7921_mcu_set_suspend_iter,
- &dev->mphy);
+ ieee80211_iterate_active_interfaces_mtx(hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ mt7921_mcu_set_suspend_iter,
+ &dev->mphy);
mt792x_mutex_release(dev);
@@ -1154,10 +1154,10 @@ static int mt7921_resume(struct ieee80211_hw *hw)
mt792x_mutex_acquire(dev);
set_bit(MT76_STATE_RUNNING, &phy->mt76->state);
- ieee80211_iterate_active_interfaces(hw,
- IEEE80211_IFACE_ITER_RESUME_ALL,
- mt76_connac_mcu_set_suspend_iter,
- &dev->mphy);
+ ieee80211_iterate_active_interfaces_mtx(hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ mt76_connac_mcu_set_suspend_iter,
+ &dev->mphy);
ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
MT792x_WATCHDOG_TIME);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0958/1756] wifi: mt76: mt7925: fix the lock inversion in suspend and resume
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (956 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0957/1756] wifi: mt76: mt7921: fix the lock inversion in suspend and resume Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0959/1756] wifi: mt76: mt7925: honour mac80211s FIF_FCSFAIL instead of hardcoding drop_err Greg Kroah-Hartman
` (40 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit a105a9fe9a07a56d1e0b5a6978a49cde2ac7e7be ]
Same as the previous patch, other driver.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260830064201.92285-3-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 7cf75e1422637..7751b42f91635 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -1543,10 +1543,10 @@ static int mt7925_suspend(struct ieee80211_hw *hw,
mt792x_mutex_acquire(dev);
clear_bit(MT76_STATE_RUNNING, &phy->mt76->state);
- ieee80211_iterate_active_interfaces(hw,
- IEEE80211_IFACE_ITER_RESUME_ALL,
- mt7925_mcu_set_suspend_iter,
- &dev->mphy);
+ ieee80211_iterate_active_interfaces_mtx(hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ mt7925_mcu_set_suspend_iter,
+ &dev->mphy);
mt792x_mutex_release(dev);
@@ -1561,10 +1561,10 @@ static int mt7925_resume(struct ieee80211_hw *hw)
mt792x_mutex_acquire(dev);
set_bit(MT76_STATE_RUNNING, &phy->mt76->state);
- ieee80211_iterate_active_interfaces(hw,
- IEEE80211_IFACE_ITER_RESUME_ALL,
- mt7925_mcu_set_suspend_iter,
- &dev->mphy);
+ ieee80211_iterate_active_interfaces_mtx(hw,
+ IEEE80211_IFACE_ITER_RESUME_ALL,
+ mt7925_mcu_set_suspend_iter,
+ &dev->mphy);
ieee80211_queue_delayed_work(hw, &phy->mt76->mac_work,
MT792x_WATCHDOG_TIME);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0959/1756] wifi: mt76: mt7925: honour mac80211s FIF_FCSFAIL instead of hardcoding drop_err
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (957 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0958/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0960/1756] wifi: mt76: mt7921: honour " Greg Kroah-Hartman
` (39 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Mark Anthony Agarro,
Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Anthony Agarro <markanthonyagarro@gmail.com>
[ Upstream commit 31b53a9c4ada2ce49201ed0da0105819acfd86bf ]
mt7925_mcu_config_sniffer() hardcodes drop_err = 1, ignoring what
mac80211 actually requested via configure_filter(). FIF_FCSFAIL is
computed there but discarded instead of persisted.
Persist the FCSFAIL bit on the phy in mt7925_configure_filter() and
read it back in mt7925_mcu_config_sniffer() to derive drop_err, so the
firmware sniffer only passes through unfiltered/marginal frames when a
monitor listener actually requested them.
mt7925_mcu_config_sniffer() is only reached from mt7925_change_chanctx(),
which is itself only exercised on a monitor-mode chanctx, so this stays
scoped to monitor mode.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Tested-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Signed-off-by: Mark Anthony Agarro <markanthonyagarro@gmail.com>
Link: https://patch.msgid.link/20260826091757.469953-1-markanthonyagarro@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7925/main.c | 7 +++----
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h | 5 +++++
drivers/net/wireless/mediatek/mt76/mt792x.h | 1 +
4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 7751b42f91635..2ab8b8e527086 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -808,11 +808,8 @@ static void mt7925_configure_filter(struct ieee80211_hw *hw,
unsigned int *total_flags,
u64 multicast)
{
-#define MT7925_FILTER_FCSFAIL BIT(2)
-#define MT7925_FILTER_CONTROL BIT(5)
-#define MT7925_FILTER_OTHER_BSS BIT(6)
-#define MT7925_FILTER_ENABLE BIT(31)
struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ struct mt792x_phy *phy = mt792x_hw_phy(hw);
u32 flags = MT7925_FILTER_ENABLE;
#define MT7925_FILTER(_fif, _type) do { \
@@ -824,6 +821,8 @@ static void mt7925_configure_filter(struct ieee80211_hw *hw,
MT7925_FILTER(FIF_CONTROL, CONTROL);
MT7925_FILTER(FIF_OTHER_BSS, OTHER_BSS);
+ phy->rxfilter = flags;
+
mt792x_mutex_acquire(dev);
mt7925_mcu_set_rxfilter(dev, flags, 0, 0);
mt792x_mutex_release(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index d6437a0fff6a2..639e6a9c0b57d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -2180,7 +2180,7 @@ int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,
.len = cpu_to_le16(sizeof(req.tlv)),
.control_ch = chandef->chan->hw_value,
.center_ch = ieee80211_frequency_to_channel(freq1),
- .drop_err = 1,
+ .drop_err = !(vif->phy->rxfilter & MT7925_FILTER_FCSFAIL),
},
};
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
index bc8d38782a81a..f5f6ced969d4c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h
@@ -7,6 +7,11 @@
#include "../mt792x.h"
#include "regs.h"
+#define MT7925_FILTER_FCSFAIL BIT(2)
+#define MT7925_FILTER_CONTROL BIT(5)
+#define MT7925_FILTER_OTHER_BSS BIT(6)
+#define MT7925_FILTER_ENABLE BIT(31)
+
#define MT7925_BEACON_RATES_TBL 25
#define MT7925_TX_RING_SIZE 2048
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index cf1b6083cf2f0..52d2338c16c43 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -148,6 +148,7 @@ struct mt792x_phy {
s16 coverage_class;
u8 slottime;
+ u32 rxfilter;
u32 rx_ampdu_ts;
u32 ampdu_ref;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0960/1756] wifi: mt76: mt7921: honour FIF_FCSFAIL instead of hardcoding drop_err
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (958 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0959/1756] wifi: mt76: mt7925: honour mac80211s FIF_FCSFAIL instead of hardcoding drop_err Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0961/1756] wifi: mt76: mt7915: publish wcid before MCU add commands Greg Kroah-Hartman
` (38 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Devin Wittmayer, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Devin Wittmayer <lucid_duck@justthetip.ca>
[ Upstream commit f8794eb3ff6dedbba0337c5197626b62da0ef057 ]
When a monitor interface asks to see frames that failed their checksum,
mac80211 passes the request down to the driver. mt7921 works out the
answer, sends it to the firmware as a receive filter, and then configures
the sniffer with a hardcoded byte telling it to drop those frames anyway.
The answer is used once and never kept, so the sniffer never gets to see
it.
That matters to anyone using monitor mode to judge a link honestly, which
is most of the reason to be in monitor mode at all.
Mark Anthony Agarro posted the same change for mt7925: keep what mac80211
asked for on the phy, and read it back when the sniffer is configured.
This does that for mt7921, and applies on top of it, since that patch is
what adds the field.
https://lore.kernel.org/linux-wireless/20260826091757.469953-1-markanthonyagarro@gmail.com/
The stored value is read in one place only, configuring the sniffer, which
has a single caller, and that call sits inside a branch reached only by a
monitor interface. Nothing else changes.
Measured on an MT7922 with a read-only probe on the command as the driver
sends it, so these are the driver's own bytes rather than an inference
from what came back:
request arm drop_err
none stock 1 1 1 1
none patched 1 1 1 1
fcsfail stock 1 1
fcsfail patched 0 0
Stock sends the drop byte whether or not anyone asked for it. Patched
sends it only when nobody did. Withdrawing the request and making it again
inside one driver load moves the byte back and forth, 0 then 1 then 0
across three changes, so nothing sticks once set.
If it does appear to stick when trying this against an MT7927, that is
mac80211 rather than the driver. It raises the filter count
unconditionally when a monitor comes up, but skips lowering it again for
drivers that set NO_VIRTUAL_MONITOR, and that is the only chip in this
family which does.
Fixes: 914189af23b8 ("wifi: mt76: mt7921: fix channel switch fail in monitor mode")
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260826231029.39632-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7921/main.c | 8 +++-----
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 5 +++++
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 71abaeaeda3ec..5fda1d848d549 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -661,12 +661,8 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw,
unsigned int *total_flags,
u64 multicast)
{
-#define MT7921_FILTER_FCSFAIL BIT(2)
-#define MT7921_FILTER_CONTROL BIT(5)
-#define MT7921_FILTER_OTHER_BSS BIT(6)
-#define MT7921_FILTER_ENABLE BIT(31)
-
struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ struct mt792x_phy *phy = mt792x_hw_phy(hw);
u32 flags = MT7921_FILTER_ENABLE;
#define MT7921_FILTER(_fif, _type) do { \
@@ -678,6 +674,8 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw,
MT7921_FILTER(FIF_CONTROL, CONTROL);
MT7921_FILTER(FIF_OTHER_BSS, OTHER_BSS);
+ phy->rxfilter = flags;
+
mt792x_mutex_acquire(dev);
mt7921_mcu_set_rxfilter(dev, flags, 0, 0);
mt792x_mutex_release(dev);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index bc7a99b58ba48..e533f1a3e0cba 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -1224,7 +1224,7 @@ int mt7921_mcu_config_sniffer(struct mt792x_vif *vif,
.len = cpu_to_le16(sizeof(req.tlv)),
.control_ch = chandef->chan->hw_value,
.center_ch = ieee80211_frequency_to_channel(freq1),
- .drop_err = 1,
+ .drop_err = !(vif->phy->rxfilter & MT7921_FILTER_FCSFAIL),
},
};
if (chandef->chan->band < ARRAY_SIZE(ch_band))
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
index 7a7e09fcf4b5e..1e19b59dc62fd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
@@ -7,6 +7,11 @@
#include "../mt792x.h"
#include "regs.h"
+#define MT7921_FILTER_FCSFAIL BIT(2)
+#define MT7921_FILTER_CONTROL BIT(5)
+#define MT7921_FILTER_OTHER_BSS BIT(6)
+#define MT7921_FILTER_ENABLE BIT(31)
+
#define MT7921_MAX_AID 20
#define MT7921_TX_RING_SIZE 2048
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0961/1756] wifi: mt76: mt7915: publish wcid before MCU add commands
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (959 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0960/1756] wifi: mt76: mt7921: honour " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0962/1756] wifi: mt76: fix unlocked wcid check in mt76_tx_status_skb_add() Greg Kroah-Hartman
` (37 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ryan Leung, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Leung <untilscour@protonmail.com>
[ Upstream commit a2d1c02c59f84e982179751bced5fb2fd5bb4212 ]
mt7915_add_interface() enables the BSS/STA in firmware via
mt7915_mcu_add_bss_info() and mt7915_mcu_add_sta() before publishing
dev->mt76.wcid[idx] with rcu_assign_pointer(). Firmware can start
generating tx-status/tx-free events referencing that wcid as soon as it
processes those MCU commands, but mt76's rx/tx-free handlers (e.g.
mt7915_mac_tx_free()) look up dev->mt76.wcid[idx] to service them, and
won't find it published yet. This can lead to memory corruption and
kernel crashes shortly after an AP interface is brought up.
This ordering was introduced by commit 8e3e7567b8c1 ("mt76: mt7915: add
sta_rec with EXTRA_INFO_NEW for the first time only"):
mt7915_mcu_add_sta() derived its "newly added" flag from
!rcu_access_pointer(dev->mt76.wcid[idx]), so the publish had to happen
after that call. Commit 33eb14f10290 ("wifi: mt76: mt7915: use mac80211
.sta_state op") later replaced that flag with a caller-supplied `newly`
argument to mt7915_mcu_add_sta(), now simply hardcoded to true, so the
ordering is no longer required.
Move the rcu_assign_pointer() before the MCU add_bss_info/add_sta
calls, so that the wcid is visible to lookups before firmware is told
it's live. This makes the ordering symmetric with
mt7915_remove_interface(), which keeps the pointer published until
after the MCU disable commands have been issued.
Closes: https://github.com/openwrt/openwrt/issues/24594
Fixes: 8e3e7567b8c1 ("mt76: mt7915: add sta_rec with EXTRA_INFO_NEW for the first time only")
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://patch.msgid.link/20260821-mt7915-wcid-publish-order-v2-1-acf0b7f32cbd@protonmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index 0e3ca0eb9f082..67b9f48100a20 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -275,9 +275,9 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
mt7915_init_bitrate_mask(vif);
memset(&mvif->cap, -1, sizeof(mvif->cap));
+ rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
mt7915_mcu_add_bss_info(phy, vif, true);
mt7915_mcu_add_sta(dev, vif, NULL, CONN_STATE_PORT_SECURE, true);
- rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
mutex_unlock(&dev->mt76.mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0962/1756] wifi: mt76: fix unlocked wcid check in mt76_tx_status_skb_add()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (960 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0961/1756] wifi: mt76: mt7915: publish wcid before MCU add commands Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0963/1756] wifi: mt76: fix wcid teardown ordering in mt76_reset_device() Greg Kroah-Hartman
` (36 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ryan Leung, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Leung <untilscour@protonmail.com>
[ Upstream commit cfb05250ded4d6de09dfd273c2a72092f48b55a3 ]
mt76_tx_status_skb_add() checks rcu_access_pointer(dev->wcid[wcid->idx])
before taking dev->status_lock, then allocates a pktid afterwards. A
concurrent mt76_wcid_cleanup() can run between the check and the lock,
letting a stale wcid be re-added to dev->wcid_list after teardown.
Worse, the check only tests for a non-NULL slot, so it also passes if a
different wcid has since been published at the same idx.
Move the check under status_lock, alongside idr_alloc(), and compare
identity (rcu_access_pointer(dev->wcid[wcid->idx]) != wcid) instead of
just testing for non-NULL, so that a reused index is correctly rejected.
Fixes: fcfe1b5e162b ("mt76: fix tx status related use-after-free race on station removal")
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://patch.msgid.link/20260821-mt76-stale-wcid-race-v2-1-8f41ee96fb73@protonmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/tx.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index ed1615192d644..edb1de6582fac 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -129,7 +129,7 @@ mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,
memset(cb, 0, sizeof(*cb));
- if (!wcid || !rcu_access_pointer(dev->wcid[wcid->idx]))
+ if (!wcid)
return MT_PACKET_ID_NO_ACK;
if (info->flags & IEEE80211_TX_CTL_NO_ACK)
@@ -147,6 +147,11 @@ mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,
spin_lock_bh(&dev->status_lock);
+ if (rcu_access_pointer(dev->wcid[wcid->idx]) != wcid) {
+ pid = MT_PACKET_ID_NO_ACK;
+ goto out;
+ }
+
pid = idr_alloc(&wcid->pktid, skb, MT_PACKET_ID_FIRST,
MT_PACKET_ID_MASK, GFP_ATOMIC);
if (pid < 0) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0963/1756] wifi: mt76: fix wcid teardown ordering in mt76_reset_device()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (961 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0962/1756] wifi: mt76: fix unlocked wcid check in mt76_tx_status_skb_add() Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0964/1756] wifi: mt76: mt76x02: validate RX padding before use Greg Kroah-Hartman
` (35 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ryan Leung, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Leung <untilscour@protonmail.com>
[ Upstream commit 5cebbd7a87df834efe002c8e54211e6adc99703a ]
mt76_reset_device() tears down each wcid's pktid idr before clearing
dev->wcid[i], which is the reverse of the ordering used on the
sta removal path. Until the pointer is cleared, a concurrent lookup
under status_lock can still find the wcid and access its
already destroyed idr.
Clear dev->wcid[i] before calling mt76_wcid_cleanup(), reproducing
the ordering mac80211 already enforces for normal sta removal (where
mt76_sta_pre_rcu_remove() clears dev->wcid[idx] before
mt76_wcid_cleanup() runs via the .sta_state callback).
Fixes: 065c79df595a ("wifi: mt76: mt7915: fix list corruption after hardware restart")
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://patch.msgid.link/20260821-mt76-wcid-null-before-cleanup-v1-1-0e364d9062d6@protonmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 13e6594945180..289c1a2815560 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -812,8 +812,8 @@ void mt76_reset_device(struct mt76_dev *dev)
continue;
wcid->sta = 0;
- mt76_wcid_cleanup(dev, wcid);
rcu_assign_pointer(dev->wcid[i], NULL);
+ mt76_wcid_cleanup(dev, wcid);
}
rcu_read_unlock();
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0964/1756] wifi: mt76: mt76x02: validate RX padding before use
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (962 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0963/1756] wifi: mt76: fix wcid teardown ordering in mt76_reset_device() Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0965/1756] wifi: mt76: mt7921: keep the join ROC until the station is authorized Greg Kroah-Hartman
` (34 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit baf375ca58eaa24503f9febac75c056852694c3a ]
The RX descriptor provides L2 and PN padding lengths that are used to
locate the CCMP IV and determine how many bytes to remove from the packet.
These lengths are not checked against the received skb length before the
IV is read or mt76x02_remove_hdr_pad() is called.
Reject frames whose IV does not fit within the skb or whose header padding
would extend past the end of the skb.
Fixes: 30ce7f4456ae ("mt76: validate rx CCMP PN")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925152754.2323624-1-yaojiale02@163.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index d5ee2bb6f679b..441d461e76787 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -818,9 +818,13 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
len = FIELD_GET(MT_RXWI_CTL_MPDU_LEN, ctl);
pn_len = FIELD_GET(MT_RXINFO_PN_LEN, rxinfo);
if (pn_len) {
- int offset = ieee80211_get_hdrlen_from_skb(skb) + pad_len;
- u8 *data = skb->data + offset;
+ unsigned int offset = ieee80211_get_hdrlen_from_skb(skb) + pad_len;
+ u8 *data;
+ if (offset + 8 > skb->len)
+ return -EINVAL;
+
+ data = skb->data + offset;
status->iv[0] = data[7];
status->iv[1] = data[6];
status->iv[2] = data[5];
@@ -840,6 +844,9 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
}
}
+ if (pad_len + ieee80211_get_hdrlen_from_skb(skb) > skb->len)
+ return -EINVAL;
+
mt76x02_remove_hdr_pad(skb, pad_len);
if ((rxinfo & MT_RXINFO_BA) && !(rxinfo & MT_RXINFO_NULL))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0965/1756] wifi: mt76: mt7921: keep the join ROC until the station is authorized
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (963 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0964/1756] wifi: mt76: mt76x02: validate RX padding before use Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0966/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
` (33 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Anthony Agarro, Devin Wittmayer,
Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Anthony Agarro <markanthonyagarro@gmail.com>
[ Upstream commit 6f591a4bb5d9a6a4a28f3f2fd77f394ddbcc4e05 ]
When an association succeeds mac80211 calls mgd_complete_tx(), and
mt7921 aborts the join ROC there. The AP starts the 4-way handshake
right away, so the abort lands where message 3 arrives. On an MT7922
this loses message 3 often enough to matter: the supplicant sends
message 2 (acked), never receives message 3, and the connection ends
with reason 15 (4WAY_HANDSHAKE_TIMEOUT) after about 3.3 s. The mt7925
capture in the linked issue shows the same ordering: abort, message 2
out, then message 3 retried by the AP several times without an answer.
Keep the ROC after a successful (re)association on a station interface
and release it when the station is authorized, on disassociation, or
when the station is removed. The ROC timer still ends it if none of
that happens. The state lives in a flag in struct mt792x_vif so that an
unrelated ROC, for example a user remain-on-channel, is never aborted
by the authorize hook.
Tested on an MT7922 (PCIe), kernel 7.3.0-rc4, WPA3-SAE AP, two rounds
of 20 disconnect/reconnect cycles per build in the same boot, unpatched
and patched in ABAB order:
unpatched 34 of 73 association attempts: M1 rx, M2 tx acked,
no M3, reason 15
patched 0 of 40
Delaying the abort by 20 ms before it made no difference (8 of 29),
and delaying 20 ms after it removed the failures (0 of 20), so what
matters is where the abort lands relative to the handshake. The
firmware behaviour after the abort is inferred from these outcomes, not
observed directly.
Not tested: MT7921 and other connac2 parts, USB and SDIO, APs other
than the one above, open or WPA2 networks, scheduled scan, suspend and
resume.
Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support")
Link: https://github.com/morrownr/mt76/issues/106
Signed-off-by: Mark Anthony Agarro <markanthonyagarro@gmail.com>
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20261005203846.239445-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/mediatek/mt76/mt7921/main.c | 17 +++++++++++++++++
drivers/net/wireless/mediatek/mt76/mt792x.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 5fda1d848d549..b631df3f6ad52 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -853,6 +853,12 @@ int mt7921_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
if (sta->aid > MT7921_MAX_AID)
return -ENOENT;
+ if (mvif->roc_join_held && !sta->tdls &&
+ (ev == MT76_STA_EVENT_AUTHORIZE || ev == MT76_STA_EVENT_DISASSOC)) {
+ mvif->roc_join_held = false;
+ mt7921_abort_roc(mvif->phy, mvif);
+ }
+
if (ev != MT76_STA_EVENT_ASSOC)
return 0;
@@ -894,6 +900,7 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
mvif->wep_sta = NULL;
+ mvif->roc_join_held = false;
ewma_rssi_init(&mvif->bss_conf.rssi);
if (!sta->tdls)
mt76_connac_mcu_uni_add_bss(&dev->mphy, vif,
@@ -1417,6 +1424,16 @@ static void mt7921_mgd_complete_tx(struct ieee80211_hw *hw,
{
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+ /* Keep the join ROC until the station is authorized, so that it
+ * covers the 4-way handshake. mt7921_mac_sta_event() releases it.
+ */
+ if (vif->type == NL80211_IFTYPE_STATION && info->success &&
+ (info->subtype == IEEE80211_STYPE_ASSOC_REQ ||
+ info->subtype == IEEE80211_STYPE_REASSOC_REQ)) {
+ mvif->roc_join_held = true;
+ return;
+ }
+
mt7921_abort_roc(mvif->phy, mvif);
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
index 52d2338c16c43..a476ec0f59aac 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x.h
+++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
@@ -131,6 +131,7 @@ struct mt792x_vif {
struct mt792x_sta *wep_sta;
struct mt792x_phy *phy;
+ bool roc_join_held; /* join ROC kept until the STA is authorized */
u16 valid_links;
u8 deflink_id;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0966/1756] wifi: mt76: mt7925: keep the join ROC until the station is authorized
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (964 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0965/1756] wifi: mt76: mt7921: keep the join ROC until the station is authorized Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0967/1756] wifi: mt76: usb: fix source overread in mt76u_copy Greg Kroah-Hartman
` (32 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Junker, Mark Anthony Agarro,
Devin Wittmayer, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Anthony Agarro <markanthonyagarro@gmail.com>
[ Upstream commit ac22c8c723c62013dd45b74e32249fc877c86fe0 ]
When a non-MLO station associates, mgd_complete_tx() aborts the join ROC
as soon as the association succeeds, which is right before the supplicant
sends message 2 of the 4-way handshake. With the abort that close to
message 2, the adapter acknowledges nothing the AP sends for the next
several ms: the AP sends message 3 and its seven retries within about
5 ms, none is acknowledged, and the handshake ends with reason 15
(4WAY_HANDSHAKE_TIMEOUT).
Keep the ROC after a successful (re)association on a non-MLD station
interface and release it when the station is authorized, on
disassociation, or when the station is removed. The ROC timer still ends
it if none of that happens. MLD interfaces keep the old behaviour: there
the ROC that is active at this point is the MLO ROC set up by
mt7925_mac_set_links(), and holding it makes mt7925_set_mlo_roc() fail
with -EBUSY in the link activation work, which leaves one link instead of
two.
Tested by a reporter on an MT7925U (USB) against a FRITZ!Box 5690 Pro on
a 6 GHz-only, non-MLO SSID, kernel 7.2.3, from traces and monitor
captures taken in separate runs:
handshakes first M3 acked abort before M2
unpatched 8 of 84 0 of 83 84 of 84
this patch 30 of 30 31 of 31 0 of 30
With the patch the AP sends message 3 once and the adapter acknowledges
it straight away; the ROC is released right after the station is
authorized. A 20 ms delay after the abort instead of this change gave
15 of 15, which points at the abort timing and not at the delay.
Tested here on an MT7925 and an MT7927 (PCIe), kernel 7.3.0-rc4: on a
non-MLO SSID neither build showed the failure (1 stalled handshake in 110
unpatched, none patched), so no effect could be measured there. On an MLO
connection the change is inert: 16 of 16 link activations succeeded in
two rounds per build, with two active links and the same ROC order as
before.
Not tested: other APs, other USB parts, MT7927 over USB, MLO connections
beyond the check above.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Reported-by: Mark Junker <fubar-coder@live.de>
Closes: https://github.com/morrownr/mt76/issues/106
Tested-by: Mark Junker <fubar-coder@live.de>
Signed-off-by: Mark Anthony Agarro <markanthonyagarro@gmail.com>
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20261006031425.20922-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/mediatek/mt76/mt7925/main.c | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index 2ab8b8e527086..49bdd15d9427f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -1134,6 +1134,13 @@ int mt7925_mac_sta_event(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, enum mt76_sta_event ev)
{
struct ieee80211_link_sta *link_sta = &sta->deflink;
+ struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+
+ if (mvif->roc_join_held && !sta->tdls &&
+ (ev == MT76_STA_EVENT_AUTHORIZE || ev == MT76_STA_EVENT_DISASSOC)) {
+ mvif->roc_join_held = false;
+ mt7925_abort_roc(mvif->phy, &mvif->bss_conf);
+ }
if (ev != MT76_STA_EVENT_ASSOC)
return 0;
@@ -1287,6 +1294,7 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
mvif->wep_sta = NULL;
+ mvif->roc_join_held = false;
ewma_rssi_init(&mvif->bss_conf.rssi);
}
}
@@ -1899,6 +1907,19 @@ static void mt7925_mgd_complete_tx(struct ieee80211_hw *hw,
{
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+ /* Keep the join ROC until the station is authorized, so that it
+ * covers the 4-way handshake. mt7925_mac_sta_event() releases it.
+ * On MLD, the active ROC is the MLO ROC, which must be released
+ * before the link activation work sets its own.
+ */
+ if (vif->type == NL80211_IFTYPE_STATION && !ieee80211_vif_is_mld(vif) &&
+ info->success &&
+ (info->subtype == IEEE80211_STYPE_ASSOC_REQ ||
+ info->subtype == IEEE80211_STYPE_REASSOC_REQ)) {
+ mvif->roc_join_held = true;
+ return;
+ }
+
mt7925_abort_roc(mvif->phy, &mvif->bss_conf);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0967/1756] wifi: mt76: usb: fix source overread in mt76u_copy
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (965 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0966/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0968/1756] wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy Greg Kroah-Hartman
` (31 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit d435130cdd064b901d8ce5ada0322298e6a86a49 ]
mt76u_copy() rounds up len to a multiple of four and uses the rounded
length as the bound for memcpy() from the source buffer. When the
caller's length is not four-byte aligned, the final copy reads up to
three bytes past the source buffer.
Keep the original length for the source copy and zero the remaining
bytes in the transmit buffer so that the hardware access width remains
four-byte aligned.
Fixes: 9446248669968 ("mt76: speed up usb bulk copy")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925150556.2304003-2-yaojiale02@163.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/usb.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
index b39dbf22dfc1d..317b3ee648ea8 100644
--- a/drivers/net/wireless/mediatek/mt76/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/usb.c
@@ -160,8 +160,10 @@ static void mt76u_copy(struct mt76_dev *dev, u32 offset,
{
struct mt76_usb *usb = &dev->usb;
const u8 *val = data;
- int ret;
int current_batch_size;
+ int len_aligned;
+ int copy_len;
+ int ret;
int i = 0;
/* Assure that always a multiple of 4 bytes are copied,
@@ -169,12 +171,16 @@ static void mt76u_copy(struct mt76_dev *dev, u32 offset,
* See: "mt76: round up length on mt76_wr_copy"
* Commit 850e8f6fbd5d0003b0
*/
- len = round_up(len, 4);
+ len_aligned = round_up(len, 4);
mutex_lock(&usb->usb_ctrl_mtx);
- while (i < len) {
- current_batch_size = min_t(int, usb->data_len, len - i);
- memcpy(usb->data, val + i, current_batch_size);
+ while (i < len_aligned) {
+ current_batch_size = min_t(int, usb->data_len, len_aligned - i);
+ copy_len = min_t(int, current_batch_size, len - i);
+ memcpy(usb->data, val + i, copy_len);
+ if (copy_len < current_batch_size)
+ memset(usb->data + copy_len, 0,
+ current_batch_size - copy_len);
ret = __mt76u_vendor_request(dev, MT_VEND_MULTI_WRITE,
USB_DIR_OUT | USB_TYPE_VENDOR,
0, offset + i, usb->data,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0968/1756] wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (966 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0967/1756] wifi: mt76: usb: fix source overread in mt76u_copy Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0969/1756] wifi: mt76: mt7603: dont drop short frames looped back on PS entry Greg Kroah-Hartman
` (30 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jiale Yao, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <yaojiale02@163.com>
[ Upstream commit 0c2fcb5225361f71905697ef9db287b24bcc67cf ]
mt7663u_copy() rounds up len to a multiple of four and uses the rounded
length as the bound for memcpy() from the source buffer. When the
caller's length is not four-byte aligned, the final copy reads up to
three bytes past the source buffer.
Keep the original length for the source copy and zero the remaining
bytes in the transmit buffer so that the hardware access width remains
four-byte aligned.
Fixes: 6cb596ba84e3 ("mt76: usb: introduce __mt76u_init utility routine")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://patch.msgid.link/20260925150556.2304003-3-yaojiale02@163.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/usb.c b/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
index 4aa9fa1c4a23b..6452acfcd57e3 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/usb.c
@@ -58,15 +58,22 @@ static void mt7663u_copy(struct mt76_dev *dev, u32 offset,
const void *data, int len)
{
struct mt76_usb *usb = &dev->usb;
- int ret, i = 0, batch_len;
const u8 *val = data;
+ int len_aligned;
+ int batch_len;
+ int copy_len;
+ int ret;
+ int i = 0;
- len = round_up(len, 4);
+ len_aligned = round_up(len, 4);
mutex_lock(&usb->usb_ctrl_mtx);
- while (i < len) {
- batch_len = min_t(int, usb->data_len, len - i);
- memcpy(usb->data, val + i, batch_len);
+ while (i < len_aligned) {
+ batch_len = min_t(int, usb->data_len, len_aligned - i);
+ copy_len = min_t(int, batch_len, len - i);
+ memcpy(usb->data, val + i, copy_len);
+ if (copy_len < batch_len)
+ memset(usb->data + copy_len, 0, batch_len - copy_len);
ret = __mt76u_vendor_request(dev, MT_VEND_WRITE_EXT,
USB_DIR_OUT | USB_TYPE_VENDOR,
(offset + i) >> 16, offset + i,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0969/1756] wifi: mt76: mt7603: dont drop short frames looped back on PS entry
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (967 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0968/1756] wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0970/1756] wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup() Greg Kroah-Hartman
` (29 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cristian Papa, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Papa <pcristian292@gmail.com>
[ Upstream commit 9956c4cac9d3f479817d6fe6a057aef3e86defcf ]
When a station enters power save, mt7603 has the PSE redirect the frames
still queued for it back to the host, and mt7603_rx_loopback_skb() parks
them until the station wakes up.
The handler rejects every frame shorter than a four-address header
(sizeof(struct ieee80211_hdr), 30 bytes) before looking at it. A
BlockAck request is 20 bytes and a QoS-Null 26, so both are freed
without a trace. Since commit b473c0e47f04 ("wifi: mt76: mt7603: fix tx
queue of loopback packets"), a BAR would also be freed later as a frame
that is not a bufferable MMPDU, although mac80211 buffers BARs for a
sleeping station like any other unicast frame.
mac80211 queues the BAR with IEEE80211_TX_CTL_REQ_TX_STATUS, so it only
learns about the loss when the tx status times out, and the recipient
keeps waiting on its reorder window until then.
Check the length against the header length of the actual frame, and
park a BlockAck request on the queue of its TID, behind the data frames
it refers to.
Found on a TP-Link Archer XR500v (MT7603E) with a client whose Bluetooth
coexistence toggles PM every ~15 ms under load. To test the change on
its own, a temporary debugfs switch flipped between the old and the new
checks every 30 seconds during a bidirectional TCP test, with counters
on the loop-back path and on the tx status of BARs. With the old check,
all 92 BARs that came back were freed, and 91 of the 544 BARs queued in
those phases never got a tx status from the hardware. With this change,
all 129 BARs that came back were parked and sent again, and 11 of 411
got no tx status. Throughput was the same with both checks.
Fixes: e004b7006600 ("mt76: mt7603: notify mac80211 about buffered frames in ps queue")
Assisted-by: LLM
Signed-off-by: Cristian Papa <pcristian292@gmail.com>
Link: https://patch.msgid.link/20260922220814.15070-1-pcristian292@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/mediatek/mt76/mt7603/dma.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
index 1e34cb6beab69..f36f49b743d03 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/dma.c
@@ -34,7 +34,7 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
int idx;
u32 val;
- if (skb->len < MT_TXD_SIZE + sizeof(struct ieee80211_hdr))
+ if (skb->len < MT_TXD_SIZE + 2)
goto free;
val = le32_to_cpu(txd[1]);
@@ -52,6 +52,9 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
sta = container_of(priv, struct ieee80211_sta, drv_priv);
hdr = (struct ieee80211_hdr *)&skb->data[MT_TXD_SIZE];
+ if (skb->len < MT_TXD_SIZE + ieee80211_hdrlen(hdr->frame_control))
+ goto free;
+
hwq = wmm_queue_map[IEEE80211_AC_BE];
if (ieee80211_is_data_qos(hdr->frame_control)) {
tid = *ieee80211_get_qos_ctl(hdr) &
@@ -62,6 +65,19 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
} else if (ieee80211_is_data(hdr->frame_control)) {
skb_set_queue_mapping(skb, IEEE80211_AC_BE);
hwq = wmm_queue_map[IEEE80211_AC_BE];
+ } else if (ieee80211_is_back_req(hdr->frame_control)) {
+ struct ieee80211_bar *bar = (struct ieee80211_bar *)hdr;
+
+ if (skb->len < MT_TXD_SIZE + sizeof(*bar))
+ goto free;
+
+ tid = (le16_to_cpu(bar->control) &
+ IEEE80211_BAR_CTRL_TID_INFO_MASK) >>
+ IEEE80211_BAR_CTRL_TID_INFO_SHIFT;
+ tid &= IEEE80211_QOS_CTL_TAG1D_MASK;
+ qid = tid_to_ac[tid];
+ hwq = wmm_queue_map[qid];
+ skb_set_queue_mapping(skb, qid);
} else {
skb_pull(skb, MT_TXD_SIZE);
if (!ieee80211_is_bufferable_mmpdu(skb))
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0970/1756] wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (968 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0969/1756] wifi: mt76: mt7603: dont drop short frames looped back on PS entry Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0971/1756] wifi: mt76: mt7615: read MT7663 temperature from the correct offset Greg Kroah-Hartman
` (28 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ryan Leung, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Leung <untilscour@protonmail.com>
[ Upstream commit 158c1145fe7ddd82914011a00de7cc3262616b16 ]
mt76_wcid_cleanup() releases dev->status_lock before calling
idr_destroy(&wcid->pktid) to tear down the pktid idr. Meanwhile,
mt76_tx_status_skb_add() from tx.c can concurrently insert into
that same idr during tx completion handling:
spin_lock_bh(&dev->status_lock);
pid = idr_alloc(&wcid->pktid, skb, MT_PACKET_ID_FIRST,
MT_PACKET_ID_MASK, GFP_ATOMIC);
Since idr_destroy() runs outside the lock, it can execute concurrently
with idr_alloc() on the same idr, corrupting its internal data
structures. Because idr nodes are freed through the generic slab
allocator, this corruption can resurface later as an unrelated-looking
crash anywhere in the kernel that happens to reuse the same freed
memory.
Fix this by calling idr_destroy() before releasing dev->status_lock,
so that the table teardown and any concurrent insertion are mutually
exclusive.
Closes: https://github.com/openwrt/openwrt/issues/24594
Fixes: bd1e3e7b693c ("mt76: introduce packet_id idr")
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://patch.msgid.link/20260820-mt76-pktid-idr-race-v1-1-451f176a6495@protonmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 289c1a2815560..77708de932f30 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -1641,9 +1641,8 @@ void mt76_wcid_cleanup(struct mt76_dev *dev, struct mt76_wcid *wcid)
mt76_tx_status_lock(dev, &list);
mt76_tx_status_skb_get(dev, wcid, -1, &list);
- mt76_tx_status_unlock(dev, &list);
-
idr_destroy(&wcid->pktid);
+ mt76_tx_status_unlock(dev, &list);
spin_lock_bh(&phy->tx_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0971/1756] wifi: mt76: mt7615: read MT7663 temperature from the correct offset
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (969 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0970/1756] wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup() Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0972/1756] wifi: mt76: mt7615: validate MCU response lengths Greg Kroah-Hartman
` (27 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ahmed Naseef, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmed Naseef <naseefkm@gmail.com>
[ Upstream commit 40217d8e6cba433a6ccb8c73737dd38b54dcc26f ]
On MT7663 the hwmon temp1_input attribute always reads 0.
mt7615_mcu_parse_response() takes the temperature from the first dword of
the THERMAL_CTRL response payload, but MT7663 firmware reports it in the
second one. On a DASAN H660GM-A (MT7663E, N9 firmware 7663mp1827) the
request and its response are:
request: 00 00 00 00
response: 00 00 00 00 2a 00 00 00
0x2a is the reading, 42 degrees, while the driver returns the leading
zero. mt7915 and mt7921 already pull sizeof(*rxd) + 4 for this command.
Restrict the extra pull to MT7663, as no MT7615 or MT7622 hardware was
available to check whether their firmware uses the same layout.
Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support")
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://patch.msgid.link/20260819192911.1886457-1-naseefkm@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index ac831422d4c77..1121c6a243750 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -153,6 +153,8 @@ int mt7615_mcu_parse_response(struct mt76_dev *mdev, int cmd,
ret = *skb->data;
} else if (cmd == MCU_EXT_CMD(THERMAL_CTRL)) {
skb_pull(skb, sizeof(*rxd));
+ if (is_mt7663(mdev))
+ skb_pull(skb, 4);
ret = le32_to_cpu(*(__le32 *)skb->data);
} else if (cmd == MCU_EXT_QUERY(RF_REG_ACCESS)) {
skb_pull(skb, sizeof(*rxd));
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0972/1756] wifi: mt76: mt7615: validate MCU response lengths
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (970 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0971/1756] wifi: mt76: mt7615: read MT7663 temperature from the correct offset Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0973/1756] wifi: mt76: feed the station RSSI average from the chain signals Greg Kroah-Hartman
` (26 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 356735fc612ea54062eb741ea15fa4ff7df4fc36 ]
mt7615_mcu_parse_response() reads the common response header before
checking its size and then consumes command-specific fields after unchecked
skb_pull() calls. A short firmware response can therefore be read beyond
its current extent.
Validate the common header and each command-specific payload before reading
it.
Fixes: 0e6a29e477f3 ("mt76: mt7615: add support to read temperature from mcu")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260830131049.2097-1-pengpeng@iscas.ac.cn
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 1121c6a243750..ead3370254e4e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -145,6 +145,9 @@ int mt7615_mcu_parse_response(struct mt76_dev *mdev, int cmd,
}
rxd = (struct mt7615_mcu_rxd *)skb->data;
+ if (skb->len < sizeof(*rxd))
+ return -EMSGSIZE;
+
if (seq != rxd->seq)
return -EAGAIN;
@@ -152,11 +155,15 @@ int mt7615_mcu_parse_response(struct mt76_dev *mdev, int cmd,
skb_pull(skb, sizeof(*rxd) - 4);
ret = *skb->data;
} else if (cmd == MCU_EXT_CMD(THERMAL_CTRL)) {
+ if (skb->len < sizeof(*rxd) + (is_mt7663(mdev) ? 8 : 4))
+ return -EMSGSIZE;
skb_pull(skb, sizeof(*rxd));
if (is_mt7663(mdev))
skb_pull(skb, 4);
ret = le32_to_cpu(*(__le32 *)skb->data);
} else if (cmd == MCU_EXT_QUERY(RF_REG_ACCESS)) {
+ if (skb->len < sizeof(*rxd) + 8 + sizeof(__le32))
+ return -EMSGSIZE;
skb_pull(skb, sizeof(*rxd));
ret = le32_to_cpu(*(__le32 *)&skb->data[8]);
} else if (cmd == MCU_UNI_CMD(DEV_INFO_UPDATE) ||
@@ -167,12 +174,16 @@ int mt7615_mcu_parse_response(struct mt76_dev *mdev, int cmd,
cmd == MCU_UNI_CMD(SUSPEND)) {
struct mt76_connac_mcu_uni_event *event;
+ if (skb->len < sizeof(*rxd) + sizeof(*event))
+ return -EMSGSIZE;
skb_pull(skb, sizeof(*rxd));
event = (struct mt76_connac_mcu_uni_event *)skb->data;
ret = le32_to_cpu(event->status);
} else if (cmd == MCU_CE_QUERY(REG_READ)) {
struct mt76_connac_mcu_reg_event *event;
+ if (skb->len < sizeof(*rxd) + sizeof(*event))
+ return -EMSGSIZE;
skb_pull(skb, sizeof(*rxd));
event = (struct mt76_connac_mcu_reg_event *)skb->data;
ret = (int)le32_to_cpu(event->val);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0973/1756] wifi: mt76: feed the station RSSI average from the chain signals
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (971 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0972/1756] wifi: mt76: mt7615: validate MCU response lengths Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0974/1756] wifi: mt76: mt7996: fix PLE free page and AC queue register offsets Greg Kroah-Hartman
` (25 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cristian Papa, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Papa <pcristian292@gmail.com>
[ Upstream commit e1534fef1ae4df6e16401117394c26dbef84f361 ]
mt76_check_sta() adds status->signal of every received frame to the
station's RSSI average, wcid->rssi, which mt76_get_min_avg_rssi() reads
for the dynamic sensitivity of mt7603 and mt7615 and for the gain
control of mt76x0 and mt76x2.
Since commit 4550fb9e9810 ("mt76: improve signal strength reporting"),
drivers no longer set status->signal: mt76_rx_convert() computes it from
the chain values when the frame is handed to mac80211, after
mt76_check_sta() has run. Except on mt7921, which still sets it, the
average is fed zeros. mt76_get_min_avg_rssi() then returns 0, so mt7603
and mt7615 leave the sensitivity at its default, and mt76x0 and mt76x2
fall back to -75 dBm for their gain settings.
Compute the signal from the chain values in mt76_check_sta() as well,
as mt76_rx_convert() does. On mt7921, the average now follows the same
combined value that mac80211 gets instead of the strongest chain.
Tested on a TP-Link Archer XR500v with one client, switching between
the old and the new input every 30 seconds. On the MT7662E (mt76x2),
the average the AGC works with was -75 dBm, its fallback, with the old
input and -54 dBm with the new one, while iw reported -54 and -52 dBm
for the station, and the AGC mostly used its low_gain 2 setting instead
of 1. On the MT7603E, the station average was 0 with the old input and
-41 dBm with the new one, while iw reported -42 and -41 dBm. The mt7603
sensitivity still stayed at its default: a separate bug keeps it from
leaving 0.
Fixes: 4550fb9e9810 ("mt76: improve signal strength reporting")
Assisted-by: LLM
Signed-off-by: Cristian Papa <pcristian292@gmail.com>
Link: https://patch.msgid.link/20260924032639.28158-1-pcristian292@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mac80211.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 77708de932f30..98f05988cd0fc 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -1375,6 +1375,7 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
struct ieee80211_hw *hw;
struct mt76_wcid *wcid = status->wcid;
u8 tidno = status->qos_ctl & IEEE80211_QOS_CTL_TID_MASK;
+ int signal;
bool ps;
hw = mt76_phy_hw(dev, status->phy_idx);
@@ -1392,8 +1393,9 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
sta = container_of((void *)wcid, struct ieee80211_sta, drv_priv);
- if (status->signal <= 0)
- ewma_signal_add(&wcid->rssi, -status->signal);
+ signal = mt76_rx_signal(status->chains, status->chain_signal);
+ if (signal <= 0 && signal > -128)
+ ewma_signal_add(&wcid->rssi, -signal);
wcid->inactive_count = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0974/1756] wifi: mt76: mt7996: fix PLE free page and AC queue register offsets
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (972 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0973/1756] wifi: mt76: feed the station RSSI average from the chain signals Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0975/1756] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup Greg Kroah-Hartman
` (24 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit c33af2e4622baafc56c565a13823f6b89d3f50db ]
The PLE register map in the MediaTek vendor driver places the free
page counter, the free page head and tail, and the HIF group page status
at 0x3a0, 0x3a4 and 0x3a8. The driver reads them at 0x380, 0x384 and
0x388, and the vendor map has the band 1 TXCMD queue empty status at
0x388. The same map has 0x100 bytes per AC for the station queue empty
bitmaps, with the MT7992 extension register at offset 0x80. The driver
uses 0x80, which cannot hold the 34 registers per AC of MT7996, so the
hw-queues file reads AC1 to AC3 of a station from the wrong register.
Use the offsets of the vendor register map.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Link: https://patch.msgid.link/20261006205936.669125-25-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/regs.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/regs.h b/drivers/net/wireless/mediatek/mt76/mt7996/regs.h
index 47b429d8bfbe5..5e0342dce630c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/regs.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/regs.h
@@ -121,12 +121,12 @@ enum offs_rev {
#define MT_FL_Q2_CTRL MT_PLE(0x3e8)
#define MT_FL_Q3_CTRL MT_PLE(0x3ec)
-#define MT_PLE_FREEPG_CNT MT_PLE(0x380)
-#define MT_PLE_FREEPG_HEAD_TAIL MT_PLE(0x384)
+#define MT_PLE_FREEPG_CNT MT_PLE(0x3a0)
+#define MT_PLE_FREEPG_HEAD_TAIL MT_PLE(0x3a4)
#define MT_PLE_PG_HIF_GROUP MT_PLE(0x00c)
-#define MT_PLE_HIF_PG_INFO MT_PLE(0x388)
+#define MT_PLE_HIF_PG_INFO MT_PLE(0x3a8)
-#define MT_PLE_AC_QEMPTY(ac, n) MT_PLE(0x600 + 0x80 * (ac) + ((n) << 2))
+#define MT_PLE_AC_QEMPTY(ac, n) MT_PLE(0x600 + 0x100 * (ac) + ((n) << 2))
#define MT_PLE_AMSDU_PACK_MSDU_CNT(n) MT_PLE(0x10e0 + ((n) << 2))
/* WF MDP TOP */
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0975/1756] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (973 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0974/1756] wifi: mt76: mt7996: fix PLE free page and AC queue register offsets Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0976/1756] ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt Greg Kroah-Hartman
` (23 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, John Crispin, Felix Fietkau,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Crispin <john@phrozen.org>
[ Upstream commit 7a5a3843178c61d99d939b231318692d08fff79b ]
mt7996_unregister_device() leaves the RX NAPIs enabled, so
mt76_dma_cleanup() deletes enabled NAPIs and destroys page pools that
are still bound to them. On rmmod, the kernel warns in
__netif_napi_del_locked() for every RX queue and in
page_pool_disable_direct_recycling(). Until the IRQ tasklet is disabled,
an interrupt can still schedule a NAPI that was already deleted.
Disable every RX NAPI that was added before the MCU exit and the DMA
cleanup. This includes the host RRO queues: mt76_dma_init() skips them,
but mt7996_dma_rro_start() adds their NAPIs later when WED is not
active, so a check for mt76_queue_is_wed_rro() would miss them.
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: John Crispin <john@phrozen.org>
Link: https://patch.msgid.link/20261006205936.669125-27-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/init.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
index 6da42d9411656..80b1df96c9ee4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
@@ -1403,6 +1403,8 @@ int mt7996_register_device(struct mt7996_dev *dev)
void mt7996_unregister_device(struct mt7996_dev *dev)
{
+ int i;
+
cancel_work_sync(&dev->dump_work);
cancel_work_sync(&dev->wed_rro.work);
cancel_work_sync(&dev->reset_work);
@@ -1413,6 +1415,10 @@ void mt7996_unregister_device(struct mt7996_dev *dev)
mt7996_coredump_unregister(dev);
mt76_unregister_device(&dev->mt76);
mt7996_wed_rro_free(dev);
+ for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) {
+ if (dev->mt76.napi[i].dev)
+ napi_disable(&dev->mt76.napi[i]);
+ }
mt7996_mcu_exit(dev);
mt7996_tx_token_put(dev);
mt7996_dma_cleanup(dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0976/1756] ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (974 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0975/1756] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0977/1756] kobject: Fix the kobj_set_name reference in kset_register() kernel-doc Greg Kroah-Hartman
` (22 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, bui duc phuc, Mark Brown,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit e9eb1854d16136006c6fe94c927b54b2b264b429 ]
rockchip_i2s_set_fmt() calls pm_runtime_get_sync() before accessing
hardware registers, but ignores its return value.
If the runtime resume fails, the function continues to perform register
accesses while the device state is undefined.
Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() and
return early on failure to avoid unpowered register accesses.
Fixes: 53ca9b9777b9 ("ASoC: rockchip: i2s: Fix regmap_ops hang")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260903112739.373621-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/rockchip/rockchip_i2s.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 4315da4a47c15..358caa5d1544b 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -244,7 +244,9 @@ static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
unsigned int mask = 0, val = 0;
int ret = 0;
- pm_runtime_get_sync(cpu_dai->dev);
+ ret = pm_runtime_resume_and_get(cpu_dai->dev);
+ if (ret)
+ return ret;
mask = I2S_CKR_MSS_MASK;
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_BP_FP:
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0977/1756] kobject: Fix the kobj_set_name reference in kset_register() kernel-doc
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (975 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0976/1756] ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0978/1756] wifi: mt76: mt792x: compute the assoc RSSI from the chain signals Greg Kroah-Hartman
` (21 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Randy Dunlap,
Danilo Krummrich, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 3aac49b236c137fa77b97968d25338a28c49f0f8 ]
The kernel-doc comment of kset_register() refers to kobj_set_name, which
does not exist. The name is kobject_set_name. Say kobject_set_name.
Fixes: 1662cea4623f ("kset: fix memory leak when kset_register() returns error")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20260911222029.7267-1-kmehltretter@gmail.com
[ Also drop the misplaced braces in "allocated by()". - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/kobject.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/kobject.c b/lib/kobject.c
index 72fa20f405f15..1d930092a3f44 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -851,7 +851,7 @@ EXPORT_SYMBOL_GPL(kobj_sysfs_ops);
* kset_register() - Initialize and add a kset.
* @k: kset.
*
- * NOTE: On error, the kset.kobj.name allocated by() kobj_set_name()
+ * NOTE: On error, the kset.kobj.name allocated by kobject_set_name()
* is freed, it can not be used any more.
*/
int kset_register(struct kset *k)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0978/1756] wifi: mt76: mt792x: compute the assoc RSSI from the chain signals
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (976 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0977/1756] kobject: Fix the kobj_set_name reference in kset_register() kernel-doc Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0979/1756] checkkconfigsymbols.py: Parse Git status output line by line Greg Kroah-Hartman
` (20 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Felix Fietkau, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@nbd.name>
[ Upstream commit 2d12f56631ef307e58651b560ccda1f324a059f9 ]
mt792x_mac_rssi_iter() adds status->signal of auth and assoc response
frames to the BSS RSSI average, which mt7921_mcu_sta_update() and
mt7925_mcu_sta_update() send to the firmware as the station RCPI.
mt7925 never sets status->signal, since mt76_rx_convert() computes it
from the chain values later. The average is thus fed 0 dBm on mt7925.
Compute the signal from the chain values, as mt76_rx_convert() and
mt76_check_sta() do, and skip a frame without a valid chain signal. On
mt7921, the average now follows the combined value instead of the
strongest chain.
Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Link: https://patch.msgid.link/20261007112419.1277594-4-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt792x_mac.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_mac.c b/drivers/net/wireless/mediatek/mt76/mt792x_mac.c
index 05978d9c7b916..d559b8a008c0f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_mac.c
@@ -168,14 +168,16 @@ mt792x_mac_rssi_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb;
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb);
+ int signal;
- if (status->signal > 0)
+ signal = mt76_rx_signal(status->chains, status->chain_signal);
+ if (signal > 0 || signal <= -128)
return;
if (!ether_addr_equal(vif->addr, hdr->addr1))
return;
- ewma_rssi_add(&mvif->bss_conf.rssi, -status->signal);
+ ewma_rssi_add(&mvif->bss_conf.rssi, -signal);
}
void mt792x_mac_assoc_rssi(struct mt792x_dev *dev, struct sk_buff *skb)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0979/1756] checkkconfigsymbols.py: Parse Git status output line by line
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (977 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0978/1756] wifi: mt76: mt792x: compute the assoc RSSI from the chain signals Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0980/1756] drm/amd/display: assign missing trace entry in amdgpu_dm_dc_clocks_state Greg Kroah-Hartman
` (19 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ting-Han Hou, Nathan Chancellor,
Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ting-Han Hou <ue081723@gmail.com>
[ Upstream commit 72a61a7fef954152abd9df9def4f94816eb344ca ]
tree_is_dirty() iterates over the string returned by execute() one
character at a time. Its status check therefore examines filenames as
well as the two status columns.
An otherwise clean tree containing an untracked README is reported as
dirty because its name contains letters matched by [URMADC]. This
prevents --commit and --diff from running, whereas an untracked
notes.txt does not trigger the check.
Split the output into lines before examining the two status columns so
that filenames do not affect the dirty-tree check.
Fixes: b1a3f243485f ("checkkconfigsymbols.py: make it Git aware")
Assisted-by: LLM
Signed-off-by: Ting-Han Hou <ue081723@gmail.com>
Link: https://patch.msgid.link/CA+NtrhQqXgjT+4eg6W4P94Hc=DqdV3gQXz3EKKCxWvdWzfND6A@mail.gmail.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/checkkconfigsymbols.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py
index 36c920e713137..9f7aed98d91c0 100755
--- a/scripts/checkkconfigsymbols.py
+++ b/scripts/checkkconfigsymbols.py
@@ -245,7 +245,7 @@ def tree_is_dirty():
"""Return true if the current working tree is dirty (i.e., if any file has
been added, deleted, modified, renamed or copied but not committed)."""
stdout = execute(["git", "status", "--porcelain"])
- for line in stdout:
+ for line in stdout.splitlines():
if re.findall(r"[URMADC]{1}", line[:2]):
return True
return False
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0980/1756] drm/amd/display: assign missing trace entry in amdgpu_dm_dc_clocks_state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (978 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0979/1756] checkkconfigsymbols.py: Parse Git status output line by line Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0981/1756] drm/amd/display: remove duplicated prev_p_state_change_support assignment Greg Kroah-Hartman
` (18 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit ec167063dbf9fc66dc1364b6f9dd220c6742edeb ]
disp_dpp_voltage_level_khz is declared and printed, but never assigned.
So when using clock tracepoint the value of this clock is just garbage.
Assign clk->disp_dpp_voltage_level_khz since this is stored in dc_clocks
as other entries.
Fixes: 13b5ca42ca9c ("drm/amd/display: Add tracepoint for capturing clocks state")
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 4686d4b0cbad2..cbd3755ba0ebc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -512,6 +512,7 @@ TRACE_EVENT(amdgpu_dm_dc_clocks_state,
TP_fast_assign(
__entry->dispclk_khz = clk->dispclk_khz;
__entry->dppclk_khz = clk->dppclk_khz;
+ __entry->disp_dpp_voltage_level_khz = clk->disp_dpp_voltage_level_khz;
__entry->dcfclk_khz = clk->dcfclk_khz;
__entry->socclk_khz = clk->socclk_khz;
__entry->dcfclk_deep_sleep_khz = clk->dcfclk_deep_sleep_khz;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0981/1756] drm/amd/display: remove duplicated prev_p_state_change_support assignment
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (979 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0980/1756] drm/amd/display: assign missing trace entry in amdgpu_dm_dc_clocks_state Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0982/1756] drm/amd/display: fix vready offset assignment in dcn_optc_lock_unlock_state Greg Kroah-Hartman
` (17 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 11e8f72b09a6a3c0950b9558abd37559dd098698 ]
The prev_p_state_change_support trace entry is assigned and printed
twice, remove the unnecessary duplicates.
Fixes: 13b5ca42ca9c ("drm/amd/display: Add tracepoint for capturing clocks state")
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index cbd3755ba0ebc..07a7435516ee7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -522,7 +522,6 @@ TRACE_EVENT(amdgpu_dm_dc_clocks_state,
__entry->p_state_change_support = clk->p_state_change_support;
__entry->prev_p_state_change_support = clk->prev_p_state_change_support;
__entry->pwr_state = clk->pwr_state;
- __entry->prev_p_state_change_support = clk->prev_p_state_change_support;
__entry->dtm_level = clk->dtm_level;
__entry->max_supported_dppclk_khz = clk->max_supported_dppclk_khz;
__entry->max_supported_dispclk_khz = clk->max_supported_dispclk_khz;
@@ -532,8 +531,8 @@ TRACE_EVENT(amdgpu_dm_dc_clocks_state,
TP_printk("dispclk_khz=%d dppclk_khz=%d disp_dpp_voltage_level_khz=%d dcfclk_khz=%d socclk_khz=%d "
"dcfclk_deep_sleep_khz=%d fclk_khz=%d phyclk_khz=%d "
"dramclk_khz=%d p_state_change_support=%d "
- "prev_p_state_change_support=%d pwr_state=%d prev_p_state_change_support=%d "
- "dtm_level=%d max_supported_dppclk_khz=%d max_supported_dispclk_khz=%d "
+ "prev_p_state_change_support=%d pwr_state=%d dtm_level=%d "
+ "max_supported_dppclk_khz=%d max_supported_dispclk_khz=%d "
"bw_dppclk_khz=%d bw_dispclk_khz=%d ",
__entry->dispclk_khz,
__entry->dppclk_khz,
@@ -547,7 +546,6 @@ TRACE_EVENT(amdgpu_dm_dc_clocks_state,
__entry->p_state_change_support,
__entry->prev_p_state_change_support,
__entry->pwr_state,
- __entry->prev_p_state_change_support,
__entry->dtm_level,
__entry->max_supported_dppclk_khz,
__entry->max_supported_dispclk_khz,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0982/1756] drm/amd/display: fix vready offset assignment in dcn_optc_lock_unlock_state
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (980 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0981/1756] drm/amd/display: remove duplicated prev_p_state_change_support assignment Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0983/1756] drm/amd/display: use right type for amdgpu_dc_performance event entries Greg Kroah-Hartman
` (16 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 3ad7f4ca58efd6c1216632c50873dfffdefbe3ff ]
vready_offset is captured by optc_state, but the trace point entry is
wrongly assigned to vupdate_offset. Fix vready_offset tracepoint field
in dcn_optc_lock_unloack_state to record optc_state->vready_offset.
Fixes: f1943a51f0f9 ("drm/amd/display: Add events log to trace OPTC lock and unlock")
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 07a7435516ee7..3151b9b9ae360 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -700,7 +700,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
__entry->vstartup_start = optc_state->vstartup_start;
__entry->vupdate_offset = optc_state->vupdate_offset;
__entry->vupdate_width = optc_state->vupdate_width;
- __entry->vready_offset = optc_state->vupdate_offset;
+ __entry->vready_offset = optc_state->vready_offset;
),
TP_printk("%s: %s()+%d: optc_instance=%d opp_count=%d max_h_total=%d max_v_total=%d "
"min_h_blank=%d min_h_sync_width=%d min_v_sync_width=%d min_v_blank=%d "
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0983/1756] drm/amd/display: use right type for amdgpu_dc_performance event entries
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (981 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0982/1756] drm/amd/display: fix vready offset assignment in dcn_optc_lock_unlock_state Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0984/1756] drm/amd/display: copy function name into dcn_fpu trace event Greg Kroah-Hartman
` (15 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Dan Wheeler, Roman Li,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 99858eda764364bae733448c7eb79145d3d043ec ]
Some amdgpu_dc_performance trace event params are passed as unsigned
long but stored as uint32_t, cutting them off on 64-bit. Use the right
type on entry fields and on printk use unsigned format accordingly.
Fixes: 0cf5eb76e2b4 ("drm/amd/display: Add tracing to dc")
Signed-off-by: Melissa Wen <mwen@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 3151b9b9ae360..a0e8d1c9bfbfd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -75,10 +75,10 @@ TRACE_EVENT(amdgpu_dc_performance,
const char *func, unsigned int line),
TP_ARGS(read_count, write_count, last_read, last_write, func, line),
TP_STRUCT__entry(
- __field(uint32_t, reads)
- __field(uint32_t, writes)
- __field(uint32_t, read_delta)
- __field(uint32_t, write_delta)
+ __field(unsigned long, reads)
+ __field(unsigned long, writes)
+ __field(unsigned long, read_delta)
+ __field(unsigned long, write_delta)
__string(func, func)
__field(uint32_t, line)
),
@@ -92,12 +92,9 @@ TRACE_EVENT(amdgpu_dc_performance,
*last_read = read_count;
*last_write = write_count;
),
- TP_printk("%s:%d reads=%08ld (%08ld total), writes=%08ld (%08ld total)",
- __get_str(func), __entry->line,
- (unsigned long)__entry->read_delta,
- (unsigned long)__entry->reads,
- (unsigned long)__entry->write_delta,
- (unsigned long)__entry->writes)
+ TP_printk("%s:%u reads=%08lu (%08lu total), writes=%08lu (%08lu total)",
+ __get_str(func), __entry->line, __entry->read_delta,
+ __entry->reads, __entry->write_delta, __entry->writes)
);
TRACE_EVENT(amdgpu_dm_connector_atomic_check,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0984/1756] drm/amd/display: copy function name into dcn_fpu trace event
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (982 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0983/1756] drm/amd/display: use right type for amdgpu_dc_performance event entries Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0985/1756] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Greg Kroah-Hartman
` (14 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Tvrtko Ursulin,
Dan Wheeler, Roman Li, Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit b4d41522012d91cd875cebdfd1a3bbb04eb863dd ]
Userspace trace tools that use libtraceevent to read binary buffer only
see a kernel address when printing const char *. Use string macros in
dcn_fpu to copy the function name into the trace event.
Fixes: 96ee63730fa3 ("drm/amd/display: Add control mechanism for FPU")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index a0e8d1c9bfbfd..8043c4ac31d5b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -641,20 +641,20 @@ TRACE_EVENT(dcn_fpu,
TP_STRUCT__entry(
__field(bool, begin)
- __field(const char *, function)
+ __string(function, function)
__field(int, line)
__field(int, recursion_depth)
),
TP_fast_assign(
__entry->begin = begin;
- __entry->function = function;
+ __assign_str(function);
__entry->line = line;
__entry->recursion_depth = recursion_depth;
),
TP_printk("%s: recursion_depth: %d: %s()+%d:",
__entry->begin ? "begin" : "end",
__entry->recursion_depth,
- __entry->function,
+ __get_str(function),
__entry->line
)
);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0985/1756] drm/amd/display: copy function name into dcn_optc_lock_unlock_state trace event
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (983 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0984/1756] drm/amd/display: copy function name into dcn_fpu trace event Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0986/1756] ASoC: mediatek: common: Handle constraint return value in FE startup Greg Kroah-Hartman
` (13 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Melissa Wen, Dan Wheeler, Roman Li,
Alex Deucher, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <mwen@igalia.com>
[ Upstream commit 624a5a158c2a49f07edba7f8653eeecca114921f ]
Userspace trace tools that use libtraceevent to read binary buffer only
see a kernel address when printing const char *. Use string macros in
dcn_optc_lock_unlock_state to copy the function name into the trace
event.
Fixes: f1943a51f0f9 ("drm/amd/display: Add events log to trace OPTC lock and unlock")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Melissa Wen <mwen@igalia.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
index 8043c4ac31d5b..113b04678dd37 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
@@ -664,7 +664,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
TP_ARGS(optc_state, instance, lock, function, line),
TP_STRUCT__entry(
- __field(const char *, function)
+ __string(function, function)
__field(int, instance)
__field(bool, lock)
__field(int, line)
@@ -682,7 +682,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
__field(int, vready_offset)
),
TP_fast_assign(
- __entry->function = function;
+ __assign_str(function);
__entry->instance = instance;
__entry->lock = lock;
__entry->line = line;
@@ -704,7 +704,7 @@ TRACE_EVENT(dcn_optc_lock_unlock_state,
"min_v_blank_interlace=%d vstartup_start=%d vupdate_offset=%d vupdate_width=%d "
"vready_offset=%d",
__entry->lock ? "Lock" : "Unlock",
- __entry->function,
+ __get_str(function),
__entry->line,
__entry->instance,
__entry->opp_count,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0986/1756] ASoC: mediatek: common: Handle constraint return value in FE startup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (984 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0985/1756] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0987/1756] ASoC: mediatek: mt8188: " Greg Kroah-Hartman
` (12 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 5fcdb40a4776cc6f8d3179aa9cf9663fc18c7861 ]
snd_pcm_hw_constraint_integer() may return 1, which is then returned
from mtk_afe_fe_startup(). ASoC only treats 0 as success when marking
the DAI as started, so .shutdown() can be skipped on rollback.
Return 0 explicitly on success.
Fixes: 283b612429a2 ("ASoC: mediatek: implement mediatek common structure")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261007110858.509341-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/common/mtk-afe-fe-dai.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sound/soc/mediatek/common/mtk-afe-fe-dai.c b/sound/soc/mediatek/common/mtk-afe-fe-dai.c
index 3044d9ab3d4d9..4e47689bb1f16 100644
--- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c
+++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c
@@ -75,8 +75,10 @@ int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
ret = snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
- if (ret < 0)
+ if (ret < 0) {
dev_err(afe->dev, "snd_pcm_hw_constraint_integer failed\n");
+ return ret;
+ }
/* dynamic allocate irq to memif */
if (memif->irq_usage < 0) {
@@ -88,10 +90,10 @@ int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
} else {
dev_err(afe->dev, "%s() error: no more asys irq\n",
__func__);
- ret = -EBUSY;
+ return -EBUSY;
}
}
- return ret;
+ return 0;
}
EXPORT_SYMBOL_GPL(mtk_afe_fe_startup);
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0987/1756] ASoC: mediatek: mt8188: Handle constraint return value in FE startup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (985 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0986/1756] ASoC: mediatek: common: Handle constraint return value in FE startup Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0988/1756] ASoC: mediatek: mt8365: " Greg Kroah-Hartman
` (11 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 71253751586b8ce37570b8e15cfbc74f0dd06c3d ]
snd_pcm_hw_constraint_minmax() may return 1, which is then returned
from mt8188_afe_fe_startup(). ASoC only treats 0 as success when marking
the DAI as started, so .shutdown() can be skipped on rollback.
Return 0 explicitly on success.
Fixes: bf106bf09376 ("ASoC: mediatek: mt8188: add platform driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261007110858.509341-3-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
index 884a4656c6f11..8356208132d75 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
@@ -320,6 +320,9 @@ static int mt8188_afe_fe_startup(struct snd_pcm_substream *substream,
MT8188_MEMIF_DL7_MAX_PERIOD_SIZE);
if (ret < 0)
dev_dbg(afe->dev, "hw_constraint_minmax failed\n");
+ else
+ ret = 0;
+
out:
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0988/1756] ASoC: mediatek: mt8365: Handle constraint return value in FE startup
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (986 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0987/1756] ASoC: mediatek: mt8188: " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0989/1756] PCI/sysfs: Stop reporting _DSM failures as -EPERM Greg Kroah-Hartman
` (10 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, bui duc phuc, Cezary Rojewski,
Mark Brown, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <phucduc.bui@gmail.com>
[ Upstream commit 8de3f4e8e81148dd4cdd19e622d4be1fe07a7f52 ]
snd_pcm_hw_constraint_integer() may return 1, which is then returned
from mt8365_afe_fe_startup(). ASoC only treats 0 as success when marking
the DAI as started, so .shutdown() can be skipped on rollback.
Return 0 explicitly on success.
Fixes: e1991d102bc2 ("ASoC: mediatek: mt8365: Add the AFE driver support")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261007110858.509341-5-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
index 23cfcf7160e3d..50269fa1a6527 100644
--- a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
+++ b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
@@ -514,11 +514,14 @@ static int mt8365_afe_fe_startup(struct snd_pcm_substream *substream,
snd_soc_set_runtime_hwparams(substream, afe->mtk_afe_hardware);
ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
- if (ret < 0)
+ if (ret < 0) {
dev_err(afe->dev, "snd_pcm_hw_constraint_integer failed\n");
+ return ret;
+ }
mt8365_afe_enable_main_clk(afe);
- return ret;
+
+ return 0;
}
static void mt8365_afe_fe_shutdown(struct snd_pcm_substream *substream,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0989/1756] PCI/sysfs: Stop reporting _DSM failures as -EPERM
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (987 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0988/1756] ASoC: mediatek: mt8365: " Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0990/1756] PCI/sysfs: Handle a malformed _DSM result in acpi_attr_is_visible() Greg Kroah-Hartman
` (9 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Wilczyński,
Bjorn Helgaas, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Wilczyński <kwilczynski@kernel.org>
[ Upstream commit 36f9bd09920ed71c1b79db397170412b2de22319 ]
Currently, dsm_get_label() returns the literal -1 on every failure path.
The sysfs read path passes that value to userspace as -EPERM. Reading the
"label" or "acpi_index" attribute on a platform where the Device Name _DSM
returns a malformed result then fails with:
$ cat /sys/bus/pci/devices/0000:00:08.3/label
cat: /sys/bus/pci/devices/0000:00:08.3/label: Operation not permitted
Nothing in that path performs a permission check, and the read fails the
same way for a privileged reader. The error code points at a cause that
does not exist, and tools such as lspci report it on every invocation.
Return -ENODEV when the device has no ACPI companion, and -EIO when the
_DSM evaluation fails or returns an object that cannot be parsed. Other
_DSM users in the tree report such failures the same way.
The set of reads that succeed, and the bytes they return, stay the same.
Only the error code of reads that already fail differs.
Fixes: 6058989bad05 ("PCI: Export ACPI _DSM provided firmware instance number and string name to sysfs")
Link: https://github.com/pciutils/pciutils/issues/175
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260814070522.2327975-2-kwilczynski@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pci-label.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index c224619b9a266..17f1bc0cf458e 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -160,12 +160,12 @@ static int dsm_get_label(struct device *dev, char *buf,
int len = 0;
if (!handle)
- return -1;
+ return -ENODEV;
obj = acpi_evaluate_dsm(handle, &pci_acpi_dsm_guid, 0x2,
DSM_PCI_DEVICE_NAME, NULL);
if (!obj)
- return -1;
+ return -EIO;
tmp = obj->package.elements;
if (obj->type == ACPI_TYPE_PACKAGE && obj->package.count == 2 &&
@@ -190,7 +190,7 @@ static int dsm_get_label(struct device *dev, char *buf,
ACPI_FREE(obj);
- return len > 0 ? len : -1;
+ return len > 0 ? len : -EIO;
}
static ssize_t label_show(struct device *dev, struct device_attribute *attr,
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0990/1756] PCI/sysfs: Handle a malformed _DSM result in acpi_attr_is_visible()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (988 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0989/1756] PCI/sysfs: Stop reporting _DSM failures as -EPERM Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0991/1756] ALSA: hda: Fix potential UAF for gating jack Greg Kroah-Hartman
` (8 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Krzysztof Wilczyński,
Bjorn Helgaas, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Wilczyński <kwilczynski@kernel.org>
[ Upstream commit 1832dc1579aa7cc7cd41843770767e7a3ffa8364 ]
Currently, the "label" and "acpi_index" attributes are created whenever the
_DSM function 0 bitmap advertises the Device Name function, without
evaluating that function. The documented ABI states that each attribute is
created only if the firmware has given a name or an instance number to the
PCI device.
The bitmap says nothing about the object the function returns. Firmware
that advertises the function but returns an object that cannot be parsed
therefore produces attributes that exist and fail every read, as in the
report below.
Evaluate the Device Name _DSM when deciding attribute visibility and create
each attribute only when the element it exports has a type the read path
accepts, mirroring the checks performed at read time. The SMBIOS attribute
group already follows this pattern by performing the DMI lookup in its
is_visible() callback. The read side checks remain in place since the two
evaluations happen at different times.
This restores the behaviour from before commit 2fc59fe2ecdc ("PCI /
pci-label: treat PCI label with index 0 as valid label"), which switched
visibility from evaluating the function to checking only the function 0
bitmap. The check is now made for each attribute, not once for both.
Fixes: 2fc59fe2ecdc ("PCI / pci-label: treat PCI label with index 0 as valid label")
Closes: https://github.com/pciutils/pciutils/issues/175
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260814070522.2327975-4-kwilczynski@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/ABI/testing/sysfs-bus-pci | 14 ++++++++---
drivers/pci/pci-label.c | 33 ++++++++++++++++++++++++-
2 files changed, 42 insertions(+), 5 deletions(-)
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci
index 5da6a14dc326b..70b36a806293a 100644
--- a/Documentation/ABI/testing/sysfs-bus-pci
+++ b/Documentation/ABI/testing/sysfs-bus-pci
@@ -244,10 +244,16 @@ Contact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
Description:
Reading this attribute will provide the firmware
given name (SMBIOS type 41 string or ACPI _DSM string) of
- the PCI device. The attribute will be created only
- if the firmware has given a name to the PCI device.
- ACPI _DSM string name will be given priority if the
- system firmware provides SMBIOS type 41 string also.
+ the PCI device. The attribute will be created only if the
+ firmware naming mechanism is implemented for the device:
+ a SMBIOS type 41 record with a non-empty reference
+ designation, or a Device Name _DSM that returns the name
+ as a string or a buffer. The value read is empty when the
+ firmware implements the _DSM but gives the device no name,
+ which per PCI Firmware r3.3, sec 4.6.7 the firmware reports
+ as a NULL string. ACPI _DSM string name will be given
+ priority if the system firmware provides SMBIOS type 41
+ string also.
Users:
Userspace applications interested in knowing the
firmware assigned name of the PCI device.
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index 17f1bc0cf458e..f81248a11a18e 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -217,11 +217,42 @@ static umode_t acpi_attr_is_visible(struct kobject *kobj, struct attribute *a,
int n)
{
struct device *dev = kobj_to_dev(kobj);
+ union acpi_object *obj, *tmp;
+ umode_t mode = 0;
if (!device_has_acpi_name(dev))
return 0;
- return a->mode;
+ /*
+ * The bitmap from _DSM function 0 only advertises function 7,
+ * and whether the returned object can be parsed is a separate
+ * question. Evaluate it and expose each attribute only if the
+ * element it exports has one of the types the read path
+ * accepts, mirroring the checks in dsm_get_label().
+ */
+ obj = acpi_evaluate_dsm(ACPI_HANDLE(dev), &pci_acpi_dsm_guid, 0x2,
+ DSM_PCI_DEVICE_NAME, NULL);
+ if (!obj)
+ return 0;
+
+ if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 2)
+ goto out;
+
+ tmp = obj->package.elements;
+ if (tmp[0].type != ACPI_TYPE_INTEGER)
+ goto out;
+
+ if (a == &dev_attr_acpi_index.attr)
+ mode = a->mode;
+ else if (a == &dev_attr_label.attr &&
+ (tmp[1].type == ACPI_TYPE_STRING ||
+ tmp[1].type == ACPI_TYPE_BUFFER))
+ mode = a->mode;
+
+out:
+ ACPI_FREE(obj);
+
+ return mode;
}
const struct attribute_group pci_dev_acpi_attr_group = {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0991/1756] ALSA: hda: Fix potential UAF for gating jack
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (989 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0990/1756] PCI/sysfs: Handle a malformed _DSM result in acpi_attr_is_visible() Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0992/1756] ALSA: usb-audio: Check mixer matrix size for UAC2/3 at parsing Greg Kroah-Hartman
` (7 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 27cee4141c8de82cf051104ca830c3a209816033 ]
snd_hda_jack_set_gating_jack() assigns gated and gating variables from
the succeeding calls of snd_hda_jack_tbl_get(). This works normally,
but the second call might kick off the reallocation of the jack table,
hence the first pointer might become invalid, which leads to a UAF.
For avoiding that pitfall, this patch changes the code to two phases:
the first to only create two entries, and the second phase to get the
pointers from the table, so that no relocation can happen any longer.
Fixes: 0619ba8c17b1 ("ALSA: hda - Allow jack state to depend on another jack")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172051.13240-4-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_jack.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c
index 7d7786df60ea7..8c25c7d81128b 100644
--- a/sound/pci/hda/hda_jack.c
+++ b/sound/pci/hda/hda_jack.c
@@ -383,12 +383,15 @@ EXPORT_SYMBOL_GPL(snd_hda_jack_detect_enable);
int snd_hda_jack_set_gating_jack(struct hda_codec *codec, hda_nid_t gated_nid,
hda_nid_t gating_nid)
{
- struct hda_jack_tbl *gated = snd_hda_jack_tbl_new(codec, gated_nid, 0);
- struct hda_jack_tbl *gating =
- snd_hda_jack_tbl_new(codec, gating_nid, 0);
+ struct hda_jack_tbl *gated, *gating;
WARN_ON(codec->dp_mst);
+ if (!snd_hda_jack_tbl_new(codec, gated_nid, 0) ||
+ !snd_hda_jack_tbl_new(codec, gating_nid, 0))
+ return -ENOMEM;
+ gated = snd_hda_jack_tbl_get_mst(codec, gated_nid, 0);
+ gating = snd_hda_jack_tbl_get_mst(codec, gating_nid, 0);
if (!gated || !gating)
return -EINVAL;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0992/1756] ALSA: usb-audio: Check mixer matrix size for UAC2/3 at parsing
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (990 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0991/1756] ALSA: hda: Fix potential UAF for gating jack Greg Kroah-Hartman
@ 2026-11-18 14:51 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0993/1756] ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation Greg Kroah-Hartman
` (6 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:51 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 22185ffd7b31885d03fdeb20055a8707779a70f9 ]
The matrix of input/output channels specified in a UAC2/3 mixer unit
must fit to the upper limit 256. Add a sanity check and returns an
error if an invalid size is detected.
Link: https://lore.kernel.org/d46fcac6-bd7e-4fc4-95e1-4e8d39f92ad3@zipdox.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260930155356.348608-2-tiwai@suse.de
Stable-dep-of: c01fb2ed90c0 ("ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/mixer.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 45145ef7db7c5..cb685fa0e03ea 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2284,6 +2284,16 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid,
num_outs = err;
input_pins = desc->bNrInPins;
+ if (state->mixer->protocol == UAC_VERSION_2 ||
+ state->mixer->protocol == UAC_VERSION_3) {
+ if (input_pins * num_outs > 256) {
+ usb_audio_err(state->chip,
+ "invalid channels for MIXER UNIT %d: input=%d, output=%d\n",
+ unitid, input_pins, num_outs);
+ return -EINVAL;
+ }
+ }
+
num_ins = 0;
ich = 0;
for (pin = 0; pin < input_pins; pin++) {
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0993/1756] ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (991 preceding siblings ...)
2026-11-18 14:51 ` [PATCH 6.12 0992/1756] ALSA: usb-audio: Check mixer matrix size for UAC2/3 at parsing Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0994/1756] ALSA: pcmtest: Fix a bogus pointer read in snd_pcmtst_pcm_pointer() Greg Kroah-Hartman
` (5 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit c01fb2ed90c0770560ea9cc1644f205956b26a70 ]
The bitmap matrix in the mixer unit descriptor for UAC2 and UAC3 has
rather the size of input-pins x output-pins, while the current
USB-audio driver code wrongly assumes the UAC1 bitmap matrix size,
which is input-channels x output-pins. That is, when input pins have
multiple channels, the column size differs and it leads to the
accesses at a wrong position.
This patch corrects the access of the bitmap matrix for UAC2/UAC3.
For making the code cleaner, split the parser to UAC1 and UAC2/3, too.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172051.13240-5-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/mixer.c | 112 ++++++++++++++++++++++++++++++++--------------
1 file changed, 78 insertions(+), 34 deletions(-)
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index cb685fa0e03ea..b69b04777c6a3 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2180,7 +2180,7 @@ static bool mixer_bitmap_overflow(struct uac_mixer_unit_descriptor *desc,
*/
static void build_mixer_unit_ctl(struct mixer_build *state,
struct uac_mixer_unit_descriptor *desc,
- int in_pin, int in_ch, int num_outs,
+ int in_ch, int num_outs,
int unitid, struct usb_audio_term *iterm)
{
struct usb_mixer_elem_info *cval;
@@ -2265,34 +2265,13 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid,
/*
* parse a mixer unit
*/
-static int parse_audio_mixer_unit(struct mixer_build *state, int unitid,
- void *raw_desc)
+/* UAC1 mixer unit */
+static int parse_audio_mixer_unit_v1(struct mixer_build *state, int unitid,
+ int input_pins, int num_outs,
+ struct uac_mixer_unit_descriptor *desc)
{
- struct uac_mixer_unit_descriptor *desc = raw_desc;
struct usb_audio_term iterm;
- int input_pins, num_ins, num_outs;
- int pin, ich, err;
-
- err = uac_mixer_unit_get_channels(state, desc);
- if (err < 0) {
- usb_audio_err(state->chip,
- "invalid MIXER UNIT descriptor %d\n",
- unitid);
- return err;
- }
-
- num_outs = err;
- input_pins = desc->bNrInPins;
-
- if (state->mixer->protocol == UAC_VERSION_2 ||
- state->mixer->protocol == UAC_VERSION_3) {
- if (input_pins * num_outs > 256) {
- usb_audio_err(state->chip,
- "invalid channels for MIXER UNIT %d: input=%d, output=%d\n",
- unitid, input_pins, num_outs);
- return -EINVAL;
- }
- }
+ int num_ins, pin, ich, och, err;
num_ins = 0;
ich = 0;
@@ -2311,25 +2290,90 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid,
num_ins, num_outs))
break;
for (; ich < num_ins; ich++) {
- int och, ich_has_controls = 0;
-
for (och = 0; och < num_outs; och++) {
__u8 *c = uac_mixer_unit_bmControls(desc,
state->mixer->protocol);
- if (check_matrix_bitmap(c, ich, och, num_outs)) {
- ich_has_controls = 1;
+ if (check_matrix_bitmap(c, ich, och, num_outs))
break;
- }
}
- if (ich_has_controls)
- build_mixer_unit_ctl(state, desc, pin, ich, num_outs,
+ if (och < num_outs)
+ build_mixer_unit_ctl(state, desc, ich, num_outs,
unitid, &iterm);
}
}
return 0;
}
+/* UAC2/UAC3 mixer unit */
+static int parse_audio_mixer_unit_v2(struct mixer_build *state, int unitid,
+ int input_pins, int num_outs,
+ struct uac_mixer_unit_descriptor *desc)
+{
+ struct usb_audio_term iterm;
+ int pin, och, err;
+
+ if (input_pins * num_outs > 256 ||
+ mixer_bitmap_overflow(desc, state->mixer->protocol,
+ input_pins, num_outs)) {
+ usb_audio_err(state->chip,
+ "invalid channels for MIXER UNIT %d: input=%d, output=%d\n",
+ unitid, input_pins, num_outs);
+ return -EINVAL;
+ }
+
+ for (pin = 0; pin < input_pins; pin++) {
+ err = parse_audio_unit(state, desc->baSourceID[pin]);
+ if (err < 0)
+ continue;
+ if (!num_outs)
+ continue;
+ err = check_input_term(state, desc->baSourceID[pin], &iterm);
+ if (err < 0)
+ return err;
+
+ for (och = 0; och < num_outs; och++) {
+ __u8 *c = uac_mixer_unit_bmControls(desc,
+ state->mixer->protocol);
+
+ if (check_matrix_bitmap(c, pin, och, num_outs))
+ break;
+ }
+ if (och < num_outs)
+ build_mixer_unit_ctl(state, desc, pin, num_outs,
+ unitid, &iterm);
+ }
+ return 0;
+}
+
+static int parse_audio_mixer_unit(struct mixer_build *state, int unitid,
+ void *raw_desc)
+{
+ struct uac_mixer_unit_descriptor *desc = raw_desc;
+ int num_outs;
+
+ num_outs = uac_mixer_unit_get_channels(state, desc);
+ if (num_outs < 0) {
+ usb_audio_err(state->chip,
+ "invalid MIXER UNIT descriptor %d\n",
+ unitid);
+ return num_outs;
+ }
+
+ switch (state->mixer->protocol) {
+ case UAC_VERSION_1:
+ default:
+ return parse_audio_mixer_unit_v1(state, unitid,
+ desc->bNrInPins, num_outs,
+ desc);
+ case UAC_VERSION_2:
+ case UAC_VERSION_3:
+ return parse_audio_mixer_unit_v2(state, unitid,
+ desc->bNrInPins, num_outs,
+ desc);
+ }
+}
+
/*
* Processing Unit / Extension Unit
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0994/1756] ALSA: pcmtest: Fix a bogus pointer read in snd_pcmtst_pcm_pointer()
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (992 preceding siblings ...)
2026-11-18 14:52 ` [PATCH 6.12 0993/1756] ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0995/1756] ALSA: core: Add missing barriers for power_ref vs card->shutdown Greg Kroah-Hartman
` (4 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 905a07c711baf184d01aebd3cf9028a89bcd8b7f ]
Sashiko reported a potential bogus value for a pcmtest driver when a
concurrent call to PCM pointer is invoked while the pcmtest's timer
callback is running: since the position is updated in the timer
callback without locking, the following wrapping in inc_buf_pos()
might be screwed up:
if (v_iter->buf_pos >= bytes)
v_iter->buf_pos %= bytes;
Although it was reported as an OOB, the actual return is corrected
inside buffer_size, so no corruption is expected in this scenario, but
an error message could show a bogus value.
Also, the whole state is read and modified locklessly in the timer
callback, which can be racy against the pause operation, too.
For avoiding those races, simply put the PCM stream lock in the timer
callback (while the snd_pcm_period_elapsed() must be changed to its
*_under_stream_lock() variant for avoiding the deadlock).
Reported-by: Sashiko <sashiko-bot@kernel.org>
Fixes: 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172051.13240-7-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/drivers/pcmtest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c
index acdafeb43858c..4a53dd84b19af 100644
--- a/sound/drivers/pcmtest.c
+++ b/sound/drivers/pcmtest.c
@@ -344,6 +344,7 @@ static void timer_timeout(struct timer_list *data)
v_iter = from_timer(v_iter, data, timer_instance);
substream = v_iter->substream;
+ guard(pcm_stream_lock_irqsave)(substream);
if (v_iter->suspend)
return;
@@ -357,7 +358,7 @@ static void timer_timeout(struct timer_list *data)
v_iter->period_pos += v_iter->b_rw;
if (v_iter->period_pos >= v_iter->period_bytes) {
v_iter->period_pos %= v_iter->period_bytes;
- snd_pcm_period_elapsed(substream);
+ snd_pcm_period_elapsed_under_stream_lock(substream);
}
if (!v_iter->suspend)
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0995/1756] ALSA: core: Add missing barriers for power_ref vs card->shutdown
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (993 preceding siblings ...)
2026-11-18 14:52 ` [PATCH 6.12 0994/1756] ALSA: pcmtest: Fix a bogus pointer read in snd_pcmtst_pcm_pointer() Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0996/1756] ALSA: seq: Fix missing direction and ump_group handling in 32bit compat ioctl Greg Kroah-Hartman
` (3 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit a6913835735469751f56473f5212eb291a4805e7 ]
snd_power_ref_and_wait() increments card->power_ref and then reads
card->shutdown (and the power state) locklessly, while
snd_card_disconnect() sets card->shutdown and then waits for
power_ref to drop to zero via snd_power_sync_ref(). Due to the
missing barrier on both sides, the caller proceeds with shutdown still
seen as false, while the disconnect side sees a zero refcount and
continues tearing down incorrectly.
For addressing the potential race, add smp_mb__after_atomic() after
the refcount increment and smp_mb() before snd_power_sync_ref() in
snd_card_disconnect().
Fixes: e94fdbd7b25d ("ALSA: control: Track in-flight control read/write/tlv accesses")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Assisted-by: LLM
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172051.13240-9-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/init.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/core/init.c b/sound/core/init.c
index b37269b86be89..d39dc0198370e 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -552,6 +552,8 @@ void snd_card_disconnect(struct snd_card *card)
clear_bit(card->number, snd_cards_lock);
}
+ /* order card->shutdown store against power_ref read */
+ smp_mb();
snd_power_sync_ref(card);
}
EXPORT_SYMBOL(snd_card_disconnect);
@@ -1142,6 +1144,8 @@ EXPORT_SYMBOL(snd_card_file_remove);
int snd_power_ref_and_wait(struct snd_card *card)
{
snd_power_ref(card);
+ /* order power_ref increment against card->shutdown read */
+ smp_mb__after_atomic();
if (snd_power_get_state(card) != SNDRV_CTL_POWER_D0) {
wait_event_cmd(card->power_sleep,
card->shutdown ||
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0996/1756] ALSA: seq: Fix missing direction and ump_group handling in 32bit compat ioctl
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (994 preceding siblings ...)
2026-11-18 14:52 ` [PATCH 6.12 0995/1756] ALSA: core: Add missing barriers for power_ref vs card->shutdown Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0997/1756] ALSA: info: Fix memory leak at card removal Greg Kroah-Hartman
` (2 subsequent siblings)
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 9d3e19c192b97b4c4c0abcafdbf1edb1e56cee88 ]
I forgot to cover the two new fields, direction and ump_group, in
struct snd_seq_port_info for the 32bit compat ioctls of
SNDRV_SEQ_IOCTL_GET_PORT_INFO & co, which ended up with the garbage
copies in those fields. Add the handling of those two fields in the
compat layer.
Also, avoid over-copying the 64bit snd_seq_port_info but only the first
part (before the field kernel); this avoids the copy of kernel-space
garbage value in the reserved field.
Fixes: ff166a9d19fa ("ALSA: seq: Add port direction to snd_seq_port_info")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172533.14667-2-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/seq/seq_compat.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/sound/core/seq/seq_compat.c b/sound/core/seq/seq_compat.c
index ee9bfdf781b12..e585b09111991 100644
--- a/sound/core/seq/seq_compat.c
+++ b/sound/core/seq/seq_compat.c
@@ -25,7 +25,9 @@ struct snd_seq_port_info32 {
u32 kernel; /* reserved for kernel use (must be NULL) */
u32 flags; /* misc. conditioning */
unsigned char time_queue; /* queue # for timestamping */
- char reserved[59]; /* for future use */
+ unsigned char direction; /* port usage direction (r/w/bidir) */
+ unsigned char ump_group; /* 0 = UMP EP (no conversion), 1-16 = UMP group number */
+ char reserved[57]; /* for future use */
};
static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned int cmd,
@@ -40,7 +42,9 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned
if (copy_from_user(data, data32, sizeof(*data32)) ||
get_user(data->flags, &data32->flags) ||
- get_user(data->time_queue, &data32->time_queue))
+ get_user(data->time_queue, &data32->time_queue) ||
+ get_user(data->direction, &data32->direction) ||
+ get_user(data->ump_group, &data32->ump_group))
return -EFAULT;
data->kernel = NULL;
@@ -50,9 +54,12 @@ static int snd_seq_call_port_info_ioctl(struct snd_seq_client *client, unsigned
if (err < 0)
return err;
- if (copy_to_user(data32, data, sizeof(*data32)) ||
+ if (copy_to_user(data32, data,
+ offsetof(struct snd_seq_port_info32, kernel)) ||
put_user(data->flags, &data32->flags) ||
- put_user(data->time_queue, &data32->time_queue))
+ put_user(data->time_queue, &data32->time_queue) ||
+ put_user(data->direction, &data32->direction) ||
+ put_user(data->ump_group, &data32->ump_group))
return -EFAULT;
return err;
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0997/1756] ALSA: info: Fix memory leak at card removal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (995 preceding siblings ...)
2026-11-18 14:52 ` [PATCH 6.12 0996/1756] ALSA: seq: Fix missing direction and ump_group handling in 32bit compat ioctl Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0998/1756] ALSA: hda: Avoid non-operational GPU warning at regular device removal Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0999/1756] ALSA: hda/intel: Move firmware loading into the probe work Greg Kroah-Hartman
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit a3e8eec7692eac706ba0934fa18453e46acd1a08 ]
The fix for potential deadlock at disconnection by the commit
c7a606519533 ("ALSA: info: Fix potential deadlock at disconnection")
clears card->proc_root pointer at snd_info_card_disconnect(), in order
just to be sure. But this leads to a memory leak of card->proc_root
content that should have been released at a later call of
snd_info_card_free().
For addressing the memory leak, simply drop the card->proc_root
clearance at snd_info_card_disconnect().
Since card->proc_root might be still looked at in
snd_info_card_id_change() that may be running concurrently during the
connection procedure, add a sanity check there, too.
Fixes: c7a606519533 ("ALSA: info: Fix potential deadlock at disconnection")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20261006174002.703431-1-tiwai%40suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172533.14667-5-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/core/info.c b/sound/core/info.c
index 1f5b8a3d9e3b6..ce5caf28f041b 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -528,6 +528,8 @@ int snd_info_card_register(struct snd_card *card)
void snd_info_card_id_change(struct snd_card *card)
{
guard(mutex)(&info_mutex);
+ if (card->shutdown)
+ return;
if (card->proc_root_link) {
proc_remove(card->proc_root_link);
card->proc_root_link = NULL;
@@ -555,7 +557,6 @@ void snd_info_card_disconnect(struct snd_card *card)
if (card->proc_root)
snd_info_clear_entries(card->proc_root);
card->proc_root_link = NULL;
- card->proc_root = NULL;
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0998/1756] ALSA: hda: Avoid non-operational GPU warning at regular device removal
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (996 preceding siblings ...)
2026-11-18 14:52 ` [PATCH 6.12 0997/1756] ALSA: info: Fix memory leak at card removal Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0999/1756] ALSA: hda/intel: Move firmware loading into the probe work Greg Kroah-Hartman
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 3af4ed9f927c469f23d03a76e3b438ed09715bd3 ]
When a hda-intel driver is removed manually and it has a GPU with
switcheroo, it always gives a warning like "GPU sound probed, but not
operational:..." no matter whether GPU has been actually operational
or not. This warning was originally put for machines that really
suffer from the non-operational GPU HDMI audio, but it's seen at the
common path a normal device removal also goes over.
For avoiding a confusing warning, move the check and the warning at
the error path of azx_probe_continue() that is the point where the
non-functional GPU gets detected and given up.
Fixes: 2b360ba9a493 ("ALSA: hda: intel: Fix Optimus when GPU has no sound")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007171231.8147-1-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_intel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 48fe74ad34124..667eac42a0869 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1371,7 +1371,6 @@ static void azx_free(struct azx *chip)
* actually stop the chip) to allow GPU to suspend via
* vga_switcheroo, and print a warning.
*/
- dev_warn(&pci->dev, "GPU sound probed, but not operational: please add a quirk to driver_denylist\n");
pm_runtime_disable(&pci->dev);
pm_runtime_set_suspended(&pci->dev);
pm_runtime_enable(&pci->dev);
@@ -2412,6 +2411,8 @@ static int azx_probe_continue(struct azx *chip)
out_free:
if (err < 0) {
pci_set_drvdata(pci, NULL);
+ if (hda->vga_switcheroo_registered)
+ dev_warn(&pci->dev, "GPU sound probed, but not operational: please add a quirk to driver_denylist\n");
snd_card_free(chip->card);
return err;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
* [PATCH 6.12 0999/1756] ALSA: hda/intel: Move firmware loading into the probe work
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
` (997 preceding siblings ...)
2026-11-18 14:52 ` [PATCH 6.12 0998/1756] ALSA: hda: Avoid non-operational GPU warning at regular device removal Greg Kroah-Hartman
@ 2026-11-18 14:52 ` Greg Kroah-Hartman
998 siblings, 0 replies; 1614+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-18 14:52 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai, Sasha Levin
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit eb90ae3cca783ebec65704597027811431465de4 ]
The hda-intel driver uses request_firmware_nowait() for loading its
patch, and tries to continue the probe directly from the fw loader
callback. This works in principle, but it has a few drawbacks:
- The driver may be released before the firmware callback completes
- Having two ways of async probe makes the code flow unnecessarily
complex
The former issue is more severe, as it may potentially lead to a UAF,
and there is no explicit way to cancel the pending firmware worker
for now.
This patch changes the firmware loading to be performed rather in the
common probe work without *_nowait(). Then the pending work can be
easily canceled, and the code becomes more straightforward.
A nice bonus is that, by moving into the probe work, the firmware
doesn't need any longer to be cached, hence we can get rid of struct
azx.fw field, and release the firmware immediately after parsing it,
too.
Fixes: 5cb543dba986 ("ALSA: hda - Deferred probing with request_firmware_nowait()")
Link: https://patch.msgid.link/20260415135526.1813126-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stable-dep-of: 7e1ad3c55baa ("ALSA: hda: Don't free card at probe error in vga_switcheroo handler")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/hda/hda_controller.h | 4 ---
sound/pci/hda/hda_intel.c | 58 +++++++++-------------------------
2 files changed, 15 insertions(+), 47 deletions(-)
diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h
index c2d0109866e62..7434f38038a0b 100644
--- a/sound/pci/hda/hda_controller.h
+++ b/sound/pci/hda/hda_controller.h
@@ -127,10 +127,6 @@ struct azx {
unsigned int beep_mode;
bool ctl_dev_id;
-#ifdef CONFIG_SND_HDA_PATCH_LOADER
- const struct firmware *fw;
-#endif
-
/* flags */
int bdl_pos_adj;
unsigned int running:1;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 667eac42a0869..d5142861d2865 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1390,9 +1390,6 @@ static void azx_free(struct azx *chip)
azx_free_streams(chip);
snd_hdac_bus_exit(bus);
-#ifdef CONFIG_SND_HDA_PATCH_LOADER
- release_firmware(chip->fw);
-#endif
display_power(chip, false);
if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT)
@@ -2037,24 +2034,6 @@ static int azx_first_init(struct azx *chip)
return 0;
}
-#ifdef CONFIG_SND_HDA_PATCH_LOADER
-/* callback from request_firmware_nowait() */
-static void azx_firmware_cb(const struct firmware *fw, void *context)
-{
- struct snd_card *card = context;
- struct azx *chip = card->private_data;
-
- if (fw)
- chip->fw = fw;
- else
- dev_err(card->dev, "Cannot load firmware, continue without patching\n");
- if (!chip->disabled) {
- /* continue probing */
- azx_probe_continue(chip);
- }
-}
-#endif
-
static int disable_msi_reset_irq(struct azx *chip)
{
struct hdac_bus *bus = azx_bus(chip);
@@ -2119,7 +2098,6 @@ static int azx_probe(struct pci_dev *pci,
struct snd_card *card;
struct hda_intel *hda;
struct azx *chip;
- bool schedule_probe;
int dev;
int err;
@@ -2224,22 +2202,7 @@ static int azx_probe(struct pci_dev *pci,
chip->disabled = true;
}
- schedule_probe = !chip->disabled;
-
-#ifdef CONFIG_SND_HDA_PATCH_LOADER
- if (patch[dev] && *patch[dev]) {
- dev_info(card->dev, "Applying patch firmware '%s'\n",
- patch[dev]);
- err = request_firmware_nowait(THIS_MODULE, true, patch[dev],
- &pci->dev, GFP_KERNEL, card,
- azx_firmware_cb);
- if (err < 0)
- goto out_free;
- schedule_probe = false; /* continued in azx_firmware_cb() */
- }
-#endif /* CONFIG_SND_HDA_PATCH_LOADER */
-
- if (schedule_probe)
+ if (!chip->disabled)
schedule_delayed_work(&hda->probe_work, 0);
set_bit(dev, probed_devs);
@@ -2368,11 +2331,20 @@ static int azx_probe_continue(struct azx *chip)
}
#ifdef CONFIG_SND_HDA_PATCH_LOADER
- if (chip->fw) {
- err = snd_hda_load_patch(&chip->bus, chip->fw->size,
- chip->fw->data);
- if (err < 0)
- goto out_free;
+ if (patch[dev] && *patch[dev]) {
+ const struct firmware *fw = NULL;
+
+ dev_info(&pci->dev, "Applying patch firmware '%s'\n",
+ patch[dev]);
+ if (request_firmware(&fw, patch[dev], &pci->dev) < 0) {
+ dev_err(&pci->dev,
+ "Cannot load firmware, continue without patching\n");
+ } else {
+ err = snd_hda_load_patch(&chip->bus, fw->size, fw->data);
+ release_firmware(fw);
+ if (err < 0)
+ goto out_free;
+ }
}
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 1614+ messages in thread
end of thread, other threads:[~2026-11-18 19:48 UTC | newest]
Thread overview: 1614+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 14:35 [PATCH 6.12 0000/1756] 6.12.119-rc1 review Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0001/1756] KVM: nSVM: Check validity of vmcs01 save area copied from SMRAM on RSM Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0002/1756] inet: frags: limit the truesize of a reassembly queue Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0003/1756] mm/hugetlb: fix endless write fault on a leftover uffd bit Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0004/1756] 9p/xen: drain response work after unbinding IRQ Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0005/1756] ksmbd: revert fsids on durable reconnect and replay failure Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0006/1756] mm/ksm: fix use of a freed anon_vma at swap-in Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0007/1756] ksmbd: enforce the read-only share flag when creating a stream Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0008/1756] selftests/mm: include kselftest.h in vm_util.h Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0009/1756] PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0010/1756] fbcon: Rebuild rotated font buffer on font change Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0011/1756] mm/memcontrol: fix stuck FLUSHING_CACHED_CHARGE bit on isolated cpus Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0012/1756] drm/amdkfd: Validate the control stack of a restored queue Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0013/1756] btrfs: prevent deleting the wrong subvolume by ID Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0014/1756] ocfs2/cluster: hold a reference on the heartbeat thread Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0015/1756] ocfs2/heartbeat: serialize concurrent writes to a regions dev attribute Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0016/1756] ACPI: utils: Add exclusive AML evaluation helpers Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0017/1756] platform/x86: ideapad-laptop: Evaluate ACPI methods exclusively Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0018/1756] proc: dont let an entry below /proc/<pid>/net be a mountpoint Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0019/1756] wifi: mt76: mt7996: fix PCI device reference leak in mt7996_pci_init_hif2() Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0020/1756] mm/userfaultfd: write-lock the VMA before waking waiters when unregistering Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0021/1756] backing-file: enforce append-only and immutable backing inodes Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0022/1756] mm/userfaultfd: wake waiters when registration modes are removed Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0023/1756] f2fs: fix to update superblock crc in sanity_check_area_boundary() Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0024/1756] hwmon: chipcap2: fix IRQ teardown ordering Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0025/1756] hwmon: chipcap2: disable device after hwmon teardown Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0026/1756] libceph: initialize CRUSH choose argument weights Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0027/1756] ovl: inherit FMODE_NONOTIFY when opening directory realfiles Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0028/1756] mm/memory-tiers: unregister empty tiers outside memory_tier_lock Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0029/1756] mm/vma: update VMA iterator state on error in new VMA merge Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0030/1756] f2fs: fix to fetch ino via ino_of_node() under cache lock Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0031/1756] mm/vma: fix expansion of VMA_MIXEDMAP_BIT VMAs Greg Kroah-Hartman
2026-11-18 14:35 ` [PATCH 6.12 0032/1756] drm/amdgpu: finish GPU recovery callbacks before restarting schedulers Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0033/1756] drm/amdgpu: drop the gang leader reference when freeing gang jobs Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0034/1756] apparmor: fix profile leak when a policy load fails Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0035/1756] mm/ksm: mark migration stores with WRITE_ONCE() Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0036/1756] platform/x86: hp-wmi: Order DMI board name arrays Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0037/1756] platform/x86: hp-wmi: Add OMEN board 8A17 thermal profile support Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0038/1756] inet: frags: bound the wmem charge of the socket completing a reassembly Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0039/1756] io_uring/eventfd: reset deferred signal state Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0040/1756] alpha: select SYSCTL_EXCEPTION_TRACE Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0041/1756] can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0042/1756] ALSA: pcm: Optimize cpu_latency_qos_*() calls Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0043/1756] ALSA: pcm: Prevent O_APPEND open on OSS streams Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0044/1756] tools: linux/types.h: Add 128-bit integer types for arm64 UAPI structures Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0045/1756] khugepaged: fix readahead lock inversion in collapse_file() Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0046/1756] hwmon: (sht15) Remove redundant dev_err() Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0047/1756] hwmon: (sht15) Stop deferred work before releasing its resources Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0048/1756] mm/mremap: fix moving PUD leaves Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0049/1756] mm/mremap: recheck PUDs under the page table lock Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0050/1756] mm: page_alloc: do not give all non-blocking requests reserve access Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0051/1756] drm/amdgpu: cancel idle work in hw_init failure paths for vcn/uvd/vce/jpeg Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0052/1756] drm/amd/display: set allow_freesync before validating a new stream Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0053/1756] hugetlbfs: enforce F_SEAL_EXEC in setattr Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0054/1756] drm/msm/hdmi: Handle msm_hdmi_power_on() errors during .atomic_pre_enable() Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0055/1756] drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0056/1756] hwmon: (coretemp) Set nr_cores only after core_data allocation succeeds Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0057/1756] drm/amd/pm: populate unique ID for smu 13.0.7 Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0058/1756] btrfs: raid56: do not verify the content if there is no data checksum Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0059/1756] ocfs2: validate move extents against a stable EOF Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0060/1756] hwmon: (chipcap2) Switch to guard() for mutext handling Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0061/1756] hwmon: (chipcap2) Drop unnecessary include files Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0062/1756] hwmon: chipcap2: serialize access to the alarm indicators Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0063/1756] hwmon: chipcap2: synchronize ready IRQ state Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0064/1756] ksmbd: do not read past the DACL in the access denied debug message Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0065/1756] cipso: stop modifying live ip_options_rcu Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0066/1756] Revert "x86/mm/pat: Use pr_warn() for early W^X warnings" Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0067/1756] Revert "x86/mm/pat: Fix effective RW computation in lookup_address_in_pgd_attr()" Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0068/1756] mm/vma: avoid spurious write locks when mm->mm_lock_seq overflows Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0069/1756] scsi: target: Move I/O path stats to per CPU Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0070/1756] scsi: target: Fix demo-mode dynamic ACL dev-entry UAF vs LUN teardown Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0071/1756] scsi: target: Fix LUN/device R/W and total command stats Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0072/1756] KVM: arm64: vgic-its: Dont map an LPI from more than one event Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0073/1756] l2tp: snapshot sequencing state when building transmit headers Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0074/1756] mm/hugetlb: fix mremap deadlock when PMD sharing is possible Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0075/1756] mm: fix outdated incorrect code comments for handle_mm_fault() Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0076/1756] mm/memory: update stale locking comments for fault handlers Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0077/1756] mm: fix address wraparound when scanning large folio PTEs Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0078/1756] mm/huge_memory: fix truncate racing with PMD zapping Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0079/1756] fbdev: kyro: Use devm_ioremap() for mmio registers Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0080/1756] fbdev: kyro: Use devm_ioremap_wc() for screen mem Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0081/1756] fbdev: kyro: Release WC setup on registration failure Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0082/1756] hwmon: (coretemp) Fix 32-bit jiffies wraparound in show_temp() Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0083/1756] hwmon: (tmp108) Add helper function tmp108_common_probe() to prepare I3C support Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0084/1756] hwmon: (tmp108) Fix initial conversion delay and wait until ready Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0085/1756] drm/amdgpu: dont walk the CS chunks when allocating them failed Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0086/1756] nvme: tuning pr code by using defined structs and macros Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0087/1756] nvme: unregister when pr_register() is given a zero new key Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0088/1756] mm/vma: dont leak the charge for stack growth Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0089/1756] drm/i915/psr: Clear selective fetch area when duplicating plane state Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0090/1756] mm/hugetlb: dont clear the resv_map of a VMA whose lock is held Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0091/1756] mm/madvise: preserve VMA_SOFTDIRTY_BIT when changing anonymous names Greg Kroah-Hartman
2026-11-18 14:36 ` [PATCH 6.12 0092/1756] mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0093/1756] vhost-scsi: Reduce mem use by moving upages to per queue Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0094/1756] vhost-scsi: zero misaligned I/O bounce pages Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0095/1756] quota: initialize dquot cache before mounting rootfs Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0096/1756] ksmbd: let the owner read and change the DACL when no ACE names it Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0097/1756] mm/userfaultfd: compare exact registration modes before skipping Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0098/1756] apparmor: fix query_data() output overlapping the lookup key Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0099/1756] virtio_blk: use synchronous quiesce in virtblk_freeze_priv() Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0100/1756] mm/filemap: read mapping->a_ops->free_folio under i_lock Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0101/1756] mm/rmap: handle device-exclusive entries in folio_referenced_one() Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0102/1756] fork: take mmap_lock before copying mm_struct Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0103/1756] ASoC: qcom: q6apm: clear g_apm on driver removal Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0104/1756] drm/amdkfd: Map wptr BO to GART unconditionally Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0105/1756] drm/amdkfd: use the queues process info for the WPTR BO eviction fence Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0106/1756] rose: walk the neighbour list under its lock when a device goes down Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0107/1756] rose: hold RTNL while a route is added or deleted Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0108/1756] rose: change the loopback nodes under the neighbour list lock too Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0109/1756] rose: check the length of Restart Request and Diagnostic frames Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0110/1756] rose: keep a socket unbound when connect() fails to autobind it Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0111/1756] rose: refuse an empty message when the Q bit is included Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0112/1756] rose: give loopback answers LCIs that calls cannot be given Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0113/1756] rose: clear the other half of a through route a new call takes over Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0114/1756] rose: disconnect sockets under their lock when a neighbour goes away Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0115/1756] hdlcdrv: close the hardware driver once, and only if it was opened Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0116/1756] mm/shmem: make shmem_file() check the files inode Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0117/1756] drm/i915/display: Add enabled pipe planes into state for selective fetch Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0118/1756] nvmet: reject keep-alive timeouts that would overflow Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0119/1756] drm/amd/display: Minimize wait for pending updates Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0120/1756] drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0121/1756] mm/shmem: fix accounting of swapin-error markers Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0122/1756] mm/cma: accept memory of CMA areas reserved at a fixed address Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0123/1756] ovl: inherit FMODE_NONOTIFY when reading directory layers Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0124/1756] netfilter: flowtable: ensure sufficient headroom in xmit path Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0125/1756] comedi: addi_apci_3xxx: fix subdevice count underallocation Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0126/1756] comedi: dt2811: fix shift-out-of-bounds in IRQ check Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0127/1756] r8169: align RTL8125/RTL8126 PHY config with vendor driver Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0128/1756] xfs: add a flag to convert unwritten extents without allocating blocks Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0129/1756] x86/microcode/AMD: Move the no-revision fixup to get_patch_level() Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0130/1756] fs/stat.c: avoid harmless garbage value problem in vfs_statx_path() Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0131/1756] drm/komeda: Fix bits parsing of GLB_CORE_ID Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0132/1756] accel/qaic: reject BO sizes that overflow page count Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0133/1756] drm/panfrost: Prevent division by 0 Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0134/1756] bpf: Mark dentry->d_inode as trusted_or_null Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0135/1756] bpf: sched_ext: Mark ops argument container pointer fields as trusted Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0136/1756] drm/omap: dsi: avoid sending bta sync all the time in writes Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0137/1756] drm: of: Fix drm_of_get_data_lanes_count_ep() return value documentation Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0138/1756] libbpf: Improve log message formatting Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0139/1756] libbpf: Support BTF.ext loading and output in either endianness Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0140/1756] libbpf: Avoid overflow in BTF.ext bounds check Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0141/1756] selftests/bpf: Allocate a larger timeout for connection Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0142/1756] drm/panthor: Take reqs_lock in soft_reset for clearing pending_reqs Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0143/1756] gpio: pcf857x: use new GPIO line value setter callbacks Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0144/1756] gpio: pcf857x: implement get_direction() Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0145/1756] bpftool: Fix spurious batch file read error Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0146/1756] regulator: fixed: reject incompatible platform devices Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0147/1756] spi: sh-msiof: SITMDR1/SIRMDR1 bitfield conversion Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0148/1756] spi: sh-msiof: propagate setup runtime-PM errors Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0149/1756] iio: humidity: hts221: report available values via read_avail() Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0150/1756] dt-bindings: iio: light: ltr501: Sort compatible enum array Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0151/1756] dt-bindings: iio: light: ltr501: Add missing ltr303 compatible Greg Kroah-Hartman
2026-11-18 14:37 ` [PATCH 6.12 0152/1756] iio: temperature: tmp117: fix calibbias cache update on I2C write failure Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0153/1756] iio: pressure: rohm-bm1390: Fix AVE_NUM initialization Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0154/1756] ata: pata_parport: Fix use-after-free in new_device_store Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0155/1756] ARM: dts: helios4: fix lm75 supply name Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0156/1756] ARM: dts: armada-385-clearfog-gtr: fix vmmc property name Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0157/1756] ARM: dts: armada-395-gp: drop unsupported SDHCI clock-frequency Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0158/1756] ARM: dts: armada-388-helios4: fix vmmc property name Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0159/1756] ARM: dts: helios4: fix vbus-supply for USB2 PHY Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0160/1756] ARM: dts: helios4: fix spi1 location Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0161/1756] kexec_file: stop the top-down search before it underflows Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0162/1756] perf jitdump: Fix extended header read that always fails Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0163/1756] perf jitdump: Fix debug_data and unwinding_data leaks Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0164/1756] perf jitdump: Validate code_size against total_size in code load Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0165/1756] perf jitdump: Prevent integer underflow in debug info size calculation Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0166/1756] perf jitdump: Bounds-check debug entry byte-swap loop Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0167/1756] perf jitdump: Check snprintf return before computing header size Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0168/1756] perf jitdump: Fix funlockfile on unlocked stream in jit_open() error path Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0169/1756] perf python: Constify variables and parameters Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0170/1756] perf sample: Make user_regs and intr_regs optional Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0171/1756] perf jitdump: Free event in jit_repipe_code_move() Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0172/1756] perf: replace strcpy() with strncpy() in util/jitdump.c Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0173/1756] perf jitdump: Use dirname() return value in jit_open() Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0174/1756] perf jitdump: Validate debug entries on native (non-swap) path Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0175/1756] perf jitdump: Validate sym string NUL-termination in code load Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0176/1756] perf jitdump: Validate unwinding sizes against record payload Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0177/1756] remoteproc: qcom_q6v5_adsp: Fix double jiffies conversion in adsp_start() Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0178/1756] arm64: dts: qcom: sdm845-sony-xperia-tama: Fix Bluetooth UART pinctrl Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0179/1756] remoteproc: xlnx: Initialize mailbox work before requesting channels Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0180/1756] lsm: dont call security_backing_file_free() multiple times Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0181/1756] ASoC: wcd-mbhc-v2: Fix incorrect properties names and typos Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0182/1756] pwm: renesas-tpu: Fix runtime PM reference leak Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0183/1756] spi: omap2-mcspi: Remove unbalanced pm_runtime_put_sync() calls Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0184/1756] soc: qcom: apr: clean up failed service registrations Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0185/1756] platform/chrome: cros_ec_proto: Fix deferred response Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0186/1756] staging: rtl8723bs: change remaining printk to proper api Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0187/1756] staging: rtl8723bs: remove return from void function Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0188/1756] staging: rtl8723bs: remove wrapper rtw_init_recv_timer Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0189/1756] staging: rtl8723bs: move rtw_recv_indicatepkt to rtw_recv.c Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0190/1756] staging: rtl8723bs: remove unused private debug counters Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0191/1756] staging: rtl8723bs: disable SDIO function on block size failure Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0192/1756] staging: octeon: schedule the TX cleanup tasklet every 1024th packet Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0193/1756] clk: fix self-consuming provider module pinning Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0194/1756] microblaze: CCF: fix refcount leak Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0195/1756] microblaze: prevent ptrace writes to MSR and pt_mode Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0196/1756] soundwire: intel: initialise quirk_mask before reading it Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0197/1756] arm64: dts: rockchip: Correct Device Orientation on Gameforce Ace Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0198/1756] wifi: rtw88: debugfs: dont vzalloc(0) when rsvd_page is read unconfigured Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0199/1756] sched_ext/scx_flatcg: Make cgv_node_less() wraparound-safe Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0200/1756] fuse: fall back to copy_splice_read() on FOPEN_DIRECT_IO Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0201/1756] dlm: validate lock modes in recovery messages Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0202/1756] dlm: fix NULL pointer dereference in dlm_dump_rsb_name() Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0203/1756] dlm: fix buffer overflow from negative len in dlm_search_rsb_tree Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0204/1756] dlm: fix variable key length lookup Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0205/1756] remoteproc: imx_dsp_rproc: Add support of recovery and coredump process Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0206/1756] remoteproc: imx_dsp_rproc: Drop extra space Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0207/1756] remoteproc: imx_dsp: Acquire runtime PM before adding carveouts Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0208/1756] arm64: dts: imx95: Avoid 32-bit PCIe window System RAM overlap Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0209/1756] x86/crash: Reserve elfcorehdr for CONFIG_NR_CPUS, not CONFIG_NR_CPUS_DEFAULT Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0210/1756] bpftool: Set BPF_F_XDP_DEV_BOUND_ONLY flag non-destructively Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0211/1756] PCI: endpoint: pci-epf-vntb: Pass PF/VF number when BAR programming Greg Kroah-Hartman
2026-11-18 14:38 ` [PATCH 6.12 0212/1756] dmaengine: fsl_raid: dont invoke client callback under desc_lock Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0213/1756] dmaengine: fsl_raid: avoid free_q underflow in free_chan_resources Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0214/1756] RDMA/hns: Fix missing CQE when UD QP use different SL Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0215/1756] clk: Use the generic OF phandle parsing in only one place Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0216/1756] wifi: ath11k: disable interrupts during firmware crash recovery Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0217/1756] wifi: ath11k: fix sporadic WLAN initialization failures Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0218/1756] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0219/1756] wifi: mac80211: fix unauthorised port check for encap offload Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0220/1756] wifi: mac80211: fix key selection for encap offload frames Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0221/1756] wifi: mac80211: dont send encap offload frames unencrypted Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0222/1756] wifi: mac80211: drop encap offload frames with a tainted key Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0223/1756] wifi: free SKBTX_WIFI_STATUS skb tx_flags flag Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0224/1756] wifi: check if socket flags are valid Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0225/1756] wifi: mac80211: fix IEEE80211_TX_CTL_REQ_TX_STATUS mixup Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0226/1756] wifi: wfx: fix possible device hang during init Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0227/1756] hwrng: cctrng - Fix runtime PM usage counter leak Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0228/1756] crypto: asymmetric_keys - fix OOB read in pefile_parse_binary Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0229/1756] wifi: mac80211: fix swapped fq_overlimit/fq_overmemory in aqm debugfs Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0230/1756] irqchip/riscv-imsic: Use GENMASK for base address masks Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0231/1756] memory: brcmstb_dpfe: validate firmware section sizes Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0232/1756] arm64: dts: ti: k3-j722s-evm: Enable PMIC Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0233/1756] arm64: dts: ti: j722s-evm: Add MUX to control CSI2RX Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0234/1756] arm64: dts: ti: k3-j722s-evm: Add bootph-all property to enable Ethernet boot Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0235/1756] arm64: dts: ti: k3-j722s-evm: Switch audio codec clock from audio_refclk1 to external clock Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0236/1756] selftests/bpf: More precise cpu_mitigations state detection Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0237/1756] selftests/bpf: make cmdline_contains stricter Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0238/1756] regulator: mp886x: fix vsel_mask Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0239/1756] efi/cper: Reject CPER records with an out-of-range error_data_length Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0240/1756] efi/cper: Reject an error status block length that wraps a u32 Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0241/1756] ACPI: extlog: Validate elog record length before walking sections Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0242/1756] ACPI: APEI: GHES: Bound CXL event record copy to the firmware section length Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0243/1756] efi/cper: Read only validated fields in cper_mem_err_pack() Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0244/1756] spi: mtk-nor: fix runtime PM usage count leak in probe error path Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0245/1756] remoteproc: imx_rproc: Allow mappings ending at region boundary Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0246/1756] perf trace: Fix error checking in btf_struct_scnprintf() Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0247/1756] perf evsel: Validate branch stack before byte swapping Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0248/1756] perf evsel: Validate RAW sample " Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0249/1756] RDMA/irdma: Preserve fast-registration IOVA on 32-bit Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0250/1756] gpio: crystalcove: add missing MODULE_ALIAS() Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0251/1756] drivers/base/node: fix UAF on device_register() failure Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0252/1756] irqchip/gic-v3-its: Dont WARN on LPI free allocation failure Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0253/1756] ASoC: es8326: report resume restore errors Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0254/1756] virtio_ccw: fix synchronize_cbs() after interrupt fallback Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0255/1756] virtio_ccw: always take irq_lock in the classic interrupt handler Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0256/1756] pwm: mtk-disp: Fix period readback Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0257/1756] mac80211: tx: Use info->flags in ieee80211_tx_h_select_key() Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0258/1756] ASoC: mediatek: mt8186: Fix APLL mux setting error handling Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0259/1756] ASoC: mediatek: mt8186: Fix clock handling in mux disable path Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0260/1756] ASoC: mediatek: mt8186: Fix AFE clock error handling Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0261/1756] ASoC: mediatek: mt8186: Fix APLL enable " Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0262/1756] ASoC: mediatek: mt8186: Fix MCK " Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0263/1756] ASoC: mediatek: mt6797: fix wrong unwind order and error code in enable_clock Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0264/1756] pwm: lp3943: fix NULL pointer dereference for an unconfigured channel Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0265/1756] selftests/sched_ext: Handle CPU hotplug write failures Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0266/1756] EDAC/i10nm: Fix Granite Rapids ADXL MC mapping Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0267/1756] perf btf: Make the sigtrap test helper to find a member by name widely available Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0268/1756] perf bpf: Fix up build failure due to change of btf_vlen() return type Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0269/1756] perf trace: Enhance BTF type formatting to symbolise kernel function pointers Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0270/1756] perf trace: Add upper bound checks for augmented BTF struct printing Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0271/1756] mtd: spinand: Fix spinand_manufacturer_ops kernel-doc Greg Kroah-Hartman
2026-11-18 14:39 ` [PATCH 6.12 0272/1756] dmaengine: sun6i-dma: Fix use-after-free in error handling paths Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0273/1756] dmaengine: at_hdmac: Fix use-after-free by proper tasklet cleanup Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0274/1756] dmaengine: mediatek: hsdma: fix runtime PM leak on init failure Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0275/1756] dmaengine: img-mdc: Fix runtime PM usage counter leak Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0276/1756] dmaengine: zynqmp_dma: Fix chan probe/remove error handling Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0277/1756] dmaengine: dw-axi-dmac: convert clock handling to clk_bulk API Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0278/1756] dmaengine: xilinx_dma: Fix MCDMA descriptor fields based on DMA direction Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0279/1756] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0280/1756] dmaengine: zynqmp_dma: drop redundant label Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0281/1756] ACPI: button: Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020) RZ09-0310 Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0282/1756] ACPI: PM: Drop parent state update from acpi_device_get_power() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0283/1756] ACPI: PCI: Introduce acpi_dev_get_pci_dev() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0284/1756] ACPI: scan: Stop calling acpi_bus_init_power() early Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0285/1756] ACPI: utils: Adjust message printing macros for ACPI objects Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0286/1756] wifi: ath11k: modify null check logic in ath11k_ce_rx_post_pipe() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0287/1756] wifi: ath11k: fix locking problem in ath11k_dp_rx_tid_del_func() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0288/1756] wifi: ath12k: Free allocated CE IRQs on request_irq() failure Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0289/1756] wifi: ath12k: Free allocated external " Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0290/1756] selftests: net: csum: Clean up recv_verify_packet_ipv6 Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0291/1756] selftests: net: csum: filter packets by source address and port Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0292/1756] power: supply: mp2629: Use the full batt_impedance_compensation name in the ABI document Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0293/1756] power: supply: mm8013: Publish the OF module alias Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0294/1756] PM: wakeup: implement devm_device_init_wakeup() helper Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0295/1756] PM: sleep: wakeirq: Introduce device-managed variant of dev_pm_set_wake_irq() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0296/1756] power: supply: bq24190_charger: use the wake irq API Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0297/1756] power: supply: bq2515x: Propagate charge-enable read errors Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0298/1756] scsi: mpi3mr: Fix buffer overflow in BSG passthrough request copy Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0299/1756] scsi: mpi3mr: Fix out-of-bounds read when copying BSG MPI requests Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0300/1756] scsi: mpi3mr: Fix I/O block counter leak on admin request post failure Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0301/1756] scsi: mpi3mr: Fix target device reference leak in BSG task management Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0302/1756] scsi: mpi3mr: Fix buffer overflow when caching log data Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0303/1756] scsi: mpi3mr: Fix out-of-bounds reply frame access Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0304/1756] scsi: mpi3mr: Fix out-of-bounds sense buffer access Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0305/1756] scsi: mpi3mr: Fix out-of-bounds bitmap access during device removal Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0306/1756] scsi: mpi3mr: Fix target device reference leak in device removal handshake Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0307/1756] scsi: mpi3mr: Fix out-of-bounds read in SAS topology change events Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0308/1756] scsi: mpi3mr: Event processing debug improvement Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0309/1756] scsi: mpi3mr: Fix device loss during enclosure reboot due to zero link speed Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0310/1756] scsi: mpi3mr: Rename log data save helper to reflect threaded/BH context Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0311/1756] scsi: mpi3mr: Fix out-of-bounds read of event data Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0312/1756] scsi: mpi3mr: Fix out-of-bounds phy array access on link change Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0313/1756] scsi: mpi3mr: Fix buffer overflow in the BSG target device map Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0314/1756] scsi: mpi3mr: Fix out-of-bounds read in PCIe topology change events Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0315/1756] scsi: mpi3mr: zero out diagnostic buffer status memory Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0316/1756] scsi: mpi3mr: Fix use-after-free of the firmware event workqueue Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0317/1756] scsi: mpi3mr: Fix NULL pointer dereference on PCI error recovery Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0318/1756] iio: accel: kionix-kx022a: Fix IPOL macro name Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0319/1756] iio: imu: adis16400: Check return value of spi_setup() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0320/1756] efi/libstub: Fix efi_set_event_at() parameter documentation Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0321/1756] kernfs: fix up the unlocked attribute reads on the creation paths Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0322/1756] PCI: xgene: Use managed clock for PCIe controller Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0323/1756] RDMA/hns: Limit gmv_entry_num to avoid memory waste Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0324/1756] RDMA/hns: Fix GID capacity loss in 64K system Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0325/1756] usb: image: microtek: stop SG processing after transfer errors Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0326/1756] USB: usbmon: fix null-ptr-deref in mon_bus_remove() when mon_bus_init() fails Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0327/1756] USB: pci-quirks: Release EHCI device reference Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0328/1756] usb-storage: alauda: do not do DMA from the stack Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0329/1756] usb-storage: alauda: check the return value of alauda_read_map() Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0330/1756] usb-storage: alauda: fix out-of-bounds zone index Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0331/1756] usb: musb: da8xx: depopulate OF children on remove Greg Kroah-Hartman
2026-11-18 14:40 ` [PATCH 6.12 0332/1756] usb: musb: da8xx: depopulate OF children on probe failure Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0333/1756] dmaengine: sprd: use clk_bulk API to fix clock imbalance Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0334/1756] firmware: arm_scmi: Protect xfer->async_done with xfer->lock Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0335/1756] firmware: arm_scmi: Dont reuse raw xfers with async_done still armed Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0336/1756] usb: gadget: composite: avoid warning on aborted delayed status Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0337/1756] usb: gadget: f_mass_storage: ignore class requests while inactive Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0338/1756] dmaengine: fsl_raid: zero CF descriptor pool allocations Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0339/1756] dmaengine: dw-axi-dmac: Fix AXI burst length encoding Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0340/1756] dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0341/1756] dmaengine: dw-axi-dmac: Fix CH_CFG2 channel priority position Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0342/1756] PCI: endpoint: pci-epf-vntb: Serialize virtual PCI bus scan Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0343/1756] regulator: ab8500: Fix AB8505 VANA voltage selectors Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0344/1756] regulator: ab8500: Remove stale expand_register kernel-doc entry Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0345/1756] regulator: ab8500: Add AB8505 VAUX3 3.05 V setting Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0346/1756] regulator: ab8500: Handle AB8505 VINTCORE selector 7 Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0347/1756] regulator: ab8500: Treat cut 1.0 VAUX3 as fixed Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0348/1756] regulator: ab8500: Test dedicated enable bits only Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0349/1756] regulator: ab8500: Propagate mode enable read errors Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0350/1756] arm64: dts: qcom: sm7225-fairphone-fp4: Disable PMK8350 PON Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0351/1756] sit: fix UAF in ipip6_tunnel_del_prl() Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0352/1756] ip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setup Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0353/1756] crypto: amlogic - Fix DMA memory leak in cipher error path Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0354/1756] crypto: qat - avoid OOB read when stripping RSA leading zeros Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0355/1756] crypto: qat - release instance on DH fallback allocation failure Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0356/1756] crypto: mxs-dcp - handle zero-length skcipher requests Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0357/1756] crypto: lskcipher - preserve state across unaligned chunks Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0358/1756] memory: exynos5422-dmc: handle clock enable failures Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0359/1756] gfs2: Fix journaled truncate range end offset Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0360/1756] ACPI: glue: Fix up and adjust acpi_unbind_one() Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0361/1756] thermal: gov_power_allocator: Fix NULL pointer dereference in update_tz() Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0362/1756] firewire: cdev: Fix FW_CDEV_IOC_CREATE_ISO_CONTEXT references in kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0363/1756] firewire: core: remove unused link field in fw_packet structure Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0364/1756] cpuidle: menu: Remove incorrect unlikely() annotation Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0365/1756] cpuidle: menu: Remove single state handling Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0366/1756] cpuidle: menu: Do not return a disabled idle state Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0367/1756] ARM: dts: stm32: lxa-mc1: change stdout-path baud rate from 9600 to 115200 Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0368/1756] ARM: dts: stm32: lxa-tac: " Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0369/1756] ARM: dts: stm32: add LTDC / DCMIPP access controller for STM32MP135 Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0370/1756] cpuidle: teo: Do not return a disabled idle state Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0371/1756] PM: runtime: Only queue an idle check for RPM-linked suppliers Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0372/1756] ARM: dts: stm32: Drop bias-disable from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0373/1756] HID: i2c-hid: Unfollow the panel on shutdown Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0374/1756] bpf: Fix program BTF use-after-free in sleepable programs Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0375/1756] ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0376/1756] x86/svm: Avoid sign extension of SVM_EVTINJ_VALID in 64-bit expressions Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0377/1756] clk: mediatek: reset: Fix device registration kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0378/1756] clk: rs9: Add clock index range check to rs9_of_clk_get() Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0379/1756] clk: s2mps11: Propagate OF provider registration failures Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0380/1756] spi: Fix the return value in spi_new_ancillary_device() kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0381/1756] ata: libata-scsi: Fix ata_scsi_hotplug() reference in kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0382/1756] gfs2: Fix the return value in gfs2_get_link() kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0383/1756] virtio: synchronize callbacks after device reset Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0384/1756] virtio_pci_modern: move avq cleanup from reset to del_vqs Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0385/1756] ALSA: control: Fix virtual master creation reference in kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0386/1756] ACPI: fan: Fix memory leak due to leftover devm_kcalloc() argument Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0387/1756] ACPI: video: Fix backlight unregistration ordering Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0388/1756] perf header: Fix potential memory corruption in cpu_cache_level__read Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0389/1756] regulator: qcom-rpmh: Fix the return value in rpmh_regulator_vrm_get_optimum_mode() kernel-doc Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0390/1756] libbpf: Support opening bpf objects of either endianness Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0391/1756] libbpf: fix log level propagation for light skeleton loaders Greg Kroah-Hartman
2026-11-18 14:41 ` [PATCH 6.12 0392/1756] fs/ntfs3: take run_lock when freeing offs_folio in ni_decompress_file Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0393/1756] fs/ntfs3: update ctime only on successful setxattr Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0394/1756] ntfs: Do not kmap page cache pages for compression Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0395/1756] fs/ntfs3: zero frame pages on read error Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0396/1756] pinctrl: amd: Add PM debugging message for turning on/off wakes Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0397/1756] pinctrl: amd: Dont access irq_datas hwirq member directly Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0398/1756] pinctrl: amd: add timeout to irq-enable readback Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0399/1756] microblaze: uaccess: Zero out destination on failed get_user() Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0400/1756] microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0401/1756] arm64: pi: Run the source checker on the libfdt objects under C=2 Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0402/1756] wifi: mac80211: Fix the return value in mesh_path_add() kernel-doc Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0403/1756] wifi: mac80211: dont reset the TXQ scheduling round number Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0404/1756] mtd: spi-nor: spansion: Remove s25fs256s0 Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0405/1756] wifi: wfx: fix use-after-free of the cooling work on device removal Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0406/1756] f2fs: quota: fix stale lock holder on remount failure Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0407/1756] firmware: imx: dsp: fix mailbox channel leak on kasprintf failure Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0408/1756] phy: hisilicon: hi3670: Fix OF node and device reference leaks Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0409/1756] phy: cadence: Sierra: Do not modify register when getting parent clock Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0410/1756] memory: emif: fix device_node reference leak on np_ddr Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0411/1756] RDMA/rxe: Use validated num_sge in local buffer Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0412/1756] RDMA/uverbs: Make CQ handle mandatory for WQ creation Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0413/1756] media: i2c: ar0521: remove duplicate media entity cleanup Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0414/1756] block: Fix the thaw_bdev reference in bdev_freeze() kernel-doc Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0415/1756] remoteproc: core: Set trace buffer name for diagnostics Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0416/1756] dmaengine: mv_xor: kill tasklet on channel add error path Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0417/1756] loadpin: Fix stale KEXEC_VERIFY_SIG reference in documentation Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0418/1756] wifi: rtw88: sdio: zero the padding added to a TX transfer Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0419/1756] ntfs3: fix out-of-bounds read in ntfs_read_mft() Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0420/1756] mm/gup_test: reject wrapped user ranges Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0421/1756] mm/gup_test: safely calculate GUP batch size Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0422/1756] mm/gup_test: report actual pinned bytes Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0423/1756] arm64: dts: mediatek: mt8173: Fix MFG_ASYNC power domain clock Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0424/1756] ACPI: tables: handle failed initrd override mappings Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0425/1756] cxl/hdm: Reject switch decoder interleave ways that overflow targets Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0426/1756] cxl: Add a cached copy of target_map to cxl_decoder Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0427/1756] cxl/hdm: Make switch decoder target parsing endian-safe Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0428/1756] pinctrl: stm32: Declare stm32_pmx_get_mode() as static Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0429/1756] pinctrl: stm32: Allow compile as module for stm32mp257 Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0430/1756] pinctrl: stm32: Drop the nonexistent CONFIG_MACH_STM32MP25 from the STM32MP257 default Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0431/1756] ASoC: SOF: imx: Prevent stack OOB read in DSP panic dump Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0432/1756] scsi: pm8001: Fix SATA FIS offset in struct hw_event_resp Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0433/1756] staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0434/1756] md/raid10: fix missing wakeup in wait_barrier_nolock Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0435/1756] md: reject v0.90 arrays with too many devices Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0436/1756] md/raid5: dont BUG() on an inconsistent reshape state from the superblock Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0437/1756] md/raid5: reject raid4/5 arrays with too few disks Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0438/1756] md/raid5: setup_conf: Fix null-ptr-def in error handling path Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0439/1756] md/raid5: reject a per-device size smaller than one chunk Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0440/1756] clk: si521xx: correct the SI52147 OF output enable map Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0441/1756] clk: milbeaut: Return divider update timeouts Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0442/1756] drm/amd/pm: bound SCLK FCW range entries to the table size Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0443/1756] drm/amdgpu: Add vbios build number interface Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0444/1756] drm/amd: Add correct prefix for VBIOS message Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0445/1756] drm/amdgpu: Print full vbios info Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0446/1756] drm/amdgpu: bounds check ATOM IIO table parsing Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0447/1756] drm/amdgpu/atom: bound the VBIOS date, part number, version and build getters Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0448/1756] ata: sata_dwc_460ex: Dont enable interrupt if libATA core registration fails Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0449/1756] libbpf: Reject local struct_ops bitfields before data access Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0450/1756] Revert "rcu/nocb: Fix rcuog wake-up from offline softirq" Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0451/1756] rcu/nocb: Remove unnecessary WakeOvfIsDeferred wake path Greg Kroah-Hartman
2026-11-18 14:42 ` [PATCH 6.12 0452/1756] rcu: fix shrink budget underflow in lazy_rcu_shrink_scan Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0453/1756] PCI: dra7xx: Remove device links to PHY Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0454/1756] PCI: dra7xx: Fix clock enable leak on probe failure Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0455/1756] kconfig: fix extra output from savedefconfig on out-of-range defaults Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0456/1756] cxl/pci: Skip reset detection for DVSEC emulated decoders Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0457/1756] cxl/port: Fix uninitialized coordinates reported for RCDs Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0458/1756] crypto: qat - fix active_devs leak on crypto alg registration failure Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0459/1756] crypto: atmel-sha - reject initialization without a device Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0460/1756] interconnect: exynos: Remove the PM QoS request on unbind Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0461/1756] interconnect: qcom: icc-rpm: Handle icc_link_create() failures Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0462/1756] interconnect: qcom: use 64-bit SMD RPM bus votes Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0463/1756] RDMA/core: Fix swapped list_add_tail() arguments in ib_add_sub_device() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0464/1756] RDMA/restrack: Dont set RESTRACK_DD mark after a failed xa_insert() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0465/1756] RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0466/1756] ACPI: CPPC: Validate the _CPC package header Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0467/1756] spi: mxic: fix ps_clk leak in runtime resume Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0468/1756] ACPI: HMAT: preserve hmat_adist_nb notifier block Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0469/1756] dt-bindings: vendor-prefixes: add ESS Technology Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0470/1756] clk: raspberrypi: Handle cpufreq device registration failure Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0471/1756] clk: versatile: clk-icst: Fix node reference leak in of_syscon_icst_setup() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0472/1756] clk: starfive: jh7110: reject oscillator lookup errors Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0473/1756] bpf, lsm: Reject writes into the BPF LSM program context Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0474/1756] pinctrl: fix PINCTRL_SPPCTL=m Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0475/1756] fs/ntfs3: check INDEX_ROOT resident size before use in ntfs_read_mft() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0476/1756] fs/ntfs3: fix valid_size not being updated in attr_allocate_frame() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0477/1756] fs/ntfs3: validate EA entry layout against ef->size in ntfs_read_ea Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0478/1756] fs/ntfs3: validate $SDH entry size in ntfs_insert_security Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0479/1756] pmdomain: imx: Propagate SCU provider registration failures Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0480/1756] dt-bindings: vendor-prefixes: add vendor prefix for Nexperia B.V Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0481/1756] bpftool: Using the right format specifiers Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0482/1756] bpftool: Make skeleton C++ compatible with explicit casts Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0483/1756] bpftool: Generate skeleton for global percpu data Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0484/1756] bpftool: Compute map size of light skeletons at runtime Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0485/1756] pstore: dont leave an ERR_PTR in the ramoops zone pointer Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0486/1756] pstore: reject persistent RAM zones too small for the buffer header Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0487/1756] KMSAN: fix memset() when using fortify-source, again Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0488/1756] md/raid5: give the io_unit slab caches per-array names Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0489/1756] leds: lp8860: Fix device_node leak in lp8860_probe() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0490/1756] leds: pca9532: Check i2c_smbus_read_byte_data() return value Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0491/1756] perf test: Fix a leaked map reference in the arch dwarf unwind tests Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0492/1756] perf build: Check the version of the compiler that is used Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0493/1756] leds: lm3692x: Fix regulator/gpio leak and wrong enabled state on last write failure Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0494/1756] perf annotate-data: Show the sample count in the data-type browser Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0495/1756] RDMA/core: Fix partial copy of IPv6 flow_lbl in LAG hash skb Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0496/1756] RDMA/irdma: Fix erroneous -ENOMEM for large MR registration Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0497/1756] leds: flash: Prevent using uninitialized variable in flash_fault_show() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0498/1756] regulator: mp886x: check get_voltage_sel() return value Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0499/1756] regulator: mp886x: fix pontential division by zero Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0500/1756] arm64: dts: ti: k3-am62-verdin: fix main_gpio0/main_gpio1 line names size Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0501/1756] RDMA/irdma: Use kvzalloc for lvl2 leafmem allocation Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0502/1756] ata: pata_parport: fix parport attach idr_alloc for Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0503/1756] ASoC: amd: acp-es8336: Switch to use acpi_bus_get_primary_device() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0504/1756] ASoC: amd: acp3x-es83xx: " Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0505/1756] wifi: rtl8xxxu: free RX skb when URB submission fails Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0506/1756] RDMA/cxgb4: Fix neigh reference leak in rx_pkt() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0507/1756] RDMA/cxgb4: Fix skb " Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0508/1756] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0509/1756] RDMA/siw: Fix qp use-after-free in siw_get_base_qp() Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0510/1756] hwrng: starfive - propagate clock and reset errors Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0511/1756] crypto: starfive - handle clock enable failures Greg Kroah-Hartman
2026-11-18 14:43 ` [PATCH 6.12 0512/1756] crypto: starfive - propagate clock and reset errors Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0513/1756] crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0514/1756] crypto: ccp - kill v3 IRQ tasklet during teardown Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0515/1756] crypto: ccp - kill v5 " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0516/1756] RDMA/mlx5: Guard steering anchor resource destruction on create error Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0517/1756] swim: Assert strobe with stable outputs Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0518/1756] swim: Select appropriate drive once only Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0519/1756] swim: Enable the drive when probing Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0520/1756] swim: Dont disable drive after every sector Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0521/1756] swim: Perform ISM/IWM mode switching according to specs Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0522/1756] swim: Configure parameter memory Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0523/1756] swim: Refactor SWIM setup Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0524/1756] swim: Enable clock divider only where appropriate Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0525/1756] swim: Dont start motor until medium is present Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0526/1756] swim: Recalibrate when drive is probed Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0527/1756] swim: Add track zero recalibration delay Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0528/1756] swim: Handle FIFO timeout error Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0529/1756] swim: Check for CRC errors Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0530/1756] swim: Simplify return value initialization Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0531/1756] swim: Check error register during sector read Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0532/1756] swim: Dont use the mark register to read data Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0533/1756] swim: Fix buffer overflow Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0534/1756] block: remove BLK_MQ_F_SHOULD_MERGE Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0535/1756] swim: Convert to blocking queue Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0536/1756] swim: Remove redundant RELAX actions Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0537/1756] swim: Deduplicate polling loops Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0538/1756] swim: Check drive ready bit Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0539/1756] swim: Revisit delays Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0540/1756] swim: Dont search beyond the first data mark Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0541/1756] media: i2c: ov5648: Fix a data race on state->streaming Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0542/1756] serial: msm: select PM_OPP Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0543/1756] serial: Switch back to struct platform_driver::remove() Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0544/1756] serial: txx9: Drop noop probe function and dangerous remove callback Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0545/1756] serial: 8250_uniphier: Use devm_clk_get_enabled() Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0546/1756] serial: sifive: fix off-by-one in console port bounds check Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0547/1756] ARM: dts: ux500: Convert HREF audio to audio-graph-card2 Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0548/1756] dt-bindings: vendor-prefixes: add Free Mobile Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0549/1756] clk: qcom: dispcc-sm8450: Fix disp_cc_mdss_mdp_clk_src ops Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0550/1756] clk: qcom: alpha-pll: Check Lucid Ole PLL status before configuring Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0551/1756] tools/nolibc: fix WIFSIGNALED() for status 0 Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0552/1756] bpftool: Fix CPU IDs in per-CPU map output Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0553/1756] iommufd: Fix iommufd_hw_capabilities reference in kernel-doc Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0554/1756] ext2: drain in-flight DIO before buffered write fallback Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0555/1756] mfd: rk8xx: Register poweroff handler in atomic phase Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0556/1756] mfd: intel_quark_i2c_gpio: Manage the fixed-rate clock Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0557/1756] mfd: da9150: Balance IRQ wake on teardown Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0558/1756] kconfig: warn about malformed KCONFIG_PROBABILITY values Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0559/1756] ASoC: fsl_asrc: use regmap_write_bits to update clock source registers Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0560/1756] perf mem: Fix size tracking for mem_lvls in perf_script__meminfo_scnprintf() Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0561/1756] NFS: use TCP for MOUNT when xprtsec= selects TLS Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0562/1756] bpf: Adjust bpf_func to account for CFI offset in bpf_jit_free on riscv Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0563/1756] ASoC: fsl_asrc: check the second front-end DMA channel Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0564/1756] ASoC: adau17x1: return cache sync errors from resume Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0565/1756] ASoC: ak4642: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0566/1756] ASoC: es8316: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0567/1756] ASoC: nau8540: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0568/1756] ASoC: rt1011: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0569/1756] ASoC: rt1016: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0570/1756] ASoC: rt1305: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0571/1756] ASoC: rt1308: " Greg Kroah-Hartman
2026-11-18 14:44 ` [PATCH 6.12 0572/1756] ASoC: rt1318: " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0573/1756] ASoC: rt5616: " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0574/1756] ASoC: rt5659: " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0575/1756] ASoC: rt5660: " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0576/1756] ASoC: rt5665: " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0577/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle tuner clock enable errors Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0578/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate regmap update errors Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0579/1756] ASoC: mediatek: mt8188: mt8188-afe-clk: Handle clock enable errors Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0580/1756] ASoC: mediatek: mt8188: mt8188-afe-pcm: Handle runtime resume errors Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0581/1756] iio: accel: bma220: publish the SPI driver ACPI alias Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0582/1756] dt-bindings: arm: mediatek: Fix MT6779 audsys compatible Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0583/1756] powerpc/ftrace: Dont restore r13 during ftrace_regs_caller Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0584/1756] arm64: dts: qcom: x1e80100-yoga-slim7x: Mark the EC reset gpio as reserved Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0585/1756] arm64: dts: qcom: x1e80100-qcp: " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0586/1756] dt-bindings: vendor-prefixes: Add General Mobile Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0587/1756] perf c2c: Fix documented default coalesce fields Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0588/1756] mtd: block: prevent reclaim I/O during request processing Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0589/1756] wifi: ath11k: fix reg_info_store leak in ath11k_service_ready_ext_event() Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0590/1756] writeback: size foreign flushes by target wb dirty pages Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0591/1756] ACPICA: Fix memory leak in acpi_ds_create_field() Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0592/1756] ACPICA: Fix PCC OperationRegion command offsets Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0593/1756] perf annotate-data: Resolve type DIEs in the debug file they came from Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0594/1756] ACPI: PCC: Simplify PCC shared memory region handling Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0595/1756] ACPI: PCC: Preserve shared memory signature in OpRegion handler Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0596/1756] ASoC: mediatek: mt8183: Fix wrong clock cleanup on clk_set_parent() failure Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0597/1756] ASoC: mediatek: mt8183: Fix clock handling in mux disable path Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0598/1756] ASoC: mediatek: mt8183: Fix APLL enable error handling Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0599/1756] dt-bindings: vendor-prefixes: Add Chip Wealth Technology Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0600/1756] arm64: dts: qcom: sdm845-lg: fix sdcard pinctrl nodes Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0601/1756] hfs/hfsplus: serialize B-tree close against folio release Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0602/1756] arm64: dts: qcom: lemans-ride-common: fix SerDes PHY regulator supplies Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0603/1756] ARM: dts: qcom: msm8974: Use the header with DSI phy clock IDs Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0604/1756] ARM: dts: qcom: msm8974: Sort header includes alphabetically Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0605/1756] ARM: dts: qcom: msm8974: add MDSS reset Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0606/1756] dt-bindings: vendor-prefixes: Add LeEco Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0607/1756] dt-bindings: vendor-prefixes: Add Retronix Technology Inc Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0608/1756] dt-bindings: vendor-prefixes: Add Retroid Pocket Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0609/1756] scsi: ufs: core: Serialize AHIT register access between sysfs and host driver Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0610/1756] MIPS: Octeon: size the swiotlb for a modular OHCI platform driver Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0611/1756] MIPS: Only check -msym32 when need-compiler Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0612/1756] bitmap: bitmap_parse(): reject non-hex character before 8 digits Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0613/1756] bitmap: bitmap_parselist(): reject trailing characters after group size Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0614/1756] bitmap: bitmap_parselist(): dont wrap around on a huge " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0615/1756] m68k: apollo: Fix interrupt setup Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0616/1756] drm/msm/a6xx: Fix secondary rail vote in ARC votes Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0617/1756] netfilter: synproxy: fix reset of ct seqadj when reopening a connection Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0618/1756] ARM: dts: gemini: Use a level-high interrupt for TVE200 Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0619/1756] PCI: aardvark: Disable PHY on probe failures Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0620/1756] arm64: dts: qcom: sm8150: Use SM8150_CX for the SDHC power domain Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0621/1756] iommu/vt-d: Fix IQE handling to cover all descriptors in submission range Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0622/1756] arm64: dts: st: introduce stm32mp23 SoCs family Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0623/1756] arm64: dts: st: fix arm,smc-id of the SMC watchdog on stm32mp2 Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0624/1756] wifi: mac80211: Fix a race when expiring a mesh path Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0625/1756] RDMA/hns: Pin CQ buffer writable to match device DMA write access Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0626/1756] RDMA/mlx5: Set WQ event handler before firmware RQ insertion Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0627/1756] RDMA/mlx5: Set SRQ event handler before xarray insertion Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0628/1756] RDMA/mlx5: Set RQ event handler for raw-packet QP Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0629/1756] RDMA/mlx5: Initialize QP/RQ/SQ resource refcount before publishing it Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0630/1756] ASoC: amd: acp-es8336: Use an owned codec device reference Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0631/1756] ASoC: amd: acp3x-es83xx: Keep " Greg Kroah-Hartman
2026-11-18 14:45 ` [PATCH 6.12 0632/1756] ALSA: oxygen: Use guard() for mutex locks Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0633/1756] ALSA: oxygen: use helper to activate the SPDIF PCM control Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0634/1756] ALSA: via82xx: use helper to activate DXS controls Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0635/1756] drm/exynos/fimd: fix register offset type in fimd_trigger() Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0636/1756] staging: iio: adc: ad7816: Sort headers alphabetically Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0637/1756] staging: iio: adc: ad7816: Serialize SPI operations Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0638/1756] staging: iio: adc: ad7816: Protect sysfs attributes with mutex Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0639/1756] iio: dac: ad5758: Fix alignment for DMA safety Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0640/1756] iio: dac: ad5758: Reject out-of-range raw values Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0641/1756] iio: dac: ad5758: Fix the offset calculation Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0642/1756] ALSA: caiaq: Serialize access to the EP1 command buffer Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0643/1756] ALSA: caiaq: Fix the Kore controller key map Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0644/1756] spi: rspi: Fix DMA mode when the DMA controller is built as a module Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0645/1756] ASoC: mediatek: mt8192: fix APLL mux error handling Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0646/1756] ASoC: mediatek: mt8192: fix AFE clock " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0647/1756] ASoC: mediatek: mt8192: fix error handling in APLL enable functions Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0648/1756] ASoC: mediatek: mt8192: fix MCK clock error handling Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0649/1756] ASoC: mediatek: mt8192: switch to devm_clk_get_optional() Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0650/1756] ASoC: mediatek: mt8192: mt8192-afe-gpio: Use guard() for mutex locks Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0651/1756] ASoC: mediatek: mt8192: Propagate errors in mt8192_afe_gpio_request() Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0652/1756] ASoC: mediatek: mt8192: check return values in mt8192_afe_gpio_init() Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0653/1756] ASoC: mediatek: mt8192: Handle regcache_sync() failure in runtime resume Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0654/1756] ASoC: mediatek: mt8192: Propagate mt8192_afe_gpio_request() errors in ADDA DAI Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0655/1756] ASoC: mediatek: mt8192: Propagate errors in TDM DAI DAPM event handlers Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0656/1756] ASoC: mediatek: mt8192: Propagate errors in I2S " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0657/1756] ASoC: mediatek: mt8192-mt6359: Fix error handling in MTKAIF calibration Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0658/1756] perf machine: Factor creating a "live" machine out of dwarf-unwind Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0659/1756] perf debug: Add function symbols to dump_stack Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0660/1756] perf test: Avoid use perf_env Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0661/1756] perf machine: Explicitly pass in host perf_env Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0662/1756] perf test code-reading: Fix duplicate kernel maps and machine leak Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0663/1756] perf build: Clean libperf-gtk.so in make clean Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0664/1756] perf vendor events intel: Fix sierraforest umask encoding Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0665/1756] perf vendor events intel: Fix skylakex " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0666/1756] perf vendor events intel: Fix snowridgex " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0667/1756] soc: ti: k3-ringacc: Correct ring API kernel-doc Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0668/1756] soc: ti: k3-ringacc: Fix DMA ring initialization kernel-doc Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0669/1756] fs/ntfs3: fix slab-out-of-bounds write in attr_insert_range() Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0670/1756] cgroup/cpuset: Disable cpuset_cpumask_can_shrink() test if not load balancing Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0671/1756] cgroup/cpuset: Run SCHED_DEADLINE shrink test on valid partition root only Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0672/1756] RDMA/mlx5: Restore mr->pi_mr after temporary stack-local assignment Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0673/1756] IB/isert: Dont share drop_cmd_list across concurrent connection teardowns Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0674/1756] arm64: dts: imx8dxl-evk: fix reserved memory node names for remoteproc Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0675/1756] arm64: dts: imx8qm-mek: " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0676/1756] arm64: dts: imx8ulp-evk: " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0677/1756] arm64: dts: imx93-14x14-evk: " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0678/1756] arm64: dts: imx93-9x9-qsb: " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0679/1756] PCI/IOV: Read VF config values that need not match PF Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0680/1756] swim: Return -EROFS when opened with BLK_OPEN_WRITE flag Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0681/1756] swim: Fix FDEJECT ioctl for exclusive open Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0682/1756] swim3: " Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0683/1756] RDMA/bnxt_re: Fix integer overflow in send payload size computation Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0684/1756] RDMA/bnxt_re: Detect wrong sge_len passed for inline Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0685/1756] RDMA/bnxt_re: Validate SRQ max_sge at create time Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0686/1756] RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv() Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0687/1756] RDMA/bnxt_re: Fix the PD and DPI table size Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0688/1756] RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0689/1756] media: venus: Drop session events without an instance Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0690/1756] IB/mad: fix UAF and double-free in RMPP receive reassembly Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0691/1756] clk: ti: adpll: unregister OF clock provider on remove Greg Kroah-Hartman
2026-11-18 14:46 ` [PATCH 6.12 0692/1756] clk: si5351: fail prepare when PLL reset times out Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0693/1756] RDMA/nldev: Fix NULL deref in dumps of objects abandoned by DRIVER_FAILURE Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0694/1756] RDMA/rtrs-clt: Reject invalid queue_depth from the peer Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0695/1756] perf python: Initialize debug output on module load Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0696/1756] RDMA/mad: Reject receive completions shorter than GRH Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0697/1756] RDMA/mlx4: Do not allow the user to write to the clock page Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0698/1756] RDMA/cxgb4: Do not allow userspace to write the status page Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0699/1756] time: Prevent time64_to_tm() day truncation on 32-bit Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0700/1756] RDMA/rtrs-clt: Dont WARN on unexpected info-response opcode Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0701/1756] vfio/platform: prevent read-only region mappings from becoming writable Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0702/1756] vfio/fsl-mc: " Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0703/1756] vfio/cdx: " Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0704/1756] selftests/timers: clocksource-switch: Fix unchecked open()/read() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0705/1756] perf symbols: Dont let a modules last symbol overlap the next module Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0706/1756] RDMA/rtrs-clt: Validate peer-supplied IO completion msg_id Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0707/1756] RDMA/siw: Fix length of first chunk in siw_try_1seg() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0708/1756] RDMA/hfi1: shut down the trap timer before unregistering Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0709/1756] RDMA/hfi1: quiesce SDMA asynchronous cleanup on exit Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0710/1756] pinctrl: nuvoton: Fix clock reference leak in ma35_get_bank_data() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0711/1756] pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0712/1756] kconfig: tests: Provide defconfig outfile for savedefconfig Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0713/1756] RDMA/irdma: Do not move a fresh RoCE QP to ERROR on RESET Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0714/1756] rtc: bd70528: properly enable wakeup Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0715/1756] f2fs: quota: fix unused-label warning Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0716/1756] tools/nolibc: stop rounding malloc() sizes up to 4096 bytes Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0717/1756] tools/nolibc: check for overflow in malloc() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0718/1756] dt-bindings: vendor-prefixes: Add Sophos Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0719/1756] x86/hibernate: Ignore page-zero RAM in E820 checksum Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0720/1756] ARM: mvebu: fix Cortex-A9 errata selection for Armada 38x Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0721/1756] ice: skip stats handling for channel VSIs on rebuild Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0722/1756] drm/msm: Properly handle msm_ioremap() without name Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0723/1756] dt-bindings: display/msm: hdmi: Correct name of disallowed supplies Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0724/1756] drm/msm/mdp5: drop cursor pipe for msm8x76 Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0725/1756] drm/msm/dp: Initialize the debugfs connector pointer Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0726/1756] staging: sm750fb: free cmap on framebuffer release Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0727/1756] OPP: Fix the return value in dev_pm_opp_get_of_node() kernel-doc Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0728/1756] drm/imx/lcdc: avoid duplicate clk_per enable Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0729/1756] rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0730/1756] rtc: ftrtc010: fix clock resource leak on probe failure Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0731/1756] rtc: ftrtc010: use devm clock APIs to fix use-after-disable in remove Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0732/1756] ARM: vexpress: fix device_node refcount leak in vexpress_flags_set() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0733/1756] ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0734/1756] arm64: dts: st: fix sai3b unit address on stm32mp231 Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0735/1756] seg6: fix HMAC validation when an extension header precedes the SRH Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0736/1756] amt: pull the AMT header behind the transport header in amt_parse_type() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0737/1756] misc: enclosure: fix UAF on device_register() failure Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0738/1756] misc: nsm: mark device ready before registering the hwrng and misc device Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0739/1756] misc: nsm: fix CBOR short-length decoding Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0740/1756] debugfs: make debugfs_create_str() read-only Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0741/1756] ASoC: rt712: avoid duplicate reset in io_init Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0742/1756] perf trace: Copy sockaddr arguments by their length Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0743/1756] perf bpf: Move the LIBBPF_CURRENT_VERSION_GEQ macro to bpf-utils.h Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0744/1756] perf thread_map: Add thread_map__tgid() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0745/1756] cpufreq: amd-pstate: Restore previous mode when changing driver mode fails Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0746/1756] cpufreq: amd-pstate: Propagate cppc_set_auto_sel() errors on mode change Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0747/1756] pinctrl: mediatek: mt7629: fix the 2.4 GHz Wi-Fi pin mode array Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0748/1756] mm/memory_hotplug: fix missing rollback in __add_pages() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0749/1756] drm/tegra: Fix syncobj_in wait return value check Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0750/1756] drm/tegra: Dont pass an ERR_PTR to drm_syncobj_replace_fence() Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0751/1756] drm/tegra: Drop reference on postfence Greg Kroah-Hartman
2026-11-18 14:47 ` [PATCH 6.12 0752/1756] nvdimm/pmem: Release gendisk on probe failure Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0753/1756] platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0754/1756] crypto: atmel - handle authenc requests without plaintext Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0755/1756] crypto: tcrypt - Avoid reading req->base after submission Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0756/1756] hwrng: intel - return -ENOMEM when kmalloc_obj() fails Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0757/1756] rtc: ftrtc010: fix integer overflow in time calculation Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0758/1756] ALSA: ump: Avoid dereference with max_src_size=0 Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0759/1756] hwrng: intel - return -ENOMEM when ioremap() fails Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0760/1756] clocksource/drivers/dbx500-prcmu: Check timer register mapping Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0761/1756] isofs: return long Joliet names whole Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0762/1756] ASoC: dwc: Use OF match data again for StarFive JH7110 Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0763/1756] iommu/arm-smmu-v3: Ensure L2 tables are visible before L1 ptrs Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0764/1756] iommu/arm-smmu-v3-test: Fix arm_smmu_v3_test_debug_print_used_bits() Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0765/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: mux the SPI NOR HOLD# and WP# pins Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0766/1756] arm64: dts: amlogic: meson-sm1-odroid-hc4: run the SPI NOR at 40 MHz Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0767/1756] soc/tegra: flowctrl: Release OF node reference on error Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0768/1756] drm/msm/dp: dont report link training success after a reinit Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0769/1756] drm/msm/dpu: disable the slave encoder before the master Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0770/1756] drm/msm/dpu: extract bandwidth aggregation function Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0771/1756] drm/msm/dpu: change ib values to u32 Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0772/1756] drm/msm/dpu: make fix_core_ab_vote consistent with fix_core_ib_vote Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0773/1756] drm/msm/dpu: drop core_clk_rate overrides from _dpu_core_perf_calc_crtc Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0774/1756] drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus() Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0775/1756] drm/msm/dpu: compute the CRTC bandwidth from the state being checked Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0776/1756] phy: HiSilicon: Fix error handling in hi3670_pcie_allclk_ctrl() Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0777/1756] phy: rockchip: usbdp: Update mode_change after error handling Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0778/1756] phy: rockchip: usbdp: Do not lose USB3 PHY status Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0779/1756] phy: rockchip: usbdp: Fix devm_clk_bulk_get_all check Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0780/1756] phy: rockchip: usbdp: Handle missing clock-names DT property gracefully Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0781/1756] phy: rockchip: usbdp: Drop seamless DP takeover Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0782/1756] phy: rockchip: usbdp: Limit DP lane count to muxed lanes Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0783/1756] phy: rockchip: usbdp: add rk3576 device match data Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0784/1756] phy: rockchip: usbdp: Add missing mode_change update Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0785/1756] phy: rockchip: usbdp: Support single-lane DP Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0786/1756] phy: rockchip: usbdp: Drop DP HPD handling Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0787/1756] phy: rockchip: usbdp: Properly handle TYPEC_STATE_SAFE and TYPEC_STATE_USB Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0788/1756] phy: rockchip: usbdp: Hold mutex in DP PHY configure Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0789/1756] phy: rockchip: usbdp: Rename mode_change to phy_needs_reinit Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0790/1756] phy: rockchip: usbdp: Avoid xHCI SErrors Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0791/1756] phy: rockchip: usbdp: Handle rk_udphy_reset_deassert errors Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0792/1756] phy: rockchip: usbdp: Only enable USB3 when not in high-speed mode Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0793/1756] scsi: scsi_debug: Refuse a negative physblk_exp Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0794/1756] scsi: scsi_debug: Take the zone metadata lock before the data lock Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0795/1756] scsi: scsi_debug: Refuse a short WRITE ATOMIC (16) before writing it Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0796/1756] scsi: scsi_debug: Map the region written by WRITE ATOMIC (16) Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0797/1756] scsi: scsi_debug: Validate the access parameters of " Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0798/1756] scsi: st: Restore changed drive settings after reset also for MTLOAD and MTRETEN Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0799/1756] scsi: st: Record the tape position after a successful MTLOAD Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0800/1756] phy: freescale: fsl-samsung-hdmi: Replace register defines with macro Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0801/1756] phy: freescale: fsl-samsung-hdmi: Simplify REG21_PMS_S_MASK lookup Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0802/1756] phy: freescale: fsl-samsung-hdmi: Support dynamic integer Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0803/1756] phy: freescale: fsl-samsung-hdmi: Use helper function devm_clk_get_enabled() Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0804/1756] phy: freescale: fsl-samsung-hdmi: initialize default rate Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0805/1756] md: take reconfig_mutex when enabling PPL on an inactive array Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0806/1756] md/raid5: drain released_stripes before destroying the cache Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0807/1756] clk: imx: composite-93: return timeout from gate enable Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0808/1756] md/raid5: protect big_stripe_tree lookup with RCU Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0809/1756] dt-bindings: media: sun4i-a10-video-engine: Fix IOMMU count for H6 Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0810/1756] power: supply: bq24190: Remove redundant pm_runtime_mark_last_busy() calls Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0811/1756] power: supply: bq24190_charger: dont reset registers across system suspend Greg Kroah-Hartman
2026-11-18 14:48 ` [PATCH 6.12 0812/1756] md: Fix the null-ptr-deref of mddev->private while submitting IO Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0813/1756] dt-bindings: power: supply: ab8500: Add AB8505 charger Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0814/1756] .gitignore: drop Module.markers Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0815/1756] perf/cxl: Program the requested event group on configurable counters Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0816/1756] perf/cxl: Clear stale event fields before reprogramming a counter Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0817/1756] perf/cxl: Fix the counter overflow delta fixup Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0818/1756] perf/cxl: Accept an overflow interrupt on MSI message number 0 Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0819/1756] perf/cxl: Dont share the overflow interrupt, and keep it pinned Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0820/1756] perf/cxl: Unfreeze counters after handling an overflow interrupt Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0821/1756] perf/cxl: Validate the hardware-reported counter width Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0822/1756] perf/cxl: Dont log through pmu.dev in the overflow interrupt handler Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0823/1756] perf/cxl: Clear stale overflow status before using a counter Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0824/1756] perf/dwc_pcie: Fix PCI device reference leak in probe Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0825/1756] spi: fsl: switch to managed controller allocation Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0826/1756] spi: fsl: unmap immr_spi_cs on remove Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0827/1756] spi: bcm63xx-hsspi: Disable runtime PM " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0828/1756] selftests/alsa: Do not take another controls event as our own Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0829/1756] power: supply: ab8500_btemp: Fix event temperature reporting Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0830/1756] power: supply: ab8500: Preserve battery termination current Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0831/1756] power: supply: ab8500_charger: Fix AC charger re-enable Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0832/1756] power: supply: ab8500_charger: Decode AB8505 USB status Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0833/1756] power: supply: ab8500_charger: Respect AB8505 register layout Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0834/1756] power: supply: ab8500_charger: Handle detection errors Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0835/1756] power: supply: ab8500_charger: Skip absent AB8505 main charger Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0836/1756] power: supply: ab8500_charger: Retry AB8505 USB detection Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0837/1756] power: supply: ab8500_charger: Recover inactive AB8505 charger Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0838/1756] power: supply: ab8500_fg: Finalize current measurements Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0839/1756] power: supply: ab8500_fg: Avoid reserved AB8505 CCConf bit Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0840/1756] ASoC: rt5682-sdw: always cancel jack work on remove Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0841/1756] ASoC: rt711-sdw: " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0842/1756] ASoC: rt711-sdca: " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0843/1756] ASoC: rt712-sdca: " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0844/1756] ASoC: rt722-sdca: " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0845/1756] arm64: dts: rockchip: Rename rk3328 HDMI audio card Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0846/1756] ARM: dts: ux500: Use AB8505 charger compatible Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0847/1756] arm64: dts: rockchip: Update CPU OPP voltages in RK356x SoC dtsi Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0848/1756] arm64: dts: rockchip: Prepare RK356x SoC dtsi files for per-variant OPPs Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0849/1756] arm64: dts: rockchip: Rename rk3566 and rk3568 HDMI audio cards Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0850/1756] arm64: dts: rockchip: fix analog headphone output on rk3399-firefly Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0851/1756] arm64: dts: rockchip: disable unused i2s0 " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0852/1756] ASoC: mt6359-accdet: manage private workqueues with devres Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0853/1756] perf/marvell: cn10k_tad: Publish the OF module alias Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0854/1756] svcrdma: Fix svc_rdma_recv_cid_init() kernel-doc Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0855/1756] cpufreq: sparc-us2e: fix frequency table index copy-paste error Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0856/1756] cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0857/1756] cpufreq: sti: avoid NULL dereference in dev_err() Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0858/1756] drm/msm/dpu: round up the compressed INTF width Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0859/1756] firmware: qcom: tzmem: Use DO_ONCE_SLEEPABLE() in qcom_tzmem_enable() Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0860/1756] soc: qcom: pmic_glink: simplify locking with guard() Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0861/1756] soc: qcom: pmic_glink: Avoid losing early rpmsg probe Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0862/1756] soc: qcom: pmic_pdcharger_ulog: prevent work requeue during remove Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0863/1756] wifi: cfg80211: allow zero HE OBSS PD offsets Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0864/1756] wifi: b43: dont pass unterminated string to sscanf() Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0865/1756] wifi: b43legacy: debugfs: NUL terminate string in debugfs Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0866/1756] wifi: carl9170: " Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0867/1756] Revert "wifi: mac80211: do not use old MBSSID elements" Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0868/1756] dmaengine: ioat: disable relaxed ordering before registering the device Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0869/1756] dmaengine: plx_dma: fix NULL pointer deref in plx_dma_isr() Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0870/1756] SUNRPC: reject a client-side TLS alert record that is not two octets Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0871/1756] SUNRPC: treat every client-side TLS error alert as fatal Greg Kroah-Hartman
2026-11-18 14:49 ` [PATCH 6.12 0872/1756] NFS: filelayout: calculate dense stripe width in 64 bits Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0873/1756] floppy: flush pending work before releasing resources on init failure Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0874/1756] floppy: avoid NULL deref in reset_interrupt when cont is cleared Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0875/1756] floppy: unregister platform device on add_disk failure Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0876/1756] wifi: ath12k: Reserve space for a string terminator Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0877/1756] drm/msm/a6xx: fix use-after-free of OPP in a6xx_pm_resume Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0878/1756] dmaengine: ste_dma40: Fix physical cyclic capability Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0879/1756] dmaengine: ste_dma40: Fix failed start cleanup Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0880/1756] dmaengine: ste_dma40: Fix probe runtime PM disable Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0881/1756] dmaengine: ste_dma40: Check runtime PM in IRQ Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0882/1756] dmaengine: ste_dma40: Remove redundant pm_runtime_mark_last_busy() calls Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0883/1756] dmaengine: ste_dma40: Handle runtime PM resume errors Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0884/1756] dmaengine: ste_dma40: Return IRQ_NONE when no interrupt is pending Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0885/1756] dmaengine: ste_dma40: Init hardware before registration Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0886/1756] dmaengine: ste_dma40: Fix probe IRQ leak Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0887/1756] dmaengine: ste_dma40: Fix DMA registration unwind Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0888/1756] dmaengine: ste_dma40: Fix LCLA allocation order Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0889/1756] dmaengine: ste_dma40: Fix probe LCLA free Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0890/1756] dmaengine: ste_dma40: Put the LCPA SRAM node Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0891/1756] dmaengine: ste_dma40: turn d40_base phy_chans into a flexible array Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0892/1756] dmaengine: ste_dma40: Fix memcpy channel parsing Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0893/1756] dmaengine: ste_dma40: Validate disabled channel indexes Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0894/1756] dmaengine: ste_dma40: Validate DMA specifier length Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0895/1756] dmaengine: ste_dma40: Reject direction changes after allocation Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0896/1756] dmaengine: ste_dma40: Fix logical channel bounds check Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0897/1756] dmaengine: ste_dma40: Fix event group bounds Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0898/1756] dmaengine: ste_dma40: Fix V4B event group mapping Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0899/1756] dmaengine: ste_dma40: Validate fixed physical channel indexes Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0900/1756] dmaengine: ste_dma40: Validate memcpy configuration Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0901/1756] pNFS/flexfiles: honor FF_FLAGS_NO_IO_THRU_MDS over the mdsthreshold hint Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0902/1756] pNFS/flexfiles: dont read through MDS when previous layout forbid it Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0903/1756] pNFS/flexfiles: dont reset to MDS for v4 error " Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0904/1756] arm64: dts: allwinner: sun50i-h6: Add missing SRAM region for video engine Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0905/1756] arm64: dts: allwinner: sun50i-h6: Add missing IOMMU " Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0906/1756] ipv4: fix IP ID reuse in ip_select_ident_segs() Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0907/1756] ipv4: reserve one IP ID per segment for UDP GSO packets Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0908/1756] riscv: fix RVG_SYSTEM_CSR_MASK width mask Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0909/1756] sh: uaccess: Require offsettable operands for 64-bit user access Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0910/1756] sh: defconfig: Enable the current M66592 UDC symbol Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0911/1756] efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot() Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0912/1756] efi/riscv: libstub: Dont set image_size in handle_kernel_image() Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0913/1756] x86/efi: Drop support for the EFI_PROPERTIES_TABLE Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0914/1756] x86/efistub: Drop long obsolete UGA support Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0915/1756] efi/libstub: Use C99-style for loop to traverse handle buffer Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0916/1756] efi/libstub: Simplify GOP handling code Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0917/1756] efi/libstub: Simplify PCI I/O handle buffer traversal Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0918/1756] efi/libstub: Use cleanup helpers for freeing copies of the memory map Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0919/1756] x86/efistub: Merge PE and handover entrypoints Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0920/1756] efi/libstub: make local GUID variables static Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0921/1756] efi/libstub: Free cmdline_ptr in efi_pe_entry Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0922/1756] dt-bindings: dma: dma40: Restore disabled-channels Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0923/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix transfers for SUN4I_FIFO_DEPTH Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0924/1756] spi: spi-sun4i: sun4i_spi_fill_fifo(): always apply A10 FIFO fill level workaround Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0925/1756] spi: spi-sun4i: sun4i_spi_transfer_one(): fix setting of clock rate Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0926/1756] spi: spi-sun4i: sun4i_spi_handler(): fix race condition between transfer completion and RX FIFO interrupt Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0927/1756] NFS: return DENIED in decode_lock_denied if we cannot decode owner Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0928/1756] nilfs2: fix link count underflow when removing corrupted directory Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0929/1756] selftests: cgroup: Optionally set up v1 environment Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0930/1756] selftests/cgroup: conform test to KTAP format output Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0931/1756] selftests/cgroup: add test for zswap incompressible pages Greg Kroah-Hartman
2026-11-18 14:50 ` [PATCH 6.12 0932/1756] selftests/cgroup: skip test_zswap if zswap is globally disabled Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0933/1756] selftests/cgroup: avoid OOM in test_swapin_nozswap Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0934/1756] selftests/cgroup: use runtime page size for zswpin check Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0935/1756] selftests/cgroup: replace hardcoded page size values in test_zswap Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0936/1756] selftests/cgroup: test_zswap: fix implicit unsigned promotion bug in test_no_kmem_bypass Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0937/1756] checkpatch: skip CamelCase cache for --no-tree without root Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0938/1756] ocfs2: fix deadlock in inline-data truncate transactions Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0939/1756] selftests/epoll: fix race condition in multi-waiter wakeup tests Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0940/1756] init/main: fix off-by-one in argv_init cleanup Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0941/1756] init/main: fix false-positive kernel panic on environment variable overwrite Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0942/1756] ocfs2: allow xattr bucket entries to span multiple blocks Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0943/1756] ocfs2: reject inconsistent xattr bucket during defrag Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0944/1756] PCI/AER: Fix struct pci_dev reference leak in aer_process_err_devices() Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0945/1756] ALSA: caiaq: Allow zero-length packet handling for EP1 Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0946/1756] gen_init_cpio: stop parsing on lines with a missing argument list Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0947/1756] pinctrl: sprd: free maps on DT map failure Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0948/1756] wifi: mt76: mt7915: check default EEPROM firmware size before copying Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0949/1756] wifi: mt76: mt7996: validate firmware event lengths before parsing Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0950/1756] wifi: mt76: mt7915: unregister thermal cooling device on hwmon failure Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0951/1756] wifi: mt76: mt7915: guard firmware memory dump write on disabled memdump Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0952/1756] wifi: mt76: mt7921: fix lock inversion between dev->mutex and iflist_mtx Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0953/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0954/1756] wifi: mt76: mt7921: check drv_pmctrl return in the PCIe reset path Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0955/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0956/1756] wifi: mt76: mt7925: restore the reset state when fw_pmctrl fails Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0957/1756] wifi: mt76: mt7921: fix the lock inversion in suspend and resume Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0958/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0959/1756] wifi: mt76: mt7925: honour mac80211s FIF_FCSFAIL instead of hardcoding drop_err Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0960/1756] wifi: mt76: mt7921: honour " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0961/1756] wifi: mt76: mt7915: publish wcid before MCU add commands Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0962/1756] wifi: mt76: fix unlocked wcid check in mt76_tx_status_skb_add() Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0963/1756] wifi: mt76: fix wcid teardown ordering in mt76_reset_device() Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0964/1756] wifi: mt76: mt76x02: validate RX padding before use Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0965/1756] wifi: mt76: mt7921: keep the join ROC until the station is authorized Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0966/1756] wifi: mt76: mt7925: " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0967/1756] wifi: mt76: usb: fix source overread in mt76u_copy Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0968/1756] wifi: mt76: mt7615: usb: fix source overread in mt7663u_copy Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0969/1756] wifi: mt76: mt7603: dont drop short frames looped back on PS entry Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0970/1756] wifi: mt76: fix wcid->pktid corruption in mt76_wcid_cleanup() Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0971/1756] wifi: mt76: mt7615: read MT7663 temperature from the correct offset Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0972/1756] wifi: mt76: mt7615: validate MCU response lengths Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0973/1756] wifi: mt76: feed the station RSSI average from the chain signals Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0974/1756] wifi: mt76: mt7996: fix PLE free page and AC queue register offsets Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0975/1756] wifi: mt76: mt7996: disable the RX NAPIs before the DMA cleanup Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0976/1756] ASoC: rockchip: rockchip_i2s: Handle runtime PM resume failures in set_fmt Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0977/1756] kobject: Fix the kobj_set_name reference in kset_register() kernel-doc Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0978/1756] wifi: mt76: mt792x: compute the assoc RSSI from the chain signals Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0979/1756] checkkconfigsymbols.py: Parse Git status output line by line Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0980/1756] drm/amd/display: assign missing trace entry in amdgpu_dm_dc_clocks_state Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0981/1756] drm/amd/display: remove duplicated prev_p_state_change_support assignment Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0982/1756] drm/amd/display: fix vready offset assignment in dcn_optc_lock_unlock_state Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0983/1756] drm/amd/display: use right type for amdgpu_dc_performance event entries Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0984/1756] drm/amd/display: copy function name into dcn_fpu trace event Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0985/1756] drm/amd/display: copy function name into dcn_optc_lock_unlock_state " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0986/1756] ASoC: mediatek: common: Handle constraint return value in FE startup Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0987/1756] ASoC: mediatek: mt8188: " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0988/1756] ASoC: mediatek: mt8365: " Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0989/1756] PCI/sysfs: Stop reporting _DSM failures as -EPERM Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0990/1756] PCI/sysfs: Handle a malformed _DSM result in acpi_attr_is_visible() Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0991/1756] ALSA: hda: Fix potential UAF for gating jack Greg Kroah-Hartman
2026-11-18 14:51 ` [PATCH 6.12 0992/1756] ALSA: usb-audio: Check mixer matrix size for UAC2/3 at parsing Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0993/1756] ALSA: usb-audio: Fix invalid UAC2/3 mixer unit matrix evaluation Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0994/1756] ALSA: pcmtest: Fix a bogus pointer read in snd_pcmtst_pcm_pointer() Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0995/1756] ALSA: core: Add missing barriers for power_ref vs card->shutdown Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0996/1756] ALSA: seq: Fix missing direction and ump_group handling in 32bit compat ioctl Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0997/1756] ALSA: info: Fix memory leak at card removal Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0998/1756] ALSA: hda: Avoid non-operational GPU warning at regular device removal Greg Kroah-Hartman
2026-11-18 14:52 ` [PATCH 6.12 0999/1756] ALSA: hda/intel: Move firmware loading into the probe work Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox