Skip to contentSkip to conversation

6.12.13-rc1 review

PATCH In review Greg Kroah-Hartman 12 participants 605 messages Feb 5, 2025 – Feb 6, 2025 Page 1 of 5

Subsystems (6)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover 6.12.13-rc1 review

This is the start of the stable review cycle for the 6.12.13 release. There are 590 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:43:01 +0000. Anything received after that time might be too late.

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

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

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

thanks,

greg k-h

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

Greg Kroah-Hartman <[email protected]>

    Linux 6.12.13-rc1

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

Tiezhu Yang <[email protected]>

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

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

Leon Hwang <[email protected]>
selftests/bpf: Add test to verify tailcall and freplace restrictions

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

Adam Ford <[email protected]>
phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings

Gal Pressman <[email protected]>
ethtool: Fix access to uninitialized fields in set RXNFC command

Steffen Klassert <[email protected]>
xfrm: Fix acquire state insertion.

Everest K.C <[email protected]>
xfrm: Add error handling when nla_put_u32() returns an error

Geert Uytterhoeven <[email protected]>
dma-mapping: save base/size instead of pointer to shared DMA pool

Zijun Hu <[email protected]>
of: reserved-memory: Warn for missing static reserved memory regions

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

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

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

Wayne Lin <[email protected]>
drm/amd/display: Reduce accessing remote DPCD overhead

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

Parth Pancholi <[email protected]>
kbuild: switch from lz4c to lz4 for compression

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

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/uring_cmd: use cached cmd_op in io_uring_cmd_sock()

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

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

Patryk Wlazlyn <[email protected]>
tools/power turbostat: Allow using cpu device in perf counters on hybrid platforms

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()

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

Edward Cree <[email protected]>
net: ethtool: only allow set_rxnfc with rss + ring_cookie if driver opts in

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

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]>
tools: ynl: c: correct reverse decode of empty attrs

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

Mateusz Polchlopek <[email protected]>
ice: extend dump serdes equalizer values feature

Mateusz Polchlopek <[email protected]>
ice: rework of dump serdes equalizer values feature

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

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

Adam Ford <[email protected]>
phy: freescale: fsl-samsung-hdmi: Support dynamic integer

Adam Ford <[email protected]>
phy: freescale: fsl-samsung-hdmi: Simplify REG21_PMS_S_MASK lookup

Adam Ford <[email protected]>
phy: freescale: fsl-samsung-hdmi: Replace register defines with macro

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

Steffen Klassert <[email protected]>
xfrm: Add an inbound percpu state cache.

Steffen Klassert <[email protected]>
xfrm: Cache used outbound xfrm states at the policy.

Steffen Klassert <[email protected]>
xfrm: Add support for per cpu xfrm state handling.

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().

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()

Gao Xiang <[email protected]>
erofs: sunset struct erofs_workgroup

Gao Xiang <[email protected]>
erofs: move erofs_workgroup operations into zdata.c

Gao Xiang <[email protected]>
erofs: get rid of erofs_{find,insert}_workgroup

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

Conor Dooley <[email protected]>
PCI: microchip: Add support for using either Root Port 1 or 2

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

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

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

Oreoluwa Babatunde <[email protected]>
of: reserved_mem: Restructure how the reserved memory regions are processed

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

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

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

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

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

Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sc7180: change labels to lower-case

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

Bryan O'Donoghue <[email protected]>
arm64: dts: qcom: sdm845-db845c-navigation-mezzanine: Convert mezzanine riser to dtso

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

Vasily Khoruzhick <[email protected]>
arm64: dts: allwinner: a64: explicitly assign clock parent for TCON0

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

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: 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

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

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

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

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

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

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'

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()

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()

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

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

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: 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

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

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

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

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

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

Zong-Zhe Yang <[email protected]>
wifi: rtw89: tweak setting of channel and TX power for MLO

Zong-Zhe Yang <[email protected]>
wifi: rtw89: chan: manage active interfaces

Zong-Zhe Yang <[email protected]>
wifi: rtw89: handle entity active flag per PHY

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

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

Vasily Khoruzhick <[email protected]>
clk: sunxi-ng: a64: drop redundant CLK_PLL_VIDEO0_2X and CLK_PLL_MIPI

Vasily Khoruzhick <[email protected]>
dt-bindings: clock: sunxi: Export PLL_VIDEO_2X and PLL_MIPI

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

Pengfei Li <[email protected]>
clk: imx: add i.MX91 clk

Pengfei Li <[email protected]>
clk: imx93: Move IMX93_CLK_END macro to clk driver

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

Pengfei Li <[email protected]>
dt-bindings: clock: Add i.MX91 clock support

Pengfei Li <[email protected]>
dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition

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

Masahiro Yamada <[email protected]>
module: Convert default symbol namespace to string literal

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

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

Eric Dumazet <[email protected]>
net_sched: sch_sfq: handle bigger packets

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()

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

Alex Deucher <[email protected]>
Revert "drm/amdgpu/gfx9: put queue resets behind a debug option"

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

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()

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

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()

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

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]>
drm/msm/dp: set safe_to_exit_level before printing it

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

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

Johannes Weiner <[email protected]>
sched: psi: pass enqueue/dequeue flags to psi callbacks directly

John Stultz <[email protected]>
sched: Split out __schedule() deactivate task logic into a helper

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

Perry Yuan <[email protected]>
x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD

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

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: 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

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:

 Documentation/core-api/symbol-namespaces.rst       |   4 +-
 .../devicetree/bindings/clock/imx93-clock.yaml     |   1 +
 .../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 +-
 .../it_IT/core-api/symbol-namespaces.rst           |   4 +-
 .../zh_CN/core-api/symbol-namespaces.rst           |   4 +-
 Makefile                                           |   6 +-
 .../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    |   4 +-
 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 +-
 .../boot/dts/allwinner/sun50i-a64-pinebook.dts     |   2 +
 .../boot/dts/allwinner/sun50i-a64-teres-i.dts      |   2 +
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      |   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/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/Makefile                  |   3 +
 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/sc7180-firmware-tfa.dtsi  |  84 ++--
 .../arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi |   8 +-
 .../boot/dts/qcom/sc7180-trogdor-homestar.dtsi     |   8 +-
 .../arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi |   4 +-
 .../dts/qcom/sc7180-trogdor-quackingstick.dtsi     |   1 +
 .../boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi  |   8 +-
 arch/arm64/boot/dts/qcom/sc7180.dtsi               | 362 ++++++-------
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi             |  46 +-
 ...dts => sdm845-db845c-navigation-mezzanine.dtso} |  46 +-
 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/sm7125.dtsi               |  16 +-
 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 +-
 arch/arm64/boot/dts/ti/Makefile                    |   4 -
 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/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                          |  10 +-
 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-mq.c                                     |  34 +-
 block/blk-mq.h                                     |   6 +
 block/blk-sysfs.c                                  |   9 +-
 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/bluetooth/btbcm.c                          |   3 +
 drivers/bluetooth/btnxpuart.c                      |   3 +-
 drivers/bluetooth/btrtl.c                          |   4 +-
 drivers/bluetooth/btusb.c                          |   7 +
 drivers/cdx/Makefile                               |   2 +-
 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                        |  89 ++--
 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/sunxi-ng/ccu-sun50i-a64.h              |   2 -
 drivers/clk/thead/clk-th1520-ap.c                  |  13 +-
 drivers/cpufreq/acpi-cpufreq.c                     |  36 +-
 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/Makefile                  |   2 +-
 drivers/crypto/intel/iaa/iaa_crypto_main.c         |   2 +-
 drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c        |   3 +
 drivers/crypto/intel/qat/qat_common/Makefile       |   2 +-
 drivers/crypto/tegra/tegra-se-aes.c                |   7 +-
 drivers/crypto/tegra/tegra-se-hash.c               |   7 +-
 drivers/dma/idxd/Makefile                          |   2 +-
 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-idio-16.c                        |   2 +-
 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_ttm.c            |   1 +
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c              |   4 -
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c            |   6 -
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c            |   2 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |   2 +
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |  34 +-
 .../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/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/mdp4/mdp4_lcdc_encoder.c  |   2 +-
 drivers/gpu/drm/msm/dp/dp_audio.c                  |   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                      |   1 -
 drivers/iommu/amd/iommu.c                          |   9 -
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c        |  17 +-
 drivers/iommu/iommufd/iova_bitmap.c                |   2 +-
 drivers/iommu/iommufd/main.c                       |   2 +-
 drivers/leds/leds-cht-wcove.c                      |   6 +-
 drivers/leds/leds-netxbig.c                        |   1 +
 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                 |   1 +
 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/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    |  18 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c       | 109 ++--
 drivers/net/ethernet/intel/ice/ice_ethtool.h       |  38 +-
 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 +-
 .../mlx5/core/steering/hws/mlx5hws_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/sfc/ef100_ethtool.c           |   1 +
 drivers/net/ethernet/sfc/ethtool.c                 |   1 +
 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/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              |   6 +-
 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/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/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          | 212 +++++++-
 drivers/net/wireless/realtek/rtw89/chan.h          |  28 +-
 drivers/net/wireless/realtek/rtw89/core.c          | 124 +++--
 drivers/net/wireless/realtek/rtw89/core.h          |  27 +-
 drivers/net/wireless/realtek/rtw89/fw.c            |  40 +-
 drivers/net/wireless/realtek/rtw89/mac.c           |   3 +-
 drivers/net/wireless/realtek/rtw89/mac80211.c      |  10 +-
 drivers/net/wireless/ti/wlcore/main.c              |  10 +-
 drivers/nvme/host/core.c                           |  34 +-
 drivers/nvme/host/tcp.c                            |  70 ++-
 drivers/of/fdt.c                                   |  13 +-
 drivers/of/of_private.h                            |   3 +-
 drivers/of/of_reserved_mem.c                       | 174 +++++--
 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/plda/pcie-microchip-host.c  | 222 +++++---
 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       | 558 ++++++++++++---------
 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/lenovo.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                                 |   2 +-
 drivers/pwm/pwm-dwc-core.c                         |   2 +-
 drivers/pwm/pwm-lpss.c                             |   2 +-
 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/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/tty/serial/sc16is7xx.c                     |   2 +-
 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/storage/Makefile                       |   2 +-
 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                                   |  97 +++-
 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/internal.h                                |  17 +-
 fs/erofs/zdata.c                                   | 190 +++++--
 fs/erofs/zutil.c                                   | 155 +-----
 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_notify_failure.c                        | 121 +++--
 include/acpi/acpixf.h                              |   1 +
 include/dt-bindings/clock/imx93-clock.h            |   7 +-
 include/dt-bindings/clock/sun50i-a64-ccu.h         |   2 +
 include/linux/btf.h                                |   5 +
 include/linux/coredump.h                           |   4 +-
 include/linux/ethtool.h                            |   4 +
 include/linux/export.h                             |   2 +-
 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/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/netns/xfrm.h                           |   1 +
 include/net/pkt_cls.h                              |  13 +-
 include/net/sch_generic.h                          |   5 +-
 include/net/xfrm.h                                 |  30 +-
 include/sound/hdaudio_ext.h                        |  45 --
 include/trace/events/afs.h                         |   2 +
 include/trace/events/rxrpc.h                       |  25 +
 include/uapi/linux/xfrm.h                          |   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/dma/coherent.c                              |  14 +-
 kernel/events/core.c                               |  35 +-
 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                                |  83 +--
 kernel/sched/cpufreq_schedutil.c                   |   4 +-
 kernel/sched/fair.c                                |  21 +-
 kernel/sched/features.h                            |   9 +
 kernel/sched/sched.h                               |  56 +--
 kernel/sched/stats.h                               |  33 +-
 kernel/sched/syscalls.c                            |   2 +-
 kernel/trace/bpf_trace.c                           |  13 +-
 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                                     |  21 +-
 net/core/filter.c                                  |   2 +-
 net/core/sysctl_net_core.c                         |   5 +-
 net/ethtool/ioctl.c                                |   8 +-
 net/ethtool/netlink.c                              |   2 +-
 net/hsr/hsr_forward.c                              |   7 +-
 net/ipv4/esp4_offload.c                            |   6 +-
 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/esp6_offload.c                            |   6 +-
 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/key/af_key.c                                   |   7 +-
 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                                |  45 +-
 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_compat.c                             |   6 +-
 net/xfrm/xfrm_input.c                              |   2 +-
 net/xfrm/xfrm_policy.c                             |  12 +
 net/xfrm/xfrm_replay.c                             |  10 +-
 net/xfrm/xfrm_state.c                              | 256 ++++++++--
 net/xfrm/xfrm_user.c                               |  59 ++-
 samples/landlock/sandboxer.c                       |   7 +
 scripts/Makefile.lib                               |   4 +-
 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                          |   6 +-
 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/rockchip/rockchip_i2s_tdm.c              |  31 +-
 sound/soc/sh/rz-ssi.c                              |   3 +-
 sound/soc/sunxi/sun4i-spdif.c                      |   7 +
 sound/usb/quirks.c                                 |   2 +
 tools/bootconfig/main.c                            |   4 +-
 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/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 +-
 tools/perf/tests/shell/trace_btf_enum.sh           |   8 +-
 tools/perf/util/bpf-event.c                        |  10 +-
 .../util/bpf_skel/augmented_raw_syscalls.bpf.c     |  11 +-
 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 +-
 .../cpupower/utils/idle_monitor/mperf_monitor.c    |  15 +-
 tools/power/x86/turbostat/turbostat.8              |  25 +
 tools/power/x86/turbostat/turbostat.c              | 163 +++++-
 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 +
 tools/testing/selftests/bpf/prog_tests/tailcalls.c | 124 ++++-
 tools/testing/selftests/bpf/progs/tc_bpf2bpf.c     |   5 +-
 .../selftests/bpf/progs/test_fill_link_info.c      |  13 +-
 tools/testing/selftests/bpf/test_tc_tunnel.sh      |   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/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 +-
 678 files changed, 6718 insertions(+), 3703 deletions(-)
author maintainer
#1 lore raw

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

6.12-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
#3 lore raw

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

In reply to Greg Kroah-Hartman

6.12-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 dddedaef5e93d..0c01e4423ee2a 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
#2 lore raw

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

In reply to Greg Kroah-Hartman

6.12-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/590 dlm: fix srcu_read_lock() return type to int

In reply to Greg Kroah-Hartman

6.12-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 cb3a10b041c27..f2d88a3581695 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/590 afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY

In reply to Greg Kroah-Hartman

6.12-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/590 afs: Fix directory format encoding struct

In reply to Greg Kroah-Hartman

6.12-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/590 afs: Fix cleanup of immediately failed async calls

In reply to Greg Kroah-Hartman

6.12-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/590 fs: fix proc_handler for sysctl_nr_open

In reply to Greg Kroah-Hartman

6.12-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 eed5ffad9997c..18735dc8269a1 100644
@@ -125,7 +125,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/590 block: copy back bounce buffer to user-space correctly in case of split

In reply to Greg Kroah-Hartman

6.12-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 88e3ad73c3854..9aed61fcd0bf9 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/590 block: retry call probe after request_module in blk_request_module

In reply to Greg Kroah-Hartman

6.12-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 8645cf3b0816e..99344f53c7897 100644
@@ -778,7 +778,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;
@@ -788,14 +788,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
#11 lore raw

PATCH 11/590 ps3disk: Do not use dev->bounce_size before it is set

In reply to Greg Kroah-Hartman

6.12-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
#15 lore raw

PATCH 15/590 block: dont update BLK_FEAT_POLL in __blk_mq_update_nr_hw_queues

In reply to Greg Kroah-Hartman

6.12-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 487e8cafccc55..42023addf9cda 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 784d41eb0abba..662e52ab06467 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;
@@ -4333,12 +4332,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)
 {
@@ -4349,7 +4342,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);
@@ -5037,8 +5030,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) {
@@ -5052,13 +5043,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);
 	}
 
@@ -5118,9 +5102,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 f4ac1af77a267..364c0415293cf 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 207577145c54f..692b27266220f 100644
@@ -256,10 +256,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
#16 lore raw

PATCH 16/590 nvme-tcp: Fix I/O queue cpu spreading for multiple controllers

In reply to Greg Kroah-Hartman

6.12-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 55abfe5e1d254..8305d3c128074 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) {
@@ -2856,6 +2896,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);
@@ -2873,6 +2914,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
#17 lore raw

PATCH 17/590 nvme: Add error check for xa_store in nvme_get_effects_log

In reply to Greg Kroah-Hartman

6.12-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 249914b90dbfa..f5ea15bfe6feb 100644
@@ -3085,7 +3085,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)
@@ -3102,7 +3102,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
#18 lore raw

PATCH 18/590 powerpc/pseries/iommu: IOMMU incorrectly marks MMIO range in DDW

In reply to Greg Kroah-Hartman

6.12-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
#19 lore raw

PATCH 19/590 selftests/powerpc: Fix argument order to timer_sub()

In reply to Greg Kroah-Hartman

6.12-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
#20 lore raw

PATCH 20/590 nvme: Add error path for xa_store in nvme_init_effects

In reply to Greg Kroah-Hartman

6.12-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 f5ea15bfe6feb..23137fcd335b0 100644
@@ -3168,6 +3168,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;
@@ -3214,10 +3233,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
#21 lore raw

PATCH 21/590 btrfs: improve the warning and error message for btrfs_remove_qgroup()

In reply to Greg Kroah-Hartman

6.12-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 e70ed857fc743..4fcd6cd4c1c24 100644
@@ -1839,9 +1839,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.
@@ -1850,8 +1860,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
#22 lore raw

PATCH 22/590 partitions: ldm: remove the initial kernel-doc notation

In reply to Greg Kroah-Hartman

6.12-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
#23 lore raw

PATCH 23/590 btrfs: subpage: fix the bitmap dump of the locked flags

In reply to Greg Kroah-Hartman

6.12-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 fe4d719d506bf..ec7328a6bfd75 100644
@@ -868,6 +868,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));
@@ -880,15 +881,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
#24 lore raw

PATCH 24/590 select: Fix unbalanced user_access_end()

In reply to Greg Kroah-Hartman

6.12-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 a77907faf2b45..834f438296e2b 100644
@@ -787,7 +787,7 @@ static inline int get_sigset_argpack(struct sigset_argpack *to,
 	}
 	return 0;
 Efault:
-	user_access_end();
+	user_read_access_end();
 	return -EFAULT;
 }
 
@@ -1361,7 +1361,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
#25 lore raw

PATCH 25/590 nvme: fix bogus kzalloc() return check in nvme_init_effects_log()

In reply to Greg Kroah-Hartman

6.12-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 23137fcd335b0..4c409efd8cec1 100644
@@ -3174,7 +3174,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
#26 lore raw

PATCH 26/590 afs: Fix the fallback handling for the YFS.RemoveFile2 RPC call

In reply to Greg Kroah-Hartman

6.12-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
#27 lore raw

PATCH 27/590 perf/core: Save raw sample data conditionally based on sample type

In reply to Greg Kroah-Hartman

6.12-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 e2e0aa463fbd1..c3075e4a8efc3 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 fb908843f2092..347901525a46a 100644
@@ -1266,12 +1266,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 df27d08a72326..501d8c2fedff4 100644
@@ -10375,9 +10375,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)
@@ -10389,7 +10389,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)
@@ -10400,7 +10400,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;
@@ -10426,6 +10426,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;
@@ -10435,13 +10436,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();
@@ -10449,15 +10454,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);
 	}
 }
 
@@ -10475,15 +10480,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
@@ -10493,7 +10493,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);
 		}
 	}
 
@@ -10510,7 +10511,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 50881898e758d..b5cf605fb0e60 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
#28 lore raw

PATCH 28/590 sched/fair: Untangle NEXT_BUDDY and pick_next_task()

In reply to Greg Kroah-Hartman

6.12-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 60be5f8bbe711..a21110b220b7b 100644
@@ -5647,9 +5647,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 290874079f60d..050d7503064e3 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
#29 lore raw

PATCH 29/590 sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat

In reply to Greg Kroah-Hartman

6.12-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 02eaf84c8626f..8982820dae213 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 a21110b220b7b..65e7be6448720 100644
@@ -9418,6 +9418,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:
@@ -9490,10 +9492,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;
 	}
 
@@ -9508,6 +9508,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);
 }
@@ -9668,6 +9674,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
#12 lore raw

PATCH 12/590 nbd: dont allow reconnect after disconnect

In reply to Greg Kroah-Hartman

6.12-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
#30 lore raw

PATCH 30/590 sched: Fix race between yield_to() and try_to_wake_up()

In reply to Greg Kroah-Hartman

6.12-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 1784ed1fb3fe5..f9cb7896c1b96 100644
@@ -1471,7 +1471,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
#31 lore raw

PATCH 31/590 x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD

In reply to Greg Kroah-Hartman

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

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

From: Perry Yuan <[email protected]>

[ Upstream commit b0979e53645825a38f814ca5d3d09aed2745911d ]

Enable the SD_ASYM_PACKING domain flag for the PKG domain on AMD heterogeneous processors. This flag is beneficial for processors with one or more CCDs and relies on x86_sched_itmt_flags().

Stable-dep-of: e1bc02646527 ("x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally")

---
 arch/x86/kernel/smpboot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kernel/smpboot.c +3 -2
index 766f092dab80b..b5a8f0891135b 100644
@@ -497,8 +497,9 @@ static int x86_cluster_flags(void)
 
 static int x86_die_flags(void)
 {
-	if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
-	       return x86_sched_itmt_flags();
+	if (cpu_feature_enabled(X86_FEATURE_HYBRID_CPU) ||
+	    cpu_feature_enabled(X86_FEATURE_AMD_HETEROGENEOUS_CORES))
+		return x86_sched_itmt_flags();
 
 	return 0;
 }
Signature · 1 line
2.39.5
author maintainer
#32 lore raw

PATCH 32/590 x86/topology: Use x86_sched_itmt_flags for PKG domain unconditionally

In reply to Greg Kroah-Hartman

6.12-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
#33 lore raw

PATCH 33/590 sched: Split out __schedule() deactivate task logic into a helper

In reply to Greg Kroah-Hartman

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

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

From: John Stultz <[email protected]>

[ Upstream commit 7b3d61f6578ab06f130ecc13cd2f3010a6c295bb ]

As we're going to re-use the deactivation logic,
split it into a helper.

Stable-dep-of: 7d9da040575b ("psi: Fix race when task wakes up before psi_sched_switch() adjusts flags")

---
 kernel/sched/core.c | 67 +++++++++++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 27 deletions(-)
kernel/sched/core.c +40 -27
index d07dc87787dff..d794d9bb429fd 100644
@@ -6507,6 +6507,45 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
 #define SM_PREEMPT		1
 #define SM_RTLOCK_WAIT		2
 
+/*
+ * Helper function for __schedule()
+ *
+ * If a task does not have signals pending, deactivate it
+ * Otherwise marks the task's __state as RUNNING
+ */
+static bool try_to_block_task(struct rq *rq, struct task_struct *p,
+			      unsigned long task_state)
+{
+	int flags = DEQUEUE_NOCLOCK;
+
+	if (signal_pending_state(task_state, p)) {
+		WRITE_ONCE(p->__state, TASK_RUNNING);
+		return false;
+	}
+
+	p->sched_contributes_to_load =
+		(task_state & TASK_UNINTERRUPTIBLE) &&
+		!(task_state & TASK_NOLOAD) &&
+		!(task_state & TASK_FROZEN);
+
+	if (unlikely(is_special_task_state(task_state)))
+		flags |= DEQUEUE_SPECIAL;
+
+	/*
+	 * __schedule()			ttwu()
+	 *   prev_state = prev->state;    if (p->on_rq && ...)
+	 *   if (prev_state)		    goto out;
+	 *     p->on_rq = 0;		  smp_acquire__after_ctrl_dep();
+	 *				  p->state = TASK_WAKING
+	 *
+	 * Where __schedule() and ttwu() have matching control dependencies.
+	 *
+	 * After this, schedule() must not care about p->state any more.
+	 */
+	block_task(rq, p, flags);
+	return true;
+}
+
 /*
  * __schedule() is the main scheduler function.
  *
@@ -6615,33 +6654,7 @@ static void __sched notrace __schedule(int sched_mode)
 			goto picked;
 		}
 	} else if (!preempt && prev_state) {
-		if (signal_pending_state(prev_state, prev)) {
-			WRITE_ONCE(prev->__state, TASK_RUNNING);
-		} else {
-			int flags = DEQUEUE_NOCLOCK;
-
-			prev->sched_contributes_to_load =
-				(prev_state & TASK_UNINTERRUPTIBLE) &&
-				!(prev_state & TASK_NOLOAD) &&
-				!(prev_state & TASK_FROZEN);
-
-			if (unlikely(is_special_task_state(prev_state)))
-				flags |= DEQUEUE_SPECIAL;
-
-			/*
-			 * __schedule()			ttwu()
-			 *   prev_state = prev->state;    if (p->on_rq && ...)
-			 *   if (prev_state)		    goto out;
-			 *     p->on_rq = 0;		  smp_acquire__after_ctrl_dep();
-			 *				  p->state = TASK_WAKING
-			 *
-			 * Where __schedule() and ttwu() have matching control dependencies.
-			 *
-			 * After this, schedule() must not care about p->state any more.
-			 */
-			block_task(rq, prev, flags);
-			block = true;
-		}
+		block = try_to_block_task(rq, prev, prev_state);
 		switch_count = &prev->nvcsw;
 	}
 
Signature · 1 line
2.39.5
author maintainer
#34 lore raw

PATCH 34/590 sched: psi: pass enqueue/dequeue flags to psi callbacks directly

In reply to Greg Kroah-Hartman

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

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

From: Johannes Weiner <[email protected]>

[ Upstream commit 1a6151017ee5a30cb2d959f110ab18fc49646467 ]

What psi needs to do on each enqueue and dequeue has gotten more subtle, and the generic sched code trying to distill this into a bool for the callbacks is awkward.

Pass the flags directly and let psi parse them. For that to work, the #include "stats.h" (which has the psi callback implementations) needs to be below the flag definitions in "sched.h". Move that section further down, next to some of the other accounting stuff.

This also puts the ENQUEUE_SAVE/RESTORE branch behind the psi jump label, slightly reducing overhead when PSI=y but runtime disabled.

Stable-dep-of: 7d9da040575b ("psi: Fix race when task wakes up before psi_sched_switch() adjusts flags")

---
 kernel/sched/core.c  | 12 +++++-----
 kernel/sched/sched.h | 56 ++++++++++++++++++++++----------------------
 kernel/sched/stats.h | 29 +++++++++++++++--------
 3 files changed, 53 insertions(+), 44 deletions(-)
kernel/sched/core.c +6 -6
index d794d9bb429fd..c1d2d46feec50 100644
@@ -2024,10 +2024,10 @@ void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
 	 */
 	uclamp_rq_inc(rq, p);
 
-	if (!(flags & ENQUEUE_RESTORE)) {
+	psi_enqueue(p, flags);
+
+	if (!(flags & ENQUEUE_RESTORE))
 		sched_info_enqueue(rq, p);
-		psi_enqueue(p, flags & ENQUEUE_MIGRATED);
-	}
 
 	if (sched_core_enabled(rq))
 		sched_core_enqueue(rq, p);
@@ -2044,10 +2044,10 @@ inline bool dequeue_task(struct rq *rq, struct task_struct *p, int flags)
 	if (!(flags & DEQUEUE_NOCLOCK))
 		update_rq_clock(rq);
 
-	if (!(flags & DEQUEUE_SAVE)) {
+	if (!(flags & DEQUEUE_SAVE))
 		sched_info_dequeue(rq, p);
-		psi_dequeue(p, !(flags & DEQUEUE_SLEEP));
-	}
+
+	psi_dequeue(p, flags);
 
 	/*
 	 * Must be before ->dequeue_task() because ->dequeue_task() can 'fail'
kernel/sched/sched.h +28 -28

68 lines not on this page · raw message

kernel/sched/stats.h +19 -10
index 767e098a3bd13..8ee0add5a48a8 100644
@@ -127,21 +127,25 @@ static inline void psi_account_irqtime(struct rq *rq, struct task_struct *curr,
  * go through migration requeues. In this case, *sleeping* states need
  * to be transferred.
  */
-static inline void psi_enqueue(struct task_struct *p, bool migrate)
+static inline void psi_enqueue(struct task_struct *p, int flags)
 {
 	int clear = 0, set = 0;
 
 	if (static_branch_likely(&psi_disabled))
 		return;
 
+	/* Same runqueue, nothing changed for psi */
+	if (flags & ENQUEUE_RESTORE)
+		return;
+
 	if (p->se.sched_delayed) {
 		/* CPU migration of "sleeping" task */
-		SCHED_WARN_ON(!migrate);
+		SCHED_WARN_ON(!(flags & ENQUEUE_MIGRATED));
 		if (p->in_memstall)
 			set |= TSK_MEMSTALL;
 		if (p->in_iowait)
 			set |= TSK_IOWAIT;
-	} else if (migrate) {
+	} else if (flags & ENQUEUE_MIGRATED) {
 		/* CPU migration of runnable task */
 		set = TSK_RUNNING;
 		if (p->in_memstall)
@@ -158,17 +162,14 @@ static inline void psi_enqueue(struct task_struct *p, bool migrate)
 	psi_task_change(p, clear, set);
 }
 
-static inline void psi_dequeue(struct task_struct *p, bool migrate)
+static inline void psi_dequeue(struct task_struct *p, int flags)
 {
 	if (static_branch_likely(&psi_disabled))
 		return;
 
-	/*
-	 * When migrating a task to another CPU, clear all psi
-	 * state. The enqueue callback above will work it out.
-	 */
-	if (migrate)
-		psi_task_change(p, p->psi_flags, 0);
+	/* Same runqueue, nothing changed for psi */
+	if (flags & DEQUEUE_SAVE)
+		return;
 
 	/*
 	 * A voluntary sleep is a dequeue followed by a task switch. To
@@ -176,6 +177,14 @@ static inline void psi_dequeue(struct task_struct *p, bool migrate)
 	 * TSK_RUNNING and TSK_IOWAIT for us when it moves TSK_ONCPU.
 	 * Do nothing here.
 	 */
+	if (flags & DEQUEUE_SLEEP)
+		return;
+
+	/*
+	 * When migrating a task to another CPU, clear all psi
+	 * state. The enqueue callback above will work it out.
+	 */
+	psi_task_change(p, p->psi_flags, 0);
 }
 
 static inline void psi_ttwu_dequeue(struct task_struct *p)
Signature · 1 line
2.39.5
author maintainer
#35 lore raw

PATCH 35/590 psi: Fix race when task wakes up before psi_sched_switch() adjusts flags

In reply to Greg Kroah-Hartman

6.12-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 c1d2d46feec50..aba41c69f09c4 100644
@@ -6593,7 +6593,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;
@@ -6654,7 +6653,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;
 	}
 
@@ -6699,7 +6698,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
#13 lore raw

PATCH 13/590 pstore/blk: trivial typo fixes

In reply to Greg Kroah-Hartman

6.12-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
#14 lore raw

PATCH 14/590 block: check BLK_FEAT_POLL under q_usage_count

In reply to Greg Kroah-Hartman

6.12-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 4f791a3114a12..487e8cafccc55 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 4e76651e786d1..784d41eb0abba 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
#37 lore raw

PATCH 37/590 drm/rockchip: vop2: fix rk3588 dp+dsi maxclk verification

In reply to Greg Kroah-Hartman

6.12-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
#42 lore raw

PATCH 43/590 drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table

In reply to Greg Kroah-Hartman

6.12-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 b56298d9da98f..5c54c9fd44619 100644
@@ -1420,6 +1420,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
#43 lore raw

PATCH 44/590 drm/rockchip: vop2: Fix cluster windows alpha ctrl regsiters offset

In reply to Greg Kroah-Hartman

6.12-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
#44 lore raw

PATCH 45/590 drm/rockchip: vop2: Fix the mixer alpha setup for layer 0

In reply to Greg Kroah-Hartman

6.12-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
#38 lore raw

PATCH 38/590 drm/msm/dp: set safe_to_exit_level before printing it

In reply to Greg Kroah-Hartman

6.12-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 a599fc5d63c52..f4e01da5c55b0 100644
@@ -329,10 +329,10 @@ static void dp_audio_safe_to_exit_level(struct 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
#45 lore raw

PATCH 46/590 drm/panthor: Preserve the result returned by panthor_fw_resume()

In reply to Greg Kroah-Hartman

6.12-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
#46 lore raw

PATCH 47/590 drm/rockchip: vop2: Fix the windows switch between different layers

In reply to Greg Kroah-Hartman

6.12-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
#47 lore raw

PATCH 48/590 printk: Defer legacy printing when holding printk_cpu_sync

In reply to Greg Kroah-Hartman

6.12-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 3fcb48502adbd..5eef70000b439 100644
@@ -335,3 +335,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 beb808f4c367b..7530df62ff7cb 100644
@@ -4892,6 +4892,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 2b35a9d3919d8..e6198da7c7354 100644
@@ -43,10 +43,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
#48 lore raw

PATCH 49/590 drm/connector: Allow clearing HDMI infoframes

In reply to Greg Kroah-Hartman

6.12-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
#49 lore raw

PATCH 50/590 drm/rockchip: vop2: Set AXI id for rk3588

In reply to Greg Kroah-Hartman

6.12-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 18efb3fe1c000..e473a8f8fd32d 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
#50 lore raw

PATCH 51/590 drm/rockchip: vop2: Setup delay cycle for Esmart2/3

In reply to Greg Kroah-Hartman

6.12-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
#51 lore raw

PATCH 52/590 drm/rockchip: vop2: Check linear format for Cluster windows on rk3566/8

In reply to Greg Kroah-Hartman

6.12-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
#39 lore raw

PATCH 39/590 drm/msm/hdmi: simplify code in pll_get_integloop_gain

In reply to Greg Kroah-Hartman

6.12-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 e6ffaf92d26d3..1c4211cfa2a47 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
#52 lore raw

PATCH 53/590 drm/rockchip: vop2: Add check for 32 bpp format for rk3588

In reply to Greg Kroah-Hartman

6.12-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
#53 lore raw

PATCH 54/590 drm/rockchip: vop2: include rockchip_drm_drv.h

In reply to Greg Kroah-Hartman

6.12-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
#54 lore raw

PATCH 55/590 drm/amdgpu/vcn: reset fw_shared under SRIOV

In reply to Greg Kroah-Hartman

6.12-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 6fca2915ea8fd..84c6b0f5c4c0b 100644
@@ -943,6 +943,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
#55 lore raw

PATCH 56/590 OPP: add index check to assert to avoid buffer overflow in _read_freq()

In reply to Greg Kroah-Hartman

6.12-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 3aa18737470fa..1efb819c91b63 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);
@@ -2911,7 +2923,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;
 	}
@@ -2987,7 +2999,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
#56 lore raw

PATCH 57/590 OPP: fix dev_pm_opp_find_bw_*() when bandwidth table not initialized

In reply to Greg Kroah-Hartman

6.12-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 1efb819c91b63..5ac209472c0cf 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
#57 lore raw

PATCH 58/590 drm/msm/dpu: provide DSPP and correct LM config for SDM670

In reply to Greg Kroah-Hartman

6.12-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
#40 lore raw

PATCH 41/590 HID: core: Fix assumption that Resolution Multipliers must be in Logical Collections

In reply to Greg Kroah-Hartman

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

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

From: Alan Stern <[email protected]>

commit 64f2657b579343cf923aa933f08074e6258eb07b upstream.

A report in 2019 by the syzbot fuzzer was found to be connected to two errors in the HID core associated with Resolution Multipliers. One of the errors was fixed by commit ea427a222d8b ("HID: core: Fix deadloop in hid_apply_multiplier."), but the other has not been fixed.

This error arises because hid_apply_multipler() assumes that every Resolution Multiplier control is contained in a Logical Collection, i.e., there's no way the routine can ever set multiplier_collection to NULL. This is in spite of the fact that the function starts with a big comment saying:

* "The Resolution Multiplier control must be contained in the same
* Logical Collection as the control(s) to which it is to be applied.
...
* If no Logical Collection is
* defined, the Resolution Multiplier is associated with all
* controls in the report."
* HID Usage Table, v1.12, Section 4.3.1, p30
*
* Thus, search from the current collection upwards until we find a
* logical collection...

The comment and the code overlook the possibility that none of the collections found may be a Logical Collection.

The fix is to set the multiplier_collection pointer to NULL if the collection found isn't a Logical Collection.

Reported-by [email protected]
Cc Peter Hutterer <[email protected]>
Fixes 5a4abb36f312 ("HID: core: process the Resolution Multiplier")
---
 drivers/hid/hid-core.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-core.c +2 -0
