Skip to contentSkip to conversation

6.13.2-rc1 review

PATCH In review Greg Kroah-Hartman 16 participants 645 messages Feb 5, 2025 – Aug 12, 2025 Page 1 of 5

Subsystems (6)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 6.13.2-rc1 review

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

Responses should be made by Fri, 07 Feb 2025 13:42:57 +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.13.2-rc1.gz

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

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 6.13.2-rc1

Qu Wenruo <[email protected]>
btrfs: do proper folio cleanup when run_delalloc_nocow() failed

Qu Wenruo <[email protected]>
btrfs: do proper folio cleanup when cow_file_range() failed

Tiezhu Yang <[email protected]>

    LoongArch: Change 8 to 14 for LOONGARCH_MAX_{BRP,WRP}

Uwe Kleine-König <[email protected]>
pwm: Ensure callbacks exist before calling them

Chen Ridong <[email protected]>
memcg: fix soft lockup in the OOM process

Sean Christopherson <[email protected]>
KVM: x86: Plumb in the vCPU to kvm_x86_ops.hwapic_isr_update()

Aric Cyr <[email protected]>
drm/amd/display: Add hubp cache reset when powergating

Nathan Chancellor <[email protected]>
s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS

Claudiu Beznea <[email protected]>
ASoC: da7213: Initialize the mutex

Kevin Brodsky <[email protected]>
selftests/mm: build with -O2

Qu Wenruo <[email protected]>
btrfs: output the reason for open_ctree() failure

Yu Kuai <[email protected]>
md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime

Shivaprasad G Bhat <[email protected]>
powerpc/pseries/iommu: Don't unset window if it was never set

Dan Carpenter <[email protected]>
media: imx-jpeg: Fix potential error pointer dereference in detach_pm()

Laurentiu Palcu <[email protected]>
staging: media: max96712: fix kernel oops when removing module

Melissa Wen <[email protected]>
drm/amd/display: restore invalid MSA timing check for freesync

Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Don't free command immediately

Calvin Owens <[email protected]>
pps: Fix a use-after-free

Laurent Pinchart <[email protected]>
media: uvcvideo: Fix double free in error path

Arnaud Pouliquen <[email protected]>
remoteproc: core: Fix ida_free call while not allocated

Patrisious Haddad <[email protected]>
RDMA/mlx5: Fix implicit ODP use after free

Matthieu Baerts (NGI0) <[email protected]>
mptcp: blackhole only if 1st SYN retrans w/o MPC is accepted

Paolo Abeni <[email protected]>
mptcp: handle fastopen disconnect correctly

Matthieu Baerts (NGI0) <[email protected]>
mptcp: pm: only set fullmesh for subflow endp

Paolo Abeni <[email protected]>
mptcp: consolidate suboption status

Abel Vesa <[email protected]>
clk: qcom: gcc-x1e80100: Do not turn off usb_2 controller GDSC

Kyle Tso <[email protected]>
usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS

Jos Wang <[email protected]>
usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE

Ray Chi <[email protected]>
usb: dwc3: Skip resume if pm_runtime_set_active() fails

Kyle Tso <[email protected]>
usb: dwc3: core: Defer the probe until USB power supply ready

Joe Hattori <[email protected]>
usb: dwc3-am62: Fix an OF node leak in phy_syscon_pll_refclk()

Thinh Nguyen <[email protected]>
usb: gadget: f_tcm: Fix Get/SetInterface return value

Sean Rhodes <[email protected]>
drivers/card_reader/rtsx_usb: Restore interrupt based detection

Michal Pecio <[email protected]>
usb: xhci: Fix NULL pointer dereference on certain command aborts

Nikita Zhandarovich <[email protected]>
net: usb: rtl8150: enable basic endpoint checking

Lianqin Hu <[email protected]>
ALSA: usb-audio: Add delay quirk for iBasso DC07 Pro

Darrick J. Wong <[email protected]>
xfs: don't shut down the filesystem for media failures beyond end of log

Darrick J. Wong <[email protected]>
xfs: release the dquot buf outside of qli_lock

Darrick J. Wong <[email protected]>
xfs: don't over-report free space or inodes in statvfs

Long Li <[email protected]>
xfs: fix mount hang during primary superblock recovery failure

Christoph Hellwig <[email protected]>
xfs: check for dead buffers in xfs_buf_find_insert

Ricardo B. Marliere <[email protected]>
ktest.pl: Check kernelrelease return in get_version

Masami Hiramatsu (Google) <[email protected]>
selftests/ftrace: Fix to use remount when testing mount GID option

Mathieu Desnoyers <[email protected]>
selftests/rseq: Fix handling of glibc without rseq support

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: reject mismatching sum of field_len with set key length

Chuck Lever <[email protected]>
Revert "SUNRPC: Reduce thread wake-up rate when receiving large RPC messages"

Yu Kuai <[email protected]>
md/md-bitmap: move bitmap_{start, end}write to md upper layer

Yu Kuai <[email protected]>

    md/raid5: implement pers->bitmap_sector()

Yu Kuai <[email protected]>

    md: add a new callback pers->bitmap_sector()

Yu Kuai <[email protected]>

    md/md-bitmap: remove the last parameter for bimtap_ops->endwrite()

Yu Kuai <[email protected]>
md/md-bitmap: factor behind write counters out from bitmap_{start/end}write()

Daniel Lee <[email protected]>
f2fs: Introduce linear search for dentries

Liam R. Howlett <[email protected]>
kernel: be more careful about dup_mmap() failures and uprobe registering

Masahiro Yamada <[email protected]>
kbuild: fix Clang LTO with CONFIG_OBJTOOL=n

Lin Yujun <[email protected]>
hexagon: Fix unbalanced spinlock in die()

Willem de Bruijn <[email protected]>
hexagon: fix using plain integer as NULL pointer warning in cmpxchg

Masahiro Yamada <[email protected]>
kconfig: fix memory leak in sym_warn_unmet_dep()

Masahiro Yamada <[email protected]>
kconfig: fix file name in warnings when loading KCONFIG_DEFCONFIG_LIST

Pali Rohár <[email protected]>
cifs: Fix getting and setting SACLs over SMB1

Pali Rohár <[email protected]>
cifs: Validate EAs for WSL reparse points

Len Brown <[email protected]>
tools/power turbostat: Fix forked child affinity regression

Daniel Baluta <[email protected]>
ASoC: amd: acp: Fix possible deadlock

Jens Axboe <[email protected]>
io_uring/register: use atomic_read/write for sq_flags migration

Jens Axboe <[email protected]>
io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock()

Jens Axboe <[email protected]>

    io_uring/msg_ring: don't leave potentially dangling ->tctx pointer

Detlev Casanova <[email protected]>
ASoC: rockchip: i2s_tdm: Re-add the set_sysclk callback

Palmer Dabbelt <[email protected]>
RISC-V: Mark riscv_v_init() as __init

Torsten Hilbrich <[email protected]>
kbuild: Fix signing issue for external modules

Patryk Wlazlyn <[email protected]>
tools/power turbostat: Fix PMT mmaped file size rounding

Al Viro <[email protected]>
hostfs: fix string handling in __dentry_name()

Masahiro Yamada <[email protected]>
genksyms: fix memory leak when the same symbol is read from *.symref file

Masahiro Yamada <[email protected]>
genksyms: fix memory leak when the same symbol is added from source

Eric Dumazet <[email protected]>
net: hsr: fix fill_frame_info() regression vs VLAN packets

Kory Maincent <[email protected]>
net: sh_eth: Fix missing rtnl lock in suspend/resume path

Kory Maincent <[email protected]>
net: ravb: Fix missing rtnl lock in suspend/resume path

Toke Høiland-Jørgensen <[email protected]>
net: xdp: Disallow attaching device-bound programs in generic mode

Jon Maloy <[email protected]>
tcp: correct handling of extreme memory squeeze

Rafał Miłecki <[email protected]>
bgmac: reduce max frame size to support just MTU 1500

Michal Luczaj <[email protected]>
vsock: Allow retrying on connect() failure

Michal Luczaj <[email protected]>
vsock: Keep the binding until socket destruction

Neeraj Sanjay Kale <[email protected]>
Bluetooth: btnxpuart: Fix glitches seen in dual A2DP streaming

Douglas Anderson <[email protected]>
Bluetooth: btusb: mediatek: Add locks for usb_driver_claim_interface()

Rafael J. Wysocki <[email protected]>
PM: sleep: core: Synchronize runtime PM status of parents and children

Namhyung Kim <[email protected]>
perf test: Skip syscall enum test if no landlock syscall

Howard Chu <[email protected]>
perf trace: Fix runtime error of index out of bounds

Heiko Carstens <[email protected]>
s390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init()

Cosmin Ratiu <[email protected]>
bonding: Correctly support GSO ESP offload

Kunihiko Hayashi <[email protected]>
net: stmmac: Limit FIFO size by hardware capability

Kunihiko Hayashi <[email protected]>
net: stmmac: Limit the number of MTL queues to hardware capability

Gal Pressman <[email protected]>
ethtool: Fix set RXNFC command with symmetric RSS hash

Thomas Weißschuh <[email protected]>
ptp: Properly handle compat ioctls

Ian Rogers <[email protected]>
perf annotate: Use an array for the disassembler preference

Chenyuan Yang <[email protected]>
net: davicom: fix UAF in dm9000_drv_remove

Shigeru Yoshida <[email protected]>
vxlan: Fix uninit-value in vxlan_vnifilter_dump()

David Howells <[email protected]>
rxrpc, afs: Fix peer hash locking vs RCU callback

Jan Stancek <[email protected]>
selftests: net/{lib,openvswitch}: extend CFLAGS to keep options from environment

Jan Stancek <[email protected]>
selftests: mptcp: extend CFLAGS to keep options from environment

Jakub Kicinski <[email protected]>
net: page_pool: don't try to stash the napi id

Jakub Kicinski <[email protected]>
tools: ynl: c: correct reverse decode of empty attrs

Stanislav Fomichev <[email protected]>
net/mlx5e: add missing cpu_to_node to kvzalloc_node in mlx5e_open_xdpredirect_sq

Jakub Kicinski <[email protected]>
net: netdevsim: try to close UDP port harness races

Eric Dumazet <[email protected]>
net: rose: fix timer races against user threads

Paul Fertser <[email protected]>
net/ncsi: use dev_set_mac_address() for Get MC MAC Address handling

Vasily Gorbik <[email protected]>
s390/mm: Allow large pages for KASAN shadow mapping

Michal Swiatkowski <[email protected]>
iavf: allow changing VLAN state without calling PF

Mateusz Polchlopek <[email protected]>
ice: remove invalid parameter of equalizer

Przemek Kitszel <[email protected]>
ice: fix ice_parser_rt::bst_key array size

Marco Leogrande <[email protected]>
idpf: convert workqueues to unbound

Manoj Vishwanathan <[email protected]>

    idpf: Acquire the lock before accessing the xn->salt

Emil Tantilov <[email protected]>
idpf: fix transaction timeouts on reset

Emil Tantilov <[email protected]>
idpf: add read memory barrier when checking descriptor done bit

Sebastian Sewior <[email protected]>
xfrm: Don't disable preemption while looking up cache state.

Howard Chu <[email protected]>
perf trace: Fix BPF loading failure (-E2BIG)

Wentao Liang <[email protected]>
PM: hibernate: Add error handling for syscore_suspend()

Eric Dumazet <[email protected]>
ipmr: do not call mr_mfc_uses_dev() for unres entries

Dheeraj Reddy Jonnalagadda <[email protected]>
net: fec: implement TSO descriptor cleanup

Dimitri Fedrau <[email protected]>
net: phy: marvell-88q2xxx: Fix temperature measurement with reset-gpios

Ahmad Fatoum <[email protected]>
gpio: mxc: remove dead code after switch to DT-only

Jian Shen <[email protected]>
net: hns3: fix oops when unload drivers paralleling

Christian Marangi <[email protected]>
net: airoha: Fix wrong GDM4 register definition

Alexander Stein <[email protected]>
regulator: core: Add missing newline character

pangliyuan <[email protected]>
ubifs: skip dumping tnc tree when zroot is null

Zhihao Cheng <[email protected]>
ubi: Revert "ubi: wl: Close down wear-leveling before nand is suspended"

Ming Wang <[email protected]>
rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()

Oleksij Rempel <[email protected]>
rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read

Dan Carpenter <[email protected]>
rtc: tps6594: Fix integer overflow on 32bit systems

Alexandre Cassen <[email protected]>
xfrm: delete intermediate secpath entry in packet offload mode

Joe Hattori <[email protected]>
dmaengine: ti: edma: fix OF node reference leaks in edma_driver

Adam Ford <[email protected]>
phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation

Florian Westphal <[email protected]>
xfrm: state: fix out-of-bounds read during lookup

Jianbo Liu <[email protected]>

    xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO

Luo Yifan <[email protected]>
tools/bootconfig: Fix the wrong format specifier

Huacai Chen <[email protected]>
LoongArch: Fix warnings during S3 suspend

Olga Kornievskaia <[email protected]>
NFSv4.2: mark OFFLOAD_CANCEL MOVEABLE

Olga Kornievskaia <[email protected]>
NFSv4.2: fix COPY_NOTIFY xdr buf size calculation

Mike Snitzer <[email protected]>
nfs: fix incorrect error handling in LOCALIO

John Ogness <[email protected]>
serial: 8250: Adjust the timeout for FIFO mode

Jiri Slaby (SUSE) <[email protected]>
tty: mips_ejtag_fdc: fix one more u8 warning

Zijun Hu <[email protected]>
driver core: class: Fix wild pointer dereferences in API class_dev_iter_next()

Christophe Leroy <[email protected]>
module: Don't fail module loading when setting ro_after_init section RO failed

Sebastian Andrzej Siewior <[email protected]>
module: Extend the preempt disabled section in dereference_symbol_descriptor().

Suren Baghdasaryan <[email protected]>

    alloc_tag: avoid current->alloc_tag manipulations when profiling is disabled

Ryusuke Konishi <[email protected]>
nilfs2: handle errors that nilfs_prepare_chunk() may return

Ryusuke Konishi <[email protected]>
nilfs2: protect access to buffers with no active references

Ryusuke Konishi <[email protected]>
nilfs2: do not force clear folio if buffer is referenced

Su Yue <[email protected]>
ocfs2: mark dquot as inactive if failed to start trans while releasing dquot

Gao Xiang <[email protected]>
erofs: fix potential return value overflow of z_erofs_shrink_scan()

Charles Han <[email protected]>
firewire: test: Fix potential null dereference in firewire kunit test

Guixin Liu <[email protected]>
scsi: mpi3mr: Fix possible crash when setting up bsg fails

Guixin Liu <[email protected]>
scsi: ufs: bsg: Delete bsg_dev when setting up bsg fails

Paul Menzel <[email protected]>

    scsi: mpt3sas: Set ioc->manu_pg11.EEDPTagMode directly to 1

Daire McNamara <[email protected]>
PCI: microchip: Set inbound address translation for coherent or non-coherent mode

Manivannan Sadhasivam <[email protected]>
PCI: endpoint: pci-epf-test: Fix check for DMA MEMCPY test

Mohamed Khalfella <[email protected]>
PCI: endpoint: pci-epf-test: Set dma_chan_rx pointer to NULL on error

Richard Zhu <[email protected]>
PCI: dwc: Always stop link in the dw_pcie_suspend_noirq

Krishna chaitanya chundru <[email protected]>
PCI: qcom: Update ICC and OPP values after Link Up event

Richard Zhu <[email protected]>
PCI: imx6: Add missing reference clock disable logic

Richard Zhu <[email protected]>
PCI: imx6: Deassert apps_reset in imx_pcie_deassert_core_reset()

Richard Zhu <[email protected]>
PCI: imx6: Skip controller_id generation logic for i.MX7D

Frank Li <[email protected]>
PCI: imx6: Configure PHY based on Root Complex or Endpoint mode

Dan Carpenter <[email protected]>
PCI: rockchip-ep: Fix error code in rockchip_pcie_ep_init_ob_mem()

Damien Le Moal <[email protected]>
PCI: rockchip: Add missing fields descriptions for struct rockchip_pcie_ep

King Dix <[email protected]>
PCI: rcar-ep: Fix incorrect variable used when calling devm_request_mem_region()

Desnes Nunes <[email protected]>
media: dvb-usb-v2: af9035: fix ISO C90 compilation error on af9035_i2c_master_xfer

Joe Hattori <[email protected]>
staging: media: imx: fix OF node leak in imx_media_add_of_subdevs()

Joe Hattori <[email protected]>
watchdog: rti_wdt: Fix an OF node leak in rti_wdt_probe()

Laurentiu Palcu <[email protected]>
media: nxp: imx8-isi: fix v4l2-compliance test errors

Joe Hattori <[email protected]>
mtd: hyperbus: hbmc-am654: fix an OF node reference leak

david regan <[email protected]>
mtd: rawnand: brcmnand: fix status read of brcmnand_waitfunc

Ricardo Ribalda <[email protected]>

    media: uvcvideo: Propagate buf->error to userspace

Ricardo Ribalda <[email protected]>
media: uvcvideo: Fix deadlock during uvc_probe

Jiasheng Jiang <[email protected]>
media: camif-core: Add check for clk_enable()

Jiasheng Jiang <[email protected]>
media: mipi-csis: Add check for clk_enable()

Dave Stevenson <[email protected]>
media: i2c: ov9282: Correct the exposure offset

Luca Weiss <[email protected]>
media: i2c: imx412: Add missing newline to prints

Dave Stevenson <[email protected]>

    media: i2c: imx290: Register 0x3011 varies between imx327 and imx290

Jiasheng Jiang <[email protected]>
media: marvell: Add check for clk_enable()

Chen-Yu Tsai <[email protected]>
remoteproc: mtk_scp: Only populate devices for SCP cores

Jian-Hong Pan <[email protected]>
PCI/ASPM: Save parent L1SS config in pci_save_aspm_l1ss_state()

Zijun Hu <[email protected]>
PCI: endpoint: Destroy the EPC device in devm_pci_epc_destroy()

Chen Ni <[email protected]>
media: lmedm04: Handle errors for lme2510_int_read

Oliver Neukum <[email protected]>
media: rc: iguanair: handle timeouts

Dmytro Maluka <[email protected]>
of/fdt: Restore possibility to use both ACPI and FDT from bootloader

Mark Brown <[email protected]>
spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors

Michal Wilczynski <[email protected]>
mailbox: th1520: Fix memory corruption due to incorrect array size

Dan Carpenter <[email protected]>
mailbox: mpfs: fix copy and paste bug in probe

Dan Carpenter <[email protected]>
mailbox: th1520: Fix a NULL vs IS_ERR() bug

Qasim Ijaz <[email protected]>
iommufd/iova_bitmap: Fix shift-out-of-bounds in iova_bitmap_offset_to_index()

Suraj Sonawane <[email protected]>
iommu: iommufd: fix WARNING in iommufd_device_unbind

Zhu Yanjun <[email protected]>

    RDMA/rxe: Fix the warning "__rxe_cleanup+0x12c/0x170 [rdma_rxe]"

Anumula Murali Mohan Reddy <[email protected]>
RDMA/cxgb4: Notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event

Randy Dunlap <[email protected]>
efi: sysfb_efi: fix W=1 warnings when EFI is not set

Zijun Hu <[email protected]>
of: reserved-memory: Do not make kmemleak ignore freed address

Zijun Hu <[email protected]>
of: property: Avoiding using uninitialized variable @imaplen in parse_interrupt_map()

Michael Guralnik <[email protected]>
RDMA/mlx5: Fix indirect mkey ODP page count

Pei Xiao <[email protected]>
i3c: dw: Fix use-after-free in dw_i3c_master driver due to race condition

Joel Stanley <[email protected]>
arm64: dts: qcom: x1e80100-romulus: Update firmware nodes

Akhil R <[email protected]>
arm64: tegra: Fix DMA ID for SPI2

Joe Hattori <[email protected]>
fbdev: omapfb: Fix an OF node leak in dss_of_port_get_parent_device()

Josua Mayer <[email protected]>
arm64: dts: ti: k3-am642-hummingboard-t: Convert overlay to board dts

Siddharth Vadapalli <[email protected]>

    arm64: dts: ti: Makefile: Fix typo "k3-j7200-evm-pcie1-ep.dtbo"

Michael Riesch <[email protected]>
arm64: dts: rockchip: fix num-channels property of wolfvision pf5 mic

Jagan Teki <[email protected]>
arm64: dts: rockchip: Fix PCIe3 handling for Edgeble-6TOPS Modules

Rafał Miłecki <[email protected]>
ARM: dts: mediatek: mt7623: fix IR nodename

Josua Mayer <[email protected]>
arm64: dts: marvell: cn9131-cf-solidwan: fix cp1 comphy links

Vladimir Zapolskiy <[email protected]>
arm64: dts: qcom: sm8250: Fix interrupt types of camss interrupts

Vladimir Zapolskiy <[email protected]>
arm64: dts: qcom: sdm845: Fix interrupt types of camss interrupts

Vladimir Zapolskiy <[email protected]>

    arm64: dts: qcom: sc8280xp: Fix interrupt type of camss interrupts

Val Packett <[email protected]>
arm64: dts: mediatek: add per-SoC compatibles for keypad nodes

Jason-JH.Lin <[email protected]>
dts: arm64: mediatek: mt8195: Remove MT8183 compatible for OVL

Jason-JH.Lin <[email protected]>
dts: arm64: mediatek: mt8188: Update OVL compatible from MT8183 to MT8195

Frank Wunderlich <[email protected]>
arm64: dts: mediatek: mt7988: Add missing clock-div property for i2c

Krzysztof Kozlowski <[email protected]>
firmware: qcom: scm: Cleanup global '__scm' on probe failures

Konrad Dybcio <[email protected]>

    arm64: dts: qcom: sc8280xp: Fix up remoteproc register space sizes

Neil Armstrong <[email protected]>
arm64: dts: qcom: sm8150-microsoft-surface-duo: fix typos in da7280 properties

Neil Armstrong <[email protected]>
arm64: dts: qcom: sc7180: fix psci power domain node names

Alan Stern <[email protected]>
HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections

Neil Armstrong <[email protected]>
arm64: dts: qcom: sc7180-trogdor-pompom: rename 5v-choke thermal zone

Neil Armstrong <[email protected]>
arm64: dts: qcom: sc7180-trogdor-quackingstick: add missing avee-supply

Neil Armstrong <[email protected]>
arm64: dts: qcom: sdm845-db845c-navigation-mezzanine: remove disabled ov7251 camera

Neil Armstrong <[email protected]>
arm64: dts: qcom: qcm6490-shift-otter: remove invalid orientation-switch

Aaro Koskinen <[email protected]>
ARM: omap1: Fix up the Retu IRQ on Nokia 770

Junxian Huang <[email protected]>
RDMA/hns: Clean up the legacy CONFIG_INFINIBAND_HNS

Li Zhijian <[email protected]>
RDMA/rtrs: Add missing deinit() call

Kalesh AP <[email protected]>
RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error

Jonas Karlman <[email protected]>
arm64: dts: rockchip: Fix sdmmc access on rk3308-rock-s0 v1.1 boards

Bryan Brattlof <[email protected]>
arm64: dts: ti: k3-am62a: Remove duplicate GICR reg

Bryan Brattlof <[email protected]>
arm64: dts: ti: k3-am62: Remove duplicate GICR reg

Cristian Birsan <[email protected]>
ARM: dts: microchip: sama5d27_wlsom1_ek: Add no-1-8-v property to sdmmc0 node

Cristian Birsan <[email protected]>
ARM: dts: microchip: sama5d29_curiosity: Add no-1-8-v property to sdmmc0 node

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8650: Fix CDSP context banks unit addresses

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: x1e80100: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8650: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8550: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8450: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8350: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm8250: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm6375: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm6125: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sm4450: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sdx75: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: sc7280: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: qrb4210-rb2: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: q[dr]u1000: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: qcs404: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8994: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8939: correct sleep clock frequency

Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: msm8916: correct sleep clock frequency

Luca Weiss <[email protected]>
arm64: dts: qcom: sm7225-fairphone-fp4: Drop extra qcom,msm-id value

Konrad Dybcio <[email protected]>
arm64: dts: qcom: msm8994: Describe USB interrupts

Konrad Dybcio <[email protected]>
arm64: dts: qcom: msm8996: Fix up USB3 interrupts

Ross Burton <[email protected]>
arm64: defconfig: remove obsolete CONFIG_SM_DISPCC_8650

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sa8775p: Use valid node names for GPI DMAs

Maulik Shah <[email protected]>
arm64: dts: qcom: sa8775p: Add CPUs to psci power domain

Konrad Dybcio <[email protected]>
arm64: dts: qcom: sa8775p: Use a SoC-specific compatible for GPI DMA

Taniya Das <[email protected]>
arm64: dts: qcom: sa8775p: Update sleep_clk frequency

Marek Vasut <[email protected]>
arm64: dts: qcom: msm8996-xiaomi-gemini: Fix LP5562 LED1 reg property

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8183-kukui-jacuzzi: Drop pp3300_panel voltage settings

Joe Hattori <[email protected]>
memory: tegra20-emc: fix an OF node reference bug in tegra_emc_find_node_by_ram_code()

Marek Vasut <[email protected]>
ARM: dts: stm32: Swap USART3 and UART8 alias on STM32MP15xx DHCOM SoM

Marek Vasut <[email protected]>
ARM: dts: stm32: Deduplicate serial aliases and chosen node for STM32MP15xx DHCOM SoM

Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt8195: Remove suspend-breaking reset from pcie1

Ma Ke <[email protected]>
RDMA/srp: Fix error handling in srp_add_port

Hsin-Te Yuan <[email protected]>
arm64: dts: mediatek: mt8183: willow: Support second source touchscreen

Hsin-Te Yuan <[email protected]>
arm64: dts: mediatek: mt8183: kenzo: Support second source touchscreen

zhenwei pi <[email protected]>
RDMA/rxe: Fix mismatched max_msg_sz

Mamta Shukla <[email protected]>
arm: dts: socfpga: use reset-name "stmmaceth-ocp" instead of "ahb"

Ricky CX Wu <[email protected]>
ARM: dts: aspeed: yosemite4: correct the compatible string for max31790

Ricky CX Wu <[email protected]>
ARM: dts: aspeed: yosemite4: Add required properties for IOE on fan boards

Ricky CX Wu <[email protected]>
ARM: dts: aspeed: yosemite4: correct the compatible string of adm1272

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-evb: Fix MT6397 PMIC sub-node names

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Fix MT6397 PMIC sub-node names

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8395-genio-1200-evk: Drop regulator-compatible property

Chen-Yu Tsai <[email protected]>
arm64: dts: medaitek: mt8395-nio-12l: Drop regulator-compatible property

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8195-demo: Drop regulator-compatible property

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8195-cherry: Drop regulator-compatible property

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8192-asurada: Drop regulator-compatible property

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-elm: Drop regulator-compatible property

Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173-evb: Drop regulator-compatible property

Dan Carpenter <[email protected]>
rdma/cxgb4: Prevent potential integer overflow on 32bit

Claudiu Beznea <[email protected]>
arm64: dts: renesas: rzg3s-smarc: Fix the debug serial alias

Leon Romanovsky <[email protected]>
RDMA/mlx4: Avoid false error about access to uninitialized gids array

Arnaud Pouliquen <[email protected]>
ARM: dts: stm32: Fix IPCC EXTI declaration on stm32mp151

Marek Vasut <[email protected]>
ARM: dts: stm32: Sort M24256E write-lockable page in DH STM32MP13xx DHCOR SoM DT

Marek Vasut <[email protected]>
ARM: dts: stm32: Increase CPU core voltage on STM32MP13xx DHCOR SoM

Val Packett <[email protected]>

    arm64: dts: mediatek: mt8516: reserve 192 KiB for TF-A

Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: add i2c clock-div property

Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: fix wdt irq type

Val Packett <[email protected]>
arm64: dts: mediatek: mt8516: fix GICv2 range

Hsin-Yi Wang <[email protected]>
arm64: dts: mt8183: set DMIC one-wire mode on Damu

Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt8186: Move wakeup to MTU3 to get working suspend

Alexander Stein <[email protected]>
ARM: dts: imx7-tqma7: add missing vs-supply for LM75A (rev. 01xxx)

Nicolas Ferre <[email protected]>
ARM: at91: pm: change BU Power Switch to automatic mode

Javier Carrasco <[email protected]>
soc: atmel: fix device_node release in atmel_soc_device_init()

Hou Tao <[email protected]>
bpf: Cancel the running bpf_timer through kworker for PREEMPT_RT

Pali Rohár <[email protected]>
cifs: Use cifs_autodisable_serverino() for disabling CIFS_MOUNT_SERVER_INUM in readdir.c

Paulo Alcantara <[email protected]>
smb: client: fix oops due to unset link speed

Herbert Xu <[email protected]>
rhashtable: Fix rhashtable_try_insert test

Chen Ridong <[email protected]>
padata: avoid UAF for reorder_work

Chen Ridong <[email protected]>
padata: add pd get/put refcnt helper

Chen Ridong <[email protected]>
padata: fix UAF in padata_reorder

Chun-Tse Shao <[email protected]>
perf lock: Fix parse_lock_type which only retrieve one lock flag

Vishal Chourasia <[email protected]>
tools: Sync if_xdp.h uapi tooling header

Kailang Yang <[email protected]>
ALSA: hda/realtek - Fixed headphone distorted sound on Acer Aspire A115-31 laptop

Jason Gunthorpe <[email protected]>
iommu/amd: Fully decode all combinations of alloc_paging_flags

Jason Gunthorpe <[email protected]>
iommu/amd: Change amd_iommu_pgtable to use enum protection_domain_mode

Jason Gunthorpe <[email protected]>
iommu/amd: Remove type argument from do_iommu_domain_alloc() and related

Jason Gunthorpe <[email protected]>

    iommu/amd: Remove dev == NULL checks

Jason Gunthorpe <[email protected]>
iommu/amd: Remove domain_alloc()

Alejandro Jimenez <[email protected]>
iommu/amd: Remove unused amd_iommu_domain_update()

Guo Ren <[email protected]>
iommu/riscv: Fixup compile warning

Daniel Xu <[email protected]>
bpf: tcp: Mark bpf_load_hdr_opt() arg2 as read-write

Pu Lehui <[email protected]>
libbpf: Fix incorrect traversal end type ID when marking BTF_IS_EMBEDDED

Pu Lehui <[email protected]>
libbpf: Fix return zero when elf_begin failed

Pu Lehui <[email protected]>
selftests/bpf: Fix btf leak on new btf alloc failure in btf_distill test

Tony Ambardar <[email protected]>
selftests/bpf: Fix undefined UINT_MAX in veristat.c

Puranjay Mohan <[email protected]>
bpf: Send signals asynchronously if !preemptible

Simon Trimmer <[email protected]>
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83JX, 83MC and 83NM

Simon Trimmer <[email protected]>
ASoC: Intel: sof_sdw: Fix DMI match for Lenovo 83LC

Ian Rogers <[email protected]>
perf inject: Fix use without initialization of local variables

Ian Rogers <[email protected]>
perf test stat: Avoid hybrid assumption when virtualized

Maciej S. Szmigiero <[email protected]>
pinctrl: amd: Take suspend type into consideration which pins are non-wake

Mingwei Zheng <[email protected]>
pinctrl: stm32: Add check for clk_enable()

Jiachen Zhang <[email protected]>
perf report: Fix misleading help message about --demangle

Cezary Rojewski <[email protected]>
ALSA: hda: Fix compilation of snd_hdac_adsp_xxx() helpers

Arnaldo Carvalho de Melo <[email protected]>
perf MANIFEST: Add arch/*/include/uapi/asm/bpf_perf_event.h to the perf tarball

Namhyung Kim <[email protected]>
perf symbol: Prefer non-label symbols with same address

Amadeusz Sławiński <[email protected]>
ASoC: Intel: avs: Fix init-config parsing

Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Fix theoretical infinite loop

Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Fix the minimum firmware version numbers

Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Do not readq() u32 registers

Arnaldo Carvalho de Melo <[email protected]>
perf namespaces: Fixup the nsinfo__in_pidns() return type, its bool

Arnaldo Carvalho de Melo <[email protected]>
perf namespaces: Introduce nsinfo__set_in_pidns()

Christophe Leroy <[email protected]>
perf machine: Don't ignore _etext when not a text symbol

Christophe Leroy <[email protected]>
perf maps: Fix display of kernel symbols

Arnaldo Carvalho de Melo <[email protected]>
perf top: Don't complain about lack of vmlinux when not resolving some kernel samples

Lu Baolu <[email protected]>
iommu/vt-d: Draining PRQ in sva unbind path when FPD bit set

Jiayuan Chen <[email protected]>
selftests/bpf: Avoid generating untracked files when running bpf selftests

Thomas Weißschuh <[email protected]>
padata: fix sysfs store callback check

Martin KaFai Lau <[email protected]>
bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing

Takashi Iwai <[email protected]>
ALSA: seq: Make dependency on UMP clearer

Pei Xiao <[email protected]>
bpf: Use refcount_t instead of atomic_t for mmap_count

Kanchana P Sridhar <[email protected]>
crypto: iaa - Fix IAA disabling that occurs when sync_mode is set to 'async'

James Clark <[email protected]>
perf stat: Fix trailing comma when there is no metric unit

Joe Hattori <[email protected]>
crypto: ixp4xx - fix OF node reference leaks in init_ixp_crypto()

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

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

Breno Leitao <[email protected]>
rhashtable: Fix potential deadlock by moving schedule_work outside lock

Martin KaFai Lau <[email protected]>
bpf: bpf_local_storage: Always use bpf_mem_alloc in PREEMPT_RT

Ba Jing <[email protected]>
ktest.pl: Remove unused declarations in run_bisect_test function

Mingwei Zheng <[email protected]>
pinctrl: nomadik: Add check for clk_enable()

Levi Yun <[email protected]>
perf expr: Initialize is_test value in expr__ctx_new()

Arnaldo Carvalho de Melo <[email protected]>
tools build: Remove the libunwind feature tests from the ones detected when test-all.o builds

Claudiu Beznea <[email protected]>
ASoC: renesas: rz-ssi: Use only the proper amount of dividers

Zhongqiu Han <[email protected]>
perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()

Zhongqiu Han <[email protected]>
perf header: Fix one memory leakage in process_bpf_prog_info()

Zhongqiu Han <[email protected]>
perf header: Fix one memory leakage in process_bpf_btf()

Hans de Goede <[email protected]>
platform/x86: x86-android-tablets: Make variables only used locally static

Hans de Goede <[email protected]>
platform/x86: x86-android-tablets: Add missing __init to get_i2c_adap_by_*()

Gaurav Jain <[email protected]>
crypto: caam - use JobR's space to access page 0 regs

Herbert Xu <[email protected]>
crypto: api - Fix boot-up self-test race

Chen Ridong <[email protected]>
crypto: tegra - do not transfer req when tegra init fails

Jason Gunthorpe <[email protected]>
iommu/arm-smmuv3: Update comments about ATS and bypass

Saket Kumar Bhaskar <[email protected]>
selftests/bpf: Fix fill_link_info selftest on powerpc

Arnaldo Carvalho de Melo <[email protected]>
tools features: Don't check for libunwind devel files by default

George Lander <[email protected]>
ASoC: sun4i-spdif: Add clock multiplier settings

Bard Liao <[email protected]>

    ASoC: Intel: sof_sdw: correct mach_params->dmic_num

Quentin Monnet <[email protected]>
libbpf: Fix segfault due to libelf functions not setting errno

Andrea Righi <[email protected]>
sched_ext: Use the NUMA scheduling domain for NUMA optimizations

Marco Leogrande <[email protected]>
tools/testing/selftests/bpf/test_tc_tunnel.sh: Fix wait for server bind

Takashi Iwai <[email protected]>
ASoC: wcd937x: Use *-y for Makefile

Takashi Iwai <[email protected]>
ASoC: cs42l84: Use *-y for Makefile

Takashi Iwai <[email protected]>
ASoC: SDCA: Use *-y for Makefile

Takashi Iwai <[email protected]>
ASoC: mediatek: mt8365: Use *-y for Makefile

Takashi Iwai <[email protected]>
ASoC: cs40l50: Use *-y for Makefile

Andrii Nakryiko <[email protected]>
libbpf: don't adjust USDT semaphore address if .stapsdt.base addr is missing

Christophe JAILLET <[email protected]>
pinctrl: samsung: Fix irq handling if an error occurs in exynos_irq_demux_eint16_31()

Pei Xiao <[email protected]>
platform/x86: x86-android-tablets: make platform data be static

Pei Xiao <[email protected]>
platform/mellanox: mlxbf-pmc: incorrect type in assignment

Nikita Zhandarovich <[email protected]>
net/rose: prevent integer overflows in rose_setsockopt()

Mahdi Arghavani <[email protected]>
tcp_cubic: fix incorrect HyStart round start detection

Roger Quadros <[email protected]>
net: ethernet: ti: am65-cpsw: fix freeing IRQ in am65_cpsw_nuss_remove_tx_chns()

Xin Long <[email protected]>
net: sched: refine software bypass handling in tc_run

Florian Westphal <[email protected]>
netfilter: nft_flow_offload: update tcp state flags under lock

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: fix set size with rbtree backend

Jamal Hadi Salim <[email protected]>
net: sched: Disallow replacing of child qdisc from one parent to another

Antoine Tenart <[email protected]>
net: avoid race between device unregistration and ethnl ops

Shinas Rasheed <[email protected]>
octeon_ep_vf: remove firmware stats fetch in ndo_get_stats64

Shinas Rasheed <[email protected]>
octeon_ep: remove firmware stats fetch in ndo_get_stats64

Maher Sanalla <[email protected]>
net/mlxfw: Drop hard coded max FW flash image size

Liu Jian <[email protected]>
net: let net.core.dev_weight always be non-zero

Mickaël Salaün <[email protected]>
selftests/landlock: Fix error message

Mickaël Salaün <[email protected]>
selftests/landlock: Fix build with non-default pthread linking

Daniel Golle <[email protected]>
net: phy: realtek: always clear NBase-T lpa

Daniel Golle <[email protected]>
net: phy: realtek: clear master_slave_state if link is down

Daniel Golle <[email protected]>
net: phy: realtek: clear 1000Base-T lpa if link is down

Mingwei Zheng <[email protected]>
pwm: stm32: Add check for clk_enable()

Kuniyuki Iwashima <[email protected]>

    dev: Acquire netdev_rename_lock before restoring dev->name in dev_change_name().

Bo Gan <[email protected]>
clk: analogbits: Fix incorrect calculation of vco rate delta

Eric Dumazet <[email protected]>
inet: ipmr: fix data-races

Alexis Lothoré <[email protected]>
wifi: wilc1000: unregister wiphy only after netdev registration

Max Chou <[email protected]>
Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()

Charles Han <[email protected]>
Bluetooth: btbcm: Fix NULL deref in btbcm_get_board_name()

Dmitry Antipov <[email protected]>
wifi: cfg80211: adjust allocation of colocated AP data

Dmitry V. Levin <[email protected]>
selftests: harness: fix printing of mismatch values in __EXPECT()

Geert Uytterhoeven <[email protected]>
selftests: timers: clocksource-switch: Adapt progress to kselftest framework

Aditya Kumar Singh <[email protected]>
wifi: ath12k: fix key cache handling

Gautham R. Shenoy <[email protected]>
cpufreq: ACPI: Fix max-frequency computation

Uwe Kleine-König <[email protected]>
i2c: designware: Actually make use of the I2C_DW_COMMON and I2C_DW symbol namespaces

Peter Chiu <[email protected]>
wifi: mt76: mt7996: fix ldpc setting

Benjamin Lin <[email protected]>
wifi: mt76: mt7996: fix definition of tx descriptor

Benjamin Lin <[email protected]>
wifi: mt76: mt7996: fix incorrect indexing of MIB FW event

Howard Hsu <[email protected]>
wifi: mt76: mt7996: fix HE Phy capability

Howard Hsu <[email protected]>
wifi: mt76: mt7996: fix the capability of reception of EHT MU PPDU

Peter Chiu <[email protected]>
wifi: mt76: mt7996: add max mpdu len capability

Peter Chiu <[email protected]>
wifi: mt76: mt7996: fix register mapping

Peter Chiu <[email protected]>
wifi: mt76: mt7915: fix register mapping

Felix Fietkau <[email protected]>
wifi: mt76: mt7915: fix omac index assignment after hardware reset

Felix Fietkau <[email protected]>
wifi: mt76: mt7915: firmware restart on devices with a second pcie link

Felix Fietkau <[email protected]>
wifi: mt76: only enable tx worker after setting the channel

Felix Fietkau <[email protected]>
wifi: mt76: mt7996: fix rx filter setting for bfee functionality

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Properly handle responses for commands with events

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Cleanup MLO settings post-disconnection

Ming Yen Hsieh <[email protected]>

    wifi: mt76: mt7925: Update mt7925_mcu_uni_[tx,rx]_ba for MLO

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Init secondary link PM state

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Update secondary link PS flow

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Update mt7925_unassign_vif_chanctx for per-link BSS

Ming Yen Hsieh <[email protected]>

    wifi: mt76: mt7925: Update mt792x_rx_get_wcid for per-link STA

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Update mt7925_mcu_sta_update for BC in ASSOC state

Ming Yen Hsieh <[email protected]>
wifi: mt76: Enhance mt7925_mac_link_sta_add to support MLO

Ming Yen Hsieh <[email protected]>

    wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO

Leon Yen <[email protected]>
wifi: mt76: mt7925: Fix CNM Timeout with Single Active Link in MLO

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: fix wrong parameter for related cmd of chan info

allan.wang <[email protected]>
wifi: mt76: mt7925: Fix incorrect WCID phy_idx assignment

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Fix incorrect WCID assignment for MLO

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: Fix incorrect MLD address in bss_mld_tlv for MLO support

Sean Wang <[email protected]>
wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO

xueqin Luo <[email protected]>
wifi: mt76: mt7915: fix overflows seen when writing limit attributes

xueqin Luo <[email protected]>
wifi: mt76: mt7996: fix overflows seen when writing limit attributes

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: fix the invalid ip address for arp offload

Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer

Eric-SY Chang <[email protected]>
wifi: mt76: mt7925: fix wrong band_idx setting when enable sniffer mode

Charles Han <[email protected]>
wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links

Christophe JAILLET <[email protected]>
wifi: mt76: mt7915: Fix an error handling path in mt7915_add_interface()

Michael Lo <[email protected]>
wifi: mt76: mt7921: fix using incorrect group cipher after disconnection.

WangYuli <[email protected]>
wifi: mt76: mt76u_vendor_request: Do not print error messages when -EPROTO

Mickaël Salaün <[email protected]>
landlock: Handle weird files

Guangguan Wang <[email protected]>
net/smc: fix data error when recvmsg with MSG_PEEK flag

Drew Fustini <[email protected]>
clk: thead: Fix cpu2vp_clk for TH1520 AP_SUBSYS clocks

Drew Fustini <[email protected]>
clk: thead: Add CLK_IGNORE_UNUSED to fix TH1520 boot

Drew Fustini <[email protected]>
clk: thead: Fix clk gate registration to pass flags

Sergio Paracuellos <[email protected]>
clk: ralink: mtmips: remove duplicated 'xtal' clock for Ralink SoC RT3883

Johannes Berg <[email protected]>
wifi: mac80211: don't flush non-uploaded STAs

Ilan Peer <[email protected]>
wifi: mac80211: Fix common size calculation for ML element

Andy Strohman <[email protected]>
wifi: mac80211: fix tid removal during mesh forwarding

Kees Cook <[email protected]>
wifi: cfg80211: Move cfg80211_scan_req_add_chan() n_channels increment earlier

Johannes Berg <[email protected]>
wifi: mac80211: prohibit deactivating all links

Emmanuel Grumbach <[email protected]>
wifi: iwlwifi: mvm: remove unneeded NULL pointer checks

Daniel Gabay <[email protected]>
wifi: iwlwifi: mvm: don't count mgmt frames as MPDU

Miri Korenblit <[email protected]>
wifi: iwlwifi: mvm: avoid NULL pointer dereference

Johannes Berg <[email protected]>
wifi: iwlwifi: fw: read STEP table from correct UEFI var

Nicolas Cavallari <[email protected]>

    wifi: mt76: mt7915: Fix mesh scan on MT7916 DBDC

Dan Carpenter <[email protected]>

    wifi: mt76: mt7925: fix off by one in mt7925_load_clc()

Joel Stanley <[email protected]>
hwmon: Fix help text for aspeed-g6-pwm-tach

Ping-Ke Shih <[email protected]>
wifi: rtw89: fix race between cancel_hw_scan and hw_scan completion

Zong-Zhe Yang <[email protected]>
wifi: rtw89: mcc: consider time limits not divisible by 1024

Chih-Kang Chang <[email protected]>
wifi: rtw89: avoid to init mgnt_entry list twice when WoWLAN failed

Po-Hao Huang <[email protected]>
wifi: rtw89: correct header conversion rule for MLO only

Zong-Zhe Yang <[email protected]>
wifi: rtw89: chan: fix soft lockup in rtw89_entity_recalc_mgnt_roles()

Zong-Zhe Yang <[email protected]>
wifi: rtw89: fix proceeding MCC with wrong scanning state after sequence changes

Andreas Kemnade <[email protected]>
wifi: wlcore: fix unbalanced pm_runtime calls

Alexis Lothoré <[email protected]>
wifi: wilc1000: unregister wiphy only if it has been registered

Shayne Chen <[email protected]>
wifi: mt76: mt7996: fix invalid interface combinations

Zichen Xie <[email protected]>
samples/landlock: Fix possible NULL dereference in parse_path()

Rob Herring (Arm) <[email protected]>
mfd: syscon: Fix race in device_node_get_regmap()

Joe Hattori <[email protected]>
leds: cht-wcove: Use devm_led_classdev_register() to avoid memory leak

Terry Tritton <[email protected]>
HID: fix generic desktop D-Pad controls

Karol Przybylski <[email protected]>
HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check

Amit Pundir <[email protected]>
clk: qcom: gcc-sdm845: Do not use shared clk_ops for QUPs

Sathishkumar Muruganandam <[email protected]>
wifi: ath12k: fix tx power, max reg power update to firmware

Quan Nguyen <[email protected]>
ipmi: ssif_bmc: Fix new request loss when bmc ready for a response

Joe Hattori <[email protected]>
OPP: OF: Fix an OF node leak in _opp_add_static_v2()

Yevgeny Kliteynik <[email protected]>
net/mlx5: HWS, fix definer's HWS_SET32 macro for negative offset

Eric Dumazet <[email protected]>

    ax25: rcu protect dev->ax25_ptr

Joe Hattori <[email protected]>
regulator: of: Implement the unwind path of of_regulator_match()

Vasily Khoruzhick <[email protected]>
clk: sunxi-ng: a64: stop force-selecting PLL-MIPI as TCON0 parent

Mario Limonciello <[email protected]>
cpufreq/amd-pstate: Fix prefcore rankings

Octavian Purdila <[email protected]>
team: prevent adding a device which is already a team device lower

Bryan O'Donoghue <[email protected]>
clk: qcom: camcc-x1e80100: Set titan_top_gdsc as the parent GDSC of subordinate GDSCs

Peng Fan <[email protected]>
clk: imx: Apply some clks only for i.MX93

Shengjiu Wang <[email protected]>
arm64: dts: imx93: Use IMX93_CLK_SPDIF_IPG as SPDIF IPG clock

Shengjiu Wang <[email protected]>
clk: imx93: Add IMX93_CLK_SPDIF_IPG clock

Shengjiu Wang <[email protected]>
dt-bindings: clock: imx93: Add SPDIF IPG clk

Marek Vasut <[email protected]>
clk: imx8mp: Fix clkout1/2 support

Stefano Brivio <[email protected]>
udp: Deal with race between UDP socket address change and rehash

Manivannan Sadhasivam <[email protected]>
cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks

Manivannan Sadhasivam <[email protected]>
cpufreq: qcom: Fix qcom_cpufreq_hw_recalc_rate() to query LUT if LMh IRQ is not available

Luca Ceresoli <[email protected]>
gpio: pca953x: log an error when failing to get the reset GPIO

Lorenzo Bianconi <[email protected]>
net: airoha: Fix error path in airoha_probe()

Eric Dumazet <[email protected]>
ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple()

Mickaël Salaün <[email protected]>
selftests: ktap_helpers: Fix uninitialized variable

Sultan Alsawaf (unemployed) <[email protected]>
cpufreq: schedutil: Fix superfluous updates caused by need_freq_update

Mingwei Zheng <[email protected]>
pwm: stm32-lp: Add check for clk_enable()

Eric Dumazet <[email protected]>
inetpeer: do not get a refcount in inet_getpeer()

Eric Dumazet <[email protected]>
inetpeer: update inetpeer timestamp in inet_getpeer()

Eric Dumazet <[email protected]>
inetpeer: remove create argument of inet_getpeer()

Eric Dumazet <[email protected]>
inetpeer: remove create argument of inet_getpeer_v[46]()

Joe Hattori <[email protected]>
leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()

Matti Vaittinen <[email protected]>
dt-bindings: mfd: bd71815: Fix rsense and typos

He Rongguang <[email protected]>
cpupower: fix TSC MHz calculation

Joe Hattori <[email protected]>
ACPI: fan: cleanup resources in the error path of .probe()

Uwe Kleine-König <[email protected]>
hwmon: (nct6775): Actually make use of the HWMON_NCT6775 symbol namespace

Marcel Hamer <[email protected]>
wifi: brcmfmac: add missing header include for brcmf_dbg

Aditya Kumar Singh <[email protected]>
wifi: ath12k: fix read pointer after free in ath12k_mac_assign_vif_to_vdev()

Chen-Yu Tsai <[email protected]>
regulator: dt-bindings: mt6315: Drop regulator-compatible property

Jiri Kosina <[email protected]>

    HID: multitouch: fix support for Goodix PID 0x01e9

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: pci: wait for firmware loading before releasing memory

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: fix memory leaks and invalid access at probe error path

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: destroy workqueue at rtl_deinit_core

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: remove unused check_buddy_priv

Geert Uytterhoeven <[email protected]>
dt-bindings: leds: class-multicolor: Fix path to color definitions

Joe Hattori <[email protected]>
clk: fix an OF node reference leak in of_clk_get_parent_name()

Neil Armstrong <[email protected]>
dt-bindings: mmc: controller: clarify the address-cells description

David Howells <[email protected]>
rxrpc: Fix handling of received connection abort

Mingwei Zheng <[email protected]>
spi: zynq-qspi: Add check for clk_enable()

Octavian Purdila <[email protected]>
net_sched: sch_sfq: don't allow 1 packet limit

Song Yoong Siang <[email protected]>
selftests/bpf: Actuate tx_metadata_len in xdp_hw_metadata

Zichen Xie <[email protected]>
wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()

Dan Carpenter <[email protected]>
clk: mmp: pxa1908-apbc: Fix NULL vs IS_ERR() check

Dan Carpenter <[email protected]>
clk: mmp: pxa1908-apbcp: Fix a NULL vs IS_ERR() check

Dan Carpenter <[email protected]>
clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check

Javier Carrasco <[email protected]>
clk: renesas: cpg-mssr: Fix 'soc' node handling in cpg_mssr_reserved_init()

Barnabás Czémán <[email protected]>
wifi: wcn36xx: fix channel survey memory allocation size

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: usb: fix workqueue leak when probe fails

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: fix init_sw_vars leak when probe fails

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: wait for firmware loading before releasing memory

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step

Thadeu Lima de Souza Cascardo <[email protected]>
wifi: rtlwifi: do not complete firmware loading needlessly

Colin Ian King <[email protected]>
wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

Balaji Pothunoori <[email protected]>
wifi: ath11k: Fix unexpected return buffer manager error for WCN6750/WCN6855

Charles Han <[email protected]>
ipmi: ipmb: Add check devm_kasprintf() returned value

Thomas Gleixner <[email protected]>
genirq: Make handle_enforce_irqctx() unconditionally available

Jonathan Kim <[email protected]>
drm/amdgpu: fix gpu recovery disable with per queue reset

Jiang Liu <[email protected]>
drm/amdgpu: tear down ttm range manager for doorbell in amdgpu_ttm_fini()

Dan Carpenter <[email protected]>
drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()

Hermes Wu <[email protected]>
drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE

Dmitry Baryshkov <[email protected]>
drm/msm/mdp4: correct LCDC regulator name

Dmitry Baryshkov <[email protected]>

    drm/msm: don't clean up priv->kms prematurely

Sui Jingfeng <[email protected]>
drm/msm: Check return value of of_dma_configure()

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on X1E80100

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on SM8650

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on SM8550

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on SM8350

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on SM8250

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on SC8180X

Dmitry Baryshkov <[email protected]>

    drm/msm/dpu: link DSPP_2/_3 blocks on SM8150

Dmitry Baryshkov <[email protected]>
drm/msm/dpu: provide DSPP and correct LM config for SDM670

Neil Armstrong <[email protected]>
OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized

Neil Armstrong <[email protected]>
OPP: add index check to assert to avoid buffer overflow in _read_freq()

Karol Przybylski <[email protected]>
drm/amdgpu: Fix potential integer overflow in scheduler mask calculations

Bokun Zhang <[email protected]>
drm/amdgpu/vcn: reset fw_shared under SRIOV

Min-Hua Chen <[email protected]>
drm/rockchip: vop2: include rockchip_drm_drv.h

Andy Yan <[email protected]>
drm/rockchip: vop2: Add check for 32 bpp format for rk3588

Andy Yan <[email protected]>
drm/rockchip: vop2: Check linear format for Cluster windows on rk3566/8

Andy Yan <[email protected]>
drm/rockchip: vop2: Setup delay cycle for Esmart2/3

Andy Yan <[email protected]>
drm/rockchip: vop2: Set AXI id for rk3588

Derek Foreman <[email protected]>
drm/connector: Allow clearing HDMI infoframes

John Ogness <[email protected]>
printk: Defer legacy printing when holding printk_cpu_sync

Andy Yan <[email protected]>
drm/rockchip: vop2: Fix the windows switch between different layers

Abhinav Kumar <[email protected]>
drm/msm/dpu: check dpu_plane_atomic_print_state() for valid sspp

Abhinav Kumar <[email protected]>
drm/msm/dp: disable the opp table request even for dp_ctrl_off_link()

Abhinav Kumar <[email protected]>
drm/msm/dp: dont call dp_catalog_ctrl_mainlink_ctrl in dp_ctrl_configure_source_params()

Abhinav Kumar <[email protected]>
drm/msm/dp: do not touch the MMSS_DP_INTF_CONFIG for tpg

Boris Brezillon <[email protected]>
drm/panthor: Preserve the result returned by panthor_fw_resume()

Andy Yan <[email protected]>
drm/rockchip: vop2: Fix the mixer alpha setup for layer 0

Andy Yan <[email protected]>
drm/rockchip: vop2: Fix cluster windows alpha ctrl regsiters offset

Ivan Stepchenko <[email protected]>
drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table

Christophe JAILLET <[email protected]>
drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()

Sui Jingfeng <[email protected]>
drm/etnaviv: Fix page property being used for non writecombine buffers

Rex Nie <[email protected]>
drm/msm/hdmi: simplify code in pll_get_integloop_gain

Dmitry Baryshkov <[email protected]>
dt-bindings: display/msm: qcom,sa8775p-mdss: fix the example

Dmitry Baryshkov <[email protected]>
drm/msm/dp: fix msm_dp_utils_pack_sdp_header interface

Dmitry Baryshkov <[email protected]>
drm/msm/dp: set safe_to_exit_level before printing it

Heiko Stuebner <[email protected]>
drm/rockchip: vop2: fix rk3588 dp+dsi maxclk verification

Ville Syrjälä <[email protected]>
drm/i915: Grab intel_display from the encoder to avoid potential oopsies

Maíra Canal <[email protected]>
drm/v3d: Fix performance counter source settings on V3D 7.x

Chengming Zhou <[email protected]>
psi: Fix race when task wakes up before psi_sched_switch() adjusts flags

K Prateek Nayak <[email protected]>
x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally

Tianchen Ding <[email protected]>
sched: Fix race between yield_to() and try_to_wake_up()

Peter Zijlstra <[email protected]>
sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat

Peter Zijlstra <[email protected]>
sched/fair: Untangle NEXT_BUDDY and pick_next_task()

Yabin Cui <[email protected]>
perf/core: Save raw sample data conditionally based on sample type

John Garry <[email protected]>
block: Ensure start sector is aligned for stacking atomic writes

David Howells <[email protected]>
afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call

Jens Axboe <[email protected]>
nvme: fix bogus kzalloc() return check in nvme_init_effects_log()

Christophe Leroy <[email protected]>
select: Fix unbalanced user_access_end()

Qu Wenruo <[email protected]>
btrfs: subpage: fix the bitmap dump of the locked flags

Randy Dunlap <[email protected]>
partitions: ldm: remove the initial kernel-doc notation

Qu Wenruo <[email protected]>
btrfs: improve the warning and error message for btrfs_remove_qgroup()

Keisuke Nishimura <[email protected]>
nvme: Add error path for xa_store in nvme_init_effects

Michael Ellerman <[email protected]>
selftests/powerpc: Fix argument order to timer_sub()

Gaurav Batra <[email protected]>
powerpc/pseries/iommu: IOMMU incorrectly marks MMIO range in DDW

Keisuke Nishimura <[email protected]>
nvme: Add error check for xa_store in nvme_get_effects_log

Sagi Grimberg <[email protected]>
nvme-tcp: Fix I/O queue cpu spreading for multiple controllers

Christoph Hellwig <[email protected]>
block: fix queue freeze vs limits lock order in sysfs store methods

Christoph Hellwig <[email protected]>
block: add a store_limit operations for sysfs entries

Christoph Hellwig <[email protected]>
block: add a queue_limits_commit_update_frozen helper

Christoph Hellwig <[email protected]>
block: don't update BLK_FEAT_POLL in __blk_mq_update_nr_hw_queues

Christoph Hellwig <[email protected]>
block: check BLK_FEAT_POLL under q_usage_count

Eugen Hristev <[email protected]>
pstore/blk: trivial typo fixes

Yu Kuai <[email protected]>
nbd: don't allow reconnect after disconnect

Geert Uytterhoeven <[email protected]>

    ps3disk: Do not use dev->bounce_size before it is set

Yang Erkun <[email protected]>
block: retry call probe after request_module in blk_request_module

Pavel Begunkov <[email protected]>
io_uring: prevent reg-wait speculations

Christoph Hellwig <[email protected]>
block: copy back bounce buffer to user-space correctly in case of split

Jinliang Zheng <[email protected]>
fs: fix proc_handler for sysctl_nr_open

David Howells <[email protected]>
afs: Fix cleanup of immediately failed async calls

David Howells <[email protected]>
afs: Fix directory format encoding struct

David Howells <[email protected]>
afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY

Alexander Aring <[email protected]>
dlm: fix srcu_read_lock() return type to int

Alexander Aring <[email protected]>
dlm: fix removal of rsb struct that is master and dir record

Sourabh Jain <[email protected]>
powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

Kees Cook <[email protected]>
coredump: Do not lock during 'comm' reporting

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

Diffstat:

 .../bindings/display/msm/qcom,sa8775p-mdss.yaml    |   3 +-
 .../bindings/leds/leds-class-multicolor.yaml       |   2 +-
 .../devicetree/bindings/mfd/rohm,bd71815-pmic.yaml |  20 +--
 .../devicetree/bindings/mmc/mmc-controller.yaml    |   2 +-
 .../bindings/regulator/mt6315-regulator.yaml       |   6 -
 Documentation/driver-api/crypto/iaa/iaa-crypto.rst |   9 +-
 Makefile                                           |   4 +-
 .../dts/aspeed/aspeed-bmc-facebook-yosemite4.dts   |  24 ++-
 .../boot/dts/intel/socfpga/socfpga_arria10.dtsi    |   6 +-
 arch/arm/boot/dts/mediatek/mt7623.dtsi             |   2 +-
 .../boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts |   1 +
 .../boot/dts/microchip/at91-sama5d29_curiosity.dts |   1 +
 arch/arm/boot/dts/nxp/imx/imx7-tqma7.dtsi          |   1 +
 arch/arm/boot/dts/st/stm32mp13xx-dhcor-som.dtsi    |  16 +-
 arch/arm/boot/dts/st/stm32mp151.dtsi               |   2 +-
 arch/arm/boot/dts/st/stm32mp15xx-dhcom-drc02.dtsi  |  12 --
 arch/arm/boot/dts/st/stm32mp15xx-dhcom-pdk2.dtsi   |  10 --
 .../arm/boot/dts/st/stm32mp15xx-dhcom-picoitx.dtsi |  10 --
 arch/arm/boot/dts/st/stm32mp15xx-dhcom-som.dtsi    |   7 +
 arch/arm/mach-at91/pm.c                            |  31 ++--
 arch/arm/mach-omap1/board-nokia770.c               |   2 +-
 arch/arm64/boot/dts/freescale/imx93.dtsi           |   2 +-
 arch/arm64/boot/dts/marvell/cn9131-cf-solidwan.dts |   4 +-
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi          |   3 +
 arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi       |  29 +---
 arch/arm64/boot/dts/mediatek/mt8173-evb.dts        |  25 +--
 .../dts/mediatek/mt8183-kukui-jacuzzi-damu.dts     |   4 +
 .../dts/mediatek/mt8183-kukui-jacuzzi-kenzo.dts    |  15 ++
 .../dts/mediatek/mt8183-kukui-jacuzzi-willow.dtsi  |  15 ++
 .../boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi    |   2 -
 arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   3 +-
 arch/arm64/boot/dts/mediatek/mt8186.dtsi           |   8 +-
 arch/arm64/boot/dts/mediatek/mt8188.dtsi           |   2 +-
 arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi   |   3 -
 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi    |   2 -
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts       |   9 --
 arch/arm64/boot/dts/mediatek/mt8195.dtsi           |   5 +-
 arch/arm64/boot/dts/mediatek/mt8365.dtsi           |   3 +-
 .../boot/dts/mediatek/mt8395-genio-1200-evk.dts    |   2 -
 .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     |   2 -
 arch/arm64/boot/dts/mediatek/mt8516.dtsi           |  11 +-
 arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi   |   2 -
 arch/arm64/boot/dts/nvidia/tegra234.dtsi           |   2 +-
 arch/arm64/boot/dts/qcom/msm8916.dtsi              |   2 +-
 arch/arm64/boot/dts/qcom/msm8939.dtsi              |   2 +-
 arch/arm64/boot/dts/qcom/msm8994.dtsi              |  11 +-
 arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts |   2 +-
 arch/arm64/boot/dts/qcom/msm8996.dtsi              |   9 +-
 arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts   |   2 -
 arch/arm64/boot/dts/qcom/qcs404.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/qcs8550-aim300.dtsi       |   2 +-
 arch/arm64/boot/dts/qcom/qdu1000-idp.dts           |   2 +-
 arch/arm64/boot/dts/qcom/qrb4210-rb2.dts           |   2 +-
 arch/arm64/boot/dts/qcom/qru1000-idp.dts           |   2 +-
 arch/arm64/boot/dts/qcom/sa8775p-ride.dtsi         |   2 +-
 arch/arm64/boot/dts/qcom/sa8775p.dtsi              |  32 +++-
 .../arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi |   4 +-
 .../dts/qcom/sc7180-trogdor-quackingstick.dtsi     |   1 +
 arch/arm64/boot/dts/qcom/sc7180.dtsi               |  18 +--
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi             |  46 +++---
 .../qcom/sdm845-db845c-navigation-mezzanine.dtso   |  42 -----
 arch/arm64/boot/dts/qcom/sdm845.dtsi               |  20 +--
 arch/arm64/boot/dts/qcom/sdx75.dtsi                |   2 +-
 arch/arm64/boot/dts/qcom/sm4450.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm6125.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm6375.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  |   2 +-
 .../boot/dts/qcom/sm8150-microsoft-surface-duo.dts |   4 +-
 arch/arm64/boot/dts/qcom/sm8250.dtsi               |  30 ++--
 arch/arm64/boot/dts/qcom/sm8350.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm8450.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm8550-hdk.dts            |   2 +-
 arch/arm64/boot/dts/qcom/sm8550-mtp.dts            |   2 +-
 arch/arm64/boot/dts/qcom/sm8550-qrd.dts            |   2 +-
 arch/arm64/boot/dts/qcom/sm8550-samsung-q5q.dts    |   2 +-
 .../dts/qcom/sm8550-sony-xperia-yodo-pdx234.dts    |   2 +-
 arch/arm64/boot/dts/qcom/sm8650-hdk.dts            |   2 +-
 arch/arm64/boot/dts/qcom/sm8650-mtp.dts            |   2 +-
 arch/arm64/boot/dts/qcom/sm8650-qrd.dts            |   2 +-
 arch/arm64/boot/dts/qcom/sm8650.dtsi               |   6 +-
 .../boot/dts/qcom/x1e80100-microsoft-romulus.dtsi  |   4 +-
 arch/arm64/boot/dts/qcom/x1e80100.dtsi             |   2 +-
 arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi   |   5 -
 arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi       |   7 +-
 arch/arm64/boot/dts/rockchip/rk3308-rock-s0.dts    |  25 ++-
 .../boot/dts/rockchip/rk3568-wolfvision-pf5.dts    |   2 +-
 .../boot/dts/rockchip/rk3588-edgeble-neu6a-io.dtsi |  95 +++++++----
 arch/arm64/boot/dts/ti/Makefile                    |   6 +-
 arch/arm64/boot/dts/ti/k3-am62-main.dtsi           |   1 -
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi          |   1 -
 ...-pcie.dtso => k3-am642-hummingboard-t-pcie.dts} |  14 +-
 ...-usb3.dtso => k3-am642-hummingboard-t-usb3.dts} |  13 +-
 arch/arm64/configs/defconfig                       |   1 -
 arch/hexagon/include/asm/cmpxchg.h                 |   2 +-
 arch/hexagon/kernel/traps.c                        |   4 +-
 arch/loongarch/include/asm/hw_breakpoint.h         |   4 +-
 arch/loongarch/include/asm/loongarch.h             |  60 +++++++
 arch/loongarch/kernel/hw_breakpoint.c              |  16 +-
 arch/loongarch/power/platform.c                    |   2 +-
 arch/powerpc/include/asm/hugetlb.h                 |   9 ++
 arch/powerpc/kernel/iommu.c                        |   2 +-
 arch/powerpc/platforms/pseries/iommu.c             |  12 +-
 arch/riscv/kernel/vector.c                         |   2 +-
 arch/s390/Kconfig                                  |   1 +
 arch/s390/Makefile                                 |   2 +-
 arch/s390/boot/vmem.c                              |  74 ++++++---
 arch/s390/include/asm/sclp.h                       |   1 +
 arch/s390/kernel/perf_cpum_cf.c                    |   2 +-
 arch/s390/kernel/perf_pai_crypto.c                 |   2 +-
 arch/s390/kernel/perf_pai_ext.c                    |   2 +-
 arch/s390/kernel/setup.c                           |   5 +
 arch/s390/purgatory/Makefile                       |   2 +-
 arch/x86/events/amd/ibs.c                          |   2 +-
 arch/x86/include/asm/kvm_host.h                    |   2 +-
 arch/x86/kernel/smpboot.c                          |  11 +-
 arch/x86/kvm/lapic.c                               |  11 +-
 arch/x86/kvm/vmx/vmx.c                             |   2 +-
 arch/x86/kvm/vmx/x86_ops.h                         |   2 +-
 block/bio-integrity.c                              |  15 +-
 block/blk-core.c                                   |  21 +--
 block/blk-integrity.c                              |   4 +-
 block/blk-mq.c                                     |  34 ++--
 block/blk-mq.h                                     |   6 +
 block/blk-settings.c                               |  31 +++-
 block/blk-sysfs.c                                  | 137 ++++++++--------
 block/blk-zoned.c                                  |   7 +-
 block/genhd.c                                      |  22 ++-
 block/partitions/ldm.h                             |   2 +-
 crypto/algapi.c                                    |   4 +-
 drivers/acpi/acpica/achware.h                      |   2 -
 drivers/acpi/fan_core.c                            |  10 +-
 drivers/base/class.c                               |   9 +-
 drivers/base/power/main.c                          |  29 ++--
 drivers/block/nbd.c                                |   1 +
 drivers/block/ps3disk.c                            |   4 +-
 drivers/block/virtio_blk.c                         |   4 +-
 drivers/bluetooth/btbcm.c                          |   3 +
 drivers/bluetooth/btnxpuart.c                      |   3 +-
 drivers/bluetooth/btrtl.c                          |   4 +-
 drivers/bluetooth/btusb.c                          |   7 +
 drivers/char/ipmi/ipmb_dev_int.c                   |   3 +
 drivers/char/ipmi/ssif_bmc.c                       |   5 +-
 drivers/clk/analogbits/wrpll-cln28hpc.c            |   2 +-
 drivers/clk/clk.c                                  |   4 +-
 drivers/clk/imx/clk-imx8mp.c                       |   5 +-
 drivers/clk/imx/clk-imx93.c                        |  32 ++--
 drivers/clk/mmp/clk-pxa1908-apbc.c                 |   4 +-
 drivers/clk/mmp/clk-pxa1908-apbcp.c                |   4 +-
 drivers/clk/mmp/clk-pxa1908-mpmu.c                 |   4 +-
 drivers/clk/qcom/camcc-x1e80100.c                  |   7 +
 drivers/clk/qcom/gcc-sdm845.c                      |  32 ++--
 drivers/clk/qcom/gcc-x1e80100.c                    |   2 +-
 drivers/clk/ralink/clk-mtmips.c                    |   1 -
 drivers/clk/renesas/renesas-cpg-mssr.c             |   2 +-
 drivers/clk/sunxi-ng/ccu-sun50i-a64.c              |  13 +-
 drivers/clk/thead/clk-th1520-ap.c                  |  13 +-
 drivers/cpufreq/acpi-cpufreq.c                     |  36 +++--
 drivers/cpufreq/amd-pstate.c                       |   2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c                  |  34 ++--
 drivers/crypto/caam/blob_gen.c                     |   3 +-
 drivers/crypto/hisilicon/sec2/sec.h                |   3 +-
 drivers/crypto/hisilicon/sec2/sec_crypto.c         | 157 +++++++++---------
 drivers/crypto/hisilicon/sec2/sec_crypto.h         |  11 --
 drivers/crypto/intel/iaa/iaa_crypto_main.c         |   2 +-
 drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c        |   3 +
 drivers/crypto/tegra/tegra-se-aes.c                |   7 +-
 drivers/crypto/tegra/tegra-se-hash.c               |   7 +-
 drivers/dma/ti/edma.c                              |   3 +-
 drivers/firewire/device-attribute-test.c           |   2 +
 drivers/firmware/efi/sysfb_efi.c                   |   2 +-
 drivers/firmware/qcom/qcom_scm.c                   |  42 +++--
 drivers/gpio/gpio-mxc.c                            |   3 +-
 drivers/gpio/gpio-pca953x.c                        |   3 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c  |   6 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c            |   8 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c           |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c            |   1 +
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c            |   2 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  12 +-
 .../gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c   |   3 +
 .../gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c |  10 +-
 .../gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.h |   2 +
 .../gpu/drm/amd/display/dc/hubp/dcn20/dcn20_hubp.c |   1 +
 .../drm/amd/display/dc/hubp/dcn201/dcn201_hubp.c   |   1 +
 .../gpu/drm/amd/display/dc/hubp/dcn21/dcn21_hubp.c |   3 +
 .../gpu/drm/amd/display/dc/hubp/dcn30/dcn30_hubp.c |   3 +
 .../gpu/drm/amd/display/dc/hubp/dcn31/dcn31_hubp.c |   1 +
 .../gpu/drm/amd/display/dc/hubp/dcn32/dcn32_hubp.c |   1 +
 .../gpu/drm/amd/display/dc/hubp/dcn35/dcn35_hubp.c |   1 +
 .../drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c   |   3 +-
 .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c    |   2 +
 .../drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c    |   2 +
 drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h       |   2 +
 .../gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c    |   2 +
 .../drm/amd/pm/powerplay/hwmgr/vega10_powertune.c  |   5 +-
 drivers/gpu/drm/bridge/ite-it6505.c                |   2 +-
 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |   8 +
 drivers/gpu/drm/etnaviv/etnaviv_gem.c              |  16 +-
 drivers/gpu/drm/i915/display/intel_crt.c           |  10 +-
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c              |   8 +-
 .../drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h    |   2 +
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_4_1_sdm670.h |  54 ++++++-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h |   2 +
 .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h    |   2 +
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h |   2 +
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h |   2 +
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h |   2 +
 .../drm/msm/disp/dpu1/catalog/dpu_9_2_x1e80100.h   |   2 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |  15 +-
 drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c  |   2 +-
 drivers/gpu/drm/msm/dp/dp_audio.c                  |   2 +-
 drivers/gpu/drm/msm/dp/dp_catalog.c                |   1 -
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   |   2 +-
 drivers/gpu/drm/msm/dp/dp_utils.c                  |  10 +-
 drivers/gpu/drm/msm/dp/dp_utils.h                  |   2 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c           |   2 +-
 drivers/gpu/drm/msm/msm_kms.c                      |   1 -
 drivers/gpu/drm/panthor/panthor_device.c           |   4 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c       | 115 ++++++++++---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.h       |  10 ++
 drivers/gpu/drm/rockchip/rockchip_vop2_reg.c       |  26 ++-
 drivers/gpu/drm/v3d/v3d_debugfs.c                  |   4 +-
 drivers/gpu/drm/v3d/v3d_perfmon.c                  |  15 +-
 drivers/gpu/drm/v3d/v3d_regs.h                     |  29 ++--
 drivers/hid/hid-core.c                             |   2 +
 drivers/hid/hid-input.c                            |  37 ++---
 drivers/hid/hid-multitouch.c                       |   2 +-
 drivers/hid/hid-thrustmaster.c                     |   8 +
 drivers/hwmon/Kconfig                              |   4 +-
 drivers/hwmon/nct6775-core.c                       |   6 +-
 drivers/i2c/busses/i2c-designware-common.c         |   5 +-
 drivers/i2c/busses/i2c-designware-master.c         |   5 +-
 drivers/i2c/busses/i2c-designware-slave.c          |   5 +-
 drivers/i3c/master/dw-i3c-master.c                 |   1 +
 drivers/infiniband/hw/Makefile                     |   2 +-
 drivers/infiniband/hw/bnxt_re/ib_verbs.c           |   7 +-
 drivers/infiniband/hw/cxgb4/device.c               |   6 +-
 drivers/infiniband/hw/cxgb4/qp.c                   |   8 +
 drivers/infiniband/hw/hns/Kconfig                  |  20 +--
 drivers/infiniband/hw/hns/Makefile                 |   9 +-
 drivers/infiniband/hw/mlx4/main.c                  |   8 +-
 drivers/infiniband/hw/mlx5/odp.c                   |  62 +++++---
 drivers/infiniband/sw/rxe/rxe_param.h              |   2 +-
 drivers/infiniband/sw/rxe/rxe_pool.c               |  11 +-
 drivers/infiniband/sw/rxe/rxe_verbs.c              |   5 +-
 drivers/infiniband/ulp/rtrs/rtrs.c                 |   3 +
 drivers/infiniband/ulp/srp/ib_srp.c                |   1 -
 drivers/iommu/amd/amd_iommu.h                      |   5 +-
 drivers/iommu/amd/init.c                           |  14 +-
 drivers/iommu/amd/iommu.c                          | 132 +++++----------
 drivers/iommu/amd/pasid.c                          |   3 +-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c        |  17 +-
 drivers/iommu/intel/pasid.c                        |  22 ++-
 drivers/iommu/intel/pasid.h                        |   6 +
 drivers/iommu/iommufd/iova_bitmap.c                |   2 +-
 drivers/iommu/iommufd/main.c                       |   2 +-
 drivers/iommu/riscv/iommu.c                        |   2 +-
 drivers/leds/leds-cht-wcove.c                      |   6 +-
 drivers/leds/leds-netxbig.c                        |   1 +
 drivers/mailbox/mailbox-mpfs.c                     |   2 +-
 drivers/mailbox/mailbox-th1520.c                   |   6 +-
 drivers/md/md-bitmap.c                             |  79 +++++----
 drivers/md/md-bitmap.h                             |   7 +-
 drivers/md/md.c                                    |  34 ++++
 drivers/md/md.h                                    |   5 +
 drivers/md/raid1.c                                 |  34 +---
 drivers/md/raid1.h                                 |   1 -
 drivers/md/raid10.c                                |  26 +--
 drivers/md/raid10.h                                |   1 -
 drivers/md/raid5-cache.c                           |   4 -
 drivers/md/raid5.c                                 | 111 ++++++-------
 drivers/md/raid5.h                                 |   4 -
 drivers/media/i2c/imx290.c                         |   3 +-
 drivers/media/i2c/imx412.c                         |  42 ++---
 drivers/media/i2c/ov9282.c                         |   2 +-
 drivers/media/platform/marvell/mcam-core.c         |   7 +-
 drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c     |   7 +-
 .../media/platform/nxp/imx8-isi/imx8-isi-video.c   |   3 +
 .../media/platform/samsung/exynos4-is/mipi-csis.c  |  10 +-
 .../media/platform/samsung/s3c-camif/camif-core.c  |  13 +-
 drivers/media/rc/iguanair.c                        |   4 +-
 drivers/media/usb/dvb-usb-v2/af9035.c              |  18 ++-
 drivers/media/usb/dvb-usb-v2/lmedm04.c             |  12 +-
 drivers/media/usb/uvc/uvc_queue.c                  |   3 +-
 drivers/media/usb/uvc/uvc_status.c                 |   4 +
 drivers/memory/tegra/tegra20-emc.c                 |   8 +-
 drivers/mfd/syscon.c                               |  19 +--
 drivers/misc/cardreader/rtsx_usb.c                 |  15 ++
 drivers/mtd/hyperbus/hbmc-am654.c                  |  19 ++-
 drivers/mtd/nand/raw/brcmnand/brcmnand.c           |   5 +
 drivers/mtd/ubi/ubi.h                              |   2 -
 drivers/mtd/ubi/wl.c                               |  21 ---
 drivers/net/bonding/bond_main.c                    |  19 +--
 drivers/net/ethernet/broadcom/bgmac.h              |   3 +-
 drivers/net/ethernet/davicom/dm9000.c              |   3 +-
 drivers/net/ethernet/freescale/fec_main.c          |  31 +++-
 drivers/net/ethernet/hisilicon/hns3/hnae3.c        |  15 ++
 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |   2 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |   2 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |   2 +
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |   2 +
 drivers/net/ethernet/intel/iavf/iavf_main.c        |  19 ++-
 drivers/net/ethernet/intel/ice/ice_adminq_cmd.h    |   1 -
 drivers/net/ethernet/intel/ice/ice_ethtool.c       |   1 -
 drivers/net/ethernet/intel/ice/ice_ethtool.h       |   1 -
 drivers/net/ethernet/intel/ice/ice_parser.h        |   6 +-
 drivers/net/ethernet/intel/ice/ice_parser_rt.c     |  12 +-
 drivers/net/ethernet/intel/idpf/idpf_controlq.c    |   6 +
 drivers/net/ethernet/intel/idpf/idpf_main.c        |  15 +-
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c    |  14 +-
 .../net/ethernet/marvell/octeon_ep/octep_main.c    |  10 --
 .../ethernet/marvell/octeon_ep_vf/octep_vf_main.c  |   8 -
 drivers/net/ethernet/mediatek/airoha_eth.c         |  37 +++--
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   2 +-
 .../mellanox/mlx5/core/steering/hws/definer.c      |   2 +-
 drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c    |   2 -
 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c  |   8 +-
 drivers/net/ethernet/renesas/ravb_main.c           |  22 ++-
 drivers/net/ethernet/renesas/sh_eth.c              |   4 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  30 ++++
 drivers/net/ethernet/ti/am65-cpsw-nuss.c           |   2 +-
 drivers/net/netdevsim/netdevsim.h                  |   1 +
 drivers/net/netdevsim/udp_tunnels.c                |  23 +--
 drivers/net/phy/marvell-88q2xxx.c                  |  33 +++-
 drivers/net/phy/realtek.c                          |  29 ++--
 drivers/net/tap.c                                  |   6 +-
 drivers/net/team/team_core.c                       |   7 +
 drivers/net/tun.c                                  |   6 +-
 drivers/net/usb/rtl8150.c                          |  22 +++
 drivers/net/vxlan/vxlan_vnifilter.c                |   5 +
 drivers/net/wireless/ath/ath11k/dp_rx.c            |   1 +
 drivers/net/wireless/ath/ath11k/hal_rx.c           |   3 +-
 drivers/net/wireless/ath/ath12k/mac.c              |  42 ++---
 drivers/net/wireless/ath/wcn36xx/main.c            |   5 +-
 .../wireless/broadcom/brcm80211/brcmfmac/fwil.h    |   2 +
 drivers/net/wireless/intel/iwlwifi/fw/uefi.c       |  44 +++--
 drivers/net/wireless/intel/iwlwifi/mvm/coex.c      |   9 +-
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c        |  18 ---
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   4 +-
 drivers/net/wireless/mediatek/mt76/mac80211.c      |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c    |   2 +-
 .../net/wireless/mediatek/mt76/mt76_connac_mcu.c   |   2 +-
 .../net/wireless/mediatek/mt76/mt76_connac_mcu.h   |   1 +
 drivers/net/wireless/mediatek/mt76/mt7915/init.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c    |   7 +
 drivers/net/wireless/mediatek/mt76/mt7915/main.c   |   9 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mmio.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h |   1 +
 drivers/net/wireless/mediatek/mt76/mt7915/pci.c    |   1 +
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c    |   1 +
 drivers/net/wireless/mediatek/mt76/mt7921/main.c   |   9 +-
 drivers/net/wireless/mediatek/mt76/mt7925/mac.c    |   6 +-
 drivers/net/wireless/mediatek/mt76/mt7925/main.c   | 109 +++++++++----
 drivers/net/wireless/mediatek/mt76/mt7925/mcu.c    | 142 +++++++++++------
 drivers/net/wireless/mediatek/mt76/mt7925/mcu.h    |   5 +-
 drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h |   2 +
 drivers/net/wireless/mediatek/mt76/mt792x.h        |   7 +-
 drivers/net/wireless/mediatek/mt76/mt792x_core.c   |   3 +-
 drivers/net/wireless/mediatek/mt76/mt792x_mac.c    |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7996/init.c   |  20 +--
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c    |   5 +-
 drivers/net/wireless/mediatek/mt76/mt7996/main.c   |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c    |  47 ++++--
 drivers/net/wireless/mediatek/mt76/mt7996/mmio.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/usb.c           |   4 +-
 drivers/net/wireless/microchip/wilc1000/netdev.c   |   2 -
 drivers/net/wireless/microchip/wilc1000/sdio.c     |   9 +-
 drivers/net/wireless/microchip/wilc1000/spi.c      |   9 +-
 drivers/net/wireless/realtek/rtlwifi/base.c        |  13 +-
 drivers/net/wireless/realtek/rtlwifi/base.h        |   1 -
 drivers/net/wireless/realtek/rtlwifi/pci.c         |  61 ++-----
 .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c    |   7 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   |   4 +-
 drivers/net/wireless/realtek/rtlwifi/usb.c         |  12 +-
 drivers/net/wireless/realtek/rtlwifi/wifi.h        |  12 --
 drivers/net/wireless/realtek/rtw89/chan.c          |  31 +++-
 drivers/net/wireless/realtek/rtw89/chan.h          |   9 +-
 drivers/net/wireless/realtek/rtw89/core.c          |  11 +-
 drivers/net/wireless/realtek/rtw89/core.h          |   3 +
 drivers/net/wireless/realtek/rtw89/fw.c            |  40 ++++-
 drivers/net/wireless/realtek/rtw89/mac80211.c      |  12 +-
 drivers/net/wireless/ti/wlcore/main.c              |  10 +-
 drivers/nvme/host/core.c                           |  34 +++-
 drivers/nvme/host/tcp.c                            |  70 ++++++--
 drivers/of/fdt.c                                   |  10 +-
 drivers/of/of_reserved_mem.c                       |   3 +-
 drivers/of/property.c                              |   2 +-
 drivers/opp/core.c                                 |  57 +++++--
 drivers/opp/of.c                                   |   4 +-
 drivers/pci/controller/dwc/pci-imx6.c              |  30 ++--
 drivers/pci/controller/dwc/pcie-designware-host.c  |   1 +
 drivers/pci/controller/dwc/pcie-qcom.c             |   2 +
 drivers/pci/controller/pcie-rcar-ep.c              |   2 +-
 drivers/pci/controller/pcie-rockchip-ep.c          |   5 +
 drivers/pci/controller/plda/pcie-microchip-host.c  |  96 +++++++++++
 drivers/pci/controller/plda/pcie-plda-host.c       |  17 +-
 drivers/pci/controller/plda/pcie-plda.h            |   6 +-
 drivers/pci/endpoint/functions/pci-epf-test.c      |   6 +-
 drivers/pci/endpoint/pci-epc-core.c                |   2 +-
 drivers/pci/pcie/aspm.c                            |  35 +++-
 drivers/phy/freescale/phy-fsl-samsung-hdmi.c       |  30 ++--
 drivers/pinctrl/nomadik/pinctrl-nomadik.c          |  35 +++-
 drivers/pinctrl/pinctrl-amd.c                      |  27 +++-
 drivers/pinctrl/pinctrl-amd.h                      |   7 +-
 drivers/pinctrl/samsung/pinctrl-exynos.c           |   3 +-
 drivers/pinctrl/stm32/pinctrl-stm32.c              |  76 ++++-----
 drivers/platform/mellanox/mlxbf-pmc.c              |   6 +-
 drivers/platform/x86/x86-android-tablets/core.c    |   4 +-
 drivers/platform/x86/x86-android-tablets/lenovo.c  |   4 +-
 drivers/platform/x86/x86-android-tablets/other.c   |   4 +-
 drivers/pps/clients/pps-gpio.c                     |   4 +-
 drivers/pps/clients/pps-ktimer.c                   |   4 +-
 drivers/pps/clients/pps-ldisc.c                    |   6 +-
 drivers/pps/clients/pps_parport.c                  |   4 +-
 drivers/pps/kapi.c                                 |  10 +-
 drivers/pps/kc.c                                   |  10 +-
 drivers/pps/pps.c                                  | 127 ++++++++-------
 drivers/ptp/ptp_chardev.c                          |   4 +
 drivers/ptp/ptp_ocp.c                              |   2 +-
 drivers/pwm/core.c                                 |  13 +-
 drivers/pwm/pwm-stm32-lp.c                         |   8 +-
 drivers/pwm/pwm-stm32.c                            |   7 +-
 drivers/regulator/core.c                           |   2 +-
 drivers/regulator/of_regulator.c                   |  14 +-
 drivers/remoteproc/mtk_scp.c                       |  12 +-
 drivers/remoteproc/remoteproc_core.c               |  14 +-
 drivers/rtc/rtc-loongson.c                         |  13 +-
 drivers/rtc/rtc-pcf85063.c                         |  11 +-
 drivers/rtc/rtc-tps6594.c                          |   2 +-
 drivers/s390/char/sclp.c                           |  12 +-
 drivers/scsi/mpi3mr/mpi3mr_app.c                   |   8 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c                |   3 +-
 drivers/scsi/sd.c                                  |  17 +-
 drivers/scsi/sr.c                                  |   5 +-
 drivers/soc/atmel/soc.c                            |   2 +-
 drivers/spi/spi-omap2-mcspi.c                      |  11 +-
 drivers/spi/spi-zynq-qspi.c                        |  13 +-
 drivers/staging/media/imx/imx-media-of.c           |   8 +-
 drivers/staging/media/max96712/max96712.c          |   4 +-
 drivers/tty/mips_ejtag_fdc.c                       |   4 +-
 drivers/tty/serial/8250/8250_port.c                |  32 +++-
 drivers/ufs/core/ufs_bsg.c                         |   1 +
 drivers/usb/dwc3/core.c                            |  35 ++--
 drivers/usb/dwc3/dwc3-am62.c                       |   1 +
 drivers/usb/gadget/function/f_tcm.c                |  14 +-
 drivers/usb/host/xhci-ring.c                       |   3 +-
 drivers/usb/typec/tcpm/tcpci.c                     |  13 +-
 drivers/usb/typec/tcpm/tcpm.c                      |  10 +-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c      |   1 +
 drivers/watchdog/rti_wdt.c                         |   1 +
 fs/afs/dir.c                                       |   7 +-
 fs/afs/internal.h                                  |   9 ++
 fs/afs/rxrpc.c                                     |  12 +-
 fs/afs/xdr_fs.h                                    |   2 +-
 fs/afs/yfsclient.c                                 |   5 +-
 fs/btrfs/inode.c                                   | 160 ++++++++++++++-----
 fs/btrfs/qgroup.c                                  |  21 ++-
 fs/btrfs/subpage.c                                 |   6 +-
 fs/btrfs/subpage.h                                 |  13 ++
 fs/btrfs/super.c                                   |   2 +-
 fs/dlm/lock.c                                      |  46 ++++--
 fs/dlm/lowcomms.c                                  |   3 +-
 fs/erofs/zdata.c                                   |   3 +-
 fs/f2fs/dir.c                                      |  53 ++++--
 fs/f2fs/f2fs.h                                     |   6 +-
 fs/f2fs/inline.c                                   |   5 +-
 fs/file_table.c                                    |   2 +-
 fs/hostfs/hostfs_kern.c                            |  27 +---
 fs/nfs/localio.c                                   |   4 +-
 fs/nfs/nfs42proc.c                                 |   2 +-
 fs/nfs/nfs42xdr.c                                  |   2 +
 fs/nfs_common/common.c                             |  89 +++++++++--
 fs/nilfs2/dir.c                                    |  13 +-
 fs/nilfs2/namei.c                                  |  29 ++--
 fs/nilfs2/nilfs.h                                  |   4 +-
 fs/nilfs2/page.c                                   |  31 +++-
 fs/nilfs2/segment.c                                |   4 +-
 fs/ocfs2/quota_global.c                            |   5 +
 fs/pstore/blk.c                                    |   4 +-
 fs/select.c                                        |   4 +-
 fs/smb/client/cifsacl.c                            |  25 +--
 fs/smb/client/cifsproto.h                          |   2 +-
 fs/smb/client/cifssmb.c                            |   4 +-
 fs/smb/client/readdir.c                            |   2 +-
 fs/smb/client/reparse.c                            |  22 ++-
 fs/smb/client/smb2ops.c                            |   3 +-
 fs/ubifs/debug.c                                   |  22 +--
 fs/xfs/xfs_buf.c                                   |   3 +-
 fs/xfs/xfs_buf_item_recover.c                      |  11 +-
 fs/xfs/xfs_dquot.c                                 |  12 +-
 fs/xfs/xfs_notify_failure.c                        | 121 +++++++++-----
 fs/xfs/xfs_qm_bhv.c                                |  27 ++--
 include/acpi/acpixf.h                              |   1 +
 include/dt-bindings/clock/imx93-clock.h            |   1 +
 include/linux/alloc_tag.h                          |  11 +-
 include/linux/blkdev.h                             |  23 +--
 include/linux/btf.h                                |   5 +
 include/linux/coredump.h                           |   4 +-
 include/linux/hid.h                                |   1 +
 include/linux/ieee80211.h                          |  11 +-
 include/linux/kallsyms.h                           |   2 +-
 include/linux/mroute_base.h                        |   6 +-
 include/linux/netdevice.h                          |   2 +-
 include/linux/nfs_common.h                         |   3 +-
 include/linux/perf_event.h                         |   6 +
 include/linux/pm.h                                 |   1 +
 include/linux/pps_kernel.h                         |   3 +-
 include/linux/ptr_ring.h                           |  21 ++-
 include/linux/pwm.h                                |  17 ++
 include/linux/sched.h                              |   1 +
 include/linux/skb_array.h                          |  17 +-
 include/linux/usb/tcpm.h                           |   3 +-
 include/net/ax25.h                                 |  10 +-
 include/net/inetpeer.h                             |  12 +-
 include/net/netfilter/nf_tables.h                  |   6 +
 include/net/page_pool/types.h                      |   1 -
 include/net/pkt_cls.h                              |  13 +-
 include/net/sch_generic.h                          |   5 +-
 include/net/xfrm.h                                 |  16 +-
 include/sound/hdaudio_ext.h                        |  45 ------
 include/trace/events/afs.h                         |   2 +
 include/trace/events/rxrpc.h                       |  25 +++
 io_uring/io_uring.c                                |   1 +
 io_uring/msg_ring.c                                |   4 +-
 io_uring/register.c                                |   2 +-
 io_uring/uring_cmd.c                               |   2 +-
 kernel/bpf/arena.c                                 |   8 +-
 kernel/bpf/bpf_local_storage.c                     |   8 +-
 kernel/bpf/bpf_struct_ops.c                        |  21 +++
 kernel/bpf/btf.c                                   |   5 -
 kernel/bpf/helpers.c                               |  18 ++-
 kernel/events/core.c                               |  35 ++--
 kernel/events/uprobes.c                            |   4 +
 kernel/fork.c                                      |  17 +-
 kernel/irq/internals.h                             |   9 +-
 kernel/module/main.c                               |   7 +-
 kernel/padata.c                                    |  45 ++++--
 kernel/power/hibernate.c                           |   7 +-
 kernel/printk/internal.h                           |   6 +
 kernel/printk/printk.c                             |   5 +
 kernel/printk/printk_safe.c                        |   7 +-
 kernel/sched/core.c                                |   6 +-
 kernel/sched/cpufreq_schedutil.c                   |   4 +-
 kernel/sched/ext.c                                 | 114 +++++++++----
 kernel/sched/fair.c                                |  21 ++-
 kernel/sched/features.h                            |   9 ++
 kernel/sched/stats.h                               |   4 +
 kernel/sched/syscalls.c                            |   2 +-
 kernel/trace/bpf_trace.c                           |  13 +-
 lib/alloc_tag.c                                    |   2 +
 lib/rhashtable.c                                   |  12 +-
 mm/memcontrol.c                                    |   7 +-
 mm/oom_kill.c                                      |   8 +-
 net/ax25/af_ax25.c                                 |  12 +-
 net/ax25/ax25_dev.c                                |   4 +-
 net/ax25/ax25_ip.c                                 |   3 +-
 net/ax25/ax25_out.c                                |  22 ++-
 net/ax25/ax25_route.c                              |   2 +
 net/core/dev.c                                     |  23 ++-
 net/core/filter.c                                  |   2 +-
 net/core/page_pool.c                               |   2 +
 net/core/page_pool_priv.h                          |   2 +
 net/core/page_pool_user.c                          |  15 +-
 net/core/sysctl_net_core.c                         |   5 +-
 net/ethtool/ioctl.c                                |   2 +-
 net/ethtool/netlink.c                              |   2 +-
 net/hsr/hsr_forward.c                              |   7 +-
 net/ipv4/icmp.c                                    |   9 +-
 net/ipv4/inetpeer.c                                |  31 +---
 net/ipv4/ip_fragment.c                             |  15 +-
 net/ipv4/ipmr.c                                    |  28 ++--
 net/ipv4/ipmr_base.c                               |   9 +-
 net/ipv4/route.c                                   |  17 +-
 net/ipv4/tcp_cubic.c                               |   8 +-
 net/ipv4/tcp_output.c                              |   9 +-
 net/ipv4/udp.c                                     |  56 +++++++
 net/ipv6/icmp.c                                    |   6 +-
 net/ipv6/ip6_output.c                              |   6 +-
 net/ipv6/ip6mr.c                                   |  28 ++--
 net/ipv6/ndisc.c                                   |   8 +-
 net/ipv6/udp.c                                     |  50 ++++++
 net/mac80211/debugfs_netdev.c                      |   2 +-
 net/mac80211/driver-ops.h                          |   3 +
 net/mac80211/rx.c                                  |   1 +
 net/mptcp/ctrl.c                                   |   4 +-
 net/mptcp/options.c                                |  13 +-
 net/mptcp/pm_netlink.c                             |   3 +-
 net/mptcp/protocol.c                               |   4 +-
 net/mptcp/protocol.h                               |  30 ++--
 net/ncsi/ncsi-rsp.c                                |  18 +--
 net/netfilter/nf_tables_api.c                      |  57 ++++++-
 net/netfilter/nft_flow_offload.c                   |  16 +-
 net/netfilter/nft_set_rbtree.c                     |  43 +++++
 net/rose/af_rose.c                                 |  16 +-
 net/rose/rose_timer.c                              |  15 ++
 net/rxrpc/conn_event.c                             |  12 +-
 net/rxrpc/peer_event.c                             |  16 +-
 net/rxrpc/peer_object.c                            |  12 +-
 net/sched/cls_api.c                                |  57 +++----
 net/sched/cls_bpf.c                                |   2 +
 net/sched/cls_flower.c                             |   2 +
 net/sched/cls_matchall.c                           |   2 +
 net/sched/cls_u32.c                                |   4 +
 net/sched/sch_api.c                                |   4 +
 net/sched/sch_generic.c                            |   4 +-
 net/sched/sch_sfq.c                                |   4 +
 net/smc/af_smc.c                                   |   2 +-
 net/smc/smc_rx.c                                   |  37 +++--
 net/smc/smc_rx.h                                   |   8 +-
 net/sunrpc/svcsock.c                               |  12 +-
 net/vmw_vsock/af_vsock.c                           |  13 +-
 net/wireless/scan.c                                |   7 +-
 net/wireless/tests/scan.c                          |   2 +
 net/xfrm/xfrm_replay.c                             |  10 +-
 net/xfrm/xfrm_state.c                              |  93 ++++++++---
 samples/landlock/sandboxer.c                       |   7 +
 scripts/Makefile.build                             |   2 +
 scripts/Makefile.lib                               |  10 +-
 scripts/Makefile.modinst                           |   2 +-
 scripts/genksyms/genksyms.c                        |  11 +-
 scripts/genksyms/genksyms.h                        |   2 +-
 scripts/genksyms/parse.y                           |  18 ++-
 scripts/kconfig/confdata.c                         |   6 +-
 scripts/kconfig/symbol.c                           |   1 +
 security/landlock/fs.c                             |  11 +-
 sound/core/seq/Kconfig                             |   4 +-
 sound/pci/hda/patch_realtek.c                      |   1 +
 sound/soc/amd/acp/acp-i2s.c                        |   1 +
 sound/soc/codecs/Makefile                          |   8 +-
 sound/soc/codecs/da7213.c                          |   2 +
 sound/soc/intel/avs/apl.c                          |   3 +-
 sound/soc/intel/avs/cnl.c                          |   1 +
 sound/soc/intel/avs/core.c                         |  14 +-
 sound/soc/intel/avs/loader.c                       |   2 +-
 sound/soc/intel/avs/registers.h                    |  45 ++++++
 sound/soc/intel/avs/skl.c                          |   1 +
 sound/soc/intel/avs/topology.c                     |   4 +-
 sound/soc/intel/boards/sof_sdw.c                   |  47 ++++--
 sound/soc/mediatek/mt8365/Makefile                 |   2 +-
 sound/soc/renesas/rz-ssi.c                         |   3 +-
 sound/soc/rockchip/rockchip_i2s_tdm.c              |  31 +++-
 sound/soc/sdca/Makefile                            |   2 +-
 sound/soc/sunxi/sun4i-spdif.c                      |   7 +
 sound/usb/quirks.c                                 |   2 +
 tools/bootconfig/main.c                            |   4 +-
 tools/build/Makefile.feature                       |   7 -
 tools/build/feature/test-all.c                     |   5 -
 tools/include/uapi/linux/if_xdp.h                  |   4 +-
 tools/lib/bpf/btf.c                                |   1 +
 tools/lib/bpf/btf_relocate.c                       |   2 +-
 tools/lib/bpf/linker.c                             |  22 +--
 tools/lib/bpf/usdt.c                               |   2 +-
 tools/net/ynl/lib/ynl.c                            |   2 +-
 tools/perf/MANIFEST                                |   1 +
 tools/perf/Makefile.config                         |  83 ++++++----
 tools/perf/builtin-inject.c                        |   8 +-
 tools/perf/builtin-lock.c                          |  66 +++++---
 tools/perf/builtin-report.c                        |   2 +-
 tools/perf/builtin-top.c                           |   2 +-
 tools/perf/builtin-trace.c                         |   6 +-
 .../perf/tests/shell/lib/perf_json_output_lint.py  |  14 +-
 tools/perf/tests/shell/stat.sh                     |   6 +-
 tools/perf/tests/shell/trace_btf_enum.sh           |   8 +-
 tools/perf/util/annotate.c                         |  76 ++++++++-
 tools/perf/util/annotate.h                         |  15 +-
 tools/perf/util/bpf-event.c                        |  10 +-
 .../util/bpf_skel/augmented_raw_syscalls.bpf.c     |  11 +-
 tools/perf/util/disasm.c                           |  83 ++--------
 tools/perf/util/env.c                              |  13 +-
 tools/perf/util/env.h                              |   4 +-
 tools/perf/util/expr.c                             |   5 +-
 tools/perf/util/header.c                           |   8 +-
 tools/perf/util/machine.c                          |   2 +-
 tools/perf/util/maps.c                             |   7 +-
 tools/perf/util/namespaces.c                       |   7 +-
 tools/perf/util/namespaces.h                       |   3 +-
 tools/perf/util/stat-display.c                     | 177 +++++++++++----------
 tools/perf/util/symbol.c                           |   9 +-
 .../cpupower/utils/idle_monitor/mperf_monitor.c    |  15 +-
 tools/power/x86/turbostat/turbostat.c              |  58 ++++++-
 tools/testing/ktest/ktest.pl                       |   7 +-
 tools/testing/selftests/bpf/Makefile               |   4 +-
 .../testing/selftests/bpf/prog_tests/btf_distill.c |   4 +-
 .../selftests/bpf/prog_tests/fill_link_info.c      |   4 +
 .../selftests/bpf/progs/test_fill_link_info.c      |  13 +-
 tools/testing/selftests/bpf/test_tc_tunnel.sh      |   1 +
 tools/testing/selftests/bpf/veristat.c             |   1 +
 tools/testing/selftests/bpf/xdp_hw_metadata.c      |   2 +-
 .../drivers/net/netdevsim/udp_tunnel_nic.sh        |  16 +-
 .../ftrace/test.d/00basic/mount_options.tc         |   8 +-
 tools/testing/selftests/kselftest/ktap_helpers.sh  |   2 +-
 tools/testing/selftests/kselftest_harness.h        |  24 +--
 tools/testing/selftests/landlock/Makefile          |   4 +-
 tools/testing/selftests/landlock/fs_test.c         |   3 +-
 tools/testing/selftests/mm/Makefile                |   9 +-
 tools/testing/selftests/net/lib/Makefile           |   2 +-
 tools/testing/selftests/net/mptcp/Makefile         |   2 +-
 tools/testing/selftests/net/openvswitch/Makefile   |   2 +-
 .../selftests/powerpc/benchmarks/gettimeofday.c    |   2 +-
 tools/testing/selftests/rseq/rseq.c                |  32 +++-
 tools/testing/selftests/rseq/rseq.h                |   9 +-
 .../testing/selftests/timers/clocksource-switch.c  |   6 +-
 703 files changed, 5738 insertions(+), 3278 deletions(-)
author maintainer
#1 lore raw

PATCH 1/623 coredump: Do not lock during comm reporting

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

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

From: Kees Cook <[email protected]>

[ Upstream commit 200f091c95bbc4b8660636bd345805c45d6eced7 ]

The 'comm' member will always be NUL terminated, and this is not fast-path, so we can just perform a direct memcpy during a coredump instead of potentially deadlocking while holding the task struct lock.

---
 include/linux/coredump.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/coredump.h +2 -2
index 45e598fe34766..77e6e195d1d68 100644
@@ -52,8 +52,8 @@ extern void do_coredump(const kernel_siginfo_t *siginfo);
 #define __COREDUMP_PRINTK(Level, Format, ...) \
 	do {	\
 		char comm[TASK_COMM_LEN];	\
-	\
-		get_task_comm(comm, current);	\
+		/* This will always be NUL terminated. */ \
+		memcpy(comm, current->comm, sizeof(comm)); \
 		printk_ratelimited(Level "coredump: %d(%*pE): " Format "\n",	\
 			task_tgid_vnr(current), (int)strlen(comm), comm, ##__VA_ARGS__);	\
 	} while (0)	\
Signature · 1 line
2.39.5
author maintainer
#2 lore raw

PATCH 2/623 powerpc/book3s64/hugetlb: Fix disabling hugetlb when fadump is active

In reply to Greg Kroah-Hartman

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

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

From: Sourabh Jain <[email protected]>

[ Upstream commit d629d7a8efc33d05d62f4805c0ffb44727e3d99f ]

Commit 8597538712eb ("powerpc/fadump: Do not use hugepages when fadump is active") disabled hugetlb support when fadump is active by returning early from hugetlbpage_init():arch/powerpc/mm/hugetlbpage.c and not populating hpage_shift/HPAGE_SHIFT.

Later, commit 2354ad252b66 ("powerpc/mm: Update default hugetlb size early") moved the allocation of hpage_shift/HPAGE_SHIFT to early boot, which inadvertently re-enabled hugetlb support when fadump is active.

Fix this by implementing hugepages_supported() on powerpc. This ensures that disabling hugetlb for the fadump kernel is independent of hpage_shift/HPAGE_SHIFT.

---
 arch/powerpc/include/asm/hugetlb.h | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/powerpc/include/asm/hugetlb.h +9 -0
index 18a3028ac3b6d..dad2e7980f245 100644
@@ -15,6 +15,15 @@
 
 extern bool hugetlb_disabled;
 
+static inline bool hugepages_supported(void)
+{
+	if (hugetlb_disabled)
+		return false;
+
+	return HPAGE_SHIFT != 0;
+}
+#define hugepages_supported hugepages_supported
+
 void __init hugetlbpage_init_defaultsize(void);
 
 int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
Signature · 1 line
2.39.5
author maintainer
#4 lore raw

PATCH 4/623 dlm: fix srcu_read_lock() return type to int

In reply to Greg Kroah-Hartman

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

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

From: Alexander Aring <[email protected]>

[ Upstream commit 57cdd1a1cf1464199678f9338049b63fb5d5b41c ]

The return type of srcu_read_lock() is int and not bool. Whereas we using the ret variable only to evaluate a bool type of dlm_lowcomms_con_has_addr() to check if an address is already being set.

Fixes 6f0b0b5d7ae7 ("fs: dlm: remove dlm_node_addrs lookup list")
---
 fs/dlm/lowcomms.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/dlm/lowcomms.c +2 -1
index df40c3fd10702..d28141829c051 100644
@@ -462,7 +462,8 @@ static bool dlm_lowcomms_con_has_addr(const struct connection *con,
 int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr)
 {
 	struct connection *con;
-	bool ret, idx;
+	bool ret;
+	int idx;
 
 	idx = srcu_read_lock(&connections_srcu);
 	con = nodeid2con(nodeid, GFP_NOFS);
Signature · 1 line
2.39.5
author maintainer
#5 lore raw

PATCH 5/623 afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY

In reply to Greg Kroah-Hartman

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

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

From: David Howells <[email protected]>

[ Upstream commit b49194da2aff2c879dec9c59ef8dec0f2b0809ef ]

AFS servers pass back a code indicating EEXIST when they're asked to remove a directory that is not empty rather than ENOTEMPTY because not all the systems that an AFS server can run on have the latter error available and AFS preexisted the addition of that error in general.

Fix afs_rmdir() to translate EEXIST to ENOTEMPTY.

---
 fs/afs/dir.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
fs/afs/dir.c +6 -1
index ada363af5aab8..50edd1cae28ac 100644
@@ -1472,7 +1472,12 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
 		op->file[1].vnode = vnode;
 	}
 
-	return afs_do_sync_operation(op);
+	ret = afs_do_sync_operation(op);
+
+	/* Not all systems that can host afs servers have ENOTEMPTY. */
+	if (ret == -EEXIST)
+		ret = -ENOTEMPTY;
+	return ret;
 
 error:
 	return afs_put_operation(op);
Signature · 1 line
2.39.5
author maintainer
#6 lore raw

PATCH 6/623 afs: Fix directory format encoding struct

In reply to Greg Kroah-Hartman

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

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

From: David Howells <[email protected]>

[ Upstream commit 07a10767853adcbdbf436dc91393b729b52c4e81 ]

The AFS directory format structure, union afs_xdr_dir_block::meta, has too many alloc counter slots declared and so pushes the hash table along and over the data. This doesn't cause a problem at the moment because I'm currently ignoring the hash table and only using the correct number of alloc_ctrs in the code anyway. In future, however, I should start using the hash table to try and speed up afs_lookup().

Fix this by using the correct constant to declare the counter array.

Fixes 4ea219a839bf ("afs: Split the directory content defs into a header")
cc Marc Dionne <[email protected]>
---
 fs/afs/xdr_fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/afs/xdr_fs.h +1 -1
index 8ca8681645077..cc5f143d21a34 100644
@@ -88,7 +88,7 @@ union afs_xdr_dir_block {
 
 	struct {
 		struct afs_xdr_dir_hdr	hdr;
-		u8			alloc_ctrs[AFS_DIR_MAX_BLOCKS];
+		u8			alloc_ctrs[AFS_DIR_BLOCKS_WITH_CTR];
 		__be16			hashtable[AFS_DIR_HASHTBL_SIZE];
 	} meta;
 
Signature · 1 line
2.39.5
author maintainer
#7 lore raw

PATCH 7/623 afs: Fix cleanup of immediately failed async calls

In reply to Greg Kroah-Hartman

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

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

From: David Howells <[email protected]>

[ Upstream commit 9750be93b2be12b6d92323b97d7c055099d279e6 ]

If we manage to begin an async call, but fail to transmit any data on it due to a signal, we then abort it which causes a race between the notification of call completion from rxrpc and our attempt to cancel the notification. The notification will be necessary, however, for async FetchData to terminate the netfs subrequest.

However, since we get a notification from rxrpc upon completion of a call (aborted or otherwise), we can just leave it to that.

This leads to calls not getting cleaned up, but appearing in /proc/net/rxrpc/calls as being aborted with code 6.

Fix this by making the "error_do_abort:" case of afs_make_call() abort the call and then abandon it to the notification handler.

---
 fs/afs/internal.h          |  9 +++++++++
 fs/afs/rxrpc.c             | 12 +++++++++---
 include/trace/events/afs.h |  2 ++
 3 files changed, 20 insertions(+), 3 deletions(-)
fs/afs/internal.h +9 -0
index c9d620175e80c..d9760b2a8d8de 100644
@@ -1346,6 +1346,15 @@ extern void afs_send_simple_reply(struct afs_call *, const void *, size_t);
 extern int afs_extract_data(struct afs_call *, bool);
 extern int afs_protocol_error(struct afs_call *, enum afs_eproto_cause);
 
+static inline void afs_see_call(struct afs_call *call, enum afs_call_trace why)
+{
+	int r = refcount_read(&call->ref);
+
+	trace_afs_call(call->debug_id, why, r,
+		       atomic_read(&call->net->nr_outstanding_calls),
+		       __builtin_return_address(0));
+}
+
 static inline void afs_make_op_call(struct afs_operation *op, struct afs_call *call,
 				    gfp_t gfp)
 {
fs/afs/rxrpc.c +9 -3
index 9f2a3bb56ec69..a122c6366ce19 100644
@@ -430,11 +430,16 @@ void afs_make_call(struct afs_call *call, gfp_t gfp)
 	return;
 
 error_do_abort:
-	if (ret != -ECONNABORTED) {
+	if (ret != -ECONNABORTED)
 		rxrpc_kernel_abort_call(call->net->socket, rxcall,
 					RX_USER_ABORT, ret,
 					afs_abort_send_data_error);
-	} else {
+	if (call->async) {
+		afs_see_call(call, afs_call_trace_async_abort);
+		return;
+	}
+
+	if (ret == -ECONNABORTED) {
 		len = 0;
 		iov_iter_kvec(&msg.msg_iter, ITER_DEST, NULL, 0, 0);
 		rxrpc_kernel_recv_data(call->net->socket, rxcall,
@@ -445,6 +450,8 @@ void afs_make_call(struct afs_call *call, gfp_t gfp)
 	call->error = ret;
 	trace_afs_call_done(call);
 error_kill_call:
+	if (call->async)
+		afs_see_call(call, afs_call_trace_async_kill);
 	if (call->type->done)
 		call->type->done(call);
 
@@ -602,7 +609,6 @@ static void afs_deliver_to_call(struct afs_call *call)
 	abort_code = 0;
 call_complete:
 	afs_set_call_complete(call, ret, remote_abort);
-	state = AFS_CALL_COMPLETE;
 	goto done;
 }
 
include/trace/events/afs.h +2 -0
index a0aed1a428a18..9a75590227f26 100644
@@ -118,6 +118,8 @@ enum yfs_cm_operation {
  */
 #define afs_call_traces \
 	EM(afs_call_trace_alloc,		"ALLOC") \
+	EM(afs_call_trace_async_abort,		"ASYAB") \
+	EM(afs_call_trace_async_kill,		"ASYKL") \
 	EM(afs_call_trace_free,			"FREE ") \
 	EM(afs_call_trace_get,			"GET  ") \
 	EM(afs_call_trace_put,			"PUT  ") \
Signature · 1 line
2.39.5
author maintainer
#8 lore raw

PATCH 8/623 fs: fix proc_handler for sysctl_nr_open

In reply to Greg Kroah-Hartman

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

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

From: Jinliang Zheng <[email protected]>

[ Upstream commit d727935cad9f6f52c8d184968f9720fdc966c669 ]

Use proc_douintvec_minmax() instead of proc_dointvec_minmax() to handle sysctl_nr_open, because its data type is unsigned int, not int.

Fixes 9b80a184eaad ("fs/file: more unsigned file descriptors")
---
 fs/file_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file_table.c +1 -1
index 976736be47cb6..502b81f614d9b 100644
@@ -128,7 +128,7 @@ static struct ctl_table fs_stat_sysctls[] = {
 		.data		= &sysctl_nr_open,
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec_minmax,
+		.proc_handler	= proc_douintvec_minmax,
 		.extra1		= &sysctl_nr_open_min,
 		.extra2		= &sysctl_nr_open_max,
 	},
Signature · 1 line
2.39.5
author maintainer
#9 lore raw

PATCH 9/623 block: copy back bounce buffer to user-space correctly in case of split

In reply to Greg Kroah-Hartman

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

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

From: Christoph Hellwig <[email protected]>

[ Upstream commit 031141976be0bd5f385775727a4ed3cc845eb7ba ]

Copy back the bounce buffer to user-space in entirety when the parent bio completes. The existing code uses bip_iter.bi_size for sizing the copy, which can be modified. So move away from that and fetch it from the vector passed to the block layer. While at it, switch to using better variable names.

Fixes 492c5d455969f ("block: bio-integrity: directly map user buffers")
---
 block/bio-integrity.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
block/bio-integrity.c +8 -7
index 2a4bd66116920..e73d8ed34235e 100644
@@ -118,17 +118,18 @@ static void bio_integrity_unpin_bvec(struct bio_vec *bv, int nr_vecs,
 
 static void bio_integrity_uncopy_user(struct bio_integrity_payload *bip)
 {
-	unsigned short nr_vecs = bip->bip_max_vcnt - 1;
-	struct bio_vec *copy = &bip->bip_vec[1];
-	size_t bytes = bip->bip_iter.bi_size;
-	struct iov_iter iter;
+	unsigned short orig_nr_vecs = bip->bip_max_vcnt - 1;
+	struct bio_vec *orig_bvecs = &bip->bip_vec[1];
+	struct bio_vec *bounce_bvec = &bip->bip_vec[0];
+	size_t bytes = bounce_bvec->bv_len;
+	struct iov_iter orig_iter;
 	int ret;
 
-	iov_iter_bvec(&iter, ITER_DEST, copy, nr_vecs, bytes);
-	ret = copy_to_iter(bvec_virt(bip->bip_vec), bytes, &iter);
+	iov_iter_bvec(&orig_iter, ITER_DEST, orig_bvecs, orig_nr_vecs, bytes);
+	ret = copy_to_iter(bvec_virt(bounce_bvec), bytes, &orig_iter);
 	WARN_ON_ONCE(ret != bytes);
 
-	bio_integrity_unpin_bvec(copy, nr_vecs, true);
+	bio_integrity_unpin_bvec(orig_bvecs, orig_nr_vecs, true);
 }
 
 /**
Signature · 1 line
2.39.5
author maintainer
#10 lore raw

PATCH 10/623 io_uring: prevent reg-wait speculations

In reply to Greg Kroah-Hartman

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

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

From: Pavel Begunkov <[email protected]>

[ Upstream commit 29b95ac917927ce9f95bf38797e16333ecb489b1 ]

With *ENTER_EXT_ARG_REG instead of passing a user pointer with arguments for the waiting loop the user can specify an offset into a pre-mapped region of memory, in which case the
[offset, offset + sizeof(io_uring_reg_wait)) will be intepreted as the argument.

As we address a kernel array using a user given index, it'd be a subject to speculation type of exploits. Use array_index_nospec() to prevent that. Make sure to pass not the full region size but truncate by the maximum offset allowed considering the structure size.

Fixes d617b3147d54c ("io_uring: restore back registered wait arguments")
Fixes aa00f67adc2c0 ("io_uring: add support for fixed wait regions")
---
 io_uring/io_uring.c | 1 +
 1 file changed, 1 insertion(+)
io_uring/io_uring.c +1 -0
index 4758f1ba902b9..d062c5c69211b 100644
@@ -3233,6 +3233,7 @@ static struct io_uring_reg_wait *io_get_ext_arg_reg(struct io_ring_ctx *ctx,
 		     end > ctx->cq_wait_size))
 		return ERR_PTR(-EFAULT);
 
+	offset = array_index_nospec(offset, ctx->cq_wait_size - size);
 	return ctx->cq_wait_arg + offset;
 }
 
Signature · 1 line
2.39.5
author maintainer
#11 lore raw

PATCH 11/623 block: retry call probe after request_module in blk_request_module

In reply to Greg Kroah-Hartman

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

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

From: Yang Erkun <[email protected]>

[ Upstream commit 457ef47c08d2979f3e59ce66267485c3faed70c8 ]

Set kernel config:

CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_LOOP_MIN_COUNT=0

Do latter:

mknod loop0 b 7 0
exec 4<> loop0

Before commit e418de3abcda ("block: switch gendisk lookup to a simple xarray"), lookup_gendisk will first use base_probe to load module loop, and then the retry will call loop_probe to prepare the loop disk. Finally open for this disk will success. However, after this commit, we lose the retry logic, and open will fail with ENXIO. Block device autoloading is deprecated and will be removed soon, but maybe we should keep open success until we really remove it. So, give a retry to fix it.

---
 block/genhd.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
block/genhd.c +17 -5
index 79230c109fca0..8a63be374220c 100644
@@ -798,7 +798,7 @@ static ssize_t disk_badblocks_store(struct device *dev,
 }
 
 #ifdef CONFIG_BLOCK_LEGACY_AUTOLOAD
-void blk_request_module(dev_t devt)
+static bool blk_probe_dev(dev_t devt)
 {
 	unsigned int major = MAJOR(devt);
 	struct blk_major_name **n;
@@ -808,14 +808,26 @@ void blk_request_module(dev_t devt)
 		if ((*n)->major == major && (*n)->probe) {
 			(*n)->probe(devt);
 			mutex_unlock(&major_names_lock);
-			return;
+			return true;
 		}
 	}
 	mutex_unlock(&major_names_lock);
+	return false;
+}
+
+void blk_request_module(dev_t devt)
+{
+	int error;
+
+	if (blk_probe_dev(devt))
+		return;
 
-	if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0)
-		/* Make old-style 2.4 aliases work */
-		request_module("block-major-%d", MAJOR(devt));
+	error = request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt));
+	/* Make old-style 2.4 aliases work */
+	if (error > 0)
+		error = request_module("block-major-%d", MAJOR(devt));
+	if (!error)
+		blk_probe_dev(devt);
 }
 #endif /* CONFIG_BLOCK_LEGACY_AUTOLOAD */
 
Signature · 1 line
2.39.5
author maintainer
#12 lore raw

PATCH 12/623 ps3disk: Do not use dev->bounce_size before it is set

In reply to Greg Kroah-Hartman

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

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

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit c2398e6d5f16e15598d3a37e17107fea477e3f91 ]

dev->bounce_size is only initialized after it is used to set the queue limits. Fix this by using BOUNCE_SIZE instead.

---
 drivers/block/ps3disk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/ps3disk.c +2 -2
index ff45ed7664695..226ffc743238e 100644
@@ -384,9 +384,9 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)
 	unsigned int devidx;
 	struct queue_limits lim = {
 		.logical_block_size	= dev->blk_size,
-		.max_hw_sectors		= dev->bounce_size >> 9,
+		.max_hw_sectors		= BOUNCE_SIZE >> 9,
 		.max_segments		= -1,
-		.max_segment_size	= dev->bounce_size,
+		.max_segment_size	= BOUNCE_SIZE,
 		.dma_alignment		= dev->blk_size - 1,
 		.features		= BLK_FEAT_WRITE_CACHE |
 					  BLK_FEAT_ROTATIONAL,
Signature · 1 line
2.39.5
author maintainer
#13 lore raw

PATCH 13/623 nbd: dont allow reconnect after disconnect

In reply to Greg Kroah-Hartman

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

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

From: Yu Kuai <[email protected]>

[ Upstream commit 844b8cdc681612ff24df62cdefddeab5772fadf1 ]

Following process can cause nbd_config UAF:

1) grab nbd_config temporarily;

2) nbd_genl_disconnect() flush all recv_work() and release the initial reference:

nbd_genl_disconnect
nbd_disconnect_and_put

    nbd_disconnect
     flush_workqueue(nbd->recv_workq)
    if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF, ...))
     nbd_config_put
     -> due to step 1), reference is still not zero

3) nbd_genl_reconfigure() queue recv_work() again;

nbd_genl_reconfigure
config = nbd_get_config_unlocked(nbd)
if (!config)
-> succeed
if (!test_bit(NBD_RT_BOUND, ...))
-> succeed
nbd_reconnect_socket

    queue_work(nbd->recv_workq, &args->work)

4) step 1) release the reference;

5) Finially, recv_work() will trigger UAF:

recv_work
nbd_config_put(nbd)
-> nbd_config is freed
atomic_dec(&config->recv_threads)
-> UAF

Fix the problem by clearing NBD_RT_BOUND in nbd_genl_disconnect(), so that nbd_genl_reconfigure() will fail.

---
 drivers/block/nbd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/nbd.c +1 -0
index b852050d8a966..450458267e6e6 100644
@@ -2180,6 +2180,7 @@ static void nbd_disconnect_and_put(struct nbd_device *nbd)
 	flush_workqueue(nbd->recv_workq);
 	nbd_clear_que(nbd);
 	nbd->task_setup = NULL;
+	clear_bit(NBD_RT_BOUND, &nbd->config->runtime_flags);
 	mutex_unlock(&nbd->config_lock);
 
 	if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,
Signature · 1 line
2.39.5
author maintainer
#14 lore raw

PATCH 14/623 pstore/blk: trivial typo fixes

In reply to Greg Kroah-Hartman

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

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

From: Eugen Hristev <[email protected]>

[ Upstream commit 542243af7182efaeaf6d0f4643f7de437541a9af ]

Fix trivial typos in comments.

Fixes 2a03ddbde1e1 ("pstore/blk: Move verify_size() macro out of function")
Fixes 17639f67c1d6 ("pstore/blk: Introduce backend for block devices")
---
 fs/pstore/blk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/pstore/blk.c +2 -2
index 65b2473e22ff9..fa6b8cb788a1f 100644
@@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info;
 		_##name_ = check_size(name, alignsize);		\
 	else							\
 		_##name_ = 0;					\
-	/* Synchronize module parameters with resuls. */	\
+	/* Synchronize module parameters with results. */	\
 	name = _##name_ / 1024;					\
 	dev->zone.name = _##name_;				\
 }
@@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)
 	if (pstore_device_info)
 		return -EBUSY;
 
-	/* zero means not limit on which backends to attempt to store. */
+	/* zero means no limit on which backends attempt to store. */
 	if (!dev->flags)
 		dev->flags = UINT_MAX;
 
Signature · 1 line
2.39.5
author maintainer
#15 lore raw

PATCH 15/623 block: check BLK_FEAT_POLL under q_usage_count

In reply to Greg Kroah-Hartman

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

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

From: Christoph Hellwig <[email protected]>

[ Upstream commit 958148a6ac061a9a80a184ea678a5fa872d0c56f ]

Otherwise feature reconfiguration can race with I/O submission.

Also drop the bio_clear_polled in the error path, as the flag does not matter for instant error completions, it is a left over from when we allowed polled I/O to proceed unpolled in this case.

Stable-dep-of: d432c817c21a ("block: don't update BLK_FEAT_POLL in __blk_mq_update_nr_hw_queues")

---
 block/blk-core.c | 22 ++++++++++++----------
 block/blk-mq.c   | 12 ++++++++++--
 2 files changed, 22 insertions(+), 12 deletions(-)
block/blk-core.c +12 -10
index 666efe8fa2020..6309b3f5a89dc 100644
@@ -629,8 +629,14 @@ static void __submit_bio(struct bio *bio)
 		blk_mq_submit_bio(bio);
 	} else if (likely(bio_queue_enter(bio) == 0)) {
 		struct gendisk *disk = bio->bi_bdev->bd_disk;
-
-		disk->fops->submit_bio(bio);
+	
+		if ((bio->bi_opf & REQ_POLLED) &&
+		    !(disk->queue->limits.features & BLK_FEAT_POLL)) {
+			bio->bi_status = BLK_STS_NOTSUPP;
+			bio_endio(bio);
+		} else {
+			disk->fops->submit_bio(bio);
+		}
 		blk_queue_exit(disk->queue);
 	}
 
@@ -805,12 +811,6 @@ void submit_bio_noacct(struct bio *bio)
 		}
 	}
 
-	if (!(q->limits.features & BLK_FEAT_POLL) &&
-			(bio->bi_opf & REQ_POLLED)) {
-		bio_clear_polled(bio);
-		goto not_supported;
-	}
-
 	switch (bio_op(bio)) {
 	case REQ_OP_READ:
 		break;
@@ -935,7 +935,7 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
 		return 0;
 
 	q = bdev_get_queue(bdev);
-	if (cookie == BLK_QC_T_NONE || !(q->limits.features & BLK_FEAT_POLL))
+	if (cookie == BLK_QC_T_NONE)
 		return 0;
 
 	blk_flush_plug(current->plug, false);
@@ -951,7 +951,9 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
 	 */
 	if (!percpu_ref_tryget(&q->q_usage_counter))
 		return 0;
-	if (queue_is_mq(q)) {
+	if (!(q->limits.features & BLK_FEAT_POLL)) {
+		ret = 0;
+	} else if (queue_is_mq(q)) {
 		ret = blk_mq_poll(q, cookie, iob, flags);
 	} else {
 		struct gendisk *disk = q->disk;
block/blk-mq.c +10 -2
index 8ac19d4ae3c0a..0137a995b9f37 100644
@@ -3092,14 +3092,22 @@ void blk_mq_submit_bio(struct bio *bio)
 	}
 
 	/*
-	 * Device reconfiguration may change logical block size, so alignment
-	 * check has to be done with queue usage counter held
+	 * Device reconfiguration may change logical block size or reduce the
+	 * number of poll queues, so the checks for alignment and poll support
+	 * have to be done with queue usage counter held.
 	 */
 	if (unlikely(bio_unaligned(bio, q))) {
 		bio_io_error(bio);
 		goto queue_exit;
 	}
 
+	if ((bio->bi_opf & REQ_POLLED) &&
+	    !(q->limits.features & BLK_FEAT_POLL)) {
+		bio->bi_status = BLK_STS_NOTSUPP;
+		bio_endio(bio);
+		goto queue_exit;
+	}
+
 	bio = __bio_split_to_limits(bio, &q->limits, &nr_segs);
 	if (!bio)
 		goto queue_exit;
Signature · 1 line
2.39.5
author maintainer
#16 lore raw

PATCH 16/623 block: dont update BLK_FEAT_POLL in __blk_mq_update_nr_hw_queues

In reply to Greg Kroah-Hartman

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

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

From: Christoph Hellwig <[email protected]>

[ Upstream commit d432c817c21a48c3baaa0d28e4d3e74b6aa238a0 ]

When __blk_mq_update_nr_hw_queues changes the number of tag sets, it might have to disable poll queues. Currently it does so by adjusting the BLK_FEAT_POLL, which is a bit against the intent of features that describe hardware / driver capabilities, but more importantly causes nasty lock order problems with the broadly held freeze when updating the number of hardware queues and the limits lock. Fix this by leaving BLK_FEAT_POLL alone, and instead check for the number of poll queues in the bio submission and poll handlers. While this adds extra work to the fast path, the variables are in cache lines used by these operations anyway, so it should be cheap enough.

---
 block/blk-core.c  |  7 +++----
 block/blk-mq.c    | 26 +++++---------------------
 block/blk-mq.h    |  6 ++++++
 block/blk-sysfs.c |  9 ++++++++-
 4 files changed, 22 insertions(+), 26 deletions(-)
block/blk-core.c +3 -4
index 6309b3f5a89dc..32fb28a6372cd 100644
@@ -951,14 +951,13 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
 	 */
 	if (!percpu_ref_tryget(&q->q_usage_counter))
 		return 0;
-	if (!(q->limits.features & BLK_FEAT_POLL)) {
-		ret = 0;
-	} else if (queue_is_mq(q)) {
+	if (queue_is_mq(q)) {
 		ret = blk_mq_poll(q, cookie, iob, flags);
 	} else {
 		struct gendisk *disk = q->disk;
 
-		if (disk && disk->fops->poll_bio)
+		if ((q->limits.features & BLK_FEAT_POLL) && disk &&
+		    disk->fops->poll_bio)
 			ret = disk->fops->poll_bio(bio, iob, flags);
 	}
 	blk_queue_exit(q);
block/blk-mq.c +5 -21
index 0137a995b9f37..23968c02be0d6 100644
@@ -3101,8 +3101,7 @@ void blk_mq_submit_bio(struct bio *bio)
 		goto queue_exit;
 	}
 
-	if ((bio->bi_opf & REQ_POLLED) &&
-	    !(q->limits.features & BLK_FEAT_POLL)) {
+	if ((bio->bi_opf & REQ_POLLED) && !blk_mq_can_poll(q)) {
 		bio->bi_status = BLK_STS_NOTSUPP;
 		bio_endio(bio);
 		goto queue_exit;
@@ -4325,12 +4324,6 @@ void blk_mq_release(struct request_queue *q)
 	blk_mq_sysfs_deinit(q);
 }
 
-static bool blk_mq_can_poll(struct blk_mq_tag_set *set)
-{
-	return set->nr_maps > HCTX_TYPE_POLL &&
-		set->map[HCTX_TYPE_POLL].nr_queues;
-}
-
 struct request_queue *blk_mq_alloc_queue(struct blk_mq_tag_set *set,
 		struct queue_limits *lim, void *queuedata)
 {
@@ -4341,7 +4334,7 @@ struct request_queue *blk_mq_alloc_queue(struct blk_mq_tag_set *set,
 	if (!lim)
 		lim = &default_lim;
 	lim->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT;
-	if (blk_mq_can_poll(set))
+	if (set->nr_maps > HCTX_TYPE_POLL)
 		lim->features |= BLK_FEAT_POLL;
 
 	q = blk_alloc_queue(lim, set->numa_node);
@@ -5029,8 +5022,6 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set,
 fallback:
 	blk_mq_update_queue_map(set);
 	list_for_each_entry(q, &set->tag_list, tag_set_list) {
-		struct queue_limits lim;
-
 		blk_mq_realloc_hw_ctxs(set, q);
 
 		if (q->nr_hw_queues != set->nr_hw_queues) {
@@ -5044,13 +5035,6 @@ static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set,
 			set->nr_hw_queues = prev_nr_hw_queues;
 			goto fallback;
 		}
-		lim = queue_limits_start_update(q);
-		if (blk_mq_can_poll(set))
-			lim.features |= BLK_FEAT_POLL;
-		else
-			lim.features &= ~BLK_FEAT_POLL;
-		if (queue_limits_commit_update(q, &lim) < 0)
-			pr_warn("updating the poll flag failed\n");
 		blk_mq_map_swqueue(q);
 	}
 
@@ -5110,9 +5094,9 @@ static int blk_hctx_poll(struct request_queue *q, struct blk_mq_hw_ctx *hctx,
 int blk_mq_poll(struct request_queue *q, blk_qc_t cookie,
 		struct io_comp_batch *iob, unsigned int flags)
 {
-	struct blk_mq_hw_ctx *hctx = xa_load(&q->hctx_table, cookie);
-
-	return blk_hctx_poll(q, hctx, iob, flags);
+	if (!blk_mq_can_poll(q))
+		return 0;
+	return blk_hctx_poll(q, xa_load(&q->hctx_table, cookie), iob, flags);
 }
 
 int blk_rq_poll(struct request *rq, struct io_comp_batch *iob,
block/blk-mq.h +6 -0
index 89a20fffa4b1c..a80d3b3105f9e 100644
@@ -451,4 +451,10 @@ do {								\
 #define blk_mq_run_dispatch_ops(q, dispatch_ops)		\
 	__blk_mq_run_dispatch_ops(q, true, dispatch_ops)	\
 
+static inline bool blk_mq_can_poll(struct request_queue *q)
+{
+	return (q->limits.features & BLK_FEAT_POLL) &&
+		q->tag_set->map[HCTX_TYPE_POLL].nr_queues;
+}
+
 #endif
block/blk-sysfs.c +8 -1
index 767598e719ab0..e9f1c82b2f3e3 100644
@@ -245,10 +245,17 @@ static ssize_t queue_##_name##_show(struct gendisk *disk, char *page)	\
 		!!(disk->queue->limits.features & _feature));		\
 }
 
-QUEUE_SYSFS_FEATURE_SHOW(poll, BLK_FEAT_POLL);
 QUEUE_SYSFS_FEATURE_SHOW(fua, BLK_FEAT_FUA);
 QUEUE_SYSFS_FEATURE_SHOW(dax, BLK_FEAT_DAX);
 
+static ssize_t queue_poll_show(struct gendisk *disk, char *page)
+{
+	if (queue_is_mq(disk->queue))
+		return sysfs_emit(page, "%u\n", blk_mq_can_poll(disk->queue));
+	return sysfs_emit(page, "%u\n",
+		!!(disk->queue->limits.features & BLK_FEAT_POLL));
+}
+
 static ssize_t queue_zoned_show(struct gendisk *disk, char *page)
 {
 	if (blk_queue_is_zoned(disk->queue))
Signature · 1 line
2.39.5
author maintainer
#17 lore raw

PATCH 17/623 block: add a queue_limits_commit_update_frozen helper

In reply to Greg Kroah-Hartman

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

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

From: Christoph Hellwig <[email protected]>

[ Upstream commit aa427d7b73b196f657d6d2cf0e94eff6b883fdef ]

Add a helper that freezes the queue, updates the queue limits and unfreezes the queue and convert all open coded versions of that to the new helper.

Stable-dep-of: c99f66e4084a ("block: fix queue freeze vs limits lock order in sysfs store methods")

---
 block/blk-integrity.c      |  4 +---
 block/blk-settings.c       | 24 ++++++++++++++++++++++++
 block/blk-zoned.c          |  7 +------
 drivers/block/virtio_blk.c |  4 +---
 drivers/scsi/sd.c          | 17 +++++------------
 drivers/scsi/sr.c          |  5 +----
 include/linux/blkdev.h     |  2 ++
 7 files changed, 35 insertions(+), 28 deletions(-)
block/blk-integrity.c +1 -3
index b180cac61a9dd..013469faa5e7c 100644
@@ -218,9 +218,7 @@ static ssize_t flag_store(struct device *dev, const char *page, size_t count,
 	else
 		lim.integrity.flags |= flag;
 
-	blk_mq_freeze_queue(q);
-	err = queue_limits_commit_update(q, &lim);
-	blk_mq_unfreeze_queue(q);
+	err = queue_limits_commit_update_frozen(q, &lim);
 	if (err)
 		return err;
 	return count;
block/blk-settings.c +24 -0
index 8f09e33f41f68..b017637d9e735 100644
@@ -443,6 +443,30 @@ int queue_limits_commit_update(struct request_queue *q,
 }
 EXPORT_SYMBOL_GPL(queue_limits_commit_update);
 
+/**
+ * queue_limits_commit_update_frozen - commit an atomic update of queue limits
+ * @q:		queue to update
+ * @lim:	limits to apply
+ *
+ * Apply the limits in @lim that were obtained from queue_limits_start_update()
+ * and updated with the new values by the caller to @q.  Freezes the queue
+ * before the update and unfreezes it after.
+ *
+ * Returns 0 if successful, else a negative error code.
+ */
+int queue_limits_commit_update_frozen(struct request_queue *q,
+		struct queue_limits *lim)
+{
+	int ret;
+
+	blk_mq_freeze_queue(q);
+	ret = queue_limits_commit_update(q, lim);
+	blk_mq_unfreeze_queue(q);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(queue_limits_commit_update_frozen);
+
 /**
  * queue_limits_set - apply queue limits to queue
  * @q:		queue to update
block/blk-zoned.c +1 -6
index 84da1eadff642..c964c6b667809 100644
@@ -1446,7 +1446,6 @@ static int disk_update_zone_resources(struct gendisk *disk,
 	unsigned int nr_seq_zones, nr_conv_zones;
 	unsigned int pool_size;
 	struct queue_limits lim;
-	int ret;
 
 	disk->nr_zones = args->nr_zones;
 	disk->zone_capacity = args->zone_capacity;
@@ -1497,11 +1496,7 @@ static int disk_update_zone_resources(struct gendisk *disk,
 	}
 
 commit:
-	blk_mq_freeze_queue(q);
-	ret = queue_limits_commit_update(q, &lim);
-	blk_mq_unfreeze_queue(q);
-
-	return ret;
+	return queue_limits_commit_update_frozen(q, &lim);
 }
 
 static int blk_revalidate_conv_zone(struct blk_zone *zone, unsigned int idx,
drivers/block/virtio_blk.c +1 -3
index 3efe378f13866..5afc8aac62ab9 100644
@@ -1106,9 +1106,7 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
 		lim.features |= BLK_FEAT_WRITE_CACHE;
 	else
 		lim.features &= ~BLK_FEAT_WRITE_CACHE;
-	blk_mq_freeze_queue(disk->queue);
-	i = queue_limits_commit_update(disk->queue, &lim);
-	blk_mq_unfreeze_queue(disk->queue);
+	i = queue_limits_commit_update_frozen(disk->queue, &lim);
 	if (i)
 		return i;
 	return count;
drivers/scsi/sd.c +5 -12
index 8947dab132d78..af62a8ed86200 100644
@@ -177,9 +177,8 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
 
 		lim = queue_limits_start_update(sdkp->disk->queue);
 		sd_set_flush_flag(sdkp, &lim);
-		blk_mq_freeze_queue(sdkp->disk->queue);
-		ret = queue_limits_commit_update(sdkp->disk->queue, &lim);
-		blk_mq_unfreeze_queue(sdkp->disk->queue);
+		ret = queue_limits_commit_update_frozen(sdkp->disk->queue,
+				&lim);
 		if (ret)
 			return ret;
 		return count;
@@ -483,9 +482,7 @@ provisioning_mode_store(struct device *dev, struct device_attribute *attr,
 
 	lim = queue_limits_start_update(sdkp->disk->queue);
 	sd_config_discard(sdkp, &lim, mode);
-	blk_mq_freeze_queue(sdkp->disk->queue);
-	err = queue_limits_commit_update(sdkp->disk->queue, &lim);
-	blk_mq_unfreeze_queue(sdkp->disk->queue);
+	err = queue_limits_commit_update_frozen(sdkp->disk->queue, &lim);
 	if (err)
 		return err;
 	return count;
@@ -594,9 +591,7 @@ max_write_same_blocks_store(struct device *dev, struct device_attribute *attr,
 
 	lim = queue_limits_start_update(sdkp->disk->queue);
 	sd_config_write_same(sdkp, &lim);
-	blk_mq_freeze_queue(sdkp->disk->queue);
-	err = queue_limits_commit_update(sdkp->disk->queue, &lim);
-	blk_mq_unfreeze_queue(sdkp->disk->queue);
+	err = queue_limits_commit_update_frozen(sdkp->disk->queue, &lim);
 	if (err)
 		return err;
 	return count;
@@ -3803,9 +3798,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
 	sd_config_write_same(sdkp, &lim);
 	kfree(buffer);
 
-	blk_mq_freeze_queue(sdkp->disk->queue);
-	err = queue_limits_commit_update(sdkp->disk->queue, &lim);
-	blk_mq_unfreeze_queue(sdkp->disk->queue);
+	err = queue_limits_commit_update_frozen(sdkp->disk->queue, &lim);
 	if (err)
 		return err;
 
drivers/scsi/sr.c +1 -4
index 198bec87bb8e7..b17796d5ee665 100644
@@ -797,10 +797,7 @@ static int get_sectorsize(struct scsi_cd *cd)
 
 	lim = queue_limits_start_update(q);
 	lim.logical_block_size = sector_size;
-	blk_mq_freeze_queue(q);
-	err = queue_limits_commit_update(q, &lim);
-	blk_mq_unfreeze_queue(q);
-	return err;
+	return queue_limits_commit_update_frozen(q, &lim);
 }
 
 static int get_capabilities(struct scsi_cd *cd)
include/linux/blkdev.h +2 -0
index 378d3a1a22fca..e0ce4d6913cde 100644
@@ -947,6 +947,8 @@ queue_limits_start_update(struct request_queue *q)
 	mutex_lock(&q->limits_lock);
 	return q->limits;
 }
+int queue_limits_commit_update_frozen(struct request_queue *q,
+		struct queue_limits *lim);
 int queue_limits_commit_update(struct request_queue *q,
 		struct queue_limits *lim);
 int queue_limits_set(struct request_queue *q, struct queue_limits *lim);
Signature · 1 line
2.39.5
author maintainer
#18 lore raw

PATCH 18/623 block: add a store_limit operations for sysfs entries

In reply to Greg Kroah-Hartman

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

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

From: Christoph Hellwig <[email protected]>

[ Upstream commit a16230649ce27f8ac7dd8a5b079d9657aa96de16 ]

De-duplicate the code for updating queue limits by adding a store_limit method that allows having common code handle the actual queue limits update.

Note that this is a pure refactoring patch and does not address the existing freeze vs limits lock order problem in the refactored code, which will be addressed next.

Stable-dep-of: c99f66e4084a ("block: fix queue freeze vs limits lock order in sysfs store methods")

---
 block/blk-sysfs.c | 128 ++++++++++++++++++++++------------------------
 1 file changed, 61 insertions(+), 67 deletions(-)
block/blk-sysfs.c +61 -67
index e9f1c82b2f3e3..d2aa2177e4ba5 100644
@@ -24,6 +24,8 @@ struct queue_sysfs_entry {
 	struct attribute attr;
 	ssize_t (*show)(struct gendisk *disk, char *page);
 	ssize_t (*store)(struct gendisk *disk, const char *page, size_t count);
+	int (*store_limit)(struct gendisk *disk, const char *page,
+			size_t count, struct queue_limits *lim);
 	void (*load_module)(struct gendisk *disk, const char *page, size_t count);
 };
 
@@ -153,13 +155,11 @@ QUEUE_SYSFS_SHOW_CONST(discard_zeroes_data, 0)
 QUEUE_SYSFS_SHOW_CONST(write_same_max, 0)
 QUEUE_SYSFS_SHOW_CONST(poll_delay, -1)
 
-static ssize_t queue_max_discard_sectors_store(struct gendisk *disk,
-		const char *page, size_t count)
+static int queue_max_discard_sectors_store(struct gendisk *disk,
+		const char *page, size_t count, struct queue_limits *lim)
 {
 	unsigned long max_discard_bytes;
-	struct queue_limits lim;
 	ssize_t ret;
-	int err;
 
 	ret = queue_var_store(&max_discard_bytes, page, count);
 	if (ret < 0)
@@ -171,38 +171,28 @@ static ssize_t queue_max_discard_sectors_store(struct gendisk *disk,
 	if ((max_discard_bytes >> SECTOR_SHIFT) > UINT_MAX)
 		return -EINVAL;
 
-	lim = queue_limits_start_update(disk->queue);
-	lim.max_user_discard_sectors = max_discard_bytes >> SECTOR_SHIFT;
-	err = queue_limits_commit_update(disk->queue, &lim);
-	if (err)
-		return err;
-	return ret;
+	lim->max_user_discard_sectors = max_discard_bytes >> SECTOR_SHIFT;
+	return 0;
 }
 
-static ssize_t
-queue_max_sectors_store(struct gendisk *disk, const char *page, size_t count)
+static int
+queue_max_sectors_store(struct gendisk *disk, const char *page, size_t count,
+		struct queue_limits *lim)
 {
 	unsigned long max_sectors_kb;
-	struct queue_limits lim;
 	ssize_t ret;
-	int err;
 
 	ret = queue_var_store(&max_sectors_kb, page, count);
 	if (ret < 0)
 		return ret;
 
-	lim = queue_limits_start_update(disk->queue);
-	lim.max_user_sectors = max_sectors_kb << 1;
-	err = queue_limits_commit_update(disk->queue, &lim);
-	if (err)
-		return err;
-	return ret;
+	lim->max_user_sectors = max_sectors_kb << 1;
+	return 0;
 }
 
 static ssize_t queue_feature_store(struct gendisk *disk, const char *page,
-		size_t count, blk_features_t feature)
+		size_t count, struct queue_limits *lim, blk_features_t feature)
 {
-	struct queue_limits lim;
 	unsigned long val;
 	ssize_t ret;
 
@@ -210,15 +200,11 @@ static ssize_t queue_feature_store(struct gendisk *disk, const char *page,
 	if (ret < 0)
 		return ret;
 
-	lim = queue_limits_start_update(disk->queue);
 	if (val)
-		lim.features |= feature;
+		lim->features |= feature;
 	else
-		lim.features &= ~feature;
-	ret = queue_limits_commit_update(disk->queue, &lim);
-	if (ret)
-		return ret;
-	return count;
+		lim->features &= ~feature;
+	return 0;
 }
 
 #define QUEUE_SYSFS_FEATURE(_name, _feature)				\
@@ -227,10 +213,10 @@ static ssize_t queue_##_name##_show(struct gendisk *disk, char *page)	\
 	return sysfs_emit(page, "%u\n",					\
 		!!(disk->queue->limits.features & _feature));		\
 }									\
-static ssize_t queue_##_name##_store(struct gendisk *disk,		\
-		const char *page, size_t count)				\
+static int queue_##_name##_store(struct gendisk *disk,			\
+		const char *page, size_t count, struct queue_limits *lim) \
 {									\
-	return queue_feature_store(disk, page, count, _feature);	\
+	return queue_feature_store(disk, page, count, lim, _feature);	\
 }
 
 QUEUE_SYSFS_FEATURE(rotational, BLK_FEAT_ROTATIONAL)
@@ -273,10 +259,9 @@ static ssize_t queue_iostats_passthrough_show(struct gendisk *disk, char *page)
 	return queue_var_show(!!blk_queue_passthrough_stat(disk->queue), page);
 }
 
-static ssize_t queue_iostats_passthrough_store(struct gendisk *disk,
-					       const char *page, size_t count)
+static int queue_iostats_passthrough_store(struct gendisk *disk,
+		const char *page, size_t count, struct queue_limits *lim)
 {
-	struct queue_limits lim;
 	unsigned long ios;
 	ssize_t ret;
 
@@ -284,18 +269,13 @@ static ssize_t queue_iostats_passthrough_store(struct gendisk *disk,
 	if (ret < 0)
 		return ret;
 
-	lim = queue_limits_start_update(disk->queue);
 	if (ios)
-		lim.flags |= BLK_FLAG_IOSTATS_PASSTHROUGH;
+		lim->flags |= BLK_FLAG_IOSTATS_PASSTHROUGH;
 	else
-		lim.flags &= ~BLK_FLAG_IOSTATS_PASSTHROUGH;
-
-	ret = queue_limits_commit_update(disk->queue, &lim);
-	if (ret)
-		return ret;
-
-	return count;
+		lim->flags &= ~BLK_FLAG_IOSTATS_PASSTHROUGH;
+	return 0;
 }
+
 static ssize_t queue_nomerges_show(struct gendisk *disk, char *page)
 {
 	return queue_var_show((blk_queue_nomerges(disk->queue) << 1) |
@@ -398,12 +378,10 @@ static ssize_t queue_wc_show(struct gendisk *disk, char *page)
 	return sysfs_emit(page, "write through\n");
 }
 
-static ssize_t queue_wc_store(struct gendisk *disk, const char *page,
-			      size_t count)
+static int queue_wc_store(struct gendisk *disk, const char *page,
+		size_t count, struct queue_limits *lim)
 {
-	struct queue_limits lim;
 	bool disable;
-	int err;
 
 	if (!strncmp(page, "write back", 10)) {
 		disable = false;
@@ -414,15 +392,11 @@ static ssize_t queue_wc_store(struct gendisk *disk, const char *page,
 		return -EINVAL;
 	}
 
-	lim = queue_limits_start_update(disk->queue);
 	if (disable)
-		lim.flags |= BLK_FLAG_WRITE_CACHE_DISABLED;
+		lim->flags |= BLK_FLAG_WRITE_CACHE_DISABLED;
 	else
-		lim.flags &= ~BLK_FLAG_WRITE_CACHE_DISABLED;
-	err = queue_limits_commit_update(disk->queue, &lim);
-	if (err)
-		return err;
-	return count;
+		lim->flags &= ~BLK_FLAG_WRITE_CACHE_DISABLED;
+	return 0;
 }
 
 #define QUEUE_RO_ENTRY(_prefix, _name)			\
@@ -438,6 +412,13 @@ static struct queue_sysfs_entry _prefix##_entry = {	\
 	.store	= _prefix##_store,			\
 };
 
+#define QUEUE_LIM_RW_ENTRY(_prefix, _name)			\
+static struct queue_sysfs_entry _prefix##_entry = {	\
+	.attr		= { .name = _name, .mode = 0644 },	\
+	.show		= _prefix##_show,			\
+	.store_limit	= _prefix##_store,			\
+}
+
 #define QUEUE_RW_LOAD_MODULE_ENTRY(_prefix, _name)		\
 static struct queue_sysfs_entry _prefix##_entry = {		\
 	.attr		= { .name = _name, .mode = 0644 },	\
@@ -448,7 +429,7 @@ static struct queue_sysfs_entry _prefix##_entry = {		\
 
 QUEUE_RW_ENTRY(queue_requests, "nr_requests");
 QUEUE_RW_ENTRY(queue_ra, "read_ahead_kb");
-QUEUE_RW_ENTRY(queue_max_sectors, "max_sectors_kb");
+QUEUE_LIM_RW_ENTRY(queue_max_sectors, "max_sectors_kb");
 QUEUE_RO_ENTRY(queue_max_hw_sectors, "max_hw_sectors_kb");
 QUEUE_RO_ENTRY(queue_max_segments, "max_segments");
 QUEUE_RO_ENTRY(queue_max_integrity_segments, "max_integrity_segments");
@@ -464,7 +445,7 @@ QUEUE_RO_ENTRY(queue_io_opt, "optimal_io_size");
 QUEUE_RO_ENTRY(queue_max_discard_segments, "max_discard_segments");
 QUEUE_RO_ENTRY(queue_discard_granularity, "discard_granularity");
 QUEUE_RO_ENTRY(queue_max_hw_discard_sectors, "discard_max_hw_bytes");
-QUEUE_RW_ENTRY(queue_max_discard_sectors, "discard_max_bytes");
+QUEUE_LIM_RW_ENTRY(queue_max_discard_sectors, "discard_max_bytes");
 QUEUE_RO_ENTRY(queue_discard_zeroes_data, "discard_zeroes_data");
 
 QUEUE_RO_ENTRY(queue_atomic_write_max_sectors, "atomic_write_max_bytes");
@@ -484,11 +465,11 @@ QUEUE_RO_ENTRY(queue_max_open_zones, "max_open_zones");
 QUEUE_RO_ENTRY(queue_max_active_zones, "max_active_zones");
 
 QUEUE_RW_ENTRY(queue_nomerges, "nomerges");
-QUEUE_RW_ENTRY(queue_iostats_passthrough, "iostats_passthrough");
+QUEUE_LIM_RW_ENTRY(queue_iostats_passthrough, "iostats_passthrough");
 QUEUE_RW_ENTRY(queue_rq_affinity, "rq_affinity");
 QUEUE_RW_ENTRY(queue_poll, "io_poll");
 QUEUE_RW_ENTRY(queue_poll_delay, "io_poll_delay");
-QUEUE_RW_ENTRY(queue_wc, "write_cache");
+QUEUE_LIM_RW_ENTRY(queue_wc, "write_cache");
 QUEUE_RO_ENTRY(queue_fua, "fua");
 QUEUE_RO_ENTRY(queue_dax, "dax");
 QUEUE_RW_ENTRY(queue_io_timeout, "io_timeout");
@@ -501,10 +482,10 @@ static struct queue_sysfs_entry queue_hw_sector_size_entry = {
 	.show = queue_logical_block_size_show,
 };
 
-QUEUE_RW_ENTRY(queue_rotational, "rotational");
-QUEUE_RW_ENTRY(queue_iostats, "iostats");
-QUEUE_RW_ENTRY(queue_add_random, "add_random");
-QUEUE_RW_ENTRY(queue_stable_writes, "stable_writes");
+QUEUE_LIM_RW_ENTRY(queue_rotational, "rotational");
+QUEUE_LIM_RW_ENTRY(queue_iostats, "iostats");
+QUEUE_LIM_RW_ENTRY(queue_add_random, "add_random");
+QUEUE_LIM_RW_ENTRY(queue_stable_writes, "stable_writes");
 
 #ifdef CONFIG_BLK_WBT
 static ssize_t queue_var_store64(s64 *var, const char *page)
@@ -702,7 +683,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
 	struct request_queue *q = disk->queue;
 	ssize_t res;
 
-	if (!entry->store)
+	if (!entry->store_limit && !entry->store)
 		return -EIO;
 
 	/*
@@ -713,11 +694,24 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
 	if (entry->load_module)
 		entry->load_module(disk, page, length);
 
-	blk_mq_freeze_queue(q);
 	mutex_lock(&q->sysfs_lock);
-	res = entry->store(disk, page, length);
-	mutex_unlock(&q->sysfs_lock);
+	blk_mq_freeze_queue(q);
+	if (entry->store_limit) {
+		struct queue_limits lim = queue_limits_start_update(q);
+
+		res = entry->store_limit(disk, page, length, &lim);
+		if (res < 0) {
+			queue_limits_cancel_update(q);
+		} else {
+			res = queue_limits_commit_update(q, &lim);
+			if (!res)
+				res = length;
+		}
+	} else {
+		res = entry->store(disk, page, length);
+	}
 	blk_mq_unfreeze_queue(q);
+	mutex_unlock(&q->sysfs_lock);
 	return res;
 }
 
Signature · 1 line
2.39.5
author maintainer
#19 lore raw

PATCH 19/623 block: fix queue freeze vs limits lock order in sysfs store methods

In reply to Greg Kroah-Hartman

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

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

From: Christoph Hellwig <[email protected]>

[ Upstream commit c99f66e4084a62a2cc401c4704a84328aeddc9ec ]

queue_attr_store() always freezes a device queue before calling the attribute store operation. For attributes that control queue limits, the store operation will also lock the queue limits with a call to queue_limits_start_update(). However, some drivers (e.g. SCSI sd) may need to issue commands to a device to obtain limit values from the hardware with the queue limits locked. This creates a potential ABBA deadlock situation if a user attempts to modify a limit (thus freezing the device queue) while the device driver starts a revalidation of the device queue limits.

Avoid such deadlock by not freezing the queue before calling the ->store_limit() method in struct queue_sysfs_entry and instead use the queue_limits_commit_update_frozen helper to freeze the queue after taking the limits lock.

This also removes taking the sysfs lock for the store_limit method as it doesn't protect anything here, but creates even more nesting. Hopefully it will go away from the actual sysfs methods entirely soon.

(commit log adapted from a similar patch from Damien Le Moal)

Fixes ff956a3be95b ("block: use queue_limits_commit_update in queue_discard_max_store")
Fixes 0327ca9d53bf ("block: use queue_limits_commit_update in queue_max_sectors_store")
---
 block/blk-sysfs.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
block/blk-sysfs.c +10 -8
index d2aa2177e4ba5..e828be777206b 100644
@@ -694,22 +694,24 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
 	if (entry->load_module)
 		entry->load_module(disk, page, length);
 
-	mutex_lock(&q->sysfs_lock);
-	blk_mq_freeze_queue(q);
 	if (entry->store_limit) {
 		struct queue_limits lim = queue_limits_start_update(q);
 
 		res = entry->store_limit(disk, page, length, &lim);
 		if (res < 0) {
 			queue_limits_cancel_update(q);
-		} else {
-			res = queue_limits_commit_update(q, &lim);
-			if (!res)
-				res = length;
+			return res;
 		}
-	} else {
-		res = entry->store(disk, page, length);
+
+		res = queue_limits_commit_update_frozen(q, &lim);
+		if (res)
+			return res;
+		return length;
 	}
+
+	mutex_lock(&q->sysfs_lock);
+	blk_mq_freeze_queue(q);
+	res = entry->store(disk, page, length);
 	blk_mq_unfreeze_queue(q);
 	mutex_unlock(&q->sysfs_lock);
 	return res;
Signature · 1 line
2.39.5
author maintainer
#20 lore raw

PATCH 20/623 nvme-tcp: Fix I/O queue cpu spreading for multiple controllers

In reply to Greg Kroah-Hartman

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

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

From: Sagi Grimberg <[email protected]>

[ Upstream commit 32193789878c259e39b97bd0c0f2f0ccbe5cb8a8 ]

Since day-1 we are assigning the queue io_cpu very naively. We always base the queue id (controller scope) and assign it its matching cpu from the online mask. This works fine when the number of queues match the number of cpu cores.

The problem starts when we have less queues than cpu cores. First, we should take into account the mq_map and select a cpu within the cpus that are assigned to this queue by the mq_map in order to minimize cross numa cpu bouncing.

Second, even worse is that we don't take into account multiple controllers may have assigned queues to a given cpu. As a result we may simply compund more and more queues on the same set of cpus, which is suboptimal.

We fix this by introducing global per-cpu counters that tracks the number of queues assigned to each cpu, and we select the least used cpu based on the mq_map and the per-cpu counters, and assign it as the queue io_cpu.

The behavior for a single controller is slightly optimized by selecting better cpu candidates by consulting with the mq_map, and multiple controllers are spreading queues among cpu cores much better, resulting in lower average cpu load, and less likelihood to hit hotspots.

Note that the accounting is not 100% perfect, but we don't need to be, we're simply putting our best effort to select the best candidate cpu core that we find at any given point.

Another byproduct is that every controller reset/reconnect may change the queues io_cpu mapping, based on the current LRU accounting scheme.

Here is the baseline queue io_cpu assignment for 4 controllers, 2 queues per controller, and 4 cpus on the host:
nvme1: queue 0: using cpu 0
nvme1: queue 1: using cpu 1
nvme2: queue 0: using cpu 0
nvme2: queue 1: using cpu 1
nvme3: queue 0: using cpu 0
nvme3: queue 1: using cpu 1
nvme4: queue 0: using cpu 0
nvme4: queue 1: using cpu 1

And this is the fixed io_cpu assignment:
nvme1: queue 0: using cpu 0
nvme1: queue 1: using cpu 2
nvme2: queue 0: using cpu 1
nvme2: queue 1: using cpu 3
nvme3: queue 0: using cpu 0
nvme3: queue 1: using cpu 2
nvme4: queue 0: using cpu 1
nvme4: queue 1: using cpu 3

Fixes 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
[fixed kbuild reported errors]
---
 drivers/nvme/host/tcp.c | 70 +++++++++++++++++++++++++++++++++--------
 1 file changed, 57 insertions(+), 13 deletions(-)
drivers/nvme/host/tcp.c +57 -13
index b127d41dbbfee..841238f38fdda 100644
@@ -54,6 +54,8 @@ MODULE_PARM_DESC(tls_handshake_timeout,
 		 "nvme TLS handshake timeout in seconds (default 10)");
 #endif
 
+static atomic_t nvme_tcp_cpu_queues[NR_CPUS];
+
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 /* lockdep can detect a circular dependency of the form
  *   sk_lock -> mmap_lock (page fault) -> fs locks -> sk_lock
@@ -127,6 +129,7 @@ enum nvme_tcp_queue_flags {
 	NVME_TCP_Q_ALLOCATED	= 0,
 	NVME_TCP_Q_LIVE		= 1,
 	NVME_TCP_Q_POLLING	= 2,
+	NVME_TCP_Q_IO_CPU_SET	= 3,
 };
 
 enum nvme_tcp_recv_state {
@@ -1562,23 +1565,56 @@ static bool nvme_tcp_poll_queue(struct nvme_tcp_queue *queue)
 			  ctrl->io_queues[HCTX_TYPE_POLL];
 }
 
+/**
+ * Track the number of queues assigned to each cpu using a global per-cpu
+ * counter and select the least used cpu from the mq_map. Our goal is to spread
+ * different controllers I/O threads across different cpu cores.
+ *
+ * Note that the accounting is not 100% perfect, but we don't need to be, we're
+ * simply putting our best effort to select the best candidate cpu core that we
+ * find at any given point.
+ */
 static void nvme_tcp_set_queue_io_cpu(struct nvme_tcp_queue *queue)
 {
 	struct nvme_tcp_ctrl *ctrl = queue->ctrl;
-	int qid = nvme_tcp_queue_id(queue);
-	int n = 0;
+	struct blk_mq_tag_set *set = &ctrl->tag_set;
+	int qid = nvme_tcp_queue_id(queue) - 1;
+	unsigned int *mq_map = NULL;
+	int cpu, min_queues = INT_MAX, io_cpu;
+
+	if (wq_unbound)
+		goto out;
 
 	if (nvme_tcp_default_queue(queue))
-		n = qid - 1;
+		mq_map = set->map[HCTX_TYPE_DEFAULT].mq_map;
 	else if (nvme_tcp_read_queue(queue))
-		n = qid - ctrl->io_queues[HCTX_TYPE_DEFAULT] - 1;
+		mq_map = set->map[HCTX_TYPE_READ].mq_map;
 	else if (nvme_tcp_poll_queue(queue))
-		n = qid - ctrl->io_queues[HCTX_TYPE_DEFAULT] -
-				ctrl->io_queues[HCTX_TYPE_READ] - 1;
-	if (wq_unbound)
-		queue->io_cpu = WORK_CPU_UNBOUND;
-	else
-		queue->io_cpu = cpumask_next_wrap(n - 1, cpu_online_mask, -1, false);
+		mq_map = set->map[HCTX_TYPE_POLL].mq_map;
+
+	if (WARN_ON(!mq_map))
+		goto out;
+
+	/* Search for the least used cpu from the mq_map */
+	io_cpu = WORK_CPU_UNBOUND;
+	for_each_online_cpu(cpu) {
+		int num_queues = atomic_read(&nvme_tcp_cpu_queues[cpu]);
+
+		if (mq_map[cpu] != qid)
+			continue;
+		if (num_queues < min_queues) {
+			io_cpu = cpu;
+			min_queues = num_queues;
+		}
+	}
+	if (io_cpu != WORK_CPU_UNBOUND) {
+		queue->io_cpu = io_cpu;
+		atomic_inc(&nvme_tcp_cpu_queues[io_cpu]);
+		set_bit(NVME_TCP_Q_IO_CPU_SET, &queue->flags);
+	}
+out:
+	dev_dbg(ctrl->ctrl.device, "queue %d: using cpu %d\n",
+		qid, queue->io_cpu);
 }
 
 static void nvme_tcp_tls_done(void *data, int status, key_serial_t pskid)
@@ -1722,7 +1758,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid,
 
 	queue->sock->sk->sk_allocation = GFP_ATOMIC;
 	queue->sock->sk->sk_use_task_frag = false;
-	nvme_tcp_set_queue_io_cpu(queue);
+	queue->io_cpu = WORK_CPU_UNBOUND;
 	queue->request = NULL;
 	queue->data_remaining = 0;
 	queue->ddgst_remaining = 0;
@@ -1844,6 +1880,9 @@ static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)
 	if (!test_bit(NVME_TCP_Q_ALLOCATED, &queue->flags))
 		return;
 
+	if (test_and_clear_bit(NVME_TCP_Q_IO_CPU_SET, &queue->flags))
+		atomic_dec(&nvme_tcp_cpu_queues[queue->io_cpu]);
+
 	mutex_lock(&queue->queue_lock);
 	if (test_and_clear_bit(NVME_TCP_Q_LIVE, &queue->flags))
 		__nvme_tcp_stop_queue(queue);
@@ -1878,9 +1917,10 @@ static int nvme_tcp_start_queue(struct nvme_ctrl *nctrl, int idx)
 	nvme_tcp_init_recv_ctx(queue);
 	nvme_tcp_setup_sock_ops(queue);
 
-	if (idx)
+	if (idx) {
+		nvme_tcp_set_queue_io_cpu(queue);
 		ret = nvmf_connect_io_queue(nctrl, idx);
-	else
+	} else
 		ret = nvmf_connect_admin_queue(nctrl);
 
 	if (!ret) {
@@ -2845,6 +2885,7 @@ static struct nvmf_transport_ops nvme_tcp_transport = {
 static int __init nvme_tcp_init_module(void)
 {
 	unsigned int wq_flags = WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_SYSFS;
+	int cpu;
 
 	BUILD_BUG_ON(sizeof(struct nvme_tcp_hdr) != 8);
 	BUILD_BUG_ON(sizeof(struct nvme_tcp_cmd_pdu) != 72);
@@ -2862,6 +2903,9 @@ static int __init nvme_tcp_init_module(void)
 	if (!nvme_tcp_wq)
 		return -ENOMEM;
 
+	for_each_possible_cpu(cpu)
+		atomic_set(&nvme_tcp_cpu_queues[cpu], 0);
+
 	nvmf_register_transport(&nvme_tcp_transport);
 	return 0;
 }
Signature · 1 line
2.39.5
author maintainer
#21 lore raw

PATCH 21/623 nvme: Add error check for xa_store in nvme_get_effects_log

In reply to Greg Kroah-Hartman

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

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

From: Keisuke Nishimura <[email protected]>

[ Upstream commit ac32057acc7f3d7a238dafaa9b2aa2bc9750080e ]

The xa_store() may fail due to memory allocation failure because there is no guarantee that the index csi is already used. This fix adds an error check of the return value of xa_store() in nvme_get_effects_log().

Fixes 1cf7a12e09aa ("nvme: use an xarray to lookup the Commands Supported and Effects log")
---
 drivers/nvme/host/core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +6 -2
index a970168a3014e..315692cb2e614 100644
@@ -3092,7 +3092,7 @@ int nvme_get_log(struct nvme_ctrl *ctrl, u32 nsid, u8 log_page, u8 lsp, u8 csi,
 static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
 				struct nvme_effects_log **log)
 {
-	struct nvme_effects_log	*cel = xa_load(&ctrl->cels, csi);
+	struct nvme_effects_log *old, *cel = xa_load(&ctrl->cels, csi);
 	int ret;
 
 	if (cel)
@@ -3109,7 +3109,11 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
 		return ret;
 	}
 
-	xa_store(&ctrl->cels, csi, cel, GFP_KERNEL);
+	old = xa_store(&ctrl->cels, csi, cel, GFP_KERNEL);
+	if (xa_is_err(old)) {
+		kfree(cel);
+		return xa_err(old);
+	}
 out:
 	*log = cel;
 	return 0;
Signature · 1 line
2.39.5
author maintainer
#3 lore raw

PATCH 3/623 dlm: fix removal of rsb struct that is master and dir record

In reply to Greg Kroah-Hartman

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

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

From: Alexander Aring <[email protected]>

[ Upstream commit 134129520beaf3339482c557361ea0bde709cf36 ]

An rsb struct was not being removed in the case where it was both the master and the dir record. This case (master and dir node) was missed in the condition for doing add_scan() from deactivate_rsb(). Fixing this triggers a related WARN_ON that needs to be fixed, and requires adjusting where two del_scan() calls are made.

Fixes c217adfc8caa ("dlm: fix add_scan and del_scan usage")
---
 fs/dlm/lock.c | 46 ++++++++++++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 16 deletions(-)
fs/dlm/lock.c +30 -16
index fc1d710166e92..c8ff88f1cdcf2 100644
@@ -824,9 +824,12 @@ static int find_rsb_dir(struct dlm_ls *ls, const void *name, int len,
 		r->res_first_lkid = 0;
 	}
 
-	/* A dir record will not be on the scan list. */
-	if (r->res_dir_nodeid != our_nodeid)
-		del_scan(ls, r);
+	/* we always deactivate scan timer for the rsb, when
+	 * we move it out of the inactive state as rsb state
+	 * can be changed and scan timers are only for inactive
+	 * rsbs.
+	 */
+	del_scan(ls, r);
 	list_move(&r->res_slow_list, &ls->ls_slow_active);
 	rsb_clear_flag(r, RSB_INACTIVE);
 	kref_init(&r->res_ref); /* ref is now used in active state */
@@ -989,10 +992,10 @@ static int find_rsb_nodir(struct dlm_ls *ls, const void *name, int len,
 		r->res_nodeid = 0;
 	}
 
+	del_scan(ls, r);
 	list_move(&r->res_slow_list, &ls->ls_slow_active);
 	rsb_clear_flag(r, RSB_INACTIVE);
 	kref_init(&r->res_ref);
-	del_scan(ls, r);
 	write_unlock_bh(&ls->ls_rsbtbl_lock);
 
 	goto out;
@@ -1337,9 +1340,13 @@ static int _dlm_master_lookup(struct dlm_ls *ls, int from_nodeid, const char *na
 	__dlm_master_lookup(ls, r, our_nodeid, from_nodeid, true, flags,
 			    r_nodeid, result);
 
-	/* A dir record rsb should never be on scan list. */
-	/* Try to fix this with del_scan? */
-	WARN_ON(!list_empty(&r->res_scan_list));
+	/* A dir record rsb should never be on scan list.
+	 * Except when we are the dir and master node.
+	 * This function should only be called by the dir
+	 * node.
+	 */
+	WARN_ON(!list_empty(&r->res_scan_list) &&
+		r->res_master_nodeid != our_nodeid);
 
 	write_unlock_bh(&ls->ls_rsbtbl_lock);
 
@@ -1430,16 +1437,23 @@ static void deactivate_rsb(struct kref *kref)
 	list_move(&r->res_slow_list, &ls->ls_slow_inactive);
 
 	/*
-	 * When the rsb becomes unused:
-	 * - If it's not a dir record for a remote master rsb,
-	 *   then it is put on the scan list to be freed.
-	 * - If it's a dir record for a remote master rsb,
-	 *   then it is kept in the inactive state until
-	 *   receive_remove() from the master node.
+	 * When the rsb becomes unused, there are two possibilities:
+	 * 1. Leave the inactive rsb in place (don't remove it).
+	 * 2. Add it to the scan list to be removed.
+	 *
+	 * 1 is done when the rsb is acting as the dir record
+	 * for a remotely mastered rsb.  The rsb must be left
+	 * in place as an inactive rsb to act as the dir record.
+	 *
+	 * 2 is done when a) the rsb is not the master and not the
+	 * dir record, b) when the rsb is both the master and the
+	 * dir record, c) when the rsb is master but not dir record.
+	 *
+	 * (If no directory is used, the rsb can always be removed.)
 	 */
-	if (!dlm_no_directory(ls) &&
-	    (r->res_master_nodeid != our_nodeid) &&
-	    (dlm_dir_nodeid(r) != our_nodeid))
+	if (dlm_no_directory(ls) ||
+	    (r->res_master_nodeid == our_nodeid ||
+	     dlm_dir_nodeid(r) != our_nodeid))
 		add_scan(ls, r);
 
 	if (r->res_lvbptr) {
Signature · 1 line
2.39.5
author maintainer
#23 lore raw

PATCH 23/623 selftests/powerpc: Fix argument order to timer_sub()

In reply to Greg Kroah-Hartman

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

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

From: Michael Ellerman <[email protected]>

[ Upstream commit 2bf66e66d2e6feece6175ec09ec590a0a8563bdd ]

Commit c814bf958926 ("powerpc/selftests: Use timersub() for gettimeofday()"), got the order of arguments to timersub() wrong, leading to a negative time delta being reported, eg:

test: gettimeofday
tags: git_version:v6.12-rc5-409-gdddf291c3030
time = -3.297781
success: gettimeofday

The correct order is minuend, subtrahend, which in this case is end, start. Which gives:

test: gettimeofday
tags: git_version:v6.12-rc5-409-gdddf291c3030-dirty time = 3.300650
success: gettimeofday

Fixes c814bf958926 ("powerpc/selftests: Use timersub() for gettimeofday()")
---
 tools/testing/selftests/powerpc/benchmarks/gettimeofday.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/powerpc/benchmarks/gettimeofday.c +1 -1
index 580fcac0a09f3..b71ef8a493ed1 100644
@@ -20,7 +20,7 @@ static int test_gettimeofday(void)
 		gettimeofday(&tv_end, NULL);
 	}
 
-	timersub(&tv_start, &tv_end, &tv_diff);
+	timersub(&tv_end, &tv_start, &tv_diff);
 
 	printf("time = %.6f\n", tv_diff.tv_sec + (tv_diff.tv_usec) * 1e-6);
 
Signature · 1 line
2.39.5
author maintainer
#24 lore raw

PATCH 24/623 nvme: Add error path for xa_store in nvme_init_effects

In reply to Greg Kroah-Hartman

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

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

From: Keisuke Nishimura <[email protected]>

[ Upstream commit d4a95adeabc6b5a39405e49c6d5ed14dd83682c4 ]

The xa_store() may fail due to memory allocation failure because there is no guarantee that the index NVME_CSI_NVM is already used. This fix introduces a new function to handle the error path.

Fixes cc115cbe12d9 ("nvme: always initialize known command effects")
---
 drivers/nvme/host/core.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
drivers/nvme/host/core.c +22 -4
index 315692cb2e614..7c4a19f5c951a 100644
@@ -3175,6 +3175,25 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 	return ret;
 }
 
+static int nvme_init_effects_log(struct nvme_ctrl *ctrl,
+		u8 csi, struct nvme_effects_log **log)
+{
+	struct nvme_effects_log *effects, *old;
+
+	effects = kzalloc(sizeof(*effects), GFP_KERNEL);
+	if (effects)
+		return -ENOMEM;
+
+	old = xa_store(&ctrl->cels, csi, effects, GFP_KERNEL);
+	if (xa_is_err(old)) {
+		kfree(effects);
+		return xa_err(old);
+	}
+
+	*log = effects;
+	return 0;
+}
+
 static void nvme_init_known_nvm_effects(struct nvme_ctrl *ctrl)
 {
 	struct nvme_effects_log	*log = ctrl->effects;
@@ -3221,10 +3240,9 @@ static int nvme_init_effects(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
 	}
 
 	if (!ctrl->effects) {
-		ctrl->effects = kzalloc(sizeof(*ctrl->effects), GFP_KERNEL);
-		if (!ctrl->effects)
-			return -ENOMEM;
-		xa_store(&ctrl->cels, NVME_CSI_NVM, ctrl->effects, GFP_KERNEL);
+		ret = nvme_init_effects_log(ctrl, NVME_CSI_NVM, &ctrl->effects);
+		if (ret < 0)
+			return ret;
 	}
 
 	nvme_init_known_nvm_effects(ctrl);
Signature · 1 line
2.39.5
author maintainer
#25 lore raw

PATCH 25/623 btrfs: improve the warning and error message for btrfs_remove_qgroup()

In reply to Greg Kroah-Hartman

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

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

From: Qu Wenruo <[email protected]>

[ Upstream commit c0def46dec9c547679a25fe7552c4bcbec0b0dd2 ]

[WARNING]
There are several warnings about the recently introduced qgroup auto-removal that it triggers WARN_ON() for the non-zero rfer/excl numbers, e.g:

 ------------[ cut here ]------------
 WARNING: CPU: 67 PID: 2882 at fs/btrfs/qgroup.c:1854 btrfs_remove_qgroup+0x3df/0x450
 CPU: 67 UID: 0 PID: 2882 Comm: btrfs-cleaner Kdump: loaded Not tainted 6.11.6-300.fc41.x86_64 #1
 RIP: 0010:btrfs_remove_qgroup+0x3df/0x450
 Call Trace:
  <TASK>
  btrfs_qgroup_cleanup_dropped_subvolume+0x97/0xc0
  btrfs_drop_snapshot+0x44e/0xa80
  btrfs_clean_one_deleted_snapshot+0xc3/0x110
  cleaner_kthread+0xd8/0x130
  kthread+0xd2/0x100
  ret_from_fork+0x34/0x50
  ret_from_fork_asm+0x1a/0x30
  </TASK>
 ---[ end trace 0000000000000000 ]---
 BTRFS warning (device sda): to be deleted qgroup 0/319 has non-zero numbers, rfer 258478080 rfer_cmpr 258478080 excl 0 excl_cmpr 0

[CAUSE]
Although the root cause is still unclear, as if qgroup is consistent a fully dropped subvolume (with extra transaction committed) should lead to all zero numbers for the qgroup.

My current guess is the subvolume drop triggered the new subtree drop threshold thus marked qgroup inconsistent, then rescan cleared it but some corner case is not properly handled during subvolume dropping.

But at least for this particular case, since it's only the rfer/excl not properly reset to 0, and qgroup is already marked inconsistent, there is nothing to be worried for the end users.

The user space tool utilizing qgroup would queue a rescan to handle everything, so the kernel wanring is a little overkilled.

[ENHANCEMENT]
Enhance the warning inside btrfs_remove_qgroup() by:

- Only do WARN() if CONFIG_BTRFS_DEBUG is enabled
As explained the kernel can handle inconsistent qgroups by simply do a rescan, there is nothing to bother the end users.

- Treat the reserved space leak the same as non-zero numbers By outputting the values and trigger a WARN() if it's a debug build. So far I haven't experienced any case related to reserved space so I hope we will never need to bother them.

Fixes 839d6ea4f86d ("btrfs: automatically remove the subvolume qgroup")
---
 fs/btrfs/qgroup.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
fs/btrfs/qgroup.c +16 -5
index f9b214992212d..993b5e803699e 100644
@@ -1838,9 +1838,19 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid)
 	 * Thus its reserved space should all be zero, no matter if qgroup
 	 * is consistent or the mode.
 	 */
-	WARN_ON(qgroup->rsv.values[BTRFS_QGROUP_RSV_DATA] ||
-		qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PREALLOC] ||
-		qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PERTRANS]);
+	if (qgroup->rsv.values[BTRFS_QGROUP_RSV_DATA] ||
+	    qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PREALLOC] ||
+	    qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PERTRANS]) {
+		WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
+		btrfs_warn_rl(fs_info,
+"to be deleted qgroup %u/%llu has non-zero numbers, data %llu meta prealloc %llu meta pertrans %llu",
+			      btrfs_qgroup_level(qgroup->qgroupid),
+			      btrfs_qgroup_subvolid(qgroup->qgroupid),
+			      qgroup->rsv.values[BTRFS_QGROUP_RSV_DATA],
+			      qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PREALLOC],
+			      qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PERTRANS]);
+
+	}
 	/*
 	 * The same for rfer/excl numbers, but that's only if our qgroup is
 	 * consistent and if it's in regular qgroup mode.
@@ -1849,8 +1859,9 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid)
 	 */
 	if (btrfs_qgroup_mode(fs_info) == BTRFS_QGROUP_MODE_FULL &&
 	    !(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT)) {
-		if (WARN_ON(qgroup->rfer || qgroup->excl ||
-			    qgroup->rfer_cmpr || qgroup->excl_cmpr)) {
+		if (qgroup->rfer || qgroup->excl ||
+		    qgroup->rfer_cmpr || qgroup->excl_cmpr) {
+			WARN_ON(IS_ENABLED(CONFIG_BTRFS_DEBUG));
 			btrfs_warn_rl(fs_info,
 "to be deleted qgroup %u/%llu has non-zero numbers, rfer %llu rfer_cmpr %llu excl %llu excl_cmpr %llu",
 				      btrfs_qgroup_level(qgroup->qgroupid),
Signature · 1 line
2.39.5
author maintainer
#26 lore raw

PATCH 26/623 partitions: ldm: remove the initial kernel-doc notation

In reply to Greg Kroah-Hartman

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

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

From: Randy Dunlap <[email protected]>

[ Upstream commit e494e451611a3de6ae95f99e8339210c157d70fb ]

Remove the file's first comment describing what the file is. This comment is not in kernel-doc format so it causes a kernel-doc warning.

ldm.h:13: warning: expecting prototype for ldm(). Prototype was for _FS_PT_LDM_H_() instead

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc Richard Russon (FlatCap) <[email protected]>
Cc Jens Axboe <[email protected]>
---
 block/partitions/ldm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/partitions/ldm.h +1 -1
index e259180c89148..aa3bd050d8cdd 100644
@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
-/**
+/*
  * ldm - Part of the Linux-NTFS project.
  *
  * Copyright (C) 2001,2002 Richard Russon <[email protected]>
Signature · 1 line
2.39.5
author maintainer
#27 lore raw

PATCH 27/623 btrfs: subpage: fix the bitmap dump of the locked flags

In reply to Greg Kroah-Hartman

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

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

From: Qu Wenruo <[email protected]>

[ Upstream commit 396294d1afee65a203d6cabd843d0782e5d7388e ]

We're dumping the locked bitmap into the @checked_bitmap variable, printing incorrect values during debug.

Thankfully even during my development I haven't hit a case where I need to dump the locked bitmap. But for the sake of consistency, fix it by dupping the locked bitmap into @locked_bitmap variable for output.

Fixes 75258f20fb70 ("btrfs: subpage: dump extra subpage bitmaps for debug")
---
 fs/btrfs/subpage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/subpage.c +4 -2
index 8c68059ac1b0c..03d7bfc042e2a 100644
@@ -716,6 +716,7 @@ void __cold btrfs_subpage_dump_bitmap(const struct btrfs_fs_info *fs_info,
 	unsigned long writeback_bitmap;
 	unsigned long ordered_bitmap;
 	unsigned long checked_bitmap;
+	unsigned long locked_bitmap;
 	unsigned long flags;
 
 	ASSERT(folio_test_private(folio) && folio_get_private(folio));
@@ -728,15 +729,16 @@ void __cold btrfs_subpage_dump_bitmap(const struct btrfs_fs_info *fs_info,
 	GET_SUBPAGE_BITMAP(subpage, fs_info, writeback, &writeback_bitmap);
 	GET_SUBPAGE_BITMAP(subpage, fs_info, ordered, &ordered_bitmap);
 	GET_SUBPAGE_BITMAP(subpage, fs_info, checked, &checked_bitmap);
-	GET_SUBPAGE_BITMAP(subpage, fs_info, locked, &checked_bitmap);
+	GET_SUBPAGE_BITMAP(subpage, fs_info, locked, &locked_bitmap);
 	spin_unlock_irqrestore(&subpage->lock, flags);
 
 	dump_page(folio_page(folio, 0), "btrfs subpage dump");
 	btrfs_warn(fs_info,
-"start=%llu len=%u page=%llu, bitmaps uptodate=%*pbl dirty=%*pbl writeback=%*pbl ordered=%*pbl checked=%*pbl",
+"start=%llu len=%u page=%llu, bitmaps uptodate=%*pbl dirty=%*pbl locked=%*pbl writeback=%*pbl ordered=%*pbl checked=%*pbl",
 		    start, len, folio_pos(folio),
 		    sectors_per_page, &uptodate_bitmap,
 		    sectors_per_page, &dirty_bitmap,
+		    sectors_per_page, &locked_bitmap,
 		    sectors_per_page, &writeback_bitmap,
 		    sectors_per_page, &ordered_bitmap,
 		    sectors_per_page, &checked_bitmap);
Signature · 1 line
2.39.5
author maintainer
#28 lore raw

PATCH 28/623 select: Fix unbalanced user_access_end()

In reply to Greg Kroah-Hartman

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

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

From: Christophe Leroy <[email protected]>

[ Upstream commit 344af27715ddbf357cf76978d674428b88f8e92d ]

While working on implementing user access validation on powerpc I got the following warnings on a pmac32_defconfig build:

	  CC      fs/select.o
	fs/select.o: warning: objtool: sys_pselect6+0x1bc: redundant UACCESS disable
	fs/select.o: warning: objtool: sys_pselect6_time32+0x1bc: redundant UACCESS disable

On powerpc/32s, user_read_access_begin/end() are no-ops, but the failure path has a user_access_end() instead of user_read_access_end() which means an access end without any prior access begin.

Replace that user_access_end() by user_read_access_end().

---
 fs/select.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/select.c +2 -2
index e223d1fe9d554..7da531b1cf6be 100644
@@ -786,7 +786,7 @@ static inline int get_sigset_argpack(struct sigset_argpack *to,
 	}
 	return 0;
 Efault:
-	user_access_end();
+	user_read_access_end();
 	return -EFAULT;
 }
 
@@ -1355,7 +1355,7 @@ static inline int get_compat_sigset_argpack(struct compat_sigset_argpack *to,
 	}
 	return 0;
 Efault:
-	user_access_end();
+	user_read_access_end();
 	return -EFAULT;
 }
 
Signature · 1 line
2.39.5
author maintainer
#29 lore raw

PATCH 29/623 nvme: fix bogus kzalloc() return check in nvme_init_effects_log()

In reply to Greg Kroah-Hartman

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

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

From: Jens Axboe <[email protected]>

[ Upstream commit 170e086ad3997f816d1f551f178a03a626a130b7 ]

nvme_init_effects_log() returns failure when kzalloc() is successful, which is obviously wrong and causes failures to boot. Correct the check.

Fixes d4a95adeabc6 ("nvme: Add error path for xa_store in nvme_init_effects")
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index 7c4a19f5c951a..12e7ae1f99e20 100644
@@ -3181,7 +3181,7 @@ static int nvme_init_effects_log(struct nvme_ctrl *ctrl,
 	struct nvme_effects_log *effects, *old;
 
 	effects = kzalloc(sizeof(*effects), GFP_KERNEL);
-	if (effects)
+	if (!effects)
 		return -ENOMEM;
 
 	old = xa_store(&ctrl->cels, csi, effects, GFP_KERNEL);
Signature · 1 line
2.39.5
author maintainer
#30 lore raw

PATCH 30/623 afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call

In reply to Greg Kroah-Hartman

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

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

From: David Howells <[email protected]>

[ Upstream commit e30458d690f35abb01de8b3cbc09285deb725d00 ]

Fix a pair of bugs in the fallback handling for the YFS.RemoveFile2 RPC call:

(1) Fix the abort code check to also look for RXGEN_OPCODE. The lack of this masks the second bug.

(2) call->server is now not used for ordinary filesystem RPC calls that

     have an operation descriptor.  Fix to use call->op->server instead.
Fixes e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept")
cc Marc Dionne <[email protected]>
---
 fs/afs/yfsclient.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/afs/yfsclient.c +3 -2
index 024227aba4cd5..362845f9aaaef 100644
@@ -666,8 +666,9 @@ static int yfs_deliver_fs_remove_file2(struct afs_call *call)
 static void yfs_done_fs_remove_file2(struct afs_call *call)
 {
 	if (call->error == -ECONNABORTED &&
-	    call->abort_code == RX_INVALID_OPERATION) {
-		set_bit(AFS_SERVER_FL_NO_RM2, &call->server->flags);
+	    (call->abort_code == RX_INVALID_OPERATION ||
+	     call->abort_code == RXGEN_OPCODE)) {
+		set_bit(AFS_SERVER_FL_NO_RM2, &call->op->server->flags);
 		call->op->flags |= AFS_OPERATION_DOWNGRADE;
 	}
 }
Signature · 1 line
2.39.5
author maintainer
#31 lore raw

PATCH 31/623 block: Ensure start sector is aligned for stacking atomic writes

In reply to Greg Kroah-Hartman

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

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

From: John Garry <[email protected]>

[ Upstream commit 6564862d646e7d630929ba1ff330740bb215bdac ]

For stacking atomic writes, ensure that the start sector is aligned with the device atomic write unit min and any boundary. Otherwise, we may permit misaligned atomic writes.

Rework bdev_can_atomic_write() into a common helper to resuse the alignment check. There also use atomic_write_hw_unit_min, which is more proper (than atomic_write_unit_min).

Fixes d7f36dc446e89 ("block: Support atomic writes limits for stacked devices")
---
 block/blk-settings.c   |  7 +++++--
 include/linux/blkdev.h | 21 ++++++++++++---------
 2 files changed, 17 insertions(+), 11 deletions(-)
block/blk-settings.c +5 -2
index b017637d9e735..64f2e67238d77 100644
@@ -608,7 +608,7 @@ static bool blk_stack_atomic_writes_head(struct queue_limits *t,
 }
 
 static void blk_stack_atomic_writes_limits(struct queue_limits *t,
-				struct queue_limits *b)
+				struct queue_limits *b, sector_t start)
 {
 	if (!(t->features & BLK_FEAT_ATOMIC_WRITES_STACKED))
 		goto unsupported;
@@ -616,6 +616,9 @@ static void blk_stack_atomic_writes_limits(struct queue_limits *t,
 	if (!b->atomic_write_unit_min)
 		goto unsupported;
 
+	if (!blk_atomic_write_start_sect_aligned(start, b))
+		goto unsupported;
+
 	/*
 	 * If atomic_write_hw_max is set, we have already stacked 1x bottom
 	 * device, so check for compliance.
@@ -798,7 +801,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
 		t->zone_write_granularity = 0;
 		t->max_zone_append_sectors = 0;
 	}
-	blk_stack_atomic_writes_limits(t, b);
+	blk_stack_atomic_writes_limits(t, b, start);
 
 	return ret;
 }
include/linux/blkdev.h +12 -9
index e0ce4d6913cde..495813277597f 100644
@@ -1701,6 +1701,15 @@ struct io_comp_batch {
 	void (*complete)(struct io_comp_batch *);
 };
 
+static inline bool blk_atomic_write_start_sect_aligned(sector_t sector,
+						struct queue_limits *limits)
+{
+	unsigned int alignment = max(limits->atomic_write_hw_unit_min,
+				limits->atomic_write_hw_boundary);
+
+	return IS_ALIGNED(sector, alignment >> SECTOR_SHIFT);
+}
+
 static inline bool bdev_can_atomic_write(struct block_device *bdev)
 {
 	struct request_queue *bd_queue = bdev->bd_queue;
@@ -1709,15 +1718,9 @@ static inline bool bdev_can_atomic_write(struct block_device *bdev)
 	if (!limits->atomic_write_unit_min)
 		return false;
 
-	if (bdev_is_partition(bdev)) {
-		sector_t bd_start_sect = bdev->bd_start_sect;
-		unsigned int alignment =
-			max(limits->atomic_write_unit_min,
-			    limits->atomic_write_hw_boundary);
-
-		if (!IS_ALIGNED(bd_start_sect, alignment >> SECTOR_SHIFT))
-			return false;
-	}
+	if (bdev_is_partition(bdev))
+		return blk_atomic_write_start_sect_aligned(bdev->bd_start_sect,
+							limits);
 
 	return true;
 }
Signature · 1 line
2.39.5
author maintainer
#32 lore raw

PATCH 32/623 perf/core: Save raw sample data conditionally based on sample type

In reply to Greg Kroah-Hartman

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

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

From: Yabin Cui <[email protected]>

[ Upstream commit b9c44b91476b67327a521568a854babecc4070ab ]

Currently, space for raw sample data is always allocated within sample records for both BPF output and tracepoint events. This leads to unused space in sample records when raw sample data is not requested.

This patch enforces checking sample type of an event in perf_sample_save_raw_data(). So raw sample data will only be saved if explicitly requested, reducing overhead when it is not needed.

Fixes 0a9081cf0a11 ("perf/core: Add perf_sample_save_raw_data() helper")
---
 arch/s390/kernel/perf_cpum_cf.c    |  2 +-
 arch/s390/kernel/perf_pai_crypto.c |  2 +-
 arch/s390/kernel/perf_pai_ext.c    |  2 +-
 arch/x86/events/amd/ibs.c          |  2 +-
 include/linux/perf_event.h         |  6 +++++
 kernel/events/core.c               | 35 +++++++++++++++---------------
 kernel/trace/bpf_trace.c           | 11 +++++-----
 7 files changed, 34 insertions(+), 26 deletions(-)
arch/s390/kernel/perf_cpum_cf.c +1 -1
index b0bc68da6a116..33205dd410e47 100644
@@ -981,7 +981,7 @@ static int cfdiag_push_sample(struct perf_event *event,
 	if (event->attr.sample_type & PERF_SAMPLE_RAW) {
 		raw.frag.size = cpuhw->usedss;
 		raw.frag.data = cpuhw->stop;
-		perf_sample_save_raw_data(&data, &raw);
+		perf_sample_save_raw_data(&data, event, &raw);
 	}
 
 	overflow = perf_event_overflow(event, &data, &regs);
arch/s390/kernel/perf_pai_crypto.c +1 -1
index fa73254542661..10725f5a6f0fd 100644
@@ -478,7 +478,7 @@ static int paicrypt_push_sample(size_t rawsize, struct paicrypt_map *cpump,
 	if (event->attr.sample_type & PERF_SAMPLE_RAW) {
 		raw.frag.size = rawsize;
 		raw.frag.data = cpump->save;
-		perf_sample_save_raw_data(&data, &raw);
+		perf_sample_save_raw_data(&data, event, &raw);
 	}
 
 	overflow = perf_event_overflow(event, &data, &regs);
arch/s390/kernel/perf_pai_ext.c +1 -1
index 7f462bef1fc07..a8f0bad99cf04 100644
@@ -503,7 +503,7 @@ static int paiext_push_sample(size_t rawsize, struct paiext_map *cpump,
 	if (event->attr.sample_type & PERF_SAMPLE_RAW) {
 		raw.frag.size = rawsize;
 		raw.frag.data = cpump->save;
-		perf_sample_save_raw_data(&data, &raw);
+		perf_sample_save_raw_data(&data, event, &raw);
 	}
 
 	overflow = perf_event_overflow(event, &data, &regs);
arch/x86/events/amd/ibs.c +1 -1
index e91970b01d624..c3a2f6f57770a 100644
@@ -1118,7 +1118,7 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
 				.data = ibs_data.data,
 			},
 		};
-		perf_sample_save_raw_data(&data, &raw);
+		perf_sample_save_raw_data(&data, event, &raw);
 	}
 
 	if (perf_ibs == &perf_ibs_op)
include/linux/perf_event.h +6 -0
index cb99ec8c9e96f..f7c0a3f2f502d 100644
@@ -1287,12 +1287,18 @@ static inline void perf_sample_save_callchain(struct perf_sample_data *data,
 }
 
 static inline void perf_sample_save_raw_data(struct perf_sample_data *data,
+					     struct perf_event *event,
 					     struct perf_raw_record *raw)
 {
 	struct perf_raw_frag *frag = &raw->frag;
 	u32 sum = 0;
 	int size;
 
+	if (!(event->attr.sample_type & PERF_SAMPLE_RAW))
+		return;
+	if (WARN_ON_ONCE(data->sample_flags & PERF_SAMPLE_RAW))
+		return;
+
 	do {
 		sum += frag->size;
 		if (perf_raw_frag_last(frag))
kernel/events/core.c +18 -17
index 065f9188b44a0..e9f698c08dc17 100644
@@ -10425,9 +10425,9 @@ static struct pmu perf_tracepoint = {
 };
 
 static int perf_tp_filter_match(struct perf_event *event,
-				struct perf_sample_data *data)
+				struct perf_raw_record *raw)
 {
-	void *record = data->raw->frag.data;
+	void *record = raw->frag.data;
 
 	/* only top level events have filters set */
 	if (event->parent)
@@ -10439,7 +10439,7 @@ static int perf_tp_filter_match(struct perf_event *event,
 }
 
 static int perf_tp_event_match(struct perf_event *event,
-				struct perf_sample_data *data,
+				struct perf_raw_record *raw,
 				struct pt_regs *regs)
 {
 	if (event->hw.state & PERF_HES_STOPPED)
@@ -10450,7 +10450,7 @@ static int perf_tp_event_match(struct perf_event *event,
 	if (event->attr.exclude_kernel && !user_mode(regs))
 		return 0;
 
-	if (!perf_tp_filter_match(event, data))
+	if (!perf_tp_filter_match(event, raw))
 		return 0;
 
 	return 1;
@@ -10476,6 +10476,7 @@ EXPORT_SYMBOL_GPL(perf_trace_run_bpf_submit);
 static void __perf_tp_event_target_task(u64 count, void *record,
 					struct pt_regs *regs,
 					struct perf_sample_data *data,
+					struct perf_raw_record *raw,
 					struct perf_event *event)
 {
 	struct trace_entry *entry = record;
@@ -10485,13 +10486,17 @@ static void __perf_tp_event_target_task(u64 count, void *record,
 	/* Cannot deliver synchronous signal to other task. */
 	if (event->attr.sigtrap)
 		return;
-	if (perf_tp_event_match(event, data, regs))
+	if (perf_tp_event_match(event, raw, regs)) {
+		perf_sample_data_init(data, 0, 0);
+		perf_sample_save_raw_data(data, event, raw);
 		perf_swevent_event(event, count, data, regs);
+	}
 }
 
 static void perf_tp_event_target_task(u64 count, void *record,
 				      struct pt_regs *regs,
 				      struct perf_sample_data *data,
+				      struct perf_raw_record *raw,
 				      struct perf_event_context *ctx)
 {
 	unsigned int cpu = smp_processor_id();
@@ -10499,15 +10504,15 @@ static void perf_tp_event_target_task(u64 count, void *record,
 	struct perf_event *event, *sibling;
 
 	perf_event_groups_for_cpu_pmu(event, &ctx->pinned_groups, cpu, pmu) {
-		__perf_tp_event_target_task(count, record, regs, data, event);
+		__perf_tp_event_target_task(count, record, regs, data, raw, event);
 		for_each_sibling_event(sibling, event)
-			__perf_tp_event_target_task(count, record, regs, data, sibling);
+			__perf_tp_event_target_task(count, record, regs, data, raw, sibling);
 	}
 
 	perf_event_groups_for_cpu_pmu(event, &ctx->flexible_groups, cpu, pmu) {
-		__perf_tp_event_target_task(count, record, regs, data, event);
+		__perf_tp_event_target_task(count, record, regs, data, raw, event);
 		for_each_sibling_event(sibling, event)
-			__perf_tp_event_target_task(count, record, regs, data, sibling);
+			__perf_tp_event_target_task(count, record, regs, data, raw, sibling);
 	}
 }
 
@@ -10525,15 +10530,10 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
 		},
 	};
 
-	perf_sample_data_init(&data, 0, 0);
-	perf_sample_save_raw_data(&data, &raw);
-
 	perf_trace_buf_update(record, event_type);
 
 	hlist_for_each_entry_rcu(event, head, hlist_entry) {
-		if (perf_tp_event_match(event, &data, regs)) {
-			perf_swevent_event(event, count, &data, regs);
-
+		if (perf_tp_event_match(event, &raw, regs)) {
 			/*
 			 * Here use the same on-stack perf_sample_data,
 			 * some members in data are event-specific and
@@ -10543,7 +10543,8 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
 			 * because data->sample_flags is set.
 			 */
 			perf_sample_data_init(&data, 0, 0);
-			perf_sample_save_raw_data(&data, &raw);
+			perf_sample_save_raw_data(&data, event, &raw);
+			perf_swevent_event(event, count, &data, regs);
 		}
 	}
 
@@ -10560,7 +10561,7 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
 			goto unlock;
 
 		raw_spin_lock(&ctx->lock);
-		perf_tp_event_target_task(count, record, regs, &data, ctx);
+		perf_tp_event_target_task(count, record, regs, &data, &raw, ctx);
 		raw_spin_unlock(&ctx->lock);
 unlock:
 		rcu_read_unlock();
kernel/trace/bpf_trace.c +6 -5
index 1b8db5aee9d38..9f2f65767639d 100644
@@ -619,7 +619,8 @@ static const struct bpf_func_proto bpf_perf_event_read_value_proto = {
 
 static __always_inline u64
 __bpf_perf_event_output(struct pt_regs *regs, struct bpf_map *map,
-			u64 flags, struct perf_sample_data *sd)
+			u64 flags, struct perf_raw_record *raw,
+			struct perf_sample_data *sd)
 {
 	struct bpf_array *array = container_of(map, struct bpf_array, map);
 	unsigned int cpu = smp_processor_id();
@@ -644,6 +645,8 @@ __bpf_perf_event_output(struct pt_regs *regs, struct bpf_map *map,
 	if (unlikely(event->oncpu != cpu))
 		return -EOPNOTSUPP;
 
+	perf_sample_save_raw_data(sd, event, raw);
+
 	return perf_event_output(event, sd, regs);
 }
 
@@ -687,9 +690,8 @@ BPF_CALL_5(bpf_perf_event_output, struct pt_regs *, regs, struct bpf_map *, map,
 	}
 
 	perf_sample_data_init(sd, 0, 0);
-	perf_sample_save_raw_data(sd, &raw);
 
-	err = __bpf_perf_event_output(regs, map, flags, sd);
+	err = __bpf_perf_event_output(regs, map, flags, &raw, sd);
 out:
 	this_cpu_dec(bpf_trace_nest_level);
 	preempt_enable();
@@ -748,9 +750,8 @@ u64 bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size,
 
 	perf_fetch_caller_regs(regs);
 	perf_sample_data_init(sd, 0, 0);
-	perf_sample_save_raw_data(sd, &raw);
 
-	ret = __bpf_perf_event_output(regs, map, flags, sd);
+	ret = __bpf_perf_event_output(regs, map, flags, &raw, sd);
 out:
 	this_cpu_dec(bpf_event_output_nest_level);
 	preempt_enable();
Signature · 1 line
2.39.5
author maintainer
#33 lore raw

PATCH 33/623 sched/fair: Untangle NEXT_BUDDY and pick_next_task()

In reply to Greg Kroah-Hartman

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

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

From: Peter Zijlstra <[email protected]>

[ Upstream commit 2a77e4be12cb58bbf774e7c717c8bb80e128b7a4 ]

There are 3 sites using set_next_buddy() and only one is conditional on NEXT_BUDDY, the other two sites are unconditional; to note:

- yield_to_task()
- cgroup dequeue / pick optimization

However, having NEXT_BUDDY control both the wakeup-preemption and the picking side of things means its near useless.

Fixes 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy")
---
 kernel/sched/fair.c     | 4 ++--
 kernel/sched/features.h | 9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
kernel/sched/fair.c +2 -2
index 26958431deb7a..808010430a16e 100644
@@ -5538,9 +5538,9 @@ static struct sched_entity *
 pick_next_entity(struct rq *rq, struct cfs_rq *cfs_rq)
 {
 	/*
-	 * Enabling NEXT_BUDDY will affect latency but not fairness.
+	 * Picking the ->next buddy will affect latency but not fairness.
 	 */
-	if (sched_feat(NEXT_BUDDY) &&
+	if (sched_feat(PICK_BUDDY) &&
 	    cfs_rq->next && entity_eligible(cfs_rq, cfs_rq->next)) {
 		/* ->next will never be delayed */
 		SCHED_WARN_ON(cfs_rq->next->sched_delayed);
kernel/sched/features.h +9 -0
index a3d331dd2d8ff..3c12d9f93331d 100644
@@ -31,6 +31,15 @@ SCHED_FEAT(PREEMPT_SHORT, true)
  */
 SCHED_FEAT(NEXT_BUDDY, false)
 
+/*
+ * Allow completely ignoring cfs_rq->next; which can be set from various
+ * places:
+ *   - NEXT_BUDDY (wakeup preemption)
+ *   - yield_to_task()
+ *   - cgroup dequeue / pick
+ */
+SCHED_FEAT(PICK_BUDDY, true)
+
 /*
  * Consider buddies to be cache hot, decreases the likeliness of a
  * cache buddy being migrated away, increases cache locality.
Signature · 1 line
2.39.5
author maintainer
#34 lore raw

PATCH 34/623 sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat

In reply to Greg Kroah-Hartman

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

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

From: Peter Zijlstra <[email protected]>

[ Upstream commit a430d99e349026d53e2557b7b22bd2ebd61fe12a ]

In /proc/schedstat, lb_hot_gained reports the number hot tasks pulled during load balance. This value is incremented in can_migrate_task() if the task is migratable and hot. After incrementing the value, load balancer can still decide not to migrate this task leading to wrong accounting. Fix this by incrementing stats when hot tasks are detached. This issue only exists in detach_tasks() where we can decide to not migrate hot task even if it is migratable. However, in detach_one_task(), we migrate it unconditionally.

[Swapnil: Handled the case where nr_failed_migrations_hot was not accounted properly and wrote commit log]

---
 include/linux/sched.h |  1 +
 kernel/sched/fair.c   | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)
include/linux/sched.h +1 -0
index 64934e0830af3..949b53e0accf2 100644
@@ -944,6 +944,7 @@ struct task_struct {
 	unsigned			sched_reset_on_fork:1;
 	unsigned			sched_contributes_to_load:1;
 	unsigned			sched_migrated:1;
+	unsigned			sched_task_hot:1;
 
 	/* Force alignment to the next boundary: */
 	unsigned			:0;
kernel/sched/fair.c +13 -4
index 808010430a16e..8800679b508d9 100644
@@ -9303,6 +9303,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
 	int tsk_cache_hot;
 
 	lockdep_assert_rq_held(env->src_rq);
+	if (p->sched_task_hot)
+		p->sched_task_hot = 0;
 
 	/*
 	 * We do not migrate tasks that are:
@@ -9375,10 +9377,8 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
 
 	if (tsk_cache_hot <= 0 ||
 	    env->sd->nr_balance_failed > env->sd->cache_nice_tries) {
-		if (tsk_cache_hot == 1) {
-			schedstat_inc(env->sd->lb_hot_gained[env->idle]);
-			schedstat_inc(p->stats.nr_forced_migrations);
-		}
+		if (tsk_cache_hot == 1)
+			p->sched_task_hot = 1;
 		return 1;
 	}
 
@@ -9393,6 +9393,12 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
 {
 	lockdep_assert_rq_held(env->src_rq);
 
+	if (p->sched_task_hot) {
+		p->sched_task_hot = 0;
+		schedstat_inc(env->sd->lb_hot_gained[env->idle]);
+		schedstat_inc(p->stats.nr_forced_migrations);
+	}
+
 	deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK);
 	set_task_cpu(p, env->dst_cpu);
 }
@@ -9553,6 +9559,9 @@ static int detach_tasks(struct lb_env *env)
 
 		continue;
 next:
+		if (p->sched_task_hot)
+			schedstat_inc(p->stats.nr_failed_migrations_hot);
+
 		list_move(&p->se.group_node, tasks);
 	}
 
Signature · 1 line
2.39.5
author maintainer
#35 lore raw

PATCH 35/623 sched: Fix race between yield_to() and try_to_wake_up()

In reply to Greg Kroah-Hartman

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

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

From: Tianchen Ding <[email protected]>

[ Upstream commit 5d808c78d97251af1d3a3e4f253e7d6c39fd871e ]

We met a SCHED_WARN in set_next_buddy():
__warn_printk
set_next_buddy
yield_to_task_fair
yield_to
kvm_vcpu_yield_to [kvm]
...

After a short dig, we found the rq_lock held by yield_to() may not be exactly the rq that the target task belongs to. There is a race window against try_to_wake_up().

CPU0 target_task

blocking on CPU1
lock rq0 & rq1
double check task_rq == p_rq, ok
woken to CPU2 (lock task_pi & rq2) task_rq = rq2
yield_to_task_fair (w/o lock rq2)

In this race window, yield_to() is operating the task w/o the correct lock. Fix this by taking task pi_lock first.

Fixes d95f41220065 ("sched: Add yield_to(task, preempt) functionality")
---
 kernel/sched/syscalls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/syscalls.c +1 -1
index ff0e5ab4e37cb..943406c4ee865 100644
@@ -1433,7 +1433,7 @@ int __sched yield_to(struct task_struct *p, bool preempt)
 	struct rq *rq, *p_rq;
 	int yielded = 0;
 
-	scoped_guard (irqsave) {
+	scoped_guard (raw_spinlock_irqsave, &p->pi_lock) {
 		rq = this_rq();
 
 again:
Signature · 1 line
2.39.5
author maintainer
#36 lore raw

PATCH 36/623 x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally

In reply to Greg Kroah-Hartman

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

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

From: K Prateek Nayak <[email protected]>

[ Upstream commit e1bc02646527fc1ed74f00eb599b2b74d49671c7 ]

x86_sched_itmt_flags() returns SD_ASYM_PACKING if ITMT support is enabled by the system. Without ITMT support being enabled, it returns 0 similar to current x86_die_flags() on non-Hybrid systems (!X86_HYBRID_CPU and !X86_FEATURE_AMD_HETEROGENEOUS_CORES)

On Intel systems that enable ITMT support, either the MC domain coincides with the PKG domain, or in case of multiple MC groups within a PKG domain, either Sub-NUMA Cluster (SNC) is enabled or the processor features Hybrid core layout (X86_HYBRID_CPU) which leads to three distinct possibilities:

o If PKG and MC domains coincide, PKG domain is degenerated by sd_parent_degenerate() when building sched domain topology.

o If SNC is enabled, PKG domain is never added since "x86_has_numa_in_package" is set and the topology will instead contain NODE and NUMA domains.

o On X86_HYBRID_CPU which contains multiple MC groups within the PKG, the PKG domain requires x86_sched_itmt_flags().

Thus, on Intel systems that contains multiple MC groups within the PKG and enables ITMT support, the PKG domain requires x86_sched_itmt_flags(). In all other cases PKG domain is either never added or is degenerated. Thus, returning x86_sched_itmt_flags() unconditionally at PKG domain on Intel systems should not lead to any functional changes.

On AMD systems with multiple LLCs (MC groups) within a PKG domain, enabling ITMT support requires setting SD_ASYM_PACKING to the PKG domain since the core rankings are assigned PKG-wide.

Core rankings on AMD processors is currently set by the amd-pstate driver when Preferred Core feature is supported. A subset of systems that support Preferred Core feature can be detected using X86_FEATURE_AMD_HETEROGENEOUS_CORES however, this does not cover all the systems that support Preferred Core ranking.

Detecting Preferred Core support on AMD systems requires inspecting CPPC Highest Perf on all present CPUs and checking if it differs on at least one CPU. Previous suggestion to use a synthetic feature to detect Preferred Core support [1] was found to be non-trivial to implement since BSP alone cannot detect if Preferred Core is supported and by the time AP comes up, alternatives are patched and setting a X86_FEATURE_* then is not possible.

Since x86 processors enabling ITMT support that consists multiple non-NUMA MC groups within a PKG requires SD_ASYM_PACKING flag set at the PKG domain, return x86_sched_itmt_flags unconditionally for the PKG domain.

Since x86_die_flags() would have just returned x86_sched_itmt_flags() after the change, remove the unnecessary wrapper and pass x86_sched_itmt_flags() directly as the flags function.

Fixes f3a052391822 ("cpufreq: amd-pstate: Enable amd-pstate preferred core support")
---
 arch/x86/kernel/smpboot.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
arch/x86/kernel/smpboot.c +1 -10
index b5a8f0891135b..f1fac08fdef28 100644
@@ -495,15 +495,6 @@ static int x86_cluster_flags(void)
 }
 #endif
 
-static int x86_die_flags(void)
-{
-	if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU) ||
-	    cpu_feature_enabled(X86_FEATURE_AMD_HETEROGENEOUS_CORES))
-		return x86_sched_itmt_flags();
-
-	return 0;
-}
-
 /*
  * Set if a package/die has multiple NUMA nodes inside.
  * AMD Magny-Cours, Intel Cluster-on-Die, and Intel
@@ -539,7 +530,7 @@ static void __init build_sched_topology(void)
 	 */
 	if (!x86_has_numa_in_package) {
 		x86_topology[i++] = (struct sched_domain_topology_level){
-			cpu_cpu_mask, x86_die_flags, SD_INIT_NAME(PKG)
+			cpu_cpu_mask, x86_sched_itmt_flags, SD_INIT_NAME(PKG)
 		};
 	}
 
Signature · 1 line
2.39.5
author maintainer
#37 lore raw

PATCH 37/623 psi: Fix race when task wakes up before psi_sched_switch() adjusts flags

In reply to Greg Kroah-Hartman

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

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

From: Chengming Zhou <[email protected]>

[ Upstream commit 7d9da040575b343085287686fa902a5b2d43c7ca ]

When running hackbench in a cgroup with bandwidth throttling enabled, following PSI splat was observed:

psi: inconsistent task state! task=1831:hackbench cpu=8 psi_flags=14 clear=0 set=4

When investigating the series of events leading up to the splat, following sequence was observed:

    [008] d..2.: sched_switch: ... ==> next_comm=hackbench next_pid=1831 next_prio=120
        ...
    [008] dN.2.: dequeue_entity(task delayed): task=hackbench pid=1831 cfs_rq->throttled=0
    [008] dN.2.: pick_task_fair: check_cfs_rq_runtime() throttled cfs_rq on CPU8
    # CPU8 goes into newidle balance and releases the rq lock
        ...
    # CPU15 on same LLC Domain is trying to wakeup hackbench(pid=1831)
    [015] d..4.: psi_flags_change: psi: task state: task=1831:hackbench cpu=8 psi_flags=14 clear=0 set=4 final=14 # Splat (cfs_rq->throttled=1)
    [015] d..4.: sched_wakeup: comm=hackbench pid=1831 prio=120 target_cpu=008 # Task has woken on a throttled hierarchy
    [008] d..2.: sched_switch: prev_comm=hackbench prev_pid=1831 prev_prio=120 prev_state=S ==> ...

psi_dequeue() relies on psi_sched_switch() to set the correct PSI flags for the blocked entity, however, with the introduction of DELAY_DEQUEUE, the block task can wakeup when newidle balance drops the runqueue lock during __schedule().

If a task wakes before psi_sched_switch() adjusts the PSI flags, skip any modifications in psi_enqueue() which would still see the flags of a running task and not a blocked one. Instead, rely on psi_sched_switch() to do the right thing.

Since the status returned by try_to_block_task() may no longer be true by the time schedule reaches psi_sched_switch(), check if the task is blocked or not using a combination of task_on_rq_queued() and p->se.sched_delayed checks.

[ prateek: Commit message, testing, early bailout in psi_enqueue() ]

---
 kernel/sched/core.c  | 6 +++---
 kernel/sched/stats.h | 4 ++++
 2 files changed, 7 insertions(+), 3 deletions(-)
kernel/sched/core.c +3 -3
index 3e5a6bf587f91..e0fd8069c60e6 100644
@@ -6641,7 +6641,6 @@ static void __sched notrace __schedule(int sched_mode)
 	 * as a preemption by schedule_debug() and RCU.
 	 */
 	bool preempt = sched_mode > SM_NONE;
-	bool block = false;
 	unsigned long *switch_count;
 	unsigned long prev_state;
 	struct rq_flags rf;
@@ -6702,7 +6701,7 @@ static void __sched notrace __schedule(int sched_mode)
 			goto picked;
 		}
 	} else if (!preempt && prev_state) {
-		block = try_to_block_task(rq, prev, prev_state);
+		try_to_block_task(rq, prev, prev_state);
 		switch_count = &prev->nvcsw;
 	}
 
@@ -6748,7 +6747,8 @@ static void __sched notrace __schedule(int sched_mode)
 
 		migrate_disable_switch(rq, prev);
 		psi_account_irqtime(rq, prev, next);
-		psi_sched_switch(prev, next, block);
+		psi_sched_switch(prev, next, !task_on_rq_queued(prev) ||
+					     prev->se.sched_delayed);
 
 		trace_sched_switch(preempt, prev, next, prev_state);
 
kernel/sched/stats.h +4 -0
index 8ee0add5a48a8..6ade91bce63ee 100644
@@ -138,6 +138,10 @@ static inline void psi_enqueue(struct task_struct *p, int flags)
 	if (flags & ENQUEUE_RESTORE)
 		return;
 
+	/* psi_sched_switch() will handle the flags */
+	if (task_on_cpu(task_rq(p), p))
+		return;
+
 	if (p->se.sched_delayed) {
 		/* CPU migration of "sleeping" task */
 		SCHED_WARN_ON(!(flags & ENQUEUE_MIGRATED));
Signature · 1 line
2.39.5
author maintainer
#38 lore raw

PATCH 38/623 drm/v3d: Fix performance counter source settings on V3D 7.x

In reply to Greg Kroah-Hartman

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

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

From: Maíra Canal <[email protected]>

[ Upstream commit e987e22e9229d70c2083a91cc61269b2c4924955 ]

When the new register addresses were introduced for V3D 7.x, we added new masks for performance counter sources on V3D 7.x. Nevertheless, we never apply these new masks when setting the sources.

Fix the performance counter source settings on V3D 7.x by introducing a new macro, V3D_SET_FIELD_VER, which allows fields setting to vary by version. Using this macro, we can provide different values for source mask based on the V3D version, ensuring that sources are correctly configure on V3D 7.x.

---
 drivers/gpu/drm/v3d/v3d_debugfs.c |  4 ++--
 drivers/gpu/drm/v3d/v3d_perfmon.c | 15 ++++++++-------
 drivers/gpu/drm/v3d/v3d_regs.h    | 29 +++++++++++++++++------------
 3 files changed, 27 insertions(+), 21 deletions(-)
drivers/gpu/drm/v3d/v3d_debugfs.c +2 -2
index 19e3ee7ac897f..76816f2551c10 100644
@@ -237,8 +237,8 @@ static int v3d_measure_clock(struct seq_file *m, void *unused)
 	if (v3d->ver >= 40) {
 		int cycle_count_reg = V3D_PCTR_CYCLE_COUNT(v3d->ver);
 		V3D_CORE_WRITE(core, V3D_V4_PCTR_0_SRC_0_3,
-			       V3D_SET_FIELD(cycle_count_reg,
-					     V3D_PCTR_S0));
+			       V3D_SET_FIELD_VER(cycle_count_reg,
+						 V3D_PCTR_S0, v3d->ver));
 		V3D_CORE_WRITE(core, V3D_V4_PCTR_0_CLR, 1);
 		V3D_CORE_WRITE(core, V3D_V4_PCTR_0_EN, 1);
 	} else {
drivers/gpu/drm/v3d/v3d_perfmon.c +8 -7
index 924814cab46a1..ecf06e8e9fbcc 100644
@@ -240,17 +240,18 @@ void v3d_perfmon_start(struct v3d_dev *v3d, struct v3d_perfmon *perfmon)
 
 	for (i = 0; i < ncounters; i++) {
 		u32 source = i / 4;
-		u32 channel = V3D_SET_FIELD(perfmon->counters[i], V3D_PCTR_S0);
+		u32 channel = V3D_SET_FIELD_VER(perfmon->counters[i], V3D_PCTR_S0,
+						v3d->ver);
 
 		i++;
-		channel |= V3D_SET_FIELD(i < ncounters ? perfmon->counters[i] : 0,
-					 V3D_PCTR_S1);
+		channel |= V3D_SET_FIELD_VER(i < ncounters ? perfmon->counters[i] : 0,
+					     V3D_PCTR_S1, v3d->ver);
 		i++;
-		channel |= V3D_SET_FIELD(i < ncounters ? perfmon->counters[i] : 0,
-					 V3D_PCTR_S2);
+		channel |= V3D_SET_FIELD_VER(i < ncounters ? perfmon->counters[i] : 0,
+					     V3D_PCTR_S2, v3d->ver);
 		i++;
-		channel |= V3D_SET_FIELD(i < ncounters ? perfmon->counters[i] : 0,
-					 V3D_PCTR_S3);
+		channel |= V3D_SET_FIELD_VER(i < ncounters ? perfmon->counters[i] : 0,
+					     V3D_PCTR_S3, v3d->ver);
 		V3D_CORE_WRITE(0, V3D_V4_PCTR_0_SRC_X(source), channel);
 	}
 
drivers/gpu/drm/v3d/v3d_regs.h +17 -12
index 1b1a62ad95852..6da3c69082bd6 100644
@@ -15,6 +15,14 @@
 		fieldval & field##_MASK;				\
 	 })
 
+#define V3D_SET_FIELD_VER(value, field, ver)				\
+	({								\
+		typeof(ver) _ver = (ver);				\
+		u32 fieldval = (value) << field##_SHIFT(_ver);		\
+		WARN_ON((fieldval & ~field##_MASK(_ver)) != 0);		\
+		fieldval & field##_MASK(_ver);				\
+	 })
+
 #define V3D_GET_FIELD(word, field) (((word) & field##_MASK) >>		\
 				    field##_SHIFT)
 
@@ -354,18 +362,15 @@
 #define V3D_V4_PCTR_0_SRC_28_31                        0x0067c
 #define V3D_V4_PCTR_0_SRC_X(x)                         (V3D_V4_PCTR_0_SRC_0_3 + \
 							4 * (x))
-# define V3D_PCTR_S0_MASK                              V3D_MASK(6, 0)
-# define V3D_V7_PCTR_S0_MASK                           V3D_MASK(7, 0)
-# define V3D_PCTR_S0_SHIFT                             0
-# define V3D_PCTR_S1_MASK                              V3D_MASK(14, 8)
-# define V3D_V7_PCTR_S1_MASK                           V3D_MASK(15, 8)
-# define V3D_PCTR_S1_SHIFT                             8
-# define V3D_PCTR_S2_MASK                              V3D_MASK(22, 16)
-# define V3D_V7_PCTR_S2_MASK                           V3D_MASK(23, 16)
-# define V3D_PCTR_S2_SHIFT                             16
-# define V3D_PCTR_S3_MASK                              V3D_MASK(30, 24)
-# define V3D_V7_PCTR_S3_MASK                           V3D_MASK(31, 24)
-# define V3D_PCTR_S3_SHIFT                             24
+# define V3D_PCTR_S0_MASK(ver) (((ver) >= 71) ? V3D_MASK(7, 0) : V3D_MASK(6, 0))
+# define V3D_PCTR_S0_SHIFT(ver)                        0
+# define V3D_PCTR_S1_MASK(ver) (((ver) >= 71) ? V3D_MASK(15, 8) : V3D_MASK(14, 8))
+# define V3D_PCTR_S1_SHIFT(ver)                        8
+# define V3D_PCTR_S2_MASK(ver) (((ver) >= 71) ? V3D_MASK(23, 16) : V3D_MASK(22, 16))
+# define V3D_PCTR_S2_SHIFT(ver)                        16
+# define V3D_PCTR_S3_MASK(ver) (((ver) >= 71) ? V3D_MASK(31, 24) : V3D_MASK(30, 24))
+# define V3D_PCTR_S3_SHIFT(ver)                        24
+
 #define V3D_PCTR_CYCLE_COUNT(ver) ((ver >= 71) ? 0 : 32)
 
 /* Output values of the counters. */
Signature · 1 line
2.39.5
author maintainer
#39 lore raw

PATCH 39/623 drm/i915: Grab intel_display from the encoder to avoid potential oopsies

In reply to Greg Kroah-Hartman

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

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

From: Ville Syrjälä <[email protected]>

[ Upstream commit dc3806d9eb66d0105f8d55d462d4ef681d9eac59 ]

Grab the intel_display from 'encoder' rather than 'state' in the encoder hooks to avoid the massive footgun that is intel_sanitize_encoder(), which passes NULL as the 'state' argument to encoder .disable() and .post_disable().

TODO: figure out how to actually fix intel_sanitize_encoder()...

Fixes 40eb34c3f491 ("drm/i915/crt: convert to struct intel_display")
Fixes ab0b0eb5c85c ("drm/i915/tv: convert to struct intel_display")
---
 drivers/gpu/drm/i915/display/intel_crt.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_crt.c +5 -5
index 74c1983fe07ea..1be55bdb48b96 100644
@@ -244,7 +244,7 @@ static void hsw_disable_crt(struct intel_atomic_state *state,
 			    const struct intel_crtc_state *old_crtc_state,
 			    const struct drm_connector_state *old_conn_state)
 {
-	struct intel_display *display = to_intel_display(state);
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 
 	drm_WARN_ON(display->drm, !old_crtc_state->has_pch_encoder);
@@ -257,7 +257,7 @@ static void hsw_post_disable_crt(struct intel_atomic_state *state,
 				 const struct intel_crtc_state *old_crtc_state,
 				 const struct drm_connector_state *old_conn_state)
 {
-	struct intel_display *display = to_intel_display(state);
+	struct intel_display *display = to_intel_display(encoder);
 	struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 
@@ -287,7 +287,7 @@ static void hsw_pre_pll_enable_crt(struct intel_atomic_state *state,
 				   const struct intel_crtc_state *crtc_state,
 				   const struct drm_connector_state *conn_state)
 {
-	struct intel_display *display = to_intel_display(state);
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 
 	drm_WARN_ON(display->drm, !crtc_state->has_pch_encoder);
@@ -300,7 +300,7 @@ static void hsw_pre_enable_crt(struct intel_atomic_state *state,
 			       const struct intel_crtc_state *crtc_state,
 			       const struct drm_connector_state *conn_state)
 {
-	struct intel_display *display = to_intel_display(state);
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	enum pipe pipe = crtc->pipe;
@@ -319,7 +319,7 @@ static void hsw_enable_crt(struct intel_atomic_state *state,
 			   const struct intel_crtc_state *crtc_state,
 			   const struct drm_connector_state *conn_state)
 {
-	struct intel_display *display = to_intel_display(state);
+	struct intel_display *display = to_intel_display(encoder);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	enum pipe pipe = crtc->pipe;
Signature · 1 line
2.39.5
author maintainer
#40 lore raw

PATCH 40/623 drm/rockchip: vop2: fix rk3588 dp+dsi maxclk verification

In reply to Greg Kroah-Hartman

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

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

From: Heiko Stuebner <[email protected]>

[ Upstream commit 5807f4ee6d32a4cce9a4df36f0d455c64c861947 ]

The clock is in Hz while the value checked against is in kHz, so actual frequencies will never be able to be below to max value. Fix this by specifying the max-value in Hz too.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +4 -4
index 9873172e3fd33..30d03ff6c01f0 100644
@@ -1721,9 +1721,9 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id,
 		else
 			dclk_out_rate = v_pixclk >> 2;
 
-		dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000);
+		dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000000);
 		if (!dclk_rate) {
-			drm_err(vop2->drm, "DP dclk_out_rate out of range, dclk_out_rate: %ld KHZ\n",
+			drm_err(vop2->drm, "DP dclk_out_rate out of range, dclk_out_rate: %ld Hz\n",
 				dclk_out_rate);
 			return 0;
 		}
@@ -1738,9 +1738,9 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id,
 		 * dclk_rate = N * dclk_core_rate N = (1,2,4 ),
 		 * we get a little factor here
 		 */
-		dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000);
+		dclk_rate = rk3588_calc_dclk(dclk_out_rate, 600000000);
 		if (!dclk_rate) {
-			drm_err(vop2->drm, "MIPI dclk out of range, dclk_out_rate: %ld KHZ\n",
+			drm_err(vop2->drm, "MIPI dclk out of range, dclk_out_rate: %ld Hz\n",
 				dclk_out_rate);
 			return 0;
 		}
Signature · 1 line
2.39.5
author maintainer
#22 lore raw

PATCH 22/623 powerpc/pseries/iommu: IOMMU incorrectly marks MMIO range in DDW

In reply to Greg Kroah-Hartman

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

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

From: Gaurav Batra <[email protected]>

[ Upstream commit 8f70caad82e9c088ed93b4fea48d941ab6441886 ]

Power Hypervisor can possibily allocate MMIO window intersecting with Dynamic DMA Window (DDW) range, which is over 32-bit addressing.

These MMIO pages needs to be marked as reserved so that IOMMU doesn't map DMA buffers in this range.

The current code is not marking these pages correctly which is resulting in LPAR to OOPS while booting. The stack is at below

BUG: Unable to handle kernel data access on read at 0xc00800005cd40000
Faulting instruction address: 0xc00000000005cdac
Oops: Kernel access of bad area, sig: 11 [#1]
LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
Modules linked in: af_packet rfkill ibmveth(X) lpfc(+) nvmet_fc nvmet nvme_keyring crct10dif_vpmsum nvme_fc nvme_fabrics nvme_core be2net(+) nvme_auth rtc_generic nfsd auth_rpcgss nfs_acl lockd grace sunrpc fuse configfs ip_tables x_tables xfs libcrc32c dm_service_time ibmvfc(X) scsi_transport_fc vmx_crypto gf128mul crc32c_vpmsum dm_mirror dm_region_hash dm_log dm_multipath dm_mod sd_mod scsi_dh_emc scsi_dh_rdac scsi_dh_alua t10_pi crc64_rocksoft_generic crc64_rocksoft sg crc64 scsi_mod
Supported: Yes, External
CPU: 8 PID: 241 Comm: kworker/8:1 Kdump: loaded Not tainted 6.4.0-150600.23.14-default #1 SLE15-SP6 b44ee71c81261b9e4bab5e0cde1f2ed891d5359b
Hardware name: IBM,9080-M9S POWER9 (raw) 0x4e2103 0xf000005 of:IBM,FW950.B0 (VH950_149) hv:phyp pSeries
Workqueue: events work_for_cpu_fn
NIP:  c00000000005cdac LR: c00000000005e830 CTR: 0000000000000000
REGS: c00001400c9ff770 TRAP: 0300   Not tainted  (6.4.0-150600.23.14-default)
MSR:  800000000280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 24228448  XER: 00000001
CFAR: c00000000005cdd4 DAR: c00800005cd40000 DSISR: 40000000 IRQMASK: 0

GPR00: c00000000005e830 c00001400c9ffa10 c000000001987d00 c00001400c4fe800
GPR04: 0000080000000000 0000000000000001 0000000004000000 0000000000800000
GPR08: 0000000004000000 0000000000000001 c00800005cd40000 ffffffffffffffff
GPR12: 0000000084228882 c00000000a4c4f00 0000000000000010 0000080000000000
GPR16: c00001400c4fe800 0000000004000000 0800000000000000 c00000006088b800
GPR20: c00001401a7be980 c00001400eff3800 c000000002a2da68 000000000000002b
GPR24: c0000000026793a8 c000000002679368 000000000000002a c0000000026793c8
GPR28: 000008007effffff 0000080000000000 0000000000800000 c00001400c4fe800 NIP [c00000000005cdac] iommu_table_reserve_pages+0xac/0x100
LR [c00000000005e830] iommu_init_table+0x80/0x1e0

Call Trace:
[c00001400c9ffa10] [c00000000005e810] iommu_init_table+0x60/0x1e0 (unreliable)
[c00001400c9ffa90] [c00000000010356c] iommu_bypass_supported_pSeriesLP+0x9cc/0xe40
[c00001400c9ffc30] [c00000000005c300] dma_iommu_dma_supported+0xf0/0x230
[c00001400c9ffcb0] [c00000000024b0c4] dma_supported+0x44/0x90
[c00001400c9ffcd0] [c00000000024b14c] dma_set_mask+0x3c/0x80
[c00001400c9ffd00] [c0080000555b715c] be_probe+0xc4/0xb90 [be2net]
[c00001400c9ffdc0] [c000000000986f3c] local_pci_probe+0x6c/0x110
[c00001400c9ffe40] [c000000000188f28] work_for_cpu_fn+0x38/0x60
[c00001400c9ffe70] [c00000000018e454] process_one_work+0x314/0x620
[c00001400c9fff10] [c00000000018f280] worker_thread+0x2b0/0x620
[c00001400c9fff90] [c00000000019bb18] kthread+0x148/0x150
[c00001400c9fffe0] [c00000000000ded8] start_kernel_thread+0x14/0x18

There are 2 issues in the code

1. The index is "int" while the address is "unsigned long". This results in negative value when setting the bitmap.

2. The DMA offset is page shifted but the MMIO range is used as-is (64-bit address). MMIO address needs to be page shifted as well.

Fixes 3c33066a2190 ("powerpc/kernel/iommu: Add new iommu_table_in_use() helper")
---
 arch/powerpc/kernel/iommu.c            | 2 +-
 arch/powerpc/platforms/pseries/iommu.c | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)
arch/powerpc/kernel/iommu.c +1 -1
index 76381e14e800c..0ebae6e4c19dd 100644
@@ -687,7 +687,7 @@ void iommu_table_clear(struct iommu_table *tbl)
 void iommu_table_reserve_pages(struct iommu_table *tbl,
 		unsigned long res_start, unsigned long res_end)
 {
-	int i;
+	unsigned long i;
 
 	WARN_ON_ONCE(res_end < res_start);
 	/*
arch/powerpc/platforms/pseries/iommu.c +6 -3
index 534cd159e9ab4..29f1a0cc59cd5 100644
@@ -1650,7 +1650,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
 		iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn,
 					    dynamic_addr, dynamic_len, page_shift, NULL,
 					    &iommu_table_lpar_multi_ops);
-		iommu_init_table(newtbl, pci->phb->node, start, end);
+		iommu_init_table(newtbl, pci->phb->node,
+				 start >> page_shift, end >> page_shift);
 
 		pci->table_group->tables[default_win_removed ? 0 : 1] = newtbl;
 
@@ -2065,7 +2066,9 @@ static long spapr_tce_create_table(struct iommu_table_group *table_group, int nu
 							    offset, 1UL << window_shift,
 							    IOMMU_PAGE_SHIFT_4K, NULL,
 							    &iommu_table_lpar_multi_ops);
-				iommu_init_table(tbl, pci->phb->node, start, end);
+				iommu_init_table(tbl, pci->phb->node,
+						 start >> IOMMU_PAGE_SHIFT_4K,
+						 end >> IOMMU_PAGE_SHIFT_4K);
 
 				table_group->tables[0] = tbl;
 
@@ -2136,7 +2139,7 @@ static long spapr_tce_create_table(struct iommu_table_group *table_group, int nu
 	/* New table for using DDW instead of the default DMA window */
 	iommu_table_setparms_common(tbl, pci->phb->bus->number, create.liobn, win_addr,
 				    1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops);
-	iommu_init_table(tbl, pci->phb->node, start, end);
+	iommu_init_table(tbl, pci->phb->node, start >> page_shift, end >> page_shift);
 
 	pci->table_group->tables[num] = tbl;
 	set_iommu_table_base(&pdev->dev, tbl);
Signature · 1 line
2.39.5
author maintainer
#44 lore raw

PATCH 44/623 drm/msm/hdmi: simplify code in pll_get_integloop_gain

In reply to Greg Kroah-Hartman

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

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

From: Rex Nie <[email protected]>

[ Upstream commit c1beb6f75d5e60e4e57a837c665a52eb79eb19ba ]

In pll_get_integloop_gain(), digclk_divsel=1 or 2, base=63 or 196ULL, so the base may be 63, 126, 196, 392. The condition base <= 2046 always true.

Fixes caedbf17c48d ("drm/msm: add msm8998 hdmi phy/pll support")

Patchwork: https://patchwork.freedesktop.org/patch/624153/

---
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c +1 -1
index a719fd33d9d8d..33bb48ae58a2d 100644
@@ -137,7 +137,7 @@ static inline u32 pll_get_integloop_gain(u64 frac_start, u64 bclk, u32 ref_clk,
 
 	base <<= (digclk_divsel == 2 ? 1 : 0);
 
-	return (base <= 2046 ? base : 2046);
+	return base;
 }
 
 static inline u32 pll_get_pll_cmp(u64 fdata, unsigned long ref_clk)
Signature · 1 line
2.39.5
author maintainer
#45 lore raw

PATCH 45/623 drm/etnaviv: Fix page property being used for non writecombine buffers

In reply to Greg Kroah-Hartman

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

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

From: Sui Jingfeng <[email protected]>

[ Upstream commit 834f304192834d6f0941954f3277ae0ba11a9a86 ]

In the etnaviv_gem_vmap_impl() function, the driver vmap whatever buffers with write combine(WC) page property, this is incorrect. Cached buffers should be mapped with the cached page property and uncached buffers should be mapped with the uncached page property.

Fixes a0a5ab3e99b8 ("drm/etnaviv: call correct function when trying to vmap a DMABUF")
---
 drivers/gpu/drm/etnaviv/etnaviv_gem.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_gem.c +14 -2
index 16473c371444c..da30179de02b5 100644
@@ -342,6 +342,7 @@ void *etnaviv_gem_vmap(struct drm_gem_object *obj)
 static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)
 {
 	struct page **pages;
+	pgprot_t prot;
 
 	lockdep_assert_held(&obj->lock);
 
@@ -349,8 +350,19 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)
 	if (IS_ERR(pages))
 		return NULL;
 
-	return vmap(pages, obj->base.size >> PAGE_SHIFT,
-			VM_MAP, pgprot_writecombine(PAGE_KERNEL));
+	switch (obj->flags & ETNA_BO_CACHE_MASK) {
+	case ETNA_BO_CACHED:
+		prot = PAGE_KERNEL;
+		break;
+	case ETNA_BO_UNCACHED:
+		prot = pgprot_noncached(PAGE_KERNEL);
+		break;
+	case ETNA_BO_WC:
+	default:
+		prot = pgprot_writecombine(PAGE_KERNEL);
+	}
+
+	return vmap(pages, obj->base.size >> PAGE_SHIFT, VM_MAP, prot);
 }
 
 static inline enum dma_data_direction etnaviv_op_to_dma_dir(u32 op)
Signature · 1 line
2.39.5
author maintainer
#46 lore raw

PATCH 46/623 drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()

In reply to Greg Kroah-Hartman

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

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

From: Christophe JAILLET <[email protected]>

[ Upstream commit a3300782d5375e280ba7040f323d01960bfe3396 ]

In case of error after a amdgpu_gfx_rlc_enter_safe_mode() call, it is not balanced by a corresponding amdgpu_gfx_rlc_exit_safe_mode() call.

Add the missing call.

Fixes 9b7b8154cdb8 ("drm/amd/powerplay: added didt support for vega10")
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_powertune.c +3 -2
index 3007b054c873c..776d58ea63ae9 100644
@@ -1120,13 +1120,14 @@ static int vega10_enable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)
 	result = vega10_program_didt_config_registers(hwmgr, SEEDCForceStallPatternConfig_Vega10, VEGA10_CONFIGREG_DIDT);
 	result |= vega10_program_didt_config_registers(hwmgr, SEEDCCtrlForceStallConfig_Vega10, VEGA10_CONFIGREG_DIDT);
 	if (0 != result)
-		return result;
+		goto exit_safe_mode;
 
 	vega10_didt_set_mask(hwmgr, false);
 
+exit_safe_mode:
 	amdgpu_gfx_rlc_exit_safe_mode(adev, 0);
 
-	return 0;
+	return result;
 }
 
 static int vega10_disable_se_edc_force_stall_config(struct pp_hwmgr *hwmgr)
Signature · 1 line
2.39.5
author maintainer
#47 lore raw

PATCH 47/623 drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table

In reply to Greg Kroah-Hartman

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

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

From: Ivan Stepchenko <[email protected]>

[ Upstream commit 357445e28ff004d7f10967aa93ddb4bffa5c3688 ]

The function atomctrl_get_smc_sclk_range_table() does not check the return value of smu_atom_get_data_table(). If smu_atom_get_data_table() fails to retrieve SMU_Info table, it returns NULL which is later dereferenced.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

In practice this should never happen as this code only gets called on polaris chips and the vbios data table will always be present on those chips.

Fixes a23eefa2f461 ("drm/amd/powerplay: enable dpm for baffin.")
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +2 -0
index fe24219c3bf48..4bd92fd782be6 100644
@@ -992,6 +992,8 @@ int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctr
 			GetIndexIntoMasterTable(DATA, SMU_Info),
 			&size, &frev, &crev);
 
+	if (!psmu_info)
+		return -EINVAL;
 
 	for (i = 0; i < psmu_info->ucSclkEntryNum; i++) {
 		table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;
Signature · 1 line
2.39.5
author maintainer
#48 lore raw

PATCH 48/623 drm/rockchip: vop2: Fix cluster windows alpha ctrl regsiters offset

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit 17b4b10a0df1a1421d5fbdc03bad0bd3799bc966 ]

The phy_id of cluster windws are not increase one for each window.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +17 -1
index 30d03ff6c01f0..594923303a850 100644
@@ -2159,7 +2159,6 @@ static int vop2_find_start_mixer_id_for_vp(struct vop2 *vop2, u8 port_id)
 
 static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_win)
 {
-	u32 offset = (main_win->data->phys_id * 0x10);
 	struct vop2_alpha_config alpha_config;
 	struct vop2_alpha alpha;
 	struct drm_plane_state *bottom_win_pstate;
@@ -2167,6 +2166,7 @@ static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_wi
 	u16 src_glb_alpha_val, dst_glb_alpha_val;
 	bool premulti_en = false;
 	bool swap = false;
+	u32 offset = 0;
 
 	/* At one win mode, win0 is dst/bottom win, and win1 is a all zero src/top win */
 	bottom_win_pstate = main_win->base.state;
@@ -2185,6 +2185,22 @@ static void vop2_setup_cluster_alpha(struct vop2 *vop2, struct vop2_win *main_wi
 	vop2_parse_alpha(&alpha_config, &alpha);
 
 	alpha.src_color_ctrl.bits.src_dst_swap = swap;
+
+	switch (main_win->data->phys_id) {
+	case ROCKCHIP_VOP2_CLUSTER0:
+		offset = 0x0;
+		break;
+	case ROCKCHIP_VOP2_CLUSTER1:
+		offset = 0x10;
+		break;
+	case ROCKCHIP_VOP2_CLUSTER2:
+		offset = 0x20;
+		break;
+	case ROCKCHIP_VOP2_CLUSTER3:
+		offset = 0x30;
+		break;
+	}
+
 	vop2_writel(vop2, RK3568_CLUSTER0_MIX_SRC_COLOR_CTRL + offset,
 		    alpha.src_color_ctrl.val);
 	vop2_writel(vop2, RK3568_CLUSTER0_MIX_DST_COLOR_CTRL + offset,
Signature · 1 line
2.39.5
author maintainer
#49 lore raw

PATCH 49/623 drm/rockchip: vop2: Fix the mixer alpha setup for layer 0

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit 6b4dfdcde3573a12b72d2869dabd4ca37ad7e9c7 ]

The alpha setup should start from the second layer, the current calculation starts incorrectly from the first layer, a negative offset will be obtained in the following formula:

offset = (mixer_id + zpos - 1) * 0x10

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +6 -0
index 594923303a850..630a204440ba8 100644
@@ -2248,6 +2248,12 @@ static void vop2_setup_alpha(struct vop2_video_port *vp)
 		struct vop2_win *win = to_vop2_win(plane);
 		int zpos = plane->state->normalized_zpos;
 
+		/*
+		 * Need to configure alpha from second layer.
+		 */
+		if (zpos == 0)
+			continue;
+
 		if (plane->state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI)
 			premulti_en = 1;
 		else
Signature · 1 line
2.39.5
author maintainer
#50 lore raw

PATCH 50/623 drm/panthor: Preserve the result returned by panthor_fw_resume()

In reply to Greg Kroah-Hartman

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

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

From: Boris Brezillon <[email protected]>

[ Upstream commit 4bd56ca8226dda6115bca385b166ef87e867d807 ]

WARN() will return true if the condition is true, false otherwise. If we store the return of drm_WARN_ON() in ret, we lose the actual error code.

v3:
- Add R-b
v2:
- Add R-b

---
 drivers/gpu/drm/panthor/panthor_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panthor/panthor_device.c +2 -2
index 6fbff516c1c1f..01dff89bed4e1 100644
@@ -445,8 +445,8 @@ int panthor_device_resume(struct device *dev)
 	    drm_dev_enter(&ptdev->base, &cookie)) {
 		panthor_gpu_resume(ptdev);
 		panthor_mmu_resume(ptdev);
-		ret = drm_WARN_ON(&ptdev->base, panthor_fw_resume(ptdev));
-		if (!ret) {
+		ret = panthor_fw_resume(ptdev);
+		if (!drm_WARN_ON(&ptdev->base, ret)) {
 			panthor_sched_resume(ptdev);
 		} else {
 			panthor_mmu_suspend(ptdev);
Signature · 1 line
2.39.5
author maintainer
#51 lore raw

PATCH 51/623 drm/msm/dp: do not touch the MMSS_DP_INTF_CONFIG for tpg

In reply to Greg Kroah-Hartman

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

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

From: Abhinav Kumar <[email protected]>

[ Upstream commit 9ffbf5ef0e8d6e1b76440a6d77311d0c5d6e3979 ]

MMSS_DP_INTF_CONFIG has already been setup by the main datapath for DP to account for widebus to be used/unused etc.

In current implementation, TPG only switches the DP controller to use the main datapath stream OR use the test pattern but expects the rest of the controller to be already setup.

Keeping the same behavior intact, drop the clearing of MMSS_DP_INTF_CONFIG from the msm_dp_catalog_panel_tpg_enable() API.

Fixes 757a2f36ab09 ("drm/msm/dp: enable widebus feature for display port")

Patchwork: https://patchwork.freedesktop.org/patch/626888/

---
 drivers/gpu/drm/msm/dp/dp_catalog.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_catalog.c +0 -1
index b4c8856fb25d0..2a755a06ac490 100644
@@ -1036,7 +1036,6 @@ void msm_dp_catalog_panel_tpg_enable(struct msm_dp_catalog *msm_dp_catalog,
 	display_hctl = (hsync_end_x << 16) | hsync_start_x;
 
 
-	msm_dp_write_p0(catalog, MMSS_DP_INTF_CONFIG, 0x0);
 	msm_dp_write_p0(catalog, MMSS_DP_INTF_HSYNC_CTL, hsync_ctl);
 	msm_dp_write_p0(catalog, MMSS_DP_INTF_VSYNC_PERIOD_F0, vsync_period *
 			hsync_period);
Signature · 1 line
2.39.5
author maintainer
#52 lore raw

PATCH 52/623 drm/msm/dp: dont call dp_catalog_ctrl_mainlink_ctrl in dp_ctrl_configure_source_params()

In reply to Greg Kroah-Hartman

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

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

From: Abhinav Kumar <[email protected]>

[ Upstream commit 50e608d166ba68faacf81a5ce17c09b0c697eefd ]

Once the link has already been setup there is no need to call dp_catalog_ctrl_mainlink_ctrl() as this does a reset on the mainlink thereby tearing down the link briefly.

Fixes c943b4948b58 ("drm/msm/dp: add displayPort driver support")

Patchwork: https://patchwork.freedesktop.org/patch/627479/

---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_ctrl.c +0 -1
index bc2ca8133b790..a8069f7c4773f 100644
@@ -178,7 +178,6 @@ static void msm_dp_ctrl_configure_source_params(struct msm_dp_ctrl_private *ctrl
 	u32 cc, tb;
 
 	msm_dp_catalog_ctrl_lane_mapping(ctrl->catalog);
-	msm_dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, true);
 	msm_dp_catalog_setup_peripheral_flush(ctrl->catalog);
 
 	msm_dp_ctrl_config_ctrl(ctrl);
Signature · 1 line
2.39.5
author maintainer
#53 lore raw

PATCH 53/623 drm/msm/dp: disable the opp table request even for dp_ctrl_off_link()

In reply to Greg Kroah-Hartman

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

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

From: Abhinav Kumar <[email protected]>

[ Upstream commit a3dd01375a6a21ed3e5dbc58f7004d48561f0977 ]

dp_ctrl_off_link() was created to handle a case where we received a cable connect and then get a cable disconnect without the corresponding dp_display_enable(). For such cases the pixel clock will be off but the link clock will still be on. dp_ctrl_off_link() handles this case by turning off the link clock only.

However, the vote removal to the opp table for this case was missed. Remove the opp table vote in dp_ctrl_off_link().

Fixes 375a126090b9 ("drm/msm/dp: tear down main link at unplug handle immediately")

Patchwork: https://patchwork.freedesktop.org/patch/627487/

---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/dp/dp_ctrl.c +1 -0
index a8069f7c4773f..9c463ae2f8fae 100644
@@ -2070,6 +2070,7 @@ void msm_dp_ctrl_off_link(struct msm_dp_ctrl *msm_dp_ctrl)
 
 	msm_dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, false);
 
+	dev_pm_opp_set_rate(ctrl->dev, 0);
 	msm_dp_ctrl_link_clk_disable(&ctrl->msm_dp_ctrl);
 
 	DRM_DEBUG_DP("Before, phy=%p init_count=%d power_on=%d\n",
Signature · 1 line
2.39.5
author maintainer
#41 lore raw

PATCH 41/623 drm/msm/dp: set safe_to_exit_level before printing it

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 7dee35d79bb046bfd425aa9e58a82414f67c1cec ]

Rather than printing random garbage from stack and pretending that it is the default safe_to_exit_level, set the variable beforehand.

Fixes d13e36d7d222 ("drm/msm/dp: add audio support for Display Port on MSM")

Patchwork: https://patchwork.freedesktop.org/patch/626804/

---
 drivers/gpu/drm/msm/dp/dp_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_audio.c +1 -1
index 74e01a5dd4195..5cbb11986460d 100644
@@ -329,10 +329,10 @@ static void msm_dp_audio_safe_to_exit_level(struct msm_dp_audio_private *audio)
 		safe_to_exit_level = 5;
 		break;
 	default:
+		safe_to_exit_level = 14;
 		drm_dbg_dp(audio->drm_dev,
 				"setting the default safe_to_exit_level = %u\n",
 				safe_to_exit_level);
-		safe_to_exit_level = 14;
 		break;
 	}
 
Signature · 1 line
2.39.5
author maintainer
#54 lore raw

PATCH 54/623 drm/msm/dpu: check dpu_plane_atomic_print_state() for valid sspp

In reply to Greg Kroah-Hartman

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

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

From: Abhinav Kumar <[email protected]>

[ Upstream commit 789384eb1437aed94155dc0eac8a8a6ba1baf578 ]

Similar to the r_pipe sspp protect, add a check to protect the pipe state prints to avoid NULL ptr dereference for cases when the state is dumped without a corresponding atomic_check() where the pipe->sspp is assigned.

Fixes 31f7148fd370 ("drm/msm/dpu: move pstate->pipe initialization to dpu_plane_atomic_check")

Patchwork: https://patchwork.freedesktop.org/patch/628404/

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +9 -6
index 3ffac24333a2a..703e58901d53f 100644
@@ -1335,12 +1335,15 @@ static void dpu_plane_atomic_print_state(struct drm_printer *p,
 
 	drm_printf(p, "\tstage=%d\n", pstate->stage);
 
-	drm_printf(p, "\tsspp[0]=%s\n", pipe->sspp->cap->name);
-	drm_printf(p, "\tmultirect_mode[0]=%s\n", dpu_get_multirect_mode(pipe->multirect_mode));
-	drm_printf(p, "\tmultirect_index[0]=%s\n",
-		   dpu_get_multirect_index(pipe->multirect_index));
-	drm_printf(p, "\tsrc[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->src_rect));
-	drm_printf(p, "\tdst[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->dst_rect));
+	if (pipe->sspp) {
+		drm_printf(p, "\tsspp[0]=%s\n", pipe->sspp->cap->name);
+		drm_printf(p, "\tmultirect_mode[0]=%s\n",
+			   dpu_get_multirect_mode(pipe->multirect_mode));
+		drm_printf(p, "\tmultirect_index[0]=%s\n",
+			   dpu_get_multirect_index(pipe->multirect_index));
+		drm_printf(p, "\tsrc[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->src_rect));
+		drm_printf(p, "\tdst[0]=" DRM_RECT_FMT "\n", DRM_RECT_ARG(&pipe_cfg->dst_rect));
+	}
 
 	if (r_pipe->sspp) {
 		drm_printf(p, "\tsspp[1]=%s\n", r_pipe->sspp->cap->name);
Signature · 1 line
2.39.5
author maintainer
#55 lore raw

PATCH 55/623 drm/rockchip: vop2: Fix the windows switch between different layers

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit 0ca953ac226eaffbe1a795f5e517095a8d494921 ]

Every layer of vop2 should bind a window, and we also need to make sure that this window is not used by other layer.

0x5 is a reserved layer sel value on rk3568, but it will select Cluster3 on rk3588, configure unused layers to 0x5 will lead alpha blending error on rk3588.

When we bind a window from layerM to layerN, we move the old window on layerN to layerM.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 47 ++++++++++++++------
 1 file changed, 34 insertions(+), 13 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +34 -13
index 630a204440ba8..60b498ffd41aa 100644
@@ -2330,7 +2330,10 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)
 	struct drm_plane *plane;
 	u32 layer_sel = 0;
 	u32 port_sel;
-	unsigned int nlayer, ofs;
+	u8 layer_id;
+	u8 old_layer_id;
+	u8 layer_sel_id;
+	unsigned int ofs;
 	u32 ovl_ctrl;
 	int i;
 	struct vop2_video_port *vp0 = &vop2->vps[0];
@@ -2374,9 +2377,30 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)
 	for (i = 0; i < vp->id; i++)
 		ofs += vop2->vps[i].nlayers;
 
-	nlayer = 0;
 	drm_atomic_crtc_for_each_plane(plane, &vp->crtc) {
 		struct vop2_win *win = to_vop2_win(plane);
+		struct vop2_win *old_win;
+
+		layer_id = (u8)(plane->state->normalized_zpos + ofs);
+
+		/*
+		 * Find the layer this win bind in old state.
+		 */
+		for (old_layer_id = 0; old_layer_id < vop2->data->win_size; old_layer_id++) {
+			layer_sel_id = (layer_sel >> (4 * old_layer_id)) & 0xf;
+			if (layer_sel_id == win->data->layer_sel_id)
+				break;
+		}
+
+		/*
+		 * Find the win bind to this layer in old state
+		 */
+		for (i = 0; i < vop2->data->win_size; i++) {
+			old_win = &vop2->win[i];
+			layer_sel_id = (layer_sel >> (4 * layer_id)) & 0xf;
+			if (layer_sel_id == old_win->data->layer_sel_id)
+				break;
+		}
 
 		switch (win->data->phys_id) {
 		case ROCKCHIP_VOP2_CLUSTER0:
@@ -2421,17 +2445,14 @@ static void vop2_setup_layer_mixer(struct vop2_video_port *vp)
 			break;
 		}
 
-		layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(plane->state->normalized_zpos + ofs,
-							  0x7);
-		layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(plane->state->normalized_zpos + ofs,
-							 win->data->layer_sel_id);
-		nlayer++;
-	}
-
-	/* configure unused layers to 0x5 (reserved) */
-	for (; nlayer < vp->nlayers; nlayer++) {
-		layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(nlayer + ofs, 0x7);
-		layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(nlayer + ofs, 5);
+		layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(layer_id, 0x7);
+		layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(layer_id, win->data->layer_sel_id);
+		/*
+		 * When we bind a window from layerM to layerN, we also need to move the old
+		 * window on layerN to layerM to avoid one window selected by two or more layers.
+		 */
+		layer_sel &= ~RK3568_OVL_LAYER_SEL__LAYER(old_layer_id, 0x7);
+		layer_sel |= RK3568_OVL_LAYER_SEL__LAYER(old_layer_id, old_win->data->layer_sel_id);
 	}
 
 	vop2_writel(vop2, RK3568_OVL_LAYER_SEL, layer_sel);
Signature · 1 line
2.39.5
author maintainer
#56 lore raw

PATCH 56/623 printk: Defer legacy printing when holding printk_cpu_sync

In reply to Greg Kroah-Hartman

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

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

From: John Ogness <[email protected]>

[ Upstream commit 0161e2d6950fe66cf6ac1c10d945bae971f33667 ]

The documentation of printk_cpu_sync_get() clearly states that the owner must never perform any activities where it waits for a CPU. For legacy printing there can be spinning on the console_lock and on the port lock. Therefore legacy printing must be deferred when holding the printk_cpu_sync.

Note that in the case of emergency states, atomic consoles are not prevented from printing when printk is deferred. This is appropriate because they do not spin-wait indefinitely for other CPUs.

---
 kernel/printk/internal.h    | 6 ++++++
 kernel/printk/printk.c      | 5 +++++
 kernel/printk/printk_safe.c | 7 ++++++-
 3 files changed, 17 insertions(+), 1 deletion(-)
kernel/printk/internal.h +6 -0
index c6bb47666aef6..a91bdf8029671 100644
@@ -338,3 +338,9 @@ bool printk_get_next_message(struct printk_message *pmsg, u64 seq,
 void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped);
 void console_prepend_replay(struct printk_message *pmsg);
 #endif
+
+#ifdef CONFIG_SMP
+bool is_printk_cpu_sync_owner(void);
+#else
+static inline bool is_printk_cpu_sync_owner(void) { return false; }
+#endif
kernel/printk/printk.c +5 -0
index 80910bc3470c2..f446a06b4da8c 100644
@@ -4922,6 +4922,11 @@ void console_try_replay_all(void)
 static atomic_t printk_cpu_sync_owner = ATOMIC_INIT(-1);
 static atomic_t printk_cpu_sync_nested = ATOMIC_INIT(0);
 
+bool is_printk_cpu_sync_owner(void)
+{
+	return (atomic_read(&printk_cpu_sync_owner) == raw_smp_processor_id());
+}
+
 /**
  * __printk_cpu_sync_wait() - Busy wait until the printk cpu-reentrant
  *                            spinning lock is not owned by any CPU.
kernel/printk/printk_safe.c +6 -1
index 6f94418d53ffb..6bc40ac8847b5 100644
@@ -61,10 +61,15 @@ bool is_printk_legacy_deferred(void)
 	/*
 	 * The per-CPU variable @printk_context can be read safely in any
 	 * context. CPU migration is always disabled when set.
+	 *
+	 * A context holding the printk_cpu_sync must not spin waiting for
+	 * another CPU. For legacy printing, it could be the console_lock
+	 * or the port lock.
 	 */
 	return (force_legacy_kthread() ||
 		this_cpu_read(printk_context) ||
-		in_nmi());
+		in_nmi() ||
+		is_printk_cpu_sync_owner());
 }
 
 asmlinkage int vprintk(const char *fmt, va_list args)
Signature · 1 line
2.39.5
author maintainer
#57 lore raw

PATCH 57/623 drm/connector: Allow clearing HDMI infoframes

In reply to Greg Kroah-Hartman

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

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

From: Derek Foreman <[email protected]>

[ Upstream commit d34357743b360c99903b5a59daab08f55b2f41a1 ]

Our infoframe setting code currently lacks the ability to clear infoframes. For some of the infoframes, we only need to replace them, so if an error occurred when generating a new infoframe we would leave a stale frame instead of clearing the frame.

However, the Dynamic Range and Mastering (DRM) infoframe should only be present when displaying HDR content (ie: the HDR_OUTPUT_METADATA blob is set). If we can't clear infoframes, the stale DRM infoframe will remain and we can never set the display back to SDR mode.

With this change, we clear infoframes when they can not, or should not, be generated. This fixes switching to an SDR mode from an HDR one.

---
 drivers/gpu/drm/display/drm_hdmi_state_helper.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/display/drm_hdmi_state_helper.c +8 -0
index feb7a3a759811..936a8f95d80f7 100644
@@ -347,6 +347,8 @@ static int hdmi_generate_avi_infoframe(const struct drm_connector *connector,
 		is_limited_range ? HDMI_QUANTIZATION_RANGE_LIMITED : HDMI_QUANTIZATION_RANGE_FULL;
 	int ret;
 
+	infoframe->set = false;
+
 	ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector, mode);
 	if (ret)
 		return ret;
@@ -376,6 +378,8 @@ static int hdmi_generate_spd_infoframe(const struct drm_connector *connector,
 		&infoframe->data.spd;
 	int ret;
 
+	infoframe->set = false;
+
 	ret = hdmi_spd_infoframe_init(frame,
 				      connector->hdmi.vendor,
 				      connector->hdmi.product);
@@ -398,6 +402,8 @@ static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector,
 		&infoframe->data.drm;
 	int ret;
 
+	infoframe->set = false;
+
 	if (connector->max_bpc < 10)
 		return 0;
 
@@ -425,6 +431,8 @@ static int hdmi_generate_hdmi_vendor_infoframe(const struct drm_connector *conne
 		&infoframe->data.vendor.hdmi;
 	int ret;
 
+	infoframe->set = false;
+
 	if (!info->has_hdmi_infoframe)
 		return 0;
 
Signature · 1 line
2.39.5
author maintainer
#58 lore raw

PATCH 58/623 drm/rockchip: vop2: Set AXI id for rk3588

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit 7b256880fdb2d7f23393b87bb557090f049e686a ]

There are two AXI bus in vop2, windows attached on the same bus must have a unique channel YUV and RGB channel ID.

The default IDs will conflict with each other on the rk3588, so they need to be reassigned.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 14 +++++++++++
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.h |  9 +++++++
 drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 26 +++++++++++++++++++-
 3 files changed, 48 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +14 -0
index 60b498ffd41aa..cd3fb906d0089 100644
@@ -1320,6 +1320,12 @@ static void vop2_plane_atomic_update(struct drm_plane *plane,
 		&fb->format->format,
 		afbc_en ? "AFBC" : "", &yrgb_mst);
 
+	if (vop2->data->soc_id > 3568) {
+		vop2_win_write(win, VOP2_WIN_AXI_BUS_ID, win->data->axi_bus_id);
+		vop2_win_write(win, VOP2_WIN_AXI_YRGB_R_ID, win->data->axi_yrgb_r_id);
+		vop2_win_write(win, VOP2_WIN_AXI_UV_R_ID, win->data->axi_uv_r_id);
+	}
+
 	if (vop2_cluster_window(win))
 		vop2_win_write(win, VOP2_WIN_AFBC_HALF_BLOCK_EN, half_block_en);
 
@@ -2908,6 +2914,10 @@ static struct reg_field vop2_cluster_regs[VOP2_WIN_MAX_REG] = {
 	[VOP2_WIN_Y2R_EN] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL0, 8, 8),
 	[VOP2_WIN_R2Y_EN] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL0, 9, 9),
 	[VOP2_WIN_CSC_MODE] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL0, 10, 11),
+	[VOP2_WIN_AXI_YRGB_R_ID] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL2, 0, 3),
+	[VOP2_WIN_AXI_UV_R_ID] = REG_FIELD(RK3568_CLUSTER_WIN_CTRL2, 5, 8),
+	/* RK3588 only, reserved bit on rk3568*/
+	[VOP2_WIN_AXI_BUS_ID] = REG_FIELD(RK3568_CLUSTER_CTRL, 13, 13),
 
 	/* Scale */
 	[VOP2_WIN_SCALE_YRGB_X] = REG_FIELD(RK3568_CLUSTER_WIN_SCL_FACTOR_YRGB, 0, 15),
@@ -3000,6 +3010,10 @@ static struct reg_field vop2_esmart_regs[VOP2_WIN_MAX_REG] = {
 	[VOP2_WIN_YMIRROR] = REG_FIELD(RK3568_SMART_CTRL1, 31, 31),
 	[VOP2_WIN_COLOR_KEY] = REG_FIELD(RK3568_SMART_COLOR_KEY_CTRL, 0, 29),
 	[VOP2_WIN_COLOR_KEY_EN] = REG_FIELD(RK3568_SMART_COLOR_KEY_CTRL, 31, 31),
+	[VOP2_WIN_AXI_YRGB_R_ID] = REG_FIELD(RK3568_SMART_CTRL1, 4, 8),
+	[VOP2_WIN_AXI_UV_R_ID] = REG_FIELD(RK3568_SMART_CTRL1, 12, 16),
+	/* RK3588 only, reserved register on rk3568 */
+	[VOP2_WIN_AXI_BUS_ID] = REG_FIELD(RK3588_SMART_AXI_CTRL, 1, 1),
 
 	/* Scale */
 	[VOP2_WIN_SCALE_YRGB_X] = REG_FIELD(RK3568_SMART_REGION0_SCL_FACTOR_YRGB, 0, 15),
drivers/gpu/drm/rockchip/rockchip_drm_vop2.h +9 -0
index 615a16196aff6..1c4204324f9f5 100644
@@ -78,6 +78,9 @@ enum vop2_win_regs {
 	VOP2_WIN_COLOR_KEY,
 	VOP2_WIN_COLOR_KEY_EN,
 	VOP2_WIN_DITHER_UP,
+	VOP2_WIN_AXI_BUS_ID,
+	VOP2_WIN_AXI_YRGB_R_ID,
+	VOP2_WIN_AXI_UV_R_ID,
 
 	/* scale regs */
 	VOP2_WIN_SCALE_YRGB_X,
@@ -140,6 +143,10 @@ struct vop2_win_data {
 	unsigned int layer_sel_id;
 	uint64_t feature;
 
+	uint8_t axi_bus_id;
+	uint8_t axi_yrgb_r_id;
+	uint8_t axi_uv_r_id;
+
 	unsigned int max_upscale_factor;
 	unsigned int max_downscale_factor;
 	const u8 dly[VOP2_DLY_MODE_MAX];
@@ -308,6 +315,7 @@ enum dst_factor_mode {
 
 #define RK3568_CLUSTER_WIN_CTRL0		0x00
 #define RK3568_CLUSTER_WIN_CTRL1		0x04
+#define RK3568_CLUSTER_WIN_CTRL2		0x08
 #define RK3568_CLUSTER_WIN_YRGB_MST		0x10
 #define RK3568_CLUSTER_WIN_CBR_MST		0x14
 #define RK3568_CLUSTER_WIN_VIR			0x18
@@ -330,6 +338,7 @@ enum dst_factor_mode {
 /* (E)smart register definition, offset relative to window base */
 #define RK3568_SMART_CTRL0			0x00
 #define RK3568_SMART_CTRL1			0x04
+#define RK3588_SMART_AXI_CTRL			0x08
 #define RK3568_SMART_REGION0_CTRL		0x10
 #define RK3568_SMART_REGION0_YRGB_MST		0x14
 #define RK3568_SMART_REGION0_CBR_MST		0x18
drivers/gpu/drm/rockchip/rockchip_vop2_reg.c +25 -1
index f9d87a0abc8b0..6a6c15f2c9cc7 100644
@@ -313,7 +313,7 @@ static const struct vop2_video_port_data rk3588_vop_video_ports[] = {
  * AXI1 is a read only bus.
  *
  * Every window on a AXI bus must assigned two unique
- * read id(yrgb_id/uv_id, valid id are 0x1~0xe).
+ * read id(yrgb_r_id/uv_r_id, valid id are 0x1~0xe).
  *
  * AXI0:
  * Cluster0/1, Esmart0/1, WriteBack
@@ -333,6 +333,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.layer_sel_id = 0,
 		.supported_rotations = DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270 |
 				       DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
+		.axi_bus_id = 0,
+		.axi_yrgb_r_id = 2,
+		.axi_uv_r_id = 3,
 		.max_upscale_factor = 4,
 		.max_downscale_factor = 4,
 		.dly = { 4, 26, 29 },
@@ -349,6 +352,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.supported_rotations = DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270 |
 				       DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_PRIMARY,
+		.axi_bus_id = 0,
+		.axi_yrgb_r_id = 6,
+		.axi_uv_r_id = 7,
 		.max_upscale_factor = 4,
 		.max_downscale_factor = 4,
 		.dly = { 4, 26, 29 },
@@ -364,6 +370,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.supported_rotations = DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270 |
 				       DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_PRIMARY,
+		.axi_bus_id = 1,
+		.axi_yrgb_r_id = 2,
+		.axi_uv_r_id = 3,
 		.max_upscale_factor = 4,
 		.max_downscale_factor = 4,
 		.dly = { 4, 26, 29 },
@@ -379,6 +388,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.supported_rotations = DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270 |
 				       DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_PRIMARY,
+		.axi_bus_id = 1,
+		.axi_yrgb_r_id = 6,
+		.axi_uv_r_id = 7,
 		.max_upscale_factor = 4,
 		.max_downscale_factor = 4,
 		.dly = { 4, 26, 29 },
@@ -393,6 +405,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.layer_sel_id = 2,
 		.supported_rotations = DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_OVERLAY,
+		.axi_bus_id = 0,
+		.axi_yrgb_r_id = 0x0a,
+		.axi_uv_r_id = 0x0b,
 		.max_upscale_factor = 8,
 		.max_downscale_factor = 8,
 		.dly = { 23, 45, 48 },
@@ -406,6 +421,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.layer_sel_id = 3,
 		.supported_rotations = DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_OVERLAY,
+		.axi_bus_id = 0,
+		.axi_yrgb_r_id = 0x0c,
+		.axi_uv_r_id = 0x01,
 		.max_upscale_factor = 8,
 		.max_downscale_factor = 8,
 		.dly = { 23, 45, 48 },
@@ -419,6 +437,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.layer_sel_id = 6,
 		.supported_rotations = DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_OVERLAY,
+		.axi_bus_id = 1,
+		.axi_yrgb_r_id = 0x0a,
+		.axi_uv_r_id = 0x0b,
 		.max_upscale_factor = 8,
 		.max_downscale_factor = 8,
 		.dly = { 23, 45, 48 },
@@ -432,6 +453,9 @@ static const struct vop2_win_data rk3588_vop_win_data[] = {
 		.layer_sel_id = 7,
 		.supported_rotations = DRM_MODE_REFLECT_Y,
 		.type = DRM_PLANE_TYPE_OVERLAY,
+		.axi_bus_id = 1,
+		.axi_yrgb_r_id = 0x0c,
+		.axi_uv_r_id = 0x0d,
 		.max_upscale_factor = 8,
 		.max_downscale_factor = 8,
 		.dly = { 23, 45, 48 },
Signature · 1 line
2.39.5
author maintainer
#59 lore raw

PATCH 59/623 drm/rockchip: vop2: Setup delay cycle for Esmart2/3

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit c766998ba6df126ab6934d32ff2ff080316ec630 ]

Each layer needs to set the correct delay cycle to display properly without unexpected offset on screen.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +2 -0
index cd3fb906d0089..68b5c438cdaba 100644
@@ -2493,9 +2493,11 @@ static void vop2_setup_dly_for_windows(struct vop2 *vop2)
 			sdly |= FIELD_PREP(RK3568_SMART_DLY_NUM__ESMART1, dly);
 			break;
 		case ROCKCHIP_VOP2_SMART0:
+		case ROCKCHIP_VOP2_ESMART2:
 			sdly |= FIELD_PREP(RK3568_SMART_DLY_NUM__SMART0, dly);
 			break;
 		case ROCKCHIP_VOP2_SMART1:
+		case ROCKCHIP_VOP2_ESMART3:
 			sdly |= FIELD_PREP(RK3568_SMART_DLY_NUM__SMART1, dly);
 			break;
 		}
Signature · 1 line
2.39.5
author maintainer
#42 lore raw

PATCH 42/623 drm/msm/dp: fix msm_dp_utils_pack_sdp_header interface

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit b047cbe5e54b632042941b90b808223e63742690 ]

The msm_dp_utils_pack_sdp_header() accepts an unlimited-size u32 pointer for the header output, while it expects a two-element array. It performs a sizeof check which is always true on 64-bit platforms (since sizeof(u32*) is 8) and is always false on 32-bit platforms. It returns an error code which nobody actually checks.

Fix the function interface to accept u32[2] and return void, skipping all the checks.

Fixes 55fb8ffc1802 ("drm/msm/dp: add VSC SDP support for YUV420 over DP")

Patchwork: https://patchwork.freedesktop.org/patch/626806/

---
 drivers/gpu/drm/msm/dp/dp_utils.c | 10 +---------
 drivers/gpu/drm/msm/dp/dp_utils.h |  2 +-
 2 files changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/msm/dp/dp_utils.c +1 -9
index 2a40f07fe2d5e..4a5ebb0c33b85 100644
@@ -74,14 +74,8 @@ u8 msm_dp_utils_calculate_parity(u32 data)
 	return parity_byte;
 }
 
-ssize_t msm_dp_utils_pack_sdp_header(struct dp_sdp_header *sdp_header, u32 *header_buff)
+void msm_dp_utils_pack_sdp_header(struct dp_sdp_header *sdp_header, u32 header_buff[2])
 {
-	size_t length;
-
-	length = sizeof(header_buff);
-	if (length < DP_SDP_HEADER_SIZE)
-		return -ENOSPC;
-
 	header_buff[0] = FIELD_PREP(HEADER_0_MASK, sdp_header->HB0) |
 		FIELD_PREP(PARITY_0_MASK, msm_dp_utils_calculate_parity(sdp_header->HB0)) |
 		FIELD_PREP(HEADER_1_MASK, sdp_header->HB1) |
@@ -91,6 +85,4 @@ ssize_t msm_dp_utils_pack_sdp_header(struct dp_sdp_header *sdp_header, u32 *head
 		FIELD_PREP(PARITY_2_MASK, msm_dp_utils_calculate_parity(sdp_header->HB2)) |
 		FIELD_PREP(HEADER_3_MASK, sdp_header->HB3) |
 		FIELD_PREP(PARITY_3_MASK, msm_dp_utils_calculate_parity(sdp_header->HB3));
-
-	return length;
 }
drivers/gpu/drm/msm/dp/dp_utils.h +1 -1
index 88d53157f5b59..2e4f98a863c4c 100644
@@ -31,6 +31,6 @@
 u8 msm_dp_utils_get_g0_value(u8 data);
 u8 msm_dp_utils_get_g1_value(u8 data);
 u8 msm_dp_utils_calculate_parity(u32 data);
-ssize_t msm_dp_utils_pack_sdp_header(struct dp_sdp_header *sdp_header, u32 *header_buff);
+void msm_dp_utils_pack_sdp_header(struct dp_sdp_header *sdp_header, u32 header_buff[2]);
 
 #endif /* _DP_UTILS_H_ */
Signature · 1 line
2.39.5
author maintainer
#60 lore raw

PATCH 60/623 drm/rockchip: vop2: Check linear format for Cluster windows on rk3566/8

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit df063c0b8ffbdca486ab2f802e716973985d8f86 ]

The Cluster windows on rk3566/8 only support afbc mode.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +10 -0
index 68b5c438cdaba..2abc68fe2d1ff 100644
@@ -550,6 +550,16 @@ static bool rockchip_vop2_mod_supported(struct drm_plane *plane, u32 format,
 	if (modifier == DRM_FORMAT_MOD_INVALID)
 		return false;
 
+	if (vop2->data->soc_id == 3568 || vop2->data->soc_id == 3566) {
+		if (vop2_cluster_window(win)) {
+			if (modifier == DRM_FORMAT_MOD_LINEAR) {
+				drm_dbg_kms(vop2->drm,
+					    "Cluster window only supports format with afbc\n");
+				return false;
+			}
+		}
+	}
+
 	if (modifier == DRM_FORMAT_MOD_LINEAR)
 		return true;
 
Signature · 1 line
2.39.5
author maintainer
#61 lore raw

PATCH 61/623 drm/rockchip: vop2: Add check for 32 bpp format for rk3588

In reply to Greg Kroah-Hartman

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

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

From: Andy Yan <[email protected]>

[ Upstream commit 7e8a56c703c67bfa8d3f71a0c1c297bb1252b897 ]

RK3588 only support DRM_FORMAT_XRGB2101010/XBGR2101010 in afbc mode.

Fixes 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588")
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +9 -0
index 2abc68fe2d1ff..6082b1c179aeb 100644
@@ -560,6 +560,15 @@ static bool rockchip_vop2_mod_supported(struct drm_plane *plane, u32 format,
 		}
 	}
 
+	if (format == DRM_FORMAT_XRGB2101010 || format == DRM_FORMAT_XBGR2101010) {
+		if (vop2->data->soc_id == 3588) {
+			if (!rockchip_afbc(plane, modifier)) {
+				drm_dbg_kms(vop2->drm, "Only support 32 bpp format with afbc\n");
+				return false;
+			}
+		}
+	}
+
 	if (modifier == DRM_FORMAT_MOD_LINEAR)
 		return true;
 
Signature · 1 line
2.39.5
author maintainer
#43 lore raw

PATCH 43/623 dt-bindings: display/msm: qcom,sa8775p-mdss: fix the example

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 3b08796f2a7ca0c27b16543603df85bb45a640ff ]

Add p1 region to the list of DP registers in the SA8775p example. This fixes the following warning:

Documentation/devicetree/bindings/display/msm/qcom,sa8775p-mdss.example.dtb: displayport-controller@af54000: reg: [[183844864, 260], [183845376, 192], [183848960, 1904], [183853056, 156]] is too short

Patchwork: https://patchwork.freedesktop.org/patch/624068/

---
 .../devicetree/bindings/display/msm/qcom,sa8775p-mdss.yaml     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/msm/qcom,sa8775p-mdss.yaml +2 -1
index 58f8a01f29c7a..4536bb2f971f3 100644
@@ -168,7 +168,8 @@ examples:
             reg = <0xaf54000 0x104>,
                   <0xaf54200 0x0c0>,
                   <0xaf55000 0x770>,
-                  <0xaf56000 0x09c>;
+                  <0xaf56000 0x09c>,
+                  <0xaf57000 0x09c>;
 
             interrupt-parent = <&mdss0>;
             interrupts = <12>;
Signature · 1 line
2.39.5
author maintainer
#63 lore raw

PATCH 63/623 drm/amdgpu/vcn: reset fw_shared under SRIOV

In reply to Greg Kroah-Hartman

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

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

From: Bokun Zhang <[email protected]>

[ Upstream commit 3676f37a88432132bcff55a17dc48911239b6d98 ]

- The previous patch only considered the case for baremetal and is not applicable for SRIOV code path. We also need to init fw_share for SRIOV VF

Fixes 928cd772e18f ("drm/amdgpu/vcn: reset fw_shared when VCPU buffers corrupted on vcn v4.0.3")
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -0
index 3f69b9b2bcd07..18cc1aefb2a2b 100644
@@ -957,6 +957,8 @@ static int vcn_v4_0_3_start_sriov(struct amdgpu_device *adev)
 	for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
 		vcn_inst = GET_INST(VCN, i);
 
+		vcn_v4_0_3_fw_shared_init(adev, vcn_inst);
+
 		memset(&header, 0, sizeof(struct mmsch_v4_0_3_init_header));
 		header.version = MMSCH_VERSION;
 		header.total_size = sizeof(struct mmsch_v4_0_3_init_header) >> 2;
Signature · 1 line
2.39.5
author maintainer
#64 lore raw

PATCH 64/623 drm/amdgpu: Fix potential integer overflow in scheduler mask calculations

In reply to Greg Kroah-Hartman

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

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

From: Karol Przybylski <[email protected]>

[ Upstream commit 34c4eb7d4e0cd443399a0f114d467d2b3ff05419 ]

The use of 1 << i in scheduler mask calculations can result in an unintentional integer overflow due to the expression being evaluated as a 32-bit signed integer.

This patch replaces 1 << i with 1ULL << i to ensure the operation is performed as a 64-bit unsigned integer, preventing overflow

Discovered in coverity scan, CID 1636393, 1636175, 1636007, 1635853

Fixes c5c63d9cb5d3 ("drm/amdgpu: add amdgpu_gfx_sched_mask and amdgpu_compute_sched_mask debugfs")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +4 -4
index 1d155463d044b..9a4dad3e41529 100644
@@ -2058,7 +2058,7 @@ static int amdgpu_debugfs_gfx_sched_mask_set(void *data, u64 val)
 	if (!adev)
 		return -ENODEV;
 
-	mask = (1 << adev->gfx.num_gfx_rings) - 1;
+	mask = (1ULL << adev->gfx.num_gfx_rings) - 1;
 	if ((val & mask) == 0)
 		return -EINVAL;
 
@@ -2086,7 +2086,7 @@ static int amdgpu_debugfs_gfx_sched_mask_get(void *data, u64 *val)
 	for (i = 0; i < adev->gfx.num_gfx_rings; ++i) {
 		ring = &adev->gfx.gfx_ring[i];
 		if (ring->sched.ready)
-			mask |= 1 << i;
+			mask |= 1ULL << i;
 	}
 
 	*val = mask;
@@ -2128,7 +2128,7 @@ static int amdgpu_debugfs_compute_sched_mask_set(void *data, u64 val)
 	if (!adev)
 		return -ENODEV;
 
-	mask = (1 << adev->gfx.num_compute_rings) - 1;
+	mask = (1ULL << adev->gfx.num_compute_rings) - 1;
 	if ((val & mask) == 0)
 		return -EINVAL;
 
@@ -2157,7 +2157,7 @@ static int amdgpu_debugfs_compute_sched_mask_get(void *data, u64 *val)
 	for (i = 0; i < adev->gfx.num_compute_rings; ++i) {
 		ring = &adev->gfx.compute_ring[i];
 		if (ring->sched.ready)
-			mask |= 1 << i;
+			mask |= 1ULL << i;
 	}
 
 	*val = mask;
Signature · 1 line
2.39.5
author maintainer
#65 lore raw

PATCH 65/623 OPP: add index check to assert to avoid buffer overflow in _read_freq()

In reply to Greg Kroah-Hartman

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

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

From: Neil Armstrong <[email protected]>

[ Upstream commit d659bc68ed489022ea33342cfbda2911a81e7a0d ]

Pass the freq index to the assert function to make sure we do not read a freq out of the opp->rates[] table when called from the indexed variants:
dev_pm_opp_find_freq_exact_indexed() or dev_pm_opp_find_freq_ceil/floor_indexed().

Add a secondary parameter to the assert function, unused for assert_single_clk() then add assert_clk_index() which will check for the clock index when called from the _indexed() find functions.

Fixes 142e17c1c2b4 ("OPP: Introduce dev_pm_opp_find_freq_{ceil/floor}_indexed() APIs")
Fixes a5893928bb17 ("OPP: Add dev_pm_opp_find_freq_exact_indexed()")
---
 drivers/opp/core.c | 42 +++++++++++++++++++++++++++---------------
 1 file changed, 27 insertions(+), 15 deletions(-)
drivers/opp/core.c +27 -15
index 0311b18319a45..cf32e642da027 100644
@@ -101,11 +101,21 @@ struct opp_table *_find_opp_table(struct device *dev)
  * representation in the OPP table and manage the clock configuration themselves
  * in an platform specific way.
  */
-static bool assert_single_clk(struct opp_table *opp_table)
+static bool assert_single_clk(struct opp_table *opp_table,
+			      unsigned int __always_unused index)
 {
 	return !WARN_ON(opp_table->clk_count > 1);
 }
 
+/*
+ * Returns true if clock table is large enough to contain the clock index.
+ */
+static bool assert_clk_index(struct opp_table *opp_table,
+			     unsigned int index)
+{
+	return opp_table->clk_count > index;
+}
+
 /**
  * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp
  * @opp:	opp for which voltage has to be returned for
@@ -499,12 +509,12 @@ static struct dev_pm_opp *_opp_table_find_key(struct opp_table *opp_table,
 		unsigned long (*read)(struct dev_pm_opp *opp, int index),
 		bool (*compare)(struct dev_pm_opp **opp, struct dev_pm_opp *temp_opp,
 				unsigned long opp_key, unsigned long key),
-		bool (*assert)(struct opp_table *opp_table))
+		bool (*assert)(struct opp_table *opp_table, unsigned int index))
 {
 	struct dev_pm_opp *temp_opp, *opp = ERR_PTR(-ERANGE);
 
 	/* Assert that the requirement is met */
-	if (assert && !assert(opp_table))
+	if (assert && !assert(opp_table, index))
 		return ERR_PTR(-EINVAL);
 
 	mutex_lock(&opp_table->lock);
@@ -532,7 +542,7 @@ _find_key(struct device *dev, unsigned long *key, int index, bool available,
 	  unsigned long (*read)(struct dev_pm_opp *opp, int index),
 	  bool (*compare)(struct dev_pm_opp **opp, struct dev_pm_opp *temp_opp,
 			  unsigned long opp_key, unsigned long key),
-	  bool (*assert)(struct opp_table *opp_table))
+	  bool (*assert)(struct opp_table *opp_table, unsigned int index))
 {
 	struct opp_table *opp_table;
 	struct dev_pm_opp *opp;
@@ -555,7 +565,7 @@ _find_key(struct device *dev, unsigned long *key, int index, bool available,
 static struct dev_pm_opp *_find_key_exact(struct device *dev,
 		unsigned long key, int index, bool available,
 		unsigned long (*read)(struct dev_pm_opp *opp, int index),
-		bool (*assert)(struct opp_table *opp_table))
+		bool (*assert)(struct opp_table *opp_table, unsigned int index))
 {
 	/*
 	 * The value of key will be updated here, but will be ignored as the
@@ -568,7 +578,7 @@ static struct dev_pm_opp *_find_key_exact(struct device *dev,
 static struct dev_pm_opp *_opp_table_find_key_ceil(struct opp_table *opp_table,
 		unsigned long *key, int index, bool available,
 		unsigned long (*read)(struct dev_pm_opp *opp, int index),
-		bool (*assert)(struct opp_table *opp_table))
+		bool (*assert)(struct opp_table *opp_table, unsigned int index))
 {
 	return _opp_table_find_key(opp_table, key, index, available, read,
 				   _compare_ceil, assert);
@@ -577,7 +587,7 @@ static struct dev_pm_opp *_opp_table_find_key_ceil(struct opp_table *opp_table,
 static struct dev_pm_opp *_find_key_ceil(struct device *dev, unsigned long *key,
 		int index, bool available,
 		unsigned long (*read)(struct dev_pm_opp *opp, int index),
-		bool (*assert)(struct opp_table *opp_table))
+		bool (*assert)(struct opp_table *opp_table, unsigned int index))
 {
 	return _find_key(dev, key, index, available, read, _compare_ceil,
 			 assert);
@@ -586,7 +596,7 @@ static struct dev_pm_opp *_find_key_ceil(struct device *dev, unsigned long *key,
 static struct dev_pm_opp *_find_key_floor(struct device *dev,
 		unsigned long *key, int index, bool available,
 		unsigned long (*read)(struct dev_pm_opp *opp, int index),
-		bool (*assert)(struct opp_table *opp_table))
+		bool (*assert)(struct opp_table *opp_table, unsigned int index))
 {
 	return _find_key(dev, key, index, available, read, _compare_floor,
 			 assert);
@@ -647,7 +657,8 @@ struct dev_pm_opp *
 dev_pm_opp_find_freq_exact_indexed(struct device *dev, unsigned long freq,
 				   u32 index, bool available)
 {
-	return _find_key_exact(dev, freq, index, available, _read_freq, NULL);
+	return _find_key_exact(dev, freq, index, available, _read_freq,
+			       assert_clk_index);
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_exact_indexed);
 
@@ -707,7 +718,8 @@ struct dev_pm_opp *
 dev_pm_opp_find_freq_ceil_indexed(struct device *dev, unsigned long *freq,
 				  u32 index)
 {
-	return _find_key_ceil(dev, freq, index, true, _read_freq, NULL);
+	return _find_key_ceil(dev, freq, index, true, _read_freq,
+			      assert_clk_index);
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_ceil_indexed);
 
@@ -760,7 +772,7 @@ struct dev_pm_opp *
 dev_pm_opp_find_freq_floor_indexed(struct device *dev, unsigned long *freq,
 				   u32 index)
 {
-	return _find_key_floor(dev, freq, index, true, _read_freq, NULL);
+	return _find_key_floor(dev, freq, index, true, _read_freq, assert_clk_index);
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_find_freq_floor_indexed);
 
@@ -1702,7 +1714,7 @@ void dev_pm_opp_remove(struct device *dev, unsigned long freq)
 	if (IS_ERR(opp_table))
 		return;
 
-	if (!assert_single_clk(opp_table))
+	if (!assert_single_clk(opp_table, 0))
 		goto put_table;
 
 	mutex_lock(&opp_table->lock);
@@ -2054,7 +2066,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
 	unsigned long tol, u_volt = data->u_volt;
 	int ret;
 
-	if (!assert_single_clk(opp_table))
+	if (!assert_single_clk(opp_table, 0))
 		return -EINVAL;
 
 	new_opp = _opp_allocate(opp_table);
@@ -2810,7 +2822,7 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,
 		return r;
 	}
 
-	if (!assert_single_clk(opp_table)) {
+	if (!assert_single_clk(opp_table, 0)) {
 		r = -EINVAL;
 		goto put_table;
 	}
@@ -2886,7 +2898,7 @@ int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
 		return r;
 	}
 
-	if (!assert_single_clk(opp_table)) {
+	if (!assert_single_clk(opp_table, 0)) {
 		r = -EINVAL;
 		goto put_table;
 	}
Signature · 1 line
2.39.5
author maintainer
#66 lore raw

PATCH 66/623 OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized

In reply to Greg Kroah-Hartman

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

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

From: Neil Armstrong <[email protected]>

[ Upstream commit b44b9bc7cab2967c3d6a791b1cd542c89fc07f0e ]

If a driver calls dev_pm_opp_find_bw_ceil/floor() the retrieve bandwidth from the OPP table but the bandwidth table was not created because the interconnect properties were missing in the OPP consumer node, the kernel will crash with:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004
...
pc : _read_bw+0x8/0x10
lr : _opp_table_find_key+0x9c/0x174
...
Call trace:
  _read_bw+0x8/0x10 (P)
  _opp_table_find_key+0x9c/0x174 (L)
  _find_key+0x98/0x168
  dev_pm_opp_find_bw_ceil+0x50/0x88

...

In order to fix the crash, create an assert function to check if the bandwidth table was created before trying to get a bandwidth with _read_bw().

Fixes add1dc094a74 ("OPP: Use generic key finding helpers for bandwidth key")
---
 drivers/opp/core.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/opp/core.c +13 -2
index cf32e642da027..47b1068bb9891 100644
@@ -116,6 +116,15 @@ static bool assert_clk_index(struct opp_table *opp_table,
 	return opp_table->clk_count > index;
 }
 
+/*
+ * Returns true if bandwidth table is large enough to contain the bandwidth index.
+ */
+static bool assert_bandwidth_index(struct opp_table *opp_table,
+				   unsigned int index)
+{
+	return opp_table->path_count > index;
+}
+
 /**
  * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp
  * @opp:	opp for which voltage has to be returned for
@@ -890,7 +899,8 @@ struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev, unsigned int *bw,
 	unsigned long temp = *bw;
 	struct dev_pm_opp *opp;
 
-	opp = _find_key_ceil(dev, &temp, index, true, _read_bw, NULL);
+	opp = _find_key_ceil(dev, &temp, index, true, _read_bw,
+			     assert_bandwidth_index);
 	*bw = temp;
 	return opp;
 }
@@ -921,7 +931,8 @@ struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
 	unsigned long temp = *bw;
 	struct dev_pm_opp *opp;
 
-	opp = _find_key_floor(dev, &temp, index, true, _read_bw, NULL);
+	opp = _find_key_floor(dev, &temp, index, true, _read_bw,
+			      assert_bandwidth_index);
 	*bw = temp;
 	return opp;
 }
Signature · 1 line
2.39.5
author maintainer
#67 lore raw

PATCH 67/623 drm/msm/dpu: provide DSPP and correct LM config for SDM670

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 9a20f33495bfd45ca6712213f30697f686d0b6fd ]

On SDM670 the DPU has two DSPP blocks compared to 4 DSPP blocks on SDM845. Currently SDM670 just reuses LMs and DSPPs from SDM845. Define platform-specific configuration for those blocks.

Fixes e140b7e496b7 ("drm/msm/dpu: Add hw revision 4.1 (SDM670)")

Patchwork: https://patchwork.freedesktop.org/patch/629951/

---
 .../msm/disp/dpu1/catalog/dpu_4_1_sdm670.h    | 54 ++++++++++++++++++-
 1 file changed, 52 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_1_sdm670.h +52 -2
index cbbdaebe357ec..daef07924886a 100644
@@ -65,6 +65,54 @@ static const struct dpu_sspp_cfg sdm670_sspp[] = {
 	},
 };
 
+static const struct dpu_lm_cfg sdm670_lm[] = {
+	{
+		.name = "lm_0", .id = LM_0,
+		.base = 0x44000, .len = 0x320,
+		.features = MIXER_SDM845_MASK,
+		.sblk = &sdm845_lm_sblk,
+		.lm_pair = LM_1,
+		.pingpong = PINGPONG_0,
+		.dspp = DSPP_0,
+	}, {
+		.name = "lm_1", .id = LM_1,
+		.base = 0x45000, .len = 0x320,
+		.features = MIXER_SDM845_MASK,
+		.sblk = &sdm845_lm_sblk,
+		.lm_pair = LM_0,
+		.pingpong = PINGPONG_1,
+		.dspp = DSPP_1,
+	}, {
+		.name = "lm_2", .id = LM_2,
+		.base = 0x46000, .len = 0x320,
+		.features = MIXER_SDM845_MASK,
+		.sblk = &sdm845_lm_sblk,
+		.lm_pair = LM_5,
+		.pingpong = PINGPONG_2,
+	}, {
+		.name = "lm_5", .id = LM_5,
+		.base = 0x49000, .len = 0x320,
+		.features = MIXER_SDM845_MASK,
+		.sblk = &sdm845_lm_sblk,
+		.lm_pair = LM_2,
+		.pingpong = PINGPONG_3,
+	},
+};
+
+static const struct dpu_dspp_cfg sdm670_dspp[] = {
+	{
+		.name = "dspp_0", .id = DSPP_0,
+		.base = 0x54000, .len = 0x1800,
+		.features = DSPP_SC7180_MASK,
+		.sblk = &sdm845_dspp_sblk,
+	}, {
+		.name = "dspp_1", .id = DSPP_1,
+		.base = 0x56000, .len = 0x1800,
+		.features = DSPP_SC7180_MASK,
+		.sblk = &sdm845_dspp_sblk,
+	},
+};
+
 static const struct dpu_dsc_cfg sdm670_dsc[] = {
 	{
 		.name = "dsc_0", .id = DSC_0,
@@ -88,8 +136,10 @@ const struct dpu_mdss_cfg dpu_sdm670_cfg = {
 	.ctl = sdm845_ctl,
 	.sspp_count = ARRAY_SIZE(sdm670_sspp),
 	.sspp = sdm670_sspp,
-	.mixer_count = ARRAY_SIZE(sdm845_lm),
-	.mixer = sdm845_lm,
+	.mixer_count = ARRAY_SIZE(sdm670_lm),
+	.mixer = sdm670_lm,
+	.dspp_count = ARRAY_SIZE(sdm670_dspp),
+	.dspp = sdm670_dspp,
 	.pingpong_count = ARRAY_SIZE(sdm845_pp),
 	.pingpong = sdm845_pp,
 	.dsc_count = ARRAY_SIZE(sdm670_dsc),
Signature · 1 line
2.39.5
author maintainer
#68 lore raw

PATCH 68/623 drm/msm/dpu: link DSPP_2/_3 blocks on SM8150

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit ac440a31e523805939215b24d2f0c451b48d5891 ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes 05ae91d960fd ("drm/msm/dpu: enable DSPP support on SM8[12]50")

Patchwork: https://patchwork.freedesktop.org/patch/629952/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h +2 -0
index 6ccfde82fecdb..421afacb72480 100644
@@ -164,6 +164,7 @@ static const struct dpu_lm_cfg sm8150_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x320,
@@ -171,6 +172,7 @@ static const struct dpu_lm_cfg sm8150_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
author maintainer
#69 lore raw

PATCH 69/623 drm/msm/dpu: link DSPP_2/_3 blocks on SC8180X

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 0986163245df6bece47113e506143a7e87b0097d ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes f5abecfe339e ("drm/msm/dpu: enable DSPP and DSC on sc8180x")

Patchwork: https://patchwork.freedesktop.org/patch/629954/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h +2 -0
index bab19ddd1d4f9..641023b102bf5 100644
@@ -163,6 +163,7 @@ static const struct dpu_lm_cfg sc8180x_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x320,
@@ -170,6 +171,7 @@ static const struct dpu_lm_cfg sc8180x_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
author maintainer
#70 lore raw

PATCH 70/623 drm/msm/dpu: link DSPP_2/_3 blocks on SM8250

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 8252028092f86d413b3a83e5e76a9615073a0c7f ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes 05ae91d960fd ("drm/msm/dpu: enable DSPP support on SM8[12]50")

Patchwork: https://patchwork.freedesktop.org/patch/629956/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h +2 -0
index a57d50b1f0280..e8916ae826a6d 100644
@@ -162,6 +162,7 @@ static const struct dpu_lm_cfg sm8250_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x320,
@@ -169,6 +170,7 @@ static const struct dpu_lm_cfg sm8250_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
author maintainer
#71 lore raw

PATCH 71/623 drm/msm/dpu: link DSPP_2/_3 blocks on SM8350

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 42323d3c9e04c725d27606c31663b80a7cc30218 ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes 0e91bcbb0016 ("drm/msm/dpu: Add SM8350 to hw catalog")

Patchwork: https://patchwork.freedesktop.org/patch/629959/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_0_sm8350.h +2 -0
index aced16e350daa..f7c08e89c8820 100644
@@ -162,6 +162,7 @@ static const struct dpu_lm_cfg sm8350_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x320,
@@ -169,6 +170,7 @@ static const struct dpu_lm_cfg sm8350_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
author maintainer
#72 lore raw

PATCH 72/623 drm/msm/dpu: link DSPP_2/_3 blocks on SM8550

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit e21f9d85b05361bc343b11ecf84ac12c9cccbc3e ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes efcd0107727c ("drm/msm/dpu: add support for SM8550")

Patchwork: https://patchwork.freedesktop.org/patch/629961/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_0_sm8550.h +2 -0
index ad48defa154f7..a1dbbf5c652ff 100644
@@ -160,6 +160,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x320,
@@ -167,6 +168,7 @@ static const struct dpu_lm_cfg sm8550_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
author maintainer
#73 lore raw

PATCH 73/623 drm/msm/dpu: link DSPP_2/_3 blocks on SM8650

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 3d3ca0915aa3692a837f7235ca9d12db26f09911 ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes b94747f7d8c7 ("drm/msm/dpu: add support for SM8650 DPU")

Patchwork: https://patchwork.freedesktop.org/patch/629962/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_10_0_sm8650.h +2 -0
index eb5dfff2ec4f4..e187e7b1cef16 100644
@@ -160,6 +160,7 @@ static const struct dpu_lm_cfg sm8650_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x400,
@@ -167,6 +168,7 @@ static const struct dpu_lm_cfg sm8650_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x400,
Signature · 1 line
2.39.5
author maintainer
#74 lore raw

PATCH 74/623 drm/msm/dpu: link DSPP_2/_3 blocks on X1E80100

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 3a7a4bebe0dbe22686da7de573f183e0c842883a ]

Link DSPP_2 to the LM_2 and DSPP_3 to the LM_3 mixer blocks. This allows using colour transformation matrix (aka night mode) with more outputs at the same time.

Fixes e3b1f369db5a ("drm/msm/dpu: Add X1E80100 support")

Patchwork: https://patchwork.freedesktop.org/patch/629966/

---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_2_x1e80100.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_9_2_x1e80100.h +2 -0
index a3e60ac70689e..e084406ebb071 100644
@@ -159,6 +159,7 @@ static const struct dpu_lm_cfg x1e80100_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_3,
 		.pingpong = PINGPONG_2,
+		.dspp = DSPP_2,
 	}, {
 		.name = "lm_3", .id = LM_3,
 		.base = 0x47000, .len = 0x320,
@@ -166,6 +167,7 @@ static const struct dpu_lm_cfg x1e80100_lm[] = {
 		.sblk = &sdm845_lm_sblk,
 		.lm_pair = LM_2,
 		.pingpong = PINGPONG_3,
+		.dspp = DSPP_3,
 	}, {
 		.name = "lm_4", .id = LM_4,
 		.base = 0x48000, .len = 0x320,
Signature · 1 line
2.39.5
author maintainer
#75 lore raw

PATCH 75/623 drm/msm: Check return value of of_dma_configure()

In reply to Greg Kroah-Hartman

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

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

From: Sui Jingfeng <[email protected]>

[ Upstream commit b34a7401ffaee45354e81b38a4d072794079cfd6 ]

Because the of_dma_configure() will returns '-EPROBE_DEFER' if the probe procedure of the specific platform IOMMU driver is not finished yet. It can also return other error code for various reasons.

Stop pretending that it will always suceess, quit if it fail.

Fixes 29ac8979cdf7 ("drm/msm/a6xx: use msm_gem for GMU memory objects")
Fixes 5a903a44a984 ("drm/msm/a6xx: Introduce GMU wrapper support")

Patchwork: https://patchwork.freedesktop.org/patch/622782/

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +6 -2
index 14db7376c712d..e386b059187ac 100644
@@ -1603,7 +1603,9 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
 
 	gmu->dev = &pdev->dev;
 
-	of_dma_configure(gmu->dev, node, true);
+	ret = of_dma_configure(gmu->dev, node, true);
+	if (ret)
+		return ret;
 
 	pm_runtime_enable(gmu->dev);
 
@@ -1668,7 +1670,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
 
 	gmu->dev = &pdev->dev;
 
-	of_dma_configure(gmu->dev, node, true);
+	ret = of_dma_configure(gmu->dev, node, true);
+	if (ret)
+		return ret;
 
 	/* Fow now, don't do anything fancy until we get our feet under us */
 	gmu->idle_level = GMU_IDLE_STATE_ACTIVE;
Signature · 1 line
2.39.5
author maintainer
#76 lore raw

PATCH 76/623 drm/msm: dont clean up priv->kms prematurely

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit ebc0deda3c2948d40419677d388b4e6081688a06 ]

MSM display drivers provide kms structure allocated during probe(). Don't clean up priv->kms field in case of an error. Otherwise probe functions might fail after KMS probe deferral.

Fixes a2ab5d5bb6b1 ("drm/msm: allow passing struct msm_kms to msm_drv_probe()")
Fixes 506efcba3129 ("drm/msm: carve out KMS code from msm_drv.c")

Patchwork: https://patchwork.freedesktop.org/patch/590411/

---
 drivers/gpu/drm/msm/msm_kms.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/msm_kms.c +0 -1
index f3326d09bdbce..4cfad12f4dc1f 100644
@@ -244,7 +244,6 @@ int msm_drm_kms_init(struct device *dev, const struct drm_driver *drv)
 	ret = priv->kms_init(ddev);
 	if (ret) {
 		DRM_DEV_ERROR(dev, "failed to load kms\n");
-		priv->kms = NULL;
 		return ret;
 	}
 
Signature · 1 line
2.39.5
author maintainer
#77 lore raw

PATCH 77/623 drm/msm/mdp4: correct LCDC regulator name

In reply to Greg Kroah-Hartman

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

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

From: Dmitry Baryshkov <[email protected]>

[ Upstream commit 8aa337cbe7a61a5a98a4d3f446fc968b3bac914a ]

Correct c&p error from the conversion of LCDC regulators to the bulk API.

Fixes 54f1fbcb47d4 ("drm/msm/mdp4: use bulk regulators API for LCDC encoder")

Patchwork: https://patchwork.freedesktop.org/patch/590412/

---
 drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c +1 -1
index 576995ddce37e..8bbc7fb881d59 100644
@@ -389,7 +389,7 @@ struct drm_encoder *mdp4_lcdc_encoder_init(struct drm_device *dev,
 
 	/* TODO: different regulators in other cases? */
 	mdp4_lcdc_encoder->regs[0].supply = "lvds-vccs-3p3v";
-	mdp4_lcdc_encoder->regs[1].supply = "lvds-vccs-3p3v";
+	mdp4_lcdc_encoder->regs[1].supply = "lvds-pll-vdda";
 	mdp4_lcdc_encoder->regs[2].supply = "lvds-vdda";
 
 	ret = devm_regulator_bulk_get(dev->dev,
Signature · 1 line
2.39.5
author maintainer
#78 lore raw

PATCH 78/623 drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE

In reply to Greg Kroah-Hartman

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

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

From: Hermes Wu <[email protected]>

[ Upstream commit c14870218c14532b0f0a7805b96a4d3c92d06fb2 ]

The hardware AUX FIFO is 16 bytes
Change definition of AUX_FIFO_MAX_SIZE to 16

---
 drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it6505.c +1 -1
index 008d86cc562af..cf891e7677c0e 100644
@@ -300,7 +300,7 @@
 #define MAX_CR_LEVEL 0x03
 #define MAX_EQ_LEVEL 0x03
 #define AUX_WAIT_TIMEOUT_MS 15
-#define AUX_FIFO_MAX_SIZE 32
+#define AUX_FIFO_MAX_SIZE 16
 #define PIXEL_CLK_DELAY 1
 #define PIXEL_CLK_INVERSE 0
 #define ADJUST_PHASE_THRESHOLD 80000
Signature · 1 line
2.39.5
author maintainer
#79 lore raw

PATCH 79/623 drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit 6ec6cd9acbaa844391a1f75a824a3a9d18978fcb ]

The "mask" and "val" variables are type u64. The problem is that the BIT() macros are type unsigned long which is just 32 bits on 32bit systems.

It's unlikely that people will be using this driver on 32bit kernels and even if they did we only use the lower AMDGPU_MAX_SDMA_INSTANCES (16) bits. So this bug does not affect anything in real life.

Still, for correctness sake, u64 bit masks should use BIT_ULL().

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +2 -2
index 113f0d2426187..f40531fea11ad 100644
@@ -358,13 +358,13 @@ static int amdgpu_debugfs_sdma_sched_mask_set(void *data, u64 val)
 	if (!adev)
 		return -ENODEV;
 
-	mask = (1 << adev->sdma.num_instances) - 1;
+	mask = BIT_ULL(adev->sdma.num_instances) - 1;
 	if ((val & mask) == 0)
 		return -EINVAL;
 
 	for (i = 0; i < adev->sdma.num_instances; ++i) {
 		ring = &adev->sdma.instance[i].ring;
-		if (val & (1 << i))
+		if (val & BIT_ULL(i))
 			ring->sched.ready = true;
 		else
 			ring->sched.ready = false;
Signature · 1 line
2.39.5
author maintainer
#80 lore raw

PATCH 80/623 drm/amdgpu: tear down ttm range manager for doorbell in amdgpu_ttm_fini()

In reply to Greg Kroah-Hartman

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

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

From: Jiang Liu <[email protected]>

[ Upstream commit 60a2c0c12b644450e420ffc42291d1eb248bacb7 ]

Tear down ttm range manager for doorbell in function amdgpu_ttm_fini(), to avoid memory leakage.

Fixes 792b84fb9038 ("drm/amdgpu: initialize ttm for doorbells")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
index c8180cad0abdd..c4da62d111052 100644
@@ -2065,6 +2065,7 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
 	ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GDS);
 	ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GWS);
 	ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_OA);
+	ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_DOORBELL);
 	ttm_device_fini(&adev->mman.bdev);
 	adev->mman.initialized = false;
 	DRM_INFO("amdgpu: ttm finalized\n");
Signature · 1 line
2.39.5
author maintainer
#62 lore raw

PATCH 62/623 drm/rockchip: vop2: include rockchip_drm_drv.h

In reply to Greg Kroah-Hartman

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

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

From: Min-Hua Chen <[email protected]>

[ Upstream commit 77b1ccb2a27c7b3b118a03bf1730def92070d31b ]

Move rockchip_drm_drv.h in rockchip_drm_vop2.h to fix the follow sparse warning:

ARCH=arm64 LLVM=1 make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' mrproper defconfig all -j12

drivers/gpu/drm/rockchip/rockchip_vop2_reg.c:502:24: sparse:
warning: symbol 'vop2_platform_driver' was not declared. Should it be static?

It is also beneficial for the upcoming support for rk3576.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 1 -
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +0 -1
index 6082b1c179aeb..5880d87fe6b3a 100644
@@ -33,7 +33,6 @@
 #include <uapi/linux/videodev2.h>
 #include <dt-bindings/soc/rockchip,vop2.h>
 
-#include "rockchip_drm_drv.h"
 #include "rockchip_drm_gem.h"
 #include "rockchip_drm_vop2.h"
 #include "rockchip_rgb.h"
drivers/gpu/drm/rockchip/rockchip_drm_vop2.h +1 -0
index 1c4204324f9f5..130aaa40316d1 100644
@@ -9,6 +9,7 @@
 
 #include <linux/regmap.h>
 #include <drm/drm_modes.h>
+#include "rockchip_drm_drv.h"
 #include "rockchip_drm_vop.h"
 
 #define VOP2_VP_FEATURE_OUTPUT_10BIT        BIT(0)
Signature · 1 line
2.39.5
author maintainer
#84 lore raw

PATCH 84/623 wifi: ath11k: Fix unexpected return buffer manager error for WCN6750/WCN6855

In reply to Greg Kroah-Hartman

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

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

From: Balaji Pothunoori <[email protected]>

[ Upstream commit 78e154d42f2c72905fe66a400847e1b2b101b7b2 ]

The following error messages were encountered while parsing fragmented RX packets for WCN6750/WCN6855:

ath11k 17a10040.wifi: invalid return buffer manager 4

This issue arose due to a hardcoded check for HAL_RX_BUF_RBM_SW3_BM introduced in 'commit 71c748b5e01e ("ath11k: Fix unexpected return buffer manager error for QCA6390")'

For WCN6750 and WCN6855, the return buffer manager ID should be HAL_RX_BUF_RBM_SW1_BM. The incorrect conditional check caused fragmented packets to be dropped, resulting in the above error log.

Fix this by adding a check for HAL_RX_BUF_RBM_SW1_BM.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.2.0.c2-00258-QCAMSLSWPL-1
Tested-on: WCN6855 hw2.1 WLAN.HSP.1.1-04479-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1

Fixes 71c748b5e01e ("ath11k: Fix unexpected return buffer manager error for QCA6390")
---
 drivers/net/wireless/ath/ath11k/dp_rx.c  | 1 +
 drivers/net/wireless/ath/ath11k/hal_rx.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -0
index 40088e62572e1..40b52d12b4323 100644
@@ -3872,6 +3872,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,
 		ath11k_hal_rx_msdu_link_info_get(link_desc_va, &num_msdus, msdu_cookies,
 						 &rbm);
 		if (rbm != HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST &&
+		    rbm != HAL_RX_BUF_RBM_SW1_BM &&
 		    rbm != HAL_RX_BUF_RBM_SW3_BM) {
 			ab->soc_stats.invalid_rbm++;
 			ath11k_warn(ab, "invalid return buffer manager %d\n", rbm);
drivers/net/wireless/ath/ath11k/hal_rx.c +2 -1
index 8f7dd43dc1bd8..753bd93f02123 100644
@@ -372,7 +372,8 @@ int ath11k_hal_wbm_desc_parse_err(struct ath11k_base *ab, void *desc,
 
 	ret_buf_mgr = FIELD_GET(BUFFER_ADDR_INFO1_RET_BUF_MGR,
 				wbm_desc->buf_addr_info.info1);
-	if (ret_buf_mgr != HAL_RX_BUF_RBM_SW3_BM) {
+	if (ret_buf_mgr != HAL_RX_BUF_RBM_SW1_BM &&
+	    ret_buf_mgr != HAL_RX_BUF_RBM_SW3_BM) {
 		ab->soc_stats.invalid_rbm++;
 		return -EINVAL;
 	}
Signature · 1 line
2.39.5
author maintainer
#85 lore raw

PATCH 85/623 wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

In reply to Greg Kroah-Hartman

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

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

From: Colin Ian King <[email protected]>

[ Upstream commit 5e5903a442bb889a62a0f5d89ac33e53ab08592c ]

A previous clean-up fix removed the assignment of v2 inside a while loop that turned it into an infinite loop. Fix this by restoring the assignment of v2 from array[] so that v2 is updated inside the loop.

Fixes cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c +3 -1
index 1be51ea3f3c82..9eddbada8af12 100644
@@ -2033,8 +2033,10 @@ static bool _rtl8821ae_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
 			if (!_rtl8821ae_check_condition(hw, v1)) {
 				i += 2; /* skip the pair of expression*/
 				v2 = array[i+1];
-				while (v2 != 0xDEAD)
+				while (v2 != 0xDEAD) {
 					i += 3;
+					v2 = array[i + 1];
+				}
 			}
 		}
 	}
Signature · 1 line
2.39.5
author maintainer
#86 lore raw

PATCH 86/623 wifi: rtlwifi: do not complete firmware loading needlessly

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit e73e11d303940119e41850a0452a0deda2cc4eb5 ]

The only code waiting for completion is driver removal, which will not be called when probe returns a failure. So this completion is unnecessary.

---
 drivers/net/wireless/realtek/rtlwifi/pci.c | 1 -
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 -
 2 files changed, 2 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -1
index 11709b6c83f1a..40fc3c297a8ac 100644
@@ -2266,7 +2266,6 @@ int rtl_pci_probe(struct pci_dev *pdev,
 		pci_iounmap(pdev, (void __iomem *)rtlpriv->io.pci_mem_start);
 
 	pci_release_regions(pdev);
-	complete(&rtlpriv->firmware_loading_complete);
 
 fail1:
 	if (hw)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -1
index d37a017b2b814..c3aa0cd9ff211 100644
@@ -1040,7 +1040,6 @@ int rtl_usb_probe(struct usb_interface *intf,
 error_out2:
 	_rtl_usb_io_handler_release(hw);
 	usb_put_dev(udev);
-	complete(&rtlpriv->firmware_loading_complete);
 	kfree(rtlpriv->usb_data);
 	ieee80211_free_hw(hw);
 	return -ENODEV;
Signature · 1 line
2.39.5
author maintainer
#87 lore raw

PATCH 87/623 wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit 8559a9e0c457729fe3edb3176bbf7c7874f482b0 ]

Just like in commit 4dfde294b979 ("rtlwifi: rise completion at the last step of firmware callback"), only signal completion once the function is finished. Otherwise, the module removal waiting for the completion could free the memory that the callback will still use before returning.

---
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c +4 -3
index bbf8ff63dcedb..e63c67b1861b5 100644
@@ -64,22 +64,23 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
 
 	rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD,
 		"Firmware callback routine entered!\n");
-	complete(&rtlpriv->firmware_loading_complete);
 	if (!firmware) {
 		pr_err("Firmware %s not available\n", fw_name);
 		rtlpriv->max_fw_size = 0;
-		return;
+		goto exit;
 	}
 	if (firmware->size > rtlpriv->max_fw_size) {
 		pr_err("Firmware is too big!\n");
 		rtlpriv->max_fw_size = 0;
 		release_firmware(firmware);
-		return;
+		goto exit;
 	}
 	pfirmware = (struct rt_firmware *)rtlpriv->rtlhal.pfirmware;
 	memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
 	pfirmware->sz_fw_tmpbufferlen = firmware->size;
 	release_firmware(firmware);
+exit:
+	complete(&rtlpriv->firmware_loading_complete);
 }
 
 static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
Signature · 1 line
2.39.5
author maintainer
#88 lore raw

PATCH 88/623 wifi: rtlwifi: wait for firmware loading before releasing memory

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit b4b26642b31ef282df6ff7ea8531985edfdef12a ]

At probe error path, the firmware loading work may have already been queued. In such a case, it will try to access memory allocated by the probe function, which is about to be released. In such paths, wait for the firmware worker to finish before releasing memory.

Fixes a7f7c15e945a ("rtlwifi: rtl8192cu: Free ieee80211_hw if probing fails")
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/usb.c +3 -1
index c3aa0cd9ff211..c27b116ccdff5 100644
@@ -1028,13 +1028,15 @@ int rtl_usb_probe(struct usb_interface *intf,
 	err = ieee80211_register_hw(hw);
 	if (err) {
 		pr_err("Can't register mac80211 hw.\n");
-		goto error_out;
+		goto error_init_vars;
 	}
 	rtlpriv->mac80211.mac80211_registered = 1;
 
 	set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
 	return 0;
 
+error_init_vars:
+	wait_for_completion(&rtlpriv->firmware_loading_complete);
 error_out:
 	rtl_deinit_core(hw);
 error_out2:
Signature · 1 line
2.39.5
author maintainer
#89 lore raw

PATCH 89/623 wifi: rtlwifi: fix init_sw_vars leak when probe fails

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit 00260350aed80c002df270c805ca443ec9a719a6 ]

If ieee80211_register_hw fails, the memory allocated for the firmware will not be released. Call deinit_sw_vars as the function that undoes the allocationes done by init_sw_vars.

Fixes cefe3dfdb9f5 ("rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe")
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -0
index c27b116ccdff5..8ec687fab5721 100644
@@ -1037,6 +1037,7 @@ int rtl_usb_probe(struct usb_interface *intf,
 
 error_init_vars:
 	wait_for_completion(&rtlpriv->firmware_loading_complete);
+	rtlpriv->cfg->ops->deinit_sw_vars(hw);
 error_out:
 	rtl_deinit_core(hw);
 error_out2:
Signature · 1 line
2.39.5
author maintainer
#90 lore raw

PATCH 90/623 wifi: rtlwifi: usb: fix workqueue leak when probe fails

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit f79bc5c67867c19ce2762e7934c20dbb835ed82c ]

rtl_init_core creates a workqueue that is then assigned to rtl_wq. rtl_deinit_core does not destroy it. It is left to rtl_usb_deinit, which must be called in the probe error path.

Fixes 2ca20f79e0d8 ("rtlwifi: Add usb driver")
Fixes 851639fdaeac ("rtlwifi: Modify some USB de-initialize code.")
---
 drivers/net/wireless/realtek/rtlwifi/usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/usb.c +1 -0
index 8ec687fab5721..0368ecea2e817 100644
@@ -1039,6 +1039,7 @@ int rtl_usb_probe(struct usb_interface *intf,
 	wait_for_completion(&rtlpriv->firmware_loading_complete);
 	rtlpriv->cfg->ops->deinit_sw_vars(hw);
 error_out:
+	rtl_usb_deinit(hw);
 	rtl_deinit_core(hw);
 error_out2:
 	_rtl_usb_io_handler_release(hw);
Signature · 1 line
2.39.5
author maintainer
#81 lore raw

PATCH 81/623 drm/amdgpu: fix gpu recovery disable with per queue reset

In reply to Greg Kroah-Hartman

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

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

From: Jonathan Kim <[email protected]>

[ Upstream commit 86bde64cb7957be393f84e5d35fb8dfc91e4ae7e ]

Per queue reset should be bypassed when gpu recovery is disabled with module parameter.

Fixes ee0a469cf917 ("drm/amdkfd: support per-queue reset on gfx9")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +6 -0
index cc66ebb7bae15..441568163e20e 100644
@@ -1131,6 +1131,9 @@ uint64_t kgd_gfx_v9_hqd_get_pq_addr(struct amdgpu_device *adev,
 	uint32_t low, high;
 	uint64_t queue_addr = 0;
 
+	if (!amdgpu_gpu_recovery)
+		return 0;
+
 	kgd_gfx_v9_acquire_queue(adev, pipe_id, queue_id, inst);
 	amdgpu_gfx_rlc_enter_safe_mode(adev, inst);
 
@@ -1179,6 +1182,9 @@ uint64_t kgd_gfx_v9_hqd_reset(struct amdgpu_device *adev,
 	uint32_t low, high, pipe_reset_data = 0;
 	uint64_t queue_addr = 0;
 
+	if (!amdgpu_gpu_recovery)
+		return 0;
+
 	kgd_gfx_v9_acquire_queue(adev, pipe_id, queue_id, inst);
 	amdgpu_gfx_rlc_enter_safe_mode(adev, inst);
 
Signature · 1 line
2.39.5
author maintainer
#91 lore raw

PATCH 91/623 wifi: wcn36xx: fix channel survey memory allocation size

In reply to Greg Kroah-Hartman

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

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

From: Barnabás Czémán <[email protected]>

[ Upstream commit 6200d947f050efdba4090dfefd8a01981363d954 ]

KASAN reported a memory allocation issue in wcn->chan_survey due to incorrect size calculation.
This commit uses kcalloc to allocate memory for wcn->chan_survey, ensuring proper initialization and preventing the use of uninitialized values when there are no frames on the channel.

---
 drivers/net/wireless/ath/wcn36xx/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/wcn36xx/main.c +4 -1
index 8557d4826a46e..94d08d6ae1a3c 100644
@@ -1590,7 +1590,10 @@ static int wcn36xx_probe(struct platform_device *pdev)
 	}
 
 	n_channels = wcn_band_2ghz.n_channels + wcn_band_5ghz.n_channels;
-	wcn->chan_survey = devm_kmalloc(wcn->dev, n_channels, GFP_KERNEL);
+	wcn->chan_survey = devm_kcalloc(wcn->dev,
+					n_channels,
+					sizeof(struct wcn36xx_chan_survey),
+					GFP_KERNEL);
 	if (!wcn->chan_survey) {
 		ret = -ENOMEM;
 		goto out_wq;
Signature · 1 line
2.39.5
author maintainer
#92 lore raw

PATCH 92/623 clk: renesas: cpg-mssr: Fix soc node handling in cpg_mssr_reserved_init()

In reply to Greg Kroah-Hartman

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

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

From: Javier Carrasco <[email protected]>

[ Upstream commit a6ca7e6240f0651412da6a17d0e7a8f66d3455a6 ]

A device_node reference obtained via of_find_node_by_path() requires explicit calls to of_node_put() after it is no longer required to avoid leaking the resource.

Instead of adding the missing calls to of_node_put() in all execution paths, use the cleanup attribute for 'soc' by means of the __free() macro, which automatically calls of_node_put() when the variable goes out of scope.

---
 drivers/clk/renesas/renesas-cpg-mssr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/renesas-cpg-mssr.c +1 -1
index 79e7a90c3b1be..bf85501709f03 100644
@@ -979,7 +979,7 @@ static void __init cpg_mssr_reserved_exit(struct cpg_mssr_priv *priv)
 static int __init cpg_mssr_reserved_init(struct cpg_mssr_priv *priv,
 					 const struct cpg_mssr_info *info)
 {
-	struct device_node *soc = of_find_node_by_path("/soc");
+	struct device_node *soc __free(device_node) = of_find_node_by_path("/soc");
 	struct device_node *node;
 	uint32_t args[MAX_PHANDLE_ARGS];
 	unsigned int *ids = NULL;
Signature · 1 line
2.39.5
author maintainer
#93 lore raw

PATCH 93/623 clk: mmp: pxa1908-mpmu: Fix a NULL vs IS_ERR() check

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit 7def56f841af22e07977e193eea002e085facbdb ]

The devm_kzalloc() function returns NULL on error, not error pointers. Update the check to match.

---
 drivers/clk/mmp/clk-pxa1908-mpmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mmp/clk-pxa1908-mpmu.c +2 -2
index e3337bacaadd5..90b4b24885740 100644
@@ -78,8 +78,8 @@ static int pxa1908_mpmu_probe(struct platform_device *pdev)
 	struct pxa1908_clk_unit *pxa_unit;
 
 	pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
-	if (IS_ERR(pxa_unit))
-		return PTR_ERR(pxa_unit);
+	if (!pxa_unit)
+		return -ENOMEM;
 
 	pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pxa_unit->base))
Signature · 1 line
2.39.5
author maintainer
#94 lore raw

PATCH 94/623 clk: mmp: pxa1908-apbcp: Fix a NULL vs IS_ERR() check

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit 3acea81be689b77b3ceac6ff345ff0366734d967 ]

The devm_kzalloc() function doesn't return error pointers, it returns NULL on error. Update the check to match.

---
 drivers/clk/mmp/clk-pxa1908-apbcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mmp/clk-pxa1908-apbcp.c +2 -2
index 08f3845cbb1be..f638d7e89b472 100644
@@ -48,8 +48,8 @@ static int pxa1908_apbcp_probe(struct platform_device *pdev)
 	struct pxa1908_clk_unit *pxa_unit;
 
 	pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
-	if (IS_ERR(pxa_unit))
-		return PTR_ERR(pxa_unit);
+	if (!pxa_unit)
+		return -ENOMEM;
 
 	pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pxa_unit->base))
Signature · 1 line
2.39.5
author maintainer
#95 lore raw

PATCH 95/623 clk: mmp: pxa1908-apbc: Fix NULL vs IS_ERR() check

In reply to Greg Kroah-Hartman

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

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

From: Dan Carpenter <[email protected]>

[ Upstream commit e5ca5d7b4d7c29246d957dc45d63610584ae3a54 ]

The devm_kzalloc() function returns NULL on error, not error pointers. Fix the check.

---
 drivers/clk/mmp/clk-pxa1908-apbc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mmp/clk-pxa1908-apbc.c +2 -2
index b93d084661985..3fd7b5e644f3b 100644
@@ -96,8 +96,8 @@ static int pxa1908_apbc_probe(struct platform_device *pdev)
 	struct pxa1908_clk_unit *pxa_unit;
 
 	pxa_unit = devm_kzalloc(&pdev->dev, sizeof(*pxa_unit), GFP_KERNEL);
-	if (IS_ERR(pxa_unit))
-		return PTR_ERR(pxa_unit);
+	if (!pxa_unit)
+		return -ENOMEM;
 
 	pxa_unit->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(pxa_unit->base))
Signature · 1 line
2.39.5
author maintainer
#96 lore raw

PATCH 96/623 wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()

In reply to Greg Kroah-Hartman

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

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

From: Zichen Xie <[email protected]>

[ Upstream commit 13c4f7714c6a1ecf748a2f22099447c14fe6ed8c ]

kunit_kzalloc() may return NULL, dereferencing it without NULL check may lead to NULL dereference.
Add a NULL check for ies.

Fixes 45d43937a44c ("wifi: cfg80211: add a kunit test for 6 GHz colocated AP parsing")
---
 net/wireless/tests/scan.c | 2 ++
 1 file changed, 2 insertions(+)
net/wireless/tests/scan.c +2 -0
index e12f620b5f424..b1a9c1466d6cb 100644
@@ -810,6 +810,8 @@ static void test_cfg80211_parse_colocated_ap(struct kunit *test)
 		skb_put_data(input, "123", 3);
 
 	ies = kunit_kzalloc(test, struct_size(ies, data, input->len), GFP_KERNEL);
+	KUNIT_ASSERT_NOT_NULL(test, ies);
+
 	ies->len = input->len;
 	memcpy(ies->data, input->data, input->len);
 
Signature · 1 line
2.39.5
author maintainer
#97 lore raw

PATCH 97/623 selftests/bpf: Actuate tx_metadata_len in xdp_hw_metadata

In reply to Greg Kroah-Hartman

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

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

From: Song Yoong Siang <[email protected]>

[ Upstream commit 0bee36d1a51366fa57b731f8975f26f92943b43e ]

set XDP_UMEM_TX_METADATA_LEN flag to reserve tx_metadata_len bytes of per-chunk metadata.

Fixes d5e726d9143c ("xsk: Require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len")
---
 tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/xdp_hw_metadata.c +1 -1
index 6f9956eed797f..ad6c08dfd6c8c 100644
@@ -79,7 +79,7 @@ static int open_xsk(int ifindex, struct xsk *xsk, __u32 queue_id)
 		.fill_size = XSK_RING_PROD__DEFAULT_NUM_DESCS,
 		.comp_size = XSK_RING_CONS__DEFAULT_NUM_DESCS,
 		.frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE,
-		.flags = XSK_UMEM__DEFAULT_FLAGS,
+		.flags = XDP_UMEM_TX_METADATA_LEN,
 		.tx_metadata_len = sizeof(struct xsk_tx_metadata),
 	};
 	__u32 idx = 0;
Signature · 1 line
2.39.5
author maintainer
#82 lore raw

PATCH 82/623 genirq: Make handle_enforce_irqctx() unconditionally available

In reply to Greg Kroah-Hartman

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

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

From: Thomas Gleixner <[email protected]>

[ Upstream commit 8d187a77f04c14fb459a5301d69f733a5a1396bc ]

Commit 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely") sett the flag which enforces interrupt handling in interrupt context and prevents software base resends for ARM GIC v2/v3.

But it missed that the helper function which checks the flag was hidden behind CONFIG_GENERIC_PENDING_IRQ, which is not set by ARM[64].

Make the helper unconditionally available so that the enforcement actually works.

Fixes 1b57d91b969c ("irqchip/gic-v2, v3: Prevent SW resends entirely")
---
 kernel/irq/internals.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
kernel/irq/internals.h +3 -6
index fe0272cd84a51..a29df4b02a2ed 100644
@@ -441,10 +441,6 @@ static inline struct cpumask *irq_desc_get_pending_mask(struct irq_desc *desc)
 {
 	return desc->pending_mask;
 }
-static inline bool handle_enforce_irqctx(struct irq_data *data)
-{
-	return irqd_is_handle_enforce_irqctx(data);
-}
 bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear);
 #else /* CONFIG_GENERIC_PENDING_IRQ */
 static inline bool irq_can_move_pcntxt(struct irq_data *data)
@@ -471,11 +467,12 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
 {
 	return false;
 }
+#endif /* !CONFIG_GENERIC_PENDING_IRQ */
+
 static inline bool handle_enforce_irqctx(struct irq_data *data)
 {
-	return false;
+	return irqd_is_handle_enforce_irqctx(data);
 }
-#endif /* !CONFIG_GENERIC_PENDING_IRQ */
 
 #if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
 static inline int irq_domain_activate_irq(struct irq_data *data, bool reserve)
Signature · 1 line
2.39.5
author maintainer
#98 lore raw

PATCH 98/623 net_sched: sch_sfq: dont allow 1 packet limit

In reply to Greg Kroah-Hartman

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

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

From: Octavian Purdila <[email protected]>

[ Upstream commit 10685681bafce6febb39770f3387621bf5d67d0b ]

The current implementation does not work correctly with a limit of
1. iproute2 actually checks for this and this patch adds the check in kernel as well.

This fixes the following syzkaller reported crash:

UBSAN: array-index-out-of-bounds in net/sched/sch_sfq.c:210:6
index 65535 is out of range for type 'struct sfq_head[128]'
CPU: 0 PID: 2569 Comm: syz-executor101 Not tainted 5.10.0-smp-DEV #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
  __dump_stack lib/dump_stack.c:79 [inline]
  dump_stack+0x125/0x19f lib/dump_stack.c:120
  ubsan_epilogue lib/ubsan.c:148 [inline]
  __ubsan_handle_out_of_bounds+0xed/0x120 lib/ubsan.c:347
  sfq_link net/sched/sch_sfq.c:210 [inline]
  sfq_dec+0x528/0x600 net/sched/sch_sfq.c:238
  sfq_dequeue+0x39b/0x9d0 net/sched/sch_sfq.c:500
  sfq_reset+0x13/0x50 net/sched/sch_sfq.c:525
  qdisc_reset+0xfe/0x510 net/sched/sch_generic.c:1026
  tbf_reset+0x3d/0x100 net/sched/sch_tbf.c:319
  qdisc_reset+0xfe/0x510 net/sched/sch_generic.c:1026
  dev_reset_queue+0x8c/0x140 net/sched/sch_generic.c:1296
  netdev_for_each_tx_queue include/linux/netdevice.h:2350 [inline]
  dev_deactivate_many+0x6dc/0xc20 net/sched/sch_generic.c:1362
  __dev_close_many+0x214/0x350 net/core/dev.c:1468
  dev_close_many+0x207/0x510 net/core/dev.c:1506
  unregister_netdevice_many+0x40f/0x16b0 net/core/dev.c:10738
  unregister_netdevice_queue+0x2be/0x310 net/core/dev.c:10695
  unregister_netdevice include/linux/netdevice.h:2893 [inline]
  __tun_detach+0x6b6/0x1600 drivers/net/tun.c:689
  tun_detach drivers/net/tun.c:705 [inline]
  tun_chr_close+0x104/0x1b0 drivers/net/tun.c:3640
  __fput+0x203/0x840 fs/file_table.c:280
  task_work_run+0x129/0x1b0 kernel/task_work.c:185
  exit_task_work include/linux/task_work.h:33 [inline]
  do_exit+0x5ce/0x2200 kernel/exit.c:931
  do_group_exit+0x144/0x310 kernel/exit.c:1046
  __do_sys_exit_group kernel/exit.c:1057 [inline]
  __se_sys_exit_group kernel/exit.c:1055 [inline]
  __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1055
 do_syscall_64+0x6c/0xd0
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fe5e7b52479
Code: Unable to access opcode bytes at RIP 0x7fe5e7b5244f.
RSP: 002b:00007ffd3c800398 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe5e7b52479
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007fe5e7bcd2d0 R08: ffffffffffffffb8 R09: 0000000000000014
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe5e7bcd2d0
R13: 0000000000000000 R14: 00007fe5e7bcdd20 R15: 00007fe5e7b24270

The crash can be also be reproduced with the following (with a tc recompiled to allow for sfq limits of 1):

tc qdisc add dev dummy0 handle 1: root tbf rate 1Kbit burst 100b lat 1s ../iproute2-6.9.0/tc/tc qdisc add dev dummy0 handle 2: parent 1:10 sfq limit 1 ifconfig dummy0 up
ping -I dummy0 -f -c2 -W0.1 8.8.8.8
sleep 1

Scenario that triggers the crash:

* the first packet is sent and queued in TBF and SFQ; qdisc qlen is 1

* TBF dequeues: it peeks from SFQ which moves the packet to the gso_skb list and keeps qdisc qlen set to 1. TBF is out of tokens so it schedules itself for later.

* the second packet is sent and TBF tries to queues it to SFQ. qdisc qlen is now 2 and because the SFQ limit is 1 the packet is dropped by SFQ. At this point qlen is 1, and all of the SFQ slots are empty, however q->tail is not NULL.

At this point, assuming no more packets are queued, when sch_dequeue runs again it will decrement the qlen for the current empty slot causing an underflow and the subsequent out of bounds access.

---
 net/sched/sch_sfq.c | 4 ++++
 1 file changed, 4 insertions(+)
net/sched/sch_sfq.c +4 -0
index a4b8296a2fa1c..65d5b59da5830 100644
@@ -652,6 +652,10 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,
 		if (!p)
 			return -ENOMEM;
 	}
+	if (ctl->limit == 1) {
+		NL_SET_ERR_MSG_MOD(extack, "invalid limit");
+		return -EINVAL;
+	}
 	sch_tree_lock(sch);
 	if (ctl->quantum)
 		q->quantum = ctl->quantum;
Signature · 1 line
2.39.5
author maintainer
#99 lore raw

PATCH 99/623 spi: zynq-qspi: Add check for clk_enable()

In reply to Greg Kroah-Hartman

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

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

From: Mingwei Zheng <[email protected]>

[ Upstream commit 8332e667099712e05ec87ba2058af394b51ebdc9 ]

Add check for the return value of clk_enable() to catch the potential error.

---
 drivers/spi/spi-zynq-qspi.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/spi/spi-zynq-qspi.c +11 -2
index dee9c339a35e7..5caf0abf3763a 100644
@@ -379,12 +379,21 @@ static int zynq_qspi_setup_op(struct spi_device *spi)
 {
 	struct spi_controller *ctlr = spi->controller;
 	struct zynq_qspi *qspi = spi_controller_get_devdata(ctlr);
+	int ret;
 
 	if (ctlr->busy)
 		return -EBUSY;
 
-	clk_enable(qspi->refclk);
-	clk_enable(qspi->pclk);
+	ret = clk_enable(qspi->refclk);
+	if (ret)
+		return ret;
+
+	ret = clk_enable(qspi->pclk);
+	if (ret) {
+		clk_disable(qspi->refclk);
+		return ret;
+	}
+
 	zynq_qspi_write(qspi, ZYNQ_QSPI_ENABLE_OFFSET,
 			ZYNQ_QSPI_ENABLE_ENABLE_MASK);
 
Signature · 1 line
2.39.5
author maintainer
#100 lore raw

PATCH 100/623 rxrpc: Fix handling of received connection abort

In reply to Greg Kroah-Hartman

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

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

From: David Howells <[email protected]>

[ Upstream commit 0e56ebde245e4799ce74d38419426f2a80d39950 ]

Fix the handling of a connection abort that we've received. Though the abort is at the connection level, it needs propagating to the calls on that connection. Whilst the propagation bit is performed, the calls aren't then woken up to go and process their termination, and as no further input is forthcoming, they just hang.

Also add some tracing for the logging of connection aborts.

Fixes 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code")
cc Marc Dionne <[email protected]>
---
 include/trace/events/rxrpc.h | 25 +++++++++++++++++++++++++
 net/rxrpc/conn_event.c       | 12 ++++++++----
 2 files changed, 33 insertions(+), 4 deletions(-)
include/trace/events/rxrpc.h +25 -0
index d03e0bd8c028b..27c23873c8811 100644
@@ -117,6 +117,7 @@
 #define rxrpc_call_poke_traces \
 	EM(rxrpc_call_poke_abort,		"Abort")	\
 	EM(rxrpc_call_poke_complete,		"Compl")	\
+	EM(rxrpc_call_poke_conn_abort,		"Conn-abort")	\
 	EM(rxrpc_call_poke_error,		"Error")	\
 	EM(rxrpc_call_poke_idle,		"Idle")		\
 	EM(rxrpc_call_poke_set_timeout,		"Set-timo")	\
@@ -282,6 +283,7 @@
 	EM(rxrpc_call_see_activate_client,	"SEE act-clnt") \
 	EM(rxrpc_call_see_connect_failed,	"SEE con-fail") \
 	EM(rxrpc_call_see_connected,		"SEE connect ") \
+	EM(rxrpc_call_see_conn_abort,		"SEE conn-abt") \
 	EM(rxrpc_call_see_disconnected,		"SEE disconn ") \
 	EM(rxrpc_call_see_distribute_error,	"SEE dist-err") \
 	EM(rxrpc_call_see_input,		"SEE input   ") \
@@ -981,6 +983,29 @@ TRACE_EVENT(rxrpc_rx_abort,
 		      __entry->abort_code)
 	    );
 
+TRACE_EVENT(rxrpc_rx_conn_abort,
+	    TP_PROTO(const struct rxrpc_connection *conn, const struct sk_buff *skb),
+
+	    TP_ARGS(conn, skb),
+
+	    TP_STRUCT__entry(
+		    __field(unsigned int,	conn)
+		    __field(rxrpc_serial_t,	serial)
+		    __field(u32,		abort_code)
+			     ),
+
+	    TP_fast_assign(
+		    __entry->conn = conn->debug_id;
+		    __entry->serial = rxrpc_skb(skb)->hdr.serial;
+		    __entry->abort_code = skb->priority;
+			   ),
+
+	    TP_printk("C=%08x ABORT %08x ac=%d",
+		      __entry->conn,
+		      __entry->serial,
+		      __entry->abort_code)
+	    );
+
 TRACE_EVENT(rxrpc_rx_challenge,
 	    TP_PROTO(struct rxrpc_connection *conn, rxrpc_serial_t serial,
 		     u32 version, u32 nonce, u32 min_level),
net/rxrpc/conn_event.c +8 -4
index 598b4ee389fc1..2a1396cd892f3 100644
@@ -63,11 +63,12 @@ int rxrpc_abort_conn(struct rxrpc_connection *conn, struct sk_buff *skb,
 /*
  * Mark a connection as being remotely aborted.
  */
-static bool rxrpc_input_conn_abort(struct rxrpc_connection *conn,
+static void rxrpc_input_conn_abort(struct rxrpc_connection *conn,
 				   struct sk_buff *skb)
 {
-	return rxrpc_set_conn_aborted(conn, skb, skb->priority, -ECONNABORTED,
-				      RXRPC_CALL_REMOTELY_ABORTED);
+	trace_rxrpc_rx_conn_abort(conn, skb);
+	rxrpc_set_conn_aborted(conn, skb, skb->priority, -ECONNABORTED,
+			       RXRPC_CALL_REMOTELY_ABORTED);
 }
 
 /*
@@ -202,11 +203,14 @@ static void rxrpc_abort_calls(struct rxrpc_connection *conn)
 
 	for (i = 0; i < RXRPC_MAXCALLS; i++) {
 		call = conn->channels[i].call;
-		if (call)
+		if (call) {
+			rxrpc_see_call(call, rxrpc_call_see_conn_abort);
 			rxrpc_set_call_completion(call,
 						  conn->completion,
 						  conn->abort_code,
 						  conn->error);
+			rxrpc_poke_call(call, rxrpc_call_poke_conn_abort);
+		}
 	}
 
 	_leave("");
Signature · 1 line
2.39.5
author maintainer
#101 lore raw

PATCH 101/623 dt-bindings: mmc: controller: clarify the address-cells description

In reply to Greg Kroah-Hartman

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

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

From: Neil Armstrong <[email protected]>

[ Upstream commit b2b8e93ec00b8110cb37cbde5400d5abfdaed6a7 ]

The term "slot ID" has nothing to do with the SDIO function number which is specified in the reg property of the subnodes, rephrase the description to be more accurate.

Fixes f9b7989859dd ("dt-bindings: mmc: Add YAML schemas for the generic MMC options")

Message-ID: <20241128-topic-amlogic-arm32-upstream-bindings-fixes-convert-meson-mx-sdio-v4-1-11d9f9200a59@linaro.org>

---
 Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/mmc-controller.yaml +1 -1
index 58ae298cd2fcf..23884b8184a9d 100644
@@ -25,7 +25,7 @@ properties:
   "#address-cells":
     const: 1
     description: |
-      The cell is the slot ID if a function subnode is used.
+      The cell is the SDIO function number if a function subnode is used.
 
   "#size-cells":
     const: 0
Signature · 1 line
2.39.5
author maintainer
#83 lore raw

PATCH 83/623 ipmi: ipmb: Add check devm_kasprintf() returned value

In reply to Greg Kroah-Hartman

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

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

From: Charles Han <[email protected]>

[ Upstream commit 2378bd0b264ad3a1f76bd957caf33ee0c7945351 ]

devm_kasprintf() can return a NULL pointer on failure but this returned value is not checked.

Fixes 51bd6f291583 ("Add support for IPMB driver")

Message-ID: <[email protected]>

---
 drivers/char/ipmi/ipmb_dev_int.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/char/ipmi/ipmb_dev_int.c +3 -0
index 7296127181eca..8a14fd0291d89 100644
@@ -321,6 +321,9 @@ static int ipmb_probe(struct i2c_client *client)
 	ipmb_dev->miscdev.name = devm_kasprintf(&client->dev, GFP_KERNEL,
 						"%s%d", "ipmb-",
 						client->adapter->nr);
+	if (!ipmb_dev->miscdev.name)
+		return -ENOMEM;
+
 	ipmb_dev->miscdev.fops = &ipmb_fops;
 	ipmb_dev->miscdev.parent = &client->dev;
 	ret = misc_register(&ipmb_dev->miscdev);
Signature · 1 line
2.39.5
author maintainer
#103 lore raw

PATCH 103/623 dt-bindings: leds: class-multicolor: Fix path to color definitions

In reply to Greg Kroah-Hartman

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

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

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit 609bc99a4452ffbce82d10f024a85d911c42e6cd ]

The LED color definitions have always been in
include/dt-bindings/leds/common.h in upstream.

---
 .../devicetree/bindings/leds/leds-class-multicolor.yaml         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/leds/leds-class-multicolor.yaml +1 -1
index e850a8894758d..bb40bb9e036ee 100644
@@ -27,7 +27,7 @@ properties:
     description: |
       For multicolor LED support this property should be defined as either
       LED_COLOR_ID_RGB or LED_COLOR_ID_MULTI which can be found in
-      include/linux/leds/common.h.
+      include/dt-bindings/leds/common.h.
     enum: [ 8, 9 ]
 
 required:
Signature · 1 line
2.39.5
author maintainer
#107 lore raw

PATCH 107/623 wifi: rtlwifi: pci: wait for firmware loading before releasing memory

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit b59b86c5d08be7d761c04affcbcec8184738c200 ]

At probe error path, the firmware loading work may have already been queued. In such a case, it will try to access memory allocated by the probe function, which is about to be released. In such paths, wait for the firmware worker to finish before releasing memory.

Fixes 3d86b93064c7 ("rtlwifi: Fix PCI probe error path orphaned memory")
---
 drivers/net/wireless/realtek/rtlwifi/pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtlwifi/pci.c +1 -0
index a870117cf12af..0eafc4d125f91 100644
@@ -2218,6 +2218,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 fail4:
 	rtl_deinit_core(hw);
 fail3:
+	wait_for_completion(&rtlpriv->firmware_loading_complete);
 	rtlpriv->cfg->ops->deinit_sw_vars(hw);
 
 fail2:
Signature · 1 line
2.39.5
author maintainer
#108 lore raw

PATCH 108/623 HID: multitouch: fix support for Goodix PID 0x01e9

In reply to Greg Kroah-Hartman

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

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

From: Jiri Kosina <[email protected]>

[ Upstream commit 8ade5e05bd094485ce370fad66a6a3fb6f50bfbc ]

Commit c8000deb68365b ("HID: multitouch: Add support for GT7868Q") added support for 0x01e8 and 0x01e9, but the mt_device[] entries were added twice for 0x01e8 and there was none added for 0x01e9. Fix that.

Fixes c8000deb68365b ("HID: multitouch: Add support for GT7868Q")
---
 drivers/hid/hid-multitouch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-multitouch.c +1 -1
index 65023bfe30ed2..42c0bd9d2f31e 100644
@@ -2084,7 +2084,7 @@ static const struct hid_device_id mt_devices[] = {
 		     I2C_DEVICE_ID_GOODIX_01E8) },
 	{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU,
 	  HID_DEVICE(BUS_I2C, HID_GROUP_ANY, I2C_VENDOR_ID_GOODIX,
-		     I2C_DEVICE_ID_GOODIX_01E8) },
+		     I2C_DEVICE_ID_GOODIX_01E9) },
 
 	/* GoodTouch panels */
 	{ .driver_data = MT_CLS_NSMU,
Signature · 1 line
2.39.5
author maintainer
#109 lore raw

PATCH 109/623 regulator: dt-bindings: mt6315: Drop regulator-compatible property

In reply to Greg Kroah-Hartman

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

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

From: Chen-Yu Tsai <[email protected]>

[ Upstream commit 08242719a8af603db54a2a79234a8fe600680105 ]

The "regulator-compatible" property has been deprecated since 2012 in commit 13511def87b9 ("regulator: deprecate regulator-compatible DT property"), which is so old it's not even mentioned in the converted regulator bindings YAML file. It should not have been used for new submissions such as the MT6315.

Drop the property from the MT6315 regulator binding and its examples.

Fixes 977fb5b58469 ("regulator: document binding for MT6315 regulator")
Fixes 6d435a94ba5b ("regulator: mt6315: Enforce regulator-compatible, not name")
---
 .../devicetree/bindings/regulator/mt6315-regulator.yaml     | 6 ------
 1 file changed, 6 deletions(-)
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +0 -6
index cd4aa27218a1b..fa6743bb269d4 100644
@@ -35,10 +35,6 @@ properties:
         $ref: regulator.yaml#
         unevaluatedProperties: false
 
-        properties:
-          regulator-compatible:
-            pattern: "^vbuck[1-4]$"
-
     additionalProperties: false
 
 required:
@@ -56,7 +52,6 @@ examples:
 
       regulators {
         vbuck1 {
-          regulator-compatible = "vbuck1";
           regulator-min-microvolt = <300000>;
           regulator-max-microvolt = <1193750>;
           regulator-enable-ramp-delay = <256>;
@@ -64,7 +59,6 @@ examples:
         };
 
         vbuck3 {
-          regulator-compatible = "vbuck3";
           regulator-min-microvolt = <300000>;
           regulator-max-microvolt = <1193750>;
           regulator-enable-ramp-delay = <256>;
Signature · 1 line
2.39.5
author maintainer
#110 lore raw

PATCH 110/623 wifi: ath12k: fix read pointer after free in ath12k_mac_assign_vif_to_vdev()

In reply to Greg Kroah-Hartman

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

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

From: Aditya Kumar Singh <[email protected]>

[ Upstream commit 5a10971c7645a95f5d5dc23c26fbac4bf61801d0 ]

In ath12k_mac_assign_vif_to_vdev(), if arvif is created on a different radio, it gets deleted from that radio through a call to ath12k_mac_unassign_link_vif(). This action frees the arvif pointer. Subsequently, there is a check involving arvif, which will result in a read-after-free scenario.

Fix this by moving this check after arvif is again assigned via call to ath12k_mac_assign_link_vif().

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

---
 drivers/net/wireless/ath/ath12k/mac.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/mac.c +3 -3
index d493ec812055f..cf4f4245f6068 100644
@@ -7173,9 +7173,6 @@ static struct ath12k *ath12k_mac_assign_vif_to_vdev(struct ieee80211_hw *hw,
 
 	ab = ar->ab;
 
-	if (arvif->is_created)
-		goto flush;
-
 	/* Assign arvif again here since previous radio switch block
 	 * would've unassigned and cleared it.
 	 */
@@ -7186,6 +7183,9 @@ static struct ath12k *ath12k_mac_assign_vif_to_vdev(struct ieee80211_hw *hw,
 		goto unlock;
 	}
 
+	if (arvif->is_created)
+		goto flush;
+
 	if (ar->num_created_vdevs > (TARGET_NUM_VDEVS - 1)) {
 		ath12k_warn(ab, "failed to create vdev, reached max vdev limit %d\n",
 			    TARGET_NUM_VDEVS);
Signature · 1 line
2.39.5
author maintainer
#111 lore raw

PATCH 111/623 wifi: brcmfmac: add missing header include for brcmf_dbg

In reply to Greg Kroah-Hartman

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

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

From: Marcel Hamer <[email protected]>

[ Upstream commit b05d30c2b6df7e2172b18bf1baee9b202f9c6b53 ]

Including the fwil.h header file can lead to a build error:

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h: \
In function ‘brcmf_fil_cmd_int_set’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h:90:9: error: implicit \
declaration of function ‘brcmf_dbg’ [-Werror=implicit-function-declaration]

   90 |         brcmf_dbg(FIL, "ifidx=%d, cmd=%d, value=%d\n", ifp->ifidx, cmd, data);
      |         ^~~~~~~~~

The error is often avoided because the debug.h header file is included before the fwil.h header file.

This makes sure the header include order is irrelevant by explicitly adding the debug.h header.

Fixes 31343230abb1 ("wifi: brcmfmac: export firmware interface functions")
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h +2 -0
index 31e080e4da669..ab3d6cfcb02bd 100644
@@ -6,6 +6,8 @@
 #ifndef _fwil_h_
 #define _fwil_h_
 
+#include "debug.h"
+
 /*******************************************************************************
  * Dongle command codes that are interpreted by firmware
  ******************************************************************************/
Signature · 1 line
2.39.5
author maintainer
#112 lore raw

PATCH 112/623 hwmon: (nct6775): Actually make use of the HWMON_NCT6775 symbol namespace

In reply to Greg Kroah-Hartman

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

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

From: Uwe Kleine-König <[email protected]>

[ Upstream commit 2505f87eb3af55f3dd7f57d7cb7783b94b52a2d9 ]

DEFAULT_SYMBOL_NAMESPACE must already be defined when <linux/export.h> is included. So move the define above the include block.

Fixes c3963bc0a0cf ("hwmon: (nct6775) Split core and platform driver")
---
 drivers/hwmon/nct6775-core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/nct6775-core.c +3 -3
index c243b51837d2f..fa3351351825b 100644
@@ -42,6 +42,9 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#undef DEFAULT_SYMBOL_NAMESPACE
+#define DEFAULT_SYMBOL_NAMESPACE "HWMON_NCT6775"
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -56,9 +59,6 @@
 #include "lm75.h"
 #include "nct6775.h"
 
-#undef DEFAULT_SYMBOL_NAMESPACE
-#define DEFAULT_SYMBOL_NAMESPACE "HWMON_NCT6775"
-
 #define USE_ALTERNATE
 
 /* used to set data->name = nct6775_device_names[data->sio_kind] */
Signature · 1 line
2.39.5
author maintainer
#113 lore raw

PATCH 113/623 ACPI: fan: cleanup resources in the error path of .probe()

In reply to Greg Kroah-Hartman

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

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

From: Joe Hattori <[email protected]>

[ Upstream commit c759bc8e9046f9812238f506d70f07d3ea4206d4 ]

Call thermal_cooling_device_unregister() and sysfs_remove_link() in the error path of acpi_fan_probe() to fix possible memory leak.

This bug was found by an experimental static analysis tool that I am developing.

Fixes 05a83d972293 ("ACPI: register ACPI Fan as generic thermal cooling device")
---
 drivers/acpi/fan_core.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/acpi/fan_core.c +8 -2
index 3ea9cfcff46e7..10016f52f4f40 100644
@@ -371,19 +371,25 @@ static int acpi_fan_probe(struct platform_device *pdev)
 	result = sysfs_create_link(&pdev->dev.kobj,
 				   &cdev->device.kobj,
 				   "thermal_cooling");
-	if (result)
+	if (result) {
 		dev_err(&pdev->dev, "Failed to create sysfs link 'thermal_cooling'\n");
+		goto err_unregister;
+	}
 
 	result = sysfs_create_link(&cdev->device.kobj,
 				   &pdev->dev.kobj,
 				   "device");
 	if (result) {
 		dev_err(&pdev->dev, "Failed to create sysfs link 'device'\n");
-		goto err_end;
+		goto err_remove_link;
 	}
 
 	return 0;
 
+err_remove_link:
+	sysfs_remove_link(&pdev->dev.kobj, "thermal_cooling");
+err_unregister:
+	thermal_cooling_device_unregister(cdev);
 err_end:
 	if (fan->acpi4)
 		acpi_fan_delete_attributes(device);
Signature · 1 line
2.39.5
author maintainer
#104 lore raw

PATCH 104/623 wifi: rtlwifi: remove unused check_buddy_priv

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit 2fdac64c3c35858aa8ac5caa70b232e03456e120 ]

Commit 2461c7d60f9f ("rtlwifi: Update header file") introduced a global list of private data structures.

Later on, commit 26634c4b1868 ("rtlwifi Modify existing bits to match vendor version 2013.02.07") started adding the private data to that list at probe time and added a hook, check_buddy_priv to find the private data from a similar device.

However, that function was never used.

Besides, though there is a lock for that list, it is never used. And when the probe fails, the private data is never removed from the list. This would cause a second probe to access freed memory.

Remove the unused hook, structures and members, which will prevent the potential race condition on the list and its corruption during a second probe when probe fails.

Fixes 26634c4b1868 ("rtlwifi Modify existing bits to match vendor version 2013.02.07")
---
 drivers/net/wireless/realtek/rtlwifi/base.c |  7 ----
 drivers/net/wireless/realtek/rtlwifi/base.h |  1 -
 drivers/net/wireless/realtek/rtlwifi/pci.c  | 44 ---------------------
 drivers/net/wireless/realtek/rtlwifi/wifi.h | 12 ------
 4 files changed, 64 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +0 -7
index aab4605de9c47..fd28c7a722d89 100644
@@ -2696,9 +2696,6 @@ MODULE_AUTHOR("Larry Finger	<[email protected]>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core");
 
-struct rtl_global_var rtl_global_var = {};
-EXPORT_SYMBOL_GPL(rtl_global_var);
-
 static int __init rtl_core_module_init(void)
 {
 	BUILD_BUG_ON(TX_PWR_BY_RATE_NUM_RATE < TX_PWR_BY_RATE_NUM_SECTION);
@@ -2712,10 +2709,6 @@ static int __init rtl_core_module_init(void)
 	/* add debugfs */
 	rtl_debugfs_add_topdir();
 
-	/* init some global vars */
-	INIT_LIST_HEAD(&rtl_global_var.glb_priv_list);
-	spin_lock_init(&rtl_global_var.glb_list_lock);
-
 	return 0;
 }
 
drivers/net/wireless/realtek/rtlwifi/base.h +0 -1
index f081a9a90563f..f3a6a43a42eca 100644
@@ -124,7 +124,6 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,
 u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie);
 void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len);
 u8 rtl_tid_to_ac(u8 tid);
-extern struct rtl_global_var rtl_global_var;
 void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation);
 
 #endif
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -44

74 lines not on this page · raw message

drivers/net/wireless/realtek/rtlwifi/wifi.h +0 -12
index ae6e351bc83c9..f1830ddcdd8c1 100644
@@ -2270,8 +2270,6 @@ struct rtl_intf_ops {
 	/*com */
 	int (*adapter_start)(struct ieee80211_hw *hw);
 	void (*adapter_stop)(struct ieee80211_hw *hw);
-	bool (*check_buddy_priv)(struct ieee80211_hw *hw,
-				 struct rtl_priv **buddy_priv);
 
 	int (*adapter_tx)(struct ieee80211_hw *hw,
 			  struct ieee80211_sta *sta,
@@ -2514,14 +2512,6 @@ struct dig_t {
 	u32 rssi_max;
 };
 
-struct rtl_global_var {
-	/* from this list we can get
-	 * other adapter's rtl_priv
-	 */
-	struct list_head glb_priv_list;
-	spinlock_t glb_list_lock;
-};
-
 #define IN_4WAY_TIMEOUT_TIME	(30 * MSEC_PER_SEC)	/* 30 seconds */
 
 struct rtl_btc_info {
@@ -2667,9 +2657,7 @@ struct rtl_scan_list {
 struct rtl_priv {
 	struct ieee80211_hw *hw;
 	struct completion firmware_loading_complete;
-	struct list_head list;
 	struct rtl_priv *buddy_priv;
-	struct rtl_global_var *glb_var;
 	struct rtl_dmsp_ctl dmsp_ctl;
 	struct rtl_locks locks;
 	struct rtl_works works;
Signature · 1 line
2.39.5
author maintainer
#114 lore raw

PATCH 114/623 cpupower: fix TSC MHz calculation

In reply to Greg Kroah-Hartman

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

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

From: He Rongguang <[email protected]>

[ Upstream commit 9d6c0e58514f8b57cd9c2c755e41623d6a966025 ]

Commit 'cpupower: Make TSC read per CPU for Mperf monitor' (c2adb1877b7) changes TSC counter reads per cpu, but left time diff global (from start of all cpus to end of all cpus), thus diff(time) is too large for a cpu's tsc counting, resulting in far less than acutal TSC_Mhz and thus cpupower monitor showing far less than actual cpu realtime frequency.

/proc/cpuinfo shows frequency:
cat /proc/cpuinfo | egrep -e 'processor' -e 'MHz'
...
processor : 171
cpu MHz : 4108.498
...

before fix (System 100% busy):

    | Mperf              || Idle_Stats
 CPU| C0   | Cx   | Freq  || POLL | C1   | C2
 171|  0.77| 99.23|  2279||  0.00|  0.00|  0.00

after fix (System 100% busy):

    | Mperf              || Idle_Stats
 CPU| C0   | Cx   | Freq  || POLL | C1   | C2
 171|  0.46| 99.54|  4095||  0.00|  0.00|  0.00
Fixes c2adb1877b76 ("cpupower: Make TSC read per CPU for Mperf monitor")
---
 .../cpupower/utils/idle_monitor/mperf_monitor.c   | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c +9 -6
index ae6af354a81db..08a399b0be286 100644
@@ -33,7 +33,7 @@ static int mperf_get_count_percent(unsigned int self_id, double *percent,
 				   unsigned int cpu);
 static int mperf_get_count_freq(unsigned int id, unsigned long long *count,
 				unsigned int cpu);
-static struct timespec time_start, time_end;
+static struct timespec *time_start, *time_end;
 
 static cstate_t mperf_cstates[MPERF_CSTATE_COUNT] = {
 	{
@@ -174,7 +174,7 @@ static int mperf_get_count_percent(unsigned int id, double *percent,
 		dprint("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n",
 		       mperf_cstates[id].name, mperf_diff, tsc_diff);
 	} else if (max_freq_mode == MAX_FREQ_SYSFS) {
-		timediff = max_frequency * timespec_diff_us(time_start, time_end);
+		timediff = max_frequency * timespec_diff_us(time_start[cpu], time_end[cpu]);
 		*percent = 100.0 * mperf_diff / timediff;
 		dprint("%s: MAXFREQ - mperf_diff: %llu, time_diff: %llu\n",
 		       mperf_cstates[id].name, mperf_diff, timediff);
@@ -207,7 +207,7 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,
 	if (max_freq_mode == MAX_FREQ_TSC_REF) {
 		/* Calculate max_freq from TSC count */
 		tsc_diff = tsc_at_measure_end[cpu] - tsc_at_measure_start[cpu];
-		time_diff = timespec_diff_us(time_start, time_end);
+		time_diff = timespec_diff_us(time_start[cpu], time_end[cpu]);
 		max_frequency = tsc_diff / time_diff;
 	}
 
@@ -226,9 +226,8 @@ static int mperf_start(void)
 {
 	int cpu;
 
-	clock_gettime(CLOCK_REALTIME, &time_start);
-
 	for (cpu = 0; cpu < cpu_count; cpu++) {
+		clock_gettime(CLOCK_REALTIME, &time_start[cpu]);
 		mperf_get_tsc(&tsc_at_measure_start[cpu]);
 		mperf_init_stats(cpu);
 	}
@@ -243,9 +242,9 @@ static int mperf_stop(void)
 	for (cpu = 0; cpu < cpu_count; cpu++) {
 		mperf_measure_stats(cpu);
 		mperf_get_tsc(&tsc_at_measure_end[cpu]);
+		clock_gettime(CLOCK_REALTIME, &time_end[cpu]);
 	}
 
-	clock_gettime(CLOCK_REALTIME, &time_end);
 	return 0;
 }
 
@@ -349,6 +348,8 @@ struct cpuidle_monitor *mperf_register(void)
 	aperf_current_count = calloc(cpu_count, sizeof(unsigned long long));
 	tsc_at_measure_start = calloc(cpu_count, sizeof(unsigned long long));
 	tsc_at_measure_end = calloc(cpu_count, sizeof(unsigned long long));
+	time_start = calloc(cpu_count, sizeof(struct timespec));
+	time_end = calloc(cpu_count, sizeof(struct timespec));
 	mperf_monitor.name_len = strlen(mperf_monitor.name);
 	return &mperf_monitor;
 }
@@ -361,6 +362,8 @@ void mperf_unregister(void)
 	free(aperf_current_count);
 	free(tsc_at_measure_start);
 	free(tsc_at_measure_end);
+	free(time_start);
+	free(time_end);
 	free(is_valid);
 }
 
Signature · 1 line
2.39.5
author maintainer
#115 lore raw

PATCH 115/623 dt-bindings: mfd: bd71815: Fix rsense and typos

In reply to Greg Kroah-Hartman

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

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

From: Matti Vaittinen <[email protected]>

[ Upstream commit 6856edf7ead8c54803216a38a7b227bcb3dadff7 ]

The sense resistor used for measuring currents is typically some tens of milli Ohms. It has accidentally been documented to be tens of mega Ohms. Fix the size of this resistor and a few copy-paste errors while at it.

Drop the unsuitable 'rohm,charger-sense-resistor-ohms' property (which can't represent resistors smaller than one Ohm), and introduce a new 'rohm,charger-sense-resistor-micro-ohms' property with appropriate minimum, maximum and default values instead.

---
 .../bindings/mfd/rohm,bd71815-pmic.yaml       | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/mfd/rohm,bd71815-pmic.yaml +10 -10
index bb81307dc11b8..4fc78efaa5504 100644
@@ -50,15 +50,15 @@ properties:
     minimum: 0
     maximum: 1
 
-  rohm,charger-sense-resistor-ohms:
-    minimum: 10000000
-    maximum: 50000000
+  rohm,charger-sense-resistor-micro-ohms:
+    minimum: 10000
+    maximum: 50000
     description: |
-      BD71827 and BD71828 have SAR ADC for measuring charging currents.
-      External sense resistor (RSENSE in data sheet) should be used. If
-      something other but 30MOhm resistor is used the resistance value
-      should be given here in Ohms.
-    default: 30000000
+      BD71815 has SAR ADC for measuring charging currents. External sense
+      resistor (RSENSE in data sheet) should be used. If something other
+      but a 30 mOhm resistor is used the resistance value should be given
+      here in micro Ohms.
+    default: 30000
 
   regulators:
     $ref: /schemas/regulator/rohm,bd71815-regulator.yaml
@@ -67,7 +67,7 @@ properties:
 
   gpio-reserved-ranges:
     description: |
-      Usage of BD71828 GPIO pins can be changed via OTP. This property can be
+      Usage of BD71815 GPIO pins can be changed via OTP. This property can be
       used to mark the pins which should not be configured for GPIO. Please see
       the ../gpio/gpio.txt for more information.
 
@@ -113,7 +113,7 @@ examples:
             gpio-controller;
             #gpio-cells = <2>;
 
-            rohm,charger-sense-resistor-ohms = <10000000>;
+            rohm,charger-sense-resistor-micro-ohms = <10000>;
 
             regulators {
                 buck1: buck1 {
Signature · 1 line
2.39.5
author maintainer
#116 lore raw

PATCH 116/623 leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()

In reply to Greg Kroah-Hartman

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

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

From: Joe Hattori <[email protected]>

[ Upstream commit 0508316be63bb735f59bdc8fe4527cadb62210ca ]

netxbig_leds_get_of_pdata() does not release the OF node obtained by of_parse_phandle() when of_find_device_by_node() fails. Add an of_node_put() call to fix the leak.

This bug was found by an experimental static analysis tool that I am developing.

Fixes 9af512e81964 ("leds: netxbig: Convert to use GPIO descriptors")
---
 drivers/leds/leds-netxbig.c | 1 +
 1 file changed, 1 insertion(+)
drivers/leds/leds-netxbig.c +1 -0
index af5a908b8d9ed..e95287416ef87 100644
@@ -439,6 +439,7 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
 	}
 	gpio_ext_pdev = of_find_device_by_node(gpio_ext_np);
 	if (!gpio_ext_pdev) {
+		of_node_put(gpio_ext_np);
 		dev_err(dev, "Failed to find platform device for gpio-ext\n");
 		return -ENODEV;
 	}
Signature · 1 line
2.39.5
author maintainer
#117 lore raw

PATCH 117/623 inetpeer: remove create argument of inet_getpeer_v[46]()

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit 661cd8fc8e9039819ca0c22e0add52b632240a9e ]

All callers of inet_getpeer_v4() and inet_getpeer_v6() want to create an inetpeer.

Stable-dep-of: a853c609504e ("inetpeer: do not get a refcount in inet_getpeer()")

---
 include/net/inetpeer.h | 9 ++++-----
 net/ipv4/icmp.c        | 2 +-
 net/ipv4/ip_fragment.c | 2 +-
 net/ipv4/route.c       | 4 ++--
 net/ipv6/icmp.c        | 2 +-
 net/ipv6/ip6_output.c  | 2 +-
 net/ipv6/ndisc.c       | 2 +-
 7 files changed, 11 insertions(+), 12 deletions(-)
include/net/inetpeer.h +4 -5
index 74ff688568a0c..6f51f81d6cb19 100644
@@ -101,25 +101,24 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
 
 static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base,
 						__be32 v4daddr,
-						int vif, int create)
+						int vif)
 {
 	struct inetpeer_addr daddr;
 
 	daddr.a4.addr = v4daddr;
 	daddr.a4.vif = vif;
 	daddr.family = AF_INET;
-	return inet_getpeer(base, &daddr, create);
+	return inet_getpeer(base, &daddr, 1);
 }
 
 static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
-						const struct in6_addr *v6daddr,
-						int create)
+						const struct in6_addr *v6daddr)
 {
 	struct inetpeer_addr daddr;
 
 	daddr.a6 = *v6daddr;
 	daddr.family = AF_INET6;
-	return inet_getpeer(base, &daddr, create);
+	return inet_getpeer(base, &daddr, 1);
 }
 
 static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a,
net/ipv4/icmp.c +1 -1
index 963a89ae9c26e..5eeb9f569a706 100644
@@ -322,7 +322,7 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
 		goto out;
 
 	vif = l3mdev_master_ifindex(dst->dev);
-	peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif, 1);
+	peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif);
 	rc = inet_peer_xrlim_allow(peer,
 				   READ_ONCE(net->ipv4.sysctl_icmp_ratelimit));
 	if (peer)
net/ipv4/ip_fragment.c +1 -1
index 07036a2943c19..46e1171299f22 100644
@@ -89,7 +89,7 @@ static void ip4_frag_init(struct inet_frag_queue *q, const void *a)
 	q->key.v4 = *key;
 	qp->ecn = 0;
 	qp->peer = q->fqdir->max_dist ?
-		inet_getpeer_v4(net->ipv4.peers, key->saddr, key->vif, 1) :
+		inet_getpeer_v4(net->ipv4.peers, key->saddr, key->vif) :
 		NULL;
 }
 
net/ipv4/route.c +2 -2
index e1564b95fab09..00fdd6e965604 100644
@@ -873,7 +873,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)
 	rcu_read_unlock();
 
 	net = dev_net(rt->dst.dev);
-	peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr, vif, 1);
+	peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr, vif);
 	if (!peer) {
 		icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST,
 			  rt_nexthop(rt, ip_hdr(skb)->daddr));
@@ -976,7 +976,7 @@ static int ip_error(struct sk_buff *skb)
 	}
 
 	peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr,
-			       l3mdev_master_ifindex(skb->dev), 1);
+			       l3mdev_master_ifindex(skb->dev));
 
 	send = true;
 	if (peer) {
net/ipv6/icmp.c +1 -1
index 071b0bc1179d8..4593e3992c67b 100644
@@ -222,7 +222,7 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
 		if (rt->rt6i_dst.plen < 128)
 			tmo >>= ((128 - rt->rt6i_dst.plen)>>5);
 
-		peer = inet_getpeer_v6(net->ipv6.peers, &fl6->daddr, 1);
+		peer = inet_getpeer_v6(net->ipv6.peers, &fl6->daddr);
 		res = inet_peer_xrlim_allow(peer, tmo);
 		if (peer)
 			inet_putpeer(peer);
net/ipv6/ip6_output.c +1 -1
index f7b4608bb316e..c4cd959e0c876 100644
@@ -613,7 +613,7 @@ int ip6_forward(struct sk_buff *skb)
 		else
 			target = &hdr->daddr;
 
-		peer = inet_getpeer_v6(net->ipv6.peers, &hdr->daddr, 1);
+		peer = inet_getpeer_v6(net->ipv6.peers, &hdr->daddr);
 
 		/* Limit redirects both by destination (here)
 		   and by source (inside ndisc_send_redirect)
net/ipv6/ndisc.c +1 -1
index aba94a3486737..f113554d13325 100644
@@ -1731,7 +1731,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
 			  "Redirect: destination is not a neighbour\n");
 		goto release;
 	}
-	peer = inet_getpeer_v6(net->ipv6.peers, &ipv6_hdr(skb)->saddr, 1);
+	peer = inet_getpeer_v6(net->ipv6.peers, &ipv6_hdr(skb)->saddr);
 	ret = inet_peer_xrlim_allow(peer, 1*HZ);
 	if (peer)
 		inet_putpeer(peer);
Signature · 1 line
2.39.5
author maintainer
#118 lore raw

PATCH 118/623 inetpeer: remove create argument of inet_getpeer()

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit 7a596a50c4a4eab946aec149171c72321b4934aa ]

All callers of inet_getpeer() want to create an inetpeer.

Stable-dep-of: a853c609504e ("inetpeer: do not get a refcount in inet_getpeer()")

---
 include/net/inetpeer.h |  7 +++----
 net/ipv4/inetpeer.c    | 11 ++---------
 2 files changed, 5 insertions(+), 13 deletions(-)
include/net/inetpeer.h +3 -4
index 6f51f81d6cb19..f475757daafba 100644
@@ -96,8 +96,7 @@ static inline struct in6_addr *inetpeer_get_addr_v6(struct inetpeer_addr *iaddr)
 
 /* can be called with or without local BH being disabled */
 struct inet_peer *inet_getpeer(struct inet_peer_base *base,
-			       const struct inetpeer_addr *daddr,
-			       int create);
+			       const struct inetpeer_addr *daddr);
 
 static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base,
 						__be32 v4daddr,
@@ -108,7 +107,7 @@ static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base,
 	daddr.a4.addr = v4daddr;
 	daddr.a4.vif = vif;
 	daddr.family = AF_INET;
-	return inet_getpeer(base, &daddr, 1);
+	return inet_getpeer(base, &daddr);
 }
 
 static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
@@ -118,7 +117,7 @@ static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
 
 	daddr.a6 = *v6daddr;
 	daddr.family = AF_INET6;
-	return inet_getpeer(base, &daddr, 1);
+	return inet_getpeer(base, &daddr);
 }
 
 static inline int inetpeer_addr_cmp(const struct inetpeer_addr *a,
net/ipv4/inetpeer.c +2 -9
index 5ab56f4cb5297..bc79cc9d13ebb 100644
@@ -169,13 +169,11 @@ static void inet_peer_gc(struct inet_peer_base *base,
 }
 
 struct inet_peer *inet_getpeer(struct inet_peer_base *base,
-			       const struct inetpeer_addr *daddr,
-			       int create)
+			       const struct inetpeer_addr *daddr)
 {
 	struct inet_peer *p, *gc_stack[PEER_MAX_GC];
 	struct rb_node **pp, *parent;
 	unsigned int gc_cnt, seq;
-	int invalidated;
 
 	/* Attempt a lockless lookup first.
 	 * Because of a concurrent writer, we might not find an existing entry.
@@ -183,16 +181,11 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
 	rcu_read_lock();
 	seq = read_seqbegin(&base->lock);
 	p = lookup(daddr, base, seq, NULL, &gc_cnt, &parent, &pp);
-	invalidated = read_seqretry(&base->lock, seq);
 	rcu_read_unlock();
 
 	if (p)
 		return p;
 
-	/* If no writer did a change during our lookup, we can return early. */
-	if (!create && !invalidated)
-		return NULL;
-
 	/* retry an exact lookup, taking the lock before.
 	 * At least, nodes should be hot in our cache.
 	 */
@@ -201,7 +194,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
 
 	gc_cnt = 0;
 	p = lookup(daddr, base, seq, gc_stack, &gc_cnt, &parent, &pp);
-	if (!p && create) {
+	if (!p) {
 		p = kmem_cache_alloc(peer_cachep, GFP_ATOMIC);
 		if (p) {
 			p->daddr = *daddr;
Signature · 1 line
2.39.5
author maintainer
#119 lore raw

PATCH 119/623 inetpeer: update inetpeer timestamp in inet_getpeer()

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit 50b362f21d6c10b0f7939c1482c6a1b43da82f1a ]

inet_putpeer() will be removed in the following patch, because we will no longer use refcounts.

Update inetpeer timestamp (p->dtime) at lookup time.

Stable-dep-of: a853c609504e ("inetpeer: do not get a refcount in inet_getpeer()")

---
 net/ipv4/inetpeer.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
net/ipv4/inetpeer.c +4 -8
index bc79cc9d13ebb..28c3ae5bc4a0b 100644
@@ -95,6 +95,7 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
 {
 	struct rb_node **pp, *parent, *next;
 	struct inet_peer *p;
+	u32 now;
 
 	pp = &base->rb_root.rb_node;
 	parent = NULL;
@@ -110,6 +111,9 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
 		if (cmp == 0) {
 			if (!refcount_inc_not_zero(&p->refcnt))
 				break;
+			now = jiffies;
+			if (READ_ONCE(p->dtime) != now)
+				WRITE_ONCE(p->dtime, now);
 			return p;
 		}
 		if (gc_stack) {
@@ -150,9 +154,6 @@ static void inet_peer_gc(struct inet_peer_base *base,
 	for (i = 0; i < gc_cnt; i++) {
 		p = gc_stack[i];
 
-		/* The READ_ONCE() pairs with the WRITE_ONCE()
-		 * in inet_putpeer()
-		 */
 		delta = (__u32)jiffies - READ_ONCE(p->dtime);
 
 		if (delta < ttl || !refcount_dec_if_one(&p->refcnt))
@@ -224,11 +225,6 @@ EXPORT_SYMBOL_GPL(inet_getpeer);
 
 void inet_putpeer(struct inet_peer *p)
 {
-	/* The WRITE_ONCE() pairs with itself (we run lockless)
-	 * and the READ_ONCE() in inet_peer_gc()
-	 */
-	WRITE_ONCE(p->dtime, (__u32)jiffies);
-
 	if (refcount_dec_and_test(&p->refcnt))
 		kfree_rcu(p, rcu);
 }
Signature · 1 line
2.39.5
author maintainer
#105 lore raw

PATCH 105/623 wifi: rtlwifi: destroy workqueue at rtl_deinit_core

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit d8ece6fc3694657e4886191b32ca1690af11adda ]

rtl_wq is allocated at rtl_init_core, so it makes more sense to destroy it at rtl_deinit_core. In the case of USB, where _rtl_usb_init does not require anything to be undone, that is fine. But for PCI, rtl_pci_init, which is called after rtl_init_core, needs to deallocate data, but only if it has been called.

That means that destroying the workqueue needs to be done whether rtl_pci_init has been called or not. And since rtl_pci_deinit was doing it, it has to be moved out of there.

It makes more sense to move it to rtl_deinit_core and have it done in both cases, USB and PCI.

Since this is a requirement for a followup memory leak fix, mark this as fixing such memory leak.

---
 drivers/net/wireless/realtek/rtlwifi/base.c | 6 ++++++
 drivers/net/wireless/realtek/rtlwifi/pci.c  | 2 --
 drivers/net/wireless/realtek/rtlwifi/usb.c  | 5 -----
 3 files changed, 6 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtlwifi/base.c +6 -0
index fd28c7a722d89..ff61867d142fa 100644
@@ -575,9 +575,15 @@ static void rtl_free_entries_from_ack_queue(struct ieee80211_hw *hw,
 
 void rtl_deinit_core(struct ieee80211_hw *hw)
 {
+	struct rtl_priv *rtlpriv = rtl_priv(hw);
+
 	rtl_c2hcmd_launcher(hw, 0);
 	rtl_free_entries_from_scan_list(hw);
 	rtl_free_entries_from_ack_queue(hw, false);
+	if (rtlpriv->works.rtl_wq) {
+		destroy_workqueue(rtlpriv->works.rtl_wq);
+		rtlpriv->works.rtl_wq = NULL;
+	}
 }
 EXPORT_SYMBOL_GPL(rtl_deinit_core);
 
drivers/net/wireless/realtek/rtlwifi/pci.c +0 -2
index 4388066eb9e27..e60ac910e750b 100644
@@ -1656,8 +1656,6 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)
 	synchronize_irq(rtlpci->pdev->irq);
 	tasklet_kill(&rtlpriv->works.irq_tasklet);
 	cancel_work_sync(&rtlpriv->works.lps_change_work);
-
-	destroy_workqueue(rtlpriv->works.rtl_wq);
 }
 
 static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
drivers/net/wireless/realtek/rtlwifi/usb.c +0 -5
index 0368ecea2e817..f5718e570011e 100644
@@ -629,11 +629,6 @@ static void _rtl_usb_cleanup_rx(struct ieee80211_hw *hw)
 	tasklet_kill(&rtlusb->rx_work_tasklet);
 	cancel_work_sync(&rtlpriv->works.lps_change_work);
 
-	if (rtlpriv->works.rtl_wq) {
-		destroy_workqueue(rtlpriv->works.rtl_wq);
-		rtlpriv->works.rtl_wq = NULL;
-	}
-
 	skb_queue_purge(&rtlusb->rx_queue);
 
 	while ((urb = usb_get_from_anchor(&rtlusb->rx_cleanup_urbs))) {
Signature · 1 line
2.39.5
author maintainer
#120 lore raw

PATCH 120/623 inetpeer: do not get a refcount in inet_getpeer()

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit a853c609504e2d1d83e71285e3622fda1f1451d8 ]

All inet_getpeer() callers except ip4_frag_init() don't need to acquire a permanent refcount on the inetpeer.

They can switch to full RCU protection.

Move the refcount_inc_not_zero() into ip4_frag_init(), so that all the other callers no longer have to perform a pair of expensive atomic operations on a possibly contended cache line.

inet_putpeer() no longer needs to be exported.

After this patch, my DUT can receive 8,400,000 UDP packets per second targeting closed ports, using 50% less cpu cycles than before.

Also change two calls to l3mdev_master_ifindex() by l3mdev_master_ifindex_rcu() (Ido ideas)

Fixes 8c2bd38b95f7 ("icmp: change the order of rate limits")
---
 net/ipv4/icmp.c        |  9 ++++-----
 net/ipv4/inetpeer.c    |  8 ++------
 net/ipv4/ip_fragment.c | 15 ++++++++++-----
 net/ipv4/route.c       | 15 ++++++++-------
 net/ipv6/icmp.c        |  4 ++--
 net/ipv6/ip6_output.c  |  4 ++--
 net/ipv6/ndisc.c       |  6 ++++--
 7 files changed, 32 insertions(+), 29 deletions(-)
net/ipv4/icmp.c +4 -5
index 5eeb9f569a706..094084b61bff8 100644
@@ -312,7 +312,6 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
 	struct dst_entry *dst = &rt->dst;
 	struct inet_peer *peer;
 	bool rc = true;
-	int vif;
 
 	if (!apply_ratelimit)
 		return true;
@@ -321,12 +320,12 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
 	if (dst->dev && (dst->dev->flags&IFF_LOOPBACK))
 		goto out;
 
-	vif = l3mdev_master_ifindex(dst->dev);
-	peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif);
+	rcu_read_lock();
+	peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr,
+			       l3mdev_master_ifindex_rcu(dst->dev));
 	rc = inet_peer_xrlim_allow(peer,
 				   READ_ONCE(net->ipv4.sysctl_icmp_ratelimit));
-	if (peer)
-		inet_putpeer(peer);
+	rcu_read_unlock();
 out:
 	if (!rc)
 		__ICMP_INC_STATS(net, ICMP_MIB_RATELIMITHOST);
net/ipv4/inetpeer.c +2 -6
index 28c3ae5bc4a0b..e02484f4d22b8 100644
@@ -109,8 +109,6 @@ static struct inet_peer *lookup(const struct inetpeer_addr *daddr,
 		p = rb_entry(parent, struct inet_peer, rb_node);
 		cmp = inetpeer_addr_cmp(daddr, &p->daddr);
 		if (cmp == 0) {
-			if (!refcount_inc_not_zero(&p->refcnt))
-				break;
 			now = jiffies;
 			if (READ_ONCE(p->dtime) != now)
 				WRITE_ONCE(p->dtime, now);
@@ -169,6 +167,7 @@ static void inet_peer_gc(struct inet_peer_base *base,
 	}
 }
 
+/* Must be called under RCU : No refcount change is done here. */
 struct inet_peer *inet_getpeer(struct inet_peer_base *base,
 			       const struct inetpeer_addr *daddr)
 {
@@ -179,10 +178,8 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
 	/* Attempt a lockless lookup first.
 	 * Because of a concurrent writer, we might not find an existing entry.
 	 */
-	rcu_read_lock();
 	seq = read_seqbegin(&base->lock);
 	p = lookup(daddr, base, seq, NULL, &gc_cnt, &parent, &pp);
-	rcu_read_unlock();
 
 	if (p)
 		return p;
@@ -200,7 +197,7 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
 		if (p) {
 			p->daddr = *daddr;
 			p->dtime = (__u32)jiffies;
-			refcount_set(&p->refcnt, 2);
+			refcount_set(&p->refcnt, 1);
 			atomic_set(&p->rid, 0);
 			p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
 			p->rate_tokens = 0;
@@ -228,7 +225,6 @@ void inet_putpeer(struct inet_peer *p)
 	if (refcount_dec_and_test(&p->refcnt))
 		kfree_rcu(p, rcu);
 }
-EXPORT_SYMBOL_GPL(inet_putpeer);
 
 /*
  *	Check transmit rate limitation for given message.
net/ipv4/ip_fragment.c +10 -5
index 46e1171299f22..7a435746a22de 100644
@@ -82,15 +82,20 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *skb,
 static void ip4_frag_init(struct inet_frag_queue *q, const void *a)
 {
 	struct ipq *qp = container_of(q, struct ipq, q);
-	struct net *net = q->fqdir->net;
-
 	const struct frag_v4_compare_key *key = a;
+	struct net *net = q->fqdir->net;
+	struct inet_peer *p = NULL;
 
 	q->key.v4 = *key;
 	qp->ecn = 0;
-	qp->peer = q->fqdir->max_dist ?
-		inet_getpeer_v4(net->ipv4.peers, key->saddr, key->vif) :
-		NULL;
+	if (q->fqdir->max_dist) {
+		rcu_read_lock();
+		p = inet_getpeer_v4(net->ipv4.peers, key->saddr, key->vif);
+		if (p && !refcount_inc_not_zero(&p->refcnt))
+			p = NULL;
+		rcu_read_unlock();
+	}
+	qp->peer = p;
 }
 
 static void ip4_frag_free(struct inet_frag_queue *q)
net/ipv4/route.c +8 -7
index 00fdd6e965604..3a1467f2d553f 100644
@@ -870,11 +870,11 @@ void ip_rt_send_redirect(struct sk_buff *skb)
 	}
 	log_martians = IN_DEV_LOG_MARTIANS(in_dev);
 	vif = l3mdev_master_ifindex_rcu(rt->dst.dev);
-	rcu_read_unlock();
 
 	net = dev_net(rt->dst.dev);
 	peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr, vif);
 	if (!peer) {
+		rcu_read_unlock();
 		icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST,
 			  rt_nexthop(rt, ip_hdr(skb)->daddr));
 		return;
@@ -893,7 +893,7 @@ void ip_rt_send_redirect(struct sk_buff *skb)
 	 */
 	if (peer->n_redirects >= ip_rt_redirect_number) {
 		peer->rate_last = jiffies;
-		goto out_put_peer;
+		goto out_unlock;
 	}
 
 	/* Check for load limit; set rate_last to the latest sent
@@ -914,8 +914,8 @@ void ip_rt_send_redirect(struct sk_buff *skb)
 					     &ip_hdr(skb)->saddr, inet_iif(skb),
 					     &ip_hdr(skb)->daddr, &gw);
 	}
-out_put_peer:
-	inet_putpeer(peer);
+out_unlock:
+	rcu_read_unlock();
 }
 
 static int ip_error(struct sk_buff *skb)
@@ -975,9 +975,9 @@ static int ip_error(struct sk_buff *skb)
 		break;
 	}
 
+	rcu_read_lock();
 	peer = inet_getpeer_v4(net->ipv4.peers, ip_hdr(skb)->saddr,
-			       l3mdev_master_ifindex(skb->dev));
-
+			       l3mdev_master_ifindex_rcu(skb->dev));
 	send = true;
 	if (peer) {
 		now = jiffies;
@@ -989,8 +989,9 @@ static int ip_error(struct sk_buff *skb)
 			peer->rate_tokens -= ip_rt_error_cost;
 		else
 			send = false;
-		inet_putpeer(peer);
 	}
+	rcu_read_unlock();
+
 	if (send)
 		icmp_send(skb, ICMP_DEST_UNREACH, code, 0);
 
net/ipv6/icmp.c +2 -2
index 4593e3992c67b..a6984a29fdb9d 100644
@@ -222,10 +222,10 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
 		if (rt->rt6i_dst.plen < 128)
 			tmo >>= ((128 - rt->rt6i_dst.plen)>>5);
 
+		rcu_read_lock();
 		peer = inet_getpeer_v6(net->ipv6.peers, &fl6->daddr);
 		res = inet_peer_xrlim_allow(peer, tmo);
-		if (peer)
-			inet_putpeer(peer);
+		rcu_read_unlock();
 	}
 	if (!res)
 		__ICMP6_INC_STATS(net, ip6_dst_idev(dst),
net/ipv6/ip6_output.c +2 -2
index c4cd959e0c876..5a364b3521153 100644
@@ -613,6 +613,7 @@ int ip6_forward(struct sk_buff *skb)
 		else
 			target = &hdr->daddr;
 
+		rcu_read_lock();
 		peer = inet_getpeer_v6(net->ipv6.peers, &hdr->daddr);
 
 		/* Limit redirects both by destination (here)
@@ -620,8 +621,7 @@ int ip6_forward(struct sk_buff *skb)
 		 */
 		if (inet_peer_xrlim_allow(peer, 1*HZ))
 			ndisc_send_redirect(skb, target);
-		if (peer)
-			inet_putpeer(peer);
+		rcu_read_unlock();
 	} else {
 		int addrtype = ipv6_addr_type(&hdr->saddr);
 
net/ipv6/ndisc.c +4 -2
index f113554d13325..d044c67019de6 100644
@@ -1731,10 +1731,12 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
 			  "Redirect: destination is not a neighbour\n");
 		goto release;
 	}
+
+	rcu_read_lock();
 	peer = inet_getpeer_v6(net->ipv6.peers, &ipv6_hdr(skb)->saddr);
 	ret = inet_peer_xrlim_allow(peer, 1*HZ);
-	if (peer)
-		inet_putpeer(peer);
+	rcu_read_unlock();
+
 	if (!ret)
 		goto release;
 
Signature · 1 line
2.39.5
author maintainer
#121 lore raw

PATCH 121/623 pwm: stm32-lp: Add check for clk_enable()

In reply to Greg Kroah-Hartman

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

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

From: Mingwei Zheng <[email protected]>

[ Upstream commit cce16e7f6216227964cda25f5f23634bce2c500f ]

Add check for the return value of clk_enable() to catch the potential error.
We used APP-Miner to find it.

---
 drivers/pwm/pwm-stm32-lp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/pwm/pwm-stm32-lp.c +6 -2
index 989731256f503..5832dce8ed9d5 100644
@@ -167,8 +167,12 @@ static int stm32_pwm_lp_get_state(struct pwm_chip *chip,
 	regmap_read(priv->regmap, STM32_LPTIM_CR, &val);
 	state->enabled = !!FIELD_GET(STM32_LPTIM_ENABLE, val);
 	/* Keep PWM counter clock refcount in sync with PWM initial state */
-	if (state->enabled)
-		clk_enable(priv->clk);
+	if (state->enabled) {
+		int ret = clk_enable(priv->clk);
+
+		if (ret)
+			return ret;
+	}
 
 	regmap_read(priv->regmap, STM32_LPTIM_CFGR, &val);
 	presc = FIELD_GET(STM32_LPTIM_PRESC, val);
Signature · 1 line
2.39.5
author maintainer
#122 lore raw

PATCH 122/623 cpufreq: schedutil: Fix superfluous updates caused by need_freq_update

In reply to Greg Kroah-Hartman

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

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

From: Sultan Alsawaf (unemployed) <[email protected]>

[ Upstream commit 8e461a1cb43d69d2fc8a97e61916dce571e6bb31 ]

A redundant frequency update is only truly needed when there is a policy limits change with a driver that specifies CPUFREQ_NEED_UPDATE_LIMITS.

In spite of that, drivers specifying CPUFREQ_NEED_UPDATE_LIMITS receive a frequency update _all the time_, not just for a policy limits change, because need_freq_update is never cleared.

Furthermore, ignore_dl_rate_limit()'s usage of need_freq_update also leads to a redundant frequency update, regardless of whether or not the driver specifies CPUFREQ_NEED_UPDATE_LIMITS, when the next chosen frequency is the same as the current one.

Fix the superfluous updates by only honoring CPUFREQ_NEED_UPDATE_LIMITS when there's a policy limits change, and clearing need_freq_update when a requisite redundant update occurs.

This is neatly achieved by moving up the CPUFREQ_NEED_UPDATE_LIMITS test and instead setting need_freq_update to false in sugov_update_next_freq().

Fixes 600f5badb78c ("cpufreq: schedutil: Don't skip freq update when limits change")
---
 kernel/sched/cpufreq_schedutil.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/cpufreq_schedutil.c +2 -2
index 28c77904ea749..e51d5ce730be1 100644
@@ -83,7 +83,7 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
 
 	if (unlikely(sg_policy->limits_changed)) {
 		sg_policy->limits_changed = false;
-		sg_policy->need_freq_update = true;
+		sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS);
 		return true;
 	}
 
@@ -96,7 +96,7 @@ static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
 				   unsigned int next_freq)
 {
 	if (sg_policy->need_freq_update)
-		sg_policy->need_freq_update = cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS);
+		sg_policy->need_freq_update = false;
 	else if (sg_policy->next_freq == next_freq)
 		return false;
 
Signature · 1 line
2.39.5
author maintainer
#123 lore raw

PATCH 123/623 selftests: ktap_helpers: Fix uninitialized variable

In reply to Greg Kroah-Hartman

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

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

From: Mickaël Salaün <[email protected]>

[ Upstream commit 3e707b07f582c12ed78fa5516a97bf701bf0634c ]

__ktap_test() may be called without the optional third argument which is an issue for scripts using set -u to detect uninitialized variables and potential bugs.

Fix this optional "directive" argument by either using the third argument or an empty string.

This is required for the next commit to properly test script execution control.

Cc Kees Cook <[email protected]>
Cc Nícolas F. R. A. Prado <[email protected]>
Cc Shuah Khan <[email protected]>
Fixes 14571ab1ad21 ("kselftest: Add new test for detecting unprobed Devicetree devices")
---
 tools/testing/selftests/kselftest/ktap_helpers.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kselftest/ktap_helpers.sh +1 -1
index 79a125eb24c2e..14e7f3ec3f84c 100644
@@ -40,7 +40,7 @@ ktap_skip_all() {
 __ktap_test() {
 	result="$1"
 	description="$2"
-	directive="$3" # optional
+	directive="${3:-}" # optional
 
 	local directive_str=
 	[ ! -z "$directive" ] && directive_str="# $directive"
Signature · 1 line
2.39.5
author maintainer
#124 lore raw

PATCH 124/623 ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple()

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit a126061c80d5efb4baef4bcf346094139cd81df6 ]

Jakub added a lockdep_assert_no_hardirq() check in __page_pool_put_page() to increase test coverage.

syzbot found a splat caused by hard irq blocking in ptr_ring_resize_multiple() [1]

As current users of ptr_ring_resize_multiple() do not require hard irqs being masked, replace it to only block BH.

Rename helpers to better reflect they are safe against BH only.

- ptr_ring_resize_multiple() to ptr_ring_resize_multiple_bh()
- skb_array_resize_multiple() to skb_array_resize_multiple_bh()

[1]

WARNING: CPU: 1 PID: 9150 at net/core/page_pool.c:709 __page_pool_put_page net/core/page_pool.c:709 [inline]
WARNING: CPU: 1 PID: 9150 at net/core/page_pool.c:709 page_pool_put_unrefed_netmem+0x157/0xa40 net/core/page_pool.c:780
Modules linked in:
CPU: 1 UID: 0 PID: 9150 Comm: syz.1.1052 Not tainted 6.11.0-rc3-syzkaller-00202-gf8669d7b5f5d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:__page_pool_put_page net/core/page_pool.c:709 [inline]
RIP: 0010:page_pool_put_unrefed_netmem+0x157/0xa40 net/core/page_pool.c:780
Code: 74 0e e8 7c aa fb f7 eb 43 e8 75 aa fb f7 eb 3c 65 8b 1d 38 a8 6a 76 31 ff 89 de e8 a3 ae fb f7 85 db 74 0b e8 5a aa fb f7 90 <0f> 0b 90 eb 1d 65 8b 1d 15 a8 6a 76 31 ff 89 de e8 84 ae fb f7 85
RSP: 0018:ffffc9000bda6b58 EFLAGS: 00010083
RAX: ffffffff8997e523 RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffffc9000fbd0000 RSI: 0000000000001842 RDI: 0000000000001843
RBP: 0000000000000000 R08: ffffffff8997df2c R09: 1ffffd40003a000d
R10: dffffc0000000000 R11: fffff940003a000e R12: ffffea0001d00040
R13: ffff88802e8a4000 R14: dffffc0000000000 R15: 00000000ffffffff
FS:  00007fb7aaf716c0(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa15a0d4b72 CR3: 00000000561b0000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tun_ptr_free drivers/net/tun.c:617 [inline]
 __ptr_ring_swap_queue include/linux/ptr_ring.h:571 [inline]
 ptr_ring_resize_multiple_noprof include/linux/ptr_ring.h:643 [inline]
 tun_queue_resize drivers/net/tun.c:3694 [inline]
 tun_device_event+0xaaf/0x1080 drivers/net/tun.c:3714
 notifier_call_chain+0x19f/0x3e0 kernel/notifier.c:93
 call_netdevice_notifiers_extack net/core/dev.c:2032 [inline]
 call_netdevice_notifiers net/core/dev.c:2046 [inline]
 dev_change_tx_queue_len+0x158/0x2a0 net/core/dev.c:9024
 do_setlink+0xff6/0x41f0 net/core/rtnetlink.c:2923
 rtnl_setlink+0x40d/0x5a0 net/core/rtnetlink.c:3201
 rtnetlink_rcv_msg+0x73f/0xcf0 net/core/rtnetlink.c:6647
 netlink_rcv_skb+0x1e3/0x430 net/netlink/af_netlink.c:2550
---
 drivers/net/tap.c         |  6 +++---
 drivers/net/tun.c         |  6 +++---
 include/linux/ptr_ring.h  | 21 ++++++++++-----------
 include/linux/skb_array.h | 17 +++++++++--------
 net/sched/sch_generic.c   |  4 ++--
 5 files changed, 27 insertions(+), 27 deletions(-)
drivers/net/tap.c +3 -3
index 5aa41d5f7765a..5ca6ecf0ce5fb 100644
@@ -1329,9 +1329,9 @@ int tap_queue_resize(struct tap_dev *tap)
 	list_for_each_entry(q, &tap->queue_list, next)
 		rings[i++] = &q->ring;
 
-	ret = ptr_ring_resize_multiple(rings, n,
-				       dev->tx_queue_len, GFP_KERNEL,
-				       __skb_array_destroy_skb);
+	ret = ptr_ring_resize_multiple_bh(rings, n,
+					  dev->tx_queue_len, GFP_KERNEL,
+					  __skb_array_destroy_skb);
 
 	kfree(rings);
 	return ret;
drivers/net/tun.c +3 -3
index e816aaba8e5f2..148c7bc66c0af 100644
@@ -3697,9 +3697,9 @@ static int tun_queue_resize(struct tun_struct *tun)
 	list_for_each_entry(tfile, &tun->disabled, next)
 		rings[i++] = &tfile->tx_ring;
 
-	ret = ptr_ring_resize_multiple(rings, n,
-				       dev->tx_queue_len, GFP_KERNEL,
-				       tun_ptr_free);
+	ret = ptr_ring_resize_multiple_bh(rings, n,
+					  dev->tx_queue_len, GFP_KERNEL,
+					  tun_ptr_free);
 
 	kfree(rings);
 	return ret;
include/linux/ptr_ring.h +10 -11
index fd037c127bb07..551329220e4f3 100644
@@ -615,15 +615,14 @@ static inline int ptr_ring_resize_noprof(struct ptr_ring *r, int size, gfp_t gfp
 /*
  * Note: producer lock is nested within consumer lock, so if you
  * resize you must make sure all uses nest correctly.
- * In particular if you consume ring in interrupt or BH context, you must
- * disable interrupts/BH when doing so.
+ * In particular if you consume ring in BH context, you must
+ * disable BH when doing so.
  */
-static inline int ptr_ring_resize_multiple_noprof(struct ptr_ring **rings,
-						  unsigned int nrings,
-						  int size,
-						  gfp_t gfp, void (*destroy)(void *))
+static inline int ptr_ring_resize_multiple_bh_noprof(struct ptr_ring **rings,
+						     unsigned int nrings,
+						     int size, gfp_t gfp,
+						     void (*destroy)(void *))
 {
-	unsigned long flags;
 	void ***queues;
 	int i;
 
@@ -638,12 +637,12 @@ static inline int ptr_ring_resize_multiple_noprof(struct ptr_ring **rings,
 	}
 
 	for (i = 0; i < nrings; ++i) {
-		spin_lock_irqsave(&(rings[i])->consumer_lock, flags);
+		spin_lock_bh(&(rings[i])->consumer_lock);
 		spin_lock(&(rings[i])->producer_lock);
 		queues[i] = __ptr_ring_swap_queue(rings[i], queues[i],
 						  size, gfp, destroy);
 		spin_unlock(&(rings[i])->producer_lock);
-		spin_unlock_irqrestore(&(rings[i])->consumer_lock, flags);
+		spin_unlock_bh(&(rings[i])->consumer_lock);
 	}
 
 	for (i = 0; i < nrings; ++i)
@@ -662,8 +661,8 @@ static inline int ptr_ring_resize_multiple_noprof(struct ptr_ring **rings,
 noqueues:
 	return -ENOMEM;
 }
-#define ptr_ring_resize_multiple(...) \
-		alloc_hooks(ptr_ring_resize_multiple_noprof(__VA_ARGS__))
+#define ptr_ring_resize_multiple_bh(...) \
+		alloc_hooks(ptr_ring_resize_multiple_bh_noprof(__VA_ARGS__))
 
 static inline void ptr_ring_cleanup(struct ptr_ring *r, void (*destroy)(void *))
 {
include/linux/skb_array.h +9 -8
index 926496c9cc9c3..bf178238a3083 100644
@@ -199,17 +199,18 @@ static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp)
 	return ptr_ring_resize(&a->ring, size, gfp, __skb_array_destroy_skb);
 }
 
-static inline int skb_array_resize_multiple_noprof(struct skb_array **rings,
-						   int nrings, unsigned int size,
-						   gfp_t gfp)
+static inline int skb_array_resize_multiple_bh_noprof(struct skb_array **rings,
+						      int nrings,
+						      unsigned int size,
+						      gfp_t gfp)
 {
 	BUILD_BUG_ON(offsetof(struct skb_array, ring));
-	return ptr_ring_resize_multiple_noprof((struct ptr_ring **)rings,
-					       nrings, size, gfp,
-					       __skb_array_destroy_skb);
+	return ptr_ring_resize_multiple_bh_noprof((struct ptr_ring **)rings,
+					          nrings, size, gfp,
+					          __skb_array_destroy_skb);
 }
-#define skb_array_resize_multiple(...)	\
-		alloc_hooks(skb_array_resize_multiple_noprof(__VA_ARGS__))
+#define skb_array_resize_multiple_bh(...)	\
+		alloc_hooks(skb_array_resize_multiple_bh_noprof(__VA_ARGS__))
 
 static inline void skb_array_cleanup(struct skb_array *a)
 {
net/sched/sch_generic.c +2 -2
index 38ec18f73de43..8874ae6680952 100644
@@ -911,8 +911,8 @@ static int pfifo_fast_change_tx_queue_len(struct Qdisc *sch,
 		bands[prio] = q;
 	}
 
-	return skb_array_resize_multiple(bands, PFIFO_FAST_BANDS, new_len,
-					 GFP_KERNEL);
+	return skb_array_resize_multiple_bh(bands, PFIFO_FAST_BANDS, new_len,
+					    GFP_KERNEL);
 }
 
 struct Qdisc_ops pfifo_fast_ops __read_mostly = {
Signature · 1 line
2.39.5
author maintainer
#106 lore raw

PATCH 106/623 wifi: rtlwifi: fix memory leaks and invalid access at probe error path

In reply to Greg Kroah-Hartman

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

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

From: Thadeu Lima de Souza Cascardo <[email protected]>

[ Upstream commit e7ceefbfd8d447abc8aca8ab993a942803522c06 ]

Deinitialize at reverse order when probe fails.

When init_sw_vars fails, rtl_deinit_core should not be called, specially now that it destroys the rtl_wq workqueue.

And call rtl_pci_deinit and deinit_sw_vars, otherwise, memory will be leaked.

Remove pci_set_drvdata call as it will already be cleaned up by the core driver code and could lead to memory leaks too. cf. commit 8d450935ae7f ("wireless: rtlwifi: remove unnecessary pci_set_drvdata()") and commit 3d86b93064c7 ("rtlwifi: Fix PCI probe error path orphaned memory").

---
 drivers/net/wireless/realtek/rtlwifi/pci.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +8 -5
index e60ac910e750b..a870117cf12af 100644
@@ -2165,7 +2165,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
 		pr_err("Can't init_sw_vars\n");
 		err = -ENODEV;
-		goto fail3;
+		goto fail2;
 	}
 	rtl_init_sw_leds(hw);
 
@@ -2183,14 +2183,14 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	err = rtl_pci_init(hw, pdev);
 	if (err) {
 		pr_err("Failed to init PCI\n");
-		goto fail3;
+		goto fail4;
 	}
 
 	err = ieee80211_register_hw(hw);
 	if (err) {
 		pr_err("Can't register mac80211 hw.\n");
 		err = -ENODEV;
-		goto fail3;
+		goto fail5;
 	}
 	rtlpriv->mac80211.mac80211_registered = 1;
 
@@ -2213,9 +2213,12 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
 	return 0;
 
-fail3:
-	pci_set_drvdata(pdev, NULL);
+fail5:
+	rtl_pci_deinit(hw);
+fail4:
 	rtl_deinit_core(hw);
+fail3:
+	rtlpriv->cfg->ops->deinit_sw_vars(hw);
 
 fail2:
 	if (rtlpriv->io.pci_mem_start != 0)
Signature · 1 line
2.39.5
author maintainer
#102 lore raw

PATCH 102/623 clk: fix an OF node reference leak in of_clk_get_parent_name()

In reply to Greg Kroah-Hartman

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

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

From: Joe Hattori <[email protected]>

[ Upstream commit 28fa3291cad1c201967ef93edc6e7f8ccc9afbc0 ]

Current implementation of of_clk_get_parent_name() leaks an OF node reference on error path. Add a of_node_put() call before returning an error.

This bug was found by an experimental static analysis tool that I am developing.

Fixes 8da411cc1964 ("clk: let of_clk_get_parent_name() fail for invalid clock-indices")
---
 drivers/clk/clk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/clk.c +3 -1
index 9b45fa005030f..cf7720b9172ff 100644
@@ -5385,8 +5385,10 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index)
 		count++;
 	}
 	/* We went off the end of 'clock-indices' without finding it */
-	if (of_property_present(clkspec.np, "clock-indices") && !found)
+	if (of_property_present(clkspec.np, "clock-indices") && !found) {
+		of_node_put(clkspec.np);
 		return NULL;
+	}
 
 	if (of_property_read_string_index(clkspec.np, "clock-output-names",
 					  index,
Signature · 1 line
2.39.5