Skip to contentSkip to conversation

6.17.3-rc1 review

PATCH In review Greg Kroah-Hartman 22 participants 591 messages Oct 13, 2025 – Oct 23, 2025 Page 1 of 5

Subsystems (8)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 6.17.3-rc1 review

This is the start of the stable review cycle for the 6.17.3 release. There are 563 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 Wed, 15 Oct 2025 14:42:41 +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.17.3-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.17.y
and the diffstat can be found below.

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 6.17.3-rc1

Lijo Lazar <[email protected]>
drm/amdgpu/vcn: Fix double-free of vcn dump buffer

Marek Szyprowski <[email protected]>
scsi: ufs: core: Fix PM QoS mutex initialization

Miaoqian Lin <[email protected]>
usb: cdns3: cdnsp-pci: remove redundant pci_disable_device() call

Konrad Dybcio <[email protected]>
arm64: dts: qcom: qcm2290: Disable USB SS bus instances in park mode

Sven Peter <[email protected]>
usb: typec: tipd: Clear interrupts first

Oleksij Rempel <[email protected]>
net: usb: asix: hold PM usage ref to avoid PM/MDIO + RTNL deadlock

Dominique Martinet <[email protected]>
net/9p: Fix buffer overflow in USB transport layer

Salah Triki <[email protected]>
bus: fsl-mc: Check return value of platform_get_resource()

Bartosz Golaszewski <[email protected]>
pinctrl: check the return value of pinmux_ops::get_function_name()

Jens Wiklander <[email protected]>
tee: fix register_shm_helper()

Duoming Zhou <[email protected]>
thunderbolt: Fix use-after-free in tb_dp_dprx_work

Shin'ichiro Kawasaki <[email protected]>
PCI: endpoint: pci-epf-test: Add NULL check for DMA channels before release

Zhen Ni <[email protected]>
remoteproc: pru: Fix potential NULL pointer dereference in pru_rproc_set_ctable()

Breno Leitao <[email protected]>
PCI/AER: Avoid NULL pointer dereference in aer_ratelimit()

Lei Lu <[email protected]>
sunrpc: fix null pointer dereference on zero-length checksum

Zhen Ni <[email protected]>
Input: uinput - zero-initialize uinput_ff_upload_compat to avoid info leak

Marek Vasut <[email protected]>
Input: atmel_mxt_ts - allow reset GPIO to sleep

Ling Xu <[email protected]>
misc: fastrpc: Skip reference for DMA handles

Ling Xu <[email protected]>
misc: fastrpc: fix possible map leak in fastrpc_put_args

Ling Xu <[email protected]>
misc: fastrpc: Fix fastrpc_map_lookup operation

Ling Xu <[email protected]>
misc: fastrpc: Save actual DMA size in fastrpc_map structure

Guangshuo Li <[email protected]>
nvdimm: ndtest: Return -ENOMEM if devm_kcalloc() fails in ndtest_probe()

Lance Yang <[email protected]>
selftests/mm: skip soft-dirty tests when CONFIG_MEM_SOFT_DIRTY is disabled

Yang Shi <[email protected]>
mm: hugetlb: avoid soft lockup when mprotect to large memory area

Janne Grunau <[email protected]>
fbdev: simplefb: Fix use after free in simplefb_detach_genpds()

Sean Christopherson <[email protected]>
KVM: SVM: Skip fastpath emulation on VM-Exit if next RIP isn't valid

Jan Kara <[email protected]>
ext4: fix checks for orphan inodes

Baokun Li <[email protected]>
ext4: fix potential null deref in ext4_mb_init()

Namjae Jeon <[email protected]>
ksmbd: add max ip connections parameter

Matvey Kovalev <[email protected]>
ksmbd: fix error code overwriting in smb2_get_info_filesystem()

Yunseong Kim <[email protected]>
ksmbd: Fix race condition in RPC handle list access

Jakub Acs <[email protected]>
mm/ksm: fix flag-dropping behavior in ksm_madvise

Huacai Chen <[email protected]>
LoongArch: BPF: Fix uninitialized symbol 'retval_off'

Hengqi Chen <[email protected]>
LoongArch: BPF: Remove duplicated flags check

Hengqi Chen <[email protected]>
LoongArch: BPF: No text_poke() for kernel text

Hengqi Chen <[email protected]>
LoongArch: BPF: Remove duplicated bpf_flush_icache()

Hengqi Chen <[email protected]>
LoongArch: BPF: Make error handling robust in arch_prepare_bpf_trampoline()

Hengqi Chen <[email protected]>
LoongArch: BPF: Make trampoline size stable

Hengqi Chen <[email protected]>
LoongArch: BPF: Don't align trampoline size

Hengqi Chen <[email protected]>
LoongArch: BPF: No support of struct argument in trampoline programs

Hengqi Chen <[email protected]>
LoongArch: BPF: Sign-extend struct ops return values properly

Xi Ruoyao <[email protected]>
pwm: loongson: Fix LOONGSON_PWM_FREQ_DEFAULT

Youling Tang <[email protected]>
LoongArch: Automatically disable kaslr if boot from kexec_file

Zheng Qixing <[email protected]>
dm: fix NULL pointer dereference in __dm_suspend()

Zheng Qixing <[email protected]>
dm: fix queue start/stop imbalance under suspend/load/resume races

Steven Rostedt <[email protected]>
tracing: Stop fortify-string from warning in tracing_mark_raw_write()

Steven Rostedt <[email protected]>
tracing: Fix tracing_mark_raw_write() to use buf and not ubuf

Steven Rostedt <[email protected]>
tracing: Have trace_marker use per-cpu data to read user space

Steven Rostedt <[email protected]>
tracing: Fix irqoff tracers on failure of acquiring calltime

Steven Rostedt <[email protected]>
tracing: Fix wakeup tracers on failure of acquiring calltime

Yuan Chen <[email protected]>
tracing: Fix race condition in kprobe initialization causing NULL pointer dereference

Sasha Levin <[email protected]>
tracing: Fix lock imbalance in s_start() memory allocation failure path

Bartosz Golaszewski <[email protected]>
mfd: vexpress-sysreg: Check the return value of devm_gpiochip_add_data()

Hans de Goede <[email protected]>
mfd: intel_soc_pmic_chtdc_ti: Set use_single_read regmap_config flag

Cosmin Tanislav <[email protected]>
mfd: rz-mtu3: Fix MTU5 NFCR register offset

Deepak Sharma <[email protected]>
net: nfc: nci: Add parameter validation for packet data

Larshin Sergey <[email protected]>
fs: udf: fix OOB read in lengthAllocDescs handling

Kai Vehmanen <[email protected]>
ASoC: SOF: ipc4-pcm: fix start offset calculation for chain DMA

Kai Vehmanen <[email protected]>
ASoC: SOF: ipc4-pcm: fix delay calculation when DSP resamples

Srinivas Kandagatla <[email protected]>
ASoC: codecs: wcd937x: make stub functions inline

Srinivas Kandagatla <[email protected]>
ASoC: codecs: wcd937x: set the comp soundwire port correctly

Ranjani Sridharan <[email protected]>
ASoC: SOF: ipc3-topology: Fix multi-core and static pipelines tear down

Ma Ke <[email protected]>
ASoC: wcd934x: fix error handling in wcd934x_codec_parse_data()

Pavel Begunkov <[email protected]>
io_uring/zcrx: fix overshooting recv limit

Jens Axboe <[email protected]>
io_uring/waitid: always prune wait queue entry in io_waitid_wait()

Miaoqian Lin <[email protected]>
hisi_acc_vfio_pci: Fix reference leak in hisi_acc_vfio_debug_init

Naman Jain <[email protected]>
uio_hv_generic: Let userspace take care of interrupt mask

Phillip Lougher <[email protected]>
Squashfs: fix uninit-value in squashfs_get_parent

Takashi Iwai <[email protected]>
ALSA: hda/realtek: Add quirk for HP Spectre 14t-ea100

Steven 'Steve' Kendall <[email protected]>
ALSA: hda/hdmi: Add pin fix for HP ProDesk model

Jarkko Sakkinen <[email protected]>
tpm: Disable TPM2_TCG_HMAC by default

Yazhou Tang <[email protected]>
bpf: Reject negative offsets for ALU ops

Brahmajit Das <[email protected]>
bpf: Skip scalar adjustment for BPF_NEG if dst is a pointer

Jiri Olsa <[email protected]>
selftests/bpf: Fix realloc size in bpf_get_addrs

Menglong Dong <[email protected]>
selftests/bpf: move get_ksyms and get_addrs to trace_helpers.c

Shubham Sharma <[email protected]>
selftests/bpf: Fix typos and grammar in test sources

zhang jiao <[email protected]>
vhost: vringh: Modify the return value check

Bo Sun <[email protected]>
octeontx2-pf: fix bitmap leak

Bo Sun <[email protected]>
octeontx2-vf: fix bitmap leak

Mike Snitzer <[email protected]>
nfs/localio: avoid issuing misaligned IO using O_DIRECT

Mike Snitzer <[email protected]>
NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support

Jakub Kicinski <[email protected]>
Revert "net/mlx5e: Update and set Xon/Xoff upon MTU set"

Guixin Liu <[email protected]>
iommufd: Register iommufd mock devices with fwspec

Wei Fang <[email protected]>
net: enetc: initialize SW PIR and CIR based HW PIR and CIR values

Hangbin Liu <[email protected]>
bonding: fix xfrm offload feature setup on active-backup mode

Enzo Matsumiya <[email protected]>
smb: client: fix crypto buffers in non-linear memory

Moshe Shemesh <[email protected]>
net/mlx5: fw reset, add reset timeout work

Shay Drory <[email protected]>
net/mlx5: pagealloc: Fix reclaim race during command interface teardown

Moshe Shemesh <[email protected]>
net/mlx5: Stop polling for command response if interface goes down

Yeounsu Moon <[email protected]>
net: dlink: handle copy_thresh allocation failure

Kohei Enju <[email protected]>
net: ena: return 0 in ena_get_rxfh_key_size() when RSS hash key is not configurable

Kohei Enju <[email protected]>
nfp: fix RSS hash key size when RSS is not supported

Eric Dumazet <[email protected]>

    tcp: use skb->len instead of skb->truesize in tcp_can_ingest()

Alok Tiwari <[email protected]>
idpf: fix mismatched free function for dma_alloc_coherent

Alok Tiwari <[email protected]>
PCI: j721e: Fix incorrect error message in probe()

Erick Karanja <[email protected]>
mtd: rawnand: atmel: Fix error handling path in atmel_nand_controller_add_nands

Chao Yu <[email protected]>
f2fs: fix UAF issue in f2fs_merge_page_bio()

Donet Tom <[email protected]>
drivers/base/node: fix double free in register_one_node()

Dan Carpenter <[email protected]>
ocfs2: fix double free in user_cluster_connect()

Alistair Popple <[email protected]>
cramfs: fix incorrect physical page address calculation

Nishanth Menon <[email protected]>
hwrng: ks-sa - fix division by zero in ks_sa_rng_init

Fan Wu <[email protected]>
KEYS: X.509: Fix Basic Constraints CA flag parsing

Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements

Pauli Virtanen <[email protected]>
Bluetooth: ISO: don't leak skb in ISO_CONT RX

Pauli Virtanen <[email protected]>
Bluetooth: ISO: free rx_skb if not consumed

Luiz Augusto von Dentz <[email protected]>
Bluetooth: ISO: Fix possible UAF on iso_conn_free

Luiz Augusto von Dentz <[email protected]>
Bluetooth: MGMT: Fix not exposing debug UUID on MGMT_OP_READ_EXP_FEATURES_INFO

Kiran K <[email protected]>
Bluetooth: btintel_pcie: Refactor Device Coredump

Théo Lebrun <[email protected]>
net: macb: single dma_alloc_coherent() for DMA descriptors

Théo Lebrun <[email protected]>
net: macb: move ring size computation to functions

Théo Lebrun <[email protected]>
net: macb: remove illusion about TBQPH/RBQPH being per-queue

Michael S. Tsirkin <[email protected]>
vhost: vringh: Fix copy_to_iter return value check

I Viswanath <[email protected]>
ptp: Add a upper bound on max_vclocks

I Viswanath <[email protected]>
net: usb: Remove disruptive netif_wake_queue in rtl8150_set_multicast

Claudiu Manoil <[email protected]>
net: enetc: Fix probing error message typo for the ENETCv4 PF driver

Bernard Metzler <[email protected]>
RDMA/siw: Always report immediate post SQ errors

Alessandro Zanni <[email protected]>
iommu/selftest: prevent use of uninitialized variable

Lu Baolu <[email protected]>
iommu/vt-d: Disallow dirty tracking if incoherent page walk

Dmitry Baryshkov <[email protected]>

    ASoC: qcom: sc8280xp: use sa8775p/ subdir for QCS9100 / QCS9075

Marek Vasut <[email protected]>
PCI: rcar-gen4: Fix inverted break condition in PHY initialization

Marek Vasut <[email protected]>
PCI: rcar-gen4: Assure reset occurs before DBI access

Marek Vasut <[email protected]>
PCI: rcar-gen4: Add missing 1ms delay after PWR reset assertion

Cristian Ciocaltea <[email protected]>
usb: vhci-hcd: Prevent suspending virtually attached devices

Ranjan Kumar <[email protected]>
scsi: mpt3sas: Fix crash in transport port remove by using ioc_info()

Zhongqiu Han <[email protected]>
scsi: ufs: core: Fix data race in CPU latency PM QoS request handling

Eric Dumazet <[email protected]>
netfilter: nf_conntrack: do not skip entries in /proc/net/nf_conntrack

Fernando Fernandez Mancera <[email protected]>
netfilter: nfnetlink: reset nlh pointer during batch replay

Slavin Liu <[email protected]>
ipvs: Defer ip_vs_ftp unregister during netns cleanup

Vadim Fedorenko <[email protected]>
net: ethtool: tsconfig: set command must provide a reply

Anthony Iliopoulos <[email protected]>
NFSv4.1: fix backchannel max_resp_sz verification check

Lin Yujun <[email protected]>
coresight: Fix incorrect handling for return value of devm_kzalloc

Jie Gan <[email protected]>
coresight: tpda: fix the logic to setup the element size

Leo Yan <[email protected]>
coresight: trbe: Return NULL pointer for allocation failures

Leo Yan <[email protected]>
coresight: Avoid enable programming clock duplicately

Leo Yan <[email protected]>
coresight: Appropriately disable trace bus clocks

Leo Yan <[email protected]>
coresight: Appropriately disable programming clocks

Leo Yan <[email protected]>
coresight: etm4x: Support atclk

Leo Yan <[email protected]>
coresight: catu: Support atclk

Leo Yan <[email protected]>
coresight: tmc: Support atclk

Yuanfang Zhang <[email protected]>
coresight-etm4x: Conditionally access register TRCEXTINSELR

Yeoreum Yun <[email protected]>
coresight: fix indentation error in cscfg_remove_owned_csdev_configs()

Ivan Abramov <[email protected]>
dm vdo: return error on corrupted metadata in start_restoring_volume functions

Ryder Lee <[email protected]>

    wifi: cfg80211: fix width unit in cfg80211_radio_chandef_valid()

Nithyanantham Paramasivam <[email protected]>
wifi: ath12k: Fix flush cache failure during RX queue update

Nithyanantham Paramasivam <[email protected]>
wifi: ath12k: Refactor RX TID deletion handling into helper function

Stephan Gerhold <[email protected]>
remoteproc: qcom: pas: Shutdown lite ADSP DTB on X1E

Stephan Gerhold <[email protected]>
remoteproc: qcom: q6v5: Avoid disabling handover IRQ twice

Nagarjuna Kristam <[email protected]>
PCI: tegra194: Fix duplicate PLL disable in pex_ep_event_pex_rst_assert()

Fedor Pchelkin <[email protected]>
wifi: rtw89: avoid circular locking dependency in ser_state_run()

Fedor Pchelkin <[email protected]>
wifi: rtw89: fix leak in rtw89_core_send_nullfunc()

Chunyu Hu <[email protected]>
selftests/mm: fix va_high_addr_switch.sh failure on x86_64

Gui-Dong Han <[email protected]>
RDMA/rxe: Fix race in do_task() when draining

Dmitry Baryshkov <[email protected]>
remoteproc: qcom_q6v5_mss: support loading MBN file on msm8974

Barnabás Czémán <[email protected]>
rpmsg: qcom_smd: Fix fallback to qcom,ipc parse

Hari Chandrakanthan <[email protected]>
wifi: ath12k: Fix peer lookup in ath12k_dp_mon_rx_deliver_msdu()

Chenghai Huang <[email protected]>

    crypto: hisilicon/qm - set NULL to qm->debug.qm_diff_regs

Dan Moulding <[email protected]>
crypto: comp - Use same definition of context alloc and free ops

Zilin Guan <[email protected]>
vfio/pds: replace bitmap_free with vfree

Michael Karcher <[email protected]>
sparc: fix accurate exception reporting in copy_{from,to}_user for M7

Michael Karcher <[email protected]>
sparc: fix accurate exception reporting in copy_to_user for Niagara 4

Michael Karcher <[email protected]>
sparc: fix accurate exception reporting in copy_{from_to}_user for Niagara

Michael Karcher <[email protected]>
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III

Michael Karcher <[email protected]>
sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC

Richard Fitzgerald <[email protected]>
ASoC: Intel: sof_sdw: Prevent jump to NULL add_sidecar callback

Aditya Kumar Singh <[email protected]>
wifi: mac80211: fix Rx packet handling when pubsta information is not available

Vineeth Pillai (Google) <[email protected]>
iommu/vt-d: debugfs: Fix legacy mode page table dump logic

Baochen Qiang <[email protected]>
wifi: ath10k: avoid unnecessary wait for service ready message

Baochen Qiang <[email protected]>
wifi: ath12k: fix wrong logging ID used for CE

Sriram R <[email protected]>
wifi: ath12k: Add fallback for invalid channel number in PHY metadata

Kang Yang <[email protected]>
wifi: ath12k: fix the fetching of combined rssi

Kang Yang <[email protected]>
wifi: ath12k: fix HAL_PHYRX_COMMON_USER_INFO handling in monitor mode

Kang Yang <[email protected]>
wifi: ath12k: fix signal in radiotap for WCN7850

Baochen Qiang <[email protected]>
wifi: ath12k: fix overflow warning on num_pwr_levels

Baochen Qiang <[email protected]>
wifi: ath12k: initialize eirp_power before use

Richard Fitzgerald <[email protected]>
ASoC: SOF: ipc4-pcm: Fix incorrect comparison with number of tdm_slots

Bagas Sanjaya <[email protected]>
Documentation: trace: historgram-design: Separate sched_waking histogram section heading and the following diagram

Vlad Dumitrescu <[email protected]>
IB/sa: Fix sa_local_svc_timeout_ms read race

Parav Pandit <[email protected]>
RDMA/core: Resolve MAC of next-hop device without ARP support

Michal Pecio <[email protected]>
Revert "usb: xhci: Avoid Stop Endpoint retry loop if the endpoint seems Running"

Kuniyuki Iwashima <[email protected]>
mptcp: Use __sk_dst_get() and dst_dev_rcu() in mptcp_active_enable().

Kuniyuki Iwashima <[email protected]>
mptcp: Call dst_release() in mptcp_active_enable().

Kuniyuki Iwashima <[email protected]>

    tls: Use __sk_dst_get() and dst_dev_rcu() in get_netdev_for_sock().

Kuniyuki Iwashima <[email protected]>

    smc: Use __sk_dst_get() and dst_dev_rcu() in smc_vlan_by_tcpsk().

Kuniyuki Iwashima <[email protected]>

    smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().

Kuniyuki Iwashima <[email protected]>

    smc: Use __sk_dst_get() and dst_dev_rcu() in in smc_clc_prfx_set().

Kuniyuki Iwashima <[email protected]>
smc: Fix use-after-free in __pnet_find_base_ndev().

wangzijie <[email protected]>
f2fs: fix zero-sized extent for precache extents

Benjamin Tissoires <[email protected]>
HID: hidraw: tighten ioctl command parsing

Qianfeng Rong <[email protected]>
scsi: qla2xxx: Fix incorrect sign of error code in qla_nvme_xmt_ls_rsp()

Qianfeng Rong <[email protected]>
scsi: qla2xxx: Fix incorrect sign of error code in START_SP_W_RETRIES()

Qianfeng Rong <[email protected]>
scsi: qla2xxx: edif: Fix incorrect sign of error code

Colin Ian King <[email protected]>
ACPI: NFIT: Fix incorrect ndr_desc being reportedin dev_err message

Sebastian Andrzej Siewior <[email protected]>
ALSA: pcm: Disable bottom softirqs as part of spin_lock_irq() on PREEMPT_RT

Fangyu Yu <[email protected]>
RISC-V: KVM: Write hgatp register with valid mode bits

Chao Yu <[email protected]>
f2fs: fix to mitigate overhead of f2fs_zero_post_eof_page()

Chao Yu <[email protected]>
f2fs: fix to avoid migrating empty section

Chao Yu <[email protected]>
f2fs: fix to truncate first page in error path of f2fs_truncate()

Chao Yu <[email protected]>

    f2fs: fix to update map->m_next_extent correctly in f2fs_map_blocks()

Timur Kristóf <[email protected]>
drm/amdgpu: Fix allocating extra dwords for rings (v2)

Zqiang <[email protected]>
srcu/tiny: Remove preempt_disable/enable() in srcu_gp_start_if_needed()

Bard Liao <[email protected]>
ASoC: Intel: hda-sdw-bpt: set persistent_buffer false

Felix Fietkau <[email protected]>
wifi: mt76: mt7996: remove redundant per-phy mac80211 calls during restart

Zhi-Jun You <[email protected]>

    wifi: mt76: mt7915: fix mt7981 pre-calibration

Lorenzo Bianconi <[email protected]>

    wifi: mt76: mt7996: Convert mt7996_wed_rro_addr to LE

Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7996: Fix RX packets configuration for primary WED device

Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7996: Fix tx-queues initialization for second phy on mt7996

Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7996: Check phy before init msta_link in mt7996_mac_sta_add_links()

Lorenzo Bianconi <[email protected]>
wifi: mt76: mt7996: Use proper link_id in link_sta_rc_update callback

Abdun Nihaal <[email protected]>
wifi: mt76: fix potential memory leak in mt76_wmac_probe()

Lorenzo Bianconi <[email protected]>

    wifi: mt76: mt7996: Fix mt7996_mcu_bss_mld_tlv routine

Lorenzo Bianconi <[email protected]>

    wifi: mt76: mt7996: Fix mt7996_mcu_sta_ba wcid configuration

Håkon Bugge <[email protected]>
RDMA/cm: Rate limit destroy CM ID timeout error message

Donet Tom <[email protected]>
drivers/base/node: handle error properly in register_one_node()

Niklas Cassel <[email protected]>
PCI: endpoint: pci-epf-test: Fix doorbell test support

Christophe Leroy <[email protected]>
watchdog: mpc8xxx_wdt: Reload the watchdog timer when enabling the watchdog

Guenter Roeck <[email protected]>
watchdog: intel_oc_wdt: Do not try to write into const memory

Jiri Kosina <[email protected]>
HID: steelseries: Fix STEELSERIES_SRWS1 handling in steelseries_remove()

Zhang Tengfei <[email protected]>

    ipvs: Use READ_ONCE/WRITE_ONCE for ipvs->enable

Zhen Ni <[email protected]>
netfilter: ipset: Remove unused htable_bits in macro ahash_region

Edward Srouji <[email protected]>
RDMA/mlx5: Fix page size bitmap calculation for KSM mode

Matthieu Baerts (NGI0) <[email protected]>
tools: ynl: fix undefined variable name

Kuan-Wei Chiu <[email protected]>
mm/slub: Fix cmp_loc_by_count() to return 0 when counts are equal

Hans de Goede <[email protected]>
iio: consumers: Fix offset handling in iio_convert_raw_to_processed()

Hans de Goede <[email protected]>
iio: consumers: Fix handling of negative channel scale in iio_convert_raw_to_processed()

Moon Hee Lee <[email protected]>
fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist

Vitaly Grigoryev <[email protected]>
fs: ntfs3: Fix integer overflow in run_unpack()

Sarika Sharma <[email protected]>
wifi: mac80211: fix reporting of all valid links in sta_set_sinfo()

Qianfeng Rong <[email protected]>
drm/msm/dpu: fix incorrect type for ret

Akhil P Oommen <[email protected]>
drm/msm: Fix bootup splat with separate_gpu_drm modparam

Eric Dumazet <[email protected]>
ipv6: snmp: do not track per idev ICMP6_MIB_RATELIMITHOST

Eric Dumazet <[email protected]>
ipv6: snmp: do not use SNMP_MIB_SENTINEL anymore

Takashi Iwai <[email protected]>
ASoC: Intel: bytcr_rt5651: Fix invalid quirk input mapping

Takashi Iwai <[email protected]>
ASoC: Intel: bytcr_rt5640: Fix invalid quirk input mapping

Takashi Iwai <[email protected]>
ASoC: Intel: bytcht_es8316: Fix invalid quirk input mapping

Alexander Lobakin <[email protected]>
idpf: fix Rx descriptor ready check barrier in splitq

Dmitry Baryshkov <[email protected]>
drm/msm: stop supporting no-IOMMU configuration

Dmitry Baryshkov <[email protected]>
drm/msm/mdp4: stop supporting no-IOMMU configuration

Liao Yuanhong <[email protected]>
wifi: iwlwifi: Remove redundant header files

Rob Clark <[email protected]>
drm/msm: Fix missing VM_BIND offset/range validation

Rob Clark <[email protected]>
drm/msm: Fix obj leak in VM_BIND error path

Wang Liang <[email protected]>
pps: fix warning in pps_register_cdev when register device fail

Colin Ian King <[email protected]>
misc: genwqe: Fix incorrect cmd field being reported in error

Seppo Takalo <[email protected]>
tty: n_gsm: Don't block input queue by waiting MSC

William Wu <[email protected]>
usb: gadget: configfs: Correctly set use_os_string at bind

Xichao Zhao <[email protected]>
usb: phy: twl6030: Fix incorrect type for ret

Qianfeng Rong <[email protected]>
drm/amdkfd: Fix error code sign for EINVAL in svm_ioctl()

Anderson Nascimento <[email protected]>
fanotify: Validate the return value of mnt_ns_from_dentry() before dereferencing

Eric Dumazet <[email protected]>
tcp: fix __tcp_close() to only send RST when required

Ziyue Zhang <[email protected]>
PCI: qcom: Add equalization settings for 8.0 GT/s and 32.0 GT/s

Aditya Kumar Singh <[email protected]>
wifi: mac80211: consider links for validating SCAN_FLAG_AP in scan request during MLO

Alok Tiwari <[email protected]>

    PCI: tegra: Fix devm_kcalloc() argument order for port->phys allocation

Jun Nie <[email protected]>
drm/msm: Do not validate SSPP when it is not ready

Gokul Sivakumar <[email protected]>
wifi: brcmfmac: fix 43752 SDIO FWVID incorrectly labelled as Cypress (CYW)

Stefan Kerkmann <[email protected]>
wifi: mwifiex: send world regulatory domain to driver

Lorenzo Bianconi <[email protected]>
wifi: mac80211: Make CONNECTION_MONITOR optional for MLO sta

Timur Kristóf <[email protected]>
drm/amd/pm: Disable SCLK switching on Oland with high pixel clocks (v3)

Timur Kristóf <[email protected]>
drm/amd/pm: Disable MCLK switching with non-DC at 120 Hz+ (v2)

Timur Kristóf <[email protected]>
drm/amd/pm: Treat zero vblank time as too short in si_dpm (v3)

Timur Kristóf <[email protected]>
drm/amd/pm: Adjust si_upload_smc_data register programming (v3)

Timur Kristóf <[email protected]>
drm/amd/pm: Fix si_upload_smc_data (v3)

Timur Kristóf <[email protected]>
drm/amd/pm: Disable ULV even if unsupported (v3)

Timur Kristóf <[email protected]>
drm/amdgpu: Power up UVD 3 for FW validation (v2)

Yuanfang Zhang <[email protected]>
coresight: Only register perf symlink for sinks with alloc_buffer

James Clark <[email protected]>
coresight: Fix missing include for FIELD_GET

James Clark <[email protected]>
coresight: trbe: Add ISB after TRBLIMITR write

Nathan Lynch <[email protected]>

    dmaengine: Fix dma_async_tx_descriptor->tx_submit documentation

Eric Dumazet <[email protected]>
inet: ping: check sock_net() in ping_get_port() and ping_lookup()

Weili Qian <[email protected]>
crypto: hisilicon/qm - request reserved interrupt for virtual function

Zhushuai Yin <[email protected]>
crypto: hisilicon/qm - check whether the input function and PF are on the same device

Weili Qian <[email protected]>
crypto: hisilicon - check the sva module status while enabling or disabling address prefetch

Chenghai Huang <[email protected]>
crypto: hisilicon - re-enable address prefetch after device resuming

Chenghai Huang <[email protected]>
crypto: hisilicon/zip - remove unnecessary validation for high-performance mode configurations

Eric Dumazet <[email protected]>
ipv4: start using dst_dev_rcu()

Eric Dumazet <[email protected]>
tcp_metrics: use dst_dev_net_rcu()

Eric Dumazet <[email protected]>
net: use dst_dev_rcu() in sk_setup_caps()

Eric Dumazet <[email protected]>
ipv6: use RCU in ip6_output()

Eric Dumazet <[email protected]>
ipv6: use RCU in ip6_xmit()

Eric Dumazet <[email protected]>
ipv6: start using dst_dev_rcu()

Yue Haibing <[email protected]>
ipv6: mcast: Add ip6_mc_find_idev() helper

Eric Dumazet <[email protected]>

    net: dst: introduce dst->dev_rcu

Geert Uytterhoeven <[email protected]>
efi: Explain OVMF acronym in OVMF_DEBUG_LOG help text

Qianfeng Rong <[email protected]>
accel/amdxdna: Use int instead of u32 to store error codes

Lijo Lazar <[email protected]>
drm/amdgpu: Check vcn state before profile switch

Sathishkumar S <[email protected]>
drm/amdgpu/vcn: Hold pg_lock before vcn power off

Sathishkumar S <[email protected]>
drm/amdgpu/vcn: Add regdump helper functions

Arnd Bergmann <[email protected]>
media: st-delta: avoid excessive stack usage

Qianfeng Rong <[email protected]>
ALSA: lx_core: use int type to store negative error codes

Dan Carpenter <[email protected]>
HID: i2c-hid: Fix test in i2c_hid_core_register_panel_follower()

Nirmoy Das <[email protected]>
PCI/ACPI: Fix pci_acpi_preserve_config() memory leak

Nipun Gupta <[email protected]>
cdx: don't select CONFIG_GENERIC_MSI_IRQ

Krishna Chaitanya Chundru <[email protected]>
PCI: qcom: Restrict port parsing only to PCIe bridge child nodes

Joanne Koong <[email protected]>
fuse: remove unneeded offset assignment when filling write pages

Claudiu Beznea <[email protected]>
PCI: rcar-host: Pass proper IRQ domain to generic_handle_domain_irq()

Christian Marangi <[email protected]>
net: phy: as21xxx: better handle PHY HW reset on soft-reboot

Christian Marangi <[email protected]>
net: phy: introduce phy_id_compare_vendor() PHY ID helper

Bitterblue Smith <[email protected]>

    wifi: rtw88: Use led->brightness_set_blocking for PCI too

Patrisious Haddad <[email protected]>
RDMA/mlx5: Fix vport loopback forcing for MPV device

Or Har-Toov <[email protected]>
RDMA/mlx5: Better estimate max_qp_wr to reflect WQE count

Pin-yen Lin <[email protected]>
HID: i2c-hid: Make elan touch controllers power on after panel is enabled

Pin-yen Lin <[email protected]>
drm/panel: Allow powering on panel follower after panel is enabled

Benjamin Mugnier <[email protected]>
media: i2c: vd55g1: Fix duster register address

Bingbu Cao <[email protected]>
media: staging/ipu7: cleanup the MMU correctly in IPU7 driver release

Bingbu Cao <[email protected]>
media: staging/ipu7: Don't set name for IPU7 PCI device

Bingbu Cao <[email protected]>
media: staging/ipu7: convert to use pci_alloc_irq_vectors() API

Zhang Shurong <[email protected]>
media: rj54n1cb0c: Fix memleak in rj54n1_probe()

Xaver Hugl <[email protected]>
drm: re-allow no-op changes on non-primary planes in async flips

Thorsten Blum <[email protected]>
crypto: octeontx2 - Call strscpy() with correct size argument

Val Packett <[email protected]>
drm/dp: drm_edp_backlight_set_level: do not always send 3-byte commands

Chao Yu <[email protected]>
f2fs: fix to allow removing qf_name

Chao Yu <[email protected]>
f2fs: fix to avoid NULL pointer dereference in f2fs_check_quota_consistency()

Chao Yu <[email protected]>
f2fs: fix to clear unusable_cap for checkpoint=enable

Thomas Fourier <[email protected]>
scsi: myrs: Fix dma_alloc_coherent() error check

Kuniyuki Iwashima <[email protected]>
mptcp: Fix up subflow's memcg when CONFIG_SOCK_CGROUP_DATA=n.

Niklas Cassel <[email protected]>

    scsi: pm80xx: Fix pm8001_abort_task() for chip_8006 when using an expander

Niklas Cassel <[email protected]>

    scsi: pm80xx: Add helper function to get the local phy id

Niklas Cassel <[email protected]>

    scsi: pm80xx: Use dev_parent_is_expander() helper

Niklas Cassel <[email protected]>
scsi: libsas: Add dev_parent_is_expander() helper

Niklas Cassel <[email protected]>

    scsi: pm80xx: Fix array-index-out-of-of-bounds on rmmod

Niklas Cassel <[email protected]>

    scsi: pm80xx: Restore support for expanders

Akhilesh Patil <[email protected]>
fwctl/mlx5: Fix memory alloc/free in mlx5ctl_fw_rpc()

Jorge Marques <[email protected]>
docs: iio: ad3552r: Fix malformed code-block directive

Arnd Bergmann <[email protected]>
hwrng: nomadik - add ARM_AMBA dependency

Thomas Fourier <[email protected]>
crypto: keembay - Add missing check after sg_nents_for_len()

Srinivasan Shanmugam <[email protected]>
drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions

Liao Yuanhong <[email protected]>
drm/amd/display: Remove redundant semicolons

Dan Carpenter <[email protected]>

    serial: max310x: Add error checking in probe()

Dan Carpenter <[email protected]>
misc: pci_endpoint_test: Fix array underflow in pci_endpoint_test_ioctl()

Geert Uytterhoeven <[email protected]>
PCI/pwrctrl: Fix double cleanup on devm_add_action_or_reset() failure

Komal Bajaj <[email protected]>
usb: misc: qcom_eud: Access EUD_MODE_MANAGER2 through secure calls

Dan Carpenter <[email protected]>
usb: host: max3421-hcd: Fix error pointer dereference in probe cleanup

Aradhya Bhatia <[email protected]>
drm/bridge: cdns-dsi: Fix the _atomic_check()

Jonas Karlman <[email protected]>
phy: rockchip: naneng-combphy: Enable U3 OTG port for RK3568

Jacopo Mondi <[email protected]>
media: zoran: Remove zoran_fh structure

Jack Xiao <[email protected]>
drm/amdgpu: fix incorrect vm flags to map bo

Jeongjun Park <[email protected]>
HID: steelseries: refactor probe() and remove()

Bitterblue Smith <[email protected]>

    wifi: rtw88: Lock rtwdev->mutex before setting the LED

Chia-I Wu <[email protected]>
drm/bridge: it6505: select REGMAP_I2C

Chao Yu <[email protected]>
f2fs: fix to zero data after EOF for compressed file correctly

Chao Yu <[email protected]>
f2fs: fix to avoid overflow while left shift operation

Chao Yu <[email protected]>
f2fs: fix condition in __allow_reserved_blocks()

Brahmajit Das <[email protected]>
drm/radeon/r600_cs: clean up of dead code in r600_cs

Dan Carpenter <[email protected]>
PCI: xgene-msi: Return negative -EINVAL in xgene_msi_handler_setup()

Dan Carpenter <[email protected]>
PCI: endpoint: pci-ep-msi: Fix NULL vs IS_ERR() check in pci_epf_write_msi_msg()

Xiang Liu <[email protected]>
drm/amdgpu: Fix vcn v4.0.3 poison irq call trace on sriov guest

Xiang Liu <[email protected]>
drm/amdgpu: Fix jpeg v4.0.3 poison irq call trace on sriov guest

Arnd Bergmann <[email protected]>
drm/amdgpu: fix link error for !PM_SLEEP

Brigham Campbell <[email protected]>
drm/panel: novatek-nt35560: Fix invalid return value

Srinivasan Shanmugam <[email protected]>
drm/amd/display: Reduce Stack Usage by moving 'audio_output' into 'stream_res' v4

Colin Ian King <[email protected]>
drm/vmwgfx: fix missing assignment to ts

Langyan Ye <[email protected]>
drm/panel-edp: Add 50ms disable delay for four panels

Dmitry Baryshkov <[email protected]>
drm/display: bridge-connector: correct CEC bridge pointers in drm_bridge_connector_init

Langyan Ye <[email protected]>
drm/panel-edp: Add disable to 100ms for MNB601LS1-4

Tvrtko Ursulin <[email protected]>
drm/sched: Fix a race in DRM_GPU_SCHED_STAT_NO_HANG test

Dzmitry Sankouski <[email protected]>
mfd: max77705: Setup the core driver as an interrupt controller

Arnd Bergmann <[email protected]>
i3c: fix big-endian FIFO transfers

Daniel Borkmann <[email protected]>
bpf: Enforce expected_attach_type for tailcall compatibility

D. Wythe <[email protected]>
libbpf: Fix error when st-prefix_ops and ops from differ btf

Kunihiko Hayashi <[email protected]>
i2c: designware: Add disabling clocks when probe fails

Kunihiko Hayashi <[email protected]>
i2c: designware: Fix clock issue when PM is disabled

Troy Mitchell <[email protected]>
i2c: spacemit: ensure SDA is released after bus reset

Troy Mitchell <[email protected]>
i2c: spacemit: check SDA instead of SCL after bus reset

Troy Mitchell <[email protected]>
i2c: spacemit: disable SDA glitch fix to avoid restart delay

Troy Mitchell <[email protected]>
i2c: spacemit: remove stop function to avoid bus error

Troy Mitchell <[email protected]>
i2c: spacemit: ensure bus release check runs when wait_bus_idle() fails

Leilk.Liu <[email protected]>
i2c: mediatek: fix potential incorrect use of I2C_MASTER_WRRD

Dmitry Baryshkov <[email protected]>
thermal/drivers/qcom/lmh: Add missing IRQ includes

Dmitry Baryshkov <[email protected]>
thermal/drivers/qcom: Make LMH select QCOM_SCM

André Almeida <[email protected]>
tools/nolibc: add stdbool.h to nolibc includes

Vadim Pasternak <[email protected]>
hwmon: (mlxreg-fan) Separate methods of fan setting coming from different subsystems

Qi Xi <[email protected]>
once: fix race by moving DO_ONCE to separate section

Andrea Righi <[email protected]>
bpf: Mark kfuncs as __noclone

Arnd Bergmann <[email protected]>
clocksource/drivers/tegra186: Avoid 64-bit division

Guenter Roeck <[email protected]>
clocksource/drivers/timer-tegra186: Avoid 64-bit divide operation

Jonas Gorski <[email protected]>
spi: fix return code when spi device has too many chipselects

Zhouyi Zhou <[email protected]>
tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers

Dzmitry Sankouski <[email protected]>
power: supply: max77705_charger: rework interrupts

Dzmitry Sankouski <[email protected]>
power: supply: max77705_charger: use regfields for config registers

Dzmitry Sankouski <[email protected]>
power: supply: max77705_charger: refactoring: rename charger to chg

Dzmitry Sankouski <[email protected]>
mfd: max77705: max77705_charger: move active discharge setting to mfd parent

Rafael J. Wysocki <[email protected]>
smp: Fix up and expand the smp_call_function_many() kerneldoc

Thomas Weißschuh <[email protected]>
selftests: always install UAPI headers to the correct directory

Janne Grunau <[email protected]>
arm64: dts: apple: Add ethernet0 alias for J375 template

Hector Martin <[email protected]>

    arm64: dts: apple: t600x: Add bluetooth device nodes

Hector Martin <[email protected]>

    arm64: dts: apple: t600x: Add missing WiFi properties

Hengqi Chen <[email protected]>
bpf, arm64: Call bpf_jit_binary_pack_finalize() in bpf_jit_free()

Eduard Zingerman <[email protected]>
bpf: dont report verifier bug for missing bpf_scc_visit on speculative path

Sebastian Andrzej Siewior <[email protected]>
selftest/futex: Compile also with libnuma < 2.0.16

André Almeida <[email protected]>
selftest/futex: Make the error check more precise for futex_numa_mpol

Dan Carpenter <[email protected]>
selftests/futex: Fix futex_wait() for 32bit ARM

Mikko Rapeli <[email protected]>
mmc: select REGMAP_MMIO with MMC_LOONGSON2

Paul Chaignon <[email protected]>
bpf: Explicitly check accesses to bpf_sock_addr

Yu Kuai <[email protected]>
blk-throttle: fix throtl_data leak during disk release

Yi Lai <[email protected]>
selftests/kselftest_harness: Add harness-selftest.expected to TEST_FILES

Akhilesh Patil <[email protected]>
selftests: watchdog: skip ping loop if WDIOF_KEEPALIVEPING not supported

John Garry <[email protected]>
block: fix stacking of atomic writes when atomics are not supported

John Garry <[email protected]>
block: update validation of atomic writes boundary for stacked devices

Stanley Chu <[email protected]>
i3c: master: svc: Recycle unused IBI slot

Stanley Chu <[email protected]>
i3c: master: svc: Use manual response for IBI events

Martin George <[email protected]>
nvme-tcp: send only permitted commands for secure concat

Daniel Wagner <[email protected]>
nvmet-fcloop: call done callback even when remote port is gone

Daniel Wagner <[email protected]>
nvmet-fc: move lsop put work to nvmet_fc_ls_req_op

Martin George <[email protected]>
nvme-auth: update bi_directional flag

Hengqi Chen <[email protected]>
riscv, bpf: Sign extend struct ops return values properly

Dmitry Antipov <[email protected]>
ACPICA: Fix largest possible resource descriptor index

Ahmed Salem <[email protected]>
ACPICA: Apply ACPI_NONSTRING

Uwe Kleine-König <[email protected]>
pwm: tiehrpwm: Fix corner case in clock divisor calculation

Uwe Kleine-König <[email protected]>
pwm: tiehrpwm: Fix various off-by-one errors in duty-cycle calculation

Uwe Kleine-König <[email protected]>
pwm: tiehrpwm: Make code comment in .free() more useful

Uwe Kleine-König <[email protected]>
pwm: tiehrpwm: Don't drop runtime PM reference in .free()

Chen-Yu Tsai <[email protected]>
arm64: dts: allwinner: t527: orangepi-4a: hook up external 32k crystal

Chen-Yu Tsai <[email protected]>
arm64: dts: allwinner: t527: avaota-a1: hook up external 32k crystal

Chen-Yu Tsai <[email protected]>
arm64: dts: allwinner: a527: cubie-a5e: Drop external 32.768 KHz crystal

Chen-Yu Tsai <[email protected]>
arm64: dts: allwinner: a527: cubie-a5e: Add LEDs

AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt8516-pumpkin: Fix machine compatible

AngeloGioacchino Del Regno <[email protected]>

    arm64: dts: mediatek: mt8395-kontron-i1200: Fix MT6360 regulator nodes

AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt7986a: Fix PCI-Express T-PHY node address

AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt6795-xperia-m5: Fix mmc0 latch-ck value

Bean Huo <[email protected]>
mmc: core: Fix variable shadowing in mmc_route_rpmb_frames()

AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt6331: Fix pmic, regulators, rtc, keys node names

Biju Das <[email protected]>
arm64: dts: renesas: r9a09g047e57-smarc: Fix gpio key's pin control node

Akashdeep Kaur <[email protected]>
arm64: dts: ti: k3-pinctrl: Fix the bug in existing macros

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8186-tentacruel: Fix touchscreen model

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8188: Change efuse fallback compatible to mt8186

Beleswar Padhi <[email protected]>
Revert "arm64: dts: ti: k3-j721e-beagleboneai64: Fix reversed C6x carveout locations"

Beleswar Padhi <[email protected]>
Revert "arm64: dts: ti: k3-j721e-sk: Fix reversed C6x carveout locations"

Beleswar Padhi <[email protected]>
arm64: dts: ti: k3: Rename rproc reserved-mem nodes to 'memory@addr'

Beleswar Padhi <[email protected]>
arm64: dts: ti: k3-j742s2-mcu-wakeup: Override firmware-name for MCU R5F cores

Sebastian Reichel <[email protected]>
arm64: dts: rockchip: Fix network on rk3576 evb1 board

Alexey Charkov <[email protected]>

    arm64: dts: rockchip: Add WiFi on rk3576-evb1-v10

Alexey Charkov <[email protected]>

    arm64: dts: rockchip: Add RTC on rk3576-evb1-v10

Chen-Yu Tsai <[email protected]>
arm64: dts: allwinner: t527: avaota-a1: Add ethernet PHY reset setting

Chen-Yu Tsai <[email protected]>
arm64: dts: allwinner: a527: cubie-a5e: Add ethernet PHY reset setting

Yu Kuai <[email protected]>
blk-mq: fix potential deadlock while nr_requests grown

Yu Kuai <[email protected]>
blk-mq-sched: add new parameter nr_requests in blk_mq_alloc_sched_tags()

Yu Kuai <[email protected]>
blk-mq: split bitmap grow and resize case in blk_mq_update_nr_requests()

Yu Kuai <[email protected]>
blk-mq: cleanup shared tags case in blk_mq_update_nr_requests()

Yu Kuai <[email protected]>
blk-mq: convert to serialize updating nr_requests with update_nr_hwq_lock

Yu Kuai <[email protected]>
blk-mq: check invalid nr_requests in queue_requests_store()

Yu Kuai <[email protected]>
blk-mq: remove useless checkings in blk_mq_update_nr_requests()

Yu Kuai <[email protected]>
block: fix ordering of recursive split IO

Yu Kuai <[email protected]>
block: skip unnecessary checks for split bio

Yu Kuai <[email protected]>
block: factor out a helper bio_submit_split_bioset()

Yu Kuai <[email protected]>
block: initialize bio issue time in blk_mq_submit_bio()

Yu Kuai <[email protected]>
block: cleanup bio_issue

Johan Hovold <[email protected]>
cpuidle: qcom-spm: fix device and OF node leaks at probe

Johan Hovold <[email protected]>
soc: mediatek: mtk-svs: fix device leaks on mt8192 probe failure

Johan Hovold <[email protected]>
soc: mediatek: mtk-svs: fix device leaks on mt8183 probe failure

Xianwei Zhao <[email protected]>
dts: arm: amlogic: fix pwm node for c3

Johan Hovold <[email protected]>
firmware: firmware: meson-sm: fix compile-test default

Nicolas Frattaroli <[email protected]>
PM / devfreq: rockchip-dfi: double count on RK3588

Eric Dumazet <[email protected]>
nbd: restrict sockets to TCP and UDP

Rob Herring (Arm) <[email protected]>
arm64: dts: mediatek: mt8183: Fix out of range pull values

Guoqing Jiang <[email protected]>
arm64: dts: mediatek: mt8195: Remove suspend-breaking reset from pcie0

Bibo Mao <[email protected]>
tick: Do not set device to detached state in tick_shutdown()

Dan Carpenter <[email protected]>
irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()

Dan Carpenter <[email protected]>
irqchip/gic-v5: Fix loop in gicv5_its_create_itt_two_level() cleanup path

Thomas Weißschuh <[email protected]>
selftests: vDSO: vdso_test_abi: Correctly skip whole test with missing vDSO

Thomas Weißschuh <[email protected]>
selftests: vDSO: Fix -Wunitialized in powerpc VDSO_CALL() wrapper

Han Guangjiang <[email protected]>
blk-throttle: fix access race during throttle policy activation

Genjian Zhang <[email protected]>
null_blk: Fix the description of the cache_size module argument

Yulin Lu <[email protected]>
pinctrl: eswin: Fix regulator error check and Kconfig dependency

Qianfeng Rong <[email protected]>
pinctrl: renesas: Use int type to store negative error codes

Eugene Shalygin <[email protected]>
hwmon: (asus-ec-sensors) Narrow lock for X870E-CREATOR WIFI

Andy Yan <[email protected]>
power: supply: cw2015: Fix a alignment coding style issue

Dan Carpenter <[email protected]>
PM / devfreq: mtk-cci: Fix potential error pointer dereference in probe()

Jihed Chaibi <[email protected]>
ARM: dts: omap: am335x-cm-t335: Remove unused mcasp num-serializer property

Jihed Chaibi <[email protected]>
ARM: dts: ti: omap: omap3-devkit8000-lcd: Fix ti,keep-vref-on property to use correct boolean syntax in DTS

Jihed Chaibi <[email protected]>
ARM: dts: ti: omap: am335x-baltos: Fix ti,en-ck32k-xtal property in DTS to use correct boolean syntax

Thomas Weißschuh <[email protected]>
vdso: Add struct __kernel_old_timeval forward declaration to gettime.h

Yu Kuai <[email protected]>
blk-mq: fix elevator depth_updated method

Rafael J. Wysocki <[email protected]>
PM: sleep: core: Clear power.must_resume in noirq suspend error path

Thomas Weißschuh <[email protected]>
vdso/datastore: Gate time data behind CONFIG_GENERIC_GETTIMEOFDAY

Ricardo B. Marlière <[email protected]>
selftests/bpf: Fix count write in testapp_xdp_metadata_copy()

Brian Norris <[email protected]>
genirq/test: Ensure CPU 1 is online for hotplug test

Brian Norris <[email protected]>
genirq/test: Drop CONFIG_GENERIC_IRQ_MIGRATION assumptions

Brian Norris <[email protected]>
genirq/test: Depend on SPARSE_IRQ

Brian Norris <[email protected]>
genirq/test: Select IRQ_DOMAIN

David Gow <[email protected]>
genirq/test: Fix depth tests on architectures with NOREQUEST by default.

Rob Herring (Arm) <[email protected]>
dt-bindings: vendor-prefixes: Add undocumented vendor prefixes

Jihed Chaibi <[email protected]>
ARM: dts: stm32: stm32mp151c-plyaqm: Use correct dai-format property

Qianfeng Rong <[email protected]>
block: use int to store blk_stack_limits() return value

Inochi Amaoto <[email protected]>
PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()

Andrei Lalaev <[email protected]>
leds: leds-lp55xx: Use correct address for memory programming

Benjamin Berg <[email protected]>
selftests/nolibc: fix EXPECT_NZ macro

Thomas Weißschuh <[email protected]>
tools/nolibc: avoid error in dup2() if old fd equals new fd

Waiman Long <[email protected]>
selftests/futex: Fix some futex_numa_mpol subtests

Qianfeng Rong <[email protected]>
regulator: scmi: Use int type to store negative error codes

Janne Grunau <[email protected]>

    arm64: dts: apple: t8103-j457: Fix PCIe ethernet iommu-map

Nicolas Ferre <[email protected]>
ARM: at91: pm: fix MCKx restore routine

Sebastian Andrzej Siewior <[email protected]>
selftests/futex: Remove the -g parameter from futex_priv_hash

Li Nan <[email protected]>
blk-mq: check kobject state_in_sysfs before deleting in blk_mq_unregister_hctx

Da Xue <[email protected]>
pinctrl: meson-gxl: add missing i2c_d pinmux

Sneh Mankad <[email protected]>
soc: qcom: rpmh-rsc: Unconditionally clear _TRIGGER bit for TCS

Vlastimil Babka <[email protected]>
scripts/misc-check: update export checks for EXPORT_SYMBOL_FOR_MODULES()

Inochi Amaoto <[email protected]>
irqchip/sg2042-msi: Fix broken affinity setting

Inochi Amaoto <[email protected]>
PCI/MSI: Add startup/shutdown for per device domains

Inochi Amaoto <[email protected]>
genirq: Add irq_chip_(startup/shutdown)_parent()

Huisong Li <[email protected]>
ACPI: processor: idle: Fix memory leak when register cpuidle device failed

Tao Chen <[email protected]>
bpf: Remove preempt_disable in bpf_try_get_buffers

Joy Zou <[email protected]>
arm64: dts: imx95: Correct the lpuart7 and lpuart8 srcid

Frieder Schrempf <[email protected]>
arm64: dts: imx93-kontron: Fix USB port assignment

Annette Kobou <[email protected]>
arm64: dts: imx93-kontron: Fix GPIO for panel regulator

Junnan Wu <[email protected]>
firmware: arm_scmi: Mark VirtIO ready before registering scmi_virtio_driver

Mykyta Yatsenko <[email protected]>
libbpf: Export bpf_object__prepare symbol

Marek Vasut <[email protected]>
arm64: dts: renesas: sparrow-hawk: Set VDDQ18_25_AVB voltage on EVTB1

Marek Vasut <[email protected]>
arm64: dts: renesas: sparrow-hawk: Invert microSD voltage selector on EVTB1

Florian Fainelli <[email protected]>
cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus()

Ilya Leoshkevich <[email protected]>
s390/bpf: Write back tail call counter for BPF_TRAMP_F_CALL_ORIG

Ilya Leoshkevich <[email protected]>
s390/bpf: Write back tail call counter for BPF_PSEUDO_CALL

Ilya Leoshkevich <[email protected]>
s390/bpf: Do not write tail call counter into helper and kfunc frames

Fenglin Wu <[email protected]>
leds: flash: leds-qcom-flash: Update torch current clamp setting

Len Bao <[email protected]>
leds: max77705: Function return instead of variable assignment

Geert Uytterhoeven <[email protected]>
ARM: dts: renesas: porter: Fix CAN pin group

Thomas Weißschuh <[email protected]>
tools/nolibc: fix error return value of clock_nanosleep()

Yureka Lilian <[email protected]>
libbpf: Fix reuse of DEVMAP

Tao Chen <[email protected]>
bpf: Remove migrate_disable in kprobe_multi_link_prog_run

Matt Bobrowski <[email protected]>
bpf/selftests: Fix test_tcpnotify_user

Baptiste Lepers <[email protected]>
rust: cpumask: Mark CpumaskVar as transparent

Amery Hung <[email protected]>
selftests/bpf: Copy test_kmods when installing selftest

Geert Uytterhoeven <[email protected]>
regmap: Remove superfluous check for !config in __regmap_init()

Paul Chaignon <[email protected]>
bpf: Tidy verifier bug message

Biju Das <[email protected]>
arm64: dts: renesas: rzg2lc-smarc: Disable CAN-FD channel0

Lad Prabhakar <[email protected]>
pinctrl: renesas: rzg2l: Fix invalid unsigned return in rzg3s_oen_read()

Qu Wenruo <[email protected]>
btrfs: fix symbolic link reading when bs > ps

Qu Wenruo <[email protected]>
btrfs: return any hit error from extent_writepage_io()

Chen Ridong <[email protected]>
cpuset: fix failure to enable isolated partition when containing isolcpus

Randy Dunlap <[email protected]>
lsm: CONFIG_LSM can depend on CONFIG_SECURITY

Peter Zijlstra <[email protected]>

    sched/fair: Get rid of sched_domains_curr_level hack for tl->cpumask()

Michal Koutný <[email protected]>
selftests: cgroup: Make test_pids backwards compatible

Uros Bizjak <[email protected]>
x86/vdso: Fix output operand size of RDPID

Dapeng Mi <[email protected]>
perf/x86/intel: Fix IA32_PMC_x_CFG_B MSRs access error

Dapeng Mi <[email protected]>
perf/x86/intel: Use early_initcall() to hook bts_init()

Qiuxu Zhuo <[email protected]>
EDAC/i10nm: Skip DIMM enumeration on a disabled memory controller

Stefan Metzmacher <[email protected]>
smb: server: fix IRD/ORD negotiation with the client

Stefan Metzmacher <[email protected]>
smb: client: fix sending the iwrap custom IRD/ORD negotiation messages

Gao Xiang <[email protected]>
erofs: avoid reading more for fragment maps

Leo Yan <[email protected]>
perf: arm_spe: Prevent overflow in PERF_IDX2OFF()

Leo Yan <[email protected]>
coresight: trbe: Prevent overflow in PERF_IDX2OFF()

Chunyan Zhang <[email protected]>
raid6: riscv: Clean up unused header file inclusion

Jeremy Linton <[email protected]>
uprobes: uprobe_warn should use passed task

Joe Lawrence <[email protected]>
powerpc64/modules: correctly iterate over stubs in setup_ftrace_ool_stubs

Joe Lawrence <[email protected]>
powerpc/ftrace: ensure ftrace record ops are always set for NOPs

Christophe Leroy <[email protected]>
powerpc/603: Really copy kernel PGD entries into all PGDIRs

Christophe Leroy <[email protected]>
powerpc/8xx: Remove left-over instruction and comments in DataStoreTLBMiss handler

Andreas Gruenbacher <[email protected]>
gfs2: Add proper lockspace locking

Andreas Gruenbacher <[email protected]>
gfs2: do_xmote cleanup

Andreas Gruenbacher <[email protected]>
gfs2: Get rid of GLF_INVALIDATE_IN_PROGRESS

Andreas Gruenbacher <[email protected]>
gfs2: Remove duplicate check in do_xmote

Andreas Gruenbacher <[email protected]>
gfs2: Fix LM_FLAG_TRY* logic in add_to_queue

Andreas Gruenbacher <[email protected]>
gfs2: Further sanitize lock_dlm.c

Colin Ian King <[email protected]>
gfs2: Remove space before newline

Andreas Gruenbacher <[email protected]>
gfs2: Fix GLF_INVALIDATE_IN_PROGRESS flag clearing in do_xmote

Kang Chen <[email protected]>
hfsplus: fix slab-out-of-bounds read in hfsplus_uni2asc()

Thomas Weißschuh <[email protected]>
kselftest/arm64/gcs: Correctly check return value when disabling GCS

Bala-Vignesh-Reddy <[email protected]>
selftests: arm64: Fix -Waddress warning in tpidr2 test

Bala-Vignesh-Reddy <[email protected]>
selftests: arm64: Check fread return value in exec_target

Kienan Stewart <[email protected]>

    kbuild: Add missing $(objtree) prefix to powerpc crtsavres.o artifact

Johannes Nixdorf <[email protected]>
seccomp: Fix a race with WAIT_KILLABLE_RECV if the tracer replies too fast

Linus Torvalds <[email protected]>
Fix CC_HAS_ASM_GOTO_OUTPUT on non-x86 architectures

Christian Göttsche <[email protected]>
pid: use ns_capable_noaudit() when determining net sysctl permissions

Geert Uytterhoeven <[email protected]>
init: INITRAMFS_PRESERVE_MTIME should depend on BLK_DEV_INITRD

Jeff Layton <[email protected]>
filelock: add FL_RECLAIM to show_fl_flags() macro

Simon Schuster <[email protected]>
arch: copy_thread: pass clone_flags as u64

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

Diffstat:

 .../devicetree/bindings/vendor-prefixes.yaml       |  50 ++++
 Documentation/iio/ad3552r.rst                      |   3 +-
 Documentation/trace/histogram-design.rst           |   4 +-
 Makefile                                           |   4 +-
 arch/alpha/kernel/process.c                        |   2 +-
 arch/arc/kernel/process.c                          |   2 +-
 arch/arm/boot/dts/renesas/r8a7791-porter.dts       |   2 +-
 arch/arm/boot/dts/st/stm32mp151c-plyaqm.dts        |   2 +-
 arch/arm/boot/dts/ti/omap/am335x-baltos.dtsi       |   2 +-
 arch/arm/boot/dts/ti/omap/am335x-cm-t335.dts       |   2 -
 .../dts/ti/omap/omap3-devkit8000-lcd-common.dtsi   |   2 +-
 arch/arm/kernel/process.c                          |   2 +-
 arch/arm/mach-at91/pm_suspend.S                    |   4 +-
 .../boot/dts/allwinner/sun55i-a527-cubie-a5e.dts   |  25 +-
 .../boot/dts/allwinner/sun55i-t527-avaota-a1.dts   |  11 +
 .../boot/dts/allwinner/sun55i-t527-orangepi-4a.dts |   8 +
 arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi        |   2 +-
 arch/arm64/boot/dts/apple/t6000-j314s.dts          |   8 +
 arch/arm64/boot/dts/apple/t6000-j316s.dts          |   8 +
 arch/arm64/boot/dts/apple/t6001-j314c.dts          |   8 +
 arch/arm64/boot/dts/apple/t6001-j316c.dts          |   8 +
 arch/arm64/boot/dts/apple/t6001-j375c.dts          |   8 +
 arch/arm64/boot/dts/apple/t6002-j375d.dts          |   8 +
 arch/arm64/boot/dts/apple/t600x-j314-j316.dtsi     |  10 +
 arch/arm64/boot/dts/apple/t600x-j375.dtsi          |  11 +
 arch/arm64/boot/dts/apple/t8103-j457.dts           |  12 +-
 .../boot/dts/freescale/imx93-kontron-bl-osm-s.dts  |  32 ++-
 arch/arm64/boot/dts/freescale/imx95.dtsi           |   4 +-
 arch/arm64/boot/dts/mediatek/mt6331.dtsi           |  10 +-
 .../boot/dts/mediatek/mt6795-sony-xperia-m5.dts    |   2 +-
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi          |  12 +-
 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi     |  14 +-
 arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts    |  14 +-
 .../boot/dts/mediatek/mt8186-corsola-krabby.dtsi   |   8 +-
 .../mt8186-corsola-tentacruel-sku262144.dts        |   4 +
 arch/arm64/boot/dts/mediatek/mt8188.dtsi           |   2 +-
 arch/arm64/boot/dts/mediatek/mt8195.dtsi           |   3 -
 .../dts/mediatek/mt8395-kontron-3-5-sbc-i1200.dts  |  16 +-
 arch/arm64/boot/dts/mediatek/mt8516-pumpkin.dts    |   2 +-
 arch/arm64/boot/dts/qcom/qcm2290.dtsi              |   1 +
 .../boot/dts/renesas/r8a779g3-sparrow-hawk.dts     |   6 +-
 arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts |   6 +-
 arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi      |   5 +-
 arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts   | 118 ++++++++-
 arch/arm64/boot/dts/ti/k3-am62-phycore-som.dtsi    |  10 +-
 arch/arm64/boot/dts/ti/k3-am62-pocketbeagle2.dts   |   6 +-
 arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi         |   2 +-
 arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts     |   2 +-
 arch/arm64/boot/dts/ti/k3-am62a-phycore-som.dtsi   |  12 +-
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts            |  12 +-
 arch/arm64/boot/dts/ti/k3-am62d2-evm.dts           |  14 +-
 arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi        |   2 +-
 arch/arm64/boot/dts/ti/k3-am62p5-sk.dts            |   8 +-
 arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi     |   8 +-
 arch/arm64/boot/dts/ti/k3-am64-phycore-som.dtsi    |  22 +-
 arch/arm64/boot/dts/ti/k3-am642-evm.dts            |  22 +-
 arch/arm64/boot/dts/ti/k3-am642-sk.dts             |  22 +-
 arch/arm64/boot/dts/ti/k3-am642-sr-som.dtsi        |  16 +-
 arch/arm64/boot/dts/ti/k3-am642-tqma64xxl.dtsi     |  18 +-
 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi |  10 +-
 arch/arm64/boot/dts/ti/k3-am654-base-board.dts     |  10 +-
 arch/arm64/boot/dts/ti/k3-am67a-beagley-ai.dts     |  22 +-
 arch/arm64/boot/dts/ti/k3-am68-phycore-som.dtsi    |  34 +--
 arch/arm64/boot/dts/ti/k3-am68-sk-som.dtsi         |  34 +--
 arch/arm64/boot/dts/ti/k3-am69-sk.dts              |  48 ++--
 arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi        |  18 +-
 arch/arm64/boot/dts/ti/k3-j721e-beagleboneai64.dts |  40 +--
 arch/arm64/boot/dts/ti/k3-j721e-sk.dts             |  40 +--
 arch/arm64/boot/dts/ti/k3-j721e-som-p0.dtsi        |  38 +--
 arch/arm64/boot/dts/ti/k3-j721s2-som-p0.dtsi       |  34 +--
 arch/arm64/boot/dts/ti/k3-j722s-evm.dts            |  22 +-
 arch/arm64/boot/dts/ti/k3-j742s2-mcu-wakeup.dtsi   |  17 ++
 arch/arm64/boot/dts/ti/k3-j742s2.dtsi              |   1 +
 arch/arm64/boot/dts/ti/k3-j784s4-evm.dts           |   4 +-
 .../boot/dts/ti/k3-j784s4-j742s2-evm-common.dtsi   |  44 ++--
 arch/arm64/boot/dts/ti/k3-pinctrl.h                |   4 +-
 arch/arm64/kernel/process.c                        |   2 +-
 arch/arm64/net/bpf_jit_comp.c                      |   3 +-
 arch/csky/kernel/process.c                         |   2 +-
 arch/hexagon/kernel/process.c                      |   2 +-
 arch/loongarch/kernel/process.c                    |   2 +-
 arch/loongarch/kernel/relocate.c                   |   4 +
 arch/loongarch/net/bpf_jit.c                       |  80 ++++--
 arch/m68k/kernel/process.c                         |   2 +-
 arch/microblaze/kernel/process.c                   |   2 +-
 arch/mips/kernel/process.c                         |   2 +-
 arch/nios2/kernel/process.c                        |   2 +-
 arch/openrisc/kernel/process.c                     |   2 +-
 arch/parisc/kernel/process.c                       |   2 +-
 arch/powerpc/Kconfig                               |   4 +
 arch/powerpc/Makefile                              |   2 +-
 arch/powerpc/include/asm/book3s/32/pgalloc.h       |  10 +-
 arch/powerpc/include/asm/nohash/pgalloc.h          |   2 +-
 arch/powerpc/include/asm/topology.h                |   2 +
 arch/powerpc/kernel/head_8xx.S                     |   9 +-
 arch/powerpc/kernel/module_64.c                    |   2 +-
 arch/powerpc/kernel/process.c                      |   2 +-
 arch/powerpc/kernel/smp.c                          |  27 +-
 arch/powerpc/kernel/trace/ftrace.c                 |  10 +-
 arch/riscv/kernel/process.c                        |   2 +-
 arch/riscv/kvm/vmid.c                              |   3 +-
 arch/riscv/net/bpf_jit_comp64.c                    |  42 +++-
 arch/s390/kernel/process.c                         |   2 +-
 arch/s390/kernel/topology.c                        |  20 +-
 arch/s390/net/bpf_jit_comp.c                       |  42 +++-
 arch/sh/kernel/process_32.c                        |   2 +-
 arch/sparc/kernel/process_32.c                     |   2 +-
 arch/sparc/kernel/process_64.c                     |   2 +-
 arch/sparc/lib/M7memcpy.S                          |  20 +-
 arch/sparc/lib/Memcpy_utils.S                      |   9 +
 arch/sparc/lib/NG4memcpy.S                         |   2 +-
 arch/sparc/lib/NGmemcpy.S                          |  29 ++-
 arch/sparc/lib/U1memcpy.S                          |  19 +-
 arch/sparc/lib/U3memcpy.S                          |   2 +-
 arch/um/kernel/process.c                           |   2 +-
 arch/x86/events/intel/bts.c                        |   2 +-
 arch/x86/events/intel/core.c                       |   3 +-
 arch/x86/include/asm/fpu/sched.h                   |   2 +-
 arch/x86/include/asm/segment.h                     |   8 +-
 arch/x86/include/asm/shstk.h                       |   4 +-
 arch/x86/kernel/fpu/core.c                         |   2 +-
 arch/x86/kernel/process.c                          |   2 +-
 arch/x86/kernel/shstk.c                            |   2 +-
 arch/x86/kernel/smpboot.c                          |   8 +-
 arch/x86/kvm/svm/svm.c                             |  12 +-
 arch/xtensa/kernel/process.c                       |   2 +-
 block/bfq-iosched.c                                |  22 +-
 block/bio.c                                        |   2 +-
 block/blk-cgroup.c                                 |   6 -
 block/blk-cgroup.h                                 |  12 +-
 block/blk-core.c                                   |  19 +-
 block/blk-iolatency.c                              |  14 +-
 block/blk-merge.c                                  |  64 +++--
 block/blk-mq-sched.c                               |  14 +-
 block/blk-mq-sched.h                               |  13 +-
 block/blk-mq-sysfs.c                               |   6 +-
 block/blk-mq-tag.c                                 |  23 +-
 block/blk-mq.c                                     |  84 ++++---
 block/blk-mq.h                                     |  18 +-
 block/blk-settings.c                               |  44 ++--
 block/blk-sysfs.c                                  |  57 ++++-
 block/blk-throttle.c                               |  15 +-
 block/blk-throttle.h                               |  18 +-
 block/blk.h                                        |  45 +---
 block/elevator.c                                   |   3 +-
 block/elevator.h                                   |   2 +-
 block/kyber-iosched.c                              |  19 +-
 block/mq-deadline.c                                |  16 +-
 crypto/842.c                                       |   6 +-
 crypto/asymmetric_keys/x509_cert_parser.c          |  16 +-
 crypto/lz4.c                                       |   6 +-
 crypto/lz4hc.c                                     |   6 +-
 crypto/lzo-rle.c                                   |   6 +-
 crypto/lzo.c                                       |   6 +-
 drivers/accel/amdxdna/aie2_ctx.c                   |   6 +-
 drivers/acpi/acpica/aclocal.h                      |   2 +-
 drivers/acpi/nfit/core.c                           |   2 +-
 drivers/acpi/processor_idle.c                      |   3 +
 drivers/base/node.c                                |   4 +
 drivers/base/power/main.c                          |  14 +-
 drivers/base/regmap/regmap.c                       |   2 +-
 drivers/block/nbd.c                                |   8 +
 drivers/block/null_blk/main.c                      |   2 +-
 drivers/bluetooth/btintel_pcie.c                   | 218 ++++++----------
 drivers/bluetooth/btintel_pcie.h                   |   2 +
 drivers/bus/fsl-mc/fsl-mc-bus.c                    |   3 +
 drivers/cdx/Kconfig                                |   1 -
 drivers/cdx/cdx.c                                  |   4 +-
 drivers/cdx/controller/Kconfig                     |   1 -
 drivers/cdx/controller/cdx_controller.c            |   3 +-
 drivers/char/hw_random/Kconfig                     |   1 +
 drivers/char/hw_random/ks-sa-rng.c                 |   4 +
 drivers/char/tpm/Kconfig                           |   2 +-
 drivers/clocksource/timer-tegra186.c               |   4 +-
 drivers/cpufreq/scmi-cpufreq.c                     |  10 +
 drivers/cpuidle/cpuidle-qcom-spm.c                 |   7 +-
 drivers/crypto/hisilicon/debugfs.c                 |   1 +
 drivers/crypto/hisilicon/hpre/hpre_main.c          |  86 +++++--
 drivers/crypto/hisilicon/qm.c                      |  45 +++-
 drivers/crypto/hisilicon/sec2/sec_main.c           | 126 +++++++---
 drivers/crypto/hisilicon/zip/zip_main.c            | 102 +++++---
 .../crypto/intel/keembay/keembay-ocs-hcu-core.c    |   5 +-
 .../crypto/marvell/octeontx2/otx2_cptpf_ucode.c    |   2 +-
 drivers/crypto/nx/nx-common-powernv.c              |   6 +-
 drivers/crypto/nx/nx-common-pseries.c              |   6 +-
 drivers/devfreq/event/rockchip-dfi.c               |   7 +-
 drivers/devfreq/mtk-cci-devfreq.c                  |   3 +-
 drivers/edac/i10nm_base.c                          |  14 ++
 drivers/firmware/arm_scmi/transports/virtio.c      |   3 +
 drivers/firmware/efi/Kconfig                       |   7 +-
 drivers/firmware/meson/Kconfig                     |   2 +-
 drivers/fwctl/mlx5/main.c                          |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c            |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |  20 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c           |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h           |  13 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c            | 170 ++++++++++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h            |  11 +
 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c             |   2 +-
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c           |   2 +-
 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c              |  29 ++-
 drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c              |  27 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c              |   1 -
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c              |   2 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c            |   4 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c            |   2 -
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c               |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |   8 +-
 .../display/dc/dml/dcn32/display_rq_dlg_calc_32.c  |   1 -
 .../drm/amd/display/dc/hwss/dce110/dce110_hwseq.c  |  32 ++-
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   5 +-
 .../amd/display/dc/link/accessories/link_dp_cts.c  |  12 +-
 .../amd/display/dc/resource/dcn31/dcn31_resource.c |   5 +-
 .../amd/display/dc/resource/dcn31/dcn31_resource.h |   3 +-
 drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c       |   7 +
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c         |  92 +++++--
 drivers/gpu/drm/bridge/Kconfig                     |   1 +
 drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c     |   4 +-
 drivers/gpu/drm/display/drm_bridge_connector.c     |   4 +
 drivers/gpu/drm/display/drm_dp_helper.c            |   4 +-
 drivers/gpu/drm/drm_atomic_uapi.c                  |  23 +-
 drivers/gpu/drm/drm_panel.c                        |  73 +++++-
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c    |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |   4 +
 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c           |   6 +-
 drivers/gpu/drm/msm/msm_drv.c                      |   1 +
 drivers/gpu/drm/msm/msm_gem_vma.c                  |  31 ++-
 drivers/gpu/drm/msm/msm_kms.c                      |   5 +-
 drivers/gpu/drm/panel/panel-edp.c                  |  20 +-
 drivers/gpu/drm/panel/panel-novatek-nt35560.c      |   2 +-
 drivers/gpu/drm/radeon/r600_cs.c                   |   4 +-
 drivers/gpu/drm/scheduler/tests/mock_scheduler.c   |   2 +-
 drivers/gpu/drm/scheduler/tests/sched_tests.h      |   7 +-
 drivers/gpu/drm/scheduler/tests/tests_basic.c      |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_fence.c              |   2 +-
 drivers/hid/hid-ids.h                              |   2 +
 drivers/hid/hid-quirks.c                           |   2 +
 drivers/hid/hid-steelseries.c                      | 108 +++-----
 drivers/hid/hidraw.c                               | 262 ++++++++++---------
 drivers/hid/i2c-hid/i2c-hid-core.c                 |  46 ++--
 drivers/hid/i2c-hid/i2c-hid-of-elan.c              |  11 +-
 drivers/hwmon/asus-ec-sensors.c                    |   2 +-
 drivers/hwmon/mlxreg-fan.c                         |  24 +-
 drivers/hwtracing/coresight/coresight-catu.c       |  31 ++-
 drivers/hwtracing/coresight/coresight-catu.h       |   1 +
 drivers/hwtracing/coresight/coresight-core.c       |   6 +-
 drivers/hwtracing/coresight/coresight-cpu-debug.c  |   6 +-
 drivers/hwtracing/coresight/coresight-ctcu-core.c  |  10 +-
 drivers/hwtracing/coresight/coresight-etb10.c      |  10 +-
 drivers/hwtracing/coresight/coresight-etm3x-core.c |   9 +-
 drivers/hwtracing/coresight/coresight-etm4x-core.c |  41 +--
 .../hwtracing/coresight/coresight-etm4x-sysfs.c    |   1 +
 drivers/hwtracing/coresight/coresight-etm4x.h      |   6 +-
 drivers/hwtracing/coresight/coresight-funnel.c     |  42 +---
 drivers/hwtracing/coresight/coresight-replicator.c |  40 +--
 drivers/hwtracing/coresight/coresight-stm.c        |  13 +-
 drivers/hwtracing/coresight/coresight-syscfg.c     |   2 +-
 drivers/hwtracing/coresight/coresight-tmc-core.c   |  26 +-
 drivers/hwtracing/coresight/coresight-tmc.h        |   2 +
 drivers/hwtracing/coresight/coresight-tpda.c       |   3 +
 drivers/hwtracing/coresight/coresight-tpiu.c       |  14 +-
 drivers/hwtracing/coresight/coresight-trbe.c       |  12 +-
 drivers/hwtracing/coresight/ultrasoc-smb.h         |   1 +
 drivers/i2c/busses/i2c-designware-platdrv.c        |   5 +-
 drivers/i2c/busses/i2c-k1.c                        |  71 ++++--
 drivers/i2c/busses/i2c-mt65xx.c                    |  17 +-
 drivers/i3c/internals.h                            |  12 +-
 drivers/i3c/master/svc-i3c-master.c                |  31 ++-
 drivers/iio/inkern.c                               |  30 +--
 drivers/infiniband/core/addr.c                     |  10 +-
 drivers/infiniband/core/cm.c                       |   4 +-
 drivers/infiniband/core/sa_query.c                 |   6 +-
 drivers/infiniband/hw/mlx5/main.c                  |  67 ++++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h               |   5 +
 drivers/infiniband/sw/rxe/rxe_task.c               |   8 +-
 drivers/infiniband/sw/siw/siw_verbs.c              |  25 +-
 drivers/input/misc/uinput.c                        |   1 +
 drivers/input/touchscreen/atmel_mxt_ts.c           |   2 +-
 drivers/iommu/intel/debugfs.c                      |  17 +-
 drivers/iommu/intel/iommu.h                        |   3 +-
 drivers/iommu/iommu-priv.h                         |   2 +
 drivers/iommu/iommu.c                              |  26 ++
 drivers/iommu/iommufd/selftest.c                   |   2 +-
 drivers/irqchip/irq-gic-v5-its.c                   |  24 +-
 drivers/irqchip/irq-sg2042-msi.c                   |  18 +-
 drivers/leds/flash/leds-qcom-flash.c               |  62 +++--
 drivers/leds/leds-lp55xx-common.c                  |   2 +-
 drivers/leds/leds-max77705.c                       |   2 +-
 drivers/md/dm-core.h                               |   1 +
 drivers/md/dm-vdo/indexer/volume-index.c           |   4 +-
 drivers/md/dm.c                                    |  13 +-
 drivers/media/i2c/rj54n1cb0c.c                     |   9 +-
 drivers/media/i2c/vd55g1.c                         |   2 +-
 drivers/media/pci/zoran/zoran.h                    |   6 -
 drivers/media/pci/zoran/zoran_driver.c             |   3 +-
 .../media/platform/st/sti/delta/delta-mjpeg-dec.c  |  20 +-
 drivers/mfd/intel_soc_pmic_chtdc_ti.c              |   2 +
 drivers/mfd/max77705.c                             |  38 ++-
 drivers/mfd/rz-mtu3.c                              |   2 +-
 drivers/mfd/vexpress-sysreg.c                      |   6 +-
 drivers/misc/fastrpc.c                             |  89 ++++---
 drivers/misc/genwqe/card_ddcb.c                    |   2 +-
 drivers/misc/pci_endpoint_test.c                   |   2 +-
 drivers/mmc/core/block.c                           |   6 +-
 drivers/mmc/host/Kconfig                           |   1 +
 drivers/mtd/nand/raw/atmel/nand-controller.c       |   4 +-
 drivers/net/bonding/bond_main.c                    |   2 +-
 drivers/net/bonding/bond_netlink.c                 |  16 +-
 drivers/net/ethernet/amazon/ena/ena_ethtool.c      |   5 +-
 drivers/net/ethernet/cadence/macb.h                |   4 -
 drivers/net/ethernet/cadence/macb_main.c           | 134 +++++-----
 drivers/net/ethernet/dlink/dl2k.c                  |   7 +-
 drivers/net/ethernet/freescale/enetc/enetc4_pf.c   |   2 +-
 drivers/net/ethernet/freescale/enetc/ntmp.c        |  15 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.c        |   8 +-
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c    |   6 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |   1 +
 .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c   |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c      |   6 +-
 .../ethernet/mellanox/mlx5/core/en/port_buffer.h   |  12 -
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  17 +-
 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c |  24 ++
 .../net/ethernet/mellanox/mlx5/core/pagealloc.c    |   7 +-
 .../net/ethernet/netronome/nfp/nfp_net_ethtool.c   |   2 +-
 drivers/net/phy/as21xxx.c                          |   7 +-
 drivers/net/usb/asix_devices.c                     |  29 +++
 drivers/net/usb/rtl8150.c                          |   2 -
 drivers/net/wireless/ath/ath10k/wmi.c              |  39 ++-
 drivers/net/wireless/ath/ath12k/ce.c               |   2 +-
 drivers/net/wireless/ath/ath12k/debug.h            |   1 +
 drivers/net/wireless/ath/ath12k/dp_mon.c           |  56 +++--
 drivers/net/wireless/ath/ath12k/dp_rx.c            |  45 +++-
 drivers/net/wireless/ath/ath12k/hal_rx.h           |  12 +-
 drivers/net/wireless/ath/ath12k/mac.c              |  16 +-
 .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c  |   2 +-
 .../wireless/broadcom/brcm80211/brcmfmac/chip.c    |   4 +-
 .../wireless/broadcom/brcm80211/brcmfmac/sdio.c    |   8 +-
 .../broadcom/brcm80211/include/brcm_hw_ids.h       |   1 -
 drivers/net/wireless/intel/iwlwifi/fw/regulatory.h |   1 -
 drivers/net/wireless/marvell/mwifiex/cfg80211.c    |   7 +-
 drivers/net/wireless/mediatek/mt76/mt7603/soc.c    |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h |   6 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c    |  29 +--
 drivers/net/wireless/mediatek/mt76/mt7996/init.c   |  29 ++-
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c    | 137 +++-------
 drivers/net/wireless/mediatek/mt76/mt7996/main.c   | 106 ++++++--
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c    |  38 ++-
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.h    |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h |  22 +-
 drivers/net/wireless/mediatek/mt76/mt7996/pci.c    |   2 +-
 drivers/net/wireless/realtek/rtw88/led.c           |  13 +-
 drivers/net/wireless/realtek/rtw89/core.c          |   1 +
 drivers/net/wireless/realtek/rtw89/ser.c           |   3 +-
 drivers/nvme/host/auth.c                           |   5 +-
 drivers/nvme/host/tcp.c                            |   3 +
 drivers/nvme/target/fc.c                           |  19 +-
 drivers/nvme/target/fcloop.c                       |   8 +-
 drivers/pci/controller/cadence/pci-j721e.c         |   2 +-
 drivers/pci/controller/dwc/pcie-designware.h       |   1 -
 drivers/pci/controller/dwc/pcie-qcom-common.c      |  58 +++--
 drivers/pci/controller/dwc/pcie-qcom-common.h      |   2 +-
 drivers/pci/controller/dwc/pcie-qcom-ep.c          |   6 +-
 drivers/pci/controller/dwc/pcie-qcom.c             |   8 +-
 drivers/pci/controller/dwc/pcie-rcar-gen4.c        |  26 +-
 drivers/pci/controller/dwc/pcie-tegra194.c         |   4 +-
 drivers/pci/controller/pci-tegra.c                 |   2 +-
 drivers/pci/controller/pci-xgene-msi.c             |   2 +-
 drivers/pci/controller/pcie-rcar-host.c            |   2 +-
 drivers/pci/endpoint/functions/pci-epf-test.c      |  31 ++-
 drivers/pci/endpoint/pci-ep-msi.c                  |   2 +-
 drivers/pci/msi/irqdomain.c                        |  57 +++++
 drivers/pci/pci-acpi.c                             |   6 +-
 drivers/pci/pcie/aer.c                             |   3 +
 drivers/pci/pwrctrl/slot.c                         |  12 +-
 drivers/perf/arm_spe_pmu.c                         |   3 +-
 drivers/phy/rockchip/phy-rockchip-naneng-combphy.c |  12 +
 drivers/pinctrl/Kconfig                            |   2 +
 drivers/pinctrl/meson/pinctrl-meson-gxl.c          |  10 +
 drivers/pinctrl/pinctrl-eic7700.c                  |   2 +-
 drivers/pinctrl/pinmux.c                           |   2 +-
 drivers/pinctrl/renesas/pinctrl-rzg2l.c            |   2 +-
 drivers/pinctrl/renesas/pinctrl.c                  |   3 +-
 drivers/power/supply/cw2015_battery.c              |   3 +-
 drivers/power/supply/max77705_charger.c            | 198 +++++++--------
 drivers/pps/kapi.c                                 |   5 +-
 drivers/pps/pps.c                                  |   5 +-
 drivers/ptp/ptp_private.h                          |   1 +
 drivers/ptp/ptp_sysfs.c                            |   2 +-
 drivers/pwm/pwm-loongson.c                         |   2 +-
 drivers/pwm/pwm-tiehrpwm.c                         | 154 +++++-------
 drivers/regulator/scmi-regulator.c                 |   3 +-
 drivers/remoteproc/pru_rproc.c                     |   3 +-
 drivers/remoteproc/qcom_q6v5.c                     |   3 -
 drivers/remoteproc/qcom_q6v5_mss.c                 |  11 +-
 drivers/remoteproc/qcom_q6v5_pas.c                 |   6 +
 drivers/rpmsg/qcom_smd.c                           |   2 +-
 drivers/scsi/libsas/sas_expander.c                 |   5 +-
 drivers/scsi/mpt3sas/mpt3sas_transport.c           |   8 +-
 drivers/scsi/myrs.c                                |   8 +-
 drivers/scsi/pm8001/pm8001_hwi.c                   |  11 +-
 drivers/scsi/pm8001/pm8001_sas.c                   |  31 ++-
 drivers/scsi/pm8001/pm8001_sas.h                   |   1 +
 drivers/scsi/pm8001/pm80xx_hwi.c                   |  10 +-
 drivers/scsi/qla2xxx/qla_edif.c                    |   4 +-
 drivers/scsi/qla2xxx/qla_init.c                    |   4 +-
 drivers/scsi/qla2xxx/qla_nvme.c                    |   2 +-
 drivers/soc/mediatek/mtk-svs.c                     |  23 ++
 drivers/soc/qcom/rpmh-rsc.c                        |   7 +-
 drivers/spi/spi.c                                  |   2 +-
 drivers/staging/media/ipu7/ipu7.c                  |  28 +--
 drivers/tee/tee_shm.c                              |   8 +
 drivers/thermal/qcom/Kconfig                       |   3 +-
 drivers/thermal/qcom/lmh.c                         |   2 +
 drivers/thunderbolt/tunnel.c                       |   5 +-
 drivers/tty/n_gsm.c                                |  25 +-
 drivers/tty/serial/max310x.c                       |   2 +
 drivers/ufs/core/ufs-sysfs.c                       |   2 +
 drivers/ufs/core/ufshcd.c                          |   9 +
 drivers/uio/uio_hv_generic.c                       |   7 +-
 drivers/usb/cdns3/cdnsp-pci.c                      |   5 +-
 drivers/usb/gadget/configfs.c                      |   2 +
 drivers/usb/host/max3421-hcd.c                     |   2 +-
 drivers/usb/host/xhci-ring.c                       |  11 +-
 drivers/usb/misc/Kconfig                           |   1 +
 drivers/usb/misc/qcom_eud.c                        |  33 ++-
 drivers/usb/phy/phy-twl6030-usb.c                  |   3 +-
 drivers/usb/typec/tipd/core.c                      |  24 +-
 drivers/usb/usbip/vhci_hcd.c                       |  22 ++
 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c     |   6 +-
 drivers/vfio/pci/pds/dirty.c                       |   2 +-
 drivers/vhost/vringh.c                             |  14 +-
 drivers/video/fbdev/simplefb.c                     |  31 ++-
 drivers/watchdog/intel_oc_wdt.c                    |   8 +-
 drivers/watchdog/mpc8xxx_wdt.c                     |   2 +
 fs/btrfs/extent_io.c                               |   9 +-
 fs/btrfs/inode.c                                   |   2 +-
 fs/cramfs/inode.c                                  |   2 +-
 fs/erofs/zdata.c                                   |   4 +-
 fs/ext4/ext4.h                                     |  10 +
 fs/ext4/file.c                                     |   2 +-
 fs/ext4/inode.c                                    |   2 +-
 fs/ext4/mballoc.c                                  |  10 +
 fs/ext4/orphan.c                                   |   6 +-
 fs/ext4/super.c                                    |   4 +-
 fs/f2fs/compress.c                                 |  25 +-
 fs/f2fs/data.c                                     |  11 +-
 fs/f2fs/f2fs.h                                     |   4 +-
 fs/f2fs/file.c                                     |  49 ++--
 fs/f2fs/gc.c                                       |  16 +-
 fs/f2fs/super.c                                    |  10 +-
 fs/fuse/file.c                                     |   1 -
 fs/gfs2/file.c                                     |  23 +-
 fs/gfs2/glock.c                                    | 121 ++++-----
 fs/gfs2/glock.h                                    |   4 +
 fs/gfs2/incore.h                                   |   3 +-
 fs/gfs2/lock_dlm.c                                 |  72 ++++--
 fs/gfs2/trace_gfs2.h                               |   1 -
 fs/hfsplus/dir.c                                   |   2 +-
 fs/hfsplus/hfsplus_fs.h                            |   8 +-
 fs/hfsplus/unicode.c                               |  24 +-
 fs/hfsplus/xattr.c                                 |   6 +-
 fs/nfs/localio.c                                   |  65 ++++-
 fs/nfs/nfs4proc.c                                  |   2 +-
 fs/nfsd/filecache.c                                |  34 +++
 fs/nfsd/filecache.h                                |   4 +
 fs/nfsd/localio.c                                  |  11 +
 fs/nfsd/trace.h                                    |  27 ++
 fs/nfsd/vfs.h                                      |   4 +
 fs/notify/fanotify/fanotify_user.c                 |   3 +
 fs/ntfs3/index.c                                   |  10 +
 fs/ntfs3/run.c                                     |  12 +-
 fs/ocfs2/stack_user.c                              |   1 +
 fs/smb/client/smb2ops.c                            |  17 +-
 fs/smb/client/smbdirect.c                          | 110 +++++++-
 fs/smb/client/smbdirect.h                          |   4 +-
 fs/smb/server/ksmbd_netlink.h                      |   5 +-
 fs/smb/server/mgmt/user_session.c                  |  26 +-
 fs/smb/server/server.h                             |   1 +
 fs/smb/server/smb2pdu.c                            |   3 +-
 fs/smb/server/transport_ipc.c                      |   3 +
 fs/smb/server/transport_rdma.c                     |  97 ++++++-
 fs/smb/server/transport_tcp.c                      |  27 +-
 fs/squashfs/inode.c                                |   7 +
 fs/squashfs/squashfs_fs_i.h                        |   2 +-
 fs/udf/inode.c                                     |   3 +
 include/acpi/actbl.h                               |   2 +-
 include/asm-generic/vmlinux.lds.h                  |   1 +
 include/crypto/internal/scompress.h                |  11 +-
 include/drm/drm_panel.h                            |  14 ++
 include/linux/blk_types.h                          |   7 +-
 include/linux/blkdev.h                             |   2 +
 include/linux/bpf.h                                |   1 +
 include/linux/bpf_verifier.h                       |  12 +-
 include/linux/btf.h                                |   2 +-
 include/linux/coresight.h                          |  25 +-
 include/linux/dmaengine.h                          |   2 +-
 include/linux/hid.h                                |   2 +
 include/linux/irq.h                                |   2 +
 include/linux/memcontrol.h                         |   6 +
 include/linux/mm.h                                 |   2 +-
 include/linux/mmc/sdio_ids.h                       |   2 +-
 include/linux/msi.h                                |   2 +
 include/linux/nfslocalio.h                         |   2 +
 include/linux/once.h                               |   4 +-
 include/linux/phy.h                                |  23 +-
 include/linux/power/max77705_charger.h             | 102 ++++----
 include/linux/sched/topology.h                     |  28 ++-
 include/linux/topology.h                           |   2 +-
 include/net/bonding.h                              |   1 +
 include/net/dst.h                                  |  16 +-
 include/net/ip.h                                   |  30 ++-
 include/net/ip6_route.h                            |   2 +-
 include/net/route.h                                |   2 +-
 include/scsi/libsas.h                              |   8 +
 include/trace/events/filelock.h                    |   3 +-
 include/trace/misc/fs.h                            |  22 ++
 include/uapi/linux/hidraw.h                        |   2 +
 include/ufs/ufshcd.h                               |   3 +
 include/vdso/gettime.h                             |   1 +
 init/Kconfig                                       |   3 +-
 io_uring/waitid.c                                  |   3 +-
 io_uring/zcrx.c                                    |   4 +
 kernel/bpf/core.c                                  |   5 +
 kernel/bpf/helpers.c                               |   3 -
 kernel/bpf/verifier.c                              |  28 ++-
 kernel/cgroup/cpuset.c                             |   2 +-
 kernel/events/uprobes.c                            |   2 +-
 kernel/irq/Kconfig                                 |   2 +
 kernel/irq/chip.c                                  |  37 +++
 kernel/irq/irq_test.c                              |  18 +-
 kernel/pid.c                                       |   2 +-
 kernel/rcu/srcutiny.c                              |   4 +-
 kernel/sched/topology.c                            |  28 +--
 kernel/seccomp.c                                   |  12 +-
 kernel/smp.c                                       |  11 +-
 kernel/time/clockevents.c                          |   2 +-
 kernel/time/tick-common.c                          |  16 +-
 kernel/time/tick-internal.h                        |   2 +-
 kernel/trace/bpf_trace.c                           |   9 +-
 kernel/trace/trace.c                               | 278 +++++++++++++++++----
 kernel/trace/trace_events.c                        |   3 +-
 kernel/trace/trace_fprobe.c                        |  10 +-
 kernel/trace/trace_irqsoff.c                       |  23 +-
 kernel/trace/trace_kprobe.c                        |  11 +-
 kernel/trace/trace_probe.h                         |   9 +-
 kernel/trace/trace_sched_wakeup.c                  |  16 +-
 kernel/trace/trace_uprobe.c                        |  12 +-
 lib/raid6/recov_rvv.c                              |   2 -
 lib/raid6/rvv.c                                    |   3 -
 lib/vdso/datastore.c                               |   6 +-
 mm/hugetlb.c                                       |   2 +
 mm/memcontrol.c                                    |  13 +
 mm/slub.c                                          |   5 +-
 net/9p/trans_usbg.c                                |  16 +-
 net/bluetooth/hci_sync.c                           |  10 +-
 net/bluetooth/iso.c                                |  11 +-
 net/bluetooth/mgmt.c                               |  10 +-
 net/core/dst.c                                     |   2 +-
 net/core/filter.c                                  |  16 +-
 net/core/sock.c                                    |  16 +-
 net/ethtool/tsconfig.c                             |  12 +-
 net/ipv4/icmp.c                                    |   6 +-
 net/ipv4/ip_fragment.c                             |   6 +-
 net/ipv4/ipmr.c                                    |   6 +-
 net/ipv4/ping.c                                    |  14 +-
 net/ipv4/route.c                                   |   8 +-
 net/ipv4/tcp.c                                     |   9 +-
 net/ipv4/tcp_input.c                               |  15 +-
 net/ipv4/tcp_metrics.c                             |   6 +-
 net/ipv6/anycast.c                                 |   2 +-
 net/ipv6/icmp.c                                    |   9 +-
 net/ipv6/ip6_output.c                              |  64 ++---
 net/ipv6/mcast.c                                   |  67 +++--
 net/ipv6/ndisc.c                                   |   2 +-
 net/ipv6/output_core.c                             |   8 +-
 net/ipv6/proc.c                                    |  47 ++--
 net/ipv6/route.c                                   |   7 +-
 net/mac80211/cfg.c                                 |  21 +-
 net/mac80211/main.c                                |   3 -
 net/mac80211/rx.c                                  |  28 ++-
 net/mac80211/sta_info.c                            |  10 +-
 net/mptcp/ctrl.c                                   |   9 +-
 net/mptcp/subflow.c                                |  11 +-
 net/netfilter/ipset/ip_set_hash_gen.h              |   8 +-
 net/netfilter/ipvs/ip_vs_conn.c                    |   4 +-
 net/netfilter/ipvs/ip_vs_core.c                    |  11 +-
 net/netfilter/ipvs/ip_vs_ctl.c                     |   6 +-
 net/netfilter/ipvs/ip_vs_est.c                     |  16 +-
 net/netfilter/ipvs/ip_vs_ftp.c                     |   4 +-
 net/netfilter/nf_conntrack_standalone.c            |   3 +
 net/netfilter/nfnetlink.c                          |   2 +
 net/nfc/nci/ntf.c                                  | 135 +++++++---
 net/smc/smc_clc.c                                  |  67 ++---
 net/smc/smc_core.c                                 |  27 +-
 net/smc/smc_pnet.c                                 |  43 ++--
 net/sunrpc/auth_gss/svcauth_gss.c                  |   2 +-
 net/tls/tls_device.c                               |  18 +-
 net/wireless/util.c                                |   2 +-
 rust/bindings/bindings_helper.h                    |   1 +
 rust/kernel/cpumask.rs                             |   1 +
 scripts/misc-check                                 |   4 +-
 security/Kconfig                                   |   1 +
 sound/core/pcm_native.c                            |  21 +-
 sound/hda/codecs/hdmi/hdmi.c                       |   1 +
 sound/hda/codecs/realtek/alc269.c                  |   1 +
 sound/pci/lx6464es/lx_core.c                       |   4 +-
 sound/soc/codecs/wcd934x.c                         |  17 +-
 sound/soc/codecs/wcd937x.c                         |   4 +-
 sound/soc/codecs/wcd937x.h                         |   6 +-
 sound/soc/intel/boards/bytcht_es8316.c             |  20 +-
 sound/soc/intel/boards/bytcr_rt5640.c              |   7 +-
 sound/soc/intel/boards/bytcr_rt5651.c              |  26 +-
 sound/soc/intel/boards/sof_sdw.c                   |   2 +-
 sound/soc/qcom/sc8280xp.c                          |   4 +-
 sound/soc/sof/intel/hda-sdw-bpt.c                  |   2 +-
 sound/soc/sof/ipc3-topology.c                      |  10 +-
 sound/soc/sof/ipc4-pcm.c                           | 101 ++++++--
 sound/soc/sof/ipc4-topology.c                      |   1 -
 sound/soc/sof/ipc4-topology.h                      |   2 +
 tools/include/nolibc/nolibc.h                      |   1 +
 tools/include/nolibc/std.h                         |   2 +-
 tools/include/nolibc/sys.h                         |  13 +
 tools/include/nolibc/time.h                        |   5 +-
 tools/lib/bpf/libbpf.c                             |  46 ++--
 tools/lib/bpf/libbpf.h                             |   2 +-
 tools/net/ynl/pyynl/lib/ynl.py                     |   2 +-
 .../acpi/os_specific/service_layers/oslinuxtbl.c   |   4 +-
 tools/testing/nvdimm/test/ndtest.c                 |  13 +-
 tools/testing/selftests/arm64/abi/tpidr2.c         |   8 +-
 tools/testing/selftests/arm64/gcs/basic-gcs.c      |   2 +-
 tools/testing/selftests/arm64/pauth/exec_target.c  |   7 +-
 tools/testing/selftests/bpf/Makefile               |   4 +-
 tools/testing/selftests/bpf/bench.c                |   2 +-
 tools/testing/selftests/bpf/prog_tests/btf_dump.c  |   2 +-
 tools/testing/selftests/bpf/prog_tests/fd_array.c  |   2 +-
 .../selftests/bpf/prog_tests/kprobe_multi_test.c   | 220 +---------------
 .../selftests/bpf/prog_tests/module_attach.c       |   2 +-
 .../testing/selftests/bpf/prog_tests/reg_bounds.c  |   4 +-
 .../selftests/bpf/prog_tests/stacktrace_build_id.c |   2 +-
 .../bpf/prog_tests/stacktrace_build_id_nmi.c       |   2 +-
 .../selftests/bpf/prog_tests/stacktrace_map.c      |   2 +-
 .../bpf/prog_tests/stacktrace_map_raw_tp.c         |   2 +-
 .../selftests/bpf/prog_tests/stacktrace_map_skip.c |   2 +-
 tools/testing/selftests/bpf/progs/bpf_cc_cubic.c   |   2 +-
 tools/testing/selftests/bpf/progs/bpf_dctcp.c      |   2 +-
 .../selftests/bpf/progs/freplace_connect_v4_prog.c |   2 +-
 .../selftests/bpf/progs/iters_state_safety.c       |   2 +-
 tools/testing/selftests/bpf/progs/rbtree_search.c  |   2 +-
 .../selftests/bpf/progs/struct_ops_kptr_return.c   |   2 +-
 .../selftests/bpf/progs/struct_ops_refcounted.c    |   2 +-
 .../selftests/bpf/progs/test_cls_redirect.c        |   2 +-
 .../selftests/bpf/progs/test_cls_redirect_dynptr.c |   2 +-
 .../selftests/bpf/progs/test_tcpnotify_kern.c      |   1 -
 .../testing/selftests/bpf/progs/uretprobe_stack.c  |   4 +-
 .../selftests/bpf/progs/verifier_scalar_ids.c      |   2 +-
 .../testing/selftests/bpf/progs/verifier_var_off.c |   6 +-
 tools/testing/selftests/bpf/test_sockmap.c         |   2 +-
 tools/testing/selftests/bpf/test_tcpnotify_user.c  |  20 +-
 tools/testing/selftests/bpf/trace_helpers.c        | 214 ++++++++++++++++
 tools/testing/selftests/bpf/trace_helpers.h        |   3 +
 tools/testing/selftests/bpf/verifier/calls.c       |   8 +-
 tools/testing/selftests/bpf/xdping.c               |   2 +-
 tools/testing/selftests/bpf/xsk.h                  |   4 +-
 tools/testing/selftests/bpf/xskxceiver.c           |  14 +-
 tools/testing/selftests/cgroup/lib/cgroup_util.c   |  12 +
 .../selftests/cgroup/lib/include/cgroup_util.h     |   1 +
 tools/testing/selftests/cgroup/test_pids.c         |   3 +
 tools/testing/selftests/futex/functional/Makefile  |   5 +-
 .../selftests/futex/functional/futex_numa_mpol.c   |  59 ++---
 .../selftests/futex/functional/futex_priv_hash.c   |   1 -
 tools/testing/selftests/futex/functional/run.sh    |   1 -
 tools/testing/selftests/futex/include/futextest.h  |  11 +
 tools/testing/selftests/iommu/iommufd_utils.h      |   8 +-
 tools/testing/selftests/kselftest_harness/Makefile |   1 +
 tools/testing/selftests/lib.mk                     |   5 +-
 tools/testing/selftests/mm/madv_populate.c         |  21 +-
 tools/testing/selftests/mm/soft-dirty.c            |   5 +-
 tools/testing/selftests/mm/va_high_addr_switch.c   |   4 +-
 tools/testing/selftests/mm/vm_util.c               |  17 ++
 tools/testing/selftests/mm/vm_util.h               |   1 +
 tools/testing/selftests/nolibc/nolibc-test.c       |   5 +-
 tools/testing/selftests/vDSO/vdso_call.h           |   7 +-
 tools/testing/selftests/vDSO/vdso_test_abi.c       |   9 +-
 tools/testing/selftests/watchdog/watchdog-test.c   |   6 +
 684 files changed, 6525 insertions(+), 3960 deletions(-)
author maintainer
#1 lore raw

PATCH 1/563 arch: copy_thread: pass clone_flags as u64

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

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

From: Simon Schuster <[email protected]>

[ Upstream commit bbc46b23af5bb934cd1cf066ef4342cee457a24e ]

With the introduction of clone3 in commit 7f192e3cd316 ("fork: add clone3") the effective bit width of clone_flags on all architectures was increased from 32-bit to 64-bit, with a new type of u64 for the flags. However, for most consumers of clone_flags the interface was not changed from the previous type of unsigned long.

While this works fine as long as none of the new 64-bit flag bits (CLONE_CLEAR_SIGHAND and CLONE_INTO_CGROUP) are evaluated, this is still undesirable in terms of the principle of least surprise.

Thus, this commit fixes all relevant interfaces of the copy_thread function that is called from copy_process to consistently pass clone_flags as u64, so that no truncation to 32-bit integers occurs on 32-bit architectures.

---
 arch/alpha/kernel/process.c      | 2 +-
 arch/arc/kernel/process.c        | 2 +-
 arch/arm/kernel/process.c        | 2 +-
 arch/arm64/kernel/process.c      | 2 +-
 arch/csky/kernel/process.c       | 2 +-
 arch/hexagon/kernel/process.c    | 2 +-
 arch/loongarch/kernel/process.c  | 2 +-
 arch/m68k/kernel/process.c       | 2 +-
 arch/microblaze/kernel/process.c | 2 +-
 arch/mips/kernel/process.c       | 2 +-
 arch/nios2/kernel/process.c      | 2 +-
 arch/openrisc/kernel/process.c   | 2 +-
 arch/parisc/kernel/process.c     | 2 +-
 arch/powerpc/kernel/process.c    | 2 +-
 arch/riscv/kernel/process.c      | 2 +-
 arch/s390/kernel/process.c       | 2 +-
 arch/sh/kernel/process_32.c      | 2 +-
 arch/sparc/kernel/process_32.c   | 2 +-
 arch/sparc/kernel/process_64.c   | 2 +-
 arch/um/kernel/process.c         | 2 +-
 arch/x86/include/asm/fpu/sched.h | 2 +-
 arch/x86/include/asm/shstk.h     | 4 ++--
 arch/x86/kernel/fpu/core.c       | 2 +-
 arch/x86/kernel/process.c        | 2 +-
 arch/x86/kernel/shstk.c          | 2 +-
 arch/xtensa/kernel/process.c     | 2 +-
 26 files changed, 27 insertions(+), 27 deletions(-)
arch/alpha/kernel/process.c +1 -1
index 582d96548385d..06522451f018f 100644
@@ -231,7 +231,7 @@ flush_thread(void)
  */
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	extern void ret_from_fork(void);
arch/arc/kernel/process.c +1 -1
index 186ceab661eb0..8166d09087130 100644
@@ -166,7 +166,7 @@ asmlinkage void ret_from_fork(void);
  */
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *c_regs;        /* child's pt_regs */
arch/arm/kernel/process.c +1 -1
index e16ed102960cb..d7aa95225c70b 100644
@@ -234,7 +234,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long stack_start = args->stack;
 	unsigned long tls = args->tls;
 	struct thread_info *thread = task_thread_info(p);
arch/arm64/kernel/process.c +1 -1
index 96482a1412c6a..fba7ca102a8c4 100644
@@ -409,7 +409,7 @@ asmlinkage void ret_from_fork(void) asm("ret_from_fork");
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long stack_start = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *childregs = task_pt_regs(p);
arch/csky/kernel/process.c +1 -1
index 0c6e4b17fe00f..a7a90340042a5 100644
@@ -32,7 +32,7 @@ void flush_thread(void){}
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct switch_stack *childstack;
arch/hexagon/kernel/process.c +1 -1
index 2a77bfd756945..15b4992bfa298 100644
@@ -52,7 +52,7 @@ void arch_cpu_idle(void)
  */
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct thread_info *ti = task_thread_info(p);
arch/loongarch/kernel/process.c +1 -1
index 3582f591bab28..efd9edf65603c 100644
@@ -167,7 +167,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 	unsigned long childksp;
 	unsigned long tls = args->tls;
 	unsigned long usp = args->stack;
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	struct pt_regs *childregs, *regs = current_pt_regs();
 
 	childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE;
arch/m68k/kernel/process.c +1 -1
index fda7eac23f872..f5a07a70e9385 100644
@@ -141,7 +141,7 @@ asmlinkage int m68k_clone3(struct pt_regs *regs)
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct fork_frame {
arch/microblaze/kernel/process.c +1 -1
index 56342e11442d2..6cbf642d7b801 100644
@@ -54,7 +54,7 @@ void flush_thread(void)
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *childregs = task_pt_regs(p);
arch/mips/kernel/process.c +1 -1
index 02aa6a04a21da..29191fa1801e2 100644
@@ -107,7 +107,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
  */
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct thread_info *ti = task_thread_info(p);
arch/nios2/kernel/process.c +1 -1
index f84021303f6a8..151404139085c 100644
@@ -101,7 +101,7 @@ void flush_thread(void)
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *childregs = task_pt_regs(p);
arch/openrisc/kernel/process.c +1 -1
index eef99fee2110c..73ffb9fa3118b 100644
@@ -165,7 +165,7 @@ extern asmlinkage void ret_from_fork(void);
 int
 copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *userregs;
arch/parisc/kernel/process.c +1 -1
index ed93bd8c15453..e64ab5d2a40d6 100644
@@ -201,7 +201,7 @@ arch_initcall(parisc_idle_init);
 int
 copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *cregs = &(p->thread.regs);
arch/powerpc/kernel/process.c +1 -1
index 855e098865032..eb23966ac0a9f 100644
@@ -1805,7 +1805,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 			f = ret_from_kernel_user_thread;
 		} else {
 			struct pt_regs *regs = current_pt_regs();
-			unsigned long clone_flags = args->flags;
+			u64 clone_flags = args->flags;
 			unsigned long usp = args->stack;
 
 			/* Copy registers */
arch/riscv/kernel/process.c +1 -1
index a0a40889d79a5..31a392993cb45 100644
@@ -223,7 +223,7 @@ asmlinkage void ret_from_fork_user(struct pt_regs *regs)
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *childregs = task_pt_regs(p);
arch/s390/kernel/process.c +1 -1
index f55f09cda6f88..b107dbca4ed7d 100644
@@ -106,7 +106,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long new_stackp = args->stack;
 	unsigned long tls = args->tls;
 	struct fake_frame
arch/sh/kernel/process_32.c +1 -1
index 92b6649d49295..62f753a85b89c 100644
@@ -89,7 +89,7 @@ asmlinkage void ret_from_kernel_thread(void);
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp = args->stack;
 	unsigned long tls = args->tls;
 	struct thread_info *ti = task_thread_info(p);
arch/sparc/kernel/process_32.c +1 -1
index 9c7c662cb5659..5a28c0e91bf15 100644
@@ -260,7 +260,7 @@ extern void ret_from_kernel_thread(void);
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long sp = args->stack;
 	unsigned long tls = args->tls;
 	struct thread_info *ti = task_thread_info(p);
arch/sparc/kernel/process_64.c +1 -1
index 529adfecd58ca..25781923788a0 100644
@@ -567,7 +567,7 @@ void fault_in_user_windows(struct pt_regs *regs)
  */
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long sp = args->stack;
 	unsigned long tls = args->tls;
 	struct thread_info *t = task_thread_info(p);
arch/um/kernel/process.c +1 -1
index 1be644de9e41e..9c9c66dc45f05 100644
@@ -143,7 +143,7 @@ static void fork_handler(void)
 
 int copy_thread(struct task_struct * p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long sp = args->stack;
 	unsigned long tls = args->tls;
 	void (*handler)(void);
arch/x86/include/asm/fpu/sched.h +1 -1
index c060549c6c940..89004f4ca208d 100644
@@ -11,7 +11,7 @@
 
 extern void save_fpregs_to_fpstate(struct fpu *fpu);
 extern void fpu__drop(struct task_struct *tsk);
-extern int  fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal,
+extern int  fpu_clone(struct task_struct *dst, u64 clone_flags, bool minimal,
 		      unsigned long shstk_addr);
 extern void fpu_flush_thread(void);
 
arch/x86/include/asm/shstk.h +2 -2
index ba6f2fe438488..0f50e01259430 100644
@@ -16,7 +16,7 @@ struct thread_shstk {
 
 long shstk_prctl(struct task_struct *task, int option, unsigned long arg2);
 void reset_thread_features(void);
-unsigned long shstk_alloc_thread_stack(struct task_struct *p, unsigned long clone_flags,
+unsigned long shstk_alloc_thread_stack(struct task_struct *p, u64 clone_flags,
 				       unsigned long stack_size);
 void shstk_free(struct task_struct *p);
 int setup_signal_shadow_stack(struct ksignal *ksig);
@@ -28,7 +28,7 @@ static inline long shstk_prctl(struct task_struct *task, int option,
 			       unsigned long arg2) { return -EINVAL; }
 static inline void reset_thread_features(void) {}
 static inline unsigned long shstk_alloc_thread_stack(struct task_struct *p,
-						     unsigned long clone_flags,
+						     u64 clone_flags,
 						     unsigned long stack_size) { return 0; }
 static inline void shstk_free(struct task_struct *p) {}
 static inline int setup_signal_shadow_stack(struct ksignal *ksig) { return 0; }
arch/x86/kernel/fpu/core.c +1 -1
index aefd412a23dc2..1f71cc135e9ad 100644
@@ -631,7 +631,7 @@ static int update_fpu_shstk(struct task_struct *dst, unsigned long ssp)
 }
 
 /* Clone current's FPU state on fork */
-int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal,
+int fpu_clone(struct task_struct *dst, u64 clone_flags, bool minimal,
 	      unsigned long ssp)
 {
 	/*
arch/x86/kernel/process.c +1 -1
index 1b7960cf6eb0c..e3a3987b0c4fb 100644
@@ -159,7 +159,7 @@ __visible void ret_from_fork(struct task_struct *prev, struct pt_regs *regs,
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long sp = args->stack;
 	unsigned long tls = args->tls;
 	struct inactive_task_frame *frame;
arch/x86/kernel/shstk.c +1 -1
index 2ddf23387c7ef..5eba6c5a67757 100644
@@ -191,7 +191,7 @@ void reset_thread_features(void)
 	current->thread.features_locked = 0;
 }
 
-unsigned long shstk_alloc_thread_stack(struct task_struct *tsk, unsigned long clone_flags,
+unsigned long shstk_alloc_thread_stack(struct task_struct *tsk, u64 clone_flags,
 				       unsigned long stack_size)
 {
 	struct thread_shstk *shstk = &tsk->thread.shstk;
arch/xtensa/kernel/process.c +1 -1
index 7bd66677f7b6d..94d43f44be131 100644
@@ -267,7 +267,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 
 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
-	unsigned long clone_flags = args->flags;
+	u64 clone_flags = args->flags;
 	unsigned long usp_thread_fn = args->stack;
 	unsigned long tls = args->tls;
 	struct pt_regs *childregs = task_pt_regs(p);
Signature · 1 line
2.51.0
author maintainer
#2 lore raw

PATCH 2/563 filelock: add FL_RECLAIM to show_fl_flags() macro

In reply to Greg Kroah-Hartman

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

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

From: Jeff Layton <[email protected]>

[ Upstream commit c593b9d6c446510684da400833f9d632651942f0 ]

Show the FL_RECLAIM flag symbolically in tracepoints.

Fixes bb0a55bb7148 ("nfs: don't allow reexport reclaims")
---
 include/trace/events/filelock.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/trace/events/filelock.h +2 -1
index b8d1e00a7982c..2dfeb158e848a 100644
@@ -27,7 +27,8 @@
 		{ FL_SLEEP,		"FL_SLEEP" },			\
 		{ FL_DOWNGRADE_PENDING,	"FL_DOWNGRADE_PENDING" },	\
 		{ FL_UNLOCK_PENDING,	"FL_UNLOCK_PENDING" },		\
-		{ FL_OFDLCK,		"FL_OFDLCK" })
+		{ FL_OFDLCK,		"FL_OFDLCK" },			\
+		{ FL_RECLAIM,		"FL_RECLAIM"})
 
 #define show_fl_type(val)				\
 	__print_symbolic(val,				\
Signature · 1 line
2.51.0
author maintainer
#3 lore raw

PATCH 3/563 init: INITRAMFS_PRESERVE_MTIME should depend on BLK_DEV_INITRD

In reply to Greg Kroah-Hartman

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

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

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 74792608606a525a0e0df7e8d48acd8000561389 ]

INITRAMFS_PRESERVE_MTIME is only used in init/initramfs.c and init/initramfs_test.c. Hence add a dependency on BLK_DEV_INITRD, to prevent asking the user about this feature when configuring a kernel without initramfs support.

Fixes 1274aea127b2e8c9 ("initramfs: add INITRAMFS_PRESERVE_MTIME Kconfig option")
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)
init/Kconfig +1 -0
index ecddb94db8dc0..e5d6d798994ae 100644
@@ -1504,6 +1504,7 @@ config BOOT_CONFIG_EMBED_FILE
 
 config INITRAMFS_PRESERVE_MTIME
 	bool "Preserve cpio archive mtimes in initramfs"
+	depends on BLK_DEV_INITRD
 	default y
 	help
 	  Each entry in an initramfs cpio archive carries an mtime value. When
Signature · 1 line
2.51.0
author maintainer
#4 lore raw

PATCH 4/563 pid: use ns_capable_noaudit() when determining net sysctl permissions

In reply to Greg Kroah-Hartman

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

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

From: Christian Göttsche <[email protected]>

[ Upstream commit b9cb7e59ac4ae68940347ebfc41e0436d32d3c6e ]

The capability check should not be audited since it is only being used to determine the inode permissions. A failed check does not indicate a violation of security policy but, when an LSM is enabled, a denial audit message was being generated.

The denial audit message can either lead to the capability being unnecessarily allowed in a security policy, or being silenced potentially masking a legitimate capability check at a later point in time.

Similar to commit d6169b0206db ("net: Use ns_capable_noaudit() when determining net sysctl permissions")

Fixes 7863dcc72d0f ("pid: allow pid_max to be set per pid namespace")
CC Christian Brauner <[email protected]>
---
 kernel/pid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/pid.c +1 -1
index c45a28c16cd25..d94ce02505012 100644
@@ -680,7 +680,7 @@ static int pid_table_root_permissions(struct ctl_table_header *head,
 		container_of(head->set, struct pid_namespace, set);
 	int mode = table->mode;
 
-	if (ns_capable(pidns->user_ns, CAP_SYS_ADMIN) ||
+	if (ns_capable_noaudit(pidns->user_ns, CAP_SYS_ADMIN) ||
 	    uid_eq(current_euid(), make_kuid(pidns->user_ns, 0)))
 		mode = (mode & S_IRWXU) >> 6;
 	else if (in_egroup_p(make_kgid(pidns->user_ns, 0)))
Signature · 1 line
2.51.0
author maintainer
#5 lore raw

PATCH 5/563 Fix CC_HAS_ASM_GOTO_OUTPUT on non-x86 architectures

In reply to Greg Kroah-Hartman

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

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

From: Linus Torvalds <[email protected]>

[ Upstream commit fde0ab43b9a30d08817adc5402b69fec83a61cb8 ]

There's a silly problem with the CC_HAS_ASM_GOTO_OUTPUT test: even with a working compiler it will fail on some architectures simply because it uses the mnemonic "jmp" for testing the inline asm.

And as reported by Geert, not all architectures use that mnemonic, so the test fails spuriously on such platforms (including arm and riscv, but also several other architectures).

This issue avoided any obvious test failures because the build still works thanks to falling back on the old non-asm-goto code, which just generates worse code.

Just use an empty asm statement instead.

Fixes e2ffa15b9baa ("kbuild: Disable CC_HAS_ASM_GOTO_OUTPUT on clang < 17")
Cc Nathan Chancellor <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 init/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
init/Kconfig +1 -1
index e5d6d798994ae..87c868f86a060 100644
@@ -102,7 +102,7 @@ config CC_HAS_ASM_GOTO_OUTPUT
 	# Detect basic support
 	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
 	# Detect clang (< v17) scoped label issues
-	depends on $(success,echo 'void b(void **);void* c(void);int f(void){{asm goto("jmp %l0"::::l0);return 0;l0:return 1;}void *x __attribute__((cleanup(b)))=c();{asm goto("jmp %l0"::::l1);return 2;l1:return 3;}}' | $(CC) -x c - -c -o /dev/null)
+	depends on $(success,echo 'void b(void **);void* c(void);int f(void){{asm goto(""::::l0);return 0;l0:return 1;}void *x __attribute__((cleanup(b)))=c();{asm goto(""::::l1);return 2;l1:return 3;}}' | $(CC) -x c - -c -o /dev/null)
 
 config CC_HAS_ASM_GOTO_TIED_OUTPUT
 	depends on CC_HAS_ASM_GOTO_OUTPUT
Signature · 1 line
2.51.0
author maintainer
#6 lore raw

PATCH 6/563 seccomp: Fix a race with WAIT_KILLABLE_RECV if the tracer replies too fast

In reply to Greg Kroah-Hartman

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

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

From: Johannes Nixdorf <[email protected]>

[ Upstream commit cce436aafc2abad691fdd37de63ec8a4490b42ce ]

Normally the tracee starts in SECCOMP_NOTIFY_INIT, sends an event to the tracer, and starts to wait interruptibly. With SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV, if the tracer receives the message (SECCOMP_NOTIFY_SENT is reached) while the tracee was waiting and is subsequently interrupted, the tracee begins to wait again uninterruptibly (but killable).

This fails if SECCOMP_NOTIFY_REPLIED is reached before the tracee is interrupted, as the check only considered SECCOMP_NOTIFY_SENT as a condition to begin waiting again. In this case the tracee is interrupted even though the tracer already acted on its behalf. This breaks the assumption SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV wanted to ensure, namely that the tracer can be sure the syscall is not interrupted or restarted on the tracee after it is received on the tracer. Fix this by also considering SECCOMP_NOTIFY_REPLIED when evaluating whether to switch to uninterruptible waiting.

With the condition changed the loop in seccomp_do_user_notification() would exit immediately after deciding that noninterruptible waiting is required if the operation already reached SECCOMP_NOTIFY_REPLIED, skipping the code that processes pending addfd commands first. Prevent this by executing the remaining loop body one last time in this case.

---
 kernel/seccomp.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
kernel/seccomp.c +5 -7
index 41aa761c7738c..3bbfba30a777a 100644
@@ -1139,7 +1139,7 @@ static void seccomp_handle_addfd(struct seccomp_kaddfd *addfd, struct seccomp_kn
 static bool should_sleep_killable(struct seccomp_filter *match,
 				  struct seccomp_knotif *n)
 {
-	return match->wait_killable_recv && n->state == SECCOMP_NOTIFY_SENT;
+	return match->wait_killable_recv && n->state >= SECCOMP_NOTIFY_SENT;
 }
 
 static int seccomp_do_user_notification(int this_syscall,
@@ -1186,13 +1186,11 @@ static int seccomp_do_user_notification(int this_syscall,
 
 		if (err != 0) {
 			/*
-			 * Check to see if the notifcation got picked up and
-			 * whether we should switch to wait killable.
+			 * Check to see whether we should switch to wait
+			 * killable. Only return the interrupted error if not.
 			 */
-			if (!wait_killable && should_sleep_killable(match, &n))
-				continue;
-
-			goto interrupted;
+			if (!(!wait_killable && should_sleep_killable(match, &n)))
+				goto interrupted;
 		}
 
 		addfd = list_first_entry_or_null(&n.addfd,
Signature · 1 line
2.51.0
author maintainer
#7 lore raw

PATCH 7/563 kbuild: Add missing $(objtree) prefix to powerpc crtsavres.o artifact

In reply to Greg Kroah-Hartman

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

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

From: Kienan Stewart <[email protected]>

[ Upstream commit 46104a7d3ccd2acfe508e661393add0615c27a22 ]

In the upstream commit 214c0eea43b2ea66bcd6467ea57e47ce8874191b ("kbuild: add $(objtree)/ prefix to some in-kernel build artifacts") artifacts required for building out-of-tree kernel modules had $(objtree) prepended to them to prepare for building in other directories.

When building external modules for powerpc, arch/powerpc/lib/crtsavres.o is required for certain configurations. This artifact is missing the prepended $(objtree).

---
 arch/powerpc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/Makefile +1 -1
index 9753fb87217c3..a58b1029592ce 100644
@@ -58,7 +58,7 @@ ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy)
 # There is a corresponding test in arch/powerpc/lib/Makefile
 KBUILD_LDFLAGS_MODULE += --save-restore-funcs
 else
-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
+KBUILD_LDFLAGS_MODULE += $(objtree)/arch/powerpc/lib/crtsavres.o
 endif
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
Signature · 1 line
2.51.0
author maintainer
#8 lore raw

PATCH 8/563 selftests: arm64: Check fread return value in exec_target

In reply to Greg Kroah-Hartman

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

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

From: Bala-Vignesh-Reddy <[email protected]>

[ Upstream commit a679e5683d3eef22ca12514ff8784b2b914ebedc ]

Fix -Wunused-result warning generated when compiled with gcc 13.3.0, by checking fread's return value and handling errors, preventing potential failures when reading from stdin.

Fixes compiler warning:
warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]

Fixes 806a15b2545e ("kselftests/arm64: add PAuth test for whether exec() changes keys")
---
 tools/testing/selftests/arm64/pauth/exec_target.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/testing/selftests/arm64/pauth/exec_target.c +6 -1
index 4435600ca400d..e597861b26d6b 100644
@@ -13,7 +13,12 @@ int main(void)
 	unsigned long hwcaps;
 	size_t val;
 
-	fread(&val, sizeof(size_t), 1, stdin);
+	size_t size = fread(&val, sizeof(size_t), 1, stdin);
+
+	if (size != 1) {
+		fprintf(stderr, "Could not read input from stdin\n");
+		return EXIT_FAILURE;
+	}
 
 	/* don't try to execute illegal (unimplemented) instructions) caller
 	 * should have checked this and keep worker simple
Signature · 1 line
2.51.0
author maintainer
#9 lore raw

PATCH 9/563 selftests: arm64: Fix -Waddress warning in tpidr2 test

In reply to Greg Kroah-Hartman

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

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

From: Bala-Vignesh-Reddy <[email protected]>

[ Upstream commit 50af02425afc72b1b47c4a0a0b9c9bdaa1a1b347 ]

Thanks to -Waddress, the compiler warns that the ksft_test_result() invocations in the arm64 tpidr2 selftest are always true. Oops.

Fix the test by, err, actually running the test functions.

Fixes 6d80cb73131d ("kselftest/arm64: Convert tpidr2 test to use kselftest.h")
---
 tools/testing/selftests/arm64/abi/tpidr2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/arm64/abi/tpidr2.c +4 -4
index f58a9f89b952c..4c89ab0f10101 100644
@@ -227,10 +227,10 @@ int main(int argc, char **argv)
 	ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);
 	if (ret >= 0) {
 		ksft_test_result(default_value(), "default_value\n");
-		ksft_test_result(write_read, "write_read\n");
-		ksft_test_result(write_sleep_read, "write_sleep_read\n");
-		ksft_test_result(write_fork_read, "write_fork_read\n");
-		ksft_test_result(write_clone_read, "write_clone_read\n");
+		ksft_test_result(write_read(), "write_read\n");
+		ksft_test_result(write_sleep_read(), "write_sleep_read\n");
+		ksft_test_result(write_fork_read(), "write_fork_read\n");
+		ksft_test_result(write_clone_read(), "write_clone_read\n");
 
 	} else {
 		ksft_print_msg("SME support not present\n");
Signature · 1 line
2.51.0
author maintainer
#10 lore raw

PATCH 10/563 kselftest/arm64/gcs: Correctly check return value when disabling GCS

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 740cdafd0d998903c1faeee921028a8a78698be5 ]

The return value was not assigned to 'ret', so the check afterwards does not do anything.

Fixes 3d37d4307e0f ("kselftest/arm64: Add very basic GCS test program")
---
 tools/testing/selftests/arm64/gcs/basic-gcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/arm64/gcs/basic-gcs.c +1 -1
index 54f9c888249d7..100d2a983155f 100644
@@ -410,7 +410,7 @@ int main(void)
 	}
 
 	/* One last test: disable GCS, we can do this one time */
-	my_syscall5(__NR_prctl, PR_SET_SHADOW_STACK_STATUS, 0, 0, 0, 0);
+	ret = my_syscall5(__NR_prctl, PR_SET_SHADOW_STACK_STATUS, 0, 0, 0, 0);
 	if (ret != 0)
 		ksft_print_msg("Failed to disable GCS: %d\n", ret);
 
Signature · 1 line
2.51.0
author maintainer
#11 lore raw

PATCH 11/563 hfsplus: fix slab-out-of-bounds read in hfsplus_uni2asc()

In reply to Greg Kroah-Hartman

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

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

From: Kang Chen <[email protected]>

[ Upstream commit bea3e1d4467bcf292c8e54f080353d556d355e26 ]

BUG: KASAN: slab-out-of-bounds in hfsplus_uni2asc+0xa71/0xb90 fs/hfsplus/unicode.c:186
Read of size 2 at addr ffff8880289ef218 by task syz.6.248/14290

CPU: 0 UID: 0 PID: 14290 Comm: syz.6.248 Not tainted 6.16.4 #1 PREEMPT(full)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1b0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x5f0 mm/kasan/report.c:482
 kasan_report+0xca/0x100 mm/kasan/report.c:595
 hfsplus_uni2asc+0xa71/0xb90 fs/hfsplus/unicode.c:186
 hfsplus_listxattr+0x5b6/0xbd0 fs/hfsplus/xattr.c:738
 vfs_listxattr+0xbe/0x140 fs/xattr.c:493
 listxattr+0xee/0x190 fs/xattr.c:924
 filename_listxattr fs/xattr.c:958 [inline]
 path_listxattrat+0x143/0x360 fs/xattr.c:988
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcb/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe0e9fae16d
Code: 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe0eae67f98 EFLAGS: 00000246 ORIG_RAX: 00000000000000c3
RAX: ffffffffffffffda RBX: 00007fe0ea205fa0 RCX: 00007fe0e9fae16d
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000000
RBP: 00007fe0ea0480f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe0ea206038 R14: 00007fe0ea205fa0 R15: 00007fe0eae48000
 </TASK>

Allocated by task 14290:
 kasan_save_stack+0x24/0x50 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394
 kasan_kmalloc include/linux/kasan.h:260 [inline]
 __do_kmalloc_node mm/slub.c:4333 [inline]
 __kmalloc_noprof+0x219/0x540 mm/slub.c:4345
 kmalloc_noprof include/linux/slab.h:909 [inline]
 hfsplus_find_init+0x95/0x1f0 fs/hfsplus/bfind.c:21
 hfsplus_listxattr+0x331/0xbd0 fs/hfsplus/xattr.c:697
 vfs_listxattr+0xbe/0x140 fs/xattr.c:493
 listxattr+0xee/0x190 fs/xattr.c:924
 filename_listxattr fs/xattr.c:958 [inline]
 path_listxattrat+0x143/0x360 fs/xattr.c:988
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcb/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

When hfsplus_uni2asc is called from hfsplus_listxattr,
it actually passes in a struct hfsplus_attr_unistr*.
The size of the corresponding structure is different from that of hfsplus_unistr, so the previous fix (94458781aee6) is insufficient.
The pointer on the unicode buffer is still going beyond the allocated memory.

This patch introduces two warpper functions hfsplus_uni2asc_xattr_str and hfsplus_uni2asc_str to process two unicode buffers,
struct hfsplus_attr_unistr* and struct hfsplus_unistr* respectively. When ustrlen value is bigger than the allocated memory size, the ustrlen value is limited to an safe size.

---
 fs/hfsplus/dir.c        |  2 +-
 fs/hfsplus/hfsplus_fs.h |  8 ++++++--
 fs/hfsplus/unicode.c    | 24 +++++++++++++++++++-----
 fs/hfsplus/xattr.c      |  6 +++---
 4 files changed, 29 insertions(+), 11 deletions(-)
fs/hfsplus/dir.c +1 -1
index 876bbb80fb4dc..1b3e27a0d5e03 100644
@@ -204,7 +204,7 @@ static int hfsplus_readdir(struct file *file, struct dir_context *ctx)
 			fd.entrylength);
 		type = be16_to_cpu(entry.type);
 		len = NLS_MAX_CHARSET_SIZE * HFSPLUS_MAX_STRLEN;
-		err = hfsplus_uni2asc(sb, &fd.key->cat.name, strbuf, &len);
+		err = hfsplus_uni2asc_str(sb, &fd.key->cat.name, strbuf, &len);
 		if (err)
 			goto out;
 		if (type == HFSPLUS_FOLDER) {
fs/hfsplus/hfsplus_fs.h +6 -2
index 96a5c24813dd6..2311e4be4e865 100644
@@ -521,8 +521,12 @@ int hfsplus_strcasecmp(const struct hfsplus_unistr *s1,
 		       const struct hfsplus_unistr *s2);
 int hfsplus_strcmp(const struct hfsplus_unistr *s1,
 		   const struct hfsplus_unistr *s2);
-int hfsplus_uni2asc(struct super_block *sb, const struct hfsplus_unistr *ustr,
-		    char *astr, int *len_p);
+int hfsplus_uni2asc_str(struct super_block *sb,
+			const struct hfsplus_unistr *ustr, char *astr,
+			int *len_p);
+int hfsplus_uni2asc_xattr_str(struct super_block *sb,
+			      const struct hfsplus_attr_unistr *ustr,
+			      char *astr, int *len_p);
 int hfsplus_asc2uni(struct super_block *sb, struct hfsplus_unistr *ustr,
 		    int max_unistr_len, const char *astr, int len);
 int hfsplus_hash_dentry(const struct dentry *dentry, struct qstr *str);
fs/hfsplus/unicode.c +19 -5
index 36b6cf2a3abba..862ba27f1628a 100644
@@ -119,9 +119,8 @@ static u16 *hfsplus_compose_lookup(u16 *p, u16 cc)
 	return NULL;
 }
 
-int hfsplus_uni2asc(struct super_block *sb,
-		const struct hfsplus_unistr *ustr,
-		char *astr, int *len_p)
+static int hfsplus_uni2asc(struct super_block *sb, const struct hfsplus_unistr *ustr,
+		    int max_len, char *astr, int *len_p)
 {
 	const hfsplus_unichr *ip;
 	struct nls_table *nls = HFSPLUS_SB(sb)->nls;
@@ -134,8 +133,8 @@ int hfsplus_uni2asc(struct super_block *sb,
 	ip = ustr->unicode;
 
 	ustrlen = be16_to_cpu(ustr->length);
-	if (ustrlen > HFSPLUS_MAX_STRLEN) {
-		ustrlen = HFSPLUS_MAX_STRLEN;
+	if (ustrlen > max_len) {
+		ustrlen = max_len;
 		pr_err("invalid length %u has been corrected to %d\n",
 			be16_to_cpu(ustr->length), ustrlen);
 	}
@@ -256,6 +255,21 @@ int hfsplus_uni2asc(struct super_block *sb,
 	return res;
 }
 
+inline int hfsplus_uni2asc_str(struct super_block *sb,
+			       const struct hfsplus_unistr *ustr, char *astr,
+			       int *len_p)
+{
+	return hfsplus_uni2asc(sb, ustr, HFSPLUS_MAX_STRLEN, astr, len_p);
+}
+
+inline int hfsplus_uni2asc_xattr_str(struct super_block *sb,
+				     const struct hfsplus_attr_unistr *ustr,
+				     char *astr, int *len_p)
+{
+	return hfsplus_uni2asc(sb, (const struct hfsplus_unistr *)ustr,
+			       HFSPLUS_ATTR_MAX_STRLEN, astr, len_p);
+}
+
 /*
  * Convert one or more ASCII characters into a single unicode character.
  * Returns the number of ASCII characters corresponding to the unicode char.
fs/hfsplus/xattr.c +3 -3
index 18dc3d254d218..c951fa9835aa1 100644
@@ -735,9 +735,9 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
 			goto end_listxattr;
 
 		xattr_name_len = NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN;
-		if (hfsplus_uni2asc(inode->i_sb,
-			(const struct hfsplus_unistr *)&fd.key->attr.key_name,
-					strbuf, &xattr_name_len)) {
+		if (hfsplus_uni2asc_xattr_str(inode->i_sb,
+					      &fd.key->attr.key_name, strbuf,
+					      &xattr_name_len)) {
 			pr_err("unicode conversion failed\n");
 			res = -EIO;
 			goto end_listxattr;
Signature · 1 line
2.51.0
author maintainer
#12 lore raw

PATCH 12/563 gfs2: Fix GLF_INVALIDATE_IN_PROGRESS flag clearing in do_xmote

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit 061df28b82af6b22fb5fa529a8f2ef00474ee004 ]

Commit 865cc3e9cc0b ("gfs2: fix a deadlock on withdraw-during-mount") added a statement to do_xmote() to clear the GLF_INVALIDATE_IN_PROGRESS flag a second time after it has already been cleared. Fix that.

Fixes 865cc3e9cc0b ("gfs2: fix a deadlock on withdraw-during-mount")
---
 fs/gfs2/glock.c | 2 --
 1 file changed, 2 deletions(-)
fs/gfs2/glock.c +0 -2
index b6fd1cb17de7b..edb105f9da059 100644
@@ -805,8 +805,6 @@ __acquires(&gl->gl_lockref.lock)
 			clear_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags);
 			gfs2_glock_queue_work(gl, GL_GLOCK_DFT_HOLD);
 			return;
-		} else {
-			clear_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags);
 		}
 	}
 
Signature · 1 line
2.51.0
author maintainer
#13 lore raw

PATCH 13/563 gfs2: Remove space before newline

In reply to Greg Kroah-Hartman

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

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

From: Colin Ian King <[email protected]>

[ Upstream commit aa94ad9ab230d08741e6630a20fd1296b52c1009 ]

There is an extraneous space before a newline in a fs_err message. Remove it

Stable-dep-of: bddb53b776fb ("gfs2: Get rid of GLF_INVALIDATE_IN_PROGRESS")

---
 fs/gfs2/glock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/glock.c +1 -1
index edb105f9da059..3d5cf9c24d78b 100644
@@ -733,7 +733,7 @@ __acquires(&gl->gl_lockref.lock)
 		 */
 		if (ret) {
 			if (cmpxchg(&sdp->sd_log_error, 0, ret)) {
-				fs_err(sdp, "Error %d syncing glock \n", ret);
+				fs_err(sdp, "Error %d syncing glock\n", ret);
 				gfs2_dump_glock(NULL, gl, true);
 			}
 			spin_lock(&gl->gl_lockref.lock);
Signature · 1 line
2.51.0
author maintainer
#14 lore raw

PATCH 14/563 gfs2: Further sanitize lock_dlm.c

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit fd70ab7155c4b92a9747d42c02791a0793ab9c66 ]

The gl_req field and GLF_BLOCKING flag are only relevant to gdlm_lock(), its callback gdlm_ast(), and their helpers, so set and clear them inside lock_dlm.c.

Also, the LM_FLAG_ANY flag is relevant to gdlm_lock(), but do_xmote() doesn't pass that flag down to gdlm_lock() as it should. Fix that by passing down all the flags.

In addition, document the effect of the LM_FLAG_ANY flag on locks held in EX mode locally.

Stable-dep-of: bddb53b776fb ("gfs2: Get rid of GLF_INVALIDATE_IN_PROGRESS")

---
 fs/gfs2/glock.c    |  6 ------
 fs/gfs2/glock.h    |  4 ++++
 fs/gfs2/lock_dlm.c | 26 ++++++++++++++++++--------
 3 files changed, 22 insertions(+), 14 deletions(-)
fs/gfs2/glock.c +0 -6
index 3d5cf9c24d78b..45dd73bb884fd 100644
@@ -715,12 +715,6 @@ __acquires(&gl->gl_lockref.lock)
 			return;
 		do_error(gl, 0); /* Fail queued try locks */
 	}
-	gl->gl_req = target;
-	set_bit(GLF_BLOCKING, &gl->gl_flags);
-	if ((gl->gl_req == LM_ST_UNLOCKED) ||
-	    (gl->gl_state == LM_ST_EXCLUSIVE) ||
-	    (lck_flags & (LM_FLAG_TRY|LM_FLAG_TRY_1CB)))
-		clear_bit(GLF_BLOCKING, &gl->gl_flags);
 	if (!glops->go_inval && !glops->go_sync)
 		goto skip_inval;
 
fs/gfs2/glock.h +4 -0
index 9339a3bff6eeb..d041b922b45e3 100644
@@ -68,6 +68,10 @@ enum {
  * also be granted in SHARED.  The preferred state is whichever is compatible
  * with other granted locks, or the specified state if no other locks exist.
  *
+ * In addition, when a lock is already held in EX mode locally, a SHARED or
+ * DEFERRED mode request with the LM_FLAG_ANY flag set will be granted.
+ * (The LM_FLAG_ANY flag is only use for SHARED mode requests currently.)
+ *
  * LM_FLAG_NODE_SCOPE
  * This holder agrees to share the lock within this node. In other words,
  * the glock is held in EX mode according to DLM, but local holders on the
fs/gfs2/lock_dlm.c +18 -8
index cee5d199d2d87..5daaeaaaf18dd 100644
@@ -58,6 +58,7 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
 /**
  * gfs2_update_reply_times - Update locking statistics
  * @gl: The glock to update
+ * @blocking: The operation may have been blocking
  *
  * This assumes that gl->gl_dstamp has been set earlier.
  *
@@ -72,12 +73,12 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
  * TRY_1CB flags are set are classified as non-blocking. All
  * other DLM requests are counted as (potentially) blocking.
  */
-static inline void gfs2_update_reply_times(struct gfs2_glock *gl)
+static inline void gfs2_update_reply_times(struct gfs2_glock *gl,
+					   bool blocking)
 {
 	struct gfs2_pcpu_lkstats *lks;
 	const unsigned gltype = gl->gl_name.ln_type;
-	unsigned index = test_bit(GLF_BLOCKING, &gl->gl_flags) ?
-			 GFS2_LKS_SRTTB : GFS2_LKS_SRTT;
+	unsigned index = blocking ? GFS2_LKS_SRTTB : GFS2_LKS_SRTT;
 	s64 rtt;
 
 	preempt_disable();
@@ -119,14 +120,18 @@ static inline void gfs2_update_request_times(struct gfs2_glock *gl)
 static void gdlm_ast(void *arg)
 {
 	struct gfs2_glock *gl = arg;
+	bool blocking;
 	unsigned ret;
 
+	blocking = test_bit(GLF_BLOCKING, &gl->gl_flags);
+	gfs2_update_reply_times(gl, blocking);
+	clear_bit(GLF_BLOCKING, &gl->gl_flags);
+
 	/* If the glock is dead, we only react to a dlm_unlock() reply. */
 	if (__lockref_is_dead(&gl->gl_lockref) &&
 	    gl->gl_lksb.sb_status != -DLM_EUNLOCK)
 		return;
 
-	gfs2_update_reply_times(gl);
 	BUG_ON(gl->gl_lksb.sb_flags & DLM_SBF_DEMOTED);
 
 	if ((gl->gl_lksb.sb_flags & DLM_SBF_VALNOTVALID) && gl->gl_lksb.sb_lvbptr)
@@ -241,7 +246,7 @@ static bool down_conversion(int cur, int req)
 }
 
 static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
-		      const int cur, const int req)
+		      const int req, bool blocking)
 {
 	u32 lkf = 0;
 
@@ -274,7 +279,7 @@ static u32 make_flags(struct gfs2_glock *gl, const unsigned int gfs_flags,
 		 * "upward" lock conversions or else DLM will reject the
 		 * request as invalid.
 		 */
-		if (!down_conversion(cur, req))
+		if (blocking)
 			lkf |= DLM_LKF_QUECVT;
 	}
 
@@ -294,14 +299,20 @@ static int gdlm_lock(struct gfs2_glock *gl, unsigned int req_state,
 		     unsigned int flags)
 {
 	struct lm_lockstruct *ls = &gl->gl_name.ln_sbd->sd_lockstruct;
+	bool blocking;
 	int cur, req;
 	u32 lkf;
 	char strname[GDLM_STRNAME_BYTES] = "";
 	int error;
 
+	gl->gl_req = req_state;
 	cur = make_mode(gl->gl_name.ln_sbd, gl->gl_state);
 	req = make_mode(gl->gl_name.ln_sbd, req_state);
-	lkf = make_flags(gl, flags, cur, req);
+	blocking = !down_conversion(cur, req) &&
+		   !(flags & (LM_FLAG_TRY|LM_FLAG_TRY_1CB));
+	lkf = make_flags(gl, flags, req, blocking);
+	if (blocking)
+		set_bit(GLF_BLOCKING, &gl->gl_flags);
 	gfs2_glstats_inc(gl, GFS2_LKS_DCOUNT);
 	gfs2_sbstats_inc(gl, GFS2_LKS_DCOUNT);
 	if (test_bit(GLF_INITIAL, &gl->gl_flags)) {
@@ -341,7 +352,6 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
 		return;
 	}
 
-	clear_bit(GLF_BLOCKING, &gl->gl_flags);
 	gfs2_glstats_inc(gl, GFS2_LKS_DCOUNT);
 	gfs2_sbstats_inc(gl, GFS2_LKS_DCOUNT);
 	gfs2_update_request_times(gl);
Signature · 1 line
2.51.0
author maintainer
#15 lore raw

PATCH 15/563 gfs2: Fix LM_FLAG_TRY* logic in add_to_queue

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit 0c23e24164d83086e75581b0cf930f4e161636d6 ]

The logic in add_to_queue() for determining whether a LM_FLAG_TRY or LM_FLAG_TRY_1CB holder should be queued does not make any sense: we are interested in wether or not the new operation will block behind an existing or future holder in the queue, but the current code checks for ongoing locking or ->go_inval() operations, which has little to do with that.

Replace that code with something more sensible, remove the incorrect add_to_queue() function annotations, remove the similarly misguided do_error(gl, 0) call in do_xmote(), and add a missing comment to the same call in do_promote().

Stable-dep-of: bddb53b776fb ("gfs2: Get rid of GLF_INVALIDATE_IN_PROGRESS")

---
 fs/gfs2/glock.c | 47 ++++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 23 deletions(-)
fs/gfs2/glock.c +24 -23
index 45dd73bb884fd..5edf125b39fe3 100644
@@ -502,7 +502,7 @@ static bool do_promote(struct gfs2_glock *gl)
 			 */
 			if (list_is_first(&gh->gh_list, &gl->gl_holders))
 				return false;
-			do_error(gl, 0);
+			do_error(gl, 0); /* Fail queued try locks */
 			break;
 		}
 		set_bit(HIF_HOLDER, &gh->gh_iflags);
@@ -713,7 +713,6 @@ __acquires(&gl->gl_lockref.lock)
 		if (test_and_set_bit(GLF_INVALIDATE_IN_PROGRESS,
 				     &gl->gl_flags))
 			return;
-		do_error(gl, 0); /* Fail queued try locks */
 	}
 	if (!glops->go_inval && !glops->go_sync)
 		goto skip_inval;
@@ -1454,6 +1453,24 @@ void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...)
 	va_end(args);
 }
 
+static bool gfs2_should_queue_trylock(struct gfs2_glock *gl,
+				      struct gfs2_holder *gh)
+{
+	struct gfs2_holder *current_gh, *gh2;
+
+	current_gh = find_first_holder(gl);
+	if (current_gh && !may_grant(gl, current_gh, gh))
+		return false;
+
+	list_for_each_entry(gh2, &gl->gl_holders, gh_list) {
+		if (test_bit(HIF_HOLDER, &gh2->gh_iflags))
+			continue;
+		if (!(gh2->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)))
+			return false;
+	}
+	return true;
+}
+
 static inline bool pid_is_meaningful(const struct gfs2_holder *gh)
 {
         if (!(gh->gh_flags & GL_NOPID))
@@ -1472,27 +1489,20 @@ static inline bool pid_is_meaningful(const struct gfs2_holder *gh)
  */
 
 static inline void add_to_queue(struct gfs2_holder *gh)
-__releases(&gl->gl_lockref.lock)
-__acquires(&gl->gl_lockref.lock)
 {
 	struct gfs2_glock *gl = gh->gh_gl;
 	struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
 	struct gfs2_holder *gh2;
-	int try_futile = 0;
 
 	GLOCK_BUG_ON(gl, gh->gh_owner_pid == NULL);
 	if (test_and_set_bit(HIF_WAIT, &gh->gh_iflags))
 		GLOCK_BUG_ON(gl, true);
 
-	if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) {
-		if (test_bit(GLF_LOCK, &gl->gl_flags)) {
-			struct gfs2_holder *current_gh;
-
-			current_gh = find_first_holder(gl);
-			try_futile = !may_grant(gl, current_gh, gh);
-		}
-		if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags))
-			goto fail;
+	if ((gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) &&
+	    !gfs2_should_queue_trylock(gl, gh)) {
+		gh->gh_error = GLR_TRYFAILED;
+		gfs2_holder_wake(gh);
+		return;
 	}
 
 	list_for_each_entry(gh2, &gl->gl_holders, gh_list) {
@@ -1504,15 +1514,6 @@ __acquires(&gl->gl_lockref.lock)
 			continue;
 		goto trap_recursive;
 	}
-	list_for_each_entry(gh2, &gl->gl_holders, gh_list) {
-		if (try_futile &&
-		    !(gh2->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))) {
-fail:
-			gh->gh_error = GLR_TRYFAILED;
-			gfs2_holder_wake(gh);
-			return;
-		}
-	}
 	trace_gfs2_glock_queue(gh, 1);
 	gfs2_glstats_inc(gl, GFS2_LKS_QCOUNT);
 	gfs2_sbstats_inc(gl, GFS2_LKS_QCOUNT);
Signature · 1 line
2.51.0
author maintainer
#16 lore raw

PATCH 16/563 gfs2: Remove duplicate check in do_xmote

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit 9b54770b68ae793a3a8d378be4cda2bb7be6c8cc ]

In do_xmote(), remove the duplicate check for the ->go_sync and ->go_inval glock operations. They are either both defined, or none of them are.

Stable-dep-of: bddb53b776fb ("gfs2: Get rid of GLF_INVALIDATE_IN_PROGRESS")

---
 fs/gfs2/glock.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)
fs/gfs2/glock.c +13 -14
index 5edf125b39fe3..93aae10d78f30 100644
@@ -714,25 +714,24 @@ __acquires(&gl->gl_lockref.lock)
 				     &gl->gl_flags))
 			return;
 	}
-	if (!glops->go_inval && !glops->go_sync)
+	if (!glops->go_inval || !glops->go_sync)
 		goto skip_inval;
 
 	spin_unlock(&gl->gl_lockref.lock);
-	if (glops->go_sync) {
-		ret = glops->go_sync(gl);
-		/* If we had a problem syncing (due to io errors or whatever,
-		 * we should not invalidate the metadata or tell dlm to
-		 * release the glock to other nodes.
-		 */
-		if (ret) {
-			if (cmpxchg(&sdp->sd_log_error, 0, ret)) {
-				fs_err(sdp, "Error %d syncing glock\n", ret);
-				gfs2_dump_glock(NULL, gl, true);
-			}
-			spin_lock(&gl->gl_lockref.lock);
-			goto skip_inval;
+	ret = glops->go_sync(gl);
+	/* If we had a problem syncing (due to io errors or whatever,
+	 * we should not invalidate the metadata or tell dlm to
+	 * release the glock to other nodes.
+	 */
+	if (ret) {
+		if (cmpxchg(&sdp->sd_log_error, 0, ret)) {
+			fs_err(sdp, "Error %d syncing glock\n", ret);
+			gfs2_dump_glock(NULL, gl, true);
 		}
+		spin_lock(&gl->gl_lockref.lock);
+		goto skip_inval;
 	}
+
 	if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) {
 		/*
 		 * The call to go_sync should have cleared out the ail list.
Signature · 1 line
2.51.0
author maintainer
#17 lore raw

PATCH 17/563 gfs2: Get rid of GLF_INVALIDATE_IN_PROGRESS

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit bddb53b776fb7ce81dfba7c24884d9f2c0c68e50 ]

Get rid of the GLF_INVALIDATE_IN_PROGRESS flag: it was originally used to indicate to add_to_queue() that the ->go_sync() and ->go_invalid() operations were in progress, but as we have established in commit "gfs2:
Fix LM_FLAG_TRY* logic in add_to_queue", add_to_queue() has no need to know.

Commit d99724c3c36a describes a race in which GLF_INVALIDATE_IN_PROGRESS is used to serialize two processes which are both in do_xmote() at the same time. That analysis is wrong: the serialization happens via the GLF_LOCK flag, which ensures that at most one glock operation can be active at any time.

Fixes d99724c3c36a ("gfs2: Close timing window with GLF_INVALIDATE_IN_PROGRESS")
---
 fs/gfs2/glock.c      | 16 +---------------
 fs/gfs2/incore.h     |  1 -
 fs/gfs2/trace_gfs2.h |  1 -
 3 files changed, 1 insertion(+), 17 deletions(-)
fs/gfs2/glock.c +1 -15
index 93aae10d78f30..68e943e13dd53 100644
@@ -703,17 +703,6 @@ __acquires(&gl->gl_lockref.lock)
 	lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP);
 	GLOCK_BUG_ON(gl, gl->gl_state == target);
 	GLOCK_BUG_ON(gl, gl->gl_state == gl->gl_target);
-	if ((target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) &&
-	    glops->go_inval) {
-		/*
-		 * If another process is already doing the invalidate, let that
-		 * finish first.  The glock state machine will get back to this
-		 * holder again later.
-		 */
-		if (test_and_set_bit(GLF_INVALIDATE_IN_PROGRESS,
-				     &gl->gl_flags))
-			return;
-	}
 	if (!glops->go_inval || !glops->go_sync)
 		goto skip_inval;
 
@@ -732,7 +721,7 @@ __acquires(&gl->gl_lockref.lock)
 		goto skip_inval;
 	}
 
-	if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) {
+	if (target == LM_ST_UNLOCKED || target == LM_ST_DEFERRED) {
 		/*
 		 * The call to go_sync should have cleared out the ail list.
 		 * If there are still items, we have a problem. We ought to
@@ -747,7 +736,6 @@ __acquires(&gl->gl_lockref.lock)
 			gfs2_dump_glock(NULL, gl, true);
 		}
 		glops->go_inval(gl, target == LM_ST_DEFERRED ? 0 : DIO_METADATA);
-		clear_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags);
 	}
 	spin_lock(&gl->gl_lockref.lock);
 
@@ -2313,8 +2301,6 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
 		*p++ = 'y';
 	if (test_bit(GLF_LFLUSH, gflags))
 		*p++ = 'f';
-	if (test_bit(GLF_INVALIDATE_IN_PROGRESS, gflags))
-		*p++ = 'i';
 	if (test_bit(GLF_PENDING_REPLY, gflags))
 		*p++ = 'R';
 	if (test_bit(GLF_HAVE_REPLY, gflags))
fs/gfs2/incore.h +0 -1
index d4ad82f47eeea..c390f208654c1 100644
@@ -319,7 +319,6 @@ enum {
 	GLF_DEMOTE_IN_PROGRESS		= 5,
 	GLF_DIRTY			= 6,
 	GLF_LFLUSH			= 7,
-	GLF_INVALIDATE_IN_PROGRESS	= 8,
 	GLF_HAVE_REPLY			= 9,
 	GLF_INITIAL			= 10,
 	GLF_HAVE_FROZEN_REPLY		= 11,
fs/gfs2/trace_gfs2.h +0 -1
index 26036ffc3f338..1c2507a273180 100644
@@ -52,7 +52,6 @@
 	{(1UL << GLF_DEMOTE_IN_PROGRESS),	"p" },		\
 	{(1UL << GLF_DIRTY),			"y" },		\
 	{(1UL << GLF_LFLUSH),			"f" },		\
-	{(1UL << GLF_INVALIDATE_IN_PROGRESS),	"i" },		\
 	{(1UL << GLF_PENDING_REPLY),		"R" },		\
 	{(1UL << GLF_HAVE_REPLY),		"r" },		\
 	{(1UL << GLF_INITIAL),			"a" },		\
Signature · 1 line
2.51.0
author maintainer
#18 lore raw

PATCH 18/563 gfs2: do_xmote cleanup

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit 2309a01351e56446f43c89e200d643647d47e739 ]

Check for asynchronous completion and clear the GLF_PENDING_REPLY flag earlier in do_xmote(). This will make future changes more readable.

Stable-dep-of: 6ab26555c9ff ("gfs2: Add proper lockspace locking")

---
 fs/gfs2/glock.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
fs/gfs2/glock.c +7 -5
index 68e943e13dd53..54c011ff00ddc 100644
@@ -794,6 +794,12 @@ __acquires(&gl->gl_lockref.lock)
 		ret = ls->ls_ops->lm_lock(gl, target, lck_flags);
 		spin_lock(&gl->gl_lockref.lock);
 
+		if (!ret) {
+			/* The operation will be completed asynchronously. */
+			return;
+		}
+		clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
+
 		if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
 		    target == LM_ST_UNLOCKED &&
 		    test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
@@ -801,14 +807,10 @@ __acquires(&gl->gl_lockref.lock)
 			 * The lockspace has been released and the lock has
 			 * been unlocked implicitly.
 			 */
-		} else if (ret) {
+		} else {
 			fs_err(sdp, "lm_lock ret %d\n", ret);
 			target = gl->gl_state | LM_OUT_ERROR;
-		} else {
-			/* The operation will be completed asynchronously. */
-			return;
 		}
-		clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
 	}
 
 	/* Complete the operation now. */
Signature · 1 line
2.51.0
author maintainer
#19 lore raw

PATCH 19/563 gfs2: Add proper lockspace locking

In reply to Greg Kroah-Hartman

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

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

From: Andreas Gruenbacher <[email protected]>

[ Upstream commit 6ab26555c9ffef96c56ca16356e55ac5ab61ec93 ]

GFS2 has been calling functions like dlm_lock() even after the lockspace that these functions operate on has been released with dlm_release_lockspace(). It has always assumed that those functions would return -EINVAL in that case, but that was never guaranteed, and it certainly is no longer the case since commit 4db41bf4f04f ("dlm: remove ls_local_handle from struct dlm_ls").

To fix that, add proper lockspace locking.

Fixes 3e11e5304150 ("GFS2: ignore unlock failures after withdraw")
---
 fs/gfs2/file.c     | 23 +++++++++++++++--------
 fs/gfs2/glock.c    |  5 ++---
 fs/gfs2/incore.h   |  2 ++
 fs/gfs2/lock_dlm.c | 46 +++++++++++++++++++++++++++++++++++++---------
 4 files changed, 56 insertions(+), 20 deletions(-)
fs/gfs2/file.c +15 -8
index 72d95185a39f6..bc67fa058c845 100644
@@ -1442,6 +1442,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
 	struct gfs2_inode *ip = GFS2_I(file->f_mapping->host);
 	struct gfs2_sbd *sdp = GFS2_SB(file->f_mapping->host);
 	struct lm_lockstruct *ls = &sdp->sd_lockstruct;
+	int ret;
 
 	if (!(fl->c.flc_flags & FL_POSIX))
 		return -ENOLCK;
@@ -1450,14 +1451,20 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
 			locks_lock_file_wait(file, fl);
 		return -EIO;
 	}
-	if (cmd == F_CANCELLK)
-		return dlm_posix_cancel(ls->ls_dlm, ip->i_no_addr, file, fl);
-	else if (IS_GETLK(cmd))
-		return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
-	else if (lock_is_unlock(fl))
-		return dlm_posix_unlock(ls->ls_dlm, ip->i_no_addr, file, fl);
-	else
-		return dlm_posix_lock(ls->ls_dlm, ip->i_no_addr, file, cmd, fl);
+	down_read(&ls->ls_sem);
+	ret = -ENODEV;
+	if (likely(ls->ls_dlm != NULL)) {
+		if (cmd == F_CANCELLK)
+			ret = dlm_posix_cancel(ls->ls_dlm, ip->i_no_addr, file, fl);
+		else if (IS_GETLK(cmd))
+			ret = dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
+		else if (lock_is_unlock(fl))
+			ret = dlm_posix_unlock(ls->ls_dlm, ip->i_no_addr, file, fl);
+		else
+			ret = dlm_posix_lock(ls->ls_dlm, ip->i_no_addr, file, cmd, fl);
+	}
+	up_read(&ls->ls_sem);
+	return ret;
 }
 
 static void __flock_holder_uninit(struct file *file, struct gfs2_holder *fl_gh)
fs/gfs2/glock.c +2 -3
index 54c011ff00ddc..a6535413a0b46 100644
@@ -800,9 +800,8 @@ __acquires(&gl->gl_lockref.lock)
 		}
 		clear_bit(GLF_PENDING_REPLY, &gl->gl_flags);
 
-		if (ret == -EINVAL && gl->gl_target == LM_ST_UNLOCKED &&
-		    target == LM_ST_UNLOCKED &&
-		    test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) {
+		if (ret == -ENODEV && gl->gl_target == LM_ST_UNLOCKED &&
+		    target == LM_ST_UNLOCKED) {
 			/*
 			 * The lockspace has been released and the lock has
 			 * been unlocked implicitly.
fs/gfs2/incore.h +2 -0
index c390f208654c1..3fcb7ab198d47 100644
@@ -657,6 +657,8 @@ struct lm_lockstruct {
 	struct completion ls_sync_wait; /* {control,mounted}_{lock,unlock} */
 	char *ls_lvb_bits;
 
+	struct rw_semaphore ls_sem;
+
 	spinlock_t ls_recover_spin; /* protects following fields */
 	unsigned long ls_recover_flags; /* DFL_ */
 	uint32_t ls_recover_mount; /* gen in first recover_done cb */
fs/gfs2/lock_dlm.c +37 -9

98 lines not on this page · raw message

Signature · 1 line
2.51.0
author maintainer
#20 lore raw

PATCH 20/563 powerpc/8xx: Remove left-over instruction and comments in DataStoreTLBMiss handler

In reply to Greg Kroah-Hartman

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

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

From: Christophe Leroy <[email protected]>

[ Upstream commit d9e46de4bf5c5f987075afd5f240bb2a8a5d71ed ]

Commit ac9f97ff8b32 ("powerpc/8xx: Inconditionally use task PGDIR in DTLB misses") removed the test that needed the valeur in SPRN_EPN but failed to remove the read.

Remove it.

And remove related comments, including the very same comment in InstructionTLBMiss that should have been removed by commit 33c527522f39 ("powerpc/8xx: Inconditionally use task PGDIR in ITLB misses").

Also update the comment about absence of a second level table which has been handled implicitely since commit 5ddb75cee5af ("powerpc/8xx:
remove tests on PGDIR entry validity").

---
 arch/powerpc/kernel/head_8xx.S | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/powerpc/kernel/head_8xx.S +1 -8
index 56c5ebe21b99a..613606400ee99 100644
@@ -162,7 +162,7 @@ instruction_counter:
  * For the MPC8xx, this is a software tablewalk to load the instruction
  * TLB.  The task switch loads the M_TWB register with the pointer to the first
  * level table.
- * If we discover there is no second level table (value is zero) or if there
+ * If there is no second level table (value is zero) or if there
  * is an invalid pte, we load that into the TLB, which causes another fault
  * into the TLB Error interrupt where we can handle such problems.
  * We have to use the MD_xxx registers for the tablewalk because the
@@ -183,9 +183,6 @@ instruction_counter:
 	mtspr	SPRN_SPRG_SCRATCH2, r10
 	mtspr	SPRN_M_TW, r11
 
-	/* If we are faulting a kernel address, we have to use the
-	 * kernel page tables.
-	 */
 	mfspr	r10, SPRN_SRR0	/* Get effective address of fault */
 	INVALIDATE_ADJACENT_PAGES_CPU15(r10, r11)
 	mtspr	SPRN_MD_EPN, r10
@@ -228,10 +225,6 @@ instruction_counter:
 	mtspr	SPRN_SPRG_SCRATCH2, r10
 	mtspr	SPRN_M_TW, r11
 
-	/* If we are faulting a kernel address, we have to use the
-	 * kernel page tables.
-	 */
-	mfspr	r10, SPRN_MD_EPN
 	mfspr	r10, SPRN_M_TWB	/* Get level 1 table */
 	lwz	r11, (swapper_pg_dir-PAGE_OFFSET)@l(r10)	/* Get level 1 entry */
 
Signature · 1 line
2.51.0
author maintainer
#21 lore raw

PATCH 21/563 powerpc/603: Really copy kernel PGD entries into all PGDIRs

In reply to Greg Kroah-Hartman

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

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

From: Christophe Leroy <[email protected]>

[ Upstream commit f2863371f017eb03c230addc253783fa4c7e90f5 ]

Commit 82ef440f9a38 ("powerpc/603: Copy kernel PGD entries into all PGDIRs and preallocate execmem page tables") was supposed to extend to powerpc 603 the copy of kernel PGD entries into all PGDIRs implemented in a previous patch on the 8xx. But 603 is book3s/32 and uses a duplicate of pgd_alloc() defined in another header.

So really do the copy at the correct place for the 603.

Fixes 82ef440f9a38 ("powerpc/603: Copy kernel PGD entries into all PGDIRs and preallocate execmem page tables")
---
 arch/powerpc/include/asm/book3s/32/pgalloc.h | 10 ++++++++--
 arch/powerpc/include/asm/nohash/pgalloc.h    |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/book3s/32/pgalloc.h +8 -2
index dd4eb30631758..f4390704d5ba2 100644
@@ -7,8 +7,14 @@
 
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
-			pgtable_gfp_flags(mm, GFP_KERNEL));
+	pgd_t *pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
+				      pgtable_gfp_flags(mm, GFP_KERNEL));
+
+#ifdef CONFIG_PPC_BOOK3S_603
+	memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD,
+	       (MAX_PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
+#endif
+	return pgd;
 }
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
arch/powerpc/include/asm/nohash/pgalloc.h +1 -1
index bb5f3e8ea912d..4ef780b291bc3 100644
@@ -22,7 +22,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 	pgd_t *pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
 			pgtable_gfp_flags(mm, GFP_KERNEL));
 
-#if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC_BOOK3S_603)
+#ifdef CONFIG_PPC_8xx
 	memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD,
 	       (MAX_PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
 #endif
Signature · 1 line
2.51.0
author maintainer
#22 lore raw

PATCH 22/563 powerpc/ftrace: ensure ftrace record ops are always set for NOPs

In reply to Greg Kroah-Hartman

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

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

From: Joe Lawrence <[email protected]>

[ Upstream commit 5337609a314828aa2474ac359db615f475c4a4d2 ]

When an ftrace call site is converted to a NOP, its corresponding dyn_ftrace record should have its ftrace_ops pointer set to ftrace_nop_ops.

Correct the powerpc implementation to ensure the ftrace_rec_set_nop_ops() helper is called on all successful NOP initialization paths. This ensures all ftrace records are consistent before being handled by the ftrace core.

---
 arch/powerpc/kernel/trace/ftrace.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
arch/powerpc/kernel/trace/ftrace.c +8 -2
index 6dca92d5a6e82..841d077e28251 100644
@@ -488,8 +488,10 @@ int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec)
 		return ret;
 
 	/* Set up out-of-line stub */
-	if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE))
-		return ftrace_init_ool_stub(mod, rec);
+	if (IS_ENABLED(CONFIG_PPC_FTRACE_OUT_OF_LINE)) {
+		ret = ftrace_init_ool_stub(mod, rec);
+		goto out;
+	}
 
 	/* Nop-out the ftrace location */
 	new = ppc_inst(PPC_RAW_NOP());
@@ -520,6 +522,10 @@ int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec)
 		return -EINVAL;
 	}
 
+out:
+	if (!ret)
+		ret = ftrace_rec_set_nop_ops(rec);
+
 	return ret;
 }
 
Signature · 1 line
2.51.0
author maintainer
#23 lore raw

PATCH 23/563 powerpc64/modules: correctly iterate over stubs in setup_ftrace_ool_stubs

In reply to Greg Kroah-Hartman

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

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

From: Joe Lawrence <[email protected]>

[ Upstream commit f6b4df37ebfeb47e50e27780500d2d06b4d211bd ]

CONFIG_PPC_FTRACE_OUT_OF_LINE introduced setup_ftrace_ool_stubs() to extend the ppc64le module .stubs section with an array of ftrace_ool_stub structures for each patchable function.

Fix its ppc64_stub_entry stub reservation loop to properly write across all of the num_stubs used and not just the first entry.

---
 arch/powerpc/kernel/module_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/module_64.c +1 -1
index 126bf3b06ab7e..0e45cac4de76b 100644
@@ -1139,7 +1139,7 @@ static int setup_ftrace_ool_stubs(const Elf64_Shdr *sechdrs, unsigned long addr,
 
 	/* reserve stubs */
 	for (i = 0; i < num_stubs; i++)
-		if (patch_u32((void *)&stub->funcdata, PPC_RAW_NOP()))
+		if (patch_u32((void *)&stub[i].funcdata, PPC_RAW_NOP()))
 			return -1;
 #endif
 
Signature · 1 line
2.51.0
author maintainer
#24 lore raw

PATCH 24/563 uprobes: uprobe_warn should use passed task

In reply to Greg Kroah-Hartman

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

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

From: Jeremy Linton <[email protected]>

[ Upstream commit ba1afc94deb849eab843a372b969444581add2c9 ]

uprobe_warn() is passed a task structure, yet its using current. For the most part this shouldn't matter, but since a task structure is provided, lets use it.

Fixes 248d3a7b2f10 ("uprobes: Change uprobe_copy_process() to dup return_instances")
---
 kernel/events/uprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/uprobes.c +1 -1
index 7ca1940607bd8..4b97d16f731c1 100644
@@ -121,7 +121,7 @@ struct xol_area {
 
 static void uprobe_warn(struct task_struct *t, const char *msg)
 {
-	pr_warn("uprobe: %s:%d failed to %s\n", current->comm, current->pid, msg);
+	pr_warn("uprobe: %s:%d failed to %s\n", t->comm, t->pid, msg);
 }
 
 /*
Signature · 1 line
2.51.0
author maintainer
#25 lore raw

PATCH 25/563 raid6: riscv: Clean up unused header file inclusion

In reply to Greg Kroah-Hartman

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

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

From: Chunyan Zhang <[email protected]>

[ Upstream commit f8a03516a530cc36bc9015c84ba7540ee3e8d7bd ]

These two C files don't reference things defined in simd.h or types.h so remove these redundant #inclusions.

Fixes 6093faaf9593 ("raid6: Add RISC-V SIMD syndrome and recovery calculations")
---
 lib/raid6/recov_rvv.c | 2 --
 lib/raid6/rvv.c       | 3 ---
 2 files changed, 5 deletions(-)
lib/raid6/recov_rvv.c +0 -2
index 5d54c4b437df7..5f779719c3d34 100644
@@ -4,9 +4,7 @@
  * Author: Chunyan Zhang <[email protected]>
  */
 
-#include <asm/simd.h>
 #include <asm/vector.h>
-#include <crypto/internal/simd.h>
 #include <linux/raid/pq.h>
 
 static int rvv_has_vector(void)
lib/raid6/rvv.c +0 -3
index 7d82efa5b14f9..b193ea176d5d3 100644
@@ -9,11 +9,8 @@
  *	Copyright 2002-2004 H. Peter Anvin
  */
 
-#include <asm/simd.h>
 #include <asm/vector.h>
-#include <crypto/internal/simd.h>
 #include <linux/raid/pq.h>
-#include <linux/types.h>
 #include "rvv.h"
 
 #define NSIZE	(riscv_v_vsize / 32) /* NSIZE = vlenb */
Signature · 1 line
2.51.0
author maintainer
#26 lore raw

PATCH 26/563 coresight: trbe: Prevent overflow in PERF_IDX2OFF()

In reply to Greg Kroah-Hartman

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

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

From: Leo Yan <[email protected]>

[ Upstream commit 105f56877f2d5f82d71e20b45eb7be7c24c3d908 ]

Cast nr_pages to unsigned long to avoid overflow when handling large AUX buffer sizes (>= 2 GiB).

Fixes 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
---
 drivers/hwtracing/coresight/coresight-trbe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-trbe.c +2 -1
index 8267dd1a2130d..8f426f94e32a1 100644
@@ -23,7 +23,8 @@
 #include "coresight-self-hosted-trace.h"
 #include "coresight-trbe.h"
 
-#define PERF_IDX2OFF(idx, buf) ((idx) % ((buf)->nr_pages << PAGE_SHIFT))
+#define PERF_IDX2OFF(idx, buf) \
+	((idx) % ((unsigned long)(buf)->nr_pages << PAGE_SHIFT))
 
 /*
  * A padding packet that will help the user space tools
Signature · 1 line
2.51.0
author maintainer
#27 lore raw

PATCH 27/563 perf: arm_spe: Prevent overflow in PERF_IDX2OFF()

In reply to Greg Kroah-Hartman

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

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

From: Leo Yan <[email protected]>

[ Upstream commit a29fea30dd93da16652930162b177941abd8c75e ]

Cast nr_pages to unsigned long to avoid overflow when handling large AUX buffer sizes (>= 2 GiB).

Fixes d5d9696b0380 ("drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension")
---
 drivers/perf/arm_spe_pmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/perf/arm_spe_pmu.c +2 -1
index 369e77ad5f13f..8f14cb324e018 100644
@@ -97,7 +97,8 @@ struct arm_spe_pmu {
 #define to_spe_pmu(p) (container_of(p, struct arm_spe_pmu, pmu))
 
 /* Convert a free-running index from perf into an SPE buffer offset */
-#define PERF_IDX2OFF(idx, buf)	((idx) % ((buf)->nr_pages << PAGE_SHIFT))
+#define PERF_IDX2OFF(idx, buf) \
+	((idx) % ((unsigned long)(buf)->nr_pages << PAGE_SHIFT))
 
 /* Keep track of our dynamic hotplug state */
 static enum cpuhp_state arm_spe_pmu_online;
Signature · 1 line
2.51.0
author maintainer
#28 lore raw

PATCH 28/563 erofs: avoid reading more for fragment maps

In reply to Greg Kroah-Hartman

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

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

From: Gao Xiang <[email protected]>

[ Upstream commit 334c0e493c2aa3e843a80bb9f3862bb50360cb36 ]

Since all real encoded extents (directly handled by the decompression subsystem) have a sane, limited maximum decoded length (Z_EROFS_PCLUSTER_MAX_DSIZE), and the read-more policy is only applied if needed.

However, it makes no sense to read more for non-encoded maps, such as fragment extents, since such extents can be huge (up to i_size) and there is no benefit to reading more at this layer.

For normal images, it does not really matter, but for crafted images generated by syzbot, excessively large fragment extents can cause read-more to run for an overly long time.

Reported-and-tested-by [email protected]
Fixes b44686c8391b ("erofs: fix large fragment handling")
Fixes b15b2e307c3a ("erofs: support on-disk compressed fragments data")
---
 fs/erofs/zdata.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/erofs/zdata.c +2 -2
index 2d73297003d25..625b8ae8f67f0 100644
@@ -1835,7 +1835,7 @@ static void z_erofs_pcluster_readmore(struct z_erofs_frontend *f,
 		map->m_la = end;
 		err = z_erofs_map_blocks_iter(inode, map,
 					      EROFS_GET_BLOCKS_READMORE);
-		if (err)
+		if (err || !(map->m_flags & EROFS_MAP_ENCODED))
 			return;
 
 		/* expand ra for the trailing edge if readahead */
@@ -1847,7 +1847,7 @@ static void z_erofs_pcluster_readmore(struct z_erofs_frontend *f,
 		end = round_up(end, PAGE_SIZE);
 	} else {
 		end = round_up(map->m_la, PAGE_SIZE);
-		if (!map->m_llen)
+		if (!(map->m_flags & EROFS_MAP_ENCODED) || !map->m_llen)
 			return;
 	}
 
Signature · 1 line
2.51.0
author maintainer
#29 lore raw

PATCH 29/563 smb: client: fix sending the iwrap custom IRD/ORD negotiation messages

In reply to Greg Kroah-Hartman

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

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

From: Stefan Metzmacher <[email protected]>

[ Upstream commit ef71f1e046489c77a2f7d012edc762fba0a7aadc ]

Do a real negotiation and check the servers initiator_depth and responder_resources.

This should use big endian in order to be useful. I have captures of windows clients showing this.

The fact that we used little endian up to now means that we sent very large numbers and the negotiation with the server truncated them to the server limits.

Note the reason why this uses u8 for initiator_depth and responder_resources is that the rdma layer also uses it.

The inconsitency regarding the initiator_depth and responder_resources values being reversed for iwarp devices in RDMA_CM_EVENT_ESTABLISHED should also be fixed later, but for now we should fix it.

Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Cc Long Li <[email protected]>
Fixes c7398583340a ("CIFS: SMBD: Implement RDMA memory registration")
---
 fs/smb/client/smbdirect.c | 110 ++++++++++++++++++++++++++++++++++----
 fs/smb/client/smbdirect.h |   4 +-
 2 files changed, 103 insertions(+), 11 deletions(-)
fs/smb/client/smbdirect.c +100 -10
index e0fce5033004c..6480945c24592 100644
@@ -179,6 +179,8 @@ static int smbd_conn_upcall(
 	struct smbd_connection *info = id->context;
 	struct smbdirect_socket *sc = &info->socket;
 	const char *event_name = rdma_event_msg(event->event);
+	u8 peer_initiator_depth;
+	u8 peer_responder_resources;
 
 	log_rdma_event(INFO, "event=%s status=%d\n",
 		event_name, event->status);
@@ -204,6 +206,85 @@ static int smbd_conn_upcall(
 
 	case RDMA_CM_EVENT_ESTABLISHED:
 		log_rdma_event(INFO, "connected event=%s\n", event_name);
+
+		/*
+		 * Here we work around an inconsistency between
+		 * iWarp and other devices (at least rxe and irdma using RoCEv2)
+		 */
+		if (rdma_protocol_iwarp(id->device, id->port_num)) {
+			/*
+			 * iWarp devices report the peer's values
+			 * with the perspective of the peer here.
+			 * Tested with siw and irdma (in iwarp mode)
+			 * We need to change to our perspective here,
+			 * so we need to switch the values.
+			 */
+			peer_initiator_depth = event->param.conn.responder_resources;
+			peer_responder_resources = event->param.conn.initiator_depth;
+		} else {
+			/*
+			 * Non iWarp devices report the peer's values
+			 * already changed to our perspective here.
+			 * Tested with rxe and irdma (in roce mode).
+			 */
+			peer_initiator_depth = event->param.conn.initiator_depth;
+			peer_responder_resources = event->param.conn.responder_resources;
+		}
+		if (rdma_protocol_iwarp(id->device, id->port_num) &&
+		    event->param.conn.private_data_len == 8) {
+			/*
+			 * Legacy clients with only iWarp MPA v1 support
+			 * need a private blob in order to negotiate
+			 * the IRD/ORD values.
+			 */
+			const __be32 *ird_ord_hdr = event->param.conn.private_data;
+			u32 ird32 = be32_to_cpu(ird_ord_hdr[0]);
+			u32 ord32 = be32_to_cpu(ird_ord_hdr[1]);
+
+			/*
+			 * cifs.ko sends the legacy IRD/ORD negotiation
+			 * event if iWarp MPA v2 was used.
+			 *
+			 * Here we check that the values match and only
+			 * mark the client as legacy if they don't match.
+			 */
+			if ((u32)event->param.conn.initiator_depth != ird32 ||
+			    (u32)event->param.conn.responder_resources != ord32) {
+				/*
+				 * There are broken clients (old cifs.ko)
+				 * using little endian and also
+				 * struct rdma_conn_param only uses u8
+				 * for initiator_depth and responder_resources,
+				 * so we truncate the value to U8_MAX.
+				 *
+				 * smb_direct_accept_client() will then
+				 * do the real negotiation in order to
+				 * select the minimum between client and
+				 * server.
+				 */
+				ird32 = min_t(u32, ird32, U8_MAX);
+				ord32 = min_t(u32, ord32, U8_MAX);
+
+				info->legacy_iwarp = true;
+				peer_initiator_depth = (u8)ird32;
+				peer_responder_resources = (u8)ord32;
+			}
+		}
+
+		/*
+		 * negotiate the value by using the minimum
+		 * between client and server if the client provided
+		 * non 0 values.
+		 */
+		if (peer_initiator_depth != 0)
+			info->initiator_depth =
+					min_t(u8, info->initiator_depth,
+					      peer_initiator_depth);
+		if (peer_responder_resources != 0)
+			info->responder_resources =
+					min_t(u8, info->responder_resources,
+					      peer_responder_resources);
+
 		sc->status = SMBDIRECT_SOCKET_CONNECTED;
 		wake_up_interruptible(&info->status_wait);
 		break;
@@ -1551,7 +1632,7 @@ static struct smbd_connection *_smbd_get_connection(
 	struct ib_qp_init_attr qp_attr;
 	struct sockaddr_in *addr_in = (struct sockaddr_in *) dstaddr;
 	struct ib_port_immutable port_immutable;
-	u32 ird_ord_hdr[2];
+	__be32 ird_ord_hdr[2];
 
 	info = kzalloc(sizeof(struct smbd_connection), GFP_KERNEL);
 	if (!info)
@@ -1559,6 +1640,9 @@ static struct smbd_connection *_smbd_get_connection(
 	sc = &info->socket;
 	sp = &sc->parameters;
 
+	info->initiator_depth = 1;
+	info->responder_resources = SMBD_CM_RESPONDER_RESOURCES;
+
 	sc->status = SMBDIRECT_SOCKET_CONNECTING;
 	rc = smbd_ia_open(info, dstaddr, port);
 	if (rc) {
@@ -1639,22 +1723,22 @@ static struct smbd_connection *_smbd_get_connection(
 	}
 	sc->ib.qp = sc->rdma.cm_id->qp;
 
-	memset(&conn_param, 0, sizeof(conn_param));
-	conn_param.initiator_depth = 0;
-
-	conn_param.responder_resources =
-		min(sc->ib.dev->attrs.max_qp_rd_atom,
-		    SMBD_CM_RESPONDER_RESOURCES);
-	info->responder_resources = conn_param.responder_resources;
+	info->responder_resources =
+		min_t(u8, info->responder_resources,
+		      sc->ib.dev->attrs.max_qp_rd_atom);
 	log_rdma_mr(INFO, "responder_resources=%d\n",
 		info->responder_resources);
 
+	memset(&conn_param, 0, sizeof(conn_param));
+	conn_param.initiator_depth = info->initiator_depth;
+	conn_param.responder_resources = info->responder_resources;
+
 	/* Need to send IRD/ORD in private data for iWARP */
 	sc->ib.dev->ops.get_port_immutable(
 		sc->ib.dev, sc->rdma.cm_id->port_num, &port_immutable);
 	if (port_immutable.core_cap_flags & RDMA_CORE_PORT_IWARP) {
-		ird_ord_hdr[0] = info->responder_resources;
-		ird_ord_hdr[1] = 1;
+		ird_ord_hdr[0] = cpu_to_be32(conn_param.responder_resources);
+		ird_ord_hdr[1] = cpu_to_be32(conn_param.initiator_depth);
 		conn_param.private_data = ird_ord_hdr;
 		conn_param.private_data_len = sizeof(ird_ord_hdr);
 	} else {
@@ -2121,6 +2205,12 @@ static int allocate_mr_list(struct smbd_connection *info)
 	atomic_set(&info->mr_used_count, 0);
 	init_waitqueue_head(&info->wait_for_mr_cleanup);
 	INIT_WORK(&info->mr_recovery_work, smbd_mr_recovery_work);
+
+	if (info->responder_resources == 0) {
+		log_rdma_mr(ERR, "responder_resources negotiated as 0\n");
+		return -EINVAL;
+	}
+
 	/* Allocate more MRs (2x) than hardware responder_resources */
 	for (i = 0; i < info->responder_resources * 2; i++) {
 		smbdirect_mr = kzalloc(sizeof(*smbdirect_mr), GFP_KERNEL);
fs/smb/client/smbdirect.h +3 -1
index e45aa9ddd71da..4ca9b2b2c57f9 100644
@@ -67,7 +67,9 @@ struct smbd_connection {
 
 	/* Memory registrations */
 	/* Maximum number of RDMA read/write outstanding on this connection */
-	int responder_resources;
+	bool legacy_iwarp;
+	u8 initiator_depth;
+	u8 responder_resources;
 	/* Maximum number of pages in a single RDMA write/read on this connection */
 	int max_frmr_depth;
 	/*
Signature · 1 line
2.51.0
author maintainer
#30 lore raw

PATCH 30/563 smb: server: fix IRD/ORD negotiation with the client

In reply to Greg Kroah-Hartman

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

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

From: Stefan Metzmacher <[email protected]>

[ Upstream commit fad988a2158d743da7971884b93482a73735b25e ]

Already do real negotiation in smb_direct_handle_connect_request() where we see the requested initiator_depth and responder_resources from the client.

We should detect legacy iwarp clients using MPA v1 with the custom IRD/ORD negotiation.

We need to send the custom IRD/ORD in big endian, but we need to try to let clients with broken requests using little endian (older cifs.ko) to work.

Note the reason why this uses u8 for
initiator_depth and responder_resources is
that the rdma layer also uses it.

Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
---
 fs/smb/server/transport_rdma.c | 99 +++++++++++++++++++++++++++++-----
 1 file changed, 85 insertions(+), 14 deletions(-)
fs/smb/server/transport_rdma.c +85 -14
index 74dfb6496095d..e1f659d3b4cf5 100644
@@ -153,6 +153,10 @@ struct smb_direct_transport {
 	struct work_struct	disconnect_work;
 
 	bool			negotiation_requested;
+
+	bool			legacy_iwarp;
+	u8			initiator_depth;
+	u8			responder_resources;
 };
 
 #define KSMBD_TRANS(t) ((struct ksmbd_transport *)&((t)->transport))
@@ -347,6 +351,9 @@ static struct smb_direct_transport *alloc_transport(struct rdma_cm_id *cm_id)
 	t->cm_id = cm_id;
 	cm_id->context = t;
 
+	t->initiator_depth = SMB_DIRECT_CM_INITIATOR_DEPTH;
+	t->responder_resources = 1;
+
 	t->status = SMB_DIRECT_CS_NEW;
 	init_waitqueue_head(&t->wait_status);
 
@@ -1676,21 +1683,21 @@ static int smb_direct_send_negotiate_response(struct smb_direct_transport *t,
 static int smb_direct_accept_client(struct smb_direct_transport *t)
 {
 	struct rdma_conn_param conn_param;
-	struct ib_port_immutable port_immutable;
-	u32 ird_ord_hdr[2];
+	__be32 ird_ord_hdr[2];
 	int ret;
 
+	/*
+	 * smb_direct_handle_connect_request()
+	 * already negotiated t->initiator_depth
+	 * and t->responder_resources
+	 */
 	memset(&conn_param, 0, sizeof(conn_param));
-	conn_param.initiator_depth = min_t(u8, t->cm_id->device->attrs.max_qp_rd_atom,
-					   SMB_DIRECT_CM_INITIATOR_DEPTH);
-	conn_param.responder_resources = 0;
-
-	t->cm_id->device->ops.get_port_immutable(t->cm_id->device,
-						 t->cm_id->port_num,
-						 &port_immutable);
-	if (port_immutable.core_cap_flags & RDMA_CORE_PORT_IWARP) {
-		ird_ord_hdr[0] = conn_param.responder_resources;
-		ird_ord_hdr[1] = 1;
+	conn_param.initiator_depth = t->initiator_depth;
+	conn_param.responder_resources = t->responder_resources;
+
+	if (t->legacy_iwarp) {
+		ird_ord_hdr[0] = cpu_to_be32(conn_param.responder_resources);
+		ird_ord_hdr[1] = cpu_to_be32(conn_param.initiator_depth);
 		conn_param.private_data = ird_ord_hdr;
 		conn_param.private_data_len = sizeof(ird_ord_hdr);
 	} else {
@@ -2081,10 +2088,13 @@ static bool rdma_frwr_is_supported(struct ib_device_attr *attrs)
 	return true;
 }
 
-static int smb_direct_handle_connect_request(struct rdma_cm_id *new_cm_id)
+static int smb_direct_handle_connect_request(struct rdma_cm_id *new_cm_id,
+					     struct rdma_cm_event *event)
 {
 	struct smb_direct_transport *t;
 	struct task_struct *handler;
+	u8 peer_initiator_depth;
+	u8 peer_responder_resources;
 	int ret;
 
 	if (!rdma_frwr_is_supported(&new_cm_id->device->attrs)) {
@@ -2098,6 +2108,67 @@ static int smb_direct_handle_connect_request(struct rdma_cm_id *new_cm_id)
 	if (!t)
 		return -ENOMEM;
 
+	peer_initiator_depth = event->param.conn.initiator_depth;
+	peer_responder_resources = event->param.conn.responder_resources;
+	if (rdma_protocol_iwarp(new_cm_id->device, new_cm_id->port_num) &&
+	    event->param.conn.private_data_len == 8) {
+		/*
+		 * Legacy clients with only iWarp MPA v1 support
+		 * need a private blob in order to negotiate
+		 * the IRD/ORD values.
+		 */
+		const __be32 *ird_ord_hdr = event->param.conn.private_data;
+		u32 ird32 = be32_to_cpu(ird_ord_hdr[0]);
+		u32 ord32 = be32_to_cpu(ird_ord_hdr[1]);
+
+		/*
+		 * cifs.ko sends the legacy IRD/ORD negotiation
+		 * event if iWarp MPA v2 was used.
+		 *
+		 * Here we check that the values match and only
+		 * mark the client as legacy if they don't match.
+		 */
+		if ((u32)event->param.conn.initiator_depth != ird32 ||
+		    (u32)event->param.conn.responder_resources != ord32) {
+			/*
+			 * There are broken clients (old cifs.ko)
+			 * using little endian and also
+			 * struct rdma_conn_param only uses u8
+			 * for initiator_depth and responder_resources,
+			 * so we truncate the value to U8_MAX.
+			 *
+			 * smb_direct_accept_client() will then
+			 * do the real negotiation in order to
+			 * select the minimum between client and
+			 * server.
+			 */
+			ird32 = min_t(u32, ird32, U8_MAX);
+			ord32 = min_t(u32, ord32, U8_MAX);
+
+			t->legacy_iwarp = true;
+			peer_initiator_depth = (u8)ird32;
+			peer_responder_resources = (u8)ord32;
+		}
+	}
+
+	/*
+	 * First set what the we as server are able to support
+	 */
+	t->initiator_depth = min_t(u8, t->initiator_depth,
+				   new_cm_id->device->attrs.max_qp_rd_atom);
+
+	/*
+	 * negotiate the value by using the minimum
+	 * between client and server if the client provided
+	 * non 0 values.
+	 */
+	if (peer_initiator_depth != 0)
+		t->initiator_depth = min_t(u8, t->initiator_depth,
+					   peer_initiator_depth);
+	if (peer_responder_resources != 0)
+		t->responder_resources = min_t(u8, t->responder_resources,
+					       peer_responder_resources);
+
 	ret = smb_direct_connect(t);
 	if (ret)
 		goto out_err;
@@ -2122,7 +2193,7 @@ static int smb_direct_listen_handler(struct rdma_cm_id *cm_id,
 {
 	switch (event->event) {
 	case RDMA_CM_EVENT_CONNECT_REQUEST: {
-		int ret = smb_direct_handle_connect_request(cm_id);
+		int ret = smb_direct_handle_connect_request(cm_id, event);
 
 		if (ret) {
 			pr_err("Can't create transport: %d\n", ret);
Signature · 1 line
2.51.0
author maintainer
#31 lore raw

PATCH 31/563 EDAC/i10nm: Skip DIMM enumeration on a disabled memory controller

In reply to Greg Kroah-Hartman

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

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

From: Qiuxu Zhuo <[email protected]>

[ Upstream commit 2e6fe1bbefd9c059c3787d1c620fe67343a94dff ]

When loading the i10nm_edac driver on some Intel Granite Rapids servers, a call trace may appear as follows:

  UBSAN: shift-out-of-bounds in drivers/edac/skx_common.c:453:16
  shift exponent -66 is negative
  ...
  __ubsan_handle_shift_out_of_bounds+0x1e3/0x390
  skx_get_dimm_info.cold+0x47/0xd40 [skx_edac_common]
  i10nm_get_dimm_config+0x23e/0x390 [i10nm_edac]
  skx_register_mci+0x159/0x220 [skx_edac_common]
  i10nm_init+0xcb0/0x1ff0 [i10nm_edac]
  ...

This occurs because some BIOS may disable a memory controller if there aren't any memory DIMMs populated on this memory controller. The DIMMMTR register of this disabled memory controller contains the invalid value ~0, resulting in the call trace above.

Fix this call trace by skipping DIMM enumeration on a disabled memory controller.

---
 drivers/edac/i10nm_base.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/edac/i10nm_base.c +14 -0
index bf4171ac191d3..9d00f247f4e0e 100644
@@ -1057,6 +1057,15 @@ static bool i10nm_check_ecc(struct skx_imc *imc, int chan)
 	return !!GET_BITFIELD(mcmtr, 2, 2);
 }
 
+static bool i10nm_channel_disabled(struct skx_imc *imc, int chan)
+{
+	u32 mcmtr = I10NM_GET_MCMTR(imc, chan);
+
+	edac_dbg(1, "mc%d ch%d mcmtr reg %x\n", imc->mc, chan, mcmtr);
+
+	return (mcmtr == ~0 || GET_BITFIELD(mcmtr, 18, 18));
+}
+
 static int i10nm_get_dimm_config(struct mem_ctl_info *mci,
 				 struct res_config *cfg)
 {
@@ -1070,6 +1079,11 @@ static int i10nm_get_dimm_config(struct mem_ctl_info *mci,
 		if (!imc->mbase)
 			continue;
 
+		if (i10nm_channel_disabled(imc, i)) {
+			edac_dbg(1, "mc%d ch%d is disabled.\n", imc->mc, i);
+			continue;
+		}
+
 		ndimms = 0;
 
 		if (res_cfg->type != GNR)
Signature · 1 line
2.51.0
author maintainer
#32 lore raw

PATCH 32/563 perf/x86/intel: Use early_initcall() to hook bts_init()

In reply to Greg Kroah-Hartman

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

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

From: Dapeng Mi <[email protected]>

[ Upstream commit d9cf9c6884d21e01483c4e17479d27636ea4bb50 ]

After the commit 'd971342d38bf ("perf/x86/intel: Decouple BTS
initialization from PEBS initialization")' is introduced, x86_pmu.bts
would initialized in bts_init() which is hooked by arch_initcall().

Whereas init_hw_perf_events() is hooked by early_initcall(). Once the core PMU is initialized, nmi watchdog initialization is called immediately before bts_init() is called. It leads to the BTS buffer is not really initialized since bts_init() is not called and x86_pmu.bts is still false at that time. Worse, BTS buffer would never be initialized then unless all core PMU events are freed and reserve_ds_buffers() is called again.

Thus aligning with init_hw_perf_events(), use early_initcall() to hook bts_init() to ensure x86_pmu.bts is initialized before nmi watchdog initialization.

Fixes d971342d38bf ("perf/x86/intel: Decouple BTS initialization from PEBS initialization")
---
 arch/x86/events/intel/bts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/bts.c +1 -1
index 61da6b8a3d519..cbac54cb3a9ec 100644
@@ -643,4 +643,4 @@ static __init int bts_init(void)
 
 	return perf_pmu_register(&bts_pmu, "intel_bts", -1);
 }
-arch_initcall(bts_init);
+early_initcall(bts_init);
Signature · 1 line
2.51.0
author maintainer
#33 lore raw

PATCH 33/563 perf/x86/intel: Fix IA32_PMC_x_CFG_B MSRs access error

In reply to Greg Kroah-Hartman

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

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

From: Dapeng Mi <[email protected]>

[ Upstream commit 43796f30507802d93ead2dc44fc9637f34671a89 ]

When running perf_fuzzer on PTL, sometimes the below "unchecked MSR
access error" is seen when accessing IA32_PMC_x_CFG_B MSRs.

[   55.611268] unchecked MSR access error: WRMSR to 0x1986 (tried to write 0x0000000200000001) at rIP: 0xffffffffac564b28 (native_write_msr+0x8/0x30)
[   55.611280] Call Trace:
[   55.611282]  <TASK>
[   55.611284]  ? intel_pmu_config_acr+0x87/0x160
[   55.611289]  intel_pmu_enable_acr+0x6d/0x80
[   55.611291]  intel_pmu_enable_event+0xce/0x460
[   55.611293]  x86_pmu_start+0x78/0xb0
[   55.611297]  x86_pmu_enable+0x218/0x3a0
[   55.611300]  ? x86_pmu_enable+0x121/0x3a0
[   55.611302]  perf_pmu_enable+0x40/0x50
[   55.611307]  ctx_resched+0x19d/0x220
[   55.611309]  __perf_install_in_context+0x284/0x2f0
[   55.611311]  ? __pfx_remote_function+0x10/0x10
[   55.611314]  remote_function+0x52/0x70
[   55.611317]  ? __pfx_remote_function+0x10/0x10
[   55.611319]  generic_exec_single+0x84/0x150
[   55.611323]  smp_call_function_single+0xc5/0x1a0
[   55.611326]  ? __pfx_remote_function+0x10/0x10
[   55.611329]  perf_install_in_context+0xd1/0x1e0
[   55.611331]  ? __pfx___perf_install_in_context+0x10/0x10
[   55.611333]  __do_sys_perf_event_open+0xa76/0x1040
[   55.611336]  __x64_sys_perf_event_open+0x26/0x30
[   55.611337]  x64_sys_call+0x1d8e/0x20c0
[   55.611339]  do_syscall_64+0x4f/0x120
[   55.611343]  entry_SYSCALL_64_after_hwframe+0x76/0x7e

On PTL, GP counter 0 and 1 doesn't support auto counter reload feature, thus it would trigger a #GP when trying to write 1 on bit 0 of CFG_B MSR which requires to enable auto counter reload on GP counter 0.

The root cause of causing this issue is the check for auto counter reload (ACR) counter mask from user space is incorrect in intel_pmu_acr_late_setup() helper. It leads to an invalid ACR counter mask from user space could be set into hw.config1 and then written into CFG_B MSRs and trigger the MSR access warning.

e.g., User may create a perf event with ACR counter mask (config2=0xcb), and there is only 1 event created, so "cpuc->n_events" is 1.

The correct check condition should be "i + idx >= cpuc->n_events" instead of "i + idx > cpuc->n_events" (it looks a typo). Otherwise, the counter mask would traverse twice and an invalid "cpuc->assign[1]" bit (bit 0) is set into hw.config1 and cause MSR accessing error.

Besides, also check if the ACR counter mask corresponding events are ACR events. If not, filter out these counter mask. If a event is not a ACR event, it could be scheduled to an HW counter which doesn't support ACR. It's invalid to add their counter index in ACR counter mask.

Furthermore, remove the WARN_ON_ONCE() since it's easily triggered as user could set any invalid ACR counter mask and the warning message could mislead users.

Fixes ec980e4facef ("perf/x86/intel: Support auto counter reload")
---
 arch/x86/events/intel/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/events/intel/core.c +2 -1
index c2fb729c270ec..15da60cf69f20 100644
@@ -2997,7 +2997,8 @@ static void intel_pmu_acr_late_setup(struct cpu_hw_events *cpuc)
 			if (event->group_leader != leader->group_leader)
 				break;
 			for_each_set_bit(idx, (unsigned long *)&event->attr.config2, X86_PMC_IDX_MAX) {
-				if (WARN_ON_ONCE(i + idx > cpuc->n_events))
+				if (i + idx >= cpuc->n_events ||
+				    !is_acr_event_group(cpuc->event_list[i + idx]))
 					return;
 				__set_bit(cpuc->assign[i + idx], (unsigned long *)&event->hw.config1);
 			}
Signature · 1 line
2.51.0
author maintainer
#34 lore raw

PATCH 34/563 x86/vdso: Fix output operand size of RDPID

In reply to Greg Kroah-Hartman

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

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

From: Uros Bizjak <[email protected]>

[ Upstream commit ac9c408ed19d535289ca59200dd6a44a6a2d6036 ]

RDPID instruction outputs to a word-sized register (64-bit on x86_64 and 32-bit on x86_32). Use an unsigned long variable to store the correct size.

LSL outputs to 32-bit register, use %k operand prefix to always print the 32-bit name of the register.

Use RDPID insn mnemonic while at it as the minimum binutils version of 2.30 supports it.

[ bp: Merge two patches touching the same function into a single one. ]

Fixes ffebbaedc861 ("x86/vdso: Introduce helper functions for CPU and node number")
---
 arch/x86/include/asm/segment.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/segment.h +4 -4
index 77d8f49b92bdd..f59ae7186940a 100644
@@ -244,7 +244,7 @@ static inline unsigned long vdso_encode_cpunode(int cpu, unsigned long node)
 
 static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
 {
-	unsigned int p;
+	unsigned long p;
 
 	/*
 	 * Load CPU and node number from the GDT.  LSL is faster than RDTSCP
@@ -254,10 +254,10 @@ static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
 	 *
 	 * If RDPID is available, use it.
 	 */
-	alternative_io ("lsl %[seg],%[p]",
-			".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */
+	alternative_io ("lsl %[seg],%k[p]",
+			"rdpid %[p]",
 			X86_FEATURE_RDPID,
-			[p] "=a" (p), [seg] "r" (__CPUNODE_SEG));
+			[p] "=r" (p), [seg] "r" (__CPUNODE_SEG));
 
 	if (cpu)
 		*cpu = (p & VDSO_CPUNODE_MASK);
Signature · 1 line
2.51.0
author maintainer
#35 lore raw

PATCH 35/563 selftests: cgroup: Make test_pids backwards compatible

In reply to Greg Kroah-Hartman

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

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

From: Michal Koutný <[email protected]>

[ Upstream commit 3b0dec689a6301845761681b852f9538cb75a1d2 ]

The predicates in test expect event counting from 73e75e6fc352b ("cgroup/pids: Separate semantics of pids.events related to pids.max") and the test would fail on older kernels. We want to have one version of tests for all, so detect the feature and skip the test on old kernels. (The test could even switch to check v1 semantics based on the flag but keep it simple for now.)

Fixes 9f34c566027b6 ("selftests: cgroup: Add basic tests for pids controller")
---
 tools/testing/selftests/cgroup/lib/cgroup_util.c     | 12 ++++++++++++
 .../selftests/cgroup/lib/include/cgroup_util.h       |  1 +
 tools/testing/selftests/cgroup/test_pids.c           |  3 +++
 3 files changed, 16 insertions(+)
tools/testing/selftests/cgroup/lib/cgroup_util.c +12 -0
index 0e89fcff4d05d..44c52f620fda1 100644
@@ -522,6 +522,18 @@ int proc_mount_contains(const char *option)
 	return strstr(buf, option) != NULL;
 }
 
+int cgroup_feature(const char *feature)
+{
+	char buf[PAGE_SIZE];
+	ssize_t read;
+
+	read = read_text("/sys/kernel/cgroup/features", buf, sizeof(buf));
+	if (read < 0)
+		return read;
+
+	return strstr(buf, feature) != NULL;
+}
+
 ssize_t proc_read_text(int pid, bool thread, const char *item, char *buf, size_t size)
 {
 	char path[PATH_MAX];
tools/testing/selftests/cgroup/lib/include/cgroup_util.h +1 -0
index c69cab66254b4..9dc90a1b386d7 100644
@@ -60,6 +60,7 @@ extern int cg_run_nowait(const char *cgroup,
 extern int cg_wait_for_proc_count(const char *cgroup, int count);
 extern int cg_killall(const char *cgroup);
 int proc_mount_contains(const char *option);
+int cgroup_feature(const char *feature);
 extern ssize_t proc_read_text(int pid, bool thread, const char *item, char *buf, size_t size);
 extern int proc_read_strstr(int pid, bool thread, const char *item, const char *needle);
 extern pid_t clone_into_cgroup(int cgroup_fd);
tools/testing/selftests/cgroup/test_pids.c +3 -0
index 9ecb83c6cc5cb..d8a1d1cd50072 100644
@@ -77,6 +77,9 @@ static int test_pids_events(const char *root)
 	char *cg_parent = NULL, *cg_child = NULL;
 	int pid;
 
+	if (cgroup_feature("pids_localevents") <= 0)
+		return KSFT_SKIP;
+
 	cg_parent = cg_name(root, "pids_parent");
 	cg_child = cg_name(cg_parent, "pids_child");
 	if (!cg_parent || !cg_child)
Signature · 1 line
2.51.0
author maintainer
#36 lore raw

PATCH 36/563 sched/fair: Get rid of sched_domains_curr_level hack for tl->cpumask()

In reply to Greg Kroah-Hartman

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

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

From: Peter Zijlstra <[email protected]>

[ Upstream commit 661f951e371cc134ea31c84238dbdc9a898b8403 ]

Leon [1] and Vinicius [2] noted a topology_span_sane() warning during their testing starting from v6.16-rc1. Debug that followed pointed to the tl->mask() for the NODE domain being incorrectly resolved to that of the highest NUMA domain.

tl->mask() for NODE is set to the sd_numa_mask() which depends on the global "sched_domains_curr_level" hack. "sched_domains_curr_level" is set to the "tl->numa_level" during tl traversal in build_sched_domains() calling sd_init() but was not reset before topology_span_sane().

Since "tl->numa_level" still reflected the old value from build_sched_domains(), topology_span_sane() for the NODE domain trips when the span of the last NUMA domain overlaps.

Instead of replicating the "sched_domains_curr_level" hack, get rid of it entirely and instead, pass the entire "sched_domain_topology_level" object to tl->cpumask() function to prevent such mishap in the future.

sd_numa_mask() now directly references "tl->numa_level" instead of relying on the global "sched_domains_curr_level" hack to index into sched_domains_numa_masks[].

The original warning was reproducible on the following NUMA topology reported by Leon:

    $ sudo numactl -H
    available: 5 nodes (0-4)
    node 0 cpus: 0 1
    node 0 size: 2927 MB
    node 0 free: 1603 MB
    node 1 cpus: 2 3
    node 1 size: 3023 MB
    node 1 free: 3008 MB
    node 2 cpus: 4 5
    node 2 size: 3023 MB
    node 2 free: 3007 MB
    node 3 cpus: 6 7
    node 3 size: 3023 MB
    node 3 free: 3002 MB
    node 4 cpus: 8 9
    node 4 size: 3022 MB
    node 4 free: 2718 MB
    node distances:
    node   0   1   2   3   4
      0:  10  39  38  37  36
      1:  39  10  38  37  36
      2:  38  38  10  37  36
      3:  37  37  37  10  36
      4:  36  36  36  36  10

The above topology can be mimicked using the following QEMU cmd that was used to reproduce the warning and test the fix:

     sudo qemu-system-x86_64 -enable-kvm -cpu host \
     -m 20G -smp cpus=10,sockets=10 -machine q35 \
     -object memory-backend-ram,size=4G,id=m0 \
     -object memory-backend-ram,size=4G,id=m1 \
     -object memory-backend-ram,size=4G,id=m2 \
     -object memory-backend-ram,size=4G,id=m3 \
     -object memory-backend-ram,size=4G,id=m4 \
     -numa node,cpus=0-1,memdev=m0,nodeid=0 \
     -numa node,cpus=2-3,memdev=m1,nodeid=1 \
     -numa node,cpus=4-5,memdev=m2,nodeid=2 \
     -numa node,cpus=6-7,memdev=m3,nodeid=3 \
     -numa node,cpus=8-9,memdev=m4,nodeid=4 \
     -numa dist,src=0,dst=1,val=39 \
     -numa dist,src=0,dst=2,val=38 \
     -numa dist,src=0,dst=3,val=37 \
     -numa dist,src=0,dst=4,val=36 \
     -numa dist,src=1,dst=0,val=39 \
     -numa dist,src=1,dst=2,val=38 \
     -numa dist,src=1,dst=3,val=37 \
     -numa dist,src=1,dst=4,val=36 \
     -numa dist,src=2,dst=0,val=38 \
     -numa dist,src=2,dst=1,val=38 \
     -numa dist,src=2,dst=3,val=37 \
     -numa dist,src=2,dst=4,val=36 \
     -numa dist,src=3,dst=0,val=37 \
     -numa dist,src=3,dst=1,val=37 \
     -numa dist,src=3,dst=2,val=37 \
     -numa dist,src=3,dst=4,val=36 \
     -numa dist,src=4,dst=0,val=36 \
     -numa dist,src=4,dst=1,val=36 \
     -numa dist,src=4,dst=2,val=36 \
     -numa dist,src=4,dst=3,val=36 \
     ...

[ prateek: Moved common functions to include/linux/sched/topology.h,
reuse the common bits for s390 and ppc, commit message ]

---
 arch/powerpc/Kconfig                |  4 ++++
 arch/powerpc/include/asm/topology.h |  2 ++
 arch/powerpc/kernel/smp.c           | 27 +++++++++++----------------
 arch/s390/kernel/topology.c         | 20 +++++++-------------
 arch/x86/kernel/smpboot.c           |  8 ++++----
 include/linux/sched/topology.h      | 28 +++++++++++++++++++++++++++-
 include/linux/topology.h            |  2 +-
 kernel/sched/topology.c             | 28 ++++++++++------------------
 8 files changed, 66 insertions(+), 53 deletions(-)
arch/powerpc/Kconfig +4 -0
index 93402a1d9c9fc..e51a595a06228 100644
@@ -971,6 +971,10 @@ config SCHED_SMT
 	  when dealing with POWER5 cpus at a cost of slightly increased
 	  overhead in some places. If unsure say N here.
 
+config SCHED_MC
+	def_bool y
+	depends on SMP
+
 config PPC_DENORMALISATION
 	bool "PowerPC denormalisation exception handling"
 	depends on PPC_BOOK3S_64
arch/powerpc/include/asm/topology.h +2 -0
index da15b5efe8071..f19ca44512d1e 100644
@@ -131,6 +131,8 @@ static inline int cpu_to_coregroup_id(int cpu)
 #ifdef CONFIG_SMP
 #include <asm/cputable.h>
 
+struct cpumask *cpu_coregroup_mask(int cpu);
+
 #ifdef CONFIG_PPC64
 #include <asm/smp.h>
 
arch/powerpc/kernel/smp.c +11 -16
index f59e4b9cc2074..68edb66c2964b 100644
@@ -1028,19 +1028,19 @@ static int powerpc_shared_proc_flags(void)
  * We can't just pass cpu_l2_cache_mask() directly because
  * returns a non-const pointer and the compiler barfs on that.
  */
-static const struct cpumask *shared_cache_mask(int cpu)
+static const struct cpumask *tl_cache_mask(struct sched_domain_topology_level *tl, int cpu)
 {
 	return per_cpu(cpu_l2_cache_map, cpu);
 }
 
 #ifdef CONFIG_SCHED_SMT
-static const struct cpumask *smallcore_smt_mask(int cpu)
+static const struct cpumask *tl_smallcore_smt_mask(struct sched_domain_topology_level *tl, int cpu)
 {
 	return cpu_smallcore_mask(cpu);
 }
 #endif
 
-static struct cpumask *cpu_coregroup_mask(int cpu)
+struct cpumask *cpu_coregroup_mask(int cpu)
 {
 	return per_cpu(cpu_coregroup_map, cpu);
 }
@@ -1054,11 +1054,6 @@ static bool has_coregroup_support(void)
 	return coregroup_enabled;
 }
 
-static const struct cpumask *cpu_mc_mask(int cpu)
-{
-	return cpu_coregroup_mask(cpu);
-}
-
 static int __init init_big_cores(void)
 {
 	int cpu;
@@ -1448,7 +1443,7 @@ static bool update_mask_by_l2(int cpu, cpumask_var_t *mask)
 		return false;
 	}
 
-	cpumask_and(*mask, cpu_online_mask, cpu_cpu_mask(cpu));
+	cpumask_and(*mask, cpu_online_mask, cpu_node_mask(cpu));
 
 	/* Update l2-cache mask with all the CPUs that are part of submask */
 	or_cpumasks_related(cpu, cpu, submask_fn, cpu_l2_cache_mask);
@@ -1538,7 +1533,7 @@ static void update_coregroup_mask(int cpu, cpumask_var_t *mask)
 		return;
 	}
 
-	cpumask_and(*mask, cpu_online_mask, cpu_cpu_mask(cpu));
+	cpumask_and(*mask, cpu_online_mask, cpu_node_mask(cpu));
 
 	/* Update coregroup mask with all the CPUs that are part of submask */
 	or_cpumasks_related(cpu, cpu, submask_fn, cpu_coregroup_mask);
@@ -1601,7 +1596,7 @@ static void add_cpu_to_masks(int cpu)
 
 	/* If chip_id is -1; limit the cpu_core_mask to within PKG */
 	if (chip_id == -1)
-		cpumask_and(mask, mask, cpu_cpu_mask(cpu));
+		cpumask_and(mask, mask, cpu_node_mask(cpu));
 
 	for_each_cpu(i, mask) {
 		if (chip_id == cpu_to_chip_id(i)) {
@@ -1701,22 +1696,22 @@ static void __init build_sched_topology(void)
 	if (has_big_cores) {
 		pr_info("Big cores detected but using small core scheduling\n");
 		powerpc_topology[i++] =
-			SDTL_INIT(smallcore_smt_mask, powerpc_smt_flags, SMT);
+			SDTL_INIT(tl_smallcore_smt_mask, powerpc_smt_flags, SMT);
 	} else {
-		powerpc_topology[i++] = SDTL_INIT(cpu_smt_mask, powerpc_smt_flags, SMT);
+		powerpc_topology[i++] = SDTL_INIT(tl_smt_mask, powerpc_smt_flags, SMT);
 	}
 #endif
 	if (shared_caches) {
 		powerpc_topology[i++] =
-			SDTL_INIT(shared_cache_mask, powerpc_shared_cache_flags, CACHE);
+			SDTL_INIT(tl_cache_mask, powerpc_shared_cache_flags, CACHE);
 	}
 
 	if (has_coregroup_support()) {
 		powerpc_topology[i++] =
-			SDTL_INIT(cpu_mc_mask, powerpc_shared_proc_flags, MC);
+			SDTL_INIT(tl_mc_mask, powerpc_shared_proc_flags, MC);
 	}
 
-	powerpc_topology[i++] = SDTL_INIT(cpu_cpu_mask, powerpc_shared_proc_flags, PKG);
+	powerpc_topology[i++] = SDTL_INIT(tl_pkg_mask, powerpc_shared_proc_flags, PKG);
 
 	/* There must be one trailing NULL entry left.  */
 	BUG_ON(i >= ARRAY_SIZE(powerpc_topology) - 1);
arch/s390/kernel/topology.c +7 -13
index 46569b8e47dde..1594c80e9bc4d 100644
@@ -509,33 +509,27 @@ int topology_cpu_init(struct cpu *cpu)
 	return rc;
 }
 
-static const struct cpumask *cpu_thread_mask(int cpu)
-{
-	return &cpu_topology[cpu].thread_mask;
-}
-
-
 const struct cpumask *cpu_coregroup_mask(int cpu)
 {
 	return &cpu_topology[cpu].core_mask;
 }
 
-static const struct cpumask *cpu_book_mask(int cpu)
+static const struct cpumask *tl_book_mask(struct sched_domain_topology_level *tl, int cpu)
 {
 	return &cpu_topology[cpu].book_mask;
 }
 
-static const struct cpumask *cpu_drawer_mask(int cpu)
+static const struct cpumask *tl_drawer_mask(struct sched_domain_topology_level *tl, int cpu)
 {
 	return &cpu_topology[cpu].drawer_mask;
 }
 
 static struct sched_domain_topology_level s390_topology[] = {
-	SDTL_INIT(cpu_thread_mask, cpu_smt_flags, SMT),
-	SDTL_INIT(cpu_coregroup_mask, cpu_core_flags, MC),
-	SDTL_INIT(cpu_book_mask, NULL, BOOK),
-	SDTL_INIT(cpu_drawer_mask, NULL, DRAWER),
-	SDTL_INIT(cpu_cpu_mask, NULL, PKG),
+	SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
+	SDTL_INIT(tl_mc_mask, cpu_core_flags, MC),
+	SDTL_INIT(tl_book_mask, NULL, BOOK),
+	SDTL_INIT(tl_drawer_mask, NULL, DRAWER),
+	SDTL_INIT(tl_pkg_mask, NULL, PKG),
 	{ NULL, },
 };
 
arch/x86/kernel/smpboot.c +4 -4
index 33e166f6ab122..eb289abece237 100644
@@ -479,14 +479,14 @@ static int x86_cluster_flags(void)
 static bool x86_has_numa_in_package;
 
 static struct sched_domain_topology_level x86_topology[] = {
-	SDTL_INIT(cpu_smt_mask, cpu_smt_flags, SMT),
+	SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
 #ifdef CONFIG_SCHED_CLUSTER
-	SDTL_INIT(cpu_clustergroup_mask, x86_cluster_flags, CLS),
+	SDTL_INIT(tl_cls_mask, x86_cluster_flags, CLS),
 #endif
 #ifdef CONFIG_SCHED_MC
-	SDTL_INIT(cpu_coregroup_mask, x86_core_flags, MC),
+	SDTL_INIT(tl_mc_mask, x86_core_flags, MC),
 #endif
-	SDTL_INIT(cpu_cpu_mask, x86_sched_itmt_flags, PKG),
+	SDTL_INIT(tl_pkg_mask, x86_sched_itmt_flags, PKG),
 	{ NULL },
 };
 
include/linux/sched/topology.h +27 -1
index 5263746b63e8c..a3a24e115d446 100644
@@ -30,11 +30,19 @@ struct sd_flag_debug {
 };
 extern const struct sd_flag_debug sd_flag_debug[];
 
+struct sched_domain_topology_level;
+
 #ifdef CONFIG_SCHED_SMT
 static inline int cpu_smt_flags(void)
 {
 	return SD_SHARE_CPUCAPACITY | SD_SHARE_LLC;
 }
+
+static inline const
+struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
+{
+	return cpu_smt_mask(cpu);
+}
 #endif
 
 #ifdef CONFIG_SCHED_CLUSTER
@@ -42,6 +50,12 @@ static inline int cpu_cluster_flags(void)
 {
 	return SD_CLUSTER | SD_SHARE_LLC;
 }
+
+static inline const
+struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu)
+{
+	return cpu_clustergroup_mask(cpu);
+}
 #endif
 
 #ifdef CONFIG_SCHED_MC
@@ -49,8 +63,20 @@ static inline int cpu_core_flags(void)
 {
 	return SD_SHARE_LLC;
 }
+
+static inline const
+struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
+{
+	return cpu_coregroup_mask(cpu);
+}
 #endif
 
+static inline const
+struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
+{
+	return cpu_node_mask(cpu);
+}
+
 #ifdef CONFIG_NUMA
 static inline int cpu_numa_flags(void)
 {
@@ -172,7 +198,7 @@ bool cpus_equal_capacity(int this_cpu, int that_cpu);
 bool cpus_share_cache(int this_cpu, int that_cpu);
 bool cpus_share_resources(int this_cpu, int that_cpu);
 
-typedef const struct cpumask *(*sched_domain_mask_f)(int cpu);
+typedef const struct cpumask *(*sched_domain_mask_f)(struct sched_domain_topology_level *tl, int cpu);
 typedef int (*sched_domain_flags_f)(void);
 
 struct sd_data {
include/linux/topology.h +1 -1
index 33b7fda97d390..6575af39fd10f 100644
@@ -260,7 +260,7 @@ static inline bool topology_is_primary_thread(unsigned int cpu)
 
 #endif
 
-static inline const struct cpumask *cpu_cpu_mask(int cpu)
+static inline const struct cpumask *cpu_node_mask(int cpu)
 {
 	return cpumask_of_node(cpu_to_node(cpu));
 }
kernel/sched/topology.c +10 -18
index 6e2f54169e66c..36d4f9f063516 100644
@@ -1591,7 +1591,6 @@ static void claim_allocations(int cpu, struct sched_domain *sd)
 enum numa_topology_type sched_numa_topology_type;
 
 static int			sched_domains_numa_levels;
-static int			sched_domains_curr_level;
 
 int				sched_max_numa_distance;
 static int			*sched_domains_numa_distance;
@@ -1632,14 +1631,7 @@ sd_init(struct sched_domain_topology_level *tl,
 	int sd_id, sd_weight, sd_flags = 0;
 	struct cpumask *sd_span;
 
-#ifdef CONFIG_NUMA
-	/*
-	 * Ugly hack to pass state to sd_numa_mask()...
-	 */
-	sched_domains_curr_level = tl->numa_level;
-#endif
-
-	sd_weight = cpumask_weight(tl->mask(cpu));
+	sd_weight = cpumask_weight(tl->mask(tl, cpu));
 
 	if (tl->sd_flags)
 		sd_flags = (*tl->sd_flags)();
@@ -1677,7 +1669,7 @@ sd_init(struct sched_domain_topology_level *tl,
 	};
 
 	sd_span = sched_domain_span(sd);
-	cpumask_and(sd_span, cpu_map, tl->mask(cpu));
+	cpumask_and(sd_span, cpu_map, tl->mask(tl, cpu));
 	sd_id = cpumask_first(sd_span);
 
 	sd->flags |= asym_cpu_capacity_classify(sd_span, cpu_map);
@@ -1737,17 +1729,17 @@ sd_init(struct sched_domain_topology_level *tl,
  */
 static struct sched_domain_topology_level default_topology[] = {
 #ifdef CONFIG_SCHED_SMT
-	SDTL_INIT(cpu_smt_mask, cpu_smt_flags, SMT),
+	SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
 #endif
 
 #ifdef CONFIG_SCHED_CLUSTER
-	SDTL_INIT(cpu_clustergroup_mask, cpu_cluster_flags, CLS),
+	SDTL_INIT(tl_cls_mask, cpu_cluster_flags, CLS),
 #endif
 
 #ifdef CONFIG_SCHED_MC
-	SDTL_INIT(cpu_coregroup_mask, cpu_core_flags, MC),
+	SDTL_INIT(tl_mc_mask, cpu_core_flags, MC),
 #endif
-	SDTL_INIT(cpu_cpu_mask, NULL, PKG),
+	SDTL_INIT(tl_pkg_mask, NULL, PKG),
 	{ NULL, },
 };
 
@@ -1769,9 +1761,9 @@ void __init set_sched_topology(struct sched_domain_topology_level *tl)
 
 #ifdef CONFIG_NUMA
 
-static const struct cpumask *sd_numa_mask(int cpu)
+static const struct cpumask *sd_numa_mask(struct sched_domain_topology_level *tl, int cpu)
 {
-	return sched_domains_numa_masks[sched_domains_curr_level][cpu_to_node(cpu)];
+	return sched_domains_numa_masks[tl->numa_level][cpu_to_node(cpu)];
 }
 
 static void sched_numa_warn(const char *str)
@@ -2413,7 +2405,7 @@ static bool topology_span_sane(const struct cpumask *cpu_map)
 		 * breaks the linking done for an earlier span.
 		 */
 		for_each_cpu(cpu, cpu_map) {
-			const struct cpumask *tl_cpu_mask = tl->mask(cpu);
+			const struct cpumask *tl_cpu_mask = tl->mask(tl, cpu);
 			int id;
 
 			/* lowest bit set in this mask is used as a unique id */
@@ -2421,7 +2413,7 @@ static bool topology_span_sane(const struct cpumask *cpu_map)
 
 			if (cpumask_test_cpu(id, id_seen)) {
 				/* First CPU has already been seen, ensure identical spans */
-				if (!cpumask_equal(tl->mask(id), tl_cpu_mask))
+				if (!cpumask_equal(tl->mask(tl, id), tl_cpu_mask))
 					return false;
 			} else {
 				/* First CPU hasn't been seen before, ensure it's a completely new span */
Signature · 1 line
2.51.0
author maintainer
#37 lore raw

PATCH 37/563 lsm: CONFIG_LSM can depend on CONFIG_SECURITY

In reply to Greg Kroah-Hartman

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

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

From: Randy Dunlap <[email protected]>

[ Upstream commit 54d94c422fed9575b74167333c1757847a4e6899 ]

When CONFIG_SECURITY is not set, CONFIG_LSM (builtin_lsm_order) does not need to be visible and settable since builtin_lsm_order is defined in security.o, which is only built when CONFIG_SECURITY=y.

So make CONFIG_LSM depend on CONFIG_SECURITY.

Fixes 13e735c0e953 ("LSM: Introduce CONFIG_LSM")
[PM: subj tweak]
---
 security/Kconfig | 1 +
 1 file changed, 1 insertion(+)
security/Kconfig +1 -0
index 4816fc74f81eb..285f284dfcac4 100644
@@ -269,6 +269,7 @@ endchoice
 
 config LSM
 	string "Ordered list of enabled LSMs"
+	depends on SECURITY
 	default "landlock,lockdown,yama,loadpin,safesetid,smack,selinux,tomoyo,apparmor,ipe,bpf" if DEFAULT_SECURITY_SMACK
 	default "landlock,lockdown,yama,loadpin,safesetid,apparmor,selinux,smack,tomoyo,ipe,bpf" if DEFAULT_SECURITY_APPARMOR
 	default "landlock,lockdown,yama,loadpin,safesetid,tomoyo,ipe,bpf" if DEFAULT_SECURITY_TOMOYO
Signature · 1 line
2.51.0
author maintainer
#38 lore raw

PATCH 38/563 cpuset: fix failure to enable isolated partition when containing isolcpus

In reply to Greg Kroah-Hartman

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

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

From: Chen Ridong <[email protected]>

[ Upstream commit 216217ebee16afc4d79c3e86a736d87175c18e68 ]

The 'isolcpus' parameter specified at boot time can be assigned to an isolated partition. While it is valid put the 'isolcpus' in an isolated partition, attempting to change a member cpuset to an isolated partition will fail if the cpuset contains any 'isolcpus'.

For example, the system boots with 'isolcpus=9', and the following configuration works correctly:

  # cd /sys/fs/cgroup/
  # mkdir test
  # echo 1 > test/cpuset.cpus
  # echo isolated > test/cpuset.cpus.partition
  # cat test/cpuset.cpus.partition
  isolated
  # echo 9 > test/cpuset.cpus
  # cat test/cpuset.cpus.partition
  isolated
  # cat test/cpuset.cpus
  9

However, the following steps to convert a member cpuset to an isolated partition will fail:

  # cd /sys/fs/cgroup/
  # mkdir test
  # echo 9 > test/cpuset.cpus
  # echo isolated > test/cpuset.cpus.partition
  # cat test/cpuset.cpus.partition
  isolated invalid (partition config conflicts with housekeeping setup)

The issue occurs because the new partition state (new_prs) is used for validation against housekeeping constraints before it has been properly updated. To resolve this, move the assignment of new_prs before the housekeeping validation check when enabling a root partition.

Fixes 4a74e418881f ("cgroup/cpuset: Check partition conflict with housekeeping setup")
---
 kernel/cgroup/cpuset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/cpuset.c +1 -1
index 27adb04df675d..fef93032fe7e4 100644
@@ -1716,6 +1716,7 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
 		xcpus = tmp->delmask;
 		if (compute_effective_exclusive_cpumask(cs, xcpus, NULL))
 			WARN_ON_ONCE(!cpumask_empty(cs->exclusive_cpus));
+		new_prs = (cmd == partcmd_enable) ? PRS_ROOT : PRS_ISOLATED;
 
 		/*
 		 * Enabling partition root is not allowed if its
@@ -1748,7 +1749,6 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
 
 		deleting = true;
 		subparts_delta++;
-		new_prs = (cmd == partcmd_enable) ? PRS_ROOT : PRS_ISOLATED;
 	} else if (cmd == partcmd_disable) {
 		/*
 		 * May need to add cpus back to parent's effective_cpus
Signature · 1 line
2.51.0
author maintainer
#39 lore raw

PATCH 39/563 btrfs: return any hit error from extent_writepage_io()

In reply to Greg Kroah-Hartman

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

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

From: Qu Wenruo <[email protected]>

[ Upstream commit 2d83ed6c6c4607b42ee7927e92a9d2fa31d6f30b ]

Since the support of bs < ps support, extent_writepage_io() will submit multiple blocks inside the folio.

But if we hit error submitting one sector, but the next sector can still be submitted successfully, the function extent_writepage_io() will still return 0.

This will make btrfs to silently ignore the error without setting error flag for the filemap.

Fix it by recording the first error hit, and always return that value.

Fixes 8bf334beb349 ("btrfs: fix double accounting race when extent_writepage_io() failed")
---
 fs/btrfs/extent_io.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
fs/btrfs/extent_io.c +5 -4
index b21cb72835ccf..4eafe3817e11c 100644
@@ -1621,7 +1621,7 @@ static noinline_for_stack int extent_writepage_io(struct btrfs_inode *inode,
 	struct btrfs_fs_info *fs_info = inode->root->fs_info;
 	unsigned long range_bitmap = 0;
 	bool submitted_io = false;
-	bool error = false;
+	int found_error = 0;
 	const u64 folio_start = folio_pos(folio);
 	const unsigned int blocks_per_folio = btrfs_blocks_per_folio(fs_info, folio);
 	u64 cur;
@@ -1685,7 +1685,8 @@ static noinline_for_stack int extent_writepage_io(struct btrfs_inode *inode,
 			 */
 			btrfs_mark_ordered_io_finished(inode, folio, cur,
 						       fs_info->sectorsize, false);
-			error = true;
+			if (!found_error)
+				found_error = ret;
 			continue;
 		}
 		submitted_io = true;
@@ -1702,11 +1703,11 @@ static noinline_for_stack int extent_writepage_io(struct btrfs_inode *inode,
 	 * If we hit any error, the corresponding sector will have its dirty
 	 * flag cleared and writeback finished, thus no need to handle the error case.
 	 */
-	if (!submitted_io && !error) {
+	if (!submitted_io && !found_error) {
 		btrfs_folio_set_writeback(fs_info, folio, start, len);
 		btrfs_folio_clear_writeback(fs_info, folio, start, len);
 	}
-	return ret;
+	return found_error;
 }
 
 /*
Signature · 1 line
2.51.0
author maintainer
#40 lore raw

PATCH 40/563 btrfs: fix symbolic link reading when bs > ps

In reply to Greg Kroah-Hartman

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

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

From: Qu Wenruo <[email protected]>

[ Upstream commit 67378b754608a3524d125bfa5744508a49fe48be ]

[BUG DURING BS > PS TEST]
When running the following script on a btrfs whose block size is larger than page size, e.g. 8K block size and 4K page size, it will trigger a kernel BUG:

  # mkfs.btrfs -s 8k $dev
  # mount $dev $mnt
  # mkdir $mnt/dir
  # ln -s dir $mnt/link
  # ls $mnt/link

The call trace looks like this:

BTRFS warning (device dm-2): support for block size 8192 with page size 4096 is experimental, some features may be missing BTRFS info (device dm-2): checking UUID tree
BTRFS info (device dm-2): enabling ssd optimizations
BTRFS info (device dm-2): enabling free space tree

  ------------[ cut here ]------------
  kernel BUG at /home/adam/linux/include/linux/highmem.h:275!
  Oops: invalid opcode: 0000 [#1] SMP
  CPU: 8 UID: 0 PID: 667 Comm: ls Tainted: G           OE       6.17.0-rc4-custom+ #283 PREEMPT(full)
  Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 02/02/2022
  RIP: 0010:zero_user_segments.constprop.0+0xdc/0xe0 [btrfs]
  Call Trace:
   <TASK>
   btrfs_get_extent.cold+0x85/0x101 [btrfs 7453c70c03e631c8d8bfdd4264fa62d3e238da6f]
   btrfs_do_readpage+0x244/0x750 [btrfs 7453c70c03e631c8d8bfdd4264fa62d3e238da6f]
   btrfs_read_folio+0x9c/0x100 [btrfs 7453c70c03e631c8d8bfdd4264fa62d3e238da6f]
   filemap_read_folio+0x37/0xe0
   do_read_cache_folio+0x94/0x3e0
   __page_get_link.isra.0+0x20/0x90
   page_get_link+0x16/0x40
   step_into+0x69b/0x830
   path_lookupat+0xa7/0x170
   filename_lookup+0xf7/0x200
   ? set_ptes.isra.0+0x36/0x70
   vfs_statx+0x7a/0x160
   do_statx+0x63/0xa0
   __x64_sys_statx+0x90/0xe0
   do_syscall_64+0x82/0xae0
   entry_SYSCALL_64_after_hwframe+0x4b/0x53
   </TASK>

Please note bs > ps support is still under development and the enablement patch is not even in btrfs development branch.

[CAUSE]
Btrfs reuses its data folio read path to handle symbolic links, as the symbolic link target is stored as an inline data extent.

But for newly created inodes, btrfs only set the minimal order if the target inode is a regular file.

Thus for above newly created symbolic link, it doesn't properly respect the minimal folio order, and triggered the above crash.

[FIX]
Call btrfs_set_inode_mapping_order() unconditionally inside btrfs_create_new_inode().

For symbolic links this will fix the crash as now the folio will meet the minimal order.

For regular files this brings no change.

For directory/bdev/char and all the other types of inodes, they won't go through the data read path, thus no effect either.

Fixes cc38d178ff33 ("btrfs: enable large data folio support under CONFIG_BTRFS_EXPERIMENTAL")
---
 fs/btrfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/inode.c +1 -1
index 18db1053cdf08..cd8a09e3d1dc0 100644
@@ -6479,6 +6479,7 @@ int btrfs_create_new_inode(struct btrfs_trans_handle *trans,
 	if (!args->subvol)
 		btrfs_inherit_iflags(BTRFS_I(inode), BTRFS_I(dir));
 
+	btrfs_set_inode_mapping_order(BTRFS_I(inode));
 	if (S_ISREG(inode->i_mode)) {
 		if (btrfs_test_opt(fs_info, NODATASUM))
 			BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
@@ -6486,7 +6487,6 @@ int btrfs_create_new_inode(struct btrfs_trans_handle *trans,
 			BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW |
 				BTRFS_INODE_NODATASUM;
 		btrfs_update_inode_mapping_flags(BTRFS_I(inode));
-		btrfs_set_inode_mapping_order(BTRFS_I(inode));
 	}
 
 	ret = btrfs_insert_inode_locked(inode);
Signature · 1 line
2.51.0
author maintainer
#41 lore raw

PATCH 41/563 pinctrl: renesas: rzg2l: Fix invalid unsigned return in rzg3s_oen_read()

In reply to Greg Kroah-Hartman

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

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

From: Lad Prabhakar <[email protected]>

[ Upstream commit 8912b2862b9b74a0dc4e3ea1aacdec2f8abd7e1d ]

rzg3s_oen_read() returns a u32 value, but previously propagated a negative error code from rzg3s_pin_to_oen_bit(), resulting in an unintended large positive value due to unsigned conversion. This caused incorrect output-enable reporting for certain pins.

Without this patch, pins P1_0-P1_4 and P7_0-P7_4 are incorrectly reported as "output enabled" in the pinconf-pins debugfs file. With this fix, only P1_0-P1_1 and P7_0-P7_1 are shown as "output enabled", which matches the hardware manual.

Fix this by returning 0 when the OEN bit lookup fails, treating the pin as output-disabled by default.

Fixes a9024a323af2 ("pinctrl: renesas: rzg2l: Clean up and refactor OEN read/write functions")
---
 drivers/pinctrl/renesas/pinctrl-rzg2l.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/renesas/pinctrl-rzg2l.c +1 -1
index c52263c2a7b09..22bc5b8f65fde 100644
@@ -1124,7 +1124,7 @@ static u32 rzg3s_oen_read(struct rzg2l_pinctrl *pctrl, unsigned int _pin)
 
 	bit = rzg3s_pin_to_oen_bit(pctrl, _pin);
 	if (bit < 0)
-		return bit;
+		return 0;
 
 	return !(readb(pctrl->base + ETH_MODE) & BIT(bit));
 }
Signature · 1 line
2.51.0
author maintainer
#42 lore raw

PATCH 42/563 arm64: dts: renesas: rzg2lc-smarc: Disable CAN-FD channel0

In reply to Greg Kroah-Hartman

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

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

From: Biju Das <[email protected]>

[ Upstream commit ae014fbc99c7f986ee785233e7a5336834e39af4 ]

On RZ/G2LC SMARC EVK, CAN-FD channel0 is not populated, and currently we are deleting a wrong and nonexistent node. Fixing the wrong node would invoke a dtb warning message, as channel0 is a required property. Disable CAN-FD channel0 instead of deleting the node.

Fixes 46da632734a5 ("arm64: dts: renesas: rzg2lc-smarc: Enable CANFD channel 1")
---
 arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi +4 -1
index 345b779e4f601..f3d7eff0d2f2a 100644
@@ -48,7 +48,10 @@ sound_card {
 #if (SW_SCIF_CAN || SW_RSPI_CAN)
 &canfd {
 	pinctrl-0 = <&can1_pins>;
-	/delete-node/ channel@0;
+
+	channel0 {
+		status = "disabled";
+	};
 };
 #else
 &canfd {
Signature · 1 line
2.51.0
author maintainer
#43 lore raw

PATCH 43/563 bpf: Tidy verifier bug message

In reply to Greg Kroah-Hartman

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

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

From: Paul Chaignon <[email protected]>

[ Upstream commit c93c59baa5ab57e94b874000cec56e26611b7a23 ]

Yonghong noticed that error messages for potential verifier bugs often have a '(1)' at the end. This is happening because verifier_bug_if(cond, env, fmt, args...) prints "(" #cond ")\n" as part of the message and verifier_bug() is defined as:

  #define verifier_bug(env, fmt, args...) verifier_bug_if(1, env, fmt, ##args)

Hence, verifier_bug() always ends up displaying '(1)'. This small patch fixes it by having verifier_bug_if conditionally call verifier_bug instead of the other way around.

---
 include/linux/bpf_verifier.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
include/linux/bpf_verifier.h +7 -5
index 94defa405c85e..fe9a841fdf0cf 100644
@@ -875,13 +875,15 @@ __printf(3, 4) void verbose_linfo(struct bpf_verifier_env *env,
 #define verifier_bug_if(cond, env, fmt, args...)						\
 	({											\
 		bool __cond = (cond);								\
-		if (unlikely(__cond)) {								\
-			BPF_WARN_ONCE(1, "verifier bug: " fmt "(" #cond ")\n", ##args);		\
-			bpf_log(&env->log, "verifier bug: " fmt "(" #cond ")\n", ##args);	\
-		}										\
+		if (unlikely(__cond))								\
+			verifier_bug(env, fmt " (" #cond ")", ##args);				\
 		(__cond);									\
 	})
-#define verifier_bug(env, fmt, args...) verifier_bug_if(1, env, fmt, ##args)
+#define verifier_bug(env, fmt, args...)								\
+	({											\
+		BPF_WARN_ONCE(1, "verifier bug: " fmt "\n", ##args);				\
+		bpf_log(&env->log, "verifier bug: " fmt "\n", ##args);				\
+	})
 
 static inline struct bpf_func_state *cur_func(struct bpf_verifier_env *env)
 {
Signature · 1 line
2.51.0
author maintainer
#44 lore raw

PATCH 44/563 regmap: Remove superfluous check for !config in __regmap_init()

In reply to Greg Kroah-Hartman

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

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

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 5c36b86d2bf68fbcad16169983ef7ee8c537db59 ]

The first thing __regmap_init() do is check if config is non-NULL, so there is no need to check for this again later.

---
 drivers/base/regmap/regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +1 -1
index 1f3f782a04ba2..6883e1a43fe5d 100644
@@ -827,7 +827,7 @@ struct regmap *__regmap_init(struct device *dev,
 		map->read_flag_mask = bus->read_flag_mask;
 	}
 
-	if (config && config->read && config->write) {
+	if (config->read && config->write) {
 		map->reg_read  = _regmap_bus_read;
 		if (config->reg_update_bits)
 			map->reg_update_bits = config->reg_update_bits;
Signature · 1 line
2.51.0
author maintainer
#45 lore raw

PATCH 45/563 selftests/bpf: Copy test_kmods when installing selftest

In reply to Greg Kroah-Hartman

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

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

From: Amery Hung <[email protected]>

[ Upstream commit 07866544e410e4c895a729971e4164861b41fad5 ]

Commit d6212d82bf26 ("selftests/bpf: Consolidate kernel modules into common directory") consolidated the Makefile of test_kmods. However, since it removed test_kmods from TEST_GEN_PROGS_EXTENDED, the kernel modules required by bpf selftests are now missing from kselftest_install when "make install". Fix it by adding test_kmod to TEST_GEN_FILES.

Fixes d6212d82bf26 ("selftests/bpf: Consolidate kernel modules into common directory")
---
 tools/testing/selftests/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/Makefile +1 -1
index 4863106034dfb..77794efc020ea 100644
@@ -137,7 +137,7 @@ TEST_GEN_PROGS_EXTENDED = \
 	xdping \
 	xskxceiver
 
-TEST_GEN_FILES += liburandom_read.so urandom_read sign-file uprobe_multi
+TEST_GEN_FILES += $(TEST_KMODS) liburandom_read.so urandom_read sign-file uprobe_multi
 
 ifneq ($(V),1)
 submake_extras := feature_display=0
Signature · 1 line
2.51.0
author maintainer
#46 lore raw

PATCH 46/563 rust: cpumask: Mark CpumaskVar as transparent

In reply to Greg Kroah-Hartman

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

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

From: Baptiste Lepers <[email protected]>

[ Upstream commit 23fca458f6ab18927e50c2134fb7b60297f18b4e ]

Unsafe code in CpumaskVar's methods assumes that the type has the same layout as bindings::cpumask_var_t. This is not guaranteed by the default struct representation in Rust, but requires specifying the transparent representation.

Fixes 8961b8cb3099a ("rust: cpumask: Add initial abstractions")
---
 rust/kernel/cpumask.rs | 1 +
 1 file changed, 1 insertion(+)
rust/kernel/cpumask.rs +1 -0
index 3fcbff4386705..05e1c882404e4 100644
@@ -212,6 +212,7 @@ impl Cpumask {
 /// }
 /// assert_eq!(mask2.weight(), count);
 /// ```
+#[repr(transparent)]
 pub struct CpumaskVar {
     #[cfg(CONFIG_CPUMASK_OFFSTACK)]
     ptr: NonNull<Cpumask>,
Signature · 1 line
2.51.0
author maintainer
#47 lore raw

PATCH 47/563 bpf/selftests: Fix test_tcpnotify_user

In reply to Greg Kroah-Hartman

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

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

From: Matt Bobrowski <[email protected]>

[ Upstream commit c80d79720647ed77ebc0198abd5a0807efdaff0b ]

Based on a bisect, it appears that commit 7ee988770326 ("timers:
Implement the hierarchical pull model") has somehow inadvertently broken BPF selftest test_tcpnotify_user. The error that is being generated by this test is as follows:

FAILED: Wrong stats Expected 10 calls, got 8

It looks like the change allows timer functions to be run on CPUs different from the one they are armed on. The test had pinned itself to CPU 0, and in the past the retransmit attempts also occurred on CPU
0. The test had set the max_entries attribute for BPF_MAP_TYPE_PERF_EVENT_ARRAY to 2 and was calling bpf_perf_event_output() with BPF_F_CURRENT_CPU, so the entry was likely to be in range. With the change to allow timers to run on other CPUs, the current CPU tasked with performing the retransmit might be bumped and in turn fall out of range, as the event will be filtered out via __bpf_perf_event_output() using:

    if (unlikely(index >= array->map.max_entries))
            return -E2BIG;

A possible change would be to explicitly set the max_entries attribute for perf_event_map in test_tcpnotify_kern.c to a value that's at least as large as the number of CPUs. As it turns out however, if the field is left unset, then the libbpf will determine the number of CPUs available on the underlying system and update the max_entries attribute accordingly in map_set_def_max_entries().

A further problem with the test is that it has a thread that continues running up until the program exits. The main thread cleans up some LIBBPF data structures, while the other thread continues to use them, which inevitably will trigger a SIGSEGV. This can be dealt with by telling the thread to run for as long as necessary and doing a pthread_join on it before exiting the program.

Finally, I don't think binding the process to CPU 0 is meaningful for this test any more, so get rid of that.

Fixes 435f90a338ae ("selftests/bpf: add a test case for sock_ops perf-event notification")
---
 .../selftests/bpf/progs/test_tcpnotify_kern.c |  1 -
 .../selftests/bpf/test_tcpnotify_user.c       | 20 +++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)
tools/testing/selftests/bpf/progs/test_tcpnotify_kern.c +0 -1
index 540181c115a85..ef00d38b0a8d2 100644
@@ -23,7 +23,6 @@ struct {
 
 struct {
 	__uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
-	__uint(max_entries, 2);
 	__type(key, int);
 	__type(value, __u32);
 } perf_event_map SEC(".maps");
tools/testing/selftests/bpf/test_tcpnotify_user.c +10 -10
index 595194453ff8f..35b4893ccdf8a 100644
@@ -15,20 +15,18 @@
 #include <bpf/libbpf.h>
 #include <sys/ioctl.h>
 #include <linux/rtnetlink.h>
-#include <signal.h>
 #include <linux/perf_event.h>
-#include <linux/err.h>
 
-#include "bpf_util.h"
 #include "cgroup_helpers.h"
 
 #include "test_tcpnotify.h"
-#include "trace_helpers.h"
 #include "testing_helpers.h"
 
 #define SOCKET_BUFFER_SIZE (getpagesize() < 8192L ? getpagesize() : 8192L)
 
 pthread_t tid;
+static bool exit_thread;
+
 int rx_callbacks;
 
 static void dummyfn(void *ctx, int cpu, void *data, __u32 size)
@@ -45,7 +43,7 @@ void tcp_notifier_poller(struct perf_buffer *pb)
 {
 	int err;
 
-	while (1) {
+	while (!exit_thread) {
 		err = perf_buffer__poll(pb, 100);
 		if (err < 0 && err != -EINTR) {
 			printf("failed perf_buffer__poll: %d\n", err);
@@ -78,15 +76,10 @@ int main(int argc, char **argv)
 	int error = EXIT_FAILURE;
 	struct bpf_object *obj;
 	char test_script[80];
-	cpu_set_t cpuset;
 	__u32 key = 0;
 
 	libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
 
-	CPU_ZERO(&cpuset);
-	CPU_SET(0, &cpuset);
-	pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
-
 	cg_fd = cgroup_setup_and_join(cg_path);
 	if (cg_fd < 0)
 		goto err;
@@ -151,6 +144,13 @@ int main(int argc, char **argv)
 
 	sleep(10);
 
+	exit_thread = true;
+	int ret = pthread_join(tid, NULL);
+	if (ret) {
+		printf("FAILED: pthread_join\n");
+		goto err;
+	}
+
 	if (verify_result(&g)) {
 		printf("FAILED: Wrong stats Expected %d calls, got %d\n",
 			g.ncalls, rx_callbacks);
Signature · 1 line
2.51.0
author maintainer
#48 lore raw

PATCH 48/563 bpf: Remove migrate_disable in kprobe_multi_link_prog_run

In reply to Greg Kroah-Hartman

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

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

From: Tao Chen <[email protected]>

[ Upstream commit abdaf49be5424db74e19d167c10d7dad79a0efc2 ]

Graph tracer framework ensures we won't migrate, kprobe_multi_link_prog_run called all the way from graph tracer, which disables preemption in function_graph_enter_regs, as Jiri and Yonghong suggested, there is no need to use migrate_disable. As a result, some overhead may will be reduced. And add cant_sleep check for __this_cpu_inc_return.

---
 kernel/trace/bpf_trace.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
kernel/trace/bpf_trace.c +7 -2
index 3ae52978cae61..606007c387c52 100644
@@ -2728,20 +2728,25 @@ kprobe_multi_link_prog_run(struct bpf_kprobe_multi_link *link,
 	struct pt_regs *regs;
 	int err;
 
+	/*
+	 * graph tracer framework ensures we won't migrate, so there is no need
+	 * to use migrate_disable for bpf_prog_run again. The check here just for
+	 * __this_cpu_inc_return.
+	 */
+	cant_sleep();
+
 	if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1)) {
 		bpf_prog_inc_misses_counter(link->link.prog);
 		err = 1;
 		goto out;
 	}
 
-	migrate_disable();
 	rcu_read_lock();
 	regs = ftrace_partial_regs(fregs, bpf_kprobe_multi_pt_regs_ptr());
 	old_run_ctx = bpf_set_run_ctx(&run_ctx.session_ctx.run_ctx);
 	err = bpf_prog_run(link->link.prog, regs);
 	bpf_reset_run_ctx(old_run_ctx);
 	rcu_read_unlock();
-	migrate_enable();
 
  out:
 	__this_cpu_dec(bpf_prog_active);
Signature · 1 line
2.51.0
author maintainer
#49 lore raw

PATCH 49/563 libbpf: Fix reuse of DEVMAP

In reply to Greg Kroah-Hartman

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

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

From: Yureka Lilian <[email protected]>

[ Upstream commit 6c6b4146deb12d20f42490d5013f2043df942161 ]

Previously, re-using pinned DEVMAP maps would always fail, because get_map_info on a DEVMAP always returns flags with BPF_F_RDONLY_PROG set, but BPF_F_RDONLY_PROG being set on a map during creation is invalid.

Thus, ignore the BPF_F_RDONLY_PROG flag in the flags returned from get_map_info when checking for compatibility with an existing DEVMAP.

The same problem is handled in a third-party ebpf library:
- https://github.com/cilium/ebpf/issues/925
- https://github.com/cilium/ebpf/pull/930

Fixes 0cdbb4b09a06 ("devmap: Allow map lookups from eBPF")
---
 tools/lib/bpf/libbpf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
tools/lib/bpf/libbpf.c +10 -0
index 8f5a81b672e1b..fe4fc5438678c 100644
@@ -5093,6 +5093,16 @@ static bool map_is_reuse_compat(const struct bpf_map *map, int map_fd)
 		return false;
 	}
 
+	/*
+	 * bpf_get_map_info_by_fd() for DEVMAP will always return flags with
+	 * BPF_F_RDONLY_PROG set, but it generally is not set at map creation time.
+	 * Thus, ignore the BPF_F_RDONLY_PROG flag in the flags returned from
+	 * bpf_get_map_info_by_fd() when checking for compatibility with an
+	 * existing DEVMAP.
+	 */
+	if (map->def.type == BPF_MAP_TYPE_DEVMAP || map->def.type == BPF_MAP_TYPE_DEVMAP_HASH)
+		map_info.map_flags &= ~BPF_F_RDONLY_PROG;
+
 	return (map_info.type == map->def.type &&
 		map_info.key_size == map->def.key_size &&
 		map_info.value_size == map->def.value_size &&
Signature · 1 line
2.51.0
author maintainer
#50 lore raw

PATCH 50/563 tools/nolibc: fix error return value of clock_nanosleep()

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 1201f6fb5bfdbd10985ac3c8f49ef8f4f88b5c94 ]

clock_nanosleep() returns a positive error value. Unlike other libc functions it *does not* return -1 nor set errno.

Fix the return value and also adapt nanosleep().

---
 tools/include/nolibc/time.h                  | 5 +++--
 tools/testing/selftests/nolibc/nolibc-test.c | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
tools/include/nolibc/time.h +3 -2
index d02bc44d2643a..e9c1b976791a6 100644
@@ -133,7 +133,8 @@ static __attribute__((unused))
 int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *rqtp,
 		    struct timespec *rmtp)
 {
-	return __sysret(sys_clock_nanosleep(clockid, flags, rqtp, rmtp));
+	/* Directly return a positive error number */
+	return -sys_clock_nanosleep(clockid, flags, rqtp, rmtp);
 }
 
 static __inline__
@@ -145,7 +146,7 @@ double difftime(time_t time1, time_t time2)
 static __inline__
 int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
 {
-	return clock_nanosleep(CLOCK_REALTIME, 0, rqtp, rmtp);
+	return __sysret(sys_clock_nanosleep(CLOCK_REALTIME, 0, rqtp, rmtp));
 }
 
 
tools/testing/selftests/nolibc/nolibc-test.c +1 -0
index a297ee0d6d075..cc4d730ac4656 100644
@@ -1334,6 +1334,7 @@ int run_syscall(int min, int max)
 		CASE_TEST(chroot_root);       EXPECT_SYSZR(euid0, chroot("/")); break;
 		CASE_TEST(chroot_blah);       EXPECT_SYSER(1, chroot("/proc/self/blah"), -1, ENOENT); break;
 		CASE_TEST(chroot_exe);        EXPECT_SYSER(1, chroot(argv0), -1, ENOTDIR); break;
+		CASE_TEST(clock_nanosleep);   ts.tv_nsec = -1; EXPECT_EQ(1, EINVAL, clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)); break;
 		CASE_TEST(close_m1);          EXPECT_SYSER(1, close(-1), -1, EBADF); break;
 		CASE_TEST(close_dup);         EXPECT_SYSZR(1, close(dup(0))); break;
 		CASE_TEST(dup_0);             tmp = dup(0);  EXPECT_SYSNE(1, tmp, -1); close(tmp); break;
Signature · 1 line
2.51.0
author maintainer
#51 lore raw

PATCH 51/563 ARM: dts: renesas: porter: Fix CAN pin group

In reply to Greg Kroah-Hartman

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

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

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 287066b295051729fb08c3cff12ae17c6fe66133 ]

According to the schematics, the CAN transceiver is connected to pins GP7_3 and GP7_4, which correspond to CAN0 data group B.

---
 arch/arm/boot/dts/renesas/r8a7791-porter.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/renesas/r8a7791-porter.dts +1 -1
index f518eadd8b9cd..81b3c5d74e9b3 100644
@@ -289,7 +289,7 @@ vin0_pins: vin0 {
 	};
 
 	can0_pins: can0 {
-		groups = "can0_data";
+		groups = "can0_data_b";
 		function = "can0";
 	};
 
Signature · 1 line
2.51.0
author maintainer
#52 lore raw

PATCH 52/563 leds: max77705: Function return instead of variable assignment

In reply to Greg Kroah-Hartman

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

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

From: Len Bao <[email protected]>

[ Upstream commit 6e3779e3c6f9dcc9267bf98bef70773a0b13dcbb ]

Coverity noticed that assigning value -EINVAL to 'ret' in the if statement is useless because 'ret' is overwritten a few lines later. However, after inspect the code, this warning reveals that we need to return -EINVAL instead of the variable assignment. So, fix it.

Coverity-id: 1646104

Fixes aebb5fc9a0d8 ("leds: max77705: Add LEDs support")
---
 drivers/leds/leds-max77705.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-max77705.c +1 -1
index 933cb4f19be9b..b7403b3fcf5e7 100644
@@ -180,7 +180,7 @@ static int max77705_add_led(struct device *dev, struct regmap *regmap, struct fw
 
 		ret = fwnode_property_read_u32(np, "reg", &reg);
 		if (ret || reg >= MAX77705_LED_NUM_LEDS)
-			ret = -EINVAL;
+			return -EINVAL;
 
 		info = devm_kcalloc(dev, num_channels, sizeof(*info), GFP_KERNEL);
 		if (!info)
Signature · 1 line
2.51.0
author maintainer
#53 lore raw

PATCH 53/563 leds: flash: leds-qcom-flash: Update torch current clamp setting

In reply to Greg Kroah-Hartman

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

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

From: Fenglin Wu <[email protected]>

[ Upstream commit 5974e8f6c3e47ab097c3dd8ece7324d1f88fe739 ]

There is a register to clamp the flash current per LED channel when safety timer is disabled. It needs to be updated according to the maximum torch LED current setting to ensure the torch current won't be clamped unexpectedly.

---
 drivers/leds/flash/leds-qcom-flash.c | 62 ++++++++++++++++------------
 1 file changed, 36 insertions(+), 26 deletions(-)
drivers/leds/flash/leds-qcom-flash.c +36 -26
index 89cf5120f5d55..db7c2c743adc7 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022, 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/bitfield.h>
@@ -114,36 +114,39 @@ enum {
 	REG_THERM_THRSH1,
 	REG_THERM_THRSH2,
 	REG_THERM_THRSH3,
+	REG_TORCH_CLAMP,
 	REG_MAX_COUNT,
 };
 
 static const struct reg_field mvflash_3ch_regs[REG_MAX_COUNT] = {
-	REG_FIELD(0x08, 0, 7),			/* status1	*/
-	REG_FIELD(0x09, 0, 7),                  /* status2	*/
-	REG_FIELD(0x0a, 0, 7),                  /* status3	*/
-	REG_FIELD_ID(0x40, 0, 7, 3, 1),         /* chan_timer	*/
-	REG_FIELD_ID(0x43, 0, 6, 3, 1),         /* itarget	*/
-	REG_FIELD(0x46, 7, 7),                  /* module_en	*/
-	REG_FIELD(0x47, 0, 5),                  /* iresolution	*/
-	REG_FIELD_ID(0x49, 0, 2, 3, 1),         /* chan_strobe	*/
-	REG_FIELD(0x4c, 0, 2),                  /* chan_en	*/
-	REG_FIELD(0x56, 0, 2),			/* therm_thrsh1 */
-	REG_FIELD(0x57, 0, 2),			/* therm_thrsh2 */
-	REG_FIELD(0x58, 0, 2),			/* therm_thrsh3 */
+	[REG_STATUS1]		= REG_FIELD(0x08, 0, 7),
+	[REG_STATUS2]		= REG_FIELD(0x09, 0, 7),
+	[REG_STATUS3]		= REG_FIELD(0x0a, 0, 7),
+	[REG_CHAN_TIMER]	= REG_FIELD_ID(0x40, 0, 7, 3, 1),
+	[REG_ITARGET]		= REG_FIELD_ID(0x43, 0, 6, 3, 1),
+	[REG_MODULE_EN]		= REG_FIELD(0x46, 7, 7),
+	[REG_IRESOLUTION]	= REG_FIELD(0x47, 0, 5),
+	[REG_CHAN_STROBE]	= REG_FIELD_ID(0x49, 0, 2, 3, 1),
+	[REG_CHAN_EN]		= REG_FIELD(0x4c, 0, 2),
+	[REG_THERM_THRSH1]	= REG_FIELD(0x56, 0, 2),
+	[REG_THERM_THRSH2]	= REG_FIELD(0x57, 0, 2),
+	[REG_THERM_THRSH3]	= REG_FIELD(0x58, 0, 2),
+	[REG_TORCH_CLAMP]	= REG_FIELD(0xec, 0, 6),
 };
 
 static const struct reg_field mvflash_4ch_regs[REG_MAX_COUNT] = {
-	REG_FIELD(0x06, 0, 7),			/* status1	*/
-	REG_FIELD(0x07, 0, 6),			/* status2	*/
-	REG_FIELD(0x09, 0, 7),			/* status3	*/
-	REG_FIELD_ID(0x3e, 0, 7, 4, 1),		/* chan_timer	*/
-	REG_FIELD_ID(0x42, 0, 6, 4, 1),		/* itarget	*/
-	REG_FIELD(0x46, 7, 7),			/* module_en	*/
-	REG_FIELD(0x49, 0, 3),			/* iresolution	*/
-	REG_FIELD_ID(0x4a, 0, 6, 4, 1),		/* chan_strobe	*/
-	REG_FIELD(0x4e, 0, 3),			/* chan_en	*/
-	REG_FIELD(0x7a, 0, 2),			/* therm_thrsh1 */
-	REG_FIELD(0x78, 0, 2),			/* therm_thrsh2 */
+	[REG_STATUS1]		= REG_FIELD(0x06, 0, 7),
+	[REG_STATUS2]		= REG_FIELD(0x07, 0, 6),
+	[REG_STATUS3]		= REG_FIELD(0x09, 0, 7),
+	[REG_CHAN_TIMER]	= REG_FIELD_ID(0x3e, 0, 7, 4, 1),
+	[REG_ITARGET]		= REG_FIELD_ID(0x42, 0, 6, 4, 1),
+	[REG_MODULE_EN]		= REG_FIELD(0x46, 7, 7),
+	[REG_IRESOLUTION]	= REG_FIELD(0x49, 0, 3),
+	[REG_CHAN_STROBE]	= REG_FIELD_ID(0x4a, 0, 6, 4, 1),
+	[REG_CHAN_EN]		= REG_FIELD(0x4e, 0, 3),
+	[REG_THERM_THRSH1]	= REG_FIELD(0x7a, 0, 2),
+	[REG_THERM_THRSH2]	= REG_FIELD(0x78, 0, 2),
+	[REG_TORCH_CLAMP]	= REG_FIELD(0xed, 0, 6),
 };
 
 struct qcom_flash_data {
@@ -156,6 +159,7 @@ struct qcom_flash_data {
 	u8			max_channels;
 	u8			chan_en_bits;
 	u8			revision;
+	u8			torch_clamp;
 };
 
 struct qcom_flash_led {
@@ -702,6 +706,7 @@ static int qcom_flash_register_led_device(struct device *dev,
 	u32 current_ua, timeout_us;
 	u32 channels[4];
 	int i, rc, count;
+	u8 torch_clamp;
 
 	count = fwnode_property_count_u32(node, "led-sources");
 	if (count <= 0) {
@@ -751,6 +756,12 @@ static int qcom_flash_register_led_device(struct device *dev,
 	current_ua = min_t(u32, current_ua, TORCH_CURRENT_MAX_UA * led->chan_count);
 	led->max_torch_current_ma = current_ua / UA_PER_MA;
 
+	torch_clamp = (current_ua / led->chan_count) / TORCH_IRES_UA;
+	if (torch_clamp != 0)
+		torch_clamp--;
+
+	flash_data->torch_clamp = max_t(u8, flash_data->torch_clamp, torch_clamp);
+
 	if (fwnode_property_present(node, "flash-max-microamp")) {
 		flash->led_cdev.flags |= LED_DEV_CAP_FLASH;
 
@@ -917,8 +928,7 @@ static int qcom_flash_led_probe(struct platform_device *pdev)
 		flash_data->leds_count++;
 	}
 
-	return 0;
-
+	return regmap_field_write(flash_data->r_fields[REG_TORCH_CLAMP], flash_data->torch_clamp);
 release:
 	while (flash_data->v4l2_flash[flash_data->leds_count] && flash_data->leds_count)
 		v4l2_flash_release(flash_data->v4l2_flash[flash_data->leds_count--]);
Signature · 1 line
2.51.0
author maintainer
#54 lore raw

PATCH 54/563 s390/bpf: Do not write tail call counter into helper and kfunc frames

In reply to Greg Kroah-Hartman

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

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

From: Ilya Leoshkevich <[email protected]>

[ Upstream commit eada40e057fc1842358d9daca3abe5cacb21e8a1 ]

Only BPF functions make use of the tail call counter; helpers and kfuncs ignore and most likely also clobber it. Writing it into these functions' frames is pointless and misleading, so do not do it.

Fixes dd691e847d28 ("s390/bpf: Implement bpf_jit_supports_subprog_tailcalls()")
---
 arch/s390/net/bpf_jit_comp.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
arch/s390/net/bpf_jit_comp.c +12 -4
index bb17efe29d657..bfac1ddf3447b 100644
@@ -1790,6 +1790,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
 
 		REG_SET_SEEN(BPF_REG_5);
 		jit->seen |= SEEN_FUNC;
+
 		/*
 		 * Copy the tail call counter to where the callee expects it.
 		 *
@@ -1800,10 +1801,17 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
 		 * Note 2: We assume that the verifier does not let us call the
 		 * main program, which clears the tail call counter on entry.
 		 */
-		/* mvc tail_call_cnt(4,%r15),frame_off+tail_call_cnt(%r15) */
-		_EMIT6(0xd203f000 | offsetof(struct prog_frame, tail_call_cnt),
-		       0xf000 | (jit->frame_off +
-				 offsetof(struct prog_frame, tail_call_cnt)));
+
+		if (insn->src_reg == BPF_PSEUDO_CALL)
+			/*
+			 * mvc tail_call_cnt(4,%r15),
+			 *     frame_off+tail_call_cnt(%r15)
+			 */
+			_EMIT6(0xd203f000 | offsetof(struct prog_frame,
+						     tail_call_cnt),
+			       0xf000 | (jit->frame_off +
+					 offsetof(struct prog_frame,
+						  tail_call_cnt)));
 
 		/* Sign-extend the kfunc arguments. */
 		if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) {
Signature · 1 line
2.51.0
author maintainer
#55 lore raw

PATCH 55/563 s390/bpf: Write back tail call counter for BPF_PSEUDO_CALL

In reply to Greg Kroah-Hartman

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

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

From: Ilya Leoshkevich <[email protected]>

[ Upstream commit c861a6b147137d10b5ff88a2c492ba376cd1b8b0 ]

The tailcall_bpf2bpf_hierarchy_1 test hangs on s390. Its call graph is as follows:

entry()

    subprog_tail()
      bpf_tail_call_static(0) -> entry + tail_call_start
    subprog_tail()
      bpf_tail_call_static(0) -> entry + tail_call_start

entry() copies its tail call counter to the subprog_tail()'s frame, which then increments it. However, the incremented result is discarded, leading to an astronomically large number of tail calls.

Fix by writing the incremented counter back to the entry()'s frame.

Fixes dd691e847d28 ("s390/bpf: Implement bpf_jit_supports_subprog_tailcalls()")
---
 arch/s390/net/bpf_jit_comp.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
arch/s390/net/bpf_jit_comp.c +16 -7
index bfac1ddf3447b..ccb83ac3e6f32 100644
@@ -1793,13 +1793,6 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
 
 		/*
 		 * Copy the tail call counter to where the callee expects it.
-		 *
-		 * Note 1: The callee can increment the tail call counter, but
-		 * we do not load it back, since the x86 JIT does not do this
-		 * either.
-		 *
-		 * Note 2: We assume that the verifier does not let us call the
-		 * main program, which clears the tail call counter on entry.
 		 */
 
 		if (insn->src_reg == BPF_PSEUDO_CALL)
@@ -1833,6 +1826,22 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
 		call_r1(jit);
 		/* lgr %b0,%r2: load return value into %b0 */
 		EMIT4(0xb9040000, BPF_REG_0, REG_2);
+
+		/*
+		 * Copy the potentially updated tail call counter back.
+		 */
+
+		if (insn->src_reg == BPF_PSEUDO_CALL)
+			/*
+			 * mvc frame_off+tail_call_cnt(%r15),
+			 *     tail_call_cnt(4,%r15)
+			 */
+			_EMIT6(0xd203f000 | (jit->frame_off +
+					     offsetof(struct prog_frame,
+						      tail_call_cnt)),
+			       0xf000 | offsetof(struct prog_frame,
+						 tail_call_cnt));
+
 		break;
 	}
 	case BPF_JMP | BPF_TAIL_CALL: {
Signature · 1 line
2.51.0
author maintainer
#56 lore raw

PATCH 56/563 s390/bpf: Write back tail call counter for BPF_TRAMP_F_CALL_ORIG

In reply to Greg Kroah-Hartman

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

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

From: Ilya Leoshkevich <[email protected]>

[ Upstream commit bc3905a71f02511607d3ccf732360580209cac4c ]

The tailcall_bpf2bpf_hierarchy_fentry test hangs on s390. Its call graph is as follows:

entry()
subprog_tail()
trampoline()
fentry()
the rest of subprog_tail() # via BPF_TRAMP_F_CALL_ORIG return to entry()

The problem is that the rest of subprog_tail() increments the tail call counter, but the trampoline discards the incremented value. This results in an astronomically large number of tail calls.

Fix by making the trampoline write the incremented tail call counter back.

Fixes 528eb2cb87bc ("s390/bpf: Implement arch_prepare_bpf_trampoline()")
---
 arch/s390/net/bpf_jit_comp.c | 3 +++
 1 file changed, 3 insertions(+)
arch/s390/net/bpf_jit_comp.c +3 -0
index ccb83ac3e6f32..b2b8eb62b82e0 100644
@@ -2839,6 +2839,9 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
 		/* stg %r2,retval_off(%r15) */
 		EMIT6_DISP_LH(0xe3000000, 0x0024, REG_2, REG_0, REG_15,
 			      tjit->retval_off);
+		/* mvc tccnt_off(%r15),tail_call_cnt(4,%r15) */
+		_EMIT6(0xd203f000 | tjit->tccnt_off,
+		       0xf000 | offsetof(struct prog_frame, tail_call_cnt));
 
 		im->ip_after_call = jit->prg_buf + jit->prg;
 
Signature · 1 line
2.51.0
author maintainer
#57 lore raw

PATCH 57/563 cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus()

In reply to Greg Kroah-Hartman

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

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

From: Florian Fainelli <[email protected]>

[ Upstream commit cd5d4621ba846dad9b2e6b0c2d1518d083fcfa13 ]

Broadcom STB platforms were early adopters (2017) of the SCMI framework and as a result, not all deployed systems have a Device Tree entry where SCMI protocol 0x13 (PERFORMANCE) is declared as a clock provider, nor are the CPU Device Tree node(s) referencing protocol 0x13 as their clock provider. This was clarified in commit e11c480b6df1 ("dt-bindings:
firmware: arm,scmi: Extend bindings for protocol@13") in 2023.

For those platforms, we allow the checks done by scmi_dev_used_by_cpus() to continue, and in the event of not having done an early return, we key off the documented compatible string and give them a pass to continue to use scmi-cpufreq.

Fixes 6c9bb8692272 ("cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs")
---
 drivers/cpufreq/scmi-cpufreq.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/cpufreq/scmi-cpufreq.c +10 -0
index ef078426bfd51..38c165d526d14 100644
@@ -15,6 +15,7 @@
 #include <linux/energy_model.h>
 #include <linux/export.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/pm_opp.h>
 #include <linux/pm_qos.h>
 #include <linux/slab.h>
@@ -424,6 +425,15 @@ static bool scmi_dev_used_by_cpus(struct device *scmi_dev)
 			return true;
 	}
 
+	/*
+	 * Older Broadcom STB chips had a "clocks" property for CPU node(s)
+	 * that did not match the SCMI performance protocol node, if we got
+	 * there, it means we had such an older Device Tree, therefore return
+	 * true to preserve backwards compatibility.
+	 */
+	if (of_machine_is_compatible("brcm,brcmstb"))
+		return true;
+
 	return false;
 }
 
Signature · 1 line
2.51.0
author maintainer
#58 lore raw

PATCH 58/563 arm64: dts: renesas: sparrow-hawk: Invert microSD voltage selector on EVTB1

In reply to Greg Kroah-Hartman

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

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

From: Marek Vasut <[email protected]>

[ Upstream commit ae95807b00e1639b3f6ab94eb2cd887266e4f766 ]

Invert the polarity of microSD voltage selector on Retronix R-Car V4H Sparrow Hawk board. The voltage selector was not populated on prototype EVTA1 boards, and is implemented slightly different on EVTB1 boards. As the EVTA1 boards are from a limited run and generally not available, update the DT to make it compatible with EVTB1 microSD voltage selector.

Fixes a719915e76f2 ("arm64: dts: renesas: r8a779g3: Add Retronix R-Car V4H Sparrow Hawk board support")
---
 arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts +1 -1
index 9ba23129e65ec..18411dfb524fd 100644
@@ -185,7 +185,7 @@ vcc_sdhi: regulator-vcc-sdhi {
 		regulator-max-microvolt = <3300000>;
 		gpios = <&gpio8 13 GPIO_ACTIVE_HIGH>;
 		gpios-states = <1>;
-		states = <3300000 0>, <1800000 1>;
+		states = <1800000 0>, <3300000 1>;
 	};
 };
 
Signature · 1 line
2.51.0
author maintainer
#59 lore raw

PATCH 59/563 arm64: dts: renesas: sparrow-hawk: Set VDDQ18_25_AVB voltage on EVTB1

In reply to Greg Kroah-Hartman

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

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

From: Marek Vasut <[email protected]>

[ Upstream commit 7d1e3aa2826a22f68f1850c31ac96348272fa356 ]

The Retronix R-Car V4H Sparrow Hawk EVTB1 uses 1V8 IO voltage supply for VDDQ18_25_AVB power rail. Update the AVB0 pinmux to reflect the change in IO voltage. Since the VDDQ18_25_AVB power rail is shared, all four AVB0, AVB1, AVB2, TSN0 PFC/GPIO POC[7..4] registers have to be configured the same way. As the EVTA1 boards are from a limited run and generally not available, update the DT to make it compatible with EVTB1 IO voltage settings.

Fixes a719915e76f2 ("arm64: dts: renesas: r8a779g3: Add Retronix R-Car V4H Sparrow Hawk board support")
---
 arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts +4 -0
index 18411dfb524fd..2c1ab75e4d910 100644
@@ -556,6 +556,10 @@ pins-mii {
 			drive-strength = <21>;
 		};
 
+		pins-vddq18-25-avb {
+			pins = "PIN_VDDQ_AVB0", "PIN_VDDQ_AVB1", "PIN_VDDQ_AVB2", "PIN_VDDQ_TSN0";
+			power-source = <1800>;
+		};
 	};
 
 	/* Page 28 / CANFD_IF */
Signature · 1 line
2.51.0
author maintainer
#60 lore raw

PATCH 60/563 libbpf: Export bpf_object__prepare symbol

In reply to Greg Kroah-Hartman

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

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

From: Mykyta Yatsenko <[email protected]>

[ Upstream commit 2693227c1150d58bf82ef45a394a554373be5286 ]

Add missing LIBBPF_API macro for bpf_object__prepare function to enable its export. libbpf.map had bpf_object__prepare already listed.

---
 tools/lib/bpf/libbpf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.h +1 -1
index 455a957cb702c..2b86e21190d37 100644
@@ -252,7 +252,7 @@ bpf_object__open_mem(const void *obj_buf, size_t obj_buf_sz,
  * @return 0, on success; negative error code, otherwise, error code is
  * stored in errno
  */
-int bpf_object__prepare(struct bpf_object *obj);
+LIBBPF_API int bpf_object__prepare(struct bpf_object *obj);
 
 /**
  * @brief **bpf_object__load()** loads BPF object into kernel.
Signature · 1 line
2.51.0
author maintainer
#61 lore raw

PATCH 61/563 firmware: arm_scmi: Mark VirtIO ready before registering scmi_virtio_driver

In reply to Greg Kroah-Hartman

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

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

From: Junnan Wu <[email protected]>

[ Upstream commit e8faa8a466f61f4ae07069ed6b0872f602f1cba9 ]

After commit 20bda12a0ea0 (“firmware: arm_scmi: Make VirtIO transport a standalone driver”), the VirtIO transport probes independently. During scmi_virtio_probe, scmi_probe() is called, which intune invokes scmi_protocol_acquire() that sends a message over the virtqueue and waits for a reply.

Previously, DRIVER_OK was only set after scmi_vio_probe, in the core virtio via virtio_dev_probe(). According to the Virtio spec (3.1 Device Initialization):

  |  The driver MUST NOT send any buffer available notifications to the
  |  device before setting DRIVER_OK.

Some type-1 hypervisors block available-buffer notifications until the driver is marked OK. In such cases, scmi_vio_probe stalls in scmi_wait_for_reply(), and the probe never completes.

Resolve this by setting DRIVER_OK immediately after the device-specific setup, so scmi_probe() can safely send notifications.

Note after splitting the transports into modules, the probe sequence changed a bit. We can no longer rely on virtio_device_ready() being called by the core in virtio_dev_probe(), because scmi_vio_probe() doesn’t complete until the core SCMI stack runs scmi_probe(), which immediately issues the initial BASE protocol exchanges.

Fixes 20bda12a0ea0 ("firmware: arm_scmi: Make VirtIO transport a standalone driver")

Message-Id: <[email protected]>

---
 drivers/firmware/arm_scmi/transports/virtio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/firmware/arm_scmi/transports/virtio.c +3 -0
index cb934db9b2b4a..326c4a93e44b9 100644
@@ -871,6 +871,9 @@ static int scmi_vio_probe(struct virtio_device *vdev)
 	/* Ensure initialized scmi_vdev is visible */
 	smp_store_mb(scmi_vdev, vdev);
 
+	/* Set device ready */
+	virtio_device_ready(vdev);
+
 	ret = platform_driver_register(&scmi_virtio_driver);
 	if (ret) {
 		vdev->priv = NULL;
Signature · 1 line
2.51.0
author maintainer
#62 lore raw

PATCH 62/563 arm64: dts: imx93-kontron: Fix GPIO for panel regulator

In reply to Greg Kroah-Hartman

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

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

From: Annette Kobou <[email protected]>

[ Upstream commit f3e011388dd08d15e0414e3b6b974f946305e7af ]

The regulator uses the wrong GPIO. Fix this.

Fixes 2b52fd6035b7 ("arm64: dts: Add support for Kontron i.MX93 OSM-S SoM and BL carrier board")
---
 .../boot/dts/freescale/imx93-kontron-bl-osm-s.dts    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx93-kontron-bl-osm-s.dts +11 -1
index 89e97c604bd3e..9a9e5d0daf3ba 100644
@@ -33,7 +33,9 @@ pwm-beeper {
 
 	reg_vcc_panel: regulator-vcc-panel {
 		compatible = "regulator-fixed";
-		gpio = <&gpio4 3 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_reg_vcc_panel>;
+		gpio = <&gpio2 21 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 		regulator-max-microvolt = <3300000>;
 		regulator-min-microvolt = <3300000>;
@@ -161,3 +163,11 @@ &usdhc2 {
 	vmmc-supply = <&reg_vdd_3v3>;
 	status = "okay";
 };
+
+&iomuxc {
+	pinctrl_reg_vcc_panel: regvccpanelgrp {
+		fsl,pins = <
+			MX93_PAD_GPIO_IO21__GPIO2_IO21		0x31e /* PWM_2 */
+		>;
+	};
+};
Signature · 1 line
2.51.0
author maintainer
#63 lore raw

PATCH 63/563 arm64: dts: imx93-kontron: Fix USB port assignment

In reply to Greg Kroah-Hartman

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

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

From: Frieder Schrempf <[email protected]>

[ Upstream commit c94737568b290e0547bff344046f02df49ed6373 ]

The assignment of the USB ports is wrong and needs to be swapped. The OTG (USB-C) port is on the first port and the host port with the onboard hub is on the second port.

Fixes 2b52fd6035b7 ("arm64: dts: Add support for Kontron i.MX93 OSM-S SoM and BL carrier board")
---
 .../dts/freescale/imx93-kontron-bl-osm-s.dts  | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
arch/arm64/boot/dts/freescale/imx93-kontron-bl-osm-s.dts +10 -10
index 9a9e5d0daf3ba..c3d2ddd887fdf 100644
@@ -137,6 +137,16 @@ &tpm6 {
 };
 
 &usbotg1 {
+	adp-disable;
+	hnp-disable;
+	srp-disable;
+	disable-over-current;
+	dr_mode = "otg";
+	usb-role-switch;
+	status = "okay";
+};
+
+&usbotg2 {
 	#address-cells = <1>;
 	#size-cells = <0>;
 	disable-over-current;
@@ -149,16 +159,6 @@ usb1@1 {
 	};
 };
 
-&usbotg2 {
-	adp-disable;
-	hnp-disable;
-	srp-disable;
-	disable-over-current;
-	dr_mode = "otg";
-	usb-role-switch;
-	status = "okay";
-};
-
 &usdhc2 {
 	vmmc-supply = <&reg_vdd_3v3>;
 	status = "okay";
Signature · 1 line
2.51.0
author maintainer
#64 lore raw

PATCH 64/563 arm64: dts: imx95: Correct the lpuart7 and lpuart8 srcid

In reply to Greg Kroah-Hartman

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

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

From: Joy Zou <[email protected]>

[ Upstream commit 6fdaf3b1839c861931db0dd11747c056a76b68f9 ]

According to the imx95 RM, the lpuart7 rx and tx DMA's srcid are 88 and 87, and the lpuart8 rx and tx DMA's srcid are 90 and 89. So correct them.

Fixes 915fd2e127e8 ("arm64: dts: imx95: add edma[1..3] nodes")
---
 arch/arm64/boot/dts/freescale/imx95.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/freescale/imx95.dtsi +2 -2
index 8296888bce594..4521da02d1695 100644
@@ -913,7 +913,7 @@ lpuart7: serial@42690000 {
 				interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&scmi_clk IMX95_CLK_LPUART7>;
 				clock-names = "ipg";
-				dmas = <&edma2 26 0 FSL_EDMA_RX>, <&edma2 25 0 0>;
+				dmas = <&edma2 88 0 FSL_EDMA_RX>, <&edma2 87 0 0>;
 				dma-names = "rx", "tx";
 				status = "disabled";
 			};
@@ -925,7 +925,7 @@ lpuart8: serial@426a0000 {
 				interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
 				clocks = <&scmi_clk IMX95_CLK_LPUART8>;
 				clock-names = "ipg";
-				dmas = <&edma2 28 0 FSL_EDMA_RX>, <&edma2 27 0 0>;
+				dmas = <&edma2 90 0 FSL_EDMA_RX>, <&edma2 89 0 0>;
 				dma-names = "rx", "tx";
 				status = "disabled";
 			};
Signature · 1 line
2.51.0
author maintainer
#65 lore raw

PATCH 65/563 bpf: Remove preempt_disable in bpf_try_get_buffers

In reply to Greg Kroah-Hartman

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

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

From: Tao Chen <[email protected]>

[ Upstream commit 4223bf833c8495e40ae2886acbc0ecbe88fa6306 ]

Now BPF program will run with migration disabled, so it is safe to access this_cpu_inc_return(bpf_bprintf_nest_level).

Fixes d9c9e4db186a ("bpf: Factorize bpf_trace_printk and bpf_seq_printf")
---
 kernel/bpf/helpers.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/bpf/helpers.c +0 -3
index 8af62cb243d9e..9c750a6a895bf 100644
@@ -774,11 +774,9 @@ int bpf_try_get_buffers(struct bpf_bprintf_buffers **bufs)
 {
 	int nest_level;
 
-	preempt_disable();
 	nest_level = this_cpu_inc_return(bpf_bprintf_nest_level);
 	if (WARN_ON_ONCE(nest_level > MAX_BPRINTF_NEST_LEVEL)) {
 		this_cpu_dec(bpf_bprintf_nest_level);
-		preempt_enable();
 		return -EBUSY;
 	}
 	*bufs = this_cpu_ptr(&bpf_bprintf_bufs[nest_level - 1]);
@@ -791,7 +789,6 @@ void bpf_put_buffers(void)
 	if (WARN_ON_ONCE(this_cpu_read(bpf_bprintf_nest_level) == 0))
 		return;
 	this_cpu_dec(bpf_bprintf_nest_level);
-	preempt_enable();
 }
 
 void bpf_bprintf_cleanup(struct bpf_bprintf_data *data)
Signature · 1 line
2.51.0
author maintainer
#66 lore raw

PATCH 66/563 ACPI: processor: idle: Fix memory leak when register cpuidle device failed

In reply to Greg Kroah-Hartman

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

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

From: Huisong Li <[email protected]>

[ Upstream commit 11b3de1c03fa9f3b5d17e6d48050bc98b3704420 ]

The cpuidle device's memory is leaked when cpuidle device registration fails in acpi_processor_power_init(). Free it as appropriate.

Fixes 3d339dcbb56d ("cpuidle / ACPI : move cpuidle_device field out of the acpi_processor_power structure")
[ rjw: Changed the order of the new statements, added empty line after if () ]
[ rjw: Changelog edits ]
---
 drivers/acpi/processor_idle.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/acpi/processor_idle.c +3 -0
index 2c2dc559e0f8d..d0fc045a8d310 100644
@@ -1405,6 +1405,9 @@ int acpi_processor_power_init(struct acpi_processor *pr)
 		if (retval) {
 			if (acpi_processor_registered == 0)
 				cpuidle_unregister_driver(&acpi_idle_driver);
+
+			per_cpu(acpi_cpuidle_device, pr->id) = NULL;
+			kfree(dev);
 			return retval;
 		}
 		acpi_processor_registered++;
Signature · 1 line
2.51.0
author maintainer
#67 lore raw

PATCH 67/563 genirq: Add irq_chip_(startup/shutdown)_parent()

In reply to Greg Kroah-Hartman

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

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

From: Inochi Amaoto <[email protected]>

[ Upstream commit 7a721a2fee2bce01af26699a87739db8ca8ea3c8 ]

As the MSI controller on SG2044 uses PLIC as the underlying interrupt controller, it needs to call irq_enable() and irq_disable() to startup/shutdown interrupts. Otherwise, the MSI interrupt can not be startup correctly and will not respond any incoming interrupt.

Introduce irq_chip_startup_parent() and irq_chip_shutdown_parent() to allow the interrupt controller to call the irq_startup()/irq_shutdown() callbacks of the parent interrupt chip.

In case the irq_startup()/irq_shutdown() callbacks are not implemented for the parent interrupt chip, this will fallback to irq_chip_enable_parent() or irq_chip_disable_parent().

Stable-dep-of: 9d8c41816bac ("irqchip/sg2042-msi: Fix broken affinity setting")

---
 include/linux/irq.h |  2 ++
 kernel/irq/chip.c   | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)
include/linux/irq.h +2 -0
index 1d6b606a81efe..890e1371f5d4c 100644
@@ -669,6 +669,8 @@ extern int irq_chip_set_parent_state(struct irq_data *data,
 extern int irq_chip_get_parent_state(struct irq_data *data,
 				     enum irqchip_irq_state which,
 				     bool *state);
+extern void irq_chip_shutdown_parent(struct irq_data *data);
+extern unsigned int irq_chip_startup_parent(struct irq_data *data);
 extern void irq_chip_enable_parent(struct irq_data *data);
 extern void irq_chip_disable_parent(struct irq_data *data);
 extern void irq_chip_ack_parent(struct irq_data *data);
kernel/irq/chip.c +37 -0
index 0d0276378c707..3ffa0d80ddd19 100644
@@ -1259,6 +1259,43 @@ int irq_chip_get_parent_state(struct irq_data *data,
 }
 EXPORT_SYMBOL_GPL(irq_chip_get_parent_state);
 
+/**
+ * irq_chip_shutdown_parent - Shutdown the parent interrupt
+ * @data:	Pointer to interrupt specific data
+ *
+ * Invokes the irq_shutdown() callback of the parent if available or falls
+ * back to irq_chip_disable_parent().
+ */
+void irq_chip_shutdown_parent(struct irq_data *data)
+{
+	struct irq_data *parent = data->parent_data;
+
+	if (parent->chip->irq_shutdown)
+		parent->chip->irq_shutdown(parent);
+	else
+		irq_chip_disable_parent(data);
+}
+EXPORT_SYMBOL_GPL(irq_chip_shutdown_parent);
+
+/**
+ * irq_chip_startup_parent - Startup the parent interrupt
+ * @data:	Pointer to interrupt specific data
+ *
+ * Invokes the irq_startup() callback of the parent if available or falls
+ * back to irq_chip_enable_parent().
+ */
+unsigned int irq_chip_startup_parent(struct irq_data *data)
+{
+	struct irq_data *parent = data->parent_data;
+
+	if (parent->chip->irq_startup)
+		return parent->chip->irq_startup(parent);
+
+	irq_chip_enable_parent(data);
+	return 0;
+}
+EXPORT_SYMBOL_GPL(irq_chip_startup_parent);
+
 /**
  * irq_chip_enable_parent - Enable the parent interrupt (defaults to unmask if
  * NULL)
Signature · 1 line
2.51.0
author maintainer
#68 lore raw

PATCH 68/563 PCI/MSI: Add startup/shutdown for per device domains

In reply to Greg Kroah-Hartman

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

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

From: Inochi Amaoto <[email protected]>

[ Upstream commit 54f45a30c0d0153d2be091ba2d683ab6db6d1d5b ]

As the RISC-V PLIC cannot apply affinity settings without invoking irq_enable(), it will make the interrupt unavailble when used as an underlying interrupt chip for the MSI controller.

Implement the irq_startup() and irq_shutdown() callbacks for the PCI MSI and MSI-X templates.

For chips that specify MSI_FLAG_PCI_MSI_STARTUP_PARENT, the parent startup and shutdown functions are invoked. That allows the interrupt on the parent chip to be enabled if the interrupt has not been enabled during allocation. This is necessary for MSI controllers which use PLIC as underlying parent interrupt chip.

Stable-dep-of: 9d8c41816bac ("irqchip/sg2042-msi: Fix broken affinity setting")

---
 drivers/pci/msi/irqdomain.c | 52 +++++++++++++++++++++++++++++++++++++
 include/linux/msi.h         |  2 ++
 2 files changed, 54 insertions(+)
drivers/pci/msi/irqdomain.c +52 -0
index 0938ef7ebabf2..e0a800f918e81 100644
@@ -148,6 +148,23 @@ static void pci_device_domain_set_desc(msi_alloc_info_t *arg, struct msi_desc *d
 	arg->hwirq = desc->msi_index;
 }
 
+static void cond_shutdown_parent(struct irq_data *data)
+{
+	struct msi_domain_info *info = data->domain->host_data;
+
+	if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
+		irq_chip_shutdown_parent(data);
+}
+
+static unsigned int cond_startup_parent(struct irq_data *data)
+{
+	struct msi_domain_info *info = data->domain->host_data;
+
+	if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
+		return irq_chip_startup_parent(data);
+	return 0;
+}
+
 static __always_inline void cond_mask_parent(struct irq_data *data)
 {
 	struct msi_domain_info *info = data->domain->host_data;
@@ -164,6 +181,23 @@ static __always_inline void cond_unmask_parent(struct irq_data *data)
 		irq_chip_unmask_parent(data);
 }
 
+static void pci_irq_shutdown_msi(struct irq_data *data)
+{
+	struct msi_desc *desc = irq_data_get_msi_desc(data);
+
+	pci_msi_mask(desc, BIT(data->irq - desc->irq));
+	cond_shutdown_parent(data);
+}
+
+static unsigned int pci_irq_startup_msi(struct irq_data *data)
+{
+	struct msi_desc *desc = irq_data_get_msi_desc(data);
+	unsigned int ret = cond_startup_parent(data);
+
+	pci_msi_unmask(desc, BIT(data->irq - desc->irq));
+	return ret;
+}
+
 static void pci_irq_mask_msi(struct irq_data *data)
 {
 	struct msi_desc *desc = irq_data_get_msi_desc(data);
@@ -194,6 +228,8 @@ static void pci_irq_unmask_msi(struct irq_data *data)
 static const struct msi_domain_template pci_msi_template = {
 	.chip = {
 		.name			= "PCI-MSI",
+		.irq_startup		= pci_irq_startup_msi,
+		.irq_shutdown		= pci_irq_shutdown_msi,
 		.irq_mask		= pci_irq_mask_msi,
 		.irq_unmask		= pci_irq_unmask_msi,
 		.irq_write_msi_msg	= pci_msi_domain_write_msg,
@@ -210,6 +246,20 @@ static const struct msi_domain_template pci_msi_template = {
 	},
 };
 
+static void pci_irq_shutdown_msix(struct irq_data *data)
+{
+	pci_msix_mask(irq_data_get_msi_desc(data));
+	cond_shutdown_parent(data);
+}
+
+static unsigned int pci_irq_startup_msix(struct irq_data *data)
+{
+	unsigned int ret = cond_startup_parent(data);
+
+	pci_msix_unmask(irq_data_get_msi_desc(data));
+	return ret;
+}
+
 static void pci_irq_mask_msix(struct irq_data *data)
 {
 	pci_msix_mask(irq_data_get_msi_desc(data));
@@ -234,6 +284,8 @@ EXPORT_SYMBOL_GPL(pci_msix_prepare_desc);
 static const struct msi_domain_template pci_msix_template = {
 	.chip = {
 		.name			= "PCI-MSIX",
+		.irq_startup		= pci_irq_startup_msix,
+		.irq_shutdown		= pci_irq_shutdown_msix,
 		.irq_mask		= pci_irq_mask_msix,
 		.irq_unmask		= pci_irq_unmask_msix,
 		.irq_write_msi_msg	= pci_msi_domain_write_msg,
include/linux/msi.h +2 -0
index e5e86a8529fb6..3111ba95fbde4 100644
@@ -568,6 +568,8 @@ enum {
 	MSI_FLAG_PARENT_PM_DEV		= (1 << 8),
 	/* Support for parent mask/unmask */
 	MSI_FLAG_PCI_MSI_MASK_PARENT	= (1 << 9),
+	/* Support for parent startup/shutdown */
+	MSI_FLAG_PCI_MSI_STARTUP_PARENT	= (1 << 10),
 
 	/* Mask for the generic functionality */
 	MSI_GENERIC_FLAGS_MASK		= GENMASK(15, 0),
Signature · 1 line
2.51.0
#69 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

[+cc Kenny, Gene, Jens, Todd]

Quoted 1 line · Greg Kroah-Hartman

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

We have open regression reports about this, so I don't think we should backport it yet:

https://lore.kernel.org/r/[email protected]

Quoted 142 lines

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

From: Inochi Amaoto <[email protected]>

[ Upstream commit 54f45a30c0d0153d2be091ba2d683ab6db6d1d5b ]

As the RISC-V PLIC cannot apply affinity settings without invoking irq_enable(), it will make the interrupt unavailble when used as an underlying interrupt chip for the MSI controller.

Implement the irq_startup() and irq_shutdown() callbacks for the PCI MSI and MSI-X templates.

For chips that specify MSI_FLAG_PCI_MSI_STARTUP_PARENT, the parent startup and shutdown functions are invoked. That allows the interrupt on the parent chip to be enabled if the interrupt has not been enabled during allocation. This is necessary for MSI controllers which use PLIC as underlying parent interrupt chip.

Stable-dep-of: 9d8c41816bac ("irqchip/sg2042-msi: Fix broken affinity setting")

---
 drivers/pci/msi/irqdomain.c | 52 +++++++++++++++++++++++++++++++++++++
 include/linux/msi.h         |  2 ++
 2 files changed, 54 insertions(+)
drivers/pci/msi/irqdomain.c +52 -0
index 0938ef7ebabf2..e0a800f918e81 100644
@@ -148,6 +148,23 @@ static void pci_device_domain_set_desc(msi_alloc_info_t *arg, struct msi_desc *d
 	arg->hwirq = desc->msi_index;
 }
 
+static void cond_shutdown_parent(struct irq_data *data)
+{
+	struct msi_domain_info *info = data->domain->host_data;
+
+	if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
+		irq_chip_shutdown_parent(data);
+}
+
+static unsigned int cond_startup_parent(struct irq_data *data)
+{
+	struct msi_domain_info *info = data->domain->host_data;
+
+	if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
+		return irq_chip_startup_parent(data);
+	return 0;
+}
+
 static __always_inline void cond_mask_parent(struct irq_data *data)
 {
 	struct msi_domain_info *info = data->domain->host_data;
@@ -164,6 +181,23 @@ static __always_inline void cond_unmask_parent(struct irq_data *data)
 		irq_chip_unmask_parent(data);
 }
 
+static void pci_irq_shutdown_msi(struct irq_data *data)
+{
+	struct msi_desc *desc = irq_data_get_msi_desc(data);
+
+	pci_msi_mask(desc, BIT(data->irq - desc->irq));
+	cond_shutdown_parent(data);
+}
+
+static unsigned int pci_irq_startup_msi(struct irq_data *data)
+{
+	struct msi_desc *desc = irq_data_get_msi_desc(data);
+	unsigned int ret = cond_startup_parent(data);
+
+	pci_msi_unmask(desc, BIT(data->irq - desc->irq));
+	return ret;
+}
+
 static void pci_irq_mask_msi(struct irq_data *data)
 {
 	struct msi_desc *desc = irq_data_get_msi_desc(data);
@@ -194,6 +228,8 @@ static void pci_irq_unmask_msi(struct irq_data *data)
 static const struct msi_domain_template pci_msi_template = {
 	.chip = {
 		.name			= "PCI-MSI",
+		.irq_startup		= pci_irq_startup_msi,
+		.irq_shutdown		= pci_irq_shutdown_msi,
 		.irq_mask		= pci_irq_mask_msi,
 		.irq_unmask		= pci_irq_unmask_msi,
 		.irq_write_msi_msg	= pci_msi_domain_write_msg,
@@ -210,6 +246,20 @@ static const struct msi_domain_template pci_msi_template = {
 	},
 };
 
+static void pci_irq_shutdown_msix(struct irq_data *data)
+{
+	pci_msix_mask(irq_data_get_msi_desc(data));
+	cond_shutdown_parent(data);
+}
+
+static unsigned int pci_irq_startup_msix(struct irq_data *data)
+{
+	unsigned int ret = cond_startup_parent(data);
+
+	pci_msix_unmask(irq_data_get_msi_desc(data));
+	return ret;
+}
+
 static void pci_irq_mask_msix(struct irq_data *data)
 {
 	pci_msix_mask(irq_data_get_msi_desc(data));
@@ -234,6 +284,8 @@ EXPORT_SYMBOL_GPL(pci_msix_prepare_desc);
 static const struct msi_domain_template pci_msix_template = {
 	.chip = {
 		.name			= "PCI-MSIX",
+		.irq_startup		= pci_irq_startup_msix,
+		.irq_shutdown		= pci_irq_shutdown_msix,
 		.irq_mask		= pci_irq_mask_msix,
 		.irq_unmask		= pci_irq_unmask_msix,
 		.irq_write_msi_msg	= pci_msi_domain_write_msg,
include/linux/msi.h +2 -0
index e5e86a8529fb6..3111ba95fbde4 100644
@@ -568,6 +568,8 @@ enum {
 	MSI_FLAG_PARENT_PM_DEV		= (1 << 8),
 	/* Support for parent mask/unmask */
 	MSI_FLAG_PCI_MSI_MASK_PARENT	= (1 << 9),
+	/* Support for parent startup/shutdown */
+	MSI_FLAG_PCI_MSI_STARTUP_PARENT	= (1 << 10),
 
 	/* Mask for the generic functionality */
 	MSI_GENERIC_FLAGS_MASK		= GENMASK(15, 0),
Signature · 1 line
2.51.0
#70 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

Hi

Quoted 9 lines · Bjorn Helgaas

[+cc Kenny, Gene, Jens, Todd]

Quoted 1 line · Greg Kroah-Hartman

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

We have open regression reports about this, so I don't think we should backport it yet:

https://lore.kernel.org/r/[email protected]

I've received a similar report for v6.17.3-rc1/ v6.17.3 (v6.17.2 was fine) on a Lenovo 82FG/ Ideapad 5-15ITL05 (i5-1135G7 and Xe graphics), failing to (UEFI-) boot already within the initramfs (Debian/ unstable, initramfs-tools).

Backing out (only) the changes to drivers/pci/msi/irqdomain.c and include/linux/msi.h from patch-6.17.3 fixes the regression again.

Regards
Stefan Lippers-Hollmann

#71 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

Quoted 18 lines · Stefan Lippers-Hollmann

Hi

Quoted 9 lines · Bjorn Helgaas

[+cc Kenny, Gene, Jens, Todd]

Quoted 1 line · Greg Kroah-Hartman

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

We have open regression reports about this, so I don't think we should backport it yet:

https://lore.kernel.org/r/[email protected]

I've received a similar report for v6.17.3-rc1/ v6.17.3 (v6.17.2 was fine) on a Lenovo 82FG/ Ideapad 5-15ITL05 (i5-1135G7 and Xe graphics), failing to (UEFI-) boot already within the initramfs (Debian/ unstable, initramfs-tools).

Quoted 5 lines

Backing out (only) the changes to drivers/pci/msi/irqdomain.c and include/linux/msi.h from patch-6.17.3 fixes the regression again.

Regards
Stefan Lippers-Hollmann

This is caused by the vmd driver, as vmd driver rely on the assumption that pci domain template does not set irq_startup()/irq_shutdown.

I think this may needs the following patch:
https://lore.kernel.org/all/[email protected]

#72 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

Hi

Quoted 1 line · Inochi Amaoto

On Thu, Oct 16, 2025 at 03:07:11AM +0200, Stefan Lippers-Hollmann wrote:

[...]

Quoted 12 lines
Quoted 12 lines
Quoted 4 lines

We have open regression reports about this, so I don't think we should backport it yet:

https://lore.kernel.org/r/[email protected]

I've received a similar report for v6.17.3-rc1/ v6.17.3 (v6.17.2 was fine) on a Lenovo 82FG/ Ideapad 5-15ITL05 (i5-1135G7 and Xe graphics), failing to (UEFI-) boot already within the initramfs (Debian/ unstable, initramfs-tools).

Backing out (only) the changes to drivers/pci/msi/irqdomain.c and include/linux/msi.h from patch-6.17.3 fixes the regression again.

[...]

Quoted 5 lines

This is caused by the vmd driver, as vmd driver rely on the assumption that pci domain template does not set irq_startup()/irq_shutdown.

I think this may needs the following patch:
https://lore.kernel.org/all/[email protected]

I got confirmation that this patch indeed fixes the problem, thanks a lot!

Regards
Stefan Lippers-Hollmann

author maintainer
#73 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

In reply to Bjorn Helgaas
Quoted 9 lines · Bjorn Helgaas

[+cc Kenny, Gene, Jens, Todd]

Quoted 1 line · Greg Kroah-Hartman

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

We have open regression reports about this, so I don't think we should backport it yet:

https://lore.kernel.org/r/[email protected]

It's already in a release :(

If someone will be so kind as to forward me the git id of the fix when it lands in Linus's tree, I will be glad to queue that up.

thanks,

greg k-h

#74 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

Quoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Bjorn Helgaas

[+cc Kenny, Gene, Jens, Todd]

Quoted 1 line · Greg Kroah-Hartman

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

We have open regression reports about this, so I don't think we should backport it yet:

Quoted 9 lines
Quoted 1 line

https://lore.kernel.org/r/[email protected]

It's already in a release :(

If someone will be so kind as to forward me the git id of the fix when it lands in Linus's tree, I will be glad to queue that up.

thanks,

Hi Greg, the fix has made it into Linus's tree. The git hash is e433110eb5bf067f74d3d15c5fb252206c66ae0b

Signature · 2 lines
Regards,
  Eric
Quoted 2 lines

greg k-h

author maintainer
#75 lore raw

Re: [PATCH 6.17 068/563] PCI/MSI: Add startup/shutdown for per device domains

Quoted 14 lines · Eric Naim
Quoted 13 lines · Greg Kroah-Hartman
Quoted 9 lines · Bjorn Helgaas

[+cc Kenny, Gene, Jens, Todd]

Quoted 1 line · Greg Kroah-Hartman

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

We have open regression reports about this, so I don't think we should backport it yet:

https://lore.kernel.org/r/[email protected]

It's already in a release :(

Quoted 7 lines
Quoted 5 lines

If someone will be so kind as to forward me the git id of the fix when it lands in Linus's tree, I will be glad to queue that up.

thanks,

Hi Greg, the fix has made it into Linus's tree. The git hash is e433110eb5bf067f74d3d15c5fb252206c66ae0b

Thanks, now queued up.

author maintainer
#76 lore raw

PATCH 69/563 irqchip/sg2042-msi: Fix broken affinity setting

In reply to Greg Kroah-Hartman

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

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

From: Inochi Amaoto <[email protected]>

[ Upstream commit 9d8c41816bac518b4824f83b346ae30a1be83f68 ]

When using NVME on SG2044, the NVME drvier always complains about "I/O tag XXX (XXX) QID XX timeout, completion polled", which is caused by the broken affinity setting mechanism of the sg2042-msi driver.

The PLIC driver can only the set the affinity when enabled, but the sg2042-msi driver invokes the affinity setter in disabled state, which causes the change to be lost.

Cure this by implementing the irq_startup()/shutdown() callbacks, which allow to startup (enabled) the underlying PLIC first.

---
 drivers/irqchip/irq-sg2042-msi.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/irqchip/irq-sg2042-msi.c +13 -5
index bcfddc51bc6a1..2fd4d94f9bd76 100644
@@ -85,6 +85,8 @@ static void sg2042_msi_irq_compose_msi_msg(struct irq_data *d, struct msi_msg *m
 
 static const struct irq_chip sg2042_msi_middle_irq_chip = {
 	.name			= "SG2042 MSI",
+	.irq_startup		= irq_chip_startup_parent,
+	.irq_shutdown		= irq_chip_shutdown_parent,
 	.irq_ack		= sg2042_msi_irq_ack,
 	.irq_mask		= irq_chip_mask_parent,
 	.irq_unmask		= irq_chip_unmask_parent,
@@ -114,6 +116,8 @@ static void sg2044_msi_irq_compose_msi_msg(struct irq_data *d, struct msi_msg *m
 
 static struct irq_chip sg2044_msi_middle_irq_chip = {
 	.name			= "SG2044 MSI",
+	.irq_startup		= irq_chip_startup_parent,
+	.irq_shutdown		= irq_chip_shutdown_parent,
 	.irq_ack		= sg2044_msi_irq_ack,
 	.irq_mask		= irq_chip_mask_parent,
 	.irq_unmask		= irq_chip_unmask_parent,
@@ -185,8 +189,10 @@ static const struct irq_domain_ops sg204x_msi_middle_domain_ops = {
 	.select	= msi_lib_irq_domain_select,
 };
 
-#define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS |	\
-				   MSI_FLAG_USE_DEF_CHIP_OPS)
+#define SG2042_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS |		\
+				   MSI_FLAG_USE_DEF_CHIP_OPS |		\
+				   MSI_FLAG_PCI_MSI_MASK_PARENT |	\
+				   MSI_FLAG_PCI_MSI_STARTUP_PARENT)
 
 #define SG2042_MSI_FLAGS_SUPPORTED MSI_GENERIC_FLAGS_MASK
 
@@ -200,10 +206,12 @@ static const struct msi_parent_ops sg2042_msi_parent_ops = {
 	.init_dev_msi_info	= msi_lib_init_dev_msi_info,
 };
 
-#define SG2044_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS |	\
-				   MSI_FLAG_USE_DEF_CHIP_OPS)
+#define SG2044_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS |		\
+				   MSI_FLAG_USE_DEF_CHIP_OPS |		\
+				   MSI_FLAG_PCI_MSI_MASK_PARENT |	\
+				   MSI_FLAG_PCI_MSI_STARTUP_PARENT)
 
-#define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK |	\
+#define SG2044_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK |		\
 				    MSI_FLAG_PCI_MSIX)
 
 static const struct msi_parent_ops sg2044_msi_parent_ops = {
Signature · 1 line
2.51.0
author maintainer
#77 lore raw

PATCH 70/563 scripts/misc-check: update export checks for EXPORT_SYMBOL_FOR_MODULES()

In reply to Greg Kroah-Hartman

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

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

From: Vlastimil Babka <[email protected]>

[ Upstream commit 0354e81b7bd629f9c3379c9524e988ebc504fa25 ]

The module export checks are looking for EXPORT_SYMBOL_GPL_FOR_MODULES() which was renamed to EXPORT_SYMBOL_FOR_MODULES(). Update the checks.

Fixes 6d3c3ca4c77e ("module: Rename EXPORT_SYMBOL_GPL_FOR_MODULES to EXPORT_SYMBOL_FOR_MODULES")
---
 scripts/misc-check | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/misc-check +2 -2
index 84f08da17b2c0..40e5a4b01ff47 100755
@@ -45,7 +45,7 @@ check_tracked_ignored_files () {
 # does not automatically fix it.
 check_missing_include_linux_export_h () {
 
-	git -C "${srctree:-.}" grep --files-with-matches -E 'EXPORT_SYMBOL((_NS)?(_GPL)?|_GPL_FOR_MODULES)\(.*\)' \
+	git -C "${srctree:-.}" grep --files-with-matches -E 'EXPORT_SYMBOL((_NS)?(_GPL)?|_FOR_MODULES)\(.*\)' \
 	    -- '*.[ch]' :^tools/ :^include/linux/export.h |
 	xargs -r git -C "${srctree:-.}" grep --files-without-match '#include[[:space:]]*<linux/export\.h>' |
 	xargs -r printf "%s: warning: EXPORT_SYMBOL() is used, but #include <linux/export.h> is missing\n" >&2
@@ -58,7 +58,7 @@ check_unnecessary_include_linux_export_h () {
 
 	git -C "${srctree:-.}" grep --files-with-matches '#include[[:space:]]*<linux/export\.h>' \
 	    -- '*.[c]' :^tools/ |
-	xargs -r git -C "${srctree:-.}" grep --files-without-match -E 'EXPORT_SYMBOL((_NS)?(_GPL)?|_GPL_FOR_MODULES)\(.*\)' |
+	xargs -r git -C "${srctree:-.}" grep --files-without-match -E 'EXPORT_SYMBOL((_NS)?(_GPL)?|_FOR_MODULES)\(.*\)' |
 	xargs -r printf "%s: warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present\n" >&2
 }
 
Signature · 1 line
2.51.0
author maintainer
#78 lore raw

PATCH 71/563 soc: qcom: rpmh-rsc: Unconditionally clear _TRIGGER bit for TCS

In reply to Greg Kroah-Hartman

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

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

From: Sneh Mankad <[email protected]>

[ Upstream commit f87412d18edb5b8393eb8cb1c2d4a54f90185a21 ]

Unconditionally clear the TCS_AMC_MODE_TRIGGER bit when a transaction completes. Previously this bit was only cleared when a wake TCS was borrowed as an AMC TCS but not for dedicated AMC TCS. Leaving this bit set for AMC TCS and entering deeper low power modes can generate a false completion IRQ.

Prevent this scenario by always clearing the TCS_AMC_MODE_TRIGGER bit upon receiving a completion IRQ.

Fixes 15b3bf61b8d4 ("soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS")
---
 drivers/soc/qcom/rpmh-rsc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/soc/qcom/rpmh-rsc.c +2 -5
index fdab2b1067dbb..c6f7d5c9c493d 100644
@@ -453,13 +453,10 @@ static irqreturn_t tcs_tx_done(int irq, void *p)
 
 		trace_rpmh_tx_done(drv, i, req);
 
-		/*
-		 * If wake tcs was re-purposed for sending active
-		 * votes, clear AMC trigger & enable modes and
+		/* Clear AMC trigger & enable modes and
 		 * disable interrupt for this TCS
 		 */
-		if (!drv->tcs[ACTIVE_TCS].num_tcs)
-			__tcs_set_trigger(drv, i, false);
+		__tcs_set_trigger(drv, i, false);
 skip:
 		/* Reclaim the TCS */
 		write_tcs_reg(drv, drv->regs[RSC_DRV_CMD_ENABLE], i, 0);
Signature · 1 line
2.51.0
author maintainer
#79 lore raw

PATCH 72/563 pinctrl: meson-gxl: add missing i2c_d pinmux

In reply to Greg Kroah-Hartman

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

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

From: Da Xue <[email protected]>

[ Upstream commit d8c2a9edd181f0cc4a66eec954b3d8f6a1d954a7 ]

Amlogic GXL has 4 I2C attached to gpio-periphs. I2C_D is on GPIOX_10/11.

Add the relevant func 3 pinmux per the datasheet for S805X/S905X/S905D.

Fixes 0f15f500ff2c ("pinctrl: meson: Add GXL pinctrl definitions")
---
 drivers/pinctrl/meson/pinctrl-meson-gxl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/pinctrl/meson/pinctrl-meson-gxl.c +10 -0
index 9171de657f978..a75762e4d2641 100644
@@ -187,6 +187,9 @@ static const unsigned int i2c_sda_c_pins[]	= { GPIODV_28 };
 static const unsigned int i2c_sck_c_dv19_pins[] = { GPIODV_19 };
 static const unsigned int i2c_sda_c_dv18_pins[] = { GPIODV_18 };
 
+static const unsigned int i2c_sck_d_pins[]	= { GPIOX_11 };
+static const unsigned int i2c_sda_d_pins[]	= { GPIOX_10 };
+
 static const unsigned int eth_mdio_pins[]	= { GPIOZ_0 };
 static const unsigned int eth_mdc_pins[]	= { GPIOZ_1 };
 static const unsigned int eth_clk_rx_clk_pins[] = { GPIOZ_2 };
@@ -411,6 +414,8 @@ static const struct meson_pmx_group meson_gxl_periphs_groups[] = {
 	GPIO_GROUP(GPIO_TEST_N),
 
 	/* Bank X */
+	GROUP(i2c_sda_d,	5,	5),
+	GROUP(i2c_sck_d,	5,	4),
 	GROUP(sdio_d0,		5,	31),
 	GROUP(sdio_d1,		5,	30),
 	GROUP(sdio_d2,		5,	29),
@@ -651,6 +656,10 @@ static const char * const i2c_c_groups[] = {
 	"i2c_sck_c", "i2c_sda_c", "i2c_sda_c_dv18", "i2c_sck_c_dv19",
 };
 
+static const char * const i2c_d_groups[] = {
+	"i2c_sck_d", "i2c_sda_d",
+};
+
 static const char * const eth_groups[] = {
 	"eth_mdio", "eth_mdc", "eth_clk_rx_clk", "eth_rx_dv",
 	"eth_rxd0", "eth_rxd1", "eth_rxd2", "eth_rxd3",
@@ -777,6 +786,7 @@ static const struct meson_pmx_func meson_gxl_periphs_functions[] = {
 	FUNCTION(i2c_a),
 	FUNCTION(i2c_b),
 	FUNCTION(i2c_c),
+	FUNCTION(i2c_d),
 	FUNCTION(eth),
 	FUNCTION(pwm_a),
 	FUNCTION(pwm_b),
Signature · 1 line
2.51.0
author maintainer
#80 lore raw

PATCH 73/563 blk-mq: check kobject state_in_sysfs before deleting in blk_mq_unregister_hctx

In reply to Greg Kroah-Hartman

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

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

From: Li Nan <[email protected]>

[ Upstream commit 4c7ef92f6d4d08a27d676e4c348f4e2922cab3ed ]

In __blk_mq_update_nr_hw_queues() the return value of blk_mq_sysfs_register_hctxs() is not checked. If sysfs creation for hctx fails, later changing the number of hw_queues or removing disk will trigger the following warning:

kernfs: can not remove 'nr_tags', no directory

  WARNING: CPU: 2 PID: 637 at fs/kernfs/dir.c:1707 kernfs_remove_by_name_ns+0x13f/0x160
  Call Trace:
   remove_files.isra.1+0x38/0xb0
   sysfs_remove_group+0x4d/0x100
   sysfs_remove_groups+0x31/0x60
   __kobject_del+0x23/0xf0
   kobject_del+0x17/0x40
   blk_mq_unregister_hctx+0x5d/0x80
   blk_mq_sysfs_unregister_hctxs+0x94/0xd0
   blk_mq_update_nr_hw_queues+0x124/0x760
   nullb_update_nr_hw_queues+0x71/0xf0 [null_blk]
   nullb_device_submit_queues_store+0x92/0x120 [null_blk]

kobjct_del() was called unconditionally even if sysfs creation failed. Fix it by checkig the kobject creation statusbefore deleting it.

Fixes 477e19dedc9d ("blk-mq: adjust debugfs and sysfs register when updating nr_hw_queues")
---
 block/blk-mq-sysfs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
block/blk-mq-sysfs.c +4 -2
index 24656980f4431..5c399ac562eae 100644
@@ -150,9 +150,11 @@ static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
 		return;
 
 	hctx_for_each_ctx(hctx, ctx, i)
-		kobject_del(&ctx->kobj);
+		if (ctx->kobj.state_in_sysfs)
+			kobject_del(&ctx->kobj);
 
-	kobject_del(&hctx->kobj);
+	if (hctx->kobj.state_in_sysfs)
+		kobject_del(&hctx->kobj);
 }
 
 static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
Signature · 1 line
2.51.0
author maintainer
#81 lore raw

PATCH 74/563 selftests/futex: Remove the -g parameter from futex_priv_hash

In reply to Greg Kroah-Hartman

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

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

From: Sebastian Andrzej Siewior <[email protected]>

[ Upstream commit 2e62688d583809e832433f461194334408b10817 ]

The -g parameter was meant to the test the immutable global hash instead of the private hash which has been made immutable. The global hash is tested as part at the end of the regular test. The immutable private hash been removed.

Remove last traces of the immutable private hash.

---
 tools/testing/selftests/futex/functional/futex_priv_hash.c | 1 -
 tools/testing/selftests/futex/functional/run.sh            | 1 -
 2 files changed, 2 deletions(-)
tools/testing/selftests/futex/functional/futex_priv_hash.c +0 -1
index aea001ac49460..ec032faca6a91 100644
@@ -132,7 +132,6 @@ static void usage(char *prog)
 {
 	printf("Usage: %s\n", prog);
 	printf("  -c    Use color\n");
-	printf("  -g    Test global hash instead intead local immutable \n");
 	printf("  -h    Display this help message\n");
 	printf("  -v L  Verbosity level: %d=QUIET %d=CRITICAL %d=INFO\n",
 	       VQUIET, VCRITICAL, VINFO);
tools/testing/selftests/futex/functional/run.sh +0 -1
index 81739849f2994..5470088dc4dfb 100755
@@ -85,7 +85,6 @@ echo
 
 echo
 ./futex_priv_hash $COLOR
-./futex_priv_hash -g $COLOR
 
 echo
 ./futex_numa_mpol $COLOR
Signature · 1 line
2.51.0
author maintainer
#82 lore raw

PATCH 75/563 ARM: at91: pm: fix MCKx restore routine

In reply to Greg Kroah-Hartman

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

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

From: Nicolas Ferre <[email protected]>

[ Upstream commit 296302d3d81360e09fa956e9be9edc8223b69a12 ]

The at91_mckx_ps_restore() assembly function is responsible for setting back MCKx system bus clocks after exiting low power modes.

Fix a typo and use tmp3 variable instead of tmp2 to correctly set MCKx to previously saved state.
Tmp2 was used without the needed changes in CSS and DIV. Moreover the required bit 7, telling that MCR register's content is to be changed (CMD/write), was not set.

Fix function comment to match tmp variables actually used.

Fixes 28eb1d40fe57 ("ARM: at91: pm: add support for MCK1..4 save/restore for ulp modes")
[claudiu.beznea: s/sate/state in commit description]
---
 arch/arm/mach-at91/pm_suspend.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-at91/pm_suspend.S +2 -2
index e23b868340965..7e6c94f8edeef 100644
@@ -904,7 +904,7 @@ e_done:
 /**
  * at91_mckx_ps_restore: restore MCKx settings
  *
- * Side effects: overwrites tmp1, tmp2
+ * Side effects: overwrites tmp1, tmp2 and tmp3
  */
 .macro at91_mckx_ps_restore
 #ifdef CONFIG_SOC_SAMA7
@@ -980,7 +980,7 @@ r_ps:
 	bic	tmp3, tmp3, #AT91_PMC_MCR_V2_ID_MSK
 	orr	tmp3, tmp3, tmp1
 	orr	tmp3, tmp3, #AT91_PMC_MCR_V2_CMD
-	str	tmp2, [pmc, #AT91_PMC_MCR_V2]
+	str	tmp3, [pmc, #AT91_PMC_MCR_V2]
 
 	wait_mckrdy tmp1
 
Signature · 1 line
2.51.0
author maintainer
#83 lore raw

PATCH 76/563 arm64: dts: apple: t8103-j457: Fix PCIe ethernet iommu-map

In reply to Greg Kroah-Hartman

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

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

From: Janne Grunau <[email protected]>

[ Upstream commit 6e08cdd604edcec2c277af17c7d36caf827057ff ]

PCIe port01 of t8103-j457 (iMac, M1, 2 USB-C ports, 2021) is unused and disabled. Linux' PCI subsystem assigns the ethernet nic from port02 to bus 02. This results into assigning pcie0_dart_1 from the disabled port as iommu. The pcie0_dart_1 instance is disabled and probably fused off (it is on the M2 Pro Mac mini which has a disabled PCIe port as well).
Without iommu the ethernet nic is not expected work.
Adjusts the "bus-range" and the PCIe devices "reg" property to PCI subsystem's bus number.

Fixes 7c77ab91b33d ("arm64: dts: apple: Add missing M1 (t8103) devices")
---
 arch/arm64/boot/dts/apple/t8103-j457.dts | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/apple/t8103-j457.dts +10 -2
index 152f95fd49a21..7089ccf3ce556 100644
@@ -21,6 +21,14 @@ aliases {
 	};
 };
 
+/*
+ * Adjust pcie0's iommu-map to account for the disabled port01.
+ */
+&pcie0 {
+	iommu-map = <0x100 &pcie0_dart_0 1 1>,
+			<0x200 &pcie0_dart_2 1 1>;
+};
+
 &bluetooth0 {
 	brcm,board-type = "apple,santorini";
 };
@@ -36,10 +44,10 @@ &wifi0 {
  */
 
 &port02 {
-	bus-range = <3 3>;
+	bus-range = <2 2>;
 	status = "okay";
 	ethernet0: ethernet@0,0 {
-		reg = <0x30000 0x0 0x0 0x0 0x0>;
+		reg = <0x20000 0x0 0x0 0x0 0x0>;
 		/* To be filled by the loader */
 		local-mac-address = [00 10 18 00 00 00];
 	};
Signature · 1 line
2.51.0
author maintainer
#84 lore raw

PATCH 77/563 regulator: scmi: Use int type to store negative error codes

In reply to Greg Kroah-Hartman

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

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

From: Qianfeng Rong <[email protected]>

[ Upstream commit 9d35d068fb138160709e04e3ee97fe29a6f8615b ]

Change the 'ret' variable from u32 to int to store negative error codes or zero returned by of_property_read_u32().

Storing the negative error codes in unsigned type, doesn't cause an issue at runtime but it's ugly as pants. Additionally, assigning negative error codes to unsigned type may trigger a GCC warning when the -Wsign-conversion flag is enabled.

No effect on runtime.

---
 drivers/regulator/scmi-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/scmi-regulator.c +2 -1
index 9df726f10ad12..6d609c42e4793 100644
@@ -257,7 +257,8 @@ static int process_scmi_regulator_of_node(struct scmi_device *sdev,
 					  struct device_node *np,
 					  struct scmi_regulator_info *rinfo)
 {
-	u32 dom, ret;
+	u32 dom;
+	int ret;
 
 	ret = of_property_read_u32(np, "reg", &dom);
 	if (ret)
Signature · 1 line
2.51.0
author maintainer
#85 lore raw

PATCH 78/563 selftests/futex: Fix some futex_numa_mpol subtests

In reply to Greg Kroah-Hartman

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

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

From: Waiman Long <[email protected]>

[ Upstream commit d8e2f919997b14665e4509ef9a5278f291598d6e ]

The "Memory out of range" subtest of futex_numa_mpol assumes that memory access outside of the mmap'ed area is invalid. That may not be the case depending on the actual memory layout of the test application. When that subtest was run on an x86-64 system with latest upstream kernel, the test passed as an error was returned from futex_wake(). On another PowerPC system, the same subtest failed because futex_wake() returned 0.

Bail out! futex2_wake(64, 0x86) should fail, but didn't

Looking further into the passed subtest on x86-64, it was found that an -EINVAL was returned instead of -EFAULT. The -EINVAL error was returned because the node value test with FLAGS_NUMA set failed with a node value of 0x7f7f. IOW, the futex memory was accessible and futex_wake() failed because the supposed node number wasn't valid. If that memory location happens to have a very small value (e.g. 0), the test will pass and no error will be returned.

Since this subtest is non-deterministic, drop it unless a guard page beyond the mmap region is explicitly set.

The other problematic test is the "Memory too small" test. The futex_wake() function returns the -EINVAL error code because the given futex address isn't 8-byte aligned, not because only 4 of the 8 bytes are valid and the other 4 bytes are not. So change the name of this subtest to "Mis-aligned futex" to reflect the reality.

[ bp: Massage commit message. ]

---
 tools/testing/selftests/futex/functional/futex_numa_mpol.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
tools/testing/selftests/futex/functional/futex_numa_mpol.c +2 -4
index a9ecfb2d3932a..802c15c821906 100644
@@ -182,12 +182,10 @@ int main(int argc, char *argv[])
 	if (futex_numa->numa == FUTEX_NO_NODE)
 		ksft_exit_fail_msg("NUMA node is left uninitialized\n");
 
-	ksft_print_msg("Memory too small\n");
+	/* FUTEX2_NUMA futex must be 8-byte aligned */
+	ksft_print_msg("Mis-aligned futex\n");
 	test_futex(futex_ptr + mem_size - 4, 1);
 
-	ksft_print_msg("Memory out of range\n");
-	test_futex(futex_ptr + mem_size, 1);
-
 	futex_numa->numa = FUTEX_NO_NODE;
 	mprotect(futex_ptr, mem_size, PROT_READ);
 	ksft_print_msg("Memory, RO\n");
Signature · 1 line
2.51.0
author maintainer
#86 lore raw

PATCH 79/563 tools/nolibc: avoid error in dup2() if old fd equals new fd

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit d1ff0e2d13d6ac3a15be7870e15216726b0a809a ]

dup2() allows both 'old' and 'new' to have the same value, which dup3() does not. If libc dup2() is implemented through the dup3() system call, then it would incorrectly fail in this case.

Avoid the error by handling old == new explicitly.

Fixes 30ca20517ac1 ("tools headers: Move the nolibc header from rcutorture to tools/include/nolibc/")
---
 tools/include/nolibc/sys.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
tools/include/nolibc/sys.h +13 -0
index 295e71d34abad..90aadad31f6cb 100644
@@ -238,6 +238,19 @@ static __attribute__((unused))
 int sys_dup2(int old, int new)
 {
 #if defined(__NR_dup3)
+	int ret, nr_fcntl;
+
+#ifdef __NR_fcntl64
+	nr_fcntl = __NR_fcntl64;
+#else
+	nr_fcntl = __NR_fcntl;
+#endif
+
+	if (old == new) {
+		ret = my_syscall2(nr_fcntl, old, F_GETFD);
+		return ret < 0 ? ret : old;
+	}
+
 	return my_syscall3(__NR_dup3, old, new, 0);
 #elif defined(__NR_dup2)
 	return my_syscall2(__NR_dup2, old, new);
Signature · 1 line
2.51.0
author maintainer
#87 lore raw

PATCH 80/563 selftests/nolibc: fix EXPECT_NZ macro

In reply to Greg Kroah-Hartman

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

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

From: Benjamin Berg <[email protected]>

[ Upstream commit 6d33ce3634f99e0c6c9ce9fc111261f2c411cb48 ]

The expect non-zero macro was incorrect and never used. Fix its definition.

Fixes 362aecb2d8cfa ("selftests/nolibc: add basic infrastructure to ease creation of nolibc tests")
---
 tools/testing/selftests/nolibc/nolibc-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/nolibc/nolibc-test.c +2 -2
index cc4d730ac4656..d074878eb2341 100644
@@ -196,8 +196,8 @@ int expect_zr(int expr, int llen)
 }
 
 
-#define EXPECT_NZ(cond, expr, val)			\
-	do { if (!(cond)) result(llen, SKIPPED); else ret += expect_nz(expr, llen; } while (0)
+#define EXPECT_NZ(cond, expr)				\
+	do { if (!(cond)) result(llen, SKIPPED); else ret += expect_nz(expr, llen); } while (0)
 
 static __attribute__((unused))
 int expect_nz(int expr, int llen)
Signature · 1 line
2.51.0
author maintainer
#88 lore raw

PATCH 81/563 leds: leds-lp55xx: Use correct address for memory programming

In reply to Greg Kroah-Hartman

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

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

From: Andrei Lalaev <[email protected]>

[ Upstream commit d6058316d16ee0d1861c0550051b2492efb54b79 ]

Memory programming doesn't work for devices without page support. For example, LP5562 has 3 engines but doesn't support pages, the start address is changed depending on engine number. According to datasheet [1], the PROG MEM register addresses for each engine are as follows:

Engine 1: 0x10
Engine 2: 0x30
Engine 3: 0x50

However, the current implementation incorrectly calculates the address of PROG MEM register using the engine index starting from 1:

prog_mem_base = 0x10
LP55xx_BYTES_PER_PAGE = 0x20

Engine 1: 0x10 + 0x20 * 1 = 0x30
Engine 2: 0x10 + 0x20 * 2 = 0x50
Engine 3: 0x10 + 0x20 * 3 = 0x70

This results in writing to the wrong engine memory, causing pattern programming to fail.

To correct it, the engine index should be decreased:
Engine 1: 0x10 + 0x20 * 0 = 0x10
Engine 2: 0x10 + 0x20 * 1 = 0x30
Engine 3: 0x10 + 0x20 * 2 = 0x50

1 - https://www.ti.com/lit/ds/symlink/lp5562.pdf

Fixes 31379a57cf2f ("leds: leds-lp55xx: Generalize update_program_memory function")
---
 drivers/leds/leds-lp55xx-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/leds-lp55xx-common.c +1 -1
index e71456a56ab8d..fd447eb7eb15e 100644
@@ -212,7 +212,7 @@ int lp55xx_update_program_memory(struct lp55xx_chip *chip,
 	 * For LED chip that support page, PAGE is already set in load_engine.
 	 */
 	if (!cfg->pages_per_engine)
-		start_addr += LP55xx_BYTES_PER_PAGE * idx;
+		start_addr += LP55xx_BYTES_PER_PAGE * (idx - 1);
 
 	for (page = 0; page < program_length / LP55xx_BYTES_PER_PAGE; page++) {
 		/* Write to the next page each 32 bytes (if supported) */
Signature · 1 line
2.51.0
author maintainer
#89 lore raw

PATCH 82/563 PCI/MSI: Check MSI_FLAG_PCI_MSI_MASK_PARENT in cond_[startup|shutdown]_parent()

In reply to Greg Kroah-Hartman

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

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

From: Inochi Amaoto <[email protected]>

[ Upstream commit 727e914bbfbbda9e6efa5cb1abe4e96a949d576f ]

For MSI controllers which only support MSI_FLAG_PCI_MSI_MASK_PARENT, the newly added callback irq_startup() and irq_shutdown() for pci_msi[x]_template will not unmask or mask the interrupt when startup() resp. shutdown() is invoked. This prevents the interrupt from being enabled resp. disabled.

Invoke irq_[un]mask_parent() in cond_[startup|shutdown]_parent(), when the interrupt has the MSI_FLAG_PCI_MSI_MASK_PARENT flag set.

---
 drivers/pci/msi/irqdomain.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/pci/msi/irqdomain.c +5 -0
index e0a800f918e81..b11b7f63f0d6f 100644
@@ -154,6 +154,8 @@ static void cond_shutdown_parent(struct irq_data *data)
 
 	if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
 		irq_chip_shutdown_parent(data);
+	else if (unlikely(info->flags & MSI_FLAG_PCI_MSI_MASK_PARENT))
+		irq_chip_mask_parent(data);
 }
 
 static unsigned int cond_startup_parent(struct irq_data *data)
@@ -162,6 +164,9 @@ static unsigned int cond_startup_parent(struct irq_data *data)
 
 	if (unlikely(info->flags & MSI_FLAG_PCI_MSI_STARTUP_PARENT))
 		return irq_chip_startup_parent(data);
+	else if (unlikely(info->flags & MSI_FLAG_PCI_MSI_MASK_PARENT))
+		irq_chip_unmask_parent(data);
+
 	return 0;
 }
 
Signature · 1 line
2.51.0
author maintainer
#90 lore raw

PATCH 83/563 block: use int to store blk_stack_limits() return value

In reply to Greg Kroah-Hartman

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

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

From: Qianfeng Rong <[email protected]>

[ Upstream commit b0b4518c992eb5f316c6e40ff186cbb7a5009518 ]

Change the 'ret' variable in blk_stack_limits() from unsigned int to int, as it needs to store negative value -1.

Storing the negative error codes in unsigned type, or performing equality comparisons (e.g., ret == -1), doesn't cause an issue at runtime [1] but can be confusing. Additionally, assigning negative error codes to unsigned type may trigger a GCC warning when the -Wsign-conversion flag is enabled.

No effect on runtime.

---
 block/blk-settings.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-settings.c +2 -1
index d6438e6c276dc..693bc8d20acf3 100644
@@ -763,7 +763,8 @@ static void blk_stack_atomic_writes_limits(struct queue_limits *t,
 int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
 		     sector_t start)
 {
-	unsigned int top, bottom, alignment, ret = 0;
+	unsigned int top, bottom, alignment;
+	int ret = 0;
 
 	t->features |= (b->features & BLK_FEAT_INHERIT_MASK);
 
Signature · 1 line
2.51.0
author maintainer
#91 lore raw

PATCH 84/563 ARM: dts: stm32: stm32mp151c-plyaqm: Use correct dai-format property

In reply to Greg Kroah-Hartman

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

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

From: Jihed Chaibi <[email protected]>

[ Upstream commit 0b367e60c73c05721cf2156fe8fe077320115ffd ]

The stm32-i2s binding inherits from the standard audio-graph-port schema for its 'port' subnode, audio-graph-port requires the use of the 'dai-format' property. The stm32mp151c-plyaqm dts file was using the non-standard name 'format'.

Correct the property name to 'dai-format' to fix the dtbs_check validation error.

Fixes 9365fa46be358 ("ARM: dts: stm32: Add Plymovent AQM devicetree")
---
 arch/arm/boot/dts/st/stm32mp151c-plyaqm.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/st/stm32mp151c-plyaqm.dts +1 -1
index 39a3211c61337..55fe916740d7c 100644
@@ -239,7 +239,7 @@ &i2s1 {
 
 	i2s1_port: port {
 		i2s1_endpoint: endpoint {
-			format = "i2s";
+			dai-format = "i2s";
 			mclk-fs = <256>;
 			remote-endpoint = <&codec_endpoint>;
 		};
Signature · 1 line
2.51.0
author maintainer
#92 lore raw

PATCH 85/563 dt-bindings: vendor-prefixes: Add undocumented vendor prefixes

In reply to Greg Kroah-Hartman

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

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

From: Rob Herring (Arm) <[email protected]>

[ Upstream commit 4ed46073274a5b23baf0b992c459762e28faf549 ]

Add various vendor prefixes which are in use in compatible strings already. These were found by modifying vendor-prefixes.yaml into a schema to check compatible strings.

The added prefixes doesn't include various duplicate prefixes in use such as "lge".

---
 .../devicetree/bindings/vendor-prefixes.yaml  | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +50 -0
index 9ec8947dfcad2..ed7fec614473d 100644
@@ -86,6 +86,8 @@ patternProperties:
     description: Allegro DVT
   "^allegromicro,.*":
     description: Allegro MicroSystems, Inc.
+  "^alliedtelesis,.*":
+    description: Allied Telesis, Inc.
   "^alliedvision,.*":
     description: Allied Vision Technologies GmbH
   "^allo,.*":
@@ -229,6 +231,8 @@ patternProperties:
     description: Bitmain Technologies
   "^blaize,.*":
     description: Blaize, Inc.
+  "^bluegiga,.*":
+    description: Bluegiga Technologies Ltd.
   "^blutek,.*":
     description: BluTek Power
   "^boe,.*":
@@ -247,6 +251,8 @@ patternProperties:
     description: Bticino International
   "^buffalo,.*":
     description: Buffalo, Inc.
+  "^buglabs,.*":
+    description: Bug Labs, Inc.
   "^bur,.*":
     description: B&R Industrial Automation GmbH
   "^bytedance,.*":
@@ -325,6 +331,8 @@ patternProperties:
     description: Conexant Systems, Inc.
   "^colorfly,.*":
     description: Colorful GRP, Shenzhen Xueyushi Technology Ltd.
+  "^compal,.*":
+    description: Compal Electronics, Inc.
   "^compulab,.*":
     description: CompuLab Ltd.
   "^comvetia,.*":
@@ -353,6 +361,8 @@ patternProperties:
     description: Guangzhou China Star Optoelectronics Technology Co., Ltd
   "^csq,.*":
     description: Shenzen Chuangsiqi Technology Co.,Ltd.
+  "^csr,.*":
+    description: Cambridge Silicon Radio
   "^ctera,.*":
     description: CTERA Networks Intl.
   "^ctu,.*":
@@ -455,6 +465,8 @@ patternProperties:
     description: Emtop Embedded Solutions
   "^eeti,.*":
     description: eGalax_eMPIA Technology Inc
+  "^egnite,.*":
+    description: egnite GmbH
   "^einfochips,.*":
     description: Einfochips
   "^eink,.*":
@@ -485,8 +497,12 @@ patternProperties:
     description: Empire Electronix
   "^emtrion,.*":
     description: emtrion GmbH
+  "^enbw,.*":
+    description: Energie Baden-Württemberg AG
   "^enclustra,.*":
     description: Enclustra GmbH
+  "^endian,.*":
+    description: Endian SRL
   "^endless,.*":
     description: Endless Mobile, Inc.
   "^ene,.*":
@@ -554,6 +570,8 @@ patternProperties:
     description: FocalTech Systems Co.,Ltd
   "^forlinx,.*":
     description: Baoding Forlinx Embedded Technology Co., Ltd.
+  "^foxlink,.*":
+    description: Foxlink Group
   "^freebox,.*":
     description: Freebox SAS
   "^freecom,.*":
@@ -642,6 +660,10 @@ patternProperties:
     description: Haoyu Microelectronic Co. Ltd.
   "^hardkernel,.*":
     description: Hardkernel Co., Ltd
+  "^hce,.*":
+    description: HCE Engineering SRL
+  "^headacoustics,.*":
+    description: HEAD acoustics
   "^hechuang,.*":
     description: Shenzhen Hechuang Intelligent Co.
   "^hideep,.*":
@@ -725,6 +747,8 @@ patternProperties:
     description: Shenzhen INANBO Electronic Technology Co., Ltd.
   "^incircuit,.*":
     description: In-Circuit GmbH
+  "^incostartec,.*":
+    description: INCOstartec GmbH
   "^indiedroid,.*":
     description: Indiedroid
   "^inet-tek,.*":
@@ -933,6 +957,8 @@ patternProperties:
     description: Maxim Integrated Products
   "^maxlinear,.*":
     description: MaxLinear Inc.
+  "^maxtor,.*":
+    description: Maxtor Corporation
   "^mbvl,.*":
     description: Mobiveil Inc.
   "^mcube,.*":
@@ -1096,6 +1122,8 @@ patternProperties:
     description: Nordic Semiconductor
   "^nothing,.*":
     description: Nothing Technology Limited
+  "^novatech,.*":
+    description: NovaTech Automation
   "^novatek,.*":
     description: Novatek
   "^novtech,.*":
@@ -1191,6 +1219,8 @@ patternProperties:
     description: Pervasive Displays, Inc.
   "^phicomm,.*":
     description: PHICOMM Co., Ltd.
+  "^phontech,.*":
+    description: Phontech
   "^phytec,.*":
     description: PHYTEC Messtechnik GmbH
   "^picochip,.*":
@@ -1275,6 +1305,8 @@ patternProperties:
     description: Ramtron International
   "^raspberrypi,.*":
     description: Raspberry Pi Foundation
+  "^raumfeld,.*":
+    description: Raumfeld GmbH
   "^raydium,.*":
     description: Raydium Semiconductor Corp.
   "^rda,.*":
@@ -1313,6 +1345,8 @@ patternProperties:
     description: ROHM Semiconductor Co., Ltd
   "^ronbo,.*":
     description: Ronbo Electronics
+  "^ronetix,.*":
+    description: Ronetix GmbH
   "^roofull,.*":
     description: Shenzhen Roofull Technology Co, Ltd
   "^roseapplepi,.*":
@@ -1339,8 +1373,12 @@ patternProperties:
     description: Schindler
   "^schneider,.*":
     description: Schneider Electric
+  "^schulercontrol,.*":
+    description: Schuler Group
   "^sciosense,.*":
     description: ScioSense B.V.
+  "^sdmc,.*":
+    description: SDMC Technology Co., Ltd
   "^seagate,.*":
     description: Seagate Technology PLC
   "^seeed,.*":
@@ -1379,6 +1417,8 @@ patternProperties:
     description: Si-En Technology Ltd.
   "^si-linux,.*":
     description: Silicon Linux Corporation
+  "^sielaff,.*":
+    description: Sielaff GmbH & Co.
   "^siemens,.*":
     description: Siemens AG
   "^sifive,.*":
@@ -1447,6 +1487,8 @@ patternProperties:
     description: SolidRun
   "^solomon,.*":
     description: Solomon Systech Limited
+  "^somfy,.*":
+    description: Somfy Systems Inc.
   "^sony,.*":
     description: Sony Corporation
   "^sophgo,.*":
@@ -1517,6 +1559,8 @@ patternProperties:
   "^synopsys,.*":
     description: Synopsys, Inc. (deprecated, use snps)
     deprecated: true
+  "^taos,.*":
+    description: Texas Advanced Optoelectronic Solutions Inc.
   "^tbs,.*":
     description: TBS Technologies
   "^tbs-biometrics,.*":
@@ -1547,6 +1591,8 @@ patternProperties:
     description: Teltonika Networks
   "^tempo,.*":
     description: Tempo Semiconductor
+  "^tenda,.*":
+    description: Shenzhen Tenda Technology Co., Ltd.
   "^terasic,.*":
     description: Terasic Inc.
   "^tesla,.*":
@@ -1650,6 +1696,8 @@ patternProperties:
     description: V3 Semiconductor
   "^vaisala,.*":
     description: Vaisala
+  "^valve,.*":
+    description: Valve Corporation
   "^vamrs,.*":
     description: Vamrs Ltd.
   "^variscite,.*":
@@ -1750,6 +1798,8 @@ patternProperties:
     description: Extreme Engineering Solutions (X-ES)
   "^xiaomi,.*":
     description: Xiaomi Technology Co., Ltd.
+  "^xicor,.*":
+    description: Xicor Inc.
   "^xillybus,.*":
     description: Xillybus Ltd.
   "^xingbangda,.*":
Signature · 1 line
2.51.0
author maintainer
#93 lore raw

PATCH 86/563 genirq/test: Fix depth tests on architectures with NOREQUEST by default.

In reply to Greg Kroah-Hartman

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

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

From: David Gow <[email protected]>

[ Upstream commit c9163915a93d40e32c4e4aeb942c0adcb190d72e ]

The new irq KUnit tests fail on some architectures (notably PowerPC and 32-bit ARM), as the request_irq() call fails due to the ARCH_IRQ_INIT_FLAGS containing IRQ_NOREQUEST, yielding the following errors:

[10:17:45] # irq_free_disabled_test: EXPECTATION FAILED at kernel/irq/irq_test.c:88
[10:17:45] Expected ret == 0, but
[10:17:45] ret == -22 (0xffffffffffffffea)
[10:17:45] # irq_free_disabled_test: EXPECTATION FAILED at kernel/irq/irq_test.c:90
[10:17:45] Expected desc->depth == 0, but
[10:17:45] desc->depth == 1 (0x1)
[10:17:45] # irq_free_disabled_test: EXPECTATION FAILED at kernel/irq/irq_test.c:93
[10:17:45] Expected desc->depth == 1, but
[10:17:45] desc->depth == 2 (0x2)

By clearing IRQ_NOREQUEST from the interrupt descriptor, these tests now pass on ARM and PowerPC.

---
 kernel/irq/irq_test.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
kernel/irq/irq_test.c +12 -0
index a75abebed7f24..e220e7b2fc187 100644
@@ -54,6 +54,9 @@ static void irq_disable_depth_test(struct kunit *test)
 	desc = irq_to_desc(virq);
 	KUNIT_ASSERT_PTR_NE(test, desc, NULL);
 
+	/* On some architectures, IRQs are NOREQUEST | NOPROBE by default. */
+	irq_settings_clr_norequest(desc);
+
 	ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
@@ -81,6 +84,9 @@ static void irq_free_disabled_test(struct kunit *test)
 	desc = irq_to_desc(virq);
 	KUNIT_ASSERT_PTR_NE(test, desc, NULL);
 
+	/* On some architectures, IRQs are NOREQUEST | NOPROBE by default. */
+	irq_settings_clr_norequest(desc);
+
 	ret = request_irq(virq, noop_handler, 0, "test_irq", NULL);
 	KUNIT_EXPECT_EQ(test, ret, 0);
 
@@ -120,6 +126,9 @@ static void irq_shutdown_depth_test(struct kunit *test)
 	desc = irq_to_desc(virq);
 	KUNIT_ASSERT_PTR_NE(test, desc, NULL);
 
+	/* On some architectures, IRQs are NOREQUEST | NOPROBE by default. */
+	irq_settings_clr_norequest(desc);
+
 	data = irq_desc_get_irq_data(desc);
 	KUNIT_ASSERT_PTR_NE(test, data, NULL);
 
@@ -180,6 +189,9 @@ static void irq_cpuhotplug_test(struct kunit *test)
 	desc = irq_to_desc(virq);
 	KUNIT_ASSERT_PTR_NE(test, desc, NULL);
 
+	/* On some architectures, IRQs are NOREQUEST | NOPROBE by default. */
+	irq_settings_clr_norequest(desc);
+
 	data = irq_desc_get_irq_data(desc);
 	KUNIT_ASSERT_PTR_NE(test, data, NULL);
 
Signature · 1 line
2.51.0
author maintainer
#94 lore raw

PATCH 87/563 genirq/test: Select IRQ_DOMAIN

In reply to Greg Kroah-Hartman

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

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

From: Brian Norris <[email protected]>

[ Upstream commit f8a44f9babd054ff19e20a30cab661d716ad5459 ]

These tests use irq_domain_alloc_descs() and so require CONFIG_IRQ_DOMAIN.

---
 kernel/irq/Kconfig | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/Kconfig +1 -0
index 1da5e9d9da719..08088b8e95ae9 100644
@@ -148,6 +148,7 @@ config IRQ_KUNIT_TEST
 	bool "KUnit tests for IRQ management APIs" if !KUNIT_ALL_TESTS
 	depends on KUNIT=y
 	default KUNIT_ALL_TESTS
+	select IRQ_DOMAIN
 	imply SMP
 	help
 	  This option enables KUnit tests for the IRQ subsystem API. These are
Signature · 1 line
2.51.0
author maintainer
#95 lore raw

PATCH 88/563 genirq/test: Depend on SPARSE_IRQ

In reply to Greg Kroah-Hartman

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

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

From: Brian Norris <[email protected]>

[ Upstream commit 0c888bc86d672e551ce5c58b891c8b44f8967643 ]

Some architectures have a static interrupt layout, with a limited number of interrupts. Without SPARSE_IRQ, the test may not be able to allocate any fake interrupts, and the test will fail. (This occurs on ARCH=m68k, for example.)

Additionally, managed-affinity is only supported with CONFIG_SPARSE_IRQ=y, so irq_shutdown_depth_test() and irq_cpuhotplug_test() would fail without it.

Add a 'SPARSE_IRQ' dependency to avoid these problems.

Many architectures 'select SPARSE_IRQ', so this is easy to miss.

Notably, this also excludes ARCH=um from running any of these tests, even though some of them might work.

---
 kernel/irq/Kconfig | 1 +
 1 file changed, 1 insertion(+)
kernel/irq/Kconfig +1 -0
index 08088b8e95ae9..a75df2bb9db66 100644
@@ -147,6 +147,7 @@ config GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
 config IRQ_KUNIT_TEST
 	bool "KUnit tests for IRQ management APIs" if !KUNIT_ALL_TESTS
 	depends on KUNIT=y
+	depends on SPARSE_IRQ
 	default KUNIT_ALL_TESTS
 	select IRQ_DOMAIN
 	imply SMP
Signature · 1 line
2.51.0
author maintainer
#96 lore raw

PATCH 89/563 genirq/test: Drop CONFIG_GENERIC_IRQ_MIGRATION assumptions

In reply to Greg Kroah-Hartman

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

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

From: Brian Norris <[email protected]>

[ Upstream commit add03fdb9d52411cabb3872fb7692df6f4c67586 ]

Not all platforms use the generic IRQ migration code, even if they select GENERIC_IRQ_MIGRATION. (See, for example, powerpc / pseries_cpu_disable().)

If such platforms don't perform managed shutdown the same way, the interrupt may not actually shut down, and these tests fail:

[    4.357022][  T101]     # irq_cpuhotplug_test: EXPECTATION FAILED at kernel/irq/irq_test.c:211
[    4.357022][  T101]     Expected irqd_is_activated(data) to be false, but is true
[    4.358128][  T101]     # irq_cpuhotplug_test: EXPECTATION FAILED at kernel/irq/irq_test.c:212
[    4.358128][  T101]     Expected irqd_is_started(data) to be false, but is true
[    4.375558][  T101]     # irq_cpuhotplug_test: EXPECTATION FAILED at kernel/irq/irq_test.c:216
[    4.375558][  T101]     Expected irqd_is_activated(data) to be false, but is true
[    4.376088][  T101]     # irq_cpuhotplug_test: EXPECTATION FAILED at kernel/irq/irq_test.c:217
[    4.376088][  T101]     Expected irqd_is_started(data) to be false, but is true
[    4.377851][    T1]     # irq_cpuhotplug_test: pass:0 fail:1 skip:0 total:1
[    4.377901][    T1]     not ok 4 irq_cpuhotplug_test
[    4.378073][    T1] # irq_test_cases: pass:3 fail:1 skip:0 total:4

Rather than test that PowerPC performs migration the same way as the unterrupt core, just drop the state checks. The point of the test was to ensure that the code kept |depth| balanced, which still can be tested for.

---
 kernel/irq/irq_test.c | 4 ----
 1 file changed, 4 deletions(-)
kernel/irq/irq_test.c +0 -4
index e220e7b2fc187..37568ec714b51 100644
@@ -208,13 +208,9 @@ static void irq_cpuhotplug_test(struct kunit *test)
 	KUNIT_EXPECT_EQ(test, desc->depth, 1);
 
 	KUNIT_EXPECT_EQ(test, remove_cpu(1), 0);
-	KUNIT_EXPECT_FALSE(test, irqd_is_activated(data));
-	KUNIT_EXPECT_FALSE(test, irqd_is_started(data));
 	KUNIT_EXPECT_GE(test, desc->depth, 1);
 	KUNIT_EXPECT_EQ(test, add_cpu(1), 0);
 
-	KUNIT_EXPECT_FALSE(test, irqd_is_activated(data));
-	KUNIT_EXPECT_FALSE(test, irqd_is_started(data));
 	KUNIT_EXPECT_EQ(test, desc->depth, 1);
 
 	enable_irq(virq);
Signature · 1 line
2.51.0
author maintainer
#97 lore raw

PATCH 90/563 genirq/test: Ensure CPU 1 is online for hotplug test

In reply to Greg Kroah-Hartman

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

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

From: Brian Norris <[email protected]>

[ Upstream commit 8ad25ebfa70e86860559b306bbc923c7db4fcac6 ]

It's possible to run these tests on platforms that think they have a hotpluggable CPU1, but for whatever reason, CPU1 is not online and can't be brought online:

    # irq_cpuhotplug_test: EXPECTATION FAILED at kernel/irq/irq_test.c:210
    Expected remove_cpu(1) == 0, but
        remove_cpu(1) == 1 (0x1)
CPU1: failed to boot: -38
    # irq_cpuhotplug_test: EXPECTATION FAILED at kernel/irq/irq_test.c:214
    Expected add_cpu(1) == 0, but
        add_cpu(1) == -38 (0xffffffffffffffda)

Check that CPU1 is actually online before trying to run the test.

---
 kernel/irq/irq_test.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/irq/irq_test.c +2 -0
index 37568ec714b51..f71f46fdcfd5e 100644
@@ -178,6 +178,8 @@ static void irq_cpuhotplug_test(struct kunit *test)
 		kunit_skip(test, "requires more than 1 CPU for CPU hotplug");
 	if (!cpu_is_hotpluggable(1))
 		kunit_skip(test, "CPU 1 must be hotpluggable");
+	if (!cpu_online(1))
+		kunit_skip(test, "CPU 1 must be online");
 
 	cpumask_copy(&affinity.mask, cpumask_of(1));
 
Signature · 1 line
2.51.0
author maintainer
#98 lore raw

PATCH 91/563 selftests/bpf: Fix count write in testapp_xdp_metadata_copy()

In reply to Greg Kroah-Hartman

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

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

From: Ricardo B. Marlière <[email protected]>

[ Upstream commit c9110e6f7237f4a314e2b87b75a8a158b9877a7b ]

Commit 4b302092553c ("selftests/xsk: Add tail adjustment tests and support check") added a new global to xsk_xdp_progs.c, but left out the access in the testapp_xdp_metadata_copy() function. Since bpf_map_update_elem() will write to the whole bss section, it gets truncated. Fix by writing to skel_rx->bss->count directly.

---
 tools/testing/selftests/bpf/xskxceiver.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
tools/testing/selftests/bpf/xskxceiver.c +1 -13
index a29de0713f19f..352adc8df2d1c 100644
@@ -2276,25 +2276,13 @@ static int testapp_xdp_metadata_copy(struct test_spec *test)
 {
 	struct xsk_xdp_progs *skel_rx = test->ifobj_rx->xdp_progs;
 	struct xsk_xdp_progs *skel_tx = test->ifobj_tx->xdp_progs;
-	struct bpf_map *data_map;
-	int count = 0;
-	int key = 0;
 
 	test_spec_set_xdp_prog(test, skel_rx->progs.xsk_xdp_populate_metadata,
 			       skel_tx->progs.xsk_xdp_populate_metadata,
 			       skel_rx->maps.xsk, skel_tx->maps.xsk);
 	test->ifobj_rx->use_metadata = true;
 
-	data_map = bpf_object__find_map_by_name(skel_rx->obj, "xsk_xdp_.bss");
-	if (!data_map || !bpf_map__is_internal(data_map)) {
-		ksft_print_msg("Error: could not find bss section of XDP program\n");
-		return TEST_FAILURE;
-	}
-
-	if (bpf_map_update_elem(bpf_map__fd(data_map), &key, &count, BPF_ANY)) {
-		ksft_print_msg("Error: could not update count element\n");
-		return TEST_FAILURE;
-	}
+	skel_rx->bss->count = 0;
 
 	return testapp_validate_traffic(test);
 }
Signature · 1 line
2.51.0
author maintainer
#99 lore raw

PATCH 92/563 vdso/datastore: Gate time data behind CONFIG_GENERIC_GETTIMEOFDAY

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 7c0c01a216e6d9e1d169c0f6f3b5522e6da708ed ]

When the generic vDSO does not provide time functions, as for example on riscv32, then the time data store is not necessary.

Avoid allocating these time data pages when not used.

---
 lib/vdso/datastore.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/vdso/datastore.c +3 -3
index 3693c6caf2c4d..a565c30c71a04 100644
@@ -11,14 +11,14 @@
 /*
  * The vDSO data page.
  */
-#ifdef CONFIG_HAVE_GENERIC_VDSO
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
 static union {
 	struct vdso_time_data	data;
 	u8			page[PAGE_SIZE];
 } vdso_time_data_store __page_aligned_data;
 struct vdso_time_data *vdso_k_time_data = &vdso_time_data_store.data;
 static_assert(sizeof(vdso_time_data_store) == PAGE_SIZE);
-#endif /* CONFIG_HAVE_GENERIC_VDSO */
+#endif /* CONFIG_GENERIC_GETTIMEOFDAY */
 
 #ifdef CONFIG_VDSO_GETRANDOM
 static union {
@@ -46,7 +46,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
 
 	switch (vmf->pgoff) {
 	case VDSO_TIME_PAGE_OFFSET:
-		if (!IS_ENABLED(CONFIG_HAVE_GENERIC_VDSO))
+		if (!IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY))
 			return VM_FAULT_SIGBUS;
 		pfn = __phys_to_pfn(__pa_symbol(vdso_k_time_data));
 		if (timens_page) {
Signature · 1 line
2.51.0
author maintainer
#100 lore raw

PATCH 93/563 PM: sleep: core: Clear power.must_resume in noirq suspend error path

In reply to Greg Kroah-Hartman

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

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

From: Rafael J. Wysocki <[email protected]>

[ Upstream commit be82483d1b60baf6747884bd74cb7de484deaf76 ]

If system suspend is aborted in the "noirq" phase (for instance, due to an error returned by one of the device callbacks), power.is_noirq_suspended will not be set for some devices and device_resume_noirq() will return early for them. Consequently, noirq resume callbacks will not run for them at all because the noirq suspend callbacks have not run for them yet.

If any of them has power.must_resume set and late suspend has been skipped for it (due to power.smart_suspend), early resume should be skipped for it either, or its state may become inconsistent (for instance, if the early resume assumes that it will always follow noirq resume).

Make that happen by clearing power.must_resume in device_resume_noirq() for devices with power.is_noirq_suspended clear that have been left in suspend by device_suspend_late(), which will subsequently cause device_resume_early() to leave the device in suspend and avoid changing its state.

---
 drivers/base/power/main.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/base/power/main.c +13 -1
index 2ea6e05e6ec90..c883b01ffbddc 100644
@@ -724,8 +724,20 @@ static void device_resume_noirq(struct device *dev, pm_message_t state, bool asy
 	if (dev->power.syscore || dev->power.direct_complete)
 		goto Out;
 
-	if (!dev->power.is_noirq_suspended)
+	if (!dev->power.is_noirq_suspended) {
+		/*
+		 * This means that system suspend has been aborted in the noirq
+		 * phase before invoking the noirq suspend callback for the
+		 * device, so if device_suspend_late() has left it in suspend,
+		 * device_resume_early() should leave it in suspend either in
+		 * case the early resume of it depends on the noirq resume that
+		 * has not run.
+		 */
+		if (dev_pm_skip_suspend(dev))
+			dev->power.must_resume = false;
+
 		goto Out;
+	}
 
 	if (!dpm_wait_for_superior(dev, async))
 		goto Out;
Signature · 1 line
2.51.0
author maintainer
#101 lore raw

PATCH 94/563 blk-mq: fix elevator depth_updated method

In reply to Greg Kroah-Hartman

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

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

From: Yu Kuai <[email protected]>

[ Upstream commit 7d337eef4affc5e26e0570513168c69ddbc40f92 ]

Current depth_updated has some problems:

1) depth_updated() will be called for each hctx, while all elevators will update async_depth for the disk level, this is not related to hctx;
2) In blk_mq_update_nr_requests(), if previous hctx update succeed and this hctx update failed, q->nr_requests will not be updated, while async_depth is already updated with new nr_reqeuests in previous depth_updated();
3) All elevators are using q->nr_requests to calculate async_depth now, however, q->nr_requests is still the old value when depth_updated() is called from blk_mq_update_nr_requests();

Those problems are first from error path, then mq-deadline, and recently for bfq and kyber, fix those problems by:

- pass in request_queue instead of hctx;
- move depth_updated() after q->nr_requests is updated in blk_mq_update_nr_requests();
- add depth_updated() call inside init_sched() method to initialize async_depth;
- remove init_hctx() method for mq-deadline and bfq that is useless now;

Fixes 77f1e0a52d26 ("bfq: update internal depth state when queue depth changes")
Fixes 39823b47bbd4 ("block/mq-deadline: Fix the tag reservation code")
Fixes 42e6c6ce03fd ("lib/sbitmap: convert shallow_depth from one word to the whole sbitmap")
---
 block/bfq-iosched.c   | 22 +++++-----------------
 block/blk-mq-sched.h  | 11 +++++++++++
 block/blk-mq.c        | 23 ++++++++++++-----------
 block/elevator.h      |  2 +-
 block/kyber-iosched.c | 19 +++++++++----------
 block/mq-deadline.c   | 16 +++-------------
 6 files changed, 41 insertions(+), 52 deletions(-)
block/bfq-iosched.c +5 -17
index 50e51047e1fe5..4a8d3d96bfe49 100644
@@ -7109,9 +7109,10 @@ void bfq_put_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg)
  * See the comments on bfq_limit_depth for the purpose of
  * the depths set in the function. Return minimum shallow depth we'll use.
  */
-static void bfq_update_depths(struct bfq_data *bfqd, struct sbitmap_queue *bt)
+static void bfq_depth_updated(struct request_queue *q)
 {
-	unsigned int nr_requests = bfqd->queue->nr_requests;
+	struct bfq_data *bfqd = q->elevator->elevator_data;
+	unsigned int nr_requests = q->nr_requests;
 
 	/*
 	 * In-word depths if no bfq_queue is being weight-raised:
@@ -7143,21 +7144,8 @@ static void bfq_update_depths(struct bfq_data *bfqd, struct sbitmap_queue *bt)
 	bfqd->async_depths[1][0] = max((nr_requests * 3) >> 4, 1U);
 	/* no more than ~37% of tags for sync writes (~20% extra tags) */
 	bfqd->async_depths[1][1] = max((nr_requests * 6) >> 4, 1U);
-}
-
-static void bfq_depth_updated(struct blk_mq_hw_ctx *hctx)
-{
-	struct bfq_data *bfqd = hctx->queue->elevator->elevator_data;
-	struct blk_mq_tags *tags = hctx->sched_tags;
 
-	bfq_update_depths(bfqd, &tags->bitmap_tags);
-	sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, 1);
-}
-
-static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index)
-{
-	bfq_depth_updated(hctx);
-	return 0;
+	blk_mq_set_min_shallow_depth(q, 1);
 }
 
 static void bfq_exit_queue(struct elevator_queue *e)
@@ -7369,6 +7357,7 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq)
 		goto out_free;
 	bfq_init_root_group(bfqd->root_group, bfqd);
 	bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group);
+	bfq_depth_updated(q);
 
 	/* We dispatch from request queue wide instead of hw queue */
 	blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
@@ -7628,7 +7617,6 @@ static struct elevator_type iosched_bfq_mq = {
 		.request_merged		= bfq_request_merged,
 		.has_work		= bfq_has_work,
 		.depth_updated		= bfq_depth_updated,
-		.init_hctx		= bfq_init_hctx,
 		.init_sched		= bfq_init_queue,
 		.exit_sched		= bfq_exit_queue,
 	},
block/blk-mq-sched.h +11 -0
index b554e1d559508..fe83187f41db4 100644
@@ -92,4 +92,15 @@ static inline bool blk_mq_sched_needs_restart(struct blk_mq_hw_ctx *hctx)
 	return test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state);
 }
 
+static inline void blk_mq_set_min_shallow_depth(struct request_queue *q,
+						unsigned int depth)
+{
+	struct blk_mq_hw_ctx *hctx;
+	unsigned long i;
+
+	queue_for_each_hw_ctx(q, hctx, i)
+		sbitmap_queue_min_shallow_depth(&hctx->sched_tags->bitmap_tags,
+						depth);
+}
+
 #endif
block/blk-mq.c +12 -11
index ba3a4b77f5786..9055cd6247004 100644
@@ -4951,20 +4951,21 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
 						      false);
 		}
 		if (ret)
-			break;
-		if (q->elevator && q->elevator->type->ops.depth_updated)
-			q->elevator->type->ops.depth_updated(hctx);
+			goto out;
 	}
-	if (!ret) {
-		q->nr_requests = nr;
-		if (blk_mq_is_shared_tags(set->flags)) {
-			if (q->elevator)
-				blk_mq_tag_update_sched_shared_tags(q);
-			else
-				blk_mq_tag_resize_shared_tags(set, nr);
-		}
+
+	q->nr_requests = nr;
+	if (q->elevator && q->elevator->type->ops.depth_updated)
+		q->elevator->type->ops.depth_updated(q);
+
+	if (blk_mq_is_shared_tags(set->flags)) {
+		if (q->elevator)
+			blk_mq_tag_update_sched_shared_tags(q);
+		else
+			blk_mq_tag_resize_shared_tags(set, nr);
 	}
 
+out:
 	blk_mq_unquiesce_queue(q);
 
 	return ret;
block/elevator.h +1 -1
index adc5c157e17e5..c4d20155065e8 100644
@@ -37,7 +37,7 @@ struct elevator_mq_ops {
 	void (*exit_sched)(struct elevator_queue *);
 	int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int);
 	void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int);
-	void (*depth_updated)(struct blk_mq_hw_ctx *);
+	void (*depth_updated)(struct request_queue *);
 
 	bool (*allow_merge)(struct request_queue *, struct request *, struct bio *);
 	bool (*bio_merge)(struct request_queue *, struct bio *, unsigned int);
block/kyber-iosched.c +9 -10
index 70cbc7b2deb40..18efd6ef2a2b9 100644
@@ -399,6 +399,14 @@ static struct kyber_queue_data *kyber_queue_data_alloc(struct request_queue *q)
 	return ERR_PTR(ret);
 }
 
+static void kyber_depth_updated(struct request_queue *q)
+{
+	struct kyber_queue_data *kqd = q->elevator->elevator_data;
+
+	kqd->async_depth = q->nr_requests * KYBER_ASYNC_PERCENT / 100U;
+	blk_mq_set_min_shallow_depth(q, kqd->async_depth);
+}
+
 static int kyber_init_sched(struct request_queue *q, struct elevator_queue *eq)
 {
 	struct kyber_queue_data *kqd;
@@ -413,6 +421,7 @@ static int kyber_init_sched(struct request_queue *q, struct elevator_queue *eq)
 
 	eq->elevator_data = kqd;
 	q->elevator = eq;
+	kyber_depth_updated(q);
 
 	return 0;
 }
@@ -440,15 +449,6 @@ static void kyber_ctx_queue_init(struct kyber_ctx_queue *kcq)
 		INIT_LIST_HEAD(&kcq->rq_list[i]);
 }
 
-static void kyber_depth_updated(struct blk_mq_hw_ctx *hctx)
-{
-	struct kyber_queue_data *kqd = hctx->queue->elevator->elevator_data;
-	struct blk_mq_tags *tags = hctx->sched_tags;
-
-	kqd->async_depth = hctx->queue->nr_requests * KYBER_ASYNC_PERCENT / 100U;
-	sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, kqd->async_depth);
-}
-
 static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
 {
 	struct kyber_hctx_data *khd;
@@ -493,7 +493,6 @@ static int kyber_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
 	khd->batching = 0;
 
 	hctx->sched_data = khd;
-	kyber_depth_updated(hctx);
 
 	return 0;
 
block/mq-deadline.c +3 -13
index b9b7cdf1d3c98..2e689b2c40213 100644
@@ -507,22 +507,12 @@ static void dd_limit_depth(blk_opf_t opf, struct blk_mq_alloc_data *data)
 }
 
 /* Called by blk_mq_update_nr_requests(). */
-static void dd_depth_updated(struct blk_mq_hw_ctx *hctx)
+static void dd_depth_updated(struct request_queue *q)
 {
-	struct request_queue *q = hctx->queue;
 	struct deadline_data *dd = q->elevator->elevator_data;
-	struct blk_mq_tags *tags = hctx->sched_tags;
 
 	dd->async_depth = q->nr_requests;
-
-	sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, 1);
-}
-
-/* Called by blk_mq_init_hctx() and blk_mq_init_sched(). */
-static int dd_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
-{
-	dd_depth_updated(hctx);
-	return 0;
+	blk_mq_set_min_shallow_depth(q, 1);
 }
 
 static void dd_exit_sched(struct elevator_queue *e)
@@ -587,6 +577,7 @@ static int dd_init_sched(struct request_queue *q, struct elevator_queue *eq)
 	blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
 
 	q->elevator = eq;
+	dd_depth_updated(q);
 	return 0;
 }
 
@@ -1048,7 +1039,6 @@ static struct elevator_type mq_deadline = {
 		.has_work		= dd_has_work,
 		.init_sched		= dd_init_sched,
 		.exit_sched		= dd_exit_sched,
-		.init_hctx		= dd_init_hctx,
 	},
 
 #ifdef CONFIG_BLK_DEBUG_FS
Signature · 1 line
2.51.0
author maintainer
#102 lore raw

PATCH 95/563 vdso: Add struct __kernel_old_timeval forward declaration to gettime.h

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 437054b1bbe11be87ab0a522b8ccbae3f785c642 ]

The prototype of __vdso_gettimeofday() uses this struct. However gettime.h's own includes do not provide a definition for it.

Add a forward declaration, similar to other used structs.

Fixes 42874e4eb35b ("arch: vdso: consolidate gettime prototypes")
---
 include/vdso/gettime.h | 1 +
 1 file changed, 1 insertion(+)
include/vdso/gettime.h +1 -0
index c50d152e7b3e0..9ac161866653a 100644
@@ -5,6 +5,7 @@
 #include <linux/types.h>
 
 struct __kernel_timespec;
+struct __kernel_old_timeval;
 struct timezone;
 
 #if !defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64)
Signature · 1 line
2.51.0
author maintainer
#103 lore raw

PATCH 96/563 ARM: dts: ti: omap: am335x-baltos: Fix ti,en-ck32k-xtal property in DTS to use correct boolean syntax

In reply to Greg Kroah-Hartman

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

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

From: Jihed Chaibi <[email protected]>

[ Upstream commit 9658a92fad1889ff92fa4bd668cd61052687245a ]

The ti,en-ck32k-xtal property, defined as a boolean in the Device Tree schema, was incorrectly assigned a value (<1>) in the DTS file, causing a validation error: "size (4) error for type flag". The driver uses of_property_read_bool(), expecting a boolean. Remove the value to fix the dtbs_check error.

---
 arch/arm/boot/dts/ti/omap/am335x-baltos.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/ti/omap/am335x-baltos.dtsi +1 -1
index ae2e8dffbe049..ea47f9960c356 100644
@@ -269,7 +269,7 @@ &tps {
 	vcc7-supply = <&vbat>;
 	vccio-supply = <&vbat>;
 
-	ti,en-ck32k-xtal = <1>;
+	ti,en-ck32k-xtal;
 
 	regulators {
 		vrtc_reg: regulator@0 {
Signature · 1 line
2.51.0
author maintainer
#104 lore raw

PATCH 97/563 ARM: dts: ti: omap: omap3-devkit8000-lcd: Fix ti,keep-vref-on property to use correct boolean syntax in DTS

In reply to Greg Kroah-Hartman

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

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

From: Jihed Chaibi <[email protected]>

[ Upstream commit 5af5b85505bc859adb338fe5d6e4842e72cdf932 ]

The ti,keep-vref-on property, defined as a boolean flag in the Device Tree schema, was incorrectly assigned a value (<1>) in the DTS file, causing a validation error: "size (4) error for type flag". Remove the value to match the schema and ensure compatibility with the driver using device_property_read_bool(). This fixes the dtbs_check error.

Fixes ed05637c30e6 ("ARM: dts: omap3-devkit8000: Add ADS7846 Touchscreen support")
---
 arch/arm/boot/dts/ti/omap/omap3-devkit8000-lcd-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/ti/omap/omap3-devkit8000-lcd-common.dtsi +1 -1
index a7f99ae0c1fe9..78c657429f641 100644
@@ -65,7 +65,7 @@ ads7846@0 {
 		ti,debounce-max = /bits/ 16 <10>;
 		ti,debounce-tol = /bits/ 16 <5>;
 		ti,debounce-rep = /bits/ 16 <1>;
-		ti,keep-vref-on = <1>;
+		ti,keep-vref-on;
 		ti,settle-delay-usec = /bits/ 16 <150>;
 
 		wakeup-source;
Signature · 1 line
2.51.0
author maintainer
#105 lore raw

PATCH 98/563 ARM: dts: omap: am335x-cm-t335: Remove unused mcasp num-serializer property

In reply to Greg Kroah-Hartman

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

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

From: Jihed Chaibi <[email protected]>

[ Upstream commit 27322753c8b913fba05250e7b5abb1da31e6ed23 ]

The dtbs_check validation for am335x-cm-t335.dtb flags an error for an unevaluated 'num-serializer' property in the mcasp0 node.

This property is obsolete; it is not defined in the davinci-mcasp-audio schema and is not used by the corresponding (or any) driver.

Remove this unused property to fix the schema validation warning.

Fixes 48ab364478e77 ("ARM: dts: cm-t335: add audio support")
---
 arch/arm/boot/dts/ti/omap/am335x-cm-t335.dts | 2 --
 1 file changed, 2 deletions(-)
arch/arm/boot/dts/ti/omap/am335x-cm-t335.dts +0 -2
index 06767ea164b59..ece7f7854f6aa 100644
@@ -483,8 +483,6 @@ &mcasp1 {
 
 		op-mode = <0>;          /* MCASP_IIS_MODE */
 		tdm-slots = <2>;
-		/* 16 serializers */
-		num-serializer = <16>;
 		serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
 			0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0
 		>;
Signature · 1 line
2.51.0
author maintainer
#106 lore raw

PATCH 99/563 PM / devfreq: mtk-cci: Fix potential error pointer dereference in probe()

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit fc33bf0e097c6834646b98a7b3da0ae5b617f0f9 ]

The drv->sram_reg pointer could be set to ERR_PTR(-EPROBE_DEFER) which would lead to a error pointer dereference. Use IS_ERR_OR_NULL() to check that the pointer is valid.

Fixes e09bd5757b52 ("PM / devfreq: mtk-cci: Handle sram regulator probe deferral")
---
 drivers/devfreq/mtk-cci-devfreq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/devfreq/mtk-cci-devfreq.c +2 -1
index 22fe9e631f8aa..5730076846e1b 100644
@@ -386,7 +386,8 @@ static int mtk_ccifreq_probe(struct platform_device *pdev)
 out_free_resources:
 	if (regulator_is_enabled(drv->proc_reg))
 		regulator_disable(drv->proc_reg);
-	if (drv->sram_reg && regulator_is_enabled(drv->sram_reg))
+	if (!IS_ERR_OR_NULL(drv->sram_reg) &&
+	    regulator_is_enabled(drv->sram_reg))
 		regulator_disable(drv->sram_reg);
 
 	return ret;
Signature · 1 line
2.51.0
author maintainer
#107 lore raw

PATCH 100/563 power: supply: cw2015: Fix a alignment coding style issue

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit def5612170a8c6c4c6a3ea5bd6c3cfc8de6ba4b1 ]

Fix the checkpatch warning:
CHECK: Alignment should match open parenthesis

Fixes 0cb172a4918e ("power: supply: cw2015: Use device managed API to simplify the code")
---
 drivers/power/supply/cw2015_battery.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/power/supply/cw2015_battery.c +1 -2
index f63c3c4104515..382dff8805c62 100644
@@ -702,8 +702,7 @@ static int cw_bat_probe(struct i2c_client *client)
 	if (!cw_bat->battery_workqueue)
 		return -ENOMEM;
 
-	devm_delayed_work_autocancel(&client->dev,
-							  &cw_bat->battery_delay_work, cw_bat_work);
+	devm_delayed_work_autocancel(&client->dev, &cw_bat->battery_delay_work, cw_bat_work);
 	queue_delayed_work(cw_bat->battery_workqueue,
 			   &cw_bat->battery_delay_work, msecs_to_jiffies(10));
 	return 0;
Signature · 1 line
2.51.0
author maintainer
#108 lore raw

PATCH 101/563 hwmon: (asus-ec-sensors) Narrow lock for X870E-CREATOR WIFI

In reply to Greg Kroah-Hartman

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

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

From: Eugene Shalygin <[email protected]>

[ Upstream commit 3aa72cf03924d04c8d20f8b319df8f73550dd26c ]

Use mutex from the SIO device rather than the global lock.

Fixes 3e538b52157b ("hwmon: (asus-ec-sensors) add ProArt X870E-CREATOR WIFI")
---
 drivers/hwmon/asus-ec-sensors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/asus-ec-sensors.c +1 -1
index 4ac554731e98a..f43efb80aabf3 100644
@@ -396,7 +396,7 @@ static const struct ec_board_info board_info_pro_art_x870E_creator_wifi = {
 	.sensors = SENSOR_TEMP_CPU | SENSOR_TEMP_CPU_PACKAGE |
 		SENSOR_TEMP_MB | SENSOR_TEMP_VRM |
 		SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CPU_OPT,
-	.mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0,
 	.family = family_amd_800_series,
 };
 
Signature · 1 line
2.51.0
author maintainer
#109 lore raw

PATCH 102/563 pinctrl: renesas: Use int type to store negative error codes

In reply to Greg Kroah-Hartman

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

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

From: Qianfeng Rong <[email protected]>

[ Upstream commit 9f062fc5b0ff44550088912ab89f9da40226a826 ]

Change the 'ret' variable in sh_pfc_pinconf_group_set() from unsigned int to int, as it needs to store either negative error codes or zero returned by sh_pfc_pinconf_set().

No effect on runtime.

Fixes d0593c363f04ccc4 ("pinctrl: sh-pfc: Propagate errors on group config")
---
 drivers/pinctrl/renesas/pinctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/renesas/pinctrl.c +2 -1
index 29d16c9c1bd19..3a742f74ecd1d 100644
@@ -726,7 +726,8 @@ static int sh_pfc_pinconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
 	struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
 	const unsigned int *pins;
 	unsigned int num_pins;
-	unsigned int i, ret;
+	unsigned int i;
+	int ret;
 
 	pins = pmx->pfc->info->groups[group].pins;
 	num_pins = pmx->pfc->info->groups[group].nr_pins;
Signature · 1 line
2.51.0
author maintainer
#110 lore raw

PATCH 103/563 pinctrl: eswin: Fix regulator error check and Kconfig dependency

In reply to Greg Kroah-Hartman

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

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

From: Yulin Lu <[email protected]>

[ Upstream commit a6a2f50ab1721343ee2d5d2be888709aa886e3aa ]

Smatch reported the following warning in eic7700_pinctrl_probe():

drivers/pinctrl/pinctrl-eic7700.c:638 eic7700_pinctrl_probe()
warn: passing zero to 'PTR_ERR'

The root cause is that devm_regulator_get() may return NULL when CONFIG_REGULATOR is disabled. In such case, IS_ERR_OR_NULL() triggers PTR_ERR(NULL) which evaluates to 0, leading to passing a success code as an error.

However, this driver cannot work without a regulator. To fix this:

- Change the check from IS_ERR_OR_NULL() to IS_ERR()
- Update Kconfig to explicitly select REGULATOR and REGULATOR_FIXED_VOLTAGE, ensuring that the regulator framework is always available.

This resolves the Smatch warning and enforces the correct dependency.

---
 drivers/pinctrl/Kconfig           | 2 ++
 drivers/pinctrl/pinctrl-eic7700.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/Kconfig +2 -0
index be1ca8e85754b..0402626c4b98b 100644
@@ -211,6 +211,8 @@ config PINCTRL_EIC7700
 	depends on ARCH_ESWIN || COMPILE_TEST
 	select PINMUX
 	select GENERIC_PINCONF
+	select REGULATOR
+	select REGULATOR_FIXED_VOLTAGE
 	help
 	  This driver support for the pin controller in ESWIN's EIC7700 SoC,
 	  which supports pin multiplexing, pin configuration,and rgmii voltage
drivers/pinctrl/pinctrl-eic7700.c +1 -1
index 4874b55323439..ffcd0ec5c2dc6 100644
@@ -634,7 +634,7 @@ static int eic7700_pinctrl_probe(struct platform_device *pdev)
 		return PTR_ERR(pc->base);
 
 	regulator = devm_regulator_get(dev, "vrgmii");
-	if (IS_ERR_OR_NULL(regulator)) {
+	if (IS_ERR(regulator)) {
 		return dev_err_probe(dev, PTR_ERR(regulator),
 					 "failed to get vrgmii regulator\n");
 	}
Signature · 1 line
2.51.0
author maintainer
#111 lore raw

PATCH 104/563 null_blk: Fix the description of the cache_size module argument

In reply to Greg Kroah-Hartman

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

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

From: Genjian Zhang <[email protected]>

[ Upstream commit 7942b226e6b84df13b46b76c01d3b6e07a1b349e ]

When executing modinfo null_blk, there is an error in the description of module parameter mbps, and the output information of cache_size is incomplete.The output of modinfo before and after applying this patch is as follows:

Before:
[...]
parm: cache_size:ulong
[...]
parm: mbps:Cache size in MiB for memory-backed device.
Default: 0 (none) (uint)
[...]

After:
[...]
parm: cache_size:Cache size in MiB for memory-backed device.
Default: 0 (none) (ulong)
[...]
parm: mbps:Limit maximum bandwidth (in MiB/s).
Default: 0 (no limit) (uint)
[...]

Fixes 058efe000b31 ("null_blk: add module parameters for 4 options")
---
 drivers/block/null_blk/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/null_blk/main.c +1 -1
index 91642c9a3b293..f982027e8c858 100644
@@ -223,7 +223,7 @@ MODULE_PARM_DESC(discard, "Support discard operations (requires memory-backed nu
 
 static unsigned long g_cache_size;
 module_param_named(cache_size, g_cache_size, ulong, 0444);
-MODULE_PARM_DESC(mbps, "Cache size in MiB for memory-backed device. Default: 0 (none)");
+MODULE_PARM_DESC(cache_size, "Cache size in MiB for memory-backed device. Default: 0 (none)");
 
 static bool g_fua = true;
 module_param_named(fua, g_fua, bool, 0444);
Signature · 1 line
2.51.0
author maintainer
#112 lore raw

PATCH 105/563 blk-throttle: fix access race during throttle policy activation

In reply to Greg Kroah-Hartman

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

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

From: Han Guangjiang <[email protected]>

[ Upstream commit bd9fd5be6bc0836820500f68fff144609fbd85a9 ]

On repeated cold boots we occasionally hit a NULL pointer crash in blk_should_throtl() when throttling is consulted before the throttle policy is fully enabled for the queue. Checking only q->td != NULL is insufficient during early initialization, so blkg_to_pd() for the throttle policy can still return NULL and blkg_to_tg() becomes NULL, which later gets dereferenced.

 Unable to handle kernel NULL pointer dereference
 at virtual address 0000000000000156
 ...
 pc : submit_bio_noacct+0x14c/0x4c8
 lr : submit_bio_noacct+0x48/0x4c8
 sp : ffff800087f0b690
 x29: ffff800087f0b690 x28: 0000000000005f90 x27: ffff00068af393c0
 x26: 0000000000080000 x25: 000000000002fbc0 x24: ffff000684ddcc70
 x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000000
 x20: 0000000000080000 x19: ffff000684ddcd08 x18: ffffffffffffffff
 x17: 0000000000000000 x16: ffff80008132a550 x15: 0000ffff98020fff
 x14: 0000000000000000 x13: 1fffe000d11d7021 x12: ffff000688eb810c
 x11: ffff00077ec4bb80 x10: ffff000688dcb720 x9 : ffff80008068ef60
 x8 : 00000a6fb8a86e85 x7 : 000000000000111e x6 : 0000000000000002
 x5 : 0000000000000246 x4 : 0000000000015cff x3 : 0000000000394500
 x2 : ffff000682e35e40 x1 : 0000000000364940 x0 : 000000000000001a
 Call trace:
  submit_bio_noacct+0x14c/0x4c8
  verity_map+0x178/0x2c8
  __map_bio+0x228/0x250
  dm_submit_bio+0x1c4/0x678
  __submit_bio+0x170/0x230
  submit_bio_noacct_nocheck+0x16c/0x388
  submit_bio_noacct+0x16c/0x4c8
  submit_bio+0xb4/0x210
  f2fs_submit_read_bio+0x4c/0xf0
  f2fs_mpage_readpages+0x3b0/0x5f0
  f2fs_readahead+0x90/0xe8

Tighten blk_throtl_activated() to also require that the throttle policy bit is set on the queue:

  return q->td != NULL &&
         test_bit(blkcg_policy_throtl.plid, q->blkcg_pols);

This prevents blk_should_throtl() from accessing throttle group state until policy data has been attached to blkgs.

Fixes a3166c51702b ("blk-throttle: delay initialization until configuration")
---
 block/blk-cgroup.c   |  6 ------
 block/blk-cgroup.h   |  6 ++++++
 block/blk-throttle.c |  6 +-----
 block/blk-throttle.h | 18 +++++++++++-------
 4 files changed, 18 insertions(+), 18 deletions(-)
block/blk-cgroup.c +0 -6
index fe9ebd6a2e14d..7246fc2563152 100644
@@ -110,12 +110,6 @@ static struct cgroup_subsys_state *blkcg_css(void)
 	return task_css(current, io_cgrp_id);
 }
 
-static bool blkcg_policy_enabled(struct request_queue *q,
-				 const struct blkcg_policy *pol)
-{
-	return pol && test_bit(pol->plid, q->blkcg_pols);
-}
-
 static void blkg_free_workfn(struct work_struct *work)
 {
 	struct blkcg_gq *blkg = container_of(work, struct blkcg_gq,
block/blk-cgroup.h +6 -0
index 81868ad86330c..83367086cb6ae 100644
@@ -459,6 +459,12 @@ static inline bool blk_cgroup_mergeable(struct request *rq, struct bio *bio)
 		bio_issue_as_root_blkg(rq->bio) == bio_issue_as_root_blkg(bio);
 }
 
+static inline bool blkcg_policy_enabled(struct request_queue *q,
+				const struct blkcg_policy *pol)
+{
+	return pol && test_bit(pol->plid, q->blkcg_pols);
+}
+
 void blk_cgroup_bio_start(struct bio *bio);
 void blkcg_add_delay(struct blkcg_gq *blkg, u64 now, u64 delta);
 #else	/* CONFIG_BLK_CGROUP */
block/blk-throttle.c +1 -5
index 397b6a410f9e5..cfa1cd60d2c5f 100644
@@ -1327,17 +1327,13 @@ static int blk_throtl_init(struct gendisk *disk)
 	INIT_WORK(&td->dispatch_work, blk_throtl_dispatch_work_fn);
 	throtl_service_queue_init(&td->service_queue);
 
-	/*
-	 * Freeze queue before activating policy, to synchronize with IO path,
-	 * which is protected by 'q_usage_counter'.
-	 */
 	memflags = blk_mq_freeze_queue(disk->queue);
 	blk_mq_quiesce_queue(disk->queue);
 
 	q->td = td;
 	td->queue = q;
 
-	/* activate policy */
+	/* activate policy, blk_throtl_activated() will return true */
 	ret = blkcg_activate_policy(disk, &blkcg_policy_throtl);
 	if (ret) {
 		q->td = NULL;
block/blk-throttle.h +11 -7
index 3b27755bfbff1..9d7a42c039a15 100644
@@ -156,7 +156,13 @@ void blk_throtl_cancel_bios(struct gendisk *disk);
 
 static inline bool blk_throtl_activated(struct request_queue *q)
 {
-	return q->td != NULL;
+	/*
+	 * q->td guarantees that the blk-throttle module is already loaded,
+	 * and the plid of blk-throttle is assigned.
+	 * blkcg_policy_enabled() guarantees that the policy is activated
+	 * in the request_queue.
+	 */
+	return q->td != NULL && blkcg_policy_enabled(q, &blkcg_policy_throtl);
 }
 
 static inline bool blk_should_throtl(struct bio *bio)
@@ -164,11 +170,6 @@ static inline bool blk_should_throtl(struct bio *bio)
 	struct throtl_grp *tg;
 	int rw = bio_data_dir(bio);
 
-	/*
-	 * This is called under bio_queue_enter(), and it's synchronized with
-	 * the activation of blk-throtl, which is protected by
-	 * blk_mq_freeze_queue().
-	 */
 	if (!blk_throtl_activated(bio->bi_bdev->bd_queue))
 		return false;
 
@@ -194,7 +195,10 @@ static inline bool blk_should_throtl(struct bio *bio)
 
 static inline bool blk_throtl_bio(struct bio *bio)
 {
-
+	/*
+	 * block throttling takes effect if the policy is activated
+	 * in the bio's request_queue.
+	 */
 	if (!blk_should_throtl(bio))
 		return false;
 
Signature · 1 line
2.51.0
author maintainer
#113 lore raw

PATCH 106/563 selftests: vDSO: Fix -Wunitialized in powerpc VDSO_CALL() wrapper

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 9f15e0f9ef514b8e1a80707931f6d07362e8ebc4 ]

The _rval register variable is meant to be an output operand of the asm statement but is instead used as input operand.
clang 20.1 notices this and triggers -Wuninitialized warnings:

tools/testing/selftests/timers/auxclock.c:154:10: error: variable '_rval' is uninitialized when used here [-Werror,-Wuninitialized]

  154 |                 return VDSO_CALL(self->vdso_clock_gettime64, 2, clockid, ts);
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tools/testing/selftests/timers/../vDSO/vdso_call.h:59:10: note: expanded from macro 'VDSO_CALL'
59 | : "r" (_rval) \
| ^~~~~
tools/testing/selftests/timers/auxclock.c:154:10: note: variable '_rval' is declared here tools/testing/selftests/timers/../vDSO/vdso_call.h:47:2: note: expanded from macro 'VDSO_CALL'

   47 |         register long _rval asm ("r3");                                 \
      |         ^

It seems the list of input and output operands have been switched around. However as the argument registers are not always initialized they can not be marked as pure inputs as that would trigger -Wuninitialized warnings. Adding _rval as another input and output operand does also not work as it would collide with the existing _r3 variable.

Instead reuse _r3 for both the argument and the return value.

---
 tools/testing/selftests/vDSO/vdso_call.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
tools/testing/selftests/vDSO/vdso_call.h +3 -4
index bb237d771051b..e7205584cbdca 100644
@@ -44,7 +44,6 @@
 	register long _r6 asm ("r6");					\
 	register long _r7 asm ("r7");					\
 	register long _r8 asm ("r8");					\
-	register long _rval asm ("r3");					\
 									\
 	LOADARGS_##nr(fn, args);					\
 									\
@@ -54,13 +53,13 @@
 		"	bns+	1f\n"					\
 		"	neg	3, 3\n"					\
 		"1:"							\
-		: "+r" (_r0), "=r" (_r3), "+r" (_r4), "+r" (_r5),	\
+		: "+r" (_r0), "+r" (_r3), "+r" (_r4), "+r" (_r5),	\
 		  "+r" (_r6), "+r" (_r7), "+r" (_r8)			\
-		: "r" (_rval)						\
+		:							\
 		: "r9", "r10", "r11", "r12", "cr0", "cr1", "cr5",	\
 		  "cr6", "cr7", "xer", "lr", "ctr", "memory"		\
 	);								\
-	_rval;								\
+	_r3;								\
 })
 
 #else
Signature · 1 line
2.51.0
author maintainer
#114 lore raw

PATCH 107/563 selftests: vDSO: vdso_test_abi: Correctly skip whole test with missing vDSO

In reply to Greg Kroah-Hartman

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

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

From: Thomas Weißschuh <[email protected]>

[ Upstream commit 4b59a9f7628fd82b24f2148f62cf327a84d26555 ]

If AT_SYSINFO_EHDR is missing the whole test needs to be skipped. Currently this results in the following output:

TAP version 13
1..16
# AT_SYSINFO_EHDR is not present!

This output is incorrect, as "1..16" still requires the subtest lines to be printed, which isn't done however.

Switch to the correct skipping functions, so the output now correctly indicates that no subtests are being run:

TAP version 13
1..0 # SKIP AT_SYSINFO_EHDR is not present!

---
 tools/testing/selftests/vDSO/vdso_test_abi.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
tools/testing/selftests/vDSO/vdso_test_abi.c +4 -5
index a54424e2336f4..67cbfc56e4e1b 100644
@@ -182,12 +182,11 @@ int main(int argc, char **argv)
 	unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
 
 	ksft_print_header();
-	ksft_set_plan(VDSO_TEST_PLAN);
 
-	if (!sysinfo_ehdr) {
-		ksft_print_msg("AT_SYSINFO_EHDR is not present!\n");
-		return KSFT_SKIP;
-	}
+	if (!sysinfo_ehdr)
+		ksft_exit_skip("AT_SYSINFO_EHDR is not present!\n");
+
+	ksft_set_plan(VDSO_TEST_PLAN);
 
 	version = versions[VDSO_VERSION];
 	name = (const char **)&names[VDSO_NAMES];
Signature · 1 line
2.51.0
author maintainer
#115 lore raw

PATCH 108/563 irqchip/gic-v5: Fix loop in gicv5_its_create_itt_two_level() cleanup path

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit bfcd1fdaae92faa8cae880eb4c3aaaa60c54bf0d ]

The "i" variable in gicv5_its_create_itt_two_level() needs to be signed otherwise it can cause a forever loop in the function's cleanup path.

[ lpieralisi: Reworded commit message ]

---
 drivers/irqchip/irq-gic-v5-its.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-gic-v5-its.c +2 -2
index 9290ac741949c..4701ef62b8b27 100644
@@ -191,9 +191,9 @@ static int gicv5_its_create_itt_two_level(struct gicv5_its_chip_data *its,
 					  unsigned int num_events)
 {
 	unsigned int l1_bits, l2_bits, span, events_per_l2_table;
-	unsigned int i, complete_tables, final_span, num_ents;
+	unsigned int complete_tables, final_span, num_ents;
 	__le64 *itt_l1, *itt_l2, **l2ptrs;
-	int ret;
+	int i, ret;
 	u64 val;
 
 	ret = gicv5_its_l2sz_to_l2_bits(itt_l2sz);
Signature · 1 line
2.51.0
author maintainer
#116 lore raw

PATCH 109/563 irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc()

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit a186120c780e21e4cfd186a925e34f718e30de88 ]

Code in gicv5_its_irq_domain_alloc() has two issues:

- it checks the wrong return value/variable when calling gicv5_alloc_lpi()

- The cleanup code does not take previous loop iterations into account

Fix both issues at once by adding the right gicv5_alloc_lpi() variable check and by reworking the function cleanup code to take into account current and previous iterations.

[ lpieralisi: Reworded commit message ]

---
 drivers/irqchip/irq-gic-v5-its.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
drivers/irqchip/irq-gic-v5-its.c +14 -6
index 4701ef62b8b27..2fb58d76f5214 100644
@@ -949,15 +949,18 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
 	device_id = its_dev->device_id;
 
 	for (i = 0; i < nr_irqs; i++) {
-		lpi = gicv5_alloc_lpi();
+		ret = gicv5_alloc_lpi();
 		if (ret < 0) {
 			pr_debug("Failed to find free LPI!\n");
-			goto out_eventid;
+			goto out_free_irqs;
 		}
+		lpi = ret;
 
 		ret = irq_domain_alloc_irqs_parent(domain, virq + i, 1, &lpi);
-		if (ret)
-			goto out_free_lpi;
+		if (ret) {
+			gicv5_free_lpi(lpi);
+			goto out_free_irqs;
+		}
 
 		/*
 		 * Store eventid and deviceid into the hwirq for later use.
@@ -977,8 +980,13 @@ static int gicv5_its_irq_domain_alloc(struct irq_domain *domain, unsigned int vi
 
 	return 0;
 
-out_free_lpi:
-	gicv5_free_lpi(lpi);
+out_free_irqs:
+	while (--i >= 0) {
+		irqd = irq_domain_get_irq_data(domain, virq + i);
+		gicv5_free_lpi(irqd->parent_data->hwirq);
+		irq_domain_reset_irq_data(irqd);
+		irq_domain_free_irqs_parent(domain, virq + i, 1);
+	}
 out_eventid:
 	gicv5_its_free_eventid(its_dev, event_id_base, nr_irqs);
 	return ret;
Signature · 1 line
2.51.0
author maintainer
#117 lore raw

PATCH 110/563 tick: Do not set device to detached state in tick_shutdown()

In reply to Greg Kroah-Hartman

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

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

From: Bibo Mao <[email protected]>

[ Upstream commit fe2a449a45b13df1562419e0104b4777b6ea5248 ]

tick_shutdown() sets the state of the clockevent device to detached first and the invokes clockevents_exchange_device(), which in turn invokes clockevents_switch_state().

But clockevents_switch_state() returns without invoking the device shutdown callback as the device is already in detached state. As a consequence the timer device is not shutdown when a CPU goes offline.

tick_shutdown() does this because it was originally invoked on a online CPU and not on the outgoing CPU. It therefore could not access the clockevent device of the already offlined CPU and just set the state.

Since commit 3b1596a21fbf tick_shutdown() is called on the outgoing CPU, so the hardware device can be accessed.

Remove the state set before calling clockevents_exchange_device(), so that the subsequent clockevents_switch_state() handles the state transition and invokes the shutdown callback of the clockevent device.

[ tglx: Massaged change log ]

Fixes 3b1596a21fbf ("clockevents: Shutdown and unregister current clockevents at CPUHP_AP_TICK_DYING")
---
 kernel/time/clockevents.c   |  2 +-
 kernel/time/tick-common.c   | 16 +++++-----------
 kernel/time/tick-internal.h |  2 +-
 3 files changed, 7 insertions(+), 13 deletions(-)
kernel/time/clockevents.c +1 -1
index f3e831f62906f..a59bc75ab7c5b 100644
@@ -633,7 +633,7 @@ void tick_offline_cpu(unsigned int cpu)
 	raw_spin_lock(&clockevents_lock);
 
 	tick_broadcast_offline(cpu);
-	tick_shutdown(cpu);
+	tick_shutdown();
 
 	/*
 	 * Unregister the clock event devices which were
kernel/time/tick-common.c +5 -11
index 9a3859443c042..7e33d3f2e889b 100644
@@ -411,24 +411,18 @@ int tick_cpu_dying(unsigned int dying_cpu)
 }
 
 /*
- * Shutdown an event device on a given cpu:
+ * Shutdown an event device on the outgoing CPU:
  *
- * This is called on a life CPU, when a CPU is dead. So we cannot
- * access the hardware device itself.
- * We just set the mode and remove it from the lists.
+ * Called by the dying CPU during teardown, with clockevents_lock held
+ * and interrupts disabled.
  */
-void tick_shutdown(unsigned int cpu)
+void tick_shutdown(void)
 {
-	struct tick_device *td = &per_cpu(tick_cpu_device, cpu);
+	struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
 	struct clock_event_device *dev = td->evtdev;
 
 	td->mode = TICKDEV_MODE_PERIODIC;
 	if (dev) {
-		/*
-		 * Prevent that the clock events layer tries to call
-		 * the set mode function!
-		 */
-		clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED);
 		clockevents_exchange_device(dev, NULL);
 		dev->event_handler = clockevents_handle_noop;
 		td->evtdev = NULL;
kernel/time/tick-internal.h +1 -1
index faac36de35b9e..4e4f7bbe2a64b 100644
@@ -26,7 +26,7 @@ extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast);
 extern void tick_handle_periodic(struct clock_event_device *dev);
 extern void tick_check_new_device(struct clock_event_device *dev);
 extern void tick_offline_cpu(unsigned int cpu);
-extern void tick_shutdown(unsigned int cpu);
+extern void tick_shutdown(void);
 extern void tick_suspend(void);
 extern void tick_resume(void);
 extern bool tick_check_replacement(struct clock_event_device *curdev,
Signature · 1 line
2.51.0
author maintainer
#118 lore raw

PATCH 111/563 arm64: dts: mediatek: mt8195: Remove suspend-breaking reset from pcie0

In reply to Greg Kroah-Hartman

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

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

From: Guoqing Jiang <[email protected]>

[ Upstream commit 3374b5fb26b300809ecd6aed9f414987dd17c313 ]

When test suspend resume with 6.8 based kernel, system can't resume and I got below error which can be also reproduced with 6.16 rc6+ kernel.

mtk-pcie-gen3 112f0000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x0) mtk-pcie-gen3 112f0000.pcie: PM: dpm_run_callback(): genpd_resume_noirq returns -110 mtk-pcie-gen3 112f0000.pcie: PM: failed to resume noirq: error -110

After investigation, looks pcie0 has the same problem as pcie1 as decribed in commit 3d7fdd8e38aa ("arm64: dts: mediatek: mt8195:
Remove suspend-breaking reset from pcie1").

---
 arch/arm64/boot/dts/mediatek/mt8195.dtsi | 3 ---
 1 file changed, 3 deletions(-)
arch/arm64/boot/dts/mediatek/mt8195.dtsi +0 -3
index 8877953ce292b..ab0b2f606eb43 100644
@@ -1588,9 +1588,6 @@ pcie0: pcie@112f0000 {
 
 			power-domains = <&spm MT8195_POWER_DOMAIN_PCIE_MAC_P0>;
 
-			resets = <&infracfg_ao MT8195_INFRA_RST2_PCIE_P0_SWRST>;
-			reset-names = "mac";
-
 			#interrupt-cells = <1>;
 			interrupt-map-mask = <0 0 0 7>;
 			interrupt-map = <0 0 0 1 &pcie_intc0 0>,
Signature · 1 line
2.51.0
author maintainer
#119 lore raw

PATCH 112/563 arm64: dts: mediatek: mt8183: Fix out of range pull values

In reply to Greg Kroah-Hartman

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

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

From: Rob Herring (Arm) <[email protected]>

[ Upstream commit 0aeb7ed4bcb244862a35f880053cd64d28c6fb04 ]

A value of 10 is not valid for "mediatek,pull-down-adv" and "mediatek,pull-up-adv" properties which have defined values of 0-3. It appears the "10" was written as a binary value. The driver only looks at the lowest 2 bits, so the value "10" decimal works out the same as if "2" was used.

Fixes cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board")
Fixes 19b6403f1e2a ("arm64: dts: mt8183: add mt8183 pumpkin board")
---
 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi  | 14 +++++++-------
 arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +7 -7
index 400c61d110356..fff93e26eb760 100644
@@ -580,7 +580,7 @@ pins-cmd-dat {
 		pins-clk {
 			pinmux = <PINMUX_GPIO124__FUNC_MSDC0_CLK>;
 			drive-strength = <MTK_DRIVE_14mA>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins-rst {
@@ -609,13 +609,13 @@ pins-cmd-dat {
 		pins-clk {
 			pinmux = <PINMUX_GPIO124__FUNC_MSDC0_CLK>;
 			drive-strength = <MTK_DRIVE_14mA>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins-ds {
 			pinmux = <PINMUX_GPIO131__FUNC_MSDC0_DSL>;
 			drive-strength = <MTK_DRIVE_14mA>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins-rst {
@@ -633,13 +633,13 @@ pins-cmd-dat {
 				 <PINMUX_GPIO33__FUNC_MSDC1_DAT2>,
 				 <PINMUX_GPIO30__FUNC_MSDC1_DAT3>;
 			input-enable;
-			mediatek,pull-up-adv = <10>;
+			mediatek,pull-up-adv = <2>;
 		};
 
 		pins-clk {
 			pinmux = <PINMUX_GPIO29__FUNC_MSDC1_CLK>;
 			input-enable;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 	};
 
@@ -652,13 +652,13 @@ pins-cmd-dat {
 				 <PINMUX_GPIO30__FUNC_MSDC1_DAT3>;
 			drive-strength = <6>;
 			input-enable;
-			mediatek,pull-up-adv = <10>;
+			mediatek,pull-up-adv = <2>;
 		};
 
 		pins-clk {
 			pinmux = <PINMUX_GPIO29__FUNC_MSDC1_CLK>;
 			drive-strength = <8>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 			input-enable;
 		};
 	};
arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts +7 -7
index dbdee604edab4..7c3010889ae73 100644
@@ -324,7 +324,7 @@ pins_cmd_dat {
 		pins_clk {
 			pinmux = <PINMUX_GPIO124__FUNC_MSDC0_CLK>;
 			drive-strength = <MTK_DRIVE_14mA>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins_rst {
@@ -353,13 +353,13 @@ pins_cmd_dat {
 		pins_clk {
 			pinmux = <PINMUX_GPIO124__FUNC_MSDC0_CLK>;
 			drive-strength = <MTK_DRIVE_14mA>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins_ds {
 			pinmux = <PINMUX_GPIO131__FUNC_MSDC0_DSL>;
 			drive-strength = <MTK_DRIVE_14mA>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins_rst {
@@ -377,13 +377,13 @@ pins_cmd_dat {
 				 <PINMUX_GPIO33__FUNC_MSDC1_DAT2>,
 				 <PINMUX_GPIO30__FUNC_MSDC1_DAT3>;
 			input-enable;
-			mediatek,pull-up-adv = <10>;
+			mediatek,pull-up-adv = <2>;
 		};
 
 		pins_clk {
 			pinmux = <PINMUX_GPIO29__FUNC_MSDC1_CLK>;
 			input-enable;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 		};
 
 		pins_pmu {
@@ -401,13 +401,13 @@ pins_cmd_dat {
 				 <PINMUX_GPIO30__FUNC_MSDC1_DAT3>;
 			drive-strength = <6>;
 			input-enable;
-			mediatek,pull-up-adv = <10>;
+			mediatek,pull-up-adv = <2>;
 		};
 
 		pins_clk {
 			pinmux = <PINMUX_GPIO29__FUNC_MSDC1_CLK>;
 			drive-strength = <8>;
-			mediatek,pull-down-adv = <10>;
+			mediatek,pull-down-adv = <2>;
 			input-enable;
 		};
 	};
Signature · 1 line
2.51.0
author maintainer
#120 lore raw

PATCH 113/563 nbd: restrict sockets to TCP and UDP

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit 9f7c02e031570e8291a63162c6c046dc15ff85b0 ]

Recently, syzbot started to abuse NBD with all kinds of sockets.

Commit cf1b2326b734 ("nbd: verify socket is supported during setup") made sure the socket supported a shutdown() method.

Explicitely accept TCP and UNIX stream sockets.

---
 drivers/block/nbd.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/block/nbd.c +8 -0
index 6463d0e8d0cef..87b0b78249da3 100644
@@ -1217,6 +1217,14 @@ static struct socket *nbd_get_socket(struct nbd_device *nbd, unsigned long fd,
 	if (!sock)
 		return NULL;
 
+	if (!sk_is_tcp(sock->sk) &&
+	    !sk_is_stream_unix(sock->sk)) {
+		dev_err(disk_to_dev(nbd->disk), "Unsupported socket: should be TCP or UNIX.\n");
+		*err = -EINVAL;
+		sockfd_put(sock);
+		return NULL;
+	}
+
 	if (sock->ops->shutdown == sock_no_shutdown) {
 		dev_err(disk_to_dev(nbd->disk), "Unsupported socket: shutdown callout must be supported.\n");
 		*err = -EINVAL;
Signature · 1 line
2.51.0
author maintainer
#121 lore raw

PATCH 114/563 PM / devfreq: rockchip-dfi: double count on RK3588

In reply to Greg Kroah-Hartman

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

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

From: Nicolas Frattaroli <[email protected]>

[ Upstream commit f89c7fb83ae95578e355bed1a7aeea5f3ca5a067 ]

On RK3588 with LPDDR4X memory, the cycle count as returned by

perf stat -a -e rockchip_ddr/cycles/ sleep 1

consistently reads half as much as what the actual DDR frequency is at. For a LPDDR4X module running at 2112MHz, I get more like 1056059916 cycles per second, which is almost bang-on half what it should be. No, I'm not mixing up megatransfers and megahertz.

Consulting the downstream driver, this appears to be because the RK3588 hardware specifically (and RK3528 as well, for future reference) needs a multiplier of 2 to get to the correct frequency with everything but LPDDR5.

The RK3588's actual memory bandwidth measurements in MB/s are correct however, as confirmed with stress-ng --stream. This makes me think the access counters are not affected in the same way. This tracks with the vendor kernel not multiplying the access counts either.

Solve this by adding a new member to the dfi struct, which each SoC can set to whatever they want, but defaults to 1 if left unset by the SoC init functions. The event_get_count op can then use this multiplier if the cycle count is requested.

The cycle multiplier is not used in rockchip_dfi_get_event because the vendor driver doesn't use it there either, and we don't do other actual bandwidth unit conversion stuff in there anyway.

Fixes 481d97ba61e1 ("PM / devfreq: rockchip-dfi: add support for RK3588")
---
 drivers/devfreq/event/rockchip-dfi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/devfreq/event/rockchip-dfi.c +6 -1
index 0470d7c175f4f..54effb6351965 100644
@@ -116,6 +116,7 @@ struct rockchip_dfi {
 	int buswidth[DMC_MAX_CHANNELS];
 	int ddrmon_stride;
 	bool ddrmon_ctrl_single;
+	unsigned int count_multiplier;	/* number of data clocks per count */
 };
 
 static int rockchip_dfi_enable(struct rockchip_dfi *dfi)
@@ -435,7 +436,7 @@ static u64 rockchip_ddr_perf_event_get_count(struct perf_event *event)
 
 	switch (event->attr.config) {
 	case PERF_EVENT_CYCLES:
-		count = total.c[0].clock_cycles;
+		count = total.c[0].clock_cycles * dfi->count_multiplier;
 		break;
 	case PERF_EVENT_READ_BYTES:
 		for (i = 0; i < dfi->max_channels; i++)
@@ -655,6 +656,9 @@ static int rockchip_ddr_perf_init(struct rockchip_dfi *dfi)
 		break;
 	}
 
+	if (!dfi->count_multiplier)
+		dfi->count_multiplier = 1;
+
 	ret = perf_pmu_register(pmu, "rockchip_ddr", -1);
 	if (ret)
 		return ret;
@@ -751,6 +755,7 @@ static int rk3588_dfi_init(struct rockchip_dfi *dfi)
 	dfi->max_channels = 4;
 
 	dfi->ddrmon_stride = 0x4000;
+	dfi->count_multiplier = 2;
 
 	return 0;
 };
Signature · 1 line
2.51.0
author maintainer
#122 lore raw

PATCH 115/563 firmware: firmware: meson-sm: fix compile-test default

In reply to Greg Kroah-Hartman

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

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

From: Johan Hovold <[email protected]>

[ Upstream commit 0454346d1c5f7fccb3ef6e3103985de8ab3469f3 ]

Enabling compile testing should not enable every individual driver (we have "allyesconfig" for that).

---
 drivers/firmware/meson/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/meson/Kconfig +1 -1
index f2fdd37566482..179f5d46d8ddf 100644
@@ -5,7 +5,7 @@
 config MESON_SM
 	tristate "Amlogic Secure Monitor driver"
 	depends on ARCH_MESON || COMPILE_TEST
-	default y
+	default ARCH_MESON
 	depends on ARM64_4K_PAGES
 	help
 	  Say y here to enable the Amlogic secure monitor driver
Signature · 1 line
2.51.0
author maintainer
#123 lore raw

PATCH 116/563 dts: arm: amlogic: fix pwm node for c3

In reply to Greg Kroah-Hartman

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

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

From: Xianwei Zhao <[email protected]>

[ Upstream commit f8c9fabf2f3d87773613734a8479d0ef9b662b11 ]

Fix reg address for c3 pwm node.

---
 arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi +1 -1
index cb9ea3ca6ee0f..71b2b3b547f7c 100644
@@ -792,7 +792,7 @@ spicc1: spi@52000 {
 			pwm_mn: pwm@54000 {
 				compatible = "amlogic,c3-pwm",
 					     "amlogic,meson-s4-pwm";
-				reg = <0x0 54000 0x0 0x24>;
+				reg = <0x0 0x54000 0x0 0x24>;
 				clocks = <&clkc_periphs CLKID_PWM_M>,
 					 <&clkc_periphs CLKID_PWM_N>;
 				#pwm-cells = <3>;
Signature · 1 line
2.51.0
author maintainer
#124 lore raw

PATCH 117/563 soc: mediatek: mtk-svs: fix device leaks on mt8183 probe failure

In reply to Greg Kroah-Hartman

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

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

From: Johan Hovold <[email protected]>

[ Upstream commit 6ab4f79ea92324f7f2eb22692054a34bbba7cf35 ]

Make sure to drop the references taken by of_find_device_by_node() when looking up the thermal sensor and opp devices during probe on probe failure (e.g. probe deferral) and on driver unbind.

---
 drivers/soc/mediatek/mtk-svs.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/soc/mediatek/mtk-svs.c +15 -0
index 7c349a94b45c0..48804e1e5a6c8 100644
@@ -2165,6 +2165,13 @@ static struct device *svs_add_device_link(struct svs_platform *svsp,
 	return dev;
 }
 
+static void svs_put_device(void *_dev)
+{
+	struct device *dev = _dev;
+
+	put_device(dev);
+}
+
 static int svs_mt8192_platform_probe(struct svs_platform *svsp)
 {
 	struct device *dev;
@@ -2216,11 +2223,13 @@ static int svs_mt8183_platform_probe(struct svs_platform *svsp)
 {
 	struct device *dev;
 	u32 idx;
+	int ret;
 
 	dev = svs_add_device_link(svsp, "thermal-sensor");
 	if (IS_ERR(dev))
 		return dev_err_probe(svsp->dev, PTR_ERR(dev),
 				     "failed to get thermal device\n");
+	put_device(dev);
 
 	for (idx = 0; idx < svsp->bank_max; idx++) {
 		struct svs_bank *svsb = &svsp->banks[idx];
@@ -2230,6 +2239,7 @@ static int svs_mt8183_platform_probe(struct svs_platform *svsp)
 		case SVSB_SWID_CPU_LITTLE:
 		case SVSB_SWID_CPU_BIG:
 			svsb->opp_dev = get_cpu_device(bdata->cpu_id);
+			get_device(svsb->opp_dev);
 			break;
 		case SVSB_SWID_CCI:
 			svsb->opp_dev = svs_add_device_link(svsp, "cci");
@@ -2246,6 +2256,11 @@ static int svs_mt8183_platform_probe(struct svs_platform *svsp)
 			return dev_err_probe(svsp->dev, PTR_ERR(svsb->opp_dev),
 					     "failed to get OPP device for bank %d\n",
 					     idx);
+
+		ret = devm_add_action_or_reset(svsp->dev, svs_put_device,
+					       svsb->opp_dev);
+		if (ret)
+			return ret;
 	}
 
 	return 0;
Signature · 1 line
2.51.0
author maintainer
#125 lore raw

PATCH 118/563 soc: mediatek: mtk-svs: fix device leaks on mt8192 probe failure

In reply to Greg Kroah-Hartman

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

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

From: Johan Hovold <[email protected]>

[ Upstream commit f1a68ba5739e42353609438e27a83b08d7f5cfd6 ]

Make sure to drop the references taken by of_find_device_by_node() when looking up the thermal sensor and opp devices during probe on probe failure (e.g. probe deferral) and on driver unbind.

---
 drivers/soc/mediatek/mtk-svs.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/soc/mediatek/mtk-svs.c +8 -0
index 48804e1e5a6c8..f45537546553e 100644
@@ -2176,6 +2176,7 @@ static int svs_mt8192_platform_probe(struct svs_platform *svsp)
 {
 	struct device *dev;
 	u32 idx;
+	int ret;
 
 	svsp->rst = devm_reset_control_get_optional(svsp->dev, "svs_rst");
 	if (IS_ERR(svsp->rst))
@@ -2186,6 +2187,7 @@ static int svs_mt8192_platform_probe(struct svs_platform *svsp)
 	if (IS_ERR(dev))
 		return dev_err_probe(svsp->dev, PTR_ERR(dev),
 				     "failed to get lvts device\n");
+	put_device(dev);
 
 	for (idx = 0; idx < svsp->bank_max; idx++) {
 		struct svs_bank *svsb = &svsp->banks[idx];
@@ -2195,6 +2197,7 @@ static int svs_mt8192_platform_probe(struct svs_platform *svsp)
 		case SVSB_SWID_CPU_LITTLE:
 		case SVSB_SWID_CPU_BIG:
 			svsb->opp_dev = get_cpu_device(bdata->cpu_id);
+			get_device(svsb->opp_dev);
 			break;
 		case SVSB_SWID_CCI:
 			svsb->opp_dev = svs_add_device_link(svsp, "cci");
@@ -2214,6 +2217,11 @@ static int svs_mt8192_platform_probe(struct svs_platform *svsp)
 			return dev_err_probe(svsp->dev, PTR_ERR(svsb->opp_dev),
 					     "failed to get OPP device for bank %d\n",
 					     idx);
+
+		ret = devm_add_action_or_reset(svsp->dev, svs_put_device,
+					       svsb->opp_dev);
+		if (ret)
+			return ret;
 	}
 
 	return 0;
Signature · 1 line
2.51.0
author maintainer
#126 lore raw

PATCH 119/563 cpuidle: qcom-spm: fix device and OF node leaks at probe

In reply to Greg Kroah-Hartman

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

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

From: Johan Hovold <[email protected]>

[ Upstream commit cdc06f912670c8c199d5fa9e78b64b7ed8e871d0 ]

Make sure to drop the reference to the saw device taken by of_find_device_by_node() after retrieving its driver data during probe().

Also drop the reference to the CPU node sooner to avoid leaking it in case there is no saw node or device.

Fixes 60f3692b5f0b ("cpuidle: qcom_spm: Detach state machine from main SPM handling")
---
 drivers/cpuidle/cpuidle-qcom-spm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/cpuidle/cpuidle-qcom-spm.c +5 -2
index 5f386761b1562..f60a4cf536423 100644
@@ -96,20 +96,23 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENODEV;
 
 	saw_node = of_parse_phandle(cpu_node, "qcom,saw", 0);
+	of_node_put(cpu_node);
 	if (!saw_node)
 		return -ENODEV;
 
 	pdev = of_find_device_by_node(saw_node);
 	of_node_put(saw_node);
-	of_node_put(cpu_node);
 	if (!pdev)
 		return -ENODEV;
 
 	data = devm_kzalloc(cpuidle_dev, sizeof(*data), GFP_KERNEL);
-	if (!data)
+	if (!data) {
+		put_device(&pdev->dev);
 		return -ENOMEM;
+	}
 
 	data->spm = dev_get_drvdata(&pdev->dev);
+	put_device(&pdev->dev);
 	if (!data->spm)
 		return -EINVAL;
 
Signature · 1 line
2.51.0
author maintainer
#127 lore raw

PATCH 120/563 block: cleanup bio_issue

In reply to Greg Kroah-Hartman

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

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

From: Yu Kuai <[email protected]>

[ Upstream commit 1733e88874838ddebf7774440c285700865e6b08 ]

Now that bio->bi_issue is only used by blk-iolatency to get bio issue time, replace bio_issue with u64 time directly and remove bio_issue to make code cleaner.

Stable-dep-of: 1f963bdd6420 ("block: initialize bio issue time in blk_mq_submit_bio()")

---
 block/bio.c               |  2 +-
 block/blk-cgroup.h        |  2 +-
 block/blk-iolatency.c     | 14 +++----------
 block/blk.h               | 42 ---------------------------------------
 include/linux/blk_types.h |  7 ++-----
 5 files changed, 7 insertions(+), 60 deletions(-)
block/bio.c +1 -1
index 3b371a5da159e..1904683f7ab05 100644
@@ -261,7 +261,7 @@ void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table,
 	bio->bi_private = NULL;
 #ifdef CONFIG_BLK_CGROUP
 	bio->bi_blkg = NULL;
-	bio->bi_issue.value = 0;
+	bio->issue_time_ns = 0;
 	if (bdev)
 		bio_associate_blkg(bio);
 #ifdef CONFIG_BLK_CGROUP_IOCOST
block/blk-cgroup.h +1 -1
index 83367086cb6ae..8328427e31657 100644
@@ -372,7 +372,7 @@ static inline void blkg_put(struct blkcg_gq *blkg)
 
 static inline void blkcg_bio_issue_init(struct bio *bio)
 {
-	bio_issue_init(&bio->bi_issue, bio_sectors(bio));
+	bio->issue_time_ns = blk_time_get_ns();
 }
 
 static inline void blkcg_use_delay(struct blkcg_gq *blkg)
block/blk-iolatency.c +3 -11
index 2f8fdecdd7a9b..554b191a68921 100644
@@ -485,19 +485,11 @@ static void blkcg_iolatency_throttle(struct rq_qos *rqos, struct bio *bio)
 		mod_timer(&blkiolat->timer, jiffies + HZ);
 }
 
-static void iolatency_record_time(struct iolatency_grp *iolat,
-				  struct bio_issue *issue, u64 now,
-				  bool issue_as_root)
+static void iolatency_record_time(struct iolatency_grp *iolat, u64 start,
+				  u64 now, bool issue_as_root)
 {
-	u64 start = bio_issue_time(issue);
 	u64 req_time;
 
-	/*
-	 * Have to do this so we are truncated to the correct time that our
-	 * issue is truncated to.
-	 */
-	now = __bio_issue_time(now);
-
 	if (now <= start)
 		return;
 
@@ -625,7 +617,7 @@ static void blkcg_iolatency_done_bio(struct rq_qos *rqos, struct bio *bio)
 		 * submitted, so do not account for it.
 		 */
 		if (iolat->min_lat_nsec && bio->bi_status != BLK_STS_AGAIN) {
-			iolatency_record_time(iolat, &bio->bi_issue, now,
+			iolatency_record_time(iolat, bio->issue_time_ns, now,
 					      issue_as_root);
 			window_start = atomic64_read(&iolat->window_start);
 			if (now > window_start &&
block/blk.h +0 -42

48 lines not on this page · raw message

include/linux/blk_types.h +2 -5
index 09b99d52fd365..f78145be77df5 100644
@@ -198,10 +198,6 @@ static inline bool blk_path_error(blk_status_t error)
 	return true;
 }
 
-struct bio_issue {
-	u64 value;
-};
-
 typedef __u32 __bitwise blk_opf_t;
 
 typedef unsigned int blk_qc_t;
@@ -242,7 +238,8 @@ struct bio {
 	 * on release of the bio.
 	 */
 	struct blkcg_gq		*bi_blkg;
-	struct bio_issue	bi_issue;
+	/* Time that this bio was issued. */
+	u64			issue_time_ns;
 #ifdef CONFIG_BLK_CGROUP_IOCOST
 	u64			bi_iocost_cost;
 #endif
Signature · 1 line
2.51.0
author maintainer
#128 lore raw

PATCH 121/563 block: initialize bio issue time in blk_mq_submit_bio()

In reply to Greg Kroah-Hartman

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

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

From: Yu Kuai <[email protected]>

[ Upstream commit 1f963bdd6420b6080bcfd0ee84a75c96f35545a6 ]

bio->issue_time_ns is only used by blk-iolatency, which can only be enabled for rq-based disk, hence it's not necessary to initialize the time for bio-based disk.

Meanwhile, if bio is split by blk_crypto_fallback_split_bio_if_needed(), the issue time is not initialized for new split bio, this can be fixed as well.

Noted the next patch will optimize better that bio issue time will only be used when blk-iolatency is really enabled by the disk.

Fixes 488f6682c832 ("block: blk-crypto-fallback for Inline Encryption")
---
 block/blk-cgroup.h | 6 ------
 block/blk-core.c   | 1 -
 block/blk-merge.c  | 1 -
 block/blk-mq.c     | 8 ++++++++
 4 files changed, 8 insertions(+), 8 deletions(-)
block/blk-cgroup.h +0 -6
index 8328427e31657..1cce3294634d1 100644
@@ -370,11 +370,6 @@ static inline void blkg_put(struct blkcg_gq *blkg)
 		if (((d_blkg) = blkg_lookup(css_to_blkcg(pos_css),	\
 					    (p_blkg)->q)))
 
-static inline void blkcg_bio_issue_init(struct bio *bio)
-{
-	bio->issue_time_ns = blk_time_get_ns();
-}
-
 static inline void blkcg_use_delay(struct blkcg_gq *blkg)
 {
 	if (WARN_ON_ONCE(atomic_read(&blkg->use_delay) < 0))
@@ -497,7 +492,6 @@ static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg,
 static inline struct blkcg_gq *pd_to_blkg(struct blkg_policy_data *pd) { return NULL; }
 static inline void blkg_get(struct blkcg_gq *blkg) { }
 static inline void blkg_put(struct blkcg_gq *blkg) { }
-static inline void blkcg_bio_issue_init(struct bio *bio) { }
 static inline void blk_cgroup_bio_start(struct bio *bio) { }
 static inline bool blk_cgroup_mergeable(struct request *rq, struct bio *bio) { return true; }
 
block/blk-core.c +0 -1
index a27185cd8edea..e5af6eda5a459 100644
@@ -730,7 +730,6 @@ static void __submit_bio_noacct_mq(struct bio *bio)
 void submit_bio_noacct_nocheck(struct bio *bio)
 {
 	blk_cgroup_bio_start(bio);
-	blkcg_bio_issue_init(bio);
 
 	if (!bio_flagged(bio, BIO_TRACE_COMPLETION)) {
 		trace_block_bio_queue(bio);
block/blk-merge.c +0 -1
index 70d704615be52..5538356770a47 100644
@@ -119,7 +119,6 @@ static struct bio *bio_submit_split(struct bio *bio, int split_sectors)
 			goto error;
 		}
 		split->bi_opf |= REQ_NOMERGE;
-		blkcg_bio_issue_init(split);
 		bio_chain(split, bio);
 		trace_block_split(split, bio->bi_iter.bi_sector);
 		WARN_ON_ONCE(bio_zone_write_plugging(bio));
block/blk-mq.c +8 -0
index 9055cd6247004..19b50110376c6 100644
@@ -396,6 +396,13 @@ static inline void blk_mq_rq_time_init(struct request *rq, u64 alloc_time_ns)
 #endif
 }
 
+static inline void blk_mq_bio_issue_init(struct bio *bio)
+{
+#ifdef CONFIG_BLK_CGROUP
+	bio->issue_time_ns = blk_time_get_ns();
+#endif
+}
+
 static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
 		struct blk_mq_tags *tags, unsigned int tag)
 {
@@ -3168,6 +3175,7 @@ void blk_mq_submit_bio(struct bio *bio)
 	if (!bio_integrity_prep(bio))
 		goto queue_exit;
 
+	blk_mq_bio_issue_init(bio);
 	if (blk_mq_attempt_bio_merge(q, bio, nr_segs))
 		goto queue_exit;
 
Signature · 1 line
2.51.0
author maintainer
#129 lore raw

PATCH 122/563 block: factor out a helper bio_submit_split_bioset()

In reply to Greg Kroah-Hartman

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

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

From: Yu Kuai <[email protected]>

[ Upstream commit e37b5596a19be9a150cb194ec32e78f295a3574b ]

No functional changes are intended, some drivers like mdraid will split bio by internal processing, prepare to unify bio split codes.

Stable-dep-of: b2f5974079d8 ("block: fix ordering of recursive split IO")

---
 block/blk-merge.c      | 59 ++++++++++++++++++++++++++++--------------
 include/linux/blkdev.h |  2 ++
 2 files changed, 42 insertions(+), 19 deletions(-)
block/blk-merge.c +40 -19
index 5538356770a47..51fe4ed5b7c0b 100644
@@ -104,33 +104,54 @@ static unsigned int bio_allowed_max_sectors(const struct queue_limits *lim)
 	return round_down(UINT_MAX, lim->logical_block_size) >> SECTOR_SHIFT;
 }
 
+/*
+ * bio_submit_split_bioset - Submit a bio, splitting it at a designated sector
+ * @bio:		the original bio to be submitted and split
+ * @split_sectors:	the sector count at which to split
+ * @bs:			the bio set used for allocating the new split bio
+ *
+ * The original bio is modified to contain the remaining sectors and submitted.
+ * The caller is responsible for submitting the returned bio.
+ *
+ * If succeed, the newly allocated bio representing the initial part will be
+ * returned, on failure NULL will be returned and original bio will fail.
+ */
+struct bio *bio_submit_split_bioset(struct bio *bio, unsigned int split_sectors,
+				    struct bio_set *bs)
+{
+	struct bio *split = bio_split(bio, split_sectors, GFP_NOIO, bs);
+
+	if (IS_ERR(split)) {
+		bio->bi_status = errno_to_blk_status(PTR_ERR(split));
+		bio_endio(bio);
+		return NULL;
+	}
+
+	bio_chain(split, bio);
+	trace_block_split(split, bio->bi_iter.bi_sector);
+	WARN_ON_ONCE(bio_zone_write_plugging(bio));
+	submit_bio_noacct(bio);
+
+	return split;
+}
+EXPORT_SYMBOL_GPL(bio_submit_split_bioset);
+
 static struct bio *bio_submit_split(struct bio *bio, int split_sectors)
 {
-	if (unlikely(split_sectors < 0))
-		goto error;
+	if (unlikely(split_sectors < 0)) {
+		bio->bi_status = errno_to_blk_status(split_sectors);
+		bio_endio(bio);
+		return NULL;
+	}
 
 	if (split_sectors) {
-		struct bio *split;
-
-		split = bio_split(bio, split_sectors, GFP_NOIO,
+		bio = bio_submit_split_bioset(bio, split_sectors,
 				&bio->bi_bdev->bd_disk->bio_split);
-		if (IS_ERR(split)) {
-			split_sectors = PTR_ERR(split);
-			goto error;
-		}
-		split->bi_opf |= REQ_NOMERGE;
-		bio_chain(split, bio);
-		trace_block_split(split, bio->bi_iter.bi_sector);
-		WARN_ON_ONCE(bio_zone_write_plugging(bio));
-		submit_bio_noacct(bio);
-		return split;
+		if (bio)
+			bio->bi_opf |= REQ_NOMERGE;
 	}
 
 	return bio;
-error:
-	bio->bi_status = errno_to_blk_status(split_sectors);
-	bio_endio(bio);
-	return NULL;
 }
 
 struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
include/linux/blkdev.h +2 -0
index fe1797bbec420..cc221318712e7 100644
@@ -999,6 +999,8 @@ extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
 void submit_bio_noacct(struct bio *bio);
 struct bio *bio_split_to_limits(struct bio *bio);
+struct bio *bio_submit_split_bioset(struct bio *bio, unsigned int split_sectors,
+				    struct bio_set *bs);
 
 extern int blk_lld_busy(struct request_queue *q);
 extern int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags);
Signature · 1 line
2.51.0