6.8.2-rc1 review
Subsystems (13)
Sasha Levin
maintainercover 6.8.2-rc1 review
This is the start of the stable review cycle for the 6.8.2 release. There are 715 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 Tue Mar 26 10:34:31 PM UTC 2024. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=linux-6.8.y&id2=v6.8.1
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.8.y
and the diffstat can be found below.
Thanks,
Sasha
-------------
Pseudo-Shortlog of commits:
Abel Vesa (3):
arm64: dts: qcom: x1e80100-qcp: Fix supplies for LDOs 3E and 2J
arm64: dts: qcom: sm8550: Fix SPMI channels size
arm64: dts: qcom: sm8650: Fix SPMI channels size
Abhinav Kumar (1):
drm/msm/dpu: fix the programming of INTF_CFG2_DATA_HCTL_EN
Adam Butcher (1):
spi: spi-imx: fix off-by-one in mx51 CPU mode burst length
Adam Guerin (4):
crypto: qat - remove unused macros in qat_comp_alg.c
crypto: qat - removed unused macro in adf_cnv_dbgfs.c
crypto: qat - avoid division by zero
crypto: qat - remove double initialization of value
Adam Skladowski (1):
dt-bindings: msm: qcom, mdss: Include ommited fam-b compatible
Ajay Singh (2):
wifi: wilc1000: do not realloc workqueue everytime an interface is
added
wifi: wilc1000: fix multi-vif management when deleting a vif
Alex Bee (1):
drm/rockchip: inno_hdmi: Fix video timing
Alexander Stein (2):
media: tc358743: register v4l2 async device only after successful
setup
media: i2c: imx290: Fix IMX920 typo
Alexander Sverdlin (1):
spi: lpspi: Avoid potential use-after-free in probe()
Alexandre Ghiti (1):
riscv: Fix compilation error with FAST_GUP and rv32
Alexey I. Froloff (1):
ACPI: resource: Do IRQ override on Lunnen Ground laptops
Alexey Kodanev (1):
RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store()
Alexis Lothoré (4):
wifi: wilc1000: fix declarations ordering
wifi: wilc1000: fix RCU usage in connect path
wifi: wilc1000: prevent use-after-free on vif when cleaning up all
interfaces
wifi: wilc1000: revert reset line logic flip
Amir Goldstein (1):
ovl: relax WARN_ON in ovl_verify_area()
Anastasia Belova (1):
cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return
value
Andre Przywara (1):
firmware: arm_scmi: Fix double free in SMC transport cleanup path
Andrejs Cainikovs (1):
arm64: dts: ti: k3-am62-main: disable usb lpm
Andrew Davis (1):
arm64: dts: ti: k3-j721e: Fix mux-reg-masks in hbmc_mux
Andrey Grafin (2):
libbpf: Apply map_set_def_max_entries() for inner_maps on creation selftest/bpf: Add map_in_maps with BPF_MAP_TYPE_PERF_EVENT_ARRAY
values
Andrey Skvortsov (2):
Bluetooth: hci_h5: Add ability to allocate memory for private data
Bluetooth: btrtl: fix out of bounds memory access
Andrii Nakryiko (10):
libbpf: Fix faccessat() usage on Android
libbpf: fix __arg_ctx type enforcement for perf_event programs
libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim
API
libbpf: Add bpf_token_create() API
libbpf: Add btf__new_split() API that was declared but not implemented
libbpf: Add missed btf_ext__raw_data() API
bpf: make sure scalar args don't accept __arg_nonnull tag
bpf: don't emit warnings intended for global subprogs for static
subprogs
libbpf: fix return value for PERF_EVENT __arg_ctx type fix up check
bpf: don't infer PTR_TO_CTX for programs with unnamed context type
Andrzej Pietrasiewicz (1):
media: videobuf2: Add missing doc comment for waiting_in_dqbuf
Andy Shevchenko (2):
backlight: hx8357: Fix potential NULL pointer dereference
serial: 8250_exar: Don't remove GPIO device on suspend
AngeloGioacchino Del Regno (1):
drm/mediatek: dsi: Fix DSI RGB666 formats and definitions
Antoniu Miclaus (1):
rtc: max31335: fix interrupt status reg
Anup Patel (1):
RISC-V: KVM: Forward SEED CSR access to user space
Ard Biesheuvel (3):
x86/sme: Fix memory encryption setting if enabled by default and not
overridden
x86/efistub: Clear decompressor BSS in native EFI entrypoint x86/efistub: Don't clear BSS twice in mixed mode
Armin Wolf (2):
ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() platform/x86/amd/pmf: Do not use readl() for policy buffer access
Arnaldo Carvalho de Melo (1):
perf bpf: Clean up the generated/copied vmlinux.h
Arnaud Pouliquen (2):
remoteproc: stm32: Fix incorrect type in assignment for va
remoteproc: stm32: Fix incorrect type assignment returned by
stm32_rproc_get_loaded_rsc_tablef
Arnd Bergmann (12):
fs/select: rework stack allocation hack for clang
cpufreq: qcom-hw: add CONFIG_COMMON_CLK dependency
wifi: brcmsmac: avoid function pointer casts
crypto: qat - avoid memcpy() overflow warning
media: pvrusb2: fix pvr2_stream_callback casts
crypto: arm/sha - fix function cast warnings
mtd: rawnand: lpc32xx_mlc: fix irq handler prototype
media: dvb-frontends: avoid stack overflow warnings with clang
media: mediatek: vcodec: avoid -Wcast-function-type-strict warning
scsi: csiostor: Avoid function pointer casts
scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn
soc: fsl: dpio: fix kcalloc() argument order
Artem Savkov (1):
selftests/bpf: Fix potential premature unload in bpf_testmod
Arthur Grillo (1):
drm: Fix drm_fixp2int_round() making it add 0.5
Arınç ÜNAL (3):
net: dsa: mt7530: prevent possible incorrect XTAL frequency selection
net: dsa: mt7530: fix link-local frames that ingress vlan filtering
ports
net: dsa: mt7530: fix handling of all link-local frames
Asad Kamal (1):
drm/amd/pm: Fix esm reg mask use to get pcie speed
Athaariq Ardhiansyah (1):
ALSA: hda/realtek: fix ALC285 issues on HP Envy x360 laptops
Audra Mitchell (1):
workqueue.c: Increase workqueue name length
Babu Moger (2):
x86/resctrl: Remove hard-coded memory bandwidth limit x86/resctrl: Read supported bandwidth sources from CPUID
Baochen Qiang (2):
wifi: ath11k: fix a possible dead lock caused by ab->base_lock
wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use
Baokun Li (1):
erofs: fix lockdep false positives on initializing erofs_pseudo_mnt
Bart Van Assche (1):
fs: Fix rw_hint validation
Bartosz Golaszewski (1):
Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with
gpiod_get_optional()
Baruch Siach (1):
mtd: maps: physmap-core: fix flash size larger than 32-bit
Basavaraj Natikar (2):
HID: amd_sfh: Update HPD sensor structure elements
HID: amd_sfh: Avoid disabling the interrupt
Ben Wolsieffer (1):
watchdog: stm32_iwdg: initialize default timeout
Benjamin Berg (3):
wifi: cfg80211: add RNR with reporting AP information
wifi: mac80211: use deflink and fix typo in link ID check
wifi: cfg80211: set correct param change count in ML element
Benjamin Gaignard (1):
media: usbtv: Remove useless locks in usbtv_video_free()
Benjamin Lin (2):
wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps
wifi: mt76: mt7996: fix HIF_TXD_V2_1 value
Bert Karwatzki (1):
iommu: Fix compilation without CONFIG_IOMMU_INTEL
Bhavya Kapoor (4):
arm64: dts: ti: k3-j7200-common-proc-board: Modify Pinmux for
wkup_uart0 and mcu_uart0
arm64: dts: ti: k3-j7200-common-proc-board: Remove clock-frequency
from mcu_uart0
arm64: dts: ti: k3-j721s2-common-proc-board: Remove Pinmux for CTS and
RTS in wkup_uart0
arm64: dts: ti: k3-j784s4-evm: Remove Pinmux for CTS and RTS in
wkup_uart0
Bitterblue Smith (3):
wifi: rtw88: 8821cu: Fix firmware upload fail
wifi: rtw88: 8821c: Fix beacon loss and disconnect
wifi: rtw88: 8821c: Fix false alarm count
Bjorn Andersson (2):
pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc
Breno Leitao (1):
net: blackhole_dev: fix build warning for ethh set but not used
Brian Masney (1):
fbdev/simplefb: change loglevel when the power domains cannot be
parsed
Bryan O'Donoghue (1):
clk: Fix clk_core_get NULL dereference
Changbin Du (1):
modules: wait do_free_init correctly
Changhuang Liang (1):
staging: media: starfive: Set 16 bpp for capture_raw device
Chao Yu (15):
f2fs: compress: fix to guarantee persisting compressed blocks by CP
f2fs: compress: fix to cover normal cluster write with cp_rwsem
f2fs: compress: fix to avoid inconsistence bewteen i_blocks and dnode
f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic
f2fs: zone: fix to wait completion of last bio in zone correctly
f2fs: compress: fix to cover f2fs_disable_compressed_file() w/ i_sem
f2fs: fix to avoid potential panic during recovery
f2fs: fix to create selinux label during whiteout initialization
f2fs: compress: fix to check zstd compress level correctly in mount
option
f2fs: compress: fix to check compress flag w/ .i_sem lock
f2fs: fix to use correct segment type in f2fs_allocate_data_block()
f2fs: ro: compress: fix to avoid caching unaligned extent
f2fs: fix to truncate meta inode pages forcely
f2fs: zone: fix to remove pow2 check condition for zoned block device
f2fs: fix to avoid use-after-free issue in f2fs_filemap_fault
Charles Keepax (1):
ASoC: Intel: ssp-common: Add stub for sof_ssp_get_codec_name
Charlie Jenkins (1):
riscv: Only check online cpus for emulated accesses
Chen Ni (2):
sr9800: Add check for usbnet_get_endpoints drm/tegra: dsi: Add missing check for of_find_device_by_node
Chen-Yu Tsai (4):
arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF
pinctrl: mediatek: Drop bogus slew rate register range for MT8186
pinctrl: mediatek: Drop bogus slew rate register range for MT8192
clk: mediatek: mt8183: Correct parent of CLK_INFRA_SSPM_32K_SELF
Chintan Vankar (1):
arm64: dts: ti: k3-j784s4-main: Fix mux-reg-masks in serdes_ln_ctrl
Christoph Hellwig (1):
iomap: clear the per-folio dirty bits on all writeback failures
Christophe JAILLET (17):
mmc: wmt-sdmmc: remove an incorrect release_mem_region() call in the
.remove function
drm/tegra: dsi: Fix some error handling paths in tegra_dsi_probe() drm/tegra: dsi: Fix missing pm_runtime_disable() in the error handling
path of tegra_dsi_probe()
drm/tegra: hdmi: Fix some error handling paths in tegra_hdmi_probe() drm/tegra: rgb: Fix some error handling paths in tegra_dc_rgb_probe() drm/tegra: rgb: Fix missing clk_put() in the error handling paths of
tegra_dc_rgb_probe()
drm/tegra: output: Fix missing i2c_put_adapter() in the error handling
paths of tegra_output_probe()
PCI/P2PDMA: Fix a sleeping issue in a RCU read section
PCI: switchtec: Fix an error handling path in switchtec_pci_probe()
clk: hisilicon: hi3519: Release the correct number of gates in
hi3519_clk_unregister()
clk: hisilicon: hi3559a: Fix an erroneous devm_kfree()
clk: mediatek: mt8135: Fix an error handling path in
clk_mt8135_apmixed_probe()
clk: mediatek: mt7622-apmixedsys: Fix an error handling path in
clk_mt8135_apmixed_probe() perf pmu: Fix a potential memory leak in perf_pmu__lookup()
net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr()
NFS: Fix an off by one in root_nfs_cat() thermal/drivers/mediatek/lvts_thermal: Fix a memory leak in an error
handling path
Christophe Leroy (1):
powerpc: Force inlining of arch_vmap_p{u/m}d_supported()
Chun-Yi Lee (1):
aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts
Chunguang Xu (1):
nvme: fix reconnection fail due to reserved tag allocation
Claudiu Beznea (3):
arm64: dts: renesas: rzg3s-smarc-som: Guard Ethernet IRQ GPIO hogs
pinctrl: renesas: rzg2l: Fix locking in rzg2l_dt_subnode_to_map()
clk: renesas: r9a07g04[34]: Use SEL_SDHI1_STS status configuration for
SD1 mux
Colin Ian King (1):
usb: gadget: net2272: Use irqflags in the call to net2272_probe_fin
Craig Tatlor (1):
ARM: dts: qcom: msm8974: correct qfprom node size
Cristian Ciocaltea (6):
ASoC: amd: acp: Add missing error handling in sof-mach
ASoC: SOF: amd: Fix memory leak in amd_sof_acp_probe()
ASoC: SOF: core: Skip firmware test for custom loaders
ASoC: SOF: amd: Compute file paths on firmware load
ASoC: SOF: amd: Move signed_fw_image to struct acp_quirk_entry
ASoC: SOF: amd: Skip IRAM/DRAM size modification for Steam Deck OLED
Dafna Hirschfeld (1):
drm/xe: Replace 'grouped target' in Makefile with pattern rule
Damian Muszynski (2):
crypto: qat - fix ring to service map for dcc in 4xxx
crypto: qat - fix ring to service map for dcc in 420xx
Dan Carpenter (6):
io_uring/net: fix overflow check in io_recvmsg_mshot_prep()
ASoC: SOF: Add some bounds checking to firmware data lib/stackdepot: off by one in depot_fetch_stack()
bus: mhi: ep: check the correct variable in
mhi_ep_register_controller()
staging: greybus: fix get_channel_from_mode() failure path
char: xilinx_hwicap: Fix NULL vs IS_ERR() bug
Daniel Golle (3):
clk: mediatek: mt7981-topckgen: flag SGM_REG_SEL as critical
net: mediatek: mtk_eth_soc: clear MAC_MCR_FORCE_LINK only when MAC is
up
net: ethernet: mtk_eth_soc: fix PPE hanging issue
Daniel Lezcano (1):
powercap: dtpm_cpu: Fix error check against freq_qos_add_request()
Daniel Thompson (3):
backlight: da9052: Fully initialize backlight_properties during probe
backlight: lm3639: Fully initialize backlight_properties during probe
backlight: lp8788: Fully initialize backlight_properties during probe
Daniil Dulov (2):
media: go7007: add check of return value of go7007_read_addr()
media: pvrusb2: remove redundant NULL check
Dave Airlie (2):
nouveau: reset the bo resource bus info after an eviction nouveau/gsp: don't check devinit disable on GSP.
Dave Jiang (2):
ACPI: HMAT: Remove register of memory node for generic target
cxl: Fix the incorrect assignment of SSLBIS entry pointer initial
location
Dave Wysochanski (1):
NFS: Fix nfs_netfs_issue_read() xarray locking for writeback interrupt
David E. Box (2):
platform/x86/intel/pmc/lnl: Remove SSRAM support platform/x86/intel/pmc/arl: Put GNA device in D3
David Gow (8):
kunit: test: Log the correct filter string in executor_test lib/cmdline: Fix an invalid format specifier in an assertion msg
lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg
time: test: Fix incorrect format specifier
rtc: test: Fix invalid format specifier.
net: test: Fix printf format specifier in skb_segment kunit test drm/xe/tests: Fix printf format specifiers in xe_migrate test
drm: tests: Fix invalid printf format specifiers in KUnit tests
David Heidelberg (1):
arm64: dts: qcom: sdm845-oneplus-common: improve DAI node naming
David Howells (4):
cifs: Fix writeback data corruption
afs: Revert "afs: Hide silly-rename files from userspace"
afs: Don't cache preferred address
afs: Fix occasional rmdir-then-VNOVNODE with generic/011
David Lechner (2):
spi: consolidate setting message->spi
spi: move split xfers for CS_WORD emulation
David Regan (1):
mtd: rawnand: brcmnand: exec_op helper functions return type fixes
Deren Wu (3):
wifi: mt76: mt7925: update PCIe DMA settings
wifi: mt76: mt7921e: fix use-after-free in free_irq()
wifi: mt76: mt7925e: fix use-after-free in free_irq()
Devarsh Thakkar (2):
arm64: dts: ti: Add common1 register space for AM65x SoC
arm64: dts: ti: Add common1 register space for AM62x SoC
Dmitry Baryshkov (11):
soc: qcom: socinfo: rename PM2250 to PM4125
arm64: dts: qcom: rename PM2250 to PM4125
arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY
drm: ci: use clk_ignore_unused for apq8016
drm/msm/dpu: finalise global state object
drm/msm/a6xx: specify UBWC config for sc7180
phy: qcom: qmp-usb: split USB-C PHY driver
phy: qcom: qmp-usbc: add support for the Type-C handling
phy: qcom: qmp-usbc: handle CLAMP register in a correct way
Douglas Anderson (1):
drm/panel: boe-tv101wum-nl6: make use of prepare_prev_first
Duanqiang Wen (1):
net: txgbe: fix clk_name exceed MAX_DEV_ID limits
Duoming Zhou (3):
wifi: brcm80211: handle pmk_op allocation failure
nfp: flower: handle acti_netdevs allocation failure
clk: zynq: Prevent null pointer dereference caused by kmalloc failure
Dylan Hung (1):
i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling
Edward Adam Davis (1):
media: pvrusb2: fix uaf in pvr2_context_set_notify
Emmanuel Grumbach (2):
wifi: iwlwifi: mvm: fix the TLC command after ADD_STA
wifi: iwlwifi: mvm: don't set the MFP flag for the GTK
Eric Dumazet (8):
sock_diag: annotate data-races around sock_diag_handlers[family]
inet_diag: annotate data-races around inet_diag_table[]
ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down()
net: ip_tunnel: make sure to pull inner header in ip_tunnel_rcv()
tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge() net/sched: taprio: proper TCA_TAPRIO_TC_ENTRY_INDEX check
packet: annotate data-races around ignore_outgoing
net: move dev->state into net_device_read_txrx group
Ethan Zhao (3):
PCI: Make pci_dev_is_disconnected() helper public for other drivers iommu/vt-d: Don't issue ATS Invalidation request when device is
disconnected
iommu/vt-d: Improve ITE fault handling if target device isn't present
Eugen Hristev (2):
arm64: dts: mediatek: mt8192: fix vencoder clock name
arm64: dts: mediatek: mt8186: fix VENC power domain clocks
Ezra Buehler (1):
mtd: spinand: esmt: Extend IDs to 5 bytes
Fedor Pchelkin (1):
drm/tegra: put drm_gem_object ref on error in tegra_fb_create
Fei Shao (1):
spi: spi-mt65xx: Fix NULL pointer access in interrupt handler
Felix Maurer (1):
hsr: Handle failures in module init
Filipe Manana (1):
btrfs: fix race when detecting delalloc ranges during fiemap
Florian Fainelli (1):
spi: Fix error code checking in spi_mem_exec_op()
Frank Li (2):
arm64: dts: imx8qm: Align edma3 power-domains resources indentation
arm64: dts: imx8qm: Correct edma3 power-domains and interrupt numbers
Frederic Weisbecker (2):
rcu/exp: Fix RCU expedited parallel grace period kworker allocation
failure recovery
rcu/exp: Handle RCU expedited grace period kworker allocation failure
Frieder Schrempf (7):
arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on OSM-S
i.MX8MM
arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on SL/BL
i.MX8MM arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals
on BL OSM-S board
arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals
on BL board
arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals
on BL OSM-S board
arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals
on BL board
arm64: dts: imx8mm-kontron: Fix interrupt for RTC on OSM-S i.MX8MM
module
Frédéric Danis (1):
Bluetooth: Fix eir name length
Gabor Juhos (3):
clk: qcom: gcc-ipq5018: fix 'enable_reg' offset of 'gcc_gmac0_sys_clk'
clk: qcom: gcc-ipq5018: fix 'halt_reg' offset of 'gcc_pcie1_pipe_clk'
clk: qcom: gcc-ipq5018: fix register offset for GCC_UBI0_AXI_ARES
reset
Gabriel Krisman Bertazi (2):
ovl: Always reject mounting over case-insensitive directories
io_uring: Fix release of pinned pages when __io_uaddr_map fails
Gavrilov Ilia (6):
tcp: fix incorrect parameter validation in the do_tcp_getsockopt()
function
ipmr: fix incorrect parameter validation in the ip_mroute_getsockopt()
function
l2tp: fix incorrect parameter validation in the pppol2tp_getsockopt()
function
udp: fix incorrect parameter validation in the udp_lib_getsockopt()
function
net: kcm: fix incorrect parameter validation in the kcm_getsockopt)
function
net/x25: fix incorrect parameter validation in the x25_getsockopt()
function
Geert Uytterhoeven (11):
ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate
arm64: dts: renesas: r8a779g0: Restore sort order
arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2
ARM: dts: arm: realview: Fix development chip ROM compatible value
arm64: dts: renesas: r8a779a0: Correct avb[01] reg sizes
arm64: dts: renesas: r8a779g0: Correct avb[01] reg sizes
clk: renesas: r8a779g0: Fix PCIe clock name
pinctrl: renesas: r8a779g0: Add missing SCIF_CLK2 pin group/function
clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks
clk: renesas: r8a779f0: Correct PFC/GPIO parent clock
pinctrl: renesas: Allow the compiler to optimize away sh_pfc_pm
Gen Xu (1):
wifi: mt76: mt792x: fix ethtool warning
Geoffrey D. Bennett (4):
ALSA: scarlett2: Fix Scarlett 4th Gen 4i4 low-voltage detection
ALSA: scarlett2: Fix Scarlett 4th Gen autogain status values
ALSA: scarlett2: Fix Scarlett 4th Gen input gain range
ALSA: scarlett2: Fix Scarlett 4th Gen input gain range again
George Stark (1):
leds: aw2013: Unlock mutex before destroying it
Gergo Koteles (5):
ALSA: hda/tas2781: use dev_dbg in system_resume
ALSA: hda/tas2781: add lock to system_suspend
ALSA: hda/tas2781: do not reset cur_* values in runtime_suspend
ALSA: hda/tas2781: do not call pm_runtime_force_* in
system_resume/suspend
ALSA: hda/tas2781: restore power state after system_resume
Hao Zhang (1):
wifi: mt76: mt7925: fix mcu query command fail
Harry Wentland (2):
drm: Don't treat 0 as -1 in drm_fixp2int_ceil
drm/vkms: Avoid reading beyond LUT array
Hayes Wang (1):
r8152: fix unknown device for choose_configuration
Heiko Carstens (1):
s390/cache: prevent rebuild of shared_cpu_list
Heiko Stuebner (3):
arm64: dts: rockchip: add missing interrupt-names for rk356x vdpu
arm64: dts: rockchip: fix reset-names for rk356x i2s2 controller
arm64: dts: rockchip: drop rockchip,trcm-sync-tx-only from rk3588 i2s
Hongyu Jin (1):
dm io: Support IO priority
Howard Hsu (1):
wifi: mt76: mt7996: fix HE beamformer phy cap for station vif
Hsin-Te Yuan (1):
arm64: dts: mt8195-cherry-tomato: change watchdog reset boot flow
Hsin-Yi Wang (2):
drm/panel-edp: use put_sync in unprepare
drm/mediatek: Fix a null pointer crash in
mtk_drm_crtc_finish_page_flip
Hugo Villeneuve (1):
serial: max310x: fix syntax error in IRQ error message
Ian Rogers (5):
perf pmu: Treat the msr pmu as software
perf srcline: Add missed addr2line closes
perf expr: Fix "has_event" function for metric style events perf stat: Avoid metric-only segv
perf metric: Don't remove scale from counts
Ido Schimmel (2):
selftests: forwarding: Add missing multicast routing config entries
selftests: forwarding: Fix ping failure due to short timeout
Ignat Korchagin (1):
net: veth: do not manipulate GRO when using XDP
Igor Prusov (1):
clk: meson: Add missing clocks to axg_clk_regmaps
Ilan Peer (1):
wifi: iwlwifi: mvm: Fix the listener MAC filter flags
Ilpo Järvinen (1):
PCI/DPC: Print all TLP Prefixes, not just the first
Jaegeuk Kim (1):
f2fs: check number of blocks in a current section
Jai Luthra (1):
arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS
James Clark (1):
coresight: Fix issue where a source device's helpers aren't disabled
Jan Höppner (1):
s390/dasd: Use dev_*() for device log messages
Jan Kara (2):
quota: Fix rcu annotations of inode dquot pointers
quota: Properly annotate i_dquot arrays with __rcu
Janne Grunau (1):
spi: Restore delays for non-GPIO chip select
Jason Gunthorpe (1):
iommu/arm-smmu-v3: Check that the RID domain is S1 in SVA
Jayesh Choudhary (1):
arm64: dts: ti: k3-am69-sk: remove assigned-clock-parents for unused
VP
Jeff LaBundy (1):
Input: iqs7222 - add support for IQS7222D v1.1 and v1.2
Jens Axboe (5):
io_uring: remove looping around handling traditional task_work
io_uring: remove unconditional looping in local task_work handling io_uring/net: unify how recvmsg and sendmsg copy in the msghdr io_uring/net: move receive multishot out of the generic msghdr path
io_uring: don't save/restore iowait state
Jeremy Kerr (1):
net: mctp: copy skb ext data when fragmenting
Jernej Skrabec (4):
media: cedrus: h265: Fix configuring bitstream size
media: sun8i-di: Fix coefficient writes
media: sun8i-di: Fix power on/off sequences
media: sun8i-di: Fix chroma difference threshold
Jerome Brunet (4):
ASoC: meson: aiu: fix function pointer type mismatch
ASoC: meson: t9015: fix function pointer type mismatch
ASoC: meson: axg-tdm-interface: fix mclk setup without mclk-fs
ASoC: meson: axg-tdm-interface: add frame rate constraint
Ji Sheng Teoh (1):
watchdog: starfive: Check pm_runtime_enabled() before decrementing
usage counter
Jianhua Lu (1):
backlight: ktz8866: Correct the check for of_property_read_u32
Jie Wang (1):
net: hns3: fix port duplex configure error in IMP reset
Jijie Shao (1):
net: hns3: fix wrong judgment condition issue
Jinjie Ruan (1):
wifi: mwifiex: debugfs: Drop unnecessary error check for
debugfs_create_dir()
Jiri Olsa (1):
bpftool: Fix wrong free call in do_show_link
Jiri Pirko (3):
dpll: spec: use proper enum for pin capabilities attribute
dpll: fix dpll_xa_ref_*_del() for multiple registrations
devlink: fix port new reply cmd type
Jiri Slaby (SUSE) (1):
tty: vt: fix 20 vs 0x20 typo in EScsiignore
Johan Carlsson (1):
ALSA: usb-audio: Stop parsing channels bits when all channels are
found.
Johan Hovold (1):
PCI/AER: Fix rootport attribute paths in ABI docs
Johannes Berg (8):
wifi: iwlwifi: mvm: report beacon protection failures
wifi: iwlwifi: dbg-tlv: ensure NUL termination
wifi: iwlwifi: acpi: fix WPFC reading
wifi: iwlwifi: mvm: initialize rates in FW earlier
wifi: iwlwifi: mvm: d3: fix IPN byte order
wifi: iwlwifi: always have 'uats_enabled'
wifi: iwlwifi: mvm: fix erroneous queue index mask
wifi: iwlwifi: mvm: don't set replay counters to 0xff
John Keeping (1):
regulator: userspace-consumer: add module device table
John Ogness (6):
printk: nbcon: Relocate 32bit seq macros
printk: ringbuffer: Do not skip non-finalized records with
prb_next_seq()
printk: Wait for all reserved records with pr_flush()
printk: Add this_cpu_in_panic()
printk: ringbuffer: Cleanup reader terminology
printk: ringbuffer: Skip non-finalized records in panic
Jon Hunter (1):
memory: tegra: Correct DLA client names
Jonah Palmer (1):
vdpa/mlx5: Allow CVQ size changes
Jonas Dreßler (3):
Bluetooth: Remove HCI_POWER_OFF_TIMEOUT
Bluetooth: mgmt: Remove leftover queuing of power_off work
Bluetooth: Remove superfluous call to hci_conn_check_pending()
Jonathan Bell (1):
PCI: brcmstb: Fix broken brcm_pcie_mdio_write() polling
Jorge Mora (2):
NFSv4.2: fix nfs4_listxattr kernel BUG at mm/usercopy.c:102 NFSv4.2: fix listxattr maximum XDR buffer size
Josef Bacik (1):
nfs: fix panic when nfs4_ff_layout_prepare_ds() fails
Josh Poimboeuf (1):
objtool: Fix UNWIND_HINT_{SAVE,RESTORE} across basic blocks
José Roberto de Souza (1):
drm/xe: Skip VMAs pin when requesting signal to the last XE_EXEC
Judith Mendez (1):
arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC
Juergen Gross (2):
xen/evtchn: avoid WARN() when unbinding an event channel xen/events: increment refcnt only if event channel is refcounted
Julien Massot (2):
media: cadence: csi2rx: use match fwnode for media link
media: v4l2: cci: print leading 0 on error
Jérôme Pouiller (1):
wifi: wfx: fix memory leak when starting AP
Jörg Wedekind (1):
PCI: Mark 3ware-9650SE Root Port Extended Tags as broken
Kai Huang (1):
x86/asm: Remove the __iomem annotation of movdir64b()'s dst argument
Kajol Jain (1):
powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value
checks
Kamal Heib (1):
net: ena: Remove ena_select_queue
Kang Yang (1):
wifi: ath12k: fix incorrect logic of calculating vdev_stats_id
Kees Cook (2):
pstore: inode: Only d_invalidate() is needed x86, relocs: Ignore relocations in .notes section
Keisuke Nishimura (2):
sched/fair: Take the scheduling domain into account in
select_idle_smt()
sched/fair: Take the scheduling domain into account in
select_idle_core()
Komal Bajaj (2):
arm64: dts: qcom: qcm6490-idp: Correct the voltage setting for vph_pwr
arm64: dts: qcom: qcs6490-rb3gen2: Correct the voltage setting for
vph_pwr
Konrad Dybcio (13):
arm64: dts: qcom: sc8180x: Hook up VDD_CX as GCC parent domain
arm64: dts: qcom: sc8180x: Fix up big CPU idle state entry latency
arm64: dts: qcom: sc8180x: Add missing CPU off state
arm64: dts: qcom: sc8180x: Fix eDP PHY power-domains
arm64: dts: qcom: sc8180x: Don't hold MDP core clock at FMAX
arm64: dts: qcom: sc8180x: Require LOW_SVS vote for MMCX if DISPCC is
on
arm64: dts: qcom: sc8180x: Add missing CPU<->MDP_CFG path
arm64: dts: qcom: sc8180x: Shrink aoss_qmp register space size
arm64: dts: qcom: sm8450: Add missing interconnects to serial
arm64: dts: qcom: sdm845: Use the Low Power Island CX/MX for SLPI
clk: qcom: reset: Commonize the de/assert functions
clk: qcom: reset: Ensure write completion on reset de/assertion
clk: qcom: dispcc-sdm845: Adjust internal GDSC wait times
Konstantin Taranov (5):
RDMA/mana_ib: Fix bug in creation of dma regions RDMA/mana_ib: Introduce mdev_to_gc helper function RDMA/mana_ib: Introduce mana_ib_get_netdev helper function RDMA/mana_ib: Introduce mana_ib_install_cq_cb helper function RDMA/mana_ib: Use virtual address in dma regions for MRs
Krzysztof Kozlowski (5):
arm64: dts: qcom: x1e80100: drop qcom,drv-count
arm64: dts: qcom: sdm845-db845c: correct PCIe wake-gpios
arm64: dts: qcom: sm8150: correct PCIe wake-gpios
riscv: dts: starfive: jh7100: fix root clock names
soundwire: stream: add missing const to Documentation
Kuniyuki Iwashima (3):
af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
rds: tcp: Fix use-after-free of net in reqsk_timer_handler().
tcp: Fix refcnt handling in __inet_hash_connect().
Kévin L'hôpital (1):
net: phy: fix phy_get_internal_delay accessing an empty array
Lad Prabhakar (3):
arm64: dts: renesas: rzg2l: Add missing interrupts to IRQC nodes
arm64: dts: renesas: r9a08g045: Add missing interrupts to IRQC node
ASoC: sh: rz-ssi: Fix error message print
Lang Yu (1):
drm/amdgpu: fix mmhub client id out-of-bounds access
Le Ma (1):
drm/amdgpu: drop setting buffer funcs in sdma442
Leon Romanovsky (1):
xfrm: Allow UDP encapsulation only in offload modes
Li Nan (3):
md: fix kmemleak of rdev->serial
block: fix deadlock between bd_link_disk_holder and partition scan
md: Don't clear MD_CLOSING when the raid is about to stop
Li Zhijian (1):
coccinelle: device_attr_show: Remove useless expression STR
Linu Cherian (1):
octeontx2-af: Use matching wake_up API variant in CGX command
interface
Liu Ying (1):
arm64: dts: imx8mp-evk: Fix hdmi@3d node
Lorenzo Bianconi (1):
wifi: mt76: mt7996: fix fw loading timeout
Lu Baolu (4):
iommu/vt-d: Use rbtree to track iommu probed devices iommu/vt-d: Use device rbtree in iopf reporting path
iommu: Add static iommu_ops->release_domain iommu/vt-d: Fix NULL domain on device release
Luca Ceresoli (1):
ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates
Luca Weiss (4):
arm64: dts: qcom: sc7280: Add static properties to cryptobam
arm64: dts: qcom: qcm6490-fairphone-fp5: Add missing reserved-memory
backlight: lm3630a: Initialize backlight_properties on init
backlight: lm3630a: Don't set bl->props.brightness in get_brightness
Lucas Stach (1):
media: imx: csc/scaler: fix v4l2_ctrl_handler memory leak
Luiz Augusto von Dentz (8):
Bluetooth: Remove BT_HS
Bluetooth: hci_event: Fix not indicating new connection for BIG Sync
Bluetooth: hci_core: Cancel request on command timeout
Bluetooth: hci_sync: Fix overwriting request callback
Bluetooth: hci_core: Fix possible buffer overflow
Bluetooth: msft: Fix memory leak
Bluetooth: btusb: Fix memory leak
Bluetooth: af_bluetooth: Fix deadlock
Luoyouming (1):
RDMA/hns: Fix mis-modifying default congestion control algorithm
Maciej Strozek (2):
mfd: cs42l43: Fix wrong register defaults
mfd: cs42l43: Fix wrong GPIO_FN_SEL and SPI_CLK_CONFIG1 defaults
Mads Bligaard Nielsen (1):
drm/bridge: adv7511: fix crash on irq during probe
Manivannan Sadhasivam (1):
arm64: dts: qcom: sm8650: Fix UFS PHY clocks
Manorit Chawdhry (2):
arm64: dts: ti: k3-j721s2: Fix power domain for VTM node
arm64: dts: ti: k3-j784s4: Fix power domain for VTM node
Manu Bretelle (1):
selftests/bpf: Disable IPv6 for lwt_redirect test
Mao Jinlong (1):
coresight: etm4x: Set skip_power_up in etm4_init_arch_data function
Marek Vasut (1):
arm64: dts: imx8mp: Set SPI NOR to max 40 MHz on Data Modul i.MX8M
Plus eDM SBC
Marijn Suijten (1):
drm/msm/dpu: Only enable DSC_MODE_MULTIPLEX if dsc_merge is enabled
Mario Limonciello (2):
iommu/amd: Mark interrupt as managed
crypto: ccp - Avoid discarding errors in
psp_send_platform_access_msg()
Mark Rutland (1):
perf print-events: make is_event_supported() more robust
Markus Schneider-Pargmann (1):
can: m_can: Start/Cancel polling timer together with interrupts
Martin KaFai Lau (2):
selftests/bpf: Fix the flaky tc_redirect_dtime test selftests/bpf: Wait for the netstamp_needed_key static key to be
turned on
Martin Kaiser (1):
gpio: vf610: allow disabling the vf610 driver
Martin Kaistra (1):
wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work
Martin Krastev (1):
drm/vmwgfx: Fix vmw_du_get_cursor_mob fencing of newly-created MOBs
Masahiro Yamada (1):
kconfig: fix infinite loop when expanding a macro at the end of file
Mathias Nyman (4):
xhci: Add interrupt pending autoclear flag to each interrupter
xhci: make isoc_bei_interval variable interrupter specific.
xhci: remove unnecessary event_ring_deq parameter from
xhci_handle_event()
xhci: update event ring dequeue pointer position to controller
correctly
Matthew Brost (2):
drm/xe: Fix ref counting leak on page fault drm/xe: Invalidate userptr VMA on page pin fault
Matti Vaittinen (1):
iio: gts-helper: Fix division loop
Maxim Kudinov (1):
ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override
Maxime Ripard (2):
kunit: Setup DMA masks on the kunit device drm/tests: helpers: Include missing drm_drv header
Mete Durlu (1):
s390/vtime: fix average steal time calculation
Michael Ellerman (3):
powerpc/32: fix ADB_CUDA kconfig warning powerpc/embedded6xx: Fix no previous prototype for avr_uart_send()
etc.
powerpc/4xx: Fix warp_gpio_leds build failure
Michael Roth (1):
x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type
Michal Vokáč (2):
ARM: dts: imx6dl-yapp4: Fix typo in the QCA switch register address
ARM: dts: imx6dl-yapp4: Move the internal switch PHYs under the switch
node
Mikhail Khvainitski (1):
HID: lenovo: Add middleclick_workaround sysfs knob for cptkbd
Mikulas Patocka (3):
dm: call the resume method on internal suspend
dm-integrity: fix a memory leak when rechecking the data
dm-integrity: align the outgoing bio in integrity_recheck
Ming Lei (1):
dm raid: fix false positive for requeue needed during reshape
Ming Yen Hsieh (9):
wifi: mt76: mt7925: fix connect to 80211b mode fail in 2Ghz band
wifi: mt76: mt7925: fix wmm queue mapping
wifi: mt76: mt7925: fix fw download fail
wifi: mt76: mt7925: fix WoW failed in encrypted mode
wifi: mt76: mt7925: fix the wrong header translation config
wifi: mt76: mt7925: add support to set ifs time by mcu command
wifi: mt76: mt7921: fix incorrect type conversion for CLC command
wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz
channel config from ACPI
wifi: mt76: fix the issue of missing txpwr settings from ch153 to
ch177
Miri Korenblit (5):
wifi: iwlwifi: change link id in time event to s8
wifi: iwlwifi: fix EWRD table validity check
wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU
wifi: iwlwifi: support EHT for WH
wifi: iwlwifi: properly check if link is active
Miroslav Franc (1):
s390/dasd: fix double module refcount decrement
Muhammad Usama Anjum (1):
io_uring/net: correct the type of variable
Mustafa Ismail (1):
RDMA/irdma: Remove duplicate assignment
Nathan Chancellor (1):
s390/vdso: drop '-fPIC' from LDFLAGS
Navid Emamdoost (1):
nbd: null check for nla_nest_start
Neil Armstrong (1):
dt-bindings: arm-smmu: fix SM8[45]50 GPU SMMU if condition
Nicholas Piggin (1):
powerpc/ps3: Fix lv1 hcall assembly for ELFv2 calling convention
Nikita Kiryushin (1):
net: phy: fix phy_read_poll_timeout argument type in genphy_loopback
Nikita Zhandarovich (5):
do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak
media: em28xx: annotate unchecked call to media_device_register() drm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode() drm/amd/display: fix NULL checks for adev->dm.dc in amdgpu_dm_fini()
wireguard: receive: annotate data-race around
receiving_counter.counter
Nícolas F. R. A. Prado (6):
cpufreq: mediatek-hw: Wait for CPU supplies before probing
cpufreq: mediatek-hw: Don't error out if supply is not found
arm64: dts: mt8183: Move CrosEC base detection node to kukui-based DTs
arm64: dts: mediatek: mt8192-asurada: Remove CrosEC base detection
node
arm64: dts: mediatek: mt8186: Add missing clocks to ssusb power
domains
arm64: dts: mediatek: mt8186: Add missing xhci clock to usb
controllers
Oleksij Rempel (1):
net: dsa: microchip: make sure drive strength configuration is not
lost by soft reset
Olga Kornievskaia (1):
NFSv4.1/pnfs: fix NFS with TLS in pnfs
Ondrej Jirman (1):
leds: sgm3140: Add missing timer cleanup and flash gpio control
Oscar Salvador (1):
lib/stackdepot: fix first entry having a 0-handle
Pablo Neira Ayuso (2):
netfilter: nft_set_pipapo: release elements in clone only from destroy
path
netfilter: nf_tables: do not compare internal table flags on updates
Paloma Arellano (2):
drm/msm/dpu: allow certain formats for CDM for DP drm/msm/dpu: add division of drm_display_mode's hskew parameter
Pauli Virtanen (1):
Bluetooth: fix use-after-free in accessing skb after sending it
Pavel Begunkov (1):
io_uring: fix poll_remove stalled req completion
Peng Fan (1):
thermal/drivers/qoriq: Fix getting tmu range
Perry Yuan (1):
ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors
Peter Chiu (2):
wifi: mt76: mt7996: check txs format before getting skb by pid
wifi: mt76: mt7996: fix TWT issues
Peter Griffin (2):
mfd: syscon: Call of_node_put() only when of_parse_phandle() takes a
ref
mfd: altera-sysmgr: Call of_node_put() only when of_parse_phandle()
takes a ref
Peter Hilber (3):
timekeeping: Fix cross-timestamp interpolation on counter wrap
timekeeping: Fix cross-timestamp interpolation corner case decision
timekeeping: Fix cross-timestamp interpolation for non-x86
Peter Robinson (2):
bus: tegra-aconnect: Update dependency to ARCH_TEGRA
dmaengine: tegra210-adma: Update dependency to ARCH_TEGRA
Petr Machata (1):
selftests: forwarding: Add missing config entries
Petr Mladek (1):
printk: Disable passing console lock owner completely during panic()
Petre Rodan (1):
iio: pressure: mprls0025pa fix off-by-one enum
Przemek Kitszel (1):
ice: fix stats being updated by way too large values
Puranjay Mohan (1):
bpf: hardcode BPF_PROG_PACK_SIZE to 2MB * num_possible_nodes()
Qiheng Lin (1):
powerpc/pseries: Fix potential memleak in papr_get_attr()
Quan Tian (1):
netfilter: nf_tables: Fix a memory leak in nf_tables_updchain
Quan Zhou (1):
wifi: mt76: mt7925: add flow to avoid chip bt function fail
Quanyang Wang (1):
crypto: xilinx - call finalize with bh disabled
Quentin Schulz (2):
drm/rockchip: lvds: do not overwrite error code drm/rockchip: lvds: do not print scary message when probing defer
Raag Jadav (1):
pwm: dwc: use pm_sleep_ptr() macro
Rafael J. Wysocki (1):
ACPI: scan: Fix device check notification handling
Rafał Miłecki (9):
arm64: dts: mediatek: mt7986: fix reference to PWM in fan node
arm64: dts: mediatek: mt7986: drop crypto's unneeded/invalid clock
name
arm64: dts: mediatek: mt7986: fix SPI bus width properties
arm64: dts: mediatek: mt7986: fix SPI nodename
arm64: dts: mediatek: mt7986: drop "#clock-cells" from PWM
arm64: dts: mediatek: mt7986: add "#reset-cells" to infracfg
arm64: dts: mediatek: mt7622: add missing "device_type" to memory
nodes
arm64: dts: marvell: reorder crypto interrupts on Armada SoCs
arm64: dts: broadcom: bcmbca: bcm4908: drop invalid switch cells
Rahul Rameshbabu (4):
wifi: b43: Stop/wake correct queue in DMA Tx path when QoS is disabled
wifi: b43: Stop/wake correct queue in PIO Tx path when QoS is disabled
wifi: b43: Stop correct queue in DMA worker when QoS is disabled
wifi: b43: Disable QoS for bcm4331
Raj Kumar Bhagat (1):
wifi: ath12k: fix fetching MCBC flag for QCN9274
Randy Dunlap (4):
fs/hfsplus: use better @opf description drivers/ps3: select VIDEO to provide cmdline functions
crypto: jitter - fix CRYPTO_JITTERENTROPY help text
rtc: mt6397: select IRQ_DOMAIN instead of depending on it
Ravi Gunasekaran (1):
arm64: dts: ti: k3-am62p5-sk: Enable CPSW MDIO node
Rob Clark (1):
drm/msm/a7xx: Fix LLC typo
Rob Herring (1):
media: dt-bindings: techwell,tw9900: Fix port schema ref
Roger Quadros (1):
arm64: dts: ti: am65x: Fix dtbs_install for Rocktech OLDI overlay
Romain Naour (2):
arm64: dts: ti: k3-am69-sk: fix PMIC interrupt number
arm64: dts: ti: k3-j721e-sk: fix PMIC interrupt number
Sakari Ailus (3):
media: ivsc: csi: Swap SINK and SOURCE pads
mei: vsc: Call wake_up() in the threaded IRQ handler
mei: vsc: Don't use sleeping condition in wait_event_timeout()
Sam Protsenko (1):
clk: samsung: exynos850: Propagate SPI IPCLK rate change
Sam Ravnborg (4):
sparc32: Use generic cmpdi2/ucmpdi2 variants
mtd: maps: sun_uflash: Declare uflash_devinit static
sparc32: Do not select GENERIC_ISA_DMA
sparc32: Fix section mismatch in leon_pci_grpci
Sami Tolvanen (1):
riscv: Fix syscall wrapper for >word-size arguments
Sandipan Das (2):
perf vendor events amd: Fix Zen 4 cache latency events perf/x86/amd/core: Avoid register reset when CPU is dead
Sasha Levin (1):
Linux 6.8.2-rc1
Saurabh Sengar (1):
x86/hyperv: Use per cpu initial stack for vtl context
Sean Anderson (1):
usb: phy: generic: Get the vbus supply
Serge Semin (2):
tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning
mips: cm: Convert __mips_cm_l2sync_phys_base() to weak function
Shay Drory (1):
devlink: Fix devlink parallel commands processing
Sheng Yong (1):
f2fs: compress: fix to check unreleased compressed cluster
Shengjiu Wang (1):
clk: imx: imx8mp: Fix SAI_MCLK_SEL definition
Shifeng Li (1):
RDMA/device: Fix a race between mad_client and cm_client init
Shigeru Yoshida (1):
hsr: Fix uninit-value access in hsr_get_node()
Shiming Cheng (1):
ipv6: fib6_rules: flush route cache when rule is changed
Shin'ichiro Kawasaki (1):
nvme: host: fix double-free of struct nvme_id_ns in ns_update_nuse()
Shung-Hsi Yu (1):
selftests/bpf: trace_helpers.c: do not use poisoned type
Sibi Sankar (1):
cpufreq: Fix per-policy boost behavior on SoCs using
cpufreq_boost_set_sw()
Srinivasan Shanmugam (5):
drm/amd/display: Fix a potential buffer overflow in
'dp_dsc_clock_en_read()'
drm/amd/display: Fix potential NULL pointer dereferences in
'dcn10_set_output_transfer_func()'
drm/amdgpu: Fix potential out-of-bounds access in
'amdgpu_discovery_reg_base_init()'
drm/amd/display: Add 'replay' NULL check in
'edp_set_replay_allow_active()'
drm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of
atom_get_src_int()Sriram R (1):
wifi: ath12k: Fix issues in channel list update
StanleyYP Wang (1):
wifi: mt76: mt7996: fix efuse reading issue
Stefan Binding (1):
ALSA: hda: cs35l41: Set Channel Index correctly when system is missing
_DSD
Stephen Boyd (2):
gpiolib: Pass consumer device through to core in
devm_fwnode_gpiod_get_index()
arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang
Steve Sistare (1):
vdpa_sim: reset must not run
Subbaraya Sundeep (5):
octeontx2: Detect the mbox up or down message via register
octeontx2-pf: Wait till detach_resources msg is complete
octeontx2-pf: Use default max_active works instead of one
octeontx2-pf: Send UP messages to VF only when VF is up.
octeontx2-af: Use separate handlers for interrupts
Sunil Goutham (1):
octeontx2-af: Fix devlink params
Suzuki K Poulose (1):
virtio: uapi: Drop __packed attribute in linux/virtio_pci.h
Takashi Iwai (1):
ALSA: seq: fix function cast warnings
Tejun Heo (9):
workqueue: Move pwq->max_active to wq->max_active
workqueue: Factor out pwq_is_empty()
workqueue: Replace pwq_activate_inactive_work() with
[__]pwq_activate_work()
workqueue: Move nr_active handling into helpers
workqueue: Make wq_adjust_max_active() round-robin pwqs while
activating
workqueue: RCU protect wq->dfl_pwq and implement accessors for it
workqueue: Introduce struct wq_node_nr_active
workqueue: Implement system-wide nr_active enforcement for unbound
workqueues
workqueue: Don't call cpumask_test_cpu() with -1 CPU in
wq_update_node_max_active()
Thinh Tran (1):
net/bnx2x: Prevent access to a freed page in page_pool
Thomas Richter (1):
s390/pai: fix attr_event_free upper limit for pai device drivers
Thomas Weißschuh (1):
power: supply: mm8013: fix "not charging" detection
Thomas Zimmermann (1):
arch/powerpc: Remove <linux/fb.h> from backlight code
Théo Lebrun (2):
gpio: nomadik: fix offset bug in nmk_pmx_set()
spi: spi-mem: add statistics support to ->exec_op() calls
Tiezhu Yang (1):
bpftool: Silence build warning about calloc()
Tim Harvey (1):
arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS
Tim Pambor (1):
net: phy: dp83822: Fix RGMII TX delay configuration
Tobias Brunner (1):
ipv4: raw: Fix sending packets from raw sockets via IPsec tunnels
Toke Høiland-Jørgensen (5):
wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is
complete
libbpf: Use OPTS_SET() macro in bpf_xdp_query()
bpf: Fix DEVMAP_HASH overflow check on 32-bit arches
bpf: Fix hashtab overflow check on 32-bit arches
bpf: Fix stackmap overflow check on 32-bit arches
Tomi Valkeinen (2):
drm/tidss: Fix initial plane zpos values drm/tidss: Fix sync-lost issue with two displays
Tony Luck (1):
x86/resctrl: Implement new mba_MBps throttling heuristic
Tudor Ambarus (1):
tty: serial: samsung: fix tx_empty() to return TIOCSER_TEMT
Unnathi Chalicheemala (1):
soc: qcom: llcc: Check return value on Broadcast_OR reg read
Uwe Kleine-König (3):
pwm: atmel-hlcdc: Fix clock imbalance related to suspend support
pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan
ASoC: tlv320adc3xxx: Don't strip remove function when driver is
builtin
Vaishnav Achath (1):
arm64: dts: ti: k3-am62p-mcu/wakeup: Disable MCU and wakeup R5FSS
nodes
Viktor Malik (2):
tools/resolve_btfids: Refactor set sorting with types from btf_ids.h tools/resolve_btfids: Fix cross-compilation to non-host endianness
Vinicius Costa Gomes (2):
igc: Fix missing time sync events
igb: Fix missing time sync events
Viresh Kumar (1):
OPP: debugfs: Fix warning around icc_get_name()
Vladimir Zapolskiy (1):
arm64: dts: qcom: sm6115: drop pipe clock selection
Wang Jianjian (1):
quota: Fix potential NULL pointer dereference
Wen Gong (3):
wifi: ath11k: add support to select 6 GHz regulatory type
wifi: ath11k: store cur_regulatory_info for each radio
wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before
WMI_PEER_ASSOC_CMDID
Wenjie Qi (1):
f2fs: fix NULL pointer dereference in f2fs_submit_page_write()
William Kucharski (1):
RDMA/srpt: Do not register event handler until srpt device is fully
setup
William Tu (2):
devlink: Fix length of eswitch inline-mode
vmxnet3: Fix missing reserved tailroom
Xingyuan Mo (1):
wifi: ath10k: fix NULL pointer dereference in
ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
Xiubo Li (1):
ceph: stop copying to iter at EOF on sync reads
Xiuhong Wang (2):
f2fs: compress: relocate some judgments in
f2fs_reserve_compress_blocks
f2fs: compress: fix reserve_cblocks counting error when out of space
Xuan Zhuo (1):
virtio: packed: fix unmap leak for indirect desc table
Yan Zhai (3):
rcu: add a helper to report consolidated flavor QS
net: report RCU QS on threaded NAPI repolling
bpf: report RCU QS in cpumap kthread
Yang Jihong (5):
perf record: Fix possible incorrect free in record__switch_output() perf record: Check conflict between '--timestamp-filename' option and
pipe mode before recording
perf evsel: Fix duplicate initialization of data->id in
evsel__parse_sample()
perf thread_map: Free strlist on normal path in
thread_map__new_by_tid_str()
hwtracing: hisi_ptt: Move type check to the beginning of
hisi_ptt_pmu_event_init()
Yang Yingliang (1):
NTB: fix possible name leak in ntb_register_device()
Yewon Choi (1):
rds: introduce acquire/release ordering in acquire/release_in_xmit()
Yifan Zhang (1):
drm/amdgpu: add MMHUB 3.3.1 support
Yihang Li (1):
scsi: hisi_sas: Fix a deadlock issue related to automatic dump
Yonghong Song (1):
bpf: Mark bpf_spin_{lock,unlock}() helpers with notrace correctly
Yonglong Liu (1):
net: hns3: fix kernel crash when 1588 is received on HIP08 devices
Yu Kuai (3):
md/raid1: factor out helpers to add rdev to conf md/raid1: record nonrot rdevs while adding/removing rdevs to conf md/raid1: fix choose next idle in read_balance()
Zhang Shurong (1):
drm/tegra: dpaux: Fix PM disable depth imbalance in tegra_dpaux_probe
Zhipeng Lu (10):
wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
SUNRPC: fix a memleak in gss_import_v2_context
SUNRPC: fix some memleaks in gssx_dec_option_array drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node drm/lima: fix a memleak in lima_heap_alloc
media: v4l2-tpg: fix some memleaks in tpg_alloc
media: v4l2-mem2mem: fix a memleak in v4l2_m2m_register_entity
media: edia: dvbdev: fix a use-after-free
media: go7007: fix a memleak in go7007_load_encoder
media: ttpci: fix two memleaks in budget_av_attach
rong.yan (1):
wifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band
.../testing/sysfs-bus-pci-devices-aer_stats | 6 +-
.../bindings/display/msm/qcom,mdss.yaml | 1 +
.../devicetree/bindings/iommu/arm,smmu.yaml | 13 +-
.../bindings/media/i2c/techwell,tw9900.yaml | 2 +-
Documentation/driver-api/soundwire/stream.rst | 4 +-
Documentation/netlink/specs/devlink.yaml | 2 +-
Documentation/netlink/specs/dpll.yaml | 1 +
.../networking/net_cachelines/net_device.rst | 2 +-
Makefile | 4 +-
arch/arm/boot/dts/arm/arm-realview-pb1176.dts | 2 +-
.../boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 25 +-
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 +-
arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts | 12 +
arch/arm/boot/dts/renesas/r8a73a4.dtsi | 9 +-
arch/arm/crypto/sha256_glue.c | 13 +-
arch/arm/crypto/sha512-glue.c | 12 +-
arch/arm64/Kconfig | 2 +-
.../dts/allwinner/sun50i-h6-beelink-gs1.dts | 2 +
.../boot/dts/allwinner/sun50i-h6-tanix.dtsi | 2 +
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +-
.../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 3 -
.../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 38 +-
.../boot/dts/freescale/imx8mm-kontron-bl.dts | 38 +-
.../dts/freescale/imx8mm-kontron-osm-s.dtsi | 6 +-
.../boot/dts/freescale/imx8mm-kontron-sl.dtsi | 4 +-
.../dts/freescale/imx8mm-venice-gw71xx.dtsi | 29 +-
.../freescale/imx8mp-data-modul-edm-sbc.dts | 2 +-
arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 33 +-
.../boot/dts/freescale/imx8qm-ss-dma.dtsi | 29 +-
arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 10 +-
arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 10 +-
.../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 +
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 +
.../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +-
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 7 +-
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 3 +-
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 7 +-
.../dts/mediatek/mt8183-kukui-kakadu.dtsi | 4 +
.../dts/mediatek/mt8183-kukui-kodama.dtsi | 4 +
.../boot/dts/mediatek/mt8183-kukui-krane.dtsi | 4 +
.../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 -
arch/arm64/boot/dts/mediatek/mt8186.dtsi | 18 +-
.../boot/dts/mediatek/mt8192-asurada.dtsi | 4 -
arch/arm64/boot/dts/mediatek/mt8192.dtsi | 2 +-
.../dts/mediatek/mt8195-cherry-tomato-r1.dts | 4 +
.../dts/mediatek/mt8195-cherry-tomato-r2.dts | 4 +
.../dts/mediatek/mt8195-cherry-tomato-r3.dts | 4 +
arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +
.../dts/qcom/{pm2250.dtsi => pm4125.dtsi} | 8 +-
arch/arm64/boot/dts/qcom/qcm2290.dtsi | 7 +
.../boot/dts/qcom/qcm6490-fairphone-fp5.dts | 5 +
arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 4 +-
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 +-
arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 78 +-
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 4 -
arch/arm64/boot/dts/qcom/sa8540p.dtsi | 3 +
arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +
arch/arm64/boot/dts/qcom/sc8180x.dtsi | 38 +-
arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +-
.../boot/dts/qcom/sdm845-oneplus-common.dtsi | 8 +-
arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 +-
arch/arm64/boot/dts/qcom/sm6115.dtsi | 8 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 +
arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sm8650.dtsi | 10 +-
arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 4 +-
arch/arm64/boot/dts/qcom/x1e80100.dtsi | 1 -
arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 4 +-
arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 88 +-
arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 12 +-
arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 22 +-
arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 22 +-
arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 8 +-
.../boot/dts/renesas/rzg3s-smarc-som.dtsi | 4 +
arch/arm64/boot/dts/rockchip/rk356x.dtsi | 3 +-
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 2 -
arch/arm64/boot/dts/ti/Makefile | 1 +
arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 9 +-
arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi | 2 +
arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi | 1 +
arch/arm64/boot/dts/ti/k3-am62p.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-am62p5-sk.dts | 4 +
arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 9 +-
arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 5 +-
arch/arm64/boot/dts/ti/k3-am69-sk.dts | 10 +-
.../dts/ti/k3-j7200-common-proc-board.dts | 18 +-
.../boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 4 +-
arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 4 +-
.../dts/ti/k3-j721s2-common-proc-board.dts | 2 -
.../boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 2 -
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 12 +-
.../boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 2 +-
arch/mips/include/asm/mips-cm.h | 13 +
arch/mips/kernel/mips-cm.c | 5 +-
arch/powerpc/include/asm/backlight.h | 5 +-
arch/powerpc/include/asm/ppc_asm.h | 6 +-
arch/powerpc/include/asm/vmalloc.h | 4 +-
arch/powerpc/perf/hv-gpci.c | 29 +-
arch/powerpc/platforms/44x/warp.c | 1 +
.../platforms/embedded6xx/linkstation.c | 3 -
arch/powerpc/platforms/embedded6xx/mpc10x.h | 3 +
arch/powerpc/platforms/powermac/Kconfig | 2 +-
arch/powerpc/platforms/powermac/backlight.c | 26 -
arch/powerpc/platforms/ps3/Kconfig | 1 +
arch/powerpc/platforms/ps3/hvcall.S | 18 +-
.../pseries/papr_platform_attributes.c | 8 +-
arch/riscv/boot/dts/starfive/jh7100.dtsi | 4 +
arch/riscv/include/asm/pgtable.h | 2 +
arch/riscv/include/asm/syscall_wrapper.h | 53 +-
arch/riscv/kernel/traps_misaligned.c | 2 +-
arch/riscv/kvm/vcpu_insn.c | 13 +
arch/s390/kernel/cache.c | 1 +
arch/s390/kernel/perf_pai_crypto.c | 2 +-
arch/s390/kernel/perf_pai_ext.c | 2 +-
arch/s390/kernel/vdso32/Makefile | 2 +-
arch/s390/kernel/vdso64/Makefile | 2 +-
arch/s390/kernel/vtime.c | 4 +-
arch/sparc/Kconfig | 6 +-
arch/sparc/kernel/leon_pci_grpci1.c | 2 +-
arch/sparc/kernel/leon_pci_grpci2.c | 2 +-
arch/sparc/lib/Makefile | 4 +-
arch/sparc/lib/cmpdi2.c | 28 -
arch/sparc/lib/ucmpdi2.c | 20 -
arch/x86/events/amd/core.c | 1 -
arch/x86/hyperv/hv_vtl.c | 19 +-
arch/x86/include/asm/io.h | 2 +-
arch/x86/include/asm/page.h | 6 +-
arch/x86/include/asm/special_insns.h | 9 +-
arch/x86/kernel/acpi/cppc.c | 2 +-
arch/x86/kernel/cpu/resctrl/core.c | 10 +-
arch/x86/kernel/cpu/resctrl/internal.h | 8 +-
arch/x86/kernel/cpu/resctrl/monitor.c | 48 +-
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 +-
arch/x86/mm/mem_encrypt_identity.c | 10 +-
arch/x86/tools/relocs.c | 8 +
block/holder.c | 12 +-
crypto/Kconfig | 5 +-
drivers/acpi/numa/hmat.c | 8 +-
drivers/acpi/processor_idle.c | 2 +
drivers/acpi/resource.c | 21 +
drivers/acpi/scan.c | 8 +-
drivers/block/aoe/aoecmd.c | 12 +-
drivers/block/aoe/aoenet.c | 1 +
drivers/block/nbd.c | 6 +
drivers/bluetooth/btmtk.c | 4 +-
drivers/bluetooth/btusb.c | 10 +-
drivers/bluetooth/hci_h5.c | 5 +-
drivers/bluetooth/hci_qca.c | 6 +-
drivers/bluetooth/hci_serdev.c | 9 +-
drivers/bluetooth/hci_uart.h | 12 +-
drivers/bus/Kconfig | 5 +-
drivers/bus/mhi/ep/main.c | 2 +-
drivers/char/xilinx_hwicap/xilinx_hwicap.c | 4 +-
drivers/clk/clk.c | 3 +
drivers/clk/hisilicon/clk-hi3519.c | 2 +-
drivers/clk/hisilicon/clk-hi3559a.c | 1 -
drivers/clk/imx/clk-imx8mp-audiomix.c | 11 +-
drivers/clk/mediatek/clk-mt7622-apmixedsys.c | 1 -
drivers/clk/mediatek/clk-mt7981-topckgen.c | 5 +-
drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 4 +-
drivers/clk/mediatek/clk-mt8183.c | 2 +-
drivers/clk/meson/axg.c | 2 +
drivers/clk/qcom/dispcc-sdm845.c | 2 +
drivers/clk/qcom/gcc-ipq5018.c | 6 +-
drivers/clk/qcom/reset.c | 27 +-
drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +-
drivers/clk/renesas/r8a779g0-cpg-mssr.c | 13 +-
drivers/clk/renesas/r9a07g043-cpg.c | 2 +-
drivers/clk/renesas/r9a07g044-cpg.c | 2 +-
drivers/clk/samsung/clk-exynos850.c | 33 +-
drivers/clk/zynq/clkc.c | 8 +-
drivers/cpufreq/Kconfig.arm | 1 +
drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 +
drivers/cpufreq/cpufreq.c | 18 +-
drivers/cpufreq/freq_table.c | 2 +-
drivers/cpufreq/mediatek-cpufreq-hw.c | 19 +-
drivers/crypto/ccp/platform-access.c | 11 +-
.../intel/qat/qat_420xx/adf_420xx_hw_data.c | 8 +
.../intel/qat/qat_4xxx/adf_4xxx_hw_data.c | 8 +
.../crypto/intel/qat/qat_common/adf_clock.c | 3 +
.../intel/qat/qat_common/adf_cnv_dbgfs.c | 1 -
.../intel/qat/qat_common/adf_gen4_hw_data.c | 3 +
.../intel/qat/qat_common/adf_gen4_ras.c | 6 +-
.../intel/qat/qat_common/qat_comp_algs.c | 9 -
drivers/crypto/xilinx/zynqmp-aes-gcm.c | 3 +
drivers/cxl/core/cdat.c | 30 +-
drivers/dma/Kconfig | 14 +-
drivers/dpll/dpll_core.c | 8 +-
drivers/firmware/arm_scmi/smc.c | 7 +
drivers/firmware/efi/libstub/x86-stub.c | 7 +-
drivers/gpio/Kconfig | 3 +-
drivers/gpio/gpiolib-devres.c | 2 +-
drivers/gpio/gpiolib.c | 14 +-
drivers/gpio/gpiolib.h | 8 +
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 +-
drivers/gpu/drm/amd/amdgpu/atom.c | 2 +-
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 1 +
drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c | 8 +-
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 23 +-
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 +-
.../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +-
.../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 7 +-
.../link/protocols/link_edp_panel_control.c | 3 +-
.../gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 4 +-
.../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 4 +-
.../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 +-
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 22 +-
drivers/gpu/drm/ci/test.yml | 5 +-
drivers/gpu/drm/lima/lima_gem.c | 23 +-
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 12 +-
drivers/gpu/drm/mediatek/mtk_dsi.c | 10 +-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 11 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 7 +
.../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 7 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 15 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 1 +
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 8 +
drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +
.../drm/nouveau/nvkm/subdev/devinit/r535.c | 1 -
.../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 2 +
drivers/gpu/drm/panel/panel-edp.c | 3 +-
drivers/gpu/drm/radeon/ni.c | 2 +-
drivers/gpu/drm/rockchip/inno_hdmi.c | 4 +-
drivers/gpu/drm/rockchip/rockchip_lvds.c | 3 +-
drivers/gpu/drm/tegra/dpaux.c | 14 +-
drivers/gpu/drm/tegra/dsi.c | 59 +-
drivers/gpu/drm/tegra/fb.c | 1 +
drivers/gpu/drm/tegra/hdmi.c | 20 +-
drivers/gpu/drm/tegra/output.c | 16 +-
drivers/gpu/drm/tegra/rgb.c | 18 +-
drivers/gpu/drm/tests/drm_buddy_test.c | 14 +-
drivers/gpu/drm/tests/drm_mm_test.c | 6 +-
drivers/gpu/drm/tidss/tidss_crtc.c | 10 +
drivers/gpu/drm/tidss/tidss_plane.c | 2 +-
drivers/gpu/drm/vkms/vkms_composer.c | 14 +-
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 5 +-
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 11 +-
drivers/gpu/drm/xe/Makefile | 3 +-
drivers/gpu/drm/xe/tests/xe_migrate.c | 8 +-
drivers/gpu/drm/xe/xe_exec.c | 41 +-
drivers/gpu/drm/xe/xe_gt_pagefault.c | 10 +-
drivers/gpu/drm/xe/xe_trace.h | 2 +-
drivers/gpu/drm/xe/xe_vm.c | 32 +-
drivers/gpu/drm/xe/xe_vm_types.h | 7 +-
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 30 +-
drivers/hid/amd-sfh-hid/amd_sfh_pcie.h | 6 +-
drivers/hid/hid-lenovo.c | 57 +-
drivers/hv/Kconfig | 1 +
drivers/hwtracing/coresight/coresight-core.c | 30 +-
.../hwtracing/coresight/coresight-etm-perf.c | 2 +-
.../coresight/coresight-etm4x-core.c | 10 +-
drivers/hwtracing/coresight/coresight-priv.h | 2 +-
drivers/hwtracing/ptt/hisi_ptt.c | 6 +-
drivers/i3c/master/dw-i3c-master.c | 4 +-
drivers/iio/industrialio-gts-helper.c | 15 +-
drivers/iio/pressure/mprls0025pa.c | 4 +-
drivers/infiniband/core/device.c | 37 +-
drivers/infiniband/hw/hns/hns_roce_device.h | 17 +-
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 16 +-
drivers/infiniband/hw/irdma/verbs.c | 3 +-
drivers/infiniband/hw/mana/cq.c | 29 +-
drivers/infiniband/hw/mana/main.c | 82 +-
drivers/infiniband/hw/mana/mana_ib.h | 27 +-
drivers/infiniband/hw/mana/mr.c | 17 +-
drivers/infiniband/hw/mana/qp.c | 94 +-
drivers/infiniband/hw/mana/wq.c | 4 +-
drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c | 2 +-
drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +-
drivers/input/misc/iqs7222.c | 112 ++
drivers/iommu/Kconfig | 2 +-
drivers/iommu/amd/init.c | 3 +
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 8 +-
drivers/iommu/intel/Makefile | 2 +
drivers/iommu/intel/dmar.c | 26 +-
drivers/iommu/intel/iommu.c | 122 +-
drivers/iommu/intel/iommu.h | 10 +
drivers/iommu/intel/pasid.c | 67 +
drivers/iommu/intel/pasid.h | 1 +
drivers/iommu/intel/svm.c | 17 +-
drivers/iommu/iommu.c | 19 +-
drivers/iommu/irq_remapping.c | 3 +-
drivers/leds/flash/leds-sgm3140.c | 3 +
drivers/leds/leds-aw2013.c | 1 +
drivers/md/dm-bufio.c | 6 +-
drivers/md/dm-integrity.c | 30 +-
drivers/md/dm-io.c | 23 +-
drivers/md/dm-kcopyd.c | 4 +-
drivers/md/dm-log.c | 4 +-
drivers/md/dm-raid.c | 4 +-
drivers/md/dm-raid1.c | 6 +-
drivers/md/dm-snap-persistent.c | 4 +-
drivers/md/dm-verity-target.c | 2 +-
drivers/md/dm-writecache.c | 8 +-
drivers/md/dm.c | 26 +-
drivers/md/md.c | 15 +-
drivers/md/md.h | 1 +
drivers/md/raid1.c | 134 +-
drivers/md/raid1.h | 1 +
drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 52 +-
drivers/media/dvb-core/dvbdev.c | 5 +
drivers/media/dvb-frontends/stv0367.c | 34 +-
drivers/media/i2c/imx290.c | 16 +-
drivers/media/i2c/tc358743.c | 7 +-
drivers/media/pci/intel/ivsc/mei_csi.c | 4 +-
drivers/media/pci/ttpci/budget-av.c | 8 +-
drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
.../media/platform/mediatek/mdp/mtk_mdp_vpu.c | 2 +-
.../vcodec/common/mtk_vcodec_fw_vpu.c | 10 +-
drivers/media/platform/mediatek/vpu/mtk_vpu.c | 2 +-
drivers/media/platform/mediatek/vpu/mtk_vpu.h | 2 +-
.../media/platform/sunxi/sun8i-di/sun8i-di.c | 69 +-
drivers/media/usb/em28xx/em28xx-cards.c | 4 +
drivers/media/usb/go7007/go7007-driver.c | 8 +-
drivers/media/usb/go7007/go7007-usb.c | 4 +-
drivers/media/usb/pvrusb2/pvrusb2-context.c | 10 +-
drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 6 +-
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 11 +-
drivers/media/usb/usbtv/usbtv-video.c | 7 -
drivers/media/v4l2-core/v4l2-cci.c | 4 +-
drivers/media/v4l2-core/v4l2-mem2mem.c | 10 +-
drivers/memory/tegra/tegra234.c | 16 +-
drivers/mfd/altera-sysmgr.c | 4 +-
drivers/mfd/cs42l43.c | 72 +-
drivers/mfd/syscon.c | 4 +-
drivers/misc/mei/vsc-tp.c | 17 +-
drivers/mmc/host/wmt-sdmmc.c | 4 -
drivers/mtd/maps/physmap-core.c | 2 +-
drivers/mtd/maps/sun_uflash.c | 2 +-
drivers/mtd/nand/raw/brcmnand/brcmnand.c | 12 +-
drivers/mtd/nand/raw/lpc32xx_mlc.c | 5 +-
drivers/mtd/nand/spi/esmt.c | 9 +-
drivers/net/can/m_can/m_can.c | 23 +-
drivers/net/dsa/microchip/ksz_common.c | 10 +-
drivers/net/dsa/mt7530.c | 60 +-
drivers/net/dsa/mt7530.h | 22 +-
drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 -
.../net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 6 +-
.../net/ethernet/hisilicon/hns3/hns3_dcbnl.c | 2 +-
.../hisilicon/hns3/hns3pf/hclge_main.c | 5 +-
.../hisilicon/hns3/hns3pf/hclge_ptp.c | 2 +-
drivers/net/ethernet/intel/ice/ice_main.c | 24 +-
drivers/net/ethernet/intel/igb/igb_main.c | 23 +-
drivers/net/ethernet/intel/igc/igc_main.c | 12 +-
.../net/ethernet/marvell/octeontx2/af/cgx.c | 2 +-
.../net/ethernet/marvell/octeontx2/af/mbox.c | 43 +-
.../net/ethernet/marvell/octeontx2/af/mbox.h | 6 +
.../marvell/octeontx2/af/mcs_rvu_if.c | 17 +-
.../net/ethernet/marvell/octeontx2/af/rvu.c | 31 +-
.../net/ethernet/marvell/octeontx2/af/rvu.h | 2 +
.../ethernet/marvell/octeontx2/af/rvu_cgx.c | 20 +-
.../marvell/octeontx2/af/rvu_devlink.c | 20 +-
.../marvell/octeontx2/nic/otx2_common.c | 2 +-
.../marvell/octeontx2/nic/otx2_common.h | 2 +-
.../ethernet/marvell/octeontx2/nic/otx2_pf.c | 119 +-
.../ethernet/marvell/octeontx2/nic/otx2_vf.c | 71 +-
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +-
drivers/net/ethernet/mediatek/mtk_ppe.c | 18 +-
.../ethernet/netronome/nfp/flower/lag_conf.c | 5 +
.../net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
drivers/net/phy/dp83822.c | 37 +-
drivers/net/phy/phy_device.c | 6 +-
drivers/net/usb/r8152.c | 2 +-
drivers/net/usb/sr9800.c | 4 +-
drivers/net/veth.c | 18 -
drivers/net/vmxnet3/vmxnet3_xdp.c | 6 +-
drivers/net/wireguard/receive.c | 6 +-
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 +
drivers/net/wireless/ath/ath11k/core.h | 1 +
drivers/net/wireless/ath/ath11k/mac.c | 17 +-
drivers/net/wireless/ath/ath11k/reg.c | 249 +++-
drivers/net/wireless/ath/ath11k/reg.h | 11 +-
drivers/net/wireless/ath/ath11k/wmi.c | 147 +-
drivers/net/wireless/ath/ath11k/wmi.h | 1 +
drivers/net/wireless/ath/ath12k/core.h | 2 +-
drivers/net/wireless/ath/ath12k/hal.c | 6 +-
drivers/net/wireless/ath/ath12k/mac.c | 4 +-
drivers/net/wireless/ath/ath12k/reg.c | 4 +-
drivers/net/wireless/ath/ath9k/htc.h | 2 +-
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 +
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 4 -
drivers/net/wireless/ath/ath9k/wmi.c | 10 +-
drivers/net/wireless/broadcom/b43/b43.h | 16 +
drivers/net/wireless/broadcom/b43/dma.c | 4 +-
drivers/net/wireless/broadcom/b43/main.c | 16 +-
drivers/net/wireless/broadcom/b43/pio.c | 6 +-
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 3 +
.../broadcom/brcm80211/brcmsmac/phy/phy_cmn.c | 3 +-
.../broadcom/brcm80211/brcmsmac/phy_shim.c | 5 +-
.../broadcom/brcm80211/brcmsmac/phy_shim.h | 2 +-
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 12 +-
drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 2 +-
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 30 +-
.../net/wireless/intel/iwlwifi/fw/runtime.h | 2 +-
.../net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 +
.../wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 12 +-
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 25 +-
.../net/wireless/intel/iwlwifi/mvm/mld-key.c | 18 +-
.../net/wireless/intel/iwlwifi/mvm/mld-mac.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 26 +-
.../wireless/intel/iwlwifi/mvm/time-event.c | 11 +-
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 12 +-
drivers/net/wireless/marvell/libertas/cmd.c | 13 +-
.../net/wireless/marvell/mwifiex/debugfs.c | 3 -
.../wireless/mediatek/mt76/mt76_connac_mcu.c | 4 +-
.../wireless/mediatek/mt76/mt76_connac_mcu.h | 4 +
.../net/wireless/mediatek/mt76/mt7921/mcu.c | 4 +-
.../net/wireless/mediatek/mt76/mt7921/pci.c | 1 +
.../net/wireless/mediatek/mt76/mt7925/main.c | 26 +-
.../net/wireless/mediatek/mt76/mt7925/mcu.c | 176 ++-
.../net/wireless/mediatek/mt76/mt7925/mcu.h | 92 +-
.../net/wireless/mediatek/mt76/mt7925/pci.c | 3 +
.../wireless/mediatek/mt76/mt792x_acpi_sar.c | 26 +-
.../net/wireless/mediatek/mt76/mt792x_core.c | 1 +
.../net/wireless/mediatek/mt76/mt792x_dma.c | 15 +-
.../net/wireless/mediatek/mt76/mt792x_regs.h | 8 +
.../net/wireless/mediatek/mt76/mt7996/dma.c | 3 +-
.../net/wireless/mediatek/mt76/mt7996/init.c | 7 +-
.../net/wireless/mediatek/mt76/mt7996/mac.c | 76 +-
.../net/wireless/mediatek/mt76/mt7996/mcu.c | 18 +-
.../wireless/mediatek/mt76/mt7996/mt7996.h | 3 +-
.../wireless/microchip/wilc1000/cfg80211.c | 12 +-
drivers/net/wireless/microchip/wilc1000/hif.c | 40 +-
.../net/wireless/microchip/wilc1000/netdev.c | 38 +-
drivers/net/wireless/microchip/wilc1000/spi.c | 6 +-
.../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 +
drivers/net/wireless/realtek/rtw88/main.c | 2 -
drivers/net/wireless/realtek/rtw88/phy.c | 3 +
drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 +-
drivers/net/wireless/realtek/rtw88/usb.c | 40 +
drivers/net/wireless/silabs/wfx/sta.c | 15 +-
drivers/ntb/core.c | 8 +-
drivers/nvme/host/core.c | 6 +-
drivers/nvme/host/fabrics.h | 7 -
drivers/nvme/host/sysfs.c | 7 +-
drivers/opp/debugfs.c | 6 +-
drivers/pci/controller/pcie-brcmstb.c | 2 +-
drivers/pci/endpoint/functions/pci-epf-vntb.c | 6 +-
drivers/pci/p2pdma.c | 2 +-
drivers/pci/pci.h | 5 -
drivers/pci/pcie/dpc.c | 2 +-
drivers/pci/quirks.c | 1 +
drivers/pci/switch/switchtec.c | 4 +-
drivers/phy/qualcomm/Makefile | 2 +-
drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 266 ----
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c | 1195 +++++++++++++++++
drivers/pinctrl/mediatek/pinctrl-mt8186.c | 1 -
drivers/pinctrl/mediatek/pinctrl-mt8192.c | 1 -
drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 +-
drivers/pinctrl/renesas/core.c | 4 +-
drivers/pinctrl/renesas/pfc-r8a779g0.c | 14 +
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 20 +-
drivers/platform/x86/amd/pmf/tee-if.c | 4 +-
drivers/platform/x86/intel/pmc/arl.c | 2 +
drivers/platform/x86/intel/pmc/lnl.c | 40 +-
drivers/pmdomain/qcom/rpmhpd.c | 1 -
drivers/power/supply/mm8013.c | 13 +-
drivers/powercap/dtpm_cpu.c | 2 +-
drivers/pwm/pwm-atmel-hlcdc.c | 2 +-
drivers/pwm/pwm-dwc.c | 2 +-
drivers/pwm/pwm-sti.c | 11 +-
drivers/regulator/userspace-consumer.c | 1 +
drivers/remoteproc/stm32_rproc.c | 6 +-
drivers/rtc/Kconfig | 3 +-
drivers/rtc/lib_test.c | 2 +-
drivers/rtc/rtc-max31335.c | 2 +-
drivers/s390/block/dasd.c | 55 +-
drivers/scsi/bfa/bfa.h | 9 +-
drivers/scsi/bfa/bfa_core.c | 4 +-
drivers/scsi/bfa/bfa_ioc.h | 8 +-
drivers/scsi/bfa/bfad_bsg.c | 11 +-
drivers/scsi/csiostor/csio_defs.h | 18 +-
drivers/scsi/csiostor/csio_lnode.c | 8 +-
drivers/scsi/csiostor/csio_lnode.h | 13 -
drivers/scsi/hisi_sas/hisi_sas_main.c | 12 +-
drivers/soc/fsl/dpio/dpio-service.c | 2 +-
drivers/soc/qcom/llcc-qcom.c | 2 +
drivers/soc/qcom/socinfo.c | 2 +-
drivers/spi/spi-fsl-lpspi.c | 8 +-
drivers/spi/spi-imx.c | 4 +-
drivers/spi/spi-mem.c | 49 +-
drivers/spi/spi-mt65xx.c | 22 +-
drivers/spi/spi.c | 94 +-
drivers/staging/greybus/light.c | 8 +-
.../staging/media/imx/imx-media-csc-scaler.c | 1 +
.../media/starfive/camss/stf-capture.c | 8 +-
.../staging/media/sunxi/cedrus/cedrus_h265.c | 10 +-
drivers/thermal/mediatek/lvts_thermal.c | 4 +-
drivers/thermal/qoriq_thermal.c | 12 +-
drivers/tty/mips_ejtag_fdc.c | 2 +-
drivers/tty/serial/8250/8250_exar.c | 5 +-
drivers/tty/serial/max310x.c | 2 +-
drivers/tty/serial/samsung_tty.c | 5 +-
drivers/tty/vt/vt.c | 2 +-
drivers/usb/gadget/udc/net2272.c | 2 +-
drivers/usb/host/xhci-mem.c | 2 +-
drivers/usb/host/xhci-ring.c | 90 +-
drivers/usb/host/xhci.c | 3 +
drivers/usb/host/xhci.h | 3 +-
drivers/usb/phy/phy-generic.c | 7 +
drivers/vdpa/mlx5/net/mlx5_vnet.c | 13 +-
drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 +-
drivers/video/backlight/da9052_bl.c | 1 +
drivers/video/backlight/hx8357.c | 10 +-
drivers/video/backlight/ktz8866.c | 6 +-
drivers/video/backlight/lm3630a_bl.c | 15 +-
drivers/video/backlight/lm3639_bl.c | 1 +
drivers/video/backlight/lp8788_bl.c | 1 +
drivers/video/fbdev/simplefb.c | 2 +-
drivers/virtio/virtio_ring.c | 6 +-
drivers/watchdog/starfive-wdt.c | 9 +-
drivers/watchdog/stm32_iwdg.c | 3 +
drivers/xen/events/events_base.c | 22 +-
drivers/xen/evtchn.c | 6 +
fs/afs/dir.c | 10 -
fs/afs/rotate.c | 21 +-
fs/afs/validation.c | 16 +-
fs/btrfs/extent_io.c | 221 ++-
fs/ceph/file.c | 23 +-
fs/erofs/fscache.c | 15 +-
fs/erofs/internal.h | 1 -
fs/erofs/super.c | 30 +-
fs/ext2/ext2.h | 2 +-
fs/ext2/super.c | 2 +-
fs/ext4/ext4.h | 2 +-
fs/ext4/super.c | 2 +-
fs/f2fs/checkpoint.c | 5 +-
fs/f2fs/compress.c | 41 +-
fs/f2fs/data.c | 36 +-
fs/f2fs/dir.c | 5 +-
fs/f2fs/f2fs.h | 72 +-
fs/f2fs/file.c | 76 +-
fs/f2fs/namei.c | 25 +-
fs/f2fs/node.c | 20 +-
fs/f2fs/recovery.c | 33 +-
fs/f2fs/segment.c | 11 +-
fs/f2fs/segment.h | 17 +-
fs/f2fs/super.c | 17 +-
fs/fcntl.c | 12 +-
fs/fhandle.c | 2 +-
fs/hfsplus/wrapper.c | 2 +-
fs/iomap/buffered-io.c | 18 +-
fs/jfs/jfs_incore.h | 2 +-
fs/jfs/super.c | 2 +-
fs/nfs/flexfilelayout/flexfilelayout.c | 2 +-
fs/nfs/fscache.c | 9 +-
fs/nfs/nfs42.h | 7 +-
fs/nfs/nfs4proc.c | 16 +-
fs/nfs/nfsroot.c | 4 +-
fs/nfs/pnfs_nfs.c | 44 +-
fs/ocfs2/inode.h | 2 +-
fs/ocfs2/super.c | 2 +-
fs/overlayfs/copy_up.c | 6 +-
fs/overlayfs/params.c | 14 +-
fs/pstore/inode.c | 10 +-
fs/quota/dquot.c | 159 ++-
fs/reiserfs/reiserfs.h | 2 +-
fs/reiserfs/super.c | 2 +-
fs/select.c | 2 +-
fs/smb/client/file.c | 283 ++--
include/drm/drm_fixed.h | 5 +-
include/drm/drm_kunit_helpers.h | 2 +
include/dt-bindings/clock/r8a779g0-cpg-mssr.h | 1 +
include/linux/dm-io.h | 3 +-
include/linux/f2fs_fs.h | 1 +
include/linux/filter.h | 21 +-
include/linux/fs.h | 11 +-
include/linux/iommu.h | 1 +
include/linux/moduleloader.h | 8 +
include/linux/netdevice.h | 2 +-
include/linux/pci.h | 5 +
include/linux/poll.h | 4 -
include/linux/rcupdate.h | 31 +
include/linux/shmem_fs.h | 2 +-
include/linux/workqueue.h | 35 +-
include/media/videobuf2-core.h | 13 +-
include/net/bluetooth/hci.h | 2 -
include/net/bluetooth/hci_core.h | 1 +
include/net/bluetooth/hci_sync.h | 2 +-
include/net/bluetooth/l2cap.h | 42 -
include/soc/qcom/qcom-spmi-pmic.h | 2 +-
include/uapi/linux/virtio_pci.h | 10 +-
init/main.c | 5 +-
io_uring/io_uring.c | 116 +-
io_uring/net.c | 260 ++--
io_uring/poll.c | 4 +-
kernel/bpf/btf.c | 17 +-
kernel/bpf/core.c | 7 +-
kernel/bpf/cpumap.c | 3 +
kernel/bpf/devmap.c | 11 +-
kernel/bpf/hashtab.c | 14 +-
kernel/bpf/helpers.c | 4 +-
kernel/bpf/stackmap.c | 9 +-
kernel/module/main.c | 9 +-
kernel/printk/internal.h | 1 +
kernel/printk/nbcon.c | 41 +-
kernel/printk/printk.c | 74 +-
kernel/printk/printk_ringbuffer.c | 313 ++++-
kernel/printk/printk_ringbuffer.h | 38 +-
kernel/rcu/tree.c | 3 +
kernel/rcu/tree_exp.h | 25 +-
kernel/sched/fair.c | 16 +-
kernel/time/time_test.c | 2 +-
kernel/time/timekeeping.c | 24 +-
kernel/workqueue.c | 755 +++++++++--
lib/cmdline_kunit.c | 2 +-
lib/kunit/device.c | 4 +
lib/kunit/executor_test.c | 2 +-
lib/memcpy_kunit.c | 4 +-
lib/stackdepot.c | 16 +-
lib/test_blackhole_dev.c | 3 +-
mm/shmem.c | 2 +-
net/bluetooth/Kconfig | 8 -
net/bluetooth/Makefile | 1 -
net/bluetooth/a2mp.c | 1054 ---------------
net/bluetooth/a2mp.h | 154 ---
net/bluetooth/af_bluetooth.c | 10 +-
net/bluetooth/amp.c | 590 --------
net/bluetooth/amp.h | 60 -
net/bluetooth/eir.c | 29 +-
net/bluetooth/hci_conn.c | 6 +-
net/bluetooth/hci_core.c | 126 +-
net/bluetooth/hci_event.c | 43 +-
net/bluetooth/hci_request.c | 2 +-
net/bluetooth/hci_sync.c | 41 +-
net/bluetooth/l2cap_core.c | 1069 +--------------
net/bluetooth/l2cap_sock.c | 18 +-
net/bluetooth/mgmt.c | 97 +-
net/bluetooth/msft.c | 3 +
net/core/dev.c | 8 +-
net/core/gso_test.c | 2 +-
net/core/skbuff.c | 8 +
net/core/sock_diag.c | 10 +-
net/devlink/netlink.c | 13 +-
net/devlink/netlink_gen.c | 2 +-
net/devlink/port.c | 2 +-
net/hsr/hsr_framereg.c | 4 +
net/hsr/hsr_main.c | 15 +-
net/ipv4/inet_diag.c | 6 +-
net/ipv4/inet_hashtables.c | 2 +-
net/ipv4/inet_timewait_sock.c | 41 +-
net/ipv4/ip_tunnel.c | 15 +-
net/ipv4/ipmr.c | 4 +-
net/ipv4/raw.c | 1 +
net/ipv4/tcp.c | 4 +-
net/ipv4/tcp_minisocks.c | 4 -
net/ipv4/udp.c | 4 +-
net/ipv6/fib6_rules.c | 6 +
net/ipv6/mcast.c | 1 -
net/kcm/kcmsock.c | 3 +-
net/l2tp/l2tp_ppp.c | 4 +-
net/mac80211/mlme.c | 4 +-
net/mctp/route.c | 3 +
net/netfilter/nf_tables_api.c | 29 +-
net/netfilter/nft_set_pipapo.c | 5 +-
net/packet/af_packet.c | 4 +-
net/rds/send.c | 5 +-
net/sched/sch_taprio.c | 3 +-
net/sunrpc/addr.c | 4 +-
net/sunrpc/auth_gss/gss_krb5_mech.c | 11 +-
net/sunrpc/auth_gss/gss_rpc_xdr.c | 27 +-
net/unix/garbage.c | 2 +-
net/wireless/scan.c | 161 ++-
net/wireless/tests/scan.c | 36 +-
net/x25/af_x25.c | 4 +-
net/xfrm/xfrm_device.c | 3 +-
scripts/coccinelle/api/device_attr_show.cocci | 2 +-
scripts/kconfig/lexer.l | 7 +-
sound/core/seq/seq_midi.c | 8 +-
sound/core/seq/seq_virmidi.c | 9 +-
sound/pci/hda/cs35l41_hda_property.c | 16 +-
sound/pci/hda/patch_realtek.c | 63 +
sound/pci/hda/tas2781_hda_i2c.c | 35 +-
sound/soc/amd/acp/acp-sof-mach.c | 14 +-
sound/soc/codecs/tlv320adc3xxx.c | 4 +-
sound/soc/intel/boards/sof_ssp_common.h | 8 +
sound/soc/meson/aiu.c | 19 +-
sound/soc/meson/aiu.h | 1 -
sound/soc/meson/axg-tdm-interface.c | 29 +-
sound/soc/meson/t9015.c | 20 +-
sound/soc/rockchip/rockchip_i2s_tdm.c | 352 +----
sound/soc/sh/rz-ssi.c | 2 +-
sound/soc/sof/amd/acp-loader.c | 34 +-
sound/soc/sof/amd/acp.c | 47 +-
sound/soc/sof/amd/acp.h | 7 +-
sound/soc/sof/amd/vangogh.c | 9 +-
sound/soc/sof/fw-file-profile.c | 18 +-
sound/soc/sof/ipc3-loader.c | 2 +
sound/usb/mixer_scarlett2.c | 88 +-
sound/usb/stream.c | 5 +-
tools/bpf/bpftool/link.c | 2 +-
tools/bpf/bpftool/prog.c | 2 +-
tools/bpf/resolve_btfids/main.c | 70 +-
tools/include/linux/btf_ids.h | 9 +
tools/lib/bpf/bpf.c | 17 +
tools/lib/bpf/bpf.h | 26 +-
tools/lib/bpf/btf.c | 11 +-
tools/lib/bpf/libbpf.c | 25 +-
tools/lib/bpf/libbpf.map | 6 +-
tools/lib/bpf/libbpf_internal.h | 14 +
tools/lib/bpf/linker.c | 2 +-
tools/lib/bpf/netlink.c | 4 +-
tools/objtool/check.c | 12 +
tools/perf/Makefile.perf | 2 +-
tools/perf/builtin-record.c | 7 +-
.../pmu-events/arch/x86/amdzen4/cache.json | 56 +
tools/perf/pmu-events/jevents.py | 4 +
tools/perf/util/data.c | 2 -
tools/perf/util/evsel.c | 1 -
tools/perf/util/expr.c | 20 +-
tools/perf/util/pmu.c | 19 +-
tools/perf/util/print-events.c | 27 +-
tools/perf/util/srcline.c | 2 +
tools/perf/util/stat-display.c | 2 +-
tools/perf/util/stat-shadow.c | 7 +-
tools/perf/util/thread_map.c | 2 +-
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 9 +
.../selftests/bpf/prog_tests/lwt_redirect.c | 1 +
.../selftests/bpf/prog_tests/tc_redirect.c | 90 +-
.../bpf/progs/test_global_func_ctx_args.c | 19 +
.../selftests/bpf/progs/test_map_in_map.c | 26 +
tools/testing/selftests/bpf/test_maps.c | 6 +-
tools/testing/selftests/bpf/trace_helpers.c | 2 +-
tools/testing/selftests/net/forwarding/config | 35 +
.../net/forwarding/vxlan_bridge_1d_ipv6.sh | 4 +-
.../net/forwarding/vxlan_bridge_1q_ipv6.sh | 4 +-
731 files changed, 8821 insertions(+), 7631 deletions(-)
rename arch/arm64/boot/dts/qcom/{pm2250.dtsi => pm4125.dtsi} (91%)
delete mode 100644 arch/sparc/lib/cmpdi2.c
delete mode 100644 arch/sparc/lib/ucmpdi2.c
create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
delete mode 100644 net/bluetooth/a2mp.c
delete mode 100644 net/bluetooth/a2mp.h
delete mode 100644 net/bluetooth/amp.c
delete mode 100644 net/bluetooth/amp.hSignature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 1/715 do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak
From: Nikita Zhandarovich <[email protected]>
[ Upstream commit 3948abaa4e2be938ccdfc289385a27342fb13d43 ]
syzbot identified a kernel information leak vulnerability in do_sys_name_to_handle() and issued the following report [1].
[1]
"BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_user+0xbc/0x100 lib/usercopy.c:40 instrument_copy_to_user include/linux/instrumented.h:114 [inline] _copy_to_user+0xbc/0x100 lib/usercopy.c:40 copy_to_user include/linux/uaccess.h:191 [inline] do_sys_name_to_handle fs/fhandle.c:73 [inline] __do_sys_name_to_handle_at fs/fhandle.c:112 [inline] __se_sys_name_to_handle_at+0x949/0xb10 fs/fhandle.c:94 __x64_sys_name_to_handle_at+0xe4/0x140 fs/fhandle.c:94 ...
Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768 slab_alloc_node mm/slub.c:3478 [inline] __kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc+0x121/0x3c0 mm/slab_common.c:1020 kmalloc include/linux/slab.h:604 [inline] do_sys_name_to_handle fs/fhandle.c:39 [inline] __do_sys_name_to_handle_at fs/fhandle.c:112 [inline] __se_sys_name_to_handle_at+0x441/0xb10 fs/fhandle.c:94 __x64_sys_name_to_handle_at+0xe4/0x140 fs/fhandle.c:94 ...
Bytes 18-19 of 20 are uninitialized
Memory access of size 20 starts at ffff888128a46380 Data copied to user address 0000000020000240"
Per Chuck Lever's suggestion, use kzalloc() instead of kmalloc() to solve the problem.
--- fs/fhandle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fhandle.c +1 -1
@@ -36,7 +36,7 @@ static long do_sys_name_to_handle(const struct path *path,if (f_handle.handle_bytes >MAX_HANDLE_SZ )return -EINVAL ; - handle =kmalloc (sizeof (struct file_handle ) + f_handle.handle_bytes, + handle =kzalloc (sizeof (struct file_handle ) + f_handle.handle_bytes,GFP_KERNEL );if (!handle)return -ENOMEM ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/715 workqueue.c: Increase workqueue name length
In reply to Sasha LevinFrom: Audra Mitchell <[email protected]>
[ Upstream commit 31c89007285d365aa36f71d8fb0701581c770a27 ]
Currently we limit the size of the workqueue name to 24 characters due to commit ecf6881ff349 ("workqueue: make workqueue->name[] fixed len") Increase the size to 32 characters and print a warning in the event the requested name is larger than the limit of 32 characters.
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
kernel/workqueue.c +6 -2
@@ -108,7 +108,7 @@ enum {RESCUER_NICE_LEVEL =MIN_NICE ,HIGHPRI_NICE_LEVEL =MIN_NICE , - WQ_NAME_LEN = 24, + WQ_NAME_LEN = 32, };/*
@@ -4666,6 +4666,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,va_list args;struct workqueue_struct *wq;struct pool_workqueue *pwq; +int len;/* * Unbound && max_active == 1 used to imply ordered, which is no longer
@@ -4692,9 +4693,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, }va_start (args, max_active); -vsnprintf (wq->name,sizeof (wq->name), fmt, args); + len =vsnprintf (wq->name,sizeof (wq->name), fmt, args);va_end (args); +if (len >=WQ_NAME_LEN ) +pr_warn_once ("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n" , wq->name); + max_active = max_active ?:WQ_DFL_ACTIVE ; max_active =wq_clamp_max_active (max_active, flags, wq->name);
Signature · 1 line
2.43.0
Re: [PATCH 6.8 002/715] workqueue.c: Increase workqueue name length
Quoted 42 lines · Sasha Levin
From: Audra Mitchell <[email protected]>
[ Upstream commit
31c89007285d365aa36f71d8fb0701581c770a27]Currently we limit the size of the workqueue name to 24 characters due to commit
ecf6881ff349("workqueue: make workqueue->name[] fixed len") Increase the size to 32 characters and print a warning in the event the requested name is larger than the limit of 32 characters.Signed-off-by Audra Mitchell <[email protected]>Signed-off-by Tejun Heo <[email protected]>Stable-dep-of:
5797b1c18919("workqueue: Implement system-widenr_activeenforcement for unbound workqueues")Signed-off-by Sasha Levin <[email protected]>--- kernel/workqueue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)kernel/workqueue.c +2
-1@@ -108,7 +108,7 @@ enum {RESCUER_NICE_LEVEL =MIN_NICE ,HIGHPRI_NICE_LEVEL =MIN_NICE , - WQ_NAME_LEN = 24, + WQ_NAME_LEN = 32, };/* @@ -4666,6 +4666,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,va_list args;struct workqueue_struct *wq;struct pool_workqueue *pwq; +int len;/* * Unbound && max_active == 1 used to imply ordered, which is no longer @@ -4692,9 +4693,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, }va_start (args, max_active);
kernel/workqueue.c struct workqueue_struct *alloc_workqueue(const char *fmt, · line 4704
Quoted 10 lines
kernel/workqueue.c +4
-1-vsnprintf (wq->name,sizeof (wq->name), fmt, args); + len =vsnprintf (wq->name,sizeof (wq->name), fmt, args);va_end (args); +if (len >=WQ_NAME_LEN ) +pr_warn_once ("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n" , wq->name); + max_active = max_active ?:WQ_DFL_ACTIVE ; max_active =wq_clamp_max_active (max_active, flags, wq->name);
Minor issue. The upstream commit 8318d6a6362f5903edb4c904a8dd447e59be4ad1 "workqueue: Shorten events_freezable_power_efficient name" goes with this patch. Otherwise the warning "kernel: workqueue: name exceeds WQ_NAME_LEN. Truncating to: events_freezable_power_efficien" occurs.
Same for 6.7.11-rc2 and 6.6.23-rc2.
Greg KH
maintainerRe: [PATCH 6.8 002/715] workqueue.c: Increase workqueue name length
Quoted 53 lines · Ron Economos
Quoted 36 lines · Sasha Levin
From: Audra Mitchell <[email protected]>
[ Upstream commit
31c89007285d365aa36f71d8fb0701581c770a27]Currently we limit the size of the workqueue name to 24 characters due to commit
ecf6881ff349("workqueue: make workqueue->name[] fixed len") Increase the size to 32 characters and print a warning in the event the requested name is larger than the limit of 32 characters.Signed-off-by Audra Mitchell <[email protected]>Signed-off-by Tejun Heo <[email protected]>Stable-dep-of:
5797b1c18919("workqueue: Implement system-widenr_activeenforcement for unbound workqueues")Signed-off-by Sasha Levin <[email protected]>--- kernel/workqueue.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)kernel/workqueue.c +2
-1@@ -108,7 +108,7 @@ enum {RESCUER_NICE_LEVEL =MIN_NICE ,HIGHPRI_NICE_LEVEL =MIN_NICE , - WQ_NAME_LEN = 24, + WQ_NAME_LEN = 32, };/* @@ -4666,6 +4666,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,va_list args;struct workqueue_struct *wq;struct pool_workqueue *pwq; +int len;/* * Unbound && max_active == 1 used to imply ordered, which is no longer kernel/workqueue.c struct workqueue_struct *alloc_workqueue(const char *fmt, · line 4701
Quoted 10 lines
kernel/workqueue.c +4
-1@@ -4692,9 +4693,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, }va_start (args, max_active); -vsnprintf (wq->name,sizeof (wq->name), fmt, args); + len =vsnprintf (wq->name,sizeof (wq->name), fmt, args);va_end (args); +if (len >=WQ_NAME_LEN ) +pr_warn_once ("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n" , wq->name); + max_active = max_active ?:WQ_DFL_ACTIVE ; max_active =wq_clamp_max_active (max_active, flags, wq->name);Minor issue. The upstream commit
8318d6a6362f5903edb4c904a8dd447e59be4ad1"workqueue: Shortenevents_freezable_power_efficientname" goes with this patch. Otherwise the warning "kernel: workqueue: name exceedsWQ_NAME_LEN. Truncating to:events_freezable_power_efficien" occurs.
Quoted 1 line
Same for 6.7.11-rc2 and 6.6.23-rc2.
Now queued up, thanks.
greg k-h
Sasha Levin
maintainerPATCH 3/715 workqueue: Move pwq->max_active to wq->max_active
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit a045a272d887575da17ad86d6573e82871b50c27 ]
max_active is a workqueue-wide setting and the configured value is stored in wq->saved_max_active; however, the effective value was stored in pwq->max_active. While this is harmless, it makes max_active update process more complicated and gets in the way of the planned max_active semantic updates for unbound workqueues.
This patches moves pwq->max_active to wq->max_active. This simplifies the code and makes freezing and noop max_active updates cheaper too. No user-visible behavior change is intended.
As wq->max_active is updated while holding wq mutex but read without any locking, it now uses WRITE/READ_ONCE(). A new locking locking rule WO is added for it.
v2: wq->max_active now uses WRITE/READ_ONCE() as suggested by Lai.
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 133 ++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 67 deletions(-)
kernel/workqueue.c +66 -67
@@ -143,6 +143,9 @@ enum {* * WR: wq->mutex protected for writes. RCU protected for reads. * +* WO: wq->mutex protected for writes. Updated with WRITE_ONCE() and can be read +* with READ_ONCE() without locking. +* * MD: wq_mayday_lock protected. * * WD: Used internally by the watchdog.
@@ -250,7 +253,6 @@ struct pool_workqueue {* is marked with WORK_STRUCT_INACTIVE iff it is in pwq->inactive_works. */ int nr_active;/* L: nr of active works */ -int max_active;/* L: max active works */ struct list_head inactive_works;/* L: inactive works */ struct list_head pwqs_node;/* WR: node on wq->pwqs */ struct list_head mayday_node;/* MD: node on wq->maydays */
@@ -298,7 +300,8 @@ struct workqueue_struct {struct worker *rescuer;/* MD: rescue worker */ int nr_drainers;/* WQ: drain in progress */ -int saved_max_active;/* WQ: saved pwq max_active */ +int max_active;/* WO: max active works */ +int saved_max_active;/* WQ: saved max_active */ struct workqueue_attrs *unbound_attrs;/* PW: only for unbound wqs */ struct pool_workqueue *dfl_pwq;/* PW: only for unbound wqs */
@@ -1492,7 +1495,7 @@ static void pwq_dec_nr_in_flight(struct pool_workqueue *pwq, unsigned long work_ pwq->nr_active--;if (!list_empty (&pwq->inactive_works)) {/* one down, submit an inactive one */ -if (pwq->nr_active < pwq->max_active) +if (pwq->nr_active <READ_ONCE (pwq->wq->max_active))pwq_activate_first_inactive (pwq); } }
@@ -1793,7 +1796,13 @@ static void __queue_work(int cpu, struct workqueue_struct *wq, pwq->nr_in_flight[pwq->work_color]++; work_flags =work_color_to_flags (pwq->work_color); -if (likely (pwq->nr_active < pwq->max_active)) { +/* +* Limit the number of concurrently active work items to max_active. +* @work must also queue behind existing inactive work items to maintain +* ordering when max_active changes. See wq_adjust_max_active(). +*/ +if (list_empty (&pwq->inactive_works) && + pwq->nr_active <READ_ONCE (pwq->wq->max_active)) {if (list_empty (&pool->worklist)) pool->watchdog_ts = jiffies;
@@ -4142,50 +4151,6 @@ static void pwq_release_workfn(struct kthread_work *work) } } -/** -* pwq_adjust_max_active - update a pwq's max_active to the current setting -* @pwq: target pool_workqueue -* -* If @pwq isn't freezing, set @pwq->max_active to the associated -* workqueue's saved_max_active and activate inactive work items -* accordingly. If @pwq is freezing, clear @pwq->max_active to zero. -*/ -static void pwq_adjust_max_active (struct pool_workqueue *pwq) -{ -struct workqueue_struct *wq = pwq->wq; -bool freezable = wq->flags &WQ_FREEZABLE ; -unsigned long flags; - -/* for @wq->saved_max_active */ -lockdep_assert_held (&wq->mutex); - -/* fast exit for non-freezable wqs */ -if (!freezable && pwq->max_active == wq->saved_max_active) -return ; - -/* this function can be called during early boot w/ irq disabled */ -raw_spin_lock_irqsave (&pwq->pool->lock, flags); - -/* -* During [un]freezing, the caller is responsible for ensuring that -* this function is called at least once after @workqueue_freezing -* is updated and visible. -*/ -if (!freezable || !workqueue_freezing) { - pwq->max_active = wq->saved_max_active; - -while (!list_empty (&pwq->inactive_works) && - pwq->nr_active < pwq->max_active) -pwq_activate_first_inactive (pwq); - -kick_pool (pwq->pool); - }else { - pwq->max_active =0 ; - } - -raw_spin_unlock_irqrestore (&pwq->pool->lock, flags); -} -/* initialize newly allocated @pwq which is associated with @wq and @pool */ static void init_pwq (struct pool_workqueue *pwq,struct workqueue_struct *wq,struct worker_pool *pool)
@@ -4218,9 +4183,6 @@ static void link_pwq(struct pool_workqueue *pwq)/* set the matching work_color */ pwq->work_color = wq->work_color; -/* sync max_active to the current setting */ -pwq_adjust_max_active (pwq); -/* link in @pwq */ list_add_rcu (&pwq->pwqs_node, &wq->pwqs); }
@@ -4658,6 +4620,52 @@ static int init_rescuer(struct workqueue_struct *wq)return 0 ; } +/** +* wq_adjust_max_active - update a wq's max_active to the current setting +* @wq: target workqueue +* +* If @wq isn't freezing, set @wq->max_active to the saved_max_active and +* activate inactive work items accordingly. If @wq is freezing, clear +* @wq->max_active to zero. +*/ +static void wq_adjust_max_active (struct workqueue_struct *wq) +{ +struct pool_workqueue *pwq; + +lockdep_assert_held (&wq->mutex); + +if ((wq->flags &WQ_FREEZABLE ) && workqueue_freezing) { +WRITE_ONCE (wq->max_active,0 ); +return ; + } + +if (wq->max_active == wq->saved_max_active) +return ; + +/* +* Update @wq->max_active and then kick inactive work items if more +* active work items are allowed. This doesn't break work item ordering +* because new work items are always queued behind existing inactive +* work items if there are any. +*/ +WRITE_ONCE (wq->max_active, wq->saved_max_active); + +for_each_pwq (pwq, wq) { +unsigned long flags; + +/* this function can be called during early boot w/ irq disabled */ +raw_spin_lock_irqsave (&pwq->pool->lock, flags); + +while (!list_empty (&pwq->inactive_works) && + pwq->nr_active < wq->max_active) +pwq_activate_first_inactive (pwq); + +kick_pool (pwq->pool); + +raw_spin_unlock_irqrestore (&pwq->pool->lock, flags); + } +} + __printf(1, 4) struct workqueue_struct *alloc_workqueue(const char *fmt, unsigned int flags,
@@ -4665,7 +4673,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, {va_list args;struct workqueue_struct *wq; -struct pool_workqueue *pwq;int len;/*
@@ -4704,6 +4711,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,/* init wq */ wq->flags = flags; + wq->max_active = max_active; wq->saved_max_active = max_active;mutex_init (&wq->mutex);atomic_set (&wq->nr_pwqs_to_flush,0 );
@@ -4732,8 +4740,7 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,mutex_lock (&wq_pool_mutex);mutex_lock (&wq->mutex); -for_each_pwq (pwq, wq) -pwq_adjust_max_active (pwq); +wq_adjust_max_active (wq);mutex_unlock (&wq->mutex);list_add_tail_rcu (&wq->list, &workqueues);
@@ -4871,8 +4878,6 @@ EXPORT_SYMBOL_GPL(destroy_workqueue);*/ void workqueue_set_max_active (struct workqueue_struct *wq,int max_active) { -struct pool_workqueue *pwq; -/* disallow meddling with max_active for ordered workqueues */ if (WARN_ON (wq->flags & __WQ_ORDERED_EXPLICIT))return ;
@@ -4883,9 +4888,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active) wq->flags &= ~__WQ_ORDERED; wq->saved_max_active = max_active; - -for_each_pwq (pwq, wq) -pwq_adjust_max_active (pwq); +wq_adjust_max_active (wq);mutex_unlock (&wq->mutex); }
@@ -5132,8 +5135,8 @@ static void show_pwq(struct pool_workqueue *pwq)pr_info (" pwq %d:" , pool->id);pr_cont_pool_info (pool); -pr_cont (" active=%d/%d refcnt=%d%s\n" , - pwq->nr_active, pwq->max_active, pwq->refcnt, +pr_cont (" active=%d refcnt=%d%s\n" , + pwq->nr_active, pwq->refcnt, !list_empty (&pwq->mayday_node) ?" MAYDAY" :"" );hash_for_each (pool->busy_hash, bkt, worker, hentry) {
@@ -5681,7 +5684,6 @@ EXPORT_SYMBOL_GPL(work_on_cpu_safe_key);void freeze_workqueues_begin (void ) {struct workqueue_struct *wq; -struct pool_workqueue *pwq;mutex_lock (&wq_pool_mutex);
@@ -5690,8 +5692,7 @@ void freeze_workqueues_begin(void)list_for_each_entry (wq, &workqueues, list) {mutex_lock (&wq->mutex); -for_each_pwq (pwq, wq) -pwq_adjust_max_active (pwq); +wq_adjust_max_active (wq);mutex_unlock (&wq->mutex); }
@@ -5756,7 +5757,6 @@ bool freeze_workqueues_busy(void)void thaw_workqueues (void ) {struct workqueue_struct *wq; -struct pool_workqueue *pwq;mutex_lock (&wq_pool_mutex);
@@ -5768,8 +5768,7 @@ void thaw_workqueues(void)/* restore max_active and repopulate worklist */ list_for_each_entry (wq, &workqueues, list) {mutex_lock (&wq->mutex); -for_each_pwq (pwq, wq) -pwq_adjust_max_active (pwq); +wq_adjust_max_active (wq);mutex_unlock (&wq->mutex); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/715 workqueue: Factor out pwq_is_empty()
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit afa87ce85379e2d93863fce595afdb5771a84004 ]
"!pwq->nr_active && list_empty(&pwq->inactive_works)" test is repeated multiple times. Let's factor it out into pwq_is_empty().
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
kernel/workqueue.c +9 -4
@@ -1456,6 +1456,11 @@ static void put_pwq_unlocked(struct pool_workqueue *pwq) } } +static bool pwq_is_empty (struct pool_workqueue *pwq) +{ +return !pwq->nr_active &&list_empty (&pwq->inactive_works); +} +static void pwq_activate_inactive_work (struct work_struct *work) {struct pool_workqueue *pwq =get_work_pwq (work);
@@ -3325,7 +3330,7 @@ void drain_workqueue(struct workqueue_struct *wq)bool drained;raw_spin_lock_irq (&pwq->pool->lock); - drained = !pwq->nr_active &&list_empty (&pwq->inactive_works); + drained =pwq_is_empty (pwq);raw_spin_unlock_irq (&pwq->pool->lock);if (drained)
@@ -4772,7 +4777,7 @@ static bool pwq_busy(struct pool_workqueue *pwq)if ((pwq != pwq->wq->dfl_pwq) && (pwq->refcnt >1 ))return true; -if (pwq->nr_active || !list_empty (&pwq->inactive_works)) +if (!pwq_is_empty (pwq))return true;return false;
@@ -5210,7 +5215,7 @@ void show_one_workqueue(struct workqueue_struct *wq)unsigned long flags;for_each_pwq (pwq, wq) { -if (pwq->nr_active || !list_empty (&pwq->inactive_works)) { +if (!pwq_is_empty (pwq)) { idle = false;break ; }
@@ -5222,7 +5227,7 @@ void show_one_workqueue(struct workqueue_struct *wq)for_each_pwq (pwq, wq) {raw_spin_lock_irqsave (&pwq->pool->lock, flags); -if (pwq->nr_active || !list_empty (&pwq->inactive_works)) { +if (!pwq_is_empty (pwq)) {/* * Defer printing to avoid deadlocks in console * drivers that queue work while holding locks
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/715 workqueue: Replace pwq_activate_inactive_work() with [__]pwq_activate_work()
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit 4c6380305d21e36581b451f7337a36c93b64e050 ]
To prepare for unbound nr_active handling improvements, move work activation part of pwq_activate_inactive_work() into __pwq_activate_work() and add pwq_activate_work() which tests WORK_STRUCT_INACTIVE and updates nr_active.
pwq_activate_first_inactive() and try_to_grab_pending() are updated to use pwq_activate_work(). The latter conversion is functionally identical. For the former, this conversion adds an unnecessary WORK_STRUCT_INACTIVE testing. This is temporary and will be removed by the next patch.
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-)
kernel/workqueue.c +25 -6
@@ -1461,16 +1461,36 @@ static bool pwq_is_empty(struct pool_workqueue *pwq)return !pwq->nr_active &&list_empty (&pwq->inactive_works); } -static void pwq_activate_inactive_work (struct work_struct *work) +static void __pwq_activate_work (struct pool_workqueue *pwq, +struct work_struct *work) { -struct pool_workqueue *pwq =get_work_pwq (work); -trace_workqueue_activate_work (work);if (list_empty (&pwq->pool->worklist)) pwq->pool->watchdog_ts = jiffies;move_linked_works (work, &pwq->pool->worklist,NULL );__clear_bit (WORK_STRUCT_INACTIVE_BIT ,work_data_bits (work)); +} + +/** +* pwq_activate_work - Activate a work item if inactive +* @pwq: pool_workqueue @work belongs to +* @work: work item to activate +* +* Returns %true if activated. %false if already active. +*/ +static bool pwq_activate_work (struct pool_workqueue *pwq, +struct work_struct *work) +{ +struct worker_pool *pool = pwq->pool; + +lockdep_assert_held (&pool->lock); + +if (!(*work_data_bits (work) &WORK_STRUCT_INACTIVE )) +return false; + pwq->nr_active++; +__pwq_activate_work (pwq, work); +return true; }static void pwq_activate_first_inactive (struct pool_workqueue *pwq)
@@ -1478,7 +1498,7 @@ static void pwq_activate_first_inactive(struct pool_workqueue *pwq)struct work_struct *work =list_first_entry (&pwq->inactive_works, struct work_struct, entry); -pwq_activate_inactive_work (work); +pwq_activate_work (pwq, work); }/**
@@ -1616,8 +1636,7 @@ static int try_to_grab_pending(struct work_struct *work, bool is_dwork,* management later on and cause stall. Make sure the work * item is activated before grabbing. */ -if (*work_data_bits (work) &WORK_STRUCT_INACTIVE ) -pwq_activate_inactive_work (work); +pwq_activate_work (pwq, work);list_del_init (&work->entry);pwq_dec_nr_in_flight (pwq, *work_data_bits (work));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/715 workqueue: Move nr_active handling into helpers
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit 1c270b79ce0b8290f146255ea9057243f6dd3c17 ]
__queue_work(), pwq_dec_nr_in_flight() and wq_adjust_max_active() were open-coding nr_active handling, which is fine given that the operations are trivial. However, the planned unbound nr_active update will make them more complicated, so let's move them into helpers.
- pwq_tryinc_nr_active() is added. It increments nr_active if under max_active limit and return a boolean indicating whether inc was successful. Note that the function is structured to accommodate future changes. __queue_work() is updated to use the new helper.
- pwq_activate_first_inactive() is updated to use pwq_tryinc_nr_active() and thus no longer assumes that nr_active is under max_active and returns a boolean to indicate whether a work item has been activated.
- wq_adjust_max_active() no longer tests directly whether a work item can be activated. Instead, it's updated to use the return value of pwq_activate_first_inactive() to tell whether a work item has been activated.
- nr_active decrement and activating the first inactive work item is factored into pwq_dec_nr_active().
v3: - WARN_ON_ONCE(!WORK_STRUCT_INACTIVE) added to __pwq_activate_work() as
now we're calling the function unconditionally from pwq_activate_first_inactive().
v2: - wq->max_active now uses WRITE/READ_ONCE() as suggested by Lai.
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 86 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 19 deletions(-)
kernel/workqueue.c +67 -19
@@ -1464,11 +1464,14 @@ static bool pwq_is_empty(struct pool_workqueue *pwq)static void __pwq_activate_work (struct pool_workqueue *pwq,struct work_struct *work) { +unsigned long *wdb =work_data_bits (work); + +WARN_ON_ONCE (!(*wdb &WORK_STRUCT_INACTIVE ));trace_workqueue_activate_work (work);if (list_empty (&pwq->pool->worklist)) pwq->pool->watchdog_ts = jiffies;move_linked_works (work, &pwq->pool->worklist,NULL ); -__clear_bit (WORK_STRUCT_INACTIVE_BIT ,work_data_bits (work)); +__clear_bit (WORK_STRUCT_INACTIVE_BIT , wdb); }/**
@@ -1493,12 +1496,66 @@ static bool pwq_activate_work(struct pool_workqueue *pwq,return true; } -static void pwq_activate_first_inactive (struct pool_workqueue *pwq) +/** +* pwq_tryinc_nr_active - Try to increment nr_active for a pwq +* @pwq: pool_workqueue of interest +* +* Try to increment nr_active for @pwq. Returns %true if an nr_active count is +* successfully obtained. %false otherwise. +*/ +static bool pwq_tryinc_nr_active (struct pool_workqueue *pwq) +{ +struct workqueue_struct *wq = pwq->wq; +struct worker_pool *pool = pwq->pool; +bool obtained; + +lockdep_assert_held (&pool->lock); + + obtained = pwq->nr_active <READ_ONCE (wq->max_active); + +if (obtained) + pwq->nr_active++; +return obtained; +} + +/** +* pwq_activate_first_inactive - Activate the first inactive work item on a pwq +* @pwq: pool_workqueue of interest +* +* Activate the first inactive work item of @pwq if available and allowed by +* max_active limit. +* +* Returns %true if an inactive work item has been activated. %false if no +* inactive work item is found or max_active limit is reached. +*/ +static bool pwq_activate_first_inactive (struct pool_workqueue *pwq) +{ +struct work_struct *work = +list_first_entry_or_null (&pwq->inactive_works, + struct work_struct, entry); + +if (work &&pwq_tryinc_nr_active (pwq)) { +__pwq_activate_work (pwq, work); +return true; + }else { +return false; + } +} + +/** +* pwq_dec_nr_active - Retire an active count +* @pwq: pool_workqueue of interest +* +* Decrement @pwq's nr_active and try to activate the first inactive work item. +*/ +static void pwq_dec_nr_active (struct pool_workqueue *pwq) { -struct work_struct *work =list_first_entry (&pwq->inactive_works, - struct work_struct, entry); +struct worker_pool *pool = pwq->pool; -pwq_activate_work (pwq, work); +lockdep_assert_held (&pool->lock); + + pwq->nr_active--; +pwq_activate_first_inactive (pwq); }/**
@@ -1516,14 +1573,8 @@ static void pwq_dec_nr_in_flight(struct pool_workqueue *pwq, unsigned long work_ {int color =get_work_color (work_data); -if (!(work_data &WORK_STRUCT_INACTIVE )) { - pwq->nr_active--; -if (!list_empty (&pwq->inactive_works)) { -/* one down, submit an inactive one */ -if (pwq->nr_active <READ_ONCE (pwq->wq->max_active)) -pwq_activate_first_inactive (pwq); - } - } +if (!(work_data &WORK_STRUCT_INACTIVE )) +pwq_dec_nr_active (pwq); pwq->nr_in_flight[color]--;
@@ -1825,13 +1876,11 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,* @work must also queue behind existing inactive work items to maintain * ordering when max_active changes. See wq_adjust_max_active(). */ -if (list_empty (&pwq->inactive_works) && - pwq->nr_active <READ_ONCE (pwq->wq->max_active)) { +if (list_empty (&pwq->inactive_works) &&pwq_tryinc_nr_active (pwq)) {if (list_empty (&pool->worklist)) pool->watchdog_ts = jiffies;trace_workqueue_activate_work (work); - pwq->nr_active++;insert_work (pwq, work, &pool->worklist, work_flags);kick_pool (pool); }else {
@@ -4680,9 +4729,8 @@ static void wq_adjust_max_active(struct workqueue_struct *wq)/* this function can be called during early boot w/ irq disabled */ raw_spin_lock_irqsave (&pwq->pool->lock, flags); -while (!list_empty (&pwq->inactive_works) && - pwq->nr_active < wq->max_active) -pwq_activate_first_inactive (pwq); +while (pwq_activate_first_inactive (pwq)) + ;kick_pool (pwq->pool);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/715 workqueue: Make wq_adjust_max_active() round-robin pwqs while activating
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit c5404d4e6df6faba1007544b5f4e62c7c14416dd ]
wq_adjust_max_active() needs to activate work items after max_active is increased. Previously, it did that by visiting each pwq once activating all that could be activated. While this makes sense with per-pwq nr_active, nr_active will be shared across multiple pwqs for unbound wqs. Then, we'd want to round-robin through pwqs to be fairer.
In preparation, this patch makes wq_adjust_max_active() round-robin pwqs while activating. While the activation ordering changes, this shouldn't cause user-noticeable behavior changes.
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
kernel/workqueue.c +19 -12
@@ -4703,7 +4703,7 @@ static int init_rescuer(struct workqueue_struct *wq)*/ static void wq_adjust_max_active (struct workqueue_struct *wq) { -struct pool_workqueue *pwq; +bool activated;lockdep_assert_held (&wq->mutex);
@@ -4723,19 +4723,26 @@ static void wq_adjust_max_active(struct workqueue_struct *wq)*/ WRITE_ONCE (wq->max_active, wq->saved_max_active); -for_each_pwq (pwq, wq) { -unsigned long flags; - -/* this function can be called during early boot w/ irq disabled */ -raw_spin_lock_irqsave (&pwq->pool->lock, flags); - -while (pwq_activate_first_inactive (pwq)) - ; +/* +* Round-robin through pwq's activating the first inactive work item +* until max_active is filled. +*/ +do { +struct pool_workqueue *pwq; -kick_pool (pwq->pool); + activated = false; +for_each_pwq (pwq, wq) { +unsigned long flags; -raw_spin_unlock_irqrestore (&pwq->pool->lock, flags); - } +/* can be called during early boot w/ irq disabled */ +raw_spin_lock_irqsave (&pwq->pool->lock, flags); +if (pwq_activate_first_inactive (pwq)) { + activated = true; +kick_pool (pwq->pool); + } +raw_spin_unlock_irqrestore (&pwq->pool->lock, flags); + } + }while (activated); }__printf (1 ,4 )
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/715 workqueue: RCU protect wq->dfl_pwq and implement accessors for it
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit 9f66cff212bb3c1cd25996aaa0dfd0c9e9d8baab ]
wq->cpu_pwq is RCU protected but wq->dfl_pwq isn't. This is okay because currently wq->dfl_pwq is used only accessed to install it into wq->cpu_pwq which doesn't require RCU access. However, we want to be able to access wq->dfl_pwq under RCU in the future to access its __pod_cpumask and the code can be made easier to read by making the two pwq fields behave in the same way.
- Make wq->dfl_pwq RCU protected.
- Add unbound_pwq_slot() and unbound_pwq() which can access both ->dfl_pwq and ->cpu_pwq. The former returns the double pointer that can be used access and update the pwqs. The latter performs locking check and dereferences the double pointer.
- pwq accesses and updates are converted to use unbound_pwq[_slot]().
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 64 +++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 24 deletions(-)
kernel/workqueue.c +40 -24
@@ -304,7 +304,7 @@ struct workqueue_struct {int saved_max_active;/* WQ: saved max_active */ struct workqueue_attrs *unbound_attrs;/* PW: only for unbound wqs */ -struct pool_workqueue *dfl_pwq;/* PW: only for unbound wqs */ +struct pool_workqueue __rcu *dfl_pwq;/* PW: only for unbound wqs */ #ifdef CONFIG_SYSFS struct wq_device *wq_dev;/* I: for sysfs interface */
@@ -635,6 +635,23 @@ static int worker_pool_assign_id(struct worker_pool *pool)return ret; } +static struct pool_workqueue __rcu ** +unbound_pwq_slot (struct workqueue_struct *wq,int cpu) +{ +if (cpu >=0 ) +return per_cpu_ptr (wq->cpu_pwq, cpu); +else +return &wq->dfl_pwq; +} + +/* @cpu < 0 for dfl_pwq */ +static struct pool_workqueue *unbound_pwq (struct workqueue_struct *wq,int cpu) +{ +return rcu_dereference_check (*unbound_pwq_slot (wq, cpu), +lockdep_is_held (&wq_pool_mutex) || +lockdep_is_held (&wq->mutex)); +} +static unsigned int work_color_to_flags (int color) {return color <<WORK_STRUCT_COLOR_SHIFT ;
@@ -4324,10 +4341,11 @@ static void wq_calc_pod_cpumask(struct workqueue_attrs *attrs, int cpu, "possible intersect\n"); } -/* install @pwq into @wq's cpu_pwq and return the old pwq */ +/* install @pwq into @wq and return the old pwq, @cpu < 0 for dfl_pwq */ static struct pool_workqueue *install_unbound_pwq (struct workqueue_struct *wq,int cpu,struct pool_workqueue *pwq) { +struct pool_workqueue __rcu **slot =unbound_pwq_slot (wq, cpu);struct pool_workqueue *old_pwq;lockdep_assert_held (&wq_pool_mutex);
@@ -4336,8 +4354,8 @@ static struct pool_workqueue *install_unbound_pwq(struct workqueue_struct *wq,/* link_pwq() can handle duplicate calls */ link_pwq (pwq); - old_pwq =rcu_access_pointer (*per_cpu_ptr (wq->cpu_pwq, cpu)); -rcu_assign_pointer (*per_cpu_ptr (wq->cpu_pwq, cpu), pwq); + old_pwq =rcu_access_pointer (*slot); +rcu_assign_pointer (*slot, pwq);return old_pwq; }
@@ -4437,14 +4455,11 @@ static void apply_wqattrs_commit(struct apply_wqattrs_ctx *ctx)copy_workqueue_attrs (ctx->wq->unbound_attrs, ctx->attrs); -/* save the previous pwq and install the new one */ +/* save the previous pwqs and install the new ones */ for_each_possible_cpu (cpu) ctx->pwq_tbl[cpu] =install_unbound_pwq (ctx->wq, cpu, ctx->pwq_tbl[cpu]); - -/* @dfl_pwq might not have been used, ensure it's linked */ -link_pwq (ctx->dfl_pwq); -swap (ctx->wq->dfl_pwq, ctx->dfl_pwq); + ctx->dfl_pwq =install_unbound_pwq (ctx->wq,-1 , ctx->dfl_pwq);mutex_unlock (&ctx->wq->mutex); }
@@ -4554,9 +4569,7 @@ static void wq_update_pod(struct workqueue_struct *wq, int cpu,/* nothing to do if the target cpumask matches the current pwq */ wq_calc_pod_cpumask (target_attrs, cpu, off_cpu); - pwq =rcu_dereference_protected (*per_cpu_ptr (wq->cpu_pwq, cpu), -lockdep_is_held (&wq_pool_mutex)); -if (wqattrs_equal (target_attrs, pwq->pool->attrs)) +if (wqattrs_equal (target_attrs,unbound_pwq (wq, cpu)->pool->attrs))return ;/* create a new pwq */
@@ -4574,10 +4587,11 @@ static void wq_update_pod(struct workqueue_struct *wq, int cpu, use_dfl_pwq:mutex_lock (&wq->mutex); -raw_spin_lock_irq (&wq->dfl_pwq->pool->lock); -get_pwq (wq->dfl_pwq); -raw_spin_unlock_irq (&wq->dfl_pwq->pool->lock); - old_pwq =install_unbound_pwq (wq, cpu, wq->dfl_pwq); + pwq =unbound_pwq (wq,-1 ); +raw_spin_lock_irq (&pwq->pool->lock); +get_pwq (pwq); +raw_spin_unlock_irq (&pwq->pool->lock); + old_pwq =install_unbound_pwq (wq, cpu, pwq); out_unlock:mutex_unlock (&wq->mutex);put_pwq_unlocked (old_pwq);
@@ -4615,10 +4629,13 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq)cpus_read_lock ();if (wq->flags & __WQ_ORDERED) { +struct pool_workqueue *dfl_pwq; + ret =apply_workqueue_attrs (wq, ordered_wq_attrs[highpri]);/* there should only be single pwq for ordering guarantee */ -WARN (!ret && (wq->pwqs.next != &wq->dfl_pwq->pwqs_node || - wq->pwqs.prev != &wq->dfl_pwq->pwqs_node), + dfl_pwq =rcu_access_pointer (wq->dfl_pwq); +WARN (!ret && (wq->pwqs.next != &dfl_pwq->pwqs_node || + wq->pwqs.prev != &dfl_pwq->pwqs_node),"ordering guarantee broken for workqueue %s\n" , wq->name); }else { ret =apply_workqueue_attrs (wq, unbound_std_wq_attrs[highpri]);
@@ -4849,7 +4866,7 @@ static bool pwq_busy(struct pool_workqueue *pwq)if (pwq->nr_in_flight[i])return true; -if ((pwq != pwq->wq->dfl_pwq) && (pwq->refcnt >1 )) +if ((pwq !=rcu_access_pointer (pwq->wq->dfl_pwq)) && (pwq->refcnt >1 ))return true;if (!pwq_is_empty (pwq))return true;
@@ -4933,13 +4950,12 @@ void destroy_workqueue(struct workqueue_struct *wq)rcu_read_lock ();for_each_possible_cpu (cpu) { - pwq =rcu_access_pointer (*per_cpu_ptr (wq->cpu_pwq, cpu)); -RCU_INIT_POINTER (*per_cpu_ptr (wq->cpu_pwq, cpu),NULL ); -put_pwq_unlocked (pwq); +put_pwq_unlocked (unbound_pwq (wq, cpu)); +RCU_INIT_POINTER (*unbound_pwq_slot (wq, cpu),NULL ); } -put_pwq_unlocked (wq->dfl_pwq); - wq->dfl_pwq =NULL ; +put_pwq_unlocked (unbound_pwq (wq,-1 )); +RCU_INIT_POINTER (*unbound_pwq_slot (wq,-1 ),NULL );rcu_read_unlock (); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/715 workqueue: Introduce struct wq_node_nr_active
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit 91ccc6e7233bb10a9c176aa4cc70d6f432a441a5 ]
Currently, for both percpu and unbound workqueues, max_active applies per-cpu, which is a recent change for unbound workqueues. The change for unbound workqueues was a significant departure from the previous behavior of per-node application. It made some use cases create undesirable number of concurrent work items and left no good way of fixing them. To address the problem, workqueue is implementing a NUMA node segmented global nr_active mechanism, which will be explained further in the next patch.
As a preparation, this patch introduces struct wq_node_nr_active. It's a data structured allocated for each workqueue and NUMA node pair and currently only tracks the workqueue's number of active work items on the node. This is split out from the next patch to make it easier to understand and review.
Note that there is an extra wq_node_nr_active allocated for the invalid node nr_node_ids which is used to track nr_active for pools which don't have NUMA node associated such as the default fallback system-wide pool.
This doesn't cause any behavior changes visible to userland yet. The next patch will expand to implement the control mechanism on top.
v4: - Fixed out-of-bound access when freeing per-cpu workqueues.
v3: - Use flexible array for wq->node_nr_active as suggested by Lai.
v2: - wq->max_active now uses WRITE/READ_ONCE() as suggested by Lai.
- Lai pointed out that pwq_tryinc_nr_active() incorrectly dropped pwq->max_active check. Restored. As the next patch replaces the max_active enforcement mechanism, this doesn't change the end result.
Stable-dep-of: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
--- kernel/workqueue.c | 142 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 135 insertions(+), 7 deletions(-)
kernel/workqueue.c +135 -7
@@ -280,6 +280,16 @@ struct wq_flusher {struct wq_device ; +/* +* Unlike in a per-cpu workqueue where max_active limits its concurrency level +* on each CPU, in an unbound workqueue, max_active applies to the whole system. +* As sharing a single nr_active across multiple sockets can be very expensive, +* the counting and enforcement is per NUMA node. +*/ +struct wq_node_nr_active { +atomic_t nr;/* per-node nr_active count */ +}; +/* * The externally visible workqueue. It relays the issued work items to * the appropriate worker_pool through its pool_workqueues.
@@ -326,6 +336,7 @@ struct workqueue_struct {/* hot fields used during command issue, aligned to cacheline */ unsigned int flags____cacheline_aligned ;/* WQ: WQ_* flags */ struct pool_workqueue __percpu __rcu **cpu_pwq;/* I: per-cpu pwqs */ +struct wq_node_nr_active *node_nr_active[];/* I: per-node nr_active */ };static struct kmem_cache *pwq_cache;
@@ -1421,6 +1432,31 @@ work_func_t wq_worker_last_func(struct task_struct *task)return worker->last_func; } +/** +* wq_node_nr_active - Determine wq_node_nr_active to use +* @wq: workqueue of interest +* @node: NUMA node, can be %NUMA_NO_NODE +* +* Determine wq_node_nr_active to use for @wq on @node. Returns: +* +* - %NULL for per-cpu workqueues as they don't need to use shared nr_active. +* +* - node_nr_active[nr_node_ids] if @node is %NUMA_NO_NODE. +* +* - Otherwise, node_nr_active[@node]. +*/ +static struct wq_node_nr_active *wq_node_nr_active (struct workqueue_struct *wq, +int node) +{ +if (!(wq->flags &WQ_UNBOUND )) +return NULL ; + +if (node ==NUMA_NO_NODE ) + node = nr_node_ids; + +return wq->node_nr_active[node]; +} +/** * get_pwq - get an extra reference on the specified pool_workqueue * @pwq: pool_workqueue to get
@@ -1502,12 +1538,17 @@ static bool pwq_activate_work(struct pool_workqueue *pwq, struct work_struct *work) {struct worker_pool *pool = pwq->pool; +struct wq_node_nr_active *nna;lockdep_assert_held (&pool->lock);if (!(*work_data_bits (work) &WORK_STRUCT_INACTIVE ))return false; + nna =wq_node_nr_active (pwq->wq, pool->node); +if (nna) +atomic_inc (&nna->nr); + pwq->nr_active++;__pwq_activate_work (pwq, work);return true;
@@ -1524,14 +1565,18 @@ static bool pwq_tryinc_nr_active(struct pool_workqueue *pwq) {struct workqueue_struct *wq = pwq->wq;struct worker_pool *pool = pwq->pool; +struct wq_node_nr_active *nna =wq_node_nr_active (wq, pool->node);bool obtained;lockdep_assert_held (&pool->lock); obtained = pwq->nr_active <READ_ONCE (wq->max_active); -if (obtained) +if (obtained) { pwq->nr_active++; +if (nna) +atomic_inc (&nna->nr); + }return obtained; }
@@ -1568,10 +1613,26 @@ static bool pwq_activate_first_inactive(struct pool_workqueue *pwq)static void pwq_dec_nr_active (struct pool_workqueue *pwq) {struct worker_pool *pool = pwq->pool; +struct wq_node_nr_active *nna =wq_node_nr_active (pwq->wq, pool->node);lockdep_assert_held (&pool->lock); +/* +* @pwq->nr_active should be decremented for both percpu and unbound +* workqueues. +*/ pwq->nr_active--; + +/* +* For a percpu workqueue, it's simple. Just need to kick the first +* inactive work item on @pwq itself. +*/ +if (!nna) { +pwq_activate_first_inactive (pwq); +return ; + } + +atomic_dec (&nna->nr);pwq_activate_first_inactive (pwq); }
@@ -4026,11 +4087,63 @@ static void wq_free_lockdep(struct workqueue_struct *wq) }#endif +static void free_node_nr_active (struct wq_node_nr_active **nna_ar) +{ +int node; + +for_each_node (node) { +kfree (nna_ar[node]); + nna_ar[node] =NULL ; + } + +kfree (nna_ar[nr_node_ids]); + nna_ar[nr_node_ids] =NULL ; +} + +static void init_node_nr_active (struct wq_node_nr_active *nna) +{ +atomic_set (&nna->nr,0 ); +} + +/* +* Each node's nr_active counter will be accessed mostly from its own node and +* should be allocated in the node. +*/ +static int alloc_node_nr_active (struct wq_node_nr_active **nna_ar) +{ +struct wq_node_nr_active *nna; +int node; + +for_each_node (node) { + nna =kzalloc_node (sizeof (*nna),GFP_KERNEL , node); +if (!nna) + goto err_free; +init_node_nr_active (nna); + nna_ar[node] = nna; + } + +/* [nr_node_ids] is used as the fallback */ + nna =kzalloc_node (sizeof (*nna),GFP_KERNEL ,NUMA_NO_NODE ); +if (!nna) + goto err_free; +init_node_nr_active (nna); + nna_ar[nr_node_ids] = nna; + +return 0 ; + +err_free: +free_node_nr_active (nna_ar); +return -ENOMEM ; +} +static void rcu_free_wq (struct rcu_head *rcu) {struct workqueue_struct *wq = container_of(rcu, struct workqueue_struct, rcu); +if (wq->flags &WQ_UNBOUND ) +free_node_nr_active (wq->node_nr_active); +wq_free_lockdep (wq);free_percpu (wq->cpu_pwq);free_workqueue_attrs (wq->unbound_attrs);
@@ -4769,7 +4882,8 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, {va_list args;struct workqueue_struct *wq; -int len; +size_t wq_size; +int name_len;/* * Unbound && max_active == 1 used to imply ordered, which is no longer
@@ -4785,7 +4899,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, flags |=WQ_UNBOUND ;/* allocate wq and format name */ - wq =kzalloc (sizeof (*wq),GFP_KERNEL ); +if (flags &WQ_UNBOUND ) + wq_size =struct_size (wq, node_nr_active, nr_node_ids +1 ); +else + wq_size =sizeof (*wq); + + wq =kzalloc (wq_size,GFP_KERNEL );if (!wq)return NULL ;
@@ -4796,11 +4915,12 @@ struct workqueue_struct *alloc_workqueue(const char *fmt, }va_start (args, max_active); - len =vsnprintf (wq->name,sizeof (wq->name), fmt, args); + name_len =vsnprintf (wq->name,sizeof (wq->name), fmt, args);va_end (args); -if (len >=WQ_NAME_LEN ) -pr_warn_once ("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n" , wq->name); +if (name_len >=WQ_NAME_LEN ) +pr_warn_once ("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n" , + wq->name); max_active = max_active ?:WQ_DFL_ACTIVE ; max_active =wq_clamp_max_active (max_active, flags, wq->name);
@@ -4819,8 +4939,13 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,wq_init_lockdep (wq);INIT_LIST_HEAD (&wq->list); +if (flags &WQ_UNBOUND ) { +if (alloc_node_nr_active (wq->node_nr_active) <0 ) + goto err_unreg_lockdep; + } +if (alloc_and_link_pwqs (wq) <0 ) - goto err_unreg_lockdep; + goto err_free_node_nr_active;if (wq_online &&init_rescuer (wq) <0 ) goto err_destroy;
@@ -4845,6 +4970,9 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,return wq; +err_free_node_nr_active: +if (wq->flags &WQ_UNBOUND ) +free_node_nr_active (wq->node_nr_active); err_unreg_lockdep:wq_unregister_lockdep (wq);wq_free_lockdep (wq);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 10/715 workqueue: Implement system-wide nr_active enforcement for unbound workqueues
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit 5797b1c18919cd9c289ded7954383e499f729ce0 ]
A pool_workqueue (pwq) represents the connection between a workqueue and a worker_pool. One of the roles that a pwq plays is enforcement of the max_active concurrency limit. Before 636b927eba5b ("workqueue: Make unbound workqueues to use per-cpu pool_workqueues"), there was one pwq per each CPU for per-cpu workqueues and per each NUMA node for unbound workqueues, which was a natural result of per-cpu workqueues being served by per-cpu pools and unbound by per-NUMA pools.
In terms of max_active enforcement, this was, while not perfect, workable. For per-cpu workqueues, it was fine. For unbound, it wasn't great in that NUMA machines would get max_active that's multiplied by the number of nodes but didn't cause huge problems because NUMA machines are relatively rare and the node count is usually pretty low.
However, cache layouts are more complex now and sharing a worker pool across a whole node didn't really work well for unbound workqueues. Thus, a series of commits culminating on 8639ecebc9b1 ("workqueue: Make unbound workqueues to use per-cpu pool_workqueues") implemented more flexible affinity mechanism for unbound workqueues which enables using e.g. last-level-cache aligned pools. In the process, 636b927eba5b ("workqueue: Make unbound workqueues to use per-cpu pool_workqueues") made unbound workqueues use per-cpu pwqs like per-cpu workqueues.
While the change was necessary to enable more flexible affinity scopes, this came with the side effect of blowing up the effective max_active for unbound workqueues. Before, the effective max_active for unbound workqueues was multiplied by the number of nodes. After, by the number of CPUs.
636b927eba5b ("workqueue: Make unbound workqueues to use per-cpu pool_workqueues") claims that this should generally be okay. It is okay for users which self-regulates concurrency level which are the vast majority; however, there are enough use cases which actually depend on max_active to prevent the level of concurrency from going bonkers including several IO handling workqueues that can issue a work item for each in-flight IO. With targeted benchmarks, the misbehavior can easily be exposed as reported in
http://lkml.kernel.org/r/dbu6wiwu3sdhmhikb2w6lns7b27gbobfavhjj57kwi2quafgwl@htjcc5oikcr3.
Unfortunately, there is no way to express what these use cases need using per-cpu max_active. A CPU may issue most of in-flight IOs, so we don't want to set max_active too low but as soon as we increase max_active a bit, we can end up with unreasonable number of in-flight work items when many CPUs issue IOs at the same time. ie. The acceptable lowest max_active is higher than the acceptable highest max_active.
Ideally, max_active for an unbound workqueue should be system-wide so that the users can regulate the total level of concurrency regardless of node and cache layout. The reasons workqueue hasn't implemented that yet are:
- One max_active enforcement decouples from pool boundaires, chaining execution after a work item finishes requires inter-pool operations which would require lock dancing, which is nasty.
- Sharing a single nr_active count across the whole system can be pretty expensive on NUMA machines.
- Per-pwq enforcement had been more or less okay while we were using per-node pools.
It looks like we no longer can avoid decoupling max_active enforcement from pool boundaries. This patch implements system-wide nr_active mechanism with the following design characteristics:
- To avoid sharing a single counter across multiple nodes, the configured max_active is split across nodes according to the proportion of each workqueue's online effective CPUs per node. e.g. A node with twice more online effective CPUs will get twice higher portion of max_active.
- Workqueue used to be able to process a chain of interdependent work items which is as long as max_active. We can't do this anymore as max_active is distributed across the nodes. Instead, a new parameter min_active is introduced which determines the minimum level of concurrency within a node regardless of how max_active distribution comes out to be.
It is set to the smaller of max_active and WQ_DFL_MIN_ACTIVE which is 8. This can lead to higher effective max_weight than configured and also deadlocks if a workqueue was depending on being able to handle chains of interdependent work items that are longer than 8.
I believe these should be fine given that the number of CPUs in each NUMA node is usually higher than 8 and work item chain longer than 8 is pretty unlikely. However, if these assumptions turn out to be wrong, we'll need to add an interface to adjust min_active.
- Each unbound wq has an array of struct wq_node_nr_active which tracks per-node nr_active. When its pwq wants to run a work item, it has to obtain the matching node's nr_active. If over the node's max_active, the pwq is queued on wq_node_nr_active->pending_pwqs. As work items finish, the completion path round-robins the pending pwqs activating the first inactive work item of each, which involves some pool lock dancing and kicking other pools. It's not the simplest code but doesn't look too bad.
v4: - wq_adjust_max_active() updated to invoke wq_update_node_max_active().
- wq_adjust_max_active() is now protected by wq->mutex instead of wq_pool_mutex.
v3: - wq_node_max_active() used to calculate per-node max_active on the fly
based on system-wide CPU online states. Lai pointed out that this can lead to skewed distributions for workqueues with restricted cpumasks. Update the max_active distribution to use per-workqueue effective online CPU counts instead of system-wide and cache the calculation results in node_nr_active->max.
v2: - wq->min/max_active now uses WRITE/READ_ONCE() as suggested by Lai.
--- include/linux/workqueue.h | 35 +++- kernel/workqueue.c | 341 ++++++++++++++++++++++++++++++++++---- 2 files changed, 341 insertions(+), 35 deletions(-)
include/linux/workqueue.h +32 -3
@@ -391,6 +391,13 @@ enum {WQ_MAX_ACTIVE =512 ,/* I like 512, better ideas? */ WQ_UNBOUND_MAX_ACTIVE =WQ_MAX_ACTIVE ,WQ_DFL_ACTIVE =WQ_MAX_ACTIVE /2 , + +/* +* Per-node default cap on min_active. Unless explicitly set, min_active +* is set to min(max_active, WQ_DFL_MIN_ACTIVE). For more details, see +* workqueue_struct->min_active definition. +*/ + WQ_DFL_MIN_ACTIVE = 8, };/*
@@ -433,11 +440,33 @@ extern struct workqueue_struct *system_freezable_power_efficient_wq;* alloc_workqueue - allocate a workqueue * @fmt: printf format for the name of the workqueue * @flags: WQ_* flags -* @max_active: max in-flight work items per CPU, 0 for default +* @max_active: max in-flight work items, 0 for default * remaining args: args for @fmt * -* Allocate a workqueue with the specified parameters. For detailed -* information on WQ_* flags, please refer to +* For a per-cpu workqueue, @max_active limits the number of in-flight work +* items for each CPU. e.g. @max_active of 1 indicates that each CPU can be +* executing at most one work item for the workqueue. +* +* For unbound workqueues, @max_active limits the number of in-flight work items +* for the whole system. e.g. @max_active of 16 indicates that that there can be +* at most 16 work items executing for the workqueue in the whole system. +* +* As sharing the same active counter for an unbound workqueue across multiple +* NUMA nodes can be expensive, @max_active is distributed to each NUMA node +* according to the proportion of the number of online CPUs and enforced +* independently. +* +* Depending on online CPU distribution, a node may end up with per-node +* max_active which is significantly lower than @max_active, which can lead to +* deadlocks if the per-node concurrency limit is lower than the maximum number +* of interdependent work items for the workqueue. +* +* To guarantee forward progress regardless of online CPU distribution, the +* concurrency limit on every node is guaranteed to be equal to or greater than +* min_active which is set to min(@max_active, %WQ_DFL_MIN_ACTIVE). This means +* that the sum of per-node max_active's may be larger than @max_active. +* +* For detailed information on %WQ_* flags, please refer to * Documentation/core-api/workqueue.rst. * * RETURNS:
kernel/workqueue.c +309 -32
541 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 11/715 workqueue: Don't call cpumask_test_cpu() with -1 CPU in wq_update_node_max_active()
In reply to Sasha LevinFrom: Tejun Heo <[email protected]>
[ Upstream commit 15930da42f8981dc42c19038042947b475b19f47 ]
For wq_update_node_max_active(), @off_cpu of -1 indicates that no CPU is going down. The function was incorrectly calling cpumask_test_cpu() with -1 CPU leading to oopses like the following on some archs:
Unable to handle kernel paging request at virtual address ffff0002100296e0
..
pc : wq_update_node_max_active+0x50/0x1fc
lr : wq_update_node_max_active+0x1f0/0x1fc
...
Call trace:
wq_update_node_max_active+0x50/0x1fc
apply_wqattrs_commit+0xf0/0x114
apply_workqueue_attrs_locked+0x58/0xa0
alloc_workqueue+0x5ac/0x774
workqueue_init_early+0x460/0x540
start_kernel+0x258/0x684
__primary_switched+0xb8/0xc0
Code: 9100a273 35000d01 53067f00 d0016dc1 (f8607a60)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Attempted to kill the idle task!
---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---Fix it.
--- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/workqueue.c +1 -1
@@ -1506,7 +1506,7 @@ static void wq_update_node_max_active(struct workqueue_struct *wq, int off_cpu)lockdep_assert_held (&wq->mutex); -if (!cpumask_test_cpu (off_cpu, effective)) +if (off_cpu >=0 && !cpumask_test_cpu (off_cpu, effective)) off_cpu =-1 ; total_cpus =cpumask_weight_and (effective, cpu_online_mask);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/715 iomap: clear the per-folio dirty bits on all writeback failures
In reply to Sasha LevinFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 7ea1d9b4a840c2dd01d1234663d4a8ef256cfe39 ]
write_cache_pages always clear the page dirty bit before calling into the file systems, and leaves folios with a writeback failure without the dirty bit after return. We also clear the per-block writeback bits for writeback failures unless no I/O has submitted, which will leave the folio in an inconsistent state where it doesn't have the folio dirty, but one or more per-block dirty bits. This seems to be due the place where the iomap_clear_range_dirty call was inserted into the existing not very clearly structured code when adding per-block dirty bit support and not actually intentional. Switch to always clearing the dirty on writeback failure.
--- fs/iomap/buffered-io.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
fs/iomap/buffered-io.c +11 -7
@@ -1833,16 +1833,10 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,if (unlikely (error)) {/* * Let the filesystem know what portion of the current page -* failed to map. If the page hasn't been added to ioend, it -* won't be affected by I/O completion and we must unlock it -* now. +* failed to map. */ if (wpc->ops->discard_folio) wpc->ops->discard_folio (folio, pos); -if (!count) { -folio_unlock (folio); - goto done; - } }/*
@@ -1851,6 +1845,16 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,* all the dirty bits in the folio here. */ iomap_clear_range_dirty (folio,0 ,folio_size (folio)); + +/* +* If the page hasn't been added to the ioend, it won't be affected by +* I/O completion and we must unlock it now. +*/ +if (error && !count) { +folio_unlock (folio); + goto done; + } +folio_start_writeback (folio);folio_unlock (folio);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/715 fs: Fix rw_hint validation
In reply to Sasha LevinFrom: Bart Van Assche <[email protected]>
[ Upstream commit ec16b147a55bfa14e858234eb7b1a7c8e7cd5021 ]
Reject values that are valid rw_hints after truncation but not before truncation by passing an untruncated value to rw_hint_valid().
--- fs/fcntl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
fs/fcntl.c +5 -7
@@ -268,7 +268,7 @@ static int f_getowner_uids(struct file *filp, unsigned long arg) }#endif -static bool rw_hint_valid (enum rw_hint hint) +static bool rw_hint_valid (u64 hint) {switch (hint) {case RWH_WRITE_LIFE_NOT_SET :
@@ -288,19 +288,17 @@ static long fcntl_rw_hint(struct file *file, unsigned int cmd, {struct inode *inode =file_inode (file);u64 __user *argp = (u64 __user *)arg; -enum rw_hint hint; -u64 h; +u64 hint;switch (cmd) {case F_GET_RW_HINT : - h = inode->i_write_hint; -if (copy_to_user (argp, &h,sizeof (*argp))) + hint = inode->i_write_hint; +if (copy_to_user (argp, &hint,sizeof (*argp)))return -EFAULT ;return 0 ;case F_SET_RW_HINT : -if (copy_from_user (&h, argp,sizeof (h))) +if (copy_from_user (&hint, argp,sizeof (hint)))return -EFAULT ; - hint = (enum rw_hint ) h;if (!rw_hint_valid (hint))return -EINVAL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 14/715 io_uring: remove looping around handling traditional task_work
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
[ Upstream commit 592b4805432af075468876771c0f7d41273ccb3c ]
A previous commit added looping around handling traditional task_work as an optimization, and while that may seem like a good idea, it's also possible to run into application starvation doing so. If the task_work generation is bursty, we can get very deep task_work queues, and we can end up looping in here for a very long time.
One immediately observable problem with that is handling network traffic using provided buffers, where flooding incoming traffic and looping task_work handling will very quickly lead to buffer starvation as we keep running task_work rather than returning to the application so it can handle the associated CQEs and also provide buffers back.
--- io_uring/io_uring.c | 45 +++++++-------------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-)
io_uring/io_uring.c +7 -38
@@ -1176,12 +1176,11 @@ static void ctx_flush_and_put(struct io_ring_ctx *ctx, struct io_tw_state *ts)static unsigned int handle_tw_list (struct llist_node *node,struct io_ring_ctx **ctx, -struct io_tw_state *ts, -struct llist_node *last) +struct io_tw_state *ts) {unsigned int count =0 ; -while (node && node != last) { + do { struct llist_node *next = node->next; struct io_kiocb *req = container_of(node, struct io_kiocb, io_task_work.node);
@@ -1205,7 +1204,7 @@ static unsigned int handle_tw_list(struct llist_node *node, *ctx =NULL ;cond_resched (); } - } + }while (node);return count; }
@@ -1224,22 +1223,6 @@ static inline struct llist_node *io_llist_xchg(struct llist_head *head,return xchg (&head->first, new); } -/** -* io_llist_cmpxchg - possibly swap all entries in a lock-less list -* @head: the head of lock-less list to delete all entries -* @old: expected old value of the first entry of the list -* @new: new entry as the head of the list -* -* perform a cmpxchg on the first entry of the list. -*/ - -static inline struct llist_node *io_llist_cmpxchg (struct llist_head *head, -struct llist_node *old, -struct llist_node *new) -{ -return cmpxchg (&head->first, old, new); -} -static __cold void io_fallback_tw (struct io_uring_task *tctx,bool sync) {struct llist_node *node =llist_del_all (&tctx->task_list);
@@ -1274,9 +1257,7 @@ void tctx_task_work(struct callback_head *cb)struct io_ring_ctx *ctx =NULL ; struct io_uring_task *tctx = container_of(cb, struct io_uring_task, task_work); -struct llist_node fake = {};struct llist_node *node; -unsigned int loops =0 ;unsigned int count =0 ;if (unlikely (current->flags &PF_EXITING )) {
@@ -1284,21 +1265,9 @@ void tctx_task_work(struct callback_head *cb)return ; } -do { - loops++; - node =io_llist_xchg (&tctx->task_list, &fake); - count +=handle_tw_list (node, &ctx, &ts, &fake); - -/* skip expensive cmpxchg if there are items in the list */ -if (READ_ONCE (tctx->task_list.first) != &fake) -continue ; -if (ts.locked && !wq_list_empty (&ctx->submit_state.compl_reqs)) { -io_submit_flush_completions (ctx); -if (READ_ONCE (tctx->task_list.first) != &fake) -continue ; - } - node =io_llist_cmpxchg (&tctx->task_list, &fake,NULL ); - }while (node != &fake); + node =llist_del_all (&tctx->task_list); +if (node) + count =handle_tw_list (node, &ctx, &ts);ctx_flush_and_put (ctx, &ts);
@@ -1306,7 +1275,7 @@ void tctx_task_work(struct callback_head *cb)if (unlikely (atomic_read (&tctx->in_cancel)))io_uring_drop_tctx_refs (current); -trace_io_uring_task_work_run (tctx, count, loops); +trace_io_uring_task_work_run (tctx, count,1 ); }static inline void io_req_local_work_add (struct io_kiocb *req,unsigned flags)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 15/715 io_uring: remove unconditional looping in local task_work handling
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
[ Upstream commit 9fe3eaea4a3530ca34a8d8ff00b1848c528789ca ]
If we have a ton of notifications coming in, we can be looping in here for a long time. This can be problematic for various reasons, mostly because we can starve userspace. If the application is waiting on N events, then only re-run if we need more events.
--- io_uring/io_uring.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-)
io_uring/io_uring.c +29 -15
@@ -1389,7 +1389,20 @@ static void __cold io_move_task_work_from_local(struct io_ring_ctx *ctx) } } -static int __io_run_local_work (struct io_ring_ctx *ctx,struct io_tw_state *ts) +static bool io_run_local_work_continue (struct io_ring_ctx *ctx,int events, +int min_events) +{ +if (llist_empty (&ctx->work_llist)) +return false; +if (events < min_events) +return true; +if (ctx->flags &IORING_SETUP_TASKRUN_FLAG ) +atomic_or (IORING_SQ_TASKRUN , &ctx->rings->sq_flags); +return false; +} + +static int __io_run_local_work (struct io_ring_ctx *ctx,struct io_tw_state *ts, +int min_events) {struct llist_node *node;unsigned int loops =0 ;
@@ -1418,18 +1431,20 @@ static int __io_run_local_work(struct io_ring_ctx *ctx, struct io_tw_state *ts) } loops++; -if (!llist_empty (&ctx->work_llist)) +if (io_run_local_work_continue (ctx, ret, min_events)) goto again;if (ts->locked) {io_submit_flush_completions (ctx); -if (!llist_empty (&ctx->work_llist)) +if (io_run_local_work_continue (ctx, ret, min_events)) goto again; } +trace_io_uring_local_work_run (ctx, ret, loops);return ret; } -static inline int io_run_local_work_locked (struct io_ring_ctx *ctx) +static inline int io_run_local_work_locked (struct io_ring_ctx *ctx, +int min_events) {struct io_tw_state ts = { .locked = true, };int ret;
@@ -1437,20 +1452,20 @@ static inline int io_run_local_work_locked(struct io_ring_ctx *ctx)if (llist_empty (&ctx->work_llist))return 0 ; - ret =__io_run_local_work (ctx, &ts); + ret =__io_run_local_work (ctx, &ts, min_events);/* shouldn't happen! */ if (WARN_ON_ONCE (!ts.locked))mutex_lock (&ctx->uring_lock);return ret; } -static int io_run_local_work (struct io_ring_ctx *ctx) +static int io_run_local_work (struct io_ring_ctx *ctx,int min_events) {struct io_tw_state ts = {};int ret; ts.locked =mutex_trylock (&ctx->uring_lock); - ret =__io_run_local_work (ctx, &ts); + ret =__io_run_local_work (ctx, &ts, min_events);if (ts.locked)mutex_unlock (&ctx->uring_lock);
@@ -1646,7 +1661,7 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min) io_task_work_pending(ctx)) {u32 tail = ctx->cached_cq_tail; - (void )io_run_local_work_locked (ctx); + (void )io_run_local_work_locked (ctx, min);if (task_work_pending (current) ||wq_list_empty (&ctx->iopoll_list)) {
@@ -2489,7 +2504,7 @@ int io_run_task_work_sig(struct io_ring_ctx *ctx) {if (!llist_empty (&ctx->work_llist)) {__set_current_state (TASK_RUNNING ); -if (io_run_local_work (ctx) >0 ) +if (io_run_local_work (ctx,INT_MAX ) >0 )return 0 ; }if (io_run_task_work () >0 )
@@ -2557,7 +2572,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,if (!io_allowed_run_tw (ctx))return -EEXIST ;if (!llist_empty (&ctx->work_llist)) -io_run_local_work (ctx); +io_run_local_work (ctx, min_events);io_run_task_work ();io_cqring_overflow_flush (ctx);/* if user messes with these they will just get an early return */
@@ -2595,11 +2610,10 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,trace_io_uring_cqring_wait (ctx, min_events); do { + int nr_wait = (int) iowq.cq_tail - READ_ONCE(ctx->rings->cq.tail); unsigned long check_cq; if (ctx->flags & IORING_SETUP_DEFER_TASKRUN) { - int nr_wait = (int) iowq.cq_tail - READ_ONCE(ctx->rings->cq.tail); - atomic_set(&ctx->cq_wait_nr, nr_wait); set_current_state(TASK_INTERRUPTIBLE); } else {
@@ -2618,7 +2632,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,*/ io_run_task_work ();if (!llist_empty (&ctx->work_llist)) -io_run_local_work (ctx); +io_run_local_work (ctx, nr_wait);/* * Non-local task_work will be run on exit to userspace, but
@@ -3273,7 +3287,7 @@ static __cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,if ((ctx->flags &IORING_SETUP_DEFER_TASKRUN ) &&io_allowed_defer_tw_run (ctx)) - ret |=io_run_local_work (ctx) >0 ; + ret |=io_run_local_work (ctx,INT_MAX ) >0 ; ret |=io_cancel_defer_files (ctx, task, cancel_all);mutex_lock (&ctx->uring_lock); ret |=io_poll_remove_all (ctx, task, cancel_all);
@@ -3635,7 +3649,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,* it should handle ownership problems if any. */ if (ctx->flags &IORING_SETUP_DEFER_TASKRUN ) - (void )io_run_local_work_locked (ctx); + (void )io_run_local_work_locked (ctx, min_complete); }mutex_unlock (&ctx->uring_lock); }
Signature · 1 line
2.43.0
Re: [PATCH 6.8 015/715] io_uring: remove unconditional looping in local task_work handling
Quoted 8 lines · Sasha Levin
From: Jens Axboe <[email protected]>
[ Upstream commit
9fe3eaea4a3530ca34a8d8ff00b1848c528789ca]If we have a ton of notifications coming in, we can be looping in here for a long time. This can be problematic for various reasons, mostly because we can starve userspace. If the application is waiting on N events, then only re-run if we need more events.
This commit breaks test/recv-multishot.c from liburing:
early error: res 4
test stream=1 wait_each=0 recvmsg=0 early_error=0 defer=1 failed
The behaviour is the same in 6.9-rc2 (which contains the commit too).
Reverting the commit on the top of 6.8.2 makes it pass again.
Should the test be updated or is the commit wrong?
Thanks.
Quoted 148 lines
Fixes c0e0d6ba25f1 ("io_uring: add IORING_SETUP_DEFER_TASKRUN")Signed-off-by Jens Axboe <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- io_uring/io_uring.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-)io_uring/io_uring.c +29
-15@@ -1389,7 +1389,20 @@ static void __cold io_move_task_work_from_local(struct io_ring_ctx *ctx) } } -static int __io_run_local_work (struct io_ring_ctx *ctx,struct io_tw_state *ts) +static bool io_run_local_work_continue (struct io_ring_ctx *ctx,int events, +int min_events) +{ +if (llist_empty (&ctx->work_llist)) +return false; +if (events < min_events) +return true; +if (ctx->flags &IORING_SETUP_TASKRUN_FLAG ) +atomic_or (IORING_SQ_TASKRUN , &ctx->rings->sq_flags); +return false; +} + +static int __io_run_local_work (struct io_ring_ctx *ctx,struct io_tw_state *ts, +int min_events) {struct llist_node *node;unsigned int loops =0 ;@@ -1418,18 +1431,20 @@ static int __io_run_local_work(struct io_ring_ctx *ctx, struct io_tw_state *ts) } loops++; -if (!llist_empty (&ctx->work_llist)) +if (io_run_local_work_continue (ctx, ret, min_events)) goto again;if (ts->locked) {io_submit_flush_completions (ctx); -if (!llist_empty (&ctx->work_llist)) +if (io_run_local_work_continue (ctx, ret, min_events)) goto again; } +trace_io_uring_local_work_run (ctx, ret, loops);return ret; } -static inline int io_run_local_work_locked (struct io_ring_ctx *ctx) +static inline int io_run_local_work_locked (struct io_ring_ctx *ctx, +int min_events) {struct io_tw_state ts = { .locked = true, };int ret;@@ -1437,20 +1452,20 @@ static inline int io_run_local_work_locked(struct io_ring_ctx *ctx)if (llist_empty (&ctx->work_llist))return 0 ; - ret =__io_run_local_work (ctx, &ts); + ret =__io_run_local_work (ctx, &ts, min_events);/* shouldn't happen! */ if (WARN_ON_ONCE (!ts.locked))mutex_lock (&ctx->uring_lock);return ret; } -static int io_run_local_work (struct io_ring_ctx *ctx) +static int io_run_local_work (struct io_ring_ctx *ctx,int min_events) {struct io_tw_state ts = {};int ret; ts.locked =mutex_trylock (&ctx->uring_lock); - ret =__io_run_local_work (ctx, &ts); + ret =__io_run_local_work (ctx, &ts, min_events);if (ts.locked)mutex_unlock (&ctx->uring_lock);@@ -1646,7 +1661,7 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min) io_task_work_pending(ctx)) {u32 tail = ctx->cached_cq_tail; - (void )io_run_local_work_locked (ctx); + (void )io_run_local_work_locked (ctx, min);if (task_work_pending (current) ||wq_list_empty (&ctx->iopoll_list)) {@@ -2489,7 +2504,7 @@ int io_run_task_work_sig(struct io_ring_ctx *ctx) {if (!llist_empty (&ctx->work_llist)) {__set_current_state (TASK_RUNNING ); -if (io_run_local_work (ctx) >0 ) +if (io_run_local_work (ctx,INT_MAX ) >0 )return 0 ; }if (io_run_task_work () >0 )@@ -2557,7 +2572,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,if (!io_allowed_run_tw (ctx))return -EEXIST ;if (!llist_empty (&ctx->work_llist)) -io_run_local_work (ctx); +io_run_local_work (ctx, min_events);io_run_task_work ();io_cqring_overflow_flush (ctx);/* if user messes with these they will just get an early return */ @@ -2595,11 +2610,10 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,trace_io_uring_cqring_wait (ctx, min_events); do { + int nr_wait = (int) iowq.cq_tail - READ_ONCE(ctx->rings->cq.tail); unsigned long check_cq; if (ctx->flags & IORING_SETUP_DEFER_TASKRUN) { - int nr_wait = (int) iowq.cq_tail - READ_ONCE(ctx->rings->cq.tail); - atomic_set(&ctx->cq_wait_nr, nr_wait); set_current_state(TASK_INTERRUPTIBLE); } else {@@ -2618,7 +2632,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,*/ io_run_task_work ();if (!llist_empty (&ctx->work_llist)) -io_run_local_work (ctx); +io_run_local_work (ctx, nr_wait);/* * Non-local task_work will be run on exit to userspace, but @@ -3273,7 +3287,7 @@ static __cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,if ((ctx->flags &IORING_SETUP_DEFER_TASKRUN ) &&io_allowed_defer_tw_run (ctx)) - ret |=io_run_local_work (ctx) >0 ; + ret |=io_run_local_work (ctx,INT_MAX ) >0 ; ret |=io_cancel_defer_files (ctx, task, cancel_all);mutex_lock (&ctx->uring_lock); ret |=io_poll_remove_all (ctx, task, cancel_all);@@ -3635,7 +3649,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,* it should handle ownership problems if any. */ if (ctx->flags &IORING_SETUP_DEFER_TASKRUN ) - (void )io_run_local_work_locked (ctx); + (void )io_run_local_work_locked (ctx, min_complete); }mutex_unlock (&ctx->uring_lock); }
Signature · 2 lines
js suse labs
Re: [PATCH 6.8 015/715] io_uring: remove unconditional looping in local task_work handling
Quoted 14 lines · Jiri Slaby
Quoted 8 lines · Sasha Levin
From: Jens Axboe <[email protected]>
[ Upstream commit
9fe3eaea4a3530ca34a8d8ff00b1848c528789ca]If we have a ton of notifications coming in, we can be looping in here for a long time. This can be problematic for various reasons, mostly because we can starve userspace. If the application is waiting on N events, then only re-run if we need more events.
This commit breaks
test/recv-multishot.cfrom liburing:
early error: res 4
test stream=1 wait_each=0 recvmsg=0 early_error=0 defer=1 failed
Quoted 5 lines
The behaviour is the same in 6.9-rc2 (which contains the commit too).
Reverting the commit on the top of 6.8.2 makes it pass again.
Should the test be updated or is the commit wrong?
The commit is fine, it's the test that is buggy. Sometimes test cases make odd assumptions that are just wrong but happen to work, for some definition of work. Eg it would work fine on an idle system, but not necessarily if not. For this one, the fix is in liburing:
Signature · 1 line
Jens Axboe
Re: [PATCH 6.8 015/715] io_uring: remove unconditional looping in local task_work handling
Quoted 19 lines · Jens Axboe
Quoted 18 lines · Jiri Slaby
Quoted 8 lines · Sasha Levin
From: Jens Axboe <[email protected]>
[ Upstream commit
9fe3eaea4a3530ca34a8d8ff00b1848c528789ca]If we have a ton of notifications coming in, we can be looping in here for a long time. This can be problematic for various reasons, mostly because we can starve userspace. If the application is waiting on N events, then only re-run if we need more events.
This commit breaks
test/recv-multishot.cfrom liburing:
early error: res 4
test stream=1 wait_each=0 recvmsg=0 early_error=0 defer=1 failedThe behaviour is the same in 6.9-rc2 (which contains the commit too).
Reverting the commit on the top of 6.8.2 makes it pass again.
Quoted 8 lines
Quoted 1 line
Should the test be updated or is the commit wrong?
The commit is fine, it's the test that is buggy. Sometimes test cases make odd assumptions that are just wrong but happen to work, for some definition of work. Eg it would work fine on an idle system, but not necessarily if not. For this one, the fix is in liburing:
Thanks, that worked.
Any plans to release 2.6 with the above?
Note that for 2.4->2.5 update I also needed to take 9dc95a03e4a76 from post-2.5.
thanks,
Signature · 2 lines
js suse labs
Re: [PATCH 6.8 015/715] io_uring: remove unconditional looping in local task_work handling
Quoted 27 lines · Jiri Slaby
Quoted 26 lines · Jens Axboe
Quoted 14 lines · Jiri Slaby
Quoted 8 lines · Sasha Levin
From: Jens Axboe <[email protected]>
[ Upstream commit
9fe3eaea4a3530ca34a8d8ff00b1848c528789ca]If we have a ton of notifications coming in, we can be looping in here for a long time. This can be problematic for various reasons, mostly because we can starve userspace. If the application is waiting on N events, then only re-run if we need more events.
This commit breaks
test/recv-multishot.cfrom liburing:
early error: res 4
test stream=1 wait_each=0 recvmsg=0 early_error=0 defer=1 failedQuoted 5 lines
The behaviour is the same in 6.9-rc2 (which contains the commit too).
Reverting the commit on the top of 6.8.2 makes it pass again.
Should the test be updated or is the commit wrong?
The commit is fine, it's the test that is buggy. Sometimes test cases make odd assumptions that are just wrong but happen to work, for some definition of work. Eg it would work fine on an idle system, but not necessarily if not. For this one, the fix is in liburing:
Quoted 8 lines
Quoted 1 line
Thanks, that worked.
Any plans to release 2.6 with the above?
Note that for 2.4->2.5 update I also needed to take
9dc95a03e4a76from post-2.5.
Yep, 2.6 should be released very soon.
Signature · 1 line
Jens Axboe
Sasha Levin
maintainerPATCH 16/715 s390/dasd: Use dev_*() for device log messages
In reply to Sasha LevinFrom: Jan Höppner <[email protected]>
[ Upstream commit 79ae56fc475869d636071f66d9e4ef2a3819eee6 ]
All log messages in dasd.c use the printk variants of pr_*(). They all add the name of the affected device manually to the log message. This can be simplified by using the dev_*() variants of printk, which include the device information and make a separate call to dev_name() unnecessary.
The KMSG_COMPONENT and the pr_fmt() definition can be dropped. Note that this removes the "dasd: " prefix from the one pr_info() call in dasd_init(). However, the log message already provides all relevant information.
Stable-dep-of: c3116e62ddef ("s390/dasd: fix double module refcount decrement")
--- drivers/s390/block/dasd.c | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-)
drivers/s390/block/dasd.c +24 -26
@@ -8,9 +8,6 @@* Copyright IBM Corp. 1999, 2009 */ -#define KMSG_COMPONENT "dasd" -#define pr_fmt (fmt) KMSG_COMPONENT ": " fmt -#include <linux/kmod.h> #include <linux/init.h> #include <linux/interrupt.h>
@@ -3402,8 +3399,7 @@ static void dasd_generic_auto_online(void *data, async_cookie_t cookie) ret =ccw_device_set_online (cdev);if (ret) -pr_warn ("%s: Setting the DASD online failed with rc=%d\n" , -dev_name (&cdev->dev), ret); +dev_warn (&cdev->dev,"Setting the DASD online failed with rc=%d\n" , ret); }/*
@@ -3490,8 +3486,11 @@ int dasd_generic_set_online(struct ccw_device *cdev, {struct dasd_discipline *discipline;struct dasd_device *device; +struct device *dev;int rc; + dev = &cdev->dev; +/* first online clears initial online feature flag */ dasd_set_feature (cdev,DASD_FEATURE_INITIAL_ONLINE ,0 ); device =dasd_create_device (cdev);
@@ -3504,11 +3503,10 @@ int dasd_generic_set_online(struct ccw_device *cdev,/* Try to load the required module. */ rc =request_module (DASD_DIAG_MOD );if (rc) { -pr_warn ("%s Setting the DASD online failed " -"because the required module %s " -"could not be loaded (rc=%d)\n" , -dev_name (&cdev->dev),DASD_DIAG_MOD , - rc); +dev_warn (dev,"Setting the DASD online failed " +"because the required module %s " +"could not be loaded (rc=%d)\n" , +DASD_DIAG_MOD , rc);dasd_delete_device (device);return -ENODEV ; }
@@ -3516,8 +3514,7 @@ int dasd_generic_set_online(struct ccw_device *cdev,/* Module init could have failed, so check again here after * request_module(). */ if (!dasd_diag_discipline_pointer) { -pr_warn ("%s Setting the DASD online failed because of missing DIAG discipline\n" , -dev_name (&cdev->dev)); +dev_warn (dev,"Setting the DASD online failed because of missing DIAG discipline\n" );dasd_delete_device (device);return -ENODEV ; }
@@ -3538,8 +3535,8 @@ int dasd_generic_set_online(struct ccw_device *cdev,/* check_device will allocate block device if necessary */ rc = discipline->check_device (device);if (rc) { -pr_warn ("%s Setting the DASD online with discipline %s failed with rc=%i\n" , -dev_name (&cdev->dev), discipline->name, rc); +dev_warn (dev,"Setting the DASD online with discipline %s failed with rc=%i\n" , + discipline->name, rc);module_put (discipline->owner);module_put (base_discipline->owner);dasd_delete_device (device);
@@ -3548,16 +3545,15 @@ int dasd_generic_set_online(struct ccw_device *cdev,dasd_set_target_state (device,DASD_STATE_ONLINE );if (device->state <=DASD_STATE_KNOWN ) { -pr_warn ("%s Setting the DASD online failed because of a missing discipline\n" , -dev_name (&cdev->dev)); +dev_warn (dev,"Setting the DASD online failed because of a missing discipline\n" ); rc = -ENODEV ;dasd_set_target_state (device,DASD_STATE_NEW );if (device->block)dasd_free_block (device->block);dasd_delete_device (device); - }else -pr_debug ("dasd_generic device %s found\n" , -dev_name (&cdev->dev)); + }else { +dev_dbg (dev,"dasd_generic device found\n" ); + }wait_event (dasd_init_waitq,_wait_for_device (device));
@@ -3568,10 +3564,13 @@ EXPORT_SYMBOL_GPL(dasd_generic_set_online);int dasd_generic_set_offline (struct ccw_device *cdev) { +int max_count, open_count, rc;struct dasd_device *device;struct dasd_block *block; -int max_count, open_count, rc;unsigned long flags; +struct device *dev; + + dev = &cdev->dev; rc =0 ;spin_lock_irqsave (get_ccwdev_lock (cdev), flags);
@@ -3592,11 +3591,10 @@ int dasd_generic_set_offline(struct ccw_device *cdev) open_count =atomic_read (&device->block->open_count);if (open_count > max_count) {if (open_count >0 ) -pr_warn ("%s: The DASD cannot be set offline with open count %i\n" , -dev_name (&cdev->dev), open_count); +dev_warn (dev,"The DASD cannot be set offline with open count %i\n" , + open_count);else -pr_warn ("%s: The DASD cannot be set offline while it is in use\n" , -dev_name (&cdev->dev)); +dev_warn (dev,"The DASD cannot be set offline while it is in use\n" ); rc = -EBUSY ; goto out_err; }
@@ -3956,8 +3954,8 @@ static int dasd_handle_autoquiesce(struct dasd_device *device,if (dasd_eer_enabled (device))dasd_eer_write (device,NULL ,DASD_EER_AUTOQUIESCE ); -pr_info ("%s: The DASD has been put in the quiesce state\n" , -dev_name (&device->cdev->dev)); +dev_info (&device->cdev->dev, +"The DASD has been put in the quiesce state\n" );dasd_device_set_stop_bits (device,DASD_STOPPED_QUIESCE );if (device->features &DASD_FEATURE_REQUEUEQUIESCE )
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 17/715 s390/dasd: fix double module refcount decrement
In reply to Sasha LevinFrom: Miroslav Franc <[email protected]>
[ Upstream commit c3116e62ddeff79cae342147753ce596f01fcf06 ]
Once the discipline is associated with the device, deleting the device takes care of decrementing the module's refcount. Doing it manually on this error path causes refcount to artificially decrease on each error while it should just stay the same.
--- drivers/s390/block/dasd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/s390/block/dasd.c +1 -4
@@ -3524,12 +3524,11 @@ int dasd_generic_set_online(struct ccw_device *cdev,dasd_delete_device (device);return -EINVAL ; } + device->base_discipline = base_discipline;if (!try_module_get (discipline->owner)) { -module_put (base_discipline->owner);dasd_delete_device (device);return -EINVAL ; } - device->base_discipline = base_discipline; device->discipline = discipline;/* check_device will allocate block device if necessary */
@@ -3537,8 +3536,6 @@ int dasd_generic_set_online(struct ccw_device *cdev,if (rc) {dev_warn (dev,"Setting the DASD online with discipline %s failed with rc=%i\n" , discipline->name, rc); -module_put (discipline->owner); -module_put (base_discipline->owner);dasd_delete_device (device);return rc; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 18/715 fs/hfsplus: use better @opf description
In reply to Sasha LevinFrom: Randy Dunlap <[email protected]>
[ Upstream commit cf12445daec01aaa2d27bb34bd7c796a53442c42 ]
Use a more descriptive explanation of the @opf function parameter, more in line with <linux/blk_types.h>.
--- fs/hfsplus/wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/wrapper.c +1 -1
@@ -30,7 +30,7 @@ struct hfsplus_wd {* @sector: block to read or write, for blocks of HFSPLUS_SECTOR_SIZE bytes * @buf: buffer for I/O * @data: output pointer for location of requested data -* @opf: request op flags +* @opf: I/O operation type and flags * * The unit of I/O is hfsplus_min_io_size(sb), which may be bigger than * HFSPLUS_SECTOR_SIZE, and @buf must be sized accordingly. On reads
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 19/715 md: fix kmemleak of rdev->serial
In reply to Sasha LevinFrom: Li Nan <[email protected]>
[ Upstream commit 6cf350658736681b9d6b0b6e58c5c76b235bb4c4 ]
If kobject_add() is fail in bind_rdev_to_array(), 'rdev->serial' will be alloc not be freed, and kmemleak occurs.
unreferenced object 0xffff88815a350000 (size 49152):
comm "mdadm", pid 789, jiffies 4294716910 hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc f773277a):
[<0000000058b0a453>] kmemleak_alloc+0x61/0xe0
[<00000000366adf14>] __kmalloc_large_node+0x15e/0x270
[<000000002e82961b>] __kmalloc_node.cold+0x11/0x7f
[<00000000f206d60a>] kvmalloc_node+0x74/0x150
[<0000000034bf3363>] rdev_init_serial+0x67/0x170
[<0000000010e08fe9>] mddev_create_serial_pool+0x62/0x220
[<00000000c3837bf0>] bind_rdev_to_array+0x2af/0x630
[<0000000073c28560>] md_add_new_disk+0x400/0x9f0
[<00000000770e30ff>] md_ioctl+0x15bf/0x1c10
[<000000006cfab718>] blkdev_ioctl+0x191/0x3f0
[<0000000085086a11>] vfs_ioctl+0x22/0x60
[<0000000018b656fe>] __x64_sys_ioctl+0xba/0xe0
[<00000000e54e675e>] do_syscall_64+0x71/0x150
[<000000008b0ad622>] entry_SYSCALL_64_after_hwframe+0x6c/0x74--- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/md.c +1 -0
@@ -2566,6 +2566,7 @@ static int bind_rdev_to_array(struct md_rdev *rdev, struct mddev *mddev) fail:pr_warn ("md: failed to register dev-%s for %s\n" , b,mdname (mddev)); +mddev_destroy_serial_pool (mddev, rdev);return err; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 20/715 rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery
In reply to Sasha LevinFrom: Frederic Weisbecker <[email protected]>
[ Upstream commit a636c5e6f8fc34be520277e69c7c6ee1d4fc1d17 ]
Under CONFIG_RCU_EXP_KTHREAD=y, the nodes initialization for expedited grace periods is queued to a kworker. However if the allocation of that kworker failed, the nodes initialization is performed synchronously by the caller instead.
Now the check for kworker initialization failure relies on the kworker pointer to be NULL while its value might actually encapsulate an allocation failure error.
Make sure to handle this case.
--- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+)
kernel/rcu/tree.c +1 -0
@@ -4749,6 +4749,7 @@ static void __init rcu_start_exp_gp_kworkers(void) rcu_exp_par_gp_kworker =kthread_create_worker (0 , par_gp_kworker_name);if (IS_ERR_OR_NULL (rcu_exp_par_gp_kworker)) {pr_err ("Failed to create %s!\n" , par_gp_kworker_name); + rcu_exp_par_gp_kworker =NULL ;kthread_destroy_worker (rcu_exp_gp_kworker);return ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 21/715 rcu/exp: Handle RCU expedited grace period kworker allocation failure
In reply to Sasha LevinFrom: Frederic Weisbecker <[email protected]>
[ Upstream commit e7539ffc9a770f36bacedcf0fbfb4bf2f244f4a5 ]
Just like is done for the kworker performing nodes initialization, gracefully handle the possible allocation failure of the RCU expedited grace period main kworker.
While at it perform a rename of the related checking functions to better reflect the expedited specifics.
--- kernel/rcu/tree.c | 2 ++ kernel/rcu/tree_exp.h | 25 +++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-)
kernel/rcu/tree.c +2 -0
@@ -4743,6 +4743,7 @@ static void __init rcu_start_exp_gp_kworkers(void) rcu_exp_gp_kworker =kthread_create_worker (0 , gp_kworker_name);if (IS_ERR_OR_NULL (rcu_exp_gp_kworker)) {pr_err ("Failed to create %s!\n" , gp_kworker_name); + rcu_exp_gp_kworker =NULL ;return ; }
@@ -4751,6 +4752,7 @@ static void __init rcu_start_exp_gp_kworkers(void)pr_err ("Failed to create %s!\n" , par_gp_kworker_name); rcu_exp_par_gp_kworker =NULL ;kthread_destroy_worker (rcu_exp_gp_kworker); + rcu_exp_gp_kworker =NULL ;return ; }
kernel/rcu/tree_exp.h +19 -6
@@ -428,7 +428,12 @@ static void sync_rcu_exp_select_node_cpus(struct kthread_work *wp)__sync_rcu_exp_select_node_cpus (rewp); } -static inline bool rcu_gp_par_worker_started (void ) +static inline bool rcu_exp_worker_started (void ) +{ +return !!READ_ONCE (rcu_exp_gp_kworker); +} + +static inline bool rcu_exp_par_worker_started (void ) {return !!READ_ONCE (rcu_exp_par_gp_kworker); }
@@ -478,7 +483,12 @@ static void sync_rcu_exp_select_node_cpus(struct work_struct *wp)__sync_rcu_exp_select_node_cpus (rewp); } -static inline bool rcu_gp_par_worker_started (void ) +static inline bool rcu_exp_worker_started (void ) +{ +return !!READ_ONCE (rcu_gp_wq); +} + +static inline bool rcu_exp_par_worker_started (void ) {return !!READ_ONCE (rcu_par_gp_wq); }
@@ -541,7 +551,7 @@ static void sync_rcu_exp_select_cpus(void) rnp->exp_need_flush = false;if (!READ_ONCE (rnp->expmask))continue ;/* Avoid early boot non-existent wq. */ -if (!rcu_gp_par_worker_started () || +if (!rcu_exp_par_worker_started () || rcu_scheduler_active !=RCU_SCHEDULER_RUNNING ||rcu_is_last_leaf_node (rnp)) {/* No worker started yet or last leaf, do direct call. */
@@ -956,7 +966,7 @@ static void rcu_exp_print_detail_task_stall_rnp(struct rcu_node *rnp)*/ void synchronize_rcu_expedited (void ) { -bool boottime = (rcu_scheduler_active ==RCU_SCHEDULER_INIT ); +bool use_worker;unsigned long flags;struct rcu_exp_work rew;struct rcu_node *rnp;
@@ -967,6 +977,9 @@ void synchronize_rcu_expedited(void)lock_is_held (&rcu_sched_lock_map), "Illegal synchronize_rcu_expedited() in RCU read-side critical section"); + use_worker = (rcu_scheduler_active !=RCU_SCHEDULER_INIT ) && +rcu_exp_worker_started (); +/* Is the state is such that the call is a grace period? */ if (rcu_blocking_is_gp ()) {// Note well that this code runs with !PREEMPT && !SMP.
@@ -996,7 +1009,7 @@ void synchronize_rcu_expedited(void)return ;/* Someone else did our work for us. */ /* Ensure that load happens before action based on it. */ -if (unlikely (boottime)) { +if (unlikely (!use_worker)) {/* Direct call during scheduler init and early_initcalls(). */ rcu_exp_sel_wait_wake (s); }else {
@@ -1014,7 +1027,7 @@ void synchronize_rcu_expedited(void)/* Let the next expedited grace period start. */ mutex_unlock (&rcu_state.exp_mutex); -if (likely (!boottime)) +if (likely (use_worker))synchronize_rcu_expedited_destroy_work (&rew); }EXPORT_SYMBOL_GPL (synchronize_rcu_expedited);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 22/715 nbd: null check for nla_nest_start
In reply to Sasha LevinFrom: Navid Emamdoost <[email protected]>
[ Upstream commit 31edf4bbe0ba27fd03ac7d87eb2ee3d2a231af6d ]
nla_nest_start() may fail and return NULL. Insert a check and set errno based on other call sites within the same source code.
--- drivers/block/nbd.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/block/nbd.c +6 -0
@@ -2433,6 +2433,12 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info) } dev_list =nla_nest_start_noflag (reply,NBD_ATTR_DEVICE_LIST ); +if (!dev_list) { +nlmsg_free (reply); + ret = -EMSGSIZE ; + goto out; + } +if (index ==-1 ) { ret =idr_for_each (&nbd_index_idr, &status_cb, reply);if (ret) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 23/715 fs/select: rework stack allocation hack for clang
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit ddb9fd7a544088ed70eccbb9f85e9cc9952131c1 ]
A while ago, we changed the way that select() and poll() preallocate a temporary buffer just under the size of the static warning limit of 1024 bytes, as clang was frequently going slightly above that limit.
The warnings have recently returned and I took another look. As it turns out, clang is not actually inherently worse at reserving stack space, it just happens to inline do_select() into core_sys_select(), while gcc never inlines it.
Annotate do_select() to never be inlined and in turn remove the special case for the allocation size. This should give the same behavior for both clang and gcc all the time and once more avoids those warnings.
--- fs/select.c | 2 +- include/linux/poll.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-)
fs/select.c +1 -1
@@ -476,7 +476,7 @@ static inline void wait_key_set(poll_table *wait, unsigned long in, wait->_key |=POLLOUT_SET ; } -static int do_select (int n,fd_set_bits *fds,struct timespec64 *end_time) +static noinline_for_stack int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time) {ktime_t expire, *to =NULL ;struct poll_wqueues table;
include/linux/poll.h +0 -4
@@ -14,11 +14,7 @@/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating additional memory. */ -#ifdef __clang__ -#define MAX_STACK_ALLOC 768 -#else #define MAX_STACK_ALLOC 832 -#endif #define FRONTEND_STACK_ALLOC 256#define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC#define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 24/715 block: fix deadlock between bd_link_disk_holder and partition scan
In reply to Sasha LevinFrom: Li Nan <[email protected]>
[ Upstream commit 03f12122b20b6e6028e9ed69030a49f9cffcbb75 ]
'open_mutex' of gendisk is used to protect open/close block devices. But in bd_link_disk_holder(), it is used to protect the creation of symlink between holding disk and slave bdev, which introduces some issues.
When bd_link_disk_holder() is called, the driver is usually in the process of initialization/modification and may suspend submitting io. At this time, any io hold 'open_mutex', such as scanning partitions, can cause deadlocks. For example, in raid:
T1 T2bdev_open_by_dev
lock open_mutex [1]
...
efi_partition
...
md_submit_bio
md_ioctl mddev_syspend
-> suspend all io
md_add_new_disk
bind_rdev_to_array
bd_link_disk_holder
try lock open_mutex [2]
md_handle_request
-> wait mddev_resumeT1 scan partition, T2 add a new device to raid. T1 waits for T2 to resume mddev, but T2 waits for open_mutex held by T1. Deadlock occurs.
Fix it by introducing a local mutex 'blk_holder_mutex' to replace 'open_mutex'.
--- block/holder.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
block/holder.c +7 -5
@@ -8,6 +8,8 @@ struct bd_holder_disk {int refcnt; }; +static DEFINE_MUTEX (blk_holder_mutex); +static struct bd_holder_disk *bd_find_holder_disk (struct block_device *bdev,struct gendisk *disk) {
@@ -80,7 +82,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk)kobject_get (bdev->bd_holder_dir);mutex_unlock (&bdev->bd_disk->open_mutex); -mutex_lock (&disk->open_mutex); +mutex_lock (&blk_holder_mutex);WARN_ON_ONCE (!bdev->bd_holder); holder =bd_find_holder_disk (bdev, disk);
@@ -108,7 +110,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) goto out_del_symlink;list_add (&holder->list, &disk->slave_bdevs); -mutex_unlock (&disk->open_mutex); +mutex_unlock (&blk_holder_mutex);return 0 ; out_del_symlink:
@@ -116,7 +118,7 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) out_free_holder:kfree (holder); out_unlock: -mutex_unlock (&disk->open_mutex); +mutex_unlock (&blk_holder_mutex);if (ret)kobject_put (bdev->bd_holder_dir);return ret;
@@ -140,7 +142,7 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk)if (WARN_ON_ONCE (!disk->slave_dir))return ; -mutex_lock (&disk->open_mutex); +mutex_lock (&blk_holder_mutex); holder =bd_find_holder_disk (bdev, disk);if (!WARN_ON_ONCE (holder ==NULL ) && !--holder->refcnt) {del_symlink (disk->slave_dir,bdev_kobj (bdev));
@@ -149,6 +151,6 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk)list_del_init (&holder->list);kfree (holder); } -mutex_unlock (&disk->open_mutex); +mutex_unlock (&blk_holder_mutex); }EXPORT_SYMBOL_GPL (bd_unlink_disk_holder);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 25/715 md: Don't clear MD_CLOSING when the raid is about to stop
In reply to Sasha LevinFrom: Li Nan <[email protected]>
[ Upstream commit 9674f54e41fffaf06f6a60202e1fa4cc13de3cf5 ]
The raid should not be opened anymore when it is about to be stopped. However, other processes can open it again if the flag MD_CLOSING is cleared before exiting. From now on, this flag will not be cleared when the raid will be stopped.
--- drivers/md/md.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/md/md.c +10 -4
@@ -6279,7 +6279,15 @@ static void md_clean(struct mddev *mddev) mddev->persistent =0 ; mddev->level =LEVEL_NONE ; mddev->clevel[0 ] =0 ; - mddev->flags =0 ; +/* +* Don't clear MD_CLOSING, or mddev can be opened again. +* 'hold_active != 0' means mddev is still in the creation +* process and will be used later. +*/ +if (mddev->hold_active) + mddev->flags =0 ; +else + mddev->flags &=BIT_ULL_MASK (MD_CLOSING ); mddev->sb_flags =0 ; mddev->ro =MD_RDWR ; mddev->metadata_type[0 ] =0 ;
@@ -7625,7 +7633,6 @@ static int md_ioctl(struct block_device *bdev, blk_mode_t mode,int err =0 ;void __user *argp = (void __user *)arg;struct mddev *mddev =NULL ; -bool did_set_md_closing = false;if (!md_ioctl_valid (cmd))return -ENOTTY ;
@@ -7709,7 +7716,6 @@ static int md_ioctl(struct block_device *bdev, blk_mode_t mode, err = -EBUSY ; goto out; } - did_set_md_closing = true;mutex_unlock (&mddev->open_mutex);sync_blockdev (bdev); }
@@ -7851,7 +7857,7 @@ static int md_ioctl(struct block_device *bdev, blk_mode_t mode,mddev_unlock (mddev); out: -if (did_set_md_closing) +if (cmd ==STOP_ARRAY_RO || (err && cmd ==STOP_ARRAY ))clear_bit (MD_CLOSING , &mddev->flags);return err; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 26/715 kunit: Setup DMA masks on the kunit device
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit c5215d54dc10e801a6cefef62445a00a4c28a515 ]
Commit d393acce7b3f ("drm/tests: Switch to kunit devices") switched the DRM device creation helpers from an ad-hoc implementation to the new kunit device creation helpers introduced in commit d03c720e03bd ("kunit:
Add APIs for managing devices").
However, while the DRM helpers were using a platform_device, the kunit helpers are using a dedicated bus and device type.
That situation creates small differences in the initialisation, and one of them is that the kunit devices do not have the DMA masks setup. In turn, this means that we can't do any kind of DMA buffer allocation anymore, which creates a regression on some (downstream for now) tests.
Let's set up a default DMA mask that should work on any platform to fix it.
--- lib/kunit/device.c | 4 ++++ 1 file changed, 4 insertions(+)
lib/kunit/device.c +4 -0
@@ -10,6 +10,7 @@*/ #include <linux/device.h> +#include <linux/dma-mapping.h> #include <kunit/test.h> #include <kunit/device.h>
@@ -133,6 +134,9 @@ static struct kunit_device *kunit_device_register_internal(struct kunit *test,return ERR_PTR (err); } + kunit_dev->dev.dma_mask = &kunit_dev->dev.coherent_dma_mask; + kunit_dev->dev.coherent_dma_mask =DMA_BIT_MASK (32 ); +kunit_add_action (test, device_unregister_wrapper, &kunit_dev->dev);return kunit_dev;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 27/715 ovl: Always reject mounting over case-insensitive directories
In reply to Sasha LevinFrom: Gabriel Krisman Bertazi <[email protected]>
[ Upstream commit 2824083db76cb9d4b7910607b367e93b02912865 ]
overlayfs relies on the filesystem setting DCACHE_OP_HASH or DCACHE_OP_COMPARE to reject mounting over case-insensitive directories.
Since commit bb9cd9106b22 ("fscrypt: Have filesystems handle their d_ops"), we set ->d_op through a hook in ->d_lookup, which means the root dentry won't have them, causing the mount to accidentally succeed.
In v6.7-rc7, the following sequence will succeed to mount, but any dentry other than the root dentry will be a "weird" dentry to ovl and fail with EREMOTE.
mkfs.ext4 -O casefold lower.img
mount -O loop lower.img lower
mount -t overlay -o lowerdir=lower,upperdir=upper,workdir=work ovl /mnt
Mounting on a subdirectory fails, as expected, because DCACHE_OP_HASH and DCACHE_OP_COMPARE are properly set by ->lookup.
Fix by explicitly rejecting superblocks that allow case-insensitive dentries. Yes, this will be solved when we move d_op configuration back to ->s_d_op. Yet, we better have an explicit fix to avoid messing up again.
While there, re-sort the entries to have more descriptive error messages first.
--- fs/overlayfs/params.c | 14 +++++++++++--- include/linux/fs.h | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-)
fs/overlayfs/params.c +11 -3
@@ -280,12 +280,20 @@ static int ovl_mount_dir_check(struct fs_context *fc, const struct path *path, {struct ovl_fs_context *ctx = fc->fs_private; -if (ovl_dentry_weird (path->dentry)) -return invalfc (fc,"filesystem on %s not supported" , name); -if (!d_is_dir (path->dentry))return invalfc (fc,"%s is not a directory" , name); +/* +* Root dentries of case-insensitive capable filesystems might +* not have the dentry operations set, but still be incompatible +* with overlayfs. Check explicitly to prevent post-mount +* failures. +*/ +if (sb_has_encoding (path->mnt->mnt_sb)) +return invalfc (fc,"case-insensitive capable filesystem on %s not supported" , name); + +if (ovl_dentry_weird (path->dentry)) +return invalfc (fc,"filesystem on %s not supported" , name);/* * Check whether upper path is read-only here to report failures
include/linux/fs.h +9 -0
@@ -3281,6 +3281,15 @@ extern int generic_check_addressable(unsigned, u64);extern void generic_set_encrypted_ci_d_ops (struct dentry *dentry); +static inline bool sb_has_encoding (const struct super_block *sb) +{ +#if IS_ENABLED (CONFIG_UNICODE ) +return !!sb->s_encoding; +#else +return false; +#endif +} +int may_setattr (struct mnt_idmap *idmap,struct inode *inode,unsigned int ia_valid);int setattr_prepare (struct mnt_idmap *,struct dentry *,struct iattr *);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 28/715 kunit: test: Log the correct filter string in executor_test
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit 6f2f793fba78eb4a0d5a34a71bc781118ed923d3 ]
KUnit's executor_test logs the filter string in KUNIT_ASSERT_EQ_MSG(), but passed a random character from the filter, rather than the whole string.
This was found by annotating KUNIT_ASSERT_EQ_MSG() to let gcc validate the format string.
--- lib/kunit/executor_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kunit/executor_test.c +1 -1
@@ -129,7 +129,7 @@ static void parse_filter_attr_test(struct kunit *test) GFP_KERNEL);for (j =0 ; j < filter_count; j++) { parsed_filters[j] =kunit_next_attr_filter (&filter, &err); -KUNIT_ASSERT_EQ_MSG (test, err,0 ,"failed to parse filter '%s'" , filters[j]); +KUNIT_ASSERT_EQ_MSG (test, err,0 ,"failed to parse filter from '%s'" , filters); }KUNIT_EXPECT_STREQ (test,kunit_attr_filter_name (parsed_filters[0 ]),"speed" );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 29/715 lib/cmdline: Fix an invalid format specifier in an assertion msg
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit d2733a026fc7247ba42d7a8e1b737cf14bf1df21 ]
The correct format specifier for p - n (both p and n are pointers) is %td, as the type should be ptrdiff_t.
This was discovered by annotating KUnit assertion macros with gcc's printf specifier, but note that gcc incorrectly suggested a %d or %ld specifier (depending on the pointer size of the architecture being built).
--- lib/cmdline_kunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/cmdline_kunit.c +1 -1
@@ -124,7 +124,7 @@ static void cmdline_do_one_range_test(struct kunit *test, const char *in, n, e[0], r[0]); p =memchr_inv (&r[1 ],0 ,sizeof (r) -sizeof (r[0 ])); -KUNIT_EXPECT_PTR_EQ_MSG (test, p,NULL ,"in test %u at %u out of bound" , n, p - r); +KUNIT_EXPECT_PTR_EQ_MSG (test, p,NULL ,"in test %u at %td out of bound" , n, p - r); }static void cmdline_test_range (struct kunit *test)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 30/715 lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit 0a549ed22c3c7cc6da5c5f5918efd019944489a5 ]
The 'i' passed as an assertion message is a size_t, so should use '%zu', not '%d'.
This was found by annotating the _MSG() variants of KUnit's assertions to let gcc validate the format strings.
--- lib/memcpy_kunit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/memcpy_kunit.c +2 -2
@@ -32,7 +32,7 @@ struct some_bytes {BUILD_BUG_ON (sizeof (instance.data) !=32 ); \for (size_t i =0 ; i <sizeof (instance.data); i++) { \KUNIT_ASSERT_EQ_MSG (test, instance.data[i], v, \ -"line %d: '%s' not initialized to 0x%02x @ %d (saw 0x%02x)\n" , \ +"line %d: '%s' not initialized to 0x%02x @ %zu (saw 0x%02x)\n" , \ __LINE__, #instance, v, i, instance.data[i]); \ } \ }while (0 )
@@ -41,7 +41,7 @@ struct some_bytes {BUILD_BUG_ON (sizeof (one) !=sizeof (two)); \for (size_t i =0 ; i <sizeof (one); i++) { \ KUNIT_EXPECT_EQ_MSG(test, one.data[i], two.data[i], \ - "line %d: %s.data[%d] (0x%02x) != %s.data[%d] (0x%02x)\n", \ + "line %d: %s.data[%zu] (0x%02x) != %s.data[%zu] (0x%02x)\n", \ __LINE__, #one, i, one.data[i], #two, i, two.data[i]); \ } \ kunit_info(test, "ok: " TEST_OP "() " name "\n"); \
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 31/715 time: test: Fix incorrect format specifier
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit 133e267ef4a26d19c93996a874714e9f3f8c70aa ]
'days' is a s64 (from div_s64), and so should use a %lld specifier.
This was found by extending KUnit's assertion macros to use gcc's __printf attribute.
--- kernel/time/time_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/time_test.c +1 -1
@@ -73,7 +73,7 @@ static void time64_to_tm_test_date_range(struct kunit *test) days =div_s64 (secs,86400 ); -#define FAIL_MSG "%05ld/%02d/%02d (%2d) : %ld", \ +#define FAIL_MSG "%05ld/%02d/%02d (%2d) : %lld", \ year, month, mdday, yday, daysKUNIT_ASSERT_EQ_MSG (test, year -1900 , result.tm_year,FAIL_MSG );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 32/715 rtc: test: Fix invalid format specifier.
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit 8a904a3caa88118744062e872ae90f37748a8fd8 ]
'days' is a s64 (from div_s64), and so should use a %lld specifier.
This was found by extending KUnit's assertion macros to use gcc's __printf attribute.
--- drivers/rtc/lib_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/lib_test.c +1 -1
@@ -54,7 +54,7 @@ static void rtc_time64_to_tm_test_date_range(struct kunit *test) days =div_s64 (secs,86400 ); -#define FAIL_MSG "%d/%02d/%02d (%2d) : %ld", \ +#define FAIL_MSG "%d/%02d/%02d (%2d) : %lld", \ year, month, mday, yday, daysKUNIT_ASSERT_EQ_MSG (test, year -1900 , result.tm_year,FAIL_MSG );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 33/715 net: test: Fix printf format specifier in skb_segment kunit test
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit ff3b96f2c9e5c24fca12239cd519a8a18569e687 ]
KUNIT_FAIL() accepts a printf-style format string, but previously did not let gcc validate it with the __printf() attribute. The use of %lld for the result of PTR_ERR() is not correct.
Instead, use %pe and pass the actual error pointer. printk() will format it correctly (and give a symbolic name rather than a number if available, which should make the output more readable, too).
--- net/core/gso_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/gso_test.c +1 -1
@@ -225,7 +225,7 @@ static void gso_test_func(struct kunit *test) segs =skb_segment (skb, features);if (IS_ERR (segs)) { -KUNIT_FAIL (test,"segs error %lld" ,PTR_ERR (segs)); +KUNIT_FAIL (test,"segs error %pe" , segs); goto free_gso_skb; }else if (!segs) {KUNIT_FAIL (test,"no segments" );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 34/715 drm/xe/tests: Fix printf format specifiers in xe_migrate test
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit 689a930b93c5c20294df5da0407df361c5412eac ]
KUNIT_FAIL() is used to fail the xe_migrate test when an error occurs. However, there's a mismatch in the format specifier: '%li' is used to log 'err', which is an 'int'.
Use '%i' instead of '%li', and for the case where we're printing an error pointer, just use '%pe', instead of extracting the error code manually with PTR_ERR(). (This also results in a nicer output when the error code is known.)
--- drivers/gpu/drm/xe/tests/xe_migrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/xe/tests/xe_migrate.c +4 -4
@@ -114,21 +114,21 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo, region | XE_BO_NEEDS_CPU_ACCESS);if (IS_ERR (remote)) { -KUNIT_FAIL (test,"Failed to allocate remote bo for %s: %li\n" , - str,PTR_ERR (remote)); +KUNIT_FAIL (test,"Failed to allocate remote bo for %s: %pe\n" , + str, remote);return ; } err =xe_bo_validate (remote,NULL , false);if (err) { -KUNIT_FAIL (test,"Failed to validate system bo for %s: %li\n" , +KUNIT_FAIL (test,"Failed to validate system bo for %s: %i\n" , str, err); goto out_unlock; } err =xe_bo_vmap (remote);if (err) { -KUNIT_FAIL (test,"Failed to vmap system bo for %s: %li\n" , +KUNIT_FAIL (test,"Failed to vmap system bo for %s: %i\n" , str, err); goto out_unlock; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 35/715 drm: tests: Fix invalid printf format specifiers in KUnit tests
In reply to Sasha LevinFrom: David Gow <[email protected]>
[ Upstream commit fc9a615200d48e076af58f4309f507e500ed900d ]
The drm_buddy_test's alloc_contiguous test used a u64 for the page size, which was then updated to be an 'unsigned long' to avoid 64-bit multiplication division helpers.
However, the variable is logged by some KUNIT_ASSERT_EQ_MSG() using the '%d' or '%llu' format specifiers, the former of which is always wrong, and the latter is no longer correct now that ps is no longer a u64. Fix these to all use '%lu'.
Also, drm_mm_test calls KUNIT_FAIL() with an empty string as the message. gcc and clang warns if a printf format string is empty, so give these some more detailed error messages, which should be more useful anyway.
--- drivers/gpu/drm/tests/drm_buddy_test.c | 14 +++++++------- drivers/gpu/drm/tests/drm_mm_test.c | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/tests/drm_buddy_test.c +7 -7
@@ -260,30 +260,30 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)KUNIT_ASSERT_FALSE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size, ps, ps, list,0 ), -"buddy_alloc hit an error size=%u\n" , +"buddy_alloc hit an error size=%lu\n" , ps); }while (++i < n_pages);KUNIT_ASSERT_TRUE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size,3 * ps, ps, &allocated,DRM_BUDDY_CONTIGUOUS_ALLOCATION ), -"buddy_alloc didn't error size=%u\n" ,3 * ps); +"buddy_alloc didn't error size=%lu\n" ,3 * ps);drm_buddy_free_list (&mm, &middle);KUNIT_ASSERT_TRUE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size,3 * ps, ps, &allocated,DRM_BUDDY_CONTIGUOUS_ALLOCATION ), -"buddy_alloc didn't error size=%u\n" ,3 * ps); +"buddy_alloc didn't error size=%lu\n" ,3 * ps);KUNIT_ASSERT_TRUE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size,2 * ps, ps, &allocated,DRM_BUDDY_CONTIGUOUS_ALLOCATION ), -"buddy_alloc didn't error size=%u\n" ,2 * ps); +"buddy_alloc didn't error size=%lu\n" ,2 * ps);drm_buddy_free_list (&mm, &right);KUNIT_ASSERT_TRUE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size,3 * ps, ps, &allocated,DRM_BUDDY_CONTIGUOUS_ALLOCATION ), -"buddy_alloc didn't error size=%u\n" ,3 * ps); +"buddy_alloc didn't error size=%lu\n" ,3 * ps);/* * At this point we should have enough contiguous space for 2 blocks, * however they are never buddies (since we freed middle and right) so
@@ -292,13 +292,13 @@ static void drm_test_buddy_alloc_contiguous(struct kunit *test)KUNIT_ASSERT_FALSE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size,2 * ps, ps, &allocated,DRM_BUDDY_CONTIGUOUS_ALLOCATION ), -"buddy_alloc hit an error size=%u\n" ,2 * ps); +"buddy_alloc hit an error size=%lu\n" ,2 * ps);drm_buddy_free_list (&mm, &left);KUNIT_ASSERT_FALSE_MSG (test,drm_buddy_alloc_blocks (&mm,0 , mm_size,3 * ps, ps, &allocated,DRM_BUDDY_CONTIGUOUS_ALLOCATION ), -"buddy_alloc hit an error size=%u\n" ,3 * ps); +"buddy_alloc hit an error size=%lu\n" ,3 * ps); total =0 ;list_for_each_entry (block, &allocated, link)
drivers/gpu/drm/tests/drm_mm_test.c +3 -3
@@ -157,7 +157,7 @@ static void drm_test_mm_init(struct kunit *test)/* After creation, it should all be one massive hole */ if (!assert_one_hole (test, &mm,0 , size)) { -KUNIT_FAIL (test,"" ); +KUNIT_FAIL (test,"mm not one hole on creation" ); goto out; }
@@ -171,14 +171,14 @@ static void drm_test_mm_init(struct kunit *test)/* After filling the range entirely, there should be no holes */ if (!assert_no_holes (test, &mm)) { -KUNIT_FAIL (test,"" ); +KUNIT_FAIL (test,"mm has holes when filled" ); goto out; }/* And then after emptying it again, the massive hole should be back */ drm_mm_remove_node (&tmp);if (!assert_one_hole (test, &mm,0 , size)) { -KUNIT_FAIL (test,"" ); +KUNIT_FAIL (test,"mm does not have single hole after emptying" ); goto out; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 36/715 md/raid1: factor out helpers to add rdev to conf
In reply to Sasha LevinFrom: Yu Kuai <[email protected]>
[ Upstream commit 969d6589abcb369d53d84ec7c9c37f4b23ec1ad9 ]
There are no functional changes, just make code cleaner and prepare to record disk non-rotational information while adding and removing rdev to conf
Stable-dep-of: 257ac239ffcf ("md/raid1: fix choose next idle in read_balance()")
--- drivers/md/raid1.c | 85 +++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 32 deletions(-)
drivers/md/raid1.c +53 -32
@@ -1760,6 +1760,44 @@ static int raid1_spare_active(struct mddev *mddev)return count; } +static bool raid1_add_conf (struct r1conf *conf,struct md_rdev *rdev,int disk, +bool replacement) +{ +struct raid1_info *info = conf->mirrors + disk; + +if (replacement) + info += conf->raid_disks; + +if (info->rdev) +return false; + + rdev->raid_disk = disk; + info->head_position =0 ; + info->seq_start = MaxSector; +WRITE_ONCE (info->rdev, rdev); + +return true; +} + +static bool raid1_remove_conf (struct r1conf *conf,int disk) +{ +struct raid1_info *info = conf->mirrors + disk; +struct md_rdev *rdev = info->rdev; + +if (!rdev ||test_bit (In_sync, &rdev->flags) || +atomic_read (&rdev->nr_pending)) +return false; + +/* Only remove non-faulty devices if recovery is not possible. */ +if (!test_bit (Faulty, &rdev->flags) && + rdev->mddev->recovery_disabled != conf->recovery_disabled && + rdev->mddev->degraded < conf->raid_disks) +return false; + +WRITE_ONCE (info->rdev,NULL ); +return true; +} +static int raid1_add_disk (struct mddev *mddev,struct md_rdev *rdev) {struct r1conf *conf = mddev->private;
@@ -1795,15 +1833,13 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)disk_stack_limits (mddev->gendisk, rdev->bdev, rdev->data_offset <<9 ); - p->head_position =0 ; - rdev->raid_disk = mirror; +raid1_add_conf (conf, rdev, mirror, false); err =0 ;/* As all devices are equivalent, we don't need a full recovery * if this was recently any drive of the array */ if (rdev->saved_raid_disk <0 ) conf->fullsync =1 ; -WRITE_ONCE (p->rdev, rdev);break ; } if (test_bit(WantReplacement, &p->rdev->flags) &&
@@ -1813,13 +1849,11 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)if (err && repl_slot >=0 ) {/* Add this device as a replacement */ - p = conf->mirrors + repl_slot;clear_bit (In_sync, &rdev->flags);set_bit (Replacement, &rdev->flags); - rdev->raid_disk = repl_slot; +raid1_add_conf (conf, rdev, repl_slot, true); err =0 ; conf->fullsync =1 ; -WRITE_ONCE (p[conf->raid_disks].rdev, rdev); }print_conf (conf);
@@ -1836,27 +1870,20 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)if (unlikely (number >= conf->raid_disks)) goto abort; -if (rdev != p->rdev) - p = conf->mirrors + conf->raid_disks + number; +if (rdev != p->rdev) { + number += conf->raid_disks; + p = conf->mirrors + number; + }print_conf (conf);if (rdev == p->rdev) { -if (test_bit (In_sync, &rdev->flags) || -atomic_read (&rdev->nr_pending)) { - err = -EBUSY ; - goto abort; - } -/* Only remove non-faulty devices if recovery -* is not possible. -*/ -if (!test_bit (Faulty, &rdev->flags) && - mddev->recovery_disabled != conf->recovery_disabled && - mddev->degraded < conf->raid_disks) { +if (!raid1_remove_conf (conf, number)) { err = -EBUSY ; goto abort; } -WRITE_ONCE (p->rdev,NULL ); -if (conf->mirrors[conf->raid_disks + number].rdev) { + +if (number < conf->raid_disks && + conf->mirrors[conf->raid_disks + number].rdev) {/* We just removed a device that is being replaced. * Move down the replacement. We drain all IO before * doing this to avoid confusion.
@@ -3006,23 +3033,17 @@ static struct r1conf *setup_conf(struct mddev *mddev) err = -EINVAL ;spin_lock_init (&conf->device_lock); + conf->raid_disks = mddev->raid_disks;rdev_for_each (rdev, mddev) {int disk_idx = rdev->raid_disk; -if (disk_idx >= mddev->raid_disks - || disk_idx <0 ) + +if (disk_idx >= conf->raid_disks || disk_idx <0 )continue ; -if (test_bit (Replacement, &rdev->flags)) - disk = conf->mirrors + mddev->raid_disks + disk_idx; -else - disk = conf->mirrors + disk_idx; -if (disk->rdev) +if (!raid1_add_conf (conf, rdev, disk_idx, +test_bit (Replacement, &rdev->flags))) goto abort; - disk->rdev = rdev; - disk->head_position =0 ; - disk->seq_start = MaxSector; } - conf->raid_disks = mddev->raid_disks; conf->mddev = mddev;INIT_LIST_HEAD (&conf->retry_list);INIT_LIST_HEAD (&conf->bio_end_io_list);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 37/715 md/raid1: record nonrot rdevs while adding/removing rdevs to conf
In reply to Sasha LevinFrom: Yu Kuai <[email protected]>
[ Upstream commit 2c27d09d3a76b33629d2e681bf8b774f776ade7f ]
For raid1, each read will iterate all the rdevs from conf and check if any rdev is non-rotational, then choose rdev with minimal IO inflight if so, or rdev with closest distance otherwise.
Disk nonrot info can be changed through sysfs entry:
/sys/block/[disk_name]/queue/rotational
However, consider that this should only be used for testing, and user really shouldn't do this in real life. Record the number of non-rotational disks in conf, to avoid checking each rdev in IO fast path and simplify read_balance() a little bit.
Stable-dep-of: 257ac239ffcf ("md/raid1: fix choose next idle in read_balance()")
--- drivers/md/md.h | 1 + drivers/md/raid1.c | 17 ++++++++++------- drivers/md/raid1.h | 1 + 3 files changed, 12 insertions(+), 7 deletions(-)
drivers/md/md.h +1 -0
@@ -207,6 +207,7 @@ enum flag_bits {* check if there is collision between raid1 * serial bios. */ + Nonrot, /* non-rotational device (SSD) */ }; static inline int is_badblock(struct md_rdev *rdev, sector_t s, int sectors,
drivers/md/raid1.c +10 -7
@@ -602,7 +602,6 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sectint sectors;int best_good_sectors;int best_disk, best_dist_disk, best_pending_disk; -int has_nonrot_disk;int disk;sector_t best_dist;unsigned int min_pending;
@@ -623,7 +622,6 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect best_pending_disk =-1 ; min_pending =UINT_MAX ; best_good_sectors =0 ; - has_nonrot_disk =0 ; choose_next_idle =0 ;clear_bit (R1BIO_FailFast, &r1_bio->state);
@@ -640,7 +638,6 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sectsector_t first_bad;int bad_sectors;unsigned int pending; -bool nonrot; rdev = conf->mirrors[disk].rdev; if (r1_bio->bios[disk] == IO_BLOCKED
@@ -706,8 +703,6 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect/* At least two disks to choose from so failfast is OK */ set_bit (R1BIO_FailFast, &r1_bio->state); - nonrot =bdev_nonrot (rdev->bdev); - has_nonrot_disk |= nonrot; pending =atomic_read (&rdev->nr_pending); dist =abs (this_sector - conf->mirrors[disk].head_position);if (choose_first) {
@@ -734,7 +729,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect* small, but not a big deal since when the second disk * starts IO, the first disk is likely still busy. */ -if (nonrot && opt_iosize >0 && +if (test_bit (Nonrot, &rdev->flags) && opt_iosize >0 && mirror->seq_start != MaxSector && mirror->next_seq_sect > opt_iosize && mirror->next_seq_sect - opt_iosize >=
@@ -766,7 +761,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect* mixed ratation/non-rotational disks depending on workload. */ if (best_disk ==-1 ) { -if (has_nonrot_disk || min_pending ==0 ) +if (READ_ONCE (conf->nonrot_disks) || min_pending ==0 ) best_disk = best_pending_disk;else best_disk = best_dist_disk;
@@ -1771,6 +1766,11 @@ static bool raid1_add_conf(struct r1conf *conf, struct md_rdev *rdev, int disk,if (info->rdev)return false; +if (bdev_nonrot (rdev->bdev)) { +set_bit (Nonrot, &rdev->flags); +WRITE_ONCE (conf->nonrot_disks, conf->nonrot_disks +1 ); + } + rdev->raid_disk = disk; info->head_position =0 ; info->seq_start = MaxSector;
@@ -1794,6 +1794,9 @@ static bool raid1_remove_conf(struct r1conf *conf, int disk) rdev->mddev->degraded < conf->raid_disks)return false; +if (test_and_clear_bit (Nonrot, &rdev->flags)) +WRITE_ONCE (conf->nonrot_disks, conf->nonrot_disks -1 ); +WRITE_ONCE (info->rdev,NULL );return true; }
drivers/md/raid1.h +1 -0
@@ -71,6 +71,7 @@ struct r1conf {* allow for replacements. */ int raid_disks; +int nonrot_disks;spinlock_t device_lock;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 38/715 md/raid1: fix choose next idle in read_balance()
In reply to Sasha LevinFrom: Yu Kuai <[email protected]>
[ Upstream commit 257ac239ffcfd097a9a0732bf5095fb00164f334 ]
Commit 12cee5a8a29e ("md/raid1: prevent merging too large request") add the case choose next idle in read_balance():
read_balance:
for_each_rdev
if(next_seq_sect == this_sector || dist == 0)
-> sequential reads
best_disk = disk;
if (...)
choose_next_idle = 1
continue;
for_each_rdev
-> iterate next rdev
if (pending == 0)
best_disk = disk;
-> choose the next idle disk
break;
if (choose_next_idle)
-> keep using this rdev if there are no other idle disk contine
However, commit 2e52d449bcec ("md/raid1: add failfast handling for reads.") remove the code:
- /* If device is idle, use it */
- if (pending == 0) {
- best_disk = disk;
- break;
- }
Hence choose next idle will never work now, fix this problem by following:
1) don't set best_disk in this case, read_balance() will choose the best disk after iterating all the disks;
2) add 'pending' so that other idle disk will be chosen;
3) add a new local variable 'sequential_disk' to record the disk, and if there is no other idle disk, 'sequential_disk' will be chosen;
--- drivers/md/raid1.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)
drivers/md/raid1.c +22 -10
@@ -601,13 +601,12 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sectconst sector_t this_sector = r1_bio->sector;int sectors;int best_good_sectors; -int best_disk, best_dist_disk, best_pending_disk; +int best_disk, best_dist_disk, best_pending_disk, sequential_disk;int disk;sector_t best_dist;unsigned int min_pending;struct md_rdev *rdev;int choose_first; -int choose_next_idle;/* * Check if we can balance. We can balance on the whole
@@ -618,11 +617,11 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect sectors = r1_bio->sectors; best_disk =-1 ; best_dist_disk =-1 ; + sequential_disk =-1 ; best_dist = MaxSector; best_pending_disk =-1 ; min_pending =UINT_MAX ; best_good_sectors =0 ; - choose_next_idle =0 ;clear_bit (R1BIO_FailFast, &r1_bio->state); if ((conf->mddev->recovery_cp < this_sector + sectors) ||
@@ -715,7 +714,6 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sectint opt_iosize =bdev_io_opt (rdev->bdev) >>9 ;struct raid1_info *mirror = &conf->mirrors[disk]; - best_disk = disk;/* * If buffered sequential IO size exceeds optimal * iosize, check if there is idle disk. If yes, choose
@@ -734,15 +732,22 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect mirror->next_seq_sect > opt_iosize && mirror->next_seq_sect - opt_iosize >= mirror->seq_start) { - choose_next_idle =1 ; -continue ; +/* +* Add 'pending' to avoid choosing this disk if +* there is other idle disk. +*/ + pending++; +/* +* If there is no other idle disk, this disk +* will be chosen. +*/ + sequential_disk = disk; + } else { + best_disk = disk; +break ; } -break ; } -if (choose_next_idle) -continue ; -if (min_pending > pending) { min_pending = pending; best_pending_disk = disk;
@@ -754,6 +759,13 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect } } +/* +* sequential IO size exceeds optimal iosize, however, there is no other +* idle disk, so choose the sequential disk. +*/ +if (best_disk ==-1 && min_pending !=0 ) + best_disk = sequential_disk; +/* * If all disks are rotational, choose the closest disk. If any disk is * non-rotational, choose the disk with less pending request even the
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 39/715 io_uring/net: unify how recvmsg and sendmsg copy in the msghdr
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
[ Upstream commit 52307ac4f2b507f60bae6df5be938d35e199c688 ]
For recvmsg, we roll our own since we support buffer selections. This isn't the case for sendmsg right now, but in preparation for doing so, make the recvmsg copy helpers generic so we can call them from the sendmsg side as well.
Stable-dep-of: 8ede3db5061b ("io_uring/net: fix overflow check in io_recvmsg_mshot_prep()")
--- io_uring/net.c | 271 ++++++++++++++++++++++++++----------------------- 1 file changed, 142 insertions(+), 129 deletions(-)
io_uring/net.c +142 -129
@@ -204,16 +204,150 @@ static int io_setup_async_msg(struct io_kiocb *req,return -EAGAIN ; } +static bool io_recvmsg_multishot_overflow (struct io_async_msghdr *iomsg) +{ +int hdr; + +if (iomsg->namelen <0 ) +return true; +if (check_add_overflow ((int )sizeof (struct io_uring_recvmsg_out ), + iomsg->namelen, &hdr)) +return true; +if (check_add_overflow (hdr, (int )iomsg->controllen, &hdr)) +return true; + +return false; +} + +#ifdef CONFIG_COMPAT +static int __io_compat_msg_copy_hdr (struct io_kiocb *req, +struct io_async_msghdr *iomsg, +struct sockaddr __user **addr,int ddir) +{ + struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); +struct compat_msghdr msg; +struct compat_iovec __user *uiov; +int ret; + +if (copy_from_user (&msg, sr->umsg_compat,sizeof (msg))) +return -EFAULT ; + + ret =__get_compat_msghdr (&iomsg->msg, &msg, addr); +if (ret) +return ret; + + uiov =compat_ptr (msg.msg_iov); +if (req->flags &REQ_F_BUFFER_SELECT ) { +compat_ssize_t clen; + + iomsg->free_iov =NULL ; +if (msg.msg_iovlen ==0 ) { + sr->len =0 ; + }else if (msg.msg_iovlen >1 ) { +return -EINVAL ; + }else { +if (!access_ok (uiov,sizeof (*uiov))) +return -EFAULT ; +if (__get_user (clen, &uiov->iov_len)) +return -EFAULT ; +if (clen <0 ) +return -EINVAL ; + sr->len = clen; + } + +if (ddir ==ITER_DEST && req->flags &REQ_F_APOLL_MULTISHOT ) { + iomsg->namelen = msg.msg_namelen; + iomsg->controllen = msg.msg_controllen; +if (io_recvmsg_multishot_overflow (iomsg)) +return -EOVERFLOW ; + } + +return 0 ; + } + + iomsg->free_iov = iomsg->fast_iov; + ret =__import_iovec (ddir, (struct iovec __user *)uiov, msg.msg_iovlen, +UIO_FASTIOV , &iomsg->free_iov, + &iomsg->msg.msg_iter, true); +if (unlikely (ret <0 )) +return ret; + +return 0 ; +} +#endif + +static int __io_msg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg, +struct sockaddr __user **addr,int ddir) +{ + struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); +struct user_msghdr msg; +int ret; + +if (copy_from_user (&msg, sr->umsg,sizeof (*sr->umsg))) +return -EFAULT ; + + ret =__copy_msghdr (&iomsg->msg, &msg, addr); +if (ret) +return ret; + +if (req->flags &REQ_F_BUFFER_SELECT ) { +if (msg.msg_iovlen ==0 ) { + sr->len = iomsg->fast_iov[0 ].iov_len =0 ; + iomsg->fast_iov[0 ].iov_base =NULL ; + iomsg->free_iov =NULL ; + }else if (msg.msg_iovlen >1 ) { +return -EINVAL ; + }else { +if (copy_from_user (iomsg->fast_iov, msg.msg_iov, +sizeof (*msg.msg_iov))) +return -EFAULT ; + sr->len = iomsg->fast_iov[0 ].iov_len; + iomsg->free_iov =NULL ; + } + +if (ddir ==ITER_DEST && req->flags &REQ_F_APOLL_MULTISHOT ) { + iomsg->namelen = msg.msg_namelen; + iomsg->controllen = msg.msg_controllen; +if (io_recvmsg_multishot_overflow (iomsg)) +return -EOVERFLOW ; + } + +return 0 ; + } + + iomsg->free_iov = iomsg->fast_iov; + ret =__import_iovec (ddir, msg.msg_iov, msg.msg_iovlen,UIO_FASTIOV , + &iomsg->free_iov, &iomsg->msg.msg_iter, false); +if (unlikely (ret <0 )) +return ret; + +return 0 ; +} + +static int io_msg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg, +struct sockaddr __user **addr,int ddir) +{ + iomsg->msg.msg_name = &iomsg->addr; + iomsg->msg.msg_iter.nr_segs =0 ; + +#ifdef CONFIG_COMPAT +if (req->ctx->compat) +return __io_compat_msg_copy_hdr (req, iomsg, addr, ddir); +#endif + +return __io_msg_copy_hdr (req, iomsg, addr, ddir); +} +static int io_sendmsg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg) { struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg);int ret; - iomsg->msg.msg_name = &iomsg->addr; - iomsg->free_iov = iomsg->fast_iov; - ret =sendmsg_copy_msghdr (&iomsg->msg, sr->umsg, sr->msg_flags, - &iomsg->free_iov); + ret =io_msg_copy_hdr (req, iomsg,NULL ,ITER_SOURCE ); +if (ret) +return ret; +/* save msg_control as sys_sendmsg() overwrites it */ sr->msg_control = iomsg->msg.msg_control_user;return ret;
@@ -435,142 +569,21 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)return IOU_OK ; } -static bool io_recvmsg_multishot_overflow (struct io_async_msghdr *iomsg) -{ -int hdr; - -if (iomsg->namelen <0 ) -return true; -if (check_add_overflow ((int )sizeof (struct io_uring_recvmsg_out ), - iomsg->namelen, &hdr)) -return true; -if (check_add_overflow (hdr, (int )iomsg->controllen, &hdr)) -return true; - -return false; -} - -static int __io_recvmsg_copy_hdr (struct io_kiocb *req, -struct io_async_msghdr *iomsg) -{ - struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); -struct user_msghdr msg; -int ret; - -if (copy_from_user (&msg, sr->umsg,sizeof (*sr->umsg))) -return -EFAULT ; - - ret =__copy_msghdr (&iomsg->msg, &msg, &iomsg->uaddr); -if (ret) -return ret; - -if (req->flags &REQ_F_BUFFER_SELECT ) { -if (msg.msg_iovlen ==0 ) { - sr->len = iomsg->fast_iov[0 ].iov_len =0 ; - iomsg->fast_iov[0 ].iov_base =NULL ; - iomsg->free_iov =NULL ; - }else if (msg.msg_iovlen >1 ) { -return -EINVAL ; - }else { -if (copy_from_user (iomsg->fast_iov, msg.msg_iov,sizeof (*msg.msg_iov))) -return -EFAULT ; - sr->len = iomsg->fast_iov[0 ].iov_len; - iomsg->free_iov =NULL ; - } - -if (req->flags &REQ_F_APOLL_MULTISHOT ) { - iomsg->namelen = msg.msg_namelen; - iomsg->controllen = msg.msg_controllen; -if (io_recvmsg_multishot_overflow (iomsg)) -return -EOVERFLOW ; - } - }else { - iomsg->free_iov = iomsg->fast_iov; - ret =__import_iovec (ITER_DEST , msg.msg_iov, msg.msg_iovlen,UIO_FASTIOV , - &iomsg->free_iov, &iomsg->msg.msg_iter, - false); -if (ret >0 ) - ret =0 ; - } - -return ret; -} - -#ifdef CONFIG_COMPAT -static int __io_compat_recvmsg_copy_hdr (struct io_kiocb *req, -struct io_async_msghdr *iomsg) -{ - struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); -struct compat_msghdr msg; -struct compat_iovec __user *uiov; -int ret; - -if (copy_from_user (&msg, sr->umsg_compat,sizeof (msg))) -return -EFAULT ; - - ret =__get_compat_msghdr (&iomsg->msg, &msg, &iomsg->uaddr); -if (ret) -return ret; - - uiov =compat_ptr (msg.msg_iov); -if (req->flags &REQ_F_BUFFER_SELECT ) { -compat_ssize_t clen; - - iomsg->free_iov =NULL ; -if (msg.msg_iovlen ==0 ) { - sr->len =0 ; - }else if (msg.msg_iovlen >1 ) { -return -EINVAL ; - }else { -if (!access_ok (uiov,sizeof (*uiov))) -return -EFAULT ; -if (__get_user (clen, &uiov->iov_len)) -return -EFAULT ; -if (clen <0 ) -return -EINVAL ; - sr->len = clen; - } - -if (req->flags &REQ_F_APOLL_MULTISHOT ) { - iomsg->namelen = msg.msg_namelen; - iomsg->controllen = msg.msg_controllen; -if (io_recvmsg_multishot_overflow (iomsg)) -return -EOVERFLOW ; - } - }else { - iomsg->free_iov = iomsg->fast_iov; - ret =__import_iovec (ITER_DEST , (struct iovec __user *)uiov, msg.msg_iovlen, -UIO_FASTIOV , &iomsg->free_iov, - &iomsg->msg.msg_iter, true); -if (ret <0 ) -return ret; - } - -return 0 ; -} -#endif -static int io_recvmsg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg) { - iomsg->msg.msg_name = &iomsg->addr; - iomsg->msg.msg_iter.nr_segs =0 ; - -#ifdef CONFIG_COMPAT -if (req->ctx->compat) -return __io_compat_recvmsg_copy_hdr (req, iomsg); -#endif - -return __io_recvmsg_copy_hdr (req, iomsg); +return io_msg_copy_hdr (req, iomsg, &iomsg->uaddr,ITER_DEST ); }int io_recvmsg_prep_async (struct io_kiocb *req) { +struct io_async_msghdr *iomsg;int ret;if (!io_msg_alloc_async_prep (req))return -ENOMEM ; - ret =io_recvmsg_copy_hdr (req, req->async_data); + iomsg = req->async_data; + ret =io_recvmsg_copy_hdr (req, iomsg);if (!ret) req->flags |=REQ_F_NEED_CLEANUP ;return ret;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 40/715 io_uring/net: move receive multishot out of the generic msghdr path
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
[ Upstream commit c55978024d123d43808ab393a0a4ce3ce8568150 ]
Move the actual user_msghdr / compat_msghdr into the send and receive sides, respectively, so we can move the uaddr receive handling into its own handler, and ditto the multishot with buffer selection logic.
Stable-dep-of: 8ede3db5061b ("io_uring/net: fix overflow check in io_recvmsg_mshot_prep()")
--- io_uring/net.c | 161 ++++++++++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 70 deletions(-)
io_uring/net.c +91 -70
@@ -204,46 +204,26 @@ static int io_setup_async_msg(struct io_kiocb *req,return -EAGAIN ; } -static bool io_recvmsg_multishot_overflow (struct io_async_msghdr *iomsg) -{ -int hdr; - -if (iomsg->namelen <0 ) -return true; -if (check_add_overflow ((int )sizeof (struct io_uring_recvmsg_out ), - iomsg->namelen, &hdr)) -return true; -if (check_add_overflow (hdr, (int )iomsg->controllen, &hdr)) -return true; - -return false; -} -#ifdef CONFIG_COMPAT -static int __io_compat_msg_copy_hdr (struct io_kiocb *req, -struct io_async_msghdr *iomsg, -struct sockaddr __user **addr,int ddir) +static int io_compat_msg_copy_hdr (struct io_kiocb *req, +struct io_async_msghdr *iomsg, +struct compat_msghdr *msg,int ddir) { struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); -struct compat_msghdr msg;struct compat_iovec __user *uiov;int ret; -if (copy_from_user (&msg, sr->umsg_compat,sizeof (msg))) +if (copy_from_user (msg, sr->umsg_compat,sizeof (*msg)))return -EFAULT ; - ret =__get_compat_msghdr (&iomsg->msg, &msg, addr); -if (ret) -return ret; - - uiov =compat_ptr (msg.msg_iov); + uiov =compat_ptr (msg->msg_iov);if (req->flags &REQ_F_BUFFER_SELECT ) {compat_ssize_t clen; iomsg->free_iov =NULL ; -if (msg.msg_iovlen ==0 ) { +if (msg->msg_iovlen ==0 ) { sr->len =0 ; - }else if (msg.msg_iovlen >1 ) { + }else if (msg->msg_iovlen >1 ) {return -EINVAL ; }else {if (!access_ok (uiov,sizeof (*uiov)))
@@ -255,18 +235,11 @@ static int __io_compat_msg_copy_hdr(struct io_kiocb *req, sr->len = clen; } -if (ddir ==ITER_DEST && req->flags &REQ_F_APOLL_MULTISHOT ) { - iomsg->namelen = msg.msg_namelen; - iomsg->controllen = msg.msg_controllen; -if (io_recvmsg_multishot_overflow (iomsg)) -return -EOVERFLOW ; - } -return 0 ; } iomsg->free_iov = iomsg->fast_iov; - ret =__import_iovec (ddir, (struct iovec __user *)uiov, msg.msg_iovlen, + ret =__import_iovec (ddir, (struct iovec __user *)uiov, msg->msg_iovlen,UIO_FASTIOV , &iomsg->free_iov, &iomsg->msg.msg_iter, true);if (unlikely (ret <0 ))
@@ -276,47 +249,35 @@ static int __io_compat_msg_copy_hdr(struct io_kiocb *req, }#endif -static int __io_msg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg, -struct sockaddr __user **addr,int ddir) +static int io_msg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg, +struct user_msghdr *msg,int ddir) { struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); -struct user_msghdr msg;int ret; -if (copy_from_user (&msg, sr->umsg,sizeof (*sr->umsg))) +if (copy_from_user (msg, sr->umsg,sizeof (*sr->umsg)))return -EFAULT ; - ret =__copy_msghdr (&iomsg->msg, &msg, addr); -if (ret) -return ret; -if (req->flags &REQ_F_BUFFER_SELECT ) { -if (msg.msg_iovlen ==0 ) { +if (msg->msg_iovlen ==0 ) { sr->len = iomsg->fast_iov[0 ].iov_len =0 ; iomsg->fast_iov[0 ].iov_base =NULL ; iomsg->free_iov =NULL ; - }else if (msg.msg_iovlen >1 ) { + }else if (msg->msg_iovlen >1 ) {return -EINVAL ; }else { -if (copy_from_user (iomsg->fast_iov, msg.msg_iov, -sizeof (*msg.msg_iov))) +if (copy_from_user (iomsg->fast_iov, msg->msg_iov, +sizeof (*msg->msg_iov)))return -EFAULT ; sr->len = iomsg->fast_iov[0 ].iov_len; iomsg->free_iov =NULL ; } -if (ddir ==ITER_DEST && req->flags &REQ_F_APOLL_MULTISHOT ) { - iomsg->namelen = msg.msg_namelen; - iomsg->controllen = msg.msg_controllen; -if (io_recvmsg_multishot_overflow (iomsg)) -return -EOVERFLOW ; - } -return 0 ; } iomsg->free_iov = iomsg->fast_iov; - ret =__import_iovec (ddir, msg.msg_iov, msg.msg_iovlen,UIO_FASTIOV , + ret =__import_iovec (ddir, msg->msg_iov, msg->msg_iovlen,UIO_FASTIOV , &iomsg->free_iov, &iomsg->msg.msg_iter, false);if (unlikely (ret <0 ))return ret;
@@ -324,30 +285,34 @@ static int __io_msg_copy_hdr(struct io_kiocb *req, struct io_async_msghdr *iomsgreturn 0 ; } -static int io_msg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg, -struct sockaddr __user **addr,int ddir) +static int io_sendmsg_copy_hdr (struct io_kiocb *req, +struct io_async_msghdr *iomsg) { + struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); +struct user_msghdr msg; +int ret; + iomsg->msg.msg_name = &iomsg->addr; iomsg->msg.msg_iter.nr_segs =0 ;#ifdef CONFIG_COMPAT -if (req->ctx->compat) -return __io_compat_msg_copy_hdr (req, iomsg, addr, ddir); -#endif +if (unlikely (req->ctx->compat)) { +struct compat_msghdr cmsg; -return __io_msg_copy_hdr (req, iomsg, addr, ddir); -} + ret =io_compat_msg_copy_hdr (req, iomsg, &cmsg,ITER_SOURCE ); +if (unlikely (ret)) +return ret; -static int io_sendmsg_copy_hdr (struct io_kiocb *req, -struct io_async_msghdr *iomsg) -{ - struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); -int ret; +return __get_compat_msghdr (&iomsg->msg, &cmsg,NULL ); + } +#endif - ret =io_msg_copy_hdr (req, iomsg,NULL ,ITER_SOURCE ); -if (ret) + ret =io_msg_copy_hdr (req, iomsg, &msg,ITER_SOURCE ); +if (unlikely (ret))return ret; + ret =__copy_msghdr (&iomsg->msg, &msg,NULL ); +/* save msg_control as sys_sendmsg() overwrites it */ sr->msg_control = iomsg->msg.msg_control_user;return ret;
@@ -569,10 +534,66 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags)return IOU_OK ; } +static int io_recvmsg_mshot_prep (struct io_kiocb *req, +struct io_async_msghdr *iomsg, +size_t namelen,size_t controllen) +{ +if ((req->flags & (REQ_F_APOLL_MULTISHOT |REQ_F_BUFFER_SELECT )) == + (REQ_F_APOLL_MULTISHOT |REQ_F_BUFFER_SELECT )) { +int hdr; + +if (unlikely (namelen <0 )) +return -EOVERFLOW ; +if (check_add_overflow ((int )sizeof (struct io_uring_recvmsg_out ), + namelen, &hdr)) +return -EOVERFLOW ; +if (check_add_overflow (hdr, (int )controllen, &hdr)) +return -EOVERFLOW ; + + iomsg->namelen = namelen; + iomsg->controllen = controllen; +return 0 ; + } + +return 0 ; +} +static int io_recvmsg_copy_hdr (struct io_kiocb *req,struct io_async_msghdr *iomsg) { -return io_msg_copy_hdr (req, iomsg, &iomsg->uaddr,ITER_DEST ); +struct user_msghdr msg; +int ret; + + iomsg->msg.msg_name = &iomsg->addr; + iomsg->msg.msg_iter.nr_segs =0 ; + +#ifdef CONFIG_COMPAT +if (unlikely (req->ctx->compat)) { +struct compat_msghdr cmsg; + + ret =io_compat_msg_copy_hdr (req, iomsg, &cmsg,ITER_DEST ); +if (unlikely (ret)) +return ret; + + ret =__get_compat_msghdr (&iomsg->msg, &cmsg, &iomsg->uaddr); +if (unlikely (ret)) +return ret; + +return io_recvmsg_mshot_prep (req, iomsg, cmsg.msg_namelen, + cmsg.msg_controllen); + } +#endif + + ret =io_msg_copy_hdr (req, iomsg, &msg,ITER_DEST ); +if (unlikely (ret)) +return ret; + + ret =__copy_msghdr (&iomsg->msg, &msg, &iomsg->uaddr); +if (unlikely (ret)) +return ret; + +return io_recvmsg_mshot_prep (req, iomsg, msg.msg_namelen, + msg.msg_controllen); }int io_recvmsg_prep_async (struct io_kiocb *req)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 41/715 io_uring/net: fix overflow check in io_recvmsg_mshot_prep()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 8ede3db5061bb1fe28e2c9683329aafa89d2b1b4 ]
The "controllen" variable is type size_t (unsigned long). Casting it to int could lead to an integer underflow.
The check_add_overflow() function considers the type of the destination which is type int. If we add two positive values and the result cannot fit in an integer then that's counted as an overflow.
However, if we cast "controllen" to an int and it turns negative, then negative values *can* fit into an int type so there is no overflow.
Good: 100 + (unsigned long)-4 = 96 <-- overflow
Bad: 100 + (int)-4 = 96 <-- no overflow
I deleted the cast of the sizeof() as well. That's not a bug but the cast is unnecessary.
--- io_uring/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
io_uring/net.c +2 -2
@@ -544,10 +544,10 @@ static int io_recvmsg_mshot_prep(struct io_kiocb *req,if (unlikely (namelen <0 ))return -EOVERFLOW ; -if (check_add_overflow ((int )sizeof (struct io_uring_recvmsg_out ), +if (check_add_overflow (sizeof (struct io_uring_recvmsg_out ), namelen, &hdr))return -EOVERFLOW ; -if (check_add_overflow (hdr, (int )controllen, &hdr)) +if (check_add_overflow (hdr, controllen, &hdr))return -EOVERFLOW ; iomsg->namelen = namelen;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 42/715 nvme: host: fix double-free of struct nvme_id_ns in ns_update_nuse()
In reply to Sasha LevinFrom: Shin'ichiro Kawasaki <[email protected]>
[ Upstream commit 8d0d2447394b13fb22a069f0330f9c49b7fff9d3 ]
When nvme_identify_ns() fails, it frees the pointer to the struct nvme_id_ns before it returns. However, ns_update_nuse() calls kfree() for the pointer even when nvme_identify_ns() fails. This results in KASAN double-free, which was observed with blktests nvme/045 with proposed patches [1] on the kernel v6.8-rc7. Fix the double-free by skipping kfree() when nvme_identify_ns() fails.
--- drivers/nvme/host/sysfs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/nvme/host/sysfs.c +2 -5
@@ -221,14 +221,11 @@ static int ns_update_nuse(struct nvme_ns *ns) ret =nvme_identify_ns (ns->ctrl, ns->head->ns_id, &id);if (ret) - goto out_free_id; +return ret; ns->head->nuse =le64_to_cpu (id->nuse); - -out_free_id:kfree (id); - -return ret; +return 0 ; } static ssize_t nuse_show(struct device *dev, struct device_attribute *attr,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 43/715 aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts
In reply to Sasha LevinFrom: Chun-Yi Lee <[email protected]>
[ Upstream commit f98364e926626c678fb4b9004b75cacf92ff0662 ]
This patch is against CVE-2023-6270. The description of cve is:
A flaw was found in the ATA over Ethernet (AoE) driver in the Linux kernel. The aoecmd_cfg_pkts() function improperly updates the refcnt on struct net_device, and a use-after-free can be triggered by racing between the free on the struct and the access through the skbtxq global queue. This could lead to a denial of service condition or potential code execution.
In aoecmd_cfg_pkts(), it always calls dev_put(ifp) when skb initial code is finished. But the net_device ifp will still be used in later tx()->dev_queue_xmit() in kthread. Which means that the dev_put(ifp) should NOT be called in the success path of skb initial code in aoecmd_cfg_pkts(). Otherwise tx() may run into use-after-free because the net_device is freed.
This patch removed the dev_put(ifp) in the success path in aoecmd_cfg_pkts(), and added dev_put() after skb xmit in tx().
--- drivers/block/aoe/aoecmd.c | 12 ++++++------ drivers/block/aoe/aoenet.c | 1 + 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/block/aoe/aoecmd.c +6 -6
@@ -419,13 +419,16 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff_head *qurcu_read_lock ();for_each_netdev_rcu (&init_net, ifp) {dev_hold (ifp); -if (!is_aoe_netif (ifp)) - goto cont; +if (!is_aoe_netif (ifp)) { +dev_put (ifp); +continue ; + } skb =new_skb (sizeof *h +sizeof *ch);if (skb ==NULL ) {printk (KERN_INFO "aoe: skb alloc failure\n" ); - goto cont; +dev_put (ifp); +continue ; }skb_put (skb,sizeof *h +sizeof *ch); skb->dev = ifp;
@@ -440,9 +443,6 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff_head *qu h->major =cpu_to_be16 (aoemajor); h->minor = aoeminor; h->cmd =AOECMD_CFG ; - -cont: -dev_put (ifp); }rcu_read_unlock (); }
drivers/block/aoe/aoenet.c +1 -0
@@ -63,6 +63,7 @@ tx(int id) __must_hold(&txlock)pr_warn ("aoe: packet could not be sent on %s. %s\n" , ifp ? ifp->name :"netif" ,"consider increasing tx_queue_len" ); +dev_put (ifp);spin_lock_irq (&txlock); }return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 44/715 x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type
In reply to Sasha LevinFrom: Michael Roth <[email protected]>
[ Upstream commit 8e5647a723c49d73b9f108a8bb38e8c29d3948ea ]
On 64-bit platforms, the pfn_to_kaddr() macro requires that the input value is 64 bits in order to ensure that valid address bits don't get lost when shifting that input by PAGE_SHIFT to calculate the physical address to provide a virtual address for.
One such example is in pvalidate_pages() (used by SEV-SNP guests), where the GFN in the struct used for page-state change requests is a 40-bit bit-field, so attempts to pass this GFN field directly into pfn_to_kaddr() ends up causing guest crashes when dealing with addresses above the 1TB range due to the above.
Fix this issue with SEV-SNP guests, as well as any similar cases that might cause issues in current/future code, by using an inline function, instead of a macro, so that the input is implicitly cast to the expected 64-bit input type prior to performing the shift operation.
While it might be argued that the issue is on the caller side, other archs/macros have taken similar approaches to deal with instances like this, such as ARM explicitly casting the input to phys_addr_t:
e48866647b48 ("ARM: 8396/1: use phys_addr_t in pfn_to_kaddr()")
A C inline function is even better though.
[ mingo: Refined the changelog some more & added __always_inline. ]
--- arch/x86/include/asm/page.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/x86/include/asm/page.h +5 -1
@@ -66,10 +66,14 @@ static inline void copy_user_page(void *to, void *from, unsigned long vaddr,* virt_addr_valid(kaddr) returns true. */ #define virt_to_page (kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define pfn_to_kaddr (pfn) __va((pfn) << PAGE_SHIFT)extern bool __virt_addr_valid (unsigned long kaddr);#define virt_addr_valid (kaddr) __virt_addr_valid((unsigned long) (kaddr)) +static __always_inline void *pfn_to_kaddr(unsigned long pfn) +{ +return __va (pfn <<PAGE_SHIFT ); +} + static __always_inline u64 __canonical_address(u64 vaddr, u8 vaddr_bits) {return ((s64 )vaddr << (64 - vaddr_bits)) >> (64 - vaddr_bits);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 45/715 x86/resctrl: Remove hard-coded memory bandwidth limit
In reply to Sasha LevinFrom: Babu Moger <[email protected]>
[ Upstream commit 0976783bb123f30981bc1e7a14d9626a6f63aeac ]
The QOS Memory Bandwidth Enforcement Limit is reported by CPUID_Fn80000020_EAX_x01 and CPUID_Fn80000020_EAX_x02:
Bits Description
31:0 BW_LEN: Size of the QOS Memory Bandwidth Enforcement Limit.
Newer processors can support higher bandwidth limit than the current hard-coded value. Remove latter and detect using CPUID instead. Also, update the register variables eax and edx to match the AMD CPUID definition.
The CPUID details are documented in the Processor Programming Reference (PPR) Vol 1.1 for AMD Family 19h Model 11h B1 - 55901 Rev 0.25 in the Link tag below.
--- arch/x86/kernel/cpu/resctrl/core.c | 10 ++++------ arch/x86/kernel/cpu/resctrl/internal.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/resctrl/core.c +4 -6
@@ -231,9 +231,7 @@ static bool __get_mem_config_intel(struct rdt_resource *r)static bool __rdt_get_mem_config_amd (struct rdt_resource *r) {struct rdt_hw_resource *hw_res =resctrl_to_arch_res (r); -union cpuid_0x10_3_eax eax; -union cpuid_0x10_x_edx edx; -u32 ebx, ecx, subleaf; +u32 eax, ebx, ecx, edx, subleaf;/* * Query CPUID_Fn80000020_EDX_x01 for MBA and
@@ -241,9 +239,9 @@ static bool __rdt_get_mem_config_amd(struct rdt_resource *r)*/ subleaf = (r->rid ==RDT_RESOURCE_SMBA ) ?2 :1 ; -cpuid_count (0x80000020 , subleaf, &eax.full, &ebx, &ecx, &edx.full); - hw_res->num_closid = edx.split.cos_max +1 ; - r->default_ctrl =MAX_MBA_BW_AMD ; +cpuid_count (0x80000020 , subleaf, &eax, &ebx, &ecx, &edx); + hw_res->num_closid = edx +1 ; + r->default_ctrl =1 << eax;/* AMD does not use delay */ r->membw.delay_linear = false;
arch/x86/kernel/cpu/resctrl/internal.h +0 -1
@@ -18,7 +18,6 @@#define MBM_OVERFLOW_INTERVAL 1000#define MAX_MBA_BW 100u#define MBA_IS_LINEAR 0x4 -#define MAX_MBA_BW_AMD 0x800#define MBM_CNTR_WIDTH_OFFSET_AMD 20#define RMID_VAL_ERROR BIT_ULL(63)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 46/715 x86/resctrl: Read supported bandwidth sources from CPUID
In reply to Sasha LevinFrom: Babu Moger <[email protected]>
[ Upstream commit 54e35eb8611cce5550d3d7689679b1a91c864f28 ]
If the BMEC (Bandwidth Monitoring Event Configuration) feature is supported, the bandwidth events can be configured. The maximum supported bandwidth bitmask can be read from CPUID:
CPUID_Fn80000020_ECX_x03 [Platform QoS Monitoring Bandwidth Event Configuration]
Bits Description 31:7 Reserved 6:0 Identifies the bandwidth sources that can be tracked.
While at it, move the mask checking to mon_config_write() before iterating over all the domains. Also, print the valid bitmask when the user tries to configure invalid event configuration value.
The CPUID details are documented in the Processor Programming Reference (PPR) Vol 1.1 for AMD Family 19h Model 11h B1 - 55901 Rev 0.25 in the Link tag.
--- arch/x86/kernel/cpu/resctrl/internal.h | 3 +++ arch/x86/kernel/cpu/resctrl/monitor.c | 6 ++++++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 14 ++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/resctrl/internal.h +3 -0
@@ -394,6 +394,8 @@ struct rdt_parse_data {* @msr_update: Function pointer to update QOS MSRs * @mon_scale: cqm counter * mon_scale = occupancy in bytes * @mbm_width: Monitor width, to detect and correct for overflow. +* @mbm_cfg_mask: Bandwidth sources that can be tracked when Bandwidth +* Monitoring Event Configuration (BMEC) is supported. * @cdp_enabled: CDP state of this resource * * Members of this structure are either private to the architecture
@@ -408,6 +410,7 @@ struct rdt_hw_resource { struct rdt_resource *r);unsigned int mon_scale;unsigned int mbm_width; +unsigned int mbm_cfg_mask;bool cdp_enabled; };
arch/x86/kernel/cpu/resctrl/monitor.c +6 -0
@@ -813,6 +813,12 @@ int __init rdt_get_mon_l3_config(struct rdt_resource *r)return ret;if (rdt_cpu_has (X86_FEATURE_BMEC )) { +u32 eax, ebx, ecx, edx; + +/* Detect list of bandwidth sources that can be tracked */ +cpuid_count (0x80000020 ,3 , &eax, &ebx, &ecx, &edx); + hw_res->mbm_cfg_mask = ecx &MAX_EVT_CONFIG_BITS ; +if (rdt_cpu_has (X86_FEATURE_CQM_MBM_TOTAL )) { mbm_total_event.configurable = true;mbm_config_rftype_init ("mbm_total_bytes_config" );
arch/x86/kernel/cpu/resctrl/rdtgroup.c +8 -6
@@ -1620,12 +1620,6 @@ static int mbm_config_write_domain(struct rdt_resource *r,struct mon_config_info mon_info = {0 };int ret =0 ; -/* mon_config cannot be more than the supported set of events */ -if (val >MAX_EVT_CONFIG_BITS ) { -rdt_last_cmd_puts ("Invalid event configuration\n" ); -return -EINVAL ; - } -/* * Read the current config value first. If both are the same then * no need to write it again.
@@ -1663,6 +1657,7 @@ static int mbm_config_write_domain(struct rdt_resource *r,static int mon_config_write (struct rdt_resource *r,char *tok,u32 evtid) { +struct rdt_hw_resource *hw_res =resctrl_to_arch_res (r);char *dom_str =NULL , *id_str;unsigned long dom_id, val;struct rdt_domain *d;
@@ -1686,6 +1681,13 @@ static int mon_config_write(struct rdt_resource *r, char *tok, u32 evtid)return -EINVAL ; } +/* Value from user cannot be more than the supported set of events */ +if ((val & hw_res->mbm_cfg_mask) != val) { +rdt_last_cmd_printf ("Invalid event configuration: max valid mask is 0x%02x\n" , + hw_res->mbm_cfg_mask); +return -EINVAL ; + } +list_for_each_entry (d, &r->domains, list) {if (d->id == dom_id) { ret =mbm_config_write_domain (r, d, evtid, val);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 47/715 x86/resctrl: Implement new mba_MBps throttling heuristic
In reply to Sasha LevinFrom: Tony Luck <[email protected]>
[ Upstream commit c2427e70c1630d98966375fffc2b713ab9768a94 ]
The mba_MBps feedback loop increases throttling when a group is using more bandwidth than the target set by the user in the schemata file, and decreases throttling when below target.
To avoid possibly stepping throttling up and down on every poll a flag "delta_comp" is set whenever throttling is changed to indicate that the actual change in bandwidth should be recorded on the next poll in "delta_bw". Throttling is only reduced if the current bandwidth plus delta_bw is below the user target.
This algorithm works well if the workload has steady bandwidth needs. But it can go badly wrong if the workload moves to a different phase just as the throttling level changed. E.g. if the workload becomes essentially idle right as throttling level is increased, the value calculated for delta_bw will be more or less the old bandwidth level. If the workload then resumes, Linux may never reduce throttling because current bandwidth plus delta_bw is above the target set by the user.
Implement a simpler heuristic by assuming that in the worst case the currently measured bandwidth is being controlled by the current level of throttling. Compute how much it may increase if throttling is relaxed to the next higher level. If that is still below the user target, then it is ok to reduce the amount of throttling.
--- arch/x86/kernel/cpu/resctrl/internal.h | 4 --- arch/x86/kernel/cpu/resctrl/monitor.c | 42 ++++++-------------------- 2 files changed, 10 insertions(+), 36 deletions(-)
arch/x86/kernel/cpu/resctrl/internal.h +0 -4
@@ -295,14 +295,10 @@ struct rftype {* struct mbm_state - status for each MBM counter in each domain * @prev_bw_bytes: Previous bytes value read for bandwidth calculation * @prev_bw: The most recent bandwidth in MBps -* @delta_bw: Difference between the current and previous bandwidth -* @delta_comp: Indicates whether to compute the delta_bw */ struct mbm_state {u64 prev_bw_bytes;u32 prev_bw; -u32 delta_bw; -bool delta_comp; };/**
arch/x86/kernel/cpu/resctrl/monitor.c +10 -32
86 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 48/715 x86/sme: Fix memory encryption setting if enabled by default and not overridden
In reply to Sasha LevinFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit e814b59e6c2b11f5a3d007b2e61f7d550c354c3a ]
Commit
cbebd68f59f0 ("x86/mm: Fix use of uninitialized buffer in sme_enable()")
'fixed' an issue in sme_enable() detected by static analysis, and broke the common case in the process.
cmdline_find_option() will return < 0 on an error, or when the command line argument does not appear at all. In this particular case, the latter is not an error condition, and so the early exit is wrong.
Instead, without mem_encrypt= on the command line, the compile time default should be honoured, which could be to enable memory encryption, and this is currently broken.
Fix it by setting sme_me_mask to a preliminary value based on the compile time default, and only omitting the command line argument test when cmdline_find_option() returns an error.
[ bp: Drop active_by_default while at it. ]
--- arch/x86/mm/mem_encrypt_identity.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
arch/x86/mm/mem_encrypt_identity.c +3 -7
@@ -507,7 +507,6 @@ void __init sme_enable(struct boot_params *bp)const char *cmdline_ptr, *cmdline_arg, *cmdline_on, *cmdline_off;unsigned int eax, ebx, ecx, edx;unsigned long feature_mask; -bool active_by_default;unsigned long me_mask;char buffer[16 ];bool snp;
@@ -593,22 +592,19 @@ void __init sme_enable(struct boot_params *bp) : "p" (sme_cmdline_off));if (IS_ENABLED (CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT )) - active_by_default = true; -else - active_by_default = false; + sme_me_mask = me_mask; cmdline_ptr = (const char *)((u64 )bp->hdr.cmd_line_ptr | ((u64 )bp->ext_cmd_line_ptr <<32 ));if (cmdline_find_option (cmdline_ptr, cmdline_arg, buffer,sizeof (buffer)) <0 ) -return ; + goto out;if (!strncmp (buffer, cmdline_on,sizeof (buffer))) sme_me_mask = me_mask;else if (!strncmp (buffer, cmdline_off,sizeof (buffer))) sme_me_mask =0 ; -else - sme_me_mask = active_by_default ? me_mask :0 ; + out:if (sme_me_mask) { physical_mask &= ~sme_me_mask;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 49/715 timekeeping: Fix cross-timestamp interpolation on counter wrap
In reply to Sasha LevinFrom: Peter Hilber <[email protected]>
[ Upstream commit 84dccadd3e2a3f1a373826ad71e5ced5e76b0c00 ]
cycle_between() decides whether get_device_system_crosststamp() will interpolate for older counter readings.
cycle_between() yields wrong results for a counter wrap-around where after < before < test, and for the case after < test < before.
Fix the comparison logic.
--- kernel/time/timekeeping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/timekeeping.c +1 -1
@@ -1186,7 +1186,7 @@ static bool cycle_between(u64 before, u64 test, u64 after) {if (test > before && test < after)return true; -if (test < before && before > after) +if (before > after && (test > before || test < after))return true;return false; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 50/715 timekeeping: Fix cross-timestamp interpolation corner case decision
In reply to Sasha LevinFrom: Peter Hilber <[email protected]>
[ Upstream commit 87a41130881995f82f7adbafbfeddaebfb35f0ef ]
The cycle_between() helper checks if parameter test is in the open interval (before, after). Colloquially speaking, this also applies to the counter wrap-around special case before > after. get_device_system_crosststamp() currently uses cycle_between() at the first call site to decide whether to interpolate for older counter readings.
get_device_system_crosststamp() has the following problem with cycle_between() testing against an open interval: Assume that, by chance, cycles == tk->tkr_mono.cycle_last (in the following, "cycle_last" for brevity). Then, cycle_between() at the first call site, with effective argument values cycle_between(cycle_last, cycles, now), returns false, enabling interpolation. During interpolation, get_device_system_crosststamp() will then call cycle_between() at the second call site (if a history_begin was supplied). The effective argument values are cycle_between(history_begin->cycles, cycles, cycles), since system_counterval.cycles == interval_start == cycles, per the assumption. Due to the test against the open interval, cycle_between() returns false again. This causes get_device_system_crosststamp() to return -EINVAL.
This failure should be avoided, since get_device_system_crosststamp() works both when cycles follows cycle_last (no interpolation), and when cycles precedes cycle_last (interpolation). For the case cycles == cycle_last, interpolation is actually unneeded.
Fix this by changing cycle_between() into timestamp_in_interval(), which now checks against the closed interval, rather than the open interval.
This changes the get_device_system_crosststamp() behavior for three corner cases:
1. Bypass interpolation in the case cycles == tk->tkr_mono.cycle_last, fixing the problem described above.
2. At the first timestamp_in_interval() call site, cycles == now no longer causes failure.
3. At the second timestamp_in_interval() call site, history_begin->cycles == system_counterval.cycles no longer causes failure. adjust_historical_crosststamp() also works for this corner case, where partial_history_cycles == total_history_cycles.
These behavioral changes should not cause any problems.
--- kernel/time/timekeeping.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
kernel/time/timekeeping.c +10 -8
@@ -1180,13 +1180,15 @@ static int adjust_historical_crosststamp(struct system_time_snapshot *history, }/* -* cycle_between - true if test occurs chronologically between before and after +* timestamp_in_interval - true if ts is chronologically in [start, end] +* +* True if ts occurs chronologically at or after start, and before or at end. */ -static bool cycle_between (u64 before,u64 test,u64 after) +static bool timestamp_in_interval (u64 start,u64 end,u64 ts) { -if (test > before && test < after) +if (ts >= start && ts <= end)return true; -if (before > after && (test > before || test < after)) +if (start > end && (ts >= start || ts <= end))return true;return false; }
@@ -1246,7 +1248,7 @@ int get_device_system_crosststamp(int (*get_time_fn)*/ now =tk_clock_read (&tk->tkr_mono); interval_start = tk->tkr_mono.cycle_last; -if (!cycle_between (interval_start, cycles, now)) { +if (!timestamp_in_interval (interval_start, now, cycles)) { clock_was_set_seq = tk->clock_was_set_seq; cs_was_changed_seq = tk->cs_was_changed_seq; cycles = interval_start;
@@ -1277,13 +1279,13 @@ int get_device_system_crosststamp(int (*get_time_fn)bool discontinuity;/* -* Check that the counter value occurs after the provided +* Check that the counter value is not before the provided * history reference and that the history doesn't cross a * clocksource change */ if (!history_begin || - !cycle_between (history_begin->cycles, - system_counterval.cycles, cycles) || + !timestamp_in_interval (history_begin->cycles, + cycles, system_counterval.cycles) || history_begin->cs_was_changed_seq != cs_was_changed_seq)return -EINVAL ; partial_history_cycles = cycles - system_counterval.cycles;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 51/715 timekeeping: Fix cross-timestamp interpolation for non-x86
In reply to Sasha LevinFrom: Peter Hilber <[email protected]>
[ Upstream commit 14274d0bd31b4debf28284604589f596ad2e99f2 ]
So far, get_device_system_crosststamp() unconditionally passes system_counterval.cycles to timekeeping_cycles_to_ns(). But when interpolating system time (do_interp == true), system_counterval.cycles is before tkr_mono.cycle_last, contrary to the timekeeping_cycles_to_ns() expectations.
On x86, CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE will mitigate on interpolating, setting delta to 0. With delta == 0, xtstamp->sys_monoraw and xtstamp->sys_realtime are then set to the last update time, as implicitly expected by adjust_historical_crosststamp(). On other architectures, the resulting nonsense xtstamp->sys_monoraw and xtstamp->sys_realtime corrupt the xtstamp (ts) adjustment in adjust_historical_crosststamp().
Fix this by deriving xtstamp->sys_monoraw and xtstamp->sys_realtime from the last update time when interpolating, by using the local variable "cycles". The local variable already has the right value when interpolating, unlike system_counterval.cycles.
--- kernel/time/timekeeping.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
kernel/time/timekeeping.c +2 -4
@@ -1261,10 +1261,8 @@ int get_device_system_crosststamp(int (*get_time_fn) tk_core.timekeeper.offs_real); base_raw = tk->tkr_raw.base; - nsec_real =timekeeping_cycles_to_ns (&tk->tkr_mono, - system_counterval.cycles); - nsec_raw =timekeeping_cycles_to_ns (&tk->tkr_raw, - system_counterval.cycles); + nsec_real =timekeeping_cycles_to_ns (&tk->tkr_mono, cycles); + nsec_raw =timekeeping_cycles_to_ns (&tk->tkr_raw, cycles); }while (read_seqcount_retry (&tk_core.seq, seq)); xtstamp->sys_realtime =ktime_add_ns (base_real, nsec_real);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 52/715 x86/asm: Remove the __iomem annotation of movdir64b()'s dst argument
In reply to Sasha LevinFrom: Kai Huang <[email protected]>
[ Upstream commit 5bdd181821b2c65b074cfad07d7c7d5d3cfe20bf ]
Commit e56d28df2f66 ("x86/virt/tdx: Configure global KeyID on all packages") causes a sparse warning:
arch/x86/virt/vmx/tdx/tdx.c:683:27: warning: incorrect type in argument 1 (different address spaces)
arch/x86/virt/vmx/tdx/tdx.c:683:27: expected void [noderef] __iomem *dst
arch/x86/virt/vmx/tdx/tdx.c:683:27: got void *
The reason is TDX must use the MOVDIR64B instruction to convert TDX private memory (which is normal RAM but not MMIO) back to normal. The TDX code uses existing movdir64b() helper to do that, but the first argument @dst of movdir64b() is annotated with __iomem.
When movdir64b() was firstly introduced in commit 0888e1030d3e ("x86/asm: Carve out a generic movdir64b() helper for general usage"), it didn't have the __iomem annotation. But this commit also introduced the same "incorrect type" sparse warning because the iosubmit_cmds512(), which was the solo caller of movdir64b(), has the __iomem annotation.
This was later fixed by commit 6ae58d871319 ("x86/asm: Annotate movdir64b()'s dst argument with __iomem"). That fix was reasonable because until TDX code the movdir64b() was only used to move data to MMIO location, as described by the commit message:
... The current usages send a 64-bytes command descriptor to an MMIO location (portal) on a device for consumption. When future usages for the MOVDIR64B instruction warrant a separate variant of a memory to memory operation, the argument annotation can be revisited.
Now TDX code uses MOVDIR64B to move data to normal memory so it's time to revisit.
The SDM says the destination of MOVDIR64B is "memory location specified in a general register", thus it's more reasonable that movdir64b() does not have the __iomem annotation on the @dst.
Remove the __iomem annotation from the @dst argument of movdir64b() to fix the sparse warning in TDX code. Similar to memset_io(), introduce a new movdir64b_io() to cover the case where the destination is an MMIO location, and change the solo caller iosubmit_cmds512() to use the new movdir64b_io().
In movdir64b_io() explicitly use __force in the type casting otherwise there will be below sparse warning:
warning: cast removes address space '__iomem' of expression
[ dhansen: normal changelog tweaks ]
--- arch/x86/include/asm/io.h | 2 +- arch/x86/include/asm/special_insns.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
arch/x86/include/asm/io.h +1 -1
@@ -379,7 +379,7 @@ static inline void iosubmit_cmds512(void __iomem *dst, const void *src,const u8 *end = from + count *64 ;while (from < end) { -movdir64b (dst, from); +movdir64b_io (dst, from); from +=64 ; } }
arch/x86/include/asm/special_insns.h +7 -2
@@ -224,10 +224,10 @@ static inline void serialize(void) }/* The dst parameter must be 64-bytes aligned */ -static inline void movdir64b (void __iomem *dst,const void *src) +static inline void movdir64b (void *dst,const void *src) {const struct {char _[64 ]; } *__src = src; -struct {char _[64 ]; }__iomem *__dst = dst; +struct {char _[64 ]; } *__dst = dst;/* * MOVDIR64B %(rdx), rax.
@@ -245,6 +245,11 @@ static inline void movdir64b(void __iomem *dst, const void *src) : "m" (*__src), "a" (__dst), "d" (__src)); } +static inline void movdir64b_io (void __iomem *dst,const void *src) +{ +movdir64b ((void __force *)dst, src); +} +/** * enqcmds - Enqueue a command in supervisor (CPL0) mode * @dst: destination, in MMIO space (must be 512-bit aligned)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 53/715 sched/fair: Take the scheduling domain into account in select_idle_smt()
In reply to Sasha LevinFrom: Keisuke Nishimura <[email protected]>
[ Upstream commit 8aeaffef8c6eceab0e1498486fdd4f3dc3b7066c ]
When picking a CPU on task wakeup, select_idle_smt() has to take into account the scheduling domain of @target. This is because the "isolcpus" kernel command line option can remove CPUs from the domain to isolate them from other SMT siblings.
This fix checks if the candidate CPU is in the target scheduling domain.
Commit:
df3cb4ea1fb6 ("sched/fair: Fix wrong cpu selecting from isolated domain")
... originally introduced this fix by adding the check of the scheduling domain in the loop.
However, commit:
3e6efe87cd5cc ("sched/fair: Remove redundant check in select_idle_smt()")
... accidentally removed the check. Bring it back.
--- kernel/sched/fair.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
kernel/sched/fair.c +9 -3
@@ -7311,13 +7311,19 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu/* * Scan the local SMT mask for idle CPUs. */ -static int select_idle_smt (struct task_struct *p,int target) +static int select_idle_smt (struct task_struct *p,struct sched_domain *sd,int target) {int cpu;for_each_cpu_and (cpu,cpu_smt_mask (target), p->cpus_ptr) {if (cpu == target)continue ; +/* +* Check if the CPU is in the LLC scheduling domain of @target. +* Due to isolcpus, there is no guarantee that all the siblings are in the domain. +*/ +if (!cpumask_test_cpu (cpu,sched_domain_span (sd))) +continue ;if (available_idle_cpu (cpu) ||sched_idle_cpu (cpu))return cpu; }
@@ -7341,7 +7347,7 @@ static inline int select_idle_core(struct task_struct *p, int core, struct cpumareturn __select_idle_cpu (core, p); } -static inline int select_idle_smt (struct task_struct *p,int target) +static inline int select_idle_smt (struct task_struct *p,struct sched_domain *sd,int target) {return -1 ; }
@@ -7591,7 +7597,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) has_idle_core =test_idle_cores (target);if (!has_idle_core &&cpus_share_cache (prev, target)) { - i =select_idle_smt (p, prev); + i =select_idle_smt (p, sd, prev);if ((unsigned int )i < nr_cpumask_bits)return i; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 54/715 sched/fair: Take the scheduling domain into account in select_idle_core()
In reply to Sasha LevinFrom: Keisuke Nishimura <[email protected]>
[ Upstream commit 23d04d8c6b8ec339057264659b7834027f3e6a63 ]
When picking a CPU on task wakeup, select_idle_core() has to take into account the scheduling domain where the function looks for the CPU.
This is because the "isolcpus" kernel command line option can remove CPUs from the domain to isolate them from other SMT siblings.
This change replaces the set of CPUs allowed to run the task from p->cpus_ptr by the intersection of p->cpus_ptr and sched_domain_span(sd) which is stored in the 'cpus' argument provided by select_idle_cpu().
--- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/fair.c +2 -2
@@ -7289,7 +7289,7 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpuif (!available_idle_cpu (cpu)) { idle = false;if (*idle_cpu ==-1 ) { -if (sched_idle_cpu (cpu) &&cpumask_test_cpu (cpu, p->cpus_ptr)) { +if (sched_idle_cpu (cpu) &&cpumask_test_cpu (cpu, cpus)) { *idle_cpu = cpu;break ; }
@@ -7297,7 +7297,7 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu }break ; } -if (*idle_cpu ==-1 &&cpumask_test_cpu (cpu, p->cpus_ptr)) +if (*idle_cpu ==-1 &&cpumask_test_cpu (cpu, cpus)) *idle_cpu = cpu; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 55/715 wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
In reply to Sasha LevinFrom: Xingyuan Mo <[email protected]>
[ Upstream commit ad25ee36f00172f7d53242dc77c69fff7ced0755 ]
We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is present before accessing it, otherwise a null pointer deference error will occur.
--- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath10k/wmi-tlv.c +4 -0
@@ -851,6 +851,10 @@ ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev(struct ath10k *ar, struct sk_buff *skb, } ev = tb[WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT ]; +if (!ev) { +kfree (tb); +return -EPROTO ; + } arg->desc_id = ev->desc_id; arg->status = ev->status;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 56/715 wifi: b43: Stop/wake correct queue in DMA Tx path when QoS is disabled
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 9636951e4468f02c72cc75a82dc65d003077edbc ]
When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop/wake queue 0 when QoS is disabled to prevent trying to stop/wake a non-existent queue and failing to stop/wake the actual queue instantiated.
Log of issue before change (with kernel parameter qos=0):
[ +5.112651] ------------[ cut here ]------------
[ +0.000005] WARNING: CPU: 7 PID: 25513 at net/mac80211/util.c:449 __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000067] Modules linked in: b43(O) snd_seq_dummy snd_hrtimer snd_seq snd_seq_device nft_chain_nat xt_MASQUERADE nf_nat xfrm_user xfrm_algo xt_addrtype overlay ccm af_packet amdgpu snd_hda_codec_cirrus snd_hda_codec_generic ledtrig_audio drm_exec amdxcp gpu_sched xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6t_rpfilter ipt_rpfilter xt_pkttype xt_LOG nf_log_syslog xt_tcpudp nft_compat nf_tables nfnetlink sch_fq_codel btusb uinput iTCO_wdt ctr btrtl intel_pmc_bxt i915 intel_rapl_msr mei_hdcp mei_pxp joydev at24 watchdog btintel atkbd libps2 serio radeon btbcm vivaldi_fmap btmtk intel_rapl_common snd_hda_codec_hdmi bluetooth uvcvideo nls_iso8859_1 applesmc nls_cp437 x86_pkg_temp_thermal snd_hda_intel intel_powerclamp vfat videobuf2_vmalloc coretemp fat snd_intel_dspcfg crc32_pclmul uvc polyval_clmulni snd_intel_sdw_acpi loop videobuf2_memops snd_hda_codec tun drm_suballoc_helper polyval_generic drm_ttm_helper drm_buddy tap ecdh_generic videobuf2_v4l2 gf128mul macvlan ttm ghash_clmulni_intel ecc tg3
[ +0.000044] videodev bridge snd_hda_core rapl crc16 drm_display_helper cec mousedev snd_hwdep evdev intel_cstate bcm5974 hid_appleir videobuf2_common stp mac_hid libphy snd_pcm drm_kms_helper acpi_als mei_me intel_uncore llc mc snd_timer intel_gtt industrialio_triggered_buffer apple_mfi_fastcharge i2c_i801 mei snd lpc_ich agpgart ptp i2c_smbus thunderbolt apple_gmux i2c_algo_bit kfifo_buf video industrialio soundcore pps_core wmi tiny_power_button sbs sbshc button ac cordic bcma mac80211 cfg80211 ssb rfkill libarc4 kvm_intel kvm drm irqbypass fuse backlight firmware_class efi_pstore configfs efivarfs dmi_sysfs ip_tables x_tables autofs4 dm_crypt cbc encrypted_keys trusted asn1_encoder tee tpm rng_core input_leds hid_apple led_class hid_generic usbhid hid sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic ahci libahci libata uhci_hcd ehci_pci ehci_hcd crct10dif_pclmul crct10dif_common sha512_ssse3 sha512_generic sha256_ssse3 sha1_ssse3 aesni_intel usbcore scsi_mod libaes crypto_simd cryptd scsi_common
[ +0.000055] usb_common rtc_cmos btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq dm_snapshot dm_bufio dm_mod dax [last unloaded: b43(O)]
[ +0.000009] CPU: 7 PID: 25513 Comm: irq/17-b43 Tainted: G W O 6.6.7 #1-NixOS
[ +0.000003] Hardware name: Apple Inc. MacBookPro8,3/Mac-942459F5819B171B, BIOS 87.0.0.0.0 06/13/2019
[ +0.000001] RIP: 0010:__ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000046] Code: 00 45 85 e4 0f 85 9b 00 00 00 48 8d bd 40 09 00 00 f0 48 0f ba ad 48 09 00 00 00 72 0f 5b 5d 41 5c 41 5d 41 5e e9 cb 6d 3c d0 <0f> 0b 5b 5d 41 5c 41 5d 41 5e c3 cc cc cc cc 48 8d b4 16 94 00 00
[ +0.000002] RSP: 0018:ffffc90003c77d60 EFLAGS: 00010097
[ +0.000001] RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000000
[ +0.000001] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff88820b924900
[ +0.000002] RBP: ffff88820b924900 R08: ffffc90003c77d90 R09: 000000000003bfd0
[ +0.000001] R10: ffff88820b924900 R11: ffffc90003c77c68 R12: 0000000000000000
[ +0.000001] R13: 0000000000000000 R14: ffffc90003c77d90 R15: ffffffffc0fa6f40
[ +0.000001] FS: 0000000000000000(0000) GS:ffff88846fb80000(0000) knlGS:0000000000000000
[ +0.000001] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ +0.000001] CR2: 00007fafda7ae008 CR3: 000000046d220005 CR4: 00000000000606e0
[ +0.000002] Call Trace:
[ +0.000003] <TASK>
[ +0.000001] ? __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000044] ? __warn+0x81/0x130
[ +0.000005] ? __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000045] ? report_bug+0x171/0x1a0
[ +0.000004] ? handle_bug+0x41/0x70
[ +0.000004] ? exc_invalid_op+0x17/0x70
[ +0.000003] ? asm_exc_invalid_op+0x1a/0x20
[ +0.000005] ? __ieee80211_wake_queue+0xd5/0x180 [mac80211]
[ +0.000043] ieee80211_wake_queue+0x4a/0x80 [mac80211]
[ +0.000044] b43_dma_handle_txstatus+0x29c/0x3a0 [b43]
[ +0.000016] ? __pfx_irq_thread_fn+0x10/0x10
[ +0.000002] b43_handle_txstatus+0x61/0x80 [b43]
[ +0.000012] b43_interrupt_thread_handler+0x3f9/0x6b0 [b43]
[ +0.000011] irq_thread_fn+0x23/0x60
[ +0.000002] irq_thread+0xfe/0x1c0
[ +0.000002] ? __pfx_irq_thread_dtor+0x10/0x10
[ +0.000001] ? __pfx_irq_thread+0x10/0x10
[ +0.000001] kthread+0xe8/0x120
[ +0.000003] ? __pfx_kthread+0x10/0x10
[ +0.000003] ret_from_fork+0x34/0x50
[ +0.000002] ? __pfx_kthread+0x10/0x10
[ +0.000002] ret_from_fork_asm+0x1b/0x30
[ +0.000004] </TASK>
[ +0.000001] ---[ end trace 0000000000000000 ]--- [ +0.000065] ------------[ cut here ]------------
[ +0.000001] WARNING: CPU: 0 PID: 56077 at net/mac80211/util.c:514 __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000077] Modules linked in: b43(O) snd_seq_dummy snd_hrtimer snd_seq snd_seq_device nft_chain_nat xt_MASQUERADE nf_nat xfrm_user xfrm_algo xt_addrtype overlay ccm af_packet amdgpu snd_hda_codec_cirrus snd_hda_codec_generic ledtrig_audio drm_exec amdxcp gpu_sched xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip6t_rpfilter ipt_rpfilter xt_pkttype xt_LOG nf_log_syslog xt_tcpudp nft_compat nf_tables nfnetlink sch_fq_codel btusb uinput iTCO_wdt ctr btrtl intel_pmc_bxt i915 intel_rapl_msr mei_hdcp mei_pxp joydev at24 watchdog btintel atkbd libps2 serio radeon btbcm vivaldi_fmap btmtk intel_rapl_common snd_hda_codec_hdmi bluetooth uvcvideo nls_iso8859_1 applesmc nls_cp437 x86_pkg_temp_thermal snd_hda_intel intel_powerclamp vfat videobuf2_vmalloc coretemp fat snd_intel_dspcfg crc32_pclmul uvc polyval_clmulni snd_intel_sdw_acpi loop videobuf2_memops snd_hda_codec tun drm_suballoc_helper polyval_generic drm_ttm_helper drm_buddy tap ecdh_generic videobuf2_v4l2 gf128mul macvlan ttm ghash_clmulni_intel ecc tg3
[ +0.000073] videodev bridge snd_hda_core rapl crc16 drm_display_helper cec mousedev snd_hwdep evdev intel_cstate bcm5974 hid_appleir videobuf2_common stp mac_hid libphy snd_pcm drm_kms_helper acpi_als mei_me intel_uncore llc mc snd_timer intel_gtt industrialio_triggered_buffer apple_mfi_fastcharge i2c_i801 mei snd lpc_ich agpgart ptp i2c_smbus thunderbolt apple_gmux i2c_algo_bit kfifo_buf video industrialio soundcore pps_core wmi tiny_power_button sbs sbshc button ac cordic bcma mac80211 cfg80211 ssb rfkill libarc4 kvm_intel kvm drm irqbypass fuse backlight firmware_class efi_pstore configfs efivarfs dmi_sysfs ip_tables x_tables autofs4 dm_crypt cbc encrypted_keys trusted asn1_encoder tee tpm rng_core input_leds hid_apple led_class hid_generic usbhid hid sd_mod t10_pi crc64_rocksoft crc64 crc_t10dif crct10dif_generic ahci libahci libata uhci_hcd ehci_pci ehci_hcd crct10dif_pclmul crct10dif_common sha512_ssse3 sha512_generic sha256_ssse3 sha1_ssse3 aesni_intel usbcore scsi_mod libaes crypto_simd cryptd scsi_common
[ +0.000084] usb_common rtc_cmos btrfs blake2b_generic libcrc32c crc32c_generic crc32c_intel xor raid6_pq dm_snapshot dm_bufio dm_mod dax [last unloaded: b43]
[ +0.000012] CPU: 0 PID: 56077 Comm: kworker/u16:17 Tainted: G W O 6.6.7 #1-NixOS
[ +0.000003] Hardware name: Apple Inc. MacBookPro8,3/Mac-942459F5819B171B, BIOS 87.0.0.0.0 06/13/2019
[ +0.000001] Workqueue: phy7 b43_tx_work [b43]
[ +0.000019] RIP: 0010:__ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000076] Code: 74 11 48 8b 78 08 0f b7 d6 89 e9 4c 89 e6 e8 ab f4 00 00 65 ff 0d 9c b7 34 3f 0f 85 55 ff ff ff 0f 1f 44 00 00 e9 4b ff ff ff <0f> 0b 5b 5d 41 5c 41 5d c3 cc cc cc cc 0f 1f 80 00 00 00 00 90 90
[ +0.000002] RSP: 0000:ffffc90004157d50 EFLAGS: 00010097
[ +0.000002] RAX: 0000000000000001 RBX: 0000000000000002 RCX: 0000000000000000
[ +0.000002] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff8882d65d0900
[ +0.000002] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001
[ +0.000001] R10: 00000000000000ff R11: ffff88814d0155a0 R12: ffff8882d65d0900
[ +0.000002] R13: 0000000000000000 R14: ffff8881002d2800 R15: 00000000000000d0
[ +0.000002] FS: 0000000000000000(0000) GS:ffff88846f800000(0000) knlGS:0000000000000000
[ +0.000003] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ +0.000002] CR2: 00007f2e8c10c880 CR3: 0000000385b66005 CR4: 00000000000606f0
[ +0.000002] Call Trace:
[ +0.000001] <TASK>
[ +0.000001] ? __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000075] ? __warn+0x81/0x130
[ +0.000004] ? __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000075] ? report_bug+0x171/0x1a0
[ +0.000005] ? handle_bug+0x41/0x70
[ +0.000003] ? exc_invalid_op+0x17/0x70
[ +0.000004] ? asm_exc_invalid_op+0x1a/0x20
[ +0.000004] ? __ieee80211_stop_queue+0xcc/0xe0 [mac80211]
[ +0.000076] ieee80211_stop_queue+0x36/0x50 [mac80211]
[ +0.000077] b43_dma_tx+0x550/0x780 [b43]
[ +0.000023] b43_tx_work+0x90/0x130 [b43]
[ +0.000018] process_one_work+0x174/0x340
[ +0.000003] worker_thread+0x27b/0x3a0
[ +0.000004] ? __pfx_worker_thread+0x10/0x10
[ +0.000002] kthread+0xe8/0x120
[ +0.000003] ? __pfx_kthread+0x10/0x10
[ +0.000004] ret_from_fork+0x34/0x50
[ +0.000002] ? __pfx_kthread+0x10/0x10
[ +0.000003] ret_from_fork_asm+0x1b/0x30
[ +0.000006] </TASK>
[ +0.000001] ---[ end trace 0000000000000000 ]------ drivers/net/wireless/broadcom/b43/b43.h | 16 ++++++++++++++++ drivers/net/wireless/broadcom/b43/dma.c | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/b43/b43.h +16 -0
@@ -1082,6 +1082,22 @@ static inline bool b43_using_pio_transfers(struct b43_wldev *dev)return dev->__using_pio_transfers; } +static inline void b43_wake_queue (struct b43_wldev *dev,int queue_prio) +{ +if (dev->qos_enabled) +ieee80211_wake_queue (dev->wl->hw, queue_prio); +else +ieee80211_wake_queue (dev->wl->hw,0 ); +} + +static inline void b43_stop_queue (struct b43_wldev *dev,int queue_prio) +{ +if (dev->qos_enabled) +ieee80211_stop_queue (dev->wl->hw, queue_prio); +else +ieee80211_stop_queue (dev->wl->hw,0 ); +} +/* Message printing */ __printf(2, 3) void b43info(struct b43_wl *wl, const char *fmt, ...); __printf(2, 3) void b43err(struct b43_wl *wl, const char *fmt, ...);
drivers/net/wireless/broadcom/b43/dma.c +2 -2
@@ -1399,7 +1399,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb) should_inject_overflow(ring)) {/* This TX ring is full. */ unsigned int skb_mapping =skb_get_queue_mapping (skb); -ieee80211_stop_queue (dev->wl->hw, skb_mapping); +b43_stop_queue (dev, skb_mapping); dev->wl->tx_queue_stopped[skb_mapping] = true; ring->stopped = true;if (b43_debug (dev,B43_DBG_DMAVERBOSE )) {
@@ -1570,7 +1570,7 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev, }else {/* If the driver queue is running wake the corresponding * mac80211 queue. */ -ieee80211_wake_queue (dev->wl->hw, ring->queue_prio); +b43_wake_queue (dev, ring->queue_prio);if (b43_debug (dev,B43_DBG_DMAVERBOSE )) {b43dbg (dev->wl,"Woke up TX ring %d\n" , ring->index); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 57/715 wifi: b43: Stop/wake correct queue in PIO Tx path when QoS is disabled
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 77135a38f6c2f950d2306ac3d37cbb407e6243f2 ]
When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop/wake queue 0 when QoS is disabled to prevent trying to stop/wake a non-existent queue and failing to stop/wake the actual queue instantiated.
--- drivers/net/wireless/broadcom/b43/pio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/broadcom/b43/pio.c +3 -3
@@ -525,7 +525,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)if (total_len > (q->buffer_size - q->buffer_used)) {/* Not enough memory on the queue. */ err = -EBUSY ; -ieee80211_stop_queue (dev->wl->hw,skb_get_queue_mapping (skb)); +b43_stop_queue (dev,skb_get_queue_mapping (skb)); q->stopped = true; goto out; }
@@ -552,7 +552,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)if (((q->buffer_size - q->buffer_used) <roundup (2 +2 +6 ,4 )) || (q->free_packet_slots ==0 )) {/* The queue is full. */ -ieee80211_stop_queue (dev->wl->hw,skb_get_queue_mapping (skb)); +b43_stop_queue (dev,skb_get_queue_mapping (skb)); q->stopped = true; }
@@ -587,7 +587,7 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev,list_add (&pack->list, &q->packets_list);if (q->stopped) { -ieee80211_wake_queue (dev->wl->hw, q->queue_prio); +b43_wake_queue (dev, q->queue_prio); q->stopped = false; } }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 58/715 wifi: b43: Stop correct queue in DMA worker when QoS is disabled
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 581c8967d66c4961076dbbee356834e9c6777184 ]
When QoS is disabled, the queue priority value will not map to the correct ieee80211 queue since there is only one queue. Stop queue 0 when QoS is disabled to prevent trying to stop a non-existent queue and failing to stop the actual queue instantiated.
--- drivers/net/wireless/broadcom/b43/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/b43/main.c +7 -6
@@ -3603,7 +3603,7 @@ static void b43_tx_work(struct work_struct *work) err =b43_dma_tx (dev, skb);if (err == -ENOSPC ) { wl->tx_queue_stopped[queue_num] = true; -ieee80211_stop_queue (wl->hw, queue_num); +b43_stop_queue (dev, queue_num);skb_queue_head (&wl->tx_queue[queue_num], skb);break ; }
@@ -3627,6 +3627,7 @@ static void b43_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) {struct b43_wl *wl =hw_to_b43_wl (hw); +u16 skb_queue_mapping;if (unlikely (skb->len <2 +2 +6 )) {/* Too short, this can't be a valid frame. */
@@ -3635,12 +3636,12 @@ static void b43_op_tx(struct ieee80211_hw *hw, }B43_WARN_ON (skb_shinfo (skb)->nr_frags); -skb_queue_tail (&wl->tx_queue[skb->queue_mapping], skb); -if (!wl->tx_queue_stopped[skb->queue_mapping]) { + skb_queue_mapping =skb_get_queue_mapping (skb); +skb_queue_tail (&wl->tx_queue[skb_queue_mapping], skb); +if (!wl->tx_queue_stopped[skb_queue_mapping])ieee80211_queue_work (wl->hw, &wl->tx_work); - }else { -ieee80211_stop_queue (wl->hw, skb->queue_mapping); - } +else +b43_stop_queue (wl->current_dev, skb_queue_mapping); } static void b43_qos_params_upload(struct b43_wldev *dev,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 59/715 wifi: b43: Disable QoS for bcm4331
In reply to Sasha LevinFrom: Rahul Rameshbabu <[email protected]>
[ Upstream commit 09795bded2e725443fe4a4803cae2079cdaf7b26 ]
bcm4331 seems to not function correctly with QoS support. This may be due to issues with currently available firmware or potentially a device specific issue.
When queues that are not of the default "best effort" priority are selected, traffic appears to not transmit out of the hardware while no errors are returned. This behavior is present among all the other priority
queues: video, voice, and background. While this can be worked around by setting a kernel parameter, the default behavior is problematic for most users and may be difficult to debug. This patch offers a working out-of-box experience for bcm4331 users.
Log of the issue (using ssh low-priority traffic as an example):
ssh -T -vvvv [email protected]
OpenSSH_9.6p1, OpenSSL 3.0.12 24 Oct 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: checking match for 'host * exec "/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0rypm7sh1i8js8w-gnupg-2.4.1/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null 2>&1'"' host github.com originally github.com
debug3: /etc/ssh/ssh_config line 5: matched 'host "github.com"'
debug1: Executing command: '/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0rypm7sh1i8js8w-gnupg-2.4.1/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null 2>&1''
debug3: command returned status 0
debug3: /etc/ssh/ssh_config line 5: matched 'exec "/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0r"'
debug2: match found
debug1: /etc/ssh/ssh_config line 9: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/binary-eater/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/binary-eater/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: channel_clear_timeouts: clearing
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [192.30.255.113] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
--- drivers/net/wireless/broadcom/b43/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/b43/main.c +2 -1
@@ -2587,7 +2587,8 @@ static void b43_request_firmware(struct work_struct *work) start_ieee80211: wl->hw->queues =B43_QOS_QUEUE_NUM ; -if (!modparam_qos || dev->fw.opensource) +if (!modparam_qos || dev->fw.opensource || + dev->dev->chip_id ==BCMA_CHIP_ID_BCM4331 ) wl->hw->queues =1 ; err =ieee80211_register_hw (wl->hw);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 60/715 wifi: wilc1000: fix declarations ordering
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit 535733e90e5d8912ebeccebb05b354a2d06ff459 ]
Reorder parameters declaration in wilc_parse_join_bss_param to enforce reverse christmas tree
Stable-dep-of: 205c50306acf ("wifi: wilc1000: fix RCU usage in connect path")
--- drivers/net/wireless/microchip/wilc1000/hif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/microchip/wilc1000/hif.c +4 -4
@@ -377,13 +377,13 @@ struct wilc_join_bss_param * wilc_parse_join_bss_param(struct cfg80211_bss *bss, struct cfg80211_crypto_settings *crypto) { - struct wilc_join_bss_param *param; -struct ieee80211_p2p_noa_attr noa_attr; -u8 rates_len =0 ; + const struct cfg80211_bss_ies *ies = rcu_dereference(bss->ies);const u8 *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie;const u8 *ht_ie, *wpa_ie, *wmm_ie, *rsn_ie; +struct ieee80211_p2p_noa_attr noa_attr; +struct wilc_join_bss_param *param; +u8 rates_len =0 ;int ret; -const struct cfg80211_bss_ies *ies =rcu_dereference (bss->ies); param =kzalloc (sizeof (*param),GFP_KERNEL );if (!param)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 61/715 wifi: wilc1000: fix RCU usage in connect path
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit 205c50306acf58a335eb19fa84e40140f4fe814f ]
With lockdep enabled, calls to the connect function from cfg802.11 layer lead to the following warning:
=============================
WARNING: suspicious RCU usage
6.7.0-rc1-wt+ #333 Not tainted
-----------------------------drivers/net/wireless/microchip/wilc1000/hif.c:386
suspicious rcu_dereference_check() usage!
[...]
stack backtrace: CPU: 0 PID: 100 Comm: wpa_supplicant Not tainted 6.7.0-rc1-wt+ #333 Hardware name: Atmel SAMA5 unwind_backtrace from show_stack+0x18/0x1c show_stack from dump_stack_lvl+0x34/0x48 dump_stack_lvl from wilc_parse_join_bss_param+0x7dc/0x7f4 wilc_parse_join_bss_param from connect+0x2c4/0x648 connect from cfg80211_connect+0x30c/0xb74 cfg80211_connect from nl80211_connect+0x860/0xa94 nl80211_connect from genl_rcv_msg+0x3fc/0x59c genl_rcv_msg from netlink_rcv_skb+0xd0/0x1f8 netlink_rcv_skb from genl_rcv+0x2c/0x3c genl_rcv from netlink_unicast+0x3b0/0x550 netlink_unicast from netlink_sendmsg+0x368/0x688 netlink_sendmsg from ____sys_sendmsg+0x190/0x430 ____sys_sendmsg from ___sys_sendmsg+0x110/0x158 ___sys_sendmsg from sys_sendmsg+0xe8/0x150 sys_sendmsg from ret_fast_syscall+0x0/0x1c
This warning is emitted because in the connect path, when trying to parse target BSS parameters, we dereference a RCU pointer whithout being in RCU critical section.
Fix RCU dereference usage by moving it to a RCU read critical section. To avoid wrapping the whole wilc_parse_join_bss_param under the critical section, just use the critical section to copy ies data
--- drivers/net/wireless/microchip/wilc1000/hif.c | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-)
drivers/net/wireless/microchip/wilc1000/hif.c +24 -12
@@ -377,38 +377,49 @@ struct wilc_join_bss_param * wilc_parse_join_bss_param(struct cfg80211_bss *bss, struct cfg80211_crypto_settings *crypto) { - const struct cfg80211_bss_ies *ies = rcu_dereference(bss->ies); -const u8 *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie; + const u8 *ies_data, *tim_elm, *ssid_elm, *rates_ie, *supp_rates_ie;const u8 *ht_ie, *wpa_ie, *wmm_ie, *rsn_ie;struct ieee80211_p2p_noa_attr noa_attr; +const struct cfg80211_bss_ies *ies;struct wilc_join_bss_param *param; -u8 rates_len =0 ; +u8 rates_len =0 , ies_len;int ret; param =kzalloc (sizeof (*param),GFP_KERNEL );if (!param)return NULL ; +rcu_read_lock (); + ies =rcu_dereference (bss->ies); + ies_data =kmemdup (ies->data, ies->len,GFP_ATOMIC ); +if (!ies_data) { +rcu_read_unlock (); +kfree (param); +return NULL ; + } + ies_len = ies->len; +rcu_read_unlock (); + param->beacon_period =cpu_to_le16 (bss->beacon_interval); param->cap_info =cpu_to_le16 (bss->capability); param->bss_type =WILC_FW_BSS_TYPE_INFRA ; param->ch =ieee80211_frequency_to_channel (bss->channel->center_freq);ether_addr_copy (param->bssid, bss->bssid); - ssid_elm =cfg80211_find_ie (WLAN_EID_SSID , ies->data, ies->len); + ssid_elm =cfg80211_find_ie (WLAN_EID_SSID , ies_data, ies_len);if (ssid_elm) {if (ssid_elm[1 ] <=IEEE80211_MAX_SSID_LEN )memcpy (param->ssid, ssid_elm +2 , ssid_elm[1 ]); } - tim_elm =cfg80211_find_ie (WLAN_EID_TIM , ies->data, ies->len); + tim_elm =cfg80211_find_ie (WLAN_EID_TIM , ies_data, ies_len);if (tim_elm && tim_elm[1 ] >=2 ) param->dtim_period = tim_elm[3 ];memset (param->p_suites,0xFF ,3 );memset (param->akm_suites,0xFF ,3 ); - rates_ie =cfg80211_find_ie (WLAN_EID_SUPP_RATES , ies->data, ies->len); + rates_ie =cfg80211_find_ie (WLAN_EID_SUPP_RATES , ies_data, ies_len);if (rates_ie) { rates_len = rates_ie[1 ];if (rates_len >WILC_MAX_RATES_SUPPORTED )
@@ -419,7 +430,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss,if (rates_len <WILC_MAX_RATES_SUPPORTED ) { supp_rates_ie =cfg80211_find_ie (WLAN_EID_EXT_SUPP_RATES , - ies->data, ies->len); + ies_data, ies_len);if (supp_rates_ie) {u8 ext_rates = supp_rates_ie[1 ];
@@ -434,11 +445,11 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, } } - ht_ie =cfg80211_find_ie (WLAN_EID_HT_CAPABILITY , ies->data, ies->len); + ht_ie =cfg80211_find_ie (WLAN_EID_HT_CAPABILITY , ies_data, ies_len);if (ht_ie) param->ht_capable = true; - ret =cfg80211_get_p2p_attr (ies->data, ies->len, + ret =cfg80211_get_p2p_attr (ies_data, ies_len,IEEE80211_P2P_ATTR_ABSENCE_NOTICE , (u8 *)&noa_attr,sizeof (noa_attr));if (ret >0 ) {
@@ -462,7 +473,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, } wmm_ie =cfg80211_find_vendor_ie (WLAN_OUI_MICROSOFT ,WLAN_OUI_TYPE_MICROSOFT_WMM , - ies->data, ies->len); + ies_data, ies_len);if (wmm_ie) {struct ieee80211_wmm_param_ie *ie;
@@ -477,13 +488,13 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, wpa_ie =cfg80211_find_vendor_ie (WLAN_OUI_MICROSOFT ,WLAN_OUI_TYPE_MICROSOFT_WPA , - ies->data, ies->len); + ies_data, ies_len);if (wpa_ie) { param->mode_802_11i =1 ; param->rsn_found = true; } - rsn_ie =cfg80211_find_ie (WLAN_EID_RSN , ies->data, ies->len); + rsn_ie =cfg80211_find_ie (WLAN_EID_RSN , ies_data, ies_len);if (rsn_ie) {int rsn_ie_len =sizeof (struct element ) + rsn_ie[1 ];int offset =8 ;
@@ -517,6 +528,7 @@ wilc_parse_join_bss_param(struct cfg80211_bss *bss, param->akm_suites[i] = crypto->akm_suites[i] &0xFF ; } +kfree (ies_data);return (void *)param; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 62/715 wifi: ath11k: add support to select 6 GHz regulatory type
In reply to Sasha LevinFrom: Wen Gong <[email protected]>
[ Upstream commit e3d373ec4f02bf41379d91707e3e3f2a46464cd7 ]
There are 3 types of regulatory rules for AP mode and 6 type for station mode. Add wmi_vdev_type and ieee80211_ap_reg_power to select the exact reg rules.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
Stable-dep-of: cf2df0080bd5 ("wifi: ath11k: fix a possible dead lock caused by ab->base_lock")
--- drivers/net/wireless/ath/ath11k/reg.c | 70 +++++++++++++++++++++------ drivers/net/wireless/ath/ath11k/reg.h | 6 ++- drivers/net/wireless/ath/ath11k/wmi.c | 3 +- 3 files changed, 62 insertions(+), 17 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +55 -15
@@ -618,25 +618,68 @@ ath11k_reg_update_weather_radar_band(struct ath11k_base *ab, *rule_idx = i; } +enum wmi_reg_6ghz_ap_type +ath11k_reg_ap_pwr_convert (enum ieee80211_ap_reg_power power_type) +{ +switch (power_type) { +case IEEE80211_REG_LPI_AP : +return WMI_REG_INDOOR_AP ; +case IEEE80211_REG_SP_AP : +return WMI_REG_STANDARD_POWER_AP ; +case IEEE80211_REG_VLP_AP : +return WMI_REG_VERY_LOW_POWER_AP ; +default : +return WMI_REG_MAX_AP_TYPE ; + } +} +struct ieee80211_regdomain *ath11k_reg_build_regd (struct ath11k_base *ab, -struct cur_regulatory_info *reg_info,bool intersect) +struct cur_regulatory_info *reg_info,bool intersect, +enum wmi_vdev_type vdev_type, +enum ieee80211_ap_reg_power power_type) {struct ieee80211_regdomain *tmp_regd, *default_regd, *new_regd =NULL ; -struct cur_reg_rule *reg_rule; +struct cur_reg_rule *reg_rule, *reg_rule_6ghz;u8 i =0 , j =0 , k =0 ;u8 num_rules;u16 max_bw; -u32 flags; +u32 flags, reg_6ghz_number, max_bw_6ghz;char alpha2[3 ]; num_rules = reg_info->num_5ghz_reg_rules + reg_info->num_2ghz_reg_rules; -/* FIXME: Currently taking reg rules for 6 GHz only from Indoor AP mode list. -* This can be updated after complete 6 GHz regulatory support is added. -*/ -if (reg_info->is_ext_reg_event) - num_rules += reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP ]; +if (reg_info->is_ext_reg_event) { +if (vdev_type ==WMI_VDEV_TYPE_STA ) { +enum wmi_reg_6ghz_ap_type ap_type; + + ap_type =ath11k_reg_ap_pwr_convert (power_type); + +if (ap_type ==WMI_REG_MAX_AP_TYPE ) + ap_type =WMI_REG_INDOOR_AP ; + + reg_6ghz_number = reg_info->num_6ghz_rules_client + [ap_type][WMI_REG_DEFAULT_CLIENT ]; + +if (reg_6ghz_number ==0 ) { + ap_type =WMI_REG_INDOOR_AP ; + reg_6ghz_number = reg_info->num_6ghz_rules_client + [ap_type][WMI_REG_DEFAULT_CLIENT ]; + } + + reg_rule_6ghz = reg_info->reg_rules_6ghz_client_ptr + [ap_type][WMI_REG_DEFAULT_CLIENT ]; + max_bw_6ghz = reg_info->max_bw_6ghz_client + [ap_type][WMI_REG_DEFAULT_CLIENT ]; + }else { + reg_6ghz_number = reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP ]; + reg_rule_6ghz = + reg_info->reg_rules_6ghz_ap_ptr[WMI_REG_INDOOR_AP ]; + max_bw_6ghz = reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP ]; + } + + num_rules += reg_6ghz_number; + }if (!num_rules) goto ret;
@@ -683,13 +726,10 @@ ath11k_reg_build_regd(struct ath11k_base *ab,* per other BW rule flags we pass from here */ flags =NL80211_RRF_AUTO_BW ; - }else if (reg_info->is_ext_reg_event && - reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP ] && - (k < reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP ])) { - reg_rule = reg_info->reg_rules_6ghz_ap_ptr[WMI_REG_INDOOR_AP ] + - k++; - max_bw =min_t (u16, reg_rule->max_bw, - reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP ]); + }else if (reg_info->is_ext_reg_event && reg_6ghz_number && + k < reg_6ghz_number) { + reg_rule = reg_rule_6ghz + k++; + max_bw =min_t (u16, reg_rule->max_bw, max_bw_6ghz); flags =NL80211_RRF_AUTO_BW ; }else {break ;
drivers/net/wireless/ath/ath11k/reg.h +5 -1
@@ -34,7 +34,11 @@ void ath11k_reg_free(struct ath11k_base *ab);void ath11k_regd_update_work (struct work_struct *work);struct ieee80211_regdomain *ath11k_reg_build_regd (struct ath11k_base *ab, -struct cur_regulatory_info *reg_info,bool intersect); +struct cur_regulatory_info *reg_info,bool intersect, +enum wmi_vdev_type vdev_type, +enum ieee80211_ap_reg_power power_type);int ath11k_regd_update (struct ath11k *ar);int ath11k_reg_update_chan_list (struct ath11k *ar,bool wait); +enum wmi_reg_6ghz_ap_type +ath11k_reg_ap_pwr_convert (enum ieee80211_ap_reg_power power_type);#endif
drivers/net/wireless/ath/ath11k/wmi.c +2 -1
@@ -7151,7 +7151,8 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, !ath11k_reg_is_world_alpha((char *)reg_info->alpha2)) intersect = true; - regd =ath11k_reg_build_regd (ab, reg_info, intersect); + regd =ath11k_reg_build_regd (ab, reg_info, intersect, +WMI_VDEV_TYPE_AP ,IEEE80211_REG_LPI_AP );if (!regd) {ath11k_warn (ab,"failed to build regd from reg_info\n" ); goto fallback;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 63/715 wifi: ath11k: store cur_regulatory_info for each radio
In reply to Sasha LevinFrom: Wen Gong <[email protected]>
[ Upstream commit 7004bdceef605e5c1c5ab4aaf282002ad7523ddd ]
The regulatory info of WMI_REG_CHAN_LIST_CC_EXT_EVENTID is not saved in ath11k now, the info should be saved in ath11k. Save the info for each radio and support switch regulatory rules dynamically.
As mac.c will also call ath11k_reg_handle_chan_list() in next patches move the function to reg.c.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
Stable-dep-of: cf2df0080bd5 ("wifi: ath11k: fix a possible dead lock caused by ab->base_lock")
--- drivers/net/wireless/ath/ath11k/core.h | 1 + drivers/net/wireless/ath/ath11k/reg.c | 179 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/reg.h | 5 + drivers/net/wireless/ath/ath11k/wmi.c | 148 +++----------------- drivers/net/wireless/ath/ath11k/wmi.h | 1 + 5 files changed, 207 insertions(+), 127 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +1 -0
@@ -918,6 +918,7 @@ struct ath11k_base {* This may or may not be used during the runtime */ struct ieee80211_regdomain *new_regd[MAX_RADIOS ]; +struct cur_regulatory_info *reg_info_store;/* Current DFS Regulatory */ enum ath11k_dfs_region dfs_region;
drivers/net/wireless/ath/ath11k/reg.c +179 -0
195 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/reg.h +5 -0
@@ -30,6 +30,7 @@ enum ath11k_dfs_region {/* ATH11K Regulatory API's */ void ath11k_reg_init (struct ath11k *ar); +void ath11k_reg_reset_info (struct cur_regulatory_info *reg_info);void ath11k_reg_free (struct ath11k_base *ab);void ath11k_regd_update_work (struct work_struct *work); struct ieee80211_regdomain *
@@ -41,4 +42,8 @@ int ath11k_regd_update(struct ath11k *ar);int ath11k_reg_update_chan_list (struct ath11k *ar,bool wait);enum wmi_reg_6ghz_ap_type ath11k_reg_ap_pwr_convert (enum ieee80211_ap_reg_power power_type); +int ath11k_reg_handle_chan_list (struct ath11k_base *ab, +struct cur_regulatory_info *reg_info, +enum ieee80211_ap_reg_power power_type); +#endif
drivers/net/wireless/ath/ath11k/wmi.c +21 -127
178 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/wmi.h +1 -0
@@ -4951,6 +4951,7 @@ struct ath11k_targ_cap { };enum wmi_vdev_type { +WMI_VDEV_TYPE_UNSPEC =0 ,WMI_VDEV_TYPE_AP =1 ,WMI_VDEV_TYPE_STA =2 ,WMI_VDEV_TYPE_IBSS =3 ,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 64/715 wifi: ath11k: fix a possible dead lock caused by ab->base_lock
In reply to Sasha LevinFrom: Baochen Qiang <[email protected]>
[ Upstream commit cf2df0080bd59cb97a1519ddefaf59788febdaa5 ]
spin_lock()/spin_unlock() are used in ath11k_reg_chan_list_event() to acquire/release ab->base_lock. For now this is safe because that function is only called in soft IRQ context.
But ath11k_reg_chan_list_event() will be called from process context in an upcoming patch, and this can result in a deadlock if ab->base_lock is acquired in process context and then soft IRQ occurs on the same CPU and tries to acquire that lock.
Fix it by using spin_lock_bh() and spin_unlock_bh() instead.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/reg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/reg.c +5 -5
@@ -852,13 +852,13 @@ int ath11k_reg_handle_chan_list(struct ath11k_base *ab,/* Avoid default reg rule updates sent during FW recovery if * it is already available */ -spin_lock (&ab->base_lock); +spin_lock_bh (&ab->base_lock);if (test_bit (ATH11K_FLAG_RECOVERY , &ab->dev_flags) && ab->default_regd[pdev_idx]) { -spin_unlock (&ab->base_lock); +spin_unlock_bh (&ab->base_lock); goto retfail; } -spin_unlock (&ab->base_lock); +spin_unlock_bh (&ab->base_lock);if (pdev_idx >= ab->num_radios) {/* Process the event for phy0 only if single_pdev_only
@@ -911,7 +911,7 @@ int ath11k_reg_handle_chan_list(struct ath11k_base *ab, ab->reg_info_store[pdev_idx] = *reg_info; } -spin_lock (&ab->base_lock); +spin_lock_bh (&ab->base_lock);if (ab->default_regd[pdev_idx]) {/* The initial rules from FW after WMI Init is to build * the default regd. From then on, any rules updated for
@@ -931,7 +931,7 @@ int ath11k_reg_handle_chan_list(struct ath11k_base *ab, ab->default_regd[pdev_idx] = regd; } ab->dfs_region = reg_info->dfs_region; -spin_unlock (&ab->base_lock); +spin_unlock_bh (&ab->base_lock);return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 65/715 wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work
In reply to Sasha LevinFrom: Martin Kaistra <[email protected]>
[ Upstream commit 1213acb478a7181cd73eeaf00db430f1e45b1361 ]
The workqueue might still be running, when the driver is stopped. To avoid a use-after-free, call cancel_work_sync() in rtl8xxxu_stop().
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -0
@@ -7304,6 +7304,7 @@ static void rtl8xxxu_stop(struct ieee80211_hw *hw)if (priv->usb_interrupts)rtl8xxxu_write32 (priv,REG_USB_HIMR ,0 ); +cancel_work_sync (&priv->c2hcmd_work);cancel_delayed_work_sync (&priv->ra_watchdog);rtl8xxxu_free_rx_resources (priv);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 66/715 wifi: wilc1000: do not realloc workqueue everytime an interface is added
In reply to Sasha LevinFrom: Ajay Singh <[email protected]>
[ Upstream commit 328efda22af81130c2ad981c110518cb29ff2f1d ]
Commit 09ed8bfc5215 ("wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq"") moved workqueue creation in wilc_netdev_ifc_init in order to set the interface name in the workqueue name. However, while the driver needs only one workqueue, the wilc_netdev_ifc_init is called each time we add an interface over a phy, which in turns overwrite the workqueue with a new one. This can be observed with the following commands:
for i in $(seq 0 10)
do
iw phy phy0 interface add wlan1 type managed
iw dev wlan1 del
done
ps -eo pid,comm|grep wlan
39 kworker/R-wlan0
98 kworker/R-wlan1
102 kworker/R-wlan1
105 kworker/R-wlan1
108 kworker/R-wlan1
111 kworker/R-wlan1
114 kworker/R-wlan1
117 kworker/R-wlan1
120 kworker/R-wlan1
123 kworker/R-wlan1
126 kworker/R-wlan1
129 kworker/R-wlan1
Fix this leakage by putting back hif_workqueue allocation in wilc_cfg80211_init. Regarding the workqueue name, it is indeed relevant to set it lowercase, however it is not attached to a specific netdev, so enforcing netdev name in the name is not so relevant. Still, enrich the name with the wiphy name to make it clear which phy is using the workqueue.
--- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 11 ++++++++++- drivers/net/wireless/microchip/wilc1000/netdev.c | 10 +--------- 2 files changed, 11 insertions(+), 10 deletions(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +10 -1
@@ -1804,15 +1804,24 @@ int wilc_cfg80211_init(struct wilc **wilc, struct device *dev, int io_type,INIT_LIST_HEAD (&wl->rxq_head.list);INIT_LIST_HEAD (&wl->vif_list); + wl->hif_workqueue =alloc_ordered_workqueue ("%s" ,WQ_MEM_RECLAIM , +wiphy_name (wl->wiphy)); +if (!wl->hif_workqueue) { + ret = -ENOMEM ; + goto free_cfg; + } vif =wilc_netdev_ifc_init (wl,"wlan%d" ,WILC_STATION_MODE ,NL80211_IFTYPE_STATION , false);if (IS_ERR (vif)) { ret =PTR_ERR (vif); - goto free_cfg; + goto free_hq; }return 0 ; +free_hq: +destroy_workqueue (wl->hif_workqueue); + free_cfg:wilc_wlan_cfg_deinit (wl);
drivers/net/wireless/microchip/wilc1000/netdev.c +1 -9
@@ -989,13 +989,6 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, goto error; } - wl->hif_workqueue =alloc_ordered_workqueue ("%s-wq" ,WQ_MEM_RECLAIM , - ndev->name); -if (!wl->hif_workqueue) { - ret = -ENOMEM ; - goto unregister_netdev; - } - ndev->needs_free_netdev = true; vif->iftype = vif_type; vif->idx =wilc_get_available_idx (wl);
@@ -1008,12 +1001,11 @@ struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,return vif; -unregister_netdev: +error:if (rtnl_locked)cfg80211_unregister_netdevice (ndev);else unregister_netdev (ndev); - error:free_netdev (ndev);return ERR_PTR (ret); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 67/715 wifi: wilc1000: fix multi-vif management when deleting a vif
In reply to Sasha LevinFrom: Ajay Singh <[email protected]>
[ Upstream commit 12cfc9c8d3faf887a202c89bc312202445fca7e8 ]
Adding then removing a second vif currently makes the first vif not working anymore. This is visible for example when we have a first interface connected to some access point:
- create a wpa_supplicant.conf with some AP credentials
- wpa_supplicant -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan0
- dhclient wlan0
- iw phy phy0 interface add wlan1 type managed
- iw dev wlan1 del
wlan0 does not manage properly traffic anymore (eg: ping not working)
This is due to vif mode being incorrectly reconfigured with some default values in del_virtual_intf, affecting by default first vif.
Prevent first vif from being affected on second vif removal by removing vif mode change command in del_virtual_intf
--- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +0 -1
@@ -1609,7 +1609,6 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)cfg80211_unregister_netdevice (vif->ndev); vif->monitor_flag =0 ; -wilc_set_operation_mode (vif,0 ,0 ,0 );mutex_lock (&wl->vif_mutex);list_del_rcu (&vif->list); wl->vif_num--;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 68/715 wifi: mwifiex: debugfs: Drop unnecessary error check for debugfs_create_dir()
In reply to Sasha LevinFrom: Jinjie Ruan <[email protected]>
[ Upstream commit 50180c7f8e3de7c2d87f619131776598fcb1478d ]
debugfs_create_dir() returns ERR_PTR and never return NULL.
As Russell suggested, this patch removes the error checking for debugfs_create_dir(). This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary.
--- drivers/net/wireless/marvell/mwifiex/debugfs.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/marvell/mwifiex/debugfs.c +0 -3
@@ -970,9 +970,6 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv) priv->dfs_dev_dir =debugfs_create_dir (priv->netdev->name, mwifiex_dfs_dir); -if (!priv->dfs_dev_dir) -return ; -MWIFIEX_DFS_ADD_FILE (info);MWIFIEX_DFS_ADD_FILE (debug);MWIFIEX_DFS_ADD_FILE (getlog);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 69/715 ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 090c4094574705b0afc7d37825cdc5d06f0e7e02 ]
External clocks should be defined as zero-Hz clocks in the SoC .dtsi, and overridden in the board .dts when present.
Correct the clock rate of extal1 from 25 to 26 MHz, to match the crystal oscillator present on the APE6-EVM board.
--- arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts | 12 ++++++++++++ arch/arm/boot/dts/renesas/r8a73a4.dtsi | 9 ++++++--- 2 files changed, 18 insertions(+), 3 deletions(-)
arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts +12 -0
@@ -209,6 +209,18 @@ &cmt1 { status = "okay"; }; +&extal1_clk { + clock-frequency = <26000000>; +}; + +&extal2_clk { + clock-frequency = <48000000>; +}; + +&extalr_clk { + clock-frequency = <32768>; +}; + &pfc { scifa0_pins: scifa0 { groups = "scifa0_data";
arch/arm/boot/dts/renesas/r8a73a4.dtsi +6 -3
@@ -450,17 +450,20 @@ clocks { extalr_clk: extalr { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <32768>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; extal1_clk: extal1 { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <25000000>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; extal2_clk: extal2 { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <48000000>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; fsiack_clk: fsiack { compatible = "fixed-clock";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 70/715 arm64: dts: qcom: x1e80100: drop qcom,drv-count
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit e81e86765f957f3c5d48df9e275c527bd8c14156 ]
Property qcom,drv-count in the RSC node is not allowed and not used:
x1e80100-crd.dtb: rsc@17500000: 'qcom,drv-count' does not match any of the regexes: '^regulators(-[0-9])?$', 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/x1e80100.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/qcom/x1e80100.dtsi +0 -1
@@ -3315,7 +3315,6 @@ apps_rsc: rsc@17500000 { <0 0x17510000 0 0x10000>, <0 0x17520000 0 0x10000>; reg-names = "drv-0", "drv-1", "drv-2"; - qcom,drv-count = <3>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 71/715 arm64: dts: qcom: sc8180x: Hook up VDD_CX as GCC parent domain
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 3c58b96df110a80e78fa36ef928f1e6c375008e3 ]
Most of GCC is powered by the CX rail. Describe that relationship to let the performance state requests trickle up the chain.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -0
@@ -782,6 +782,7 @@ gcc: clock-controller@100000 { clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; + power-domains = <&rpmhpd SC8180X_CX>; }; qupv3_id_0: geniqup@8c0000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 72/715 arm64: dts: qcom: sc8180x: Fix up big CPU idle state entry latency
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 266a3a92044b89c392b3e9cfcc328d4167c18294 ]
The entry latency was oddly low.. Turns out somebody forgot about a second '1'! Fix it.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -1
@@ -290,7 +290,7 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { BIG_CPU_SLEEP_0: cpu-sleep-1-0 { compatible = "arm,idle-state"; arm,psci-suspend-param = <0x40000004>; - entry-latency-us = <241>; + entry-latency-us = <2411>; exit-latency-us = <1461>; min-residency-us = <4488>; local-timer-stop;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 73/715 arm64: dts: qcom: sc8180x: Add missing CPU off state
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 07b600dfdfea65d58dd80ea25becd8cff69bfafc ]
The CPUs can be powered off without pulling the plug from the rest of the system. Describe the idle state responsible for this.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +10 -2
@@ -298,7 +298,15 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 { }; domain-idle-states { - CLUSTER_SLEEP_0: cluster-sleep-0 { + CLUSTER_SLEEP_APSS_OFF: cluster-sleep-0 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x41000044>; + entry-latency-us = <3300>; + exit-latency-us = <3300>; + min-residency-us = <6000>; + }; + + CLUSTER_SLEEP_AOSS_SLEEP: cluster-sleep-1 { compatible = "domain-idle-state"; arm,psci-suspend-param = <0x4100a344>; entry-latency-us = <3263>;
@@ -582,7 +590,7 @@ CPU_PD7: power-domain-cpu7 { CLUSTER_PD: power-domain-cpu-cluster0 { #power-domain-cells = <0>; - domain-idle-states = <&CLUSTER_SLEEP_0>; + domain-idle-states = <&CLUSTER_SLEEP_APSS_OFF &CLUSTER_SLEEP_AOSS_SLEEP>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 74/715 arm64: dts: qcom: sc8180x: Fix eDP PHY power-domains
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 24e98cb3d5e2c86565680e00008a794b4eac0040 ]
The (e)DP PHYs are powered by the MX line, not through the MDSS GDSC. Fix that up.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -1
@@ -3193,7 +3193,7 @@ edp_phy: phy@aec2a00 { <&dispcc DISP_CC_MDSS_AHB_CLK>; clock-names = "aux", "cfg_ahb"; - power-domains = <&dispcc MDSS_GDSC>; + power-domains = <&rpmhpd SC8180X_MX>; #clock-cells = <1>; #phy-cells = <0>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 75/715 arm64: dts: qcom: sc8180x: Don't hold MDP core clock at FMAX
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 309b5774f45aafd002efdb2656673542419abd6f ]
There's an OPP table to handle this, drop the permanent vote.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +2 -4
@@ -2732,10 +2732,8 @@ mdss_mdp: mdp@ae01000 { "rot", "lut"; - assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>, - <&dispcc DISP_CC_MDSS_VSYNC_CLK>; - assigned-clock-rates = <460000000>, - <19200000>; + assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>; + assigned-clock-rates = <19200000>; operating-points-v2 = <&mdp_opp_table>; power-domains = <&rpmhpd SC8180X_MMCX>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 76/715 arm64: dts: qcom: sc8180x: Require LOW_SVS vote for MMCX if DISPCC is on
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 6d9fb9e4c473cdfd2adca019b46d8e482105cae7 ]
To ensure the PLLs are getting enough power, cast a vote with DISPCC so that MMCX is at least at LOW_SVS.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -0
@@ -3217,6 +3217,7 @@ dispcc: clock-controller@af00000 { "edp_phy_pll_link_clk", "edp_phy_pll_vco_div_clk"; power-domains = <&rpmhpd SC8180X_MMCX>; + required-opps = <&rpmhpd_opp_low_svs>; #clock-cells = <1>; #reset-cells = <1>; #power-domain-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 77/715 arm64: dts: qcom: sc8180x: Add missing CPU<->MDP_CFG path
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit f0cd5a0ebd419bd151ed79baf5f044da797521ac ]
To guarantee the required resources are enabled, describe the interconnect path between the MDSS and the CPU.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +9 -3
@@ -2701,9 +2701,15 @@ mdss: mdss@ae00000 { interrupt-controller; #interrupt-cells = <1>; - interconnects = <&mmss_noc MASTER_MDP_PORT0 0 &mc_virt SLAVE_EBI_CH0 0>, - <&mmss_noc MASTER_MDP_PORT1 0 &mc_virt SLAVE_EBI_CH0 0>; - interconnect-names = "mdp0-mem", "mdp1-mem"; + interconnects = <&mmss_noc MASTER_MDP_PORT0 QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>, + <&mmss_noc MASTER_MDP_PORT1 QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI_CH0 QCOM_ICC_TAG_ALWAYS>, + <&gem_noc MASTER_AMPSS_M0 QCOM_ICC_TAG_ALWAYS + &config_noc SLAVE_DISPLAY_CFG QCOM_ICC_TAG_ALWAYS>; + interconnect-names = "mdp0-mem", + "mdp1-mem", + "cpu-cfg"; iommus = <&apps_smmu 0x800 0x420>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 78/715 arm64: dts: qcom: sc8180x: Shrink aoss_qmp register space size
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit dcad0590d1ea4278a55c30dd2903611a96111601 ]
The AOSS_QMP region is overallocated, bleeding into space that's supposed to be used by other peripherals. Fix it.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +1 -1
@@ -3262,7 +3262,7 @@ tsens1: thermal-sensor@c265000 { aoss_qmp: power-controller@c300000 { compatible = "qcom,sc8180x-aoss-qmp", "qcom,aoss-qmp"; - reg = <0x0 0x0c300000 0x0 0x100000>; + reg = <0x0 0x0c300000 0x0 0x400>; interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>; mboxes = <&apss_shared 0>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 79/715 cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value
In reply to Sasha LevinFrom: Anastasia Belova <[email protected]>
[ Upstream commit f661017e6d326ee187db24194cabb013d81bc2a6 ]
cpufreq_cpu_get may return NULL. To avoid NULL-dereference check it and return 0 in case of error.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/cpufreq/brcmstb-avs-cpufreq.c +2 -0
@@ -481,6 +481,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)static unsigned int brcm_avs_cpufreq_get (unsigned int cpu) {struct cpufreq_policy *policy =cpufreq_cpu_get (cpu); +if (!policy) +return 0 ;struct private_data *priv = policy->driver_data;cpufreq_cpu_put (policy);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 80/715 cpufreq: mediatek-hw: Wait for CPU supplies before probing
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 788715b5f21c6455264fe00a1779e61bec407fe2 ]
Before proceeding with the probe and enabling frequency scaling for the CPUs, make sure that all supplies feeding the CPUs have probed.
This fixes an issue observed on MT8195-Tomato where if the mediatek-cpufreq-hw driver enabled the hardware (by writing to REG_FREQ_ENABLE) before the SPMI controller driver (spmi-mtk-pmif), behind which lies the big CPU supply, probed the platform would hang shortly after with "rcu: INFO: rcu_preempt detected stalls on CPUs/tasks" being printed in the log.
--- drivers/cpufreq/mediatek-cpufreq-hw.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/cpufreq/mediatek-cpufreq-hw.c +18 -1
@@ -13,6 +13,7 @@#include <linux/of.h> #include <linux/of_platform.h> #include <linux/platform_device.h> +#include <linux/regulator/consumer.h> #include <linux/slab.h> #define LUT_MAX_ENTRIES 32U
@@ -300,7 +301,23 @@ static struct cpufreq_driver cpufreq_mtk_hw_driver = {static int mtk_cpufreq_hw_driver_probe (struct platform_device *pdev) {const void *data; -int ret; +int ret, cpu; +struct device *cpu_dev; +struct regulator *cpu_reg; + +/* Make sure that all CPU supplies are available before proceeding. */ +for_each_possible_cpu (cpu) { + cpu_dev =get_cpu_device (cpu); +if (!cpu_dev) +return dev_err_probe (&pdev->dev, -EPROBE_DEFER , +"Failed to get cpu%d device\n" , cpu); + + cpu_reg =devm_regulator_get_optional (cpu_dev,"cpu" ); +if (IS_ERR (cpu_reg)) +return dev_err_probe (&pdev->dev,PTR_ERR (cpu_reg), +"CPU%d regulator get failed\n" , cpu); + } + data =of_device_get_match_data (&pdev->dev);if (!data)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 81/715 sock_diag: annotate data-races around sock_diag_handlers[family]
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit efd402537673f9951992aea4ef0f5ff51d858f4b ]
__sock_diag_cmd() and sock_diag_bind() read sock_diag_handlers[family] without a lock held.
Use READ_ONCE()/WRITE_ONCE() annotations to avoid potential issues.
--- net/core/sock_diag.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/core/sock_diag.c +5 -5
@@ -193,7 +193,7 @@ int sock_diag_register(const struct sock_diag_handler *hndl)if (sock_diag_handlers[hndl->family]) err = -EBUSY ;else - sock_diag_handlers[hndl->family] = hndl; +WRITE_ONCE (sock_diag_handlers[hndl->family], hndl);mutex_unlock (&sock_diag_table_mutex);return err;
@@ -209,7 +209,7 @@ void sock_diag_unregister(const struct sock_diag_handler *hnld)mutex_lock (&sock_diag_table_mutex);BUG_ON (sock_diag_handlers[family] != hnld); - sock_diag_handlers[family] =NULL ; +WRITE_ONCE (sock_diag_handlers[family],NULL );mutex_unlock (&sock_diag_table_mutex); }EXPORT_SYMBOL_GPL (sock_diag_unregister);
@@ -227,7 +227,7 @@ static int __sock_diag_cmd(struct sk_buff *skb, struct nlmsghdr *nlh)return -EINVAL ; req->sdiag_family =array_index_nospec (req->sdiag_family,AF_MAX ); -if (sock_diag_handlers[req->sdiag_family] ==NULL ) +if (READ_ONCE (sock_diag_handlers[req->sdiag_family]) ==NULL )sock_load_diag_module (req->sdiag_family,0 );mutex_lock (&sock_diag_table_mutex);
@@ -286,12 +286,12 @@ static int sock_diag_bind(struct net *net, int group)switch (group) {case SKNLGRP_INET_TCP_DESTROY :case SKNLGRP_INET_UDP_DESTROY : -if (!sock_diag_handlers[AF_INET ]) +if (!READ_ONCE (sock_diag_handlers[AF_INET ]))sock_load_diag_module (AF_INET ,0 );break ;case SKNLGRP_INET6_TCP_DESTROY :case SKNLGRP_INET6_UDP_DESTROY : -if (!sock_diag_handlers[AF_INET6 ]) +if (!READ_ONCE (sock_diag_handlers[AF_INET6 ]))sock_load_diag_module (AF_INET6 ,0 );break ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 82/715 inet_diag: annotate data-races around inet_diag_table[]
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit e50e10ae5d81ddb41547114bfdc5edc04422f082 ]
inet_diag_lock_handler() reads inet_diag_table[proto] locklessly.
Use READ_ONCE()/WRITE_ONCE() annotations to avoid potential issues.
--- net/ipv4/inet_diag.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv4/inet_diag.c +3 -3
@@ -57,7 +57,7 @@ static const struct inet_diag_handler *inet_diag_lock_handler(int proto)return ERR_PTR (-ENOENT ); } -if (!inet_diag_table[proto]) +if (!READ_ONCE (inet_diag_table[proto]))sock_load_diag_module (AF_INET , proto);mutex_lock (&inet_diag_table_mutex);
@@ -1503,7 +1503,7 @@ int inet_diag_register(const struct inet_diag_handler *h)mutex_lock (&inet_diag_table_mutex); err = -EEXIST ;if (!inet_diag_table[type]) { - inet_diag_table[type] = h; +WRITE_ONCE (inet_diag_table[type], h); err =0 ; }mutex_unlock (&inet_diag_table_mutex);
@@ -1520,7 +1520,7 @@ void inet_diag_unregister(const struct inet_diag_handler *h)return ;mutex_lock (&inet_diag_table_mutex); - inet_diag_table[type] =NULL ; +WRITE_ONCE (inet_diag_table[type],NULL );mutex_unlock (&inet_diag_table_mutex); }EXPORT_SYMBOL_GPL (inet_diag_unregister);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 83/715 bpftool: Silence build warning about calloc()
In reply to Sasha LevinFrom: Tiezhu Yang <[email protected]>
[ Upstream commit f5f30386c78105cba520e443a6a9ee945ec1d066 ]
There exists the following warning when building bpftool:
CC prog.oprog.c: In function ‘profile_open_perf_events’:
prog.c:2301:24: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
2301 | sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metric);
| ^~~
prog.c:2301:24: note: earlier argument should specify number of elements, later size of each element
Tested with the latest upstream GCC which contains a new warning option -Wcalloc-transposed-args. The first argument to calloc is documented to be number of elements in array, while the second argument is size of each element, just switch the first and second arguments of calloc() to silence the build warning, compile tested only.
--- tools/bpf/bpftool/prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/prog.c +1 -1
@@ -2298,7 +2298,7 @@ static int profile_open_perf_events(struct profiler_bpf *obj)int map_fd; profile_perf_events =calloc ( -sizeof (int ), obj->rodata->num_cpu * obj->rodata->num_metric); + obj->rodata->num_cpu * obj->rodata->num_metric,sizeof (int ));if (!profile_perf_events) {p_err ("failed to allocate memory for perf_event array: %s" ,strerror (errno));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 84/715 selftests/bpf: Fix potential premature unload in bpf_testmod
In reply to Sasha LevinFrom: Artem Savkov <[email protected]>
[ Upstream commit d177c1be06ce28aa8c8710ac55be1b5ad3f314c6 ]
It is possible for bpf_kfunc_call_test_release() to be called from bpf_map_free_deferred() when bpf_testmod is already unloaded and perf_test_stuct.cnt which it tries to decrease is no longer in memory. This patch tries to fix the issue by waiting for all references to be dropped in bpf_testmod_exit().
The issue can be triggered by running 'test_progs -t map_kptr' in 6.5, but is obscured in 6.6 by d119357d07435 ("rcu-tasks: Treat only synchronous grace periods urgently").
--- tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c +9 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2020 Facebook */ #include <linux/btf.h> #include <linux/btf_ids.h> +#include <linux/delay.h> #include <linux/error-injection.h> #include <linux/init.h> #include <linux/module.h>
@@ -544,6 +545,14 @@ static int bpf_testmod_init(void)static void bpf_testmod_exit (void ) { +/* Need to wait for all references to be dropped because +* bpf_kfunc_call_test_release() which currently resides in kernel can +* be called after bpf_testmod is unloaded. Once release function is +* moved into the module this wait can be removed. +*/ +while (refcount_read (&prog_test_struct.cnt) >1 ) +msleep (20 ); +return sysfs_remove_bin_file (kernel_kobj, &bin_attr_bpf_testmod_file); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 85/715 libbpf: Apply map_set_def_max_entries() for inner_maps on creation
In reply to Sasha LevinFrom: Andrey Grafin <[email protected]>
[ Upstream commit f04deb90e516e8e48bf8693397529bc942a9e80b ]
This patch allows to auto create BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS with values of BPF_MAP_TYPE_PERF_EVENT_ARRAY by bpf_object__load().
Previous behaviour created a zero filled btf_map_def for inner maps and tried to use it for a map creation but the linux kernel forbids to create a BPF_MAP_TYPE_PERF_EVENT_ARRAY map with max_entries=0.
--- tools/lib/bpf/libbpf.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/lib/bpf/libbpf.c +4 -0
@@ -70,6 +70,7 @@static struct bpf_map *bpf_object__add_map (struct bpf_object *obj);static bool prog_is_subprog (const struct bpf_object *obj,const struct bpf_program *prog); +static int map_set_def_max_entries (struct bpf_map *map);static const char *const attach_type_name[] = { [BPF_CGROUP_INET_INGRESS ] ="cgroup_inet_ingress" ,
@@ -5172,6 +5173,9 @@ static int bpf_object__create_map(struct bpf_object *obj, struct bpf_map *map, bif (bpf_map_type__is_map_in_map (def->type)) {if (map->inner_map) { + err =map_set_def_max_entries (map->inner_map); +if (err) +return err; err =bpf_object__create_map (obj, map->inner_map, true);if (err) { pr_warn("map '%s': failed to create inner map: %d\n",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 86/715 selftest/bpf: Add map_in_maps with BPF_MAP_TYPE_PERF_EVENT_ARRAY values
In reply to Sasha LevinFrom: Andrey Grafin <[email protected]>
[ Upstream commit 40628f9fff73adecac77a9aa390f8016724cad99 ]
Check that bpf_object__load() successfully creates map_in_maps with BPF_MAP_TYPE_PERF_EVENT_ARRAY values.
These changes cover fix in the previous patch
"libbpf: Apply map_set_def_max_entries() for inner_maps on creation".
A command line output is:
- w/o fix
$ sudo ./test_maps libbpf: map 'mim_array_pe': failed to create inner map: -22 libbpf: map 'mim_array_pe': failed to create: Invalid argument(-22) libbpf: failed to load object './test_map_in_map.bpf.o' Failed to load test prog
- with fix
$ sudo ./test_maps ... test_maps: OK, 0 SKIPPED
--- .../selftests/bpf/progs/test_map_in_map.c | 26 +++++++++++++++++++ tools/testing/selftests/bpf/test_maps.c | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/progs/test_map_in_map.c +26 -0
@@ -21,6 +21,32 @@ struct {__type (value, __u32); } mim_hash SEC(".maps"); +/* The following three maps are used to test +* perf_event_array map can be an inner +* map of hash/array_of_maps. +*/ +struct perf_event_array { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __type(key, __u32); + __type(value, __u32); +} inner_map0 SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS); + __uint(max_entries, 1); + __type(key, __u32); + __array(values, struct perf_event_array); +} mim_array_pe SEC(".maps") = { + .values = {&inner_map0}}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH_OF_MAPS); + __uint(max_entries, 1); + __type(key, __u32); + __array(values, struct perf_event_array); +} mim_hash_pe SEC(".maps") = { + .values = {&inner_map0}}; + SEC("xdp")int xdp_mimtest0 (struct xdp_md *ctx) {
tools/testing/selftests/bpf/test_maps.c +5 -1
@@ -1190,7 +1190,11 @@ static void test_map_in_map(void) goto out_map_in_map; } -bpf_object__load (obj); + err =bpf_object__load (obj); +if (err) { +printf ("Failed to load test prog\n" ); + goto out_map_in_map; + } map =bpf_object__find_map_by_name (obj,"mim_array" );if (!map) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 87/715 bpftool: Fix wrong free call in do_show_link
In reply to Sasha LevinFrom: Jiri Olsa <[email protected]>
[ Upstream commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad ]
The error path frees wrong array, it should be ref_ctr_offsets.
--- tools/bpf/bpftool/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/link.c +1 -1
@@ -977,7 +977,7 @@ static int do_show_link(int fd) cookies =calloc (count,sizeof (__u64));if (!cookies) {p_err ("mem alloc failed" ); -free (cookies); +free (ref_ctr_offsets);free (offsets);close (fd);return -ENOMEM ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 88/715 wifi: ath12k: Fix issues in channel list update
In reply to Sasha LevinFrom: Sriram R <[email protected]>
[ Upstream commit 67a48d937fac917947540c9f89630d472cd61fcb ]
Currently, the logic used to select the 6 GHz band is incorrect, which may cause 6 GHz supported channels to not be updated properly. This is because the 6 GHz Max frequency supported by the driver is being compared to the Max frequency supported on the board. If in some cases, the 6 GHz Max frequency supported on the board is less than the defined 6 GHz Max frequency, all 6 GHz channels are disabled. To address this, compare the max frequency supported by the board to the defined 6 GHz Minimum frequency by the driver.
Similarly, when a dual mac card supports both 6 GHz and 5 GHz radios, if the 5 GHz radio gets enumerated first before 6 GHz, the checks in ath12k_mac_setup_channels_rates() can cause the 5 GHz channels which were enabled earlier to get disabled when the 6 GHz channel list is updated. This is because the Min 6 GHz frequency defined in the driver is 5945 MHz, which should be 5925 MHz since channel 2 is not considered currently, but the firmware can pass 5925 MHz as the minimum. Hence, update the Min frequency supported by the driver to 5925 MHz.
In addition, ensure that the channel list update to firmware updates only the channels that the current radio (ar) supports rather than considering the wiphy support. This would be required when multiple pdevs are supported in a wiphy and they support different ranges of frequencies or bands as in single wiphy support.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/core.h | 2 +- drivers/net/wireless/ath/ath12k/mac.c | 2 +- drivers/net/wireless/ath/ath12k/reg.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath12k/core.h +1 -1
@@ -420,7 +420,7 @@ struct ath12k_sta { };#define ATH12K_MIN_5G_FREQ 4150 -#define ATH12K_MIN_6G_FREQ 5945 +#define ATH12K_MIN_6G_FREQ 5925#define ATH12K_MAX_6G_FREQ 7115#define ATH12K_NUM_CHANS 100#define ATH12K_MAX_5G_CHAN 173
drivers/net/wireless/ath/ath12k/mac.c +1 -1
@@ -7198,7 +7198,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar, }if (supported_bands &WMI_HOST_WLAN_5G_CAP ) { -if (reg_cap->high_5ghz_chan >=ATH12K_MAX_6G_FREQ ) { +if (reg_cap->high_5ghz_chan >=ATH12K_MIN_6G_FREQ ) { channels =kmemdup (ath12k_6ghz_channels,sizeof (ath12k_6ghz_channels),GFP_KERNEL );if (!channels) {
drivers/net/wireless/ath/ath12k/reg.c +2 -2
@@ -103,7 +103,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar) bands = hw->wiphy->bands;for (band =0 ; band <NUM_NL80211_BANDS ; band++) { -if (!bands[band]) +if (!(ar->mac.sbands[band].channels && bands[band]))continue ;for (i =0 ; i < bands[band]->n_channels; i++) {
@@ -129,7 +129,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar) ch = arg->channel;for (band =0 ; band <NUM_NL80211_BANDS ; band++) { -if (!bands[band]) +if (!(ar->mac.sbands[band].channels && bands[band]))continue ;for (i =0 ; i < bands[band]->n_channels; i++) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 89/715 selftests/bpf: Fix the flaky tc_redirect_dtime test
In reply to Sasha LevinFrom: Martin KaFai Lau <[email protected]>
[ Upstream commit 177f1d083a19af58f4b1206d299ed73689249fd8 ]
BPF CI has been reporting the tc_redirect_dtime test failing from time to time:
test_inet_dtime:PASS:setns src 0 nsec
(network_helpers.c:253: errno: No route to host) Failed to connect to server close_netns:PASS:setns 0 nsec
test_inet_dtime:FAIL:connect_to_fd unexpected connect_to_fd: actual -1 < expected 0 test_tcp_clear_dtime:PASS:tcp ip6 clear dtime ingress_fwdns_p100 0 nsec
The connect_to_fd failure (EHOSTUNREACH) is from the test_tcp_clear_dtime() test and it is the very first IPv6 traffic after setting up all the links, addresses, and routes.
The symptom is this first connect() is always slow. In my setup, it could take ~3s.
After some tracing and tcpdump, the slowness is mostly spent in the neighbor solicitation in the "ns_fwd" namespace while the "ns_src" and "ns_dst" are fine.
I forced the kernel to drop the neighbor solicitation messages. I can then reproduce EHOSTUNREACH. What actually happen could be:
- the neighbor advertisement came back a little slow.
- the "ns_fwd" namespace concluded a neighbor discovery failure and triggered the ndisc_error_report() => ip6_link_failure() => icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0)
- the client's connect() reports EHOSTUNREACH after receiving the ICMPV6_DEST_UNREACH message.
The neigh table of both "ns_src" and "ns_dst" namespace has already been manually populated but not the "ns_fwd" namespace. This patch fixes it by manually populating the neigh table also in the "ns_fwd" namespace.
Although the namespace configuration part had been existed before the tc_redirect_dtime test, still Fixes-tagging the patch when the tc_redirect_dtime test was added since it is the only test hitting it so far.
--- tools/testing/selftests/bpf/prog_tests/tc_redirect.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/testing/selftests/bpf/prog_tests/tc_redirect.c +11 -0
@@ -188,6 +188,7 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result) {struct nstoken *nstoken =NULL ;char src_fwd_addr[IFADDR_STR_LEN +1 ] = {}; +char src_addr[IFADDR_STR_LEN +1 ] = {};int err;if (result->dev_mode ==MODE_VETH ) {
@@ -208,6 +209,9 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)if (get_ifaddr ("src_fwd" , src_fwd_addr)) goto fail; +if (get_ifaddr ("src" , src_addr)) + goto fail; + result->ifindex_src =if_nametoindex ("src" );if (!ASSERT_GT (result->ifindex_src,0 ,"ifindex_src" )) goto fail;
@@ -270,6 +274,13 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)SYS (fail,"ip route add " IP4_DST "/32 dev dst_fwd scope global" );SYS (fail,"ip route add " IP6_DST "/128 dev dst_fwd scope global" ); +if (result->dev_mode ==MODE_VETH ) { +SYS (fail,"ip neigh add " IP4_SRC " dev src_fwd lladdr %s" , src_addr); +SYS (fail,"ip neigh add " IP6_SRC " dev src_fwd lladdr %s" , src_addr); +SYS (fail,"ip neigh add " IP4_DST " dev dst_fwd lladdr %s" ,MAC_DST ); +SYS (fail,"ip neigh add " IP6_DST " dev dst_fwd lladdr %s" ,MAC_DST ); + } +close_netns (nstoken);/** setup in 'dst' namespace */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 90/715 selftests/bpf: Wait for the netstamp_needed_key static key to be turned on
In reply to Sasha LevinFrom: Martin KaFai Lau <[email protected]>
[ Upstream commit ce6f6cffaeaa0a3bcdafcae7fe03c68c3afae631 ]
After the previous patch that speeded up the test (by avoiding neigh discovery in IPv6), the BPF CI occasionally hits this error:
rcv tstamp unexpected pkt rcv tstamp: actual 0 == expected 0
The test complains about the cmsg returned from the recvmsg() does not have the rcv timestamp. Setting skb->tstamp or not is controlled by a kernel static key "netstamp_needed_key". The static key is enabled whenever this is at least one sk with the SOCK_TIMESTAMP set.
The test_redirect_dtime does use setsockopt() to turn on
the SOCK_TIMESTAMP for the reading sk. In the kernel net_enable_timestamp() has a delay to enable the "netstamp_needed_key" when CONFIG_JUMP_LABEL is set. This potential delay is the likely reason for packet missing rcv timestamp occasionally.
This patch is to create udp sockets with SOCK_TIMESTAMP set. It sends and receives some packets until the received packet has a rcv timestamp. It currently retries at most 5 times with 1s in between. This should be enough to wait for the "netstamp_needed_key". It then holds on to the socket and only closes it at the end of the test. This guarantees that the test has the "netstamp_needed_key" key turned on from the beginning.
To simplify the udp sockets setup, they are sending/receiving packets in the same netns (ns_dst is used) and communicate over the "lo" dev. Hence, the patch enables the "lo" dev in the ns_dst.
--- .../selftests/bpf/prog_tests/tc_redirect.c | 79 ++++++++++++++++++- 1 file changed, 75 insertions(+), 4 deletions(-)
tools/testing/selftests/bpf/prog_tests/tc_redirect.c +75 -4
@@ -291,6 +291,7 @@ static int netns_setup_links_and_routes(struct netns_setup_result *result)SYS (fail,"ip addr add " IP4_DST "/32 dev dst" );SYS (fail,"ip addr add " IP6_DST "/128 dev dst nodad" );SYS (fail,"ip link set dev dst up" ); +SYS (fail,"ip link set dev lo up" );SYS (fail,"ip route add " IP4_SRC "/32 dev dst scope global" );SYS (fail,"ip route add " IP4_NET "/16 dev dst scope global" );
@@ -468,7 +469,7 @@ static int set_forwarding(bool enable)return 0 ; } -static void rcv_tstamp (int fd,const char *expected,size_t s) +static int __rcv_tstamp (int fd,const char *expected,size_t s,__u64 *tstamp) {struct __kernel_timespec pkt_ts = {};char ctl[CMSG_SPACE (sizeof (pkt_ts))];
@@ -489,7 +490,7 @@ static void rcv_tstamp(int fd, const char *expected, size_t s) ret =recvmsg (fd, &msg,0 );if (!ASSERT_EQ (ret, s,"recvmsg" )) -return ; +return -1 ;ASSERT_STRNEQ (data, expected, s,"expected rcv data" ); cmsg =CMSG_FIRSTHDR (&msg);
@@ -498,6 +499,12 @@ static void rcv_tstamp(int fd, const char *expected, size_t s)memcpy (&pkt_ts,CMSG_DATA (cmsg),sizeof (pkt_ts)); pkt_ns = pkt_ts.tv_sec *NSEC_PER_SEC + pkt_ts.tv_nsec; +if (tstamp) { +/* caller will check the tstamp itself */ + *tstamp = pkt_ns; +return 0 ; + } +ASSERT_NEQ (pkt_ns,0 ,"pkt rcv tstamp" ); ret =clock_gettime (CLOCK_REALTIME , &now_ts);
@@ -507,6 +514,60 @@ static void rcv_tstamp(int fd, const char *expected, size_t s)if (ASSERT_GE (now_ns, pkt_ns,"check rcv tstamp" ))ASSERT_LT (now_ns - pkt_ns,5 *NSEC_PER_SEC ,"check rcv tstamp" ); +return 0 ; +} + +static void rcv_tstamp (int fd,const char *expected,size_t s) +{ +__rcv_tstamp (fd, expected, s,NULL ); +} + +static int wait_netstamp_needed_key (void ) +{ +int opt =1 , srv_fd =-1 , cli_fd =-1 , nretries =0 , err, n; +char buf[] ="testing testing" ; +struct nstoken *nstoken; +__u64 tstamp =0 ; + + nstoken =open_netns (NS_DST ); +if (!nstoken) +return -1 ; + + srv_fd =start_server (AF_INET6 ,SOCK_DGRAM ,"::1" ,0 ,0 ); +if (!ASSERT_GE (srv_fd,0 ,"start_server" )) + goto done; + + err =setsockopt (srv_fd,SOL_SOCKET ,SO_TIMESTAMPNS_NEW , + &opt,sizeof (opt)); +if (!ASSERT_OK (err,"setsockopt(SO_TIMESTAMPNS_NEW)" )) + goto done; + + cli_fd =connect_to_fd (srv_fd,TIMEOUT_MILLIS ); +if (!ASSERT_GE (cli_fd,0 ,"connect_to_fd" )) + goto done; + +again: + n =write (cli_fd, buf,sizeof (buf)); +if (!ASSERT_EQ (n,sizeof (buf),"send to server" )) + goto done; + err =__rcv_tstamp (srv_fd, buf,sizeof (buf), &tstamp); +if (!ASSERT_OK (err,"__rcv_tstamp" )) + goto done; +if (!tstamp && nretries++ <5 ) { +sleep (1 ); +printf ("netstamp_needed_key retry#%d\n" , nretries); + goto again; + } + +done: +if (!tstamp && srv_fd !=-1 ) { +close (srv_fd); + srv_fd =-1 ; + } +if (cli_fd !=-1 ) +close (cli_fd); +close_netns (nstoken); +return srv_fd; }static void snd_tstamp (int fd,char *b,size_t s)
@@ -843,11 +904,20 @@ static void test_tc_redirect_dtime(struct netns_setup_result *setup_result) {struct test_tc_dtime *skel;struct nstoken *nstoken; -int err; +int hold_tstamp_fd, err; + +/* Hold a sk with the SOCK_TIMESTAMP set to ensure there +* is no delay in the kernel net_enable_timestamp(). +* This ensures the following tests must have +* non zero rcv tstamp in the recvmsg(). +*/ + hold_tstamp_fd =wait_netstamp_needed_key (); +if (!ASSERT_GE (hold_tstamp_fd,0 ,"wait_netstamp_needed_key" )) +return ; skel =test_tc_dtime__open ();if (!ASSERT_OK_PTR (skel,"test_tc_dtime__open" )) -return ; + goto done; skel->rodata->IFINDEX_SRC = setup_result->ifindex_src_fwd; skel->rodata->IFINDEX_DST = setup_result->ifindex_dst_fwd;
@@ -892,6 +962,7 @@ static void test_tc_redirect_dtime(struct netns_setup_result *setup_result) done:test_tc_dtime__destroy (skel); +close (hold_tstamp_fd); }static void test_tc_redirect_neigh_fib (struct netns_setup_result *setup_result)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 91/715 wifi: cfg80211: add RNR with reporting AP information
In reply to Sasha LevinFrom: Benjamin Berg <[email protected]>
[ Upstream commit 4d1d6b3f45999b1ddde53831d639a67e2655285f ]
If the reporting AP is part of the same MLD, then an entry in the RNR is required in order to discover it again from the BSS generated from the per-STA profile in the Multi-Link Probe Response.
We need this because we do not have a direct concept of an MLD AP and just do the lookup from one to the other on the fly if needed. As such, we need to ensure that this lookup will work both ways.
--- net/wireless/scan.c | 135 ++++++++++++++++++++++++++++++++++++-- net/wireless/tests/scan.c | 36 +++++++++- 2 files changed, 163 insertions(+), 8 deletions(-)
net/wireless/scan.c +130 -5
@@ -2674,6 +2674,103 @@ cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id,return 0 ; } +static struct element * +cfg80211_gen_reporter_rnr (struct cfg80211_bss *source_bss,bool is_mbssid, +bool same_mld,u8 link_id,u8 bss_change_count, +gfp_t gfp) +{ +const struct cfg80211_bss_ies *ies; +struct ieee80211_neighbor_ap_info ap_info; +struct ieee80211_tbtt_info_ge_11 tbtt_info; +u32 short_ssid; +const struct element *elem; +struct element *res; + +/* +* We only generate the RNR to permit ML lookups. For that we do not +* need an entry for the corresponding transmitting BSS, lets just skip +* it even though it would be easy to add. +*/ +if (!same_mld) +return NULL ; + +/* We could use tx_data->ies if we change cfg80211_calc_short_ssid */ +rcu_read_lock (); + ies =rcu_dereference (source_bss->ies); + + ap_info.tbtt_info_len =offsetofend (typeof (tbtt_info), mld_params); + ap_info.tbtt_info_hdr = +u8_encode_bits (IEEE80211_TBTT_INFO_TYPE_TBTT , +IEEE80211_AP_INFO_TBTT_HDR_TYPE ) | +u8_encode_bits (0 ,IEEE80211_AP_INFO_TBTT_HDR_COUNT ); + + ap_info.channel =ieee80211_frequency_to_channel (source_bss->channel->center_freq); + +/* operating class */ + elem =cfg80211_find_elem (WLAN_EID_SUPPORTED_REGULATORY_CLASSES , + ies->data, ies->len); +if (elem && elem->datalen >=1 ) { + ap_info.op_class = elem->data[0 ]; + }else { +struct cfg80211_chan_def chandef; + +/* The AP is not providing us with anything to work with. So +* make up a somewhat reasonable operating class, but don't +* bother with it too much as no one will ever use the +* information. +*/ +cfg80211_chandef_create (&chandef, source_bss->channel, +NL80211_CHAN_NO_HT ); + +if (!ieee80211_chandef_to_operating_class (&chandef, + &ap_info.op_class)) + goto out_unlock; + } + +/* Just set TBTT offset and PSD 20 to invalid/unknown */ + tbtt_info.tbtt_offset =255 ; + tbtt_info.psd_20 =IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED ; + +memcpy (tbtt_info.bssid, source_bss->bssid,ETH_ALEN ); +if (cfg80211_calc_short_ssid (ies, &elem, &short_ssid)) + goto out_unlock; + +rcu_read_unlock (); + + tbtt_info.short_ssid =cpu_to_le32 (short_ssid); + + tbtt_info.bss_params =IEEE80211_RNR_TBTT_PARAMS_SAME_SSID ; + +if (is_mbssid) { + tbtt_info.bss_params |=IEEE80211_RNR_TBTT_PARAMS_MULTI_BSSID ; + tbtt_info.bss_params |=IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID ; + } + + tbtt_info.mld_params.mld_id =0 ; + tbtt_info.mld_params.params = +le16_encode_bits (link_id,IEEE80211_RNR_MLD_PARAMS_LINK_ID ) | +le16_encode_bits (bss_change_count, +IEEE80211_RNR_MLD_PARAMS_BSS_CHANGE_COUNT ); + + res =kzalloc (struct_size (res, data, +sizeof (ap_info) + ap_info.tbtt_info_len), + gfp); +if (!res) +return NULL ; + +/* Copy the data */ + res->id =WLAN_EID_REDUCED_NEIGHBOR_REPORT ; + res->datalen =sizeof (ap_info) + ap_info.tbtt_info_len; +memcpy (res->data, &ap_info,sizeof (ap_info)); +memcpy (res->data +sizeof (ap_info), &tbtt_info, ap_info.tbtt_info_len); + +return res; + +out_unlock: +rcu_read_unlock (); +return NULL ; +} + static void cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, struct cfg80211_inform_single_bss_data *tx_data,
@@ -2687,13 +2784,14 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, .source_bss = source_bss, .bss_source = BSS_SOURCE_STA_PROFILE, }; +struct element *reporter_rnr =NULL ;struct ieee80211_multi_link_elem *ml_elem;struct cfg80211_mle *mle;u16 control;u8 ml_common_len; -u8 *new_ie; +u8 *new_ie =NULL ;struct cfg80211_bss *bss; -int mld_id; +u8 mld_id, reporter_link_id, bss_change_count;u16 seen_links =0 ;const u8 *pos;u8 i;
@@ -2715,8 +2813,14 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, ml_common_len = ml_elem->variable[0 ]; -/* length + MLD MAC address + link ID info + BSS Params Change Count */ - pos = ml_elem->variable +1 +6 +1 +1 ; +/* length + MLD MAC address */ + pos = ml_elem->variable +1 +6 ; + + reporter_link_id = pos[0 ]; + pos +=1 ; + + bss_change_count = pos[0 ]; + pos +=1 ;if (u16_get_bits (control,IEEE80211_MLC_BASIC_PRES_MED_SYNC_DELAY )) pos +=2 ;
@@ -2747,10 +2851,21 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy,if (!mle)return ; +/* No point in doing anything if there is no per-STA profile */ +if (!mle->sta_prof[0 ]) + goto out; + new_ie =kmalloc (IEEE80211_MAX_DATA_LEN , gfp);if (!new_ie) goto out; + reporter_rnr =cfg80211_gen_reporter_rnr (source_bss, +u16_get_bits (control, +IEEE80211_MLC_BASIC_PRES_MLD_ID ), + mld_id ==0 , reporter_link_id, + bss_change_count, + gfp); +for (i =0 ; i <ARRAY_SIZE (mle->sta_prof) && mle->sta_prof[i]; i++) {const struct ieee80211_neighbor_ap_info *ap_info;enum nl80211_band band;
@@ -2860,7 +2975,16 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, data.ielen +=sizeof (*ml_elem) + ml_common_len; -/* TODO: Add an RNR containing only the reporting AP */ +if (reporter_rnr && (use_for &NL80211_BSS_USE_FOR_NORMAL )) { +if (data.ielen +sizeof (struct element ) + + reporter_rnr->datalen >IEEE80211_MAX_DATA_LEN ) +continue ; + +memcpy (new_ie + data.ielen, reporter_rnr, +sizeof (struct element ) + reporter_rnr->datalen); + data.ielen +=sizeof (struct element ) + + reporter_rnr->datalen; + } bss =cfg80211_inform_single_bss_data (wiphy, &data, gfp);if (!bss)
@@ -2869,6 +2993,7 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, } out: +kfree (reporter_rnr);kfree (new_ie);kfree (mle); }
net/wireless/tests/scan.c +33 -3
@@ -2,7 +2,7 @@/* * KUnit tests for inform_bss functions * -* Copyright (C) 2023 Intel Corporation +* Copyright (C) 2023-2024 Intel Corporation */ #include <linux/ieee80211.h> #include <net/cfg80211.h>
@@ -406,9 +406,27 @@ static struct inform_bss_ml_sta_case {const char *desc;int mld_id;bool sta_prof_vendor_elems; +bool include_oper_class; } inform_bss_ml_sta_cases[] = { - { .desc = "no_mld_id", .mld_id = 0, .sta_prof_vendor_elems = false }, - { .desc = "mld_id_eq_1", .mld_id = 1, .sta_prof_vendor_elems = true }, + { + .desc = "zero_mld_id", + .mld_id = 0, + .sta_prof_vendor_elems = false, + }, { + .desc = "zero_mld_id_with_oper_class", + .mld_id = 0, + .sta_prof_vendor_elems = false, + .include_oper_class = true, + }, { + .desc = "mld_id_eq_1", + .mld_id = 1, + .sta_prof_vendor_elems = true, + }, { + .desc = "mld_id_eq_1_with_oper_class", + .mld_id = 1, + .sta_prof_vendor_elems = true, + .include_oper_class = true, + }, }; KUNIT_ARRAY_PARAM_DESC(inform_bss_ml_sta, inform_bss_ml_sta_cases, desc)
@@ -515,6 +533,12 @@ static void test_inform_bss_ml_sta(struct kunit *test)skb_put_u8 (input,4 );skb_put_data (input,"TEST" ,4 ); +if (params->include_oper_class) { +skb_put_u8 (input,WLAN_EID_SUPPORTED_REGULATORY_CLASSES ); +skb_put_u8 (input,1 ); +skb_put_u8 (input,81 ); + } +skb_put_u8 (input,WLAN_EID_REDUCED_NEIGHBOR_REPORT );skb_put_u8 (input,sizeof (rnr));skb_put_data (input, &rnr,sizeof (rnr));
@@ -582,15 +606,21 @@ static void test_inform_bss_ml_sta(struct kunit *test)KUNIT_EXPECT_EQ (test, ies->tsf, tsf +le64_to_cpu (sta_prof.tsf_offset));/* Resulting length should be: * SSID (inherited) + RNR (inherited) + vendor element(s) + +* operating class (if requested) + +* generated RNR (if MLD ID == 0) + * MLE common info + MLE header and control */ if (params->sta_prof_vendor_elems)KUNIT_EXPECT_EQ (test, ies->len,6 +2 +sizeof (rnr) +2 +160 +2 +165 + + (params->include_oper_class ?3 :0 ) + + (!params->mld_id ?22 :0 ) + mle_basic_common_info.var_len +5 );else KUNIT_EXPECT_EQ (test, ies->len,6 +2 +sizeof (rnr) +2 +155 + + (params->include_oper_class ?3 :0 ) + + (!params->mld_id ?22 :0 ) + mle_basic_common_info.var_len +5 );rcu_read_unlock ();
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 92/715 wifi: mac80211: use deflink and fix typo in link ID check
In reply to Sasha LevinFrom: Benjamin Berg <[email protected]>
[ Upstream commit e10322810ce0d0d4a5a319458c4e1e052c6fe9be ]
This does not change anything effectively, but it is closer to what the code is trying to achieve here. i.e. select the link data if it is an MLD and fall back to using the deflink otherwise.
--- net/mac80211/mlme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +2 -2
@@ -7523,10 +7523,10 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,if (err) goto err_clear; -if (req->link_id >0 ) +if (req->link_id >=0 ) link =sdata_dereference (sdata->link[req->link_id], sdata);else - link =sdata_dereference (sdata->link[0 ], sdata); + link = &sdata->deflink;if (WARN_ON (!link)) { err = -ENOLINK ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 93/715 wifi: iwlwifi: change link id in time event to s8
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit 6c8ce23854b66db94d88e0957e531cb074806c16 ]
Link ID in time event data is -1 when the time event is cleared. Change the type of the link ID in the time event data structure and in the affected function from unsigned to signed.
--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -1
@@ -121,7 +121,7 @@ struct iwl_mvm_time_event_data {* if the te is in the time event list or not (when id == TE_MAX) */ u32 id; -u8 link_id; +s8 link_id; };/* Power management */
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +4 -4
@@ -692,7 +692,7 @@ void iwl_mvm_protect_session(struct iwl_mvm *mvm,/* Determine whether mac or link id should be used, and validate the link id */ static int iwl_mvm_get_session_prot_id (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -u32 link_id) +s8 link_id) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); int ver = iwl_fw_lookup_cmd_ver(mvm->fw,
@@ -716,7 +716,7 @@ static int iwl_mvm_get_session_prot_id(struct iwl_mvm *mvm,static void iwl_mvm_cancel_session_protection (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -u32 id,u32 link_id) +u32 id,s8 link_id) {int mac_link_id =iwl_mvm_get_session_prot_id (mvm, vif, link_id);struct iwl_mvm_session_prot_cmd cmd = {
@@ -745,7 +745,7 @@ static bool __iwl_mvm_remove_time_event(struct iwl_mvm *mvm,struct ieee80211_vif *vif = te_data->vif;struct iwl_mvm_vif *mvmvif;enum nl80211_iftype iftype; -unsigned int link_id; +s8 link_id;if (!vif)return false;
@@ -1297,7 +1297,7 @@ void iwl_mvm_schedule_session_protection(struct iwl_mvm *mvm,struct iwl_mvm_time_event_data *te_data = &mvmvif->time_event_data;const u16 notif[] = {WIDE_ID (MAC_CONF_GROUP ,SESSION_PROTECTION_NOTIF ) };struct iwl_notification_wait wait_notif; -int mac_link_id =iwl_mvm_get_session_prot_id (mvm, vif, link_id); +int mac_link_id =iwl_mvm_get_session_prot_id (mvm, vif, (s8 )link_id);struct iwl_mvm_session_prot_cmd cmd = { .id_and_color =cpu_to_le32 (mac_link_id), .action =cpu_to_le32 (FW_CTXT_ACTION_ADD ),
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 94/715 af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc().
In reply to Sasha LevinFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 31e03207119a535d0b0e3b3a7f91983aeb2cb14d ]
gc_in_progress is changed under spin_lock(&unix_gc_lock), but wait_for_unix_gc() reads it locklessly.
Let's use READ_ONCE().
--- net/unix/garbage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/unix/garbage.c +1 -1
@@ -198,7 +198,7 @@ void wait_for_unix_gc(void)if (READ_ONCE (unix_tot_inflight) >UNIX_INFLIGHT_TRIGGER_GC && !READ_ONCE (gc_in_progress))unix_gc (); -wait_event (unix_gc_wait, gc_in_progress == false); +wait_event (unix_gc_wait, !READ_ONCE (gc_in_progress)); }/* The external entry point: unix_gc() */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 95/715 arm64: dts: qcom: sm8450: Add missing interconnects to serial
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 6e115b75b43bd12d4061e53c8ff175e387783d8a ]
The serial ports did not have their interconnect paths specified when they were first introduced. Fix that.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/qcom/sm8450.dtsi +12 -0
@@ -1028,6 +1028,12 @@ uart20: serial@894000 { pinctrl-names = "default"; pinctrl-0 = <&qup_uart20_default>; interrupts = <GIC_SPI 587 IRQ_TYPE_LEVEL_HIGH>; + interconnects = <&clk_virt MASTER_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS + &clk_virt SLAVE_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS>, + <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS + &config_noc SLAVE_QUP_2 QCOM_ICC_TAG_ALWAYS>; + interconnect-names = "qup-core", + "qup-config"; status = "disabled"; };
@@ -1420,6 +1426,12 @@ uart7: serial@99c000 { pinctrl-names = "default"; pinctrl-0 = <&qup_uart7_tx>, <&qup_uart7_rx>; interrupts = <GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>; + interconnects = <&clk_virt MASTER_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS + &clk_virt SLAVE_QUP_CORE_2 QCOM_ICC_TAG_ALWAYS>, + <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS + &config_noc SLAVE_QUP_2 QCOM_ICC_TAG_ALWAYS>; + interconnect-names = "qup-core", + "qup-config"; status = "disabled"; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 96/715 soc: qcom: socinfo: rename PM2250 to PM4125
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 5155e48128826d0c5999dc9f47aa746df54da448 ]
It seems, the only actual mentions of PM2250 can be found are related to the Qualcomm RB1 platform. However even RB1 schematics use PM4125 as a PMIC name. Rename PM2250 to PM4125 to follow the documentation.
--- drivers/soc/qcom/socinfo.c | 2 +- include/soc/qcom/qcom-spmi-pmic.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/soc/qcom/socinfo.c +1 -1
@@ -124,7 +124,7 @@ static const char *const pmic_models[] = { [50] = "PM8350B", [51] = "PMR735A", [52] = "PMR735B", - [55] = "PM2250", + [55] = "PM4125", [58] = "PM8450", [65] = "PM8010", [69] = "PM8550VS",
include/soc/qcom/qcom-spmi-pmic.h +1 -1
@@ -49,7 +49,7 @@#define PMK8350_SUBTYPE 0x2f#define PMR735B_SUBTYPE 0x34#define PM6350_SUBTYPE 0x36 -#define PM2250_SUBTYPE 0x37 +#define PM4125_SUBTYPE 0x37#define PMI8998_FAB_ID_SMIC 0x11#define PMI8998_FAB_ID_GF 0x30
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 97/715 arm64: dts: qcom: sc7280: Add static properties to cryptobam
In reply to Sasha LevinFrom: Luca Weiss <[email protected]>
[ Upstream commit 40ec6a2817d927367461fb0335b42b0d494ff927 ]
When the properties num-channels & qcom,num-ees are not specified, the driver tries to read the values from registers, but this read fails and resets the device if the interconnect from the qcom,qce node is not already active when that happens.
Add the static properties to not touch any registers during probe, the rest of the time when the BAM is used by QCE then the interconnect will be active already.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sc7280.dtsi +2 -0
@@ -2345,6 +2345,8 @@ cryptobam: dma-controller@1dc4000 { <&apps_smmu 0x4e6 0x0011>; qcom,ee = <0>; qcom,controlled-remotely; + num-channels = <16>; + qcom,num-ees = <4>; }; crypto: crypto@1dfa000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 98/715 arm64: dts: qcom: qcm6490-fairphone-fp5: Add missing reserved-memory
In reply to Sasha LevinFrom: Luca Weiss <[email protected]>
[ Upstream commit 5dbbe7e0a2b91ac5901ee188724a997004759171 ]
It seems we also need to reserve a region of 81 MiB called "removed_mem" otherwise we can easily hit the following error with higher RAM usage:
[ 1467.809274] Internal error: synchronous external abort: 0000000096000010 [#2] SMP
--- arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +5 -0
@@ -82,6 +82,11 @@ cdsp_mem: cdsp@88f00000 { no-map; }; + removed_mem: removed@c0000000 { + reg = <0x0 0xc0000000 0x0 0x5100000>; + no-map; + }; + rmtfs_mem: memory@f8500000 { compatible = "qcom,rmtfs-mem"; reg = <0x0 0xf8500000 0x0 0x600000>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 99/715 arm64: dts: qcom: sdm845-oneplus-common: improve DAI node naming
In reply to Sasha LevinFrom: David Heidelberg <[email protected]>
[ Upstream commit afe9867a0c0e10ba618c15d4ef6f8699872f6cc3 ]
Make it easier to understand what the reg in those nodes is by using the constants provided by qcom,q6dsp-lpass-ports.h.
Name nodes according to dt-binding expectations.
Fix for
```
arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb: service@4: dais: Unevaluated properties are not allowed ('qi2s@22', 'qi2s@23' were unexpected)
```--- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +4 -4
@@ -508,13 +508,13 @@ led-1 { }; &q6afedai { - qi2s@22 { - reg = <22>; + dai@22 { + reg = <QUATERNARY_MI2S_RX>; qcom,sd-lines = <1>; }; - qi2s@23 { - reg = <23>; + dai@23 { + reg = <QUATERNARY_MI2S_TX>; qcom,sd-lines = <0>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 100/715 arm64: dts: qcom: rename PM2250 to PM4125
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 39e62f41c3ce210554cc054f345d4135ef4e587b ]
It seems, the only actual mentions of PM2250 can be found are related to the Qualcomm RB1 platform. However even RB1 schematics use PM4125 as a PMIC name. Rename PM2250 to PM4125 to follow the documentation.
Note, this doesn't change the compatible strings. There was a previous argument regarding renaming of compat strings.
---
.../dts/qcom/{pm2250.dtsi => pm4125.dtsi} | 8 +-
arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 78 +++++++++----------
2 files changed, 43 insertions(+), 43 deletions(-)
rename arch/arm64/boot/dts/qcom/{pm2250.dtsi => pm4125.dtsi} (91%)arch/arm64/boot/dts/qcom/pm4125.dtsi renamed from arch/arm64/boot/dts/qcom/pm2250.dtsi +4 -4
@@ -19,7 +19,7 @@ pon@800 { compatible = "qcom,pm8916-pon"; reg = <0x800>; - pm2250_pwrkey: pwrkey { + pm4125_pwrkey: pwrkey { compatible = "qcom,pm8941-pwrkey"; interrupts-extended = <&spmi_bus 0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>; linux,code = <KEY_POWER>;
@@ -27,7 +27,7 @@ pm2250_pwrkey: pwrkey { bias-pull-up; }; - pm2250_resin: resin { + pm4125_resin: resin { compatible = "qcom,pm8941-resin"; interrupts-extended = <&spmi_bus 0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>; debounce = <15625>;
@@ -43,11 +43,11 @@ rtc@6000 { interrupts-extended = <&spmi_bus 0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>; }; - pm2250_gpios: gpio@c000 { + pm4125_gpios: gpio@c000 { compatible = "qcom,pm2250-gpio", "qcom,spmi-gpio"; reg = <0xc000>; gpio-controller; - gpio-ranges = <&pm2250_gpios 0 0 10>; + gpio-ranges = <&pm4125_gpios 0 0 10>; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>;
arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +39 -39
252 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 101/715 cpufreq: mediatek-hw: Don't error out if supply is not found
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit eaffb10b51bf74415c9252fd8fb4dd77122501ee ]
devm_regulator_get_optional() returns -ENODEV if no supply can be found. By introducing its usage, commit 788715b5f21c ("cpufreq: mediatek-hw:
Wait for CPU supplies before probing") caused the driver to fail probe if no supply was present in any of the CPU DT nodes.
Use devm_regulator_get() instead since the CPUs do require supplies even if not described in the DT. It will gracefully return a dummy regulator if none is found in the DT node, allowing probe to succeed.
--- drivers/cpufreq/mediatek-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/mediatek-cpufreq-hw.c +1 -1
@@ -312,7 +312,7 @@ static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev)return dev_err_probe (&pdev->dev, -EPROBE_DEFER ,"Failed to get cpu%d device\n" , cpu); - cpu_reg =devm_regulator_get_optional (cpu_dev,"cpu" ); + cpu_reg =devm_regulator_get (cpu_dev,"cpu" );if (IS_ERR (cpu_reg))return dev_err_probe (&pdev->dev,PTR_ERR (cpu_reg),"CPU%d regulator get failed\n" , cpu);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 102/715 libbpf: Fix faccessat() usage on Android
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit ad57654053805bf9a62602aaec74cc78edb6f235 ]
Android implementation of libc errors out with -EINVAL in faccessat() if passed AT_EACCESS ([0]), this leads to ridiculous issue with libbpf refusing to load /sys/kernel/btf/vmlinux on Androids ([1]). Fix by detecting Android and redefining AT_EACCESS to 0, it's equivalent on Android.
[0] https://android.googlesource.com/platform/bionic/+/refs/heads/android13-release/libc/bionic/faccessat.cpp#50
[1] https://github.com/libbpf/libbpf-bootstrap/issues/250#issuecomment-1911324250
--- tools/lib/bpf/libbpf_internal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tools/lib/bpf/libbpf_internal.h +14 -0
@@ -18,6 +18,20 @@#include <libelf.h> #include "relo_core.h" +/* Android's libc doesn't support AT_EACCESS in faccessat() implementation +* ([0]), and just returns -EINVAL even if file exists and is accessible. +* See [1] for issues caused by this. +* +* So just redefine it to 0 on Android. +* +* [0] https://android.googlesource.com/platform/bionic/+/refs/heads/android13-release/libc/bionic/faccessat.cpp#50 +* [1] https://github.com/libbpf/libbpf-bootstrap/issues/250#issuecomment-1911324250 +*/ +#ifdef __ANDROID__ +#undef AT_EACCESS +#define AT_EACCESS 0 +#endif +/* make sure libbpf doesn't use kernel-only integer typedefs */ #pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 103/715 libbpf: fix __arg_ctx type enforcement for perf_event programs
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 9eea8fafe33eb70868f6ace2fc1e17c4ff5539c3 ]
Adjust PERF_EVENT type enforcement around __arg_ctx to match exactly what kernel is doing.
--- tools/lib/bpf/libbpf.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +20 -1
@@ -33,6 +33,7 @@#include <linux/filter.h> #include <linux/limits.h> #include <linux/perf_event.h> +#include <linux/bpf_perf_event.h> #include <linux/ring_buffer.h> #include <sys/epoll.h> #include <sys/ioctl.h>
@@ -6699,6 +6700,14 @@ static struct {/* all other program types don't have "named" context structs */ }; +/* forward declarations for arch-specific underlying types of bpf_user_pt_regs_t typedef, +* for below __builtin_types_compatible_p() checks; +* with this approach we don't need any extra arch-specific #ifdef guards +*/ +struct pt_regs ; +struct user_pt_regs ; +struct user_regs_struct ; +static bool need_func_arg_type_fixup (const struct btf *btf,const struct bpf_program *prog,const char *subprog_name,int arg_idx,int arg_type_id,const char *ctx_name)
@@ -6739,11 +6748,21 @@ static bool need_func_arg_type_fixup(const struct btf *btf, const struct bpf_pro/* special cases */ switch (prog->type) {case BPF_PROG_TYPE_KPROBE : -case BPF_PROG_TYPE_PERF_EVENT :/* `struct pt_regs *` is expected, but we need to fix up */ if (btf_is_struct (t) &&strcmp (tname,"pt_regs" ) ==0 )return true;break ; +case BPF_PROG_TYPE_PERF_EVENT : + if (__builtin_types_compatible_p(bpf_user_pt_regs_t, struct pt_regs) && +btf_is_struct (t) &&strcmp (tname,"pt_regs" ) ==0 ) +return 0 ; + if (__builtin_types_compatible_p(bpf_user_pt_regs_t, struct user_pt_regs) && +btf_is_struct (t) &&strcmp (tname,"user_pt_regs" ) ==0 ) +return 0 ; + if (__builtin_types_compatible_p(bpf_user_pt_regs_t, struct user_regs_struct) && +btf_is_struct (t) &&strcmp (tname,"user_regs_struct" ) ==0 ) +return 0 ; +break ;case BPF_PROG_TYPE_RAW_TRACEPOINT :case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE :/* allow u64* as ctx */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 104/715 pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 883957bee580b723fd87d49ac73e0c84fc03a446 ]
On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is handled by an external regulator (max20411). Drop gfx.lvl from the list of power-domains exposed on this platform.
--- drivers/pmdomain/qcom/rpmhpd.c | 1 - 1 file changed, 1 deletion(-)
drivers/pmdomain/qcom/rpmhpd.c +0 -1
@@ -217,7 +217,6 @@ static struct rpmhpd *sa8540p_rpmhpds[] = { [SC8280XP_CX] = &cx, [SC8280XP_CX_AO] = &cx_ao, [SC8280XP_EBI] = &ebi, - [SC8280XP_GFX] = &gfx, [SC8280XP_LCX] = &lcx, [SC8280XP_LMX] = &lmx, [SC8280XP_MMCX] = &mmcx,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 105/715 arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit fd5821a1a83c969ed2dcc72fef885f3a82c1d978 ]
The SA8295P and SA8540P uses an external regulator (max20411), and gfx.lvl is not provided by rpmh. Drop the power-domains property of the gpucc node to reflect this.
--- arch/arm64/boot/dts/qcom/sa8540p.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/qcom/sa8540p.dtsi +3 -0
@@ -168,6 +168,9 @@ opp-2592000000 { }; &gpucc { + /* SA8295P and SA8540P doesn't provide gfx.lvl */ + /delete-property/ power-domains; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 106/715 arm64: dts: renesas: r8a779g0: Restore sort order
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 8b93657c976a61726d7ffbe8d019b84b4abfb673 ]
Numerical by unit address, alphabetical by node name.
Stable-dep-of: 08e799f6bce8 ("arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2")
--- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 72 +++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +36 -36
@@ -161,11 +161,6 @@ L3_CA76_1: cache-controller-1 { }; }; - psci { - compatible = "arm,psci-1.0", "arm,psci-0.2"; - method = "smc"; - }; - extal_clk: extal { compatible = "fixed-clock"; #clock-cells = <0>;
@@ -185,6 +180,11 @@ pmu_a76 { interrupts-extended = <&gic GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>; }; + psci { + compatible = "arm,psci-1.0", "arm,psci-0.2"; + method = "smc"; + }; + /* External SCIF clock - to be overridden by boards that provide it */ scif_clk: scif { compatible = "fixed-clock";
@@ -1777,6 +1777,37 @@ ssi0: ssi-0 { }; }; + mmc0: mmc@ee140000 { + compatible = "renesas,sdhi-r8a779g0", + "renesas,rcar-gen4-sdhi"; + reg = <0 0xee140000 0 0x2000>; + interrupts = <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 706>, + <&cpg CPG_CORE R8A779G0_CLK_SD0H>; + clock-names = "core", "clkh"; + power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; + resets = <&cpg 706>; + max-frequency = <200000000>; + iommus = <&ipmmu_ds0 32>; + status = "disabled"; + }; + + rpc: spi@ee200000 { + compatible = "renesas,r8a779g0-rpc-if", + "renesas,rcar-gen4-rpc-if"; + reg = <0 0xee200000 0 0x200>, + <0 0x08000000 0 0x04000000>, + <0 0xee208000 0 0x100>; + reg-names = "regs", "dirmap", "wbuf"; + interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 629>; + power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; + resets = <&cpg 629>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + ipmmu_rt0: iommu@ee480000 { compatible = "renesas,ipmmu-r8a779g0", "renesas,rcar-gen4-ipmmu-vmsa";
@@ -1886,37 +1917,6 @@ ipmmu_mm: iommu@eefc0000 { #iommu-cells = <1>; }; - mmc0: mmc@ee140000 { - compatible = "renesas,sdhi-r8a779g0", - "renesas,rcar-gen4-sdhi"; - reg = <0 0xee140000 0 0x2000>; - interrupts = <GIC_SPI 440 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&cpg CPG_MOD 706>, - <&cpg CPG_CORE R8A779G0_CLK_SD0H>; - clock-names = "core", "clkh"; - power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; - resets = <&cpg 706>; - max-frequency = <200000000>; - iommus = <&ipmmu_ds0 32>; - status = "disabled"; - }; - - rpc: spi@ee200000 { - compatible = "renesas,r8a779g0-rpc-if", - "renesas,rcar-gen4-rpc-if"; - reg = <0 0xee200000 0 0x200>, - <0 0x08000000 0 0x04000000>, - <0 0xee208000 0 0x100>; - reg-names = "regs", "dirmap", "wbuf"; - interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&cpg CPG_MOD 629>; - power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; - resets = <&cpg 629>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - gic: interrupt-controller@f1000000 { compatible = "arm,gic-v3"; #interrupt-cells = <3>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 107/715 arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 08e799f6bce80dd63c174d8d0fc61d1a6149960b ]
R-Car V4H actually has two SCIF_CLK pins.
The second pin provides the SCIF_CLK signal for HSCIF2 and SCIF4.
--- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +9 -3
@@ -185,13 +185,19 @@ psci { method = "smc"; }; - /* External SCIF clock - to be overridden by boards that provide it */ + /* External SCIF clocks - to be overridden by boards that provide them */ scif_clk: scif { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <0>; }; + scif_clk2: scif2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + }; + soc: soc { compatible = "simple-bus"; interrupt-parent = <&gic>;
@@ -681,7 +687,7 @@ hscif2: serial@e6560000 { interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cpg CPG_MOD 516>, <&cpg CPG_CORE R8A779G0_CLK_SASYNCPERD1>, - <&scif_clk>; + <&scif_clk2>; clock-names = "fck", "brg_int", "scif_clk"; dmas = <&dmac0 0x35>, <&dmac0 0x34>, <&dmac1 0x35>, <&dmac1 0x34>;
@@ -1057,7 +1063,7 @@ scif4: serial@e6c40000 { interrupts = <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cpg CPG_MOD 705>, <&cpg CPG_CORE R8A779G0_CLK_SASYNCPERD1>, - <&scif_clk>; + <&scif_clk2>; clock-names = "fck", "brg_int", "scif_clk"; dmas = <&dmac0 0x59>, <&dmac0 0x58>, <&dmac1 0x59>, <&dmac1 0x58>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 108/715 selftests/bpf: Disable IPv6 for lwt_redirect test
In reply to Sasha LevinFrom: Manu Bretelle <[email protected]>
[ Upstream commit 2ef61296d2844c6a4211e07ab70ef2fb412b2c30 ]
After a recent change in the vmtest runner, this test started failing sporadically.
Investigation showed that this test was subject to race condition which got exacerbated after the vm runner change. The symptoms being that the logic that waited for an ICMPv4 packet is naive and will break if 5 or more non-ICMPv4 packets make it to tap0.
When ICMPv6 is enabled, the kernel will generate traffic such as ICMPv6 router solicitation...
On a system with good performance, the expected ICMPv4 packet would very likely make it to the network interface promptly, but on a system with poor performance, those "guarantees" do not hold true anymore.
Given that the test is IPv4 only, this change disable IPv6 in the test netns by setting net.ipv6.conf.all.disable_ipv6 to 1. This essentially leaves "ping" as the sole generator of traffic in the network namespace.
If this test was to be made IPv6 compatible, the logic in wait_for_packet would need to be modified.
In more details...
At a high level, the test does:
- create a new namespace
- in setup_redirect_target set up lo, tap0, and link_err interfaces as well as add 2 routes that attaches ingress/egress sections of test_lwt_redirect.bpf.o to the xmit path.
- in send_and_capture_test_packets send an ICMP packet and read off the tap interface (using wait_for_packet) to check that a ICMP packet with the right size is read.
wait_for_packet will try to read max_retry (5) times from the tap0 fd looking for an ICMPv4 packet matching some criteria.
The problem is that when we set up the tap0 interface, because IPv6 is enabled by default, traffic such as Router solicitation is sent through tap0, as in:
# tcpdump -r /tmp/lwt_redirect.pc reading from file /tmp/lwt_redirect.pcap, link-type EN10MB (Ethernet) 04:46:23.578352 IP6 :: > ff02::1:ffc0:4427: ICMP6, neighbor solicitation, who has fe80::fcba:dff:fec0:4427, length 32 04:46:23.659522 IP6 :: > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28 04:46:24.389169 IP 10.0.0.1 > 20.0.0.9: ICMP echo request, id 122, seq 1, length 108 04:46:24.618599 IP6 fe80::fcba:dff:fec0:4427 > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28 04:46:24.619985 IP6 fe80::fcba:dff:fec0:4427 > ff02::2: ICMP6, router solicitation, length 16 04:46:24.767326 IP6 fe80::fcba:dff:fec0:4427 > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28 04:46:28.936402 IP6 fe80::fcba:dff:fec0:4427 > ff02::2: ICMP6, router solicitation, length 16
If wait_for_packet sees 5 non-ICMPv4 packets, it will return 0, which is what we see in:
2024-01-31T03:51:25.0336992Z test_lwt_redirect_run:PASS:netns_create 0 nsec 2024-01-31T03:51:25.0341309Z open_netns:PASS:malloc token 0 nsec 2024-01-31T03:51:25.0344844Z open_netns:PASS:open /proc/self/ns/net 0 nsec 2024-01-31T03:51:25.0350071Z open_netns:PASS:open netns fd 0 nsec 2024-01-31T03:51:25.0353516Z open_netns:PASS:setns 0 nsec 2024-01-31T03:51:25.0356560Z test_lwt_redirect_run:PASS:setns 0 nsec 2024-01-31T03:51:25.0360140Z open_tuntap:PASS:open(/dev/net/tun) 0 nsec 2024-01-31T03:51:25.0363822Z open_tuntap:PASS:ioctl(TUNSETIFF) 0 nsec 2024-01-31T03:51:25.0367402Z open_tuntap:PASS:fcntl(O_NONBLOCK) 0 nsec 2024-01-31T03:51:25.0371167Z setup_redirect_target:PASS:open_tuntap 0 nsec 2024-01-31T03:51:25.0375180Z setup_redirect_target:PASS:if_nametoindex 0 nsec 2024-01-31T03:51:25.0379929Z setup_redirect_target:PASS:ip link add link_err type dummy 0 nsec 2024-01-31T03:51:25.0384874Z setup_redirect_target:PASS:ip link set lo up 0 nsec 2024-01-31T03:51:25.0389678Z setup_redirect_target:PASS:ip addr add dev lo 10.0.0.1/32 0 nsec 2024-01-31T03:51:25.0394814Z setup_redirect_target:PASS:ip link set link_err up 0 nsec 2024-01-31T03:51:25.0399874Z setup_redirect_target:PASS:ip link set tap0 up 0 nsec 2024-01-31T03:51:25.0407731Z setup_redirect_target:PASS:ip route add 10.0.0.0/24 dev link_err encap bpf xmit obj test_lwt_redirect.bpf.o sec redir_ingress 0 nsec 2024-01-31T03:51:25.0419105Z setup_redirect_target:PASS:ip route add 20.0.0.0/24 dev link_err encap bpf xmit obj test_lwt_redirect.bpf.o sec redir_egress 0 nsec 2024-01-31T03:51:25.0427209Z test_lwt_redirect_normal:PASS:setup_redirect_target 0 nsec 2024-01-31T03:51:25.0431424Z ping_dev:PASS:if_nametoindex 0 nsec 2024-01-31T03:51:25.0437222Z send_and_capture_test_packets:FAIL:wait_for_epacket unexpected wait_for_epacket: actual 0 != expected 1 2024-01-31T03:51:25.0448298Z (/tmp/work/bpf/bpf/tools/testing/selftests/bpf/prog_tests/lwt_redirect.c:175: errno: Success) test_lwt_redirect_normal egress test fails 2024-01-31T03:51:25.0457124Z close_netns:PASS:setns 0 nsec
When running in a VM which potential resource contrains, the odds that calling ping is not scheduled very soon after bringing tap0 up increases, and with this the chances to get our ICMP packet pushed to position 6+ in the network trace.
To confirm this indeed solves the issue, I ran the test 100 times in a row with:
errors=0
successes=0
for i in `seq 1 100`
do
./test_progs -t lwt_redirect/lwt_redirect_normal
if [ $? -eq 0 ]; then
successes=$((successes+1))
else
errors=$((errors+1))
fi
done
echo "successes: $successes/errors: $errors"While this test would at least fail a couple of time every 10 runs, here it ran 100 times with no error.
--- tools/testing/selftests/bpf/prog_tests/lwt_redirect.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/prog_tests/lwt_redirect.c +1 -0
@@ -203,6 +203,7 @@ static int setup_redirect_target(const char *target_dev, bool need_mac)if (!ASSERT_GE (target_index,0 ,"if_nametoindex" )) goto fail; +SYS (fail,"sysctl -w net.ipv6.conf.all.disable_ipv6=1" );SYS (fail,"ip link add link_err type dummy" );SYS (fail,"ip link set lo up" );SYS (fail,"ip addr add dev lo " LOCAL_SRC "/32" );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 109/715 arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on OSM-S i.MX8MM
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 96293af54f6aa859015d8ca40a1437d3115ad50c ]
There are external pullup resistors on the board and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts | 4 ++-- arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +2 -2
@@ -294,8 +294,8 @@ MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x19 pinctrl_i2c4: i2c4grp { fsl,pins = < - MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x400001c3 - MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x400001c3 + MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x40000083 + MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x40000083 >; };
arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +2 -2
@@ -252,8 +252,8 @@ MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19 pinctrl_i2c1: i2c1grp { fsl,pins = < - MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 - MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 + MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x40000083 + MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x40000083 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 110/715 arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on SL/BL i.MX8MM
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit f19e5bb91d53264d7dac5d845a4825afadf72440 ]
There are external pullup resistors on the board and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts | 4 ++-- arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +2 -2
@@ -279,8 +279,8 @@ MX8MM_IOMUXC_SAI3_MCLK_GPIO5_IO2 0x19 pinctrl_i2c4: i2c4grp { fsl,pins = < - MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x400001c3 - MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x400001c3 + MX8MM_IOMUXC_I2C4_SCL_I2C4_SCL 0x40000083 + MX8MM_IOMUXC_I2C4_SDA_I2C4_SDA 0x40000083 >; };
arch/arm64/boot/dts/freescale/imx8mm-kontron-sl.dtsi +2 -2
@@ -237,8 +237,8 @@ MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x19 pinctrl_i2c1: i2c1grp { fsl,pins = < - MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x400001c3 - MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x400001c3 + MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL 0x40000083 + MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA 0x40000083 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 111/715 arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals on BL OSM-S board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit c6d9b5672a0e2c4b1079a50d2fc8780c40cfd3eb ]
These signals are actively driven by the SoC or by the onboard transceiver. There's no need to enable the internal pull resistors and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- .../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +8 -8
@@ -313,19 +313,19 @@ MX8MM_IOMUXC_SAI5_MCLK_GPIO3_IO25 0x19 pinctrl_uart1: uart1grp { fsl,pins = < - MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x140 - MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x140 - MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x0 + MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x0 + MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x0 >; }; pinctrl_uart2: uart2grp { fsl,pins = < - MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x140 - MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x140 - MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x0 + MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x0 + MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x0 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 112/715 arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals on BL board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 162aadaa0df8217b0cc49d919dd00022fef65e78 ]
These signals are actively driven by the SoC or by the onboard transceiver. There's no need to enable the internal pull resistors and due to silicon errata ERR050080 let's disable the internal ones to prevent any unwanted behavior in case they wear out.
--- .../boot/dts/freescale/imx8mm-kontron-bl.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +8 -8
@@ -292,19 +292,19 @@ MX8MM_IOMUXC_SPDIF_RX_PWM2_OUT 0x19 pinctrl_uart1: uart1grp { fsl,pins = < - MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x140 - MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x140 - MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX 0x0 + MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX 0x0 + MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B 0x0 >; }; pinctrl_uart2: uart2grp { fsl,pins = < - MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x140 - MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x140 - MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x140 - MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x140 + MX8MM_IOMUXC_SAI3_TXFS_UART2_DCE_RX 0x0 + MX8MM_IOMUXC_SAI3_TXC_UART2_DCE_TX 0x0 + MX8MM_IOMUXC_SAI3_RXD_UART2_DCE_RTS_B 0x0 + MX8MM_IOMUXC_SAI3_RXC_UART2_DCE_CTS_B 0x0 >; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 113/715 arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL OSM-S board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 5a940ba3e4d7c8710c9073ff5d0ca4644d4da9db ]
Some signals have external pullup resistors on the board and don't need the internal ones to be enabled. Due to silicon errata ERR050080 let's disable the internal pull resistors whererever possible and prevent any unwanted behavior in case they wear out.
--- .../dts/freescale/imx8mm-kontron-bl-osm-s.dts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl-osm-s.dts +9 -9
@@ -337,40 +337,40 @@ MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x19 pinctrl_usdhc2: usdhc2grp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d0 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d0 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x194 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d4 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d4 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x196 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d6 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d6 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; };
Signature · 1 line
2.43.0