6.1.83-rc1 review
Subsystems (7)
Sasha Levin
maintainercover 6.1.83-rc1 review
This is the start of the stable review cycle for the 6.1.83 release. There are 451 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 11:11:59 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.1.y&id2=v6.1.82
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y
and the diffstat can be found below.
Thanks,
Sasha
-------------
Pseudo-Shortlog of commits:
Abhinav Kumar (1):
drm/msm/dpu: fix the programming of INTF_CFG2_DATA_HCTL_EN
Ajay Singh (2):
wifi: wilc1000: do not realloc workqueue everytime an interface is
added
wifi: wilc1000: fix multi-vif management when deleting a vif
Alban Boyé (1):
ASoC: Intel: bytcr_rt5640: Add an extra entry for the Chuwi Vi8 tablet
Alex Bee (1):
drm/rockchip: inno_hdmi: Fix video timing
Alexander Gordeev (1):
net/iucv: fix the allocation size of iucv_path_table array
Alexander Stein (1):
media: tc358743: register v4l2 async device only after successful
setup
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
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
Andre Werner (1):
net: smsc95xx: add support for SYS TEC USB-SPEmodule1
Andrew Ballance (1):
gen_compile_commands: fix invalid escape sequence warning
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
Andrii Nakryiko (5):
libbpf: Fix faccessat() usage on Android
libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim
API
selftests/bpf: Convert test_global_funcs test to test_loader framework selftests/bpf: Add global subprog context passing tests
bpf: don't infer PTR_TO_CTX for programs with unnamed context type
Andy Shevchenko (1):
serial: 8250_exar: Don't remove GPIO device on suspend
AngeloGioacchino Del Regno (1):
drm/mediatek: dsi: Fix DSI RGB666 formats and definitions
Archie Pusaka (1):
Bluetooth: Cancel sync command before suspend and power off
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 (1):
ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()
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 (11):
fs/select: rework stack allocation hack for clang
wifi: brcmsmac: avoid function pointer casts
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
remoteproc: stm32: use correct format strings on 64-bit
soc: fsl: dpio: fix kcalloc() argument order
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
Athaariq Ardhiansyah (1):
ALSA: hda/realtek: fix ALC285 issues on HP Envy x360 laptops
Attila Tőkés (1):
ASoC: amd: yc: Fix non-functional mic on Lenovo 82UU
Baochen Qiang (1):
wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use
Baokun Li (1):
quota: simplify drop_dquot_ref()
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
Bert Karwatzki (1):
iommu: Fix compilation without CONFIG_IOMMU_INTEL
Bitterblue Smith (2):
wifi: rtw88: 8821c: Fix beacon loss and disconnect
wifi: rtw88: 8821c: Fix false alarm count
Bjorn Andersson (1):
pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl
Breno Leitao (1):
net: blackhole_dev: fix build warning for ethh set but not used
Bryan O'Donoghue (1):
clk: Fix clk_core_get NULL dereference
Cai Huoqing (1):
drm/tegra: dsi: Make use of the helper function dev_err_probe()
Changbin Du (1):
modules: wait do_free_init correctly
Chao Yu (13):
f2fs: reduce stack memory cost by using bitfield in struct
f2fs_io_info
f2fs: compress: fix to guarantee persisting compressed blocks by CP
f2fs: compress: fix to cover normal cluster write with cp_rwsem
f2fs: delete obsolete FI_FIRST_BLOCK_WRITTEN
f2fs: delete obsolete FI_DROP_CACHE
f2fs: introduce get_dnode_addr() to clean up codes
f2fs: update blkaddr in __set_data_blkaddr() for cleanup
f2fs: compress: fix to avoid inconsistence bewteen i_blocks and dnode
f2fs: compress: fix to cover f2fs_disable_compressed_file() w/ i_sem
f2fs: fix to avoid potential panic during recovery
f2fs: compress: fix to check zstd compress level correctly in mount
option
f2fs: compress: fix to check compress flag w/ .i_sem lock
f2fs: ro: compress: fix to avoid caching unaligned extent
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 (3):
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
Christoph Hellwig (3):
f2fs: simplify __allocate_data_block
nvme: only set reserved_tags in nvme_alloc_io_tag_set for fabrics
controllers
nvme: add the Apple shared tag workaround to nvme_alloc_io_tag_set
Christophe JAILLET (12):
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: 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()
net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr()
NFS: Fix an off by one in root_nfs_cat()
Christophe Leroy (1):
powerpc: Force inlining of arch_vmap_p{u/m}d_supported()
Chuck Lever (2):
NFSD: Convert filecache to rhltable
NFSD: Add an nfsd4_encode_nfstime4() helper
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
Colin Ian King (1):
usb: gadget: net2272: Use irqflags in the call to net2272_probe_fin
Conor Dooley (1):
riscv: dts: sifive: add missing #interrupt-cells to pmic
Craig Tatlor (1):
ARM: dts: qcom: msm8974: correct qfprom node size
Cristian Ciocaltea (1):
ASoC: amd: acp: Add missing error handling in sof-mach
Dai Ngo (1):
NFSD: Fix problem of COMMIT and NFS4ERR_DELAY in infinite loop
Dan Carpenter (3):
io_uring/net: fix overflow check in io_recvmsg_mshot_prep()
ASoC: SOF: Add some bounds checking to firmware data
staging: greybus: fix get_channel_from_mode() failure path
Daniel Golle (2):
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 (1):
nouveau: reset the bo resource bus info after an eviction
David Gow (4):
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.
David Howells (1):
afs: Revert "afs: Hide silly-rename files from userspace"
David McFarland (1):
ACPI: resource: Add Infinity laptops to irq1_edge_low_force_override
Dmitry Baryshkov (2):
arm64: dts: qcom: msm8998: switch USB QMP PHY to new style of bindings
arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
Duoming Zhou (2):
nfp: flower: handle acti_netdevs allocation failure
clk: zynq: Prevent null pointer dereference caused by kmalloc failure
Edward Adam Davis (1):
media: pvrusb2: fix uaf in pvr2_context_set_notify
Eric Dumazet (7):
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
Ethan Zhao (2):
PCI: Make pci_dev_is_disconnected() helper public for other drivers iommu/vt-d: Don't issue ATS Invalidation request when device is
disconnected
Eugen Hristev (1):
arm64: dts: mediatek: mt8192: fix vencoder clock name
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 Fietkau (1):
wifi: mac80211: only call drv_sta_rc_update for uploaded stations
Felix Maurer (1):
hsr: Handle failures in module init
Filipe Manana (2):
btrfs: fix data races when accessing the reserved amount of block
reserves
btrfs: fix data race at btrfs_use_block_rsv() when accessing block
reserve
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 (2):
Bluetooth: mgmt: Fix limited discoverable off timeout
Bluetooth: Fix eir name length
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 (10):
soc: microchip: Fix POLARFIRE_SOC_SYS_CTRL input prompt
ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate
ARM: dts: arm: realview: Fix development chip ROM compatible value
arm64: dts: renesas: r8a779a0: Update to R-Car Gen4 compatible values
arm64: dts: renesas: r8a779a0: Correct avb[01] reg sizes
arm64: dts: renesas: r8a779g0: Correct avb[01] reg sizes
pinctrl: renesas: r8a779g0: Add missing SCIF_CLK2 pin group/function
clk: renesas: r8a779g0: Add thermal clock
clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks
clk: renesas: r8a779f0: Correct PFC/GPIO parent clock
George Stark (1):
leds: aw2013: Unlock mutex before destroying it
Greg Joyce (1):
block: sed-opal: handle empty atoms when parsing response
Hans de Goede (1):
ASoC: rt5645: Make LattePanda board DMI match more precise
Harry Wentland (1):
drm: Don't treat 0 as -1 in drm_fixp2int_ceil
Heiko Carstens (1):
s390/cache: prevent rebuild of shared_cpu_list
Heiko Stuebner (1):
arm64: dts: rockchip: add missing interrupt-names for rk356x vdpu
Heinz Mauelshagen (1):
dm: address indent/space issues
Hongyu Jin (1):
dm io: Support IO priority
Hou Tao (2):
x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()
Hsin-Te Yuan (1):
arm64: dts: mt8195-cherry-tomato: change watchdog reset boot flow
Hsin-Yi Wang (3):
arm64: dts: mt8183: kukui: Split out keyboard node and describe
detachables
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 Abbott (1):
comedi: comedi_test: Prevent timers rescheduling during deletion
Ian Rogers (1):
perf stat: Avoid metric-only segv
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
Ilkka Koskinen (1):
perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect
child count)
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
Jakub Kicinski (1):
selftests: tls: use exact comparison in recv_partial
Jan Höppner (1):
s390/dasd: Use dev_*() for device log messages
Jan Kara (1):
quota: Fix rcu annotations of inode dquot pointers
Jeff Layton (10):
nfsd: allow nfsd_file_get to sanely handle a NULL pointer
nfsd: don't open-code clear_and_wake_up_bit
nfsd: NFSD_FILE_KEY_INODE only needs to find GC'ed entries
nfsd: simplify test_bit return in NFSD_FILE_KEY_FULL comparator
nfsd: don't kill nfsd_files because of lease break error
nfsd: add some comments to nfsd_file_do_acquire
nfsd: don't take/put an extra reference when putting a file
nfsd: update comment over __nfsd_file_cache_purge
nfsd: allow reaping files still under writeback
nfsd: simplify the delayed disposal list code
Jens Axboe (4):
io_uring/unix: drop usage of io_uring socket
io_uring: drop any code related to SCM_RIGHTS io_uring/net: unify how recvmsg and sendmsg copy in the msghdr io_uring/net: move receive multishot out of the generic msghdr path
Jeremy Kerr (1):
net: mctp: copy skb ext data when fragmenting
Jernej Skrabec (5):
media: cedrus: h265: Associate mv col buffers with buffer
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
Jiawei Wang (1):
ASoC: amd: yc: Fix non-functional mic on Lenovo 21J2
Jiaxun Yang (1):
MIPS: Clear Cause.BD in instruction_pointer_set
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 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 (2):
arm64: dts: qcom: sc8280xp: update UFS PHY nodes PCI/AER: Fix rootport attribute paths in ABI docs
Johannes Berg (3):
wifi: iwlwifi: mvm: report beacon protection failures
wifi: iwlwifi: dbg-tlv: ensure NUL termination
wifi: iwlwifi: mvm: don't set replay counters to 0xff
Johnny Hsieh (1):
ASoC: amd: yc: Add Lenovo ThinkBook 21J0 into DMI quirk table
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()
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
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
Kailang Yang (1):
ALSA: hda/realtek - ALC285 reduce pop noise from Headphone port
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
Kan Liang (1):
iommu/vt-d: Retrieve IOMMU perfmon capability information
Kees Cook (3):
pstore: inode: Convert mutex usage to guard(mutex)
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()
Konrad Dybcio (3):
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
Krzysztof Kozlowski (3):
arm64: dts: qcom: sdm845-db845c: correct PCIe wake-gpios
arm64: dts: qcom: sm8150: use 'gpios' suffix for PCI GPIOs
arm64: dts: qcom: sm8150: correct PCIe wake-gpios
Kuninori Morimoto (1):
clk: renesas: r8a779g0: Add Audio clocks
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().
Kunwu Chan (1):
x86/xen: Add some null pointer checking to smp.c
Kévin L'hôpital (1):
net: phy: fix phy_get_internal_delay accessing an empty array
Lad Prabhakar (3):
arm64: dts: renesas: r9a07g043: Split out RZ/G2UL SoC specific parts
arm64: dts: renesas: r9a07g043u: Add IRQC node
arm64: dts: renesas: rzg2l: Add missing interrupts to IRQC nodes
Leon Romanovsky (1):
RDMA/mlx5: Fix fortify source warning while accessing Eth segment
Li Nan (1):
md: Don't clear MD_CLOSING when the raid is about to stop
Linh Phung (1):
pinctrl: renesas: r8a779g0: Add Audio SSI pins, groups, and functions
Linu Cherian (1):
octeontx2-af: Use matching wake_up API variant in CGX command
interface
Luca Ceresoli (1):
ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates
Luca Weiss (2):
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: hci_sync: Only allow hci_cmd_sync_queue if running
Bluetooth: hci_conn: Consolidate code for aborting connections
Bluetooth: hci_core: Cancel request on command timeout
Bluetooth: hci_sync: Fix overwriting request callback
Bluetooth: hci_core: Fix possible buffer overflow
Bluetooth: af_bluetooth: Fix deadlock
Bluetooth: MGMT: Fix always using HCI_MAX_AD_LENGTH
Bluetooth: hci_core: Fix missing instances using HCI_MAX_AD_LENGTH
Luoyouming (1):
RDMA/hns: Fix mis-modifying default congestion control algorithm
Manuel Fombuena (1):
HID: multitouch: Add required quirk for Synaptics 0xcddc device
Marijn Suijten (1):
drm/msm/dpu: Only enable DSC_MODE_MULTIPLEX if dsc_merge is enabled
Mario Limonciello (1):
iommu/amd: Mark interrupt as managed
Mark Brown (1):
arm64/sve: Lower the maximum allocation for the SVE ptrace regset
Martin Kaiser (1):
gpio: vf610: allow disabling the vf610 driver
Martin Kaistra (1):
wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work
Masahiro Yamada (1):
kconfig: fix infinite loop when expanding a macro at the end of file
Max Kellermann (1):
parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check
Maxim Kudinov (1):
ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override
Mete Durlu (1):
s390/vtime: fix average steal time calculation
Michael Ellerman (1):
powerpc/embedded6xx: Fix no previous prototype for avr_uart_send()
etc.
Michal Vokáč (3):
ARM: dts: imx6dl-yapp4: Move phy reset into switch node
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 (4):
dm-verity, dm-crypt: align "struct bvec_iter" correctly
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
Miri Korenblit (1):
wifi: iwlwifi: fix EWRD table validity check
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
Nikita Kiryushin (1):
net: phy: fix phy_read_poll_timeout argument type in genphy_loopback
Nikita Zhandarovich (4):
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()
wireguard: receive: annotate data-race around
receiving_counter.counter
Nícolas F. R. A. Prado (4):
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
Ondrej Jirman (1):
leds: sgm3140: Add missing timer cleanup and flash gpio control
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 (1):
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
Perry Yuan (1):
ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors
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
Peter Ujfalusi (1):
ASoC: SOF: Introduce container struct for SOF firmware
Petr Machata (1):
selftests: forwarding: Add missing config entries
Petr Mladek (1):
printk: Disable passing console lock owner completely during panic()
Prike Liang (1):
drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series
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()
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
Rafael J. Wysocki (1):
ACPI: scan: Fix device check notification handling
Rafał Miłecki (4):
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
Randy Dunlap (2):
crypto: jitter - fix CRYPTO_JITTERENTROPY help text
rtc: mt6397: select IRQ_DOMAIN instead of depending on it
Ranjan Kumar (1):
scsi: mpt3sas: Prevent sending diag_reset when the controller is ready
Rob Herring (2):
arm64: dts: Fix dtc interrupt_provider warnings
cpufreq: Explicitly include correct DT includes
Sam Protsenko (1):
clk: samsung: exynos850: Propagate SPI IPCLK rate change
Sam Ravnborg (1):
sparc32: Fix section mismatch in leon_pci_grpci
Sandipan Das (1):
perf/x86/amd/core: Avoid register reset when CPU is dead
Sasha Levin (1):
Linux 6.1.83-rc1
Sean Anderson (1):
usb: phy: generic: Get the vbus supply
Sheng Yong (1):
f2fs: compress: fix to check unreleased compressed cluster
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
Sindhu Devale (1):
RDMA/irdma: Allow accurate reporting on QP max send/recv WR
Srinivasan Shanmugam (3):
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 missing break in ATOM_ARG_IMM Case of
atom_get_src_int()Srujana Challa (4):
octeontx2-af: recover CPT engine when it gets fault
octeontx2-af: add mbox for CPT LF reset
octeontx2-af: optimize cpt pf identification
octeontx2-af: add mbox to return CPT_AF_FLT_INT info
Stefan Haberland (1):
s390/dasd: add autoquiesce feature
Steve Sistare (1):
vdpa_sim: reset must not run
Stuart Henderson (3):
ASoC: wm8962: Enable oscillator if selecting WM8962_FLL_OSC
ASoC: wm8962: Enable both SPKOUTR_ENA and SPKOUTL_ENA in mono mode
ASoC: wm8962: Fix up incorrect error message in wm8962_set_fll
Subbaraya Sundeep (4):
octeontx2: Detect the mbox up or down message via register
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
Takashi Iwai (1):
ALSA: seq: fix function cast warnings
Takashi Sakamoto (1):
firewire: core: use long bus reset on gap count error
Tavian Barnes (1):
nfsd: Fix creation time serialization order
Tejun Heo (1):
net: octeontx2: Use alloc_ordered_workqueue() to create ordered
workqueues
Thierry Reding (1):
arm64: tegra: Set the correct PHY mode for MGBE
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 Zimmermann (1):
arch/powerpc: Remove <linux/fb.h> from backlight code
Théo Lebrun (1):
gpio: nomadik: fix offset bug in nmk_pmx_set()
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 (4):
wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is
complete
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 (3):
media: rkisp1: Fix IRQ handling due to shared interrupts 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
Uwe Kleine-König (5):
Input: gpio_keys_polled - suppress deferred probe error for gpio
pwm: atmel-hlcdc: Convert to platform remove callback returning void
pwm: atmel-hlcdc: Use consistent variable naming
pwm: atmel-hlcdc: Fix clock imbalance related to suspend support
pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan
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 (1):
igb: Fix missing time sync events
Viresh Kumar (1):
OPP: debugfs: Fix warning around icc_get_name()
Wang Jianjian (1):
quota: Fix potential NULL pointer dereference
William Kucharski (1):
RDMA/srpt: Do not register event handler until srpt device is fully
setup
Wolfram Sang (1):
clk: renesas: r8a779g0: Add CMT clocks
Xingyuan Mo (1):
wifi: ath10k: fix NULL pointer dereference in
ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
Xiuhong Wang (2):
f2fs: compress: relocate some judgments in
f2fs_reserve_compress_blocks
f2fs: compress: fix reserve_cblocks counting error when out of space
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 (4):
perf record: Fix possible incorrect free in record__switch_output() 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()
Yangtao Li (2):
drm/tegra: hdmi: Convert to devm_platform_ioremap_resource()
f2fs: convert to use sbi directly
Yewon Choi (1):
rds: introduce acquire/release ordering in acquire/release_in_xmit()
Yishai Hadas (1):
RDMA/mlx5: Relax DEVX access upon modify commands
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 (2):
md: fix data corruption for raid456 when reshape restart while grow up md/raid10: prevent soft lockup while flush writes
Yuxuan Hu (1):
Bluetooth: rfcomm: Fix null-ptr-deref in rfcomm_check_security
Zhang Shurong (1):
drm/tegra: dpaux: Fix PM disable depth imbalance in tegra_dpaux_probe
Zhipeng Lu (9):
wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
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
ruanjinjie (1):
NTB: EPF: fix possible memory leak in pci_vntb_probe()
.../testing/sysfs-bus-pci-devices-aer_stats | 6 +- Makefile | 4 +- arch/arm/boot/dts/arm-realview-pb1176.dts | 2 +- arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 28 +- arch/arm/boot/dts/qcom-msm8974.dtsi | 2 +- arch/arm/boot/dts/r8a73a4-ape6evm.dts | 12 + arch/arm/boot/dts/r8a73a4.dtsi | 9 +- arch/arm/crypto/sha256_glue.c | 13 +- arch/arm/crypto/sha512-glue.c | 12 +- .../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 +- arch/arm64/boot/dts/amazon/alpine-v2.dtsi | 1 - arch/arm64/boot/dts/amazon/alpine-v3.dtsi | 1 - .../boot/dts/broadcom/bcmbca/bcm4908.dtsi | 3 - .../boot/dts/broadcom/northstar2/ns2.dtsi | 1 + .../boot/dts/broadcom/stingray/stingray.dtsi | 1 + .../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 +- arch/arm64/boot/dts/lg/lg1312.dtsi | 1 - arch/arm64/boot/dts/lg/lg1313.dtsi | 1 - arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 10 +- arch/arm64/boot/dts/marvell/armada-ap80x.dtsi | 1 - 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 + arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 + .../dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 2 + .../dts/mediatek/mt8183-kukui-kakadu.dtsi | 10 + .../dts/mediatek/mt8183-kukui-kodama.dtsi | 10 + .../boot/dts/mediatek/mt8183-kukui-krane.dtsi | 10 + .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 5 - .../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/mediatek/mt8195-demo.dts | 1 + .../nvidia/tegra234-p3737-0000+p3701-0000.dts | 2 +- arch/arm64/boot/dts/qcom/msm8998.dtsi | 42 +- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 49 +- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- arch/arm64/boot/dts/qcom/sm8150.dtsi | 6 +- arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 28 +- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 4 +- arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 54 +-- arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 136 ++++++ arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 22 +- arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 22 +- arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 4 + arch/arm64/boot/dts/rockchip/rk356x.dtsi | 1 + arch/arm64/include/asm/fpsimd.h | 12 +- arch/arm64/kernel/ptrace.c | 3 +- arch/mips/include/asm/ptrace.h | 1 + arch/parisc/kernel/ftrace.c | 2 +- arch/powerpc/include/asm/backlight.h | 5 +- arch/powerpc/include/asm/vmalloc.h | 4 +- arch/powerpc/perf/hv-gpci.c | 29 +- .../platforms/embedded6xx/linkstation.c | 3 - arch/powerpc/platforms/embedded6xx/mpc10x.h | 3 + arch/powerpc/platforms/powermac/backlight.c | 26 -- .../pseries/papr_platform_attributes.c | 8 +- .../boot/dts/sifive/hifive-unmatched-a00.dts | 1 + arch/s390/include/uapi/asm/dasd.h | 2 + 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/kernel/leon_pci_grpci1.c | 2 +- arch/sparc/kernel/leon_pci_grpci2.c | 2 +- arch/x86/events/amd/core.c | 1 - arch/x86/include/asm/vsyscall.h | 10 + arch/x86/kernel/acpi/cppc.c | 2 +- arch/x86/kernel/cpu/resctrl/internal.h | 4 - arch/x86/kernel/cpu/resctrl/monitor.c | 42 +- arch/x86/mm/fault.c | 9 - arch/x86/mm/maccess.c | 10 + arch/x86/mm/mem_encrypt_identity.c | 10 +- arch/x86/tools/relocs.c | 8 + arch/x86/xen/smp.c | 12 + block/opal_proto.h | 1 + block/sed-opal.c | 6 +- crypto/Kconfig | 5 +- drivers/acpi/processor_idle.c | 2 + drivers/acpi/resource.c | 33 ++ drivers/acpi/scan.c | 8 +- drivers/block/aoe/aoecmd.c | 12 +- drivers/block/aoe/aoenet.c | 1 + drivers/block/nbd.c | 6 + drivers/bluetooth/hci_qca.c | 6 +- drivers/bus/Kconfig | 5 +- drivers/clk/clk.c | 3 + drivers/clk/hisilicon/clk-hi3519.c | 2 +- drivers/clk/hisilicon/clk-hi3559a.c | 1 - drivers/clk/meson/axg.c | 2 + drivers/clk/qcom/dispcc-sdm845.c | 2 + drivers/clk/qcom/reset.c | 27 +- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779g0-cpg-mssr.c | 18 +- drivers/clk/samsung/clk-exynos850.c | 33 +- drivers/clk/zynq/clkc.c | 8 +- drivers/comedi/drivers/comedi_test.c | 30 +- drivers/cpufreq/armada-37xx-cpufreq.c | 4 +- drivers/cpufreq/brcmstb-avs-cpufreq.c | 2 + drivers/cpufreq/mediatek-cpufreq-hw.c | 22 +- drivers/cpufreq/ppc_cbe_cpufreq.c | 2 +- drivers/cpufreq/ppc_cbe_cpufreq_pmi.c | 1 - drivers/cpufreq/qcom-cpufreq-nvmem.c | 1 - drivers/cpufreq/scpi-cpufreq.c | 2 +- drivers/cpufreq/sti-cpufreq.c | 2 +- drivers/cpufreq/ti-cpufreq.c | 2 +- drivers/cpufreq/vexpress-spc-cpufreq.c | 1 - drivers/crypto/xilinx/zynqmp-aes-gcm.c | 3 + drivers/dma/Kconfig | 14 +- drivers/firewire/core-card.c | 14 +- drivers/firmware/arm_scmi/smc.c | 7 + drivers/firmware/efi/libstub/x86-stub.c | 7 +- drivers/gpio/Kconfig | 3 +- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 45 +- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 2 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 +- 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/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_intf.c | 15 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 1 + drivers/gpu/drm/nouveau/nouveau_bo.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 | 47 +- drivers/gpu/drm/tegra/fb.c | 1 + drivers/gpu/drm/tegra/hdmi.c | 24 +- drivers/gpu/drm/tegra/output.c | 16 +- drivers/gpu/drm/tegra/rgb.c | 18 +- drivers/gpu/drm/tidss/tidss_crtc.c | 10 + drivers/gpu/drm/tidss/tidss_plane.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 5 +- 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/hid/hid-multitouch.c | 4 + drivers/hwtracing/ptt/hisi_ptt.c | 6 +- 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/uk.c | 89 +++- drivers/infiniband/hw/irdma/user.h | 10 + drivers/infiniband/hw/irdma/verbs.c | 187 +++++--- drivers/infiniband/hw/irdma/verbs.h | 3 +- drivers/infiniband/hw/mlx5/devx.c | 2 +- drivers/infiniband/hw/mlx5/wr.c | 2 +- drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c | 2 +- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +- drivers/input/keyboard/gpio_keys_polled.c | 10 +- drivers/iommu/Kconfig | 2 +- drivers/iommu/amd/init.c | 3 + drivers/iommu/intel/Kconfig | 11 + drivers/iommu/intel/Makefile | 3 + drivers/iommu/intel/dmar.c | 7 + drivers/iommu/intel/iommu.h | 43 +- drivers/iommu/intel/pasid.c | 3 + drivers/iommu/intel/perfmon.c | 172 +++++++ drivers/iommu/intel/perfmon.h | 40 ++ 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-cache-policy.h | 2 +- drivers/md/dm-crypt.c | 6 +- drivers/md/dm-integrity.c | 35 +- drivers/md/dm-io.c | 23 +- drivers/md/dm-kcopyd.c | 4 +- drivers/md/dm-log.c | 12 +- drivers/md/dm-raid.c | 12 +- drivers/md/dm-raid1.c | 8 +- drivers/md/dm-snap-persistent.c | 4 +- drivers/md/dm-table.c | 4 +- drivers/md/dm-thin.c | 6 +- drivers/md/dm-verity-target.c | 2 +- drivers/md/dm-verity.h | 4 +- drivers/md/dm-writecache.c | 8 +- drivers/md/dm.c | 26 +- drivers/md/md.c | 28 +- drivers/md/persistent-data/dm-btree.c | 6 +- .../md/persistent-data/dm-space-map-common.c | 2 +- .../md/persistent-data/dm-space-map-common.h | 2 +- drivers/md/raid10.c | 2 + 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/tc358743.c | 7 +- .../media/platform/mediatek/mdp/mtk_mdp_vpu.c | 2 +- .../mediatek/vcodec/mtk_vcodec_fw_vpu.c | 10 +- drivers/media/platform/mediatek/vpu/mtk_vpu.c | 2 +- drivers/media/platform/mediatek/vpu/mtk_vpu.h | 2 +- .../platform/rockchip/rkisp1/rkisp1-capture.c | 3 + .../platform/rockchip/rkisp1/rkisp1-common.h | 2 + .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 + .../platform/rockchip/rkisp1/rkisp1-dev.c | 22 + .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 + .../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/v4l2-core/v4l2-mem2mem.c | 10 +- drivers/mfd/altera-sysmgr.c | 4 +- drivers/mfd/syscon.c | 4 +- drivers/mmc/host/wmt-sdmmc.c | 4 - drivers/mtd/maps/physmap-core.c | 2 +- drivers/mtd/nand/raw/lpc32xx_mlc.c | 5 +- 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/igb/igb_main.c | 23 +- .../net/ethernet/marvell/octeontx2/af/cgx.c | 2 +- .../net/ethernet/marvell/octeontx2/af/mbox.c | 43 +- .../net/ethernet/marvell/octeontx2/af/mbox.h | 31 ++ .../marvell/octeontx2/af/mcs_rvu_if.c | 17 +- .../net/ethernet/marvell/octeontx2/af/rvu.c | 44 +- .../net/ethernet/marvell/octeontx2/af/rvu.h | 8 + .../ethernet/marvell/octeontx2/af/rvu_cgx.c | 20 +- .../ethernet/marvell/octeontx2/af/rvu_cpt.c | 191 ++++++-- .../marvell/octeontx2/nic/otx2_common.h | 2 +- .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 124 +++-- .../ethernet/marvell/octeontx2/nic/otx2_vf.c | 74 +-- 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 + drivers/net/phy/dp83822.c | 37 +- drivers/net/phy/phy_device.c | 6 +- drivers/net/usb/smsc95xx.c | 5 + drivers/net/usb/sr9800.c | 4 +- drivers/net/veth.c | 18 - drivers/net/wireguard/receive.c | 6 +- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 + drivers/net/wireless/ath/ath11k/mac.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/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 | 2 +- .../net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 + drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 26 +- drivers/net/wireless/marvell/libertas/cmd.c | 13 +- .../net/wireless/marvell/mwifiex/debugfs.c | 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/silabs/wfx/sta.c | 15 +- drivers/ntb/core.c | 8 +- drivers/nvme/host/core.c | 13 +- drivers/nvme/host/fabrics.h | 7 - drivers/opp/debugfs.c | 6 +- drivers/pci/endpoint/functions/pci-epf-vntb.c | 5 +- drivers/pci/pci.h | 5 - drivers/pci/pcie/dpc.c | 2 +- drivers/pci/quirks.c | 1 + drivers/pci/switch/switchtec.c | 4 +- drivers/perf/arm-cmn.c | 11 + drivers/pinctrl/mediatek/pinctrl-mt8186.c | 1 - drivers/pinctrl/mediatek/pinctrl-mt8192.c | 1 - drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 +- drivers/pinctrl/renesas/pfc-r8a779g0.c | 40 ++ drivers/powercap/dtpm_cpu.c | 2 +- drivers/pwm/pwm-atmel-hlcdc.c | 71 ++- drivers/pwm/pwm-sti.c | 11 +- drivers/remoteproc/Kconfig | 2 +- drivers/remoteproc/stm32_rproc.c | 12 +- drivers/rtc/Kconfig | 3 +- drivers/rtc/lib_test.c | 2 +- drivers/s390/block/dasd.c | 111 +++-- drivers/s390/block/dasd_eer.c | 1 + drivers/s390/block/dasd_int.h | 2 + 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/mpt3sas/mpt3sas_base.c | 4 +- drivers/soc/fsl/dpio/dpio-service.c | 2 +- drivers/soc/microchip/Kconfig | 2 +- drivers/soc/qcom/rpmhpd.c | 1 - drivers/spi/spi-mt65xx.c | 22 +- drivers/staging/greybus/light.c | 8 +- .../deprecated/saa7146/ttpci/budget-av.c | 8 +- .../staging/media/imx/imx-media-csc-scaler.c | 1 + drivers/staging/media/sunxi/cedrus/cedrus.h | 9 +- .../staging/media/sunxi/cedrus/cedrus_h265.c | 73 +-- 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/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/lm3630a_bl.c | 15 +- drivers/video/backlight/lm3639_bl.c | 1 + drivers/video/backlight/lp8788_bl.c | 1 + drivers/watchdog/stm32_iwdg.c | 3 + fs/afs/dir.c | 10 - fs/btrfs/block-rsv.c | 2 +- fs/btrfs/block-rsv.h | 32 ++ fs/btrfs/space-info.c | 26 +- fs/f2fs/checkpoint.c | 6 +- fs/f2fs/compress.c | 48 +- fs/f2fs/data.c | 73 ++- fs/f2fs/f2fs.h | 85 ++-- fs/f2fs/file.c | 106 ++--- fs/f2fs/gc.c | 10 +- fs/f2fs/inode.c | 57 +-- fs/f2fs/node.c | 22 +- fs/f2fs/recovery.c | 33 +- fs/f2fs/segment.c | 8 +- fs/f2fs/segment.h | 17 +- fs/f2fs/super.c | 10 +- fs/fcntl.c | 12 +- fs/fhandle.c | 2 +- fs/nfs/export.c | 9 +- fs/nfs/flexfilelayout/flexfilelayout.c | 2 +- fs/nfs/nfs42.h | 7 +- fs/nfs/nfs4proc.c | 16 +- fs/nfs/nfsroot.c | 4 +- fs/nfsd/filecache.c | 433 ++++++++---------- fs/nfsd/filecache.h | 9 +- fs/nfsd/nfs4state.c | 4 +- fs/nfsd/nfs4xdr.c | 50 +- fs/pstore/inode.c | 76 ++- fs/quota/dquot.c | 226 ++++----- fs/select.c | 2 +- include/drm/drm_fixed.h | 5 +- include/dt-bindings/clock/r8a779g0-cpg-mssr.h | 1 + include/linux/dm-io.h | 3 +- include/linux/exportfs.h | 1 + include/linux/filter.h | 21 +- include/linux/io_uring.h | 10 +- include/linux/io_uring_types.h | 3 - include/linux/mlx5/qp.h | 5 +- include/linux/moduleloader.h | 8 + include/linux/pci.h | 5 + include/linux/poll.h | 4 - include/linux/rcupdate.h | 31 ++ include/net/bluetooth/hci.h | 1 - include/net/bluetooth/hci_core.h | 13 +- include/net/bluetooth/hci_sync.h | 4 +- include/uapi/rdma/irdma-abi.h | 6 + init/main.c | 5 +- io_uring/filetable.c | 10 +- io_uring/io_uring.c | 44 +- io_uring/io_uring.h | 1 - io_uring/net.c | 260 ++++++----- io_uring/rsrc.c | 151 +----- io_uring/rsrc.h | 15 - kernel/bpf/btf.c | 3 + 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/printk.c | 29 ++ 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 +- lib/cmdline_kunit.c | 2 +- lib/memcpy_kunit.c | 4 +- lib/test_blackhole_dev.c | 3 +- net/bluetooth/af_bluetooth.c | 10 +- net/bluetooth/eir.c | 29 +- net/bluetooth/hci_conn.c | 154 ++----- net/bluetooth/hci_core.c | 129 ++++-- net/bluetooth/hci_event.c | 32 +- net/bluetooth/hci_request.c | 2 +- net/bluetooth/hci_sync.c | 89 +++- net/bluetooth/mgmt.c | 61 +-- net/bluetooth/rfcomm/core.c | 2 +- net/core/dev.c | 5 +- net/core/scm.c | 2 +- net/core/skbuff.c | 8 + net/core/sock_diag.c | 10 +- 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/iucv/iucv.c | 4 +- net/kcm/kcmsock.c | 3 +- net/l2tp/l2tp_ppp.c | 4 +- net/mac80211/rate.c | 3 +- net/mctp/route.c | 3 + net/netfilter/nf_tables_api.c | 2 +- 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_rpc_xdr.c | 27 +- net/unix/garbage.c | 2 +- net/unix/scm.c | 4 +- net/x25/af_x25.c | 4 +- scripts/clang-tools/gen_compile_commands.py | 2 +- scripts/kconfig/lexer.l | 7 +- sound/core/seq/seq_midi.c | 8 +- sound/core/seq/seq_virmidi.c | 9 +- sound/pci/hda/patch_realtek.c | 64 +++ sound/soc/amd/acp/acp-sof-mach.c | 14 +- sound/soc/amd/yc/acp6x-mach.c | 21 + sound/soc/codecs/rt5645.c | 10 + sound/soc/codecs/wm8962.c | 29 +- sound/soc/intel/boards/bytcr_rt5640.c | 12 + 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/sof/ipc3-loader.c | 28 +- sound/soc/sof/ipc4-loader.c | 6 +- sound/soc/sof/loader.c | 18 +- sound/soc/sof/sof-priv.h | 14 + sound/usb/stream.c | 5 +- tools/bpf/bpftool/prog.c | 2 +- tools/bpf/resolve_btfids/main.c | 70 ++- tools/include/linux/btf_ids.h | 9 + tools/lib/bpf/bpf.h | 2 +- tools/lib/bpf/libbpf.c | 4 + tools/lib/bpf/libbpf_internal.h | 14 + tools/perf/builtin-record.c | 2 +- tools/perf/util/evsel.c | 1 - tools/perf/util/stat-display.c | 2 +- tools/perf/util/thread_map.c | 2 +- .../bpf/prog_tests/test_global_funcs.c | 133 ++---- .../selftests/bpf/progs/test_global_func1.c | 6 +- .../selftests/bpf/progs/test_global_func10.c | 4 +- .../selftests/bpf/progs/test_global_func11.c | 4 +- .../selftests/bpf/progs/test_global_func12.c | 4 +- .../selftests/bpf/progs/test_global_func13.c | 4 +- .../selftests/bpf/progs/test_global_func14.c | 4 +- .../selftests/bpf/progs/test_global_func15.c | 4 +- .../selftests/bpf/progs/test_global_func16.c | 4 +- .../selftests/bpf/progs/test_global_func17.c | 4 +- .../selftests/bpf/progs/test_global_func2.c | 43 +- .../selftests/bpf/progs/test_global_func3.c | 10 +- .../selftests/bpf/progs/test_global_func4.c | 55 ++- .../selftests/bpf/progs/test_global_func5.c | 4 +- .../selftests/bpf/progs/test_global_func6.c | 4 +- .../selftests/bpf/progs/test_global_func7.c | 4 +- .../selftests/bpf/progs/test_global_func8.c | 4 +- .../selftests/bpf/progs/test_global_func9.c | 4 +- .../bpf/progs/test_global_func_ctx_args.c | 123 +++++ .../selftests/bpf/progs/test_map_in_map.c | 26 ++ tools/testing/selftests/bpf/test_maps.c | 6 +- tools/testing/selftests/net/forwarding/config | 35 ++ .../net/forwarding/vxlan_bridge_1d_ipv6.sh | 4 +- .../net/forwarding/vxlan_bridge_1q_ipv6.sh | 4 +- tools/testing/selftests/net/tls.c | 8 +- 501 files changed, 5000 insertions(+), 3564 deletions(-) create mode 100644 drivers/iommu/intel/perfmon.c create mode 100644 drivers/iommu/intel/perfmon.h create mode 100644 tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 1/451 md: fix data corruption for raid456 when reshape restart while grow up
From: Yu Kuai <[email protected]>
[ Upstream commit 873f50ece41aad5c4f788a340960c53774b5526e ]
Currently, if reshape is interrupted, echo "reshape" to sync_action will restart reshape from scratch, for example:
echo frozen > sync_action
echo reshape > sync_action
This will corrupt data before reshape_position if the array is growing, fix the problem by continue reshape from reshape_position.
--- drivers/md/md.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/md/md.c +12 -2
@@ -4903,11 +4903,21 @@ action_store(struct mddev *mddev, const char *page, size_t len)return -EINVAL ; err =mddev_lock (mddev);if (!err) { -if (test_bit (MD_RECOVERY_RUNNING , &mddev->recovery)) +if (test_bit (MD_RECOVERY_RUNNING , &mddev->recovery)) { err = -EBUSY ; -else { + }else if (mddev->reshape_position == MaxSector || + mddev->pers->check_reshape ==NULL || + mddev->pers->check_reshape (mddev)) {clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); err = mddev->pers->start_reshape (mddev); + }else { +/* +* If reshape is still in progress, and +* md_check_recovery() can continue to reshape, +* don't restart reshape because data can be +* corrupted for raid456. +*/ +clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); }mddev_unlock (mddev); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/451 md/raid10: prevent soft lockup while flush writes
In reply to Sasha LevinFrom: Yu Kuai <[email protected]>
[ Upstream commit 010444623e7f4da6b4a4dd603a7da7469981e293 ]
Currently, there is no limit for raid1/raid10 plugged bio. While flushing writes, raid1 has cond_resched() while raid10 doesn't, and too many writes can cause soft lockup.
Follow up soft lockup can be triggered easily with writeback test for raid10 with ramdisks:
watchdog: BUG: soft lockup - CPU#10 stuck for 27s! [md0_raid10:1293] Call Trace: <TASK> call_rcu+0x16/0x20 put_object+0x41/0x80 __delete_object+0x50/0x90 delete_object_full+0x2b/0x40 kmemleak_free+0x46/0xa0 slab_free_freelist_hook.constprop.0+0xed/0x1a0 kmem_cache_free+0xfd/0x300 mempool_free_slab+0x1f/0x30 mempool_free+0x3a/0x100 bio_free+0x59/0x80 bio_put+0xcf/0x2c0 free_r10bio+0xbf/0xf0 raid_end_bio_io+0x78/0xb0 one_write_done+0x8a/0xa0 raid10_end_write_request+0x1b4/0x430 bio_endio+0x175/0x320 brd_submit_bio+0x3b9/0x9b7 [brd] __submit_bio+0x69/0xe0 submit_bio_noacct_nocheck+0x1e6/0x5a0 submit_bio_noacct+0x38c/0x7e0 flush_pending_writes+0xf0/0x240 raid10d+0xac/0x1ed0
Fix the problem by adding cond_resched() to raid10 like what raid1 did.
Note that unlimited plugged bio still need to be optimized, for example, in the case of lots of dirty pages writeback, this will take lots of memory and io will spend a long time in plug, hence io latency is bad.
--- drivers/md/raid10.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/raid10.c +2 -0
@@ -920,6 +920,7 @@ static void flush_pending_writes(struct r10conf *conf)raid1_submit_write (bio); bio = next; +cond_resched (); }blk_finish_plug (&plug); }else
@@ -1130,6 +1131,7 @@ static void raid10_unplug(struct blk_plug_cb *cb, bool from_schedule)raid1_submit_write (bio); bio = next; +cond_resched (); }kfree (plug); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/451 io_uring/unix: drop usage of io_uring socket
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
Commit a4104821ad651d8a0b374f0b2474c345bbb42f82 upstream.
Since we no longer allow sending io_uring fds over SCM_RIGHTS, move to using io_is_uring_fops() to detect whether this is a io_uring fd or not. With that done, kill off io_uring_get_socket() as nobody calls it anymore.
This is in preparation to yanking out the rest of the core related to unix gc with io_uring.
--- include/linux/io_uring.h | 10 +++++----- io_uring/io_uring.c | 13 ------------- io_uring/io_uring.h | 1 - net/core/scm.c | 2 +- net/unix/scm.c | 4 +--- 5 files changed, 7 insertions(+), 23 deletions(-)
include/linux/io_uring.h +5 -5
@@ -42,11 +42,11 @@ void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, ssize_t res2, unsigned issue_flags);void io_uring_cmd_complete_in_task (struct io_uring_cmd *ioucmd,void (*task_work_cb)(struct io_uring_cmd *,unsigned )); -struct sock *io_uring_get_socket (struct file *file);void __io_uring_cancel (bool cancel_all);void __io_uring_free (struct task_struct *tsk);void io_uring_unreg_ringfd (void );const char *io_uring_get_opcode (u8 opcode); +bool io_is_uring_fops (struct file *file);static inline void io_uring_files_cancel (void ) {
@@ -71,6 +71,10 @@ static inline int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, {return -EOPNOTSUPP ; } +static inline bool io_is_uring_fops (struct file *file) +{ +return false; +}static inline void io_uring_cmd_done (struct io_uring_cmd *cmd,ssize_t ret,ssize_t ret2,unsigned issue_flags) {
@@ -79,10 +83,6 @@ static inline void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd, void (*task_work_cb)(struct io_uring_cmd *, unsigned)) { } -static inline struct sock *io_uring_get_socket (struct file *file) -{ -return NULL ; -}static inline void io_uring_task_cancel (void ) { }
io_uring/io_uring.c +0 -13
@@ -153,19 +153,6 @@ static void __io_submit_flush_completions(struct io_ring_ctx *ctx);static struct kmem_cache *req_cachep; -struct sock *io_uring_get_socket (struct file *file) -{ -#if defined(CONFIG_UNIX ) -if (io_is_uring_fops (file)) { -struct io_ring_ctx *ctx = file->private_data; - -return ctx->ring_sock->sk; - } -#endif -return NULL ; -} -EXPORT_SYMBOL (io_uring_get_socket); -static inline void io_submit_flush_completions (struct io_ring_ctx *ctx) {if (!wq_list_empty (&ctx->submit_state.compl_reqs))
io_uring/io_uring.h +0 -1
@@ -52,7 +52,6 @@ static inline bool io_req_ffs_set(struct io_kiocb *req) }void __io_req_task_work_add (struct io_kiocb *req,bool allow_local); -bool io_is_uring_fops (struct file *file);bool io_alloc_async_data (struct io_kiocb *req);void io_req_task_queue (struct io_kiocb *req);void io_queue_iowq (struct io_kiocb *req,bool *dont_use);
net/core/scm.c +1 -1
@@ -105,7 +105,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)if (fd <0 || !(file =fget_raw (fd)))return -EBADF ;/* don't allow io_uring files */ -if (io_uring_get_socket (file)) { +if (io_is_uring_fops (file)) {fput (file);return -EINVAL ; }
net/unix/scm.c +1 -3
@@ -34,10 +34,8 @@ struct sock *unix_get_socket(struct file *filp)/* PF_UNIX ? */ if (s && sock->ops && sock->ops->family ==PF_UNIX ) u_sock = s; - }else { -/* Could be an io_uring instance */ - u_sock =io_uring_get_socket (filp); } +return u_sock; }EXPORT_SYMBOL (unix_get_socket);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/451 io_uring: drop any code related to SCM_RIGHTS
In reply to Sasha LevinFrom: Jens Axboe <[email protected]>
Commit 6e5e6d274956305f1fc0340522b38f5f5be74bdb upstream.
This is dead code after we dropped support for passing io_uring fds over SCM_RIGHTS, get rid of it.
--- include/linux/io_uring_types.h | 3 - io_uring/filetable.c | 10 +-- io_uring/io_uring.c | 31 +------ io_uring/rsrc.c | 151 +-------------------------------- io_uring/rsrc.h | 15 ---- 5 files changed, 8 insertions(+), 202 deletions(-)
include/linux/io_uring_types.h +0 -3
@@ -330,9 +330,6 @@ struct io_ring_ctx {struct list_head io_buffers_pages; -#if defined(CONFIG_UNIX ) -struct socket *ring_sock; -#endif /* hashed buffered write serialization */ struct io_wq_hash *hash_map;
io_uring/filetable.c +4 -6
@@ -95,12 +95,10 @@ static int io_install_fixed_file(struct io_ring_ctx *ctx, struct file *file, needs_switch = true; } - ret =io_scm_file_account (ctx, file); -if (!ret) { - *io_get_tag_slot (ctx->file_data, slot_index) =0 ; -io_fixed_file_set (file_slot, file); -io_file_bitmap_set (&ctx->file_table, slot_index); - } + *io_get_tag_slot (ctx->file_data, slot_index) =0 ; +io_fixed_file_set (file_slot, file); +io_file_bitmap_set (&ctx->file_table, slot_index); +return 0 ; err:if (needs_switch)io_rsrc_node_switch (ctx, ctx->file_data);
io_uring/io_uring.c +2 -29
@@ -60,7 +60,6 @@#include <linux/net.h> #include <net/sock.h> #include <net/af_unix.h> -#include <net/scm.h> #include <linux/anon_inodes.h> #include <linux/sched/mm.h> #include <linux/uaccess.h>
@@ -2628,12 +2627,6 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)WARN_ON_ONCE (!list_empty (&ctx->rsrc_ref_list));WARN_ON_ONCE (!llist_empty (&ctx->rsrc_put_llist)); -#if defined(CONFIG_UNIX ) -if (ctx->ring_sock) { - ctx->ring_sock->file =NULL ;/* so that iput() is called */ -sock_release (ctx->ring_sock); - } -#endif WARN_ON_ONCE (!list_empty (&ctx->ltimeout_list));if (ctx->mm_account) {
@@ -3438,32 +3431,12 @@ static int io_uring_install_fd(struct io_ring_ctx *ctx, struct file *file)/* * Allocate an anonymous fd, this is what constitutes the application * visible backing of an io_uring instance. The application mmaps this -* fd to gain access to the SQ/CQ ring details. If UNIX sockets are enabled, -* we have to tie this fd to a socket for file garbage collection purposes. +* fd to gain access to the SQ/CQ ring details. */ static struct file *io_uring_get_file (struct io_ring_ctx *ctx) { -struct file *file; -#if defined(CONFIG_UNIX ) -int ret; - - ret =sock_create_kern (&init_net,PF_UNIX ,SOCK_RAW ,IPPROTO_IP , - &ctx->ring_sock); -if (ret) -return ERR_PTR (ret); -#endif - - file =anon_inode_getfile_secure ("[io_uring]" , &io_uring_fops, ctx, +return anon_inode_getfile_secure ("[io_uring]" , &io_uring_fops, ctx,O_RDWR |O_CLOEXEC ,NULL ); -#if defined(CONFIG_UNIX ) -if (IS_ERR (file)) { -sock_release (ctx->ring_sock); - ctx->ring_sock =NULL ; - }else { - ctx->ring_sock->file = file; - } -#endif -return file; } static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
io_uring/rsrc.c +2 -149
190 lines not on this page · raw message
io_uring/rsrc.h +0 -15
@@ -77,21 +77,6 @@ int io_sqe_files_unregister(struct io_ring_ctx *ctx);int io_sqe_files_register (struct io_ring_ctx *ctx,void __user *arg,unsigned nr_args,u64 __user *tags); -int __io_scm_file_account (struct io_ring_ctx *ctx,struct file *file); - -static inline bool io_file_need_scm (struct file *filp) -{ -return false; -} - -static inline int io_scm_file_account (struct io_ring_ctx *ctx, -struct file *file) -{ -if (likely (!io_file_need_scm (file))) -return 0 ; -return __io_scm_file_account (ctx, file); -} -int io_register_files_update (struct io_ring_ctx *ctx,void __user *arg,unsigned nr_args); int io_register_rsrc_update(struct io_ring_ctx *ctx, void __user *arg,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/451 nfsd: allow nfsd_file_get to sanely handle a NULL pointer
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit 70f62231cdfd52357836733dd31db787e0412ab2 ]
...and remove some now-useless NULL pointer checks in its callers.
--- fs/nfsd/filecache.c | 5 ++--- fs/nfsd/nfs4state.c | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-)
fs/nfsd/filecache.c +2 -3
@@ -431,7 +431,7 @@ static bool nfsd_file_lru_remove(struct nfsd_file *nf)struct nfsd_file *nfsd_file_get (struct nfsd_file *nf) { -if (likely (refcount_inc_not_zero (&nf->nf_ref))) +if (nf &&refcount_inc_not_zero (&nf->nf_ref))return nf;return NULL ; }
@@ -1086,8 +1086,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,rcu_read_lock (); nf =rhashtable_lookup (&nfsd_file_rhash_tbl, &key, nfsd_file_rhash_params); -if (nf) - nf =nfsd_file_get (nf); + nf =nfsd_file_get (nf);rcu_read_unlock ();if (nf) {
fs/nfsd/nfs4state.c +1 -3
@@ -602,9 +602,7 @@ put_nfs4_file(struct nfs4_file *fi)static struct nfsd_file *__nfs4_get_fd (struct nfs4_file *f,int oflag) { -if (f->fi_fds[oflag]) -return nfsd_file_get (f->fi_fds[oflag]); -return NULL ; +return nfsd_file_get (f->fi_fds[oflag]); } static struct nfsd_file *
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/451 nfsd: don't open-code clear_and_wake_up_bit
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit b8bea9f6cdd7236c7c2238d022145e9b2f8aac22 ]
--- fs/nfsd/filecache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfsd/filecache.c +1 -3
@@ -1174,9 +1174,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, status = nfserr_jukebox;if (status != nfs_ok)nfsd_file_unhash (nf); -clear_bit_unlock (NFSD_FILE_PENDING , &nf->nf_flags); -smp_mb__after_atomic (); -wake_up_bit (&nf->nf_flags,NFSD_FILE_PENDING ); +clear_and_wake_up_bit (NFSD_FILE_PENDING , &nf->nf_flags); goto out; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/451 nfsd: NFSD_FILE_KEY_INODE only needs to find GC'ed entries
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit 6c31e4c98853a4ba47355ea151b36a77c42b7734 ]
Since v4 files are expected to be long-lived, there's little value in closing them out of the cache when there is conflicting access.
Change the comparator to also match the gc value in the key. Change both of the current users of that key to set the gc value in the key to "true".
--- fs/nfsd/filecache.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nfsd/filecache.c +4 -0
@@ -175,6 +175,8 @@ static int nfsd_file_obj_cmpfn(struct rhashtable_compare_arg *arg,switch (key->type) {case NFSD_FILE_KEY_INODE : +if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc) +return 1 ;if (nf->nf_inode != key->inode)return 1 ;break ;
@@ -695,6 +697,7 @@ nfsd_file_queue_for_close(struct inode *inode, struct list_head *dispose)struct nfsd_file_lookup_key key = { .type =NFSD_FILE_KEY_INODE , .inode = inode, + .gc = true, };struct nfsd_file *nf;
@@ -1049,6 +1052,7 @@ nfsd_file_is_cached(struct inode *inode)struct nfsd_file_lookup_key key = { .type =NFSD_FILE_KEY_INODE , .inode = inode, + .gc = true, };bool ret = false;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/451 nfsd: simplify test_bit return in NFSD_FILE_KEY_FULL comparator
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit d69b8dbfd0866abc5ec84652cc1c10fc3d4d91ef ]
test_bit returns bool, so we can just compare the result of that to the key->gc value without the "!!".
--- fs/nfsd/filecache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/filecache.c +1 -1
@@ -189,7 +189,7 @@ static int nfsd_file_obj_cmpfn(struct rhashtable_compare_arg *arg,return 1 ;if (!nfsd_match_cred (nf->nf_cred, key->cred))return 1 ; -if (!!test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc) +if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc)return 1 ;if (test_bit (NFSD_FILE_HASHED , &nf->nf_flags) ==0 )return 1 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/451 nfsd: don't kill nfsd_files because of lease break error
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit c6593366c0bf222be9c7561354dfb921c611745e ]
An error from break_lease is non-fatal, so we needn't destroy the nfsd_file in that case. Just put the reference like we normally would and return the error.
--- fs/nfsd/filecache.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
fs/nfsd/filecache.c +15 -14
@@ -1102,7 +1102,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, nf =nfsd_file_alloc (&key, may_flags);if (!nf) { status = nfserr_jukebox; - goto out_status; + goto out; } ret = rhashtable_lookup_insert_key(&nfsd_file_rhash_tbl,
@@ -1111,13 +1111,11 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,if (likely (ret ==0 )) goto open_file; -nfsd_file_slab_free (&nf->nf_rcu); - nf =NULL ;if (ret == -EEXIST ) goto retry;trace_nfsd_file_insert_err (rqstp, key.inode, may_flags, ret); status = nfserr_jukebox; - goto out_status; + goto construction_err; wait_for_construction:wait_on_bit (&nf->nf_flags,NFSD_FILE_PENDING ,TASK_UNINTERRUPTIBLE );
@@ -1127,29 +1125,25 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,trace_nfsd_file_cons_err (rqstp, key.inode, may_flags, nf);if (!open_retry) { status = nfserr_jukebox; - goto out; + goto construction_err; } open_retry = false; -if (refcount_dec_and_test (&nf->nf_ref)) -nfsd_file_free (nf); goto retry; } -this_cpu_inc (nfsd_file_cache_hits); status =nfserrno (nfsd_open_break_lease (file_inode (nf->nf_file), may_flags)); +if (status != nfs_ok) { +nfsd_file_put (nf); + nf =NULL ; + } + out:if (status == nfs_ok) {this_cpu_inc (nfsd_file_acquisitions);nfsd_file_check_write_error (nf); *pnf = nf; - }else { -if (refcount_dec_and_test (&nf->nf_ref)) -nfsd_file_free (nf); - nf =NULL ; } - -out_status:put_cred (key.cred);trace_nfsd_file_acquire (rqstp, key.inode, may_flags, nf, status);return status;
@@ -1179,6 +1173,13 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,if (status != nfs_ok)nfsd_file_unhash (nf);clear_and_wake_up_bit (NFSD_FILE_PENDING , &nf->nf_flags); +if (status == nfs_ok) + goto out; + +construction_err: +if (refcount_dec_and_test (&nf->nf_ref)) +nfsd_file_free (nf); + nf =NULL ; goto out; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 10/451 nfsd: add some comments to nfsd_file_do_acquire
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit b680cb9b737331aad271feebbedafb865504e234 ]
David Howells mentioned that he found this bit of code confusing, so sprinkle in some comments to clarify.
--- fs/nfsd/filecache.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/nfsd/filecache.c +5 -0
@@ -1094,6 +1094,11 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,rcu_read_unlock ();if (nf) { +/* +* If the nf is on the LRU then it holds an extra reference +* that must be put if it's removed. It had better not be +* the last one however, since we should hold another. +*/ if (nfsd_file_lru_remove (nf))WARN_ON_ONCE (refcount_dec_and_test (&nf->nf_ref)); goto wait_for_construction;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 11/451 nfsd: don't take/put an extra reference when putting a file
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit b2ff1bd71db2a1b193a6dde0845adcd69cbcf75e ]
The last thing that filp_close does is an fput, so don't bother taking and putting the extra reference.
--- fs/nfsd/filecache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfsd/filecache.c +1 -3
@@ -382,10 +382,8 @@ nfsd_file_free(struct nfsd_file *nf)if (nf->nf_mark)nfsd_file_mark_put (nf->nf_mark);if (nf->nf_file) { -get_file (nf->nf_file); -filp_close (nf->nf_file,NULL );nfsd_file_check_write_error (nf); -fput (nf->nf_file); +filp_close (nf->nf_file,NULL ); }/*
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/451 nfsd: update comment over __nfsd_file_cache_purge
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit 972cc0e0924598cb293b919d39c848dc038b2c28 ]
--- fs/nfsd/filecache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfsd/filecache.c +2 -1
@@ -907,7 +907,8 @@ nfsd_file_cache_init(void)* @net: net-namespace to shut down the cache (may be NULL) * * Walk the nfsd_file cache and close out any that match @net. If @net is NULL, -* then close out everything. Called when an nfsd instance is being shut down. +* then close out everything. Called when an nfsd instance is being shut down, +* and when the exports table is flushed. */ static void __nfsd_file_cache_purge (struct net *net)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/451 nfsd: allow reaping files still under writeback
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit dcb779fcd4ed5984ad15991d574943d12a8693d1 ]
On most filesystems, there is no reason to delay reaping an nfsd_file just because its underlying inode is still under writeback. nfsd just relies on client activity or the local flusher threads to do writeback.
The main exception is NFS, which flushes all of its dirty data on last close. Add a new EXPORT_OP_FLUSH_ON_CLOSE flag to allow filesystems to signal that they do this, and only skip closing files under writeback on such filesystems.
Also, remove a redundant NULL file pointer check in nfsd_file_check_writeback, and clean up nfs's export op flag definitions.
--- fs/nfs/export.c | 9 ++++++--- fs/nfsd/filecache.c | 12 +++++++++++- include/linux/exportfs.h | 1 + 3 files changed, 18 insertions(+), 4 deletions(-)
fs/nfs/export.c +6 -3
@@ -156,7 +156,10 @@ const struct export_operations nfs_export_ops = { .fh_to_dentry = nfs_fh_to_dentry, .get_parent = nfs_get_parent, .fetch_iversion = nfs_fetch_iversion, - .flags =EXPORT_OP_NOWCC |EXPORT_OP_NOSUBTREECHK | -EXPORT_OP_CLOSE_BEFORE_UNLINK |EXPORT_OP_REMOTE_FS | - EXPORT_OP_NOATOMIC_ATTR, + .flags =EXPORT_OP_NOWCC | +EXPORT_OP_NOSUBTREECHK | +EXPORT_OP_CLOSE_BEFORE_UNLINK | +EXPORT_OP_REMOTE_FS | +EXPORT_OP_NOATOMIC_ATTR | + EXPORT_OP_FLUSH_ON_CLOSE, };
fs/nfsd/filecache.c +11 -1
@@ -402,13 +402,23 @@ nfsd_file_check_writeback(struct nfsd_file *nf)struct file *file = nf->nf_file;struct address_space *mapping; -if (!file || !(file->f_mode &FMODE_WRITE )) +/* File not open for write? */ +if (!(file->f_mode &FMODE_WRITE ))return false; + +/* +* Some filesystems (e.g. NFS) flush all dirty data on close. +* On others, there is no need to wait for writeback. +*/ +if (!(file_inode (file)->i_sb->s_export_op->flags &EXPORT_OP_FLUSH_ON_CLOSE )) +return false; + mapping = file->f_mapping;return mapping_tagged (mapping,PAGECACHE_TAG_DIRTY ) ||mapping_tagged (mapping,PAGECACHE_TAG_WRITEBACK ); } +static bool nfsd_file_lru_add (struct nfsd_file *nf) {set_bit (NFSD_FILE_REFERENCED , &nf->nf_flags);
include/linux/exportfs.h +1 -0
@@ -221,6 +221,7 @@ struct export_operations {#define EXPORT_OP_NOATOMIC_ATTR (0x10)/* Filesystem cannot supply atomic attribute updates */ +#define EXPORT_OP_FLUSH_ON_CLOSE (0x20)/* fs flushes file data on close */ unsigned long flags; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 14/451 NFSD: Convert filecache to rhltable
In reply to Sasha LevinFrom: Chuck Lever <[email protected]>
[ Upstream commit c4c649ab413ba6a785b25f0edbb12f617c87db2a ]
While we were converting the nfs4_file hashtable to use the kernel's resizable hashtable data structure, Neil Brown observed that the list variant (rhltable) would be better for managing nfsd_file items as well. The nfsd_file hash table will contain multiple entries for the same inode -- these should be kept together on a list. And, it could be possible for exotic or malicious client behavior to cause the hash table to resize itself on every insertion.
A nice simplification is that rhltable_lookup() can return a list that contains only nfsd_file items that match a given inode, which enables us to eliminate specialized hash table helper functions and use the default functions provided by the rhashtable implementation).
Since we are now storing nfsd_file items for the same inode on a single list, that effectively reduces the number of hash entries that have to be tracked in the hash table. The mininum bucket count is therefore lowered.
Light testing with fstests generic/531 show no regressions.
--- fs/nfsd/filecache.c | 311 ++++++++++++++++++-------------------------- fs/nfsd/filecache.h | 9 +- 2 files changed, 133 insertions(+), 187 deletions(-)
fs/nfsd/filecache.c +128 -183
@@ -74,70 +74,9 @@ static struct list_lru nfsd_file_lru;static unsigned long nfsd_file_flags;static struct fsnotify_group *nfsd_file_fsnotify_group;static struct delayed_work nfsd_filecache_laundrette; -static struct rhashtable nfsd_file_rhash_tbl +static struct rhltable nfsd_file_rhltable____cacheline_aligned_in_smp ; -enum nfsd_file_lookup_type { -NFSD_FILE_KEY_INODE , -NFSD_FILE_KEY_FULL , -}; - -struct nfsd_file_lookup_key { -struct inode *inode; -struct net *net; -const struct cred *cred; -unsigned char need; -bool gc; -enum nfsd_file_lookup_type type; -}; - -/* -* The returned hash value is based solely on the address of an in-code -* inode, a pointer to a slab-allocated object. The entropy in such a -* pointer is concentrated in its middle bits. -*/ -static u32 nfsd_file_inode_hash (const struct inode *inode,u32 seed) -{ -unsigned long ptr = (unsigned long )inode; -u32 k; - - k = ptr >>L1_CACHE_SHIFT ; - k &=0x00ffffff ; -return jhash2 (&k,1 , seed); -} - -/** -* nfsd_file_key_hashfn - Compute the hash value of a lookup key -* @data: key on which to compute the hash value -* @len: rhash table's key_len parameter (unused) -* @seed: rhash table's random seed of the day -* -* Return value: -* Computed 32-bit hash value -*/ -static u32 nfsd_file_key_hashfn (const void *data,u32 len,u32 seed) -{ -const struct nfsd_file_lookup_key *key = data; - -return nfsd_file_inode_hash (key->inode, seed); -} - -/** -* nfsd_file_obj_hashfn - Compute the hash value of an nfsd_file -* @data: object on which to compute the hash value -* @len: rhash table's key_len parameter (unused) -* @seed: rhash table's random seed of the day -* -* Return value: -* Computed 32-bit hash value -*/ -static u32 nfsd_file_obj_hashfn (const void *data,u32 len,u32 seed) -{ -const struct nfsd_file *nf = data; - -return nfsd_file_inode_hash (nf->nf_inode, seed); -} -static bool nfsd_match_cred (const struct cred *c1,const struct cred *c2) {
@@ -158,55 +97,16 @@ nfsd_match_cred(const struct cred *c1, const struct cred *c2)return true; } -/** -* nfsd_file_obj_cmpfn - Match a cache item against search criteria -* @arg: search criteria -* @ptr: cache item to check -* -* Return values: -* %0 - Item matches search criteria -* %1 - Item does not match search criteria -*/ -static int nfsd_file_obj_cmpfn (struct rhashtable_compare_arg *arg, -const void *ptr) -{ -const struct nfsd_file_lookup_key *key = arg->key; -const struct nfsd_file *nf = ptr; - -switch (key->type) { -case NFSD_FILE_KEY_INODE : -if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc) -return 1 ; -if (nf->nf_inode != key->inode) -return 1 ; -break ; -case NFSD_FILE_KEY_FULL : -if (nf->nf_inode != key->inode) -return 1 ; -if (nf->nf_may != key->need) -return 1 ; -if (nf->nf_net != key->net) -return 1 ; -if (!nfsd_match_cred (nf->nf_cred, key->cred)) -return 1 ; -if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != key->gc) -return 1 ; -if (test_bit (NFSD_FILE_HASHED , &nf->nf_flags) ==0 ) -return 1 ; -break ; - } -return 0 ; -} -static const struct rhashtable_params nfsd_file_rhash_params = { .key_len = sizeof_field(struct nfsd_file, nf_inode), .key_offset = offsetof(struct nfsd_file , nf_inode), - .head_offset = offsetof(struct nfsd_file , nf_rhash), - .hashfn = nfsd_file_key_hashfn, - .obj_hashfn = nfsd_file_obj_hashfn, - .obj_cmpfn = nfsd_file_obj_cmpfn, -/* Reduce resizing churn on light workloads */ - .min_size =512 ,/* buckets */ + .head_offset = offsetof(struct nfsd_file , nf_rlist), + +/* +* Start with a single page hash table to reduce resizing churn +* on light workloads. +*/ + .min_size =256 , .automatic_shrinking = true, };
@@ -309,27 +209,27 @@ nfsd_file_mark_find_or_create(struct nfsd_file *nf, struct inode *inode) }static struct nfsd_file * -nfsd_file_alloc (struct nfsd_file_lookup_key *key,unsigned int may) +nfsd_file_alloc (struct net *net,struct inode *inode,unsigned char need, +bool want_gc) {struct nfsd_file *nf; nf =kmem_cache_alloc (nfsd_file_slab,GFP_KERNEL ); -if (nf) { -INIT_LIST_HEAD (&nf->nf_lru); - nf->nf_birthtime =ktime_get (); - nf->nf_file =NULL ; - nf->nf_cred =get_current_cred (); - nf->nf_net = key->net; - nf->nf_flags =0 ; -__set_bit (NFSD_FILE_HASHED , &nf->nf_flags); -__set_bit (NFSD_FILE_PENDING , &nf->nf_flags); -if (key->gc) -__set_bit (NFSD_FILE_GC , &nf->nf_flags); - nf->nf_inode = key->inode; -refcount_set (&nf->nf_ref,1 ); - nf->nf_may = key->need; - nf->nf_mark =NULL ; - } +if (unlikely (!nf)) +return NULL ; + +INIT_LIST_HEAD (&nf->nf_lru); + nf->nf_birthtime =ktime_get (); + nf->nf_file =NULL ; + nf->nf_cred =get_current_cred (); + nf->nf_net = net; + nf->nf_flags = want_gc ? +BIT (NFSD_FILE_HASHED ) |BIT (NFSD_FILE_PENDING ) |BIT (NFSD_FILE_GC ) : +BIT (NFSD_FILE_HASHED ) |BIT (NFSD_FILE_PENDING ); + nf->nf_inode = inode; +refcount_set (&nf->nf_ref,1 ); + nf->nf_may = need; + nf->nf_mark =NULL ;return nf; }
@@ -354,8 +254,8 @@ static void nfsd_file_hash_remove(struct nfsd_file *nf) {trace_nfsd_file_unhash (nf); -rhashtable_remove_fast (&nfsd_file_rhash_tbl, &nf->nf_rhash, - nfsd_file_rhash_params); +rhltable_remove (&nfsd_file_rhltable, &nf->nf_rlist, + nfsd_file_rhash_params); } static bool
@@ -688,8 +588,8 @@ nfsd_file_cond_queue(struct nfsd_file *nf, struct list_head *dispose)* @inode: inode on which to close out nfsd_files * @dispose: list on which to gather nfsd_files to close out * -* An nfsd_file represents a struct file being held open on behalf of nfsd. An -* open file however can block other activity (such as leases), or cause +* An nfsd_file represents a struct file being held open on behalf of nfsd. +* An open file however can block other activity (such as leases), or cause * undesirable behavior (e.g. spurious silly-renames when reexporting NFS). * * This function is intended to find open nfsd_files when this sort of
@@ -702,21 +602,17 @@ nfsd_file_cond_queue(struct nfsd_file *nf, struct list_head *dispose)static void nfsd_file_queue_for_close (struct inode *inode,struct list_head *dispose) { -struct nfsd_file_lookup_key key = { - .type =NFSD_FILE_KEY_INODE , - .inode = inode, - .gc = true, - }; +struct rhlist_head *tmp, *list;struct nfsd_file *nf;rcu_read_lock (); -do { - nf =rhashtable_lookup (&nfsd_file_rhash_tbl, &key, - nfsd_file_rhash_params); -if (!nf) -break ; + list =rhltable_lookup (&nfsd_file_rhltable, &inode, + nfsd_file_rhash_params); +rhl_for_each_entry_rcu (nf, tmp, list, nf_rlist) { +if (!test_bit (NFSD_FILE_GC , &nf->nf_flags)) +continue ;nfsd_file_cond_queue (nf, dispose); - }while (1 ); + }rcu_read_unlock (); }
@@ -840,7 +736,7 @@ nfsd_file_cache_init(void)if (test_and_set_bit (NFSD_FILE_CACHE_UP , &nfsd_file_flags) ==1 )return 0 ; - ret =rhashtable_init (&nfsd_file_rhash_tbl, &nfsd_file_rhash_params); + ret =rhltable_init (&nfsd_file_rhltable, &nfsd_file_rhash_params);if (ret)return ret;
@@ -908,7 +804,7 @@ nfsd_file_cache_init(void) nfsd_file_mark_slab =NULL ;destroy_workqueue (nfsd_filecache_wq); nfsd_filecache_wq =NULL ; -rhashtable_destroy (&nfsd_file_rhash_tbl); +rhltable_destroy (&nfsd_file_rhltable); goto out; }
@@ -927,7 +823,7 @@ __nfsd_file_cache_purge(struct net *net)struct nfsd_file *nf;LIST_HEAD (dispose); -rhashtable_walk_enter (&nfsd_file_rhash_tbl, &iter); +rhltable_walk_enter (&nfsd_file_rhltable, &iter); do { rhashtable_walk_start(&iter);
@@ -1033,7 +929,7 @@ nfsd_file_cache_shutdown(void) nfsd_file_mark_slab =NULL ;destroy_workqueue (nfsd_filecache_wq); nfsd_filecache_wq =NULL ; -rhashtable_destroy (&nfsd_file_rhash_tbl); +rhltable_destroy (&nfsd_file_rhltable);for_each_possible_cpu (i) {per_cpu (nfsd_file_cache_hits, i) =0 ;
@@ -1044,6 +940,35 @@ nfsd_file_cache_shutdown(void) } } +static struct nfsd_file * +nfsd_file_lookup_locked (const struct net *net,const struct cred *cred, +struct inode *inode,unsigned char need, +bool want_gc) +{ +struct rhlist_head *tmp, *list; +struct nfsd_file *nf; + + list =rhltable_lookup (&nfsd_file_rhltable, &inode, + nfsd_file_rhash_params); +rhl_for_each_entry_rcu (nf, tmp, list, nf_rlist) { +if (nf->nf_may != need) +continue ; +if (nf->nf_net != net) +continue ; +if (!nfsd_match_cred (nf->nf_cred, cred)) +continue ; +if (test_bit (NFSD_FILE_GC , &nf->nf_flags) != want_gc) +continue ; +if (test_bit (NFSD_FILE_HASHED , &nf->nf_flags) ==0 ) +continue ; + +if (!nfsd_file_get (nf)) +continue ; +return nf; + } +return NULL ; +} +/** * nfsd_file_is_cached - are there any cached open files for this inode? * @inode: inode to check
@@ -1058,16 +983,20 @@ nfsd_file_cache_shutdown(void)bool nfsd_file_is_cached (struct inode *inode) { -struct nfsd_file_lookup_key key = { - .type =NFSD_FILE_KEY_INODE , - .inode = inode, - .gc = true, - }; +struct rhlist_head *tmp, *list; +struct nfsd_file *nf;bool ret = false; -if (rhashtable_lookup_fast (&nfsd_file_rhash_tbl, &key, - nfsd_file_rhash_params) !=NULL ) - ret = true; +rcu_read_lock (); + list =rhltable_lookup (&nfsd_file_rhltable, &inode, + nfsd_file_rhash_params); +rhl_for_each_entry_rcu (nf, tmp, list, nf_rlist) +if (test_bit (NFSD_FILE_GC , &nf->nf_flags)) { + ret = true; +break ; + } +rcu_read_unlock (); +trace_nfsd_file_is_cached (inode, (int )ret);return ret; }
@@ -1077,14 +1006,12 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, unsigned int may_flags, struct file *file, struct nfsd_file **pnf, bool want_gc) { - struct nfsd_file_lookup_key key = { - .type =NFSD_FILE_KEY_FULL , - .need = may_flags &NFSD_FILE_MAY_MASK , - .net =SVC_NET (rqstp), - .gc = want_gc, - }; + unsigned char need = may_flags & NFSD_FILE_MAY_MASK; +struct net *net =SVC_NET (rqstp); +struct nfsd_file *new, *nf; +const struct cred *cred;bool open_retry = true; -struct nfsd_file *nf; +struct inode *inode;__be32 status;int ret;
@@ -1092,14 +1019,12 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, may_flags|NFSD_MAY_OWNER_OVERRIDE);if (status != nfs_ok)return status; - key.inode =d_inode (fhp->fh_dentry); - key.cred =get_current_cred (); + inode =d_inode (fhp->fh_dentry); + cred =get_current_cred (); retry:rcu_read_lock (); - nf =rhashtable_lookup (&nfsd_file_rhash_tbl, &key, - nfsd_file_rhash_params); - nf =nfsd_file_get (nf); + nf =nfsd_file_lookup_locked (net, cred, inode, need, want_gc);rcu_read_unlock ();if (nf) {
@@ -1113,21 +1038,32 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp, goto wait_for_construction; } - nf =nfsd_file_alloc (&key, may_flags); -if (!nf) { + new =nfsd_file_alloc (net, inode, need, want_gc); +if (!new) { status = nfserr_jukebox; goto out; } - ret =rhashtable_lookup_insert_key (&nfsd_file_rhash_tbl, - &key, &nf->nf_rhash, - nfsd_file_rhash_params); +rcu_read_lock (); +spin_lock (&inode->i_lock); + nf =nfsd_file_lookup_locked (net, cred, inode, need, want_gc); +if (unlikely (nf)) { +spin_unlock (&inode->i_lock); +rcu_read_unlock (); +nfsd_file_slab_free (&new->nf_rcu); + goto wait_for_construction; + } + nf = new; + ret =rhltable_insert (&nfsd_file_rhltable, &nf->nf_rlist, + nfsd_file_rhash_params); +spin_unlock (&inode->i_lock); +rcu_read_unlock ();if (likely (ret ==0 )) goto open_file;if (ret == -EEXIST ) goto retry; -trace_nfsd_file_insert_err (rqstp, key.inode, may_flags, ret); +trace_nfsd_file_insert_err (rqstp, inode, may_flags, ret); status = nfserr_jukebox; goto construction_err;
@@ -1136,7 +1072,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,/* Did construction of this file fail? */ if (!test_bit (NFSD_FILE_HASHED , &nf->nf_flags)) { -trace_nfsd_file_cons_err (rqstp, key.inode, may_flags, nf); +trace_nfsd_file_cons_err (rqstp, inode, may_flags, nf);if (!open_retry) { status = nfserr_jukebox; goto construction_err;
@@ -1158,13 +1094,13 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,nfsd_file_check_write_error (nf); *pnf = nf; } -put_cred (key.cred); -trace_nfsd_file_acquire (rqstp, key.inode, may_flags, nf, status); +put_cred (cred); +trace_nfsd_file_acquire (rqstp, inode, may_flags, nf, status);return status; open_file:trace_nfsd_file_alloc (nf); - nf->nf_mark =nfsd_file_mark_find_or_create (nf, key.inode); + nf->nf_mark =nfsd_file_mark_find_or_create (nf, inode);if (nf->nf_mark) {if (file) {get_file (file);
@@ -1182,7 +1118,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,* If construction failed, or we raced with a call to unlink() * then unhash. */ -if (status == nfs_ok && key.inode->i_nlink ==0 ) +if (status != nfs_ok || inode->i_nlink ==0 ) status = nfserr_jukebox;if (status != nfs_ok)nfsd_file_unhash (nf);
@@ -1209,8 +1145,11 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,* seconds after the final nfsd_file_put() in case the caller * wants to re-use it. * -* Returns nfs_ok and sets @pnf on success; otherwise an nfsstat in -* network byte order is returned. +* Return values: +* %nfs_ok - @pnf points to an nfsd_file with its reference +* count boosted. +* +* On error, an nfsstat value in network byte order is returned. */ __be32 nfsd_file_acquire_gc(struct svc_rqst *rqstp, struct svc_fh *fhp,
@@ -1230,8 +1169,11 @@ nfsd_file_acquire_gc(struct svc_rqst *rqstp, struct svc_fh *fhp,* but not garbage-collected. The object is unhashed after the * final nfsd_file_put(). * -* Returns nfs_ok and sets @pnf on success; otherwise an nfsstat in -* network byte order is returned. +* Return values: +* %nfs_ok - @pnf points to an nfsd_file with its reference +* count boosted. +* +* On error, an nfsstat value in network byte order is returned. */ __be32 nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
@@ -1252,8 +1194,11 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,* and @file is non-NULL, use it to instantiate a new nfsd_file instead of * opening a new one. * -* Returns nfs_ok and sets @pnf on success; otherwise an nfsstat in -* network byte order is returned. +* Return values: +* %nfs_ok - @pnf points to an nfsd_file with its reference +* count boosted. +* +* On error, an nfsstat value in network byte order is returned. */ __be32 nfsd_file_acquire_opened(struct svc_rqst *rqstp, struct svc_fh *fhp,
@@ -1284,7 +1229,7 @@ int nfsd_file_cache_stats_show(struct seq_file *m, void *v) lru =list_lru_count (&nfsd_file_lru);rcu_read_lock (); - ht = &nfsd_file_rhash_tbl; + ht = &nfsd_file_rhltable.ht; count =atomic_read (&ht->nelems); tbl =rht_dereference_rcu (ht->tbl, ht); buckets = tbl->size;
@@ -1300,7 +1245,7 @@ int nfsd_file_cache_stats_show(struct seq_file *m, void *v) evictions +=per_cpu (nfsd_file_evictions, i); } -seq_printf (m,"total entries: %u\n" , count); +seq_printf (m,"total inodes: %u\n" , count);seq_printf (m,"hash buckets: %u\n" , buckets);seq_printf (m,"lru entries: %lu\n" , lru);seq_printf (m,"cache hits: %lu\n" , hits);
fs/nfsd/filecache.h +5 -4
@@ -29,9 +29,8 @@ struct nfsd_file_mark {* never be dereferenced, only used for comparison. */ struct nfsd_file { -struct rhash_head nf_rhash; -struct list_head nf_lru; -struct rcu_head nf_rcu; +struct rhlist_head nf_rlist; +void *nf_inode;struct file *nf_file;const struct cred *nf_cred;struct net *nf_net;
@@ -40,10 +39,12 @@ struct nfsd_file {#define NFSD_FILE_REFERENCED (2)#define NFSD_FILE_GC (3)unsigned long nf_flags; -struct inode *nf_inode;/* don't deref */ refcount_t nf_ref;unsigned char nf_may; +struct nfsd_file_mark *nf_mark; +struct list_head nf_lru; +struct rcu_head nf_rcu;ktime_t nf_birthtime; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 15/451 nfsd: simplify the delayed disposal list code
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit 92e4a6733f922f0fef1d0995f7b2d0eaff86c7ea ]
When queueing a dispose list to the appropriate "freeme" lists, it pointlessly queues the objects one at a time to an intermediate list.
Remove a few helpers and just open code a list_move to make it more clear and efficient. Better document the resulting functions with kerneldoc comments.
--- fs/nfsd/filecache.c | 64 ++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 42 deletions(-)
fs/nfsd/filecache.c +22 -42
@@ -402,49 +402,26 @@ nfsd_file_dispose_list(struct list_head *dispose) } } -static void -nfsd_file_list_remove_disposal (struct list_head *dst, -struct nfsd_fcache_disposal *l) -{ -spin_lock (&l->lock); -list_splice_init (&l->freeme, dst); -spin_unlock (&l->lock); -} - -static void -nfsd_file_list_add_disposal (struct list_head *files,struct net *net) -{ -struct nfsd_net *nn =net_generic (net, nfsd_net_id); -struct nfsd_fcache_disposal *l = nn->fcache_disposal; - -spin_lock (&l->lock); -list_splice_tail_init (files, &l->freeme); -spin_unlock (&l->lock); -queue_work (nfsd_filecache_wq, &l->work); -} - -static void -nfsd_file_list_add_pernet (struct list_head *dst,struct list_head *src, -struct net *net) -{ -struct nfsd_file *nf, *tmp; - -list_for_each_entry_safe (nf, tmp, src, nf_lru) { -if (nf->nf_net == net) -list_move_tail (&nf->nf_lru, dst); - } -} - +/** +* nfsd_file_dispose_list_delayed - move list of dead files to net's freeme list +* @dispose: list of nfsd_files to be disposed +* +* Transfers each file to the "freeme" list for its nfsd_net, to eventually +* be disposed of by the per-net garbage collector. +*/ static void nfsd_file_dispose_list_delayed (struct list_head *dispose) { -LIST_HEAD (list); -struct nfsd_file *nf; -while (!list_empty (dispose)) { - nf = list_first_entry(dispose, struct nfsd_file, nf_lru); -nfsd_file_list_add_pernet (&list, dispose, nf->nf_net); -nfsd_file_list_add_disposal (&list, nf->nf_net); +struct nfsd_file *nf =list_first_entry (dispose, + struct nfsd_file, nf_lru); +struct nfsd_net *nn =net_generic (nf->nf_net, nfsd_net_id); +struct nfsd_fcache_disposal *l = nn->fcache_disposal; + +spin_lock (&l->lock); +list_move_tail (&nf->nf_lru, &l->freeme); +spin_unlock (&l->lock); +queue_work (nfsd_filecache_wq, &l->work); } }
@@ -665,8 +642,8 @@ nfsd_file_close_inode_sync(struct inode *inode)* nfsd_file_delayed_close - close unused nfsd_files * @work: dummy * -* Walk the LRU list and destroy any entries that have not been used since -* the last scan. +* Scrape the freeme list for this nfsd_net, and then dispose of them +* all. */ static void nfsd_file_delayed_close (struct work_struct *work)
@@ -675,7 +652,10 @@ nfsd_file_delayed_close(struct work_struct *work)struct nfsd_fcache_disposal *l =container_of (work, struct nfsd_fcache_disposal, work); -nfsd_file_list_remove_disposal (&head, l); +spin_lock (&l->lock); +list_splice_init (&l->freeme, &head); +spin_unlock (&l->lock); +nfsd_file_dispose_list (&head); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 16/451 NFSD: Fix problem of COMMIT and NFS4ERR_DELAY in infinite loop
In reply to Sasha LevinFrom: Dai Ngo <[email protected]>
[ Upstream commit 147abcacee33781e75588869e944ddb07528a897 ]
The following request sequence to the same file causes the NFS client and server getting into an infinite loop with COMMIT and NFS4ERR_DELAY:
OPEN
REMOVE
WRITE
COMMIT
Problem reported by recall11, recall12, recall14, recall20, recall22, recall40, recall42, recall48, recall50 of nfstest suite.
This patch restores the handling of race condition in nfsd_file_do_acquire with unlink to that prior of the regression.
--- fs/nfsd/filecache.c | 2 -- 1 file changed, 2 deletions(-)
fs/nfsd/filecache.c +0 -2
@@ -1099,8 +1099,6 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,* then unhash. */ if (status != nfs_ok || inode->i_nlink ==0 ) - status = nfserr_jukebox; -if (status != nfs_ok)nfsd_file_unhash (nf);clear_and_wake_up_bit (NFSD_FILE_PENDING , &nf->nf_flags);if (status == nfs_ok)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 17/451 NFSD: Add an nfsd4_encode_nfstime4() helper
In reply to Sasha LevinFrom: Chuck Lever <[email protected]>
[ Upstream commit 262176798b18b12fd8ab84c94cfece0a6a652476 ]
Clean up: de-duplicate some common code.
--- fs/nfsd/nfs4xdr.c | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-)
fs/nfsd/nfs4xdr.c +26 -20
@@ -2541,6 +2541,20 @@ static __be32 *encode_change(__be32 *p, struct kstat *stat, struct inode *inode,return p; } +static __be32 nfsd4_encode_nfstime4 (struct xdr_stream *xdr, +struct timespec64 *tv) +{ +__be32 *p; + + p =xdr_reserve_space (xdr,XDR_UNIT *3 ); +if (!p) +return nfserr_resource; + + p =xdr_encode_hyper (p, (s64 )tv->tv_sec); + *p =cpu_to_be32 (tv->tv_nsec); +return nfs_ok; +} +/* * ctime (in NFSv4, time_metadata) is not writeable, and the client * doesn't really care what resolution could theoretically be stored by
@@ -3346,11 +3360,9 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, p =xdr_encode_hyper (p, dummy64); }if (bmval1 &FATTR4_WORD1_TIME_ACCESS ) { - p =xdr_reserve_space (xdr,12 ); -if (!p) - goto out_resource; - p =xdr_encode_hyper (p, (s64 )stat.atime.tv_sec); - *p++ =cpu_to_be32 (stat.atime.tv_nsec); + status =nfsd4_encode_nfstime4 (xdr, &stat.atime); +if (status) + goto out; }if (bmval1 &FATTR4_WORD1_TIME_DELTA ) { p =xdr_reserve_space (xdr,12 );
@@ -3359,25 +3371,19 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, p =encode_time_delta (p,d_inode (dentry)); }if (bmval1 &FATTR4_WORD1_TIME_METADATA ) { - p =xdr_reserve_space (xdr,12 ); -if (!p) - goto out_resource; - p =xdr_encode_hyper (p, (s64 )stat.ctime.tv_sec); - *p++ =cpu_to_be32 (stat.ctime.tv_nsec); + status =nfsd4_encode_nfstime4 (xdr, &stat.ctime); +if (status) + goto out; }if (bmval1 &FATTR4_WORD1_TIME_MODIFY ) { - p =xdr_reserve_space (xdr,12 ); -if (!p) - goto out_resource; - p =xdr_encode_hyper (p, (s64 )stat.mtime.tv_sec); - *p++ =cpu_to_be32 (stat.mtime.tv_nsec); + status =nfsd4_encode_nfstime4 (xdr, &stat.mtime); +if (status) + goto out; }if (bmval1 &FATTR4_WORD1_TIME_CREATE ) { - p =xdr_reserve_space (xdr,12 ); -if (!p) - goto out_resource; - p =xdr_encode_hyper (p, (s64 )stat.btime.tv_sec); - *p++ =cpu_to_be32 (stat.btime.tv_nsec); + status =nfsd4_encode_nfstime4 (xdr, &stat.btime); +if (status) + goto out; }if (bmval1 &FATTR4_WORD1_MOUNTED_ON_FILEID ) {u64 ino = stat.ino;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 18/451 nfsd: Fix creation time serialization order
In reply to Sasha LevinFrom: Tavian Barnes <[email protected]>
In nfsd4_encode_fattr(), TIME_CREATE was being written out after all other times. However, they should be written out in an order that matches the bit flags in bmval1, which in this case are
#define FATTR4_WORD1_TIME_ACCESS (1UL << 15)
#define FATTR4_WORD1_TIME_CREATE (1UL << 18)
#define FATTR4_WORD1_TIME_DELTA (1UL << 19)
#define FATTR4_WORD1_TIME_METADATA (1UL << 20)
#define FATTR4_WORD1_TIME_MODIFY (1UL << 21)so TIME_CREATE should come second.
I noticed this on a FreeBSD NFSv4.2 client, which supports creation times. On this client, file times were weirdly permuted. With this patch applied on the server, times looked normal on the client.
--- fs/nfsd/nfs4xdr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
fs/nfsd/nfs4xdr.c +5 -5
@@ -3364,6 +3364,11 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,if (status) goto out; } +if (bmval1 &FATTR4_WORD1_TIME_CREATE ) { + status =nfsd4_encode_nfstime4 (xdr, &stat.btime); +if (status) + goto out; + }if (bmval1 &FATTR4_WORD1_TIME_DELTA ) { p =xdr_reserve_space (xdr,12 );if (!p)
@@ -3380,11 +3385,6 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,if (status) goto out; } -if (bmval1 &FATTR4_WORD1_TIME_CREATE ) { - status =nfsd4_encode_nfstime4 (xdr, &stat.btime); -if (status) - goto out; - }if (bmval1 &FATTR4_WORD1_MOUNTED_ON_FILEID ) {u64 ino = stat.ino;
Signature · 1 line
2.43.0
Re: [PATCH 6.1 018/451] nfsd: Fix creation time serialization order
Hi!
Quoted 5 lines · Sasha Levin
From: Tavian Barnes <[email protected]>
In
nfsd4_encode_fattr(),TIME_CREATEwas being written out after all other times. However, they should be written out in an order that matches the bit flags in bmval1, which in this case are
This misses upstream marking, probably should be:
commit d7dbed457c2ef83709a2a2723a2d58de43623449
Author: Tavian Barnes <[email protected]> Date: Fri Jun 23 17:09:06 2023 -0400
nfsd: Fix creation time serialization order
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Sasha Levin
maintainerPATCH 19/451 media: rkisp1: Fix IRQ handling due to shared interrupts
In reply to Sasha LevinFrom: Tomi Valkeinen <[email protected]>
[ Upstream commit ffb635bb398fc07cb38f8a7b4a82cbe5f412f08e ]
The driver requests the interrupts as IRQF_SHARED, so the interrupt handlers can be called at any time. If such a call happens while the ISP is powered down, the SoC will hang as the driver tries to access the ISP registers.
This can be reproduced even without the platform sharing the IRQ line:
Enable CONFIG_DEBUG_SHIRQ and unload the driver, and the board will hang.
Fix this by adding a new field, 'irqs_enabled', which is used to bail out from the interrupt handler when the ISP is not operational.
--- .../platform/rockchip/rkisp1/rkisp1-capture.c | 3 +++ .../platform/rockchip/rkisp1/rkisp1-common.h | 2 ++ .../platform/rockchip/rkisp1/rkisp1-csi.c | 3 +++ .../platform/rockchip/rkisp1/rkisp1-dev.c | 22 +++++++++++++++++++ .../platform/rockchip/rkisp1/rkisp1-isp.c | 3 +++ 5 files changed, 33 insertions(+)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +3 -0
@@ -701,6 +701,9 @@ irqreturn_t rkisp1_capture_isr(int irq, void *ctx)unsigned int i;u32 status; +if (!rkisp1->irqs_enabled) +return IRQ_NONE ; + status =rkisp1_read (rkisp1,RKISP1_CIF_MI_MIS );if (!status)return IRQ_NONE ;
drivers/media/platform/rockchip/rkisp1/rkisp1-common.h +2 -0
@@ -467,6 +467,7 @@ struct rkisp1_debug {* @debug: debug params to be exposed on debugfs * @info: version-specific ISP information * @irqs: IRQ line numbers +* @irqs_enabled: the hardware is enabled and can cause interrupts */ struct rkisp1_device {void __iomem *base_addr;
@@ -488,6 +489,7 @@ struct rkisp1_device {struct rkisp1_debug debug;const struct rkisp1_info *info;int irqs[RKISP1_NUM_IRQS ]; +bool irqs_enabled; };/*
drivers/media/platform/rockchip/rkisp1/rkisp1-csi.c +3 -0
@@ -211,6 +211,9 @@ irqreturn_t rkisp1_csi_isr(int irq, void *ctx)struct rkisp1_device *rkisp1 =dev_get_drvdata (dev);u32 val, status; +if (!rkisp1->irqs_enabled) +return IRQ_NONE ; + status =rkisp1_read (rkisp1,RKISP1_CIF_MIPI_MIS );if (!status)return IRQ_NONE ;
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +22 -0
@@ -305,6 +305,24 @@ static int __maybe_unused rkisp1_runtime_suspend(struct device *dev) {struct rkisp1_device *rkisp1 =dev_get_drvdata (dev); + rkisp1->irqs_enabled = false; +/* Make sure the IRQ handler will see the above */ +mb (); + +/* +* Wait until any running IRQ handler has returned. The IRQ handler +* may get called even after this (as it's a shared interrupt line) +* but the 'irqs_enabled' flag will make the handler return immediately. +*/ +for (unsigned int il =0 ; il <ARRAY_SIZE (rkisp1->irqs); ++il) { +if (rkisp1->irqs[il] ==-1 ) +continue ; + +/* Skip if the irq line is the same as previous */ +if (il ==0 || rkisp1->irqs[il -1 ] != rkisp1->irqs[il]) +synchronize_irq (rkisp1->irqs[il]); + } +clk_bulk_disable_unprepare (rkisp1->clk_size, rkisp1->clks);return pinctrl_pm_select_sleep_state (dev); }
@@ -321,6 +339,10 @@ static int __maybe_unused rkisp1_runtime_resume(struct device *dev)if (ret)return ret; + rkisp1->irqs_enabled = true; +/* Make sure the IRQ handler will see the above */ +mb (); +return 0 ; }
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +3 -0
@@ -1023,6 +1023,9 @@ irqreturn_t rkisp1_isp_isr(int irq, void *ctx)struct rkisp1_device *rkisp1 =dev_get_drvdata (dev);u32 status, isp_err; +if (!rkisp1->irqs_enabled) +return IRQ_NONE ; + status =rkisp1_read (rkisp1,RKISP1_CIF_ISP_MIS );if (!status)return IRQ_NONE ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 20/451 perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count)
In reply to Sasha LevinFrom: Ilkka Koskinen <[email protected]>
[ Upstream commit 50572064ec7109b00eef8880e905f55861c8b3de ]
AmpereOneX mesh implementation has a bug in HN-P nodes that makes them report incorrect child count. The failing crosspoints report 8 children while they only have two.
When the driver tries to access the inexistent child nodes, it believes it has reached an invalid node type and probing fails. The workaround is to ignore those incorrect child nodes and continue normally.
--- drivers/perf/arm-cmn.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/perf/arm-cmn.c +11 -0
@@ -2178,6 +2178,17 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)dev_dbg (cmn->dev,"ignoring external node %llx\n" , reg);continue ; } +/* +* AmpereOneX erratum AC04_MESH_1 makes some XPs report a bogus +* child count larger than the number of valid child pointers. +* A child offset of 0 can only occur on CMN-600; otherwise it +* would imply the root node being its own grandchild, which +* we can safely dismiss in general. +*/ +if (reg ==0 && cmn->part !=PART_CMN600 ) { +dev_dbg (cmn->dev,"bogus child pointer?\n" ); +continue ; + }arm_cmn_init_node_info (cmn, reg &CMN_CHILD_NODE_ADDR , dn);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 21/451 selftests: tls: use exact comparison in recv_partial
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 49d821064c44cb5ffdf272905236012ea9ce50e3 ]
This exact case was fail for async crypto and we weren't catching it.
--- tools/testing/selftests/net/tls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/tls.c +4 -4
@@ -926,12 +926,12 @@ TEST_F(tls, recv_partial)memset (recv_mem,0 ,sizeof (recv_mem));EXPECT_EQ (send (self->fd, test_str, send_len,0 ), send_len); -EXPECT_NE (recv (self->cfd, recv_mem,strlen (test_str_first), -MSG_WAITALL ),-1 ); +EXPECT_EQ (recv (self->cfd, recv_mem,strlen (test_str_first), +MSG_WAITALL ),strlen (test_str_first));EXPECT_EQ (memcmp (test_str_first, recv_mem,strlen (test_str_first)),0 );memset (recv_mem,0 ,sizeof (recv_mem)); -EXPECT_NE (recv (self->cfd, recv_mem,strlen (test_str_second), -MSG_WAITALL ),-1 ); +EXPECT_EQ (recv (self->cfd, recv_mem,strlen (test_str_second), +MSG_WAITALL ),strlen (test_str_second));EXPECT_EQ (memcmp (test_str_second, recv_mem,strlen (test_str_second)),0 ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 22/451 ASoC: rt5645: Make LattePanda board DMI match more precise
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 551539a8606e28cb2a130f8ef3e9834235b456c4 ]
The DMI strings used for the LattePanda board DMI quirks are very generic.
Using the dmidecode database from https://linux-hardware.org/ shows that the chosen DMI strings also match the following 2 laptops which also have a rt5645 codec:
Insignia NS-P11W7100 https://linux-hardware.org/?computer=E092FFF8BA04
Insignia NS-P10W8100 https://linux-hardware.org/?computer=AFB6C0BF7934
All 4 hw revisions of the LattePanda board have "S70CR" in their BIOS version DMI strings:
DF-BI-7-S70CR100-*
DF-BI-7-S70CR110-*
DF-BI-7-S70CR200-*
LP-BS-7-S70CR700-*
See e.g. https://linux-hardware.org/?computer=D98250A817C0
Add a partial (non exact) DMI match on this string to make the LattePanda board DMI match more precise to avoid false-positive matches.
--- sound/soc/codecs/rt5645.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/codecs/rt5645.c +10 -0
@@ -3802,6 +3802,16 @@ static const struct dmi_system_id dmi_platform_data[] = { DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), DMI_EXACT_MATCH(DMI_BOARD_VERSION, "Default string"), +/* +* Above strings are too generic, LattePanda BIOS versions for +* all 4 hw revisions are: +* DF-BI-7-S70CR100-* +* DF-BI-7-S70CR110-* +* DF-BI-7-S70CR200-* +* LP-BS-7-S70CR700-* +* Do a partial match for S70CR to avoid false positive matches. +*/ + DMI_MATCH(DMI_BIOS_VERSION, "S70CR"), }, .driver_data = (void *)&lattepanda_board_platform_data, },
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 23/451 ASoC: amd: yc: Fix non-functional mic on Lenovo 82UU
In reply to Sasha LevinFrom: Attila Tőkés <[email protected]>
[ Upstream commit f7fe85b229bc30cb5dc95b4e9015a601c9e3a8cd ]
Like many other models, the Lenovo 82UU (Yoga Slim 7 Pro 14ARH7) needs a quirk entry for the internal microphone to function.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -227,6 +227,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "82QF"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "82UU"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 24/451 x86/xen: Add some null pointer checking to smp.c
In reply to Sasha LevinFrom: Kunwu Chan <[email protected]>
[ Upstream commit 3693bb4465e6e32a204a5b86d3ec7e6b9f7e67c2 ]
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity.
--- arch/x86/xen/smp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/x86/xen/smp.c +12 -0
@@ -65,6 +65,8 @@ int xen_smp_intr_init(unsigned int cpu)char *resched_name, *callfunc_name, *debug_name; resched_name =kasprintf (GFP_KERNEL ,"resched%d" , cpu); +if (!resched_name) + goto fail_mem;per_cpu (xen_resched_irq, cpu).name = resched_name; rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR, cpu,
@@ -77,6 +79,8 @@ int xen_smp_intr_init(unsigned int cpu)per_cpu (xen_resched_irq, cpu).irq = rc; callfunc_name =kasprintf (GFP_KERNEL ,"callfunc%d" , cpu); +if (!callfunc_name) + goto fail_mem;per_cpu (xen_callfunc_irq, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR, cpu,
@@ -90,6 +94,9 @@ int xen_smp_intr_init(unsigned int cpu)if (!xen_fifo_events) { debug_name =kasprintf (GFP_KERNEL ,"debug%d" , cpu); +if (!debug_name) + goto fail_mem; +per_cpu (xen_debug_irq, cpu).name = debug_name; rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt,
@@ -101,6 +108,9 @@ int xen_smp_intr_init(unsigned int cpu) } callfunc_name =kasprintf (GFP_KERNEL ,"callfuncsingle%d" , cpu); +if (!callfunc_name) + goto fail_mem; +per_cpu (xen_callfuncsingle_irq, cpu).name = callfunc_name; rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR, cpu,
@@ -114,6 +124,8 @@ int xen_smp_intr_init(unsigned int cpu)return 0 ; + fail_mem: + rc = -ENOMEM ; fail:xen_smp_intr_free (cpu);return rc;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 25/451 MIPS: Clear Cause.BD in instruction_pointer_set
In reply to Sasha LevinFrom: Jiaxun Yang <[email protected]>
[ Upstream commit 9d6e21ddf20293b3880ae55b9d14de91c5891c59 ]
Clear Cause.BD after we use instruction_pointer_set to override EPC.
This can prevent exception_epc check against instruction code at new return address.
It won't be considered as "in delay slot" after epc being overridden anyway.
--- arch/mips/include/asm/ptrace.h | 1 + 1 file changed, 1 insertion(+)
arch/mips/include/asm/ptrace.h +1 -0
@@ -60,6 +60,7 @@ static inline void instruction_pointer_set(struct pt_regs *regs, unsigned long val) { regs->cp0_epc = val; + regs->cp0_cause &= ~CAUSEF_BD ; }/* Query offset/name of register from its name/offset */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 26/451 HID: multitouch: Add required quirk for Synaptics 0xcddc device
In reply to Sasha LevinFrom: Manuel Fombuena <[email protected]>
[ Upstream commit 1741a8269e1c51fa08d4bfdf34667387a6eb10ec ]
Add support for the pointing stick (Accupoint) and 2 mouse buttons.
Present on some Toshiba/dynabook Portege X30 and X40 laptops.
It should close https://bugzilla.kernel.org/show_bug.cgi?id=205817
--- drivers/hid/hid-multitouch.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/hid/hid-multitouch.c +4 -0
@@ -2153,6 +2153,10 @@ static const struct hid_device_id mt_devices[] = {HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , USB_VENDOR_ID_SYNAPTICS, 0xcd7e) }, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT, +HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , + USB_VENDOR_ID_SYNAPTICS, 0xcddc) }, + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,HID_DEVICE (BUS_I2C ,HID_GROUP_MULTITOUCH_WIN_8 , USB_VENDOR_ID_SYNAPTICS, 0xce08) },
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 27/451 gen_compile_commands: fix invalid escape sequence warning
In reply to Sasha LevinFrom: Andrew Ballance <[email protected]>
[ Upstream commit dae4a0171e25884787da32823b3081b4c2acebb2 ]
With python 3.12, '\#' results in this warning
SyntaxWarning: invalid escape sequence '\#'
--- scripts/clang-tools/gen_compile_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/clang-tools/gen_compile_commands.py +1 -1
@@ -170,7 +170,7 @@ def process_line(root_directory, command_prefix, file_path): # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the # kernel version). The compile_commands.json file is not interepreted # by Make, so this code replaces the escaped version with '#'. - prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#') + prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#') # Use os.path.abspath() to normalize the path resolving '.' and '..' . abs_path = os.path.abspath(os.path.join(root_directory, file_path))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 28/451 arm64/sve: Lower the maximum allocation for the SVE ptrace regset
In reply to Sasha LevinFrom: Mark Brown <[email protected]>
[ Upstream commit 2813926261e436d33bc74486b51cce60b76edf78 ]
Doug Anderson observed that ChromeOS crashes are being reported which include failing allocations of order 7 during core dumps due to ptrace allocating storage for regsets:
chrome: page allocation failure: order:7,
mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO),
nodemask=(null),cpuset=urgent,mems_allowed=0
...
regset_get_alloc+0x1c/0x28
elf_core_dump+0x3d8/0xd8c
do_coredump+0xeb8/0x1378with further investigation showing that this is:
[ 66.957385] DOUG: Allocating 279584 bytes
which is the maximum size of the SVE regset. As Doug observes it is not entirely surprising that such a large allocation of contiguous memory might fail on a long running system.
The SVE regset is currently sized to hold SVE registers with a VQ of SVE_VQ_MAX which is 512, substantially more than the architectural maximum of 16 which we might see even in a system emulating the limits of the architecture. Since we don't expose the size we tell the regset core externally let's define ARCH_SVE_VQ_MAX with the actual architectural maximum and use that for the regset, we'll still overallocate most of the time but much less so which will be helpful even if the core is fixed to not require contiguous allocations.
Specify ARCH_SVE_VQ_MAX in terms of the maximum value that can be written into ZCR_ELx.LEN (where this is set in the hardware). For consistency update the maximum SME vector length to be specified in the same style while we are at it.
We could also teach the ptrace core about runtime discoverable regset sizes but that would be a more invasive change and this is being observed in practical systems.
--- arch/arm64/include/asm/fpsimd.h | 12 ++++++------ arch/arm64/kernel/ptrace.c | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-)
arch/arm64/include/asm/fpsimd.h +6 -6
@@ -36,13 +36,13 @@* When we defined the maximum SVE vector length we defined the ABI so * that the maximum vector length included all the reserved for future * expansion bits in ZCR rather than those just currently defined by -* the architecture. While SME follows a similar pattern the fact that -* it includes a square matrix means that any allocations that attempt -* to cover the maximum potential vector length (such as happen with -* the regset used for ptrace) end up being extremely large. Define -* the much lower actual limit for use in such situations. +* the architecture. Using this length to allocate worst size buffers +* results in excessively large allocations, and this effect is even +* more pronounced for SME due to ZA. Define more suitable VLs for +* these situations. */ -#define SME_VQ_MAX 16 +#define ARCH_SVE_VQ_MAX ((ZCR_ELx_LEN_MASK >> ZCR_ELx_LEN_SHIFT) + 1) +#define SME_VQ_MAX ((SMCR_ELx_LEN_MASK >> SMCR_ELx_LEN_SHIFT) + 1)struct task_struct ;
arch/arm64/kernel/ptrace.c +2 -1
@@ -1450,7 +1450,8 @@ static const struct user_regset aarch64_regsets[] = { #ifdef CONFIG_ARM64_SVE [REGSET_SVE ] = {/* Scalable Vector Extension */ .core_note_type =NT_ARM_SVE , - .n =DIV_ROUND_UP (SVE_PT_SIZE (SVE_VQ_MAX ,SVE_PT_REGS_SVE ), + .n =DIV_ROUND_UP (SVE_PT_SIZE (ARCH_SVE_VQ_MAX , +SVE_PT_REGS_SVE ),SVE_VQ_BYTES ), .size =SVE_VQ_BYTES , .align = SVE_VQ_BYTES,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 29/451 soc: microchip: Fix POLARFIRE_SOC_SYS_CTRL input prompt
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 6dd9a236042e305d7b69ee92db7347bf5943e7d3 ]
The symbol's prompt should be a one-line description, instead of just duplicating the symbol name.
--- drivers/soc/microchip/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/microchip/Kconfig +1 -1
@@ -1,5 +1,5 @@ config POLARFIRE_SOC_SYS_CTRL - tristate "POLARFIRE_SOC_SYS_CTRL" + tristate "Microchip PolarFire SoC (MPFS) system controller support" depends on POLARFIRE_SOC_MAILBOX help This driver adds support for the PolarFire SoC (MPFS) system controller.
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 30/451 RDMA/mlx5: Fix fortify source warning while accessing Eth segment
In reply to Sasha LevinFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 4d5e86a56615cc387d21c629f9af8fb0e958d350 ]
------------[ cut here ]------------ memcpy: detected field-spanning write (size 56) of single field "eseg->inline_hdr.start" at /var/lib/dkms/mlnx-ofed-kernel/5.8/build/drivers/infiniband/hw/mlx5/wr.c:131 (size 2) WARNING: CPU: 0 PID: 293779 at /var/lib/dkms/mlnx-ofed-kernel/5.8/build/drivers/infiniband/hw/mlx5/wr.c:131 mlx5_ib_post_send+0x191b/0x1a60 [mlx5_ib] Modules linked in: 8021q garp mrp stp llc rdma_ucm(OE) rdma_cm(OE) iw_cm(OE) ib_ipoib(OE) ib_cm(OE) ib_umad(OE) mlx5_ib(OE) ib_uverbs(OE) ib_core(OE) mlx5_core(OE) pci_hyperv_intf mlxdevm(OE) mlx_compat(OE) tls mlxfw(OE) psample nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables libcrc32c nfnetlink mst_pciconf(OE) knem(OE) vfio_pci vfio_pci_core vfio_iommu_type1 vfio iommufd irqbypass cuse nfsv3 nfs fscache netfs xfrm_user xfrm_algo ipmi_devintf ipmi_msghandler binfmt_misc crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic ghash_clmulni_intel sha512_ssse3 snd_pcsp aesni_intel crypto_simd cryptd snd_pcm snd_timer joydev snd soundcore input_leds serio_raw evbug nfsd auth_rpcgss nfs_acl lockd grace sch_fq_codel sunrpc drm efi_pstore ip_tables x_tables autofs4 psmouse virtio_net net_failover failover floppy [last unloaded: mlx_compat(OE)] CPU: 0 PID: 293779 Comm: ssh Tainted: G OE 6.2.0-32-generic #32~22.04.1-Ubuntu Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 RIP: 0010:mlx5_ib_post_send+0x191b/0x1a60 [mlx5_ib] Code: 0c 01 00 a8 01 75 25 48 8b 75 a0 b9 02 00 00 00 48 c7 c2 10 5b fd c0 48 c7 c7 80 5b fd c0 c6 05 57 0c 03 00 01 e8 95 4d 93 da <0f> 0b 44 8b 4d b0 4c 8b 45 c8 48 8b 4d c0 e9 49 fb ff ff 41 0f b7 RSP: 0018:ffffb5b48478b570 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffb5b48478b628 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffffb5b48478b5e8 R13: ffff963a3c609b5e R14: ffff9639c3fbd800 R15: ffffb5b480475a80 FS: 00007fc03b444c80(0000) GS:ffff963a3dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000556f46bdf000 CR3: 0000000006ac6003 CR4: 00000000003706f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> ? show_regs+0x72/0x90 ? mlx5_ib_post_send+0x191b/0x1a60 [mlx5_ib] ? __warn+0x8d/0x160 ? mlx5_ib_post_send+0x191b/0x1a60 [mlx5_ib] ? report_bug+0x1bb/0x1d0 ? handle_bug+0x46/0x90 ? exc_invalid_op+0x19/0x80 ? asm_exc_invalid_op+0x1b/0x20 ? mlx5_ib_post_send+0x191b/0x1a60 [mlx5_ib] mlx5_ib_post_send_nodrain+0xb/0x20 [mlx5_ib] ipoib_send+0x2ec/0x770 [ib_ipoib] ipoib_start_xmit+0x5a0/0x770 [ib_ipoib] dev_hard_start_xmit+0x8e/0x1e0 ? validate_xmit_skb_list+0x4d/0x80 sch_direct_xmit+0x116/0x3a0 __dev_xmit_skb+0x1fd/0x580 __dev_queue_xmit+0x284/0x6b0 ? _raw_spin_unlock_irq+0xe/0x50 ? __flush_work.isra.0+0x20d/0x370 ? push_pseudo_header+0x17/0x40 [ib_ipoib] neigh_connected_output+0xcd/0x110 ip_finish_output2+0x179/0x480 ? __smp_call_single_queue+0x61/0xa0 __ip_finish_output+0xc3/0x190 ip_finish_output+0x2e/0xf0 ip_output+0x78/0x110 ? __pfx_ip_finish_output+0x10/0x10 ip_local_out+0x64/0x70 __ip_queue_xmit+0x18a/0x460 ip_queue_xmit+0x15/0x30 __tcp_transmit_skb+0x914/0x9c0 tcp_write_xmit+0x334/0x8d0 tcp_push_one+0x3c/0x60 tcp_sendmsg_locked+0x2e1/0xac0 tcp_sendmsg+0x2d/0x50 inet_sendmsg+0x43/0x90 sock_sendmsg+0x68/0x80 sock_write_iter+0x93/0x100 vfs_write+0x326/0x3c0 ksys_write+0xbd/0xf0 ? do_syscall_64+0x69/0x90 __x64_sys_write+0x19/0x30 do_syscall_64+0x59/0x90 ? do_user_addr_fault+0x1d0/0x640 ? exit_to_user_mode_prepare+0x3b/0xd0 ? irqentry_exit_to_user_mode+0x9/0x20 ? irqentry_exit+0x43/0x50 ? exc_page_fault+0x92/0x1b0 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7fc03ad14a37 Code: 10 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 RSP: 002b:00007ffdf8697fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000008024 RCX: 00007fc03ad14a37 RDX: 0000000000008024 RSI: 0000556f46bd8270 RDI: 0000000000000003 RBP: 0000556f46bb1800 R08: 0000000000007fe3 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 0000556f46bc66b0 R14: 000000000000000a R15: 0000556f46bb2f50 </TASK> ---[ end trace 0000000000000000 ]---
--- drivers/infiniband/hw/mlx5/wr.c | 2 +- include/linux/mlx5/qp.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/wr.c +1 -1
@@ -78,7 +78,7 @@ static void set_eth_seg(const struct ib_send_wr *wr, struct mlx5_ib_qp *qp,*/ copysz =min_t (u64, *cur_edge - (void *)eseg->inline_hdr.start, left); -memcpy (eseg->inline_hdr.start, pdata, copysz); +memcpy (eseg->inline_hdr.data, pdata, copysz); stride =ALIGN (sizeof (struct mlx5_wqe_eth_seg ) -sizeof (eseg->inline_hdr.start) + copysz,16 ); *size += stride /16 ;
include/linux/mlx5/qp.h +4 -1
@@ -269,7 +269,10 @@ struct mlx5_wqe_eth_seg {union {struct {__be16 sz; -u8 start[2 ]; +union { +u8 start[2 ]; + DECLARE_FLEX_ARRAY(u8, data); + }; } inline_hdr;struct {__be16 type;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 31/451 RDMA/mlx5: Relax DEVX access upon modify commands
In reply to Sasha LevinFrom: Yishai Hadas <[email protected]>
[ Upstream commit be551ee1574280ef8afbf7c271212ac3e38933ef ]
Relax DEVX access upon modify commands to be UVERBS_ACCESS_READ.
The kernel doesn't need to protect what firmware protects, or what causes no damage to anyone but the user.
As firmware needs to protect itself from parallel access to the same object, don't block parallel modify/query commands on the same object in the kernel side.
This change will allow user space application to run parallel updates to different entries in the same bulk object.
--- drivers/infiniband/hw/mlx5/devx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/devx.c +1 -1
@@ -2951,7 +2951,7 @@ DECLARE_UVERBS_NAMED_METHOD(MLX5_IB_METHOD_DEVX_OBJ_MODIFY ,UVERBS_ATTR_IDR (MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE ,UVERBS_IDR_ANY_OBJECT , -UVERBS_ACCESS_WRITE , +UVERBS_ACCESS_READ ,UA_MANDATORY ), UVERBS_ATTR_PTR_IN( MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 32/451 riscv: dts: sifive: add missing #interrupt-cells to pmic
In reply to Sasha LevinFrom: Conor Dooley <[email protected]>
[ Upstream commit ce6b6d1513965f500a05f3facf223fa01fd74920 ]
At W=2 dtc complains:
hifive-unmatched-a00.dts:120.10-238.4: Warning (interrupt_provider): /soc/i2c@10030000/pmic@58: Missing '#interrupt-cells' in interrupt provider
Add the missing property.
--- arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 1 + 1 file changed, 1 insertion(+)
arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +1 -0
@@ -123,6 +123,7 @@ pmic@58 { interrupt-parent = <&gpio>; interrupts = <1 IRQ_TYPE_LEVEL_LOW>; interrupt-controller; + #interrupt-cells = <2>; onkey { compatible = "dlg,da9063-onkey";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 33/451 x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit ee0e39a63b78849f8abbef268b13e4838569f646 ]
Move is_vsyscall_vaddr() into asm/vsyscall.h to make it available for copy_from_kernel_nofault_allowed() in arch/x86/mm/maccess.c.
--- arch/x86/include/asm/vsyscall.h | 10 ++++++++++ arch/x86/mm/fault.c | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-)
arch/x86/include/asm/vsyscall.h +10 -0
@@ -4,6 +4,7 @@#include <linux/seqlock.h> #include <uapi/asm/vsyscall.h> +#include <asm/page_types.h> #ifdef CONFIG_X86_VSYSCALL_EMULATION extern void map_vsyscall (void );
@@ -24,4 +25,13 @@ static inline bool emulate_vsyscall(unsigned long error_code, }#endif +/* +* The (legacy) vsyscall page is the long page in the kernel portion +* of the address space that has user-accessible permissions. +*/ +static inline bool is_vsyscall_vaddr (unsigned long vaddr) +{ +return unlikely ((vaddr &PAGE_MASK ) ==VSYSCALL_ADDR ); +} +#endif /* _ASM_X86_VSYSCALL_H */
arch/x86/mm/fault.c +0 -9
@@ -818,15 +818,6 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,show_opcodes (regs, loglvl); } -/* -* The (legacy) vsyscall page is the long page in the kernel portion -* of the address space that has user-accessible permissions. -*/ -static bool is_vsyscall_vaddr (unsigned long vaddr) -{ -return unlikely ((vaddr &PAGE_MASK ) ==VSYSCALL_ADDR ); -} -static void __bad_area_nosemaphore (struct pt_regs *regs,unsigned long error_code,unsigned long address,u32 pkey,int si_code)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 34/451 x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault()
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit 32019c659ecfe1d92e3bf9fcdfbb11a7c70acd58 ]
When trying to use copy_from_kernel_nofault() to read vsyscall page through a bpf program, the following oops was reported:
BUG: unable to handle page fault for address: ffffffffff600000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 3231067 P4D 3231067 PUD 3233067 PMD 3235067 PTE 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 20390 Comm: test_progs ...... 6.7.0+ #58 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) ...... RIP: 0010:copy_from_kernel_nofault+0x6f/0x110 ...... Call Trace: <TASK> ? copy_from_kernel_nofault+0x6f/0x110 bpf_probe_read_kernel+0x1d/0x50 bpf_prog_2061065e56845f08_do_probe_read+0x51/0x8d trace_call_bpf+0xc5/0x1c0 perf_call_bpf_enter.isra.0+0x69/0xb0 perf_syscall_enter+0x13e/0x200 syscall_trace_enter+0x188/0x1c0 do_syscall_64+0xb5/0xe0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 </TASK> ...... ---[ end trace 0000000000000000 ]---
The oops is triggered when:
1) A bpf program uses bpf_probe_read_kernel() to read from the vsyscall page and invokes copy_from_kernel_nofault() which in turn calls __get_user_asm().
2) Because the vsyscall page address is not readable from kernel space, a page fault exception is triggered accordingly.
3) handle_page_fault() considers the vsyscall page address as a user space address instead of a kernel space address. This results in the fix-up setup by bpf not being applied and a page_fault_oops() is invoked due to SMAP.
Considering handle_page_fault() has already considered the vsyscall page address as a userspace address, fix the problem by disallowing vsyscall page read for copy_from_kernel_nofault().
--- arch/x86/mm/maccess.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/x86/mm/maccess.c +10 -0
@@ -3,6 +3,8 @@#include <linux/uaccess.h> #include <linux/kernel.h> +#include <asm/vsyscall.h> +#ifdef CONFIG_X86_64 bool copy_from_kernel_nofault_allowed (const void *unsafe_src,size_t size) {
@@ -15,6 +17,14 @@ bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)if (vaddr <TASK_SIZE_MAX +PAGE_SIZE )return false; +/* +* Reading from the vsyscall page may cause an unhandled fault in +* certain cases. Though it is at an address above TASK_SIZE_MAX, it is +* usually considered as a user space address. +*/ +if (is_vsyscall_vaddr (vaddr)) +return false; +/* * Allow everything during early boot before 'x86_virt_bits' * is initialized. Needed for instruction decoding in early
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 35/451 net/iucv: fix the allocation size of iucv_path_table array
In reply to Sasha LevinFrom: Alexander Gordeev <[email protected]>
[ Upstream commit b4ea9b6a18ebf7f9f3a7a60f82e925186978cfcf ]
iucv_path_table is a dynamically allocated array of pointers to struct iucv_path items. Yet, its size is calculated as if it was an array of struct iucv_path items.
--- net/iucv/iucv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/iucv/iucv.c +2 -2
@@ -156,7 +156,7 @@ static char iucv_error_pathid[16] = "INVALID PATHID";static LIST_HEAD (iucv_handler_list);/* -* iucv_path_table: an array of iucv_path structures. +* iucv_path_table: array of pointers to iucv_path structures. */ static struct iucv_path **iucv_path_table;static unsigned long iucv_max_pathid;
@@ -544,7 +544,7 @@ static int iucv_enable(void)cpus_read_lock (); rc = -ENOMEM ; - alloc_size = iucv_max_pathid *sizeof (struct iucv_path ); + alloc_size = iucv_max_pathid *sizeof (*iucv_path_table); iucv_path_table =kzalloc (alloc_size,GFP_KERNEL );if (!iucv_path_table) goto out;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 36/451 parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check
In reply to Sasha LevinFrom: Max Kellermann <[email protected]>
[ Upstream commit 250f5402e636a5cec9e0e95df252c3d54307210f ]
Fixes a bug revealed by -Wmissing-prototypes when CONFIG_FUNCTION_GRAPH_TRACER is enabled but not CONFIG_DYNAMIC_FTRACE:
arch/parisc/kernel/ftrace.c:82:5: error: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Werror=missing-prototypes]
82 | int ftrace_enable_ftrace_graph_caller(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/parisc/kernel/ftrace.c:88:5: error: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Werror=missing-prototypes]
88 | int ftrace_disable_ftrace_graph_caller(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- arch/parisc/kernel/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/ftrace.c +1 -1
@@ -78,7 +78,7 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent,#endif } -#ifdef CONFIG_FUNCTION_GRAPH_TRACER +#if defined(CONFIG_DYNAMIC_FTRACE ) && defined(CONFIG_FUNCTION_GRAPH_TRACER )int ftrace_enable_ftrace_graph_caller (void ) {static_key_enable (&ftrace_graph_enable.key);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 37/451 block: sed-opal: handle empty atoms when parsing response
In reply to Sasha LevinFrom: Greg Joyce <[email protected]>
[ Upstream commit 5429c8de56f6b2bd8f537df3a1e04e67b9c04282 ]
The SED Opal response parsing function response_parse() does not handle the case of an empty atom in the response. This causes the entry count to be too high and the response fails to be parsed. Recognizing, but ignoring, empty atoms allows response handling to succeed.
--- block/opal_proto.h | 1 + block/sed-opal.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
block/opal_proto.h +1 -0
@@ -71,6 +71,7 @@ enum opal_response_token {#define SHORT_ATOM_BYTE 0xBF#define MEDIUM_ATOM_BYTE 0xDF#define LONG_ATOM_BYTE 0xE3 +#define EMPTY_ATOM_BYTE 0xFF#define OPAL_INVAL_PARAM 12#define OPAL_MANUFACTURED_INACTIVE 0x08
block/sed-opal.c +5 -1
@@ -935,16 +935,20 @@ static int response_parse(const u8 *buf, size_t length, token_length =response_parse_medium (iter, pos); else if (pos[0] <= LONG_ATOM_BYTE) /* long atom */ token_length =response_parse_long (iter, pos); + else if (pos[0] == EMPTY_ATOM_BYTE) /* empty atom */ + token_length =1 ; else /* TOKEN */ token_length =response_parse_token (iter, pos);if (token_length <0 )return token_length; +if (pos[0 ] !=EMPTY_ATOM_BYTE ) + num_entries++; + pos += token_length; total -= token_length; iter++; - num_entries++; } resp->num = num_entries;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 38/451 dm-verity, dm-crypt: align "struct bvec_iter" correctly
In reply to Sasha LevinFrom: Mikulas Patocka <[email protected]>
[ Upstream commit 787f1b2800464aa277236a66eb3c279535edd460 ]
"struct bvec_iter" is defined with the __packed attribute, so it is aligned on a single byte. On X86 (and on other architectures that support unaligned addresses in hardware), "struct bvec_iter" is accessed using the 8-byte and 4-byte memory instructions, however these instructions are less efficient if they operate on unaligned addresses.
(on RISC machines that don't have unaligned access in hardware, GCC generates byte-by-byte accesses that are very inefficient - see [1])
This commit reorders the entries in "struct dm_verity_io" and "struct convert_context", so that "struct bvec_iter" is aligned on 8 bytes.
[1] https://lore.kernel.org/all/ZcLuWUNRZadJr0tQ@fedora/T/
--- drivers/md/dm-crypt.c | 4 ++-- drivers/md/dm-verity.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/md/dm-crypt.c +2 -2
@@ -52,11 +52,11 @@struct convert_context {struct completion restart;struct bio *bio_in; -struct bio *bio_out;struct bvec_iter iter_in; +struct bio *bio_out;struct bvec_iter iter_out; -u64 cc_sector;atomic_t cc_pending; +u64 cc_sector;union {struct skcipher_request *req;struct aead_request *req_aead;
drivers/md/dm-verity.h +2 -2
@@ -80,12 +80,12 @@ struct dm_verity_io {/* original value of bio->bi_end_io */ bio_end_io_t *orig_bi_end_io; +struct bvec_iter iter; +sector_t block;unsigned int n_blocks;bool in_tasklet; -struct bvec_iter iter; -struct work_struct work;char *recheck_buffer;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 39/451 arm64: dts: Fix dtc interrupt_provider warnings
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 91adecf911e5df78ea3e8f866e69db2c33416a5c ]
The dtc interrupt_provider warning is off by default. Fix all the warnings so it can be enabled.
--- arch/arm64/boot/dts/amazon/alpine-v2.dtsi | 1 - arch/arm64/boot/dts/amazon/alpine-v3.dtsi | 1 - arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | 1 + arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | 1 + arch/arm64/boot/dts/lg/lg1312.dtsi | 1 - arch/arm64/boot/dts/lg/lg1313.dtsi | 1 - arch/arm64/boot/dts/marvell/armada-ap80x.dtsi | 1 - arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 1 + arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 4 ++++ 9 files changed, 7 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/amazon/alpine-v2.dtsi +0 -1
@@ -145,7 +145,6 @@ pci@fbc00000 { msix: msix@fbe00000 { compatible = "al,alpine-msix"; reg = <0x0 0xfbe00000 0x0 0x100000>; - interrupt-controller; msi-controller; al,msi-base-spi = <160>; al,msi-num-spis = <160>;
arch/arm64/boot/dts/amazon/alpine-v3.dtsi +0 -1
@@ -351,7 +351,6 @@ pcie@fbd00000 { msix: msix@fbe00000 { compatible = "al,alpine-msix"; reg = <0x0 0xfbe00000 0x0 0x100000>; - interrupt-controller; msi-controller; al,msi-base-spi = <336>; al,msi-num-spis = <959>;
arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi +1 -0
@@ -584,6 +584,7 @@ gpio_g: gpio@660a0000 { #gpio-cells = <2>; gpio-controller; interrupt-controller; + #interrupt-cells = <2>; interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>; };
arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +1 -0
@@ -442,6 +442,7 @@ gpio_hsls: gpio@d0000 { #gpio-cells = <2>; gpio-controller; interrupt-controller; + #interrupt-cells = <2>; interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>; gpio-ranges = <&pinmux 0 0 16>, <&pinmux 16 71 2>,
arch/arm64/boot/dts/lg/lg1312.dtsi +0 -1
@@ -124,7 +124,6 @@ eth0: ethernet@c1b00000 { amba { #address-cells = <2>; #size-cells = <1>; - #interrupt-cells = <3>; compatible = "simple-bus"; interrupt-parent = <&gic>;
arch/arm64/boot/dts/lg/lg1313.dtsi +0 -1
@@ -124,7 +124,6 @@ eth0: ethernet@c3700000 { amba { #address-cells = <2>; #size-cells = <1>; - #interrupt-cells = <3>; compatible = "simple-bus"; interrupt-parent = <&gic>;
arch/arm64/boot/dts/marvell/armada-ap80x.dtsi +0 -1
@@ -133,7 +133,6 @@ pmu { odmi: odmi@300000 { compatible = "marvell,odmi-controller"; - interrupt-controller; msi-controller; marvell,odmi-frames = <4>; reg = <0x300000 0x4000>,
arch/arm64/boot/dts/mediatek/mt8195-demo.dts +1 -0
@@ -111,6 +111,7 @@ mt6360: pmic@34 { compatible = "mediatek,mt6360"; reg = <0x34>; interrupt-controller; + #interrupt-cells = <1>; interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>; interrupt-names = "IRQB";
arch/arm64/boot/dts/renesas/ulcb-kf.dtsi +4 -0
@@ -251,6 +251,7 @@ gpio_exp_74: gpio@74 { gpio-controller; #gpio-cells = <2>; interrupt-controller; + #interrupt-cells = <2>; interrupt-parent = <&gpio6>; interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
@@ -311,6 +312,7 @@ gpio_exp_75: gpio@75 { gpio-controller; #gpio-cells = <2>; interrupt-controller; + #interrupt-cells = <2>; interrupt-parent = <&gpio6>; interrupts = <4 IRQ_TYPE_EDGE_FALLING>; };
@@ -331,6 +333,7 @@ gpio_exp_76: gpio@76 { gpio-controller; #gpio-cells = <2>; interrupt-controller; + #interrupt-cells = <2>; interrupt-parent = <&gpio7>; interrupts = <3 IRQ_TYPE_EDGE_FALLING>; };
@@ -341,6 +344,7 @@ gpio_exp_77: gpio@77 { gpio-controller; #gpio-cells = <2>; interrupt-controller; + #interrupt-cells = <2>; interrupt-parent = <&gpio5>; interrupts = <9 IRQ_TYPE_EDGE_FALLING>; };
Signature · 1 line
2.43.0
Re: [PATCH 6.1 039/451] arm64: dts: Fix dtc interrupt_provider warnings
Hi!
Quoted 4 lines
[ Upstream commit
91adecf911e5df78ea3e8f866e69db2c33416a5c]The dtc
interrupt_providerwarning is off by default. Fix all the warnings so it can be enabled.
Does not fix a bug, does not belong in stable.
Best regards,
Pavel
Quoted 9 lines
Signed-off-by Rob Herring <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]> #Reviewed-by Geert Uytterhoeven <[email protected]>Acked-by Chanho Min <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Sasha Levin
maintainerPATCH 40/451 btrfs: fix data races when accessing the reserved amount of block reserves
In reply to Sasha LevinFrom: Filipe Manana <[email protected]>
[ Upstream commit e06cc89475eddc1f3a7a4d471524256152c68166 ]
At space_info.c we have several places where we access the ->reserved field of a block reserve without taking the block reserve's spinlock first, which makes KCSAN warn about a data race since that field is always updated while holding the spinlock.
The reports from KCSAN are like the following:
[117.193526] BUG: KCSAN: data-race in btrfs_block_rsv_release [btrfs] / need_preemptive_reclaim [btrfs]
[117.195148] read to 0x000000017f587190 of 8 bytes by task 6303 on cpu 3: [117.195172] need_preemptive_reclaim+0x222/0x2f0 [btrfs] [117.195992] __reserve_bytes+0xbb0/0xdc8 [btrfs] [117.196807] btrfs_reserve_metadata_bytes+0x4c/0x120 [btrfs] [117.197620] btrfs_block_rsv_add+0x78/0xa8 [btrfs] [117.198434] btrfs_delayed_update_inode+0x154/0x368 [btrfs] [117.199300] btrfs_update_inode+0x108/0x1c8 [btrfs] [117.200122] btrfs_dirty_inode+0xb4/0x140 [btrfs] [117.200937] btrfs_update_time+0x8c/0xb0 [btrfs] [117.201754] touch_atime+0x16c/0x1e0 [117.201789] filemap_read+0x674/0x728 [117.201823] btrfs_file_read_iter+0xf8/0x410 [btrfs] [117.202653] vfs_read+0x2b6/0x498 [117.203454] ksys_read+0xa2/0x150 [117.203473] __s390x_sys_read+0x68/0x88 [117.203495] do_syscall+0x1c6/0x210 [117.203517] __do_syscall+0xc8/0xf0 [117.203539] system_call+0x70/0x98
[117.203579] write to 0x000000017f587190 of 8 bytes by task 11 on cpu 0: [117.203604] btrfs_block_rsv_release+0x2e8/0x578 [btrfs] [117.204432] btrfs_delayed_inode_release_metadata+0x7c/0x1d0 [btrfs] [117.205259] __btrfs_update_delayed_inode+0x37c/0x5e0 [btrfs] [117.206093] btrfs_async_run_delayed_root+0x356/0x498 [btrfs] [117.206917] btrfs_work_helper+0x160/0x7a0 [btrfs] [117.207738] process_one_work+0x3b6/0x838 [117.207768] worker_thread+0x75e/0xb10 [117.207797] kthread+0x21a/0x230 [117.207830] __ret_from_fork+0x6c/0xb8 [117.207861] ret_from_fork+0xa/0x30
So add a helper to get the reserved amount of a block reserve while holding the lock. The value may be not be up to date anymore when used by need_preemptive_reclaim() and btrfs_preempt_reclaim_metadata_space(), but that's ok since the worst it can do is cause more reclaim work do be done sooner rather than later. Reading the field while holding the lock instead of using the data_race() annotation is used in order to prevent load tearing.
--- fs/btrfs/block-rsv.h | 16 ++++++++++++++++ fs/btrfs/space-info.c | 26 +++++++++++++------------- 2 files changed, 29 insertions(+), 13 deletions(-)
fs/btrfs/block-rsv.h +16 -0
@@ -101,4 +101,20 @@ static inline bool btrfs_block_rsv_full(const struct btrfs_block_rsv *rsv) return data_race(rsv->full); } +/* +* Get the reserved mount of a block reserve in a context where getting a stale +* value is acceptable, instead of accessing it directly and trigger data race +* warning from KCSAN. +*/ +static inline u64 btrfs_block_rsv_reserved (struct btrfs_block_rsv *rsv) +{ +u64 ret; + +spin_lock (&rsv->lock); + ret = rsv->reserved; +spin_unlock (&rsv->lock); + +return ret; +} +#endif /* BTRFS_BLOCK_RSV_H */
fs/btrfs/space-info.c +13 -13
@@ -847,7 +847,7 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info,static bool need_preemptive_reclaim (struct btrfs_fs_info *fs_info,struct btrfs_space_info *space_info) { -u64 global_rsv_size = fs_info->global_block_rsv.reserved; +const u64 global_rsv_size =btrfs_block_rsv_reserved (&fs_info->global_block_rsv);u64 ordered, delalloc;u64 total =writable_total_bytes (fs_info, space_info);u64 thresh;
@@ -948,8 +948,8 @@ static bool need_preemptive_reclaim(struct btrfs_fs_info *fs_info, ordered =percpu_counter_read_positive (&fs_info->ordered_bytes) >>1 ; delalloc =percpu_counter_read_positive (&fs_info->delalloc_bytes);if (ordered >= delalloc) - used += fs_info->delayed_refs_rsv.reserved + - fs_info->delayed_block_rsv.reserved; + used +=btrfs_block_rsv_reserved (&fs_info->delayed_refs_rsv) + +btrfs_block_rsv_reserved (&fs_info->delayed_block_rsv);else used += space_info->bytes_may_use - global_rsv_size;
@@ -1164,7 +1164,7 @@ static void btrfs_preempt_reclaim_metadata_space(struct work_struct *work)enum btrfs_flush_state flush;u64 delalloc_size =0 ;u64 to_reclaim, block_rsv_size; -u64 global_rsv_size = global_rsv->reserved; +const u64 global_rsv_size =btrfs_block_rsv_reserved (global_rsv); loops++;
@@ -1176,9 +1176,9 @@ static void btrfs_preempt_reclaim_metadata_space(struct work_struct *work)* assume it's tied up in delalloc reservations. */ block_rsv_size = global_rsv_size + - delayed_block_rsv->reserved + - delayed_refs_rsv->reserved + - trans_rsv->reserved; +btrfs_block_rsv_reserved (delayed_block_rsv) + +btrfs_block_rsv_reserved (delayed_refs_rsv) + +btrfs_block_rsv_reserved (trans_rsv);if (block_rsv_size < space_info->bytes_may_use) delalloc_size = space_info->bytes_may_use - block_rsv_size;
@@ -1198,16 +1198,16 @@ static void btrfs_preempt_reclaim_metadata_space(struct work_struct *work) to_reclaim = delalloc_size; flush =FLUSH_DELALLOC ; }else if (space_info->bytes_pinned > - (delayed_block_rsv->reserved + - delayed_refs_rsv->reserved)) { + (btrfs_block_rsv_reserved (delayed_block_rsv) + +btrfs_block_rsv_reserved (delayed_refs_rsv))) { to_reclaim = space_info->bytes_pinned; flush =COMMIT_TRANS ; - }else if (delayed_block_rsv->reserved > - delayed_refs_rsv->reserved) { - to_reclaim = delayed_block_rsv->reserved; + }else if (btrfs_block_rsv_reserved (delayed_block_rsv) > +btrfs_block_rsv_reserved (delayed_refs_rsv)) { + to_reclaim =btrfs_block_rsv_reserved (delayed_block_rsv); flush =FLUSH_DELAYED_ITEMS_NR ; }else { - to_reclaim = delayed_refs_rsv->reserved; + to_reclaim =btrfs_block_rsv_reserved (delayed_refs_rsv); flush =FLUSH_DELAYED_REFS_NR ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 41/451 btrfs: fix data race at btrfs_use_block_rsv() when accessing block reserve
In reply to Sasha LevinFrom: Filipe Manana <[email protected]>
[ Upstream commit c7bb26b847e5b97814f522686068c5628e2b3646 ]
At btrfs_use_block_rsv() we read the size of a block reserve without locking its spinlock, which makes KCSAN complain because the size of a block reserve is always updated while holding its spinlock. The report from KCSAN is the following:
[653.313148] BUG: KCSAN: data-race in btrfs_update_delayed_refs_rsv [btrfs] / btrfs_use_block_rsv [btrfs]
[653.314755] read to 0x000000017f5871b8 of 8 bytes by task 7519 on cpu 0: [653.314779] btrfs_use_block_rsv+0xe4/0x2f8 [btrfs] [653.315606] btrfs_alloc_tree_block+0xdc/0x998 [btrfs] [653.316421] btrfs_force_cow_block+0x220/0xe38 [btrfs] [653.317242] btrfs_cow_block+0x1ac/0x568 [btrfs] [653.318060] btrfs_search_slot+0xda2/0x19b8 [btrfs] [653.318879] btrfs_del_csums+0x1dc/0x798 [btrfs] [653.319702] __btrfs_free_extent.isra.0+0xc24/0x2028 [btrfs] [653.320538] __btrfs_run_delayed_refs+0xd3c/0x2390 [btrfs] [653.321340] btrfs_run_delayed_refs+0xae/0x290 [btrfs] [653.322140] flush_space+0x5e4/0x718 [btrfs] [653.322958] btrfs_preempt_reclaim_metadata_space+0x102/0x2f8 [btrfs] [653.323781] process_one_work+0x3b6/0x838 [653.323800] worker_thread+0x75e/0xb10 [653.323817] kthread+0x21a/0x230 [653.323836] __ret_from_fork+0x6c/0xb8 [653.323855] ret_from_fork+0xa/0x30
[653.323887] write to 0x000000017f5871b8 of 8 bytes by task 576 on cpu 3: [653.323906] btrfs_update_delayed_refs_rsv+0x1a4/0x250 [btrfs] [653.324699] btrfs_add_delayed_data_ref+0x468/0x6d8 [btrfs] [653.325494] btrfs_free_extent+0x76/0x120 [btrfs] [653.326280] __btrfs_mod_ref+0x6a8/0x6b8 [btrfs] [653.327064] btrfs_dec_ref+0x50/0x70 [btrfs] [653.327849] walk_up_proc+0x236/0xa50 [btrfs] [653.328633] walk_up_tree+0x21c/0x448 [btrfs] [653.329418] btrfs_drop_snapshot+0x802/0x1328 [btrfs] [653.330205] btrfs_clean_one_deleted_snapshot+0x184/0x238 [btrfs] [653.330995] cleaner_kthread+0x2b0/0x2f0 [btrfs] [653.331781] kthread+0x21a/0x230 [653.331800] __ret_from_fork+0x6c/0xb8 [653.331818] ret_from_fork+0xa/0x30
So add a helper to get the size of a block reserve while holding the lock. Reading the field while holding the lock instead of using the data_race() annotation is used in order to prevent load tearing.
--- fs/btrfs/block-rsv.c | 2 +- fs/btrfs/block-rsv.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
fs/btrfs/block-rsv.c +1 -1
@@ -512,7 +512,7 @@ struct btrfs_block_rsv *btrfs_use_block_rsv(struct btrfs_trans_handle *trans, block_rsv =get_block_rsv (trans, root); -if (unlikely (block_rsv->size ==0 )) +if (unlikely (btrfs_block_rsv_size (block_rsv) ==0 )) goto try_reserve; again: ret =btrfs_block_rsv_use_bytes (block_rsv, blocksize);
fs/btrfs/block-rsv.h +16 -0
@@ -117,4 +117,20 @@ static inline u64 btrfs_block_rsv_reserved(struct btrfs_block_rsv *rsv) return ret; } +/* +* Get the size of a block reserve in a context where getting a stale value is +* acceptable, instead of accessing it directly and trigger data race warning +* from KCSAN. +*/ +static inline u64 btrfs_block_rsv_size (struct btrfs_block_rsv *rsv) +{ +u64 ret; + +spin_lock (&rsv->lock); + ret = rsv->size; +spin_unlock (&rsv->lock); + +return ret; +} +#endif /* BTRFS_BLOCK_RSV_H */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 42/451 net: smsc95xx: add support for SYS TEC USB-SPEmodule1
In reply to Sasha LevinFrom: Andre Werner <[email protected]>
[ Upstream commit 45532b21dc2a692444b6ad5f71c253cca53e8103 ]
This patch adds support for the SYS TEC USB-SPEmodule1 10Base-T1L ethernet device to the existing smsc95xx driver by adding the new USB VID/PID pair.
--- drivers/net/usb/smsc95xx.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/usb/smsc95xx.c +5 -0
@@ -2104,6 +2104,11 @@ static const struct usb_device_id products[] = { USB_DEVICE(0x0424, 0x9E08), .driver_info = (unsigned long ) &smsc95xx_info, }, + { +/* SYSTEC USB-SPEmodule1 10BASE-T1L Ethernet Device */ +USB_DEVICE (0x0878 ,0x1400 ), + .driver_info = (unsigned long)&smsc95xx_info, + }, {/* Microchip's EVB-LAN8670-USB 10BASE-T1S Ethernet Device */ USB_DEVICE(0x184F, 0x0051),
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 43/451 wifi: mac80211: only call drv_sta_rc_update for uploaded stations
In reply to Sasha LevinFrom: Felix Fietkau <[email protected]>
[ Upstream commit 413dafc8170fcb925fb17af8842f06af305f8e0b ]
When a station has not been uploaded yet, receiving SMPS or channel width notification action frames can lead to rate_control_rate_update calling drv_sta_rc_update with uninitialized driver private data.
Fix this by adding a missing check for sta->uploaded.
--- net/mac80211/rate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/rate.c +2 -1
@@ -119,7 +119,8 @@ void rate_control_rate_update(struct ieee80211_local *local,rcu_read_unlock (); } -drv_sta_rc_update (local, sta->sdata, &sta->sta, changed); +if (sta->uploaded) +drv_sta_rc_update (local, sta->sdata, &sta->sta, changed); }int ieee80211_rate_control_register (const struct rate_control_ops *ops)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 44/451 ASoC: amd: yc: Add Lenovo ThinkBook 21J0 into DMI quirk table
In reply to Sasha LevinFrom: Johnny Hsieh <[email protected]>
[ Upstream commit 50ee641643dd0f46702e9a99354398196e1734c2 ]
This patch adds Lenovo 21J0 (ThinkBook 16 G5+ ARP) to the DMI quirks table to enable internal microphone array.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -199,6 +199,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "21J0"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 45/451 scsi: mpt3sas: Prevent sending diag_reset when the controller is ready
In reply to Sasha LevinFrom: Ranjan Kumar <[email protected]>
[ Upstream commit ee0017c3ed8a8abfa4d40e42f908fb38c31e7515 ]
If the driver detects that the controller is not ready before sending the first IOC facts command, it will wait for a maximum of 10 seconds for it to become ready. However, even if the controller becomes ready within 10 seconds, the driver will still issue a diagnostic reset.
Modify the driver to avoid sending a diag reset if the controller becomes ready within the 10-second wait time.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +3 -1
@@ -7398,7 +7398,9 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout)return -EFAULT ; } - issue_diag_reset: +return 0 ; + +issue_diag_reset: rc =_base_diag_reset (ioc);return rc; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 46/451 ALSA: hda/realtek - ALC285 reduce pop noise from Headphone port
In reply to Sasha LevinFrom: Kailang Yang <[email protected]>
[ Upstream commit b34bf65838f7c6e785f62681605a538b73c2808c ]
It had pop noise from Headphone port when system reboot state. If NID 58h Index 0x0 to fill default value, it will reduce pop noise.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -3681,6 +3681,7 @@ static void alc285_hp_init(struct hda_codec *codec)int i, val;int coef38, coef0d, coef36; +alc_write_coefex_idx (codec,0x58 ,0x00 ,0x1888 );/* write default value */ alc_update_coef_idx (codec,0x4a ,1 <<15 ,1 <<15 );/* Reset HP JD */ coef38 =alc_read_coef_idx (codec,0x38 );/* Amp control */ coef0d =alc_read_coef_idx (codec,0x0d );/* Digital Misc control */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 47/451 drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series
In reply to Sasha LevinFrom: Prike Liang <[email protected]>
[ Upstream commit c671ec01311b4744b377f98b0b4c6d033fe569b3 ]
Currently, GPU resets can now be performed successfully on the Raven series. While GPU reset is required for the S3 suspend abort case. So now can enable gpu reset for S3 abort cases on the Raven series.
--- drivers/gpu/drm/amd/amdgpu/soc15.c | 45 +++++++++++++++++------------- 1 file changed, 25 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc15.c +25 -20
@@ -584,11 +584,34 @@ soc15_asic_reset_method(struct amdgpu_device *adev)return AMD_RESET_METHOD_MODE1 ; } +static bool soc15_need_reset_on_resume (struct amdgpu_device *adev) +{ +u32 sol_reg; + + sol_reg =RREG32_SOC15 (MP0 ,0 , mmMP0_SMN_C2PMSG_81); + +/* Will reset for the following suspend abort cases. +* 1) Only reset limit on APU side, dGPU hasn't checked yet. +* 2) S3 suspend abort and TOS already launched. +*/ +if (adev->flags &AMD_IS_APU && adev->in_s3 && + !adev->suspend_complete && + sol_reg) +return true; + +return false; +} +static int soc15_asic_reset (struct amdgpu_device *adev) {/* original raven doesn't have full asic reset */ -if ((adev->apu_flags &AMD_APU_IS_RAVEN ) || - (adev->apu_flags &AMD_APU_IS_RAVEN2 )) +/* On the latest Raven, the GPU reset can be performed +* successfully. So now, temporarily enable it for the +* S3 suspend abort case. +*/ +if (((adev->apu_flags &AMD_APU_IS_RAVEN ) || + (adev->apu_flags &AMD_APU_IS_RAVEN2 )) && + !soc15_need_reset_on_resume (adev))return 0 ;switch (soc15_asic_reset_method (adev)) {
@@ -1285,24 +1308,6 @@ static int soc15_common_suspend(void *handle)return soc15_common_hw_fini (adev); } -static bool soc15_need_reset_on_resume (struct amdgpu_device *adev) -{ -u32 sol_reg; - - sol_reg =RREG32_SOC15 (MP0 ,0 , mmMP0_SMN_C2PMSG_81); - -/* Will reset for the following suspend abort cases. -* 1) Only reset limit on APU side, dGPU hasn't checked yet. -* 2) S3 suspend abort and TOS already launched. -*/ -if (adev->flags &AMD_IS_APU && adev->in_s3 && - !adev->suspend_complete && - sol_reg) -return true; - -return false; -} -static int soc15_common_resume (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 48/451 ASoC: amd: yc: Fix non-functional mic on Lenovo 21J2
In reply to Sasha LevinFrom: Jiawei Wang <[email protected]>
[ Upstream commit ed00a6945dc32462c2d3744a3518d2316da66fcc ]
Like many other models, the Lenovo 21J2 (ThinkBook 16 G5+ APO) needs a quirk entry for the internal microphone to function.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -199,6 +199,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "21J2"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 49/451 Bluetooth: rfcomm: Fix null-ptr-deref in rfcomm_check_security
In reply to Sasha LevinFrom: Yuxuan Hu <[email protected]>
[ Upstream commit 2535b848fa0f42ddff3e5255cf5e742c9b77bb26 ]
During our fuzz testing of the connection and disconnection process at the RFCOMM layer, we discovered this bug. By comparing the packets from a normal connection and disconnection process with the testcase that triggered a KASAN report. We analyzed the cause of this bug as follows:
1. In the packets captured during a normal connection, the host sends a Read Encryption Key Size type of HCI_CMD packet
(Command Opcode: 0x1408) to the controller to inquire the length of encryption key.After receiving this packet, the controller immediately replies with a Command Completepacket (Event Code: 0x0e) to return the Encryption Key Size.
2. In our fuzz test case, the timing of the controller's response to this packet was delayed to an unexpected point: after the RFCOMM and L2CAP layers had disconnected but before the HCI layer had disconnected.
3. After receiving the Encryption Key Size Response at the time described in point 2, the host still called the rfcomm_check_security function. However, by this time struct l2cap_conn *conn = l2cap_pi(sk)->chan->conn; had already been released, and when the function executed return hci_conn_security(conn->hcon, d->sec_level, auth_type, d->out);, specifically when accessing conn->hcon, a null-ptr-deref error occurred.
To fix this bug, check if sk->sk_state is BT_CLOSED before calling rfcomm_recv_frame in rfcomm_process_rx.
--- net/bluetooth/rfcomm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/rfcomm/core.c +1 -1
@@ -1937,7 +1937,7 @@ static struct rfcomm_session *rfcomm_process_rx(struct rfcomm_session *s)/* Get data directly from socket receive queue without copying it. */ while ((skb =skb_dequeue (&sk->sk_receive_queue))) {skb_orphan (skb); -if (!skb_linearize (skb)) { +if (!skb_linearize (skb) && sk->sk_state !=BT_CLOSED ) { s =rfcomm_recv_frame (s, skb);if (!s)break ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 50/451 Bluetooth: mgmt: Fix limited discoverable off timeout
In reply to Sasha LevinFrom: Frédéric Danis <[email protected]>
[ Upstream commit 0bd1fb586235224048c726922db048d1bce6354a ]
LIMITED_DISCOVERABLE flag is not reset from Class of Device and advertisement on limited discoverable timeout. This prevents to pass PTS test GAP/DISC/LIMM/BV-02-C
Calling set_discoverable_sync as when the limited discovery is set correctly update the Class of Device and advertisement.
--- net/bluetooth/mgmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/bluetooth/mgmt.c +3 -1
@@ -1039,6 +1039,8 @@ static void rpa_expired(struct work_struct *work)hci_cmd_sync_queue (hdev, rpa_expired_sync,NULL ,NULL ); } +static int set_discoverable_sync (struct hci_dev *hdev,void *data); +static void discov_off (struct work_struct *work) { struct hci_dev *hdev = container_of(work, struct hci_dev,
@@ -1057,7 +1059,7 @@ static void discov_off(struct work_struct *work)hci_dev_clear_flag (hdev,HCI_DISCOVERABLE ); hdev->discov_timeout =0 ; -hci_update_discoverable (hdev); +hci_cmd_sync_queue (hdev, set_discoverable_sync,NULL ,NULL );mgmt_new_settings (hdev);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 51/451 firewire: core: use long bus reset on gap count error
In reply to Sasha LevinFrom: Takashi Sakamoto <[email protected]>
[ Upstream commit d0b06dc48fb15902d7da09c5c0861e7f042a9381 ]
When resetting the bus after a gap count error, use a long rather than short bus reset.
IEEE 1394-1995 uses only long bus resets. IEEE 1394a adds the option of short bus resets. When video or audio transmission is in progress and a device is hot-plugged elsewhere on the bus, the resulting bus reset can cause video frame drops or audio dropouts. Short bus resets reduce or eliminate this problem. Accordingly, short bus resets are almost always preferred.
However, on a mixed 1394/1394a bus, a short bus reset can trigger an immediate additional bus reset. This double bus reset can be interpreted differently by different nodes on the bus, resulting in an inconsistent gap count after the bus reset. An inconsistent gap count will cause another bus reset, leading to a neverending bus reset loop. This only happens for some bus topologies, not for all mixed 1394/1394a buses.
By instead sending a long bus reset after a gap count inconsistency, we avoid the doubled bus reset, restoring the bus to normal operation.
--- drivers/firewire/core-card.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/firewire/core-card.c +13 -1
@@ -500,7 +500,19 @@ static void bm_work(struct work_struct *work)fw_notice (card,"phy config: new root=%x, gap_count=%d\n" , new_root_id, gap_count);fw_send_phy_config (card, new_root_id, generation, gap_count); -reset_bus (card, true); +/* +* Where possible, use a short bus reset to minimize +* disruption to isochronous transfers. But in the event +* of a gap count inconsistency, use a long bus reset. +* +* As noted in 1394a 8.4.6.2, nodes on a mixed 1394/1394a bus +* may set different gap counts after a bus reset. On a mixed +* 1394/1394a bus, a short bus reset can get doubled. Some +* nodes may treat the double reset as one bus reset and others +* may treat it as two, causing a gap count inconsistency +* again. Using a long bus reset prevents this. +*/ +reset_bus (card, card->gap_count !=0 );/* Will allocate broadcast channel after the reset. */ goto out; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 52/451 arm64: tegra: Set the correct PHY mode for MGBE
In reply to Sasha LevinFrom: Thierry Reding <[email protected]>
[ Upstream commit 4c892121d43bc2b45896ca207b54f39a8fa6b852 ]
The PHY is configured in 10GBASE-R, so make sure to reflect that in DT.
--- arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts +1 -1
@@ -2024,7 +2024,7 @@ ethernet@6800000 { status = "okay"; phy-handle = <&mgbe0_phy>; - phy-mode = "usxgmii"; + phy-mode = "10gbase-r"; mdio { #address-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 53/451 ASoC: Intel: bytcr_rt5640: Add an extra entry for the Chuwi Vi8 tablet
In reply to Sasha LevinFrom: Alban Boyé <[email protected]>
[ Upstream commit f8b0127aca8c60826e7354e504a12d4a46b1c3bb ]
The bios version can differ depending if it is a dual-boot variant of the tablet. Therefore another DMI match is required.
--- sound/soc/intel/boards/bytcr_rt5640.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/intel/boards/bytcr_rt5640.c +12 -0
@@ -685,6 +685,18 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {BYT_RT5640_SSP0_AIF1 | BYT_RT5640_MCLK_EN), }, + { /* Chuwi Vi8 dual-boot (CWI506) */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Insyde" ), +DMI_EXACT_MATCH (DMI_PRODUCT_NAME ,"i86" ), +/* The above are too generic, also match BIOS info */ + DMI_MATCH(DMI_BIOS_VERSION, "CHUWI2.D86JHBNR02"), + }, + .driver_data = (void *)(BYTCR_INPUT_DEFAULTS | +BYT_RT5640_MONO_SPEAKER | +BYT_RT5640_SSP0_AIF1 | + BYT_RT5640_MCLK_EN), + }, {/* Chuwi Vi10 (CWI505) */ .matches = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 54/451 Input: gpio_keys_polled - suppress deferred probe error for gpio
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 963465a33141d0d52338e77f80fe543d2c9dc053 ]
On a PC Engines APU our admins are faced with:
$ dmesg | grep -c "gpio-keys-polled gpio-keys-polled: unable to claim gpio 0, err=-517" 261
Such a message always appears when e.g. a new USB device is plugged in.
Suppress this message which considerably clutters the kernel log for EPROBE_DEFER (i.e. -517).
--- drivers/input/keyboard/gpio_keys_polled.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/input/keyboard/gpio_keys_polled.c +4 -6
@@ -319,12 +319,10 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) error =devm_gpio_request_one (dev, button->gpio, flags, button->desc ? :DRV_NAME ); -if (error) { -dev_err (dev, -"unable to claim gpio %u, err=%d\n" , - button->gpio, error); -return error; - } +if (error) +return dev_err_probe (dev, error, +"unable to claim gpio %u\n" , + button->gpio); bdata->gpiod =gpio_to_desc (button->gpio);if (!bdata->gpiod) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 55/451 ASoC: wm8962: Enable oscillator if selecting WM8962_FLL_OSC
In reply to Sasha LevinFrom: Stuart Henderson <[email protected]>
[ Upstream commit 03c7874106ca5032a312626b927b1c35f07b1f35 ]
--- sound/soc/codecs/wm8962.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/codecs/wm8962.c +4 -0
@@ -2914,8 +2914,12 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int sswitch (fll_id) {case WM8962_FLL_MCLK :case WM8962_FLL_BCLK : + fll1 |= (fll_id -1 ) <<WM8962_FLL_REFCLK_SRC_SHIFT ; +break ;case WM8962_FLL_OSC : fll1 |= (fll_id -1 ) <<WM8962_FLL_REFCLK_SRC_SHIFT ; +snd_soc_component_update_bits (component,WM8962_PLL2 , +WM8962_OSC_ENA ,WM8962_OSC_ENA );break ;case WM8962_FLL_INT : snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 56/451 ASoC: wm8962: Enable both SPKOUTR_ENA and SPKOUTL_ENA in mono mode
In reply to Sasha LevinFrom: Stuart Henderson <[email protected]>
[ Upstream commit 6fa849e4d78b880e878138bf238e4fd2bac3c4fa ]
--- sound/soc/codecs/wm8962.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
sound/soc/codecs/wm8962.c +14 -9
@@ -2229,6 +2229,9 @@ SND_SOC_DAPM_PGA_E("HPOUT", SND_SOC_NOPM, 0, 0, NULL, 0, hp_event,SND_SOC_DAPM_OUTPUT ("HPOUTL" ),SND_SOC_DAPM_OUTPUT ("HPOUTR" ), + +SND_SOC_DAPM_PGA ("SPKOUTL Output" ,WM8962_CLASS_D_CONTROL_1 ,6 ,0 ,NULL ,0 ), +SND_SOC_DAPM_PGA("SPKOUTR Output", WM8962_CLASS_D_CONTROL_1, 7, 0, NULL, 0), }; static const struct snd_soc_dapm_widget wm8962_dapm_spk_mono_widgets[] = {
@@ -2236,7 +2239,6 @@ SND_SOC_DAPM_MIXER("Speaker Mixer", WM8962_MIXER_ENABLES, 1, 0, spkmixl, ARRAY_SIZE(spkmixl)), SND_SOC_DAPM_MUX_E("Speaker PGA", WM8962_PWR_MGMT_2, 4, 0, &spkoutl_mux, out_pga_event, SND_SOC_DAPM_POST_PMU), -SND_SOC_DAPM_PGA ("Speaker Output" ,WM8962_CLASS_D_CONTROL_1 ,7 ,0 ,NULL ,0 ), SND_SOC_DAPM_OUTPUT("SPKOUT"), };
@@ -2251,9 +2253,6 @@ SND_SOC_DAPM_MUX_E("SPKOUTL PGA", WM8962_PWR_MGMT_2, 4, 0, &spkoutl_mux,SND_SOC_DAPM_MUX_E ("SPKOUTR PGA" ,WM8962_PWR_MGMT_2 ,3 ,0 , &spkoutr_mux, out_pga_event,SND_SOC_DAPM_POST_PMU ), -SND_SOC_DAPM_PGA ("SPKOUTR Output" ,WM8962_CLASS_D_CONTROL_1 ,7 ,0 ,NULL ,0 ), -SND_SOC_DAPM_PGA ("SPKOUTL Output" ,WM8962_CLASS_D_CONTROL_1 ,6 ,0 ,NULL ,0 ), -SND_SOC_DAPM_OUTPUT ("SPKOUTL" ), SND_SOC_DAPM_OUTPUT("SPKOUTR"), };
@@ -2366,12 +2365,18 @@ static const struct snd_soc_dapm_route wm8962_spk_mono_intercon[] = { { "Speaker PGA", "Mixer", "Speaker Mixer" }, { "Speaker PGA", "DAC", "DACL" }, - { "Speaker Output", NULL, "Speaker PGA" }, - { "Speaker Output", NULL, "SYSCLK" }, - { "Speaker Output", NULL, "TOCLK" }, - { "Speaker Output", NULL, "TEMP_SPK" }, + { "SPKOUTL Output", NULL, "Speaker PGA" }, + { "SPKOUTL Output", NULL, "SYSCLK" }, + { "SPKOUTL Output", NULL, "TOCLK" }, + { "SPKOUTL Output", NULL, "TEMP_SPK" }, + + { "SPKOUTR Output", NULL, "Speaker PGA" }, + { "SPKOUTR Output", NULL, "SYSCLK" }, + { "SPKOUTR Output", NULL, "TOCLK" }, + { "SPKOUTR Output", NULL, "TEMP_SPK" }, - { "SPKOUT", NULL, "Speaker Output" }, + { "SPKOUT", NULL, "SPKOUTL Output" }, + { "SPKOUT", NULL, "SPKOUTR Output" }, }; static const struct snd_soc_dapm_route wm8962_spk_stereo_intercon[] = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 57/451 ASoC: wm8962: Fix up incorrect error message in wm8962_set_fll
In reply to Sasha LevinFrom: Stuart Henderson <[email protected]>
[ Upstream commit 96e202f8c52ac49452f83317cf3b34cd1ad81e18 ]
Use source instead of ret, which seems to be unrelated and will always be zero.
--- sound/soc/codecs/wm8962.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm8962.c +1 -1
@@ -2933,7 +2933,7 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s WM8962_FLL_FRC_NCO, WM8962_FLL_FRC_NCO);break ;default : -dev_err (component->dev,"Unknown FLL source %d\n" , ret); +dev_err (component->dev,"Unknown FLL source %d\n" , source);return -EINVAL ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 58/451 do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak
In reply to Sasha LevinFrom: 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
@@ -37,7 +37,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 59/451 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
@@ -267,7 +267,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 :
@@ -287,19 +287,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 60/451 s390/dasd: add autoquiesce feature
In reply to Sasha LevinFrom: Stefan Haberland <[email protected]>
[ Upstream commit 1cee2975bbabd89df1097c354867192106b058ea ]
Add the internal logic to check for autoquiesce triggers and handle them.
Quiesce and resume are functions that tell Linux to stop/resume issuing I/Os to a specific DASD.
The DASD driver allows a manual quiesce/resume via ioctl.
Autoquiesce will define an amount of triggers that will lead to an automatic quiesce if a certain event occurs.
There is no automatic resume.
All events will be reported via DASD Extended Error Reporting (EER) if configured.
Stable-dep-of: c3116e62ddef ("s390/dasd: fix double module refcount decrement")
--- arch/s390/include/uapi/asm/dasd.h | 2 ++ drivers/s390/block/dasd.c | 60 ++++++++++++++++++++++--------- drivers/s390/block/dasd_eer.c | 1 + drivers/s390/block/dasd_int.h | 2 ++ 4 files changed, 48 insertions(+), 17 deletions(-)
arch/s390/include/uapi/asm/dasd.h +2 -0
@@ -78,6 +78,7 @@ typedef struct dasd_information2_t {* 0x040: give access to raw eckd data * 0x080: enable discard support * 0x100: enable autodisable for IFCC errors (default) +* 0x200: enable requeue of all requests on autoquiesce */ #define DASD_FEATURE_READONLY 0x001#define DASD_FEATURE_USEDIAG 0x002
@@ -88,6 +89,7 @@ typedef struct dasd_information2_t {#define DASD_FEATURE_USERAW 0x040#define DASD_FEATURE_DISCARD 0x080#define DASD_FEATURE_PATH_AUTODISABLE 0x100 +#define DASD_FEATURE_REQUEUEQUIESCE 0x200#define DASD_FEATURE_DEFAULT DASD_FEATURE_PATH_AUTODISABLE#define DASD_PARTN_BITS 2
drivers/s390/block/dasd.c +43 -17
112 lines not on this page · raw message
drivers/s390/block/dasd_eer.c +1 -0
@@ -387,6 +387,7 @@ void dasd_eer_write(struct dasd_device *device, struct dasd_ccw_req *cqr,break ;case DASD_EER_NOPATH :case DASD_EER_NOSPC : +case DASD_EER_AUTOQUIESCE :dasd_eer_write_standard_trigger (device,NULL , id);break ;case DASD_EER_STATECHANGE :
drivers/s390/block/dasd_int.h +2 -0
@@ -464,6 +464,7 @@ extern struct dasd_discipline *dasd_diag_discipline_pointer;#define DASD_EER_STATECHANGE 3#define DASD_EER_PPRCSUSPEND 4#define DASD_EER_NOSPC 5 +#define DASD_EER_AUTOQUIESCE 31/* DASD path handling */
@@ -641,6 +642,7 @@ struct dasd_device {struct dasd_format_entry format_entry;struct kset *paths_info;struct dasd_copy_relation *copy; +unsigned long aq_mask; };struct dasd_block {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 61/451 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>
@@ -3390,8 +3387,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); }/*
@@ -3478,8 +3474,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);
@@ -3492,11 +3491,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 ; }
@@ -3504,8 +3502,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 ; }
@@ -3526,8 +3523,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);
@@ -3536,16 +3533,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));
@@ -3556,10 +3552,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);
@@ -3580,11 +3579,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; }
@@ -3947,8 +3945,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 62/451 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
@@ -3512,12 +3512,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 */
@@ -3525,8 +3524,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 63/451 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
@@ -4471,6 +4471,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 64/451 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
@@ -4465,6 +4465,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 ; }
@@ -4473,6 +4474,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
@@ -427,7 +427,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); }
@@ -477,7 +482,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); }
@@ -540,7 +550,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. */
@@ -910,7 +920,7 @@ static int rcu_print_task_exp_stall(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;
@@ -921,6 +931,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.
@@ -950,7 +963,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 {
@@ -968,7 +981,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 65/451 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
@@ -2408,6 +2408,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 66/451 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 67/451 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
@@ -6243,7 +6243,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 ;
@@ -7571,7 +7579,6 @@ static int md_ioctl(struct block_device *bdev, fmode_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 ;
@@ -7658,7 +7665,6 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, err = -EBUSY ; goto out; } - did_set_md_closing = true;mutex_unlock (&mddev->open_mutex);sync_blockdev (bdev); }
@@ -7821,7 +7827,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode, mddev->hold_active =0 ;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 68/451 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 69/451 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 70/451 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 71/451 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 72/451 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
@@ -183,16 +183,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;
@@ -415,142 +549,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 73/451 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
@@ -183,46 +183,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)))
@@ -234,18 +214,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 ))
@@ -255,47 +228,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;
@@ -303,30 +264,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;
@@ -549,10 +514,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 74/451 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
@@ -524,10 +524,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 75/451 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
@@ -64,6 +64,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 76/451 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
@@ -281,14 +281,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 77/451 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 78/451 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 79/451 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 80/451 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 81/451 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
@@ -6678,13 +6678,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; }
@@ -6708,7 +6714,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 ; }
@@ -6970,7 +6976,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 82/451 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
@@ -6656,7 +6656,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 ; }
@@ -6664,7 +6664,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 83/451 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
@@ -844,6 +844,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 84/451 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 85/451 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 86/451 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 87/451 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 88/451 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
@@ -374,13 +374,13 @@ static void handle_connect_timeout(struct work_struct *work)void *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 89/451 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
@@ -374,38 +374,49 @@ static void handle_connect_timeout(struct work_struct *work)void *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 )
@@ -416,7 +427,7 @@ void *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 ];
@@ -431,11 +442,11 @@ void *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 ) {
@@ -459,7 +470,7 @@ void *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;
@@ -474,13 +485,13 @@ void *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 ;
@@ -514,6 +525,7 @@ void *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 90/451 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
@@ -6542,6 +6542,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 91/451 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
@@ -1810,15 +1810,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
@@ -977,13 +977,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);
@@ -996,12 +989,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 92/451 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
@@ -1615,7 +1615,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 93/451 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
@@ -964,9 +964,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 94/451 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/r8a73a4-ape6evm.dts | 12 ++++++++++++ arch/arm/boot/dts/r8a73a4.dtsi | 9 ++++++--- 2 files changed, 18 insertions(+), 3 deletions(-)
arch/arm/boot/dts/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/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 95/451 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 96/451 cpufreq: Explicitly include correct DT includes
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit a70eb93a2477371638ef481aaae7bb7b760d3004 ]
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes.
Stable-dep-of: 788715b5f21c ("cpufreq: mediatek-hw: Wait for CPU supplies before probing")
--- drivers/cpufreq/armada-37xx-cpufreq.c | 4 +--- drivers/cpufreq/mediatek-cpufreq-hw.c | 3 ++- drivers/cpufreq/ppc_cbe_cpufreq.c | 2 +- drivers/cpufreq/ppc_cbe_cpufreq_pmi.c | 1 - drivers/cpufreq/qcom-cpufreq-nvmem.c | 1 - drivers/cpufreq/scpi-cpufreq.c | 2 +- drivers/cpufreq/sti-cpufreq.c | 2 +- drivers/cpufreq/ti-cpufreq.c | 2 +- drivers/cpufreq/vexpress-spc-cpufreq.c | 1 - 9 files changed, 7 insertions(+), 11 deletions(-)
drivers/cpufreq/armada-37xx-cpufreq.c +1 -3
@@ -14,10 +14,8 @@#include <linux/interrupt.h> #include <linux/io.h> #include <linux/mfd/syscon.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/of_address.h> -#include <linux/of_device.h> -#include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/regmap.h>
drivers/cpufreq/mediatek-cpufreq-hw.c +2 -1
@@ -10,8 +10,9 @@#include <linux/iopoll.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/of_address.h> +#include <linux/of.h> #include <linux/of_platform.h> +#include <linux/platform_device.h> #include <linux/slab.h> #define LUT_MAX_ENTRIES 32U
drivers/cpufreq/ppc_cbe_cpufreq.c +1 -1
@@ -9,7 +9,7 @@#include <linux/cpufreq.h> #include <linux/module.h> -#include <linux/of_platform.h> +#include <linux/of.h> #include <asm/machdep.h> #include <asm/cell-regs.h>
drivers/cpufreq/ppc_cbe_cpufreq_pmi.c +0 -1
@@ -11,7 +11,6 @@#include <linux/types.h> #include <linux/timer.h> #include <linux/init.h> -#include <linux/of_platform.h> #include <linux/pm_qos.h> #include <linux/slab.h>
drivers/cpufreq/qcom-cpufreq-nvmem.c +0 -1
@@ -22,7 +22,6 @@#include <linux/module.h> #include <linux/nvmem-consumer.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> #include <linux/pm_opp.h>
drivers/cpufreq/scpi-cpufreq.c +1 -1
@@ -14,7 +14,7 @@#include <linux/cpumask.h> #include <linux/export.h> #include <linux/module.h> -#include <linux/of_platform.h> +#include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/scpi_protocol.h> #include <linux/slab.h>
drivers/cpufreq/sti-cpufreq.c +1 -1
@@ -13,7 +13,7 @@#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_platform.h> +#include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/regmap.h>
drivers/cpufreq/ti-cpufreq.c +1 -1
@@ -12,7 +12,7 @@#include <linux/module.h> #include <linux/init.h> #include <linux/of.h> -#include <linux/of_platform.h> +#include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/regmap.h> #include <linux/slab.h>
drivers/cpufreq/vexpress-spc-cpufreq.c +0 -1
@@ -18,7 +18,6 @@#include <linux/device.h> #include <linux/module.h> #include <linux/mutex.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/slab.h>
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 97/451 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
@@ -296,7 +297,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 98/451 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
@@ -190,7 +190,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;
@@ -206,7 +206,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);
@@ -224,7 +224,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);
@@ -283,12 +283,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 99/451 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);
@@ -1419,7 +1419,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);
@@ -1436,7 +1436,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 100/451 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
@@ -2200,7 +2200,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 101/451 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" ,
@@ -4992,6 +4993,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 102/451 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 103/451 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 104/451 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
@@ -308,7 +308,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 105/451 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
@@ -17,6 +17,20 @@#include <unistd.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 106/451 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/soc/qcom/rpmhpd.c | 1 - 1 file changed, 1 deletion(-)
drivers/soc/qcom/rpmhpd.c +0 -1
@@ -195,7 +195,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 107/451 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
@@ -247,8 +247,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 108/451 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
@@ -277,8 +277,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 109/451 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 110/451 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
@@ -290,19 +290,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 111/451 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
Sasha Levin
maintainerPATCH 112/451 arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 008820524844326ffb3123cebceba1960c0ad0dc ]
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.
--- .../boot/dts/freescale/imx8mm-kontron-bl.dts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +9 -9
@@ -314,40 +314,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
Sasha Levin
maintainerPATCH 113/451 arm64: dts: imx8mm-kontron: Fix interrupt for RTC on OSM-S i.MX8MM module
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 8d0f39b7d04d864e89b84063b124fd10aa4b8809 ]
The level of the interrupt signal is active low instead. Fix this.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +1 -1
@@ -205,7 +205,7 @@ rtc@52 { reg = <0x52>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rtc>; - interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_HIGH>; + interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_LOW>; trickle-diode-disable; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 114/451 libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim API
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 93ee1eb85e28d1e35bb059c1f5965d65d5fc83c2 ]
LIBBPF_API annotation seems missing on libbpf_set_memlock_rlim API, so add it to make this API callable from libbpf's shared library version.
--- tools/lib/bpf/bpf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/bpf.h +1 -1
@@ -35,7 +35,7 @@extern "C" {#endif -int libbpf_set_memlock_rlim (size_t memlock_bytes); +LIBBPF_API int libbpf_set_memlock_rlim(size_t memlock_bytes);struct bpf_map_create_opts {size_t sz;/* size of this struct for forward/backward compatibility */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 115/451 wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is complete
In reply to Sasha LevinFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 24355fcb0d4cbcb6ddda262596558e8cfba70f11 ]
The ath9k_wmi_event_tasklet() used in ath9k_htc assumes that all the data structures have been fully initialised by the time it runs. However, because of the order in which things are initialised, this is not guaranteed to be the case, because the device is exposed to the USB subsystem before the ath9k driver initialisation is completed.
We already committed a partial fix for this in commit:8b3046abc99e ("ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet()")
However, that commit only aborted the WMI_TXSTATUS_EVENTID command in the event tasklet, pairing it with an "initialisation complete" bit in the TX struct. It seems syzbot managed to trigger the race for one of the other commands as well, so let's just move the existing synchronisation bit to cover the whole tasklet (setting it at the end of ath9k_htc_probe_device() instead of inside ath9k_tx_init()).
--- 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 ++++++---- 4 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +1 -1
@@ -306,7 +306,6 @@ struct ath9k_htc_tx {DECLARE_BITMAP (tx_slot,MAX_TX_BUF_NUM );struct timer_list cleanup_timer;spinlock_t tx_lock; -bool initialized; };struct ath9k_htc_tx_ctl {
@@ -515,6 +514,7 @@ struct ath9k_htc_priv {unsigned long ps_usecount;bool ps_enabled;bool ps_idle; +bool initialized;#ifdef CONFIG_MAC80211_LEDS enum led_brightness brightness;
drivers/net/wireless/ath/ath9k/htc_drv_init.c +4 -0
@@ -966,6 +966,10 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, htc_handle->drv_priv = priv; +/* Allow ath9k_wmi_event_tasklet() to operate. */ +smp_wmb (); + priv->initialized = true; +return 0 ; err_init:
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +0 -4
@@ -815,10 +815,6 @@ int ath9k_tx_init(struct ath9k_htc_priv *priv)skb_queue_head_init (&priv->tx.data_vo_queue);skb_queue_head_init (&priv->tx.tx_failed); -/* Allow ath9k_wmi_event_tasklet(WMI_TXSTATUS_EVENTID) to operate. */ -smp_wmb (); - priv->tx.initialized = true; -return 0 ; }
drivers/net/wireless/ath/ath9k/wmi.c +6 -4
@@ -155,6 +155,12 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) }spin_unlock_irqrestore (&wmi->wmi_lock, flags); +/* Check if ath9k_htc_probe_device() completed. */ +if (!data_race (priv->initialized)) { +kfree_skb (skb); +continue ; + } + hdr = (struct wmi_cmd_hdr *) skb->data; cmd_id =be16_to_cpu (hdr->command_id); wmi_event =skb_pull (skb,sizeof (struct wmi_cmd_hdr ));
@@ -169,10 +175,6 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) &wmi->drv_priv->fatal_work);break ;case WMI_TXSTATUS_EVENTID : -/* Check if ath9k_tx_init() completed. */ -if (!data_race (priv->tx.initialized)) -break ; -spin_lock_bh (&priv->tx.tx_lock);if (priv->tx.flags &ATH9K_HTC_OP_TX_DRAIN ) {spin_unlock_bh (&priv->tx.tx_lock);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 116/451 wifi: iwlwifi: mvm: report beacon protection failures
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 91380f768d7f6e3d003755defa792e9a00a1444a ]
Andrei reports that we just silently drop beacons after we report the key counters, but never report to userspace, so wpa_supplicant cannot send the WNM action frame. Fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +15 -11
@@ -299,6 +299,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,u32 status, struct ieee80211_rx_status *stats) { + struct wireless_dev *wdev;struct iwl_mvm_sta *mvmsta;struct iwl_mvm_vif *mvmvif;u8 keyid;
@@ -320,9 +321,15 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,if (!ieee80211_is_beacon (hdr->frame_control))return 0 ; +if (!sta) +return -1 ; + + mvmsta =iwl_mvm_sta_from_mac80211 (sta); + mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); +/* key mismatch - will also report !MIC_OK but we shouldn't count it */ if (!(status &IWL_RX_MPDU_STATUS_KEY_VALID )) -return -1 ; + goto report;/* good cases */ if (likely(status & IWL_RX_MPDU_STATUS_MIC_OK &&
@@ -331,13 +338,6 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,return 0 ; } -if (!sta) -return -1 ; - - mvmsta =iwl_mvm_sta_from_mac80211 (sta); - - mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); -/* * both keys will have the same cipher and MIC length, use * whichever one is available
@@ -346,11 +346,11 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,if (!key) { key =rcu_dereference (mvmvif->bcn_prot.keys[1 ]);if (!key) -return -1 ; + goto report; }if (len < key->icv_len +IEEE80211_GMAC_PN_LEN +2 ) -return -1 ; + goto report;/* get the real key ID */ keyid = frame[len - key->icv_len -IEEE80211_GMAC_PN_LEN -2 ];
@@ -364,7 +364,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,return -1 ; key =rcu_dereference (mvmvif->bcn_prot.keys[keyid -6 ]);if (!key) -return -1 ; + goto report; }/* Report status to mac80211 */
@@ -372,6 +372,10 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,ieee80211_key_mic_failure (key); else if (status & IWL_RX_MPDU_STATUS_REPLAY_ERROR) ieee80211_key_replay(key); +report: + wdev =ieee80211_vif_to_wdev (mvmsta->vif); +if (wdev->netdev) +cfg80211_rx_unprot_mlme_mgmt (wdev->netdev, (void *)hdr, len);return -1 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 117/451 wifi: iwlwifi: dbg-tlv: ensure NUL termination
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit ea1d166fae14e05d49ffb0ea9fcd4658f8d3dcea ]
The iwl_fw_ini_debug_info_tlv is used as a string, so we must ensure the string is terminated correctly before using it.
--- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +6 -0
@@ -103,6 +103,12 @@ static int iwl_dbg_tlv_alloc_debug_info(struct iwl_trans *trans,if (le32_to_cpu (tlv->length) !=sizeof (*debug_info))return -EINVAL ; +/* we use this as a string, ensure input was NUL terminated */ +if (strnlen (debug_info->debug_cfg_name, +sizeof (debug_info->debug_cfg_name)) == +sizeof (debug_info->debug_cfg_name)) +return -EINVAL ; +IWL_DEBUG_FW (trans,"WRT: Loading debug cfg: %s\n" , debug_info->debug_cfg_name);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 118/451 wifi: iwlwifi: fix EWRD table validity check
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit c8d8f3911135921ace8e939ea0956b55f74bf8a0 ]
EWRD ACPI table contains up to 3 additional sar profiles. According to the BIOS spec, the table contains a n_profile variable indicating how many additional profiles exist in the table.
Currently we check that n_profiles is not <= 0.
But according to the BIOS spec, 0 is a valid value, and it can't be < 0 anyway because we receive that from ACPI as an unsigned integer.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +1 -1
@@ -725,7 +725,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)* from index 1, so the maximum value allowed here is * ACPI_SAR_PROFILES_NUM - 1. */ -if (n_profiles <=0 || n_profiles >=ACPI_SAR_PROFILE_NUM ) { +if (n_profiles >=ACPI_SAR_PROFILE_NUM ) { ret = -EINVAL ; goto out_free; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 119/451 gpio: vf610: allow disabling the vf610 driver
In reply to Sasha LevinFrom: Martin Kaiser <[email protected]>
[ Upstream commit f57595788244a838deec2d3be375291327cbc035 ]
The vf610 gpio driver is enabled by default for all i.MX machines, without any option to disable it in a board-specific config file.
Most i.MX chipsets have no hardware for this driver. Change the default to enable GPIO_VF610 for SOC_VF610 and disable it otherwise.
Add a text description after the bool type, this makes the driver selectable by make config etc.
--- drivers/gpio/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/Kconfig +2 -1
@@ -679,7 +679,8 @@ config GPIO_UNIPHIER Say yes here to support UniPhier GPIOs. config GPIO_VF610 - def_bool y + bool "VF610 GPIO support" + default y if SOC_VF610 depends on ARCH_MXC select GPIOLIB_IRQCHIP help
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 120/451 arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS
In reply to Sasha LevinFrom: Tim Harvey <[email protected]>
[ Upstream commit ec2cb52fcfef5d58574f2cfbc9a99ffc20ae5a9d ]
The GW71xx does not have a gpio controlled vbus regulator but it does require some pinctrl. Remove the regulator and move the valid pinctrl into the usbotg1 node.
--- .../dts/freescale/imx8mm-venice-gw71xx.dtsi | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi +9 -20
@@ -47,17 +47,6 @@ pps { gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; status = "okay"; }; - - reg_usb_otg1_vbus: regulator-usb-otg1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_reg_usb1_en>; - compatible = "regulator-fixed"; - regulator-name = "usb_otg1_vbus"; - gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; - enable-active-high; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; }; /* off-board header */
@@ -146,9 +135,10 @@ &uart3 { }; &usbotg1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg1>; dr_mode = "otg"; over-current-active-low; - vbus-supply = <®_usb_otg1_vbus>; status = "okay"; };
@@ -206,14 +196,6 @@ MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x41 >; }; - pinctrl_reg_usb1_en: regusb1grp { - fsl,pins = < - MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x41 - MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 - MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 - >; - }; - pinctrl_spi2: spi2grp { fsl,pins = < MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6
@@ -236,4 +218,11 @@ MX8MM_IOMUXC_UART3_RXD_UART3_DCE_RX 0x140 MX8MM_IOMUXC_UART3_TXD_UART3_DCE_TX 0x140 >; }; + + pinctrl_usbotg1: usbotg1grp { + fsl,pins = < + MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 + MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 + >; + }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 121/451 pwm: atmel-hlcdc: Convert to platform remove callback returning void
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 5fce94170ad8a67b839f3dd8e8e8a87039ba0251 ]
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void.
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Stable-dep-of: e25ac87d3f83 ("pwm: atmel-hlcdc: Fix clock imbalance related to suspend support")
--- drivers/pwm/pwm-atmel-hlcdc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pwm/pwm-atmel-hlcdc.c +2 -4
@@ -278,15 +278,13 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev)return 0 ; } -static int atmel_hlcdc_pwm_remove (struct platform_device *pdev) +static void atmel_hlcdc_pwm_remove (struct platform_device *pdev) {struct atmel_hlcdc_pwm *chip =platform_get_drvdata (pdev);pwmchip_remove (&chip->chip);clk_disable_unprepare (chip->hlcdc->periph_clk); - -return 0 ; }static const struct of_device_id atmel_hlcdc_pwm_dt_ids[] = {
@@ -301,7 +299,7 @@ static struct platform_driver atmel_hlcdc_pwm_driver = { .pm = &atmel_hlcdc_pwm_pm_ops, }, .probe = atmel_hlcdc_pwm_probe, - .remove = atmel_hlcdc_pwm_remove, + .remove_new = atmel_hlcdc_pwm_remove, };module_platform_driver (atmel_hlcdc_pwm_driver);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 122/451 pwm: atmel-hlcdc: Use consistent variable naming
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit aecab554b6ffa9a94ba796031eb39ea20eb60fb3 ]
In PWM drivers the variable name "chip" is usually only used for struct pwm_chip pointers. This driver however used "chip" for its driver data and pwm_chip pointers are named "chip", too, when there is no driver data around and "c" otherwise. Instead use "atmel" for driver data and always "chip" for pwm_chips.
Stable-dep-of: e25ac87d3f83 ("pwm: atmel-hlcdc: Fix clock imbalance related to suspend support")
--- drivers/pwm/pwm-atmel-hlcdc.c | 65 ++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 32 deletions(-)
drivers/pwm/pwm-atmel-hlcdc.c +33 -32
@@ -38,11 +38,11 @@ static inline struct atmel_hlcdc_pwm *to_atmel_hlcdc_pwm(struct pwm_chip *chip) return container_of(chip, struct atmel_hlcdc_pwm, chip); } -static int atmel_hlcdc_pwm_apply (struct pwm_chip *c,struct pwm_device *pwm, +static int atmel_hlcdc_pwm_apply (struct pwm_chip *chip,struct pwm_device *pwm,const struct pwm_state *state) { -struct atmel_hlcdc_pwm *chip =to_atmel_hlcdc_pwm (c); -struct atmel_hlcdc *hlcdc = chip->hlcdc; +struct atmel_hlcdc_pwm *atmel =to_atmel_hlcdc_pwm (chip); +struct atmel_hlcdc *hlcdc = atmel->hlcdc;unsigned int status;int ret;
@@ -54,7 +54,7 @@ static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm,u32 pwmcfg;int pres; -if (!chip->errata || !chip->errata->slow_clk_erratum) { +if (!atmel->errata || !atmel->errata->slow_clk_erratum) { clk_freq =clk_get_rate (new_clk);if (!clk_freq)return -EINVAL ;
@@ -64,7 +64,7 @@ static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm, }/* Errata: cannot use slow clk on some IP revisions */ -if ((chip->errata && chip->errata->slow_clk_erratum) || +if ((atmel->errata && atmel->errata->slow_clk_erratum) || clk_period_ns > state->period) { new_clk = hlcdc->sys_clk; clk_freq =clk_get_rate (new_clk);
@@ -77,8 +77,8 @@ static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm,for (pres =0 ; pres <=ATMEL_HLCDC_PWMPS_MAX ; pres++) {/* Errata: cannot divide by 1 on some IP revisions */ -if (!pres && chip->errata && - chip->errata->div1_clk_erratum) +if (!pres && atmel->errata && + atmel->errata->div1_clk_erratum)continue ;if ((clk_period_ns << pres) >= state->period)
@@ -90,7 +90,7 @@ static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm, pwmcfg =ATMEL_HLCDC_PWMPS (pres); -if (new_clk != chip->cur_clk) { +if (new_clk != atmel->cur_clk) {u32 gencfg =0 ;int ret;
@@ -98,8 +98,8 @@ static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm,if (ret)return ret; -clk_disable_unprepare (chip->cur_clk); - chip->cur_clk = new_clk; +clk_disable_unprepare (atmel->cur_clk); + atmel->cur_clk = new_clk;if (new_clk == hlcdc->sys_clk) gencfg =ATMEL_HLCDC_CLKPWMSEL ;
@@ -160,8 +160,8 @@ static int atmel_hlcdc_pwm_apply(struct pwm_chip *c, struct pwm_device *pwm,if (ret)return ret; -clk_disable_unprepare (chip->cur_clk); - chip->cur_clk =NULL ; +clk_disable_unprepare (atmel->cur_clk); + atmel->cur_clk =NULL ; }return 0 ;
@@ -183,31 +183,32 @@ static const struct atmel_hlcdc_pwm_errata atmel_hlcdc_pwm_sama5d3_errata = {#ifdef CONFIG_PM_SLEEP static int atmel_hlcdc_pwm_suspend (struct device *dev) { -struct atmel_hlcdc_pwm *chip =dev_get_drvdata (dev); +struct atmel_hlcdc_pwm *atmel =dev_get_drvdata (dev);/* Keep the periph clock enabled if the PWM is still running. */ -if (pwm_is_enabled (&chip->chip.pwms[0 ])) -clk_disable_unprepare (chip->hlcdc->periph_clk); +if (pwm_is_enabled (&atmel->chip.pwms[0 ])) +clk_disable_unprepare (atmel->hlcdc->periph_clk);return 0 ; }static int atmel_hlcdc_pwm_resume (struct device *dev) { -struct atmel_hlcdc_pwm *chip =dev_get_drvdata (dev); +struct atmel_hlcdc_pwm *atmel =dev_get_drvdata (dev);struct pwm_state state;int ret; -pwm_get_state (&chip->chip.pwms[0 ], &state); +pwm_get_state (&atmel->chip.pwms[0 ], &state);/* Re-enable the periph clock it was stopped during suspend. */ if (!state.enabled) { - ret =clk_prepare_enable (chip->hlcdc->periph_clk); + ret =clk_prepare_enable (atmel->hlcdc->periph_clk);if (ret)return ret; } -return atmel_hlcdc_pwm_apply (&chip->chip, &chip->chip.pwms[0 ], &state); +return atmel_hlcdc_pwm_apply (&atmel->chip, &atmel->chip.pwms[0 ], + &state); }#endif
@@ -244,14 +245,14 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev) {const struct of_device_id *match;struct device *dev = &pdev->dev; -struct atmel_hlcdc_pwm *chip; +struct atmel_hlcdc_pwm *atmel;struct atmel_hlcdc *hlcdc;int ret; hlcdc =dev_get_drvdata (dev->parent); - chip =devm_kzalloc (dev,sizeof (*chip),GFP_KERNEL ); -if (!chip) + atmel =devm_kzalloc (dev,sizeof (*atmel),GFP_KERNEL ); +if (!atmel)return -ENOMEM ; ret =clk_prepare_enable (hlcdc->periph_clk);
@@ -260,31 +261,31 @@ static int atmel_hlcdc_pwm_probe(struct platform_device *pdev) match =of_match_node (atmel_hlcdc_dt_ids, dev->parent->of_node);if (match) - chip->errata = match->data; + atmel->errata = match->data; - chip->hlcdc = hlcdc; - chip->chip.ops = &atmel_hlcdc_pwm_ops; - chip->chip.dev = dev; - chip->chip.npwm =1 ; + atmel->hlcdc = hlcdc; + atmel->chip.ops = &atmel_hlcdc_pwm_ops; + atmel->chip.dev = dev; + atmel->chip.npwm =1 ; - ret =pwmchip_add (&chip->chip); + ret =pwmchip_add (&atmel->chip);if (ret) {clk_disable_unprepare (hlcdc->periph_clk);return ret; } -platform_set_drvdata (pdev, chip); +platform_set_drvdata (pdev, atmel);return 0 ; }static void atmel_hlcdc_pwm_remove (struct platform_device *pdev) { -struct atmel_hlcdc_pwm *chip =platform_get_drvdata (pdev); +struct atmel_hlcdc_pwm *atmel =platform_get_drvdata (pdev); -pwmchip_remove (&chip->chip); +pwmchip_remove (&atmel->chip); -clk_disable_unprepare (chip->hlcdc->periph_clk); +clk_disable_unprepare (atmel->hlcdc->periph_clk); }static const struct of_device_id atmel_hlcdc_pwm_dt_ids[] = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 123/451 pwm: atmel-hlcdc: Fix clock imbalance related to suspend support
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit e25ac87d3f831fed002c34aadddaf4ebb4ea45ec ]
The suspend callback disables the periph clock when the PWM is enabled and resume reenables this clock if the PWM was disabled before. Judging from the code comment it's suspend that is wrong here. Fix accordingly.
--- drivers/pwm/pwm-atmel-hlcdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-atmel-hlcdc.c +1 -1
@@ -186,7 +186,7 @@ static int atmel_hlcdc_pwm_suspend(struct device *dev)struct atmel_hlcdc_pwm *atmel =dev_get_drvdata (dev);/* Keep the periph clock enabled if the PWM is still running. */ -if (pwm_is_enabled (&atmel->chip.pwms[0 ])) +if (!pwm_is_enabled (&atmel->chip.pwms[0 ]))clk_disable_unprepare (atmel->hlcdc->periph_clk);return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 124/451 net: blackhole_dev: fix build warning for ethh set but not used
In reply to Sasha LevinFrom: Breno Leitao <[email protected]>
[ Upstream commit 843a8851e89e2e85db04caaf88d8554818319047 ]
lib/test_blackhole_dev.c sets a variable that is never read, causing this following building warning:
lib/test_blackhole_dev.c:32:17: warning: variable 'ethh' set but not used [-Wunused-but-set-variable]
Remove the variable struct ethhdr *ethh, which is unused.
--- lib/test_blackhole_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/test_blackhole_dev.c +1 -2
@@ -29,7 +29,6 @@ static int __init test_blackholedev_init(void) {struct ipv6hdr *ip6h;struct sk_buff *skb; -struct ethhdr *ethh;struct udphdr *uh;int data_len;int ret;
@@ -61,7 +60,7 @@ static int __init test_blackholedev_init(void) ip6h->saddr = in6addr_loopback; ip6h->daddr = in6addr_loopback;/* Ether */ - ethh = (struct ethhdr *)skb_push (skb,sizeof (struct ethhdr )); +skb_push (skb,sizeof (struct ethhdr ));skb_set_mac_header (skb,0 ); skb->protocol =htons (ETH_P_IPV6 );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 125/451 wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use
In reply to Sasha LevinFrom: Baochen Qiang <[email protected]>
[ Upstream commit b802e7b7e771dee3377d071418281f8b64d2d832 ]
Currently in ath11k_peer_assoc_h_he() rx_mcs_80 and rx_mcs_160 are used to calculate max_nss, see
if (support_160) max_nss = min(rx_mcs_80, rx_mcs_160); else max_nss = rx_mcs_80;
Kernel test robot complains on uninitialized symbols:drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'. drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_160'. drivers/net/wireless/ath/ath11k/mac.c:2323 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'.
This is because there are some code paths that never set them, so the assignment of max_nss can come from uninitialized variables. This could result in some unknown issues since a wrong peer_nss might be passed to firmware.
Change to initialize them to an invalid value at the beginning. This makes sense because even max_nss gets an invalid value, due to either or both of them being invalid, we can get an valid peer_nss with following guard:
arg->peer_nss = min(sta->deflink.rx_nss, max_nss)
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/mac.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +4 -0
@@ -2112,6 +2112,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, mcs_160_map =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_160); mcs_80_map =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_80); +/* Initialize rx_mcs_160 to 9 which is an invalid value */ + rx_mcs_160 =9 ;if (support_160) {for (i =7 ; i >=0 ; i--) {u8 mcs_160 = (mcs_160_map >> (2 * i)) &3 ;
@@ -2123,6 +2125,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, } } +/* Initialize rx_mcs_80 to 9 which is an invalid value */ + rx_mcs_80 =9 ;for (i =7 ; i >=0 ; i--) {u8 mcs_80 = (mcs_80_map >> (2 * i)) &3 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 126/451 wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
In reply to Sasha LevinFrom: Zhipeng Lu <[email protected]>
[ Upstream commit 5f0e4aede01cb01fa633171f0533affd25328c3a ]
In the for statement of lbs_allocate_cmd_buffer(), if the allocation of cmdarray[i].cmdbuf fails, both cmdarray and cmdarray[i].cmdbuf needs to be freed. Otherwise, there will be memleaks in lbs_allocate_cmd_buffer().
--- drivers/net/wireless/marvell/libertas/cmd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/libertas/cmd.c +11 -2
@@ -1132,7 +1132,7 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)if (!cmdarray[i].cmdbuf) {lbs_deb_host ("ALLOC_CMD_BUF: ptempvirtualaddr is NULL\n" ); ret =-1 ; - goto done; + goto free_cmd_array; } }
@@ -1140,8 +1140,17 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)init_waitqueue_head (&cmdarray[i].cmdwait_q);lbs_cleanup_and_insert_cmd (priv, &cmdarray[i]); } - ret =0 ; +return 0 ; +free_cmd_array: +for (i =0 ; i <LBS_NUM_CMD_BUFFERS ; i++) { +if (cmdarray[i].cmdbuf) { +kfree (cmdarray[i].cmdbuf); + cmdarray[i].cmdbuf =NULL ; + } + } +kfree (priv->cmd_array); + priv->cmd_array =NULL ; done:return ret; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 127/451 wifi: wfx: fix memory leak when starting AP
In reply to Sasha LevinFrom: Jérôme Pouiller <[email protected]>
[ Upstream commit b8cfb7c819dd39965136a66fe3a7fde688d976fc ]
Kmemleak reported this error:
unreferenced object 0xd73d1180 (size 184):
comm "wpa_supplicant", pid 1559, jiffies 13006305 (age 964.245s)
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 1e 00 01 00 00 00 00 00 ................
backtrace:
[<5ca11420>] kmem_cache_alloc+0x20c/0x5ac
[<127bdd74>] __alloc_skb+0x144/0x170
[<fb8a5e38>] __netdev_alloc_skb+0x50/0x180
[<0f9fa1d5>] __ieee80211_beacon_get+0x290/0x4d4 [mac80211]
[<7accd02d>] ieee80211_beacon_get_tim+0x54/0x18c [mac80211]
[<41e25cc3>] wfx_start_ap+0xc8/0x234 [wfx]
[<93a70356>] ieee80211_start_ap+0x404/0x6b4 [mac80211]
[<a4a661cd>] nl80211_start_ap+0x76c/0x9e0 [cfg80211]
[<47bd8b68>] genl_rcv_msg+0x198/0x378
[<453ef796>] netlink_rcv_skb+0xd0/0x130
[<6b7c977a>] genl_rcv+0x34/0x44
[<66b2d04d>] netlink_unicast+0x1b4/0x258
[<f965b9b6>] netlink_sendmsg+0x1e8/0x428
[<aadb8231>] ____sys_sendmsg+0x1e0/0x274
[<d2b5212d>] ___sys_sendmsg+0x80/0xb4
[<69954f45>] __sys_sendmsg+0x64/0xa8
unreferenced object 0xce087000 (size 1024):
comm "wpa_supplicant", pid 1559, jiffies 13006305 (age 964.246s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
10 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<9a993714>] __kmalloc_track_caller+0x230/0x600
[<f83ea192>] kmalloc_reserve.constprop.0+0x30/0x74
[<a2c61343>] __alloc_skb+0xa0/0x170
[<fb8a5e38>] __netdev_alloc_skb+0x50/0x180
[<0f9fa1d5>] __ieee80211_beacon_get+0x290/0x4d4 [mac80211]
[<7accd02d>] ieee80211_beacon_get_tim+0x54/0x18c [mac80211]
[<41e25cc3>] wfx_start_ap+0xc8/0x234 [wfx]
[<93a70356>] ieee80211_start_ap+0x404/0x6b4 [mac80211]
[<a4a661cd>] nl80211_start_ap+0x76c/0x9e0 [cfg80211]
[<47bd8b68>] genl_rcv_msg+0x198/0x378
[<453ef796>] netlink_rcv_skb+0xd0/0x130
[<6b7c977a>] genl_rcv+0x34/0x44
[<66b2d04d>] netlink_unicast+0x1b4/0x258
[<f965b9b6>] netlink_sendmsg+0x1e8/0x428
[<aadb8231>] ____sys_sendmsg+0x1e0/0x274
[<d2b5212d>] ___sys_sendmsg+0x80/0xb4However, since the kernel is build optimized, it seems the stack is not accurate. It appears the issue is related to wfx_set_mfp_ap(). The issue is obvious in this function: memory allocated by ieee80211_beacon_get() is never released. Fixing this leak makes kmemleak happy.
--- drivers/net/wireless/silabs/wfx/sta.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/silabs/wfx/sta.c +10 -5
@@ -362,6 +362,7 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif)const int pairwise_cipher_suite_count_offset =8 /sizeof (u16);const int pairwise_cipher_suite_size =4 /sizeof (u16);const int akm_suite_size =4 /sizeof (u16); +int ret = -EINVAL ;const u16 *ptr;if (unlikely (!skb))
@@ -370,22 +371,26 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif) ptr = (u16 *)cfg80211_find_ie (WLAN_EID_RSN , skb->data + ieoffset, skb->len - ieoffset);if (unlikely (!ptr)) -return -EINVAL ; + goto free_skb; ptr += pairwise_cipher_suite_count_offset;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb; ptr +=1 + pairwise_cipher_suite_size * *ptr;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb; ptr +=1 + akm_suite_size * *ptr;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb;wfx_hif_set_mfp (wvif, *ptr &BIT (7 ), *ptr &BIT (6 )); -return 0 ; + ret =0 ; + +free_skb: +dev_kfree_skb (skb); +return ret; } int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 128/451 arm64: dts: qcom: msm8998: switch USB QMP PHY to new style of bindings
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit b7efebfeb2e8ad8187cdabba5f0212ba2e6c1069 ]
Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes).
Stable-dep-of: fc835b2311d4 ("arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY")
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 35 +++++++++++---------------- 1 file changed, 14 insertions(+), 21 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +14 -21
@@ -2030,7 +2030,7 @@ usb3_dwc3: usb@a800000 { interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; snps,dis_u2_susphy_quirk; snps,dis_enblslpm_quirk; - phys = <&qusb2phy>, <&usb1_ssphy>; + phys = <&qusb2phy>, <&usb3phy>; phy-names = "usb2-phy", "usb3-phy"; snps,has-lpm-erratum; snps,hird-threshold = /bits/ 8 <0x10>;
@@ -2039,33 +2039,26 @@ usb3_dwc3: usb@a800000 { usb3phy: phy@c010000 { compatible = "qcom,msm8998-qmp-usb3-phy"; - reg = <0x0c010000 0x18c>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <1>; - ranges; + reg = <0x0c010000 0x1000>; clocks = <&gcc GCC_USB3_PHY_AUX_CLK>, + <&gcc GCC_USB3_CLKREF_CLK>, <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, - <&gcc GCC_USB3_CLKREF_CLK>; - clock-names = "aux", "cfg_ahb", "ref"; + <&gcc GCC_USB3_PHY_PIPE_CLK>; + clock-names = "aux", + "ref", + "cfg_ahb", + "pipe"; + clock-output-names = "usb3_phy_pipe_clk_src"; + #clock-cells = <0>; + #phy-cells = <0>; resets = <&gcc GCC_USB3_PHY_BCR>, <&gcc GCC_USB3PHY_PHY_BCR>; - reset-names = "phy", "common"; + reset-names = "phy", + "phy_phy"; - usb1_ssphy: phy@c010200 { - reg = <0xc010200 0x128>, - <0xc010400 0x200>, - <0xc010c00 0x20c>, - <0xc010600 0x128>, - <0xc010800 0x200>; - #phy-cells = <0>; - #clock-cells = <0>; - clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>; - clock-names = "pipe0"; - clock-output-names = "usb3_phy_pipe_clk_src"; - }; + status = "disabled"; }; qusb2phy: phy@c012000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 129/451 arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit fc835b2311d4deb85d776c1d73562338462aa7ac ]
The USB3 PHY on the MSM8998 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +7 -0
@@ -1052,6 +1052,11 @@ tcsr_regs_1: syscon@1f60000 { reg = <0x01f60000 0x20000>; }; + tcsr_regs_2: syscon@1fc0000 { + compatible = "qcom,msm8998-tcsr", "syscon"; + reg = <0x01fc0000 0x26000>; + }; + tlmm: pinctrl@3400000 { compatible = "qcom,msm8998-pinctrl"; reg = <0x03400000 0xc00000>;
@@ -2058,6 +2063,8 @@ usb3phy: phy@c010000 { reset-names = "phy", "phy_phy"; + qcom,tcsr-reg = <&tcsr_regs_2 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 130/451 arm64: dts: qcom: sc8280xp: update UFS PHY nodes
In reply to Sasha LevinFrom: Johan Hovold <[email protected]>
[ Upstream commit 33c4e6588e4f018abc43381ee21fe2bed37e34a5 ]
Update the UFS PHY nodes to match the new binding.
Stable-dep-of: 1d4ef9644e21 ("arm64: dts: qcom: sc8280xp: Fix UFS PHY clocks")
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 49 +++++++++----------------- 1 file changed, 17 insertions(+), 32 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +17 -32
@@ -845,7 +845,7 @@ ufs_mem_hc: ufs@1d84000 { "jedec,ufs-2.0"; reg = <0 0x01d84000 0 0x3000>; interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>; - phys = <&ufs_mem_phy_lanes>; + phys = <&ufs_mem_phy>; phy-names = "ufsphy"; lanes-per-direction = <2>; #reset-cells = <1>;
@@ -887,27 +887,20 @@ ufs_mem_hc: ufs@1d84000 { ufs_mem_phy: phy@1d87000 { compatible = "qcom,sc8280xp-qmp-ufs-phy"; - reg = <0 0x01d87000 0 0x1c8>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - clock-names = "ref", - "ref_aux"; + reg = <0 0x01d87000 0 0x1000>; + clocks = <&gcc GCC_UFS_CARD_CLKREF_CLK>, <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; + clock-names = "ref", "ref_aux"; + + power-domains = <&gcc UFS_PHY_GDSC>; resets = <&ufs_mem_hc 0>; reset-names = "ufsphy"; - status = "disabled"; - ufs_mem_phy_lanes: phy@1d87400 { - reg = <0 0x01d87400 0 0x108>, - <0 0x01d87600 0 0x1e0>, - <0 0x01d87c00 0 0x1dc>, - <0 0x01d87800 0 0x108>, - <0 0x01d87a00 0 0x1e0>; - #phy-cells = <0>; - }; + #phy-cells = <0>; + + status = "disabled"; }; ufs_card_hc: ufs@1da4000 {
@@ -915,7 +908,7 @@ ufs_card_hc: ufs@1da4000 { "jedec,ufs-2.0"; reg = <0 0x01da4000 0 0x3000>; interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>; - phys = <&ufs_card_phy_lanes>; + phys = <&ufs_card_phy>; phy-names = "ufsphy"; lanes-per-direction = <2>; #reset-cells = <1>;
@@ -956,28 +949,20 @@ ufs_card_hc: ufs@1da4000 { ufs_card_phy: phy@1da7000 { compatible = "qcom,sc8280xp-qmp-ufs-phy"; - reg = <0 0x01da7000 0 0x1c8>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - clock-names = "ref", - "ref_aux"; + reg = <0 0x01da7000 0 0x1000>; + clocks = <&gcc GCC_UFS_1_CARD_CLKREF_CLK>, <&gcc GCC_UFS_CARD_PHY_AUX_CLK>; + clock-names = "ref", "ref_aux"; + + power-domains = <&gcc UFS_CARD_GDSC>; resets = <&ufs_card_hc 0>; reset-names = "ufsphy"; - status = "disabled"; + #phy-cells = <0>; - ufs_card_phy_lanes: phy@1da7400 { - reg = <0 0x01da7400 0 0x108>, - <0 0x01da7600 0 0x1e0>, - <0 0x01da7c00 0 0x1dc>, - <0 0x01da7800 0 0x108>, - <0 0x01da7a00 0 0x1e0>; - #phy-cells = <0>; - }; + status = "disabled"; }; tcsr_mutex: hwlock@1f40000 {
Signature · 1 line
2.43.0
Re: [PATCH 6.1 130/451] arm64: dts: qcom: sc8280xp: update UFS PHY nodes
Quoted 6 lines · Sasha Levin
From: Johan Hovold <[email protected]>
[ Upstream commit
33c4e6588e4f018abc43381ee21fe2bed37e34a5]Update the UFS PHY nodes to match the new binding.
Quoted 7 lines
Signed-off-by Johan Hovold <[email protected]>Reviewed-by Brian Masney <[email protected]>Reviewed-by Konrad Dybcio <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>Stable-dep-of:
1d4ef9644e21("arm64: dts: qcom: sc8280xp: Fix UFS PHY clocks")Signed-off-by Sasha Levin <[email protected]>
As I already pointed out once when you added the patch, this change on its own breaks the driver and must not be backported. Neither should the Stable-dep-off (similar for the other Qualcomm SoCs).
You acked that mail, but looks like they were not dropped from the 6.1 queue.
Johan
Sasha Levin
maintainerPATCH 131/451 printk: Disable passing console lock owner completely during panic()
In reply to Sasha LevinFrom: Petr Mladek <[email protected]>
[ Upstream commit d04d5882cd678b898a9d7c5aee6afbe9e6e77fcd ]
The commit d51507098ff91 ("printk: disable optimistic spin during panic") added checks to avoid becoming a console waiter if a panic is in progress.
However, the transition to panic can occur while there is already a waiter. The current owner should not pass the lock to the waiter because it might get stopped or blocked anytime.
Also the panic context might pass the console lock owner to an already stopped waiter by mistake. It might happen when console_flush_on_panic() ignores the current lock owner, for example:
CPU0 CPU1
---- ----console_lock_spinning_enable()
console_trylock_spinning()
[CPU1 now console waiter]
NMI: panic()
panic_other_cpus_shutdown()
[stopped as console waiter]
console_flush_on_panic()
console_lock_spinning_enable()
[print 1 record] console_lock_spinning_disable_and_check()
[handover to stopped CPU1]
This results in panic() not flushing the panic messages.
Fix these problems by disabling all spinning operations completely during panic().
Another advantage is that it prevents possible deadlocks caused by "console_owner_lock". The panic() context does not need to take it any longer. The lockless checks are safe because the functions become NOPs when they see the panic in progress. All operations manipulating the state are still synchronized by the lock even when non-panic CPUs would notice the panic synchronously.
The current owner might stay spinning. But non-panic() CPUs would get stopped anyway and the panic context will never start spinning.
--- kernel/printk/printk.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
kernel/printk/printk.c +29 -0
@@ -1797,10 +1797,23 @@ static bool console_waiter;*/ static void console_lock_spinning_enable (void ) { +/* +* Do not use spinning in panic(). The panic CPU wants to keep the lock. +* Non-panic CPUs abandon the flush anyway. +* +* Just keep the lockdep annotation. The panic-CPU should avoid +* taking console_owner_lock because it might cause a deadlock. +* This looks like the easiest way how to prevent false lockdep +* reports without handling races a lockless way. +*/ +if (panic_in_progress ()) + goto lockdep; +raw_spin_lock (&console_owner_lock); console_owner = current;raw_spin_unlock (&console_owner_lock); +lockdep:/* The waiter may spin on us after setting console_owner */ spin_acquire (&console_owner_dep_map,0 ,0 , _THIS_IP_); }
@@ -1824,6 +1837,22 @@ static int console_lock_spinning_disable_and_check(void) {int waiter; +/* +* Ignore spinning waiters during panic() because they might get stopped +* or blocked at any time, +* +* It is safe because nobody is allowed to start spinning during panic +* in the first place. If there has been a waiter then non panic CPUs +* might stay spinning. They would get stopped anyway. The panic context +* will never start spinning and an interrupted spin on panic CPU will +* never continue. +*/ +if (panic_in_progress ()) { +/* Keep lockdep happy. */ +spin_release (&console_owner_dep_map, _THIS_IP_); +return 0 ; + } +raw_spin_lock (&console_owner_lock); waiter =READ_ONCE (console_waiter); console_owner =NULL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 132/451 pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 5f623835584f1c8d1030666796f40c47a448ce0b ]
The driver only used the number of pwm channels to set the pwm_chip's npwm member. The result is that if there are more capture channels than PWM channels specified in the device tree, only a part of the capture channel is usable. Fix that by passing the bigger channel count to the pwm framework. This makes it possible that the .apply() callback is called with .hwpwm >= pwm_num_devs, catch that case and return an error code.
--- drivers/pwm/pwm-sti.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/pwm/pwm-sti.c +10 -1
@@ -395,8 +395,17 @@ static int sti_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,static int sti_pwm_apply (struct pwm_chip *chip,struct pwm_device *pwm,const struct pwm_state *state) { +struct sti_pwm_chip *pc =to_sti_pwmchip (chip); +struct sti_pwm_compat_data *cdata = pc->cdata; +struct device *dev = pc->dev;int err; +if (pwm->hwpwm >= cdata->pwm_num_devs) { +dev_err (dev,"device %u is not valid for pwm mode\n" , + pwm->hwpwm); +return -EINVAL ; + } +if (state->polarity !=PWM_POLARITY_NORMAL )return -EINVAL ;
@@ -647,7 +656,7 @@ static int sti_pwm_probe(struct platform_device *pdev) pc->chip.dev = dev; pc->chip.ops = &sti_pwm_ops; - pc->chip.npwm = pc->cdata->pwm_num_devs; + pc->chip.npwm =max (cdata->pwm_num_devs, cdata->cpt_num_devs);for (i =0 ; i < cdata->cpt_num_devs; i++) {struct sti_cpt_ddata *ddata = &cdata->ddata[i];
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 133/451 tools/resolve_btfids: Refactor set sorting with types from btf_ids.h
In reply to Sasha LevinFrom: Viktor Malik <[email protected]>
[ Upstream commit 9707ac4fe2f5bac6406d2403f8b8a64d7b3d8e43 ]
Instead of using magic offsets to access BTF ID set data, leverage types from btf_ids.h (btf_id_set and btf_id_set8) which define the actual layout of the data. Thanks to this change, set sorting should also continue working if the layout changes.
This requires to sync the definition of 'struct btf_id_set8' from include/linux/btf_ids.h to tools/include/linux/btf_ids.h. We don't sync the rest of the file at the moment, b/c that would require to also sync multiple dependent headers and we don't need any other defs from btf_ids.h.
Stable-dep-of: 903fad439466 ("tools/resolve_btfids: Fix cross-compilation to non-host endianness")
--- tools/bpf/resolve_btfids/main.c | 35 ++++++++++++++++++++------------- tools/include/linux/btf_ids.h | 9 +++++++++ 2 files changed, 30 insertions(+), 14 deletions(-)
tools/bpf/resolve_btfids/main.c +21 -14
@@ -70,6 +70,7 @@#include <sys/stat.h> #include <fcntl.h> #include <errno.h> +#include <linux/btf_ids.h> #include <linux/rbtree.h> #include <linux/zalloc.h> #include <linux/err.h>
@@ -78,7 +79,7 @@#include <subcmd/parse-options.h> #define BTF_IDS_SECTION ".BTF_ids" -#define BTF_ID "__BTF_ID__" +#define BTF_ID_PREFIX "__BTF_ID__"#define BTF_STRUCT "struct"#define BTF_UNION "union"
@@ -161,7 +162,7 @@ static int eprintf(int level, int var, const char *fmt, ...)static bool is_btf_id (const char *name) { -return name && !strncmp (name,BTF_ID ,sizeof (BTF_ID ) -1 ); +return name && !strncmp (name,BTF_ID_PREFIX ,sizeof (BTF_ID_PREFIX ) -1 ); }static struct btf_id *btf_id__find (struct rb_root *root,const char *name)
@@ -441,7 +442,7 @@ static int symbols_collect(struct object *obj)* __BTF_ID__TYPE__vfs_truncate__0 * prefix = ^ */ - prefix = name +sizeof (BTF_ID ) -1 ; + prefix = name +sizeof (BTF_ID_PREFIX ) -1 ;/* struct */ if (!strncmp (prefix,BTF_STRUCT ,sizeof (BTF_STRUCT ) -1 )) {
@@ -649,19 +650,18 @@ static int cmp_id(const void *pa, const void *pb)static int sets_patch (struct object *obj) {Elf_Data *data = obj->efile.idlist; -int *ptr = data->d_buf;struct rb_node *next; next =rb_first (&obj->sets);while (next) { -unsigned long addr, idx; +struct btf_id_set8 *set8; +struct btf_id_set *set; +unsigned long addr, off;struct btf_id *id; -int *base; -int cnt; id = rb_entry(next, struct btf_id, rb_node); addr = id->addr[0 ]; - idx = addr - obj->efile.idlist_addr; + off = addr - obj->efile.idlist_addr;/* sets are unique */ if (id->addr_cnt !=1 ) {
@@ -670,14 +670,21 @@ static int sets_patch(struct object *obj)return -1 ; } - idx = idx /sizeof (int ); - base = &ptr[idx] + (id->is_set8 ?2 :1 ); - cnt = ptr[idx]; +if (id->is_set) { + set = data->d_buf + off; +qsort (set->ids, set->cnt,sizeof (set->ids[0 ]), cmp_id); + }else { + set8 = data->d_buf + off; +/* +* Make sure id is at the beginning of the pairs +* struct, otherwise the below qsort would not work. +*/ +BUILD_BUG_ON (set8->pairs != &set8->pairs[0 ].id); +qsort (set8->pairs, set8->cnt,sizeof (set8->pairs[0 ]), cmp_id); + }pr_debug ("sorting addr %5lu: cnt %6d [%s]\n" , - (idx +1 ) *sizeof (int ), cnt, id->name); - -qsort (base, cnt, id->is_set8 ?sizeof (uint64_t ) :sizeof (int ), cmp_id); + off, id->is_set ? set->cnt : set8->cnt, id->name); next =rb_next (next); }
tools/include/linux/btf_ids.h +9 -0
@@ -8,6 +8,15 @@ struct btf_id_set {u32 ids[]; }; +struct btf_id_set8 { +u32 cnt; +u32 flags; +struct { +u32 id; +u32 flags; + } pairs[]; +}; +#ifdef CONFIG_DEBUG_INFO_BTF #include <linux/compiler.h> /* for __PASTE */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 134/451 tools/resolve_btfids: Fix cross-compilation to non-host endianness
In reply to Sasha LevinFrom: Viktor Malik <[email protected]>
[ Upstream commit 903fad4394666bc23975c93fb58f137ce64b5192 ]
The .BTF_ids section is pre-filled with zeroed BTF ID entries during the build and afterwards patched by resolve_btfids with correct values. Since resolve_btfids always writes in host-native endianness, it relies on libelf to do the translation when the target ELF is cross-compiled to a different endianness (this was introduced in commit 61e8aeda9398 ("bpf: Fix libelf endian handling in resolv_btfids")).
Unfortunately, the translation will corrupt the flags fields of SET8 entries because these were written during vmlinux compilation and are in the correct endianness already. This will lead to numerous selftests failures such as:
$ sudo ./test_verifier 502 502
#502/p sleepable fentry accept FAIL
Failed to load prog 'Invalid argument'!
bpf_fentry_test1 is not sleepable
verification time 34 usec
stack depth 0
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
Summary: 0 PASSED, 0 SKIPPED, 1 FAILEDSince it's not possible to instruct libelf to translate just certain values, let's manually bswap the flags (both global and entry flags) in resolve_btfids when needed, so that libelf then translates everything correctly.
--- tools/bpf/resolve_btfids/main.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
tools/bpf/resolve_btfids/main.c +35 -0
@@ -90,6 +90,14 @@#define ADDR_CNT 100 +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define ELFDATANATIVE ELFDATA2LSB +#elif __BYTE_ORDER == __BIG_ENDIAN +# define ELFDATANATIVE ELFDATA2MSB +#else +# error "Unknown machine endianness!" +#endif +struct btf_id {struct rb_node rb_node;char *name;
@@ -117,6 +125,7 @@ struct object {int idlist_shndx;size_t strtabidx;unsigned long idlist_addr; +int encoding; } efile;struct rb_root sets;
@@ -320,6 +329,7 @@ static int elf_collect(struct object *obj) {Elf_Scn *scn =NULL ;size_t shdrstrndx; +GElf_Ehdr ehdr;int idx =0 ;Elf *elf;int fd;
@@ -351,6 +361,13 @@ static int elf_collect(struct object *obj)return -1 ; } +if (gelf_getehdr (obj->efile.elf, &ehdr) ==NULL ) { +pr_err ("FAILED cannot get ELF header: %s\n" , +elf_errmsg (-1 )); +return -1 ; + } + obj->efile.encoding = ehdr.e_ident[EI_DATA ]; +/* * Scan all the elf sections and look for save data * from .BTF_ids section and symbols.
@@ -681,6 +698,24 @@ static int sets_patch(struct object *obj)*/ BUILD_BUG_ON (set8->pairs != &set8->pairs[0 ].id);qsort (set8->pairs, set8->cnt,sizeof (set8->pairs[0 ]), cmp_id); + +/* +* When ELF endianness does not match endianness of the +* host, libelf will do the translation when updating +* the ELF. This, however, corrupts SET8 flags which are +* already in the target endianness. So, let's bswap +* them to the host endianness and libelf will then +* correctly translate everything. +*/ +if (obj->efile.encoding !=ELFDATANATIVE ) { +int i; + + set8->flags =bswap_32 (set8->flags); +for (i =0 ; i < set8->cnt; i++) { + set8->pairs[i].flags = +bswap_32 (set8->pairs[i].flags); + } + } } pr_debug("sorting addr %5lu: cnt %6d [%s]\n",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 135/451 wifi: iwlwifi: mvm: don't set replay counters to 0xff
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit d5bd4041cd70faf26fc9a54bd6f172537bbe77f3 ]
The firmware (later) actually uses the values even for keys that are invalid as far as the host is concerned, later in rekeying, and then only sets the low 48 bits since the PNs are only 48 bits over the air. It does, however, compare the full 64 bits later, obviously causing problems.
Remove the memset and use kzalloc instead to avoid any old heap data leaking to the firmware. We already init all the other fields in the struct anyway. This leaves the data set to zero for any unused fields, so the firmware can look at them safely even if they're not used right now.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -3
@@ -461,12 +461,10 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm,struct wowlan_key_rsc_v5_data data = {};int i; - data.rsc =kmalloc (sizeof (*data.rsc),GFP_KERNEL ); + data.rsc =kzalloc (sizeof (*data.rsc),GFP_KERNEL );if (!data.rsc)return -ENOMEM ; -memset (data.rsc,0xff ,sizeof (*data.rsc)); -for (i =0 ; i <ARRAY_SIZE (data.rsc->mcast_key_id_map); i++) data.rsc->mcast_key_id_map[i] =IWL_MCAST_KEY_MAP_INVALID ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 136/451 s390/pai: fix attr_event_free upper limit for pai device drivers
In reply to Sasha LevinFrom: Thomas Richter <[email protected]>
[ Upstream commit 225d09d6e5f3870560665a1829d2db79330b4c58 ]
When the device drivers are initialized, a sysfs directory is created. This contains many attributes which are allocated with kzalloc(). Should it fail, the memory for the attributes already created is freed in attr_event_free(). Its second parameter is number of attribute elements to delete. This parameter is off by one. When i. e. the 10th attribute fails to get created, attributes numbered 0 to 9 should be deleted. Currently only attributes numbered 0 to 8 are deleted.
--- arch/s390/kernel/perf_pai_crypto.c | 2 +- arch/s390/kernel/perf_pai_ext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/perf_pai_crypto.c +1 -1
@@ -647,7 +647,7 @@ static int __init attr_event_init(void)for (i =0 ; i <ARRAY_SIZE (paicrypt_ctrnames); i++) { ret =attr_event_init_one (attrs, i);if (ret) { -attr_event_free (attrs, i -1 ); +attr_event_free (attrs, i);return ret; } }
arch/s390/kernel/perf_pai_ext.c +1 -1
@@ -612,7 +612,7 @@ static int __init attr_event_init(void)for (i =0 ; i <ARRAY_SIZE (paiext_ctrnames); i++) { ret =attr_event_init_one (attrs, i);if (ret) { -attr_event_free (attrs, i -1 ); +attr_event_free (attrs, i);return ret; } }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 137/451 s390/vdso: drop '-fPIC' from LDFLAGS
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 0628c03934187be33942580e10bb9afcc61adeed ]
'-fPIC' as an option to the linker does not do what it seems like it should. With ld.bfd, it is treated as '-f PIC', which does not make sense based on the meaning of '-f':
-f SHLIB, --auxiliary SHLIB Auxiliary filter for shared object symbol table
When building with ld.lld (currently under review in a GitHub pull request), it just errors out because '-f' means nothing and neither does '-fPIC':
ld.lld: error: unknown argument '-fPIC'
'-fPIC' was blindly copied from CFLAGS when the vDSO stopped being linked with '$(CC)', it should not be needed. Remove it to clear up the build failure with ld.lld.
--- arch/s390/kernel/vdso32/Makefile | 2 +- arch/s390/kernel/vdso64/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/vdso32/Makefile +1 -1
@@ -22,7 +22,7 @@ KBUILD_AFLAGS_32 += -m31 -s KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin -LDFLAGS_vdso32.so.dbg += -fPIC -shared -soname=linux-vdso32.so.1 \ +LDFLAGS_vdso32.so.dbg += -shared -soname=linux-vdso32.so.1 \ --hash-style=both --build-id=sha1 -melf_s390 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
arch/s390/kernel/vdso64/Makefile +1 -1
@@ -26,7 +26,7 @@ KBUILD_AFLAGS_64 += -m64 -s KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_64 += -m64 -fPIC -fno-common -fno-builtin -ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \ +ldflags-y := -shared -soname=linux-vdso64.so.1 \ --hash-style=both --build-id=sha1 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 138/451 selftests: forwarding: Add missing config entries
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit 4acf4e62cd572b0c806035046b3698f5585ab821 ]
The config file contains a partial kernel configuration to be used by `virtme-configkernel --custom'. The presumption is that the config file contains all Kconfig options needed by the selftests from the directory.
In net/forwarding/config, many are missing, which manifests as spurious failures when running the selftests, with messages about unknown device types, qdisc kinds or classifier actions. Add the missing configurations.
Tested the resulting configuration using virtme-ng as follows:
# vng -b -f tools/testing/selftests/net/forwarding/config # vng --user root (within the VM:) # make -C tools/testing/selftests TARGETS=net/forwarding run_tests
Stable-dep-of: f0ddf15f0a74 ("selftests: forwarding: Add missing multicast routing config entries")
--- tools/testing/selftests/net/forwarding/config | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
tools/testing/selftests/net/forwarding/config +28 -0
@@ -6,14 +6,42 @@ CONFIG_IPV6_MULTIPLE_TABLES=y CONFIG_NET_VRF=m CONFIG_BPF_SYSCALL=y CONFIG_CGROUP_BPF=y +CONFIG_DUMMY=m +CONFIG_IPV6=y +CONFIG_IPV6_GRE=m +CONFIG_MACVLAN=m CONFIG_NET_ACT_CT=m CONFIG_NET_ACT_MIRRED=m CONFIG_NET_ACT_MPLS=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SAMPLE=m +CONFIG_NET_ACT_SKBEDIT=m +CONFIG_NET_ACT_TUNNEL_KEY=m CONFIG_NET_ACT_VLAN=m CONFIG_NET_CLS_FLOWER=m CONFIG_NET_CLS_MATCHALL=m +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_META=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_DEMUX=m +CONFIG_NET_IPIP=m +CONFIG_NET_SCH_ETS=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_ACT_GACT=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_TC_SKB_EXT=y +CONFIG_NET_TEAM=y +CONFIG_NET_TEAM_MODE_LOADBALANCE=y +CONFIG_NETFILTER=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_FLOW_TABLE=m +CONFIG_NF_TABLES=m CONFIG_VETH=m CONFIG_NAMESPACES=y CONFIG_NET_NS=y +CONFIG_VXLAN=m +CONFIG_XFRM_USER=m
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 139/451 selftests: forwarding: Add missing multicast routing config entries
In reply to Sasha LevinFrom: Ido Schimmel <[email protected]>
[ Upstream commit f0ddf15f0a74c27eb4b2271a90e69948acc3fa2c ]
The two tests that make use of multicast routig (router.sh and router_multicast.sh) are currently failing in the netdev CI because the kernel is missing multicast routing support.
Fix by adding the required config entries.
--- tools/testing/selftests/net/forwarding/config | 7 +++++++ 1 file changed, 7 insertions(+)
tools/testing/selftests/net/forwarding/config +7 -0
@@ -9,6 +9,13 @@ CONFIG_CGROUP_BPF=y CONFIG_DUMMY=m CONFIG_IPV6=y CONFIG_IPV6_GRE=m +CONFIG_IPV6_MROUTE=y +CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y +CONFIG_IPV6_PIMSM_V2=y +CONFIG_IP_MROUTE=y +CONFIG_IP_MROUTE_MULTIPLE_TABLES=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y CONFIG_MACVLAN=m CONFIG_NET_ACT_CT=m CONFIG_NET_ACT_MIRRED=m
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 140/451 ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down()
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit 17ef8efc00b34918b966388b2af0993811895a8c ]
As discussed in the past (commit 2d3916f31891 ("ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()")) I think the synchronize_net() call in ipv6_mc_down() is not needed.
Under load, synchronize_net() can last between 200 usec and 5 ms.
KASAN seems to agree as well.
--- net/ipv6/mcast.c | 1 - 1 file changed, 1 deletion(-)
net/ipv6/mcast.c +0 -1
@@ -2722,7 +2722,6 @@ void ipv6_mc_down(struct inet6_dev *idev)/* Should stop work after group drop. or we will * start work again in mld_ifc_event() */ -synchronize_net ();mld_query_stop_work (idev);mld_report_stop_work (idev);
Signature · 1 line
2.43.0
Re: [PATCH 6.1 140/451] ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down()
Hi!
Quoted 11 lines
From: Eric Dumazet <[email protected]>
[ Upstream commit
17ef8efc00b34918b966388b2af0993811895a8c]As discussed in the past (commit
2d3916f31891("ipv6: fix skb drops inigmp6_event_query()andigmp6_event_report()")) I think thesynchronize_net()call inipv6_mc_down()is not needed.Under load,
synchronize_net()can last between 200 usec and 5 ms.KASAN seems to agree as well.
This is performance tweak, not a bugfix. We probably should not have it in stable.
Best regards,
Pavel
Quoted 12 lines
net/ipv6/mcast.c +0
-1@@ -2722,7 +2722,6 @@ void ipv6_mc_down(struct inet6_dev *idev)/* Should stop work after group drop. or we will * start work again in mld_ifc_event() */ -synchronize_net ();mld_query_stop_work (idev);mld_report_stop_work (idev);
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany