5.10.238-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainercover 5.10.238-rc1 review
This is the start of the stable review cycle for the 5.10.238 release. There are 270 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 04 Jun 2025 13:42:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.238-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.10.238-rc1
Robin Murphy <[email protected]>
perf/arm-cmn: Initialise cmn->cpu earlier
Juergen Gross <[email protected]>
xen/swiotlb: relax alignment requirements
Mark Pearson <[email protected]>
platform/x86: thinkpad_acpi: Ignore battery threshold change event notification
Valtteri Koskivuori <[email protected]>
platform/x86: fujitsu-laptop: Support Lifebook S2110 hotkeys
Michal Suchanek <[email protected]>
tpm: tis: Double the timeout B to 4s
Alessandro Grassi <[email protected]>
spi: spi-sun4i: fix early activation
Masahiro Yamada <[email protected]>
um: let 'make clean' properly clean underlying SUBARCH as well
John Chau <[email protected]>
platform/x86: thinkpad_acpi: Support also NEC Lavie X1475JAS
Jeff Layton <[email protected]>
nfs: don't share pNFS DS connections between net namespaces
Milton Barrera <[email protected]>
HID: quirks: Add ADATA XPG alpha wireless mouse support
Christian Brauner <[email protected]>
coredump: hand a pidfd to the usermode coredump helper
Christian Brauner <[email protected]>
fork: use pidfd_prepare()
Christian Brauner <[email protected]>
pid: add pidfd_prepare()
Christian Brauner <[email protected]>
coredump: fix error handling for replace_fd()
Pedro Tammela <[email protected]>
net_sched: hfsc: Address reentrant enqueue adding class to eltree twice
Wang Zhaolong <[email protected]>
smb: client: Reset all search buffer pointers when releasing buffer
Wang Zhaolong <[email protected]>
smb: client: Fix use-after-free in cifs_fill_dirent
Jani Nikula <[email protected]>
drm/i915/gvt: fix unterminated-string-initialization warning
Nathan Chancellor <[email protected]>
kbuild: Disable -Wdefault-const-init-unsafe
Larisa Grigore <[email protected]>
spi: spi-fsl-dspi: Reset SR flags before sending a new message
Bogdan-Gabriel Roman <[email protected]>
spi: spi-fsl-dspi: Halt the module after a new message transfer
Larisa Grigore <[email protected]>
spi: spi-fsl-dspi: restrict register range for regmap access
Tianyang Zhang <[email protected]>
mm/page_alloc.c: avoid infinite retries caused by cpuset race
Breno Leitao <[email protected]>
memcg: always call cond_resched() after fn()
feijuan.li <[email protected]>
drm/edid: fixed the bug that hdr metadata was not reset
Ilia Gavrilov <[email protected]>
llc: fix data loss when reading from a socket in llc_ui_recvmsg()
Takashi Iwai <[email protected]>
ALSA: pcm: Fix race of buffer access at PCM OSS layer
Oliver Hartkopp <[email protected]>
can: bcm: add missing rcu read protection for procfs content
Oliver Hartkopp <[email protected]>
can: bcm: add locking for bcm_op runtime updates
Dominik Grzegorzek <[email protected]>
padata: do not leak refcount in reorder_work
Ivan Pravdin <[email protected]>
crypto: algif_hash - fix double free in hash_accept
Wang Liang <[email protected]>
net/tipc: fix slab-use-after-free Read in tipc_aead_encrypt_done
Cong Wang <[email protected]>
sch_hfsc: Fix qlen accounting bug when using peek in hfsc_enqueue()
Paul Kocialkowski <[email protected]>
net: dwmac-sun8i: Use parsed internal PHY address instead of 1
Ido Schimmel <[email protected]>
bridge: netfilter: Fix forwarding of fragmented packets
Paul Chaignon <[email protected]>
xfrm: Sanitize marks before insert
Al Viro <[email protected]>
__legitimize_mnt(): check for MNT_SYNC_UMOUNT should be under mount_lock
Jason Andryuk <[email protected]>
xenbus: Allow PVH dom0 a non-local xenstore
Goldwyn Rodrigues <[email protected]>
btrfs: correct the order of prelim_ref arguments in btrfs__prelim_ref
Alistair Francis <[email protected]>
nvmet-tcp: don't restore null sk_state_change
Takashi Iwai <[email protected]>
ALSA: hda/realtek: Add quirk for HP Spectre x360 15-df1xxx
Takashi Iwai <[email protected]>
ASoC: Intel: bytcr_rt5640: Add DMI quirk for Acer Aspire SW3-013
Martin Blumenstingl <[email protected]>
pinctrl: meson: define the pull up/down resistor value as 60 kOhm
Jessica Zhang <[email protected]>
drm: Add valid clones check
Simona Vetter <[email protected]>
drm/atomic: clarify the rules around drm_atomic_state->allow_modeset
Isaac Scott <[email protected]>
regulator: ad5398: Add device tree support
Sean Anderson <[email protected]>
spi: zynqmp-gqspi: Always acknowledge interrupts
Bitterblue Smith <[email protected]>
wifi: rtw88: Don't use static local variable in rtw8822b_set_tx_power_index_by_rate
Ravi Bangoria <[email protected]>
perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt
Viktor Malik <[email protected]>
bpftool: Fix readlink usage in get_fd_type
Thomas Zimmermann <[email protected]>
drm/ast: Find VBIOS mode from regular display size
junan <[email protected]>
HID: usbkbd: Fix the bit shift number for LED_KANA
Kai Mäkisara <[email protected]>
scsi: st: Restore some drive settings after reset
Justin Tee <[email protected]>
scsi: lpfc: Handle duplicate D_IDs in ndlp search-by D_ID routine
Ankur Arora <[email protected]>
rcu: fix header guard for rcu_all_qs()
Ankur Arora <[email protected]>
rcu: handle quiescent states for PREEMPT_RCU=n, PREEMPT_COUNT=y
Ido Schimmel <[email protected]>
vxlan: Annotate FDB data races
Andrey Vatoropin <[email protected]>
hwmon: (xgene-hwmon) use appropriate type for the latency value
Bitterblue Smith <[email protected]>
wifi: rtw88: Fix download_firmware_validate() for RTL8814AU
Kuniyuki Iwashima <[email protected]>
ip: fib_rules: Fetch net from fib_rule in fib[46]_rule_configure().
William Tu <[email protected]>
net/mlx5e: reduce rep rxq depth to 256 for ECPF
William Tu <[email protected]>
net/mlx5e: set the tx_queue_len for pfifo_fast
Alexei Lazar <[email protected]>
net/mlx5: Extend Ethtool loopback selftest to support non-linear SKB
Tom Chung <[email protected]>
drm/amd/display: Initial psr_version with correct setting
Dmitry Baryshkov <[email protected]>
phy: core: don't require set_mode() callback for phy_get_mode() to work
Kees Cook <[email protected]>
net/mlx4_core: Avoid impossible mlx4_db_alloc() order value
Sakari Ailus <[email protected]>
media: v4l: Memset argument to 0 before calling get_mbus_config pad op
Konstantin Andreev <[email protected]>
smack: recognize ipv4 CIPSO w/o categories
Valentin Caron <[email protected]>
pinctrl: devicetree: do not goto err when probing hogs in pinctrl_dt_to_map
Kuninori Morimoto <[email protected]>
ASoC: soc-dai: check return value at snd_soc_dai_set_tdm_slot()
Hector Martin <[email protected]>
ASoC: tas2764: Power up/down amp on mute ops
Martin Povišer <[email protected]>
ASoC: ops: Enforce platform maximum on initial value
Shahar Shitrit <[email protected]>
net/mlx5: Apply rate-limiting to high temperature warning
Shahar Shitrit <[email protected]>
net/mlx5: Modify LSB bitmask in temperature event to include only the first bit
Xiaofei Tan <[email protected]>
ACPI: HED: Always initialize before evged
Ilpo Järvinen <[email protected]>
PCI: Fix old_size lower bound in calculate_iosize() too
Jakub Kicinski <[email protected]>
eth: mlx4: don't try to complete XDP frames in netpoll
Krzysztof Kozlowski <[email protected]>
can: c_can: Use of_property_present() to test existence of DT property
Arnd Bergmann <[email protected]>
EDAC/ie31200: work around false positive build warning
Peter Seiderer <[email protected]>
net: pktgen: fix access outside of user given buffer in pktgen_thread_write()
Bitterblue Smith <[email protected]>
wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
Bitterblue Smith <[email protected]>
wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU
Bitterblue Smith <[email protected]>
wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU
Shivasharan S <[email protected]>
scsi: mpt3sas: Send a diag reset if target reset fails
Paul Burton <[email protected]>
clocksource: mips-gic-timer: Enable counter when CPUs start
Paul Burton <[email protected]>
MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core
Bibo Mao <[email protected]>
MIPS: Use arch specific syscall name match function
Nandakumar Edamana <[email protected]>
libbpf: Fix out-of-bound read
Rafael J. Wysocki <[email protected]>
cpuidle: menu: Avoid discarding useful information
Waiman Long <[email protected]>
x86/nmi: Add an emergency handler in nmi_desc & use it in nmi_shootdown_cpus()
Andrew Davis <[email protected]>
soc: ti: k3-socinfo: Do not use syscon helper to build regmap
Hangbin Liu <[email protected]>
bonding: report duplicate MAC address in all situations
Arnd Bergmann <[email protected]>
net: xgene-v2: remove incorrect ACPI_PTR annotation
Philip Yang <[email protected]>
drm/amdkfd: KFD release_work possible circular locking
Moshe Shemesh <[email protected]>
net/mlx5: Avoid report two health errors on same syndrome
Stanimir Varbanov <[email protected]>
PCI: brcmstb: Add a softdep to MIP MSI-X driver
Stanimir Varbanov <[email protected]>
PCI: brcmstb: Expand inbound window size up to 64GB
Kuhanh Murugasen Krishnan <[email protected]>
fpga: altera-cvp: Increase credit timeout
AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_dpi: Add checks for reg_h_fre_con existence
Alexander Stein <[email protected]>
hwmon: (gpio-fan) Add missing mutex locks
Breno Leitao <[email protected]>
x86/bugs: Make spectre user default depend on MITIGATION_SPECTRE_V2
Ahmad Fatoum <[email protected]>
clk: imx8mp: inform CCF of maximum frequency of clocks
Kuniyuki Iwashima <[email protected]>
ipv4: fib: Move fib_valid_key_len() to rtm_to_fib_config().
Peter Seiderer <[email protected]>
net: pktgen: fix mpls maximum labels list parsing
Alexander Sverdlin <[email protected]>
net: ethernet: ti: cpsw_new: populate netdev of_node
Artur Weber <[email protected]>
pinctrl: bcm281xx: Use "unsigned int" instead of bare "unsigned"
Hans Verkuil <[email protected]>
media: cx231xx: set device_caps for 417
Victor Lu <[email protected]>
drm/amdgpu: Do not program AGP BAR regs under SRIOV in gfxhub_v1_0.c
Matthew Wilcox (Oracle) <[email protected]>
orangefs: Do not truncate file size
Ming-Hung Tsai <[email protected]>
dm cache: prevent BUG_ON by blocking retries on failed device resumes
Markus Elfring <[email protected]>
media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
Svyatoslav Ryhel <[email protected]>
ARM: tegra: Switch DSI-B clock parent to PLLD on Tegra114
Andy Shevchenko <[email protected]>
ieee802154: ca8210: Use proper setters and getters for bitwise types
Alexandre Belloni <[email protected]>
rtc: ds1307: stop disabling alarms on probe
Eric Dumazet <[email protected]>
tcp: bring back NUMA dispersion in inet_ehash_locks_alloc()
Andreas Schwab <[email protected]>
powerpc/prom_init: Fixup missing #size-cells on PowerBook6,7
Diogo Ivo <[email protected]>
arm64: tegra: p2597: Fix gpio for vdd-1v8-dis regulator
Willem de Bruijn <[email protected]>
ipv6: save dontfrag in cork
Erick Shepherd <[email protected]>
mmc: sdhci: Disable SD card clock before changing parameters
Ryan Roberts <[email protected]>
arm64/mm: Check PUD_TYPE_TABLE in pud_bad()
Nicolas Bouchinet <[email protected]>
netfilter: conntrack: Bound nf_conntrack sysctl writes
Eric Dumazet <[email protected]>
posix-timers: Add cond_resched() to posix_timer_add() search loop
Frediano Ziglio <[email protected]>
xen: Add support for XenServer 6.1 platform device
Mikulas Patocka <[email protected]>
dm: restrict dm device size to 2^63-512 bytes
Seyediman Seyedarab <[email protected]>
kbuild: fix argument parsing in scripts/config
Alexandre Belloni <[email protected]>
rtc: rv3032: fix EERD location
Ilpo Järvinen <[email protected]>
tcp: reorganize tcp_in_ack_event() and tcp_count_delivered()
Kai Mäkisara <[email protected]>
scsi: st: ERASE does not change tape location
Kai Mäkisara <[email protected]>
scsi: st: Tighten the page format heuristics with MODE SELECT
Christian Göttsche <[email protected]>
ext4: reorder capability check last
Tiwei Bie <[email protected]>
um: Update min_low_pfn to match changes in uml_reserved
Benjamin Berg <[email protected]>
um: Store full CSGSFS and SS register from mcontext
Nick Hu <[email protected]>
clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug
Filipe Manana <[email protected]>
btrfs: send: return -ENAMETOOLONG when attempting a path that is too long
Mark Harmstone <[email protected]>
btrfs: avoid linker error in btrfs_find_create_tree_block()
Vitalii Mordan <[email protected]>
i2c: pxa: fix call balance of i2c->clk handling routines
Stephan Gerhold <[email protected]>
i2c: qup: Vote for interconnect bandwidth to DRAM
Erick Shepherd <[email protected]>
mmc: host: Wait for Vdd to settle on card power off
Robert Richter <[email protected]>
libnvdimm/labels: Fix divide error in nd_label_data_init()
Trond Myklebust <[email protected]>
pNFS/flexfiles: Report ENETDOWN as a connection error
Ian Rogers <[email protected]>
tools/build: Don't pass test log files to linker
Jing Su <[email protected]>
dql: Fix dql->limit value when reset.
Alice Guo <[email protected]>
thermal/drivers/qoriq: Power down TMU on system suspend
Trond Myklebust <[email protected]>
SUNRPC: rpcbind should never reset the port to the value '0'
Trond Myklebust <[email protected]>
SUNRPC: rpc_clnt_set_transport() must not change the autobind setting
Trond Myklebust <[email protected]>
NFSv4: Treat ENETUNREACH errors as fatal for state recovery
Zsolt Kajtar <[email protected]>
fbdev: core: tileblit: Implement missing margin clearing for tileblit
Zsolt Kajtar <[email protected]>
fbcon: Use correct erase colour for clearing in fbcon
Shixiong Ou <[email protected]>
fbdev: fsl-diu-fb: add missing device_remove_file()
Tudor Ambarus <[email protected]>
mailbox: use error ret code of of_parse_phandle_with_args()
Trond Myklebust <[email protected]>
NFSv4: Check for delegation validity in nfs_start_delegation_return_locked()
Daniel Gomez <[email protected]>
kconfig: merge_config: use an empty file as initfile
gaoxu <[email protected]>
cgroup: Fix compilation issue due to cgroup_mutex not being exported
Marek Szyprowski <[email protected]>
dma-mapping: avoid potential unused data compilation warning
Dmitry Bogdanov <[email protected]>
scsi: target: iscsi: Fix timeout on deleted connection
Alexander Lobakin <[email protected]>
ice: arfs: fix use-after-free when freeing @rx_cpu_rmap
Florian Westphal <[email protected]>
netfilter: nf_tables: do not defer rule destruction via call_rcu
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: wait for rcu grace period on net_device removal
Florian Westphal <[email protected]>
netfilter: nf_tables: pass nft_chain to destroy function, not nft_ctx
Filipe Manana <[email protected]>
btrfs: don't BUG_ON() when 0 reference count at btrfs_lookup_extent_info()
Feng Tang <[email protected]>
selftests/mm: compaction_test: support platform with huge mount of memory
GONG Ruiqi <[email protected]>
usb: typec: fix pm usage counter imbalance in ucsi_ccg_sync_control()
Dan Carpenter <[email protected]>
usb: typec: fix potential array underflow in ucsi_ccg_sync_control()
RD Babiera <[email protected]>
usb: typec: altmodes/displayport: create sysfs nodes as driver's default device attribute group
Zack Rusin <[email protected]>
drm/vmwgfx: Fix a deadlock in dma buf fence polling
Dmitry Baryshkov <[email protected]>
ASoC: q6afe-clocks: fix reprobing of the driver
Sebastian Andrzej Siewior <[email protected]>
clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable()
Yemike Abhilash Chandra <[email protected]>
dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy
Ronald Wahl <[email protected]>
dmaengine: ti: k3-udma: Add missing locking
Fedor Pchelkin <[email protected]>
wifi: mt76: disable napi on driver removal
Claudiu Beznea <[email protected]>
phy: renesas: rcar-gen3-usb2: Set timing registers only once
Ma Ke <[email protected]>
phy: Fix error handling in tegra_xusb_port_init
Steven Rostedt <[email protected]>
tracing: samples: Initialize trace_array_printk() with the correct function
Wentao Liang <[email protected]>
ALSA: es1968: Add error handling for snd_pcm_hw_constraint_pow2()
Jeremy Linton <[email protected]>
ACPI: PPTT: Fix processor subtable walk
Nathan Lynch <[email protected]>
dmaengine: Revert "dmaengine: dmatest: Fix dmatest waiting less when interrupted"
Trond Myklebust <[email protected]>
NFSv4/pnfs: Reset the layout state after a layoutreturn
Abdun Nihaal <[email protected]>
qlcnic: fix memory leak in qlcnic_sriov_channel_cfg_cmd()
Geert Uytterhoeven <[email protected]>
ALSA: sh: SND_AICA should depend on SH_DMA_API
Vladimir Oltean <[email protected]>
net: dsa: sja1105: discard incoming frames in BR_STATE_LISTENING
Mathieu Othacehe <[email protected]>
net: cadence: macb: Fix a possible deadlock in macb_halt_tx.
Cong Wang <[email protected]>
net_sched: Flush gso_skb list too during ->change()
Geert Uytterhoeven <[email protected]>
spi: loopback-test: Do not split 1024-byte hexdumps
Li Lingfeng <[email protected]>
nfs: handle failure of nfs_get_lock_context in unlock path
Zhu Yanjun <[email protected]>
RDMA/rxe: Fix slab-use-after-free Read in rxe_queue_cleanup bug
David Lechner <[email protected]>
iio: chemical: sps30: use aligned_s64 for timestamp
Jonathan Cameron <[email protected]>
iio: adc: ad7768-1: Fix insufficient alignment of timestamp.
Hans de Goede <[email protected]>
platform/x86: asus-wmi: Fix wlan_ctrl_by_user detection
Al Viro <[email protected]>
do_umount(): add missing barrier before refcount checks in sync case
Daniel Wagner <[email protected]>
nvme: unblock ctrl state transition for firmware update
Kevin Baker <[email protected]>
drm/panel: simple: Update timings for AUO G101EVN010
Thorsten Blum <[email protected]>
MIPS: Fix MAX_REG_OFFSET
Jonathan Cameron <[email protected]>
iio: adc: dln2: Use aligned_s64 for timestamp
Andy Shevchenko <[email protected]>
types: Complement the aligned types with signed 64-bit one
Dave Penkler <[email protected]>
usb: usbtmc: Fix erroneous generic_read ioctl return
Dave Penkler <[email protected]>
usb: usbtmc: Fix erroneous wait_srq ioctl return
Dave Penkler <[email protected]>
usb: usbtmc: Fix erroneous get_stb ioctl error returns
Oliver Neukum <[email protected]>
USB: usbtmc: use interruptible sleep in usbtmc_read
Andrei Kuchynski <[email protected]>
usb: typec: ucsi: displayport: Fix NULL pointer access
RD Babiera <[email protected]>
usb: typec: tcpm: delay SNK_TRY_WAIT_DEBOUNCE to SRC_TRYWAIT transition
Jim Lin <[email protected]>
usb: host: tegra: Prevent host controller crash when OTG port is used
Wayne Chang <[email protected]>
usb: gadget: tegra-xudc: ACK ST_RC after clearing CTRL_RUN
Jan Kara <[email protected]>
ocfs2: stop quota recovery before disabling quotas
Jan Kara <[email protected]>
ocfs2: implement handshaking with ocfs2 recovery thread
Jan Kara <[email protected]>
ocfs2: switch osb->disable_recovery to enum
Dmitry Antipov <[email protected]>
module: ensure that kobject_put() is safe for module type kobjects
Jason Andryuk <[email protected]>
xenbus: Use kref to track req lifetime
Alexey Charkov <[email protected]>
usb: uhci-platform: Make the clock really optional
Silvano Seva <[email protected]>
iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_tagged_fifo
Silvano Seva <[email protected]>
iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_fifo
Gabriel Shahrouzi <[email protected]>
iio: adis16201: Correct inclinometer channel resolution
Angelo Dureghello <[email protected]>
iio: adc: ad7606: fix serial register access
Gabriel Shahrouzi <[email protected]>
staging: axis-fifo: Correct handling of tx_fifo_depth for size validation
Gabriel Shahrouzi <[email protected]>
staging: axis-fifo: Remove hardware resets for user errors
Gabriel Shahrouzi <[email protected]>
staging: iio: adc: ad7816: Correct conditional logic for store mode
Aditya Garg <[email protected]>
Input: synaptics - enable InterTouch on TUXEDO InfinityBook Pro 14 v5
Dmitry Torokhov <[email protected]>
Input: synaptics - enable SMBus for HP Elitebook 850 G1
Aditya Garg <[email protected]>
Input: synaptics - enable InterTouch on Dell Precision M3800
Aditya Garg <[email protected]>
Input: synaptics - enable InterTouch on Dynabook Portege X30L-G
Manuel Fombuena <[email protected]>
Input: synaptics - enable InterTouch on Dynabook Portege X30-D
Jonas Gorski <[email protected]>
net: dsa: b53: fix learning on VLAN unaware bridges
Jonas Gorski <[email protected]>
net: dsa: b53: fix VLAN ID for untagged vlan on bridge leave
Jonas Gorski <[email protected]>
net: dsa: b53: allow leaky reserved multicast
Jozsef Kadlecsik <[email protected]>
netfilter: ipset: fix region locking in hash types
Oliver Hartkopp <[email protected]>
can: gw: fix RCU/BH usage in cgw_create_job()
Uladzislau Rezki (Sony) <[email protected]>
rcu/kvfree: Add kvfree_rcu_mightsleep() and kfree_rcu_mightsleep()
Eric Dumazet <[email protected]>
can: gw: use call_rcu() instead of costly synchronize_rcu()
Eelco Chaudron <[email protected]>
openvswitch: Fix unsafe attribute parsing in output_userspace()
Marc Kleine-Budde <[email protected]>
can: mcp251xfd: mcp251xfd_remove(): fix order of unregistration calls
Mike Christie <[email protected]>
scsi: target: Fix WRITE_SAME No Data Buffer crash
Tudor Ambarus <[email protected]>
dm: fix copying after src array boundaries
Fedor Pchelkin <[email protected]>
usb: chipidea: ci_hdrc_imx: implement usb_phy_init() error handling
Alexander Stein <[email protected]>
usb: chipidea: ci_hdrc_imx: use dev_err_probe()
Suzuki K Poulose <[email protected]>
irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode()
Thomas Gleixner <[email protected]>
irqchip/gic-v2m: Mark a few functions __init
Xiang wangx <[email protected]>
irqchip/gic-v2m: Add const to of_device_id
Christian Hewitt <[email protected]>
Revert "drm/meson: vclk: fix calculation of 59.94 fractional rates"
Fiona Klute <[email protected]>
net: phy: microchip: force IRQ polling mode for lan88xx
Ioana Ciornei <[email protected]>
net: phy: microchip: remove the use of .ack_interrupt()
Ioana Ciornei <[email protected]>
net: phy: microchip: implement generic .handle_interrupt() callback
Sergey Shtylyov <[email protected]>
of: module: add buffer overflow check in of_modalias()
Richard Zhu <[email protected]>
PCI: imx6: Skip controller_id generation logic for i.MX7D
Mattias Barthel <[email protected]>
net: fec: ERR007885 Workaround for conventional TX
Thangaraj Samynathan <[email protected]>
net: lan743x: Fix memleak issue when GSO enabled
Michael Liang <[email protected]>
nvme-tcp: fix premature queue removal and I/O failover
Michael Chan <[email protected]>
bnxt_en: Fix ethtool -d byte order for 32-bit values
Felix Fietkau <[email protected]>
net: ipv6: fix UDPv6 GSO segmentation with NAT
Simon Horman <[email protected]>
net: dlink: Correct endianness handling of led_mode
Victor Nogueira <[email protected]>
net_sched: qfq: Fix double list add in class with netem as child qdisc
Victor Nogueira <[email protected]>
net_sched: ets: Fix double list add in class with netem as child qdisc
Victor Nogueira <[email protected]>
net_sched: hfsc: Fix a UAF vulnerability in class with netem as child qdisc
Victor Nogueira <[email protected]>
net_sched: drr: Fix double list add in class with netem as child qdisc
Chris Mi <[email protected]>
net/mlx5: E-switch, Fix error handling for enabling roce
Wenpeng Liang <[email protected]>
net/mlx5: Remove return statement exist at the end of void function
Maor Gottlieb <[email protected]>
net/mlx5: E-Switch, Initialize MAC Address for Default GID
Jakub Kicinski <[email protected]>
net/sched: act_mirred: don't override retval if we already lost the skb
Jeongjun Park <[email protected]>
tracing: Fix oob write in trace_seq_to_buffer()
Mingcong Bai <[email protected]>
iommu/vt-d: Apply quirk_iommu_igfx for 8086:0044 (QM57/QS57)
Pavel Paklov <[email protected]>
iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid
Benjamin Marzinski <[email protected]>
dm: always update the array size in realloc_argv on success
Mikulas Patocka <[email protected]>
dm-integrity: fix a warning on invalid table line
Wentao Liang <[email protected]>
wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage()
Ruslan Piasetskyi <[email protected]>
mmc: renesas_sdhi: Fix error handling in renesas_sdhi_probe
Vishal Badole <[email protected]>
amd-xgbe: Fix to ensure dependent features are toggled with RX checksum offload
Helge Deller <[email protected]>
parisc: Fix double SIGFPE crash
Clark Wang <[email protected]>
i2c: imx-lpi2c: Fix clock count when probe defers
Niravkumar L Rabara <[email protected]>
EDAC/altera: Set DDR and SDMMC interrupt mask before registration
Niravkumar L Rabara <[email protected]>
EDAC/altera: Test the correct error reg offset
Philipp Stanner <[email protected]>
drm/nouveau: Fix WARN_ON in nouveau_fence_context_kill()
Joachim Priesner <[email protected]>
ALSA: usb-audio: Add second USB ID for Jabra Evolve 65 headset
-------------
Diffstat:
Documentation/admin-guide/kernel-parameters.txt | 2 + Makefile | 16 +- arch/arm/boot/dts/tegra114.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi | 2 +- arch/arm64/include/asm/pgtable.h | 3 +- arch/mips/include/asm/ftrace.h | 16 ++ arch/mips/include/asm/ptrace.h | 3 +- arch/mips/kernel/pm-cps.c | 30 +-- arch/parisc/math-emu/driver.c | 16 +- arch/powerpc/kernel/prom_init.c | 4 +- arch/um/Makefile | 1 + arch/um/kernel/mem.c | 1 + arch/x86/events/amd/ibs.c | 3 +- arch/x86/include/asm/nmi.h | 2 + arch/x86/include/asm/perf_event.h | 1 + arch/x86/kernel/cpu/bugs.c | 10 +- arch/x86/kernel/nmi.c | 42 +++++ arch/x86/kernel/reboot.c | 10 +- arch/x86/um/os-Linux/mcontext.c | 3 +- crypto/algif_hash.c | 4 - drivers/acpi/Kconfig | 2 +- drivers/acpi/hed.c | 7 +- drivers/acpi/pptt.c | 11 +- drivers/char/tpm/tpm_tis_core.h | 2 +- drivers/clk/imx/clk-imx8mp.c | 151 +++++++++++++++ drivers/clocksource/i8253.c | 6 +- drivers/clocksource/mips-gic-timer.c | 6 +- drivers/clocksource/timer-riscv.c | 6 + drivers/cpuidle/governors/menu.c | 13 +- drivers/dma/dmatest.c | 6 +- drivers/dma/ti/k3-udma.c | 10 +- drivers/edac/altera_edac.c | 9 +- drivers/edac/altera_edac.h | 2 + drivers/edac/ie31200_edac.c | 28 ++- drivers/fpga/altera-cvp.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 +- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 16 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + drivers/gpu/drm/ast/ast_mode.c | 10 +- drivers/gpu/drm/drm_atomic_helper.c | 28 +++ drivers/gpu/drm/drm_edid.c | 1 + drivers/gpu/drm/i915/gvt/opregion.c | 8 +- drivers/gpu/drm/mediatek/mtk_dpi.c | 5 +- drivers/gpu/drm/meson/meson_vclk.c | 6 +- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- drivers/gpu/drm/panel/panel-simple.c | 25 +-- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17 +- drivers/hid/hid-ids.h | 4 + drivers/hid/hid-quirks.c | 2 + drivers/hid/usbhid/usbkbd.c | 2 +- drivers/hwmon/gpio-fan.c | 16 +- drivers/hwmon/xgene-hwmon.c | 2 +- drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +- drivers/i2c/busses/i2c-pxa.c | 5 +- drivers/i2c/busses/i2c-qup.c | 36 ++++ drivers/iio/accel/adis16201.c | 4 +- drivers/iio/adc/ad7606_spi.c | 2 +- drivers/iio/adc/ad7768-1.c | 2 +- drivers/iio/adc/dln2-adc.c | 2 +- drivers/iio/chemical/sps30.c | 2 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 6 + drivers/infiniband/sw/rxe/rxe_cq.c | 5 +- drivers/input/mouse/synaptics.c | 5 + drivers/iommu/amd/init.c | 8 + drivers/iommu/intel/iommu.c | 4 +- drivers/irqchip/irq-gic-v2m.c | 8 +- drivers/mailbox/mailbox.c | 7 +- drivers/md/dm-cache-target.c | 24 +++ drivers/md/dm-integrity.c | 2 +- drivers/md/dm-table.c | 9 +- .../media/platform/sti/c8sectpfe/c8sectpfe-core.c | 3 +- drivers/media/usb/cx231xx/cx231xx-417.c | 2 + drivers/media/v4l2-core/v4l2-subdev.c | 2 + drivers/mmc/host/renesas_sdhi_core.c | 10 +- drivers/mmc/host/sdhci-pci-core.c | 6 +- drivers/mmc/host/sdhci.c | 9 +- drivers/net/bonding/bond_main.c | 2 +- drivers/net/can/c_can/c_can_platform.c | 2 +- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +- drivers/net/dsa/b53/b53_common.c | 11 +- drivers/net/dsa/sja1105/sja1105_main.c | 6 +- drivers/net/ethernet/amd/xgbe/xgbe-desc.c | 9 +- drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 24 ++- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 11 +- drivers/net/ethernet/amd/xgbe/xgbe.h | 4 + drivers/net/ethernet/apm/xgene-v2/main.c | 4 +- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 36 +++- drivers/net/ethernet/cadence/macb_main.c | 19 +- drivers/net/ethernet/dlink/dl2k.c | 2 +- drivers/net/ethernet/dlink/dl2k.h | 2 +- drivers/net/ethernet/freescale/fec_main.c | 7 +- drivers/net/ethernet/intel/ice/ice_arfs.c | 9 +- drivers/net/ethernet/intel/ice/ice_lib.c | 5 +- drivers/net/ethernet/intel/ice/ice_main.c | 20 +- drivers/net/ethernet/mellanox/mlx4/alloc.c | 6 +- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 + drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 5 + .../net/ethernet/mellanox/mlx5/core/en_selftest.c | 3 + .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 5 +- drivers/net/ethernet/mellanox/mlx5/core/events.c | 11 +- drivers/net/ethernet/mellanox/mlx5/core/health.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 12 +- drivers/net/ethernet/mellanox/mlx5/core/rdma.h | 4 +- drivers/net/ethernet/microchip/lan743x_main.c | 8 +- drivers/net/ethernet/microchip/lan743x_main.h | 1 + .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 7 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- drivers/net/ethernet/ti/cpsw_new.c | 1 + drivers/net/ieee802154/ca8210.c | 9 +- drivers/net/phy/microchip.c | 30 +-- drivers/net/phy/microchip_t1.c | 28 ++- drivers/net/vxlan/vxlan_core.c | 18 +- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +- drivers/net/wireless/mediatek/mt76/dma.c | 1 + drivers/net/wireless/realtek/rtw88/main.c | 40 ++-- drivers/net/wireless/realtek/rtw88/reg.h | 3 +- drivers/net/wireless/realtek/rtw88/rtw8822b.c | 14 +- drivers/net/wireless/realtek/rtw88/util.c | 3 +- drivers/nvdimm/label.c | 3 +- drivers/nvme/host/core.c | 3 +- drivers/nvme/host/tcp.c | 31 ++- drivers/nvme/target/tcp.c | 3 + drivers/of/device.c | 7 +- drivers/pci/controller/dwc/pci-imx6.c | 5 +- drivers/pci/controller/pcie-brcmstb.c | 5 +- drivers/pci/setup-bus.c | 6 +- drivers/perf/arm-cmn.c | 2 +- drivers/phy/phy-core.c | 7 +- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 7 +- drivers/phy/tegra/xusb.c | 8 +- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 44 ++--- drivers/pinctrl/devicetree.c | 10 +- drivers/pinctrl/meson/pinctrl-meson.c | 2 +- drivers/platform/x86/asus-wmi.c | 3 +- drivers/platform/x86/fujitsu-laptop.c | 33 +++- drivers/platform/x86/thinkpad_acpi.c | 7 + drivers/regulator/ad5398.c | 12 +- drivers/rtc/rtc-ds1307.c | 4 +- drivers/rtc/rtc-rv3032.c | 2 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 17 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 12 +- drivers/scsi/st.c | 29 ++- drivers/scsi/st.h | 2 + drivers/soc/ti/k3-socinfo.c | 13 +- drivers/spi/spi-fsl-dspi.c | 46 ++++- drivers/spi/spi-loopback-test.c | 2 +- drivers/spi/spi-sun4i.c | 5 +- drivers/spi/spi-zynqmp-gqspi.c | 22 +-- drivers/staging/axis-fifo/axis-fifo.c | 14 +- drivers/staging/iio/adc/ad7816.c | 2 +- drivers/target/iscsi/iscsi_target.c | 2 +- drivers/target/target_core_file.c | 3 + drivers/target/target_core_iblock.c | 4 + drivers/target/target_core_sbc.c | 6 + drivers/thermal/qoriq_thermal.c | 13 ++ drivers/usb/chipidea/ci_hdrc_imx.c | 36 ++-- drivers/usb/class/usbtmc.c | 59 +++--- drivers/usb/gadget/udc/tegra-xudc.c | 4 + drivers/usb/host/uhci-platform.c | 2 +- drivers/usb/host/xhci-tegra.c | 3 + drivers/usb/typec/altmodes/displayport.c | 18 +- drivers/usb/typec/tcpm/tcpm.c | 2 +- drivers/usb/typec/ucsi/displayport.c | 2 + drivers/usb/typec/ucsi/ucsi_ccg.c | 5 + drivers/video/fbdev/core/bitblit.c | 5 +- drivers/video/fbdev/core/fbcon.c | 10 +- drivers/video/fbdev/core/fbcon.h | 38 +--- drivers/video/fbdev/core/fbcon_ccw.c | 5 +- drivers/video/fbdev/core/fbcon_cw.c | 5 +- drivers/video/fbdev/core/fbcon_ud.c | 5 +- drivers/video/fbdev/core/tileblit.c | 45 ++++- drivers/video/fbdev/fsl-diu-fb.c | 1 + drivers/xen/platform-pci.c | 4 + drivers/xen/swiotlb-xen.c | 18 +- drivers/xen/xenbus/xenbus.h | 2 + drivers/xen/xenbus/xenbus_comms.c | 9 +- drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +- drivers/xen/xenbus/xenbus_probe.c | 14 +- drivers/xen/xenbus/xenbus_xs.c | 18 +- fs/btrfs/extent-tree.c | 25 ++- fs/btrfs/extent_io.c | 7 +- fs/btrfs/send.c | 6 +- fs/cifs/readdir.c | 7 +- fs/coredump.c | 81 +++++++- fs/ext4/balloc.c | 4 +- fs/namespace.c | 9 +- fs/nfs/delegation.c | 3 +- fs/nfs/filelayout/filelayoutdev.c | 6 +- fs/nfs/flexfilelayout/flexfilelayout.c | 1 + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 6 +- fs/nfs/nfs4proc.c | 9 +- fs/nfs/nfs4state.c | 10 +- fs/nfs/pnfs.c | 9 + fs/nfs/pnfs.h | 4 +- fs/nfs/pnfs_nfs.c | 9 +- fs/ocfs2/journal.c | 80 +++++--- fs/ocfs2/journal.h | 1 + fs/ocfs2/ocfs2.h | 17 +- fs/ocfs2/quota_local.c | 9 +- fs/ocfs2/super.c | 3 + fs/orangefs/inode.c | 7 +- include/drm/drm_atomic.h | 23 ++- include/linux/binfmts.h | 1 + include/linux/dma-mapping.h | 12 +- include/linux/ipv6.h | 1 + include/linux/mlx4/device.h | 2 +- include/linux/pid.h | 1 + include/linux/rcupdate.h | 3 + include/linux/rcutree.h | 2 +- include/linux/tpm.h | 2 +- include/linux/types.h | 3 +- include/media/v4l2-subdev.h | 4 +- include/net/netfilter/nf_tables.h | 2 +- include/net/sch_generic.h | 15 ++ include/sound/pcm.h | 2 + include/trace/events/btrfs.h | 2 +- include/uapi/linux/types.h | 1 + kernel/cgroup/cgroup.c | 2 +- kernel/fork.c | 98 ++++++++-- kernel/padata.c | 3 +- kernel/params.c | 4 +- kernel/rcu/tree_plugin.h | 11 +- kernel/time/posix-timers.c | 1 + kernel/trace/trace.c | 5 +- lib/dynamic_queue_limits.c | 2 +- mm/memcontrol.c | 6 +- mm/page_alloc.c | 8 + net/bridge/br_nf_core.c | 7 +- net/bridge/br_private.h | 1 + net/can/bcm.c | 79 +++++--- net/can/gw.c | 167 +++++++++------- net/core/pktgen.c | 13 +- net/ipv4/fib_frontend.c | 18 +- net/ipv4/fib_rules.c | 4 +- net/ipv4/fib_trie.c | 22 --- net/ipv4/inet_hashtables.c | 37 ++-- net/ipv4/tcp_input.c | 56 +++--- net/ipv4/udp_offload.c | 61 +++++- net/ipv6/fib6_rules.c | 4 +- net/ipv6/ip6_output.c | 9 +- net/llc/af_llc.c | 8 +- net/netfilter/ipset/ip_set_hash_gen.h | 2 +- net/netfilter/nf_conntrack_standalone.c | 12 +- net/netfilter/nf_tables_api.c | 54 ++++-- net/netfilter/nft_immediate.c | 2 +- net/openvswitch/actions.c | 3 +- net/sched/act_mirred.c | 22 ++- net/sched/sch_codel.c | 2 +- net/sched/sch_drr.c | 9 +- net/sched/sch_ets.c | 9 +- net/sched/sch_fq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_fq_pie.c | 2 +- net/sched/sch_hfsc.c | 15 +- net/sched/sch_hhf.c | 2 +- net/sched/sch_pie.c | 2 +- net/sched/sch_qfq.c | 11 +- net/sunrpc/clnt.c | 3 - net/sunrpc/rpcb_clnt.c | 5 +- net/tipc/crypto.c | 5 + net/xfrm/xfrm_policy.c | 3 + net/xfrm/xfrm_state.c | 3 + samples/ftrace/sample-trace-array.c | 2 +- scripts/config | 26 ++- scripts/kconfig/merge_config.sh | 4 +- security/smack/smackfs.c | 4 + sound/core/oss/pcm_oss.c | 3 +- sound/core/pcm_native.c | 11 ++ sound/pci/es1968.c | 6 +- sound/pci/hda/patch_realtek.c | 42 +++++ sound/sh/Kconfig | 2 +- sound/soc/codecs/tas2764.c | 51 +++-- sound/soc/intel/boards/bytcr_rt5640.c | 13 ++ sound/soc/qcom/qdsp6/q6afe-clocks.c | 209 +++++++++++---------- sound/soc/qcom/qdsp6/q6afe.c | 2 +- sound/soc/qcom/qdsp6/q6afe.h | 2 +- sound/soc/soc-dai.c | 8 +- sound/soc/soc-ops.c | 29 ++- sound/usb/format.c | 3 +- tools/bpf/bpftool/common.c | 3 +- tools/build/Makefile.build | 6 +- tools/lib/bpf/libbpf.c | 2 +- tools/testing/selftests/vm/compaction_test.c | 19 +- 284 files changed, 2415 insertions(+), 1075 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/270 ALSA: usb-audio: Add second USB ID for Jabra Evolve 65 headset
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joachim Priesner <[email protected]>
commit 1149719442d28c96dc63cad432b5a6db7c300e1a upstream.
There seem to be multiple USB device IDs used for these; the one I have reports as 0b0e:030c when powered on. (When powered off, it reports as 0b0e:0311.)
--- sound/usb/format.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/usb/format.c +2 -1
@@ -251,7 +251,8 @@ static int parse_audio_format_rates_v1(s }/* Jabra Evolve 65 headset */ -if (chip->usb_id ==USB_ID (0x0b0e ,0x030b )) { +if (chip->usb_id ==USB_ID (0x0b0e ,0x030b ) || + chip->usb_id ==USB_ID (0x0b0e ,0x030c )) {/* only 48kHz for playback while keeping 16kHz for capture */ if (fp->nr_rates !=1 )return set_fixed_rate (fp,48000 ,SNDRV_PCM_RATE_48000 );
Greg Kroah-Hartman
maintainerPATCH 2/270 drm/nouveau: Fix WARN_ON in nouveau_fence_context_kill()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philipp Stanner <[email protected]>
commit bbe5679f30d7690a9b6838a583b9690ea73fe0e9 upstream.
Nouveau is mostly designed in a way that it's expected that fences only ever get signaled through nouveau_fence_signal(). However, in at least one other place, nouveau_fence_done(), can signal fences, too. If that happens (race) a signaled fence remains in the pending list for a while, until it gets removed by nouveau_fence_update().
Should nouveau_fence_context_kill() run in the meantime, this would be a bug because the function would attempt to set an error code on an already signaled fence.
Have nouveau_fence_context_kill() check for a fence being signaled.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
@@ -95,7 +95,7 @@ nouveau_fence_context_kill(struct nouveawhile (!list_empty (&fctx->pending)) { fence =list_entry (fctx->pending.next,typeof (*fence), head); -if (error) +if (error && !dma_fence_is_signaled_locked (&fence->base))dma_fence_set_error (&fence->base, error);if (nouveau_fence_signal (fence))
Greg Kroah-Hartman
maintainerPATCH 3/270 EDAC/altera: Test the correct error reg offset
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niravkumar L Rabara <[email protected]>
commit 4fb7b8fceb0beebbe00712c3daf49ade0386076a upstream.
Test correct structure member, ecc_cecnt_offset, before using it.
[ bp: Massage commit message. ]
--- drivers/edac/altera_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/altera_edac.c +1 -1
@@ -97,7 +97,7 @@ static irqreturn_t altr_sdram_mc_err_hanif (status & priv->ecc_stat_ce_mask) {regmap_read (drvdata->mc_vbase, priv->ecc_saddr_offset, &err_addr); -if (priv->ecc_uecnt_offset) +if (priv->ecc_cecnt_offset)regmap_read (drvdata->mc_vbase, priv->ecc_cecnt_offset, &err_count); edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, err_count,
Greg Kroah-Hartman
maintainerPATCH 4/270 EDAC/altera: Set DDR and SDMMC interrupt mask before registration
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niravkumar L Rabara <[email protected]>
commit 6dbe3c5418c4368e824bff6ae4889257dd544892 upstream.
Mask DDR and SDMMC in probe function to avoid spurious interrupts before registration. Removed invalid register write to system manager.
--- drivers/edac/altera_edac.c | 7 ++++--- drivers/edac/altera_edac.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/edac/altera_edac.c +4 -3
@@ -1006,9 +1006,6 @@ altr_init_a10_ecc_block(struct device_no } } -/* Interrupt mode set to every SBERR */ -regmap_write (ecc_mgr_map,ALTR_A10_ECC_INTMODE_OFST , -ALTR_A10_ECC_INTMODE );/* Enable ECC */ ecc_set_bits (ecc_ctrl_en_mask, (ecc_block_base +ALTR_A10_ECC_CTRL_OFST ));
@@ -2089,6 +2086,10 @@ static int altr_edac_a10_probe(struct plreturn PTR_ERR (edac->ecc_mgr_map); } +/* Set irq mask for DDR SBE to avoid any pending irq before registration */ +regmap_write (edac->ecc_mgr_map,A10_SYSMGR_ECC_INTMASK_SET_OFST , + (A10_SYSMGR_ECC_INTMASK_SDMMCB |A10_SYSMGR_ECC_INTMASK_DDR0 )); + edac->irq_chip.name = pdev->dev.of_node->name; edac->irq_chip.irq_mask = a10_eccmgr_irq_mask; edac->irq_chip.irq_unmask = a10_eccmgr_irq_unmask;
drivers/edac/altera_edac.h +2 -0
@@ -249,6 +249,8 @@ struct altr_sdram_mc_data {#define A10_SYSMGR_ECC_INTMASK_SET_OFST 0x94#define A10_SYSMGR_ECC_INTMASK_CLR_OFST 0x98#define A10_SYSMGR_ECC_INTMASK_OCRAM BIT(1) +#define A10_SYSMGR_ECC_INTMASK_SDMMCB BIT(16) +#define A10_SYSMGR_ECC_INTMASK_DDR0 BIT(17)#define A10_SYSMGR_ECC_INTSTAT_SERR_OFST 0x9C#define A10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0
Greg Kroah-Hartman
maintainerPATCH 5/270 i2c: imx-lpi2c: Fix clock count when probe defers
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clark Wang <[email protected]>
commit b1852c5de2f2a37dd4462f7837c9e3e678f9e546 upstream.
Deferred probe with pm_runtime_put() may delay clock disable, causing incorrect clock usage count. Use pm_runtime_put_sync() to ensure the clock is disabled immediately.
--- drivers/i2c/busses/i2c-imx-lpi2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-imx-lpi2c.c +2 -2
@@ -616,9 +616,9 @@ static int lpi2c_imx_probe(struct platforeturn 0 ; rpm_disable: -pm_runtime_put (&pdev->dev); -pm_runtime_disable (&pdev->dev);pm_runtime_dont_use_autosuspend (&pdev->dev); +pm_runtime_put_sync (&pdev->dev); +pm_runtime_disable (&pdev->dev);return ret; }
Greg Kroah-Hartman
maintainerPATCH 6/270 parisc: Fix double SIGFPE crash
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit de3629baf5a33af1919dec7136d643b0662e85ef upstream.
Camm noticed that on parisc a SIGFPE exception will crash an application with a second SIGFPE in the signal handler. Dave analyzed it, and it happens because glibc uses a double-word floating-point store to atomically update function descriptors. As a result of lazy binding, we hit a floating-point store in fpe_func almost immediately.
When the T bit is set, an assist exception trap occurs when when the co-processor encounters *any* floating-point instruction except for a double store of register %fr0. The latter cancels all pending traps. Let's fix this by clearing the Trap (T) bit in the FP status register before returning to the signal handler in userspace.
The issue can be reproduced with this test program:
root@parisc:~# cat fpe.c
static void fpe_func(int sig, siginfo_t *i, void *v) {
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGFPE);
sigprocmask(SIG_UNBLOCK, &set, NULL);
printf("GOT signal %d with si_code %ld\n", sig, i->si_code);
}int main() {
struct sigaction action = {
.sa_sigaction = fpe_func,
.sa_flags = SA_RESTART|SA_SIGINFO };
sigaction(SIGFPE, &action, 0);
feenableexcept(FE_OVERFLOW);
return printf("%lf\n",1.7976931348623158E308*1.7976931348623158E308);
}root@parisc:~# gcc fpe.c -lm root@parisc:~# ./a.out Floating point exception
root@parisc:~# strace -f ./a.out
execve("./a.out", ["./a.out"], 0xf9ac7034 /* 20 vars */) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
...
rt_sigaction(SIGFPE, {sa_handler=0x1110a, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
--- SIGFPE {si_signo=SIGFPE, si_code=FPE_FLTOVF, si_addr=0x1078f} ---
--- SIGFPE {si_signo=SIGFPE, si_code=FPE_FLTOVF, si_addr=0xf8f21237} ---
+++ killed by SIGFPE +++
Floating point exception--- arch/parisc/math-emu/driver.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
arch/parisc/math-emu/driver.c +13 -3
@@ -103,9 +103,19 @@ handle_fpe(struct pt_regs *regs)memcpy (regs->fr, frcopy,sizeof regs->fr);if (signalcode !=0 ) { -force_sig_fault (signalcode >>24 , signalcode &0xffffff , - (void __user *) regs->iaoq[0 ]); -return -1 ; +int sig = signalcode >>24 ; + +if (sig ==SIGFPE ) { +/* +* Clear floating point trap bit to avoid trapping +* again on the first floating-point instruction in +* the userspace signal handler. +*/ + regs->fr[0 ] &= ~(1ULL <<38 ); + } +force_sig_fault (sig, signalcode &0xffffff , + (void __user *) regs->iaoq[0 ]); +return -1 ; }return signalcode ?-1 :0 ;
Greg Kroah-Hartman
maintainerPATCH 7/270 amd-xgbe: Fix to ensure dependent features are toggled with RX checksum offload
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishal Badole <[email protected]>
commit f04dd30f1bef1ed2e74a4050af6e5e5e3869bac3 upstream.
According to the XGMAC specification, enabling features such as Layer 3 and Layer 4 Packet Filtering, Split Header and Virtualized Network support automatically selects the IPC Full Checksum Offload Engine on the receive side.
When RX checksum offload is disabled, these dependent features must also be disabled to prevent abnormal behavior caused by mismatched feature dependencies.
Ensure that toggling RX checksum offload (disabling or enabling) properly disables or enables all dependent features, maintaining consistent and expected behavior in the network device.
--- drivers/net/ethernet/amd/xgbe/xgbe-desc.c | 9 +++++++-- drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 24 ++++++++++++++++++++++-- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 11 +++++++++-- drivers/net/ethernet/amd/xgbe/xgbe.h | 4 ++++ 4 files changed, 42 insertions(+), 6 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-desc.c +7 -2
@@ -373,8 +373,13 @@ static int xgbe_map_rx_buffer(struct xgb }/* Set up the header page info */ -xgbe_set_buffer_data (&rdata->rx.hdr, &ring->rx_hdr_pa, -XGBE_SKB_ALLOC_SIZE ); +if (pdata->netdev->features &NETIF_F_RXCSUM ) { +xgbe_set_buffer_data (&rdata->rx.hdr, &ring->rx_hdr_pa, +XGBE_SKB_ALLOC_SIZE ); + }else { +xgbe_set_buffer_data (&rdata->rx.hdr, &ring->rx_hdr_pa, + pdata->rx_buf_size); + }/* Set up the buffer page info */ xgbe_set_buffer_data(&rdata->rx.buf, &ring->rx_buf_pa,
drivers/net/ethernet/amd/xgbe/xgbe-dev.c +22 -2
@@ -320,6 +320,18 @@ static void xgbe_config_sph_mode(structXGMAC_IOWRITE_BITS (pdata,MAC_RCR ,HDSMS ,XGBE_SPH_HDSMS_SIZE ); } +static void xgbe_disable_sph_mode (struct xgbe_prv_data *pdata) +{ +unsigned int i; + +for (i =0 ; i < pdata->channel_count; i++) { +if (!pdata->channel[i]->rx_ring) +break ; + +XGMAC_DMA_IOWRITE_BITS (pdata->channel[i],DMA_CH_CR ,SPH ,0 ); + } +} +static int xgbe_write_rss_reg (struct xgbe_prv_data *pdata,unsigned int type,unsigned int index,unsigned int val) {
@@ -3495,8 +3507,12 @@ static int xgbe_init(struct xgbe_prv_datxgbe_config_tx_coalesce (pdata);xgbe_config_rx_buffer_size (pdata);xgbe_config_tso_mode (pdata); -xgbe_config_sph_mode (pdata); -xgbe_config_rss (pdata); + +if (pdata->netdev->features &NETIF_F_RXCSUM ) { +xgbe_config_sph_mode (pdata); +xgbe_config_rss (pdata); + } + desc_if->wrapper_tx_desc_init (pdata); desc_if->wrapper_rx_desc_init (pdata);xgbe_enable_dma_interrupts (pdata);
@@ -3650,5 +3666,9 @@ void xgbe_init_function_ptrs_dev(struct hw_if->disable_vxlan = xgbe_disable_vxlan; hw_if->set_vxlan_id = xgbe_set_vxlan_id; +/* For Split Header*/ + hw_if->enable_sph = xgbe_config_sph_mode; + hw_if->disable_sph = xgbe_disable_sph_mode; +DBGPR ("<--xgbe_init_function_ptrs\n" ); }
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +9 -2
@@ -2264,10 +2264,17 @@ static int xgbe_set_features(struct net_if (ret)return ret; -if ((features &NETIF_F_RXCSUM ) && !rxcsum) +if ((features &NETIF_F_RXCSUM ) && !rxcsum) { + hw_if->enable_sph (pdata); + hw_if->enable_vxlan (pdata); hw_if->enable_rx_csum (pdata); -else if (!(features &NETIF_F_RXCSUM ) && rxcsum) +schedule_work (&pdata->restart_work); + }else if (!(features &NETIF_F_RXCSUM ) && rxcsum) { + hw_if->disable_sph (pdata); + hw_if->disable_vxlan (pdata); hw_if->disable_rx_csum (pdata); +schedule_work (&pdata->restart_work); + }if ((features &NETIF_F_HW_VLAN_CTAG_RX ) && !rxvlan) hw_if->enable_rx_vlan_stripping (pdata);
drivers/net/ethernet/amd/xgbe/xgbe.h +4 -0
@@ -833,6 +833,10 @@ struct xgbe_hw_if {void (*enable_vxlan)(struct xgbe_prv_data *);void (*disable_vxlan)(struct xgbe_prv_data *);void (*set_vxlan_id)(struct xgbe_prv_data *); + +/* For Split Header */ +void (*enable_sph)(struct xgbe_prv_data *pdata); +void (*disable_sph)(struct xgbe_prv_data *pdata); };/* This structure represents implementation specific routines for an
Greg Kroah-Hartman
maintainerPATCH 8/270 mmc: renesas_sdhi: Fix error handling in renesas_sdhi_probe
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruslan Piasetskyi <[email protected]>
commit 649b50a82f09fa44c2f7a65618e4584072145ab7 upstream.
After moving tmio_mmc_host_probe down, error handling has to be adjusted.
--- drivers/mmc/host/renesas_sdhi_core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +4 -6
@@ -1108,26 +1108,26 @@ int renesas_sdhi_probe(struct platform_d num_irqs =platform_irq_count (pdev);if (num_irqs <0 ) { ret = num_irqs; - goto eirq; + goto edisclk; }/* There must be at least one IRQ source */ if (!num_irqs) { ret = -ENXIO ; - goto eirq; + goto edisclk; }for (i =0 ; i < num_irqs; i++) { irq =platform_get_irq (pdev, i);if (irq <0 ) { ret = irq; - goto eirq; + goto edisclk; } ret =devm_request_irq (&pdev->dev, irq, tmio_mmc_irq,0 ,dev_name (&pdev->dev), host);if (ret) - goto eirq; + goto edisclk; } ret =tmio_mmc_host_probe (host);
@@ -1139,8 +1139,6 @@ int renesas_sdhi_probe(struct platform_dreturn ret; -eirq: -tmio_mmc_host_remove (host); edisclk:renesas_sdhi_clk_disable (host); efree:
Greg Kroah-Hartman
maintainerPATCH 9/270 wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
commit 8e089e7b585d95122c8122d732d1d5ef8f879396 upstream.
The function brcmf_usb_dl_writeimage() calls the function brcmf_usb_dl_cmd() but dose not check its return value. The 'state.state' and the 'state.bytes' are uninitialized if the function brcmf_usb_dl_cmd() fails. It is dangerous to use uninitialized variables in the conditions.
Add error handling for brcmf_usb_dl_cmd() to jump to error handling path if the brcmf_usb_dl_cmd() fails and the 'state.state' and the 'state.bytes' are uninitialized.
Improve the error message to report more detailed error information.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +4 -2
@@ -903,14 +903,16 @@ brcmf_usb_dl_writeimage(struct brcmf_usb }/* 1) Prepare USB boot loader for runtime image */ -brcmf_usb_dl_cmd (devinfo,DL_START , &state,sizeof (state)); + err =brcmf_usb_dl_cmd (devinfo,DL_START , &state,sizeof (state)); +if (err) + goto fail; rdlstate =le32_to_cpu (state.state); rdlbytes =le32_to_cpu (state.bytes);/* 2) Check we are in the Waiting state */ if (rdlstate !=DL_WAITING ) { -brcmf_err ("Failed to DL_START\n" ); +brcmf_err ("Invalid DL state: %u\n" , rdlstate); err = -EINVAL ; goto fail; }
Greg Kroah-Hartman
maintainerPATCH 10/270 dm-integrity: fix a warning on invalid table line
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 0a533c3e4246c29d502a7e0fba0e86d80a906b04 upstream.
If we use the 'B' mode and we have an invalit table line, cancel_delayed_work_sync would trigger a warning. This commit avoids the warning.
--- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-integrity.c +1 -1
@@ -4392,7 +4392,7 @@ static void dm_integrity_dtr(struct dm_tBUG_ON (!RB_EMPTY_ROOT (&ic->in_progress));BUG_ON (!list_empty (&ic->wait_list)); -if (ic->mode =='B' ) +if (ic->mode =='B' && ic->bitmap_flush_work.work.func)cancel_delayed_work_sync (&ic->bitmap_flush_work);if (ic->metadata_wq)destroy_workqueue (ic->metadata_wq);
Greg Kroah-Hartman
maintainerPATCH 11/270 dm: always update the array size in realloc_argv on success
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Marzinski <[email protected]>
commit 5a2a6c428190f945c5cbf5791f72dbea83e97f66 upstream.
realloc_argv() was only updating the array size if it was called with old_argv already allocated. The first time it was called to create an argv array, it would allocate the array but return the array size as zero. dm_split_args() would think that it couldn't store any arguments in the array and would call realloc_argv() again, causing it to reallocate the initial slots (this time using GPF_KERNEL) and finally return a size. Aside from being wasteful, this could cause deadlocks on targets that need to process messages without starting new IO. Instead, realloc_argv should always update the allocated array size on success.
--- drivers/md/dm-table.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/md/dm-table.c +3 -2
@@ -513,9 +513,10 @@ static char **realloc_argv(unsigned *siz gfp =GFP_NOIO ; } argv =kmalloc_array (new_size,sizeof (*argv), gfp); -if (argv && old_argv) { -memcpy (argv, old_argv, *size *sizeof (*argv)); +if (argv) { *size = new_size; +if (old_argv) +memcpy (argv, old_argv, *size *sizeof (*argv)); }kfree (old_argv);
Greg Kroah-Hartman
maintainerPATCH 12/270 iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Paklov <[email protected]>
commit 8dee308e4c01dea48fc104d37f92d5b58c50b96c upstream.
There is a string parsing logic error which can lead to an overflow of hid or uid buffers. Comparing ACPIID_LEN against a total string length doesn't take into account the lengths of individual hid and uid buffers so the check is insufficient in some cases. For example if the length of hid string is 4 and the length of the uid string is 260, the length of str will be equal to ACPIID_LEN + 1 but uid string will overflow uid buffer which size is 256.
The same applies to the hid string with length 13 and uid string with length 250.
Check the length of hid and uid strings separately to prevent buffer overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/iommu/amd/init.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/iommu/amd/init.c +8 -0
@@ -3243,6 +3243,14 @@ found:while (*uid =='0' && *(uid +1 )) uid++; +if (strlen (hid) >=ACPIHID_HID_LEN ) { +pr_err ("Invalid command line: hid is too long\n" ); +return 1 ; + }else if (strlen (uid) >=ACPIHID_UID_LEN ) { +pr_err ("Invalid command line: uid is too long\n" ); +return 1 ; + } + i = early_acpihid_map_size++;memcpy (early_acpihid_map[i].hid, hid,strlen (hid));memcpy (early_acpihid_map[i].uid, uid,strlen (uid));
Greg Kroah-Hartman
maintainerPATCH 13/270 iommu/vt-d: Apply quirk_iommu_igfx for 8086:0044 (QM57/QS57)
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingcong Bai <[email protected]>
commit 2c8a7c66c90832432496616a9a3c07293f1364f3 upstream.
On the Lenovo ThinkPad X201, when Intel VT-d is enabled in the BIOS, the kernel boots with errors related to DMAR, the graphical interface appeared quite choppy, and the system resets erratically within a minute after it booted:
DMAR: DRHD: handling fault status reg 3
DMAR: [DMA Write NO_PASID] Request device [00:02.0] fault addr 0xb97ff000 [fault reason 0x05] PTE Write access is not set
Upon comparing boot logs with VT-d on/off, I found that the Intel Calpella quirk (`quirk_calpella_no_shadow_gtt()') correctly applied the igfx IOMMU disable/quirk correctly:
pci 0000:00:00.0: DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics
Whereas with VT-d on, it went into the "else" branch, which then triggered the DMAR handling fault above:
... else if (!disable_igfx_iommu) {
/* we have to ensure the gfx device is idle before we flush */
pci_info(dev, "Disabling batched IOTLB flush on Ironlake\n");
iommu_set_dma_strict();
}Now, this is not exactly scientific, but moving 0x0044 to quirk_iommu_igfx seems to have fixed the aforementioned issue. Running a few `git blame' runs on the function, I have found that the quirk was originally introduced as a fix specific to ThinkPad X201:
commit 9eecabcb9a92 ("intel-iommu: Abort IOMMU setup for igfx if BIOS gave no shadow GTT space")
Which was later revised twice to the "else" branch we saw above:
- 2011: commit 6fbcfb3e467a ("intel-iommu: Workaround IOTLB hang on Ironlake GPU")
- 2024: commit ba00196ca41c ("iommu/vt-d: Decouple igfx_off from graphic identity mapping")
I'm uncertain whether further testings on this particular laptops were done in 2011 and (honestly I'm not sure) 2024, but I would be happy to do some distro-specific testing if that's what would be required to verify this patch.
P.S., I also see IDs 0x0040, 0x0062, and 0x006a listed under the same `quirk_calpella_no_shadow_gtt()' quirk, but I'm not sure how similar these chipsets are (if they share the same issue with VT-d or even, indeed, if this issue is specific to a bug in the Lenovo BIOS). With regards to 0x0062, it seems to be a Centrino wireless card, but not a chipset?
I have also listed a couple (distro and kernel) bug reports below as references (some of them are from 7-8 years ago!), as they seem to be similar issue found on different Westmere/Ironlake, Haswell, and Broadwell hardware setups.
--- drivers/iommu/intel/iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +3 -1
@@ -6234,6 +6234,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IDECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e40 , quirk_iommu_igfx);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2e90 , quirk_iommu_igfx); +/* QM57/QS57 integrated gfx malfunctions with dmar */ +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x0044 , quirk_iommu_igfx); +/* Broadwell igfx malfunctions with dmar */ DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x1606 , quirk_iommu_igfx);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x160B , quirk_iommu_igfx);
@@ -6311,7 +6314,6 @@ static void quirk_calpella_no_shadow_gtt } }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x0040 , quirk_calpella_no_shadow_gtt); -DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x0044 , quirk_calpella_no_shadow_gtt);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x0062 , quirk_calpella_no_shadow_gtt);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x006a , quirk_calpella_no_shadow_gtt);
Greg Kroah-Hartman
maintainerPATCH 14/270 tracing: Fix oob write in trace_seq_to_buffer()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
commit f5178c41bb43444a6008150fe6094497135d07cb upstream.
syzbot reported this bug:
==================================================================
BUG: KASAN: slab-out-of-bounds in trace_seq_to_buffer kernel/trace/trace.c:1830 [inline] BUG: KASAN: slab-out-of-bounds in tracing_splice_read_pipe+0x6be/0xdd0 kernel/trace/trace.c:6822 Write of size 4507 at addr ffff888032b6b000 by task syz.2.320/7260 CPU: 1 UID: 0 PID: 7260 Comm: syz.2.320 Not tainted 6.15.0-rc1-syzkaller-00301-g3bde70a2c827 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xe0/0x110 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x60 mm/kasan/shadow.c:106 trace_seq_to_buffer kernel/trace/trace.c:1830 [inline] tracing_splice_read_pipe+0x6be/0xdd0 kernel/trace/trace.c:6822 .... ==================================================================
It has been reported that trace_seq_to_buffer() tries to copy more data than PAGE_SIZE to buf. Therefore, to prevent this, we should use the smaller of trace_seq_used(&iter->seq) and PAGE_SIZE as an argument.
--- kernel/trace/trace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/trace/trace.c +3 -2
@@ -6685,13 +6685,14 @@ static ssize_t tracing_splice_read_pipe(/* Copy the data into the page, so we can start over. */ ret =trace_seq_to_buffer (&iter->seq,page_address (spd.pages[i]), -trace_seq_used (&iter->seq)); +min ((size_t )trace_seq_used (&iter->seq), +PAGE_SIZE ));if (ret <0 ) {__free_page (spd.pages[i]);break ; } spd.partial[i].offset =0 ; - spd.partial[i].len =trace_seq_used (&iter->seq); + spd.partial[i].len = ret;trace_seq_init (&iter->seq); }
Greg Kroah-Hartman
maintainerPATCH 15/270 net/sched: act_mirred: dont override retval if we already lost the skb
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
commit 166c2c8a6a4dc2e4ceba9e10cfe81c3e469e3210 upstream.
If we're redirecting the skb, and haven't called tcf_mirred_forward(), yet, we need to tell the core to drop the skb by setting the retcode to SHOT. If we have called tcf_mirred_forward(), however, the skb is out of our hands and returning SHOT will lead to UaF.
Move the retval override to the error path which actually need it.
--- net/sched/act_mirred.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
net/sched/act_mirred.c +13 -9
@@ -256,31 +256,31 @@ static int tcf_mirred_act(struct sk_buff m_mac_header_xmit =READ_ONCE (m->tcfm_mac_header_xmit); m_eaction =READ_ONCE (m->tcfm_eaction); + is_redirect =tcf_mirred_is_act_redirect (m_eaction); retval =READ_ONCE (m->tcf_action); dev =rcu_dereference_bh (m->tcfm_dev);if (unlikely (!dev)) {pr_notice_once ("tc mirred: target device is gone\n" ); - goto out; + goto err_cant_do; }if (unlikely (!(dev->flags &IFF_UP )) || !netif_carrier_ok (dev)) {net_notice_ratelimited ("tc mirred to Houston: device %s is down\n" , dev->name); - goto out; + goto err_cant_do; }/* we could easily avoid the clone only if called by ingress and clsact; * since we can't easily detect the clsact caller, skip clone only for * ingress - that covers the TC S/W datapath. */ - is_redirect =tcf_mirred_is_act_redirect (m_eaction); at_ingress =skb_at_tc_ingress (skb); use_reinsert = at_ingress && is_redirect &&tcf_mirred_can_reinsert (retval);if (!use_reinsert) { skb2 =skb_clone (skb,GFP_ATOMIC );if (!skb2) - goto out; + goto err_cant_do; } want_ingress =tcf_mirred_act_wants_ingress (m_eaction);
@@ -323,12 +323,16 @@ static int tcf_mirred_act(struct sk_buff } err =tcf_mirred_forward (want_ingress, skb2); -if (err) { -out: +if (err)tcf_action_inc_overlimit_qstats (&m->common); -if (tcf_mirred_is_act_redirect (m_eaction)) - retval =TC_ACT_SHOT ; - } +__this_cpu_dec (mirred_nest_level); + +return retval; + +err_cant_do: +if (is_redirect) + retval =TC_ACT_SHOT ; +tcf_action_inc_overlimit_qstats (&m->common);__this_cpu_dec (mirred_nest_level);return retval;
Greg Kroah-Hartman
maintainerPATCH 16/270 net/mlx5: E-Switch, Initialize MAC Address for Default GID
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maor Gottlieb <[email protected]>
[ Upstream commit 5d1a04f347e6cbf5ffe74da409a5d71fbe8c5f19 ]
Initialize the source MAC address when creating the default GID entry. Since this entry is used only for loopback traffic, it only needs to be a unicast address. A zeroed-out MAC address is sufficient for this purpose.
Without this fix, random bits would be assigned as the source address. If these bits formed a multicast address, the firmware would return an error, preventing the user from switching to switchdev mode:
Error: mlx5_core: Failed setting eswitch to offloads. kernel answers: Invalid argument
--- drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/rdma.c +1 -1
@@ -130,8 +130,8 @@ static void mlx5_rdma_make_default_gid(struct mlx5_core_dev *dev, union ib_gid *static int mlx5_rdma_add_roce_addr (struct mlx5_core_dev *dev) { +u8 mac[ETH_ALEN ] = {};union ib_gid gid; -u8 mac[ETH_ALEN ];mlx5_rdma_make_default_gid (dev, &gid); return mlx5_core_roce_gid_set(dev, 0,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/270 net/mlx5: Remove return statement exist at the end of void function
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenpeng Liang <[email protected]>
[ Upstream commit 9dee115bc1478b6a51f664defbc5b091985a3fd3 ]
void function return statements are not generally useful.
Stable-dep-of: 90538d23278a ("net/mlx5: E-switch, Fix error handling for enabling roce")
--- drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +0 -1
@@ -88,7 +88,6 @@ static void irq_set_name(char *name, int vecidx)snprintf (name,MLX5_MAX_IRQ_NAME ,"mlx5_comp%d" , vecidx -MLX5_IRQ_VEC_COMP_BASE ); -return ; }static int request_irqs (struct mlx5_core_dev *dev,int nvec)
drivers/net/ethernet/mellanox/mlx5/core/rdma.c +0 -1
@@ -183,5 +183,4 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev)mlx5_rdma_del_roce_addr (dev); disable_roce:mlx5_nic_vport_disable_roce (dev); -return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/270 net/mlx5: E-switch, Fix error handling for enabling roce
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Mi <[email protected]>
[ Upstream commit 90538d23278a981e344d364e923162fce752afeb ]
The cited commit assumes enabling roce always succeeds. But it is not true. Add error handling for it.
--- .../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 5 ++++- drivers/net/ethernet/mellanox/mlx5/core/rdma.c | 9 +++++---- drivers/net/ethernet/mellanox/mlx5/core/rdma.h | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +4 -1
@@ -2317,7 +2317,9 @@ int esw_offloads_enable(struct mlx5_eswitch *esw) esw->offloads.encap =DEVLINK_ESWITCH_ENCAP_MODE_NONE ;mutex_init (&esw->offloads.termtbl_mutex); -mlx5_rdma_enable_roce (esw->dev); + err =mlx5_rdma_enable_roce (esw->dev); +if (err) + goto err_roce; err =mlx5_esw_host_number_init (esw);if (err)
@@ -2366,6 +2368,7 @@ int esw_offloads_enable(struct mlx5_eswitch *esw) err_metadata: esw->flags &= ~MLX5_ESWITCH_VPORT_MATCH_METADATA ;mlx5_rdma_disable_roce (esw->dev); +err_roce:mutex_destroy (&esw->offloads.termtbl_mutex);return err; }
drivers/net/ethernet/mellanox/mlx5/core/rdma.c +5 -4
@@ -152,17 +152,17 @@ void mlx5_rdma_disable_roce(struct mlx5_core_dev *dev)mlx5_nic_vport_disable_roce (dev); } -void mlx5_rdma_enable_roce (struct mlx5_core_dev *dev) +int mlx5_rdma_enable_roce (struct mlx5_core_dev *dev) {int err;if (!MLX5_CAP_GEN (dev, roce)) -return ; +return 0 ; err =mlx5_nic_vport_enable_roce (dev);if (err) {mlx5_core_err (dev,"Failed to enable RoCE: %d\n" , err); -return ; +return err; } err =mlx5_rdma_add_roce_addr (dev);
@@ -177,10 +177,11 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev) goto del_roce_addr; } -return ; +return err; del_roce_addr:mlx5_rdma_del_roce_addr (dev); disable_roce:mlx5_nic_vport_disable_roce (dev); +return err; }
drivers/net/ethernet/mellanox/mlx5/core/rdma.h +2 -2
@@ -8,12 +8,12 @@#ifdef CONFIG_MLX5_ESWITCH -void mlx5_rdma_enable_roce (struct mlx5_core_dev *dev); +int mlx5_rdma_enable_roce (struct mlx5_core_dev *dev);void mlx5_rdma_disable_roce (struct mlx5_core_dev *dev);#else /* CONFIG_MLX5_ESWITCH */ -static inline void mlx5_rdma_enable_roce (struct mlx5_core_dev *dev) {} +static inline int mlx5_rdma_enable_roce (struct mlx5_core_dev *dev) {return 0 ; }static inline void mlx5_rdma_disable_roce (struct mlx5_core_dev *dev) {}#endif /* CONFIG_MLX5_ESWITCH */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/270 net_sched: drr: Fix double list add in class with netem as child qdisc
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Nogueira <[email protected]>
[ Upstream commit f99a3fbf023e20b626be4b0f042463d598050c9a ]
As described in Gerrard's report [1], there are use cases where a netem child qdisc will make the parent qdisc's enqueue callback reentrant. In the case of drr, there won't be a UAF, but the code will add the same classifier to the list twice, which will cause memory corruption.
In addition to checking for qlen being zero, this patch checks whether the class was already added to the active_list (cl_is_active) before adding to the list to cover for the reentrant case.
[1] https://lore.kernel.org/netdev/CAHcdcOm+03OD2j6R0=YHKqmy=VgJ8xEOKuP6c7mSgnp-TEJJbw@mail.gmail.com/
--- net/sched/sch_drr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/sched/sch_drr.c +6 -3
@@ -36,6 +36,11 @@ struct drr_sched {struct Qdisc_class_hash clhash; }; +static bool cl_is_active (struct drr_class *cl) +{ +return !list_empty (&cl->alist); +} +static struct drr_class *drr_find_class (struct Qdisc *sch,u32 classid) {struct drr_sched *q =qdisc_priv (sch);
@@ -344,7 +349,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch,struct drr_sched *q =qdisc_priv (sch);struct drr_class *cl;int err =0 ; -bool first; cl =drr_classify (skb, sch, &err);if (cl ==NULL ) {
@@ -354,7 +358,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch,return err; } - first = !cl->qdisc->q.qlen; err =qdisc_enqueue (skb, cl->qdisc, to_free);if (unlikely (err !=NET_XMIT_SUCCESS )) {if (net_xmit_drop_count (err)) {
@@ -364,7 +367,7 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch,return err; } -if (first) { +if (!cl_is_active (cl)) {list_add_tail (&cl->alist, &q->active); cl->deficit = cl->quantum; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/270 net_sched: hfsc: Fix a UAF vulnerability in class with netem as child qdisc
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Nogueira <[email protected]>
[ Upstream commit 141d34391abbb315d68556b7c67ad97885407547 ]
As described in Gerrard's report [1], we have a UAF case when an hfsc class has a netem child qdisc. The crux of the issue is that hfsc is assuming that checking for cl->qdisc->q.qlen == 0 guarantees that it hasn't inserted the class in the vttree or eltree (which is not true for the netem duplicate case).
This patch checks the n_active class variable to make sure that the code won't insert the class in the vttree or eltree twice, catering for the reentrant case.
[1] https://lore.kernel.org/netdev/CAHcdcOm+03OD2j6R0=YHKqmy=VgJ8xEOKuP6c7mSgnp-TEJJbw@mail.gmail.com/
--- net/sched/sch_hfsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_hfsc.c +1 -1
@@ -1571,7 +1571,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch, struct sk_buff **to_free)return err; } -if (first) { +if (first && !cl->cl_nactive) {if (cl->cl_flags &HFSC_RSC )init_ed (cl, len);if (cl->cl_flags &HFSC_FSC )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/270 net_sched: ets: Fix double list add in class with netem as child qdisc
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Nogueira <[email protected]>
[ Upstream commit 1a6d0c00fa07972384b0c308c72db091d49988b6 ]
As described in Gerrard's report [1], there are use cases where a netem child qdisc will make the parent qdisc's enqueue callback reentrant. In the case of ets, there won't be a UAF, but the code will add the same classifier to the list twice, which will cause memory corruption.
In addition to checking for qlen being zero, this patch checks whether the class was already added to the active_list (cl_is_active) before doing the addition to cater for the reentrant case.
[1] https://lore.kernel.org/netdev/CAHcdcOm+03OD2j6R0=YHKqmy=VgJ8xEOKuP6c7mSgnp-TEJJbw@mail.gmail.com/
--- net/sched/sch_ets.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/sched/sch_ets.c +6 -3
@@ -74,6 +74,11 @@ static const struct nla_policy ets_class_policy[TCA_ETS_MAX + 1] = { [TCA_ETS_QUANTA_BAND] = { .type = NLA_U32 }, }; +static bool cl_is_active (struct ets_class *cl) +{ +return !list_empty (&cl->alist); +} +static int ets_quantum_parse (struct Qdisc *sch,const struct nlattr *attr,unsigned int *quantum,struct netlink_ext_ack *extack)
@@ -424,7 +429,6 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,struct ets_sched *q =qdisc_priv (sch);struct ets_class *cl;int err =0 ; -bool first; cl =ets_classify (skb, sch, &err);if (!cl) {
@@ -434,7 +438,6 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,return err; } - first = !cl->qdisc->q.qlen; err =qdisc_enqueue (skb, cl->qdisc, to_free);if (unlikely (err !=NET_XMIT_SUCCESS )) {if (net_xmit_drop_count (err)) {
@@ -444,7 +447,7 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,return err; } -if (first && !ets_class_is_strict (q, cl)) { +if (!cl_is_active (cl) && !ets_class_is_strict (q, cl)) {list_add_tail (&cl->alist, &q->active); cl->deficit = cl->quantum; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/270 net_sched: qfq: Fix double list add in class with netem as child qdisc
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Nogueira <[email protected]>
[ Upstream commit f139f37dcdf34b67f5bf92bc8e0f7f6b3ac63aa4 ]
As described in Gerrard's report [1], there are use cases where a netem child qdisc will make the parent qdisc's enqueue callback reentrant. In the case of qfq, there won't be a UAF, but the code will add the same classifier to the list twice, which will cause memory corruption.
This patch checks whether the class was already added to the agg->active list (cl_is_active) before doing the addition to cater for the reentrant case.
[1] https://lore.kernel.org/netdev/CAHcdcOm+03OD2j6R0=YHKqmy=VgJ8xEOKuP6c7mSgnp-TEJJbw@mail.gmail.com/
--- net/sched/sch_qfq.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/sched/sch_qfq.c +7 -4
@@ -204,6 +204,11 @@ struct qfq_sched {*/ enum update_reason {enqueue, requeue}; +static bool cl_is_active (struct qfq_class *cl) +{ +return !list_empty (&cl->alist); +} +static struct qfq_class *qfq_find_class (struct Qdisc *sch,u32 classid) {struct qfq_sched *q =qdisc_priv (sch);
@@ -1222,7 +1227,6 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch,struct qfq_class *cl;struct qfq_aggregate *agg;int err =0 ; -bool first; cl =qfq_classify (skb, sch, &err);if (cl ==NULL ) {
@@ -1244,7 +1248,6 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch, } gso_segs =skb_is_gso (skb) ?skb_shinfo (skb)->gso_segs :1 ; - first = !cl->qdisc->q.qlen; err =qdisc_enqueue (skb, cl->qdisc, to_free);if (unlikely (err !=NET_XMIT_SUCCESS )) {pr_debug ("qfq_enqueue: enqueue failed %d\n" , err);
@@ -1261,8 +1264,8 @@ static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch, ++sch->q.qlen; agg = cl->agg; -/* if the queue was not empty, then done here */ -if (!first) { +/* if the class is active, then done here */ +if (cl_is_active (cl)) {if (unlikely (skb == cl->qdisc->ops->peek (cl->qdisc)) && list_first_entry(&agg->active, struct qfq_class, alist) == cl && cl->deficit < len)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/270 net: dlink: Correct endianness handling of led_mode
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Horman <[email protected]>
[ Upstream commit e7e5ae71831c44d58627a991e603845a2fed2cab ]
As it's name suggests, parse_eeprom() parses EEPROM data.
This is done by reading data, 16 bits at a time as follows:
for (i = 0; i < 128; i++)
((__le16 *) sromdata)[i] = cpu_to_le16(read_eeprom(np, i));sromdata is at the same memory location as psrom. And the type of psrom is a pointer to struct t_SROM.
As can be seen in the loop above, data is stored in sromdata, and thus psrom, as 16-bit little-endian values.
However, the integer fields of t_SROM are host byte order integers. And in the case of led_mode this leads to a little endian value being incorrectly treated as host byte order.
Looking at rio_set_led_mode, this does appear to be a bug as that code masks led_mode with 0x1, 0x2 and 0x8. Logic that would be effected by a reversed byte order.
This problem would only manifest on big endian hosts.
Found by inspection while investigating a sparse warning regarding the crc field of t_SROM.
I believe that warning is a false positive. And although I plan to send a follow-up to use little-endian types for other the integer fields of PSROM_t I do not believe that will involve any bug fixes.
Compile tested only.
--- drivers/net/ethernet/dlink/dl2k.c | 2 +- drivers/net/ethernet/dlink/dl2k.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/dlink/dl2k.c +1 -1
@@ -353,7 +353,7 @@ parse_eeprom (struct net_device *dev) dev->dev_addr[i] = psrom->mac_addr[i];if (np->chip_id ==CHIP_IP1000A ) { - np->led_mode = psrom->led_mode; + np->led_mode =le16_to_cpu (psrom->led_mode);return 0 ; }
drivers/net/ethernet/dlink/dl2k.h +1 -1
@@ -335,7 +335,7 @@ typedef struct t_SROM {u16 sub_system_id;/* 0x06 */ u16 pci_base_1;/* 0x08 (IP1000A only) */ u16 pci_base_2;/* 0x0a (IP1000A only) */ -u16 led_mode;/* 0x0c (IP1000A only) */ +__le16 led_mode;/* 0x0c (IP1000A only) */ u16 reserved1[9 ];/* 0x0e-0x1f */ u8 mac_addr[6 ];/* 0x20-0x25 */ u8 reserved2[10 ];/* 0x26-0x2f */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/270 net: ipv6: fix UDPv6 GSO segmentation with NAT
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <[email protected]>
[ Upstream commit b936a9b8d4a585ccb6d454921c36286bfe63e01d ]
If any address or port is changed, update it in all packets and recalculate checksum.
--- net/ipv4/udp_offload.c | 61 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-)
net/ipv4/udp_offload.c +60 -1
@@ -242,6 +242,62 @@ static struct sk_buff *__udpv4_gso_segment_list_csum(struct sk_buff *segs)return segs; } +static void __udpv6_gso_segment_csum (struct sk_buff *seg, +struct in6_addr *oldip, +const struct in6_addr *newip, +__be16 *oldport,__be16 newport) +{ +struct udphdr *uh =udp_hdr (seg); + +if (ipv6_addr_equal (oldip, newip) && *oldport == newport) +return ; + +if (uh->check) { +inet_proto_csum_replace16 (&uh->check, seg, oldip->s6_addr32, + newip->s6_addr32, true); + +inet_proto_csum_replace2 (&uh->check, seg, *oldport, newport, + false); +if (!uh->check) + uh->check =CSUM_MANGLED_0 ; + } + + *oldip = *newip; + *oldport = newport; +} + +static struct sk_buff *__udpv6_gso_segment_list_csum (struct sk_buff *segs) +{ +const struct ipv6hdr *iph; +const struct udphdr *uh; +struct ipv6hdr *iph2; +struct sk_buff *seg; +struct udphdr *uh2; + + seg = segs; + uh =udp_hdr (seg); + iph =ipv6_hdr (seg); + uh2 =udp_hdr (seg->next); + iph2 =ipv6_hdr (seg->next); + +if (!(*(const u32 *)&uh->source ^ *(const u32 *)&uh2->source) && +ipv6_addr_equal (&iph->saddr, &iph2->saddr) && +ipv6_addr_equal (&iph->daddr, &iph2->daddr)) +return segs; + +while ((seg = seg->next)) { + uh2 =udp_hdr (seg); + iph2 =ipv6_hdr (seg); + +__udpv6_gso_segment_csum (seg, &iph2->saddr, &iph->saddr, + &uh2->source, uh->source); +__udpv6_gso_segment_csum (seg, &iph2->daddr, &iph->daddr, + &uh2->dest, uh->dest); + } + +return segs; +} +static struct sk_buff *__udp_gso_segment_list (struct sk_buff *skb,netdev_features_t features,bool is_ipv6)
@@ -254,7 +310,10 @@ static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb,udp_hdr (skb)->len =htons (sizeof (struct udphdr ) + mss); -return is_ipv6 ? skb :__udpv4_gso_segment_list_csum (skb); +if (is_ipv6) +return __udpv6_gso_segment_list_csum (skb); +else +return __udpv4_gso_segment_list_csum (skb); } struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 25/270 bnxt_en: Fix ethtool -d byte order for 32-bit values
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Chan <[email protected]>
[ Upstream commit 02e8be5a032cae0f4ca33c6053c44d83cf4acc93 ]
For version 1 register dump that includes the PCIe stats, the existing code incorrectly assumes that all PCIe stats are 64-bit values. Fix it by using an array containing the starting and ending index of the 32-bit values. The loop in bnxt_get_regs() will use the array to do proper endian swap for the 32-bit values.
--- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +31 -5
@@ -1344,6 +1344,17 @@ static int bnxt_get_regs_len(struct net_device *dev)return reg_len; } +#define BNXT_PCIE_32B_ENTRY (start, end) \ + { offsetof(struct pcie_ctx_hw_stats, start), \ + offsetof(struct pcie_ctx_hw_stats, end) } + +static const struct { +u16 start; +u16 end; +} bnxt_pcie_32b_entries[] = { +BNXT_PCIE_32B_ENTRY (pcie_ltssm_histogram[0 ], pcie_ltssm_histogram[3 ]), +}; +static void bnxt_get_regs (struct net_device *dev,struct ethtool_regs *regs,void *_p) {
@@ -1372,12 +1383,27 @@ static void bnxt_get_regs(struct net_device *dev, struct ethtool_regs *regs,mutex_lock (&bp->hwrm_cmd_lock); rc =_hwrm_send_message (bp, &req,sizeof (req),HWRM_CMD_TIMEOUT );if (!rc) { -__le64 *src = (__le64 *)hw_pcie_stats; -u64 *dst = (u64 *)(_p +BNXT_PXP_REG_LEN ); -int i; +u8 *dst = (u8 *)(_p +BNXT_PXP_REG_LEN ); +u8 *src = (u8 *)hw_pcie_stats; +int i, j; + +for (i =0 , j =0 ; i <sizeof (*hw_pcie_stats); ) { +if (i >= bnxt_pcie_32b_entries[j].start && + i <= bnxt_pcie_32b_entries[j].end) { +u32 *dst32 = (u32 *)(dst + i); + + *dst32 =le32_to_cpu (*(__le32 *)(src + i)); + i +=4 ; +if (i > bnxt_pcie_32b_entries[j].end && + j <ARRAY_SIZE (bnxt_pcie_32b_entries) -1 ) + j++; + }else { +u64 *dst64 = (u64 *)(dst + i); -for (i =0 ; i <sizeof (*hw_pcie_stats) /sizeof (__le64); i++) - dst[i] =le64_to_cpu (src[i]); + *dst64 =le64_to_cpu (*(__le64 *)(src + i)); + i +=8 ; + } + } }mutex_unlock (&bp->hwrm_cmd_lock); dma_free_coherent(&bp->pdev->dev, sizeof(*hw_pcie_stats), hw_pcie_stats,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/270 nvme-tcp: fix premature queue removal and I/O failover
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Liang <[email protected]>
[ Upstream commit 77e40bbce93059658aee02786a32c5c98a240a8a ]
This patch addresses a data corruption issue observed in nvme-tcp during testing.
In an NVMe native multipath setup, when an I/O timeout occurs, all inflight I/Os are canceled almost immediately after the kernel socket is shut down. These canceled I/Os are reported as host path errors, triggering a failover that succeeds on a different path.
However, at this point, the original I/O may still be outstanding in the host's network transmission path (e.g., the NIC’s TX queue). From the user-space app's perspective, the buffer associated with the I/O is considered completed since they're acked on the different path and may be reused for new I/O requests.
Because nvme-tcp enables zero-copy by default in the transmission path, this can lead to corrupted data being sent to the original target, ultimately causing data corruption.
We can reproduce this data corruption by injecting delay on one path and triggering i/o timeout.
To prevent this issue, this change ensures that all inflight transmissions are fully completed from host's perspective before returning from queue stop. To handle concurrent I/O timeout from multiple namespaces under the same controller, always wait in queue stop regardless of queue's state.
This aligns with the behavior of queue stopping in other NVMe fabric transports.
--- drivers/nvme/host/tcp.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +29 -2
@@ -1573,7 +1573,7 @@ static void __nvme_tcp_stop_queue(struct nvme_tcp_queue *queue)cancel_work_sync (&queue->io_work); } -static void nvme_tcp_stop_queue (struct nvme_ctrl *nctrl,int qid) +static void nvme_tcp_stop_queue_nowait (struct nvme_ctrl *nctrl,int qid) {struct nvme_tcp_ctrl *ctrl =to_tcp_ctrl (nctrl);struct nvme_tcp_queue *queue = &ctrl->queues[qid];
@@ -1584,6 +1584,31 @@ static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)mutex_unlock (&queue->queue_lock); } +static void nvme_tcp_wait_queue (struct nvme_ctrl *nctrl,int qid) +{ +struct nvme_tcp_ctrl *ctrl =to_tcp_ctrl (nctrl); +struct nvme_tcp_queue *queue = &ctrl->queues[qid]; +int timeout =100 ; + +while (timeout >0 ) { +if (!test_bit (NVME_TCP_Q_ALLOCATED , &queue->flags) || + !sk_wmem_alloc_get (queue->sock->sk)) +return ; +msleep (2 ); + timeout -=2 ; + } +dev_warn (nctrl->device, +"qid %d: timeout draining sock wmem allocation expired\n" , + qid); +} + +static void nvme_tcp_stop_queue (struct nvme_ctrl *nctrl,int qid) +{ +nvme_tcp_stop_queue_nowait (nctrl, qid); +nvme_tcp_wait_queue (nctrl, qid); +} + +static void nvme_tcp_setup_sock_ops (struct nvme_tcp_queue *queue) {write_lock_bh (&queue->sock->sk->sk_callback_lock);
@@ -1691,7 +1716,9 @@ static void nvme_tcp_stop_io_queues(struct nvme_ctrl *ctrl)int i;for (i =1 ; i < ctrl->queue_count; i++) -nvme_tcp_stop_queue (ctrl, i); +nvme_tcp_stop_queue_nowait (ctrl, i); +for (i =1 ; i < ctrl->queue_count; i++) +nvme_tcp_wait_queue (ctrl, i); }static int nvme_tcp_start_io_queues (struct nvme_ctrl *ctrl)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/270 net: lan743x: Fix memleak issue when GSO enabled
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thangaraj Samynathan <[email protected]>
[ Upstream commit 2d52e2e38b85c8b7bc00dca55c2499f46f8c8198 ]
Always map the skb to the LS descriptor. Previously skb was mapped to EXT descriptor when the number of fragments is zero with GSO enabled. Mapping the skb to EXT descriptor prevents it from being freed, leading to a memory leak
--- drivers/net/ethernet/microchip/lan743x_main.c | 8 ++++++-- drivers/net/ethernet/microchip/lan743x_main.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +6 -2
@@ -1475,6 +1475,7 @@ static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,if (nr_frags <=0 ) { tx->frame_data0 |=TX_DESC_DATA0_LS_ ; tx->frame_data0 |=TX_DESC_DATA0_IOC_ ; + tx->frame_last = tx->frame_first; } tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail]; tx_descriptor->data0 =cpu_to_le32 (tx->frame_data0);
@@ -1544,6 +1545,7 @@ static int lan743x_tx_frame_add_fragment(struct lan743x_tx *tx, tx->frame_first =0 ; tx->frame_data0 =0 ; tx->frame_tail =0 ; + tx->frame_last =0 ;return -ENOMEM ; }
@@ -1584,16 +1586,18 @@ static void lan743x_tx_frame_end(struct lan743x_tx *tx, TX_DESC_DATA0_DTYPE_DATA_) { tx->frame_data0 |=TX_DESC_DATA0_LS_ ; tx->frame_data0 |=TX_DESC_DATA0_IOC_ ; + tx->frame_last = tx->frame_tail; } - tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail]; - buffer_info = &tx->buffer_info[tx->frame_tail]; + tx_descriptor = &tx->ring_cpu_ptr[tx->frame_last]; + buffer_info = &tx->buffer_info[tx->frame_last]; buffer_info->skb = skb;if (time_stamp) buffer_info->flags |=TX_BUFFER_INFO_FLAG_TIMESTAMP_REQUESTED ;if (ignore_sync) buffer_info->flags |=TX_BUFFER_INFO_FLAG_IGNORE_SYNC ; + tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail]; tx_descriptor->data0 =cpu_to_le32 (tx->frame_data0); tx->frame_tail =lan743x_tx_next_index (tx, tx->frame_tail); tx->last_tail = tx->frame_tail;
drivers/net/ethernet/microchip/lan743x_main.h +1 -0
@@ -657,6 +657,7 @@ struct lan743x_tx {u32 frame_first;u32 frame_data0;u32 frame_tail; +u32 frame_last;struct lan743x_tx_buffer_info *buffer_info;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/270 net: fec: ERR007885 Workaround for conventional TX
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mattias Barthel <[email protected]>
[ Upstream commit a179aad12badc43201cbf45d1e8ed2c1383c76b9 ]
Activate TX hang workaround also in fec_enet_txq_submit_skb() when TSO is not enabled.
Errata: ERR007885
Symptoms: NETDEV WATCHDOG: eth0 (fec): transmit queue 0 timed out
commit 37d6017b84f7 ("net: fec: Workaround for imx6sx enet tx hang when enable three queues") There is a TDAR race condition for mutliQ when the software sets TDAR
and the UDMA clears TDAR simultaneously or in a small window (2-4 cycles). This will cause the udma_tx and udma_tx_arbiter state machines to hang.
So, the Workaround is checking TDAR status four time, if TDAR cleared by
hardware and then write TDAR, otherwise don't set TDAR.
--- drivers/net/ethernet/freescale/fec_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/fec_main.c +6 -1
@@ -602,7 +602,12 @@ static int fec_enet_txq_submit_skb(struct fec_enet_priv_tx_q *txq, txq->bd.cur = bdp;/* Trigger transmission start */ -writel (0 , txq->bd.reg_desc_active); +if (!(fep->quirks &FEC_QUIRK_ERR007885 ) || + !readl (txq->bd.reg_desc_active) || + !readl (txq->bd.reg_desc_active) || + !readl (txq->bd.reg_desc_active) || + !readl (txq->bd.reg_desc_active)) +writel (0 , txq->bd.reg_desc_active);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/270 PCI: imx6: Skip controller_id generation logic for i.MX7D
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Zhu <[email protected]>
commit f068ffdd034c93f0c768acdc87d4d2d7023c1379 upstream.
The i.MX7D only has one PCIe controller, so controller_id should always be
0. The previous code is incorrect although yielding the correct result.
Fix by removing "IMX7D" from the switch case branch.
[Because this switch case does more than just controller_id
logic, move the "IMX7D" case label instead of removing it entirely.]
--- drivers/pci/controller/dwc/pci-imx6.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +2 -3
@@ -1092,11 +1092,10 @@ static int imx6_pcie_probe(struct platfoif (IS_ERR (imx6_pcie->pcie_aux))return dev_err_probe (dev,PTR_ERR (imx6_pcie->pcie_aux),"pcie_aux clock source missing or invalid\n" ); - fallthrough; -case IMX7D :if (dbi_base->start ==IMX8MQ_PCIE2_BASE_ADDR ) imx6_pcie->controller_id =1 ; - + fallthrough; +case IMX7D : imx6_pcie->pciephy_reset =devm_reset_control_get_exclusive (dev,"pciephy" );if (IS_ERR (imx6_pcie->pciephy_reset)) {
Greg Kroah-Hartman
maintainerPATCH 30/270 of: module: add buffer overflow check in of_modalias()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Shtylyov <[email protected]>
commit cf7385cb26ac4f0ee6c7385960525ad534323252 upstream.
In of_modalias(), if the buffer happens to be too small even for the 1st snprintf() call, the len parameter will become negative and str parameter (if not NULL initially) will point beyond the buffer's end. Add the buffer overflow check after the 1st snprintf() call and fix such check after the strlen() call (accounting for the terminating NUL char).
--- drivers/of/device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/of/device.c +4 -3
@@ -231,14 +231,15 @@ static ssize_t of_device_get_modalias(st csize =snprintf (str, len,"of:N%pOFn%c%s" , dev->of_node,'T' ,of_node_get_device_type (dev->of_node)); tsize = csize; +if (csize >= len) + csize = len >0 ? len -1 :0 ; len -= csize; -if (str) - str += csize; + str += csize;of_property_for_each_string (dev->of_node,"compatible" , p, compat) { csize =strlen (compat) +1 ; tsize += csize; -if (csize > len) +if (csize >= len)continue ; csize =snprintf (str, len,"C%s" , compat);
Greg Kroah-Hartman
maintainerPATCH 31/270 net: phy: microchip: implement generic .handle_interrupt() callback
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ioana Ciornei <[email protected]>
[ Upstream commit e01a3feb8f69ab620b0016498603cad364f65224 ]
In an attempt to actually support shared IRQs in phylib, we now move the responsibility of triggering the phylib state machine or just returning IRQ_NONE, based on the IRQ status register, to the PHY driver. Having 3 different IRQ handling callbacks (.handle_interrupt(), .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY driver implement directly an IRQ handler like any other device driver. Make this driver follow the new convention.
Stable-dep-of: 30a41ed32d30 ("net: phy: microchip: force IRQ polling mode for lan88xx")
--- drivers/net/phy/microchip.c | 19 +++++++++++++++++++ drivers/net/phy/microchip_t1.c | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+)
drivers/net/phy/microchip.c +19 -0
@@ -56,6 +56,24 @@ static int lan88xx_phy_ack_interrupt(struct phy_device *phydev)return rc <0 ? rc :0 ; } +static irqreturn_t lan88xx_handle_interrupt (struct phy_device *phydev) +{ +int irq_status; + + irq_status =phy_read (phydev,LAN88XX_INT_STS ); +if (irq_status <0 ) { +phy_error (phydev); +return IRQ_NONE ; + } + +if (!(irq_status &LAN88XX_INT_STS_LINK_CHANGE_ )) +return IRQ_NONE ; + +phy_trigger_machine (phydev); + +return IRQ_HANDLED ; +} +static int lan88xx_suspend (struct phy_device *phydev) {struct lan88xx_priv *priv = phydev->priv;
@@ -374,6 +392,7 @@ static struct phy_driver microchip_phy_driver[] = { .ack_interrupt = lan88xx_phy_ack_interrupt, .config_intr = lan88xx_phy_config_intr, + .handle_interrupt = lan88xx_handle_interrupt, .suspend = lan88xx_suspend, .resume = genphy_resume,
drivers/net/phy/microchip_t1.c +19 -0
@@ -203,6 +203,24 @@ static int lan87xx_phy_ack_interrupt(struct phy_device *phydev)return rc <0 ? rc :0 ; } +static irqreturn_t lan87xx_handle_interrupt (struct phy_device *phydev) +{ +int irq_status; + + irq_status =phy_read (phydev,LAN87XX_INTERRUPT_SOURCE ); +if (irq_status <0 ) { +phy_error (phydev); +return IRQ_NONE ; + } + +if (irq_status ==0 ) +return IRQ_NONE ; + +phy_trigger_machine (phydev); + +return IRQ_HANDLED ; +} +static int lan87xx_config_init (struct phy_device *phydev) {int rc =lan87xx_phy_init (phydev);
@@ -223,6 +241,7 @@ static struct phy_driver microchip_t1_phy_driver[] = { .ack_interrupt = lan87xx_phy_ack_interrupt, .config_intr = lan87xx_phy_config_intr, + .handle_interrupt = lan87xx_handle_interrupt, .suspend = genphy_suspend, .resume = genphy_resume,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/270 net: phy: microchip: remove the use of .ack_interrupt()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ioana Ciornei <[email protected]>
[ Upstream commit cf499391982d877e9313d2adeedcf5f1ffe05d6e ]
In preparation of removing the .ack_interrupt() callback, we must replace its occurrences (aka phy_clear_interrupt), from the 2 places where it is called from (phy_enable_interrupts and phy_disable_interrupts), with equivalent functionality.
This means that clearing interrupts now becomes something that the PHY driver is responsible of doing, before enabling interrupts and after clearing them. Make this driver follow the new contract.
Stable-dep-of: 30a41ed32d30 ("net: phy: microchip: force IRQ polling mode for lan88xx")
--- drivers/net/phy/microchip.c | 13 +++++-------- drivers/net/phy/microchip_t1.c | 17 +++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-)
drivers/net/phy/microchip.c +5 -8
@@ -44,14 +44,12 @@ static int lan88xx_phy_config_intr(struct phy_device *phydev) LAN88XX_INT_MASK_LINK_CHANGE_); }else { rc =phy_write (phydev,LAN88XX_INT_MASK ,0 ); - } - -return rc <0 ? rc :0 ; -} +if (rc) +return rc; -static int lan88xx_phy_ack_interrupt (struct phy_device *phydev) -{ -int rc =phy_read (phydev,LAN88XX_INT_STS ); +/* Ack interrupts after they have been disabled */ + rc =phy_read (phydev,LAN88XX_INT_STS ); + }return rc <0 ? rc :0 ; }
@@ -390,7 +388,6 @@ static struct phy_driver microchip_phy_driver[] = { .config_aneg = lan88xx_config_aneg, .link_change_notify = lan88xx_link_change_notify, - .ack_interrupt = lan88xx_phy_ack_interrupt, .config_intr = lan88xx_phy_config_intr, .handle_interrupt = lan88xx_handle_interrupt,
drivers/net/phy/microchip_t1.c +7 -10
@@ -189,16 +189,14 @@ static int lan87xx_phy_config_intr(struct phy_device *phydev) rc =phy_write (phydev,LAN87XX_INTERRUPT_MASK ,0x7FFF ); rc =phy_read (phydev,LAN87XX_INTERRUPT_SOURCE ); val =LAN87XX_MASK_LINK_UP |LAN87XX_MASK_LINK_DOWN ; - } - - rc =phy_write (phydev,LAN87XX_INTERRUPT_MASK , val); - -return rc <0 ? rc :0 ; -} + rc =phy_write (phydev,LAN87XX_INTERRUPT_MASK , val); + }else { + rc =phy_write (phydev,LAN87XX_INTERRUPT_MASK , val); +if (rc) +return rc; -static int lan87xx_phy_ack_interrupt (struct phy_device *phydev) -{ -int rc =phy_read (phydev,LAN87XX_INTERRUPT_SOURCE ); + rc =phy_read (phydev,LAN87XX_INTERRUPT_SOURCE ); + }return rc <0 ? rc :0 ; }
@@ -239,7 +237,6 @@ static struct phy_driver microchip_t1_phy_driver[] = { .config_init = lan87xx_config_init, .config_aneg = genphy_config_aneg, - .ack_interrupt = lan87xx_phy_ack_interrupt, .config_intr = lan87xx_phy_config_intr, .handle_interrupt = lan87xx_handle_interrupt,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/270 net: phy: microchip: force IRQ polling mode for lan88xx
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fiona Klute <[email protected]>
[ Upstream commit 30a41ed32d3088cd0d682a13d7f30b23baed7e93 ]
With lan88xx based devices the lan78xx driver can get stuck in an interrupt loop while bringing the device up, flooding the kernel log with messages like the following:
lan78xx 2-3:1.0 enp1s0u3: kevent 4 may have been dropped
Removing interrupt support from the lan88xx PHY driver forces the driver to use polling instead, which avoids the problem.
The issue has been observed with Raspberry Pi devices at least since 4.14 (see [1], bug report for their downstream kernel), as well as with Nvidia devices [2] in 2020, where disabling interrupts was the vendor-suggested workaround (together with the claim that phylib changes in 4.9 made the interrupt handling in lan78xx incompatible).
Iperf reports well over 900Mbits/sec per direction with client in --dualtest mode, so there does not seem to be a significant impact on throughput (lan88xx device connected via switch to the peer).
[1] https://github.com/raspberrypi/linux/issues/2447
[2] https://forums.developer.nvidia.com/t/jetson-xavier-and-lan7800-problem/142134/11
--- drivers/net/phy/microchip.c | 46 +++---------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-)
drivers/net/phy/microchip.c +3 -43
@@ -31,47 +31,6 @@ static int lan88xx_write_page(struct phy_device *phydev, int page)return __phy_write (phydev,LAN88XX_EXT_PAGE_ACCESS , page); } -static int lan88xx_phy_config_intr (struct phy_device *phydev) -{ -int rc; - -if (phydev->interrupts ==PHY_INTERRUPT_ENABLED ) { -/* unmask all source and clear them before enable */ - rc =phy_write (phydev,LAN88XX_INT_MASK ,0x7FFF ); - rc =phy_read (phydev,LAN88XX_INT_STS ); - rc =phy_write (phydev,LAN88XX_INT_MASK , -LAN88XX_INT_MASK_MDINTPIN_EN_ | -LAN88XX_INT_MASK_LINK_CHANGE_ ); - }else { - rc =phy_write (phydev,LAN88XX_INT_MASK ,0 ); -if (rc) -return rc; - -/* Ack interrupts after they have been disabled */ - rc =phy_read (phydev,LAN88XX_INT_STS ); - } - -return rc <0 ? rc :0 ; -} - -static irqreturn_t lan88xx_handle_interrupt (struct phy_device *phydev) -{ -int irq_status; - - irq_status =phy_read (phydev,LAN88XX_INT_STS ); -if (irq_status <0 ) { -phy_error (phydev); -return IRQ_NONE ; - } - -if (!(irq_status &LAN88XX_INT_STS_LINK_CHANGE_ )) -return IRQ_NONE ; - -phy_trigger_machine (phydev); - -return IRQ_HANDLED ; -} -static int lan88xx_suspend (struct phy_device *phydev) {struct lan88xx_priv *priv = phydev->priv;
@@ -388,8 +347,9 @@ static struct phy_driver microchip_phy_driver[] = { .config_aneg = lan88xx_config_aneg, .link_change_notify = lan88xx_link_change_notify, - .config_intr = lan88xx_phy_config_intr, - .handle_interrupt = lan88xx_handle_interrupt, +/* Interrupt handling is broken, do not define related +* functions to force polling. +*/ .suspend = lan88xx_suspend, .resume = genphy_resume,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/270 Revert "drm/meson: vclk: fix calculation of 59.94 fractional rates"
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Hewitt <[email protected]>
[ Upstream commit f37bb5486ea536c1d61df89feeaeff3f84f0b560 ]
This reverts commit bfbc68e.
The patch does permit the offending YUV420 @ 59.94 phy_freq and vclk_freq mode to match in calculations. It also results in all fractional rates being unavailable for use. This was unintended and requires the patch to be reverted.
--- drivers/gpu/drm/meson/meson_vclk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +3 -3
@@ -790,13 +790,13 @@ meson_vclk_vic_supported_freq(struct meson_drm *priv, unsigned int phy_freq, FREQ_1000_1001(params[i].pixel_freq));DRM_DEBUG_DRIVER ("i = %d phy_freq = %d alt = %d\n" , i, params[i].phy_freq, -FREQ_1000_1001 (params[i].phy_freq/1000 )*1000 ); +FREQ_1000_1001 (params[i].phy_freq/10 )*10 );/* Match strict frequency */ if (phy_freq == params[i].phy_freq && vclk_freq == params[i].vclk_freq)return MODE_OK ;/* Match 1000/1001 variant */ -if (phy_freq == (FREQ_1000_1001 (params[i].phy_freq/1000 )*1000 ) && +if (phy_freq == (FREQ_1000_1001 (params[i].phy_freq/10 )*10 ) && vclk_freq ==FREQ_1000_1001 (params[i].vclk_freq))return MODE_OK ; }
@@ -1070,7 +1070,7 @@ void meson_vclk_setup(struct meson_drm *priv, unsigned int target,for (freq =0 ; params[freq].pixel_freq ; ++freq) {if ((phy_freq == params[freq].phy_freq || - phy_freq ==FREQ_1000_1001 (params[freq].phy_freq/1000 )*1000 ) && + phy_freq ==FREQ_1000_1001 (params[freq].phy_freq/10 )*10 ) && (vclk_freq == params[freq].vclk_freq || vclk_freq ==FREQ_1000_1001 (params[freq].vclk_freq))) {if (vclk_freq != params[freq].vclk_freq)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/270 irqchip/gic-v2m: Add const to of_device_id
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang wangx <[email protected]>
[ Upstream commit c10f2f8b5d8027c1ea77f777f2d16cb9043a6c09 ]
struct of_device_id should normally be const.
Stable-dep-of: 3318dc299b07 ("irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode()")
--- drivers/irqchip/irq-gic-v2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v2m.c +1 -1
@@ -408,7 +408,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,return ret; } -static struct of_device_id gicv2m_device_id[] = { +static const struct of_device_id gicv2m_device_id[] = { { .compatible ="arm,gic-v2m-frame" , }, {}, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/270 irqchip/gic-v2m: Mark a few functions __init
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit d51a15af37ce8cf59e73de51dcdce3c9f4944974 ]
They are all part of the init sequence.
Stable-dep-of: 3318dc299b07 ("irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode()")
--- drivers/irqchip/irq-gic-v2m.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/irqchip/irq-gic-v2m.c +5 -5
@@ -263,7 +263,7 @@ static struct msi_domain_info gicv2m_pmsi_domain_info = { .chip = &gicv2m_pmsi_irq_chip, }; -static void gicv2m_teardown (void ) +static void __init gicv2m_teardown (void ) {struct v2m_data *v2m, *tmp;
@@ -278,7 +278,7 @@ static void gicv2m_teardown(void) } } -static int gicv2m_allocate_domains (struct irq_domain *parent) +static __init int gicv2m_allocate_domains (struct irq_domain *parent) {struct irq_domain *inner_domain, *pci_domain, *plat_domain;struct v2m_data *v2m;
@@ -408,7 +408,7 @@ static int __init gicv2m_init_one(struct fwnode_handle *fwnode,return ret; } -static const struct of_device_id gicv2m_device_id[] = { +static __initconst struct of_device_id gicv2m_device_id[] = { { .compatible ="arm,gic-v2m-frame" , }, {}, };
@@ -458,7 +458,7 @@ static int __init gicv2m_of_init(struct fwnode_handle *parent_handle,#ifdef CONFIG_ACPI static int acpi_num_msi; -static struct fwnode_handle *gicv2m_get_fwnode (struct device *dev) +static __init struct fwnode_handle *gicv2m_get_fwnode (struct device *dev) {struct v2m_data *data;
@@ -473,7 +473,7 @@ static struct fwnode_handle *gicv2m_get_fwnode(struct device *dev)return data->fwnode; } -static bool acpi_check_amazon_graviton_quirks (void ) +static __init bool acpi_check_amazon_graviton_quirks (void ) {static struct acpi_table_madt *madt;acpi_status status;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/270 irqchip/gic-v2m: Prevent use after free of gicv2m_get_fwnode()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suzuki K Poulose <[email protected]>
[ Upstream commit 3318dc299b072a0511d6dfd8367f3304fb6d9827 ]
With ACPI in place, gicv2m_get_fwnode() is registered with the pci subsystem as pci_msi_get_fwnode_cb(), which may get invoked at runtime during a PCI host bridge probe. But, the call back is wrongly marked as __init, causing it to be freed, while being registered with the PCI subsystem and could trigger:
Unable to handle kernel paging request at virtual address ffff8000816c0400 gicv2m_get_fwnode+0x0/0x58 (P) pci_set_bus_msi_domain+0x74/0x88 pci_register_host_bridge+0x194/0x548
This is easily reproducible on a Juno board with ACPI boot.
Retain the function for later use.
--- drivers/irqchip/irq-gic-v2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v2m.c +1 -1
@@ -458,7 +458,7 @@ static int __init gicv2m_of_init(struct fwnode_handle *parent_handle,#ifdef CONFIG_ACPI static int acpi_num_msi; -static __init struct fwnode_handle *gicv2m_get_fwnode (struct device *dev) +static struct fwnode_handle *gicv2m_get_fwnode (struct device *dev) {struct v2m_data *data;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/270 usb: chipidea: ci_hdrc_imx: use dev_err_probe()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit 18171cfc3c236a1587dcad9adc27c6e781af4438 ]
Use dev_err_probe() to simplify handling errors in ci_hdrc_imx_probe()
Stable-dep-of: 8c531e0a8c2d ("usb: chipidea: ci_hdrc_imx: implement usb_phy_init() error handling")
--- drivers/usb/chipidea/ci_hdrc_imx.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-)
drivers/usb/chipidea/ci_hdrc_imx.c +7 -16
@@ -360,25 +360,18 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) data->pinctrl =devm_pinctrl_get (dev);if (PTR_ERR (data->pinctrl) == -ENODEV ) data->pinctrl =NULL ; -else if (IS_ERR (data->pinctrl)) { -if (PTR_ERR (data->pinctrl) != -EPROBE_DEFER ) -dev_err (dev,"pinctrl get failed, err=%ld\n" , -PTR_ERR (data->pinctrl)); -return PTR_ERR (data->pinctrl); - } +else if (IS_ERR (data->pinctrl)) +return dev_err_probe (dev,PTR_ERR (data->pinctrl), +"pinctrl get failed\n" ); data->hsic_pad_regulator =devm_regulator_get_optional (dev,"hsic" );if (PTR_ERR (data->hsic_pad_regulator) == -ENODEV ) {/* no pad regualator is needed */ data->hsic_pad_regulator =NULL ; - }else if (IS_ERR (data->hsic_pad_regulator)) { -if (PTR_ERR (data->hsic_pad_regulator) != -EPROBE_DEFER ) -dev_err (dev, -"Get HSIC pad regulator error: %ld\n" , -PTR_ERR (data->hsic_pad_regulator)); -return PTR_ERR (data->hsic_pad_regulator); - } + }else if (IS_ERR (data->hsic_pad_regulator)) +return dev_err_probe (dev,PTR_ERR (data->hsic_pad_regulator), +"Get HSIC pad regulator error\n" );if (data->hsic_pad_regulator) { ret =regulator_enable (data->hsic_pad_regulator);
@@ -470,9 +463,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) &pdata);if (IS_ERR (data->ci_pdev)) { ret =PTR_ERR (data->ci_pdev); -if (ret != -EPROBE_DEFER ) -dev_err (dev,"ci_hdrc_add_device failed, err=%d\n" , - ret); +dev_err_probe (dev, ret,"ci_hdrc_add_device failed\n" ); goto err_clk; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/270 usb: chipidea: ci_hdrc_imx: implement usb_phy_init() error handling
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
[ Upstream commit 8c531e0a8c2d82509ad97c6d3a1e6217c7ed136d ]
usb_phy_init() may return an error code if e.g. its implementation fails to prepare/enable some clocks. And properly rollback on probe error path by calling the counterpart usb_phy_shutdown().
Found by Linux Verification Center (linuxtesting.org).
--- drivers/usb/chipidea/ci_hdrc_imx.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/usb/chipidea/ci_hdrc_imx.c +10 -3
@@ -446,7 +446,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) of_usb_get_phy_mode(np) == USBPHY_INTERFACE_MODE_ULPI) { pdata.flags |=CI_HDRC_OVERRIDE_PHY_CONTROL ; data->override_phy_control = true; -usb_phy_init (pdata.usb_phy); + ret =usb_phy_init (pdata.usb_phy); +if (ret) { +dev_err (dev,"Failed to init phy\n" ); + goto err_clk; + } }if (pdata.flags &CI_HDRC_SUPPORTS_RUNTIME_PM )
@@ -455,7 +459,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) ret =imx_usbmisc_init (data->usbmisc_data);if (ret) {dev_err (dev,"usbmisc init failed, ret=%d\n" , ret); - goto err_clk; + goto phy_shutdown; } data->ci_pdev = ci_hdrc_add_device(dev,
@@ -464,7 +468,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)if (IS_ERR (data->ci_pdev)) { ret =PTR_ERR (data->ci_pdev);dev_err_probe (dev, ret,"ci_hdrc_add_device failed\n" ); - goto err_clk; + goto phy_shutdown; }if (data->usbmisc_data) {
@@ -498,6 +502,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) disable_device:ci_hdrc_remove_device (data->ci_pdev); +phy_shutdown: +if (data->override_phy_control) +usb_phy_shutdown (data->phy); err_clk:imx_disable_unprepare_clks (dev); disable_hsic_regulator:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/270 dm: fix copying after src array boundaries
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tudor Ambarus <[email protected]>
commit f1aff4bc199cb92c055668caed65505e3b4d2656 upstream.
The blammed commit copied to argv the size of the reallocated argv, instead of the size of the old_argv, thus reading and copying from past the old_argv allocated memory.
Following BUG_ON was hit:
[ 3.038929][ T1] kernel BUG at lib/string_helpers.c:1040! [ 3.039147][ T1] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP ... [ 3.056489][ T1] Call trace: [ 3.056591][ T1] __fortify_panic+0x10/0x18 (P) [ 3.056773][ T1] dm_split_args+0x20c/0x210 [ 3.056942][ T1] dm_table_add_target+0x13c/0x360 [ 3.057132][ T1] table_load+0x110/0x3ac [ 3.057292][ T1] dm_ctl_ioctl+0x424/0x56c [ 3.057457][ T1] __arm64_sys_ioctl+0xa8/0xec [ 3.057634][ T1] invoke_syscall+0x58/0x10c [ 3.057804][ T1] el0_svc_common+0xa8/0xdc [ 3.057970][ T1] do_el0_svc+0x1c/0x28 [ 3.058123][ T1] el0_svc+0x50/0xac [ 3.058266][ T1] el0t_64_sync_handler+0x60/0xc4 [ 3.058452][ T1] el0t_64_sync+0x1b0/0x1b4 [ 3.058620][ T1] Code: f800865e a9bf7bfd 910003fd 941f48aa (d4210000) [ 3.058897][ T1] ---[ end trace 0000000000000000 ]--- [ 3.059083][ T1] Kernel panic - not syncing: Oops - BUG: Fatal exception
Fix it by copying the size of src, and not the size of dst, as it was.
--- drivers/md/dm-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-table.c +1 -1
@@ -514,9 +514,9 @@ static char **realloc_argv(unsigned *siz } argv =kmalloc_array (new_size,sizeof (*argv), gfp);if (argv) { - *size = new_size;if (old_argv)memcpy (argv, old_argv, *size *sizeof (*argv)); + *size = new_size; }kfree (old_argv);
Greg Kroah-Hartman
maintainerPATCH 41/270 scsi: target: Fix WRITE_SAME No Data Buffer crash
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Christie <[email protected]>
commit ccd3f449052449a917a3e577d8ba0368f43b8f29 upstream.
In newer version of the SBC specs, we have a NDOB bit that indicates there is no data buffer that gets written out. If this bit is set using commands like "sg_write_same --ndob" we will crash in target_core_iblock/file's execute_write_same handlers when we go to access the se_cmd->t_data_sg because its NULL.
This patch adds a check for the NDOB bit in the common WRITE SAME code because we don't support it. And, it adds a check for zero SG elements in each handler in case the initiator tries to send a normal WRITE SAME with no data buffer.
--- drivers/target/target_core_file.c | 3 +++ drivers/target/target_core_iblock.c | 4 ++++ drivers/target/target_core_sbc.c | 6 ++++++ 3 files changed, 13 insertions(+)
drivers/target/target_core_file.c +3 -0
@@ -455,6 +455,9 @@ fd_execute_write_same(struct se_cmd *cmdreturn TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ; } +if (!cmd->t_data_nents) +return TCM_INVALID_CDB_FIELD ; +if (cmd->t_data_nents >1 || cmd->t_data_sg[0 ].length != cmd->se_dev->dev_attrib.block_size) { pr_err("WRITE_SAME: Illegal SGL t_data_nents: %u length: %u"
drivers/target/target_core_iblock.c +4 -0
@@ -458,6 +458,10 @@ iblock_execute_write_same(struct se_cmd " backends not supported\n");return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE ; } + +if (!cmd->t_data_nents) +return TCM_INVALID_CDB_FIELD ; + sg = &cmd->t_data_sg[0 ]; if (cmd->t_data_nents > 1 ||
drivers/target/target_core_sbc.c +6 -0
@@ -312,6 +312,12 @@ sbc_setup_write_same(struct se_cmd *cmd,pr_warn ("WRITE SAME with ANCHOR not supported\n" );return TCM_INVALID_CDB_FIELD ; } + +if (flags &0x01 ) { +pr_warn ("WRITE SAME with NDOB not supported\n" ); +return TCM_INVALID_CDB_FIELD ; + } +/* * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting * translated into block discard requests within backend code.
Greg Kroah-Hartman
maintainerPATCH 42/270 can: mcp251xfd: mcp251xfd_remove(): fix order of unregistration calls
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Kleine-Budde <[email protected]>
commit 84f5eb833f53ae192baed4cfb8d9eaab43481fc9 upstream.
If a driver is removed, the driver framework invokes the driver's remove callback. A CAN driver's remove function calls unregister_candev(), which calls net_device_ops::ndo_stop further down in the call stack for interfaces which are in the "up" state.
With the mcp251xfd driver the removal of the module causes the following warning:
| WARNING: CPU: 0 PID: 352 at net/core/dev.c:7342 __netif_napi_del_locked+0xc8/0xd8
as can_rx_offload_del() deletes the NAPI, while it is still active, because the interface is still up.
To fix the warning, first unregister the network interface, which calls net_device_ops::ndo_stop, which disables the NAPI, and then call can_rx_offload_del().
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +1 -1
@@ -2889,8 +2889,8 @@ static int mcp251xfd_remove(struct spi_dstruct mcp251xfd_priv *priv =spi_get_drvdata (spi);struct net_device *ndev = priv->ndev; -can_rx_offload_del (&priv->offload);mcp251xfd_unregister (priv); +can_rx_offload_del (&priv->offload); spi->max_speed_hz = priv->spi_max_speed_hz_orig;free_candev (ndev);
Greg Kroah-Hartman
maintainerPATCH 43/270 openvswitch: Fix unsafe attribute parsing in output_userspace()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eelco Chaudron <[email protected]>
commit 6beb6835c1fbb3f676aebb51a5fee6b77fed9308 upstream.
This patch replaces the manual Netlink attribute iteration in output_userspace() with nla_for_each_nested(), which ensures that only well-formed attributes are processed.
--- net/openvswitch/actions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/openvswitch/actions.c +1 -2
@@ -953,8 +953,7 @@ static int output_userspace(struct datap upcall.cmd =OVS_PACKET_CMD_ACTION ; upcall.mru =OVS_CB (skb)->mru; -for (a =nla_data (attr), rem =nla_len (attr); rem >0 ; - a =nla_next (a, &rem)) { +nla_for_each_nested (a, attr, rem) {switch (nla_type (a)) {case OVS_USERSPACE_ATTR_USERDATA : upcall.userdata = a;
Greg Kroah-Hartman
maintainerPATCH 44/270 can: gw: use call_rcu() instead of costly synchronize_rcu()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 181d4447905d551cc664f1e7e796b482c1eec992 ]
Commit fb8696ab14ad ("can: gw: synchronize rcu operations before removing gw job entry") added three synchronize_rcu() calls to make sure one rcu grace period was observed before freeing a "struct cgw_job" (which are tiny objects).
This should be converted to call_rcu() to avoid adding delays in device / network dismantles.
Use the rcu_head that was already in struct cgw_job, not yet used.
Stable-dep-of: 511e64e13d8c ("can: gw: fix RCU/BH usage in cgw_create_job()")
--- net/can/gw.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
net/can/gw.c +10 -6
@@ -515,6 +515,13 @@ static inline void cgw_unregister_filter(struct net *net, struct cgw_job *gwj) gwj->ccgw.filter.can_mask, can_can_gw_rcv, gwj); } +static void cgw_job_free_rcu (struct rcu_head *rcu_head) +{ + struct cgw_job *gwj = container_of(rcu_head, struct cgw_job, rcu); + +kmem_cache_free (cgw_cache, gwj); +} +static int cgw_notifier (struct notifier_block *nb,unsigned long msg,void *ptr) {
@@ -534,8 +541,7 @@ static int cgw_notifier(struct notifier_block *nb,if (gwj->src.dev == dev || gwj->dst.dev == dev) {hlist_del (&gwj->list);cgw_unregister_filter (net, gwj); -synchronize_rcu (); -kmem_cache_free (cgw_cache, gwj); +call_rcu (&gwj->rcu, cgw_job_free_rcu); } } }
@@ -1093,8 +1099,7 @@ static void cgw_remove_all_jobs(struct net *net)hlist_for_each_entry_safe (gwj, nx, &net->can.cgw_list, list) {hlist_del (&gwj->list);cgw_unregister_filter (net, gwj); -synchronize_rcu (); -kmem_cache_free (cgw_cache, gwj); +call_rcu (&gwj->rcu, cgw_job_free_rcu); } }
@@ -1162,8 +1167,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh,hlist_del (&gwj->list);cgw_unregister_filter (net, gwj); -synchronize_rcu (); -kmem_cache_free (cgw_cache, gwj); +call_rcu (&gwj->rcu, cgw_job_free_rcu); err =0 ;break ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/270 rcu/kvfree: Add kvfree_rcu_mightsleep() and kfree_rcu_mightsleep()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uladzislau Rezki (Sony) <[email protected]>
[ Upstream commit 608723c41cd951fb32ade2f8371e61c270816175 ]
The kvfree_rcu() and kfree_rcu() APIs are hazardous in that if you forget the second argument, it works, but might sleep. This sleeping can be a correctness bug from atomic contexts, and even in non-atomic contexts it might introduce unacceptable latencies. This commit therefore adds kvfree_rcu_mightsleep() and kfree_rcu_mightsleep(), which will replace the single-argument kvfree_rcu() and kfree_rcu(), respectively.
This commit enables a series of commits that switch from single-argument kvfree_rcu() and kfree_rcu() to their _mightsleep() counterparts. Once all of these commits land, the single-argument versions will be removed.
Stable-dep-of: 511e64e13d8c ("can: gw: fix RCU/BH usage in cgw_create_job()")
--- include/linux/rcupdate.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/rcupdate.h +3 -0
@@ -987,6 +987,9 @@ do { \#define kvfree_rcu (...) KVFREE_GET_MACRO(__VA_ARGS__, \ kvfree_rcu_arg_2, kvfree_rcu_arg_1)(__VA_ARGS__) +#define kvfree_rcu_mightsleep (ptr) kvfree_rcu_arg_1(ptr) +#define kfree_rcu_mightsleep (ptr) kvfree_rcu_mightsleep(ptr) +#define KVFREE_GET_MACRO (_1, _2,NAME , ...) NAME#define kvfree_rcu_arg_2 (ptr, rhf) kfree_rcu(ptr, rhf)#define kvfree_rcu_arg_1 (ptr) \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/270 can: gw: fix RCU/BH usage in cgw_create_job()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Hartkopp <[email protected]>
[ Upstream commit 511e64e13d8cc72853275832e3f372607466c18c ]
As reported by Sebastian Andrzej Siewior the use of local_bh_disable() is only feasible in uni processor systems to update the modification rules. The usual use-case to update the modification rules is to update the data of the modifications but not the modification types (AND/OR/XOR/SET) or the checksum functions itself.
To omit additional memory allocations to maintain fast modification switching times, the modification description space is doubled at gw-job creation time so that only the reference to the active modification description is changed under rcu protection.
Rename cgw_job::mod to cf_mod and make it a RCU pointer. Allocate in cgw_create_job() and free it together with cgw_job in cgw_job_free_rcu(). Update all users to dereference cgw_job::cf_mod with a RCU accessor and if possible once.
[bigeasy: Replace mod1/mod2 from the Oliver's original patch with dynamic allocation, use RCU annotation and accessor]
--- net/can/gw.c | 149 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 59 deletions(-)
net/can/gw.c +90 -59
@@ -130,7 +130,7 @@ struct cgw_job {u32 handled_frames;u32 dropped_frames;u32 deleted_frames; -struct cf_mod mod; +struct cf_mod __rcu *cf_mod;union {/* CAN frame data source */ struct net_device *dev;
@@ -397,6 +397,7 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)struct cgw_job *gwj = (struct cgw_job *)data;struct canfd_frame *cf;struct sk_buff *nskb; +struct cf_mod *mod;int modidx =0 ;/* process strictly Classic CAN or CAN FD frames */
@@ -444,7 +445,8 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)* When there is at least one modification function activated, * we need to copy the skb as we want to modify skb->data. */ -if (gwj->mod.modfunc[0 ]) + mod =rcu_dereference (gwj->cf_mod); +if (mod->modfunc[0 ]) nskb =skb_copy (skb,GFP_ATOMIC );else nskb =skb_clone (skb,GFP_ATOMIC );
@@ -467,8 +469,8 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data) cf = (struct canfd_frame *)nskb->data;/* perform preprocessed modification functions if there are any */ -while (modidx <MAX_MODFUNCTIONS && gwj->mod.modfunc[modidx]) - (*gwj->mod.modfunc[modidx++])(cf, &gwj->mod); +while (modidx <MAX_MODFUNCTIONS && mod->modfunc[modidx]) + (*mod->modfunc[modidx++])(cf, mod);/* Has the CAN frame been modified? */ if (modidx) {
@@ -484,11 +486,11 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data) }/* check for checksum updates */ -if (gwj->mod.csumfunc.crc8) - (*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8); +if (mod->csumfunc.crc8) + (*mod->csumfunc.crc8)(cf, &mod->csum.crc8); -if (gwj->mod.csumfunc.xor) - (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor); +if (mod->csumfunc.xor) + (*mod->csumfunc.xor)(cf, &mod->csum.xor); }/* clear the skb timestamp if not configured the other way */
@@ -519,9 +521,20 @@ static void cgw_job_free_rcu(struct rcu_head *rcu_head) { struct cgw_job *gwj = container_of(rcu_head, struct cgw_job, rcu); +/* cgw_job::cf_mod is always accessed from the same cgw_job object within +* the same RCU read section. Once cgw_job is scheduled for removal, +* cf_mod can also be removed without mandating an additional grace period. +*/ +kfree (rcu_access_pointer (gwj->cf_mod));kmem_cache_free (cgw_cache, gwj); } +/* Return cgw_job::cf_mod with RTNL protected section */ +static struct cf_mod *cgw_job_cf_mod (struct cgw_job *gwj) +{ +return rcu_dereference_protected (gwj->cf_mod,rtnl_is_locked ()); +} +static int cgw_notifier (struct notifier_block *nb,unsigned long msg,void *ptr) {
@@ -554,6 +567,7 @@ static int cgw_put_job(struct sk_buff *skb, struct cgw_job *gwj, int type, {struct rtcanmsg *rtcan;struct nlmsghdr *nlh; +struct cf_mod *mod; nlh =nlmsg_put (skb, pid, seq, type,sizeof (*rtcan), flags);if (!nlh)
@@ -588,82 +602,83 @@ static int cgw_put_job(struct sk_buff *skb, struct cgw_job *gwj, int type, goto cancel; } + mod =cgw_job_cf_mod (gwj);if (gwj->flags &CGW_FLAGS_CAN_FD ) {struct cgw_fdframe_mod mb; -if (gwj->mod.modtype.and) { -memcpy (&mb.cf, &gwj->mod.modframe.and,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.and; +if (mod->modtype.and) { +memcpy (&mb.cf, &mod->modframe.and,sizeof (mb.cf)); + mb.modtype = mod->modtype.and;if (nla_put (skb,CGW_FDMOD_AND ,sizeof (mb), &mb) <0 ) goto cancel; } -if (gwj->mod.modtype.or) { -memcpy (&mb.cf, &gwj->mod.modframe.or,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.or; +if (mod->modtype.or) { +memcpy (&mb.cf, &mod->modframe.or,sizeof (mb.cf)); + mb.modtype = mod->modtype.or;if (nla_put (skb,CGW_FDMOD_OR ,sizeof (mb), &mb) <0 ) goto cancel; } -if (gwj->mod.modtype.xor) { -memcpy (&mb.cf, &gwj->mod.modframe.xor,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.xor; +if (mod->modtype.xor) { +memcpy (&mb.cf, &mod->modframe.xor,sizeof (mb.cf)); + mb.modtype = mod->modtype.xor;if (nla_put (skb,CGW_FDMOD_XOR ,sizeof (mb), &mb) <0 ) goto cancel; } -if (gwj->mod.modtype.set) { -memcpy (&mb.cf, &gwj->mod.modframe.set,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.set; +if (mod->modtype.set) { +memcpy (&mb.cf, &mod->modframe.set,sizeof (mb.cf)); + mb.modtype = mod->modtype.set;if (nla_put (skb,CGW_FDMOD_SET ,sizeof (mb), &mb) <0 ) goto cancel; } }else {struct cgw_frame_mod mb; -if (gwj->mod.modtype.and) { -memcpy (&mb.cf, &gwj->mod.modframe.and,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.and; +if (mod->modtype.and) { +memcpy (&mb.cf, &mod->modframe.and,sizeof (mb.cf)); + mb.modtype = mod->modtype.and;if (nla_put (skb,CGW_MOD_AND ,sizeof (mb), &mb) <0 ) goto cancel; } -if (gwj->mod.modtype.or) { -memcpy (&mb.cf, &gwj->mod.modframe.or,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.or; +if (mod->modtype.or) { +memcpy (&mb.cf, &mod->modframe.or,sizeof (mb.cf)); + mb.modtype = mod->modtype.or;if (nla_put (skb,CGW_MOD_OR ,sizeof (mb), &mb) <0 ) goto cancel; } -if (gwj->mod.modtype.xor) { -memcpy (&mb.cf, &gwj->mod.modframe.xor,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.xor; +if (mod->modtype.xor) { +memcpy (&mb.cf, &mod->modframe.xor,sizeof (mb.cf)); + mb.modtype = mod->modtype.xor;if (nla_put (skb,CGW_MOD_XOR ,sizeof (mb), &mb) <0 ) goto cancel; } -if (gwj->mod.modtype.set) { -memcpy (&mb.cf, &gwj->mod.modframe.set,sizeof (mb.cf)); - mb.modtype = gwj->mod.modtype.set; +if (mod->modtype.set) { +memcpy (&mb.cf, &mod->modframe.set,sizeof (mb.cf)); + mb.modtype = mod->modtype.set;if (nla_put (skb,CGW_MOD_SET ,sizeof (mb), &mb) <0 ) goto cancel; } } -if (gwj->mod.uid) { -if (nla_put_u32 (skb,CGW_MOD_UID , gwj->mod.uid) <0 ) +if (mod->uid) { +if (nla_put_u32 (skb,CGW_MOD_UID , mod->uid) <0 ) goto cancel; } -if (gwj->mod.csumfunc.crc8) { +if (mod->csumfunc.crc8) {if (nla_put (skb,CGW_CS_CRC8 ,CGW_CS_CRC8_LEN , - &gwj->mod.csum.crc8) <0 ) + &mod->csum.crc8) <0 ) goto cancel; } -if (gwj->mod.csumfunc.xor) { +if (mod->csumfunc.xor) {if (nla_put (skb,CGW_CS_XOR ,CGW_CS_XOR_LEN , - &gwj->mod.csum.xor) <0 ) + &mod->csum.xor) <0 ) goto cancel; }
@@ -997,7 +1012,7 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh,struct net *net =sock_net (skb->sk);struct rtcanmsg *r;struct cgw_job *gwj; -struct cf_mod mod; +struct cf_mod *mod;struct can_can_gw ccgw;u8 limhops =0 ;int err =0 ;
@@ -1016,37 +1031,48 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh,if (r->gwtype !=CGW_TYPE_CAN_CAN )return -EINVAL ; - err =cgw_parse_attr (nlh, &mod,CGW_TYPE_CAN_CAN , &ccgw, &limhops); + mod =kmalloc (sizeof (*mod),GFP_KERNEL ); +if (!mod) +return -ENOMEM ; + + err =cgw_parse_attr (nlh, mod,CGW_TYPE_CAN_CAN , &ccgw, &limhops);if (err <0 ) -return err; + goto out_free_cf; -if (mod.uid) { +if (mod->uid) {ASSERT_RTNL ();/* check for updating an existing job with identical uid */ hlist_for_each_entry (gwj, &net->can.cgw_list, list) { -if (gwj->mod.uid != mod.uid) +struct cf_mod *old_cf; + + old_cf =cgw_job_cf_mod (gwj); +if (old_cf->uid != mod->uid)continue ;/* interfaces & filters must be identical */ -if (memcmp (&gwj->ccgw, &ccgw,sizeof (ccgw))) -return -EINVAL ; +if (memcmp (&gwj->ccgw, &ccgw,sizeof (ccgw))) { + err = -EINVAL ; + goto out_free_cf; + } -/* update modifications with disabled softirq & quit */ -local_bh_disable (); -memcpy (&gwj->mod, &mod,sizeof (mod)); -local_bh_enable (); +rcu_assign_pointer (gwj->cf_mod, mod); +kfree_rcu_mightsleep (old_cf);return 0 ; } }/* ifindex == 0 is not allowed for job creation */ -if (!ccgw.src_idx || !ccgw.dst_idx) -return -ENODEV ; +if (!ccgw.src_idx || !ccgw.dst_idx) { + err = -ENODEV ; + goto out_free_cf; + } gwj =kmem_cache_alloc (cgw_cache,GFP_KERNEL ); -if (!gwj) -return -ENOMEM ; +if (!gwj) { + err = -ENOMEM ; + goto out_free_cf; + } gwj->handled_frames =0 ; gwj->dropped_frames =0 ;
@@ -1056,7 +1082,7 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh, gwj->limit_hops = limhops;/* insert already parsed information */ -memcpy (&gwj->mod, &mod,sizeof (mod)); +RCU_INIT_POINTER (gwj->cf_mod, mod);memcpy (&gwj->ccgw, &ccgw,sizeof (ccgw)); err = -ENODEV ;
@@ -1083,9 +1109,11 @@ static int cgw_create_job(struct sk_buff *skb, struct nlmsghdr *nlh,if (!err)hlist_add_head_rcu (&gwj->list, &net->can.cgw_list); out: -if (err) +if (err) {kmem_cache_free (cgw_cache, gwj); - +out_free_cf: +kfree (mod); + }return err; }
@@ -1145,19 +1173,22 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh,/* remove only the first matching entry */ hlist_for_each_entry_safe (gwj, nx, &net->can.cgw_list, list) { +struct cf_mod *cf_mod; +if (gwj->flags != r->flags)continue ;if (gwj->limit_hops != limhops)continue ; + cf_mod =cgw_job_cf_mod (gwj);/* we have a match when uid is enabled and identical */ -if (gwj->mod.uid || mod.uid) { -if (gwj->mod.uid != mod.uid) +if (cf_mod->uid || mod.uid) { +if (cf_mod->uid != mod.uid)continue ; }else {/* no uid => check for identical modifications */ -if (memcmp (&gwj->mod, &mod,sizeof (mod))) +if (memcmp (cf_mod, &mod,sizeof (mod)))continue ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/270 netfilter: ipset: fix region locking in hash types
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jozsef Kadlecsik <[email protected]>
[ Upstream commit 8478a729c0462273188263136880480729e9efca ]
Region locking introduced in v5.6-rc4 contained three macros to handle the region locks: ahash_bucket_start(), ahash_bucket_end() which gave back the start and end hash bucket values belonging to a given region lock and ahash_region() which should give back the region lock belonging to a given hash bucket. The latter was incorrect which can lead to a race condition between the garbage collector and adding new elements when a hash type of set is defined with timeouts.
--- net/netfilter/ipset/ip_set_hash_gen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipset/ip_set_hash_gen.h +1 -1
@@ -88,7 +88,7 @@ struct hbucket {#define ahash_sizeof_regions (htable_bits) \ (ahash_numof_locks(htable_bits) * sizeof(struct ip_set_region))#define ahash_region (n, htable_bits) \ - ((n) % ahash_numof_locks(htable_bits)) + ((n) / jhash_size(HTABLE_REGION_BITS))#define ahash_bucket_start (h, htable_bits) \ ((htable_bits) < HTABLE_REGION_BITS ? 0 \ : (h) * jhash_size(HTABLE_REGION_BITS))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/270 net: dsa: b53: allow leaky reserved multicast
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Gorski <[email protected]>
[ Upstream commit 5f93185a757ff38b36f849c659aeef368db15a68 ]
Allow reserved multicast to ignore VLAN membership so STP and other management protocols work without a PVID VLAN configured when using a vlan aware bridge.
--- drivers/net/dsa/b53/b53_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/dsa/b53/b53_common.c +4 -2
@@ -373,9 +373,11 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable,b53_read8 (dev,B53_VLAN_PAGE ,B53_VLAN_CTRL5 , &vc5); } + vc1 &= ~VC1_RX_MCST_FWD_EN ; +if (enable) { vc0 |=VC0_VLAN_EN |VC0_VID_CHK_EN |VC0_VID_HASH_VID ; - vc1 |=VC1_RX_MCST_UNTAG_EN |VC1_RX_MCST_FWD_EN ; + vc1 |=VC1_RX_MCST_UNTAG_EN ; vc4 &= ~VC4_ING_VID_CHECK_MASK ;if (enable_filtering) { vc4 |=VC4_ING_VID_VIO_DROP <<VC4_ING_VID_CHECK_S ;
@@ -393,7 +395,7 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable, }else { vc0 &= ~(VC0_VLAN_EN |VC0_VID_CHK_EN |VC0_VID_HASH_VID ); - vc1 &= ~(VC1_RX_MCST_UNTAG_EN |VC1_RX_MCST_FWD_EN ); + vc1 &= ~VC1_RX_MCST_UNTAG_EN ; vc4 &= ~VC4_ING_VID_CHECK_MASK ; vc5 &= ~VC5_DROP_VTABLE_MISS ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/270 net: dsa: b53: fix VLAN ID for untagged vlan on bridge leave
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Gorski <[email protected]>
[ Upstream commit a1c1901c5cc881425cc45992ab6c5418174e9e5a ]
The untagged default VLAN is added to the default vlan, which may be one, but we modify the VLAN 0 entry on bridge leave.
Fix this to use the correct VLAN entry for the default pvid.
--- drivers/net/dsa/b53/b53_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/dsa/b53/b53_common.c +2 -1
@@ -1872,7 +1872,7 @@ EXPORT_SYMBOL(b53_br_join);void b53_br_leave (struct dsa_switch *ds,int port,struct net_device *br) {struct b53_device *dev = ds->priv; -struct b53_vlan *vl = &dev->vlans[0 ]; +struct b53_vlan *vl;s8 cpu_port =dsa_to_port (ds, port)->cpu_dp->index;unsigned int i;u16 pvlan, reg, pvid;
@@ -1898,6 +1898,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct net_device *br) dev->ports[port].vlan_ctl_mask = pvlan; pvid =b53_default_pvid (dev); + vl = &dev->vlans[pvid];/* Make this port join all VLANs without VLAN entries */ if (is58xx (dev)) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/270 net: dsa: b53: fix learning on VLAN unaware bridges
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Gorski <[email protected]>
[ Upstream commit 9f34ad89bcf0e6df6f8b01f1bdab211493fc66d1 ]
When VLAN filtering is off, we configure the switch to forward, but not learn on VLAN table misses. This effectively disables learning while not filtering.
Fix this by switching to forward and learn. Setting the learning disable register will still control whether learning actually happens.
--- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_common.c +1 -1
@@ -383,7 +383,7 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable, vc4 |=VC4_ING_VID_VIO_DROP <<VC4_ING_VID_CHECK_S ; vc5 |=VC5_DROP_VTABLE_MISS ; }else { - vc4 |=VC4_ING_VID_VIO_FWD <<VC4_ING_VID_CHECK_S ; + vc4 |=VC4_NO_ING_VID_CHK <<VC4_ING_VID_CHECK_S ; vc5 &= ~VC5_DROP_VTABLE_MISS ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/270 Input: synaptics - enable InterTouch on Dynabook Portege X30-D
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manuel Fombuena <[email protected]>
commit 6d7ea0881000966607772451b789b5fb5766f11d upstream.
[ 5.989588] psmouse serio1: synaptics: Your touchpad (PNP: TOS0213 PNP0f03) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to [email protected]. [ 6.039923] psmouse serio1: synaptics: Touchpad model: 1, fw: 9.32, id: 0x1e2a1, caps: 0xf00223/0x840300/0x12e800/0x52d884, board id: 3322, fw id: 2658004
The board is labelled TM3322.
Present on the Toshiba / Dynabook Portege X30-D and possibly others.
Confirmed working well with psmouse.synaptics_intertouch=1 and local build.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -192,6 +192,7 @@ static const char * const smbus_pnp_ids["SYN3221" ,/* HP 15-ay000 */ "SYN323d" ,/* HP Spectre X360 13-w013dx */ "SYN3257" ,/* HP Envy 13-ad105ng */ +"TOS0213" ,/* Dynabook Portege X30-D */ NULL };
Greg Kroah-Hartman
maintainerPATCH 52/270 Input: synaptics - enable InterTouch on Dynabook Portege X30L-G
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aditya Garg <[email protected]>
commit 47d768b32e644b56901bb4bbbdb1feb01ea86c85 upstream.
Enable InterTouch mode on Dynabook Portege X30L-G by adding "TOS01f6" to the list of SMBus-enabled variants.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -192,6 +192,7 @@ static const char * const smbus_pnp_ids["SYN3221" ,/* HP 15-ay000 */ "SYN323d" ,/* HP Spectre X360 13-w013dx */ "SYN3257" ,/* HP Envy 13-ad105ng */ +"TOS01f6" ,/* Dynabook Portege X30L-G */ "TOS0213" ,/* Dynabook Portege X30-D */ NULL };
Greg Kroah-Hartman
maintainerPATCH 53/270 Input: synaptics - enable InterTouch on Dell Precision M3800
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aditya Garg <[email protected]>
commit a609cb4cc07aa9ab8f50466622814356c06f2c17 upstream.
Enable InterTouch mode on Dell Precision M3800 by adding "DLL060d" to the list of SMBus-enabled variants.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -163,6 +163,7 @@ static const char * const topbuttonpad_pstatic const char *const smbus_pnp_ids[] = {/* all of the topbuttonpad_pnp_ids are valid, we just add some extras */ +"DLL060d" ,/* Dell Precision M3800 */ "LEN0048" ,/* X1 Carbon 3 */ "LEN0046" ,/* X250 */ "LEN0049" ,/* Yoga 11e */
Greg Kroah-Hartman
maintainerPATCH 54/270 Input: synaptics - enable SMBus for HP Elitebook 850 G1
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <[email protected]>
commit f04f03d3e99bc8f89b6af5debf07ff67d961bc23 upstream.
The kernel reports that the touchpad for this device can support SMBus mode.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -188,6 +188,7 @@ static const char * const smbus_pnp_ids["LEN2054" ,/* E480 */ "LEN2055" ,/* E580 */ "LEN2068" ,/* T14 Gen 1 */ +"SYN3003" ,/* HP EliteBook 850 G1 */ "SYN3015" ,/* HP EliteBook 840 G2 */ "SYN3052" ,/* HP EliteBook 840 G4 */ "SYN3221", /* HP 15-ay000 */
Greg Kroah-Hartman
maintainerPATCH 55/270 Input: synaptics - enable InterTouch on TUXEDO InfinityBook Pro 14 v5
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aditya Garg <[email protected]>
commit 2abc698ac77314e0de5b33a6d96a39c5159d88e4 upstream.
Enable InterTouch mode on TUXEDO InfinityBook Pro 14 v5 by adding "SYN1221" to the list of SMBus-enabled variants.
Add support for InterTouch on SYN1221 by adding it to the list of SMBus-enabled variants.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -188,6 +188,7 @@ static const char * const smbus_pnp_ids["LEN2054" ,/* E480 */ "LEN2055" ,/* E580 */ "LEN2068" ,/* T14 Gen 1 */ +"SYN1221" ,/* TUXEDO InfinityBook Pro 14 v5 */ "SYN3003" ,/* HP EliteBook 850 G1 */ "SYN3015" ,/* HP EliteBook 840 G2 */ "SYN3052", /* HP EliteBook 840 G4 */
Greg Kroah-Hartman
maintainerPATCH 56/270 staging: iio: adc: ad7816: Correct conditional logic for store mode
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriel Shahrouzi <[email protected]>
commit 2e922956277187655ed9bedf7b5c28906e51708f upstream.
The mode setting logic in ad7816_store_mode was reversed due to incorrect handling of the strcmp return value. strcmp returns 0 on match, so the if (strcmp(buf, "full")) block executed when the input was not "full".
This resulted in "full" setting the mode to AD7816_PD (power-down) and other inputs setting it to AD7816_FULL.
Fix this by checking it against 0 to correctly check for "full" and "power-down", mapping them to AD7816_FULL and AD7816_PD respectively.
--- drivers/staging/iio/adc/ad7816.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/adc/ad7816.c +1 -1
@@ -136,7 +136,7 @@ static ssize_t ad7816_store_mode(structstruct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ad7816_chip_info *chip =iio_priv (indio_dev); -if (strcmp (buf,"full" )) { +if (strcmp (buf,"full" ) ==0 ) {gpiod_set_value (chip->rdwr_pin,1 ); chip->mode =AD7816_FULL ; }else {
Greg Kroah-Hartman
maintainerPATCH 57/270 staging: axis-fifo: Remove hardware resets for user errors
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriel Shahrouzi <[email protected]>
commit c6e8d85fafa7193613db37da29c0e8d6e2515b13 upstream.
The axis-fifo driver performs a full hardware reset (via reset_ip_core()) in several error paths within the read and write functions. This reset flushes both TX and RX FIFOs and resets the AXI-Stream links.
Allow the user to handle the error without causing hardware disruption or data loss in other FIFO paths.
--- drivers/staging/axis-fifo/axis-fifo.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/staging/axis-fifo/axis-fifo.c +3 -8
@@ -401,16 +401,14 @@ static ssize_t axis_fifo_read(struct fil bytes_available =ioread32 (fifo->base_addr +XLLF_RLR_OFFSET );if (!bytes_available) { -dev_err (fifo->dt_device,"received a packet of length 0 - fifo core will be reset\n" ); -reset_ip_core (fifo); +dev_err (fifo->dt_device,"received a packet of length 0\n" ); ret = -EIO ; goto end_unlock; }if (bytes_available > len) { -dev_err (fifo->dt_device,"user read buffer too small (available bytes=%zu user buffer bytes=%zu) - fifo core will be reset\n" , +dev_err (fifo->dt_device,"user read buffer too small (available bytes=%zu user buffer bytes=%zu)\n" , bytes_available, len); -reset_ip_core (fifo); ret = -EINVAL ; goto end_unlock; }
@@ -419,8 +417,7 @@ static ssize_t axis_fifo_read(struct fil/* this probably can't happen unless IP * registers were previously mishandled */ -dev_err (fifo->dt_device,"received a packet that isn't word-aligned - fifo core will be reset\n" ); -reset_ip_core (fifo); +dev_err (fifo->dt_device,"received a packet that isn't word-aligned\n" ); ret = -EIO ; goto end_unlock; }
@@ -441,7 +438,6 @@ static ssize_t axis_fifo_read(struct filif (copy_to_user (buf + copied *sizeof (u32), tmp_buf, copy *sizeof (u32))) { -reset_ip_core (fifo); ret = -EFAULT ; goto end_unlock; }
@@ -552,7 +548,6 @@ static ssize_t axis_fifo_write(struct fiif (copy_from_user (tmp_buf, buf + copied *sizeof (u32), copy *sizeof (u32))) { -reset_ip_core (fifo); ret = -EFAULT ; goto end_unlock; }
Greg Kroah-Hartman
maintainerPATCH 58/270 staging: axis-fifo: Correct handling of tx_fifo_depth for size validation
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriel Shahrouzi <[email protected]>
commit 2ca34b508774aaa590fc3698a54204706ecca4ba upstream.
Remove erroneous subtraction of 4 from the total FIFO depth read from device tree. The stored depth is for checking against total capacity, not initial vacancy. This prevented writes near the FIFO's full size.
The check performed just before data transfer, which uses live reads of the TDFV register to determine current vacancy, correctly handles the initial Depth - 4 hardware state and subsequent FIFO fullness.
--- drivers/staging/axis-fifo/axis-fifo.c | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/axis-fifo/axis-fifo.c +0 -3
@@ -780,9 +780,6 @@ static int axis_fifo_parse_dt(struct axi goto end; } -/* IP sets TDFV to fifo depth - 4 so we will do the same */ - fifo->tx_fifo_depth -=4 ; - ret =get_dts_property (fifo,"xlnx,use-rx-data" , &fifo->has_rx_fifo);if (ret) {dev_err (fifo->dt_device,"missing xlnx,use-rx-data property\n" );
Greg Kroah-Hartman
maintainerPATCH 59/270 iio: adc: ad7606: fix serial register access
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Angelo Dureghello <[email protected]>
commit f083f8a21cc785ebe3a33f756a3fa3660611f8db upstream.
Fix register read/write routine as per datasheet.
When reading multiple consecutive registers, only the first one is read properly. This is due to missing chip select deassert and assert again between first and second 16bit transfer, as shown in the datasheet AD7606C-16, rev 0, figure 110.
--- drivers/iio/adc/ad7606_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7606_spi.c +1 -1
@@ -127,7 +127,7 @@ static int ad7606_spi_reg_read(struct ad { .tx_buf = &st->d16[0], .len = 2, - .cs_change = 0, + .cs_change = 1, }, { .rx_buf = &st->d16[1], .len = 2,
Greg Kroah-Hartman
maintainerPATCH 60/270 iio: adis16201: Correct inclinometer channel resolution
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabriel Shahrouzi <[email protected]>
commit 609bc31eca06c7408e6860d8b46311ebe45c1fef upstream.
The inclinometer channels were previously defined with 14 realbits. However, the ADIS16201 datasheet states the resolution for these output channels is 12 bits (Page 14, text description; Page 15, table 7).
Correct the realbits value to 12 to accurately reflect the hardware.
--- drivers/iio/accel/adis16201.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/accel/adis16201.c +2 -2
@@ -214,9 +214,9 @@ static const struct iio_chan_spec adis16 BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14),ADIS_AUX_ADC_CHAN (ADIS16201_AUX_ADC_REG ,ADIS16201_SCAN_AUX_ADC ,0 ,12 ),ADIS_INCLI_CHAN (X ,ADIS16201_XINCL_OUT_REG ,ADIS16201_SCAN_INCLI_X , -BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,14 ), +BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,12 ),ADIS_INCLI_CHAN (Y ,ADIS16201_YINCL_OUT_REG ,ADIS16201_SCAN_INCLI_Y , -BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,14 ), +BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,12 ), IIO_CHAN_SOFT_TIMESTAMP(7) };
Greg Kroah-Hartman
maintainerPATCH 61/270 iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_fifo
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Silvano Seva <[email protected]>
commit 159ca7f18129834b6f4c7eae67de48e96c752fc9 upstream.
Prevent st_lsm6dsx_read_fifo from falling in an infinite loop in case pattern_len is equal to zero and the device FIFO is not empty.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +3 -0
@@ -369,6 +369,9 @@ int st_lsm6dsx_read_fifo(struct st_lsm6dif (fifo_status &cpu_to_le16 (ST_LSM6DSX_FIFO_EMPTY_MASK ))return 0 ; +if (!pattern_len) + pattern_len =ST_LSM6DSX_SAMPLE_SIZE ; + fifo_len = (le16_to_cpu (fifo_status) & fifo_diff_mask) *ST_LSM6DSX_CHAN_SIZE ; fifo_len = (fifo_len / pattern_len) * pattern_len;
Greg Kroah-Hartman
maintainerPATCH 62/270 iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_tagged_fifo
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Silvano Seva <[email protected]>
commit 8114ef86e2058e2554111b793596f17bee23fa15 upstream.
Prevent st_lsm6dsx_read_tagged_fifo from falling in an infinite loop in case pattern_len is equal to zero and the device FIFO is not empty.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +3 -0
@@ -589,6 +589,9 @@ int st_lsm6dsx_read_tagged_fifo(struct sif (!fifo_len)return 0 ; +if (!pattern_len) + pattern_len =ST_LSM6DSX_TAGGED_SAMPLE_SIZE ; +for (read_len =0 ; read_len < fifo_len; read_len += pattern_len) { err = st_lsm6dsx_read_block(hw, ST_LSM6DSX_REG_FIFO_OUT_TAG_ADDR,
Greg Kroah-Hartman
maintainerPATCH 63/270 usb: uhci-platform: Make the clock really optional
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Charkov <[email protected]>
commit a5c7973539b010874a37a0e846e62ac6f00553ba upstream.
Device tree bindings state that the clock is optional for UHCI platform controllers, and some existing device trees don't provide those - such as those for VIA/WonderMedia devices.
The driver however fails to probe now if no clock is provided, because devm_clk_get returns an error pointer in such case.
Switch to devm_clk_get_optional instead, so that it could probe again on those platforms where no clocks are given.
--- drivers/usb/host/uhci-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/uhci-platform.c +1 -1
@@ -122,7 +122,7 @@ static int uhci_hcd_platform_probe(struc }/* Get and enable clock if any specified */ - uhci->clk =devm_clk_get (&pdev->dev,NULL ); + uhci->clk =devm_clk_get_optional (&pdev->dev,NULL );if (IS_ERR (uhci->clk)) { ret =PTR_ERR (uhci->clk); goto err_rmr;
Greg Kroah-Hartman
maintainerPATCH 64/270 xenbus: Use kref to track req lifetime
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Andryuk <[email protected]>
commit 1f0304dfd9d217c2f8b04a9ef4b3258a66eedd27 upstream.
Marek reported seeing a NULL pointer fault in the xenbus_thread callstack:
BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: e030:__wake_up_common+0x4c/0x180 Call Trace: <TASK> __wake_up_common_lock+0x82/0xd0 process_msg+0x18e/0x2f0 xenbus_thread+0x165/0x1c0
process_msg+0x18e is req->cb(req). req->cb is set to xs_wake_up(), a thin wrapper around wake_up(), or xenbus_dev_queue_reply(). It seems like it was xs_wake_up() in this case.
It seems like req may have woken up the xs_wait_for_reply(), which kfree()ed the req. When xenbus_thread resumes, it faults on the zero-ed data.
Linux Device Drivers 2nd edition states:
"Normally, a wake_up call can cause an immediate reschedule to happen, meaning that other processes might run before wake_up returns." ... which would match the behaviour observed.
Change to keeping two krefs on each request. One for the caller, and one for xenbus_thread. Each will kref_put() when finished, and the last will free it.
This use of kref matches the description inDocumentation/core-api/kref.rst
Message-ID: <[email protected]>
--- drivers/xen/xenbus/xenbus.h | 2 ++ drivers/xen/xenbus/xenbus_comms.c | 9 ++++----- drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +- drivers/xen/xenbus/xenbus_xs.c | 18 ++++++++++++++++-- 4 files changed, 23 insertions(+), 8 deletions(-)
drivers/xen/xenbus/xenbus.h +2 -0
@@ -77,6 +77,7 @@ enum xb_req_state {struct xb_req_data {struct list_head list;wait_queue_head_t wq; +struct kref kref;struct xsd_sockmsg msg;uint32_t caller_req_id;enum xsd_sockmsg_type type;
@@ -103,6 +104,7 @@ int xb_init_comms(void);void xb_deinit_comms (void );int xs_watch_msg (struct xs_watch_event *event);void xs_request_exit (struct xb_req_data *req); +void xs_free_req (struct kref *kref);int xenbus_match (struct device *_dev,struct device_driver *_drv);int xenbus_dev_probe (struct device *_dev);
drivers/xen/xenbus/xenbus_comms.c +4 -5
@@ -309,8 +309,8 @@ static int process_msg(void)virt_wmb (); req->state = xb_req_state_got_reply; req->cb (req); - }else -kfree (req); + } +kref_put (&req->kref, xs_free_req); }mutex_unlock (&xs_response_mutex);
@@ -386,14 +386,13 @@ static int process_writes(void) state.req->msg.type =XS_ERROR ; state.req->err = err;list_del (&state.req->list); -if (state.req->state == xb_req_state_aborted) -kfree (state.req); -else { +if (state.req->state != xb_req_state_aborted) {/* write err, then update state */ virt_wmb (); state.req->state = xb_req_state_got_reply;wake_up (&state.req->wq); } +kref_put (&state.req->kref, xs_free_req);mutex_unlock (&xb_write_mutex);
drivers/xen/xenbus/xenbus_dev_frontend.c +1 -1
@@ -406,7 +406,7 @@ void xenbus_dev_queue_reply(struct xb_remutex_unlock (&u->reply_mutex);kfree (req->body); -kfree (req); +kref_put (&req->kref, xs_free_req);kref_put (&u->kref, xenbus_file_free);
drivers/xen/xenbus/xenbus_xs.c +16 -2
@@ -112,6 +112,12 @@ static void xs_suspend_exit(void)wake_up_all (&xs_state_enter_wq); } +void xs_free_req (struct kref *kref) +{ + struct xb_req_data *req = container_of(kref, struct xb_req_data, kref); +kfree (req); +} +static uint32_t xs_request_enter (struct xb_req_data *req) {uint32_t rq_id;
@@ -237,6 +243,12 @@ static void xs_send(struct xb_req_data * req->caller_req_id = req->msg.req_id; req->msg.req_id =xs_request_enter (req); +/* +* Take 2nd ref. One for this thread, and the second for the +* xenbus_thread. +*/ +kref_get (&req->kref); +mutex_lock (&xb_write_mutex);list_add_tail (&req->list, &xb_write_list); notify =list_is_singular (&xb_write_list);
@@ -261,8 +273,8 @@ static void *xs_wait_for_reply(struct xbif (req->state == xb_req_state_queued || req->state == xb_req_state_wait_reply) req->state = xb_req_state_aborted; -else -kfree (req); + +kref_put (&req->kref, xs_free_req);mutex_unlock (&xb_write_mutex);return ret;
@@ -291,6 +303,7 @@ int xenbus_dev_request_and_reply(struct req->cb = xenbus_dev_queue_reply; req->par = par; req->user_req = true; +kref_init (&req->kref);xs_send (req, msg);
@@ -319,6 +332,7 @@ static void *xs_talkv(struct xenbus_tran req->num_vecs = num_vecs; req->cb = xs_wake_up; req->user_req = false; +kref_init (&req->kref); msg.req_id =0 ; msg.tx_id = t.id;
Greg Kroah-Hartman
maintainerPATCH 65/270 module: ensure that kobject_put() is safe for module type kobjects
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
commit a6aeb739974ec73e5217c75a7c008a688d3d5cf1 upstream.
In 'lookup_or_create_module_kobject()', an internal kobject is created using 'module_ktype'. So call to 'kobject_put()' on error handling path causes an attempt to use an uninitialized completion pointer in 'module_kobject_release()'. In this scenario, we just want to release kobject without an extra synchronization required for a regular module unloading process, so adding an extra check whether 'complete()' is actually required makes 'kobject_put()' safe.
--- kernel/params.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/params.c +3 -1
@@ -947,7 +947,9 @@ int module_sysfs_initialized;static void module_kobj_release (struct kobject *kobj) {struct module_kobject *mk =to_module_kobject (kobj); -complete (mk->kobj_completion); + +if (mk->kobj_completion) +complete (mk->kobj_completion); }struct kobj_type module_ktype = {
Greg Kroah-Hartman
maintainerPATCH 66/270 ocfs2: switch osb->disable_recovery to enum
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit c0fb83088f0cc4ee4706e0495ee8b06f49daa716 upstream.
Patch series "ocfs2: Fix deadlocks in quota recovery", v3.
This implements another approach to fixing quota recovery deadlocks. We avoid grabbing sb->s_umount semaphore from ocfs2_finish_quota_recovery() and instead stop quota recovery early in ocfs2_dismount_volume().
This patch (of 3):
We will need more recovery states than just pure enable / disable to fix deadlocks with quota recovery. Switch osb->disable_recovery to enum.
--- fs/ocfs2/journal.c | 14 ++++++++------ fs/ocfs2/ocfs2.h | 7 ++++++- 2 files changed, 14 insertions(+), 7 deletions(-)
fs/ocfs2/journal.c +8 -6
@@ -175,7 +175,7 @@ int ocfs2_recovery_init(struct ocfs2_supstruct ocfs2_recovery_map *rm;mutex_init (&osb->recovery_lock); - osb->disable_recovery =0 ; + osb->recovery_state =OCFS2_REC_ENABLED ; osb->recovery_thread_task =NULL ;init_waitqueue_head (&osb->recovery_event);
@@ -210,7 +210,7 @@ void ocfs2_recovery_exit(struct ocfs2_su/* disable any new recovery threads and wait for any currently * running ones to exit. Do this before setting the vol_state. */ mutex_lock (&osb->recovery_lock); - osb->disable_recovery =1 ; + osb->recovery_state =OCFS2_REC_DISABLED ;mutex_unlock (&osb->recovery_lock);wait_event (osb->recovery_event, !ocfs2_recovery_thread_running (osb));
@@ -1525,14 +1525,16 @@ bail:void ocfs2_recovery_thread (struct ocfs2_super *osb,int node_num) { +int was_set =-1 ; +mutex_lock (&osb->recovery_lock); +if (osb->recovery_state <OCFS2_REC_DISABLED ) + was_set =ocfs2_recovery_map_set (osb, node_num);trace_ocfs2_recovery_thread (node_num, osb->node_num, - osb->disable_recovery, osb->recovery_thread_task, - osb->disable_recovery ? --1 :ocfs2_recovery_map_set (osb, node_num)); + osb->recovery_state, osb->recovery_thread_task, was_set); -if (osb->disable_recovery) +if (osb->recovery_state ==OCFS2_REC_DISABLED ) goto out;if (osb->recovery_thread_task)
fs/ocfs2/ocfs2.h +6 -1
@@ -286,6 +286,11 @@ enum ocfs2_mount_options#define OCFS2_OSB_ERROR_FS 0x0004#define OCFS2_DEFAULT_ATIME_QUANTUM 60 +enum ocfs2_recovery_state { +OCFS2_REC_ENABLED =0 , +OCFS2_REC_DISABLED , +}; +struct ocfs2_journal ;struct ocfs2_slot_info ;struct ocfs2_recovery_map ;
@@ -348,7 +353,7 @@ struct ocfs2_superstruct ocfs2_recovery_map *recovery_map;struct ocfs2_replay_map *replay_map;struct task_struct *recovery_thread_task; -int disable_recovery; +enum ocfs2_recovery_state recovery_state;wait_queue_head_t checkpoint_event;struct ocfs2_journal *journal;unsigned long osb_commit_interval;
Greg Kroah-Hartman
maintainerPATCH 67/270 ocfs2: implement handshaking with ocfs2 recovery thread
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit 8f947e0fd595951460f5a6e1ac29baa82fa02eab upstream.
We will need ocfs2 recovery thread to acknowledge transitions of recovery_state when disabling particular types of recovery. This is similar to what currently happens when disabling recovery completely, just more general. Implement the handshake and use it for exit from recovery.
--- fs/ocfs2/journal.c | 52 +++++++++++++++++++++++++++++++++++----------------- fs/ocfs2/ocfs2.h | 4 ++++ 2 files changed, 39 insertions(+), 17 deletions(-)
fs/ocfs2/journal.c +35 -17
@@ -194,31 +194,48 @@ int ocfs2_recovery_init(struct ocfs2_supreturn 0 ; } -/* we can't grab the goofy sem lock from inside wait_event, so we use -* memory barriers to make sure that we'll see the null task before -* being woken up */ static int ocfs2_recovery_thread_running (struct ocfs2_super *osb) { -mb ();return osb->recovery_thread_task !=NULL ; } -void ocfs2_recovery_exit (struct ocfs2_super *osb) +static void ocfs2_recovery_disable (struct ocfs2_super *osb, +enum ocfs2_recovery_state state) { -struct ocfs2_recovery_map *rm; - -/* disable any new recovery threads and wait for any currently -* running ones to exit. Do this before setting the vol_state. */ mutex_lock (&osb->recovery_lock); - osb->recovery_state =OCFS2_REC_DISABLED ; +/* +* If recovery thread is not running, we can directly transition to +* final state. +*/ +if (!ocfs2_recovery_thread_running (osb)) { + osb->recovery_state = state +1 ; + goto out_lock; + } + osb->recovery_state = state; +/* Wait for recovery thread to acknowledge state transition */ +wait_event_cmd (osb->recovery_event, + !ocfs2_recovery_thread_running (osb) || + osb->recovery_state >= state +1 , +mutex_unlock (&osb->recovery_lock), +mutex_lock (&osb->recovery_lock)); +out_lock:mutex_unlock (&osb->recovery_lock); -wait_event (osb->recovery_event, !ocfs2_recovery_thread_running (osb)); -/* At this point, we know that no more recovery threads can be -* launched, so wait for any recovery completion work to -* complete. */ +/* +* At this point we know that no more recovery work can be queued so +* wait for any recovery completion work to complete. +*/ if (osb->ocfs2_wq)flush_workqueue (osb->ocfs2_wq); +} + +void ocfs2_recovery_exit (struct ocfs2_super *osb) +{ +struct ocfs2_recovery_map *rm; + +/* disable any new recovery threads and wait for any currently +* running ones to exit. Do this before setting the vol_state. */ +ocfs2_recovery_disable (osb,OCFS2_REC_WANT_DISABLE );/* * Now that recovery is shut down, and the osb is about to be
@@ -1509,7 +1526,8 @@ bail:ocfs2_free_replay_slots (osb); osb->recovery_thread_task =NULL ; -mb ();/* sync with ocfs2_recovery_thread_running */ +if (osb->recovery_state ==OCFS2_REC_WANT_DISABLE ) + osb->recovery_state =OCFS2_REC_DISABLED ;wake_up (&osb->recovery_event);mutex_unlock (&osb->recovery_lock);
@@ -1528,13 +1546,13 @@ void ocfs2_recovery_thread(struct ocfs2_int was_set =-1 ;mutex_lock (&osb->recovery_lock); -if (osb->recovery_state <OCFS2_REC_DISABLED ) +if (osb->recovery_state <OCFS2_REC_WANT_DISABLE ) was_set =ocfs2_recovery_map_set (osb, node_num);trace_ocfs2_recovery_thread (node_num, osb->node_num, osb->recovery_state, osb->recovery_thread_task, was_set); -if (osb->recovery_state ==OCFS2_REC_DISABLED ) +if (osb->recovery_state >=OCFS2_REC_WANT_DISABLE ) goto out;if (osb->recovery_thread_task)
fs/ocfs2/ocfs2.h +4 -0
@@ -288,6 +288,10 @@ enum ocfs2_mount_optionsenum ocfs2_recovery_state {OCFS2_REC_ENABLED =0 , +OCFS2_REC_WANT_DISABLE , +/* +* Must be OCFS2_REC_WANT_DISABLE + 1 for ocfs2_recovery_exit() to work +*/ OCFS2_REC_DISABLED , };
Greg Kroah-Hartman
maintainerPATCH 68/270 ocfs2: stop quota recovery before disabling quotas
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit fcaf3b2683b05a9684acdebda706a12025a6927a upstream.
Currently quota recovery is synchronized with unmount using sb->s_umount semaphore. That is however prone to deadlocks because flush_workqueue(osb->ocfs2_wq) called from umount code can wait for quota recovery to complete while ocfs2_finish_quota_recovery() waits for sb->s_umount semaphore.
Grabbing of sb->s_umount semaphore in ocfs2_finish_quota_recovery() is only needed to protect that function from disabling of quotas from ocfs2_dismount_volume(). Handle this problem by disabling quota recovery early during unmount in ocfs2_dismount_volume() instead so that we can drop acquisition of sb->s_umount from ocfs2_finish_quota_recovery().
--- fs/ocfs2/journal.c | 20 ++++++++++++++++++-- fs/ocfs2/journal.h | 1 + fs/ocfs2/ocfs2.h | 6 ++++++ fs/ocfs2/quota_local.c | 9 ++------- fs/ocfs2/super.c | 3 +++ 5 files changed, 30 insertions(+), 9 deletions(-)
fs/ocfs2/journal.c +18 -2
@@ -229,6 +229,11 @@ out_lock:flush_workqueue (osb->ocfs2_wq); } +void ocfs2_recovery_disable_quota (struct ocfs2_super *osb) +{ +ocfs2_recovery_disable (osb,OCFS2_REC_QUOTA_WANT_DISABLE ); +} +void ocfs2_recovery_exit (struct ocfs2_super *osb) {struct ocfs2_recovery_map *rm;
@@ -1429,6 +1434,18 @@ static int __ocfs2_recovery_thread(void } } restart: +if (quota_enabled) { +mutex_lock (&osb->recovery_lock); +/* Confirm that recovery thread will no longer recover quotas */ +if (osb->recovery_state ==OCFS2_REC_QUOTA_WANT_DISABLE ) { + osb->recovery_state =OCFS2_REC_QUOTA_DISABLED ; +wake_up (&osb->recovery_event); + } +if (osb->recovery_state >=OCFS2_REC_QUOTA_DISABLED ) + quota_enabled =0 ; +mutex_unlock (&osb->recovery_lock); + } + status =ocfs2_super_lock (osb,1 );if (status <0 ) {mlog_errno (status);
@@ -1532,8 +1549,7 @@ bail:mutex_unlock (&osb->recovery_lock); -if (quota_enabled) -kfree (rm_quota); +kfree (rm_quota);/* no one is callint kthread_stop() for us so the kthread() api * requires that we call do_exit(). And it isn't exported, but
fs/ocfs2/journal.h +1 -0
@@ -150,6 +150,7 @@ void ocfs2_wait_for_recovery(struct ocfsint ocfs2_recovery_init (struct ocfs2_super *osb);void ocfs2_recovery_exit (struct ocfs2_super *osb); +void ocfs2_recovery_disable_quota (struct ocfs2_super *osb);int ocfs2_compute_replay_slots (struct ocfs2_super *osb);void ocfs2_free_replay_slots (struct ocfs2_super *osb);
fs/ocfs2/ocfs2.h +6 -0
@@ -288,6 +288,12 @@ enum ocfs2_mount_optionsenum ocfs2_recovery_state {OCFS2_REC_ENABLED =0 , +OCFS2_REC_QUOTA_WANT_DISABLE , +/* +* Must be OCFS2_REC_QUOTA_WANT_DISABLE + 1 for +* ocfs2_recovery_disable_quota() to work. +*/ +OCFS2_REC_QUOTA_DISABLED ,OCFS2_REC_WANT_DISABLE ,/* * Must be OCFS2_REC_WANT_DISABLE + 1 for ocfs2_recovery_exit() to work
fs/ocfs2/quota_local.c +2 -7
@@ -453,8 +453,7 @@ out:/* Sync changes in local quota file into global quota file and * reinitialize local quota file. -* The function expects local quota file to be already locked and -* s_umount locked in shared mode. */ +* The function expects local quota file to be already locked. */ static int ocfs2_recover_local_quota_file (struct inode *lqinode,int type,struct ocfs2_quota_recovery *rec)
@@ -585,7 +584,6 @@ int ocfs2_finish_quota_recovery(struct o {unsigned int ino[OCFS2_MAXQUOTAS ] = {LOCAL_USER_QUOTA_SYSTEM_INODE ,LOCAL_GROUP_QUOTA_SYSTEM_INODE }; -struct super_block *sb = osb->sb;struct ocfs2_local_disk_dqinfo *ldinfo;struct buffer_head *bh;handle_t *handle;
@@ -597,7 +595,6 @@ int ocfs2_finish_quota_recovery(struct oprintk (KERN_NOTICE "ocfs2: Finishing quota recovery on device (%s) for " "slot %u\n" , osb->dev_str, slot_num); -down_read (&sb->s_umount);for (type =0 ; type <OCFS2_MAXQUOTAS ; type++) {if (list_empty (&(rec->r_list[type])))continue ;
@@ -674,7 +671,6 @@ out_put:break ; } out: -up_read (&sb->s_umount);kfree (rec);return status; }
@@ -840,8 +836,7 @@ static int ocfs2_local_free_info(structocfs2_release_local_quota_bitmaps (&oinfo->dqi_chunk);/* -* s_umount held in exclusive mode protects us against racing with -* recovery thread... +* ocfs2_dismount_volume() has already aborted quota recovery... */ if (oinfo->dqi_rec) {ocfs2_free_quota_recovery (oinfo->dqi_rec);
fs/ocfs2/super.c +3 -0
@@ -1876,6 +1876,9 @@ static void ocfs2_dismount_volume(struct/* Orphan scan should be stopped as early as possible */ ocfs2_orphan_scan_stop (osb); +/* Stop quota recovery so that we can disable quotas */ +ocfs2_recovery_disable_quota (osb); +ocfs2_disable_quotas (osb);/* All dquots should be freed by now */
Greg Kroah-Hartman
maintainerPATCH 69/270 usb: gadget: tegra-xudc: ACK ST_RC after clearing CTRL_RUN
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Chang <[email protected]>
commit 59820fde001500c167342257650541280c622b73 upstream.
We identified a bug where the ST_RC bit in the status register was not being acknowledged after clearing the CTRL_RUN bit in the control register. This could lead to unexpected behavior in the USB gadget drivers.
This patch resolves the issue by adding the necessary code to explicitly acknowledge ST_RC after clearing CTRL_RUN based on the programming sequence, ensuring proper state transition.
--- drivers/usb/gadget/udc/tegra-xudc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/gadget/udc/tegra-xudc.c +4 -0
@@ -1737,6 +1737,10 @@ static int __tegra_xudc_ep_disable(struc val =xudc_readl (xudc,CTRL ); val &= ~CTRL_RUN ;xudc_writel (xudc, val,CTRL ); + + val =xudc_readl (xudc,ST ); +if (val &ST_RC ) +xudc_writel (xudc,ST_RC ,ST ); }dev_info (xudc->dev,"ep %u disabled\n" , ep->index);
Greg Kroah-Hartman
maintainerPATCH 70/270 usb: host: tegra: Prevent host controller crash when OTG port is used
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jim Lin <[email protected]>
commit 732f35cf8bdfece582f6e4a9c659119036577308 upstream.
When a USB device is connected to the OTG port, the tegra_xhci_id_work() routine transitions the PHY to host mode and calls xhci_hub_control() with the SetPortFeature command to enable port power.
In certain cases, the XHCI controller may be in a low-power state when this operation occurs. If xhci_hub_control() is invoked while the controller is suspended, the PORTSC register may return 0xFFFFFFFF, indicating a read failure. This causes xhci_hc_died() to be triggered, leading to host controller shutdown.
Example backtrace:
[ 105.445736] Workqueue: events tegra_xhci_id_work [ 105.445747] dump_backtrace+0x0/0x1e8 [ 105.445759] xhci_hc_died.part.48+0x40/0x270 [ 105.445769] tegra_xhci_set_port_power+0xc0/0x240 [ 105.445774] tegra_xhci_id_work+0x130/0x240
To prevent this, ensure the controller is fully resumed before interacting with hardware registers by calling pm_runtime_get_sync() prior to the host mode transition and xhci_hub_control().
--- drivers/usb/host/xhci-tegra.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/host/xhci-tegra.c +3 -0
@@ -1178,6 +1178,7 @@ static void tegra_xhci_id_work(struct wo tegra->otg_usb3_port =tegra_xusb_padctl_get_usb3_companion (tegra->padctl, tegra->otg_usb2_port); +pm_runtime_get_sync (tegra->dev);if (tegra->host_mode) {/* switch to host mode */ if (tegra->otg_usb3_port >=0 ) {
@@ -1207,6 +1208,7 @@ static void tegra_xhci_id_work(struct wo }tegra_xhci_set_port_power (tegra, true, true); +pm_runtime_mark_last_busy (tegra->dev); }else {if (tegra->otg_usb3_port >=0 )
@@ -1214,6 +1216,7 @@ static void tegra_xhci_id_work(struct wotegra_xhci_set_port_power (tegra, true, false); } +pm_runtime_put_autosuspend (tegra->dev); } static int tegra_xusb_get_usb2_port(struct tegra_xusb *tegra,
Greg Kroah-Hartman
maintainerPATCH 71/270 usb: typec: tcpm: delay SNK_TRY_WAIT_DEBOUNCE to SRC_TRYWAIT transition
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: RD Babiera <[email protected]>
commit e918d3959b5ae0e793b8f815ce62240e10ba03a4 upstream.
This patch fixes Type-C Compliance Test TD 4.7.6 - Try.SNK DRP Connect SNKAS.
The compliance tester moves into SNK_UNATTACHED during toggling and expects the PUT to apply Rp after tPDDebounce of detection. If the port is in SNK_TRY_WAIT_DEBOUNCE, it will move into SRC_TRYWAIT immediately and apply Rp. This violates TD 4.7.5.V.3, where the tester confirms that the PUT attaches Rp after the transitions to Unattached.SNK for tPDDebounce.
Change the tcpm_set_state delay between SNK_TRY_WAIT_DEBOUNCE and SRC_TRYWAIT to tPDDebounce.
--- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpm.c +1 -1
@@ -4019,7 +4019,7 @@ static void _tcpm_cc_change(struct tcpm_case SNK_TRY_WAIT_DEBOUNCE :if (!tcpm_port_is_sink (port)) { port->max_wait =0 ; -tcpm_set_state (port,SRC_TRYWAIT ,0 ); +tcpm_set_state (port,SRC_TRYWAIT ,PD_T_PD_DEBOUNCE ); }break ;case SRC_TRY_WAIT :
Greg Kroah-Hartman
maintainerPATCH 72/270 usb: typec: ucsi: displayport: Fix NULL pointer access
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrei Kuchynski <[email protected]>
commit 312d79669e71283d05c05cc49a1a31e59e3d9e0e upstream.
This patch ensures that the UCSI driver waits for all pending tasks in the ucsi_displayport_work workqueue to finish executing before proceeding with the partner removal.
--- drivers/usb/typec/ucsi/displayport.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/typec/ucsi/displayport.c +2 -0
@@ -270,6 +270,8 @@ void ucsi_displayport_remove_partner(strif (!dp)return ; +cancel_work_sync (&dp->work); + dp->data.conf =0 ; dp->data.status =0 ; dp->initialized = false;
Greg Kroah-Hartman
maintainerPATCH 73/270 USB: usbtmc: use interruptible sleep in usbtmc_read
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit 054c5145540e5ad5b80adf23a5e3e2fc281fb8aa upstream.
usbtmc_read() calls usbtmc_generic_read() which uses interruptible sleep, but usbtmc_read() itself uses uninterruptble sleep for mutual exclusion between threads. That makes no sense.
Both should use interruptible sleep.
--- drivers/usb/class/usbtmc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/usb/class/usbtmc.c +5 -1
@@ -1350,7 +1350,10 @@ static ssize_t usbtmc_read(struct file *if (!buffer)return -ENOMEM ; -mutex_lock (&data->io_mutex); + retval =mutex_lock_interruptible (&data->io_mutex); +if (retval <0 ) + goto exit_nolock; +if (data->zombie) { retval = -ENODEV ; goto exit;
@@ -1473,6 +1476,7 @@ static ssize_t usbtmc_read(struct file * exit:mutex_unlock (&data->io_mutex); +exit_nolock:kfree (buffer);return retval; }
Greg Kroah-Hartman
maintainerPATCH 74/270 usb: usbtmc: Fix erroneous get_stb ioctl error returns
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Penkler <[email protected]>
commit cac01bd178d6a2a23727f138d647ce1a0e8a73a1 upstream.
wait_event_interruptible_timeout returns a long
The return was being assigned to an int causing an integer overflow when the remaining jiffies > INT_MAX resulting in random error returns.
Use a long return value and convert to int ioctl return only on error.
When the return value of wait_event_interruptible_timeout was <= INT_MAX the number of remaining jiffies was returned which has no meaning for the user. Return 0 on success.
--- drivers/usb/class/usbtmc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/usb/class/usbtmc.c +8 -4
@@ -485,6 +485,7 @@ static int usbtmc488_ioctl_read_stb(struu8 tag;__u8 stb;int rv; +long wait_rv;dev_dbg (dev,"Enter ioctl_read_stb iin_ep_present: %d\n" , data->iin_ep_present);
@@ -527,16 +528,17 @@ static int usbtmc488_ioctl_read_stb(stru }if (data->iin_ep_present) { - rv =wait_event_interruptible_timeout ( + wait_rv =wait_event_interruptible_timeout ( data->waitq,atomic_read (&data->iin_data_valid) !=0 , file_data->timeout); -if (rv <0 ) { -dev_dbg (dev,"wait interrupted %d\n" , rv); +if (wait_rv <0 ) { +dev_dbg (dev,"wait interrupted %ld\n" , wait_rv); + rv = wait_rv; goto exit; } -if (rv ==0 ) { +if (wait_rv ==0 ) {dev_dbg (dev,"wait timed out\n" ); rv = -ETIMEDOUT ; goto exit;
@@ -556,6 +558,8 @@ static int usbtmc488_ioctl_read_stb(stru rv =put_user (stb, (__u8 __user *)arg);dev_dbg (dev,"stb:0x%02x received %d\n" , (unsigned int )stb, rv); + rv =0 ; + exit:/* bump interrupt bTag */ data->iin_bTag +=1 ;
Greg Kroah-Hartman
maintainerPATCH 75/270 usb: usbtmc: Fix erroneous wait_srq ioctl return
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Penkler <[email protected]>
commit a9747c9b8b59ab4207effd20eb91a890acb44e16 upstream.
wait_event_interruptible_timeout returns a long
The return was being assigned to an int causing an integer overflow when the remaining jiffies > INT_MAX resulting in random error returns.
Use a long return value, converting to the int ioctl return only on error.
--- drivers/usb/class/usbtmc.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
drivers/usb/class/usbtmc.c +11 -12
@@ -576,9 +576,9 @@ static int usbtmc488_ioctl_wait_srq(stru {struct usbtmc_device_data *data = file_data->data;struct device *dev = &data->intf->dev; -int rv;u32 timeout;unsigned long expire; +long wait_rv;if (!data->iin_ep_present) {dev_dbg (dev,"no interrupt endpoint present\n" );
@@ -592,25 +592,24 @@ static int usbtmc488_ioctl_wait_srq(strumutex_unlock (&data->io_mutex); - rv =wait_event_interruptible_timeout ( - data->waitq, -atomic_read (&file_data->srq_asserted) !=0 || -atomic_read (&file_data->closing), - expire); + wait_rv =wait_event_interruptible_timeout ( + data->waitq, +atomic_read (&file_data->srq_asserted) !=0 || +atomic_read (&file_data->closing), + expire);mutex_lock (&data->io_mutex);/* Note! disconnect or close could be called in the meantime */ if (atomic_read (&file_data->closing) || data->zombie) - rv = -ENODEV ; +return -ENODEV ; -if (rv <0 ) { -/* dev can be invalid now! */ -pr_debug ("%s - wait interrupted %d\n" , __func__, rv); -return rv; +if (wait_rv <0 ) { +dev_dbg (dev,"%s - wait interrupted %ld\n" , __func__, wait_rv); +return wait_rv; } -if (rv ==0 ) { +if (wait_rv ==0 ) {dev_dbg (dev,"%s - wait timed out\n" , __func__);return -ETIMEDOUT ; }
Greg Kroah-Hartman
maintainerPATCH 76/270 usb: usbtmc: Fix erroneous generic_read ioctl return
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Penkler <[email protected]>
commit 4e77d3ec7c7c0d9535ccf1138827cb9bb5480b9b upstream.
wait_event_interruptible_timeout returns a long
The return value was being assigned to an int causing an integer overflow when the remaining jiffies > INT_MAX which resulted in random error returns.
Use a long return value, converting to the int ioctl return only on error.
--- drivers/usb/class/usbtmc.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/usb/class/usbtmc.c +12 -6
@@ -803,6 +803,7 @@ static ssize_t usbtmc_generic_read(strucunsigned long expire;int bufcount =1 ;int again =0 ; +long wait_rv;/* mutex already locked */
@@ -915,19 +916,24 @@ static ssize_t usbtmc_generic_read(strucif (!(flags &USBTMC_FLAG_ASYNC )) {dev_dbg (dev,"%s: before wait time %lu\n" , __func__, expire); - retval =wait_event_interruptible_timeout ( + wait_rv =wait_event_interruptible_timeout ( file_data->wait_bulk_in,usbtmc_do_transfer (file_data), expire); -dev_dbg (dev,"%s: wait returned %d\n" , - __func__, retval); +dev_dbg (dev,"%s: wait returned %ld\n" , + __func__, wait_rv); -if (retval <=0 ) { -if (retval ==0 ) - retval = -ETIMEDOUT ; +if (wait_rv <0 ) { + retval = wait_rv; goto error; } + +if (wait_rv ==0 ) { + retval = -ETIMEDOUT ; + goto error; + } + } urb =usb_get_from_anchor (&file_data->in_anchor);
Greg Kroah-Hartman
maintainerPATCH 77/270 types: Complement the aligned types with signed 64-bit one
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit e4ca0e59c39442546866f3dd514a3a5956577daf ]
Some user may want to use aligned signed 64-bit type. Provide it for them.
Stable-dep-of: 5097eaae98e5 ("iio: adc: dln2: Use aligned_s64 for timestamp")
--- include/linux/types.h | 3 ++- include/uapi/linux/types.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/types.h +2 -1
@@ -109,8 +109,9 @@ typedef u64 u_int64_t;typedef s64 int64_t ;#endif -/* this is a special 64bit data type that is 8-byte aligned */ +/* These are the special 64-bit data types that are 8-byte aligned */ #define aligned_u64 __aligned_u64 +#define aligned_s64 __aligned_s64#define aligned_be64 __aligned_be64#define aligned_le64 __aligned_le64
include/uapi/linux/types.h +1 -0
@@ -46,6 +46,7 @@ typedef __u32 __bitwise __wsum;* No conversions are necessary between 32-bit user-space and a 64-bit kernel. */ #define __aligned_u64 __u64 __attribute__((aligned(8))) +#define __aligned_s64 __s64 __attribute__((aligned(8)))#define __aligned_be64 __be64 __attribute__((aligned(8)))#define __aligned_le64 __le64 __attribute__((aligned(8)))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/270 iio: adc: dln2: Use aligned_s64 for timestamp
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Cameron <[email protected]>
[ Upstream commit 5097eaae98e53f9ab9d35801c70da819b92ca907 ]
Here the lack of marking allows the overall structure to not be sufficiently aligned resulting in misplacement of the timestamp in iio_push_to_buffers_with_timestamp(). Use aligned_s64 to force the alignment on all architectures.
--- drivers/iio/adc/dln2-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/dln2-adc.c +1 -1
@@ -483,7 +483,7 @@ static irqreturn_t dln2_adc_trigger_h(int irq, void *p)struct iio_dev *indio_dev = pf->indio_dev;struct {__le16 values[DLN2_ADC_MAX_CHANNELS ]; -int64_t timestamp_space; +aligned_s64 timestamp_space; } data;struct dln2_adc_get_all_vals dev_data;struct dln2_adc *dln2 =iio_priv (indio_dev);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/270 MIPS: Fix MAX_REG_OFFSET
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thorsten Blum <[email protected]>
[ Upstream commit c44572e0cc13c9afff83fd333135a0aa9b27ba26 ]
Fix MAX_REG_OFFSET to point to the last register in 'pt_regs' and not to the marker itself, which could allow regs_get_register() to return an invalid offset.
--- arch/mips/include/asm/ptrace.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/include/asm/ptrace.h +2 -1
@@ -65,7 +65,8 @@ static inline void instruction_pointer_set(struct pt_regs *regs,/* Query offset/name of register from its name/offset */ extern int regs_query_register_offset (const char *name); -#define MAX_REG_OFFSET (offsetof(struct pt_regs, __last)) +#define MAX_REG_OFFSET \ + (offsetof(struct pt_regs, __last) - sizeof(unsigned long))/** * regs_get_register() - get register value from its offset
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/270 drm/panel: simple: Update timings for AUO G101EVN010
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kevin Baker <[email protected]>
[ Upstream commit 7c6fa1797a725732981f2d77711c867166737719 ]
Switch to panel timings based on datasheet for the AUO G101EVN01.0 LVDS panel. Default timings were tested on the panel.
Previous mode-based timings resulted in horizontal display shift.
--- drivers/gpu/drm/panel/panel-simple.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/panel/panel-simple.c +13 -12
@@ -964,27 +964,28 @@ static const struct panel_desc auo_g070vvn01 = { }, }; -static const struct drm_display_mode auo_g101evn010_mode = { - .clock =68930 , - .hdisplay =1280 , - .hsync_start =1280 +82 , - .hsync_end =1280 +82 +2 , - .htotal =1280 +82 +2 +84 , - .vdisplay =800 , - .vsync_start =800 +8 , - .vsync_end =800 +8 +2 , - .vtotal =800 +8 +2 +6 , +static const struct display_timing auo_g101evn010_timing = { + .pixelclock = {64000000 ,68930000 ,85000000 }, + .hactive = {1280 ,1280 ,1280 }, + .hfront_porch = {8 ,64 ,256 }, + .hback_porch = {8 ,64 ,256 }, + .hsync_len = {40 ,168 ,767 }, + .vactive = {800 ,800 ,800 }, + .vfront_porch = {4 ,8 ,100 }, + .vback_porch = {4 ,8 ,100 }, + .vsync_len = {8 ,16 ,223 }, };static const struct panel_desc auo_g101evn010 = { - .modes = &auo_g101evn010_mode, - .num_modes =1 , + .timings = &auo_g101evn010_timing, + .num_timings =1 , .bpc =6 , .size = { .width =216 , .height =135 , }, .bus_format =MEDIA_BUS_FMT_RGB666_1X7X3_SPWG , + .bus_flags =DRM_BUS_FLAG_DE_HIGH , .connector_type =DRM_MODE_CONNECTOR_LVDS , };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/270 nvme: unblock ctrl state transition for firmware update
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit 650415fca0a97472fdd79725e35152614d1aad76 ]
The original nvme subsystem design didn't have a CONNECTING state; the state machine allowed transitions from RESETTING to LIVE directly.
With the introduction of nvme fabrics the CONNECTING state was introduce. Over time the nvme-pci started to use the CONNECTING state as well.
Eventually, a bug fix for the nvme-fc started to depend that the only valid transition to LIVE was from CONNECTING. Though this change didn't update the firmware update handler which was still depending on RESETTING to LIVE transition.
The simplest way to address it for the time being is to switch into CONNECTING state before going to LIVE state.
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
@@ -4429,7 +4429,8 @@ static void nvme_fw_act_work(struct work_struct *work)msleep (100 ); } -if (!nvme_change_ctrl_state (ctrl,NVME_CTRL_LIVE )) +if (!nvme_change_ctrl_state (ctrl,NVME_CTRL_CONNECTING ) || + !nvme_change_ctrl_state (ctrl,NVME_CTRL_LIVE ))return ;nvme_start_queues (ctrl);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 82/270 do_umount(): add missing barrier before refcount checks in sync case
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
[ Upstream commit 65781e19dcfcb4aed1167d87a3ffcc2a0c071d47 ]
do_umount() analogue of the race fixed in 119e1ef80ecf "fix __legitimize_mnt()/mntput() race". Here we want to make sure that if __legitimize_mnt() doesn't notice our lock_mount_hash(), we will notice their refcount increment. Harder to hit than mntput_no_expire() one, fortunately, and consequences are milder (sync umount acting like umount -l on a rare race with RCU pathwalk hitting at just the wrong time instead of use-after-free galore mntput_no_expire() counterpart used to be hit). Still a bug...
--- fs/namespace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/namespace.c +2 -1
@@ -569,7 +569,7 @@ int __legitimize_mnt(struct vfsmount *bastard, unsigned seq)return 0 ; mnt =real_mount (bastard);mnt_add_count (mnt,1 ); -smp_mb ();// see mntput_no_expire() +smp_mb ();// see mntput_no_expire() and do_umount() if (likely (!read_seqretry (&mount_lock, seq)))return 0 ;if (bastard->mnt_flags &MNT_SYNC_UMOUNT ) {
@@ -1638,6 +1638,7 @@ static int do_umount(struct mount *mnt, int flags)umount_tree (mnt,UMOUNT_PROPAGATE ); retval =0 ; }else { +smp_mb ();// paired with __legitimize_mnt() shrink_submounts (mnt); retval = -EBUSY ;if (!propagate_mount_busy (mnt,2 )) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 83/270 platform/x86: asus-wmi: Fix wlan_ctrl_by_user detection
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit bfcfe6d335a967f8ea0c1980960e6f0205b5de6e ]
The wlan_ctrl_by_user detection was introduced by commit a50bd128f28c ("asus-wmi: record wlan status while controlled by userapp").
Quoting from that commit's commit message:
"""
When you call WMIMethod(DSTS, 0x00010011) to get WLAN status, it may return
(1) 0x00050001 (On)
(2) 0x00050000 (Off)
(3) 0x00030001 (On)
(4) 0x00030000 (Off)
(5) 0x00000002 (Unknown)
(1), (2) means that the model has hardware GPIO for WLAN, you can call WMIMethod(DEVS, 0x00010011, 1 or 0) to turn WLAN on/off.
(3), (4) means that the model doesn’t have hardware GPIO, you need to use API or driver library to turn WLAN on/off, and call WMIMethod(DEVS, 0x00010012, 1 or 0) to set WLAN LED status. After you set WLAN LED status, you can see the WLAN status is changed with WMIMethod(DSTS, 0x00010011). Because the status is recorded lastly (ex: Windows), you can use it for synchronization.
(5) means that the model doesn’t have WLAN device.
WLAN is the ONLY special case with upper rule.
"""
The wlan_ctrl_by_user flag should be set on 0x0003000? ((3), (4) above) return values, but the flag mistakenly also gets set on laptops with 0x0005000? ((1), (2)) return values. This is causing rfkill problems on laptops where 0x0005000? is returned.
Fix the check to only set the wlan_ctrl_by_user flag for 0x0003000? return values.
--- drivers/platform/x86/asus-wmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.c +2 -1
@@ -2739,7 +2739,8 @@ static int asus_wmi_add(struct platform_device *pdev) goto fail_leds;asus_wmi_get_devstate (asus,ASUS_WMI_DEVID_WLAN , &result); -if (result & (ASUS_WMI_DSTS_PRESENCE_BIT |ASUS_WMI_DSTS_USER_BIT )) +if ((result & (ASUS_WMI_DSTS_PRESENCE_BIT |ASUS_WMI_DSTS_USER_BIT )) == + (ASUS_WMI_DSTS_PRESENCE_BIT |ASUS_WMI_DSTS_USER_BIT )) asus->driver->wlan_ctrl_by_user =1 ;if (!(asus->driver->wlan_ctrl_by_user &&ashs_present ())) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/270 iio: adc: ad7768-1: Fix insufficient alignment of timestamp.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonathan Cameron <[email protected]>
[ Upstream commit ffbc26bc91c1f1eb3dcf5d8776e74cbae21ee13a ]
On architectures where an s64 is not 64-bit aligned, this may result insufficient alignment of the timestamp and the structure being too small. Use aligned_s64 to force the alignment.
--- drivers/iio/adc/ad7768-1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ad7768-1.c +1 -1
@@ -168,7 +168,7 @@ struct ad7768_state {union {struct {__be32 chan; -s64 timestamp; +aligned_s64 timestamp; } scan;__be32 d32;u8 d8[2 ];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 85/270 iio: chemical: sps30: use aligned_s64 for timestamp
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Lechner <[email protected]>
[ Upstream commit bb49d940344bcb8e2b19e69d7ac86f567887ea9a ]
Follow the pattern of other drivers and use aligned_s64 for the timestamp. This will ensure that the timestamp is correctly aligned on all architectures.
--- drivers/iio/chemical/sps30.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/chemical/sps30.c +1 -1
@@ -232,7 +232,7 @@ static irqreturn_t sps30_trigger_handler(int irq, void *p)int ret;struct {s32 data[4 ];/* PM1, PM2P5, PM4, PM10 */ -s64 ts; +aligned_s64 ts; } scan;mutex_lock (&state->lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 86/270 RDMA/rxe: Fix slab-use-after-free Read in rxe_queue_cleanup bug
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhu Yanjun <[email protected]>
[ Upstream commit f81b33582f9339d2dc17c69b92040d3650bb4bae ]
Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x7d/0xa0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcf/0x610 mm/kasan/report.c:489 kasan_report+0xb5/0xe0 mm/kasan/report.c:602 rxe_queue_cleanup+0xd0/0xe0 drivers/infiniband/sw/rxe/rxe_queue.c:195 rxe_cq_cleanup+0x3f/0x50 drivers/infiniband/sw/rxe/rxe_cq.c:132 __rxe_cleanup+0x168/0x300 drivers/infiniband/sw/rxe/rxe_pool.c:232 rxe_create_cq+0x22e/0x3a0 drivers/infiniband/sw/rxe/rxe_verbs.c:1109 create_cq+0x658/0xb90 drivers/infiniband/core/uverbs_cmd.c:1052 ib_uverbs_create_cq+0xc7/0x120 drivers/infiniband/core/uverbs_cmd.c:1095 ib_uverbs_write+0x969/0xc90 drivers/infiniband/core/uverbs_main.c:679 vfs_write fs/read_write.c:677 [inline] vfs_write+0x26a/0xcc0 fs/read_write.c:659 ksys_write+0x1b8/0x200 fs/read_write.c:731 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xaa/0x1b0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
In the function rxe_create_cq, when rxe_cq_from_init fails, the function rxe_cleanup will be called to handle the allocated resources. In fact, some memory resources have already been freed in the function rxe_cq_from_init. Thus, this problem will occur.
The solution is to let rxe_cleanup do all the work.
--- drivers/infiniband/sw/rxe/rxe_cq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/infiniband/sw/rxe/rxe_cq.c +1 -4
@@ -69,11 +69,8 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe, err =do_mmap_info (rxe, uresp ? &uresp->mi :NULL , udata, cq->queue->buf, cq->queue->buf_size, &cq->queue->ip); -if (err) { -vfree (cq->queue->buf); -kfree (cq->queue); +if (err)return err; - }if (uresp) cq->is_user =1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 87/270 nfs: handle failure of nfs_get_lock_context in unlock path
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Lingfeng <[email protected]>
[ Upstream commit c457dc1ec770a22636b473ce5d35614adfe97636 ]
When memory is insufficient, the allocation of nfs_lock_context in nfs_get_lock_context() fails and returns -ENOMEM. If we mistakenly treat an nfs4_unlockdata structure (whose l_ctx member has been set to -ENOMEM) as valid and proceed to execute rpc_run_task(), this will trigger a NULL pointer dereference in nfs4_locku_prepare. For example:
BUG: kernel NULL pointer dereference, address: 000000000000000c PGD 0 P4D 0 Oops: Oops: 0000 [#1] SMP PTI CPU: 15 UID: 0 PID: 12 Comm: kworker/u64:0 Not tainted 6.15.0-rc2-dirty #60 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 Workqueue: rpciod rpc_async_schedule RIP: 0010:nfs4_locku_prepare+0x35/0xc2 Code: 89 f2 48 89 fd 48 c7 c7 68 69 ef b5 53 48 8b 8e 90 00 00 00 48 89 f3 RSP: 0018:ffffbbafc006bdb8 EFLAGS: 00010246 RAX: 000000000000004b RBX: ffff9b964fc1fa00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: fffffffffffffff4 RDI: ffff9ba53fddbf40 RBP: ffff9ba539934000 R08: 0000000000000000 R09: ffffbbafc006bc38 R10: ffffffffb6b689c8 R11: 0000000000000003 R12: ffff9ba539934030 R13: 0000000000000001 R14: 0000000004248060 R15: ffffffffb56d1c30 FS: 0000000000000000(0000) GS:ffff9ba5881f0000(0000) knlGS:00000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000000c CR3: 000000093f244000 CR4: 00000000000006f0 Call Trace: <TASK> __rpc_execute+0xbc/0x480 rpc_async_schedule+0x2f/0x40 process_one_work+0x232/0x5d0 worker_thread+0x1da/0x3d0 ? __pfx_worker_thread+0x10/0x10 kthread+0x10d/0x240 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK> Modules linked in: CR2: 000000000000000c ---[ end trace 0000000000000000 ]---
Free the allocated nfs4_unlockdata when nfs_get_lock_context() fails and return NULL to terminate subsequent rpc_run_task, preventing NULL pointer dereference.
--- fs/nfs/nfs4proc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/nfs/nfs4proc.c +8 -1
@@ -6732,10 +6732,18 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl,struct nfs4_unlockdata *p;struct nfs4_state *state = lsp->ls_state;struct inode *inode = state->inode; +struct nfs_lock_context *l_ctx; p =kzalloc (sizeof (*p),GFP_NOFS );if (p ==NULL )return NULL ; + l_ctx =nfs_get_lock_context (ctx); +if (!IS_ERR (l_ctx)) { + p->l_ctx = l_ctx; + }else { +kfree (p); +return NULL ; + } p->arg.fh =NFS_FH (inode); p->arg.fl = &p->fl; p->arg.seqid = seqid;
@@ -6743,7 +6751,6 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl, p->lsp = lsp;/* Ensure we don't close file until we're done freeing locks! */ p->ctx =get_nfs_open_context (ctx); - p->l_ctx =nfs_get_lock_context (ctx);locks_init_lock (&p->fl);locks_copy_lock (&p->fl, fl); p->server =NFS_SERVER (inode);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 88/270 spi: loopback-test: Do not split 1024-byte hexdumps
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit a73fa3690a1f3014d6677e368dce4e70767a6ba2 ]
spi_test_print_hex_dump() prints buffers holding less than 1024 bytes in full. Larger buffers are truncated: only the first 512 and the last 512 bytes are printed, separated by a truncation message. The latter is confusing in case the buffer holds exactly 1024 bytes, as all data is printed anyway.
Fix this by printing buffers holding up to and including 1024 bytes in full.
--- drivers/spi/spi-loopback-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-loopback-test.c +1 -1
@@ -383,7 +383,7 @@ MODULE_LICENSE("GPL");static void spi_test_print_hex_dump (char *pre,const void *ptr,size_t len) {/* limit the hex_dump */ -if (len <1024 ) { +if (len <=1024 ) {print_hex_dump (KERN_INFO , pre,DUMP_PREFIX_OFFSET ,16 ,1 , ptr, len,0 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 89/270 net_sched: Flush gso_skb list too during ->change()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 2d3cbfd6d54a2c39ce3244f33f85c595844bd7b8 ]
Previously, when reducing a qdisc's limit via the ->change() operation, only the main skb queue was trimmed, potentially leaving packets in the gso_skb list. This could result in NULL pointer dereference when we only check sch->limit against sch->q.qlen.
This patch introduces a new helper, qdisc_dequeue_internal(), which ensures both the gso_skb list and the main queue are properly flushed when trimming excess packets. All relevant qdiscs (codel, fq, fq_codel, fq_pie, hhf, pie) are updated to use this helper in their ->change() routines.
--- include/net/sch_generic.h | 15 +++++++++++++++ net/sched/sch_codel.c | 2 +- net/sched/sch_fq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_fq_pie.c | 2 +- net/sched/sch_hhf.c | 2 +- net/sched/sch_pie.c | 2 +- 7 files changed, 21 insertions(+), 6 deletions(-)
include/net/sch_generic.h +15 -0
@@ -1036,6 +1036,21 @@ static inline struct sk_buff *__qdisc_dequeue_head(struct qdisc_skb_head *qh)return skb; } +static inline struct sk_buff *qdisc_dequeue_internal (struct Qdisc *sch,bool direct) +{ +struct sk_buff *skb; + + skb =__skb_dequeue (&sch->gso_skb); +if (skb) { + sch->q.qlen--; +return skb; + } +if (direct) +return __qdisc_dequeue_head (&sch->q); +else +return sch->dequeue (sch); +} +static inline struct sk_buff *qdisc_dequeue_head (struct Qdisc *sch) {struct sk_buff *skb =__qdisc_dequeue_head (&sch->q);
net/sched/sch_codel.c +1 -1
@@ -174,7 +174,7 @@ static int codel_change(struct Qdisc *sch, struct nlattr *opt, qlen = sch->q.qlen;while (sch->q.qlen > sch->limit) { -struct sk_buff *skb =__qdisc_dequeue_head (&sch->q); +struct sk_buff *skb =qdisc_dequeue_internal (sch, true); dropped +=qdisc_pkt_len (skb);qdisc_qstats_backlog_dec (sch, skb);
net/sched/sch_fq.c +1 -1
@@ -904,7 +904,7 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt,sch_tree_lock (sch); }while (sch->q.qlen > sch->limit) { -struct sk_buff *skb =fq_dequeue (sch); +struct sk_buff *skb =qdisc_dequeue_internal (sch, false);if (!skb)break ;
net/sched/sch_fq_codel.c +1 -1
@@ -429,7 +429,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt,while (sch->q.qlen > sch->limit || q->memory_usage > q->memory_limit) { -struct sk_buff *skb =fq_codel_dequeue (sch); +struct sk_buff *skb =qdisc_dequeue_internal (sch, false); q->cstats.drop_len +=qdisc_pkt_len (skb);rtnl_kfree_skbs (skb, skb);
net/sched/sch_fq_pie.c +1 -1
@@ -360,7 +360,7 @@ static int fq_pie_change(struct Qdisc *sch, struct nlattr *opt,/* Drop excess packets if new limit is lower */ while (sch->q.qlen > sch->limit) { -struct sk_buff *skb =fq_pie_qdisc_dequeue (sch); +struct sk_buff *skb =qdisc_dequeue_internal (sch, false); len_dropped +=qdisc_pkt_len (skb); num_dropped +=1 ;
net/sched/sch_hhf.c +1 -1
@@ -563,7 +563,7 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt, qlen = sch->q.qlen; prev_backlog = sch->qstats.backlog;while (sch->q.qlen > sch->limit) { -struct sk_buff *skb =hhf_dequeue (sch); +struct sk_buff *skb =qdisc_dequeue_internal (sch, false);rtnl_kfree_skbs (skb, skb); }
net/sched/sch_pie.c +1 -1
@@ -193,7 +193,7 @@ static int pie_change(struct Qdisc *sch, struct nlattr *opt,/* Drop excess packets if new limit is lower */ qlen = sch->q.qlen;while (sch->q.qlen > sch->limit) { -struct sk_buff *skb =__qdisc_dequeue_head (&sch->q); +struct sk_buff *skb =qdisc_dequeue_internal (sch, true); dropped +=qdisc_pkt_len (skb);qdisc_qstats_backlog_dec (sch, skb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 90/270 net: cadence: macb: Fix a possible deadlock in macb_halt_tx.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathieu Othacehe <[email protected]>
[ Upstream commit c92d6089d8ad7d4d815ebcedee3f3907b539ff1f ]
There is a situation where after THALT is set high, TGO stays high as well. Because jiffies are never updated, as we are in a context with interrupts disabled, we never exit that loop and have a deadlock.
That deadlock was noticed on a sama5d4 device that stayed locked for days.
Use retries instead of jiffies so that the timeout really works and we do not have a deadlock anymore.
--- drivers/net/ethernet/cadence/macb_main.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +6 -13
@@ -826,22 +826,15 @@ static void macb_update_stats(struct macb *bp)static int macb_halt_tx (struct macb *bp) { -unsigned long halt_time, timeout; -u32 status; +u32 status;macb_writel (bp,NCR ,macb_readl (bp,NCR ) |MACB_BIT (THALT )); - timeout = jiffies +usecs_to_jiffies (MACB_HALT_TIMEOUT ); -do { - halt_time = jiffies; - status =macb_readl (bp,TSR ); -if (!(status &MACB_BIT (TGO ))) -return 0 ; - -udelay (250 ); - }while (time_before (halt_time, timeout)); - -return -ETIMEDOUT ; +/* Poll TSR until TGO is cleared or timeout. */ +return read_poll_timeout_atomic (macb_readl, status, + !(status &MACB_BIT (TGO )), +250 ,MACB_HALT_TIMEOUT , false, + bp,TSR ); }static void macb_tx_unmap (struct macb *bp,struct macb_tx_skb *tx_skb)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 91/270 net: dsa: sja1105: discard incoming frames in BR_STATE_LISTENING
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
[ Upstream commit 498625a8ab2c8e1c9ab5105744310e8d6952cc01 ]
It has been reported that when under a bridge with stp_state=1, the logs get spammed with this message:
[ 251.734607] fsl_dpaa2_eth dpni.5 eth0: Couldn't decode source port
Further debugging shows the following info associated with packets:
source_port=-1, switch_id=-1, vid=-1, vbid=1
In other words, they are data plane packets which are supposed to be decoded by dsa_tag_8021q_find_port_by_vbid(), but the latter (correctly) refuses to do so, because no switch port is currently in BR_STATE_LEARNING or BR_STATE_FORWARDING - so the packet is effectively unexpected.
The error goes away after the port progresses to BR_STATE_LEARNING in 15 seconds (the default forward_time of the bridge), because then, dsa_tag_8021q_find_port_by_vbid() can correctly associate the data plane packets with a plausible bridge port in a plausible STP state.
Re-reading IEEE 802.1D-1990, I see the following:
"4.4.2 Learning: (...) The Forwarding Process shall discard received frames."
IEEE 802.1D-2004 further clarifies:
"DISABLED, BLOCKING, LISTENING, and BROKEN all correspond to the DISCARDING port state. While those dot1dStpPortStates serve to distinguish reasons for discarding frames, the operation of the Forwarding and Learning processes is the same for all of them. (...) LISTENING represents a port that the spanning tree algorithm has selected to be part of the active topology (computing a Root Port or Designated Port role) but is temporarily discarding frames to guard against loops or incorrect learning."
Well, this is not what the driver does - instead it sets mac[port].ingress = true.
To get rid of the log spam, prevent unexpected data plane packets to be received by software by discarding them on ingress in the LISTENING state.
In terms of blame attribution: the prints only date back to commit d7f9787a763f ("net: dsa: tag_8021q: add support for imprecise RX based on the VBID"). However, the settings would permit a LISTENING port to forward to a FORWARDING port, and the standard suggests that's not OK.
--- drivers/net/dsa/sja1105/sja1105_main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/dsa/sja1105/sja1105_main.c +1 -5
@@ -1644,6 +1644,7 @@ static void sja1105_bridge_stp_state_set(struct dsa_switch *ds, int port,switch (state) {case BR_STATE_DISABLED :case BR_STATE_BLOCKING : +case BR_STATE_LISTENING :/* From UM10944 description of DRPDTAG (why put this there?): * "Management traffic flows to the port regardless of the state * of the INGRESS flag". So BPDUs are still be allowed to pass.
@@ -1653,11 +1654,6 @@ static void sja1105_bridge_stp_state_set(struct dsa_switch *ds, int port, mac[port].egress = false; mac[port].dyn_learn = false;break ; -case BR_STATE_LISTENING : - mac[port].ingress = true; - mac[port].egress = false; - mac[port].dyn_learn = false; -break ;case BR_STATE_LEARNING : mac[port].ingress = true; mac[port].egress = false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 92/270 ALSA: sh: SND_AICA should depend on SH_DMA_API
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 66e48ef6ef506c89ec1b3851c6f9f5f80b5835ff ]
If CONFIG_SH_DMA_API=n:
WARNING: unmet direct dependencies detected for G2_DMA
Depends on [n]: SH_DREAMCAST [=y] && SH_DMA_API [=n]
Selected by [y]:
- SND_AICA [=y] && SOUND [=y] && SND [=y] && SND_SUPERH [=y] && SH_DREAMCAST [=y]
SND_AICA selects G2_DMA. As the latter depends on SH_DMA_API, the former should depend on SH_DMA_API, too.
--- sound/sh/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/sh/Kconfig +1 -1
@@ -14,7 +14,7 @@ if SND_SUPERH config SND_AICA tristate "Dreamcast Yamaha AICA sound" - depends on SH_DREAMCAST + depends on SH_DREAMCAST && SH_DMA_API select SND_PCM select G2_DMA help
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 93/270 qlcnic: fix memory leak in qlcnic_sriov_channel_cfg_cmd()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdun Nihaal <[email protected]>
[ Upstream commit 9d8a99c5a7c7f4f7eca2c168a4ec254409670035 ]
In one of the error paths in qlcnic_sriov_channel_cfg_cmd(), the memory allocated in qlcnic_sriov_alloc_bc_mbx_args() for mailbox arguments is not freed. Fix that by jumping to the error path that frees them, by calling qlcnic_free_mbx_args(). This was found using static analysis.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +5 -2
@@ -1485,8 +1485,11 @@ static int qlcnic_sriov_channel_cfg_cmd(struct qlcnic_adapter *adapter, u8 cmd_o } cmd_op = (cmd.rsp.arg[0 ] &0xff ); -if (cmd.rsp.arg[0 ] >>25 ==2 ) -return 2 ; +if (cmd.rsp.arg[0 ] >>25 ==2 ) { + ret =2 ; + goto out; + } +if (cmd_op ==QLCNIC_BC_CMD_CHANNEL_INIT )set_bit (QLC_BC_VF_STATE , &vf->state);else
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/270 NFSv4/pnfs: Reset the layout state after a layoutreturn
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 6d6d7f91cc8c111d40416ac9240a3bb9396c5235 ]
If there are still layout segments in the layout plh_return_lsegs list after a layout return, we should be resetting the state to ensure they eventually get returned as well.
--- fs/nfs/pnfs.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/nfs/pnfs.c +9 -0
@@ -733,6 +733,14 @@ pnfs_mark_matching_lsegs_invalid(struct pnfs_layout_hdr *lo,return remaining; } +static void pnfs_reset_return_info (struct pnfs_layout_hdr *lo) +{ +struct pnfs_layout_segment *lseg; + +list_for_each_entry (lseg, &lo->plh_return_segs, pls_list) +pnfs_set_plh_return_info (lo, lseg->pls_range.iomode,0 ); +} + static void pnfs_free_returned_lsegs(struct pnfs_layout_hdr *lo, struct list_head *free_me,
@@ -1183,6 +1191,7 @@ void pnfs_layoutreturn_free_lsegs(struct pnfs_layout_hdr *lo,pnfs_mark_matching_lsegs_invalid (lo, &freeme, range, seq);pnfs_free_returned_lsegs (lo, &freeme, range, seq);pnfs_set_layout_stateid (lo, stateid,NULL , true); +pnfs_reset_return_info (lo); }else pnfs_mark_layout_stateid_invalid (lo, &freeme); out_unlock:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 95/270 dmaengine: Revert "dmaengine: dmatest: Fix dmatest waiting less when interrupted"
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Lynch <[email protected]>
commit df180e65305f8c1e020d54bfc2132349fd693de1 upstream.
Several issues with this change:
* The analysis is flawed and it's unclear what problem is being fixed. There is no difference between wait_event_freezable_timeout() and wait_event_timeout() with respect to device interrupts. And of course "the interrupt notifying the finish of an operation happens during wait_event_freezable_timeout()" -- that's how it's supposed to work.
* The link at the "Closes:" tag appears to be an unrelated use-after-free in idxd.
* It introduces a regression: dmatest threads are meant to be freezable and this change breaks that.
See discussion here:
https://lore.kernel.org/dmaengine/[email protected]/
--- drivers/dma/dmatest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/dmatest.c +3 -3
@@ -825,9 +825,9 @@ static int dmatest_func(void *data) }else {dma_async_issue_pending (chan); -wait_event_timeout (thread->done_wait, - done->done, -msecs_to_jiffies (params->timeout)); +wait_event_freezable_timeout (thread->done_wait, + done->done, +msecs_to_jiffies (params->timeout)); status =dma_async_is_tx_complete (chan, cookie,NULL ,NULL );
Greg Kroah-Hartman
maintainerPATCH 96/270 ACPI: PPTT: Fix processor subtable walk
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Linton <[email protected]>
commit adfab6b39202481bb43286fff94def4953793fdb upstream.
The original PPTT code had a bug where the processor subtable length was not correctly validated when encountering a truncated acpi_pptt_processor node.
Commit 7ab4f0e37a0f4 ("ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls") attempted to fix this by validating the size is as large as the acpi_pptt_processor node structure. This introduced a regression where the last processor node in the PPTT table is ignored if it doesn't contain any private resources. That results errors like:
ACPI PPTT: PPTT table found, but unable to locate core XX (XX)
ACPI: SPE must be homogeneous
Furthermore, it fails in a common case where the node length isn't equal to the acpi_pptt_processor structure size, leaving the original bug in a modified form.
Correct the regression by adjusting the loop termination conditions as suggested by the bug reporters. An additional check performed after the subtable node type is detected, validates the acpi_pptt_processor node is fully contained in the PPTT table. Repeating the check in acpi_pptt_leaf_node() is largely redundant as the node is already known to be fully contained in the table.
The case where a final truncated node's parent property is accepted, but the node itself is rejected should not be considered a bug.
--- drivers/acpi/pptt.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/acpi/pptt.c +8 -3
@@ -219,16 +219,18 @@ static int acpi_pptt_leaf_node(struct ac sizeof(struct acpi_table_pptt)); proc_sz =sizeof (struct acpi_pptt_processor ); -while ((unsigned long )entry + proc_sz < table_end) { +/* ignore subtable types that are smaller than a processor node */ +while ((unsigned long )entry + proc_sz <= table_end) { cpu_node = (struct acpi_pptt_processor *)entry; +if (entry->type ==ACPI_PPTT_TYPE_PROCESSOR && cpu_node->parent == node_entry)return 0 ;if (entry->length ==0 )return 0 ; + entry = ACPI_ADD_PTR(struct acpi_subtable_header, entry, entry->length); - }return 1 ; }
@@ -261,15 +263,18 @@ static struct acpi_pptt_processor *acpi_ proc_sz =sizeof (struct acpi_pptt_processor );/* find the processor structure associated with this cpuid */ -while ((unsigned long )entry + proc_sz < table_end) { +while ((unsigned long )entry + proc_sz <= table_end) { cpu_node = (struct acpi_pptt_processor *)entry;if (entry->length ==0 ) {pr_warn ("Invalid zero length subtable\n" );break ; } +/* entry->length may not equal proc_sz, revalidate the processor structure length */ if (entry->type ==ACPI_PPTT_TYPE_PROCESSOR && acpi_cpu_id == cpu_node->acpi_processor_id && + (unsigned long )entry + entry->length <= table_end && + entry->length == proc_sz + cpu_node->number_of_priv_resources *sizeof (u32) &&acpi_pptt_leaf_node (table_hdr, cpu_node)) {return (struct acpi_pptt_processor *)entry; }
Greg Kroah-Hartman
maintainerPATCH 97/270 ALSA: es1968: Add error handling for snd_pcm_hw_constraint_pow2()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
commit 9e000f1b7f31684cc5927e034360b87ac7919593 upstream.
The function snd_es1968_capture_open() calls the function snd_pcm_hw_constraint_pow2(), but does not check its return value. A proper implementation can be found in snd_cx25821_pcm_open().
Add error handling for snd_pcm_hw_constraint_pow2() and propagate its error code.
--- sound/pci/es1968.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/pci/es1968.c +4 -2
@@ -1573,7 +1573,7 @@ static int snd_es1968_capture_open(strucstruct snd_pcm_runtime *runtime = substream->runtime;struct es1968 *chip =snd_pcm_substream_chip (substream);struct esschan *es; -int apu1, apu2; +int err, apu1, apu2; apu1 =snd_es1968_alloc_apu_pair (chip,ESM_APU_PCM_CAPTURE );if (apu1 <0 )
@@ -1616,7 +1616,9 @@ static int snd_es1968_capture_open(struc runtime->hw = snd_es1968_capture; runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =calc_available_memory_size (chip) -1024 ;/* keep MIXBUF size */ -snd_pcm_hw_constraint_pow2 (runtime,0 ,SNDRV_PCM_HW_PARAM_BUFFER_BYTES ); + err =snd_pcm_hw_constraint_pow2 (runtime,0 ,SNDRV_PCM_HW_PARAM_BUFFER_BYTES ); +if (err <0 ) +return err;spin_lock_irq (&chip->substream_lock);list_add (&es->list, &chip->substream_list);
Greg Kroah-Hartman
maintainerPATCH 98/270 tracing: samples: Initialize trace_array_printk() with the correct function
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
commit 1b0c192c92ea1fe2dcb178f84adf15fe37c3e7c8 upstream.
When using trace_array_printk() on a created instance, the correct function to use to initialize it is:
trace_array_init_printk()
Not
trace_printk_init_buffer()
The former is a proper function to use, the latter is for initializing trace_printk() and causes the NOTICE banner to be displayed.
--- samples/ftrace/sample-trace-array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/ftrace/sample-trace-array.c +1 -1
@@ -112,7 +112,7 @@ static int __init sample_trace_array_ini/* * If context specific per-cpu buffers havent already been allocated. */ -trace_printk_init_buffers (); +trace_array_init_printk (tr); simple_tsk =kthread_run (simple_thread,NULL ,"sample-instance" );if (IS_ERR (simple_tsk)) {
Greg Kroah-Hartman
maintainerPATCH 99/270 phy: Fix error handling in tegra_xusb_port_init
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Ke <[email protected]>
commit b2ea5f49580c0762d17d80d8083cb89bc3acf74f upstream.
If device_add() fails, do not use device_unregister() for error handling. device_unregister() consists two functions: device_del() and put_device(). device_unregister() should only be called after device_add() succeeded because device_del() undoes what device_add() does if successful. Change device_unregister() to put_device() call before returning from the function.
As comment of device_add() says, 'if device_add() succeeds, you should call device_del() when you want to get rid of it. If device_add() has not succeeded, use only put_device() to drop the reference count'.
Found by code review.
--- drivers/phy/tegra/xusb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/phy/tegra/xusb.c +4 -4
@@ -536,16 +536,16 @@ static int tegra_xusb_port_init(struct t err =dev_set_name (&port->dev,"%s-%u" , name, index);if (err <0 ) - goto unregister; + goto put_device; err =device_add (&port->dev);if (err <0 ) - goto unregister; + goto put_device;return 0 ; -unregister: -device_unregister (&port->dev); +put_device: +put_device (&port->dev);return err; }
Greg Kroah-Hartman
maintainerPATCH 100/270 phy: renesas: rcar-gen3-usb2: Set timing registers only once
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Claudiu Beznea <[email protected]>
commit 86e70849f4b2b4597ac9f7c7931f2a363774be25 upstream.
phy-rcar-gen3-usb2 driver exports 4 PHYs. The timing registers are common to all PHYs. There is no need to set them every time a PHY is initialized. Set timing register only when the 1st PHY is initialized.
--- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/phy/renesas/phy-rcar-gen3-usb2.c +5 -2
@@ -429,8 +429,11 @@ static int rcar_gen3_phy_usb2_init(struc val =readl (usb2_base +USB2_INT_ENABLE ); val |=USB2_INT_ENABLE_UCOM_INTEN | rphy->int_enable_bits;writel (val, usb2_base +USB2_INT_ENABLE ); -writel (USB2_SPD_RSM_TIMSET_INIT , usb2_base +USB2_SPD_RSM_TIMSET ); -writel (USB2_OC_TIMSET_INIT , usb2_base +USB2_OC_TIMSET ); + +if (!rcar_gen3_is_any_rphy_initialized (channel)) { +writel (USB2_SPD_RSM_TIMSET_INIT , usb2_base +USB2_SPD_RSM_TIMSET ); +writel (USB2_OC_TIMSET_INIT , usb2_base +USB2_OC_TIMSET ); + }/* Initialize otg part */ if (channel->is_otg_channel) {
Greg Kroah-Hartman
maintainerPATCH 101/270 wifi: mt76: disable napi on driver removal
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
commit 78ab4be549533432d97ea8989d2f00b508fa68d8 upstream.
A warning on driver removal started occurring after commit 9dd05df8403b ("net: warn if NAPI instance wasn't shut down"). Disable tx napi before deleting it in mt76_dma_cleanup().
WARNING: CPU: 4 PID: 18828 at net/core/dev.c:7288 __netif_napi_del_locked+0xf0/0x100 CPU: 4 UID: 0 PID: 18828 Comm: modprobe Not tainted 6.15.0-rc4 #4 PREEMPT(lazy) Hardware name: ASUS System Product Name/PRIME X670E-PRO WIFI, BIOS 3035 09/05/2024 RIP: 0010:__netif_napi_del_locked+0xf0/0x100 Call Trace: <TASK> mt76_dma_cleanup+0x54/0x2f0 [mt76] mt7921_pci_remove+0xd5/0x190 [mt7921e] pci_device_remove+0x47/0xc0 device_release_driver_internal+0x19e/0x200 driver_detach+0x48/0x90 bus_remove_driver+0x6d/0xf0 pci_unregister_driver+0x2e/0xb0 __do_sys_delete_module.isra.0+0x197/0x2e0 do_syscall_64+0x7b/0x160 entry_SYSCALL_64_after_hwframe+0x76/0x7e
Tested with mt7921e but the same pattern can be actually applied to other mt76 drivers calling mt76_dma_cleanup() during removal. Tx napi is enabled in their *_dma_init() functions and only toggled off and on again inside their suspend/resume/reset paths. So it should be okay to disable tx napi in such a generic way.
Found by Linux Verification Center (linuxtesting.org).
--- drivers/net/wireless/mediatek/mt76/dma.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/dma.c +1 -0
@@ -666,6 +666,7 @@ void mt76_dma_cleanup(struct mt76_dev *dint i;mt76_worker_disable (&dev->tx_worker); +napi_disable (&dev->tx_napi);netif_napi_del (&dev->tx_napi);for (i =0 ; i <ARRAY_SIZE (dev->q_tx); i++)mt76_dma_tx_cleanup (dev, i, true);
Greg Kroah-Hartman
maintainerPATCH 102/270 dmaengine: ti: k3-udma: Add missing locking
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ronald Wahl <[email protected]>
commit fca280992af8c2fbd511bc43f65abb4a17363f2f upstream.
Recent kernels complain about a missing lock in k3-udma.c when the lock validator is enabled:
[ 4.128073] WARNING: CPU: 0 PID: 746 at drivers/dma/ti/../virt-dma.h:169 udma_start.isra.0+0x34/0x238 [ 4.137352] CPU: 0 UID: 0 PID: 746 Comm: kworker/0:3 Not tainted 6.12.9-arm64 #28 [ 4.144867] Hardware name: pp-v12 (DT) [ 4.148648] Workqueue: events udma_check_tx_completion [ 4.153841] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 4.160834] pc : udma_start.isra.0+0x34/0x238 [ 4.165227] lr : udma_start.isra.0+0x30/0x238 [ 4.169618] sp : ffffffc083cabcf0 [ 4.172963] x29: ffffffc083cabcf0 x28: 0000000000000000 x27: ffffff800001b005 [ 4.180167] x26: ffffffc0812f0000 x25: 0000000000000000 x24: 0000000000000000 [ 4.187370] x23: 0000000000000001 x22: 00000000e21eabe9 x21: ffffff8000fa0670 [ 4.194571] x20: ffffff8001b6bf00 x19: ffffff8000fa0430 x18: ffffffc083b95030 [ 4.201773] x17: 0000000000000000 x16: 00000000f0000000 x15: 0000000000000048 [ 4.208976] x14: 0000000000000048 x13: 0000000000000000 x12: 0000000000000001 [ 4.216179] x11: ffffffc08151a240 x10: 0000000000003ea1 x9 : ffffffc08046ab68 [ 4.223381] x8 : ffffffc083cabac0 x7 : ffffffc081df3718 x6 : 0000000000029fc8 [ 4.230583] x5 : ffffffc0817ee6d8 x4 : 0000000000000bc0 x3 : 0000000000000000 [ 4.237784] x2 : 0000000000000000 x1 : 00000000001fffff x0 : 0000000000000000 [ 4.244986] Call trace: [ 4.247463] udma_start.isra.0+0x34/0x238 [ 4.251509] udma_check_tx_completion+0xd0/0xdc [ 4.256076] process_one_work+0x244/0x3fc [ 4.260129] process_scheduled_works+0x6c/0x74 [ 4.264610] worker_thread+0x150/0x1dc [ 4.268398] kthread+0xd8/0xe8 [ 4.271492] ret_from_fork+0x10/0x20 [ 4.275107] irq event stamp: 220 [ 4.278363] hardirqs last enabled at (219): [<ffffffc080a27c7c>] _raw_spin_unlock_irq+0x38/0x50 [ 4.287183] hardirqs last disabled at (220): [<ffffffc080a1c154>] el1_dbg+0x24/0x50 [ 4.294879] softirqs last enabled at (182): [<ffffffc080037e68>] handle_softirqs+0x1c0/0x3cc [ 4.303437] softirqs last disabled at (177): [<ffffffc080010170>] __do_softirq+0x1c/0x28 [ 4.311559] ---[ end trace 0000000000000000 ]---
This commit adds the missing locking.
--- drivers/dma/ti/k3-udma.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/dma/ti/k3-udma.c +7 -0
@@ -962,8 +962,11 @@ static void udma_check_tx_completion(stru32 residue_diff;ktime_t time_diff;unsigned long delay; +unsigned long flags;while (1 ) { +spin_lock_irqsave (&uc->vc.lock, flags); +if (uc->desc) {/* Get previous residue and time stamp */ residue_diff = uc->tx_drain.residue;
@@ -998,6 +1001,8 @@ static void udma_check_tx_completion(strbreak ; } +spin_unlock_irqrestore (&uc->vc.lock, flags); +usleep_range (ktime_to_us (delay),ktime_to_us (delay) +10 );continue ;
@@ -1014,6 +1019,8 @@ static void udma_check_tx_completion(strbreak ; } + +spin_unlock_irqrestore (&uc->vc.lock, flags); }static irqreturn_t udma_ring_irq_handler (int irq,void *data)
Greg Kroah-Hartman
maintainerPATCH 103/270 dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yemike Abhilash Chandra <[email protected]>
commit 8ca9590c39b69b55a8de63d2b21b0d44f523b43a upstream.
Currently, a local dma_cap_mask_t variable is used to store device cap_mask within udma_of_xlate(). However, the DMA_PRIVATE flag in the device cap_mask can get cleared when the last channel is released. This can happen right after storing the cap_mask locally in udma_of_xlate(), and subsequent dma_request_channel() can fail due to mismatch in the cap_mask. Fix this by removing the local dma_cap_mask_t variable and directly using the one from the dma_device structure.
--- drivers/dma/ti/k3-udma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma/ti/k3-udma.c +1 -2
@@ -3082,7 +3082,6 @@ static struct dma_chan *udma_of_xlate(st struct of_dma *ofdma) {struct udma_dev *ud = ofdma->of_dma_data; -dma_cap_mask_t mask = ud->ddev.cap_mask;struct udma_filter_param filter_param;struct dma_chan *chan;
@@ -3095,7 +3094,7 @@ static struct dma_chan *udma_of_xlate(stelse filter_param.atype =0 ; - chan =__dma_request_channel (&mask, udma_dma_filter_fn, &filter_param, + chan =__dma_request_channel (&ud->ddev.cap_mask, udma_dma_filter_fn, &filter_param, ofdma->of_node);if (!chan) {dev_err (ud->dev,"get channel fail in %s.\n" , __func__);
Greg Kroah-Hartman
maintainerPATCH 104/270 clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
commit 94cff94634e506a4a44684bee1875d2dbf782722 upstream.
On x86 during boot, clockevent_i8253_disable() can be invoked via x86_late_time_init -> hpet_time_init() -> pit_timer_init() which happens with enabled interrupts.
If some of the old i8253 hardware is actually used then lockdep will notice that i8253_lock is used in hard interrupt context. This causes lockdep to complain because it observed the lock being acquired with interrupts enabled and in hard interrupt context.
Make clockevent_i8253_disable() acquire the lock with raw_spinlock_irqsave() to cure this.
[ tglx: Massage change log and use guard() ]
--- drivers/clocksource/i8253.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clocksource/i8253.c +4 -2
@@ -103,7 +103,9 @@ int __init clocksource_i8253_init(void)#ifdef CONFIG_CLKEVT_I8253 void clockevent_i8253_disable (void ) { -raw_spin_lock (&i8253_lock); +unsigned long flags; + +raw_spin_lock_irqsave (&i8253_lock, flags);/* * Writing the MODE register should stop the counter, according to
@@ -133,7 +135,7 @@ void clockevent_i8253_disable(void)outb_p (0x30 ,PIT_MODE ); -raw_spin_unlock (&i8253_lock); +raw_spin_unlock_irqrestore (&i8253_lock, flags); }static int pit_shutdown (struct clock_event_device *evt)
Greg Kroah-Hartman
maintainerPATCH 105/270 ASoC: q6afe-clocks: fix reprobing of the driver
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
commit 96fadf7e8ff49fdb74754801228942b67c3eeebd upstream.
Q6afe-clocks driver can get reprobed. For example if the APR services are restarted after the firmware crash. However currently Q6afe-clocks driver will oops because hw.init will get cleared during first _probe call. Rewrite the driver to fill the clock data at runtime rather than using big static array of clocks.
--- sound/soc/qcom/qdsp6/q6afe-clocks.c | 209 ++++++++++++++++++------------------ sound/soc/qcom/qdsp6/q6afe.c | 2 sound/soc/qcom/qdsp6/q6afe.h | 2 3 files changed, 108 insertions(+), 105 deletions(-)
sound/soc/qcom/qdsp6/q6afe-clocks.c +106 -103
@@ -11,33 +11,29 @@#include <linux/slab.h> #include "q6afe.h" -#define Q6AFE_CLK (id) &(struct q6afe_clk) { \ +#define Q6AFE_CLK (id) { \ .clk_id = id, \ .afe_clk_id = Q6AFE_##id, \ .name = #id, \ - .attributes = LPASS_CLK_ATTRIBUTE_COUPLE_NO, \ .rate = 19200000, \ - .hw.init = &(struct clk_init_data) { \ - .ops = &clk_q6afe_ops, \ - .name = #id, \ - }, \ } -#define Q6AFE_VOTE_CLK (id, blkid, n) &(struct q6afe_clk) { \ +#define Q6AFE_VOTE_CLK (id, blkid, n) { \ .clk_id = id, \ .afe_clk_id = blkid, \ - .name = #n, \ - .hw.init = &(struct clk_init_data) { \ - .ops = &clk_vote_q6afe_ops, \ - .name = #id, \ - }, \ + .name = n, \ } -struct q6afe_clk { -struct device *dev; +struct q6afe_clk_init {int clk_id;int afe_clk_id;char *name; +int rate; +}; + +struct q6afe_clk { +struct device *dev; +int afe_clk_id;int attributes;int rate;uint32_t handle;
@@ -48,8 +44,7 @@ struct q6afe_clk {struct q6afe_cc {struct device *dev; -struct q6afe_clk **clks; -int num_clks; +struct q6afe_clk *clks[Q6AFE_MAX_CLK_ID ]; };static int clk_q6afe_prepare (struct clk_hw *hw)
@@ -105,7 +100,7 @@ static int clk_vote_q6afe_block(struct cstruct q6afe_clk *clk =to_q6afe_clk (hw);return q6afe_vote_lpass_core_hw (clk->dev, clk->afe_clk_id, - clk->name, &clk->handle); +clk_hw_get_name (&clk->hw), &clk->handle); }static void clk_unvote_q6afe_block (struct clk_hw *hw)
@@ -120,84 +115,76 @@ static const struct clk_ops clk_vote_q6a .unprepare = clk_unvote_q6afe_block, }; -struct q6afe_clk *q6afe_clks[Q6AFE_MAX_CLK_ID ] = { - [LPASS_CLK_ID_PRI_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_PRI_MI2S_IBIT ), - [LPASS_CLK_ID_PRI_MI2S_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_PRI_MI2S_EBIT ), - [LPASS_CLK_ID_SEC_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEC_MI2S_IBIT ), - [LPASS_CLK_ID_SEC_MI2S_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEC_MI2S_EBIT ), - [LPASS_CLK_ID_TER_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_TER_MI2S_IBIT ), - [LPASS_CLK_ID_TER_MI2S_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_TER_MI2S_EBIT ), - [LPASS_CLK_ID_QUAD_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUAD_MI2S_IBIT ), - [LPASS_CLK_ID_QUAD_MI2S_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUAD_MI2S_EBIT ), - [LPASS_CLK_ID_SPEAKER_I2S_IBIT ] = -Q6AFE_CLK (LPASS_CLK_ID_SPEAKER_I2S_IBIT ), - [LPASS_CLK_ID_SPEAKER_I2S_EBIT ] = -Q6AFE_CLK (LPASS_CLK_ID_SPEAKER_I2S_EBIT ), - [LPASS_CLK_ID_SPEAKER_I2S_OSR ] = -Q6AFE_CLK (LPASS_CLK_ID_SPEAKER_I2S_OSR ), - [LPASS_CLK_ID_QUI_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUI_MI2S_IBIT ), - [LPASS_CLK_ID_QUI_MI2S_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUI_MI2S_EBIT ), - [LPASS_CLK_ID_SEN_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEN_MI2S_IBIT ), - [LPASS_CLK_ID_SEN_MI2S_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEN_MI2S_EBIT ), - [LPASS_CLK_ID_INT0_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT0_MI2S_IBIT ), - [LPASS_CLK_ID_INT1_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT1_MI2S_IBIT ), - [LPASS_CLK_ID_INT2_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT2_MI2S_IBIT ), - [LPASS_CLK_ID_INT3_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT3_MI2S_IBIT ), - [LPASS_CLK_ID_INT4_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT4_MI2S_IBIT ), - [LPASS_CLK_ID_INT5_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT5_MI2S_IBIT ), - [LPASS_CLK_ID_INT6_MI2S_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_INT6_MI2S_IBIT ), - [LPASS_CLK_ID_QUI_MI2S_OSR ] =Q6AFE_CLK (LPASS_CLK_ID_QUI_MI2S_OSR ), - [LPASS_CLK_ID_PRI_PCM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_PRI_PCM_IBIT ), - [LPASS_CLK_ID_PRI_PCM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_PRI_PCM_EBIT ), - [LPASS_CLK_ID_SEC_PCM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEC_PCM_IBIT ), - [LPASS_CLK_ID_SEC_PCM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEC_PCM_EBIT ), - [LPASS_CLK_ID_TER_PCM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_TER_PCM_IBIT ), - [LPASS_CLK_ID_TER_PCM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_TER_PCM_EBIT ), - [LPASS_CLK_ID_QUAD_PCM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUAD_PCM_IBIT ), - [LPASS_CLK_ID_QUAD_PCM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUAD_PCM_EBIT ), - [LPASS_CLK_ID_QUIN_PCM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUIN_PCM_IBIT ), - [LPASS_CLK_ID_QUIN_PCM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUIN_PCM_EBIT ), - [LPASS_CLK_ID_QUI_PCM_OSR ] =Q6AFE_CLK (LPASS_CLK_ID_QUI_PCM_OSR ), - [LPASS_CLK_ID_PRI_TDM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_PRI_TDM_IBIT ), - [LPASS_CLK_ID_PRI_TDM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_PRI_TDM_EBIT ), - [LPASS_CLK_ID_SEC_TDM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEC_TDM_IBIT ), - [LPASS_CLK_ID_SEC_TDM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_SEC_TDM_EBIT ), - [LPASS_CLK_ID_TER_TDM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_TER_TDM_IBIT ), - [LPASS_CLK_ID_TER_TDM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_TER_TDM_EBIT ), - [LPASS_CLK_ID_QUAD_TDM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUAD_TDM_IBIT ), - [LPASS_CLK_ID_QUAD_TDM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUAD_TDM_EBIT ), - [LPASS_CLK_ID_QUIN_TDM_IBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUIN_TDM_IBIT ), - [LPASS_CLK_ID_QUIN_TDM_EBIT ] =Q6AFE_CLK (LPASS_CLK_ID_QUIN_TDM_EBIT ), - [LPASS_CLK_ID_QUIN_TDM_OSR ] =Q6AFE_CLK (LPASS_CLK_ID_QUIN_TDM_OSR ), - [LPASS_CLK_ID_MCLK_1 ] =Q6AFE_CLK (LPASS_CLK_ID_MCLK_1 ), - [LPASS_CLK_ID_MCLK_2 ] =Q6AFE_CLK (LPASS_CLK_ID_MCLK_2 ), - [LPASS_CLK_ID_MCLK_3 ] =Q6AFE_CLK (LPASS_CLK_ID_MCLK_3 ), - [LPASS_CLK_ID_MCLK_4 ] =Q6AFE_CLK (LPASS_CLK_ID_MCLK_4 ), - [LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE ] = -Q6AFE_CLK (LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE ), - [LPASS_CLK_ID_INT_MCLK_0 ] =Q6AFE_CLK (LPASS_CLK_ID_INT_MCLK_0 ), - [LPASS_CLK_ID_INT_MCLK_1 ] =Q6AFE_CLK (LPASS_CLK_ID_INT_MCLK_1 ), - [LPASS_CLK_ID_WSA_CORE_MCLK ] =Q6AFE_CLK (LPASS_CLK_ID_WSA_CORE_MCLK ), - [LPASS_CLK_ID_WSA_CORE_NPL_MCLK ] = -Q6AFE_CLK (LPASS_CLK_ID_WSA_CORE_NPL_MCLK ), - [LPASS_CLK_ID_VA_CORE_MCLK ] =Q6AFE_CLK (LPASS_CLK_ID_VA_CORE_MCLK ), - [LPASS_CLK_ID_TX_CORE_MCLK ] =Q6AFE_CLK (LPASS_CLK_ID_TX_CORE_MCLK ), - [LPASS_CLK_ID_TX_CORE_NPL_MCLK ] = -Q6AFE_CLK (LPASS_CLK_ID_TX_CORE_NPL_MCLK ), - [LPASS_CLK_ID_RX_CORE_MCLK ] =Q6AFE_CLK (LPASS_CLK_ID_RX_CORE_MCLK ), - [LPASS_CLK_ID_RX_CORE_NPL_MCLK ] = -Q6AFE_CLK (LPASS_CLK_ID_RX_CORE_NPL_MCLK ), - [LPASS_CLK_ID_VA_CORE_2X_MCLK ] = -Q6AFE_CLK (LPASS_CLK_ID_VA_CORE_2X_MCLK ), - [LPASS_HW_AVTIMER_VOTE ] =Q6AFE_VOTE_CLK (LPASS_HW_AVTIMER_VOTE , -Q6AFE_LPASS_CORE_AVTIMER_BLOCK , -"LPASS_AVTIMER_MACRO" ), - [LPASS_HW_MACRO_VOTE ] =Q6AFE_VOTE_CLK (LPASS_HW_MACRO_VOTE , -Q6AFE_LPASS_CORE_HW_MACRO_BLOCK , -"LPASS_HW_MACRO" ), - [LPASS_HW_DCODEC_VOTE ] =Q6AFE_VOTE_CLK (LPASS_HW_DCODEC_VOTE , -Q6AFE_LPASS_CORE_HW_DCODEC_BLOCK , -"LPASS_HW_DCODEC" ), +static const struct q6afe_clk_init q6afe_clks[] = { +Q6AFE_CLK (LPASS_CLK_ID_PRI_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_PRI_MI2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEC_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEC_MI2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_TER_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_TER_MI2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUAD_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUAD_MI2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SPEAKER_I2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SPEAKER_I2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SPEAKER_I2S_OSR ), +Q6AFE_CLK (LPASS_CLK_ID_QUI_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUI_MI2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEN_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEN_MI2S_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT0_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT1_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT2_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT3_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT4_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT5_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_INT6_MI2S_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUI_MI2S_OSR ), +Q6AFE_CLK (LPASS_CLK_ID_PRI_PCM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_PRI_PCM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEC_PCM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEC_PCM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_TER_PCM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_TER_PCM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUAD_PCM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUAD_PCM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUIN_PCM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUIN_PCM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUI_PCM_OSR ), +Q6AFE_CLK (LPASS_CLK_ID_PRI_TDM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_PRI_TDM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEC_TDM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_SEC_TDM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_TER_TDM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_TER_TDM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUAD_TDM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUAD_TDM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUIN_TDM_IBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUIN_TDM_EBIT ), +Q6AFE_CLK (LPASS_CLK_ID_QUIN_TDM_OSR ), +Q6AFE_CLK (LPASS_CLK_ID_MCLK_1 ), +Q6AFE_CLK (LPASS_CLK_ID_MCLK_2 ), +Q6AFE_CLK (LPASS_CLK_ID_MCLK_3 ), +Q6AFE_CLK (LPASS_CLK_ID_MCLK_4 ), +Q6AFE_CLK (LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE ), +Q6AFE_CLK (LPASS_CLK_ID_INT_MCLK_0 ), +Q6AFE_CLK (LPASS_CLK_ID_INT_MCLK_1 ), +Q6AFE_CLK (LPASS_CLK_ID_WSA_CORE_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_WSA_CORE_NPL_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_VA_CORE_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_TX_CORE_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_TX_CORE_NPL_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_RX_CORE_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_RX_CORE_NPL_MCLK ), +Q6AFE_CLK (LPASS_CLK_ID_VA_CORE_2X_MCLK ), +Q6AFE_VOTE_CLK (LPASS_HW_AVTIMER_VOTE , +Q6AFE_LPASS_CORE_AVTIMER_BLOCK , +"LPASS_AVTIMER_MACRO" ), +Q6AFE_VOTE_CLK (LPASS_HW_MACRO_VOTE , +Q6AFE_LPASS_CORE_HW_MACRO_BLOCK , +"LPASS_HW_MACRO" ), +Q6AFE_VOTE_CLK (LPASS_HW_DCODEC_VOTE , +Q6AFE_LPASS_CORE_HW_DCODEC_BLOCK , +"LPASS_HW_DCODEC" ), }; static struct clk_hw *q6afe_of_clk_hw_get(struct of_phandle_args *clkspec,
@@ -207,7 +194,7 @@ static struct clk_hw *q6afe_of_clk_hw_geunsigned int idx = clkspec->args[0 ];unsigned int attr = clkspec->args[1 ]; -if (idx >= cc->num_clks || attr >LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR ) { +if (idx >=Q6AFE_MAX_CLK_ID || attr >LPASS_CLK_ATTRIBUTE_COUPLE_DIVISOR ) {dev_err (cc->dev,"Invalid clk specifier (%d, %d)\n" , idx, attr);return ERR_PTR (-EINVAL ); }
@@ -230,20 +217,36 @@ static int q6afe_clock_dev_probe(structif (!cc)return -ENOMEM ; - cc->clks = &q6afe_clks[0 ]; - cc->num_clks =ARRAY_SIZE (q6afe_clks); + cc->dev = dev;for (i =0 ; i <ARRAY_SIZE (q6afe_clks); i++) { -if (!q6afe_clks[i]) -continue ; +unsigned int id = q6afe_clks[i].clk_id; +struct clk_init_data init = { + .name = q6afe_clks[i].name, + }; +struct q6afe_clk *clk; + + clk =devm_kzalloc (dev,sizeof (*clk),GFP_KERNEL ); +if (!clk) +return -ENOMEM ; + + clk->dev = dev; + clk->afe_clk_id = q6afe_clks[i].afe_clk_id; + clk->rate = q6afe_clks[i].rate; + clk->hw.init = &init; + +if (clk->rate) + init.ops = &clk_q6afe_ops; +else + init.ops = &clk_vote_q6afe_ops; - q6afe_clks[i]->dev = dev; + cc->clks[id] = clk; - ret =devm_clk_hw_register (dev, &q6afe_clks[i]->hw); + ret =devm_clk_hw_register (dev, &clk->hw);if (ret)return ret; } - ret =of_clk_add_hw_provider (dev->of_node, q6afe_of_clk_hw_get, cc); + ret =devm_of_clk_add_hw_provider (dev, q6afe_of_clk_hw_get, cc);if (ret)return ret;
sound/soc/qcom/qdsp6/q6afe.c +1 -1
@@ -1681,7 +1681,7 @@ int q6afe_unvote_lpass_core_hw(struct deEXPORT_SYMBOL (q6afe_unvote_lpass_core_hw);int q6afe_vote_lpass_core_hw (struct device *dev,uint32_t hw_block_id, -char *client_name,uint32_t *client_handle) +const char *client_name,uint32_t *client_handle) {struct q6afe *afe =dev_get_drvdata (dev->parent);struct afe_cmd_remote_lpass_core_hw_vote_request *vote_cfg;
sound/soc/qcom/qdsp6/q6afe.h +1 -1
@@ -236,7 +236,7 @@ int q6afe_port_set_sysclk(struct q6afe_pint q6afe_set_lpass_clock (struct device *dev,int clk_id,int clk_src,int clk_root,unsigned int freq);int q6afe_vote_lpass_core_hw (struct device *dev,uint32_t hw_block_id, -char *client_name,uint32_t *client_handle); +const char *client_name,uint32_t *client_handle);int q6afe_unvote_lpass_core_hw (struct device *dev,uint32_t hw_block_id,uint32_t client_handle);#endif /* __Q6AFE_H__ */
Greg Kroah-Hartman
maintainerPATCH 106/270 drm/vmwgfx: Fix a deadlock in dma buf fence polling
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
commit e58337100721f3cc0c7424a18730e4f39844934f upstream.
Introduce a version of the fence ops that on release doesn't remove the fence from the pending list, and thus doesn't require a lock to fix poll->fence wait->fence unref deadlocks.
vmwgfx overwrites the wait callback to iterate over the list of all fences and update their status, to do that it holds a lock to prevent the list modifcations from other threads. The fence destroy callback both deletes the fence and removes it from the list of pending fences, for which it holds a lock.
dma buf polling cb unrefs a fence after it's been signaled: so the poll calls the wait, which signals the fences, which are being destroyed. The destruction tries to acquire the lock on the pending fences list which it can never get because it's held by the wait from which it was called.
Old bug, but not a lot of userspace apps were using dma-buf polling interfaces. Fix those, in particular this fixes KDE stalls/deadlock.
--- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +7 -10
@@ -32,7 +32,6 @@#define VMW_FENCE_WRAP (1 << 31)struct vmw_fence_manager { -int num_fence_objects;struct vmw_private *dev_priv;spinlock_t lock;struct list_head fence_list;
@@ -113,13 +112,13 @@ static void vmw_fence_obj_destroy(struct {struct vmw_fence_obj *fence = container_of(f, struct vmw_fence_obj, base); -struct vmw_fence_manager *fman =fman_from_fence (fence); -spin_lock (&fman->lock); -list_del_init (&fence->head); - --fman->num_fence_objects; -spin_unlock (&fman->lock); +if (!list_empty (&fence->head)) { +spin_lock (&fman->lock); +list_del_init (&fence->head); +spin_unlock (&fman->lock); + } fence->destroy (fence); }
@@ -250,7 +249,6 @@ static const struct dma_fence_ops vmw_fe .release = vmw_fence_obj_destroy, }; -/** * Execute signal actions on fences recently signaled. * This is done from a workqueue so we don't have to execute
@@ -353,7 +351,6 @@ static int vmw_fence_obj_init(struct vmw goto out_unlock; }list_add_tail (&fence->head, &fman->fence_list); - ++fman->num_fence_objects; out_unlock:spin_unlock (&fman->lock);
@@ -402,7 +399,7 @@ static bool vmw_fence_goal_new_locked(st {u32 goal_seqno;u32 *fifo_mem; -struct vmw_fence_obj *fence; +struct vmw_fence_obj *fence, *next_fence;if (likely (!fman->seqno_valid))return false;
@@ -413,7 +410,7 @@ static bool vmw_fence_goal_new_locked(streturn false; fman->seqno_valid = false; -list_for_each_entry (fence, &fman->fence_list, head) { +list_for_each_entry_safe (fence, next_fence, &fman->fence_list, head) {if (!list_empty (&fence->seq_passed_actions)) { fman->seqno_valid = true; vmw_mmio_write(fence->base.seqno,
Greg Kroah-Hartman
maintainerPATCH 107/270 usb: typec: altmodes/displayport: create sysfs nodes as drivers default device attribute group
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: RD Babiera <[email protected]>
commit 165376f6b23e9a779850e750fb2eb06622e5a531 upstream.
The DisplayPort driver's sysfs nodes may be present to the userspace before typec_altmode_set_drvdata() completes in dp_altmode_probe. This means that a sysfs read can trigger a NULL pointer error by deferencing dp->hpd in hpd_show or dp->lock in pin_assignment_show, as dev_get_drvdata() returns NULL in those cases.
Remove manual sysfs node creation in favor of adding attribute group as default for devices bound to the driver. The ATTRIBUTE_GROUPS() macro is not used here otherwise the path to the sysfs nodes is no longer compliant with the ABI.
--- drivers/usb/typec/altmodes/displayport.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/usb/typec/altmodes/displayport.c +9 -9
@@ -527,15 +527,20 @@ static ssize_t pin_assignment_show(struc }static DEVICE_ATTR_RW (pin_assignment); -static struct attribute *dp_altmode_attrs[] = { +static struct attribute *displayport_attrs[] = { &dev_attr_configuration.attr, &dev_attr_pin_assignment.attr,NULL }; -static const struct attribute_group dp_altmode_group = { +static const struct attribute_group displayport_group = { .name ="displayport" , - .attrs = dp_altmode_attrs, + .attrs = displayport_attrs, +}; + +static const struct attribute_group *displayport_groups[] = { + &displayport_group, +NULL , };int dp_altmode_probe (struct typec_altmode *alt)
@@ -543,7 +548,6 @@ int dp_altmode_probe(struct typec_altmodconst struct typec_altmode *port =typec_altmode_get_partner (alt);struct fwnode_handle *fwnode;struct dp_altmode *dp; -int ret;/* FIXME: Port can only be DFP_U. */
@@ -554,10 +558,6 @@ int dp_altmode_probe(struct typec_altmod DP_CAP_PIN_ASSIGN_DFP_D(alt->vdo)))return -ENODEV ; - ret =sysfs_create_group (&alt->dev.kobj, &dp_altmode_group); -if (ret) -return ret; - dp =devm_kzalloc (&alt->dev,sizeof (*dp),GFP_KERNEL );if (!dp)return -ENOMEM ;
@@ -588,7 +588,6 @@ void dp_altmode_remove(struct typec_altm {struct dp_altmode *dp =typec_altmode_get_drvdata (alt); -sysfs_remove_group (&alt->dev.kobj, &dp_altmode_group);cancel_work_sync (&dp->work);if (dp->connector_fwnode) {
@@ -613,6 +612,7 @@ static struct typec_altmode_driver dp_al .driver = { .name = "typec_displayport", .owner = THIS_MODULE, + .dev_groups = displayport_groups, }, };module_typec_altmode_driver (dp_altmode_driver);
Greg Kroah-Hartman
maintainerPATCH 108/270 usb: typec: fix potential array underflow in ucsi_ccg_sync_control()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit e56aac6e5a25630645607b6856d4b2a17b2311a5 upstream.
The "command" variable can be controlled by the user via debugfs. The worry is that if con_index is zero then "&uc->ucsi->connector[con_index
- 1]" would be an array underflow.
[ The function ucsi_ccg_sync_write() is renamed to ucsi_ccg_sync_control()
in commit 13f2ec3115c8 ("usb: typec: ucsi:simplify command sending API"). Apply this patch to ucsi_ccg_sync_write() in 6.1.y accordingly. ]
--- drivers/usb/typec/ucsi/ucsi_ccg.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/typec/ucsi/ucsi_ccg.c +5 -0
@@ -573,6 +573,10 @@ static int ucsi_ccg_sync_write(struct uc uc->has_multiple_dp) { con_index = (uc->last_cmd_sent >>16 ) &UCSI_CMD_CONNECTOR_MASK ; +if (con_index ==0 ) { + ret = -EINVAL ; + goto unlock; + } con = &uc->ucsi->connector[con_index -1 ];ucsi_ccg_update_set_new_cam_cmd (uc, con, (u64 *)val); }
@@ -588,6 +592,7 @@ static int ucsi_ccg_sync_write(struct uc err_clear_bit:clear_bit (DEV_CMD_PENDING , &uc->flags);pm_runtime_put_sync (uc->dev); +unlock:mutex_unlock (&uc->lock);return ret;
Greg Kroah-Hartman
maintainerPATCH 109/270 usb: typec: fix pm usage counter imbalance in ucsi_ccg_sync_control()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: GONG Ruiqi <[email protected]>
commit b0e525d7a22ea350e75e2aec22e47fcfafa4cacd upstream.
The error handling for the case con_index == 0 should involve dropping the pm usage counter, as ucsi_ccg_sync_control() gets it at the beginning. Fix it.
--- drivers/usb/typec/ucsi/ucsi_ccg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/typec/ucsi/ucsi_ccg.c +2 -2
@@ -575,7 +575,7 @@ static int ucsi_ccg_sync_write(struct ucUCSI_CMD_CONNECTOR_MASK ;if (con_index ==0 ) { ret = -EINVAL ; - goto unlock; + goto err_put; } con = &uc->ucsi->connector[con_index -1 ];ucsi_ccg_update_set_new_cam_cmd (uc, con, (u64 *)val);
@@ -591,8 +591,8 @@ static int ucsi_ccg_sync_write(struct uc err_clear_bit:clear_bit (DEV_CMD_PENDING , &uc->flags); +err_put:pm_runtime_put_sync (uc->dev); -unlock:mutex_unlock (&uc->lock);return ret;
Greg Kroah-Hartman
maintainerPATCH 110/270 selftests/mm: compaction_test: support platform with huge mount of memory
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Feng Tang <[email protected]>
commit ab00ddd802f80e31fc9639c652d736fe3913feae upstream.
When running mm selftest to verify mm patches, 'compaction_test' case failed on an x86 server with 1TB memory. And the root cause is that it has too much free memory than what the test supports.
The test case tries to allocate 100000 huge pages, which is about 200 GB for that x86 server, and when it succeeds, it expects it's large than 1/3 of 80% of the free memory in system. This logic only works for platform with 750 GB ( 200 / (1/3) / 80% ) or less free memory, and may raise false alarm for others.
Fix it by changing the fixed page number to self-adjustable number according to the real number of free memory.
--- tools/testing/selftests/vm/compaction_test.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
tools/testing/selftests/vm/compaction_test.c +14 -5
@@ -89,6 +89,8 @@ int check_compaction(unsigned long mem_fint compaction_index =0 ;char initial_nr_hugepages[20 ] = {0 };char nr_hugepages[20 ] = {0 }; +char target_nr_hugepages[24 ] = {0 }; +int slen;/* We want to test with 80% of available memory. Else, OOM killer comes in to play */
@@ -118,11 +120,18 @@ int check_compaction(unsigned long mem_flseek (fd,0 ,SEEK_SET ); -/* Request a large number of huge pages. The Kernel will allocate -as much as it can */ -if (write (fd,"100000" , (6 *sizeof (char ))) != (6 *sizeof (char ))) { -ksft_test_result_fail ("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n" , -strerror (errno)); +/* +* Request huge pages for about half of the free memory. The Kernel +* will allocate as much as it can, and we expect it will get at least 1/3 +*/ + nr_hugepages_ul = mem_free / hugepage_size /2 ; +snprintf (target_nr_hugepages,sizeof (target_nr_hugepages), +"%lu" , nr_hugepages_ul); + + slen =strlen (target_nr_hugepages); +if (write (fd, target_nr_hugepages, slen) != slen) { +ksft_test_result_fail ("Failed to write %lu to /proc/sys/vm/nr_hugepages: %s\n" , + nr_hugepages_ul,strerror (errno)); goto close_fd; }
Greg Kroah-Hartman
maintainerPATCH 111/270 btrfs: dont BUG_ON() when 0 reference count at btrfs_lookup_extent_info()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
commit 28cb13f29faf6290597b24b728dc3100c019356f upstream.
Instead of doing a BUG_ON() handle the error by returning -EUCLEAN, aborting the transaction and logging an error message.
--- fs/btrfs/extent-tree.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
fs/btrfs/extent-tree.c +20 -5
@@ -174,6 +174,14 @@ search_again: ei =btrfs_item_ptr (leaf, path->slots[0 ], struct btrfs_extent_item); num_refs =btrfs_extent_refs (leaf, ei); +if (unlikely (num_refs ==0 )) { + ret = -EUCLEAN ; +btrfs_err (fs_info, +"unexpected zero reference count for extent item (%llu %u %llu)" , + key.objectid, key.type, key.offset); +btrfs_abort_transaction (trans, ret); + goto out_free; + } extent_flags =btrfs_extent_flags (leaf, ei); }else { ret = -EINVAL ;
@@ -185,8 +193,6 @@ search_again: goto out_free; } - -BUG_ON (num_refs ==0 ); }else { num_refs =0 ; extent_flags =0 ;
@@ -216,10 +222,19 @@ search_again: goto search_again; }spin_lock (&head->lock); -if (head->extent_op && head->extent_op->update_flags) +if (head->extent_op && head->extent_op->update_flags) { extent_flags |= head->extent_op->flags_to_set; -else -BUG_ON (num_refs ==0 ); + }else if (unlikely (num_refs ==0 )) { +spin_unlock (&head->lock); +mutex_unlock (&head->mutex); +spin_unlock (&delayed_refs->lock); + ret = -EUCLEAN ; +btrfs_err (fs_info, +"unexpected zero reference count for extent %llu (%s)" , + bytenr, metadata ?"metadata" :"data" ); +btrfs_abort_transaction (trans, ret); + goto out_free; + } num_refs += head->ref_mod;spin_unlock (&head->lock);
Greg Kroah-Hartman
maintainerPATCH 112/270 netfilter: nf_tables: pass nft_chain to destroy function, not nft_ctx
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit 8965d42bcf54d42cbc72fe34a9d0ec3f8527debd upstream.
It would be better to not store nft_ctx inside nft_trans object, the netlink ctx strucutre is huge and most of its information is never needed in places that use trans->ctx.
Avoid/reduce its usage if possible, no runtime behaviour change intended.
--- include/net/netfilter/nf_tables.h | 2 +- net/netfilter/nf_tables_api.c | 17 ++++++++--------- net/netfilter/nft_immediate.c | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-)
include/net/netfilter/nf_tables.h +1 -1
@@ -1018,7 +1018,7 @@ static inline bool nft_chain_is_bound(stint nft_chain_add (struct nft_table *table,struct nft_chain *chain);void nft_chain_del (struct nft_chain *chain); -void nf_tables_chain_destroy (struct nft_ctx *ctx); +void nf_tables_chain_destroy (struct nft_chain *chain);struct nft_stats {u64 bytes;
net/netfilter/nf_tables_api.c +8 -9
@@ -1911,9 +1911,9 @@ static void nf_tables_chain_free_chain_rkvfree (chain->rules_next); } -void nf_tables_chain_destroy (struct nft_ctx *ctx) +void nf_tables_chain_destroy (struct nft_chain *chain) { -struct nft_chain *chain = ctx->chain; +const struct nft_table *table = chain->table;struct nft_hook *hook, *next;if (WARN_ON (chain->use >0 ))
@@ -1925,7 +1925,7 @@ void nf_tables_chain_destroy(struct nft_if (nft_is_base_chain (chain)) {struct nft_base_chain *basechain =nft_base_chain (chain); -if (nft_base_chain_netdev (ctx->family, basechain->ops.hooknum)) { +if (nft_base_chain_netdev (table->family, basechain->ops.hooknum)) {list_for_each_entry_safe (hook, next, &basechain->hook_list, list) {list_del_rcu (&hook->list);
@@ -2367,7 +2367,7 @@ err_unregister_hook: err_use:nf_tables_unregister_hook (net, table, chain); err_destroy_chain: -nf_tables_chain_destroy (ctx); +nf_tables_chain_destroy (chain);return err; }
@@ -7999,7 +7999,7 @@ static void nft_commit_release(struct nfkfree (nft_trans_chain_name (trans));break ;case NFT_MSG_DELCHAIN : -nf_tables_chain_destroy (&trans->ctx); +nf_tables_chain_destroy (nft_trans_chain (trans));break ;case NFT_MSG_DELRULE :nf_tables_rule_destroy (&trans->ctx,nft_trans_rule (trans));
@@ -8840,7 +8840,7 @@ static void nf_tables_abort_release(strunf_tables_table_destroy (&trans->ctx);break ;case NFT_MSG_NEWCHAIN : -nf_tables_chain_destroy (&trans->ctx); +nf_tables_chain_destroy (nft_trans_chain (trans));break ;case NFT_MSG_NEWRULE :nf_tables_rule_destroy (&trans->ctx,nft_trans_rule (trans));
@@ -9574,7 +9574,7 @@ int __nft_release_basechain(struct nft_c }nft_chain_del (ctx->chain);nft_use_dec (&ctx->table->use); -nf_tables_chain_destroy (ctx); +nf_tables_chain_destroy (ctx->chain);return 0 ; }
@@ -9646,10 +9646,9 @@ static void __nft_release_table(struct nnft_obj_destroy (&ctx, obj); }list_for_each_entry_safe (chain, nc, &table->chains, list) { - ctx.chain = chain;nft_chain_del (chain);nft_use_dec (&table->use); -nf_tables_chain_destroy (&ctx); +nf_tables_chain_destroy (chain); }list_del (&table->list);nf_tables_table_destroy (&ctx);
net/netfilter/nft_immediate.c +1 -1
@@ -221,7 +221,7 @@ static void nft_immediate_destroy(constlist_del (&rule->list);nf_tables_rule_destroy (&chain_ctx, rule); } -nf_tables_chain_destroy (&chain_ctx); +nf_tables_chain_destroy (chain);break ;default :break ;
Greg Kroah-Hartman
maintainerPATCH 113/270 netfilter: nf_tables: wait for rcu grace period on net_device removal
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
commit c03d278fdf35e73dd0ec543b9b556876b9d9a8dc upstream.
8c873e219970 ("netfilter: core: free hooks with call_rcu") removed synchronize_net() call when unregistering basechain hook, however, net_device removal event handler for the NFPROTO_NETDEV was not updated to wait for RCU grace period.
Note that 835b803377f5 ("netfilter: nf_tables_netdev: unregister hooks on net_device removal") does not remove basechain rules on device removal, I was hinted to remove rules on net_device removal later, see 5ebe0b0eec9d ("netfilter: nf_tables: destroy basechain and rules on netdevice removal").
Although NETDEV_UNREGISTER event is guaranteed to be handled after synchronize_net() call, this path needs to wait for rcu grace period via rcu callback to release basechain hooks if netns is alive because an ongoing netlink dump could be in progress (sockets hold a reference on the netns).
Note that nf_tables_pre_exit_net() unregisters and releases basechain hooks but it is possible to see NETDEV_UNREGISTER at a later stage in the netns exit path, eg. veth peer device in another netns:
cleanup_net()
default_device_exit_batch()
unregister_netdevice_many_notify()
notifier_call_chain()
nf_tables_netdev_event()
__nft_release_basechain()
In this particular case, same rule of thumb applies: if netns is alive, then wait for rcu grace period because netlink dump in the other netns could be in progress. Otherwise, if the other netns is going away then no netlink dump can be in progress and basechain hooks can be released inmediately.
While at it, turn WARN_ON() into WARN_ON_ONCE() for the basechain validation, which should not ever happen.
--- include/net/netfilter/nf_tables.h | 3 ++ net/netfilter/nf_tables_api.c | 41 +++++++++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 7 deletions(-)
include/net/netfilter/nf_tables.h +3 -0
@@ -962,6 +962,7 @@ struct nft_chain {char *name;u16 udlen;u8 *udata; +struct rcu_head rcu_head;/* Only used during control plane commit phase: */ struct nft_rule **rules_next;
@@ -1100,6 +1101,7 @@ static inline void nft_use_inc_restore(u* @sets: sets in the table * @objects: stateful objects in the table * @flowtables: flow tables in the table +* @net: netnamespace this table belongs to * @hgenerator: handle generator state * @handle: table handle * @use: number of chain references to this table
@@ -1115,6 +1117,7 @@ struct nft_table {struct list_head sets;struct list_head objects;struct list_head flowtables; +possible_net_t net;u64 hgenerator;u64 handle;u32 use;
net/netfilter/nf_tables_api.c +34 -7
62 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 114/270 netfilter: nf_tables: do not defer rule destruction via call_rcu
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit b04df3da1b5c6f6dc7cdccc37941740c078c4043 upstream.
nf_tables_chain_destroy can sleep, it can't be used from call_rcu callbacks.
Moreover, nf_tables_rule_release() is only safe for error unwinding, while transaction mutex is held and the to-be-desroyed rule was not exposed to either dataplane or dumps, as it deactives+frees without the required synchronize_rcu() in-between.
nft_rule_expr_deactivate() callbacks will change ->use counters of other chains/sets, see e.g. nft_lookup .deactivate callback, these must be serialized via transaction mutex.
Also add a few lockdep asserts to make this more explicit.
Calling synchronize_rcu() isn't ideal, but fixing this without is hard and way more intrusive. As-is, we can get:
WARNING: .. net/netfilter/nf_tables_api.c:5515 nft_set_destroy+0x..
Workqueue: events nf_tables_trans_destroy_work RIP: 0010:nft_set_destroy+0x3fe/0x5c0 Call Trace: <TASK> nf_tables_trans_destroy_work+0x6b7/0xad0 process_one_work+0x64a/0xce0 worker_thread+0x613/0x10d0
In case the synchronize_rcu becomes an issue, we can explore alternatives.
One way would be to allocate nft_trans_rule objects + one nft_trans_chain object, deactivate the rules + the chain and then defer the freeing to the nft destroy workqueue. We'd still need to keep the synchronize_rcu path as a fallback to handle -ENOMEM corner cases though.
--- include/net/netfilter/nf_tables.h | 3 --- net/netfilter/nf_tables_api.c | 32 +++++++++++++++----------------- 2 files changed, 15 insertions(+), 20 deletions(-)
include/net/netfilter/nf_tables.h +0 -3
@@ -962,7 +962,6 @@ struct nft_chain {char *name;u16 udlen;u8 *udata; -struct rcu_head rcu_head;/* Only used during control plane commit phase: */ struct nft_rule **rules_next;
@@ -1101,7 +1100,6 @@ static inline void nft_use_inc_restore(u* @sets: sets in the table * @objects: stateful objects in the table * @flowtables: flow tables in the table -* @net: netnamespace this table belongs to * @hgenerator: handle generator state * @handle: table handle * @use: number of chain references to this table
@@ -1117,7 +1115,6 @@ struct nft_table {struct list_head sets;struct list_head objects;struct list_head flowtables; -possible_net_t net;u64 hgenerator;u64 handle;u32 use;
net/netfilter/nf_tables_api.c +15 -17
@@ -1299,7 +1299,6 @@ static int nf_tables_newtable(struct netINIT_LIST_HEAD (&table->sets);INIT_LIST_HEAD (&table->objects);INIT_LIST_HEAD (&table->flowtables); -write_pnet (&table->net, net); table->family = family; table->flags = flags; table->handle = ++table_handle;
@@ -3345,8 +3344,11 @@ void nf_tables_rule_destroy(const structkfree (rule); } +/* can only be used if rule is no longer visible to dumps */ static void nf_tables_rule_release (const struct nft_ctx *ctx,struct nft_rule *rule) { +lockdep_commit_lock_is_held (ctx->net); +nft_rule_expr_deactivate (ctx, rule,NFT_TRANS_RELEASE );nf_tables_rule_destroy (ctx, rule); }
@@ -4858,6 +4860,8 @@ void nf_tables_deactivate_set(const strustruct nft_set_binding *binding, enum nft_trans_phase phase) { + lockdep_commit_lock_is_held(ctx->net); +switch (phase) {case NFT_TRANS_PREPARE_ERROR :nft_set_trans_unbind (ctx, set);
@@ -9571,19 +9575,6 @@ static void __nft_release_basechain_now(nf_tables_chain_destroy (ctx->chain); } -static void nft_release_basechain_rcu (struct rcu_head *head) -{ - struct nft_chain *chain = container_of(head, struct nft_chain, rcu_head); -struct nft_ctx ctx = { - .family = chain->table->family, - .chain = chain, - .net =read_pnet (&chain->table->net), - }; - -__nft_release_basechain_now (&ctx); -put_net (ctx.net); -} -int __nft_release_basechain (struct nft_ctx *ctx) {struct nft_rule *rule;
@@ -9598,11 +9589,18 @@ int __nft_release_basechain(struct nft_cnft_chain_del (ctx->chain);nft_use_dec (&ctx->table->use); -if (maybe_get_net (ctx->net)) -call_rcu (&ctx->chain->rcu_head, nft_release_basechain_rcu); -else +if (!maybe_get_net (ctx->net)) {__nft_release_basechain_now (ctx); +return 0 ; + } + +/* wait for ruleset dumps to complete. Owning chain is no longer in +* lists, so new dumps can't find any of these rules anymore. +*/ +synchronize_rcu (); +__nft_release_basechain_now (ctx); +put_net (ctx->net);return 0 ; }EXPORT_SYMBOL_GPL (__nft_release_basechain);
Re: [PATCH 5.10 114/270] netfilter: nf_tables: do not defer rule destruction via call_rcu
Quoted 8 lines · Greg Kroah-Hartman
5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
commit
b04df3da1b5c6f6dc7cdccc37941740c078c4043upstream.
..skip..
Quoted 2 lines
Also add a few lockdep asserts to make this more explicit.
..skip..
net/netfilter/nf_tables_api.c void nf_tables_deactivate_set(const stru · line 4863
Quoted 12 lines
net/netfilter/nf_tables_api.c +4
-0+/* can only be used if rule is no longer visible to dumps */ static void nf_tables_rule_release (const struct nft_ctx *ctx,struct nft_rule *rule) { +lockdep_commit_lock_is_held (ctx->net); +nft_rule_expr_deactivate (ctx, rule,NFT_TRANS_RELEASE ); }@@ -4858,6 +4860,8 @@ void nf_tables_deactivate_set(const strustruct nft_set_binding *binding, enum nft_trans_phase phase) { + lockdep_commit_lock_is_held(ctx->net);
I guess you meant WARN_ON_ONCE(!lockdep_commit_lock_is_held(ctx->net)); here?
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--
Alexey
Greg Kroah-Hartman
maintainerPATCH 115/270 ice: arfs: fix use-after-free when freeing @rx_cpu_rmap
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Lobakin <[email protected]>
commit d7442f512b71fc63a99c8a801422dde4fbbf9f93 upstream.
The CI testing bots triggered the following splat:
[ 718.203054] BUG: KASAN: use-after-free in free_irq_cpu_rmap+0x53/0x80
[ 718.206349] Read of size 4 at addr ffff8881bd127e00 by task sh/20834
[ 718.212852] CPU: 28 PID: 20834 Comm: sh Kdump: loaded Tainted: G S W IOE 5.17.0-rc8_nextqueue-devqueue-02643-g23f3121aca93 #1
[ 718.219695] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0012.070720200218 07/07/2020
[ 718.223418] Call Trace:
[ 718.227139]
[ 718.230783] dump_stack_lvl+0x33/0x42
[ 718.234431] print_address_description.constprop.9+0x21/0x170
[ 718.238177] ? free_irq_cpu_rmap+0x53/0x80
[ 718.241885] ? free_irq_cpu_rmap+0x53/0x80
[ 718.245539] kasan_report.cold.18+0x7f/0x11b
[ 718.249197] ? free_irq_cpu_rmap+0x53/0x80
[ 718.252852] free_irq_cpu_rmap+0x53/0x80
[ 718.256471] ice_free_cpu_rx_rmap.part.11+0x37/0x50 [ice]
[ 718.260174] ice_remove_arfs+0x5f/0x70 [ice]
[ 718.263810] ice_rebuild_arfs+0x3b/0x70 [ice]
[ 718.267419] ice_rebuild+0x39c/0xb60 [ice]
[ 718.270974] ? asm_sysvec_apic_timer_interrupt+0x12/0x20
[ 718.274472] ? ice_init_phy_user_cfg+0x360/0x360 [ice]
[ 718.278033] ? delay_tsc+0x4a/0xb0
[ 718.281513] ? preempt_count_sub+0x14/0xc0
[ 718.284984] ? delay_tsc+0x8f/0xb0
[ 718.288463] ice_do_reset+0x92/0xf0 [ice]
[ 718.292014] ice_pci_err_resume+0x91/0xf0 [ice]
[ 718.295561] pci_reset_function+0x53/0x80
<...>
[ 718.393035] Allocated by task 690:
[ 718.433497] Freed by task 20834:
[ 718.495688] Last potentially related work creation:
[ 718.568966] The buggy address belongs to the object at ffff8881bd127e00
which belongs to the cache kmalloc-96 of size 96
[ 718.574085] The buggy address is located 0 bytes inside of
96-byte region [ffff8881bd127e00, ffff8881bd127e60)
[ 718.579265] The buggy address belongs to the page:
[ 718.598905] Memory state around the buggy address:
[ 718.601809] ffff8881bd127d00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[ 718.604796] ffff8881bd127d80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
[ 718.607794] >ffff8881bd127e00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[ 718.610811] ^
[ 718.613819] ffff8881bd127e80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[ 718.617107] ffff8881bd127f00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fcThis is due to that free_irq_cpu_rmap() is always being called *after* (devm_)free_irq() and thus it tries to work with IRQ descs already freed. For example, on device reset the driver frees the rmap right before allocating a new one (the splat above). Make rmap creation and freeing function symmetrical with {request,free}_irq() calls i.e. do that on ifup/ifdown instead of device probe/remove/resume. These operations can be performed independently from the actual device aRFS configuration. Also, make sure ice_vsi_free_irq() clears IRQ affinity notifiers only when aRFS is disabled -- otherwise, CPU rmap sets and clears its own and they must not be touched manually.
--- drivers/net/ethernet/intel/ice/ice_arfs.c | 9 ++------- drivers/net/ethernet/intel/ice/ice_lib.c | 5 ++++- drivers/net/ethernet/intel/ice/ice_main.c | 20 ++++++++------------ 3 files changed, 14 insertions(+), 20 deletions(-)
drivers/net/ethernet/intel/ice/ice_arfs.c +2 -7
@@ -577,7 +577,7 @@ void ice_free_cpu_rx_rmap(struct ice_vsi {struct net_device *netdev; -if (!vsi || vsi->type !=ICE_VSI_PF || !vsi->arfs_fltr_list) +if (!vsi || vsi->type !=ICE_VSI_PF )return ; netdev = vsi->netdev;
@@ -600,7 +600,7 @@ int ice_set_cpu_rx_rmap(struct ice_vsi *int base_idx, i;if (!vsi || vsi->type !=ICE_VSI_PF ) -return -EINVAL ; +return 0 ; pf = vsi->back; netdev = vsi->netdev;
@@ -638,7 +638,6 @@ void ice_remove_arfs(struct ice_pf *pf)if (!pf_vsi)return ; -ice_free_cpu_rx_rmap (pf_vsi);ice_clear_arfs (pf_vsi); }
@@ -655,9 +654,5 @@ void ice_rebuild_arfs(struct ice_pf *pf)return ;ice_remove_arfs (pf); -if (ice_set_cpu_rx_rmap (pf_vsi)) { -dev_err (ice_pf_to_dev (pf),"Failed to rebuild aRFS\n" ); -return ; - }ice_init_arfs (pf_vsi); }
drivers/net/ethernet/intel/ice/ice_lib.c +4 -1
@@ -2411,6 +2411,8 @@ void ice_vsi_free_irq(struct ice_vsi *vsreturn ; vsi->irqs_ready = false; +ice_free_cpu_rx_rmap (vsi); +ice_for_each_q_vector (vsi, i) {u16 vector = i + base;int irq_num;
@@ -2424,7 +2426,8 @@ void ice_vsi_free_irq(struct ice_vsi *vscontinue ;/* clear the affinity notifier in the IRQ descriptor */ -irq_set_affinity_notifier (irq_num,NULL ); +if (!IS_ENABLED (CONFIG_RFS_ACCEL )) +irq_set_affinity_notifier (irq_num,NULL );/* clear the affinity_mask in the IRQ descriptor */ irq_set_affinity_hint (irq_num,NULL );
drivers/net/ethernet/intel/ice/ice_main.c +8 -12
@@ -2247,6 +2247,13 @@ static int ice_vsi_req_irq_msix(struct iirq_set_affinity_hint (irq_num, &q_vector->affinity_mask); } + err =ice_set_cpu_rx_rmap (vsi); +if (err) { +netdev_err (vsi->netdev,"Failed to setup CPU RMAP on VSI %u: %pe\n" , + vsi->vsi_num,ERR_PTR (err)); + goto free_q_irqs; + } + vsi->irqs_ready = true;return 0 ;
@@ -3242,22 +3249,12 @@ static int ice_setup_pf_sw(struct ice_pf*/ ice_napi_add (vsi); - status =ice_set_cpu_rx_rmap (vsi); -if (status) { -dev_err (ice_pf_to_dev (pf),"Failed to set CPU Rx map VSI %d error %d\n" , - vsi->vsi_num, status); - status = -EINVAL ; - goto unroll_napi_add; - } status =ice_init_mac_fltr (pf);if (status) - goto free_cpu_rx_map; + goto unroll_napi_add;return status; -free_cpu_rx_map: -ice_free_cpu_rx_rmap (vsi); - unroll_napi_add:if (vsi) {ice_napi_del (vsi);
@@ -4598,7 +4595,6 @@ static int __maybe_unused ice_suspend(stcontinue ;ice_vsi_free_q_vectors (pf->vsi[v]); } -ice_free_cpu_rx_rmap (ice_get_main_vsi (pf));ice_clear_interrupt_scheme (pf);pci_save_state (pdev);
Greg Kroah-Hartman
maintainerPATCH 116/270 scsi: target: iscsi: Fix timeout on deleted connection
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Bogdanov <[email protected]>
[ Upstream commit 7f533cc5ee4c4436cee51dc58e81dfd9c3384418 ]
NOPIN response timer may expire on a deleted connection and crash with such logs:
Did not receive response to NOPIN on CID: 0, failing connection for I_T Nexus (null),i,0x00023d000125,iqn.2017-01.com.iscsi.target,t,0x3d
BUG: Kernel NULL pointer dereference on read at 0x00000000 NIP strlcpy+0x8/0xb0 LR iscsit_fill_cxn_timeout_err_stats+0x5c/0xc0 [iscsi_target_mod] Call Trace: iscsit_handle_nopin_response_timeout+0xfc/0x120 [iscsi_target_mod] call_timer_fn+0x58/0x1f0 run_timer_softirq+0x740/0x860 __do_softirq+0x16c/0x420 irq_exit+0x188/0x1c0 timer_interrupt+0x184/0x410
That is because nopin response timer may be re-started on nopin timer expiration.
Stop nopin timer before stopping the nopin response timer to be sure that no one of them will be re-started.
--- drivers/target/iscsi/iscsi_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/iscsi/iscsi_target.c +1 -1
@@ -4168,8 +4168,8 @@ int iscsit_close_connection(spin_unlock (&iscsit_global->ts_bitmap_lock);iscsit_stop_timers_for_cmds (conn); -iscsit_stop_nopin_response_timer (conn);iscsit_stop_nopin_timer (conn); +iscsit_stop_nopin_response_timer (conn);if (conn->conn_transport->iscsit_wait_conn) conn->conn_transport->iscsit_wait_conn (conn);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 117/270 dma-mapping: avoid potential unused data compilation warning
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
[ Upstream commit c9b19ea63036fc537a69265acea1b18dabd1cbd3 ]
When CONFIG_NEED_DMA_MAP_STATE is not defined, dma-mapping clients might report unused data compilation warnings for dma_unmap_*() calls arguments. Redefine macros for those calls to let compiler to notice that it is okay when the provided arguments are not used.
--- include/linux/dma-mapping.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
include/linux/dma-mapping.h +8 -4
@@ -568,10 +568,14 @@ static inline int dma_mmap_wc(struct device *dev,#else #define DEFINE_DMA_UNMAP_ADDR (ADDR_NAME )#define DEFINE_DMA_UNMAP_LEN (LEN_NAME ) -#define dma_unmap_addr (PTR ,ADDR_NAME ) (0) -#define dma_unmap_addr_set (PTR ,ADDR_NAME ,VAL ) do { } while (0) -#define dma_unmap_len (PTR ,LEN_NAME ) (0) -#define dma_unmap_len_set (PTR ,LEN_NAME ,VAL ) do { } while (0) +#define dma_unmap_addr (PTR ,ADDR_NAME ) \ + ({ typeof(PTR) __p __maybe_unused = PTR; 0; }) +#define dma_unmap_addr_set (PTR ,ADDR_NAME ,VAL ) \ + do { typeof(PTR) __p __maybe_unused = PTR; } while (0) +#define dma_unmap_len (PTR ,LEN_NAME ) \ + ({ typeof(PTR) __p __maybe_unused = PTR; 0; }) +#define dma_unmap_len_set (PTR ,LEN_NAME ,VAL ) \ + do { typeof(PTR) __p __maybe_unused = PTR; } while (0)#endif /*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 118/270 cgroup: Fix compilation issue due to cgroup_mutex not being exported
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: gaoxu <[email protected]>
[ Upstream commit 87c259a7a359e73e6c52c68fcbec79988999b4e6 ]
When adding folio_memcg function call in the zram module for Android16-6.12, the following error occurs during compilation:
ERROR: modpost: "cgroup_mutex" [../soc-repo/zram.ko] undefined!
This error is caused by the indirect call to lockdep_is_held(&cgroup_mutex) within folio_memcg. The export setting for cgroup_mutex is controlled by the CONFIG_PROVE_RCU macro. If CONFIG_LOCKDEP is enabled while CONFIG_PROVE_RCU is not, this compilation error will occur.
To resolve this issue, add a parallel macro CONFIG_LOCKDEP control to ensure cgroup_mutex is properly exported when needed.
--- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/cgroup.c +1 -1
@@ -81,7 +81,7 @@DEFINE_MUTEX (cgroup_mutex);DEFINE_SPINLOCK (css_set_lock); -#ifdef CONFIG_PROVE_RCU +#if (definedCONFIG_PROVE_RCU || definedCONFIG_LOCKDEP )EXPORT_SYMBOL_GPL (cgroup_mutex);EXPORT_SYMBOL_GPL (css_set_lock);#endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 119/270 kconfig: merge_config: use an empty file as initfile
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Gomez <[email protected]>
[ Upstream commit a26fe287eed112b4e21e854f173c8918a6a8596d ]
The scripts/kconfig/merge_config.sh script requires an existing $INITFILE (or the $1 argument) as a base file for merging Kconfig fragments. However, an empty $INITFILE can serve as an initial starting point, later referenced by the KCONFIG_ALLCONFIG Makefile variable if -m is not used. This variable can point to any configuration file containing preset config symbols (the merged output) as stated in Documentation/kbuild/kconfig.rst. When -m is used $INITFILE will contain just the merge output requiring the user to run make (i.e. KCONFIG_ALLCONFIG=<$INITFILE> make <allnoconfig/alldefconfig> or make olddefconfig).
Instead of failing when $INITFILE is missing, create an empty file and use it as the starting point for merges.
--- scripts/kconfig/merge_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kconfig/merge_config.sh +2 -2
@@ -98,8 +98,8 @@ INITFILE=$1 shift; if [ ! -r "$INITFILE" ]; then - echo "The base file '$INITFILE' does not exist. Exit." >&2 - exit 1 + echo "The base file '$INITFILE' does not exist. Creating one..." >&2 + touch "$INITFILE" fi MERGE_LIST=$*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 120/270 NFSv4: Check for delegation validity in nfs_start_delegation_return_locked()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 9e8f324bd44c1fe026b582b75213de4eccfa1163 ]
Check that the delegation is still attached after taking the spin lock in nfs_start_delegation_return_locked().
--- fs/nfs/delegation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfs/delegation.c +2 -1
@@ -297,7 +297,8 @@ nfs_start_delegation_return_locked(struct nfs_inode *nfsi)if (delegation ==NULL ) goto out;spin_lock (&delegation->lock); -if (!test_and_set_bit (NFS_DELEGATION_RETURNING , &delegation->flags)) { +if (delegation->inode && + !test_and_set_bit (NFS_DELEGATION_RETURNING , &delegation->flags)) {clear_bit (NFS_DELEGATION_RETURN_DELAYED , &delegation->flags);/* Refcount matched in nfs_end_delegation_return() */ ret =nfs_get_delegation (delegation);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 121/270 mailbox: use error ret code of of_parse_phandle_with_args()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tudor Ambarus <[email protected]>
[ Upstream commit 24fdd5074b205cfb0ef4cd0751a2d03031455929 ]
In case of error, of_parse_phandle_with_args() returns -EINVAL when the passed index is negative, or -ENOENT when the index is for an empty phandle. The mailbox core overwrote the error return code with a less precise -ENODEV. Use the error returned code from of_parse_phandle_with_args().
--- drivers/mailbox/mailbox.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mailbox/mailbox.c +4 -3
@@ -350,11 +350,12 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)mutex_lock (&con_mutex); -if (of_parse_phandle_with_args (dev->of_node,"mboxes" , -"#mbox-cells" , index, &spec)) { + ret =of_parse_phandle_with_args (dev->of_node,"mboxes" ,"#mbox-cells" , + index, &spec); +if (ret) {dev_dbg (dev,"%s: can't parse \"mboxes\" property\n" , __func__);mutex_unlock (&con_mutex); -return ERR_PTR (-ENODEV ); +return ERR_PTR (ret); } chan =ERR_PTR (-EPROBE_DEFER );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 122/270 fbdev: fsl-diu-fb: add missing device_remove_file()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shixiong Ou <[email protected]>
[ Upstream commit 86d16cd12efa547ed43d16ba7a782c1251c80ea8 ]
Call device_remove_file() when driver remove.
--- drivers/video/fbdev/fsl-diu-fb.c | 1 + 1 file changed, 1 insertion(+)
drivers/video/fbdev/fsl-diu-fb.c +1 -0
@@ -1830,6 +1830,7 @@ static int fsl_diu_remove(struct platform_device *pdev)int i; data =dev_get_drvdata (&pdev->dev); +device_remove_file (&pdev->dev, &data->dev_attr);disable_lcdc (&data->fsl_diu_info[0 ]);free_irq (data->irq, data->diu_reg);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 123/270 fbcon: Use correct erase colour for clearing in fbcon
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zsolt Kajtar <[email protected]>
[ Upstream commit 892c788d73fe4a94337ed092cb998c49fa8ecaf4 ]
The erase colour calculation for fbcon clearing should use get_color instead of attr_col_ec, like everything else. The latter is similar but is not correct. For example it's missing the depth dependent remapping and doesn't care about blanking.
The problem can be reproduced by setting up the background colour to grey (vt.color=0x70) and having an fbcon console set to 2bpp (4 shades of gray). Now the background attribute should be 1 (dark gray) on the console.
If the screen is scrolled when pressing enter in a shell prompt at the bottom line then the new line is cleared using colour 7 instead of 1. That's not something fillrect likes (at 2bbp it expect 0-3) so the result is interesting.
This patch switches to get_color with vc_video_erase_char to determine the erase colour from attr_col_ec. That makes the latter function redundant as no other users were left.
Use correct erase colour for clearing in fbcon
--- drivers/video/fbdev/core/bitblit.c | 5 ++-- drivers/video/fbdev/core/fbcon.c | 10 +++++--- drivers/video/fbdev/core/fbcon.h | 38 +--------------------------- drivers/video/fbdev/core/fbcon_ccw.c | 5 ++-- drivers/video/fbdev/core/fbcon_cw.c | 5 ++-- drivers/video/fbdev/core/fbcon_ud.c | 5 ++-- drivers/video/fbdev/core/tileblit.c | 8 +++--- 7 files changed, 18 insertions(+), 58 deletions(-)
drivers/video/fbdev/core/bitblit.c +2 -3
@@ -59,12 +59,11 @@ static void bit_bmove(struct vc_data *vc, struct fb_info *info, int sy, }static void bit_clear (struct vc_data *vc,struct fb_info *info,int sy, -int sx,int height,int width) +int sx,int height,int width,int fg,int bg) { -int bgshift = (vc->vc_hi_font_mask) ?13 :12 ;struct fb_fillrect region; - region.color =attr_bgcol_ec (bgshift, vc, info); + region.color = bg; region.dx = sx * vc->vc_font.width; region.dy = sy * vc->vc_font.height; region.width = width * vc->vc_font.width;
drivers/video/fbdev/core/fbcon.c +6 -4
@@ -1266,7 +1266,7 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, {struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];struct fbcon_ops *ops = info->fbcon_par; - +int fg, bg;struct fbcon_display *p = &fb_display[vc->vc_num];u_int y_break;
@@ -1287,16 +1287,18 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,fbcon_clear_margins (vc,0 ); } + fg =get_color (vc, info, vc->vc_video_erase_char,1 ); + bg =get_color (vc, info, vc->vc_video_erase_char,0 );/* Split blits that cross physical y_wrap boundary */ y_break = p->vrows - p->yscroll;if (sy < y_break && sy + height -1 >= y_break) {u_int b = y_break - sy; - ops->clear (vc, info,real_y (p, sy), sx, b, width); + ops->clear (vc, info,real_y (p, sy), sx, b, width, fg, bg); ops->clear (vc, info,real_y (p, sy + b), sx, height - b, - width); + width, fg, bg); }else - ops->clear (vc, info,real_y (p, sy), sx, height, width); + ops->clear (vc, info,real_y (p, sy), sx, height, width, fg, bg); } static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
drivers/video/fbdev/core/fbcon.h +1 -37
@@ -57,7 +57,7 @@ struct fbcon_ops {void (*bmove)(struct vc_data *vc,struct fb_info *info,int sy,int sx,int dy,int dx,int height,int width);void (*clear)(struct vc_data *vc,struct fb_info *info,int sy, -int sx,int height,int width); +int sx,int height,int width,int fb,int bg);void (*putcs)(struct vc_data *vc,struct fb_info *info,const unsigned short *s,int count,int yy,int xx,int fg,int bg);
@@ -118,42 +118,6 @@ static inline int mono_col(const struct fb_info *info)return (~(0xfff << max_len)) &0xff ; } -static inline int attr_col_ec (int shift,struct vc_data *vc, -struct fb_info *info,int is_fg) -{ -int is_mono01; -int col; -int fg; -int bg; - -if (!vc) -return 0 ; - -if (vc->vc_can_do_color) -return is_fg ?attr_fgcol (shift,vc->vc_video_erase_char) - :attr_bgcol (shift,vc->vc_video_erase_char); - -if (!info) -return 0 ; - - col =mono_col (info); - is_mono01 = info->fix.visual ==FB_VISUAL_MONO01 ; - -if (attr_reverse (vc->vc_video_erase_char)) { - fg = is_mono01 ? col :0 ; - bg = is_mono01 ?0 : col; - } -else { - fg = is_mono01 ?0 : col; - bg = is_mono01 ? col :0 ; - } - -return is_fg ? fg : bg; -} - -#define attr_bgcol_ec (bgshift, vc, info) attr_col_ec(bgshift, vc, info, 0) -#define attr_fgcol_ec (fgshift, vc, info) attr_col_ec(fgshift, vc, info, 1) -/* * Scroll Method */
drivers/video/fbdev/core/fbcon_ccw.c +2 -3
@@ -78,14 +78,13 @@ static void ccw_bmove(struct vc_data *vc, struct fb_info *info, int sy, }static void ccw_clear (struct vc_data *vc,struct fb_info *info,int sy, -int sx,int height,int width) +int sx,int height,int width,int fg,int bg) {struct fbcon_ops *ops = info->fbcon_par;struct fb_fillrect region; -int bgshift = (vc->vc_hi_font_mask) ?13 :12 ;u32 vyres =GETVYRES (ops->p, info); - region.color =attr_bgcol_ec (bgshift,vc,info); + region.color = bg; region.dx = sy * vc->vc_font.height; region.dy = vyres - ((sx + width) * vc->vc_font.width); region.height = width * vc->vc_font.width;
drivers/video/fbdev/core/fbcon_cw.c +2 -3
@@ -63,14 +63,13 @@ static void cw_bmove(struct vc_data *vc, struct fb_info *info, int sy, }static void cw_clear (struct vc_data *vc,struct fb_info *info,int sy, -int sx,int height,int width) +int sx,int height,int width,int fg,int bg) {struct fbcon_ops *ops = info->fbcon_par;struct fb_fillrect region; -int bgshift = (vc->vc_hi_font_mask) ?13 :12 ;u32 vxres =GETVXRES (ops->p, info); - region.color =attr_bgcol_ec (bgshift,vc,info); + region.color = bg; region.dx = vxres - ((sy + height) * vc->vc_font.height); region.dy = sx * vc->vc_font.width; region.height = width * vc->vc_font.width;
drivers/video/fbdev/core/fbcon_ud.c +2 -3
@@ -64,15 +64,14 @@ static void ud_bmove(struct vc_data *vc, struct fb_info *info, int sy, }static void ud_clear (struct vc_data *vc,struct fb_info *info,int sy, -int sx,int height,int width) +int sx,int height,int width,int fg,int bg) {struct fbcon_ops *ops = info->fbcon_par;struct fb_fillrect region; -int bgshift = (vc->vc_hi_font_mask) ?13 :12 ;u32 vyres =GETVYRES (ops->p, info);u32 vxres =GETVXRES (ops->p, info); - region.color =attr_bgcol_ec (bgshift,vc,info); + region.color = bg; region.dy = vyres - ((sy + height) * vc->vc_font.height); region.dx = vxres - ((sx + width) * vc->vc_font.width); region.width = width * vc->vc_font.width;
drivers/video/fbdev/core/tileblit.c +3 -5
@@ -33,16 +33,14 @@ static void tile_bmove(struct vc_data *vc, struct fb_info *info, int sy, }static void tile_clear (struct vc_data *vc,struct fb_info *info,int sy, -int sx,int height,int width) +int sx,int height,int width,int fg,int bg) {struct fb_tilerect rect; -int bgshift = (vc->vc_hi_font_mask) ?13 :12 ; -int fgshift = (vc->vc_hi_font_mask) ?9 :8 ; rect.index = vc->vc_video_erase_char & ((vc->vc_hi_font_mask) ?0x1ff :0xff ); - rect.fg =attr_fgcol_ec (fgshift, vc, info); - rect.bg =attr_bgcol_ec (bgshift, vc, info); + rect.fg = fg; + rect.bg = bg; rect.sx = sx; rect.sy = sy; rect.width = width;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 124/270 fbdev: core: tileblit: Implement missing margin clearing for tileblit
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zsolt Kajtar <[email protected]>
[ Upstream commit 76d3ca89981354e1f85a3e0ad9ac4217d351cc72 ]
I was wondering why there's garbage at the bottom of the screen when tile blitting is used with an odd mode like 1080, 600 or 200. Sure there's only space for half a tile but the same area is clean when the buffer is bitmap.
Then later I found that it's supposed to be cleaned but that's not implemented. So I took what's in bitblit and adapted it for tileblit.
This implementation was tested for both the horizontal and vertical case, and now does the same as what's done for bitmap buffers.
If anyone is interested to reproduce the problem then I could bet that'd be on a S3 or Ark. Just set up a mode with an odd line count and make sure that the virtual size covers the complete tile at the bottom. E.g. for 600 lines that's 608 virtual lines for a 16 tall tile. Then the bottom area should be cleaned.
For the right side it's more difficult as there the drivers won't let an odd size happen, unless the code is modified. But once it reports back a few pixel columns short then fbcon won't use the last column. With the patch that column is now clean.
Btw. the virtual size should be rounded up by the driver for both axes (not only the horizontal) so that it's dividable by the tile size. That's a driver bug but correcting it is not in scope for this patch.
Implement missing margin clearing for tileblit
--- drivers/video/fbdev/core/tileblit.c | 37 ++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
drivers/video/fbdev/core/tileblit.c +36 -1
@@ -75,7 +75,42 @@ static void tile_putcs(struct vc_data *vc, struct fb_info *info,static void tile_clear_margins (struct vc_data *vc,struct fb_info *info,int color,int bottom_only) { -return ; +unsigned int cw = vc->vc_font.width; +unsigned int ch = vc->vc_font.height; +unsigned int rw = info->var.xres - (vc->vc_cols*cw); +unsigned int bh = info->var.yres - (vc->vc_rows*ch); +unsigned int rs = info->var.xres - rw; +unsigned int bs = info->var.yres - bh; +unsigned int vwt = info->var.xres_virtual / cw; +unsigned int vht = info->var.yres_virtual / ch; +struct fb_tilerect rect; + + rect.index = vc->vc_video_erase_char & + ((vc->vc_hi_font_mask) ?0x1ff :0xff ); + rect.fg = color; + rect.bg = color; + +if ((int ) rw >0 && !bottom_only) { + rect.sx = (info->var.xoffset + rs + cw -1 ) / cw; + rect.sy =0 ; + rect.width = (rw + cw -1 ) / cw; + rect.height = vht; +if (rect.width + rect.sx > vwt) + rect.width = vwt - rect.sx; +if (rect.sx < vwt) + info->tileops->fb_tilefill (info, &rect); + } + +if ((int ) bh >0 ) { + rect.sx = info->var.xoffset / cw; + rect.sy = (info->var.yoffset + bs) / ch; + rect.width = rs / cw; + rect.height = (bh + ch -1 ) / ch; +if (rect.height + rect.sy > vht) + rect.height = vht - rect.sy; +if (rect.sy < vht) + info->tileops->fb_tilefill (info, &rect); + } } static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 125/270 NFSv4: Treat ENETUNREACH errors as fatal for state recovery
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 0af5fb5ed3d2fd9e110c6112271f022b744a849a ]
If a containerised process is killed and causes an ENETUNREACH or ENETDOWN error to be propagated to the state manager, then mark the nfs_client as being dead so that we don't loop in functions that are expecting recovery to succeed.
--- fs/nfs/nfs4state.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
fs/nfs/nfs4state.c +9 -1
@@ -2719,7 +2719,15 @@ static void nfs4_state_manager(struct nfs_client *clp)pr_warn_ratelimited ("NFS: state manager%s%s failed on NFSv4 server %s" " with error %d\n" , section_sep, section, clp->cl_hostname, -status); -ssleep (1 ); +switch (status) { +case -ENETDOWN : +case -ENETUNREACH : +nfs_mark_client_ready (clp, -EIO ); +break ; +default : +ssleep (1 ); +break ; + } out_drain:memalloc_nofs_restore (memflags);nfs4_end_drain_session (clp);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 126/270 SUNRPC: rpc_clnt_set_transport() must not change the autobind setting
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit bf9be373b830a3e48117da5d89bb6145a575f880 ]
The autobind setting was supposed to be determined in rpc_create(), since commit c2866763b402 ("SUNRPC: use sockaddr + size when creating remote transport endpoints").
--- net/sunrpc/clnt.c | 3 --- 1 file changed, 3 deletions(-)
net/sunrpc/clnt.c +0 -3
@@ -273,9 +273,6 @@ static struct rpc_xprt *rpc_clnt_set_transport(struct rpc_clnt *clnt, old =rcu_dereference_protected (clnt->cl_xprt,lockdep_is_held (&clnt->cl_lock)); -if (!xprt_bound (xprt)) - clnt->cl_autobind =1 ; - clnt->cl_timeout = timeout;rcu_assign_pointer (clnt->cl_xprt, xprt);spin_unlock (&clnt->cl_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 127/270 SUNRPC: rpcbind should never reset the port to the value 0
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit 214c13e380ad7636631279f426387f9c4e3c14d9 ]
If we already had a valid port number for the RPC service, then we should not allow the rpcbind client to set it to the invalid value '0'.
--- net/sunrpc/rpcb_clnt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/sunrpc/rpcb_clnt.c +3 -2
@@ -794,9 +794,10 @@ static void rpcb_getport_done(struct rpc_task *child, void *data) }trace_rpcb_setport (child, map->r_status, map->r_port); - xprt->ops->set_port (xprt, map->r_port); -if (map->r_port) +if (map->r_port) { + xprt->ops->set_port (xprt, map->r_port);xprt_set_bound (xprt); + } }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 128/270 thermal/drivers/qoriq: Power down TMU on system suspend
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Guo <[email protected]>
[ Upstream commit 229f3feb4b0442835b27d519679168bea2de96c2 ]
Enable power-down of TMU (Thermal Management Unit) for TMU version 2 during system suspend to save power. Save approximately 4.3mW on VDD_ANA_1P8 on i.MX93 platforms.
--- drivers/thermal/qoriq_thermal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/thermal/qoriq_thermal.c +13 -0
@@ -19,6 +19,7 @@#define SITES_MAX 16#define TMR_DISABLE 0x0#define TMR_ME 0x80000000 +#define TMR_CMD BIT(29)#define TMR_ALPF 0x0c000000#define TMR_ALPF_V2 0x03000000#define TMTMIR_DEFAULT 0x0000000f
@@ -345,6 +346,12 @@ static int __maybe_unused qoriq_tmu_suspend(struct device *dev)if (ret)return ret; +if (data->ver >TMU_VER1 ) { + ret =regmap_set_bits (data->regmap,REGS_TMR ,TMR_CMD ); +if (ret) +return ret; + } +clk_disable_unprepare (data->clk);return 0 ;
@@ -359,6 +366,12 @@ static int __maybe_unused qoriq_tmu_resume(struct device *dev)if (ret)return ret; +if (data->ver >TMU_VER1 ) { + ret =regmap_clear_bits (data->regmap,REGS_TMR ,TMR_CMD ); +if (ret) +return ret; + } +/* Enable monitoring */ return regmap_update_bits (data->regmap,REGS_TMR ,TMR_ME ,TMR_ME ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 129/270 dql: Fix dql->limit value when reset.
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jing Su <[email protected]>
[ Upstream commit 3a17f23f7c36bac3a3584aaf97d3e3e0b2790396 ]
Executing dql_reset after setting a non-zero value for limit_min can lead to an unreasonable situation where dql->limit is less than dql->limit_min.
For instance, after setting /sys/class/net/eth*/queues/tx-0/byte_queue_limits/limit_min, an ifconfig down/up operation might cause the ethernet driver to call netdev_tx_reset_queue, which in turn invokes dql_reset.
In this case, dql->limit is reset to 0 while dql->limit_min remains non-zero value, which is unexpected. The limit should always be greater than or equal to limit_min.
--- lib/dynamic_queue_limits.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dynamic_queue_limits.c +1 -1
@@ -116,7 +116,7 @@ EXPORT_SYMBOL(dql_completed);void dql_reset (struct dql *dql) {/* Reset all dynamic values */ - dql->limit =0 ; + dql->limit = dql->min_limit; dql->num_queued =0 ; dql->num_completed =0 ; dql->last_obj_cnt =0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 130/270 tools/build: Dont pass test log files to linker
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <[email protected]>
[ Upstream commit 935e7cb5bb80106ff4f2fe39640f430134ef8cd8 ]
Separate test log files from object files. Depend on test log output but don't pass to the linker.
--- tools/build/Makefile.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/build/Makefile.build +5 -1
@@ -130,6 +130,10 @@ objprefix := $(subst ./,,$(OUTPUT)$(dir)/) obj-y := $(addprefix $(objprefix),$(obj-y)) subdir-obj-y := $(addprefix $(objprefix),$(subdir-obj-y)) +# Separate out test log files from real build objects. +test-y := $(filter %_log, $(obj-y)) +obj-y := $(filter-out %_log, $(obj-y)) + # Final '$(obj)-in.o' object in-target := $(objprefix)$(obj)-in.o
@@ -140,7 +144,7 @@ $(subdir-y): $(sort $(subdir-obj-y)): $(subdir-y) ; -$(in-target): $(obj-y) FORCE +$(in-target): $(obj-y) $(test-y) FORCE $(call rule_mkdir) $(call if_changed,$(host)ld_multi)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 131/270 pNFS/flexfiles: Report ENETDOWN as a connection error
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit aa42add73ce9b9e3714723d385c254b75814e335 ]
If the client should see an ENETDOWN when trying to connect to the data server, it might still be able to talk to the metadata server through another NIC. If so, report the error.
--- fs/nfs/flexfilelayout/flexfilelayout.c | 1 + 1 file changed, 1 insertion(+)
fs/nfs/flexfilelayout/flexfilelayout.c +1 -0
@@ -1260,6 +1260,7 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,case -ECONNRESET :case -EHOSTDOWN :case -EHOSTUNREACH : +case -ENETDOWN :case -ENETUNREACH :case -EADDRINUSE :case -ENOBUFS :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 132/270 libnvdimm/labels: Fix divide error in nd_label_data_init()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Richter <[email protected]>
[ Upstream commit ef1d3455bbc1922f94a91ed58d3d7db440652959 ]
If a faulty CXL memory device returns a broken zero LSA size in its memory device information (Identify Memory Device (Opcode 4000h), CXL spec. 3.1, 8.2.9.9.1.1), a divide error occurs in the libnvdimm driver:
Oops: divide error: 0000 [#1] PREEMPT SMP NOPTI RIP: 0010:nd_label_data_init+0x10e/0x800 [libnvdimm]
Code and flow:
1) CXL Command 4000h returns LSA size = 0
2) config_size is assigned to zero LSA size (CXL pmem driver):
drivers/cxl/pmem.c: .config_size = mds->lsa_size,
3) max_xfer is set to zero (nvdimm driver):
drivers/nvdimm/label.c: max_xfer = min_t(size_t, ndd->nsarea.max_xfer, config_size);
4) A subsequent DIV_ROUND_UP() causes a division by zero:
drivers/nvdimm/label.c: /* Make our initial read size a multiple of max_xfer size */ drivers/nvdimm/label.c: read_size = min(DIV_ROUND_UP(read_size, max_xfer) * max_xfer,drivers/nvdimm/label.c- config_size);
Fix this by checking the config size parameter by extending an existing check.
--- drivers/nvdimm/label.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvdimm/label.c +2 -1
@@ -421,7 +421,8 @@ int nd_label_data_init(struct nvdimm_drvdata *ndd)if (ndd->data)return 0 ; -if (ndd->nsarea.status || ndd->nsarea.max_xfer ==0 ) { +if (ndd->nsarea.status || ndd->nsarea.max_xfer ==0 || + ndd->nsarea.config_size ==0 ) {dev_dbg (ndd->dev,"failed to init config data area: (%u:%u)\n" , ndd->nsarea.max_xfer, ndd->nsarea.config_size);return -ENXIO ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 133/270 mmc: host: Wait for Vdd to settle on card power off
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erick Shepherd <[email protected]>
[ Upstream commit 31e75ed964582257f59156ce6a42860e1ae4cc39 ]
The SD spec version 6.0 section 6.4.1.5 requires that Vdd must be lowered to less than 0.5V for a minimum of 1 ms when powering off a card. Increase wait to 15 ms so that voltage has time to drain down to 0.5V and cards can power off correctly. Issues with voltage drain time were only observed on Apollo Lake and Bay Trail host controllers so this fix is limited to those devices.
--- drivers/mmc/host/sdhci-pci-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-pci-core.c +5 -1
@@ -666,8 +666,12 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode,sdhci_set_power (host, mode, vdd); -if (mode ==MMC_POWER_OFF ) +if (mode ==MMC_POWER_OFF ) { +if (slot->chip->pdev->device ==PCI_DEVICE_ID_INTEL_APL_SD || + slot->chip->pdev->device ==PCI_DEVICE_ID_INTEL_BYT_SD ) +usleep_range (15000 ,17500 );return ; + }/* * Bus power might not enable after D3 -> D0 transition due to the
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 134/270 i2c: qup: Vote for interconnect bandwidth to DRAM
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
[ Upstream commit d4f35233a6345f62637463ef6e0708f44ffaa583 ]
When the I2C QUP controller is used together with a DMA engine it needs to vote for the interconnect path to the DRAM. Otherwise it may be unable to access the memory quickly enough.
The requested peak bandwidth is dependent on the I2C core clock.
To avoid sending votes too often the bandwidth is always requested when a DMA transfer starts, but dropped only on runtime suspend. Runtime suspend should only happen if no transfer is active. After resumption we can defer the next vote until the first DMA transfer actually happens.
The implementation is largely identical to the one introduced for spi-qup in commit ecdaa9473019 ("spi: qup: Vote for interconnect bandwidth to DRAM") since both drivers represent the same hardware block.
--- drivers/i2c/busses/i2c-qup.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
drivers/i2c/busses/i2c-qup.c +36 -0
@@ -14,6 +14,7 @@#include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/i2c.h> +#include <linux/interconnect.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/module.h>
@@ -150,6 +151,8 @@/* TAG length for DATA READ in RX FIFO */ #define READ_RX_TAGS_LEN 2 +#define QUP_BUS_WIDTH 8 +static unsigned int scl_freq;module_param_named (scl_freq, scl_freq, uint,0444 );MODULE_PARM_DESC (scl_freq,"SCL frequency override" );
@@ -227,6 +230,7 @@ struct qup_i2c_dev {int irq;struct clk *clk;struct clk *pclk; +struct icc_path *icc_path;struct i2c_adapter adap;int clk_ctl;
@@ -255,6 +259,10 @@ struct qup_i2c_dev {/* To configure when bus is in run state */ u32 config_run; +/* bandwidth votes */ +u32 src_clk_freq; +u32 cur_bw_clk_freq; +/* dma parameters */ bool is_dma;/* To check if the current transfer is using DMA */
@@ -453,6 +461,23 @@ static int qup_i2c_bus_active(struct qup_i2c_dev *qup, int len)return ret; } +static int qup_i2c_vote_bw (struct qup_i2c_dev *qup,u32 clk_freq) +{ +u32 needed_peak_bw; +int ret; + +if (qup->cur_bw_clk_freq == clk_freq) +return 0 ; + + needed_peak_bw =Bps_to_icc (clk_freq *QUP_BUS_WIDTH ); + ret =icc_set_bw (qup->icc_path,0 , needed_peak_bw); +if (ret) +return ret; + + qup->cur_bw_clk_freq = clk_freq; +return 0 ; +} +static void qup_i2c_write_tx_fifo_v1 (struct qup_i2c_dev *qup) {struct qup_i2c_block *blk = &qup->blk;
@@ -840,6 +865,10 @@ static int qup_i2c_bam_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,int ret =0 ;int idx =0 ; + ret =qup_i2c_vote_bw (qup, qup->src_clk_freq); +if (ret) +return ret; +enable_irq (qup->irq); ret =qup_i2c_req_dma (qup);
@@ -1645,6 +1674,7 @@ static void qup_i2c_disable_clocks(struct qup_i2c_dev *qup) config =readl (qup->base +QUP_CONFIG ); config |=QUP_CLOCK_AUTO_GATE ;writel (config, qup->base +QUP_CONFIG ); +qup_i2c_vote_bw (qup,0 );clk_disable_unprepare (qup->pclk); }
@@ -1745,6 +1775,11 @@ static int qup_i2c_probe(struct platform_device *pdev) goto fail_dma; } qup->is_dma = true; + + qup->icc_path =devm_of_icc_get (&pdev->dev,NULL ); +if (IS_ERR (qup->icc_path)) +return dev_err_probe (&pdev->dev,PTR_ERR (qup->icc_path), +"failed to get interconnect path\n" ); } nodma:
@@ -1793,6 +1828,7 @@ static int qup_i2c_probe(struct platform_device *pdev)qup_i2c_enable_clocks (qup); src_clk_freq =clk_get_rate (qup->clk); } + qup->src_clk_freq = src_clk_freq;/* * Bootloaders might leave a pending interrupt on certain QUP's,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 135/270 i2c: pxa: fix call balance of i2c->clk handling routines
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitalii Mordan <[email protected]>
[ Upstream commit be7113d2e2a6f20cbee99c98d261a1fd6fd7b549 ]
If the clock i2c->clk was not enabled in i2c_pxa_probe(), it should not be disabled in any path.
Found by Linux Verification Center (linuxtesting.org) with Klever.
--- drivers/i2c/busses/i2c-pxa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-pxa.c +4 -1
@@ -1508,7 +1508,10 @@ static int i2c_pxa_probe(struct platform_device *dev) i2c->adap.name); } -clk_prepare_enable (i2c->clk); + ret =clk_prepare_enable (i2c->clk); +if (ret) +return dev_err_probe (&dev->dev, ret, +"failed to enable clock\n" );if (i2c->use_pio) { i2c->adap.algo = &i2c_pxa_pio_algorithm;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 136/270 btrfs: avoid linker error in btrfs_find_create_tree_block()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Harmstone <[email protected]>
[ Upstream commit 7ef3cbf17d2734ca66c4ed8573be45f4e461e7ee ]
The inline function btrfs_is_testing() is hardcoded to return 0 if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set. Currently we're relying on the compiler optimizing out the call to alloc_test_extent_buffer() in btrfs_find_create_tree_block(), as it's not been defined (it's behind an
#ifdef).
Add a stub version of alloc_test_extent_buffer() to avoid linker errors on non-standard optimization levels. This problem was seen on GCC 14 with -O0 and is helps to see symbols that would be otherwise optimized out.
--- fs/btrfs/extent_io.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/btrfs/extent_io.c +5 -2
@@ -5134,10 +5134,10 @@ struct extent_buffer *find_extent_buffer(struct btrfs_fs_info *fs_info,return NULL ; } -#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS struct extent_buffer *alloc_test_extent_buffer (struct btrfs_fs_info *fs_info,u64 start) { +#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS struct extent_buffer *eb, *exists =NULL ;int ret;
@@ -5173,8 +5173,11 @@ struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info, free_eb:btrfs_release_extent_buffer (eb);return exists; -} +#else +/* Stub to avoid linker error when compiled with optimizations turned off. */ +return NULL ;#endif +}struct extent_buffer *alloc_extent_buffer (struct btrfs_fs_info *fs_info,u64 start)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 137/270 btrfs: send: return -ENAMETOOLONG when attempting a path that is too long
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit a77749b3e21813566cea050bbb3414ae74562eba ]
When attempting to build a too long path we are currently returning -ENOMEM, which is very odd and misleading. So update fs_path_ensure_buf() to return -ENAMETOOLONG instead. Also, while at it, move the WARN_ON() into the if statement's expression, as it makes it clear what is being tested and also has the effect of adding 'unlikely' to the statement, which allows the compiler to generate better code as this condition is never expected to happen.
--- fs/btrfs/send.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/btrfs/send.c +2 -4
@@ -390,10 +390,8 @@ static int fs_path_ensure_buf(struct fs_path *p, int len)if (p->buf_len >= len)return 0 ; -if (len >PATH_MAX ) { -WARN_ON (1 ); -return -ENOMEM ; - } +if (WARN_ON (len >PATH_MAX )) +return -ENAMETOOLONG ; path_len = p->end - p->start; old_buf_len = p->buf_len;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 138/270 clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nick Hu <[email protected]>
[ Upstream commit 70c93b026ed07078e933583591aa9ca6701cd9da ]
Stop the timer when the cpu is going to be offline otherwise the timer interrupt may be pending while performing power-down.
--- drivers/clocksource/timer-riscv.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/clocksource/timer-riscv.c +6 -0
@@ -75,7 +75,13 @@ static int riscv_timer_starting_cpu(unsigned int cpu)static int riscv_timer_dying_cpu (unsigned int cpu) { +/* +* Stop the timer when the cpu is going to be offline otherwise +* the timer interrupt may be pending while performing power-down. +*/ +riscv_clock_event_stop ();disable_percpu_irq (riscv_clock_event_irq); +return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 139/270 um: Store full CSGSFS and SS register from mcontext
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Berg <[email protected]>
[ Upstream commit cef721e0d53d2b64f2ba177c63a0dfdd7c0daf17 ]
Doing this allows using registers as retrieved from an mcontext to be pushed to a process using PTRACE_SETREGS.
It is not entirely clear to me why CSGSFS was masked. Doing so creates issues when using the mcontext as process state in seccomp and simply copying the register appears to work perfectly fine for ptrace.
--- arch/x86/um/os-Linux/mcontext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/um/os-Linux/mcontext.c +1 -2
@@ -26,7 +26,6 @@ void get_regs_from_mc(struct uml_pt_regs *regs, mcontext_t *mc)COPY (RIP );COPY2 (EFLAGS ,EFL );COPY2 (CS ,CSGSFS ); - regs->gp[CS /sizeof (unsigned long )] &=0xffff ; - regs->gp[CS /sizeof (unsigned long )] |=3 ; + regs->gp[SS /sizeof (unsigned long )] = mc->gregs[REG_CSGSFS ] >>48 ;#endif }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 140/270 um: Update min_low_pfn to match changes in uml_reserved
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tiwei Bie <[email protected]>
[ Upstream commit e82cf3051e6193f61e03898f8dba035199064d36 ]
When uml_reserved is updated, min_low_pfn must also be updated accordingly. Otherwise, min_low_pfn will not accurately reflect the lowest available PFN.
--- arch/um/kernel/mem.c | 1 + 1 file changed, 1 insertion(+)
arch/um/kernel/mem.c +1 -0
@@ -49,6 +49,7 @@ void __init mem_init(void)map_memory (brk_end,__pa (brk_end), uml_reserved - brk_end,1 ,1 ,0 );memblock_free (__pa (brk_end), uml_reserved - brk_end); uml_reserved = brk_end; + min_low_pfn =PFN_UP (__pa (uml_reserved));/* this will put all low memory onto the freelists */ memblock_free_all ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 141/270 ext4: reorder capability check last
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Göttsche <[email protected]>
[ Upstream commit 1b419c889c0767a5b66d0a6c566cae491f1cb0f7 ]
capable() calls refer to enabled LSMs whether to permit or deny the request. This is relevant in connection with SELinux, where a capability check results in a policy decision and by default a denial message on insufficient permission is issued.
It can lead to three undesired cases:
1. A denial message is generated, even in case the operation was an unprivileged one and thus the syscall succeeded, creating noise.
2. To avoid the noise from 1. the policy writer adds a rule to ignore those denial messages, hiding future syscalls, where the task performs an actual privileged operation, leading to hidden limited functionality of that task.
3. To avoid the noise from 1. the policy writer adds a rule to permit the task the requested capability, while it does not need it, violating the principle of least privilege.
--- fs/ext4/balloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/balloc.c +2 -2
@@ -637,8 +637,8 @@ static int ext4_has_free_clusters(struct ext4_sb_info *sbi,/* Hm, nope. Are (enough) root reserved clusters available? */ if (uid_eq (sbi->s_resuid,current_fsuid ()) || (!gid_eq (sbi->s_resgid,GLOBAL_ROOT_GID ) &&in_group_p (sbi->s_resgid)) || -capable (CAP_SYS_RESOURCE ) || - (flags &EXT4_MB_USE_ROOT_BLOCKS )) { + (flags &EXT4_MB_USE_ROOT_BLOCKS ) || +capable (CAP_SYS_RESOURCE )) {if (free_clusters >= (nclusters + dirty_clusters + resv_clusters))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 142/270 scsi: st: Tighten the page format heuristics with MODE SELECT
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kai Mäkisara <[email protected]>
[ Upstream commit 8db816c6f176321e42254badd5c1a8df8bfcfdb4 ]
In the days when SCSI-2 was emerging, some drives did claim SCSI-2 but did not correctly implement it. The st driver first tries MODE SELECT with the page format bit set to set the block descriptor. If not successful, the non-page format is tried.
The test only tests the sense code and this triggers also from illegal parameter in the parameter list. The test is limited to "old" devices and made more strict to remove false alarms.
--- drivers/scsi/st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/st.c +3 -1
@@ -3076,7 +3076,9 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon cmd_in == MTSETDRVBUFFER || cmd_in == SET_DENS_AND_BLK) {if (cmdstatp->sense_hdr.sense_key ==ILLEGAL_REQUEST && - !(STp->use_pf &PF_TESTED )) { + cmdstatp->sense_hdr.asc ==0x24 && + (STp->device)->scsi_level <=SCSI_2 && + !(STp->use_pf &PF_TESTED )) {/* Try the other possible state of Page Format if not already tried */ STp->use_pf = (STp->use_pf ^USE_PF ) |PF_TESTED ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 143/270 scsi: st: ERASE does not change tape location
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kai Mäkisara <[email protected]>
[ Upstream commit ad77cebf97bd42c93ab4e3bffd09f2b905c1959a ]
The SCSI ERASE command erases from the current position onwards. Don't clear the position variables.
--- drivers/scsi/st.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/st.c +0 -1
@@ -2889,7 +2889,6 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon timeout = STp->long_timeout *8 ;DEBC_printk (STp,"Erasing tape.\n" ); - fileno = blkno = at_sm =0 ;break ;case MTSETBLK :/* Set block length */ case MTSETDENSITY :/* Set tape density */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 144/270 tcp: reorganize tcp_in_ack_event() and tcp_count_delivered()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilpo Järvinen <[email protected]>
[ Upstream commit 149dfb31615e22271d2525f078c95ea49bc4db24 ]
- Move tcp_count_delivered() earlier and split tcp_count_delivered_ce() out of it
- Move tcp_in_ack_event() later
- While at it, remove the inline from tcp_in_ack_event() and let the compiler to decide
Accurate ECN's heuristics does not know if there is going to be ACE field based CE counter increase or not until after rtx queue has been processed. Only then the number of ACKed bytes/pkts is available. As CE or not affects presence of FLAG_ECE, that information for tcp_in_ack_event is not yet available in the old location of the call to tcp_in_ack_event().
--- net/ipv4/tcp_input.c | 56 +++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-)
net/ipv4/tcp_input.c +32 -24
@@ -403,6 +403,20 @@ static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdrreturn false; } +static void tcp_count_delivered_ce (struct tcp_sock *tp,u32 ecn_count) +{ + tp->delivered_ce += ecn_count; +} + +/* Updates the delivered and delivered_ce counts */ +static void tcp_count_delivered (struct tcp_sock *tp,u32 delivered, +bool ece_ack) +{ + tp->delivered += delivered; +if (ece_ack) +tcp_count_delivered_ce (tp, delivered); +} +/* Buffer size and advertised window tuning. * * 1. Tuning sk->sk_sndbuf, when connection enters established state.
@@ -1102,15 +1116,6 @@ void tcp_mark_skb_lost(struct sock *sk, struct sk_buff *skb) } } -/* Updates the delivered and delivered_ce counts */ -static void tcp_count_delivered (struct tcp_sock *tp,u32 delivered, -bool ece_ack) -{ - tp->delivered += delivered; -if (ece_ack) - tp->delivered_ce += delivered; -} -/* This procedure tags the retransmission queue when SACKs arrive. * * We have three tag bits: SACKED(S), RETRANS(R) and LOST(L).
@@ -3735,12 +3740,23 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) } } -static inline void tcp_in_ack_event (struct sock *sk,u32 flags) +static void tcp_in_ack_event (struct sock *sk,int flag) {const struct inet_connection_sock *icsk =inet_csk (sk); -if (icsk->icsk_ca_ops->in_ack_event) - icsk->icsk_ca_ops->in_ack_event (sk, flags); +if (icsk->icsk_ca_ops->in_ack_event) { +u32 ack_ev_flags =0 ; + +if (flag &FLAG_WIN_UPDATE ) + ack_ev_flags |=CA_ACK_WIN_UPDATE ; +if (flag &FLAG_SLOWPATH ) { + ack_ev_flags |=CA_ACK_SLOWPATH ; +if (flag &FLAG_ECE ) + ack_ev_flags |=CA_ACK_ECE ; + } + + icsk->icsk_ca_ops->in_ack_event (sk, ack_ev_flags); + } }/* Congestion control has updated the cwnd already. So if we're in
@@ -3857,12 +3873,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)tcp_snd_una_update (tp, ack); flag |=FLAG_WIN_UPDATE ; -tcp_in_ack_event (sk,CA_ACK_WIN_UPDATE ); -NET_INC_STATS (sock_net (sk),LINUX_MIB_TCPHPACKS ); }else { -u32 ack_ev_flags =CA_ACK_SLOWPATH ; -if (ack_seq !=TCP_SKB_CB (skb)->end_seq) flag |=FLAG_DATA ;else
@@ -3874,19 +3886,12 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) flag |=tcp_sacktag_write_queue (sk, skb, prior_snd_una, &sack_state); -if (tcp_ecn_rcv_ecn_echo (tp,tcp_hdr (skb))) { +if (tcp_ecn_rcv_ecn_echo (tp,tcp_hdr (skb))) flag |=FLAG_ECE ; - ack_ev_flags |=CA_ACK_ECE ; - }if (sack_state.sack_delivered)tcp_count_delivered (tp, sack_state.sack_delivered, flag &FLAG_ECE ); - -if (flag &FLAG_WIN_UPDATE ) - ack_ev_flags |=CA_ACK_WIN_UPDATE ; - -tcp_in_ack_event (sk, ack_ev_flags); }/* This is a deviation from RFC3168 since it states that:
@@ -3913,6 +3918,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)tcp_rack_update_reo_wnd (sk, &rs); +tcp_in_ack_event (sk, flag); +if (tp->tlp_high_seq)tcp_process_tlp_ack (sk, ack, flag);
@@ -3944,6 +3951,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)return 1 ; no_queue: +tcp_in_ack_event (sk, flag);/* If data was DSACKed, see if we can undo a cwnd reduction. */ if (flag &FLAG_DSACKING_ACK ) { tcp_fastretrans_alert(sk, prior_snd_una, num_dupack, &flag,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 145/270 rtc: rv3032: fix EERD location
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Belloni <[email protected]>
[ Upstream commit b0f9cb4a0706b0356e84d67e48500b77b343debe ]
EERD is bit 2 in CTRL1
--- drivers/rtc/rtc-rv3032.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-rv3032.c +1 -1
@@ -69,7 +69,7 @@#define RV3032_CLKOUT2_FD_MSK GENMASK(6, 5)#define RV3032_CLKOUT2_OS BIT(7) -#define RV3032_CTRL1_EERD BIT(3) +#define RV3032_CTRL1_EERD BIT(2)#define RV3032_CTRL1_WADA BIT(5)#define RV3032_CTRL2_STOP BIT(0)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 146/270 kbuild: fix argument parsing in scripts/config
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seyediman Seyedarab <[email protected]>
[ Upstream commit f757f6011c92b5a01db742c39149bed9e526478f ]
The script previously assumed --file was always the first argument, which caused issues when it appeared later. This patch updates the parsing logic to scan all arguments to find --file, sets the config file correctly, and resets the argument list with the remaining commands.
It also fixes --refresh to respect --file by passing KCONFIG_CONFIG=$FN to make oldconfig.
--- scripts/config | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
scripts/config +16 -10
@@ -32,6 +32,7 @@ commands: Disable option directly after other option --module-after|-M beforeopt option Turn option into module directly after other option + --refresh Refresh the config using old settings commands can be repeated multiple times
@@ -124,16 +125,22 @@ undef_var() { txt_delete "^# $name is not set" "$FN" } -if [ "$1" = "--file" ]; then - FN="$2" - if [ "$FN" = "" ] ; then - usage +FN=.config +CMDS=() +while [[ $# -gt 0 ]]; do + if [ "$1" = "--file" ]; then + if [ "$2" = "" ]; then + usage + fi + FN="$2" + shift 2 + else + CMDS+=("$1") + shift fi - shift 2 -else - FN=.config -fi +done +set -- "${CMDS[@]}" if [ "$1" = "" ] ; then usage fi
@@ -217,9 +224,8 @@ while [ "$1" != "" ] ; do set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A" ;; - # undocumented because it ignores --file (fixme) --refresh) - yes "" | make oldconfig + yes "" | make oldconfig KCONFIG_CONFIG=$FN ;; *)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 147/270 dm: restrict dm device size to 2^63-512 bytes
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
[ Upstream commit 45fc728515c14f53f6205789de5bfd72a95af3b8 ]
The devices with size >= 2^63 bytes can't be used reliably by userspace because the type off_t is a signed 64-bit integer.
Therefore, we limit the maximum size of a device mapper device to 2^63-512 bytes.
--- drivers/md/dm-table.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/md/dm-table.c +4 -0
@@ -682,6 +682,10 @@ int dm_table_add_target(struct dm_table *t, const char *type,DMERR ("%s: zero-length target" ,dm_device_name (t->md));return -EINVAL ; } +if (start + len < start || start + len >LLONG_MAX >>SECTOR_SHIFT ) { +DMERR ("%s: too large device" ,dm_device_name (t->md)); +return -EINVAL ; + } tgt->type =dm_get_target_type (type);if (!tgt->type) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 148/270 xen: Add support for XenServer 6.1 platform device
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frediano Ziglio <[email protected]>
[ Upstream commit 2356f15caefc0cc63d9cc5122641754f76ef9b25 ]
On XenServer on Windows machine a platform device with ID 2 instead of 1 is used.
This device is mainly identical to device 1 but due to some Windows update behaviour it was decided to use a device with a different ID.
This causes compatibility issues with Linux which expects, if Xen is detected, to find a Xen platform device (5853:0001) otherwise code will crash due to some missing initialization (specifically grant tables). Specifically from dmesg
RIP: 0010:gnttab_expand+0x29/0x210
Code: 90 0f 1f 44 00 00 55 31 d2 48 89 e5 41 57 41 56 41 55 41 89 fd
41 54 53 48 83 ec 10 48 8b 05 7e 9a 49 02 44 8b 35 a7 9a 49 02
<8b> 48 04 8d 44 39 ff f7 f1 45 8d 24 06 89 c3 e8 43 fe ff ff
44 39
RSP: 0000:ffffba34c01fbc88 EFLAGS: 00010086
...The device 2 is presented by Xapi adding device specification to Qemu command line.
Message-ID: <[email protected]>
--- drivers/xen/platform-pci.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/xen/platform-pci.c +4 -0
@@ -26,6 +26,8 @@#define DRV_NAME "xen-platform-pci" +#define PCI_DEVICE_ID_XEN_PLATFORM_XS61 0x0002 +static unsigned long platform_mmio;static unsigned long platform_mmio_alloc;static unsigned long platform_mmiolen;
@@ -167,6 +169,8 @@ static int platform_pci_probe(struct pci_dev *pdev,static const struct pci_device_id platform_pci_tbl[] = { {PCI_VENDOR_ID_XEN ,PCI_DEVICE_ID_XEN_PLATFORM ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, + {PCI_VENDOR_ID_XEN ,PCI_DEVICE_ID_XEN_PLATFORM_XS61 , +PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, {0 ,} };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 149/270 posix-timers: Add cond_resched() to posix_timer_add() search loop
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 5f2909c6cd13564a07ae692a95457f52295c4f22 ]
With a large number of POSIX timers the search for a valid ID might cause a soft lockup on PREEMPT_NONE/VOLUNTARY kernels.
Add cond_resched() to the loop to prevent that.
[ tglx: Split out from Eric's series ]
--- kernel/time/posix-timers.c | 1 + 1 file changed, 1 insertion(+)
kernel/time/posix-timers.c +1 -0
@@ -161,6 +161,7 @@ static int posix_timer_add(struct k_itimer *timer)return id; }spin_unlock (&hash_lock); +cond_resched (); }/* POSIX return code when no timer ID could be allocated */ return -EAGAIN ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 150/270 netfilter: conntrack: Bound nf_conntrack sysctl writes
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolas Bouchinet <[email protected]>
[ Upstream commit 8b6861390ffee6b8ed78b9395e3776c16fec6579 ]
nf_conntrack_max and nf_conntrack_expect_max sysctls were authorized to be written any negative value, which would then be stored in the unsigned int variables nf_conntrack_max and nf_ct_expect_max variables.
While the do_proc_dointvec_conv function is supposed to limit writing handled by proc_dointvec proc_handler to INT_MAX. Such a negative value being written in an unsigned int leads to a very high value, exceeding this limit.
Moreover, the nf_conntrack_expect_max sysctl documentation specifies the minimum value is 1.
The proc_handlers have thus been updated to proc_dointvec_minmax in order to specify the following write bounds :
* Bound nf_conntrack_max sysctl writings between SYSCTL_ZERO and SYSCTL_INT_MAX.
* Bound nf_conntrack_expect_max sysctl writings between SYSCTL_ONE and SYSCTL_INT_MAX as defined in the sysctl documentation.
With this patch applied, sysctl writes outside the defined in the bound will thus lead to a write error :
``` sysctl -w net.netfilter.nf_conntrack_expect_max=-1 sysctl: setting key "net.netfilter.nf_conntrack_expect_max": Invalid argument ```
--- net/netfilter/nf_conntrack_standalone.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_standalone.c +9 -3
@@ -613,7 +613,9 @@ static struct ctl_table nf_ct_sysctl_table[] = { .data = &nf_conntrack_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, [NF_SYSCTL_CT_COUNT] = { .procname = "nf_conntrack_count",
@@ -652,7 +654,9 @@ static struct ctl_table nf_ct_sysctl_table[] = { .data = &nf_ct_expect_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ONE, + .extra2 = SYSCTL_INT_MAX, }, [NF_SYSCTL_CT_ACCT] = { .procname = "nf_conntrack_acct",
@@ -931,7 +935,9 @@ static struct ctl_table nf_ct_netfilter_table[] = { .data = &nf_conntrack_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, { } };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 151/270 arm64/mm: Check PUD_TYPE_TABLE in pud_bad()
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Roberts <[email protected]>
[ Upstream commit bfb1d2b9021c21891427acc86eb848ccedeb274e ]
pud_bad() is currently defined in terms of pud_table(). Although for some configs, pud_table() is hard-coded to true i.e. when using 64K base pages or when page table levels are less than 3.
pud_bad() is intended to check that the pud is configured correctly. Hence let's open-code the same check that the full version of pud_table() uses into pud_bad(). Then it always performs the check regardless of the config.
--- arch/arm64/include/asm/pgtable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/include/asm/pgtable.h +2 -1
@@ -601,7 +601,8 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) pr_err("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))#define pud_none (pud) (!pud_val(pud)) -#define pud_bad (pud) (!pud_table(pud)) +#define pud_bad (pud) ((pud_val(pud) & PUD_TYPE_MASK) != \ + PUD_TYPE_TABLE)#define pud_present (pud) pte_present(pud_pte(pud))#define pud_leaf (pud) (pud_present(pud) && !pud_table(pud))#define pud_valid (pud) pte_valid(pud_pte(pud))
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 152/270 mmc: sdhci: Disable SD card clock before changing parameters
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erick Shepherd <[email protected]>
[ Upstream commit fb3bbc46c94f261b6156ee863c1b06c84cf157dc ]
Per the SD Host Controller Simplified Specification v4.20 §3.2.3, change the SD card clock parameters only after first disabling the external card clock. Doing this fixes a spurious clock pulse on Baytrail and Apollo Lake SD controllers which otherwise breaks voltage switching with a specific Swissbit SD card.
--- drivers/mmc/host/sdhci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci.c +7 -2
@@ -2010,10 +2010,15 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) host->mmc->actual_clock =0 ; -sdhci_writew (host,0 ,SDHCI_CLOCK_CONTROL ); + clk =sdhci_readw (host,SDHCI_CLOCK_CONTROL ); +if (clk &SDHCI_CLOCK_CARD_EN ) +sdhci_writew (host, clk & ~SDHCI_CLOCK_CARD_EN , +SDHCI_CLOCK_CONTROL ); -if (clock ==0 ) +if (clock ==0 ) { +sdhci_writew (host,0 ,SDHCI_CLOCK_CONTROL );return ; + } clk =sdhci_calc_clk (host, clock, &host->mmc->actual_clock);sdhci_enable_clk (host, clk);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 153/270 ipv6: save dontfrag in cork
In reply to Greg Kroah-Hartman5.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Willem de Bruijn <[email protected]>
[ Upstream commit a18dfa9925b9ef6107ea3aa5814ca3c704d34a8a ]
When spanning datagram construction over multiple send calls using MSG_MORE, per datagram settings are configured on the first send.
That is when ip(6)_setup_cork stores these settings for subsequent use in __ip(6)_append_data and others.
The only flag that escaped this was dontfrag. As a result, a datagram could be constructed with df=0 on the first sendmsg, but df=1 on a next. Which is what cmsg_ip.sh does in an upcoming MSG_MORE test in the "diff" scenario.
Changing datagram conditions in the middle of constructing an skb makes this already complex code path even more convoluted. It is here unintentional. Bring this flag in line with expected sockopt/cmsg behavior.
And stop passing ipc6 to __ip6_append_data, to avoid such issues in the future. This is already the case for __ip_append_data.
inet6_cork had a 6 byte hole, so the 1B flag has no impact.
--- include/linux/ipv6.h | 1 + net/ipv6/ip6_output.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-)
include/linux/ipv6.h +1 -0
@@ -189,6 +189,7 @@ struct inet6_cork {struct ipv6_txoptions *opt;u8 hop_limit;u8 tclass; + u8 dontfrag:1; };/**
net/ipv6/ip6_output.c +5 -4
@@ -1416,6 +1416,7 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, cork->fl.u.ip6 = *fl6; v6_cork->hop_limit = ipc6->hlimit; v6_cork->tclass = ipc6->tclass; + v6_cork->dontfrag = ipc6->dontfrag;if (rt->dst.flags &DST_XFRM_TUNNEL ) mtu = np->pmtudisc >=IPV6_PMTUDISC_PROBE ?READ_ONCE (rt->dst.dev->mtu) :dst_mtu (&rt->dst);
@@ -1450,7 +1451,7 @@ static int __ip6_append_data(struct sock *sk,int getfrag (void *from,char *to,int offset,int len,int odd,struct sk_buff *skb), void *from, size_t length, int transhdrlen, - unsigned int flags, struct ipcm6_cookie *ipc6) + unsigned int flags) { struct sk_buff *skb, *skb_prev = NULL;unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu, pmtu;
@@ -1507,7 +1508,7 @@ static int __ip6_append_data(struct sock *sk,if (headersize + transhdrlen > mtu) goto emsgsize; -if (cork->length + length > mtu - headersize && ipc6->dontfrag && +if (cork->length + length > mtu - headersize && v6_cork->dontfrag && (sk->sk_protocol ==IPPROTO_UDP || sk->sk_protocol ==IPPROTO_RAW )) { ipv6_local_rxpmtu(sk, fl6, mtu - headersize +
@@ -1825,7 +1826,7 @@ int ip6_append_data(struct sock *sk,return __ip6_append_data (sk, fl6, &sk->sk_write_queue, &inet->cork.base, &np->cork,sk_page_frag (sk), getfrag, - from, length, transhdrlen, flags, ipc6); + from, length, transhdrlen, flags); }EXPORT_SYMBOL_GPL (ip6_append_data);
@@ -2020,7 +2021,7 @@ struct sk_buff *ip6_make_skb(struct sock *sk, err =__ip6_append_data (sk, fl6, &queue, &cork->base, &v6_cork, ¤t->task_frag, getfrag, from, length + exthdrlen, transhdrlen + exthdrlen, - flags, ipc6); + flags);if (err) {__ip6_flush_pending_frames (sk, &queue, cork, &v6_cork);return ERR_PTR (err);
Signature · 1 line
2.39.5