@@ -1125,6 +1125,8 @@ static void hid_apply_multiplier(struct
 	while (multiplier_collection->parent_idx != -1 &&
 	       multiplier_collection->type != HID_COLLECTION_LOGICAL)
 		multiplier_collection = &hid->collection[multiplier_collection->parent_idx];
+	if (multiplier_collection->type != HID_COLLECTION_LOGICAL)
+		multiplier_collection = NULL;
 
 	effective_multiplier = hid_calculate_multiplier(hid, multiplier);
 
author maintainer
#58 lore raw

PATCH 59/590 drm/msm/dpu: link DSPP_2/_3 blocks on SM8150

In reply to Greg Kroah-Hartman

6.12-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
#41 lore raw

PATCH 42/590 drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config()

In reply to Greg Kroah-Hartman

6.12-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
#36 lore raw

PATCH 36/590 drm/v3d: Fix performance counter source settings on V3D 7.x

In reply to Greg Kroah-Hartman

6.12-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 6ee56cbd3f1bf..e3013ac3a5c2a 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
#60 lore raw

PATCH 61/590 drm/msm/dpu: link DSPP_2/_3 blocks on SM8250

In reply to Greg Kroah-Hartman

6.12-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
#65 lore raw

PATCH 66/590 drm/msm: Check return value of of_dma_configure()

In reply to Greg Kroah-Hartman

6.12-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
#66 lore raw

PATCH 67/590 drm/msm: dont clean up priv->kms prematurely

In reply to Greg Kroah-Hartman

6.12-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 af6a6fcb11736..6749f0fbca96d 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
#67 lore raw

PATCH 68/590 drm/msm/mdp4: correct LCDC regulator name

In reply to Greg Kroah-Hartman

6.12-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
#61 lore raw

PATCH 62/590 drm/msm/dpu: link DSPP_2/_3 blocks on SM8350

In reply to Greg Kroah-Hartman

6.12-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
#68 lore raw

PATCH 69/590 drm/bridge: it6505: Change definition of AUX_FIFO_MAX_SIZE

In reply to Greg Kroah-Hartman

6.12-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
#69 lore raw

PATCH 70/590 drm/amdgpu: tear down ttm range manager for doorbell in amdgpu_ttm_fini()

In reply to Greg Kroah-Hartman

6.12-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 9f922ec50ea2d..ae9ca6788df78 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
#70 lore raw

PATCH 71/590 Revert "drm/amdgpu/gfx9: put queue resets behind a debug option"

In reply to Greg Kroah-Hartman

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

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

From: Alex Deucher <[email protected]>

[ Upstream commit 32f00289698189b813942f37626218fd473e7302 ]

This reverts commit 7c1a2d8aba6cadde0cc542b2d805edc0be667e79.

Extended validation has completed successfully, so enable these features by default.

Stable-dep-of: 86bde64cb795 ("drm/amdgpu: fix gpu recovery disable with per queue reset")

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 4 ----
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c             | 4 ----
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c           | 6 ------
 3 files changed, 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +0 -4
index 3bc0cbf45bc59..353ac458c834b 100644
@@ -1133,10 +1133,6 @@ uint64_t kgd_gfx_v9_hqd_get_pq_addr(struct amdgpu_device *adev,
 	uint32_t low, high;
 	uint64_t queue_addr = 0;
 
-	if (!adev->debug_exp_resets &&
-	    !adev->gfx.num_gfx_rings)
-		return 0;
-
 	kgd_gfx_v9_acquire_queue(adev, pipe_id, queue_id, inst);
 	amdgpu_gfx_rlc_enter_safe_mode(adev, inst);
 
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -4
index e7cd51c95141e..e2501c98e107d 100644
@@ -7251,10 +7251,6 @@ static int gfx_v9_0_reset_kcq(struct amdgpu_ring *ring,
 	unsigned long flags;
 	int i, r;
 
-	if (!adev->debug_exp_resets &&
-	    !adev->gfx.num_gfx_rings)
-		return -EINVAL;
-
 	if (amdgpu_sriov_vf(adev))
 		return -EINVAL;
 
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +0 -6
index ffdb966c4127e..5dc3454d7d361 100644
@@ -3062,9 +3062,6 @@ static void gfx_v9_4_3_ring_soft_recovery(struct amdgpu_ring *ring,
 	struct amdgpu_device *adev = ring->adev;
 	uint32_t value = 0;
 
-	if (!adev->debug_exp_resets)
-		return;
-
 	value = REG_SET_FIELD(value, SQ_CMD, CMD, 0x03);
 	value = REG_SET_FIELD(value, SQ_CMD, MODE, 0x01);
 	value = REG_SET_FIELD(value, SQ_CMD, CHECK_VMID, 1);
@@ -3580,9 +3577,6 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring,
 	unsigned long flags;
 	int r;
 
-	if (!adev->debug_exp_resets)
-		return -EINVAL;
-
 	if (amdgpu_sriov_vf(adev))
 		return -EINVAL;
 
Signature · 1 line
2.39.5
author maintainer
#71 lore raw

PATCH 72/590 drm/amdgpu: fix gpu recovery disable with per queue reset

In reply to Greg Kroah-Hartman

6.12-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 353ac458c834b..a46d6dd6de32f 100644
@@ -1133,6 +1133,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);
 
@@ -1181,6 +1184,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
#72 lore raw

PATCH 73/590 genirq: Make handle_enforce_irqctx() unconditionally available

In reply to Greg Kroah-Hartman

6.12-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
#73 lore raw

PATCH 74/590 ipmi: ipmb: Add check devm_kasprintf() returned value

In reply to Greg Kroah-Hartman

6.12-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
#74 lore raw

PATCH 75/590 wifi: ath11k: Fix unexpected return buffer manager error for WCN6750/WCN6855

In reply to Greg Kroah-Hartman

6.12-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
#62 lore raw

PATCH 63/590 drm/msm/dpu: link DSPP_2/_3 blocks on SM8550

In reply to Greg Kroah-Hartman

6.12-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
#75 lore raw

PATCH 76/590 wifi: rtlwifi: rtl8821ae: phy: restore removed code to fix infinite loop

In reply to Greg Kroah-Hartman

6.12-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
#76 lore raw

PATCH 77/590 wifi: rtlwifi: do not complete firmware loading needlessly

In reply to Greg Kroah-Hartman

6.12-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
#77 lore raw

PATCH 78/590 wifi: rtlwifi: rtl8192se: rise completion of firmware loading as last step

In reply to Greg Kroah-Hartman

6.12-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
#78 lore raw

PATCH 79/590 wifi: rtlwifi: wait for firmware loading before releasing memory

In reply to Greg Kroah-Hartman

6.12-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
#79 lore raw

PATCH 80/590 wifi: rtlwifi: fix init_sw_vars leak when probe fails

In reply to Greg Kroah-Hartman

6.12-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
#80 lore raw

PATCH 81/590 wifi: rtlwifi: usb: fix workqueue leak when probe fails

In reply to Greg Kroah-Hartman

6.12-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
#63 lore raw

PATCH 64/590 drm/msm/dpu: link DSPP_2/_3 blocks on SM8650

In reply to Greg Kroah-Hartman

6.12-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
#81 lore raw

PATCH 82/590 wifi: wcn36xx: fix channel survey memory allocation size

In reply to Greg Kroah-Hartman

6.12-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 408776562a7e5..cd36cab6db75d 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
#82 lore raw

PATCH 83/590 clk: renesas: cpg-mssr: Fix soc node handling in cpg_mssr_reserved_init()

In reply to Greg Kroah-Hartman

6.12-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 1b421b8097965..0f27c33192e10 100644
@@ -981,7 +981,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
#64 lore raw

PATCH 65/590 drm/msm/dpu: link DSPP_2/_3 blocks on X1E80100

In reply to Greg Kroah-Hartman

6.12-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
#59 lore raw

PATCH 60/590 drm/msm/dpu: link DSPP_2/_3 blocks on SC8180X

In reply to Greg Kroah-Hartman

6.12-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
#84 lore raw

PATCH 85/590 selftests/bpf: Actuate tx_metadata_len in xdp_hw_metadata

In reply to Greg Kroah-Hartman

6.12-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
#85 lore raw

PATCH 86/590 net_sched: sch_sfq: handle bigger packets

In reply to Greg Kroah-Hartman

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

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

From: Eric Dumazet <[email protected]>

[ Upstream commit e4650d7ae4252f67e997a632adfae0dd74d3a99a ]

SFQ has an assumption on dealing with packets smaller than 64KB.

Even before BIG TCP, TCA_STAB can provide arbitrary big values in qdisc_pkt_len(skb)

It is time to switch (struct sfq_slot)->allot to a 32bit field.

sizeof(struct sfq_slot) is now 64 bytes, giving better cache locality.

Stable-dep-of: 10685681bafc ("net_sched: sch_sfq: don't allow 1 packet limit")

---
 net/sched/sch_sfq.c | 39 +++++++++++++--------------------------
 1 file changed, 13 insertions(+), 26 deletions(-)
net/sched/sch_sfq.c +13 -26
index 3b9245a3c767a..a4b8296a2fa1c 100644
@@ -77,12 +77,6 @@
 #define SFQ_EMPTY_SLOT		0xffff
 #define SFQ_DEFAULT_HASH_DIVISOR 1024
 
-/* We use 16 bits to store allot, and want to handle packets up to 64K
- * Scale allot by 8 (1<<3) so that no overflow occurs.
- */
-#define SFQ_ALLOT_SHIFT		3
-#define SFQ_ALLOT_SIZE(X)	DIV_ROUND_UP(X, 1 << SFQ_ALLOT_SHIFT)
-
 /* This type should contain at least SFQ_MAX_DEPTH + 1 + SFQ_MAX_FLOWS values */
 typedef u16 sfq_index;
 
@@ -104,7 +98,7 @@ struct sfq_slot {
 	sfq_index	next; /* next slot in sfq RR chain */
 	struct sfq_head dep; /* anchor in dep[] chains */
 	unsigned short	hash; /* hash value (index in ht[]) */
-	short		allot; /* credit for this slot */
+	int		allot; /* credit for this slot */
 
 	unsigned int    backlog;
 	struct red_vars vars;
@@ -120,7 +114,6 @@ struct sfq_sched_data {
 	siphash_key_t 	perturbation;
 	u8		cur_depth;	/* depth of longest slot */
 	u8		flags;
-	unsigned short  scaled_quantum; /* SFQ_ALLOT_SIZE(quantum) */
 	struct tcf_proto __rcu *filter_list;
 	struct tcf_block *block;
 	sfq_index	*ht;		/* Hash table ('divisor' slots) */
@@ -456,7 +449,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)
 		 */
 		q->tail = slot;
 		/* We could use a bigger initial quantum for new flows */
-		slot->allot = q->scaled_quantum;
+		slot->allot = q->quantum;
 	}
 	if (++sch->q.qlen <= q->limit)
 		return NET_XMIT_SUCCESS;
@@ -493,7 +486,7 @@ sfq_dequeue(struct Qdisc *sch)
 	slot = &q->slots[a];
 	if (slot->allot <= 0) {
 		q->tail = slot;
-		slot->allot += q->scaled_quantum;
+		slot->allot += q->quantum;
 		goto next_slot;
 	}
 	skb = slot_dequeue_head(slot);
@@ -512,7 +505,7 @@ sfq_dequeue(struct Qdisc *sch)
 		}
 		q->tail->next = next_a;
 	} else {
-		slot->allot -= SFQ_ALLOT_SIZE(qdisc_pkt_len(skb));
+		slot->allot -= qdisc_pkt_len(skb);
 	}
 	return skb;
 }
@@ -595,7 +588,7 @@ static void sfq_rehash(struct Qdisc *sch)
 				q->tail->next = x;
 			}
 			q->tail = slot;
-			slot->allot = q->scaled_quantum;
+			slot->allot = q->quantum;
 		}
 	}
 	sch->q.qlen -= dropped;
@@ -628,7 +621,8 @@ static void sfq_perturbation(struct timer_list *t)
 	rcu_read_unlock();
 }
 
-static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
+static int sfq_change(struct Qdisc *sch, struct nlattr *opt,
+		      struct netlink_ext_ack *extack)
 {
 	struct sfq_sched_data *q = qdisc_priv(sch);
 	struct tc_sfq_qopt *ctl = nla_data(opt);
@@ -646,14 +640,10 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
 	    (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
 		return -EINVAL;
 
-	/* slot->allot is a short, make sure quantum is not too big. */
-	if (ctl->quantum) {
-		unsigned int scaled = SFQ_ALLOT_SIZE(ctl->quantum);
-
-		if (scaled <= 0 || scaled > SHRT_MAX)
-			return -EINVAL;
+	if ((int)ctl->quantum < 0) {
+		NL_SET_ERR_MSG_MOD(extack, "invalid quantum");
+		return -EINVAL;
 	}
-
 	if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
 					ctl_v1->Wlog, ctl_v1->Scell_log, NULL))
 		return -EINVAL;
@@ -663,10 +653,8 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
 			return -ENOMEM;
 	}
 	sch_tree_lock(sch);
-	if (ctl->quantum) {
+	if (ctl->quantum)
 		q->quantum = ctl->quantum;
-		q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
-	}
 	WRITE_ONCE(q->perturb_period, ctl->perturb_period * HZ);
 	if (ctl->flows)
 		q->maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
@@ -762,12 +750,11 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt,
 	q->divisor = SFQ_DEFAULT_HASH_DIVISOR;
 	q->maxflows = SFQ_DEFAULT_FLOWS;
 	q->quantum = psched_mtu(qdisc_dev(sch));
-	q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
 	q->perturb_period = 0;
 	get_random_bytes(&q->perturbation, sizeof(q->perturbation));
 
 	if (opt) {
-		int err = sfq_change(sch, opt);
+		int err = sfq_change(sch, opt, extack);
 		if (err)
 			return err;
 	}
@@ -878,7 +865,7 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
 	if (idx != SFQ_EMPTY_SLOT) {
 		const struct sfq_slot *slot = &q->slots[idx];
 
-		xstats.allot = slot->allot << SFQ_ALLOT_SHIFT;
+		xstats.allot = slot->allot;
 		qs.qlen = slot->qlen;
 		qs.backlog = slot->backlog;
 	}
Signature · 1 line
2.39.5
author maintainer
#86 lore raw

PATCH 87/590 net_sched: sch_sfq: dont allow 1 packet limit

In reply to Greg Kroah-Hartman

6.12-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
#87 lore raw

PATCH 88/590 spi: zynq-qspi: Add check for clk_enable()

In reply to Greg Kroah-Hartman

6.12-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 b67455bda972b..de4c182474329 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
#88 lore raw

PATCH 89/590 rxrpc: Fix handling of received connection abort

In reply to Greg Kroah-Hartman

6.12-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 cc22596c7250c..666fe1779ccc6 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   ") \
@@ -956,6 +958,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
#89 lore raw

PATCH 90/590 dt-bindings: mmc: controller: clarify the address-cells description

In reply to Greg Kroah-Hartman

6.12-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
#90 lore raw

PATCH 91/590 clk: fix an OF node reference leak in of_clk_get_parent_name()

In reply to Greg Kroah-Hartman

6.12-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 d02451f951cf0..5b4ab94193c2b 100644
@@ -5391,8 +5391,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
author maintainer
#91 lore raw

PATCH 92/590 dt-bindings: leds: class-multicolor: Fix path to color definitions

In reply to Greg Kroah-Hartman

6.12-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
#92 lore raw

PATCH 93/590 wifi: rtlwifi: remove unused check_buddy_priv

In reply to Greg Kroah-Hartman

6.12-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
#93 lore raw

PATCH 94/590 wifi: rtlwifi: destroy workqueue at rtl_deinit_core

In reply to Greg Kroah-Hartman

6.12-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
#94 lore raw

PATCH 95/590 wifi: rtlwifi: fix memory leaks and invalid access at probe error path

In reply to Greg Kroah-Hartman

6.12-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
#95 lore raw

PATCH 96/590 wifi: rtlwifi: pci: wait for firmware loading before releasing memory

In reply to Greg Kroah-Hartman

6.12-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
#96 lore raw

PATCH 97/590 HID: multitouch: fix support for Goodix PID 0x01e9

In reply to Greg Kroah-Hartman

6.12-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 d1b7ccfb3e051..e07d63db5e1f4 100644
@@ -2078,7 +2078,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
#97 lore raw

PATCH 98/590 regulator: dt-bindings: mt6315: Drop regulator-compatible property

In reply to Greg Kroah-Hartman

6.12-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
#98 lore raw

PATCH 99/590 wifi: brcmfmac: add missing header include for brcmf_dbg

In reply to Greg Kroah-Hartman

6.12-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
#99 lore raw

PATCH 100/590 module: Convert default symbol namespace to string literal

In reply to Greg Kroah-Hartman

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

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

From: Masahiro Yamada <[email protected]>

[ Upstream commit ceb8bf2ceaa77fe222fe8fe32cb7789c9099ddf1 ]

Commit cdd30ebb1b9f ("module: Convert symbol namespace to string literal") only converted MODULE_IMPORT_NS() and EXPORT_SYMBOL_NS(), leaving DEFAULT_SYMBOL_NAMESPACE as a macro expansion.

This commit converts DEFAULT_SYMBOL_NAMESPACE in the same way to avoid annoyance for the default namespace as well.

Stable-dep-of: 2505f87eb3af ("hwmon: (nct6775): Actually make use of the HWMON_NCT6775 symbol namespace")

---
 Documentation/core-api/symbol-namespaces.rst                  | 4 ++--
 .../translations/it_IT/core-api/symbol-namespaces.rst         | 4 ++--
 .../translations/zh_CN/core-api/symbol-namespaces.rst         | 4 ++--
 drivers/cdx/Makefile                                          | 2 +-
 drivers/crypto/intel/iaa/Makefile                             | 2 +-
 drivers/crypto/intel/qat/qat_common/Makefile                  | 2 +-
 drivers/dma/idxd/Makefile                                     | 2 +-
 drivers/gpio/gpio-idio-16.c                                   | 2 +-
 drivers/hwmon/nct6775-core.c                                  | 2 +-
 drivers/i2c/busses/i2c-designware-common.c                    | 2 +-
 drivers/i2c/busses/i2c-designware-master.c                    | 2 +-
 drivers/i2c/busses/i2c-designware-slave.c                     | 2 +-
 drivers/pwm/core.c                                            | 2 +-
 drivers/pwm/pwm-dwc-core.c                                    | 2 +-
 drivers/pwm/pwm-lpss.c                                        | 2 +-
 drivers/tty/serial/sc16is7xx.c                                | 2 +-
 drivers/usb/storage/Makefile                                  | 2 +-
 include/linux/export.h                                        | 2 +-
 18 files changed, 21 insertions(+), 21 deletions(-)
Documentation/core-api/symbol-namespaces.rst +2 -2
index 12e4aecdae945..d1154eb438101 100644
@@ -68,7 +68,7 @@ is to define the default namespace in the ``Makefile`` of the subsystem. E.g. to
 export all symbols defined in usb-common into the namespace USB_COMMON, add a
 line like this to drivers/usb/common/Makefile::
 
-	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
+	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'
 
 That will affect all EXPORT_SYMBOL() and EXPORT_SYMBOL_GPL() statements. A
 symbol exported with EXPORT_SYMBOL_NS() while this definition is present, will
@@ -79,7 +79,7 @@ A second option to define the default namespace is directly in the compilation
 unit as preprocessor statement. The above example would then read::
 
 	#undef  DEFAULT_SYMBOL_NAMESPACE
-	#define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
+	#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"
 
 within the corresponding compilation unit before any EXPORT_SYMBOL macro is
 used.
Documentation/translations/it_IT/core-api/symbol-namespaces.rst +2 -2
index 17abc25ee4c1e..6657f82c0101f 100644
@@ -69,7 +69,7 @@ Per esempio per esportare tutti i simboli definiti in usb-common nello spazio
 dei nomi USB_COMMON, si può aggiungere la seguente linea in
 drivers/usb/common/Makefile::
 
-	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
+	ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'
 
 Questo cambierà tutte le macro EXPORT_SYMBOL() ed EXPORT_SYMBOL_GPL(). Invece,
 un simbolo esportato con EXPORT_SYMBOL_NS() non verrà cambiato e il simbolo
@@ -79,7 +79,7 @@ Una seconda possibilità è quella di definire il simbolo di preprocessore
 direttamente nei file da compilare. L'esempio precedente diventerebbe::
 
 	#undef  DEFAULT_SYMBOL_NAMESPACE
-	#define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
+	#define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"
 
 Questo va messo prima di un qualsiasi uso di EXPORT_SYMBOL.
 
Documentation/translations/zh_CN/core-api/symbol-namespaces.rst +2 -2
index bb16f0611046d..f3e73834f7d7d 100644
@@ -66,7 +66,7 @@
 子系统的 ``Makefile`` 中定义默认命名空间。例如,如果要将usb-common中定义的所有符号导
 出到USB_COMMON命名空间,可以在drivers/usb/common/Makefile中添加这样一行::
 
-       ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_COMMON
+       ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_COMMON"'
 
 这将影响所有 EXPORT_SYMBOL() 和 EXPORT_SYMBOL_GPL() 语句。当这个定义存在时,
 用EXPORT_SYMBOL_NS()导出的符号仍然会被导出到作为命名空间参数传递的命名空间中,
@@ -76,7 +76,7 @@
 成::
 
        #undef  DEFAULT_SYMBOL_NAMESPACE
-       #define DEFAULT_SYMBOL_NAMESPACE USB_COMMON
+       #define DEFAULT_SYMBOL_NAMESPACE "USB_COMMON"
 
 应置于相关编译单元中任何 EXPORT_SYMBOL 宏之前
 
drivers/cdx/Makefile +1 -1
index 749a3295c2bdc..3ca7068a30525 100644
@@ -5,7 +5,7 @@
 # Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
 #
 
-ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=CDX_BUS
+ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"CDX_BUS"'
 
 obj-$(CONFIG_CDX_BUS) += cdx.o controller/
 
drivers/crypto/intel/iaa/Makefile +1 -1
index b64b208d23440..55bda7770fac7 100644
@@ -3,7 +3,7 @@
 # Makefile for IAA crypto device drivers
 #
 
-ccflags-y += -I $(srctree)/drivers/dma/idxd -DDEFAULT_SYMBOL_NAMESPACE=IDXD
+ccflags-y += -I $(srctree)/drivers/dma/idxd -DDEFAULT_SYMBOL_NAMESPACE='"IDXD"'
 
 obj-$(CONFIG_CRYPTO_DEV_IAA_CRYPTO) := iaa_crypto.o
 
drivers/crypto/intel/qat/qat_common/Makefile +1 -1
index eac73cbfdd38e..7acf9c576149b 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_CRYPTO_DEV_QAT) += intel_qat.o
-ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=CRYPTO_QAT
+ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"CRYPTO_QAT"'
 intel_qat-objs := adf_cfg.o \
 	adf_isr.o \
 	adf_ctl_drv.o \
drivers/dma/idxd/Makefile +1 -1
index 2b4a0d406e1e7..9ff9d7b87b649 100644
@@ -1,4 +1,4 @@
-ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=IDXD
+ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"IDXD"'
 
 obj-$(CONFIG_INTEL_IDXD_BUS) += idxd_bus.o
 idxd_bus-y := bus.o
drivers/gpio/gpio-idio-16.c +1 -1
index 53b1eb876a125..2c95125892972 100644
@@ -14,7 +14,7 @@
 
 #include "gpio-idio-16.h"
 
-#define DEFAULT_SYMBOL_NAMESPACE GPIO_IDIO_16
+#define DEFAULT_SYMBOL_NAMESPACE "GPIO_IDIO_16"
 
 #define IDIO_16_DAT_BASE 0x0
 #define IDIO_16_OUT_BASE IDIO_16_DAT_BASE
drivers/hwmon/nct6775-core.c +1 -1
index ee04795b98aab..c243b51837d2f 100644
@@ -57,7 +57,7 @@
 #include "nct6775.h"
 
 #undef DEFAULT_SYMBOL_NAMESPACE
-#define DEFAULT_SYMBOL_NAMESPACE HWMON_NCT6775
+#define DEFAULT_SYMBOL_NAMESPACE "HWMON_NCT6775"
 
 #define USE_ALTERNATE
 
drivers/i2c/busses/i2c-designware-common.c +1 -1
index 9d88b4fa03e42..0e7771d21469d 100644
@@ -29,7 +29,7 @@
 #include <linux/types.h>
 #include <linux/units.h>
 
-#define DEFAULT_SYMBOL_NAMESPACE	I2C_DW_COMMON
+#define DEFAULT_SYMBOL_NAMESPACE	"I2C_DW_COMMON"
 
 #include "i2c-designware-core.h"
 
drivers/i2c/busses/i2c-designware-master.c +1 -1
index e8ac9a7bf0b3d..e23f93b8974e4 100644
@@ -22,7 +22,7 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
-#define DEFAULT_SYMBOL_NAMESPACE	I2C_DW
+#define DEFAULT_SYMBOL_NAMESPACE	"I2C_DW"
 
 #include "i2c-designware-core.h"
 
drivers/i2c/busses/i2c-designware-slave.c +1 -1
index 7035296aa24ce..0a76e10f77a2b 100644
@@ -16,7 +16,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 
-#define DEFAULT_SYMBOL_NAMESPACE	I2C_DW
+#define DEFAULT_SYMBOL_NAMESPACE	"I2C_DW"
 
 #include "i2c-designware-core.h"
 
drivers/pwm/core.c +1 -1
index 210368099a064..174939359ae3e 100644
@@ -6,7 +6,7 @@
  * Copyright (C) 2011-2012 Avionic Design GmbH
  */
 
-#define DEFAULT_SYMBOL_NAMESPACE PWM
+#define DEFAULT_SYMBOL_NAMESPACE "PWM"
 
 #include <linux/acpi.h>
 #include <linux/module.h>
drivers/pwm/pwm-dwc-core.c +1 -1
index c8425493b95d8..6dabec93a3c64 100644
@@ -9,7 +9,7 @@
  * Author: Raymond Tan <[email protected]>
  */
 
-#define DEFAULT_SYMBOL_NAMESPACE dwc_pwm
+#define DEFAULT_SYMBOL_NAMESPACE "dwc_pwm"
 
 #include <linux/bitops.h>
 #include <linux/export.h>
drivers/pwm/pwm-lpss.c +1 -1
index 867e2bc8c601c..3b99feb3bb491 100644
@@ -19,7 +19,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/time.h>
 
-#define DEFAULT_SYMBOL_NAMESPACE PWM_LPSS
+#define DEFAULT_SYMBOL_NAMESPACE "PWM_LPSS"
 
 #include "pwm-lpss.h"
 
drivers/tty/serial/sc16is7xx.c +1 -1
index ad88a33a504f5..6a0a1cce3a897 100644
@@ -8,7 +8,7 @@
  */
 
 #undef DEFAULT_SYMBOL_NAMESPACE
-#define DEFAULT_SYMBOL_NAMESPACE SERIAL_NXP_SC16IS7XX
+#define DEFAULT_SYMBOL_NAMESPACE "SERIAL_NXP_SC16IS7XX"
 
 #include <linux/bits.h>
 #include <linux/clk.h>
drivers/usb/storage/Makefile +1 -1
index 46635fa4a3405..28db337f190bf 100644
@@ -8,7 +8,7 @@
 
 ccflags-y := -I $(srctree)/drivers/scsi
 
-ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE=USB_STORAGE
+ccflags-y += -DDEFAULT_SYMBOL_NAMESPACE='"USB_STORAGE"'
 
 obj-$(CONFIG_USB_UAS)		+= uas.o
 obj-$(CONFIG_USB_STORAGE)	+= usb-storage.o
include/linux/export.h +1 -1
index 0bbd02fd351db..1e04dbc675c2f 100644
@@ -60,7 +60,7 @@
 #endif
 
 #ifdef DEFAULT_SYMBOL_NAMESPACE
-#define _EXPORT_SYMBOL(sym, license)	__EXPORT_SYMBOL(sym, license, __stringify(DEFAULT_SYMBOL_NAMESPACE))
+#define _EXPORT_SYMBOL(sym, license)	__EXPORT_SYMBOL(sym, license, DEFAULT_SYMBOL_NAMESPACE)
 #else
 #define _EXPORT_SYMBOL(sym, license)	__EXPORT_SYMBOL(sym, license, "")
 #endif
Signature · 1 line
2.39.5
author maintainer
#100 lore raw

PATCH 101/590 hwmon: (nct6775): Actually make use of the HWMON_NCT6775 symbol namespace

In reply to Greg Kroah-Hartman

6.12-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
#101 lore raw

PATCH 102/590 ACPI: fan: cleanup resources in the error path of .probe()

In reply to Greg Kroah-Hartman

6.12-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 7cea4495f19bb..300e5d9199864 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
#83 lore raw

PATCH 84/590 wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()

In reply to Greg Kroah-Hartman

6.12-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 9f458be716595..79a99cf5e8922 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
#103 lore raw

PATCH 104/590 dt-bindings: mfd: bd71815: Fix rsense and typos

In reply to Greg Kroah-Hartman

6.12-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
#108 lore raw

PATCH 109/590 inetpeer: do not get a refcount in inet_getpeer()

In reply to Greg Kroah-Hartman

6.12-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 c9846159a4c3e..932bd775fc268 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 f4cfc10293b85..9c5ffe3b5f776 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);
@@ -174,6 +172,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)
 {
@@ -184,10 +183,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;
@@ -205,7 +202,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;
@@ -233,7 +230,6 @@ void inet_putpeer(struct inet_peer *p)
 	if (refcount_dec_and_test(&p->refcnt))
 		call_rcu(&p->rcu, inetpeer_free_rcu);
 }
-EXPORT_SYMBOL_GPL(inet_putpeer);
 
 /*
  *	Check transmit rate limitation for given message.
net/ipv4/ip_fragment.c +10 -5
index 34f9dbc4ccb40..9ca0a183a55ff 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 7a4cf60cece7c..2a27913588d05 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 a66180a3eefe9..434ddf263b88a 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
#109 lore raw

PATCH 110/590 pwm: stm32-lp: Add check for clk_enable()

In reply to Greg Kroah-Hartman

6.12-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
#110 lore raw

PATCH 111/590 cpufreq: schedutil: Fix superfluous updates caused by need_freq_update

In reply to Greg Kroah-Hartman

6.12-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
#104 lore raw

PATCH 105/590 leds: netxbig: Fix an OF node reference leak in netxbig_leds_get_of_pdata()

In reply to Greg Kroah-Hartman

6.12-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
#111 lore raw

PATCH 112/590 selftests: ktap_helpers: Fix uninitialized variable

In reply to Greg Kroah-Hartman

6.12-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
#112 lore raw

PATCH 113/590 ptr_ring: do not block hard interrupts in ptr_ring_resize_multiple()

In reply to Greg Kroah-Hartman

6.12-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 03fe9e3ee7af1..6fc60950100c7 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
#113 lore raw

PATCH 114/590 net: airoha: Fix error path in airoha_probe()

In reply to Greg Kroah-Hartman

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

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

From: Lorenzo Bianconi <[email protected]>

[ Upstream commit 0c7469ee718e1dd929f52bfb142a7f6fb68f0765 ]

Do not run napi_disable() if airoha_hw_init() fails since Tx/Rx napi has not been started yet. In order to fix the issue, introduce airoha_qdma_stop_napi routine and remove napi_disable in airoha_hw_cleanup().

---
 drivers/net/ethernet/mediatek/airoha_eth.c | 33 ++++++++++++++++------
 1 file changed, 25 insertions(+), 8 deletions(-)
drivers/net/ethernet/mediatek/airoha_eth.c +25 -8
index 2c26eb1852837..8d9fb2a20469a 100644
@@ -2123,17 +2123,14 @@ static void airoha_hw_cleanup(struct airoha_qdma *qdma)
 		if (!qdma->q_rx[i].ndesc)
 			continue;
 
-		napi_disable(&qdma->q_rx[i].napi);
 		netif_napi_del(&qdma->q_rx[i].napi);
 		airoha_qdma_cleanup_rx_queue(&qdma->q_rx[i]);
 		if (qdma->q_rx[i].page_pool)
 			page_pool_destroy(qdma->q_rx[i].page_pool);
 	}
 
-	for (i = 0; i < ARRAY_SIZE(qdma->q_tx_irq); i++) {
-		napi_disable(&qdma->q_tx_irq[i].napi);
+	for (i = 0; i < ARRAY_SIZE(qdma->q_tx_irq); i++)
 		netif_napi_del(&qdma->q_tx_irq[i].napi);
-	}
 
 	for (i = 0; i < ARRAY_SIZE(qdma->q_tx); i++) {
 		if (!qdma->q_tx[i].ndesc)
@@ -2158,6 +2155,21 @@ static void airoha_qdma_start_napi(struct airoha_qdma *qdma)
 	}
 }
 
+static void airoha_qdma_stop_napi(struct airoha_qdma *qdma)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(qdma->q_tx_irq); i++)
+		napi_disable(&qdma->q_tx_irq[i].napi);
+
+	for (i = 0; i < ARRAY_SIZE(qdma->q_rx); i++) {
+		if (!qdma->q_rx[i].ndesc)
+			continue;
+
+		napi_disable(&qdma->q_rx[i].napi);
+	}
+}
+
 static void airoha_update_hw_stats(struct airoha_gdm_port *port)
 {
 	struct airoha_eth *eth = port->qdma->eth;
@@ -2713,7 +2725,7 @@ static int airoha_probe(struct platform_device *pdev)
 
 	err = airoha_hw_init(pdev, eth);
 	if (err)
-		goto error;
+		goto error_hw_cleanup;
 
 	for (i = 0; i < ARRAY_SIZE(eth->qdma); i++)
 		airoha_qdma_start_napi(&eth->qdma[i]);
@@ -2728,13 +2740,16 @@ static int airoha_probe(struct platform_device *pdev)
 		err = airoha_alloc_gdm_port(eth, np);
 		if (err) {
 			of_node_put(np);
-			goto error;
+			goto error_napi_stop;
 		}
 	}
 
 	return 0;
 
-error:
+error_napi_stop:
+	for (i = 0; i < ARRAY_SIZE(eth->qdma); i++)
+		airoha_qdma_stop_napi(&eth->qdma[i]);
+error_hw_cleanup:
 	for (i = 0; i < ARRAY_SIZE(eth->qdma); i++)
 		airoha_hw_cleanup(&eth->qdma[i]);
 
@@ -2755,8 +2770,10 @@ static void airoha_remove(struct platform_device *pdev)
 	struct airoha_eth *eth = platform_get_drvdata(pdev);
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(eth->qdma); i++)
+	for (i = 0; i < ARRAY_SIZE(eth->qdma); i++) {
+		airoha_qdma_stop_napi(&eth->qdma[i]);
 		airoha_hw_cleanup(&eth->qdma[i]);
+	}
 
 	for (i = 0; i < ARRAY_SIZE(eth->ports); i++) {
 		struct airoha_gdm_port *port = eth->ports[i];
Signature · 1 line
2.39.5
author maintainer
#114 lore raw

PATCH 115/590 gpio: pca953x: log an error when failing to get the reset GPIO

In reply to Greg Kroah-Hartman

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

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

From: Luca Ceresoli <[email protected]>

[ Upstream commit 7cef813a91c468253c80633891393478b9f2c966 ]

When the dirver fails getting this GPIO, it fails silently. Log an error message to make debugging a lot easier by just reading dmesg.

Fixes 054ccdef8b28 ("gpio: pca953x: Add optional reset gpio control")
---
 drivers/gpio/gpio-pca953x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +2 -1
index 3f2d33ee20cca..e49802f26e07f 100644
@@ -1088,7 +1088,8 @@ static int pca953x_probe(struct i2c_client *client)
 		 */
 		reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
 		if (IS_ERR(reset_gpio))
-			return PTR_ERR(reset_gpio);
+			return dev_err_probe(dev, PTR_ERR(reset_gpio),
+					     "Failed to get reset gpio\n");
 	}
 
 	chip->client = client;
Signature · 1 line
2.39.5
author maintainer
#115 lore raw

PATCH 116/590 cpufreq: qcom: Fix qcom_cpufreq_hw_recalc_rate() to query LUT if LMh IRQ is not available

In reply to Greg Kroah-Hartman

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

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

From: Manivannan Sadhasivam <[email protected]>

[ Upstream commit 85d8b11351a8f15d6ec7a5e97909861cb3b6bcec ]

Currently, qcom_cpufreq_hw_recalc_rate() returns the LMh throttled frequency for the domain even if LMh IRQ is not available. But as per qcom_cpufreq_hw_get(), the driver has to query LUT entries to get the actual frequency of the domain. So do the same in qcom_cpufreq_hw_recalc_rate().

While doing so, refactor the existing qcom_cpufreq_hw_get() function so that qcom_cpufreq_hw_recalc_rate() can make use of the existing code and avoid code duplication. This also requires setting the qcom_cpufreq_data::policy even if LMh IRQ is not available.

Fixes 4370232c727b ("cpufreq: qcom-hw: Add CPU clock provider support")
---
 drivers/cpufreq/qcom-cpufreq-hw.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +11 -10
index 900d6844c43d3..2d3f00d410207 100644
@@ -143,14 +143,12 @@ static unsigned long qcom_lmh_get_throttle_freq(struct qcom_cpufreq_data *data)
 }
 
 /* Get the frequency requested by the cpufreq core for the CPU */
-static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)
+static unsigned int qcom_cpufreq_get_freq(struct cpufreq_policy *policy)
 {
 	struct qcom_cpufreq_data *data;
 	const struct qcom_cpufreq_soc_data *soc_data;
-	struct cpufreq_policy *policy;
 	unsigned int index;
 
-	policy = cpufreq_cpu_get_raw(cpu);
 	if (!policy)
 		return 0;
 
@@ -163,12 +161,10 @@ static unsigned int qcom_cpufreq_get_freq(unsigned int cpu)
 	return policy->freq_table[index].frequency;
 }
 
-static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
+static unsigned int __qcom_cpufreq_hw_get(struct cpufreq_policy *policy)
 {
 	struct qcom_cpufreq_data *data;
-	struct cpufreq_policy *policy;
 
-	policy = cpufreq_cpu_get_raw(cpu);
 	if (!policy)
 		return 0;
 
@@ -177,7 +173,12 @@ static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
 	if (data->throttle_irq >= 0)
 		return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ;
 
-	return qcom_cpufreq_get_freq(cpu);
+	return qcom_cpufreq_get_freq(policy);
+}
+
+static unsigned int qcom_cpufreq_hw_get(unsigned int cpu)
+{
+	return __qcom_cpufreq_hw_get(cpufreq_cpu_get_raw(cpu));
 }
 
 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
@@ -363,7 +364,7 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
 	 * If h/w throttled frequency is higher than what cpufreq has requested
 	 * for, then stop polling and switch back to interrupt mechanism.
 	 */
-	if (throttled_freq >= qcom_cpufreq_get_freq(cpu))
+	if (throttled_freq >= qcom_cpufreq_get_freq(cpufreq_cpu_get_raw(cpu)))
 		enable_irq(data->throttle_irq);
 	else
 		mod_delayed_work(system_highpri_wq, &data->throttle_work,
@@ -441,7 +442,6 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)
 		return data->throttle_irq;
 
 	data->cancel_throttle = false;
-	data->policy = policy;
 
 	mutex_init(&data->throttle_lock);
 	INIT_DEFERRABLE_WORK(&data->throttle_work, qcom_lmh_dcvs_poll);
@@ -552,6 +552,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy)
 
 	policy->driver_data = data;
 	policy->dvfs_possible_from_any_cpu = true;
+	data->policy = policy;
 
 	ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
 	if (ret) {
@@ -622,7 +623,7 @@ static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned lon
 {
 	struct qcom_cpufreq_data *data = container_of(hw, struct qcom_cpufreq_data, cpu_clk);
 
-	return qcom_lmh_get_throttle_freq(data);
+	return __qcom_cpufreq_hw_get(data->policy) * HZ_PER_KHZ;
 }
 
 static const struct clk_ops qcom_cpufreq_hw_clk_ops = {
Signature · 1 line
2.39.5
author maintainer
#116 lore raw

PATCH 117/590 cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks

In reply to Greg Kroah-Hartman

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

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

From: Manivannan Sadhasivam <[email protected]>

[ Upstream commit a9ba290d0b829012574b6821ba08815046e60c94 ]

determine_rate() callback is used by the clk_set_rate() API to get the closest rate of the target rate supported by the clock. If this callback is not implemented (nor round_rate() callback), then the API will assume that the clock cannot set the requested rate. And since there is no parent, it will return -EINVAL.

This is not an issue right now as clk_set_rate() mistakenly compares the target rate with cached rate and bails out early. But once that is fixed to compare the target rate with the actual rate of the clock (returned by recalc_rate()), then clk_set_rate() for this clock will start to fail as below:

cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22

So implement the determine_rate() callback that just returns the actual rate at which the clock is passed to the CPUs in a domain.

Fixes 4370232c727b ("cpufreq: qcom-hw: Add CPU clock provider support")
---
 drivers/cpufreq/qcom-cpufreq-hw.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/cpufreq/qcom-cpufreq-hw.c +13 -0
index 2d3f00d410207..e739978063839 100644
@@ -626,8 +626,21 @@ static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned lon
 	return __qcom_cpufreq_hw_get(data->policy) * HZ_PER_KHZ;
 }
 
+/*
+ * Since we cannot determine the closest rate of the target rate, let's just
+ * return the actual rate at which the clock is running at. This is needed to
+ * make clk_set_rate() API work properly.
+ */
+static int qcom_cpufreq_hw_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
+{
+	req->rate = qcom_cpufreq_hw_recalc_rate(hw, 0);
+
+	return 0;
+}
+
 static const struct clk_ops qcom_cpufreq_hw_clk_ops = {
 	.recalc_rate = qcom_cpufreq_hw_recalc_rate,
+	.determine_rate = qcom_cpufreq_hw_determine_rate,
 };
 
 static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
Signature · 1 line
2.39.5
author maintainer
#117 lore raw

PATCH 118/590 udp: Deal with race between UDP socket address change and rehash

In reply to Greg Kroah-Hartman

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

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

From: Stefano Brivio <[email protected]>

[ Upstream commit a502ea6fa94b1f7be72a24bcf9e3f5f6b7e6e90c ]

If a UDP socket changes its local address while it's receiving datagrams, as a result of connect(), there is a period during which a lookup operation might fail to find it, after the address is changed but before the secondary hash (port and address) and the four-tuple hash (local and remote ports and addresses) are updated.

Secondary hash chains were introduced by commit 30fff9231fad ("udp:
bind() optimisation") and, as a result, a rehash operation became needed to make a bound socket reachable again after a connect().

This operation was introduced by commit 719f835853a9 ("udp: add rehash on connect()") which isn't however a complete fix: the socket will be found once the rehashing completes, but not while it's pending.

This is noticeable with a socat(1) server in UDP4-LISTEN mode, and a client sending datagrams to it. After the server receives the first datagram (cf. _xioopen_ipdgram_listen()), it issues a connect() to the address of the sender, in order to set up a directed flow.

Now, if the client, running on a different CPU thread, happens to send a (subsequent) datagram while the server's socket changes its address, but is not rehashed yet, this will result in a failed lookup and a port unreachable error delivered to the client, as apparent from the following reproducer:

  LEN=$(($(cat /proc/sys/net/core/wmem_default) / 4))
  dd if=/dev/urandom bs=1 count=${LEN} of=tmp.in

  while :; do
  	taskset -c 1 socat UDP4-LISTEN:1337,null-eof OPEN:tmp.out,create,trunc &
  	sleep 0.1 || sleep 1
  	taskset -c 2 socat OPEN:tmp.in UDP4:localhost:1337,shut-null
  	wait
  done

where the client will eventually get ECONNREFUSED on a write() (typically the second or third one of a given iteration):

2024/11/13 21:28:23 socat[46901] E write(6, 0x556db2e3c000, 8192): Connection refused

This issue was first observed as a seldom failure in Podman's tests checking UDP functionality while using pasta(1) to connect the container's network namespace, which leads us to a reproducer with the lookup error resulting in an ICMP packet on a tap device:

  LOCAL_ADDR="$(ip -j -4 addr show|jq -rM '.[] | .addr_info[0] | select(.scope == "global").local')"

  while :; do
  	./pasta --config-net -p pasta.pcap -u 1337 socat UDP4-LISTEN:1337,null-eof OPEN:tmp.out,create,trunc &
  	sleep 0.2 || sleep 1
  	socat OPEN:tmp.in UDP4:${LOCAL_ADDR}:1337,shut-null
  	wait
  	cmp tmp.in tmp.out
  done

Once this fails:

tmp.in tmp.out differ: char 8193, line 29

we can finally have a look at what's going on:

  $ tshark -r pasta.pcap
      1   0.000000           :: ? ff02::16     ICMPv6 110 Multicast Listener Report Message v2
      2   0.168690 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192
      3   0.168767 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192
      4   0.168806 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192
      5   0.168827 c6:47:05:8d:dc:04 ? Broadcast    ARP 42 Who has 88.198.0.161? Tell 88.198.0.164
      6   0.168851 9a:55:9a:55:9a:55 ? c6:47:05:8d:dc:04 ARP 42 88.198.0.161 is at 9a:55:9a:55:9a:55
      7   0.168875 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192
      8   0.168896 88.198.0.164 ? 88.198.0.161 ICMP 590 Destination unreachable (Port unreachable)
      9   0.168926 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192
     10   0.168959 88.198.0.161 ? 88.198.0.164 UDP 8234 60260 ? 1337 Len=8192
     11   0.168989 88.198.0.161 ? 88.198.0.164 UDP 4138 60260 ? 1337 Len=4096
     12   0.169010 88.198.0.161 ? 88.198.0.164 UDP 42 60260 ? 1337 Len=0

On the third datagram received, the network namespace of the container initiates an ARP lookup to deliver the ICMP message.

In another variant of this reproducer, starting the client with:

  strace -f pasta --config-net -u 1337 socat UDP4-LISTEN:1337,null-eof OPEN:tmp.out,create,trunc 2>strace.log &

and connecting to the socat server using a loopback address:

socat OPEN:tmp.in UDP4:localhost:1337,shut-null

we can more clearly observe a sendmmsg() call failing after the first datagram is delivered:

[pid 278012] connect(173, 0x7fff96c95fc0, 16) = 0
[...]
[pid 278012] recvmmsg(173, 0x7fff96c96020, 1024, MSG_DONTWAIT, NULL) = -1 EAGAIN (Resource temporarily unavailable) [pid 278012] sendmmsg(173, 0x561c5ad0a720, 1, MSG_NOSIGNAL) = 1
[...]
[pid 278012] sendmmsg(173, 0x561c5ad0a720, 1, MSG_NOSIGNAL) = -1 ECONNREFUSED (Connection refused)

and, somewhat confusingly, after a connect() on the same socket succeeded.

Until commit 4cdeeee9252a ("net: udp: prefer listeners bound to an address"), the race between receive address change and lookup didn't actually cause visible issues, because, once the lookup based on the secondary hash chain failed, we would still attempt a lookup based on the primary hash (destination port only), and find the socket with the outdated secondary hash.

That change, however, dropped port-only lookups altogether, as side effect, making the race visible.

To fix this, while avoiding the need to make address changes and rehash atomic against lookups, reintroduce primary hash lookups as fallback, if lookups based on four-tuple and secondary hashes fail.

To this end, introduce a simplified lookup implementation, which doesn't take care of SO_REUSEPORT groups: if we have one, there are multiple sockets that would match the four-tuple or secondary hash, meaning that we can't run into this race at all.

v2:
- instead of synchronising lookup operations against address change plus rehash, reintroduce a simplified version of the original primary hash lookup as fallback

v1:
- fix build with CONFIG_IPV6=n: add ifdef around sk_v6_rcv_saddr usage (Kuniyuki Iwashima)
- directly use sk_rcv_saddr for IPv4 receive addresses instead of fetching inet_rcv_saddr (Kuniyuki Iwashima)
- move inet_update_saddr() to inet_hashtables.h and use that to set IPv4/IPv6 addresses as suitable (Kuniyuki Iwashima)
- rebase onto net-next, update commit message accordingly

---
 net/ipv4/udp.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
 net/ipv6/udp.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
net/ipv4/udp.c +56 -0
index ff85242720a0a..d2eeb6fc49b38 100644
@@ -420,6 +420,49 @@ u32 udp_ehashfn(const struct net *net, const __be32 laddr, const __u16 lport,
 			      udp_ehash_secret + net_hash_mix(net));
 }
 
+/**
+ * udp4_lib_lookup1() - Simplified lookup using primary hash (destination port)
+ * @net:	Network namespace
+ * @saddr:	Source address, network order
+ * @sport:	Source port, network order
+ * @daddr:	Destination address, network order
+ * @hnum:	Destination port, host order
+ * @dif:	Destination interface index
+ * @sdif:	Destination bridge port index, if relevant
+ * @udptable:	Set of UDP hash tables
+ *
+ * Simplified lookup to be used as fallback if no sockets are found due to a
+ * potential race between (receive) address change, and lookup happening before
+ * the rehash operation. This function ignores SO_REUSEPORT groups while scoring
+ * result sockets, because if we have one, we don't need the fallback at all.
+ *
+ * Called under rcu_read_lock().
+ *
+ * Return: socket with highest matching score if any, NULL if none
+ */
+static struct sock *udp4_lib_lookup1(const struct net *net,
+				     __be32 saddr, __be16 sport,
+				     __be32 daddr, unsigned int hnum,
+				     int dif, int sdif,
+				     const struct udp_table *udptable)
+{
+	unsigned int slot = udp_hashfn(net, hnum, udptable->mask);
+	struct udp_hslot *hslot = &udptable->hash[slot];
+	struct sock *sk, *result = NULL;
+	int score, badness = 0;
+
+	sk_for_each_rcu(sk, &hslot->head) {
+		score = compute_score(sk, net,
+				      saddr, sport, daddr, hnum, dif, sdif);
+		if (score > badness) {
+			result = sk;
+			badness = score;
+		}
+	}
+
+	return result;
+}
+
 /* called with rcu_read_lock() */
 static struct sock *udp4_lib_lookup2(const struct net *net,
 				     __be32 saddr, __be16 sport,
@@ -525,6 +568,19 @@ struct sock *__udp4_lib_lookup(const struct net *net, __be32 saddr,
 	result = udp4_lib_lookup2(net, saddr, sport,
 				  htonl(INADDR_ANY), hnum, dif, sdif,
 				  hslot2, skb);
+	if (!IS_ERR_OR_NULL(result))
+		goto done;
+
+	/* Primary hash (destination port) lookup as fallback for this race:
+	 *   1. __ip4_datagram_connect() sets sk_rcv_saddr
+	 *   2. lookup (this function): new sk_rcv_saddr, hashes not updated yet
+	 *   3. rehash operation updating _secondary and four-tuple_ hashes
+	 * The primary hash doesn't need an update after 1., so, thanks to this
+	 * further step, 1. and 3. don't need to be atomic against the lookup.
+	 */
+	result = udp4_lib_lookup1(net, saddr, sport, daddr, hnum, dif, sdif,
+				  udptable);
+
 done:
 	if (IS_ERR(result))
 		return NULL;
net/ipv6/udp.c +50 -0

62 lines not on this page · raw message

Signature · 1 line
2.39.5
author maintainer
#105 lore raw

PATCH 106/590 inetpeer: remove create argument of inet_getpeer_v[46]()

In reply to Greg Kroah-Hartman

6.12-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 c3ad41573b33e..c9846159a4c3e 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 a92664a5ef2ef..34f9dbc4ccb40 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 723ac9181558c..7a4cf60cece7c 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 f26841f1490f5..a66180a3eefe9 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 119/590 clk: imx8mp: Fix clkout1/2 support

In reply to Greg Kroah-Hartman

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

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

From: Marek Vasut <[email protected]>

[ Upstream commit a9b7c84d22fb1687d63ca2a386773015cf59436b ]

The CLKOUTn may be fed from PLL1/2/3, but the PLL1/2/3 has to be enabled first by setting PLL_CLKE bit 11 in CCM_ANALOG_SYS_PLLn_GEN_CTRL register. The CCM_ANALOG_SYS_PLLn_GEN_CTRL bit 11 is modeled by plln_out clock. Fix the clock tree and place the clkout1/2 under plln_sel instead of plain plln to let the clock subsystem correctly control the bit 11 and enable the PLL in case the CLKOUTn is supplied by PLL1/2/3.

---
 drivers/clk/imx/clk-imx8mp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-imx8mp.c +3 -2
index 516dbd170c8a3..fb18f507f1213 100644
@@ -399,8 +399,9 @@ static const char * const imx8mp_dram_core_sels[] = {"dram_pll_out", "dram_alt_r
 
 static const char * const imx8mp_clkout_sels[] = {"audio_pll1_out", "audio_pll2_out", "video_pll1_out",
 						  "dummy", "dummy", "gpu_pll_out", "vpu_pll_out",
-						  "arm_pll_out", "sys_pll1", "sys_pll2", "sys_pll3",
-						  "dummy", "dummy", "osc_24m", "dummy", "osc_32k"};
+						  "arm_pll_out", "sys_pll1_out", "sys_pll2_out",
+						  "sys_pll3_out", "dummy", "dummy", "osc_24m",
+						  "dummy", "osc_32k"};
 
 static struct clk_hw **hws;
 static struct clk_hw_onecell_data *clk_hw_data;
Signature · 1 line
2.39.5
author maintainer
#119 lore raw

PATCH 120/590 dt-bindings: clock: imx93: Drop IMX93_CLK_END macro definition

In reply to Greg Kroah-Hartman

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

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

From: Pengfei Li <[email protected]>

[ Upstream commit c0813ce2e5b0d1174782aff30d366509377abc7b ]

IMX93_CLK_END should be dropped as it is not part of the ABI.

Stable-dep-of: 32e9dea2645f ("dt-bindings: clock: imx93: Add SPDIF IPG clk")

---
 include/dt-bindings/clock/imx93-clock.h | 1 -
 1 file changed, 1 deletion(-)
include/dt-bindings/clock/imx93-clock.h +0 -1
index 787c9e74dc96d..a1d0b326bb6bf 100644
@@ -204,6 +204,5 @@
 #define IMX93_CLK_A55_SEL		199
 #define IMX93_CLK_A55_CORE		200
 #define IMX93_CLK_PDM_IPG		201
-#define IMX93_CLK_END			202
 
 #endif
Signature · 1 line
2.39.5
author maintainer
#120 lore raw

PATCH 121/590 dt-bindings: clock: Add i.MX91 clock support

In reply to Greg Kroah-Hartman

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

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

From: Pengfei Li <[email protected]>

[ Upstream commit f029d870096fcd8565a2ee8c2d0078b9aaec4fdb ]

i.MX91 has similar Clock Control Module(CCM) design as i.MX93, only add few new clock compared to i.MX93.
Add a new compatible string and some new clocks for i.MX91.

Stable-dep-of: 32e9dea2645f ("dt-bindings: clock: imx93: Add SPDIF IPG clk")

---
 Documentation/devicetree/bindings/clock/imx93-clock.yaml | 1 +
 include/dt-bindings/clock/imx93-clock.h                  | 5 +++++
 2 files changed, 6 insertions(+)
Documentation/devicetree/bindings/clock/imx93-clock.yaml +1 -0
index ccb53c6b96c11..98c0800732ef5 100644
@@ -16,6 +16,7 @@ description: |
 properties:
   compatible:
     enum:
+      - fsl,imx91-ccm
       - fsl,imx93-ccm
 
   reg:
include/dt-bindings/clock/imx93-clock.h +5 -0
index a1d0b326bb6bf..6c685067288b5 100644
@@ -204,5 +204,10 @@
 #define IMX93_CLK_A55_SEL		199
 #define IMX93_CLK_A55_CORE		200
 #define IMX93_CLK_PDM_IPG		201
+#define IMX91_CLK_ENET1_QOS_TSN     202
+#define IMX91_CLK_ENET_TIMER        203
+#define IMX91_CLK_ENET2_REGULAR     204
+#define IMX91_CLK_ENET2_REGULAR_GATE		205
+#define IMX91_CLK_ENET1_QOS_TSN_GATE		206
 
 #endif
Signature · 1 line
2.39.5
author maintainer
#121 lore raw

PATCH 122/590 dt-bindings: clock: imx93: Add SPDIF IPG clk

In reply to Greg Kroah-Hartman

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

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

From: Shengjiu Wang <[email protected]>

[ Upstream commit 32e9dea2645fa10dfa08b4e333918affaf1e4de5 ]

Add SPDIF IPG clk. The SPDIF IPG clock and root clock share same clock gate.

---
 include/dt-bindings/clock/imx93-clock.h | 1 +
 1 file changed, 1 insertion(+)
include/dt-bindings/clock/imx93-clock.h +1 -0
index 6c685067288b5..c393fad3a3469 100644
@@ -209,5 +209,6 @@
 #define IMX91_CLK_ENET2_REGULAR     204
 #define IMX91_CLK_ENET2_REGULAR_GATE		205
 #define IMX91_CLK_ENET1_QOS_TSN_GATE		206
+#define IMX93_CLK_SPDIF_IPG		207
 
 #endif
Signature · 1 line
2.39.5
author maintainer
#122 lore raw

PATCH 123/590 clk: imx93: Move IMX93_CLK_END macro to clk driver

In reply to Greg Kroah-Hartman

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

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

From: Pengfei Li <[email protected]>

[ Upstream commit 0af18ba60752e8a4ba34404c1d9a4a799da690f5 ]

IMX93_CLK_END was previously defined in imx93-clock.h to indicate the number of clocks. However, it is not part of the ABI. For starters it does no really appear in DTS. But what's more important - new clocks are described later, which contradicts this define in binding header. So move this macro to clock driver.

Stable-dep-of: 6a7853544482 ("clk: imx93: Add IMX93_CLK_SPDIF_IPG clock")

---
 drivers/clk/imx/clk-imx93.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/imx/clk-imx93.c +2 -0
index c6a9bc8ecc1fc..c8b65146e76ea 100644
@@ -15,6 +15,8 @@
 
 #include "clk.h"
 
+#define IMX93_CLK_END 202
+
 enum clk_sel {
 	LOW_SPEED_IO_SEL,
 	NON_IO_SEL,
Signature · 1 line
2.39.5
author maintainer
#123 lore raw

PATCH 124/590 clk: imx: add i.MX91 clk

In reply to Greg Kroah-Hartman

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

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

From: Pengfei Li <[email protected]>

[ Upstream commit a27bfff88dd2e1279c858311bc57ce4deb44f684 ]

Reuse i.MX93 clk driver for i.MX91, because i.MX91 reuses the Clock Control Module from i.MX93, with only a few clocks removed and a few clocks added.

For clocks specific to i.MX93 use PLAT_IMX93 to flag them, for clocks specific to i.MX91, use PLAT_IMX91 to flag them. Others are shared by both.

Stable-dep-of: 6a7853544482 ("clk: imx93: Add IMX93_CLK_SPDIF_IPG clock")

---
 drivers/clk/imx/clk-imx93.c | 63 +++++++++++++++++++++++--------------
 1 file changed, 39 insertions(+), 24 deletions(-)
drivers/clk/imx/clk-imx93.c +39 -24
index c8b65146e76ea..58a516dd385bf 100644
@@ -15,7 +15,10 @@
 
 #include "clk.h"
 
-#define IMX93_CLK_END 202
+#define IMX93_CLK_END 207
+
+#define PLAT_IMX93 BIT(0)
+#define PLAT_IMX91 BIT(1)
 
 enum clk_sel {
 	LOW_SPEED_IO_SEL,
@@ -55,6 +58,7 @@ static const struct imx93_clk_root {
 	u32 off;
 	enum clk_sel sel;
 	unsigned long flags;
+	unsigned long plat;
 } root_array[] = {
 	/* a55/m33/bus critical clk for system run */
 	{ IMX93_CLK_A55_PERIPH,		"a55_periph_root",	0x0000,	FAST_SEL, CLK_IS_CRITICAL },
@@ -65,7 +69,7 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_BUS_AON,		"bus_aon_root",		0x0300,	LOW_SPEED_IO_SEL, CLK_IS_CRITICAL },
 	{ IMX93_CLK_WAKEUP_AXI,		"wakeup_axi_root",	0x0380,	FAST_SEL, CLK_IS_CRITICAL },
 	{ IMX93_CLK_SWO_TRACE,		"swo_trace_root",	0x0400,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_M33_SYSTICK,	"m33_systick_root",	0x0480,	LOW_SPEED_IO_SEL, },
+	{ IMX93_CLK_M33_SYSTICK,	"m33_systick_root",	0x0480,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
 	{ IMX93_CLK_FLEXIO1,		"flexio1_root",		0x0500,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_FLEXIO2,		"flexio2_root",		0x0580,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_LPTMR1,		"lptmr1_root",		0x0700,	LOW_SPEED_IO_SEL, },
@@ -122,15 +126,15 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_HSIO_ACSCAN_80M,	"hsio_acscan_80m_root",	0x1f80,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_HSIO_ACSCAN_480M,	"hsio_acscan_480m_root", 0x2000, MISC_SEL, },
 	{ IMX93_CLK_NIC_AXI,		"nic_axi_root",		0x2080, FAST_SEL, CLK_IS_CRITICAL, },
-	{ IMX93_CLK_ML_APB,		"ml_apb_root",		0x2180,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_ML,			"ml_root",		0x2200,	FAST_SEL, },
+	{ IMX93_CLK_ML_APB,		"ml_apb_root",		0x2180,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_ML,			"ml_root",		0x2200,	FAST_SEL, 0, PLAT_IMX93, },
 	{ IMX93_CLK_MEDIA_AXI,		"media_axi_root",	0x2280,	FAST_SEL, },
 	{ IMX93_CLK_MEDIA_APB,		"media_apb_root",	0x2300,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_MEDIA_LDB,		"media_ldb_root",	0x2380,	VIDEO_SEL, },
+	{ IMX93_CLK_MEDIA_LDB,		"media_ldb_root",	0x2380,	VIDEO_SEL, 0, PLAT_IMX93, },
 	{ IMX93_CLK_MEDIA_DISP_PIX,	"media_disp_pix_root",	0x2400,	VIDEO_SEL, },
 	{ IMX93_CLK_CAM_PIX,		"cam_pix_root",		0x2480,	VIDEO_SEL, },
-	{ IMX93_CLK_MIPI_TEST_BYTE,	"mipi_test_byte_root",	0x2500,	VIDEO_SEL, },
-	{ IMX93_CLK_MIPI_PHY_CFG,	"mipi_phy_cfg_root",	0x2580,	VIDEO_SEL, },
+	{ IMX93_CLK_MIPI_TEST_BYTE,	"mipi_test_byte_root",	0x2500,	VIDEO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_MIPI_PHY_CFG,	"mipi_phy_cfg_root",	0x2580,	VIDEO_SEL, 0, PLAT_IMX93, },
 	{ IMX93_CLK_ADC,		"adc_root",		0x2700,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_PDM,		"pdm_root",		0x2780,	AUDIO_SEL, },
 	{ IMX93_CLK_TSTMR1,		"tstmr1_root",		0x2800,	LOW_SPEED_IO_SEL, },
@@ -139,13 +143,16 @@ static const struct imx93_clk_root {
 	{ IMX93_CLK_MQS2,		"mqs2_root",		0x2980,	AUDIO_SEL, },
 	{ IMX93_CLK_AUDIO_XCVR,		"audio_xcvr_root",	0x2a00,	NON_IO_SEL, },
 	{ IMX93_CLK_SPDIF,		"spdif_root",		0x2a80,	AUDIO_SEL, },
-	{ IMX93_CLK_ENET,		"enet_root",		0x2b00,	NON_IO_SEL, },
-	{ IMX93_CLK_ENET_TIMER1,	"enet_timer1_root",	0x2b80,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_ENET_TIMER2,	"enet_timer2_root",	0x2c00,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_ENET_REF,		"enet_ref_root",	0x2c80,	NON_IO_SEL, },
-	{ IMX93_CLK_ENET_REF_PHY,	"enet_ref_phy_root",	0x2d00,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_I3C1_SLOW,		"i3c1_slow_root",	0x2d80,	LOW_SPEED_IO_SEL, },
-	{ IMX93_CLK_I3C2_SLOW,		"i3c2_slow_root",	0x2e00,	LOW_SPEED_IO_SEL, },
+	{ IMX93_CLK_ENET,		"enet_root",		0x2b00,	NON_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_ENET_TIMER1,	"enet_timer1_root",	0x2b80,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_ENET_TIMER2,	"enet_timer2_root",	0x2c00,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_ENET_REF,		"enet_ref_root",	0x2c80,	NON_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_ENET_REF_PHY,	"enet_ref_phy_root",	0x2d00,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX91_CLK_ENET1_QOS_TSN,	"enet1_qos_tsn_root",   0x2b00, NON_IO_SEL, 0, PLAT_IMX91, },
+	{ IMX91_CLK_ENET_TIMER,		"enet_timer_root",      0x2b80, LOW_SPEED_IO_SEL, 0, PLAT_IMX91, },
+	{ IMX91_CLK_ENET2_REGULAR,	"enet2_regular_root",   0x2c80, NON_IO_SEL, 0, PLAT_IMX91, },
+	{ IMX93_CLK_I3C1_SLOW,		"i3c1_slow_root",	0x2d80,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
+	{ IMX93_CLK_I3C2_SLOW,		"i3c2_slow_root",	0x2e00,	LOW_SPEED_IO_SEL, 0, PLAT_IMX93, },
 	{ IMX93_CLK_USB_PHY_BURUNIN,	"usb_phy_root",		0x2e80,	LOW_SPEED_IO_SEL, },
 	{ IMX93_CLK_PAL_CAME_SCAN,	"pal_came_scan_root",	0x2f00,	MISC_SEL, }
 };
@@ -157,6 +164,7 @@ static const struct imx93_clk_ccgr {
 	u32 off;
 	unsigned long flags;
 	u32 *shared_count;
+	unsigned long plat;
 } ccgr_array[] = {
 	{ IMX93_CLK_A55_GATE,		"a55_alt",	"a55_alt_root",		0x8000, },
 	/* M33 critical clk for system run */
@@ -246,8 +254,10 @@ static const struct imx93_clk_ccgr {
 	{ IMX93_CLK_AUD_XCVR_GATE,	"aud_xcvr",	"audio_xcvr_root",	0x9b80, },
 	{ IMX93_CLK_SPDIF_GATE,		"spdif",	"spdif_root",		0x9c00, },
 	{ IMX93_CLK_HSIO_32K_GATE,	"hsio_32k",	"osc_32k",		0x9dc0, },
-	{ IMX93_CLK_ENET1_GATE,		"enet1",	"wakeup_axi_root",	0x9e00, },
-	{ IMX93_CLK_ENET_QOS_GATE,	"enet_qos",	"wakeup_axi_root",	0x9e40, },
+	{ IMX93_CLK_ENET1_GATE,		"enet1",	"wakeup_axi_root",	0x9e00, 0, NULL, PLAT_IMX93, },
+	{ IMX93_CLK_ENET_QOS_GATE,	"enet_qos",	"wakeup_axi_root",	0x9e40, 0, NULL, PLAT_IMX93, },
+	{ IMX91_CLK_ENET2_REGULAR_GATE, "enet2_regular",        "wakeup_axi_root",      0x9e00, 0, NULL, PLAT_IMX91, },
+	{ IMX91_CLK_ENET1_QOS_TSN_GATE,     "enet1_qos_tsn",        "wakeup_axi_root",      0x9e40, 0, NULL, PLAT_IMX91, },
 	/* Critical because clk accessed during CPU idle */
 	{ IMX93_CLK_SYS_CNT_GATE,	"sys_cnt",	"osc_24m",		0x9e80, CLK_IS_CRITICAL},
 	{ IMX93_CLK_TSTMR1_GATE,	"tstmr1",	"bus_aon_root",		0x9ec0, },
@@ -267,6 +277,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 	const struct imx93_clk_ccgr *ccgr;
 	void __iomem *base, *anatop_base;
 	int i, ret;
+	const unsigned long plat = (unsigned long)device_get_match_data(&pdev->dev);
 
 	clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws,
 					  IMX93_CLK_END), GFP_KERNEL);
@@ -316,17 +327,20 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 
 	for (i = 0; i < ARRAY_SIZE(root_array); i++) {
 		root = &root_array[i];
-		clks[root->clk] = imx93_clk_composite_flags(root->name,
-							    parent_names[root->sel],
-							    4, base + root->off, 3,
-							    root->flags);
+		if (!root->plat || root->plat & plat)
+			clks[root->clk] = imx93_clk_composite_flags(root->name,
+								    parent_names[root->sel],
+								    4, base + root->off, 3,
+								    root->flags);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(ccgr_array); i++) {
 		ccgr = &ccgr_array[i];
-		clks[ccgr->clk] = imx93_clk_gate(NULL, ccgr->name, ccgr->parent_name,
-						 ccgr->flags, base + ccgr->off, 0, 1, 1, 3,
-						 ccgr->shared_count);
+		if (!ccgr->plat || ccgr->plat & plat)
+			clks[ccgr->clk] = imx93_clk_gate(NULL,
+							 ccgr->name, ccgr->parent_name,
+							 ccgr->flags, base + ccgr->off, 0, 1, 1, 3,
+							 ccgr->shared_count);
 	}
 
 	clks[IMX93_CLK_A55_SEL] = imx_clk_hw_mux2("a55_sel", base + 0x4820, 0, 1, a55_core_sels,
@@ -356,7 +370,8 @@ static int imx93_clocks_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id imx93_clk_of_match[] = {
-	{ .compatible = "fsl,imx93-ccm" },
+	{ .compatible = "fsl,imx93-ccm", .data = (void *)PLAT_IMX93 },
+	{ .compatible = "fsl,imx91-ccm", .data = (void *)PLAT_IMX91 },
 	{ /* Sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, imx93_clk_of_match);
Signature · 1 line
2.39.5
author maintainer
#106 lore raw

PATCH 107/590 inetpeer: remove create argument of inet_getpeer()

In reply to Greg Kroah-Hartman

6.12-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 5bd7599634517..411a194f9c999 100644
@@ -174,13 +174,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.
@@ -188,16 +186,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.
 	 */
@@ -206,7 +199,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