6.12.34-rc1 review
Greg Kroah-Hartman
maintainercover 6.12.34-rc1 review
This is the start of the stable review cycle for the 6.12.34 release. There are 512 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 Thu, 19 Jun 2025 15:22:45 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.34-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.12.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.12.34-rc1
I Hsin Cheng <[email protected]>
drm/meson: Use 1000ULL when operating with mode->clock
Andrew Price <[email protected]>
gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add
Kees Cook <[email protected]>
overflow: Introduce __DEFINE_FLEX for having no initializer
Oliver Neukum <[email protected]>
net: usb: aqc111: debug info before sanitation
Arnd Bergmann <[email protected]>
usb: misc: onboard_usb_dev: fix build warning for CONFIG_USB_ONBOARD_DEV_USB5744=n
Nícolas F. R. A. Prado <[email protected]>
regulator: dt-bindings: mt6357: Drop fixed compatible requirement
Eric Dumazet <[email protected]>
calipso: unlock rcu before returning -EAFNOSUPPORT
Xin Li (Intel) <[email protected]>
x86/fred/signal: Prevent immediate repeat of single step trap on return from SIGTRAP handler
Thomas Gleixner <[email protected]>
x86/iopl: Cure TIF_IO_BITMAP inconsistencies
Stefano Stabellini <[email protected]>
xen/arm: call uaccess_ttbr0_enable for dm_op hypercall
Dave Chinner <[email protected]>
xfs: don't assume perags are initialised when trimming AGs
Steven Rostedt <[email protected]>
ring-buffer: Move cpus_read_lock() outside of buffer->mutex
Dmitry Antipov <[email protected]>
ring-buffer: Fix buffer locking in ring_buffer_subbuf_order_set()
Steven Rostedt <[email protected]>
ring-buffer: Do not trigger WARN_ON() due to a commit_overrun
Matthew Wilcox (Oracle) <[email protected]>
9p: Add a migrate_folio method
RD Babiera <[email protected]>
usb: typec: tcpm: move tcpm_queue_vdm_unlocked to asynchronous work
Amit Sunil Dhamne <[email protected]>
usb: typec: tcpm/tcpci_maxim: Fix bounds check in process_rx()
Mathias Nyman <[email protected]>
usb: Flush altsetting 0 endpoints before reinitializating them after reset.
Pawel Laszczak <[email protected]>
usb: cdnsp: Fix issue with detecting USB 3.2 speed
Pawel Laszczak <[email protected]>
usb: cdnsp: Fix issue with detecting command completion event
Jonathan Stroud <[email protected]>
usb: misc: onboard_usb_dev: Fix usb5744 initialization sequence
Jiri Slaby (SUSE) <[email protected]>
tty: serial: 8250_omap: fix TX with DMA for am33xx
Wupeng Ma <[email protected]>
VMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify
Dave Penkler <[email protected]>
usb: usbtmc: Fix read_stb function and get_stb ioctl
Peter Korsgaard <[email protected]>
nvmem: zynqmp_nvmem: unbreak driver after cleanup
Oleg Nesterov <[email protected]>
posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del()
Terry Junge <[email protected]>
HID: usbhid: Eliminate recurrent out-of-bounds bug in usbhid_parse()
David Heimann <[email protected]>
ALSA: usb-audio: Add implicit feedback quirk for RODE AI-1
Francesco Dolcini <[email protected]>
Revert "wifi: mwifiex: Fix HT40 bandwidth issue."
Suleiman Souhlal <[email protected]>
tools/resolve_btfids: Fix build when cross compiling kernel with clang.
Miguel Ojeda <[email protected]>
objtool/rust: relax slice condition to cover more noreturn Rust functions
Matthew Wilcox (Oracle) <[email protected]>
block: Fix bvec_set_folio() for very large folios
Matthew Wilcox (Oracle) <[email protected]>
bio: Fix bio_first_folio() for SPARSEMEM without VMEMMAP
Keith Busch <[email protected]>
io_uring: consistently use rcu semantics with sqpoll thread
Christoph Hellwig <[email protected]>
block: don't use submit_bio_noacct_nocheck in blk_zone_wplug_bio_work
Penglei Jiang <[email protected]>
io_uring: fix use-after-free of sq->thread in __io_uring_show_fdinfo()
Ming Lei <[email protected]>
block: use q->elevator with ->elevator_lock held in elv_iosched_show()
Peter Zijlstra <[email protected]>
perf: Ensure bpf_perf_link path is properly serialized
Daniel Wagner <[email protected]>
nvmet-fcloop: access fcpreq only when holding reqlock
Filipe Manana <[email protected]>
btrfs: exit after state split error at set_extent_bit()
Christian Brauner <[email protected]>
gfs2: pass through holder from the VFS for freeze/thaw
Zijun Hu <[email protected]>
fs/filesystems: Fix potential unsigned integer underflow in fs_name()
Filipe Manana <[email protected]>
btrfs: exit after state insertion failure at btrfs_convert_extent_bit()
Jakub Kicinski <[email protected]>
net: drv: netdevsim: don't napi_complete() from netpoll
Eric Dumazet <[email protected]>
net_sched: ets: fix a race in ets_qdisc_change()
Eric Dumazet <[email protected]>
net_sched: tbf: fix a race in tbf_change()
Eric Dumazet <[email protected]>
net_sched: red: fix a race in __red_change()
Eric Dumazet <[email protected]>
net_sched: prio: fix a race in prio_tune()
Jianbo Liu <[email protected]>
net/mlx5e: Fix leak of Geneve TLV option object
Yevgeny Kliteynik <[email protected]>
net/mlx5: HWS, fix missing ip_version handling in definer
Patrisious Haddad <[email protected]>
net/mlx5: Fix return value when searching for existing flow group
Amir Tzin <[email protected]>
net/mlx5: Fix ECVF vports unload on shutdown flow
Moshe Shemesh <[email protected]>
net/mlx5: Ensure fw pages are always allocated on same NUMA
Luiz Augusto von Dentz <[email protected]>
Bluetooth: MGMT: Fix sparse errors
Luiz Augusto von Dentz <[email protected]>
Bluetooth: eir: Fix possible crashes on eir_create_adv_data
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix broadcast/PA when using an existing instance
Luiz Augusto von Dentz <[email protected]>
Bluetooth: Fix NULL pointer deference on eir_get_service_data
Jakub Raczynski <[email protected]>
net/mdiobus: Fix potential out-of-bounds clause 45 read/write access
Jakub Raczynski <[email protected]>
net/mdiobus: Fix potential out-of-bounds read/write access
Carlos Fernandez <[email protected]>
macsec: MACsec SCI assignment for ES = 0
Michal Luczaj <[email protected]>
net: Fix TOCTOU issue in sk_is_readable()
Yunhui Cui <[email protected]>
ACPI: CPPC: Fix NULL pointer dereference when nosmp is used
Robert Malz <[email protected]>
i40e: retry VFLR handling if there is ongoing VF reset
Robert Malz <[email protected]>
i40e: return false from i40e_reset_vf if reset is in progress
Martin Blumenstingl <[email protected]>
drm/meson: fix more rounding issues with 59.94Hz modes
Martin Blumenstingl <[email protected]>
drm/meson: use vclk_freq instead of pixel_freq in debug print
Martin Blumenstingl <[email protected]>
drm/meson: fix debug log statement when setting the HDMI clocks
Martin Blumenstingl <[email protected]>
drm/meson: use unsigned long long / Hz for frequency types
Haren Myneni <[email protected]>
powerpc/vas: Return -EINVAL if the offset is non-zero in mmap()
Ritesh Harjani (IBM) <[email protected]>
powerpc/powernv/memtrace: Fix out of bounds issue in memtrace mmap
Eric Dumazet <[email protected]>
net_sched: sch_sfq: fix a potential crash on gso_skb handling
Alok Tiwari <[email protected]>
scsi: iscsi: Fix incorrect error path labels for flashnode operations
Wojciech Slenska <[email protected]>
pinctrl: qcom: pinctrl-qcm2290: Add missing pins
Félix Piédallu <[email protected]>
spi: omap2-mcspi: Disable multi-mode when the previous message kept CS asserted
Félix Piédallu <[email protected]>
spi: omap2-mcspi: Disable multi mode when CS should be kept asserted after message
Dan Carpenter <[email protected]>
regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()
Baochen Qiang <[email protected]>
wifi: ath12k: fix GCC_GCC_PCIE_HOT_RST definition for WCN7850
P Praneesh <[email protected]>
wifi: ath12k: refactor ath12k_hw_regs structure
Rodrigo Gobbi <[email protected]>
wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
Baochen Qiang <[email protected]>
wifi: ath11k: move some firmware stats related functions outside of debugfs
Baochen Qiang <[email protected]>
wifi: ath11k: don't wait when there is no vdev started
Baochen Qiang <[email protected]>
wifi: ath11k: don't use static variables in ath11k_debugfs_fw_stats_process()
Baochen Qiang <[email protected]>
wifi: ath11k: avoid burning CPU in ath11k_debugfs_fw_stats_request()
Easwar Hariharan <[email protected]>
wifi: ath11k: convert timeouts to secs_to_jiffies()
Caleb Connolly <[email protected]>
ath10k: snoc: fix unbalanced IRQ enable in crash recovery
Jeongjun Park <[email protected]>
ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()
Jonas Gorski <[email protected]>
net: dsa: b53: fix untagged traffic sent via cpu tagged with VID 0
Luiz Augusto von Dentz <[email protected]>
Bluetooth: MGMT: Protect mgmt_pending list with its own lock
Dr. David Alan Gilbert <[email protected]>
Bluetooth: MGMT: Remove unused mgmt_pending_find_data
Luiz Augusto von Dentz <[email protected]>
Bluetooth: MGMT: Fix UAF on mgmt_remove_adv_monitor_complete
Chandrashekar Devegowda <[email protected]>
Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition
Chandrashekar Devegowda <[email protected]>
Bluetooth: btintel_pcie: Increase the tx and rx descriptor count
Kiran K <[email protected]>
Bluetooth: btintel_pcie: Fix driver not posting maximum rx buffers
Pauli Virtanen <[email protected]>
Bluetooth: hci_core: fix list_for_each_entry_rcu usage
Sanjeev Yadav <[email protected]>
scsi: core: ufs: Fix a hang in the error handler
Claudiu Beznea <[email protected]>
serial: sh-sci: Move runtime PM enable to sci_probe_single()
David Lechner <[email protected]>
dt-bindings: pwm: adi,axi-pwmgen: Fix clocks
Krzysztof Kozlowski <[email protected]>
dt-bindings: pwm: Correct indentation and style in DTS example
Uwe Kleine-König <[email protected]>
dt-bindings: pwm: adi,axi-pwmgen: Increase #pwm-cells to 3
Peter Griffin <[email protected]>
pinctrl: samsung: add gs101 specific eint suspend/resume callbacks
Peter Griffin <[email protected]>
pinctrl: samsung: add dedicated SoC eint suspend/resume callbacks
Peter Griffin <[email protected]>
pinctrl: samsung: refactor drvdata suspend & resume callbacks
Stephan Gerhold <[email protected]>
arm64: dts: qcom: x1e80100: Add GPU cooling
Stephan Gerhold <[email protected]>
arm64: dts: qcom: x1e80100: Apply consistent critical thermal shutdown
Nicolas Frattaroli <[email protected]>
mmc: sdhci-of-dwcmshc: add PD workaround on RK3576
Ulf Hansson <[email protected]>
pmdomain: core: Introduce dev_pm_genpd_rpm_always_on()
Dmitry Torokhov <[email protected]>
Input: synaptics-rmi - fix crash with unsupported versions of F34
Stefan Binding <[email protected]>
ALSA: hda/realtek: Add support for HP Agusta using CS35L41 HDA
Chris Chiu <[email protected]>
ALSA: hda/realtek - Add new HP ZBook laptop with micmute led fixup
Kailang Yang <[email protected]>
ALSA: hda/realtek - Support mute led function for HP platform
Stefan Binding <[email protected]>
ALSA: hda/realtek: Add support for various HP Laptops using CS35L41 HDA
Chris Chiu <[email protected]>
ALSA: hda/realtek: fix micmute LEDs on HP Laptops with ALC3247
Chris Chiu <[email protected]>
ALSA: hda/realtek: fix micmute LEDs on HP Laptops with ALC3315
David (Ming Qiang) Wu <[email protected]>
drm/amdgpu: read back register after written for VCN v4.0.5
Boyuan Zhang <[email protected]>
drm/amd/pm: power up or down vcn by instance
Boyuan Zhang <[email protected]>
drm/amd/pm: add inst to dpm_set_vcn_enable
Gautham R. Shenoy <[email protected]>
tools/power turbostat: Fix AMD package-energy reporting
Al Viro <[email protected]>
do_change_type(): refuse to operate on unmounted/not ours mounts
Al Viro <[email protected]>
fix propagation graph breakage by MOVE_MOUNT_SET_GROUP move_mount(2)
Al Viro <[email protected]>
path_overmount(): avoid false negatives
Nitesh Shetty <[email protected]>
iov_iter: use iov_offset for length calculation in iov_iter_aligned_bvec
Yuuki NAGAO <[email protected]>
ASoC: ti: omap-hdmi: Re-add dai_link->platform to fix card init
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Verify content returned by parse_int_array()
Cezary Rojewski <[email protected]>
ASoC: Intel: avs: Fix deadlock when the failing IPC is SET_D0IX
Cezary Rojewski <[email protected]>
ASoC: codecs: hda: Fix RPM usage count underflow
Nitin Rawat <[email protected]>
scsi: ufs: qcom: Prevent calling phy_exit() before phy_init()
Nylon Chen <[email protected]>
riscv: misaligned: fix sleeping function called during misaligned access handling
Ido Schimmel <[email protected]>
seg6: Fix validation of nexthop addresses
Mirco Barone <[email protected]>
wireguard: device: enable threaded NAPI
Daniele Palmas <[email protected]>
net: wwan: mhi_wwan_mbim: use correct mux_id for multiplexing
Lachlan Hodges <[email protected]>
wifi: cfg80211/mac80211: correctly parse S1G beacon optional elements
Jonas Gorski <[email protected]>
net: dsa: b53: do not touch DLL_IQQD on bcm53115
Jonas Gorski <[email protected]>
net: dsa: b53: allow RGMII for bcm63xx RGMII ports
Jonas Gorski <[email protected]>
net: dsa: b53: do not enable RGMII delay on bcm63xx
Meghana Malladi <[email protected]>
net: ti: icssg-prueth: Fix swapped TX stats for MII interfaces.
Florian Westphal <[email protected]>
netfilter: nf_nat: also check reverse tuple to obtain clashing entry
Florian Westphal <[email protected]>
netfilter: nf_set_pipapo_avx2: fix initial map fill
Michael Walle <[email protected]>
drm/panel-simple: fix the warnings for the Evervision VGG644804
Alok Tiwari <[email protected]>
gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
Keith Busch <[email protected]>
nvme: fix command limits status code
Rafael J. Wysocki <[email protected]>
PM: sleep: Fix power.is_suspended cleanup for direct-complete devices
Bui Quang Minh <[email protected]>
selftests: net: build net/lib dependency in all target
Ronak Doshi <[email protected]>
vmxnet3: correctly report gso type for UDP tunnels
Jinjian Song <[email protected]>
net: wwan: t7xx: Fix napi rx poll issue
Shiming Cheng <[email protected]>
net: fix udp gso skb_segment after pull from frag_list
Jesus Narvaez <[email protected]>
drm/i915/guc: Handle race condition where wakeref count drops below 0
Jouni Högander <[email protected]>
drm/i915/psr: Fix using wrong mask in REG_FIELD_PREP
Jesus Narvaez <[email protected]>
drm/i915/guc: Check if expecting reply before decrementing outstanding_submission_g2h
Paul Chaignon <[email protected]>
net: Fix checksum update for ILA adj-transport
Alexis Lothoré <[email protected]>
net: stmmac: make sure that ptp_rate is not 0 before configuring EST
Alexis Lothoré <[email protected]>
net: stmmac: make sure that ptp_rate is not 0 before configuring timestamping
Álvaro Fernández Rojas <[email protected]>
net: dsa: tag_brcm: legacy: fix pskb_may_pull length
Emil Tantilov <[email protected]>
idpf: avoid mailbox timeout delays during reset
Brian Vazquez <[email protected]>
idpf: fix a race in txq wakeup
Michal Kubiak <[email protected]>
ice: fix rebuilding the Tx scheduler tree for large queue counts
Michal Kubiak <[email protected]>
ice: create new Tx scheduler nodes for new queues only
Michal Kubiak <[email protected]>
ice: fix Tx scheduler error handling in XDP callback
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix not responding with L2CAP_CR_LE_ENCRYPTION
Álvaro Fernández Rojas <[email protected]>
spi: bcm63xx-hsspi: fix shared reset
Álvaro Fernández Rojas <[email protected]>
spi: bcm63xx-spi: fix shared reset
Horatiu Vultur <[email protected]>
net: lan966x: Make sure to insert the vlan tags also in host mode
Dan Carpenter <[email protected]>
net/mlx4_en: Prevent potential integer overflow calculating Hz
Yanqing Wang <[email protected]>
driver: net: ethernet: mtk_star_emac: fix suspend/resume issue
Charalampos Mitrodimas <[email protected]>
net: tipc: fix refcount warning in tipc_aead_encrypt
Alok Tiwari <[email protected]>
gve: Fix RX_BUFFERS_POSTED stat to report per-queue fill_cnt
Quentin Schulz <[email protected]>
net: stmmac: platform: guarantee uniqueness of bus_id
Dong Chenchen <[email protected]>
page_pool: Fix use-after-free in page_pool_recycle_in_ring
Tengteng Yang <[email protected]>
Fix sock_exceed_buf_limit not being triggered in __sk_mem_raise_allocated
Rodrigo Vivi <[email protected]>
drm/xe: Make xe_gt_freq part of the Documentation
Ming Lei <[email protected]>
loop: add file_start_write() and file_end_write()
Greg Kroah-Hartman <[email protected]>
USB: typec: fix const issue in typec_match()
Greg Kroah-Hartman <[email protected]>
USB: gadget: udc: fix const issue in gadget_match_driver()
Greg Kroah-Hartman <[email protected]>
USB: serial: bus: fix const issue in usb_serial_device_match()
Marcus Folkesson <[email protected]>
iio: adc: mcp3911: fix device dependent mappings for conversion result registers
Marius Cristea <[email protected]>
iio: adc: PAC1934: fix typo in documentation link
Hans de Goede <[email protected]>
mei: vsc: Cast tx_buf to (__be32 *) when passed to cpu_to_be32_array()
Nicolas Pitre <[email protected]>
vt: remove VT_RESIZE and VT_RESIZEX from vt_compat_ioctl()
Yeoreum Yun <[email protected]>
coresight: prevent deactivate active config while enabling the config
Qasim Ijaz <[email protected]>
fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()
Alexander Sverdlin <[email protected]>
counter: interrupt-cnt: Protect enable/disable OPs with mutex
Yabin Cui <[email protected]>
coresight: catu: Introduce refcount and spinlock for enabling/disabling
Junhao He <[email protected]>
coresight: Fixes device's owner field for registered using coresight_init_driver()
WangYuli <[email protected]>
MIPS: Loongson64: Add missing '#interrupt-cells' for loongson64c_ls7a
Chenyuan Yang <[email protected]>
usb: acpi: Prevent null pointer dereference in usb_acpi_add_usb4_devlink()
Uwe Kleine-König <[email protected]>
iio: adc: ad7124: Fix 3dB filter frequency reading
Brian Pellegrino <[email protected]>
iio: filter: admv8818: Support frequencies >= 2^32
Sam Winchenbach <[email protected]>
iio: filter: admv8818: fix range calculation
Sam Winchenbach <[email protected]>
iio: filter: admv8818: fix integer overflow
Sam Winchenbach <[email protected]>
iio: filter: admv8818: fix band 4, state 15
Mario Limonciello <[email protected]>
thunderbolt: Fix a logic error in wake on connect
Henry Martin <[email protected]>
serial: Fix potential null-ptr-deref in mlb_usio_probe()
Lad Prabhakar <[email protected]>
usb: renesas_usbhs: Reorder clock handling and power management in probe
Jerome Brunet <[email protected]>
PCI: endpoint: Retain fixed-size BAR size as well as aligned size
Liu Dalin <[email protected]>
rtc: loongson: Add missing alarm notifications for ACPI RTC events
Bjorn Helgaas <[email protected]>
PCI/DPC: Log Error Source ID only when valid
Bjorn Helgaas <[email protected]>
PCI/DPC: Initialize aer_err_info before using it
Zhe Qiao <[email protected]>
PCI/ACPI: Fix allocated memory release on error in pci_acpi_scan_root()
Henry Martin <[email protected]>
dmaengine: ti: Add NULL check in udma_probe()
Chenyuan Yang <[email protected]>
phy: qcom-qmp-usb: Fix an NULL vs IS_ERR() bug
Mario Limonciello <[email protected]>
PCI: Explicitly put devices into D0 when initializing
Hector Martin <[email protected]>
PCI: apple: Use gpiod_set_value_cansleep in probe flow
Hans Zhang <[email protected]>
PCI: cadence: Fix runtime atomic count underflow
Jerome Brunet <[email protected]>
PCI: rcar-gen4: set ep BAR4 fixed size
Wilfred Mallawa <[email protected]>
PCI: Print the actual delay time in pci_bridge_wait_for_secondary_bus()
Cristian Ciocaltea <[email protected]>
phy: rockchip: samsung-hdptx: Do no set rk_hdptx_phy->rate in case of errors
Cristian Ciocaltea <[email protected]>
phy: rockchip: samsung-hdptx: Fix clock ratio setup
Wolfram Sang <[email protected]>
rtc: sh: assign correct interrupts with DT
Danilo Krummrich <[email protected]>
rust: alloc: add missing invariant in Vec::set_len()
Pali Rohár <[email protected]>
cifs: Fix validation of SMB1 query reparse point response
Ian Rogers <[email protected]>
perf callchain: Always populate the addr_location map when adding IP
Anubhav Shelat <[email protected]>
perf trace: Set errpid to false for rseq and set_robust_list
Li Lingfeng <[email protected]>
nfs: ignore SB_RDONLY when remounting nfs
Li Lingfeng <[email protected]>
nfs: clear SB_RDONLY before getting superblock
Anubhav Shelat <[email protected]>
perf trace: Always print return value for syscalls returning a pid
Dapeng Mi <[email protected]>
perf record: Fix incorrect --user-regs comments
Ian Rogers <[email protected]>
perf symbol: Fix use-after-free in filename__read_build_id
Jason-JH Lin <[email protected]>
mailbox: mtk-cmdq: Refine GCE_GCTL_VALUE setting
Peng Fan <[email protected]>
mailbox: imx: Fix TXDB_V2 sending
Leo Yan <[email protected]>
perf tests switch-tracking: Fix timestamp comparison
Alexey Gladkov <[email protected]>
mfd: stmpe-spi: Correct the name used in MODULE_DEVICE_TABLE
Christophe JAILLET <[email protected]>
mfd: exynos-lpass: Avoid calling exynos_lpass_disable() twice in exynos_lpass_remove()
Christophe JAILLET <[email protected]>
mfd: exynos-lpass: Fix an error handling path in exynos_lpass_probe()
Dan Carpenter <[email protected]>
rpmsg: qcom_smd: Fix uninitialized return variable in __qcom_smd_send()
Siddharth Vadapalli <[email protected]>
remoteproc: k3-dsp: Drop check performed in k3_dsp_rproc_{mbox_callback/kick}Siddharth Vadapalli <[email protected]>
remoteproc: k3-r5: Drop check performed in k3_r5_rproc_{mbox_callback/kick}Dan Carpenter <[email protected]>
remoteproc: qcom_wcnss_iris: Add missing put_device() on error in probe
Adrian Hunter <[email protected]>
perf scripts python: exported-sql-viewer.py: Fix pattern matching with Python 3
Adrian Hunter <[email protected]>
perf intel-pt: Fix PEBS-via-PT data_src
Michael Petlan <[email protected]>
perf tests: Fix 'perf report' tests installation
Namhyung Kim <[email protected]>
perf trace: Fix leaks of 'struct thread' in set_filter_loop_pids()
Benjamin Marzinski <[email protected]>
dm-flakey: make corrupting read bios work
Benjamin Marzinski <[email protected]>
dm-flakey: error all IOs when num_features is absent
Benjamin Marzinski <[email protected]>
dm: fix dm_blk_report_zones
Ian Rogers <[email protected]>
perf symbol-minimal: Fix double free in filename__read_build_id
Alexei Safin <[email protected]>
hwmon: (asus-ec-sensors) check sensor index in read_string()
Mikhail Arkhipov <[email protected]>
mtd: nand: ecc-mxic: Fix use of uninitialized variable ret
Sean Christopherson <[email protected]>
x86/irq: Ensure initial PIR loads are performed exactly once
Henry Martin <[email protected]>
backlight: pm8941: Add NULL check in wled_configure()
Benjamin Marzinski <[email protected]>
dm: free table mempools if not used in __bind
Benjamin Marzinski <[email protected]>
dm: don't change md if dm_table_set_restrictions() fails
Arnaldo Carvalho de Melo <[email protected]>
perf ui browser hists: Set actions->thread before calling do_zoom_thread()
Arnaldo Carvalho de Melo <[email protected]>
perf build: Warn when libdebuginfod devel files are not available
Kees Cook <[email protected]>
randstruct: gcc-plugin: Fix attribute addition
Kees Cook <[email protected]>
randstruct: gcc-plugin: Remove bogus void member
Sergey Shtylyov <[email protected]>
fbdev: core: fbcvt: avoid division by 0 in fb_cvt_hperiod()
Henry Martin <[email protected]>
soc: aspeed: Add NULL check in aspeed_lpc_enable_snoop()
Su Hui <[email protected]>
soc: aspeed: lpc: Fix impossible judgment condition
Joel Stanley <[email protected]>
ARM: aspeed: Don't select SRAM
Julien Massot <[email protected]>
arm64: dts: mt6359: Rename RTC node to match binding expectations
Thuan Nguyen <[email protected]>
arm64: dts: renesas: white-hawk-ard-audio: Fix TPU0 groups
Dmitry Baryshkov <[email protected]>
arm64: dts: qcom: qcm2290: fix (some) of QUP interconnects
Quentin Schulz <[email protected]>
arm64: dts: rockchip: disable unrouted USB controllers and PHY on RK3399 Puma with Haikou
Vignesh Raman <[email protected]>
arm64: defconfig: mediatek: enable PHY drivers
Dmitry Baryshkov <[email protected]>
ARM: dts: qcom: apq8064: move replicator out of soc node
Dmitry Baryshkov <[email protected]>
ARM: dts: qcom: apq8064 merge hw splinlock into corresponding syscon device
Dmitry Baryshkov <[email protected]>
ARM: dts: qcom: apq8064: add missing clocks to the timer node
Andre Przywara <[email protected]>
dt-bindings: vendor-prefixes: Add Liontron name
Ioana Ciornei <[email protected]>
bus: fsl-mc: fix double-free on mc_dev
Ryusuke Konishi <[email protected]>
nilfs2: do not propagate ENOENT error from nilfs_btree_propagate()
Wentao Liang <[email protected]>
nilfs2: add pointer check for nilfs_direct_propagate()
Murad Masimov <[email protected]>
ocfs2: fix possible memory leak in ocfs2_finish_quota_recovery
Phillip Lougher <[email protected]>
Squashfs: check return result of sb_min_blocksize
Barnabás Czémán <[email protected]>
soc: qcom: smp2p: Fix fallback to qcom,ipc parse
Prasanth Babu Mantena <[email protected]>
arm64: dts: ti: k3-j721e-common-proc-board: Enable OSPI1 on J721E
Aaron Kling <[email protected]>
arm64: tegra: Add uartd serial alias for Jetson TX1 module
Aaron Kling <[email protected]>
arm64: tegra: Drop remaining serial clock-names and reset-names
Peter Robinson <[email protected]>
arm64: dts: rockchip: Update eMMC for NanoPi R5 series
Peter Robinson <[email protected]>
arm64: dts: rockchip: Add vcc-supply to SPI flash on rk3566-rock3c
Alexey Minnekhanov <[email protected]>
arm64: dts: qcom: sda660-ifc6560: Fix dt-validate warning
Alexey Minnekhanov <[email protected]>
arm64: dts: qcom: sdm660-lavender: Add missing USB phy supply
Julien Massot <[email protected]>
arm64: dts: mt6359: Add missing 'compatible' property to regulators node
Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt6357: Drop regulator-fixed compatibles
Adam Ford <[email protected]>
arm64: dts: imx8mn-beacon: Set SAI5 MCLK direction to output for HDMI audio
Adam Ford <[email protected]>
arm64: dts: imx8mm-beacon: Set SAI5 MCLK direction to output for HDMI audio
Adam Ford <[email protected]>
arm64: dts: imx8mp-beacon: Fix RTC capacitive load
Adam Ford <[email protected]>
arm64: dts: imx8mn-beacon: Fix RTC capacitive load
Adam Ford <[email protected]>
arm64: dts: imx8mm-beacon: Fix RTC capacitive load
Pin-yen Lin <[email protected]>
arm64: dts: mt8183: Add port node to mt8183.dtsi
Alexey Minnekhanov <[email protected]>
arm64: dts: qcom: sdm660-xiaomi-lavender: Add missing SD card detect GPIO
AngeloGioacchino Del Regno <[email protected]>
arm64: dts: mediatek: mt8195: Reparent vdec1/2 and venc1 power domains
Wolfram Sang <[email protected]>
ARM: dts: at91: at91sam9263: fix NAND chip selects
Wolfram Sang <[email protected]>
ARM: dts: at91: usb_a9263: fix GPIO for Dataflash chip select
Chukun Pan <[email protected]>
arm64: dts: rockchip: Move SHMEM memory to reserved memory on rk3588
Varadarajan Narayanan <[email protected]>
arm64: dts: qcom: ipq9574: Fix USB vdd info
Stephan Gerhold <[email protected]>
arm64: dts: qcom: sc8280xp-x13s: Drop duplicate DMIC supplies
Xilin Wu <[email protected]>
arm64: dts: qcom: sm8250: Fix CPU7 opp table
Luca Weiss <[email protected]>
arm64: dts: qcom: sm8350: Reenable crypto & cryptobam
Dzmitry Sankouski <[email protected]>
arm64: dts: qcom: sdm845-starqltechn: remove excess reserved gpios
Dzmitry Sankouski <[email protected]>
arm64: dts: qcom: sdm845-starqltechn: refactor node order
Dzmitry Sankouski <[email protected]>
arm64: dts: qcom: sdm845-starqltechn: fix usb regulator mistake
Dzmitry Sankouski <[email protected]>
arm64: dts: qcom: sdm845-starqltechn: remove wifi
Konrad Dybcio <[email protected]>
arm64: dts: qcom: x1e80100-romulus: Keep L12B and L15B always on
Neil Armstrong <[email protected]>
arm64: dts: qcom: sm8650: add missing cpu-cfg interconnect path in the mdss node
Neil Armstrong <[email protected]>
arm64: dts: qcom: sm8650: setup gpu thermal with higher temperatures
Mark Kettenis <[email protected]>
arm64: dts: qcom: x1e80100: Mark usb_2 as dma-coherent
Zhiguo Niu <[email protected]>
f2fs: fix to correct check conditions in f2fs_cross_rename
Zhiguo Niu <[email protected]>
f2fs: use d_inode(dentry) cleanup dentry->d_inode
Horatiu Vultur <[email protected]>
net: phy: mscc: Stop clearing the the UDPv4 checksum for L2 frames
Faicker Mo <[email protected]>
net: openvswitch: Fix the dead loop of MPLS parse
Kuniyuki Iwashima <[email protected]>
calipso: Don't call calipso functions for AF_INET sk.
Hariprasad Kelam <[email protected]>
octeontx2-pf: QOS: Refactor TC_HTB_LEAF_DEL_LAST callback
Hariprasad Kelam <[email protected]>
octeontx2-pf: QOS: Perform cache sync on send queue teardown
Horatiu Vultur <[email protected]>
net: phy: mscc: Fix memory leak when using one step timestamping
Thangaraj Samynathan <[email protected]>
net: lan743x: Fix PHY reset handling during initialization and WOL
Thangaraj Samynathan <[email protected]>
net: lan743x: rename lan743x_reset_phy to lan743x_hw_reset_phy
Greg Kroah-Hartman <[email protected]>
net: phy: fix up const issues in to_mdio_device() and to_phy_device()
Wei Fang <[email protected]>
net: phy: clear phydev->devlink when the link is deleted
KaFai Wan <[email protected]>
bpf: Avoid __bpf_prog_ret0_warn when jit fails
Suraj Gupta <[email protected]>
net: xilinx: axienet: Fix Tx skb circular buffer occupancy check in dmaengine xmit
Horatiu Vultur <[email protected]>
net: lan966x: Fix 1-step timestamping over ipv4 or ipv6
Jack Morgenstein <[email protected]>
RDMA/cma: Fix hang when cma_netevent_callback fails to queue_work
Stefano Garzarella <[email protected]>
vsock/virtio: fix rx_bytes accounting for stream sockets
Nikita Zhandarovich <[email protected]>
net: usb: aqc111: fix error handling of usbnet read calls
Radim Krčmář <[email protected]>
RISC-V: KVM: lock the correct mp_state during reset
Fernando Fernandez Mancera <[email protected]>
netfilter: nft_tunnel: fix geneve_opt dump
Florian Westphal <[email protected]>
netfilter: nf_tables: nft_fib: consistent l3mdev handling
Jiayuan Chen <[email protected]>
bpf, sockmap: Avoid using sk_socket after free when sending
Kees Cook <[email protected]>
Bluetooth: btintel: Check dsbr size from EFI variable
Dmitry Antipov <[email protected]>
Bluetooth: MGMT: iterate over mesh commands in mgmt_mesh_foreach()
Li RongQing <[email protected]>
vfio/type1: Fix error unwind in migration dirty bitmap allocation
Florian Westphal <[email protected]>
netfilter: nf_tables: nft_fib_ipv6: fix VRF ipv4/ipv6 result discrepancy
Florian Westphal <[email protected]>
netfilter: xtables: support arpt_mark and ipv6 optstrip for iptables-nft only builds
Di Shen <[email protected]>
bpf: Revert "bpf: remove unnecessary rcu_read_{lock,unlock}() in multi-uprobe attach logic"
Shayne Chen <[email protected]>
wifi: mt76: mt7996: fix RX buffer size of MCU event
Peter Chiu <[email protected]>
wifi: mt76: mt7996: set EHT max ampdu length capability
Michael Lo <[email protected]>
wifi: mt76: mt7925: ensure all MCU commands wait for response
Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: refine the sniffer commnad
Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: prevent multiple scan commands
Henry Martin <[email protected]>
wifi: mt76: mt7915: Fix null-ptr-deref in mt7915_mmio_wed_init()
Henry Martin <[email protected]>
wifi: mt76: mt7996: Fix null-ptr-deref in mt7996_mmio_wed_init()
Luiz Augusto von Dentz <[email protected]>
Bluetooth: ISO: Fix not using SID from adv report
Michal Koutný <[email protected]>
kernfs: Relax constraint in draining guard
ping.gao <[email protected]>
scsi: ufs: mcq: Delete ufshcd_release_scsi_cmd() in ufshcd_mcq_abort()
Toke Høiland-Jørgensen <[email protected]>
wifi: ath9k_htc: Abort software beacon handling if disabled
Longfang Liu <[email protected]>
hisi_acc_vfio_pci: bugfix live migration function without VF device driver
Longfang Liu <[email protected]>
hisi_acc_vfio_pci: add eq and aeq interruption restore
Longfang Liu <[email protected]>
hisi_acc_vfio_pci: fix XQE dma address error
Rajat Soni <[email protected]>
wifi: ath12k: fix memory leak in ath12k_service_ready_ext_event
Rolf Eike Beer <[email protected]>
iommu: remove duplicate selection of DMAR_TABLE
Chin-Yen Lee <[email protected]>
wifi: rtw89: fix firmware scan delay unit for WiFi 6 chips
Alexey Kodanev <[email protected]>
wifi: rtw88: fix the 'para' buffer size to avoid reading out of bounds
Ping-Ke Shih <[email protected]>
wifi: rtw89: pci: enlarge retry times of RX tag to 1000
Ilya Leoshkevich <[email protected]>
s390/bpf: Store backchain even for leaf progs
Vincent Knecht <[email protected]>
clk: qcom: gcc-msm8939: Fix mclk0 & mclk1 for 24 MHz
Rob Herring (Arm) <[email protected]>
dt-bindings: soc: fsl,qman-fqd: Fix reserved-memory.yaml reference
Tao Chen <[email protected]>
bpf: Fix WARN() in get_bpf_raw_tp_regs
Andy Shevchenko <[email protected]>
pinctrl: at91: Fix possible out-of-boundary access
Anton Protopopov <[email protected]>
libbpf: Use proper errno value in nlattr
Jiayuan Chen <[email protected]>
ktls, sockmap: Fix missing uncharge operation
Dan Carpenter <[email protected]>
of: unittest: Unlock on error in unittest_data_add()
Miaoqian Lin <[email protected]>
tracing: Fix error handling in event_trigger_parse()
Steven Rostedt <[email protected]>
tracing: Rename event_trigger_alloc() to trigger_data_alloc()
Luis Gerhorst <[email protected]>
selftests/bpf: Fix caps for __xlated/jited_unpriv
Hans Zhang <[email protected]>
efi/libstub: Describe missing 'out' parameter in efi_load_initrd
Ilan Peer <[email protected]>
wifi: iwlfiwi: mvm: Fix the rate reporting
Henry Martin <[email protected]>
clk: bcm: rpi: Add NULL check in raspberrypi_clk_register()
YiFei Zhu <[email protected]>
bpftool: Fix regression of "bpftool cgroup tree" EINVAL on older kernels
Luca Weiss <[email protected]>
clk: qcom: gpucc-sm6350: Add *_wait_val values for GDSCs
Luca Weiss <[email protected]>
clk: qcom: gcc-sm6350: Add *_wait_val values for GDSCs
Luca Weiss <[email protected]>
clk: qcom: dispcc-sm6350: Add *_wait_val values for GDSCs
Luca Weiss <[email protected]>
clk: qcom: camcc-sm6350: Add *_wait_val values for GDSCs
Steven Rostedt <[email protected]>
tracing: Move histogram trigger variables from stack to per CPU structure
Anton Protopopov <[email protected]>
bpf: Fix uninitialized values in BPF_{CORE,PROBE}_READ
Patrisious Haddad <[email protected]>
RDMA/mlx5: Fix error flow upon firmware failure for RQ destruction
Pablo Neira Ayuso <[email protected]>
netfilter: nft_set_pipapo: prevent overflow in lookup table allocation
Zhongqiu Duan <[email protected]>
netfilter: nft_quota: match correctly when the quota just depleted
Huajian Yang <[email protected]>
netfilter: bridge: Move specific fragmented packet to slow_path instead of dropping it
Lorenzo Bianconi <[email protected]>
bpf: Allow XDP dev-bound programs to perform XDP_REDIRECT into maps
Anton Protopopov <[email protected]>
libbpf: Use proper errno value in linker
Yi Zhang <[email protected]>
scsi: smartpqi: Fix smp_processor_id() call trace for preemptible kernels
Chao Yu <[email protected]>
f2fs: fix to detect gcing page in f2fs_is_cp_guaranteed()
Chao Yu <[email protected]>
f2fs: clean up w/ fscrypt_is_bounce_page()
Hangbin Liu <[email protected]>
bonding: assign random address if device address is same as bond
Jason Gunthorpe <[email protected]>
iommu: Protect against overflow in iommu_pgsize()
Jonathan Wiepert <[email protected]>
Use thread-safe function pointer in libbpf_print
Tao Chen <[email protected]>
libbpf: Remove sample_period init in perf_buffer
Feng Yang <[email protected]>
libbpf: Fix event name too long error
Yihang Li <[email protected]>
scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
Junxian Huang <[email protected]>
RDMA/hns: Include hnae3.h in hns_roce_hw_v2.h
Maharaja Kennadyrajan <[email protected]>
wifi: ath12k: fix node corruption in ar->arvifs list
Ramasamy Kaliappan <[email protected]>
wifi: ath12k: Fix the QoS control field offset to build QoS header
P Praneesh <[email protected]>
wifi: ath12k: Add MSDU length validation for TKIP MIC error
Sarika Sharma <[email protected]>
wifi: ath12k: fix invalid access to memory
Dmitry Antipov <[email protected]>
wifi: rtw88: do not ignore hardware read error during DPK
Zhen XIN <[email protected]>
wifi: rtw88: sdio: call rtw_sdio_indicate_tx_status unconditionally
Zhen XIN <[email protected]>
wifi: rtw88: sdio: map mgmt frames to queue TX_DESC_QSEL_MGMT
Cosmin Ratiu <[email protected]>
xfrm: Use xdo.dev instead of xdo.real_dev
Cosmin Ratiu <[email protected]>
net/mlx5: Avoid using xso.real_dev unnecessarily
Viktor Malik <[email protected]>
libbpf: Fix buffer overflow in bpf_object__init_prog
Hari Kalavakunta <[email protected]>
net: ncsi: Fix GCPS 64-bit member variables
Toke Høiland-Jørgensen <[email protected]>
page_pool: Track DMA-mapped pages and unmap them when destroying the pool
Toke Høiland-Jørgensen <[email protected]>
page_pool: Move pp_magic check into helper functions
Chao Yu <[email protected]>
f2fs: fix to do sanity check on sbi->total_valid_block_count
yohan.joung <[email protected]>
f2fs: prevent the current section from being selected as a victim during GC
Jaegeuk Kim <[email protected]>
f2fs: clean up unnecessary indentation
Dan Carpenter <[email protected]>
wifi: ath12k: Fix buffer overflow in debugfs
Ramya Gnanasekar <[email protected]>
wifi: ath12k: Fix WMI tag for EHT rate in peer assoc
Raj Kumar Bhagat <[email protected]>
wifi: ath12k: fix cleanup path after mhi init
Chao Yu <[email protected]>
f2fs: zone: fix to avoid inconsistence in between SIT and SSA
Jiayuan Chen <[email protected]>
bpf, sockmap: Fix panic when calling skb_linearize
Jiayuan Chen <[email protected]>
bpf, sockmap: fix duplicated data transmission
Jiayuan Chen <[email protected]>
bpf: fix ktls panic with sockmap
Saket Kumar Bhaskar <[email protected]>
selftests/bpf: Fix bpf_nf selftest failure
Tao Chen <[email protected]>
bpf: Check link_create.flags parameter for multi_kprobe
Jacob Moroni <[email protected]>
IB/cm: use rwlock for MAD agent lock
P Praneesh <[email protected]>
wifi: ath12k: Fix invalid memory access while forming 802.11 header
P Praneesh <[email protected]>
wifi: ath12k: Fix memory leak during vdev_id mismatch
Stone Zhang <[email protected]>
wifi: ath11k: fix node corruption in ar->arvifs list
Roger Pau Monne <[email protected]>
xen/x86: fix initial memory balloon target
Chuck Lever <[email protected]>
svcrdma: Reduce the number of rdma_rw contexts per-QP
Detlev Casanova <[email protected]>
media: verisilicon: Free post processor buffers on error
AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_drm_drv: Unbind secondary mmsys components on err
AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: Fix kobject put for component sub-drivers
AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_drm_drv: Fix kobject put for mtk_mutex device ptr
Konrad Dybcio <[email protected]>
drm/msm/a6xx: Disable rgb565_predicator on Adreno 7c3
Terry Tritton <[email protected]>
selftests/seccomp: fix negative_ENOSYS tracer tests on arm32
Anand Moon <[email protected]>
perf/amlogic: Replace smp_processor_id() with raw_smp_processor_id() in meson_ddr_pmu_create()
Kees Cook <[email protected]>
scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
Gustavo A. R. Silva <[email protected]>
overflow: Fix direct struct member initialization in _DEFINE_FLEX()
Mark Rutland <[email protected]>
arm64/fpsimd: Do not discard modified SVE state
Huang Yiwei <[email protected]>
firmware: SDEI: Allow sdei initialization without ACPI_APEI_GHES
Biju Das <[email protected]>
drm/tegra: rgb: Fix the unbound reference count
Kees Cook <[email protected]>
drm/vkms: Adjust vkms_state->active_planes allocation type
Biju Das <[email protected]>
drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: enable SmartDMA on SC8180X
Dmitry Baryshkov <[email protected]>
drm/msm/dpu: enable SmartDMA on SM8150
Neill Kapron <[email protected]>
selftests/seccomp: fix syscall_restart test for arm compat
Mark Rutland <[email protected]>
arm64/fpsimd: Avoid warning when sve_to_fpsimd() is unused
Kornel Dulęba <[email protected]>
arm64: Support ARM64_VA_BITS=52 when setting ARCH_MMAP_RND_BITS_MAX
Miaoqian Lin <[email protected]>
firmware: psci: Fix refcount leak in psci_dt_init
Finn Thain <[email protected]>
m68k: mac: Fix macintosh_config for Mac II
Kees Cook <[email protected]>
watchdog: exar: Shorten identity name to fit correctly
Thomas Weißschuh <[email protected]>
kunit/usercopy: Disable u64 test on 32-bit SPARC
Lizhi Xu <[email protected]>
fs/ntfs3: Add missing direct_IO in ntfs_aops_cmpr
Andrey Vatoropin <[email protected]>
fs/ntfs3: handle hdr_first_de() return value
Christophe JAILLET <[email protected]>
drm/bridge: lt9611uxc: Fix an error handling path in lt9611uxc_probe()
Casey Connolly <[email protected]>
drm/panel: samsung-sofef00: Drop s6e3fc2x01 support
Hongbo Yao <[email protected]>
perf: arm-ni: Fix missing platform_set_drvdata()
Hongbo Yao <[email protected]>
perf: arm-ni: Unregister PMUs on probe failure
Boris Brezillon <[email protected]>
drm/panthor: Update panthor_mmu::irq::mask when needed
Boris Brezillon <[email protected]>
drm/panthor: Fix GPU_COHERENCY_ACE[_LITE] definitions
Mark Rutland <[email protected]>
arm64/fpsimd: Fix merging of FPSIMD state during signal return
Mark Rutland <[email protected]>
arm64/fpsimd: Reset FPMR upon exec()
Mark Rutland <[email protected]>
arm64/fpsimd: Avoid clobbering kernel FPSIMD state with SMSTOP
Mark Brown <[email protected]>
arm64/fpsimd: Don't corrupt FPMR when streaming mode changes
Mark Brown <[email protected]>
arm64/fpsimd: Discard stale CPU state when handling SME traps
Mark Rutland <[email protected]>
arm64/fpsimd: Avoid RES0 bits in the SME trap handler
Jonas Karlman <[email protected]>
media: rkvdec: Fix frame size enumeration
Charles Han <[email protected]>
drm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table
Maxime Ripard <[email protected]>
drm/vc4: tests: Use return instead of assert
Badal Nilawar <[email protected]>
drm/xe/d3cold: Set power state to D3Cold during s2idle/s3
Ian Forbes <[email protected]>
drm/vmwgfx: Fix dumb buffer leak
Keisuke Nishimura <[email protected]>
drm/vmwgfx: Add error path for xa_store in vmw_bo_add_detached_resource
Ian Forbes <[email protected]>
drm/vmwgfx: Add seqno waiter for sync_files
Greg Kroah-Hartman <[email protected]>
ALSA: core: fix up bus match const issues.
Martin Povišer <[email protected]>
ASoC: apple: mca: Constrain channels according to TDM mask
Geert Uytterhoeven <[email protected]>
spi: sh-msiof: Fix maximum DMA transfer size
Armin Wolf <[email protected]>
ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions"
AngeloGioacchino Del Regno <[email protected]>
thermal/drivers/mediatek/lvts: Fix debugfs unregister on failure
Rafael J. Wysocki <[email protected]>
PM: sleep: Print PM debug messages during hibernation
Jiaqing Zhao <[email protected]>
x86/mtrr: Check if fixed-range MTRRs exist in mtrr_save_fixed_ranges()
Mingcong Bai <[email protected]>
ACPI: resource: fix a typo for MECHREVO in irq1_edge_low_force_override[]
Zijun Hu <[email protected]>
PM: wakeup: Delete space in the end of string shown by pm_show_wakelocks()
Vijendar Mukunda <[email protected]>
ASoC: SOF: amd: add missing acp descriptor field
Kees Cook <[email protected]>
ASoC: SOF: ipc4-pcm: Adjust pipeline_list->pipelines allocation type
Yaxiong Tian <[email protected]>
PM: EM: Fix potential division-by-zero error in em_compute_costs()
Alexander Shiyan <[email protected]>
power: reset: at91-reset: Optimize at91_reset()
Vishwaroop A <[email protected]>
spi: tegra210-quad: modify chip select (CS) deactivation
Vishwaroop A <[email protected]>
spi: tegra210-quad: remove redundant error handling code
Vishwaroop A <[email protected]>
spi: tegra210-quad: Fix X1_X2_X4 encoding and support x4 transfers
Thomas Weißschuh <[email protected]>
tools/nolibc: fix integer overflow in i{64,}toa_r() and
Qiuxu Zhuo <[email protected]>
EDAC/{skx_common,i10nm}: Fix the loss of saved RRL for HBM pseudo channel 0
Qiuxu Zhuo <[email protected]>
EDAC/skx_common: Fix general protection fault
Julien Massot <[email protected]>
ASoC: mediatek: mt8195: Set ETDM1/2 IN/OUT to COMP_DUMMY()
Hector Martin <[email protected]>
ASoC: tas2764: Enable main IRQs
Jemmy Wong <[email protected]>
tools/nolibc/types.h: fix mismatched parenthesis in minor()
Daniil Tatianin <[email protected]>
ACPICA: exserial: don't forget to handle FFixedHW opregions for reading
Herbert Xu <[email protected]>
crypto: api - Redo lookup on EEXIST
Tzung-Bi Shih <[email protected]>
kunit: Fix wrong parameter to kunit_deactivate_static_stub()
Ovidiu Panait <[email protected]>
crypto: sun8i-ce - move fallback ahash_request to the end of the struct
Herbert Xu <[email protected]>
crypto: xts - Only add ecb if it is not already there
Herbert Xu <[email protected]>
crypto: lrw - Only add ecb if it is not already there
Yongliang Gao <[email protected]>
rcu/cpu_stall_cputime: fix the hardirq count for x86 architecture
Filipe Manana <[email protected]>
btrfs: fix invalid data space release when truncating block in NOCOW mode
Qu Wenruo <[email protected]>
btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
Qu Wenruo <[email protected]>
btrfs: scrub: update device stats when an error is detected
Gaurav Batra <[email protected]>
powerpc/pseries/iommu: Fix kmemleak in TCE table userspace view
Sheng Yong <[email protected]>
erofs: avoid using multiple devices with different type
Hongbo Li <[email protected]>
erofs: fix file handle encoding for 64-bit NIDs
Herbert Xu <[email protected]>
crypto: marvell/cesa - Avoid empty transfer descriptor
Herbert Xu <[email protected]>
crypto: marvell/cesa - Handle zero-length skcipher requests
Nícolas F. R. A. Prado <[email protected]>
kselftest: cpufreq: Get rid of double suspend in rtcwake case
Yu Kuai <[email protected]>
brd: fix discard end sector
Yu Kuai <[email protected]>
brd: fix aligned_sector from brd_do_discard()
Masami Hiramatsu (Google) <[email protected]>
x86/insn: Fix opcode map (!REX2) superscript tags
Ahmed S. Darwish <[email protected]>
x86/cpu: Sanitize CPUID(0x80000000) output
Ovidiu Panait <[email protected]>
crypto: sun8i-ce - undo runtime PM changes during driver removal
Annie Li <[email protected]>
x86/microcode/AMD: Do not return error when microcode update is not necessary
John Stultz <[email protected]>
sched/core: Tweak wait_task_inactive() to force dequeue sched_delayed tasks
Eddie James <[email protected]>
powerpc/crash: Fix non-smp kexec preparation
Jiri Slaby (SUSE) <[email protected]>
powerpc: do not build ppc_save_regs.o always
Corentin Labbe <[email protected]>
crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions
Ovidiu Panait <[email protected]>
crypto: sun8i-ce-cipher - fix error handling in sun8i_ce_cipher_prepare()
Qing Wang <[email protected]>
perf/core: Fix broken throttling when max_samples_per_tick=1
Andreas Gruenbacher <[email protected]>
gfs2: gfs2_create_inode error handling fix
Andreas Gruenbacher <[email protected]>
gfs2: replace sd_aspace with sd_inode
Sandipan Das <[email protected]>
perf/x86/amd/uncore: Prevent UMC counters from saturating
Sandipan Das <[email protected]>
perf/x86/amd/uncore: Remove unused 'struct amd_uncore_ctx::node' member
Peter Zijlstra <[email protected]>
sched: Fix trace_sched_switch(.prev_state)
Ovidiu Panait <[email protected]>
crypto: sun8i-ce-hash - fix error handling in sun8i_ce_hash_run()
Andrew Cooper <[email protected]>
x86/idle: Remove MFENCEs for X86_BUG_CLFLUSH_MONITOR in mwait_idle_with_hints() and prefer_mwait_c1_over_halt()
Ahmed S. Darwish <[email protected]>
tools/x86/kcpuid: Fix error handling
-------------
Diffstat:
.../devicetree/bindings/pwm/adi,axi-pwmgen.yaml | 21 +- .../devicetree/bindings/pwm/brcm,bcm7038-pwm.yaml | 8 +- .../devicetree/bindings/pwm/brcm,kona-pwm.yaml | 8 +- .../regulator/mediatek,mt6357-regulator.yaml | 12 +- .../devicetree/bindings/soc/fsl/fsl,qman-fqd.yaml | 4 +- .../devicetree/bindings/vendor-prefixes.yaml | 2 + Documentation/gpu/xe/index.rst | 1 + Documentation/gpu/xe/xe_gt_freq.rst | 14 + Makefile | 4 +- arch/arm/boot/dts/microchip/at91sam9263ek.dts | 2 +- arch/arm/boot/dts/microchip/tny_a9263.dts | 2 +- arch/arm/boot/dts/microchip/usb_a9263.dts | 4 +- arch/arm/boot/dts/qcom/qcom-apq8064.dtsi | 82 +++--- arch/arm/mach-aspeed/Kconfig | 1 - arch/arm64/Kconfig | 6 +- .../arm64/boot/dts/freescale/imx8mm-beacon-kit.dts | 1 + .../boot/dts/freescale/imx8mm-beacon-som.dtsi | 1 + .../arm64/boot/dts/freescale/imx8mn-beacon-kit.dts | 1 + .../boot/dts/freescale/imx8mn-beacon-som.dtsi | 1 + .../boot/dts/freescale/imx8mp-beacon-som.dtsi | 1 + arch/arm64/boot/dts/mediatek/mt6357.dtsi | 10 - arch/arm64/boot/dts/mediatek/mt6359.dtsi | 4 +- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 10 +- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 4 + arch/arm64/boot/dts/mediatek/mt8195.dtsi | 50 ++-- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 12 - arch/arm64/boot/dts/nvidia/tegra194.dtsi | 12 - arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi | 1 + arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi | 11 +- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 16 +- .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 3 - .../arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts | 2 + .../arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 3 + .../boot/dts/qcom/sdm845-samsung-starqltechn.dts | 16 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 6 +- arch/arm64/boot/dts/qcom/sm8650.dtsi | 71 ++--- .../boot/dts/qcom/x1e80100-microsoft-romulus.dtsi | 2 + arch/arm64/boot/dts/qcom/x1e80100.dtsi | 299 +++++++++++---------- .../r8a779g0-white-hawk-ard-audio-da7212.dtso | 2 +- .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 8 - arch/arm64/boot/dts/rockchip/rk3566-rock-3c.dts | 1 + .../arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi | 5 +- arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 15 +- .../boot/dts/ti/k3-j721e-common-proc-board.dts | 1 + arch/arm64/configs/defconfig | 3 + arch/arm64/include/asm/esr.h | 12 +- arch/arm64/include/asm/fpsimd.h | 3 + arch/arm64/kernel/entry-common.c | 46 +++- arch/arm64/kernel/fpsimd.c | 36 ++- arch/arm64/xen/hypercall.S | 21 +- arch/m68k/mac/config.c | 2 +- .../boot/dts/loongson/loongson64c_4core_ls7a.dts | 1 + arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kexec/crash.c | 5 +- arch/powerpc/platforms/book3s/vas-api.c | 9 + arch/powerpc/platforms/powernv/memtrace.c | 8 +- arch/powerpc/platforms/pseries/iommu.c | 2 +- arch/riscv/kernel/traps_misaligned.c | 4 +- arch/riscv/kvm/vcpu_sbi.c | 4 +- arch/s390/net/bpf_jit_comp.c | 12 +- arch/x86/events/amd/uncore.c | 36 ++- arch/x86/include/asm/mwait.h | 9 +- arch/x86/include/asm/sighandling.h | 22 ++ arch/x86/kernel/cpu/common.c | 17 +- arch/x86/kernel/cpu/microcode/core.c | 2 + arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/ioport.c | 13 +- arch/x86/kernel/irq.c | 2 +- arch/x86/kernel/process.c | 15 +- arch/x86/kernel/signal_32.c | 4 + arch/x86/kernel/signal_64.c | 4 + arch/x86/lib/x86-opcode-map.txt | 50 ++-- block/blk-zoned.c | 7 +- block/elevator.c | 3 +- crypto/api.c | 13 +- crypto/lrw.c | 4 +- crypto/xts.c | 4 +- drivers/acpi/acpica/exserial.c | 6 + drivers/acpi/apei/Kconfig | 1 + drivers/acpi/apei/ghes.c | 2 +- drivers/acpi/cppc_acpi.c | 2 +- drivers/acpi/osi.c | 1 - drivers/acpi/resource.c | 2 +- drivers/base/power/main.c | 3 +- drivers/block/brd.c | 11 +- drivers/block/loop.c | 8 +- drivers/bluetooth/btintel.c | 10 +- drivers/bluetooth/btintel_pcie.c | 31 ++- drivers/bluetooth/btintel_pcie.h | 10 +- drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +- drivers/clk/bcm/clk-raspberrypi.c | 2 + drivers/clk/qcom/camcc-sm6350.c | 18 ++ drivers/clk/qcom/dispcc-sm6350.c | 3 + drivers/clk/qcom/gcc-msm8939.c | 4 +- drivers/clk/qcom/gcc-sm6350.c | 6 + drivers/clk/qcom/gpucc-sm6350.c | 6 + drivers/counter/interrupt-cnt.c | 9 + .../crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 7 +- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 17 +- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 34 ++- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 2 +- .../crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 2 +- drivers/crypto/marvell/cesa/cipher.c | 3 + drivers/crypto/marvell/cesa/hash.c | 2 +- drivers/dma/ti/k3-udma.c | 3 +- drivers/edac/i10nm_base.c | 35 +-- drivers/edac/skx_common.c | 1 + drivers/edac/skx_common.h | 11 +- drivers/firmware/Kconfig | 1 - drivers/firmware/arm_sdei.c | 11 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 1 + drivers/firmware/psci/psci.c | 4 +- drivers/fpga/tests/fpga-mgr-test.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 8 + .../gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 8 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 9 +- drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 2 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v14_0.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 4 +- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 4 +- .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 24 +- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 4 +- drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 4 +- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 19 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 4 +- .../gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c | 4 +- drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c | 38 ++- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 +- drivers/gpu/drm/i915/display/intel_psr_regs.h | 4 +- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 19 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 31 ++- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/meson/meson_drv.h | 2 +- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 29 +- drivers/gpu/drm/meson/meson_vclk.c | 226 +++++++++------- drivers/gpu/drm/meson/meson_vclk.h | 13 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 - .../gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 16 +- .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 16 +- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 34 +-- drivers/gpu/drm/panel/panel-simple.c | 5 +- drivers/gpu/drm/panthor/panthor_mmu.c | 1 + drivers/gpu/drm/panthor/panthor_regs.h | 4 +- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 +- drivers/gpu/drm/tegra/rgb.c | 14 +- drivers/gpu/drm/vc4/tests/vc4_mock_output.c | 36 ++- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 10 +- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 26 ++ drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 34 ++- drivers/gpu/drm/xe/xe_gt_freq.c | 2 + drivers/gpu/drm/xe/xe_pci.c | 1 + drivers/hid/hid-hyperv.c | 4 +- drivers/hid/usbhid/hid-core.c | 25 +- drivers/hwmon/asus-ec-sensors.c | 4 + drivers/hwtracing/coresight/coresight-catu.c | 27 +- drivers/hwtracing/coresight/coresight-catu.h | 1 + drivers/hwtracing/coresight/coresight-config.h | 2 +- drivers/hwtracing/coresight/coresight-core.c | 6 +- drivers/hwtracing/coresight/coresight-cpu-debug.c | 3 +- drivers/hwtracing/coresight/coresight-funnel.c | 3 +- drivers/hwtracing/coresight/coresight-replicator.c | 3 +- drivers/hwtracing/coresight/coresight-stm.c | 2 +- drivers/hwtracing/coresight/coresight-syscfg.c | 49 ++-- drivers/hwtracing/coresight/coresight-tmc-core.c | 2 +- drivers/hwtracing/coresight/coresight-tpiu.c | 2 +- drivers/iio/adc/ad7124.c | 4 +- drivers/iio/adc/mcp3911.c | 39 ++- drivers/iio/adc/pac1934.c | 2 +- drivers/iio/filter/admv8818.c | 230 ++++++++++++---- drivers/infiniband/core/cm.c | 16 +- drivers/infiniband/core/cma.c | 3 +- drivers/infiniband/hw/hns/hns_roce_ah.c | 1 - drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 - drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 1 + drivers/infiniband/hw/hns/hns_roce_main.c | 1 - drivers/infiniband/hw/hns/hns_roce_restrack.c | 1 - drivers/infiniband/hw/mlx5/qpc.c | 30 ++- drivers/input/rmi4/rmi_f34.c | 133 +++++---- drivers/iommu/Kconfig | 1 - drivers/iommu/iommu.c | 4 +- drivers/mailbox/imx-mailbox.c | 21 +- drivers/mailbox/mtk-cmdq-mailbox.c | 51 ++-- drivers/md/dm-core.h | 1 + drivers/md/dm-flakey.c | 70 ++--- drivers/md/dm-zone.c | 25 +- drivers/md/dm.c | 30 ++- .../media/platform/verisilicon/hantro_postproc.c | 4 +- drivers/mfd/exynos-lpass.c | 6 +- drivers/mfd/stmpe-spi.c | 2 +- drivers/misc/mei/vsc-tp.c | 4 +- drivers/misc/vmw_vmci/vmci_host.c | 11 +- drivers/mmc/host/sdhci-of-dwcmshc.c | 40 +++ drivers/mtd/nand/ecc-mxic.c | 2 +- drivers/net/bonding/bond_main.c | 25 +- drivers/net/dsa/b53/b53_common.c | 37 +-- drivers/net/ethernet/google/gve/gve_main.c | 2 +- drivers/net/ethernet/google/gve/gve_tx_dqo.c | 3 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 +- drivers/net/ethernet/intel/ice/ice_main.c | 47 +++- drivers/net/ethernet/intel/ice/ice_sched.c | 181 ++++++++++--- drivers/net/ethernet/intel/idpf/idpf_lib.c | 18 +- .../net/ethernet/intel/idpf/idpf_singleq_txrx.c | 9 +- drivers/net/ethernet/intel/idpf/idpf_txrx.c | 45 ++-- drivers/net/ethernet/intel/idpf/idpf_txrx.h | 8 - drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 2 +- drivers/net/ethernet/intel/idpf/idpf_virtchnl.h | 1 + drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 4 +- .../net/ethernet/marvell/octeontx2/nic/qos_sq.c | 22 ++ drivers/net/ethernet/mediatek/mtk_star_emac.c | 4 + drivers/net/ethernet/mellanox/mlx4/en_clock.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 4 +- .../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 18 +- .../ethernet/mellanox/mlx5/core/en_accel/ipsec.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 12 +- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 21 +- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 5 +- .../net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 +- .../mlx5/core/steering/hws/mlx5hws_definer.c | 3 + drivers/net/ethernet/microchip/lan743x_main.c | 15 +- .../net/ethernet/microchip/lan966x/lan966x_main.c | 7 + .../net/ethernet/microchip/lan966x/lan966x_main.h | 6 + .../net/ethernet/microchip/lan966x/lan966x_ptp.c | 49 +++- .../ethernet/microchip/lan966x/lan966x_switchdev.c | 1 + .../net/ethernet/microchip/lan966x/lan966x_vlan.c | 21 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_est.c | 5 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 + .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 11 +- drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +- drivers/net/ethernet/ti/icssg/icssg_stats.c | 8 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 +- drivers/net/macsec.c | 40 ++- drivers/net/netdevsim/netdev.c | 3 +- drivers/net/phy/mdio_bus.c | 12 + drivers/net/phy/mscc/mscc_ptp.c | 20 +- drivers/net/phy/phy_device.c | 4 +- drivers/net/usb/aqc111.c | 10 +- drivers/net/vmxnet3/vmxnet3_drv.c | 26 ++ drivers/net/wireguard/device.c | 1 + drivers/net/wireless/ath/ath10k/snoc.c | 4 +- drivers/net/wireless/ath/ath11k/core.c | 37 +-- drivers/net/wireless/ath/ath11k/core.h | 4 +- drivers/net/wireless/ath/ath11k/debugfs.c | 148 +--------- drivers/net/wireless/ath/ath11k/debugfs.h | 10 +- drivers/net/wireless/ath/ath11k/mac.c | 92 ++++++- drivers/net/wireless/ath/ath11k/mac.h | 4 +- drivers/net/wireless/ath/ath11k/wmi.c | 47 +++- drivers/net/wireless/ath/ath12k/core.c | 8 +- .../net/wireless/ath/ath12k/debugfs_htt_stats.c | 3 + drivers/net/wireless/ath/ath12k/dp_rx.c | 54 ++-- drivers/net/wireless/ath/ath12k/dp_tx.c | 1 + drivers/net/wireless/ath/ath12k/hal.c | 103 +++---- drivers/net/wireless/ath/ath12k/hal.h | 64 +++-- drivers/net/wireless/ath/ath12k/hal_desc.h | 3 +- drivers/net/wireless/ath/ath12k/hw.c | 35 ++- drivers/net/wireless/ath/ath12k/hw.h | 12 +- drivers/net/wireless/ath/ath12k/pci.c | 12 +- drivers/net/wireless/ath/ath12k/pci.h | 4 +- drivers/net/wireless/ath/ath12k/wmi.c | 3 +- drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 3 + drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 2 + drivers/net/wireless/marvell/mwifiex/11n.c | 6 +- drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 6 + drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 21 +- drivers/net/wireless/mediatek/mt76/mt7996/dma.c | 4 +- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 3 + drivers/net/wireless/mediatek/mt76/mt7996/mmio.c | 3 + drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h | 3 + drivers/net/wireless/realtek/rtw88/coex.c | 2 +- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 3 +- drivers/net/wireless/realtek/rtw88/sdio.c | 10 +- drivers/net/wireless/realtek/rtw89/fw.c | 2 +- drivers/net/wireless/realtek/rtw89/pci.c | 2 +- drivers/net/wwan/mhi_wwan_mbim.c | 9 +- drivers/net/wwan/t7xx/t7xx_netdev.c | 11 +- drivers/nvme/host/constants.c | 2 +- drivers/nvme/host/core.c | 1 - drivers/nvme/host/pr.c | 2 - drivers/nvme/target/core.c | 9 +- drivers/nvme/target/fcloop.c | 31 +-- drivers/nvme/target/io-cmd-bdev.c | 9 +- drivers/nvmem/zynqmp_nvmem.c | 1 + drivers/of/unittest.c | 10 +- drivers/pci/controller/cadence/pcie-cadence-host.c | 11 +- drivers/pci/controller/dwc/pcie-rcar-gen4.c | 1 + drivers/pci/controller/pcie-apple.c | 4 +- drivers/pci/endpoint/pci-epf-core.c | 22 +- drivers/pci/pci-acpi.c | 23 +- drivers/pci/pci-driver.c | 6 - drivers/pci/pci.c | 15 +- drivers/pci/pci.h | 1 + drivers/pci/pcie/dpc.c | 66 +++-- drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- drivers/perf/arm-ni.c | 40 +-- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 6 +- drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 13 +- drivers/pinctrl/pinctrl-at91.c | 6 +- drivers/pinctrl/qcom/pinctrl-qcm2290.c | 9 + drivers/pinctrl/samsung/pinctrl-exynos-arm64.c | 52 ++-- drivers/pinctrl/samsung/pinctrl-exynos.c | 266 ++++++++++-------- drivers/pinctrl/samsung/pinctrl-exynos.h | 8 +- drivers/pinctrl/samsung/pinctrl-samsung.c | 21 +- drivers/pinctrl/samsung/pinctrl-samsung.h | 8 +- drivers/pmdomain/core.c | 35 +++ drivers/power/reset/at91-reset.c | 5 +- drivers/ptp/ptp_private.h | 12 +- drivers/regulator/max20086-regulator.c | 6 +- drivers/remoteproc/qcom_wcnss_iris.c | 2 + drivers/remoteproc/ti_k3_dsp_remoteproc.c | 8 - drivers/remoteproc/ti_k3_r5_remoteproc.c | 8 - drivers/rpmsg/qcom_smd.c | 2 +- drivers/rtc/rtc-loongson.c | 8 + drivers/rtc/rtc-sh.c | 12 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 29 +- drivers/scsi/qedf/qedf_main.c | 2 +- drivers/scsi/scsi_transport_iscsi.c | 11 +- drivers/scsi/smartpqi/smartpqi_init.c | 4 +- drivers/soc/aspeed/aspeed-lpc-snoop.c | 17 +- drivers/soc/qcom/smp2p.c | 2 +- drivers/spi/spi-bcm63xx-hsspi.c | 2 +- drivers/spi/spi-bcm63xx.c | 2 +- drivers/spi/spi-omap2-mcspi.c | 30 ++- drivers/spi/spi-sh-msiof.c | 13 +- drivers/spi/spi-tegra210-quad.c | 24 +- drivers/staging/media/rkvdec/rkvdec.c | 10 +- drivers/thermal/mediatek/lvts_thermal.c | 16 +- drivers/thunderbolt/usb4.c | 4 +- drivers/tty/serial/8250/8250_omap.c | 25 +- drivers/tty/serial/milbeaut_usio.c | 5 +- drivers/tty/serial/sh-sci.c | 24 +- drivers/tty/vt/vt_ioctl.c | 2 - drivers/ufs/core/ufs-mcq.c | 6 - drivers/ufs/core/ufshcd.c | 7 +- drivers/ufs/host/ufs-qcom.c | 5 +- drivers/usb/cdns3/cdnsp-gadget.c | 21 +- drivers/usb/cdns3/cdnsp-gadget.h | 4 + drivers/usb/class/usbtmc.c | 17 +- drivers/usb/core/hub.c | 16 +- drivers/usb/core/usb-acpi.c | 2 + drivers/usb/gadget/function/f_hid.c | 12 +- drivers/usb/gadget/udc/core.c | 2 +- drivers/usb/misc/onboard_usb_dev.c | 111 ++++++-- drivers/usb/renesas_usbhs/common.c | 50 +++- drivers/usb/serial/bus.c | 2 +- drivers/usb/typec/bus.c | 2 +- drivers/usb/typec/tcpm/tcpci_maxim_core.c | 3 +- drivers/usb/typec/tcpm/tcpm.c | 91 +++++-- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 79 +++++- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 14 +- drivers/vfio/vfio_iommu_type1.c | 2 +- drivers/video/backlight/qcom-wled.c | 6 +- drivers/video/fbdev/core/fbcvt.c | 2 +- drivers/watchdog/exar_wdt.c | 2 +- drivers/xen/balloon.c | 13 +- fs/9p/vfs_addr.c | 1 + fs/btrfs/extent-io-tree.c | 6 +- fs/btrfs/inode.c | 7 +- fs/btrfs/scrub.c | 34 ++- fs/erofs/super.c | 49 +++- fs/f2fs/data.c | 4 +- fs/f2fs/f2fs.h | 10 +- fs/f2fs/gc.c | 3 + fs/f2fs/namei.c | 10 +- fs/f2fs/segment.h | 43 +-- fs/f2fs/super.c | 4 +- fs/filesystems.c | 14 +- fs/gfs2/glock.c | 3 +- fs/gfs2/glops.c | 4 +- fs/gfs2/incore.h | 9 +- fs/gfs2/inode.c | 3 +- fs/gfs2/meta_io.c | 2 +- fs/gfs2/meta_io.h | 4 +- fs/gfs2/ops_fstype.c | 35 ++- fs/gfs2/super.c | 16 +- fs/gfs2/sys.c | 1 - fs/kernfs/dir.c | 5 +- fs/kernfs/file.c | 3 +- fs/namespace.c | 25 +- fs/nfs/super.c | 19 ++ fs/nilfs2/btree.c | 4 +- fs/nilfs2/direct.c | 3 + fs/ntfs3/index.c | 8 + fs/ntfs3/inode.c | 5 + fs/ocfs2/quota_local.c | 2 +- fs/smb/client/cifssmb.c | 20 +- fs/squashfs/super.c | 5 + fs/xfs/xfs_discard.c | 17 +- include/linux/arm_sdei.h | 4 +- include/linux/bio.h | 2 +- include/linux/bvec.h | 7 +- include/linux/coresight.h | 2 +- include/linux/hid.h | 3 +- include/linux/ieee80211.h | 79 +++++- include/linux/mdio.h | 5 +- include/linux/mlx5/driver.h | 1 + include/linux/mm.h | 58 ++++ include/linux/nvme.h | 2 +- include/linux/overflow.h | 33 ++- include/linux/pci-epf.h | 3 + include/linux/phy.h | 5 +- include/linux/pm_domain.h | 7 + include/linux/poison.h | 4 + include/linux/virtio_vsock.h | 1 + include/net/bluetooth/hci_core.h | 2 +- include/net/checksum.h | 2 +- include/net/netfilter/nft_fib.h | 9 + include/net/page_pool/types.h | 6 + include/net/sock.h | 7 +- include/sound/hdaudio.h | 4 +- io_uring/fdinfo.c | 12 +- io_uring/io_uring.c | 4 +- io_uring/register.c | 7 +- io_uring/sqpoll.c | 43 +-- io_uring/sqpoll.h | 8 +- kernel/bpf/core.c | 29 +- kernel/events/core.c | 50 +++- kernel/power/energy_model.c | 4 + kernel/power/hibernate.c | 5 + kernel/power/main.c | 3 +- kernel/power/power.h | 4 + kernel/power/wakelock.c | 3 + kernel/rcu/tree.c | 10 +- kernel/rcu/tree.h | 2 +- kernel/rcu/tree_stall.h | 4 +- kernel/sched/core.c | 12 +- kernel/time/posix-cpu-timers.c | 9 + kernel/trace/bpf_trace.c | 7 +- kernel/trace/ring_buffer.c | 41 +-- kernel/trace/trace.h | 8 +- kernel/trace/trace_events_hist.c | 122 +++++++-- kernel/trace/trace_events_trigger.c | 20 +- lib/iov_iter.c | 2 +- lib/kunit/static_stub.c | 2 +- lib/usercopy_kunit.c | 1 + mm/page_alloc.c | 8 +- net/bluetooth/eir.c | 17 +- net/bluetooth/eir.h | 2 +- net/bluetooth/hci_conn.c | 2 + net/bluetooth/hci_core.c | 29 +- net/bluetooth/hci_event.c | 16 +- net/bluetooth/hci_sync.c | 76 +++++- net/bluetooth/iso.c | 9 +- net/bluetooth/l2cap_core.c | 3 +- net/bluetooth/mgmt.c | 140 +++++----- net/bluetooth/mgmt_util.c | 51 ++-- net/bluetooth/mgmt_util.h | 8 +- net/bridge/netfilter/nf_conntrack_bridge.c | 12 +- net/core/filter.c | 2 +- net/core/netmem_priv.h | 33 ++- net/core/page_pool.c | 108 ++++++-- net/core/skbuff.c | 16 +- net/core/skmsg.c | 53 ++-- net/core/sock.c | 8 +- net/core/utils.c | 4 +- net/core/xdp.c | 4 +- net/dsa/tag_brcm.c | 2 +- net/ipv4/netfilter/nft_fib_ipv4.c | 11 +- net/ipv4/udp_offload.c | 5 + net/ipv6/ila/ila_common.c | 6 +- net/ipv6/netfilter.c | 12 +- net/ipv6/netfilter/nft_fib_ipv6.c | 17 +- net/ipv6/seg6_local.c | 6 +- net/mac80211/mlme.c | 7 +- net/mac80211/scan.c | 11 +- net/ncsi/internal.h | 21 +- net/ncsi/ncsi-pkt.h | 23 +- net/ncsi/ncsi-rsp.c | 21 +- net/netfilter/nf_nat_core.c | 12 +- net/netfilter/nft_quota.c | 20 +- net/netfilter/nft_set_pipapo.c | 58 +++- net/netfilter/nft_set_pipapo_avx2.c | 21 +- net/netfilter/nft_tunnel.c | 8 +- net/netfilter/xt_TCPOPTSTRIP.c | 4 +- net/netfilter/xt_mark.c | 2 +- net/netlabel/netlabel_kapi.c | 5 + net/openvswitch/flow.c | 2 +- net/sched/sch_ets.c | 2 +- net/sched/sch_prio.c | 2 +- net/sched/sch_red.c | 2 +- net/sched/sch_sfq.c | 5 +- net/sched/sch_tbf.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 14 +- net/tipc/crypto.c | 6 +- net/tls/tls_sw.c | 15 +- net/vmw_vsock/virtio_transport_common.c | 26 +- net/wireless/scan.c | 18 +- net/xfrm/xfrm_device.c | 2 - net/xfrm/xfrm_state.c | 2 - rust/kernel/alloc/kvec.rs | 3 + scripts/gcc-plugins/gcc-common.h | 32 +++ scripts/gcc-plugins/randomize_layout_plugin.c | 40 +-- sound/core/seq_device.c | 2 +- sound/hda/hda_bus_type.c | 6 +- sound/pci/hda/hda_bind.c | 4 +- sound/pci/hda/patch_realtek.c | 68 ++++- sound/soc/apple/mca.c | 23 ++ sound/soc/codecs/hda.c | 4 +- sound/soc/codecs/tas2764.c | 2 +- sound/soc/intel/avs/debugfs.c | 6 +- sound/soc/intel/avs/ipc.c | 4 +- sound/soc/mediatek/mt8195/mt8195-mt6359.c | 4 +- sound/soc/sof/amd/pci-acp70.c | 1 + sound/soc/sof/ipc4-pcm.c | 3 +- sound/soc/ti/omap-hdmi.c | 7 +- sound/usb/implicit.c | 1 + tools/arch/x86/kcpuid/kcpuid.c | 47 ++-- tools/arch/x86/lib/x86-opcode-map.txt | 50 ++-- tools/bpf/bpftool/cgroup.c | 2 +- tools/bpf/resolve_btfids/Makefile | 2 +- tools/include/nolibc/stdlib.h | 4 +- tools/include/nolibc/types.h | 2 +- tools/lib/bpf/bpf_core_read.h | 6 + tools/lib/bpf/libbpf.c | 48 ++-- tools/lib/bpf/linker.c | 4 +- tools/lib/bpf/nlattr.c | 15 +- tools/objtool/check.c | 3 +- tools/perf/Makefile.config | 2 + tools/perf/Makefile.perf | 3 +- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-trace.c | 9 +- tools/perf/scripts/python/exported-sql-viewer.py | 5 +- tools/perf/tests/switch-tracking.c | 2 +- tools/perf/ui/browsers/hists.c | 2 +- tools/perf/util/intel-pt.c | 205 +++++++++++++- tools/perf/util/machine.c | 6 +- tools/perf/util/symbol-minimal.c | 164 +++++------ tools/perf/util/thread.c | 8 +- tools/perf/util/thread.h | 2 +- tools/power/x86/turbostat/turbostat.c | 41 ++- tools/testing/selftests/Makefile | 2 +- tools/testing/selftests/bpf/prog_tests/bpf_nf.c | 6 + tools/testing/selftests/bpf/test_loader.c | 14 +- tools/testing/selftests/cpufreq/cpufreq.sh | 3 +- tools/testing/selftests/seccomp/seccomp_bpf.c | 13 +- 538 files changed, 5609 insertions(+), 3139 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/512 tools/x86/kcpuid: Fix error handling
6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmed S. Darwish <[email protected]>
[ Upstream commit 116edfe173d0c59ec2aa87fb91f2f31d477b61b3 ]
Error handling in kcpuid is unreliable. On malloc() failures, the code prints an error then just goes on. The error messages are also printed to standard output instead of standard error.
Use err() and errx() from <err.h> to direct all error messages to standard error and automatically exit the program. Use err() to include the errno information, and errx() otherwise. Use warnx() for warnings.
While at it, alphabetically reorder the header includes.
[ mingo: Fix capitalization in the help text while at it. ]
--- tools/arch/x86/kcpuid/kcpuid.c | 47 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 24 deletions(-)
tools/arch/x86/kcpuid/kcpuid.c +23 -24
@@ -1,11 +1,12 @@// SPDX-License-Identifier: GPL-2.0 #define _GNU_SOURCE -#include <stdio.h> +#include <err.h> +#include <getopt.h> #include <stdbool.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <getopt.h> #define ARRAY_SIZE (x) (sizeof(x) / sizeof((x)[0]))#define min (a, b) (((a) < (b)) ? (a) : (b))
@@ -145,14 +146,14 @@ static bool cpuid_store(struct cpuid_range *range, u32 f, int subleaf,if (!func->leafs) { func->leafs =malloc (sizeof (struct subleaf ));if (!func->leafs) -perror ("malloc func leaf" ); +err (EXIT_FAILURE ,NULL ); func->nr =1 ; }else { s = func->nr; func->leafs =realloc (func->leafs, (s +1 ) *sizeof (*leaf));if (!func->leafs) -perror ("realloc f->leafs" ); +err (EXIT_FAILURE ,NULL ); func->nr++; }
@@ -211,7 +212,7 @@ struct cpuid_range *setup_cpuid_range(u32 input_eax) range =malloc (sizeof (struct cpuid_range ));if (!range) -perror ("malloc range" ); +err (EXIT_FAILURE ,NULL );if (input_eax &0x80000000 ) range->is_ext = true;
@@ -220,7 +221,7 @@ struct cpuid_range *setup_cpuid_range(u32 input_eax) range->funcs =malloc (sizeof (struct cpuid_func ) * idx_func);if (!range->funcs) -perror ("malloc range->funcs" ); +err (EXIT_FAILURE ,NULL ); range->nr = idx_func;memset (range->funcs,0 ,sizeof (struct cpuid_func ) * idx_func);
@@ -395,8 +396,8 @@ static int parse_line(char *line)return 0 ; err_exit: -printf ("Warning: wrong line format:\n" ); -printf ("\tline[%d]: %s\n" , flines, line); +warnx ("Wrong line format:\n" +"\tline[%d]: %s" , flines, line);return -1 ; }
@@ -418,10 +419,8 @@ static void parse_text(void) file =fopen ("./cpuid.csv" ,"r" ); } -if (!file) { -printf ("Fail to open '%s'\n" , filename); -return ; - } +if (!file) +err (EXIT_FAILURE ,"%s" , filename);while (1 ) { ret =getline (&line, &len, file);
@@ -530,7 +529,7 @@ static inline struct cpuid_func *index_to_func(u32 index) func_idx = index &0xffff ;if ((func_idx +1 ) > (u32 )range->nr) { -printf ("ERR: invalid input index (0x%x)\n" , index); +warnx ("Invalid input index (0x%x)" , index);return NULL ; }return &range->funcs[func_idx];
@@ -562,7 +561,7 @@ static void show_info(void)return ; } -printf ("ERR: invalid input subleaf (0x%x)\n" , user_sub); +warnx ("Invalid input subleaf (0x%x)" , user_sub); }show_func (func);
@@ -593,15 +592,15 @@ static void setup_platform_cpuid(void)static void usage (void ) { -printf ("kcpuid [-abdfhr] [-l leaf] [-s subleaf]\n" -"\t-a|--all Show both bit flags and complex bit fields info\n" -"\t-b|--bitflags Show boolean flags only\n" -"\t-d|--detail Show details of the flag/fields (default)\n" -"\t-f|--flags Specify the cpuid csv file\n" -"\t-h|--help Show usage info\n" -"\t-l|--leaf=index Specify the leaf you want to check\n" -"\t-r|--raw Show raw cpuid data\n" -"\t-s|--subleaf=sub Specify the subleaf you want to check\n" +warnx ("kcpuid [-abdfhr] [-l leaf] [-s subleaf]\n" +"\t-a|--all Show both bit flags and complex bit fields info\n" +"\t-b|--bitflags Show boolean flags only\n" +"\t-d|--detail Show details of the flag/fields (default)\n" +"\t-f|--flags Specify the CPUID CSV file\n" +"\t-h|--help Show usage info\n" +"\t-l|--leaf=index Specify the leaf you want to check\n" +"\t-r|--raw Show raw CPUID data\n" +"\t-s|--subleaf=sub Specify the subleaf you want to check" ); }
@@ -652,7 +651,7 @@ static int parse_options(int argc, char *argv[]) user_sub =strtoul (optarg,NULL ,0 );break ;default : -printf ("%s: Invalid option '%c'\n" , argv[0 ], optopt); +warnx ("Invalid option '%c'" , optopt);return -1 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 2/512 x86/idle: Remove MFENCEs for X86_BUG_CLFLUSH_MONITOR in mwait_idle_with_hints() and prefer_mwait_c1_over_halt()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Cooper <[email protected]>
[ Upstream commit 1f13c60d84e880df6698441026e64f84c7110c49 ]
The following commit, 12 years ago:
7e98b7192046 ("x86, idle: Use static_cpu_has() for CLFLUSH workaround, add barriers")
added barriers around the CLFLUSH in mwait_idle_with_hints(), justified with:
... and add memory barriers around it since the documentation is explicit that CLFLUSH is only ordered with respect to MFENCE.
This also triggered, 11 years ago, the same adjustment in:
f8e617f45829 ("sched/idle/x86: Optimize unnecessary mwait_idle() resched IPIs")
during development, although it failed to get the static_cpu_has_bug() treatment.
X86_BUG_CLFLUSH_MONITOR (a.k.a the AAI65 errata) is specific to Intel CPUs, and the SDM currently states:
Executions of the CLFLUSH instruction are ordered with respect to each other and with respect to writes, locked read-modify-write instructions, and fence instructions[1].
With footnote 1 reading:
Earlier versions of this manual specified that executions of the CLFLUSH instruction were ordered only by the MFENCE instruction. All processors implementing the CLFLUSH instruction also order it relative to the other operations enumerated above.
i.e. The SDM was incorrect at the time, and barriers should not have been inserted. Double checking the original AAI65 errata (not available from intel.com any more) shows no mention of barriers either.
Note: If this were a general codepath, the MFENCEs would be needed, because
AMD CPUs of the same vintage do sport otherwise-unordered CLFLUSHs.
Remove the unnecessary barriers. Furthermore, use a plain alternative(), rather than static_cpu_has_bug() and/or no optimisation. The workaround is a single instruction.
Use an explicit %rax pointer rather than a general memory operand, because MONITOR takes the pointer implicitly in the same way.
[ mingo: Cleaned up the commit a bit. ]
--- arch/x86/include/asm/mwait.h | 9 +++------ arch/x86/kernel/process.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-)
arch/x86/include/asm/mwait.h +3 -6
@@ -117,13 +117,10 @@ static __always_inline void __sti_mwait(unsigned long eax, unsigned long ecx) static __always_inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) {if (static_cpu_has_bug (X86_BUG_MONITOR ) || !current_set_polling_and_test ()) { -if (static_cpu_has_bug (X86_BUG_CLFLUSH_MONITOR )) { -mb (); -clflush ((void *)¤t_thread_info ()->flags); -mb (); - } +const void *addr = ¤t_thread_info ()->flags; -__monitor ((void *)¤t_thread_info ()->flags,0 ,0 ); + alternative_input("", "clflush (%[addr])", X86_BUG_CLFLUSH_MONITOR, [addr] "a" (addr)); +__monitor (addr,0 ,0 );if (!need_resched ()) {if (ecx &1 ) {
arch/x86/kernel/process.c +3 -6
@@ -906,13 +906,10 @@ static __init bool prefer_mwait_c1_over_halt(void) static __cpuidle void mwait_idle(void) {if (!current_set_polling_and_test ()) { -if (this_cpu_has (X86_BUG_CLFLUSH_MONITOR )) { -mb ();/* quirk */ -clflush ((void *)¤t_thread_info ()->flags); -mb ();/* quirk */ - } +const void *addr = ¤t_thread_info ()->flags; -__monitor ((void *)¤t_thread_info ()->flags,0 ,0 ); + alternative_input("", "clflush (%[addr])", X86_BUG_CLFLUSH_MONITOR, [addr] "a" (addr)); +__monitor (addr,0 ,0 );if (!need_resched ()) {__sti_mwait (0 ,0 );raw_local_irq_disable ();
Signature · 1 line
2.39.5
Re: [PATCH 6.12 002/512] x86/idle: Remove MFENCEs for X86_BUG_CLFLUSH_MONITOR in mwait_idle_with_hints() and prefer_mwait_c1_over_halt()
Hi!
Quoted 13 lines
The following commit, 12 years ago:
7e98b7192046("x86, idle: Usestatic_cpu_has()for CLFLUSH workaround, add barriers")added barriers around the CLFLUSH in
mwait_idle_with_hints(), justified with:... and add memory barriers around it since the documentation is explicit that CLFLUSH is only ordered with respect to MFENCE.
This also triggered, 11 years ago, the same adjustment in:
f8e617f45829("sched/idle/x86: Optimize unnecessarymwait_idle()resched IPIs")
Quoted 8 lines
during development, although it failed to get the
static_cpu_has_bug()treatment.
X86_BUG_CLFLUSH_MONITOR(a.k.a the AAI65 errata) is specific to Intel CPUs, and the SDM currently states:Executions of the CLFLUSH instruction are ordered with respect to each other and with respect to writes, locked read-modify-write instructions, and fence instructions[1].
This not match stable kernel rules. We lived with limited performance for 12 years, we should continue.
BR,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Greg Kroah-Hartman
maintainerPATCH 3/512 crypto: sun8i-ce-hash - fix error handling in sun8i_ce_hash_run()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <[email protected]>
[ Upstream commit ea4dd134ef332bd9e3e734c1ba0a1521f436b678 ]
Rework error handling in sun8i_ce_hash_run() to unmap the dma buffers in case of failure. Currently, the dma unmap functions are not called if the function errors out at various points.
--- .../crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-)
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c +21 -13
@@ -343,9 +343,8 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)u32 common;u64 byte_count;__le32 *bf; -void *buf =NULL ; +void *buf, *result;int j, i, todo; -void *result =NULL ;u64 bs;int digestsize;dma_addr_t addr_res, addr_pad;
@@ -365,14 +364,14 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq) buf =kcalloc (2 , bs,GFP_KERNEL |GFP_DMA );if (!buf) { err = -ENOMEM ; - goto theend; + goto err_out; } bf = (__le32 *)buf; result =kzalloc (digestsize,GFP_KERNEL |GFP_DMA );if (!result) { err = -ENOMEM ; - goto theend; + goto err_free_buf; } flow = rctx->flow;
@@ -398,7 +397,7 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)if (nr_sgs <=0 || nr_sgs >MAX_SG ) {dev_err (ce->dev,"Invalid sg number %d\n" , nr_sgs); err = -EINVAL ; - goto theend; + goto err_free_result; } len = areq->nbytes;
@@ -411,7 +410,7 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)if (len >0 ) {dev_err (ce->dev,"remaining len %d\n" , len); err = -EINVAL ; - goto theend; + goto err_unmap_src; } addr_res =dma_map_single (ce->dev, result, digestsize,DMA_FROM_DEVICE ); cet->t_dst[0 ].addr =desc_addr_val_le32 (ce, addr_res);
@@ -419,7 +418,7 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)if (dma_mapping_error (ce->dev, addr_res)) {dev_err (ce->dev,"DMA map dest\n" ); err = -EINVAL ; - goto theend; + goto err_unmap_src; } byte_count = areq->nbytes;
@@ -441,7 +440,7 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq) }if (!j) { err = -EINVAL ; - goto theend; + goto err_unmap_result; } addr_pad =dma_map_single (ce->dev, buf, j *4 ,DMA_TO_DEVICE );
@@ -450,7 +449,7 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq)if (dma_mapping_error (ce->dev, addr_pad)) {dev_err (ce->dev,"DMA error on padding SG\n" ); err = -EINVAL ; - goto theend; + goto err_unmap_result; }if (ce->variant->hash_t_dlen_in_bits)
@@ -463,16 +462,25 @@ int sun8i_ce_hash_run(struct crypto_engine *engine, void *breq) err =sun8i_ce_run_task (ce, flow,crypto_ahash_alg_name (tfm));dma_unmap_single (ce->dev, addr_pad, j *4 ,DMA_TO_DEVICE ); -dma_unmap_sg (ce->dev, areq->src, ns,DMA_TO_DEVICE ); + +err_unmap_result:dma_unmap_single (ce->dev, addr_res, digestsize,DMA_FROM_DEVICE ); +if (!err) +memcpy (areq->result, result, algt->alg.hash.base.halg.digestsize); +err_unmap_src: +dma_unmap_sg (ce->dev, areq->src, ns,DMA_TO_DEVICE ); -memcpy (areq->result, result, algt->alg.hash.base.halg.digestsize); -theend: -kfree (buf); +err_free_result:kfree (result); + +err_free_buf: +kfree (buf); + +err_out:local_bh_disable ();crypto_finalize_hash_request (engine, breq, err);local_bh_enable (); +return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 4/512 sched: Fix trace_sched_switch(.prev_state)
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 8feb053d53194382fcfb68231296fdc220497ea6 ]
Gabriele noted that in case of signal_pending_state(), the tracepoint sees a stale task-state.
--- kernel/sched/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/sched/core.c +4 -2
@@ -6517,12 +6517,14 @@ pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)* Otherwise marks the task's __state as RUNNING */ static bool try_to_block_task (struct rq *rq,struct task_struct *p, -unsigned long task_state) +unsigned long *task_state_p) { +unsigned long task_state = *task_state_p;int flags =DEQUEUE_NOCLOCK ;if (signal_pending_state (task_state, p)) {WRITE_ONCE (p->__state,TASK_RUNNING ); + *task_state_p =TASK_RUNNING ;return false; }
@@ -6656,7 +6658,7 @@ static void __sched notrace __schedule(int sched_mode) goto picked; } }else if (!preempt && prev_state) { -try_to_block_task (rq, prev, prev_state); +try_to_block_task (rq, prev, &prev_state); switch_count = &prev->nvcsw; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 5/512 perf/x86/amd/uncore: Remove unused struct amd_uncore_ctx::node member
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <[email protected]>
[ Upstream commit 4f81cc2d1bf91a49d33eb6578b58db2518deef01 ]
--- arch/x86/events/amd/uncore.c | 1 - 1 file changed, 1 deletion(-)
arch/x86/events/amd/uncore.c +0 -1
@@ -38,7 +38,6 @@ struct amd_uncore_ctx {int refcnt;int cpu;struct perf_event **events; -struct hlist_node node; };struct amd_uncore_pmu {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 6/512 perf/x86/amd/uncore: Prevent UMC counters from saturating
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sandipan Das <[email protected]>
[ Upstream commit 2492e5aba2be064d0604ae23ae0770ecc0168192 ]
Unlike L3 and DF counters, UMC counters (PERF_CTRs) set the Overflow bit (bit 48) and saturate on overflow. A subsequent pmu->read() of the event reports an incorrect accumulated count as there is no difference between the previous and the current values of the counter.
To avoid this, inspect the current counter value and proactively reset the corresponding PERF_CTR register on every pmu->read(). Combined with the periodic reads initiated by the hrtimer, the counters never get a chance saturate but the resolution reduces to 47 bits.
--- arch/x86/events/amd/uncore.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)
arch/x86/events/amd/uncore.c +34 -1
@@ -889,6 +889,39 @@ static void amd_uncore_umc_start(struct perf_event *event, int flags)perf_event_update_userpage (event); } +static void amd_uncore_umc_read (struct perf_event *event) +{ +struct hw_perf_event *hwc = &event->hw; +u64 prev, new, shift; +s64 delta; + + shift =COUNTER_SHIFT +1 ; + prev =local64_read (&hwc->prev_count); + +/* +* UMC counters do not have RDPMC assignments. Read counts directly +* from the corresponding PERF_CTR. +*/ +rdmsrl (hwc->event_base, new); + +/* +* Unlike the other uncore counters, UMC counters saturate and set the +* Overflow bit (bit 48) on overflow. Since they do not roll over, +* proactively reset the corresponding PERF_CTR when bit 47 is set so +* that the counter never gets a chance to saturate. +*/ +if (new &BIT_ULL (63 -COUNTER_SHIFT )) { +wrmsrl (hwc->event_base,0 ); +local64_set (&hwc->prev_count,0 ); + }else { +local64_set (&hwc->prev_count, new); + } + + delta = (new << shift) - (prev << shift); + delta >>= shift; +local64_add (delta, &event->count); +} +static void amd_uncore_umc_ctx_scan (struct amd_uncore *uncore,unsigned int cpu) {
@@ -966,7 +999,7 @@ int amd_uncore_umc_ctx_init(struct amd_uncore *uncore, unsigned int cpu) .del = amd_uncore_del, .start = amd_uncore_umc_start, .stop = amd_uncore_stop, - .read = amd_uncore_read, + .read = amd_uncore_umc_read, .capabilities = PERF_PMU_CAP_NO_EXCLUDE | PERF_PMU_CAP_NO_INTERRUPT, .module = THIS_MODULE, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 7/512 gfs2: replace sd_aspace with sd_inode
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Gruenbacher <[email protected]>
[ Upstream commit ae9f3bd8259a0a8f67be2420e66bb05fbb95af48 ]
Currently, sdp->sd_aspace and the per-inode metadata address spaces use sb->s_bdev->bd_mapping->host as their ->host; folios in those address spaces will thus appear to be on bdev rather than on gfs2 filesystems. This is a problem because gfs2 doesn't support cgroup writeback (SB_I_CGROUPWB), but bdev does.
Fix that by using a "dummy" gfs2 inode as ->host in those address spaces. When coming from a folio, folio->mapping->host->i_sb will then be a gfs2 super block and the SB_I_CGROUPWB flag will not be set in sb->s_iflags.
Based on a previous version from Bob Peterson from several years ago. Thanks to Tetsuo Handa, Jan Kara, and Rafael Aquini for helping figure this out.
--- fs/gfs2/glock.c | 3 +-- fs/gfs2/glops.c | 4 ++-- fs/gfs2/incore.h | 9 ++++++++- fs/gfs2/meta_io.c | 2 +- fs/gfs2/meta_io.h | 4 +--- fs/gfs2/ops_fstype.c | 31 ++++++++++++++++++------------- fs/gfs2/super.c | 2 +- 7 files changed, 32 insertions(+), 23 deletions(-)
fs/gfs2/glock.c +1 -2
@@ -1183,7 +1183,6 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, const struct gfs2_glock_operations *glops, int create, struct gfs2_glock **glp) { - struct super_block *s = sdp->sd_vfs; struct lm_lockname name = { .ln_number = number, .ln_type = glops->go_type, .ln_sbd = sdp };
@@ -1246,7 +1245,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number, mapping =gfs2_glock2aspace (gl);if (mapping) { mapping->a_ops = &gfs2_meta_aops; - mapping->host = s->s_bdev->bd_mapping->host; + mapping->host = sdp->sd_inode; mapping->flags =0 ;mapping_set_gfp_mask (mapping,GFP_NOFS ); mapping->i_private_data =NULL ;
fs/gfs2/glops.c +2 -2
@@ -168,7 +168,7 @@ void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync)static int gfs2_rgrp_metasync (struct gfs2_glock *gl) {struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; -struct address_space *metamapping = &sdp->sd_aspace; +struct address_space *metamapping =gfs2_aspace (sdp);struct gfs2_rgrpd *rgd =gfs2_glock2rgrp (gl);const unsigned bsize = sdp->sd_sb.sb_bsize;loff_t start = (rgd->rd_addr * bsize) &PAGE_MASK ;
@@ -225,7 +225,7 @@ static int rgrp_go_sync(struct gfs2_glock *gl)static void rgrp_go_inval (struct gfs2_glock *gl,int flags) {struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; -struct address_space *mapping = &sdp->sd_aspace; +struct address_space *mapping =gfs2_aspace (sdp);struct gfs2_rgrpd *rgd =gfs2_glock2rgrp (gl);const unsigned bsize = sdp->sd_sb.sb_bsize;loff_t start, end;
fs/gfs2/incore.h +8 -1
@@ -793,7 +793,7 @@ struct gfs2_sbd {/* Log stuff */ -struct address_space sd_aspace; +struct inode *sd_inode;spinlock_t sd_log_lock;
@@ -849,6 +849,13 @@ struct gfs2_sbd {unsigned long sd_glock_dqs_held; }; +#define GFS2_BAD_INO 1 + +static inline struct address_space *gfs2_aspace (struct gfs2_sbd *sdp) +{ +return sdp->sd_inode->i_mapping; +} +static inline void gfs2_glstats_inc (struct gfs2_glock *gl,int which) { gl->gl_stats.stats[which]++;
fs/gfs2/meta_io.c +1 -1
@@ -132,7 +132,7 @@ struct buffer_head *gfs2_getbuf(struct gfs2_glock *gl, u64 blkno, int create)unsigned int bufnum;if (mapping ==NULL ) - mapping = &sdp->sd_aspace; + mapping =gfs2_aspace (sdp); shift =PAGE_SHIFT - sdp->sd_sb.sb_bsize_shift; index = blkno >> shift;/* convert block to page */
fs/gfs2/meta_io.h +1 -3
@@ -44,9 +44,7 @@ static inline struct gfs2_sbd *gfs2_mapping2sbd(struct address_space *mapping)struct gfs2_glock_aspace *gla = container_of(mapping, struct gfs2_glock_aspace, mapping);return gla->glock.gl_name.ln_sbd; - }else if (mapping->a_ops == &gfs2_rgrp_aops) - return container_of(mapping, struct gfs2_sbd, sd_aspace); -else + }else return inode->i_sb->s_fs_info; }
fs/gfs2/ops_fstype.c +18 -13
@@ -72,7 +72,6 @@ void free_sbd(struct gfs2_sbd *sdp)static struct gfs2_sbd *init_sbd (struct super_block *sb) {struct gfs2_sbd *sdp; -struct address_space *mapping; sdp =kzalloc (sizeof (struct gfs2_sbd ),GFP_KERNEL );if (!sdp)
@@ -109,16 +108,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)INIT_LIST_HEAD (&sdp->sd_sc_inodes_list); - mapping = &sdp->sd_aspace; - -address_space_init_once (mapping); - mapping->a_ops = &gfs2_rgrp_aops; - mapping->host = sb->s_bdev->bd_mapping->host; - mapping->flags =0 ; -mapping_set_gfp_mask (mapping,GFP_NOFS ); - mapping->i_private_data =NULL ; - mapping->writeback_index =0 ; -spin_lock_init (&sdp->sd_log_lock);atomic_set (&sdp->sd_log_pinned,0 );INIT_LIST_HEAD (&sdp->sd_log_revokes);
@@ -1135,6 +1124,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)int silent = fc->sb_flags &SB_SILENT ;struct gfs2_sbd *sdp;struct gfs2_holder mount_gh; +struct address_space *mapping;int error; sdp =init_sbd (sb);
@@ -1156,6 +1146,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_flags |=SB_NOSEC ; sb->s_magic =GFS2_MAGIC ; sb->s_op = &gfs2_super_ops; + sb->s_d_op = &gfs2_dops; sb->s_export_op = &gfs2_export_ops; sb->s_qcop = &gfs2_quotactl_ops;
@@ -1181,9 +1172,21 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) sdp->sd_tune.gt_statfs_quantum =30 ; } +/* Set up an address space for metadata writes */ + sdp->sd_inode =new_inode (sb); + error = -ENOMEM ; +if (!sdp->sd_inode) + goto fail_free; + sdp->sd_inode->i_ino =GFS2_BAD_INO ; + sdp->sd_inode->i_size =OFFSET_MAX ; + + mapping =gfs2_aspace (sdp); + mapping->a_ops = &gfs2_rgrp_aops; +mapping_set_gfp_mask (mapping,GFP_NOFS ); + error =init_names (sdp, silent);if (error) - goto fail_free; + goto fail_iput;snprintf (sdp->sd_fsname,sizeof (sdp->sd_fsname),"%s" , sdp->sd_table_name);
@@ -1192,7 +1195,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc)WQ_MEM_RECLAIM |WQ_HIGHPRI |WQ_FREEZABLE ,0 , sdp->sd_fsname);if (!sdp->sd_glock_wq) - goto fail_free; + goto fail_iput; sdp->sd_delete_wq =alloc_workqueue ("gfs2-delete/%s" ,WQ_MEM_RECLAIM |WQ_FREEZABLE ,0 , sdp->sd_fsname);
@@ -1309,6 +1312,8 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) fail_glock_wq:if (sdp->sd_glock_wq)destroy_workqueue (sdp->sd_glock_wq); +fail_iput: +iput (sdp->sd_inode); fail_free:free_sbd (sdp); sb->s_fs_info =NULL ;
fs/gfs2/super.c +1 -1
@@ -648,7 +648,7 @@ static void gfs2_put_super(struct super_block *sb)gfs2_jindex_free (sdp);/* Take apart glock structures and buffer lists */ gfs2_gl_hash_clear (sdp); -truncate_inode_pages_final (&sdp->sd_aspace); +iput (sdp->sd_inode);gfs2_delete_debugfs_file (sdp);gfs2_sys_fs_del (sdp);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 8/512 gfs2: gfs2_create_inode error handling fix
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Gruenbacher <[email protected]>
[ Upstream commit af4044fd0b77e915736527dd83011e46e6415f01 ]
When gfs2_create_inode() finds a directory, make sure to return -EISDIR.
--- fs/gfs2/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/gfs2/inode.c +2 -1
@@ -659,7 +659,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,if (!IS_ERR (inode)) {if (S_ISDIR (inode->i_mode)) {iput (inode); - inode =ERR_PTR (-EISDIR ); + inode =NULL ; + error = -EISDIR ; goto fail_gunlock; }d_instantiate (dentry, inode);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 9/512 perf/core: Fix broken throttling when max_samples_per_tick=1
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qing Wang <[email protected]>
[ Upstream commit f51972e6f8b9a737b2b3eb588069acb538fa72de ]
According to the throttling mechanism, the pmu interrupts number can not exceed the max_samples_per_tick in one tick. But this mechanism is ineffective when max_samples_per_tick=1, because the throttling check is skipped during the first interrupt and only performed when the second interrupt arrives.
Perhaps this bug may cause little influence in one tick, but if in a larger time scale, the problem can not be underestimated.
When max_samples_per_tick = 1:
Allowed-interrupts-per-second max-samples-per-second default-HZ ARCH 200 100 100 X86 500 250 250 ARM64
...
Obviously, the pmu interrupt number far exceed the user's expect.
--- kernel/events/core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
kernel/events/core.c +8 -8
@@ -9715,14 +9715,14 @@ __perf_event_account_interrupt(struct perf_event *event, int throttle) hwc->interrupts =1 ; }else { hwc->interrupts++; -if (unlikely (throttle && - hwc->interrupts > max_samples_per_tick)) { -__this_cpu_inc (perf_throttled_count); -tick_dep_set_cpu (smp_processor_id (),TICK_DEP_BIT_PERF_EVENTS ); - hwc->interrupts =MAX_INTERRUPTS ; -perf_log_throttle (event,0 ); - ret =1 ; - } + } + +if (unlikely (throttle && hwc->interrupts >= max_samples_per_tick)) { +__this_cpu_inc (perf_throttled_count); +tick_dep_set_cpu (smp_processor_id (),TICK_DEP_BIT_PERF_EVENTS ); + hwc->interrupts =MAX_INTERRUPTS ; +perf_log_throttle (event,0 ); + ret =1 ; }if (event->attr.freq) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 10/512 crypto: sun8i-ce-cipher - fix error handling in sun8i_ce_cipher_prepare()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <[email protected]>
[ Upstream commit f31adc3e356f7350d4a4d68c98d3f60f2f6e26b3 ]
Fix two DMA cleanup issues on the error path in sun8i_ce_cipher_prepare():
1] If dma_map_sg() fails for areq->dst, the device driver would try to free
DMA memory it has not allocated in the first place. To fix this, on the "theend_sgs" error path, call dma unmap only if the corresponding dma map was successful.
2] If the dma_map_single() call for the IV fails, the device driver would
try to free an invalid DMA memory address on the "theend_iv" path:
------------[ cut here ]------------
DMA-API: sun8i-ce 1904000.crypto: device driver tries to free an invalid DMA memory address
WARNING: CPU: 2 PID: 69 at kernel/dma/debug.c:968 check_unmap+0x123c/0x1b90
Modules linked in: skcipher_example(O+)
CPU: 2 UID: 0 PID: 69 Comm: 1904000.crypto- Tainted: G O 6.15.0-rc3+ #24 PREEMPT
Tainted: [O]=OOT_MODULE
Hardware name: OrangePi Zero2 (DT)
pc : check_unmap+0x123c/0x1b90
lr : check_unmap+0x123c/0x1b90
...
Call trace:
check_unmap+0x123c/0x1b90 (P)
debug_dma_unmap_page+0xac/0xc0
dma_unmap_page_attrs+0x1f4/0x5fc
sun8i_ce_cipher_do_one+0x1bd4/0x1f40
crypto_pump_work+0x334/0x6e0
kthread_worker_fn+0x21c/0x438
kthread+0x374/0x664
ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---To fix this, check for !dma_mapping_error() before calling dma_unmap_single() on the "theend_iv" path.
--- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c +5 -2
@@ -275,13 +275,16 @@ static int sun8i_ce_cipher_prepare(struct crypto_engine *engine, void *async_req }else {if (nr_sgs >0 )dma_unmap_sg (ce->dev, areq->src, ns,DMA_TO_DEVICE ); -dma_unmap_sg (ce->dev, areq->dst, nd,DMA_FROM_DEVICE ); + +if (nr_sgd >0 ) +dma_unmap_sg (ce->dev, areq->dst, nd,DMA_FROM_DEVICE ); } theend_iv:if (areq->iv && ivsize >0 ) { -if (rctx->addr_iv) +if (!dma_mapping_error (ce->dev, rctx->addr_iv))dma_unmap_single (ce->dev, rctx->addr_iv, rctx->ivlen,DMA_TO_DEVICE ); + offset = areq->cryptlen - ivsize;if (rctx->op_dir &CE_DECRYPTION ) {memcpy (areq->iv, chan->backup_iv, ivsize);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 11/512 crypto: sun8i-ss - do not use sg_dma_len before calling DMA functions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Corentin Labbe <[email protected]>
[ Upstream commit 2dfc7cd74a5e062a5405560447517e7aab1c7341 ]
When testing sun8i-ss with multi_v7_defconfig, all CBC algorithm fail crypto selftests.
This is strange since on sunxi_defconfig, everything was ok.
The problem was in the IV setup loop which never run because sg_dma_len was 0.
--- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +1 -1
@@ -141,7 +141,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq)/* we need to copy all IVs from source in case DMA is bi-directionnal */ while (sg && len) { -if (sg_dma_len (sg) ==0 ) { +if (sg->length ==0 ) { sg =sg_next (sg);continue ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 12/512 powerpc: do not build ppc_save_regs.o always
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Slaby (SUSE) <[email protected]>
[ Upstream commit 497b7794aef03d525a5be05ae78dd7137c6861a5 ]
The Fixes commit below tried to add CONFIG_PPC_BOOK3S to one of the conditions to enable the build of ppc_save_regs.o. But it failed to do so, in fact. The commit omitted to add a dollar sign.
Therefore, ppc_save_regs.o is built always these days (as "(CONFIG_PPC_BOOK3S)" is never an empty string).
Fix this by adding the missing dollar sign.
--- arch/powerpc/kernel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/Makefile +1 -1
@@ -162,7 +162,7 @@ endif obj64-$(CONFIG_PPC_TRANSACTIONAL_MEM) += tm.o -ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC_CORE)(CONFIG_PPC_BOOK3S),) +ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC_CORE)$(CONFIG_PPC_BOOK3S),) obj-y += ppc_save_regs.o endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 13/512 powerpc/crash: Fix non-smp kexec preparation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eddie James <[email protected]>
[ Upstream commit 882b25af265de8e05c66f72b9a29f6047102958f ]
In non-smp configurations, crash_kexec_prepare is never called in the crash shutdown path. One result of this is that the crashing_cpu variable is never set, preventing crash_save_cpu from storing the NT_PRSTATUS elf note in the core dump.
--- arch/powerpc/kexec/crash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/kexec/crash.c +4 -1
@@ -359,7 +359,10 @@ void default_machine_crash_shutdown(struct pt_regs *regs)if (TRAP (regs) ==INTERRUPT_SYSTEM_RESET ) is_via_system_reset =1 ; -crash_smp_send_stop (); +if (IS_ENABLED (CONFIG_SMP )) +crash_smp_send_stop (); +else +crash_kexec_prepare ();crash_save_cpu (regs, crashing_cpu);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 14/512 sched/core: Tweak wait_task_inactive() to force dequeue sched_delayed tasks
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Stultz <[email protected]>
[ Upstream commit b7ca5743a2604156d6083b88cefacef983f3a3a6 ]
It was reported that in 6.12, smpboot_create_threads() was taking much longer then in 6.6.
I narrowed down the call path to:
smpboot_create_threads()
-> kthread_create_on_cpu()
-> kthread_bind()
-> __kthread_bind_mask()
->wait_task_inactive()Where in wait_task_inactive() we were regularly hitting the queued case, which sets a 1 tick timeout, which when called multiple times in a row, accumulates quickly into a long delay.
I noticed disabling the DELAY_DEQUEUE sched feature recovered the performance, and it seems the newly create tasks are usually sched_delayed and left on the runqueue.
So in wait_task_inactive() when we see the task p->se.sched_delayed, manually dequeue the sched_delayed task with DEQUEUE_DELAYED, so we don't have to constantly wait a tick.
--- kernel/sched/core.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/sched/core.c +6 -0
@@ -2229,6 +2229,12 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state* just go back and repeat. */ rq =task_rq_lock (p, &rf); +/* +* If task is sched_delayed, force dequeue it, to avoid always +* hitting the tick timeout in the queued case +*/ +if (p->se.sched_delayed) +dequeue_task (rq, p,DEQUEUE_SLEEP |DEQUEUE_DELAYED );trace_sched_wait_task (p); running =task_on_cpu (rq, p); queued =task_on_rq_queued (p);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 15/512 x86/microcode/AMD: Do not return error when microcode update is not necessary
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Annie Li <[email protected]>
[ Upstream commit b43dc4ab097859c24e2a6993119c927cffc856aa ]
After
6f059e634dcd("x86/microcode: Clarify the late load logic"),
if the load is up-to-date, the AMD side returns UCODE_OK which leads to load_late_locked() returning -EBADFD.
Handle UCODE_OK in the switch case to avoid this error.
[ bp: Massage commit message. ]
--- arch/x86/kernel/cpu/microcode/core.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/microcode/core.c +2 -0
@@ -696,6 +696,8 @@ static int load_late_locked(void)return load_late_stop_cpus (true);case UCODE_NFOUND :return -ENOENT ; +case UCODE_OK : +return 0 ;default :return -EBADFD ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 16/512 crypto: sun8i-ce - undo runtime PM changes during driver removal
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <[email protected]>
[ Upstream commit 9334f427576e6d361a409959b52246b0aa10476f ]
The pm_runtime_use_autosuspend() call must be undone with pm_runtime_dont_use_autosuspend() at driver exit, but this is not currently handled in the driver.
To fix this issue and at the same time simplify error handling, switch to devm_pm_runtime_enable(). It will call both pm_runtime_disable() and pm_runtime_dont_use_autosuspend() during driver removal.
--- .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c +6 -11
@@ -832,13 +832,12 @@ static int sun8i_ce_pm_init(struct sun8i_ce_dev *ce) err =pm_runtime_set_suspended (ce->dev);if (err)return err; -pm_runtime_enable (ce->dev); -return err; -} -static void sun8i_ce_pm_exit (struct sun8i_ce_dev *ce) -{ -pm_runtime_disable (ce->dev); + err =devm_pm_runtime_enable (ce->dev); +if (err) +return err; + +return 0 ; }static int sun8i_ce_get_clks (struct sun8i_ce_dev *ce)
@@ -1041,7 +1040,7 @@ static int sun8i_ce_probe(struct platform_device *pdev) "sun8i-ce-ns", ce);if (err) {dev_err (ce->dev,"Cannot request CryptoEngine Non-secure IRQ (err=%d)\n" , err); - goto error_irq; + goto error_pm; } err =sun8i_ce_register_algs (ce);
@@ -1082,8 +1081,6 @@ static int sun8i_ce_probe(struct platform_device *pdev)return 0 ; error_alg:sun8i_ce_unregister_algs (ce); -error_irq: -sun8i_ce_pm_exit (ce); error_pm:sun8i_ce_free_chanlist (ce,MAXFLOW -1 );return err;
@@ -1104,8 +1101,6 @@ static void sun8i_ce_remove(struct platform_device *pdev)#endif sun8i_ce_free_chanlist (ce,MAXFLOW -1 ); - -sun8i_ce_pm_exit (ce); }static const struct of_device_id sun8i_ce_crypto_of_match_table[] = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/512 x86/cpu: Sanitize CPUID(0x80000000) output
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmed S. Darwish <[email protected]>
[ Upstream commit cc663ba3fe383a628a812f893cc98aafff39ab04 ]
CPUID(0x80000000).EAX returns the max extended CPUID leaf available. On x86-32 machines without an extended CPUID range, a CPUID(0x80000000) query will just repeat the output of the last valid standard CPUID leaf on the CPU; i.e., a garbage values. Current tip:x86/cpu code protects against this by doing:
eax = cpuid_eax(0x80000000);
c->extended_cpuid_level = eax;
if ((eax & 0xffff0000) == 0x80000000) {
// CPU has an extended CPUID range. Check for 0x80000001
if (eax >= 0x80000001) {
cpuid(0x80000001, ...);
}
}This is correct so far. Afterwards though, the same possibly broken EAX value is used to check the availability of other extended CPUID leaves:
if (c->extended_cpuid_level >= 0x80000007) ... if (c->extended_cpuid_level >= 0x80000008) ... if (c->extended_cpuid_level >= 0x8000000a) ... if (c->extended_cpuid_level >= 0x8000001f) ...
which is invalid. Fix this by immediately setting the CPU's max extended CPUID leaf to zero if CPUID(0x80000000).EAX doesn't indicate a valid CPUID extended range.
While at it, add a comment, similar to kernel/head_32.S, clarifying the CPUID(0x80000000) sanity check.
References: 8a50e5135af0 ("x86-32: Use symbolic constants, safer CPUID when enabling EFER.NX")
--- arch/x86/kernel/cpu/common.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
arch/x86/kernel/cpu/common.c +9 -8
@@ -1007,17 +1007,18 @@ void get_cpu_cap(struct cpuinfo_x86 *c) c->x86_capability[CPUID_D_1_EAX ] = eax; } -/* AMD-defined flags: level 0x80000001 */ +/* +* Check if extended CPUID leaves are implemented: Max extended +* CPUID leaf must be in the 0x80000001-0x8000ffff range. +*/ eax =cpuid_eax (0x80000000 ); - c->extended_cpuid_level = eax; + c->extended_cpuid_level = ((eax &0xffff0000 ) ==0x80000000 ) ? eax :0 ; -if ((eax &0xffff0000 ) ==0x80000000 ) { -if (eax >=0x80000001 ) { -cpuid (0x80000001 , &eax, &ebx, &ecx, &edx); +if (c->extended_cpuid_level >=0x80000001 ) { +cpuid (0x80000001 , &eax, &ebx, &ecx, &edx); - c->x86_capability[CPUID_8000_0001_ECX ] = ecx; - c->x86_capability[CPUID_8000_0001_EDX ] = edx; - } + c->x86_capability[CPUID_8000_0001_ECX ] = ecx; + c->x86_capability[CPUID_8000_0001_EDX ] = edx; }if (c->extended_cpuid_level >=0x80000007 ) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/512 x86/insn: Fix opcode map (!REX2) superscript tags
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <[email protected]>
[ Upstream commit ca698ec2f07873a448d53c580795c4e023c75393 ]
Commit:
159039af8c07 ("x86/insn: x86/insn: Add support for REX2 prefix to the instruction decoder opcode map")
added (!REX2) superscript with a space, but the correct format requires ',' for concatination with other superscript tags.
Add ',' to generate correct insn attribute tables.
I confirmed with following command:
arch/x86/lib/x86-opcode-map.txt | grep e8 | head -n 1
[0xe8] = INAT_MAKE_IMM(INAT_IMM_VWORD32) | INAT_FORCE64 | INAT_NO_REX2,
--- arch/x86/lib/x86-opcode-map.txt | 50 +++++++++++++-------------- tools/arch/x86/lib/x86-opcode-map.txt | 50 +++++++++++++-------------- 2 files changed, 50 insertions(+), 50 deletions(-)
arch/x86/lib/x86-opcode-map.txt +25 -25
@@ -35,7 +35,7 @@ # - (!F3) : the last prefix is not 0xF3 (including non-last prefix case) # - (66&F2): Both 0x66 and 0xF2 prefixes are specified. # -# REX2 Prefix +# REX2 Prefix Superscripts # - (!REX2): REX2 is not allowed # - (REX2): REX2 variant e.g. JMPABS
@@ -286,10 +286,10 @@ df: ESC # Note: "forced64" is Intel CPU behavior: they ignore 0x66 prefix # in 64-bit mode. AMD CPUs accept 0x66 prefix, it causes RIP truncation # to 16 bits. In 32-bit mode, 0x66 is accepted by both Intel and AMD. -e0: LOOPNE/LOOPNZ Jb (f64) (!REX2) -e1: LOOPE/LOOPZ Jb (f64) (!REX2) -e2: LOOP Jb (f64) (!REX2) -e3: JrCXZ Jb (f64) (!REX2) +e0: LOOPNE/LOOPNZ Jb (f64),(!REX2) +e1: LOOPE/LOOPZ Jb (f64),(!REX2) +e2: LOOP Jb (f64),(!REX2) +e3: JrCXZ Jb (f64),(!REX2) e4: IN AL,Ib (!REX2) e5: IN eAX,Ib (!REX2) e6: OUT Ib,AL (!REX2)
@@ -298,10 +298,10 @@ e7: OUT Ib,eAX (!REX2) # in "near" jumps and calls is 16-bit. For CALL, # push of return address is 16-bit wide, RSP is decremented by 2 # but is not truncated to 16 bits, unlike RIP. -e8: CALL Jz (f64) (!REX2) -e9: JMP-near Jz (f64) (!REX2) -ea: JMP-far Ap (i64) (!REX2) -eb: JMP-short Jb (f64) (!REX2) +e8: CALL Jz (f64),(!REX2) +e9: JMP-near Jz (f64),(!REX2) +ea: JMP-far Ap (i64),(!REX2) +eb: JMP-short Jb (f64),(!REX2) ec: IN AL,DX (!REX2) ed: IN eAX,DX (!REX2) ee: OUT DX,AL (!REX2)
@@ -478,22 +478,22 @@ AVXcode: 1 7f: movq Qq,Pq | vmovdqa Wx,Vx (66) | vmovdqa32/64 Wx,Vx (66),(evo) | vmovdqu Wx,Vx (F3) | vmovdqu32/64 Wx,Vx (F3),(evo) | vmovdqu8/16 Wx,Vx (F2),(ev) # 0x0f 0x80-0x8f # Note: "forced64" is Intel CPU behavior (see comment about CALL insn). -80: JO Jz (f64) (!REX2) -81: JNO Jz (f64) (!REX2) -82: JB/JC/JNAE Jz (f64) (!REX2) -83: JAE/JNB/JNC Jz (f64) (!REX2) -84: JE/JZ Jz (f64) (!REX2) -85: JNE/JNZ Jz (f64) (!REX2) -86: JBE/JNA Jz (f64) (!REX2) -87: JA/JNBE Jz (f64) (!REX2) -88: JS Jz (f64) (!REX2) -89: JNS Jz (f64) (!REX2) -8a: JP/JPE Jz (f64) (!REX2) -8b: JNP/JPO Jz (f64) (!REX2) -8c: JL/JNGE Jz (f64) (!REX2) -8d: JNL/JGE Jz (f64) (!REX2) -8e: JLE/JNG Jz (f64) (!REX2) -8f: JNLE/JG Jz (f64) (!REX2) +80: JO Jz (f64),(!REX2) +81: JNO Jz (f64),(!REX2) +82: JB/JC/JNAE Jz (f64),(!REX2) +83: JAE/JNB/JNC Jz (f64),(!REX2) +84: JE/JZ Jz (f64),(!REX2) +85: JNE/JNZ Jz (f64),(!REX2) +86: JBE/JNA Jz (f64),(!REX2) +87: JA/JNBE Jz (f64),(!REX2) +88: JS Jz (f64),(!REX2) +89: JNS Jz (f64),(!REX2) +8a: JP/JPE Jz (f64),(!REX2) +8b: JNP/JPO Jz (f64),(!REX2) +8c: JL/JNGE Jz (f64),(!REX2) +8d: JNL/JGE Jz (f64),(!REX2) +8e: JLE/JNG Jz (f64),(!REX2) +8f: JNLE/JG Jz (f64),(!REX2) # 0x0f 0x90-0x9f 90: SETO Eb | kmovw/q Vk,Wk | kmovb/d Vk,Wk (66) 91: SETNO Eb | kmovw/q Mv,Vk | kmovb/d Mv,Vk (66)
tools/arch/x86/lib/x86-opcode-map.txt +25 -25
74 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/512 brd: fix aligned_sector from brd_do_discard()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit d4099f8893b057ad7e8d61df76bdeaf807ebd679 ]
The calculation is just wrong, fix it by round_up().
--- drivers/block/brd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/brd.c +1 -1
@@ -224,7 +224,7 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page,static void brd_do_discard (struct brd_device *brd,sector_t sector,u32 size) { -sector_t aligned_sector = (sector +PAGE_SECTORS ) & ~PAGE_SECTORS ; +sector_t aligned_sector =round_up (sector,PAGE_SECTORS );struct page *page; size -= (aligned_sector - sector) *SECTOR_SIZE ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/512 brd: fix discard end sector
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit a26a339a654b9403f0ee1004f1db4c2b2a355460 ]
brd_do_discard() just aligned start sector to page, this can only work if the discard size if at least one page. For example:
blkdiscard /dev/ram0 -o 5120 -l 1024
In this case, size = (1024 - (8192 - 5120)), which is a huge value.
Fix the problem by round_down() the end sector.
--- drivers/block/brd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/block/brd.c +6 -3
@@ -225,18 +225,21 @@ static int brd_do_bvec(struct brd_device *brd, struct page *page,static void brd_do_discard (struct brd_device *brd,sector_t sector,u32 size) {sector_t aligned_sector =round_up (sector,PAGE_SECTORS ); +sector_t aligned_end =round_down ( + sector + (size >>SECTOR_SHIFT ),PAGE_SECTORS );struct page *page; - size -= (aligned_sector - sector) *SECTOR_SIZE ; +if (aligned_end <= aligned_sector) +return ; +xa_lock (&brd->brd_pages); -while (size >=PAGE_SIZE && aligned_sector < rd_size *2 ) { +while (aligned_sector < aligned_end && aligned_sector < rd_size *2 ) { page =__xa_erase (&brd->brd_pages, aligned_sector >>PAGE_SECTORS_SHIFT );if (page) {__free_page (page); brd->brd_nr_pages--; } aligned_sector +=PAGE_SECTORS ; - size -=PAGE_SIZE ; }xa_unlock (&brd->brd_pages); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/512 kselftest: cpufreq: Get rid of double suspend in rtcwake case
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 23b88515a318680337f21d0a2fceee8038ccffc8 ]
Commit 0b631ed3ce92 ("kselftest: cpufreq: Add RTC wakeup alarm") added support for automatic wakeup in the suspend routine of the cpufreq kselftest by using rtcwake, however it left the manual power state change in the common path. The end result is that when running the cpufreq kselftest with '-t suspend_rtc' or '-t hibernate_rtc', the system will go to sleep and be woken up by the RTC, but then immediately go to sleep again with no wakeup programmed, so it will sleep forever in an automated testing setup.
Fix this by moving the manual power state change so that it only happens when not using rtcwake.
--- tools/testing/selftests/cpufreq/cpufreq.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/cpufreq/cpufreq.sh +2 -1
@@ -244,9 +244,10 @@ do_suspend() printf "Failed to suspend using RTC wake alarm\n" return 1 fi + else + echo $filename > $SYSFS/power/state fi - echo $filename > $SYSFS/power/state printf "Came out of $1\n" printf "Do basic tests after finishing $1 to verify cpufreq state\n\n"
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/512 crypto: marvell/cesa - Handle zero-length skcipher requests
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 8a4e047c6cc07676f637608a9dd675349b5de0a7 ]
Do not access random memory for zero-length skcipher requests. Just return 0.
--- drivers/crypto/marvell/cesa/cipher.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/crypto/marvell/cesa/cipher.c +3 -0
@@ -459,6 +459,9 @@ static int mv_cesa_skcipher_queue_req(struct skcipher_request *req,struct mv_cesa_skcipher_req *creq =skcipher_request_ctx (req);struct mv_cesa_engine *engine; +if (!req->cryptlen) +return 0 ; + ret =mv_cesa_skcipher_req_init (req, tmpl);if (ret)return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/512 crypto: marvell/cesa - Avoid empty transfer descriptor
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 1bafd82d9a40cf09c6c40f1c09cc35b7050b1a9f ]
The user may set req->src even if req->nbytes == 0. If there is no data to hash from req->src, do not generate an empty TDMA descriptor.
--- drivers/crypto/marvell/cesa/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/marvell/cesa/hash.c +1 -1
@@ -663,7 +663,7 @@ static int mv_cesa_ahash_dma_req_init(struct ahash_request *req)if (ret) goto err_free_tdma; -if (iter.src.sg) { +if (iter.base.len > iter.src.op_offset) {/* * Add all the new data, inserting an operation block and * launch command between each full SRAM block-worth of
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/512 erofs: fix file handle encoding for 64-bit NIDs
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongbo Li <[email protected]>
[ Upstream commit 510de8363f2c3d8e67fa9dfb2366e821382036e0 ]
EROFS uses NID to indicate the on-disk inode offset, which can exceed 32 bits. However, the default encode_fh uses the ino32, thus it doesn't work if the image is larger than 128GiB.
Let's introduce our own helpers to encode file handles.
It's easy to reproduce:
1. prepare an erofs image with nid bigger than U32_MAX
2. mount -t erofs foo.img /mnt/erofs
3. set exportfs with configuration: /mnt/erofs *(rw,sync, no_root_squash)
4. mount -t nfs $IP:/mnt/erofs /mnt/nfs
5. md5sum /mnt/nfs/foo # foo is the file which nid bigger than U32_MAX. # you will get ESTALE error.
In the case of overlayfs, the underlying filesystem's file handle is encoded in ovl_fb.fid, which is similar to NFS's case. If the NID of file is larger than U32_MAX, the overlay will get -ESTALE error when calls exportfs_decode_fh.
--- fs/erofs/super.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-)
fs/erofs/super.c +36 -8
@@ -537,24 +537,52 @@ static int erofs_fc_parse_param(struct fs_context *fc,return 0 ; } -static struct inode *erofs_nfs_get_inode (struct super_block *sb, -u64 ino,u32 generation) +static int erofs_encode_fh (struct inode *inode,u32 *fh,int *max_len, +struct inode *parent) { -return erofs_iget (sb, ino); +erofs_nid_t nid =EROFS_I (inode)->nid; +int len = parent ?6 :3 ; + +if (*max_len < len) { + *max_len = len; +return FILEID_INVALID ; + } + + fh[0 ] = (u32)(nid >>32 ); + fh[1 ] = (u32)(nid &0xffffffff ); + fh[2 ] = inode->i_generation; + +if (parent) { + nid =EROFS_I (parent)->nid; + + fh[3 ] = (u32)(nid >>32 ); + fh[4 ] = (u32)(nid &0xffffffff ); + fh[5 ] = parent->i_generation; + } + + *max_len = len; +return parent ?FILEID_INO64_GEN_PARENT :FILEID_INO64_GEN ; }static struct dentry *erofs_fh_to_dentry (struct super_block *sb,struct fid *fid,int fh_len,int fh_type) { -return generic_fh_to_dentry (sb, fid, fh_len, fh_type, - erofs_nfs_get_inode); +if ((fh_type !=FILEID_INO64_GEN && + fh_type !=FILEID_INO64_GEN_PARENT ) || fh_len <3 ) +return NULL ; + +return d_obtain_alias (erofs_iget (sb, + ((u64 )fid->raw[0 ] <<32 ) | fid->raw[1 ])); }static struct dentry *erofs_fh_to_parent (struct super_block *sb,struct fid *fid,int fh_len,int fh_type) { -return generic_fh_to_parent (sb, fid, fh_len, fh_type, - erofs_nfs_get_inode); +if (fh_type !=FILEID_INO64_GEN_PARENT || fh_len <6 ) +return NULL ; + +return d_obtain_alias (erofs_iget (sb, + ((u64 )fid->raw[3 ] <<32 ) | fid->raw[4 ])); }static struct dentry *erofs_get_parent (struct dentry *child)
@@ -570,7 +598,7 @@ static struct dentry *erofs_get_parent(struct dentry *child) }static const struct export_operations erofs_export_ops = { - .encode_fh = generic_encode_ino32_fh, + .encode_fh = erofs_encode_fh, .fh_to_dentry = erofs_fh_to_dentry, .fh_to_parent = erofs_fh_to_parent, .get_parent = erofs_get_parent,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 25/512 erofs: avoid using multiple devices with different type
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sheng Yong <[email protected]>
[ Upstream commit 9748f2f54f66743ac77275c34886a9f890e18409 ]
For multiple devices, both primary and extra devices should be the same type. erofs_init_device has already guaranteed that if the primary is a file-backed device, extra devices should also be regular files.
However, if the primary is a block device while the extra device is a file-backed device, erofs_init_device will get an ENOTBLK, which is not treated as an error in erofs_fc_get_tree, and that leads to an UAF:
erofs_fc_get_tree
get_tree_bdev_flags(erofs_fc_fill_super)
erofs_read_superblock
erofs_init_device // sbi->dif0 is not inited yet,
// return -ENOTBLK
deactivate_locked_super
free(sbi)
if (err is -ENOTBLK)
sbi->dif0.file = filp_open() // sbi UAFSo if -ENOTBLK is hitted in erofs_init_device, it means the primary device must be a block device, and the extra device is not a block device. The error can be converted to -EINVAL.
--- fs/erofs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/erofs/super.c +4 -1
@@ -188,8 +188,11 @@ static int erofs_init_device(struct erofs_buf *buf, struct super_block *sb, filp_open(dif->path, O_RDONLY | O_LARGEFILE, 0) :bdev_file_open_by_path (dif->path,BLK_OPEN_READ , sb->s_type,NULL ); -if (IS_ERR (file)) +if (IS_ERR (file)) { +if (file ==ERR_PTR (-ENOTBLK )) +return -EINVAL ;return PTR_ERR (file); + }if (!erofs_is_fileio_mode (sbi)) { dif->dax_dev = fs_dax_get_by_bdev(file_bdev(file),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/512 powerpc/pseries/iommu: Fix kmemleak in TCE table userspace view
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gaurav Batra <[email protected]>
[ Upstream commit d36e3f11fe8b55b801bdbe84ad51f612b1bd84da ]
When a device is opened by a userspace driver, via VFIO interface, DMA window is created. This DMA window has TCE Table and a corresponding data for userview of TCE table.
When the userspace driver closes the device, all the above infrastructure is free'ed and the device control given back to kernel. Both DMA window and TCE table is getting free'ed. But due to a code bug, userview of the TCE table is not getting free'ed. This is resulting in a memory leak.
Befow is the information from KMEMLEAK
unreferenced object 0xc008000022af0000 (size 16777216):
comm "senlib_unit_tes", pid 9346, jiffies 4294983174 hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 0):
kmemleak_vmalloc+0xc8/0x1a0
__vmalloc_node_range+0x284/0x340
vzalloc+0x58/0x70
spapr_tce_create_table+0x4b0/0x8d0
tce_iommu_create_table+0xcc/0x170 [vfio_iommu_spapr_tce]
tce_iommu_create_window+0x144/0x2f0 [vfio_iommu_spapr_tce]
tce_iommu_ioctl.part.0+0x59c/0xc90 [vfio_iommu_spapr_tce]
vfio_fops_unl_ioctl+0x88/0x280 [vfio]
sys_ioctl+0xf4/0x160
system_call_exception+0x164/0x310
system_call_vectored_common+0xe8/0x278
unreferenced object 0xc008000023b00000 (size 4194304):
comm "senlib_unit_tes", pid 9351, jiffies 4294984116
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 0):
kmemleak_vmalloc+0xc8/0x1a0
__vmalloc_node_range+0x284/0x340
vzalloc+0x58/0x70
spapr_tce_create_table+0x4b0/0x8d0
tce_iommu_create_table+0xcc/0x170 [vfio_iommu_spapr_tce]
tce_iommu_create_window+0x144/0x2f0 [vfio_iommu_spapr_tce]
tce_iommu_create_default_window+0x88/0x120 [vfio_iommu_spapr_tce]
tce_iommu_ioctl.part.0+0x57c/0xc90 [vfio_iommu_spapr_tce]
vfio_fops_unl_ioctl+0x88/0x280 [vfio]
sys_ioctl+0xf4/0x160
system_call_exception+0x164/0x310
system_call_vectored_common+0xe8/0x278--- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/pseries/iommu.c +1 -1
@@ -197,7 +197,7 @@ static void tce_iommu_userspace_view_free(struct iommu_table *tbl)static void tce_free_pSeries (struct iommu_table *tbl) { -if (!tbl->it_userspace) +if (tbl->it_userspace)tce_iommu_userspace_view_free (tbl); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/512 btrfs: scrub: update device stats when an error is detected
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
[ Upstream commit ec1f3a207cdf314eae4d4ae145f1ffdb829f0652 ]
[BUG]
Since the migration to the new scrub_stripe interface, scrub no longer updates the device stats when hitting an error, no matter if it's a read or checksum mismatch error. E.g:
BTRFS info (device dm-2): scrub: started on devid 1
BTRFS error (device dm-2): unable to fixup (regular) error at logical 13631488 on dev /dev/mapper/test-scratch1 physical 13631488
BTRFS warning (device dm-2): checksum error at logical 13631488 on dev /dev/mapper/test-scratch1, physical 13631488, root 5, inode 257, offset 0, length 4096, links 1 (path: file) BTRFS error (device dm-2): unable to fixup (regular) error at logical 13631488 on dev /dev/mapper/test-scratch1 physical 13631488
BTRFS warning (device dm-2): checksum error at logical 13631488 on dev /dev/mapper/test-scratch1, physical 13631488, root 5, inode 257, offset 0, length 4096, links 1 (path: file) BTRFS info (device dm-2): scrub: finished on devid 1 with status: 0
Note there is no line showing the device stats error update.
[CAUSE]
In the migration to the new scrub_stripe interface, we no longer call btrfs_dev_stat_inc_and_print().
[FIX]
- Introduce a new bitmap for metadata generation errors
* A new bitmap
@meta_gen_error_bitmap is introduced to record which blocks have metadata generation mismatch errors.
* A new counter for that bitmap
@init_nr_meta_gen_errors, is also introduced to store the number of generation mismatch errors that are found during the initial read.
This is for the error reporting at scrub_stripe_report_errors().
* New dedicated error message for unrepaired generation mismatches
* Update @meta_gen_error_bitmap if a transid mismatch is hit
- Add btrfs_dev_stat_inc_and_print() calls to the following call sites
* scrub_stripe_report_errors()
* scrub_write_endio()
This is only for the write errors.
This means there is a minor behavior change:
- The timing of device stats error message
Since we concentrate the error messages at scrub_stripe_report_errors(), the device stats error messages will all show up in one go, after the detailed scrub error messages:
BTRFS error (device dm-2): unable to fixup (regular) error at logical 13631488 on dev /dev/mapper/test-scratch1 physical 13631488
BTRFS warning (device dm-2): checksum error at logical 13631488 on dev /dev/mapper/test-scratch1, physical 13631488, root 5, inode 257, offset 0, length 4096, links 1 (path: file) BTRFS error (device dm-2): unable to fixup (regular) error at logical 13631488 on dev /dev/mapper/test-scratch1 physical 13631488
BTRFS warning (device dm-2): checksum error at logical 13631488 on dev /dev/mapper/test-scratch1, physical 13631488, root 5, inode 257, offset 0, length 4096, links 1 (path: file) BTRFS error (device dm-2): bdev /dev/mapper/test-scratch1 errs: wr 0, rd 0, flush 0, corrupt 1, gen 0
BTRFS error (device dm-2): bdev /dev/mapper/test-scratch1 errs: wr 0, rd 0, flush 0, corrupt 2, gen 0
--- fs/btrfs/scrub.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-)
fs/btrfs/scrub.c +29 -3
@@ -153,12 +153,14 @@ struct scrub_stripe {unsigned int init_nr_io_errors;unsigned int init_nr_csum_errors;unsigned int init_nr_meta_errors; +unsigned int init_nr_meta_gen_errors;/* * The following error bitmaps are all for the current status. * Every time we submit a new read, these bitmaps may be updated. * -* error_bitmap = io_error_bitmap | csum_error_bitmap | meta_error_bitmap; +* error_bitmap = io_error_bitmap | csum_error_bitmap | +* meta_error_bitmap | meta_generation_bitmap; * * IO and csum errors can happen for both metadata and data. */
@@ -166,6 +168,7 @@ struct scrub_stripe {unsigned long io_error_bitmap;unsigned long csum_error_bitmap;unsigned long meta_error_bitmap; +unsigned long meta_gen_error_bitmap;/* For writeback (repair or replace) error reporting. */ unsigned long write_error_bitmap;
@@ -672,7 +675,7 @@ static void scrub_verify_one_metadata(struct scrub_stripe *stripe, int sector_nr }if (stripe->sectors[sector_nr].generation !=btrfs_stack_header_generation (header)) { -bitmap_set (&stripe->meta_error_bitmap, sector_nr, sectors_per_tree); +bitmap_set (&stripe->meta_gen_error_bitmap, sector_nr, sectors_per_tree);bitmap_set (&stripe->error_bitmap, sector_nr, sectors_per_tree); btrfs_warn_rl(fs_info, "tree block %llu mirror %u has bad generation, has %llu want %llu",
@@ -684,6 +687,7 @@ static void scrub_verify_one_metadata(struct scrub_stripe *stripe, int sector_nrbitmap_clear (&stripe->error_bitmap, sector_nr, sectors_per_tree);bitmap_clear (&stripe->csum_error_bitmap, sector_nr, sectors_per_tree);bitmap_clear (&stripe->meta_error_bitmap, sector_nr, sectors_per_tree); +bitmap_clear (&stripe->meta_gen_error_bitmap, sector_nr, sectors_per_tree); }static void scrub_verify_one_sector (struct scrub_stripe *stripe,int sector_nr)
@@ -972,8 +976,22 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx,if (__ratelimit (&rs) && dev)scrub_print_common_warning ("header error" , dev, false, stripe->logical, physical); +if (test_bit (sector_nr, &stripe->meta_gen_error_bitmap)) +if (__ratelimit (&rs) && dev) +scrub_print_common_warning ("generation error" , dev, false, + stripe->logical, physical); } +/* Update the device stats. */ +for (int i =0 ; i < stripe->init_nr_io_errors; i++) +btrfs_dev_stat_inc_and_print (stripe->dev,BTRFS_DEV_STAT_READ_ERRS ); +for (int i =0 ; i < stripe->init_nr_csum_errors; i++) +btrfs_dev_stat_inc_and_print (stripe->dev,BTRFS_DEV_STAT_CORRUPTION_ERRS ); +/* Generation mismatch error is based on each metadata, not each block. */ +for (int i =0 ; i < stripe->init_nr_meta_gen_errors; + i += (fs_info->nodesize >> fs_info->sectorsize_bits)) +btrfs_dev_stat_inc_and_print (stripe->dev,BTRFS_DEV_STAT_GENERATION_ERRS ); +spin_lock (&sctx->stat_lock); sctx->stat.data_extents_scrubbed += stripe->nr_data_extents; sctx->stat.tree_extents_scrubbed += stripe->nr_meta_extents;
@@ -982,7 +1000,8 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx, sctx->stat.no_csum += nr_nodatacsum_sectors; sctx->stat.read_errors += stripe->init_nr_io_errors; sctx->stat.csum_errors += stripe->init_nr_csum_errors; - sctx->stat.verify_errors += stripe->init_nr_meta_errors; + sctx->stat.verify_errors += stripe->init_nr_meta_errors + + stripe->init_nr_meta_gen_errors; sctx->stat.uncorrectable_errors +=bitmap_weight (&stripe->error_bitmap, stripe->nr_sectors); sctx->stat.corrected_errors += nr_repaired_sectors;
@@ -1028,6 +1047,8 @@ static void scrub_stripe_read_repair_worker(struct work_struct *work) stripe->nr_sectors); stripe->init_nr_meta_errors =bitmap_weight (&stripe->meta_error_bitmap, stripe->nr_sectors); + stripe->init_nr_meta_gen_errors =bitmap_weight (&stripe->meta_gen_error_bitmap, + stripe->nr_sectors);if (bitmap_empty (&stripe->init_error_bitmap, stripe->nr_sectors)) goto out;
@@ -1142,6 +1163,9 @@ static void scrub_write_endio(struct btrfs_bio *bbio)bitmap_set (&stripe->write_error_bitmap, sector_nr, bio_size >> fs_info->sectorsize_bits);spin_unlock_irqrestore (&stripe->write_error_lock, flags); +for (int i =0 ; i < (bio_size >> fs_info->sectorsize_bits); i++) +btrfs_dev_stat_inc_and_print (stripe->dev, +BTRFS_DEV_STAT_WRITE_ERRS ); }bio_put (&bbio->bio);
@@ -1508,10 +1532,12 @@ static void scrub_stripe_reset_bitmaps(struct scrub_stripe *stripe) stripe->init_nr_io_errors =0 ; stripe->init_nr_csum_errors =0 ; stripe->init_nr_meta_errors =0 ; + stripe->init_nr_meta_gen_errors =0 ; stripe->error_bitmap =0 ; stripe->io_error_bitmap =0 ; stripe->csum_error_bitmap =0 ; stripe->meta_error_bitmap =0 ; + stripe->meta_gen_error_bitmap =0 ; }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/512 btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
[ Upstream commit f2c19541e421b3235efc515dad88b581f00592ae ]
When the bytenr doesn't match for a metadata tree block, we will report it as an csum error, which is incorrect and should be reported as a metadata error instead.
--- fs/btrfs/scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/scrub.c +1 -1
@@ -619,7 +619,7 @@ static void scrub_verify_one_metadata(struct scrub_stripe *stripe, int sector_nrmemcpy (on_disk_csum, header->csum, fs_info->csum_size);if (logical !=btrfs_stack_header_bytenr (header)) { -bitmap_set (&stripe->csum_error_bitmap, sector_nr, sectors_per_tree); +bitmap_set (&stripe->meta_error_bitmap, sector_nr, sectors_per_tree);bitmap_set (&stripe->error_bitmap, sector_nr, sectors_per_tree); btrfs_warn_rl(fs_info, "tree block %llu mirror %u has bad bytenr, has %llu want %llu",
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/512 btrfs: fix invalid data space release when truncating block in NOCOW mode
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit d3914d6030aa6be2993dfc223d096ff93018c236 ]
If when truncating a block we fail to reserve data space and then we proceed anyway because we can do a NOCOW write, if we later get an error when trying to get the folio from the inode's mapping, we end up releasing data space that we haven't reserved, screwing up the bytes_may_use counter from the data space_info, eventually resulting in an underflow when all other reservations done by other tasks are released, if any, or right away if there are no other reservations at the moment.
This is because when we get an error when trying to grab the block's folio we call btrfs_delalloc_release_space(), which releases metadata (which we have reserved) and data (which we haven't reserved).
Fix this by calling btrfs_delalloc_release_space() only if we did reserve data space, that is, if we aren't falling back to NOCOW, meaning the local variable @only_release_metadata has a false value, otherwise release only metadata by calling btrfs_delalloc_release_metadata().
--- fs/btrfs/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/btrfs/inode.c +5 -2
@@ -4857,8 +4857,11 @@ int btrfs_truncate_block(struct btrfs_inode *inode, loff_t from, loff_t len, folio =__filemap_get_folio (mapping, index,FGP_LOCK |FGP_ACCESSED |FGP_CREAT , mask);if (IS_ERR (folio)) { -btrfs_delalloc_release_space (inode, data_reserved, block_start, - blocksize, true); +if (only_release_metadata) +btrfs_delalloc_release_metadata (inode, blocksize, true); +else +btrfs_delalloc_release_space (inode, data_reserved, + block_start, blocksize, true);btrfs_delalloc_release_extents (inode, blocksize); ret = -ENOMEM ; goto out;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 30/512 rcu/cpu_stall_cputime: fix the hardirq count for x86 architecture
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yongliang Gao <[email protected]>
[ Upstream commit da6b85598af30e9fec34d82882d7e1e39f3da769 ]
When counting the number of hardirqs in the x86 architecture, it is essential to add arch_irq_stat_cpu to ensure accuracy.
For example, a CPU loop within the rcu_read_lock function.
Before:
[ 70.910184] rcu: INFO: rcu_preempt self-detected stall on CPU [ 70.910436] rcu: 3-....: (4999 ticks this GP) idle=*** [ 70.910711] rcu: hardirqs softirqs csw/system [ 70.910870] rcu: number: 0 657 0 [ 70.911024] rcu: cputime: 0 0 2498 ==> 2498(ms) [ 70.911278] rcu: (t=5001 jiffies g=3677 q=29 ncpus=8)
After:
[ 68.046132] rcu: INFO: rcu_preempt self-detected stall on CPU [ 68.046354] rcu: 2-....: (4999 ticks this GP) idle=*** [ 68.046628] rcu: hardirqs softirqs csw/system [ 68.046793] rcu: number: 2498 663 0 [ 68.046951] rcu: cputime: 0 0 2496 ==> 2496(ms) [ 68.047244] rcu: (t=5000 jiffies g=3825 q=4 ncpus=8)
--- kernel/rcu/tree.c | 10 +++++++--- kernel/rcu/tree.h | 2 +- kernel/rcu/tree_stall.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-)
kernel/rcu/tree.c +7 -3
@@ -802,6 +802,10 @@ static int rcu_watching_snap_save(struct rcu_data *rdp)return 0 ; } +#ifndef arch_irq_stat_cpu +#define arch_irq_stat_cpu (cpu) 0 +#endif +/* * Returns positive if the specified CPU has passed through a quiescent state * by virtue of being in or having passed through an dynticks idle state since
@@ -937,9 +941,9 @@ static int rcu_watching_snap_recheck(struct rcu_data *rdp) rsrp->cputime_irq =kcpustat_field (kcsp,CPUTIME_IRQ , cpu); rsrp->cputime_softirq =kcpustat_field (kcsp,CPUTIME_SOFTIRQ , cpu); rsrp->cputime_system =kcpustat_field (kcsp,CPUTIME_SYSTEM , cpu); - rsrp->nr_hardirqs =kstat_cpu_irqs_sum (rdp->cpu); - rsrp->nr_softirqs =kstat_cpu_softirqs_sum (rdp->cpu); - rsrp->nr_csw =nr_context_switches_cpu (rdp->cpu); + rsrp->nr_hardirqs =kstat_cpu_irqs_sum (cpu) +arch_irq_stat_cpu (cpu); + rsrp->nr_softirqs =kstat_cpu_softirqs_sum (cpu); + rsrp->nr_csw =nr_context_switches_cpu (cpu); rsrp->jiffies = jiffies; rsrp->gp_seq = rdp->gp_seq; }
kernel/rcu/tree.h +1 -1
@@ -168,7 +168,7 @@ struct rcu_snap_record {u64 cputime_irq;/* Accumulated cputime of hard irqs */ u64 cputime_softirq;/* Accumulated cputime of soft irqs */ u64 cputime_system;/* Accumulated cputime of kernel tasks */ -unsigned long nr_hardirqs;/* Accumulated number of hard irqs */ +u64 nr_hardirqs;/* Accumulated number of hard irqs */ unsigned int nr_softirqs;/* Accumulated number of soft irqs */ unsigned long long nr_csw;/* Accumulated number of task switches */ unsigned long jiffies;/* Track jiffies value */
kernel/rcu/tree_stall.h +2 -2
@@ -457,8 +457,8 @@ static void print_cpu_stat_info(int cpu) rsr.cputime_system =kcpustat_field (kcsp,CPUTIME_SYSTEM , cpu);pr_err ("\t hardirqs softirqs csw/system\n" ); -pr_err ("\t number: %8ld %10d %12lld\n" , -kstat_cpu_irqs_sum (cpu) - rsrp->nr_hardirqs, +pr_err ("\t number: %8lld %10d %12lld\n" , +kstat_cpu_irqs_sum (cpu) +arch_irq_stat_cpu (cpu) - rsrp->nr_hardirqs,kstat_cpu_softirqs_sum (cpu) - rsrp->nr_softirqs,nr_context_switches_cpu (cpu) - rsrp->nr_csw); pr_err("\tcputime: %8lld %10lld %12lld ==> %d(ms)\n",
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 31/512 crypto: lrw - Only add ecb if it is not already there
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 3d73909bddc2ebb3224a8bc2e5ce00e9df70c15d ]
Only add ecb to the cipher name if it isn't already ecb.
Also use memcmp instead of strncmp since these strings are all stored in an array of length CRYPTO_MAX_ALG_NAME.
--- crypto/lrw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/lrw.c +2 -2
@@ -322,7 +322,7 @@ static int lrw_create(struct crypto_template *tmpl, struct rtattr **tb) err =crypto_grab_skcipher (spawn,skcipher_crypto_instance (inst), cipher_name,0 , mask); -if (err == -ENOENT ) { +if (err == -ENOENT &&memcmp (cipher_name,"ecb(" ,4 )) { err = -ENAMETOOLONG ;if (snprintf (ecb_name,CRYPTO_MAX_ALG_NAME ,"ecb(%s)" , cipher_name) >=CRYPTO_MAX_ALG_NAME )
@@ -356,7 +356,7 @@ static int lrw_create(struct crypto_template *tmpl, struct rtattr **tb)/* Alas we screwed up the naming so we have to mangle the * cipher name. */ -if (!strncmp (cipher_name,"ecb(" ,4 )) { +if (!memcmp (cipher_name,"ecb(" ,4 )) {int len; len =strscpy (ecb_name, cipher_name +4 ,sizeof (ecb_name));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/512 crypto: xts - Only add ecb if it is not already there
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 270b6f13454cb7f2f7058c50df64df409c5dcf55 ]
Only add ecb to the cipher name if it isn't already ecb.
Also use memcmp instead of strncmp since these strings are all stored in an array of length CRYPTO_MAX_ALG_NAME.
--- crypto/xts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/xts.c +2 -2
@@ -363,7 +363,7 @@ static int xts_create(struct crypto_template *tmpl, struct rtattr **tb) err =crypto_grab_skcipher (&ctx->spawn,skcipher_crypto_instance (inst), cipher_name,0 , mask); -if (err == -ENOENT ) { +if (err == -ENOENT &&memcmp (cipher_name,"ecb(" ,4 )) { err = -ENAMETOOLONG ;if (snprintf (name,CRYPTO_MAX_ALG_NAME ,"ecb(%s)" , cipher_name) >=CRYPTO_MAX_ALG_NAME )
@@ -397,7 +397,7 @@ static int xts_create(struct crypto_template *tmpl, struct rtattr **tb)/* Alas we screwed up the naming so we have to mangle the * cipher name. */ -if (!strncmp (cipher_name,"ecb(" ,4 )) { +if (!memcmp (cipher_name,"ecb(" ,4 )) {int len; len =strscpy (name, cipher_name +4 ,sizeof (name));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/512 crypto: sun8i-ce - move fallback ahash_request to the end of the struct
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Panait <[email protected]>
[ Upstream commit c822831b426307a6ca426621504d3c7f99765a39 ]
'struct ahash_request' has a flexible array at the end, so it must be the last member in a struct, to avoid overwriting other struct members.
Therefore, move 'fallback_req' to the end of the 'sun8i_ce_hash_reqctx' struct.
--- drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h +1 -1
@@ -308,8 +308,8 @@ struct sun8i_ce_hash_tfm_ctx {* @flow: the flow to use for this request */ struct sun8i_ce_hash_reqctx { -struct ahash_request fallback_req;int flow; +struct ahash_request fallback_req;// keep at the end };/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/512 kunit: Fix wrong parameter to kunit_deactivate_static_stub()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tzung-Bi Shih <[email protected]>
[ Upstream commit 772e50a76ee664e75581624f512df4e45582605a ]
kunit_deactivate_static_stub() accepts real_fn_addr instead of replacement_addr. In the case, it always passes NULL to kunit_deactivate_static_stub().
Fix it.
--- lib/kunit/static_stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kunit/static_stub.c +1 -1
@@ -96,7 +96,7 @@ void __kunit_activate_static_stub(struct kunit *test,/* If the replacement address is NULL, deactivate the stub. */ if (!replacement_addr) { -kunit_deactivate_static_stub (test, replacement_addr); +kunit_deactivate_static_stub (test, real_fn_addr);return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/512 crypto: api - Redo lookup on EEXIST
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
[ Upstream commit 0a3cf32da469ff1df6e016f5f82b439a63d14461 ]
When two crypto algorithm lookups occur at the same time with different names for the same algorithm, e.g., ctr(aes-generic) and ctr(aes), they will both be instantiated. However, only one of them can be registered. The second instantiation will fail with EEXIST.
Avoid failing the second lookup by making it retry, but only once because there are tricky names such as gcm_base(ctr(aes),ghash) that will always fail, despite triggering instantiation and EEXIST.
--- crypto/api.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
crypto/api.c +11 -2
@@ -220,10 +220,19 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg,if (crypto_is_test_larval (larval))crypto_larval_kill (larval); alg =ERR_PTR (-ETIMEDOUT ); - }else if (!alg) { + }else if (!alg ||PTR_ERR (alg) == -EEXIST ) { +int err = alg ? -EEXIST : -EAGAIN ; + +/* +* EEXIST is expected because two probes can be scheduled +* at the same time with one using alg_name and the other +* using driver_name. Do a re-lookup but do not retry in +* case we hit a quirk like gcm_base(ctr(aes),...) which +* will never match. +*/ alg = &larval->alg; alg =crypto_alg_lookup (alg->cra_name, type, mask) ?: -ERR_PTR (-EAGAIN ); +ERR_PTR (err); }else if (IS_ERR (alg)) ; else if (crypto_is_test_larval(larval) &&
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/512 ACPICA: exserial: dont forget to handle FFixedHW opregions for reading
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniil Tatianin <[email protected]>
[ Upstream commit 0f8af0356a45547683a216e4921006a3c6a6d922 ]
The initial commit that introduced support for FFixedHW operation regions did add a special case in the AcpiExReadSerialBus If, but forgot to actually handle it inside the switch, so add the missing case to prevent reads from failing with AE_AML_INVALID_SPACE_ID.
--- drivers/acpi/acpica/exserial.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/acpi/acpica/exserial.c +6 -0
@@ -201,6 +201,12 @@ acpi_ex_read_serial_bus(union acpi_operand_object *obj_desc, function =ACPI_READ ;break ; +case ACPI_ADR_SPACE_FIXED_HARDWARE : + + buffer_length =ACPI_FFH_INPUT_BUFFER_SIZE ; + function =ACPI_READ ; +break ; +default :return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/512 tools/nolibc/types.h: fix mismatched parenthesis in minor()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jemmy Wong <[email protected]>
[ Upstream commit 9c138ac9392228835b520fd4dbb07e636b34a867 ]
Fix an imbalance where opening parentheses exceed closing ones.
--- tools/include/nolibc/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/nolibc/types.h +1 -1
@@ -201,7 +201,7 @@ struct stat {/* WARNING, it only deals with the 4096 first majors and 256 first minors */ #define makedev (major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))#define major (dev) ((unsigned int)(((dev) >> 8) & 0xfff)) -#define minor (dev) ((unsigned int)(((dev) & 0xff)) +#define minor (dev) ((unsigned int)((dev) & 0xff))#ifndef offsetof#define offsetof (TYPE ,FIELD ) ((size_t) &((TYPE *)0)->FIELD)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/512 ASoC: tas2764: Enable main IRQs
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hector Martin <[email protected]>
[ Upstream commit dd50f0e38563f15819059c923bf142200453e003 ]
IRQ handling was added in commit dae191fb957f ("ASoC: tas2764: Add IRQ handling") however that same commit masks all interrupts coming from the chip. Unmask the "main" interrupts so that we can see and deal with a number of errors including clock, voltage, and current.
--- sound/soc/codecs/tas2764.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/tas2764.c +1 -1
@@ -540,7 +540,7 @@ static int tas2764_codec_probe(struct snd_soc_component *component)tas2764_reset (tas2764);if (tas2764->irq) { - ret =snd_soc_component_write (tas2764->component,TAS2764_INT_MASK0 ,0xff ); + ret =snd_soc_component_write (tas2764->component,TAS2764_INT_MASK0 ,0x00 );if (ret <0 )return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/512 ASoC: mediatek: mt8195: Set ETDM1/2 IN/OUT to COMP_DUMMY()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julien Massot <[email protected]>
[ Upstream commit 7af317f7faaab09d5a78f24605057d11f5955115 ]
ETDM2_IN_BE and ETDM1_OUT_BE are defined as COMP_EMPTY(), in the case the codec dai_name will be null.
Avoid a crash if the device tree is not assigning a codec to these links.
[ 1.179936] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 1.181065] Mem abort info: [ 1.181420] ESR = 0x0000000096000004 [ 1.181892] EC = 0x25: DABT (current EL), IL = 32 bits [ 1.182576] SET = 0, FnV = 0 [ 1.182964] EA = 0, S1PTW = 0 [ 1.183367] FSC = 0x04: level 0 translation fault [ 1.183983] Data abort info: [ 1.184406] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 1.185097] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 1.185766] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 1.186439] [0000000000000000] user address but active_mm is swapper [ 1.187239] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 1.188029] Modules linked in: [ 1.188420] CPU: 7 UID: 0 PID: 70 Comm: kworker/u32:1 Not tainted 6.14.0-rc4-next-20250226+ #85 [ 1.189515] Hardware name: Radxa NIO 12L (DT) [ 1.190065] Workqueue: events_unbound deferred_probe_work_func [ 1.190808] pstate: 40400009 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 1.191683] pc : __pi_strcmp+0x24/0x140 [ 1.192170] lr : mt8195_mt6359_soc_card_probe+0x224/0x7b0 [ 1.192854] sp : ffff800083473970 [ 1.193271] x29: ffff800083473a10 x28: 0000000000001008 x27: 0000000000000002 [ 1.194168] x26: ffff800082408960 x25: ffff800082417db0 x24: ffff800082417d88 [ 1.195065] x23: 000000000000001e x22: ffff800082dbf480 x21: ffff800082dc07b8 [ 1.195961] x20: 0000000000000000 x19: 0000000000000013 x18: 00000000ffffffff [ 1.196858] x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000006 [ 1.197755] x14: ffff800082407af0 x13: 6e6f69737265766e x12: 692d6b636f6c6374 [ 1.198651] x11: 0000000000000002 x10: ffff80008240b920 x9 : 0000000000000018 [ 1.199547] x8 : 0101010101010101 x7 : 0000000000000000 x6 : 0000000000000000 [ 1.200443] x5 : 0000000000000000 x4 : 8080808080000000 x3 : 303933383978616d [ 1.201339] x2 : 0000000000000000 x1 : ffff80008240b920 x0 : 0000000000000000 [ 1.202236] Call trace: [ 1.202545] __pi_strcmp+0x24/0x140 (P) [ 1.203029] mtk_soundcard_common_probe+0x3bc/0x5b8 [ 1.203644] platform_probe+0x70/0xe8 [ 1.204106] really_probe+0xc8/0x3a0 [ 1.204556] __driver_probe_device+0x84/0x160 [ 1.205104] driver_probe_device+0x44/0x130 [ 1.205630] __device_attach_driver+0xc4/0x170 [ 1.206189] bus_for_each_drv+0x8c/0xf8 [ 1.206672] __device_attach+0xa8/0x1c8 [ 1.207155] device_initial_probe+0x1c/0x30 [ 1.207681] bus_probe_device+0xb0/0xc0 [ 1.208165] deferred_probe_work_func+0xa4/0x100 [ 1.208747] process_one_work+0x158/0x3e0 [ 1.209254] worker_thread+0x2c4/0x3e8 [ 1.209727] kthread+0x134/0x1f0 [ 1.210136] ret_from_fork+0x10/0x20 [ 1.210589] Code: 54000401 b50002c6 d503201f f86a6803 (f8408402) [ 1.211355] ---[ end trace 0000000000000000 ]---
--- sound/soc/mediatek/mt8195/mt8195-mt6359.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/mediatek/mt8195/mt8195-mt6359.c +2 -2
@@ -822,12 +822,12 @@ SND_SOC_DAILINK_DEFS(ETDM1_IN_BE,SND_SOC_DAILINK_DEFS (ETDM2_IN_BE ,DAILINK_COMP_ARRAY (COMP_CPU ("ETDM2_IN" )), -DAILINK_COMP_ARRAY (COMP_EMPTY ()), +DAILINK_COMP_ARRAY (COMP_DUMMY ()),DAILINK_COMP_ARRAY (COMP_EMPTY ()));SND_SOC_DAILINK_DEFS (ETDM1_OUT_BE ,DAILINK_COMP_ARRAY (COMP_CPU ("ETDM1_OUT" )), -DAILINK_COMP_ARRAY (COMP_EMPTY ()), +DAILINK_COMP_ARRAY (COMP_DUMMY ()),DAILINK_COMP_ARRAY (COMP_EMPTY ())); SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/512 EDAC/skx_common: Fix general protection fault
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qiuxu Zhuo <[email protected]>
[ Upstream commit 20d2d476b3ae18041be423671a8637ed5ffd6958 ]
After loading i10nm_edac (which automatically loads skx_edac_common), if unload only i10nm_edac, then reload it and perform error injection testing, a general protection fault may occur:
mce: [Hardware Error]: Machine check events logged
Oops: general protection fault ... ... Workqueue: events mce_gen_pool_process RIP: 0010:string+0x53/0xe0 ... Call Trace: <TASK> ? die_addr+0x37/0x90 ? exc_general_protection+0x1e7/0x3f0 ? asm_exc_general_protection+0x26/0x30 ? string+0x53/0xe0 vsnprintf+0x23e/0x4c0 snprintf+0x4d/0x70 skx_adxl_decode+0x16a/0x330 [skx_edac_common] skx_mce_check_error.part.0+0xf8/0x220 [skx_edac_common] skx_mce_check_error+0x17/0x20 [skx_edac_common] ...
The issue arose was because the variable 'adxl_component_count' (inside skx_edac_common), which counts the ADXL components, was not reset. During the reloading of i10nm_edac, the count was incremented by the actual number of ADXL components again, resulting in a count that was double the real number of ADXL components. This led to an out-of-bounds reference to the ADXL component array, causing the general protection fault above.
Fix this issue by resetting the 'adxl_component_count' in adxl_put(), which is called during the unloading of {skx,i10nm}_edac.
--- drivers/edac/skx_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/edac/skx_common.c +1 -0
@@ -115,6 +115,7 @@ EXPORT_SYMBOL_GPL(skx_adxl_get);void skx_adxl_put (void ) { + adxl_component_count =0 ;kfree (adxl_values);kfree (adxl_msg); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 41/512 EDAC/{skx_common,i10nm}: Fix the loss of saved RRL for HBM pseudo channel 0
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qiuxu Zhuo <[email protected]>
[ Upstream commit eeed3e03f4261e5e381a72ae099ff00ccafbb437 ]
When enabling the retry_rd_err_log (RRL) feature during the loading of the i10nm_edac driver with the module parameter retry_rd_err_log=2 (Linux RRL control mode), the default values of the control bits of RRL are saved so that they can be restored during the unloading of the driver.
In the current code, the RRL of pseudo channel 1 of HBM overwrites pseudo channel 0 during the loading of the driver, resulting in the loss of saved RRL for pseudo channel 0. This causes the RRL of pseudo channel 0 of HBM to be wrongly restored with the values from pseudo channel 1 when unloading the driver.
Fix this issue by creating two separate groups of RRL control registers per channel to save default RRL settings of two {sub-,pseudo-}channels.
--- drivers/edac/i10nm_base.c | 35 +++++++++++++++++++---------------- drivers/edac/skx_common.h | 11 ++++++++--- 2 files changed, 27 insertions(+), 19 deletions(-)
drivers/edac/i10nm_base.c +19 -16
@@ -95,7 +95,7 @@ static u32 offsets_demand2_spr[] = {0x22c70, 0x22d80, 0x22f18, 0x22d58, 0x22c64,static u32 offsets_demand_spr_hbm0[] = {0x2a54 ,0x2a60 ,0x2b10 ,0x2a58 ,0x2a5c ,0x0ee0 };static u32 offsets_demand_spr_hbm1[] = {0x2e54 ,0x2e60 ,0x2f10 ,0x2e58 ,0x2e5c ,0x0fb0 }; -static void __enable_retry_rd_err_log (struct skx_imc *imc,int chan,bool enable, +static void __enable_retry_rd_err_log (struct skx_imc *imc,int chan,bool enable,u32 *rrl_ctl,u32 *offsets_scrub,u32 *offsets_demand,u32 *offsets_demand2) {
@@ -108,10 +108,10 @@ static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enableif (enable) {/* Save default configurations */ - imc->chan[chan].retry_rd_err_log_s = s; - imc->chan[chan].retry_rd_err_log_d = d; + rrl_ctl[0 ] = s; + rrl_ctl[1 ] = d;if (offsets_demand2) - imc->chan[chan].retry_rd_err_log_d2 = d2; + rrl_ctl[2 ] = d2; s &= ~RETRY_RD_ERR_LOG_NOOVER_UC ; s |=RETRY_RD_ERR_LOG_EN ;
@@ -125,25 +125,25 @@ static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enable } }else {/* Restore default configurations */ -if (imc->chan[chan].retry_rd_err_log_s &RETRY_RD_ERR_LOG_UC ) +if (rrl_ctl[0 ] &RETRY_RD_ERR_LOG_UC ) s |=RETRY_RD_ERR_LOG_UC ; -if (imc->chan[chan].retry_rd_err_log_s &RETRY_RD_ERR_LOG_NOOVER ) +if (rrl_ctl[0 ] &RETRY_RD_ERR_LOG_NOOVER ) s |=RETRY_RD_ERR_LOG_NOOVER ; -if (!(imc->chan[chan].retry_rd_err_log_s &RETRY_RD_ERR_LOG_EN )) +if (!(rrl_ctl[0 ] &RETRY_RD_ERR_LOG_EN )) s &= ~RETRY_RD_ERR_LOG_EN ; -if (imc->chan[chan].retry_rd_err_log_d &RETRY_RD_ERR_LOG_UC ) +if (rrl_ctl[1 ] &RETRY_RD_ERR_LOG_UC ) d |=RETRY_RD_ERR_LOG_UC ; -if (imc->chan[chan].retry_rd_err_log_d &RETRY_RD_ERR_LOG_NOOVER ) +if (rrl_ctl[1 ] &RETRY_RD_ERR_LOG_NOOVER ) d |=RETRY_RD_ERR_LOG_NOOVER ; -if (!(imc->chan[chan].retry_rd_err_log_d &RETRY_RD_ERR_LOG_EN )) +if (!(rrl_ctl[1 ] &RETRY_RD_ERR_LOG_EN )) d &= ~RETRY_RD_ERR_LOG_EN ;if (offsets_demand2) { -if (imc->chan[chan].retry_rd_err_log_d2 &RETRY_RD_ERR_LOG_UC ) +if (rrl_ctl[2 ] &RETRY_RD_ERR_LOG_UC ) d2 |=RETRY_RD_ERR_LOG_UC ; -if (!(imc->chan[chan].retry_rd_err_log_d2 &RETRY_RD_ERR_LOG_NOOVER )) +if (!(rrl_ctl[2 ] &RETRY_RD_ERR_LOG_NOOVER )) d2 &= ~RETRY_RD_ERR_LOG_NOOVER ; -if (!(imc->chan[chan].retry_rd_err_log_d2 &RETRY_RD_ERR_LOG_EN )) +if (!(rrl_ctl[2 ] &RETRY_RD_ERR_LOG_EN )) d2 &= ~RETRY_RD_ERR_LOG_EN ; } }
@@ -157,6 +157,7 @@ static void __enable_retry_rd_err_log(struct skx_imc *imc, int chan, bool enablestatic void enable_retry_rd_err_log (bool enable) {int i, j, imc_num, chan_num; +struct skx_channel *chan;struct skx_imc *imc;struct skx_dev *d;
@@ -171,8 +172,9 @@ static void enable_retry_rd_err_log(bool enable)if (!imc->mbase)continue ; + chan = d->imc[i].chan;for (j =0 ; j < chan_num; j++) -__enable_retry_rd_err_log (imc, j, enable, +__enable_retry_rd_err_log (imc, j, enable, chan[j].rrl_ctl[0 ], res_cfg->offsets_scrub, res_cfg->offsets_demand, res_cfg->offsets_demand2);
@@ -186,12 +188,13 @@ static void enable_retry_rd_err_log(bool enable)if (!imc->mbase || !imc->hbm_mc)continue ; + chan = d->imc[i].chan;for (j =0 ; j < chan_num; j++) { -__enable_retry_rd_err_log (imc, j, enable, +__enable_retry_rd_err_log (imc, j, enable, chan[j].rrl_ctl[0 ], res_cfg->offsets_scrub_hbm0, res_cfg->offsets_demand_hbm0,NULL ); -__enable_retry_rd_err_log (imc, j, enable, +__enable_retry_rd_err_log (imc, j, enable, chan[j].rrl_ctl[1 ], res_cfg->offsets_scrub_hbm1, res_cfg->offsets_demand_hbm1,NULL );
drivers/edac/skx_common.h +8 -3
@@ -79,6 +79,9 @@*/ #define MCACOD_EXT_MEM_ERR 0x280 +/* Max RRL register sets per {,sub-,pseudo-}channel. */ +#define NUM_RRL_SET 3 +/* * Each cpu socket contains some pci devices that provide global * information, and also some that are local to each of the two
@@ -117,9 +120,11 @@ struct skx_dev {struct skx_channel {struct pci_dev *cdev;struct pci_dev *edev; -u32 retry_rd_err_log_s; -u32 retry_rd_err_log_d; -u32 retry_rd_err_log_d2; +/* +* Two groups of RRL control registers per channel to save default RRL +* settings of two {sub-,pseudo-}channels in Linux RRL control mode. +*/ +u32 rrl_ctl[2 ][NUM_RRL_SET ];struct skx_dimm {u8 close_pg;u8 bank_xor_enable;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 42/512 tools/nolibc: fix integer overflow in i{64,}toa_r() and
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <[email protected]>
[ Upstream commit 4d231a7df1a85c7572b67a4666cb73adb977fbf6 ]
In twos complement the most negative number can not be negated.
--- tools/include/nolibc/stdlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/include/nolibc/stdlib.h +2 -2
@@ -274,7 +274,7 @@ int itoa_r(long in, char *buffer)int len =0 ;if (in <0 ) { - in = -in; + in = -(unsigned long )in; *(ptr++) ='-' ; len++; }
@@ -410,7 +410,7 @@ int i64toa_r(int64_t in, char *buffer)int len =0 ;if (in <0 ) { - in = -in; + in = -(uint64_t )in; *(ptr++) ='-' ; len++; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 43/512 spi: tegra210-quad: Fix X1_X2_X4 encoding and support x4 transfers
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <[email protected]>
[ Upstream commit dcb06c638a1174008a985849fa30fc0da7d08904 ]
This patch corrects the QSPI_COMMAND_X1_X2_X4 and QSPI_ADDRESS_X1_X2_X4 macros to properly encode the bus width for x1, x2, and x4 transfers. Although these macros were previously incorrect, they were not being used in the driver, so no functionality was affected.
The patch updates tegra_qspi_cmd_config() and tegra_qspi_addr_config() function calls to use the actual bus width from the transfer, instead of hardcoding it to 0 (which implied x1 mode). This change enables proper support for x1, x2, and x4 data transfers by correctly configuring the interface width for commands and addresses.
These modifications improve the QSPI driver's flexibility and prepare it for future use cases that may require different bus widths for commands and addresses.
--- drivers/spi/spi-tegra210-quad.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/spi/spi-tegra210-quad.c +4 -8
@@ -134,7 +134,7 @@#define QSPI_COMMAND_VALUE_SET (X ) (((x) & 0xFF) << 0)#define QSPI_CMB_SEQ_CMD_CFG 0x1a0 -#define QSPI_COMMAND_X1_X2_X4 (x) (((x) & 0x3) << 13) +#define QSPI_COMMAND_X1_X2_X4 (x) ((((x) >> 1) & 0x3) << 13)#define QSPI_COMMAND_X1_X2_X4_MASK (0x03 << 13)#define QSPI_COMMAND_SDR_DDR BIT(12)#define QSPI_COMMAND_SIZE_SET (x) (((x) & 0xFF) << 0)
@@ -147,7 +147,7 @@#define QSPI_ADDRESS_VALUE_SET (X ) (((x) & 0xFFFF) << 0)#define QSPI_CMB_SEQ_ADDR_CFG 0x1ac -#define QSPI_ADDRESS_X1_X2_X4 (x) (((x) & 0x3) << 13) +#define QSPI_ADDRESS_X1_X2_X4 (x) ((((x) >> 1) & 0x3) << 13)#define QSPI_ADDRESS_X1_X2_X4_MASK (0x03 << 13)#define QSPI_ADDRESS_SDR_DDR BIT(12)#define QSPI_ADDRESS_SIZE_SET (x) (((x) & 0xFF) << 0)
@@ -1036,10 +1036,6 @@ static u32 tegra_qspi_addr_config(bool is_ddr, u8 bus_width, u8 len) {u32 addr_config =0 ; -/* Extract Address configuration and value */ - is_ddr =0 ;//Only SDR mode supported - bus_width =0 ;//X1 mode -if (is_ddr) addr_config |=QSPI_ADDRESS_SDR_DDR ;else
@@ -1079,13 +1075,13 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,switch (transfer_phase) {case CMD_TRANSFER :/* X1 SDR mode */ - cmd_config =tegra_qspi_cmd_config (false,0 , + cmd_config =tegra_qspi_cmd_config (false, xfer->tx_nbits, xfer->len); cmd_value = *((const u8 *)(xfer->tx_buf));break ;case ADDR_TRANSFER :/* X1 SDR mode */ - addr_config =tegra_qspi_addr_config (false,0 , + addr_config =tegra_qspi_addr_config (false, xfer->tx_nbits, xfer->len); address_value = *((const u32 *)(xfer->tx_buf));break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 44/512 spi: tegra210-quad: remove redundant error handling code
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <[email protected]>
[ Upstream commit 400d9f1a27cc2fceabdb1ed93eaf0b89b6d32ba5 ]
Remove unnecessary error handling code that terminated transfers and executed delay on errors. This code was redundant as error handling is already done at a higher level in the SPI core.
--- drivers/spi/spi-tegra210-quad.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/spi/spi-tegra210-quad.c +0 -4
@@ -1175,10 +1175,6 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi, exit: msg->status = ret; -if (ret <0 ) { -tegra_qspi_transfer_end (spi); -spi_transfer_delay_exec (xfer); - }return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/512 spi: tegra210-quad: modify chip select (CS) deactivation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <[email protected]>
[ Upstream commit d8966b65413390d1b5b706886987caac05fbe024 ]
Modify the chip select (CS) deactivation and inter-transfer delay execution only during the DATA_TRANSFER phase when the cs_change flag is not set. This ensures proper CS handling and timing between transfers while eliminating redundant operations.
--- drivers/spi/spi-tegra210-quad.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-tegra210-quad.c +4 -4
@@ -1159,16 +1159,16 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi, ret = -EIO ; goto exit; } -if (!xfer->cs_change) { -tegra_qspi_transfer_end (spi); -spi_transfer_delay_exec (xfer); - }break ;default : ret = -EINVAL ; goto exit; } msg->actual_length += xfer->len; +if (!xfer->cs_change && transfer_phase ==DATA_TRANSFER ) { +tegra_qspi_transfer_end (spi); +spi_transfer_delay_exec (xfer); + } transfer_phase++; } ret =0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/512 power: reset: at91-reset: Optimize at91_reset()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Shiyan <[email protected]>
[ Upstream commit 62d48983f215bf1dd48665913318101fa3414dcf ]
This patch adds a small optimization to the low-level at91_reset() function, which includes:
- Removes the extra branch, since the following store operations already have proper condition checks.
- Removes the definition of the clobber register r4, since it is no longer used in the code.
--- drivers/power/reset/at91-reset.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/power/reset/at91-reset.c +2 -3
@@ -129,12 +129,11 @@ static int at91_reset(struct notifier_block *this, unsigned long mode," str %4, [%0, %6]\n\t" /* Disable SDRAM1 accesses */ "1: tst %1, #0\n\t" -" beq 2f\n\t" " strne %3, [%1, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t"/* Power down SDRAM1 */ " strne %4, [%1, %6]\n\t" /* Reset CPU */ - "2: str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t" + " str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"" b .\n\t" :
@@ -145,7 +144,7 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,"r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN ),"r" (reset->data->reset_args),"r" (reset->ramc_lpr) - : "r4"); + );return NOTIFY_DONE ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/512 PM: EM: Fix potential division-by-zero error in em_compute_costs()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yaxiong Tian <[email protected]>
[ Upstream commit 179c0c7044a378198adb36f2a12410ab68cc730a ]
When the device is of a non-CPU type, table[i].performance won't be initialized in the previous em_init_performance(), resulting in division by zero when calculating costs in em_compute_costs().
Since the 'cost' algorithm is only used for EAS energy efficiency calculations and is currently not utilized by other device drivers, we should add the _is_cpu_device(dev) check to prevent this division-by-zero issue.
--- kernel/power/energy_model.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/power/energy_model.c +4 -0
@@ -233,6 +233,10 @@ static int em_compute_costs(struct device *dev, struct em_perf_state *table,unsigned long prev_cost =ULONG_MAX ;int i, ret; +/* This is needed only for CPUs and EAS skip other devices */ +if (!_is_cpu_device (dev)) +return 0 ; +/* Compute the cost of each performance state. */ for (i = nr_states -1 ; i >=0 ; i--) {unsigned long power_res, cost;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/512 ASoC: SOF: ipc4-pcm: Adjust pipeline_list->pipelines allocation type
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 00a371adbbfb46db561db85a9d7b53b2363880a1 ]
In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.)
The assigned type is "struct snd_sof_pipeline **", but the returned type will be "struct snd_sof_widget **". These are the same size allocation (pointer size) but the types don't match. Adjust the allocation type to match the assignment.
--- sound/soc/sof/ipc4-pcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/sof/ipc4-pcm.c +2 -1
@@ -780,7 +780,8 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm/* allocate memory for max number of pipeline IDs */ pipeline_list->pipelines =kcalloc (ipc4_data->max_num_pipelines, -sizeof (struct snd_sof_widget *),GFP_KERNEL ); +sizeof (*pipeline_list->pipelines), +GFP_KERNEL );if (!pipeline_list->pipelines) {sof_ipc4_pcm_free (sdev, spcm);return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/512 ASoC: SOF: amd: add missing acp descriptor field
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <[email protected]>
[ Upstream commit 7c2bad7b95db5b4b978853cd4dd042ae3ec83e63 ]
Add missing acp descriptor field acp_error_stat for ACP7.0 platform.
--- sound/soc/sof/amd/pci-acp70.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sof/amd/pci-acp70.c +1 -0
@@ -34,6 +34,7 @@ static const struct sof_amd_acp_desc acp70_chip_info = { .ext_intr_cntl = ACP70_EXTERNAL_INTR_CNTL, .ext_intr_stat = ACP70_EXT_INTR_STAT, .ext_intr_stat1 = ACP70_EXT_INTR_STAT1, + .acp_error_stat = ACP70_ERROR_STATUS, .dsp_intr_base = ACP70_DSP_SW_INTR_BASE, .acp_sw0_i2s_err_reason = ACP7X_SW0_I2S_ERROR_REASON, .sram_pte_offset = ACP70_SRAM_PTE_OFFSET,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/512 PM: wakeup: Delete space in the end of string shown by pm_show_wakelocks()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
[ Upstream commit f0050a3e214aa941b78ad4caf122a735a24d81a6 ]
pm_show_wakelocks() is called to generate a string when showing attributes /sys/power/wake_(lock|unlock), but the string ends with an unwanted space that was added back by mistake by commit c9d967b2ce40 ("PM: wakeup: simplify the output logic of pm_show_wakelocks()").
Remove the unwanted space.
--- kernel/power/wakelock.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/power/wakelock.c +3 -0
@@ -49,6 +49,9 @@ ssize_t pm_show_wakelocks(char *buf, bool show_active) len +=sysfs_emit_at (buf, len,"%s " , wl->name); } +if (len >0 ) + --len; + len +=sysfs_emit_at (buf, len,"\n" );mutex_unlock (&wakelocks_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/512 ACPI: resource: fix a typo for MECHREVO in irq1_edge_low_force_override[]
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingcong Bai <[email protected]>
[ Upstream commit 113e04276018bd13978051d8b05a613b4d390cc9 ]
The vendor name for MECHREVO was incorrectly spelled in commit b53f09ecd602 ("ACPI: resource: Do IRQ override on MECHREV GM7XG0M").
Correct this typo in this trivial patch.
--- drivers/acpi/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/resource.c +1 -1
@@ -534,7 +534,7 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {*/ static const struct dmi_system_id irq1_edge_low_force_override[] = { { -/* MECHREV Jiaolong17KS Series GM7XG0M */ +/* MECHREVO Jiaolong17KS Series GM7XG0M */ .matches = {DMI_MATCH (DMI_BOARD_NAME ,"GM7XG0M" ), },
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 52/512 x86/mtrr: Check if fixed-range MTRRs exist in mtrr_save_fixed_ranges()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiaqing Zhao <[email protected]>
[ Upstream commit 824c6384e8d9275d4ec7204f3f79a4ac6bc10379 ]
When suspending, save_processor_state() calls mtrr_save_fixed_ranges() to save fixed-range MTRRs.
On platforms without fixed-range MTRRs like the ACRN hypervisor which has removed fixed-range MTRR emulation, accessing these MSRs will trigger an unchecked MSR access error. Make sure fixed-range MTRRs are supported before access to prevent such error.
Since mtrr_state.have_fixed is only set when MTRRs are present and enabled, checking the CPU feature flag in mtrr_save_fixed_ranges() is unnecessary.
--- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -591,7 +591,7 @@ static void get_fixed_ranges(mtrr_type *frs)void mtrr_save_fixed_ranges (void *info) { -if (boot_cpu_has (X86_FEATURE_MTRR )) +if (mtrr_state.have_fixed)get_fixed_ranges (mtrr_state.fixed_ranges); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 53/512 PM: sleep: Print PM debug messages during hibernation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 1b17d4525bca3916644c41e01522df8fa0f8b90b ]
Commit cdb8c100d8a4 ("include/linux/suspend.h: Only show pm_pr_dbg messages at suspend/resume") caused PM debug messages to only be printed during system-wide suspend and resume in progress, but it forgot about hibernation.
Address this by adding a check for hibernation in progress to pm_debug_messages_should_print().
--- kernel/power/hibernate.c | 5 +++++ kernel/power/main.c | 3 ++- kernel/power/power.h | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-)
kernel/power/hibernate.c +5 -0
@@ -89,6 +89,11 @@ void hibernate_release(void)atomic_inc (&hibernate_atomic); } +bool hibernation_in_progress (void ) +{ +return !atomic_read (&hibernate_atomic); +} +bool hibernation_available (void ) { return nohibernate == 0 &&
kernel/power/main.c +2 -1
@@ -613,7 +613,8 @@ bool pm_debug_messages_on __read_mostly;bool pm_debug_messages_should_print (void ) { -return pm_debug_messages_on && pm_suspend_target_state !=PM_SUSPEND_ON ; +return pm_debug_messages_on && (hibernation_in_progress () || + pm_suspend_target_state !=PM_SUSPEND_ON ); }EXPORT_SYMBOL_GPL (pm_debug_messages_should_print);
kernel/power/power.h +4 -0
@@ -71,10 +71,14 @@ extern void enable_restore_image_protection(void);static inline void enable_restore_image_protection (void ) {}#endif /* CONFIG_STRICT_KERNEL_RWX */ +extern bool hibernation_in_progress (void ); +#else /* !CONFIG_HIBERNATION */ static inline void hibernate_reserved_size_init (void ) {}static inline void hibernate_image_size_init (void ) {} + +static inline bool hibernation_in_progress (void ) {return false; }#endif /* !CONFIG_HIBERNATION */ #define power_attr (_name) \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 54/512 thermal/drivers/mediatek/lvts: Fix debugfs unregister on failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit b49825661af93d9b8d7236f914803f136896f8fd ]
When running the probe function for this driver, the function lvts_debugfs_init() gets called in lvts_domain_init() which, in turn, gets called in lvts_probe() before registering threaded interrupt handlers.
Even though it's unlikely, the last call may fail and, if it does, there's nothing removing the already created debugfs folder and files.
In order to fix that, instead of calling the lvts debugfs cleanup function upon failure, register a devm action that will take care of calling that upon failure or driver removal.
Since devm was used, also delete the call to lvts_debugfs_exit() in the lvts_remove() callback, as now that's done automatically.
--- drivers/thermal/mediatek/lvts_thermal.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/thermal/mediatek/lvts_thermal.c +8 -8
@@ -209,6 +209,13 @@ static const struct debugfs_reg32 lvts_regs[] = { LVTS_DEBUG_FS_REGS(LVTS_CLKEN), }; +static void lvts_debugfs_exit (void *data) +{ +struct lvts_domain *lvts_td = data; + +debugfs_remove_recursive (lvts_td->dom_dentry); +} +static int lvts_debugfs_init (struct device *dev,struct lvts_domain *lvts_td) {struct debugfs_regset32 *regset;
@@ -241,12 +248,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) debugfs_create_regset32("registers", 0400, dentry, regset); } -return 0 ; -} - -static void lvts_debugfs_exit (struct lvts_domain *lvts_td) -{ -debugfs_remove_recursive (lvts_td->dom_dentry); +return devm_add_action_or_reset (dev, lvts_debugfs_exit, lvts_td); }#else
@@ -1352,8 +1354,6 @@ static void lvts_remove(struct platform_device *pdev)for (i =0 ; i < lvts_td->num_lvts_ctrl; i++)lvts_ctrl_set_enable (&lvts_td->lvts_ctrl[i], false); - -lvts_debugfs_exit (lvts_td); }static const struct lvts_ctrl_data mt7988_lvts_ap_data_ctrl[] = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 55/512 ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions"
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit 8cf4fdac9bdead7bca15fc56fdecdf78d11c3ec6 ]
As specified in section 5.7.2 of the ACPI specification the feature group string "3.0 _SCP Extensions" implies that the operating system evaluates the _SCP control method with additional parameters.
However the ACPI thermal driver evaluates the _SCP control method without those additional parameters, conflicting with the above feature group string advertised to the firmware thru _OSI.
Stop advertising support for this feature string to avoid confusing the ACPI firmware.
--- drivers/acpi/osi.c | 1 - 1 file changed, 1 deletion(-)
drivers/acpi/osi.c +0 -1
@@ -42,7 +42,6 @@ static struct acpi_osi_entry osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { {"Module Device", true}, {"Processor Device", true}, - {"3.0 _SCP Extensions", true}, {"Processor Aggregator Device", true}, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 56/512 spi: sh-msiof: Fix maximum DMA transfer size
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0941d5166629cb766000530945e54b4e49680c68 ]
The maximum amount of data to transfer in a single DMA request is calculated from the FIFO sizes (which is technically not 100% correct, but a simplification, as it is limited by the maximum word count values in the Transmit and Control Data Registers). However, in case there is both data to transmit and to receive, the transmit limit is overwritten by the receive limit.
Fix this by using the minimum applicable FIFO size instead. Move the calculation outside the loop, so it is not repeated for each individual DMA transfer.
As currently tx_fifo_size is always equal to rx_fifo_size, this bug had no real impact.
--- drivers/spi/spi-sh-msiof.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/spi/spi-sh-msiof.c +7 -6
@@ -918,6 +918,7 @@ static int sh_msiof_transfer_one(struct spi_controller *ctlr,void *rx_buf = t->rx_buf;unsigned int len = t->len;unsigned int bits = t->bits_per_word; +unsigned int max_wdlen =256 ;unsigned int bytes_per_word;unsigned int words;int n;
@@ -931,17 +932,17 @@ static int sh_msiof_transfer_one(struct spi_controller *ctlr,if (!spi_controller_is_target (p->ctlr))sh_msiof_spi_set_clk_regs (p, t); +if (tx_buf) + max_wdlen =min (max_wdlen, p->tx_fifo_size); +if (rx_buf) + max_wdlen =min (max_wdlen, p->rx_fifo_size); +while (ctlr->dma_tx && len >15 ) {/* * DMA supports 32-bit words only, hence pack 8-bit and 16-bit * words, with byte resp. word swapping. */ -unsigned int l =0 ; - -if (tx_buf) - l =min (round_down (len,4 ), p->tx_fifo_size *4 ); -if (rx_buf) - l =min (round_down (len,4 ), p->rx_fifo_size *4 ); +unsigned int l =min (round_down (len,4 ), max_wdlen *4 );if (bits <=8 ) { copy32 = copy_bswap32;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 57/512 ASoC: apple: mca: Constrain channels according to TDM mask
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Povišer <[email protected]>
[ Upstream commit e717c661e2d1a660e96c40b0fe9933e23a1d7747 ]
We don't (and can't) configure the hardware correctly if the number of channels exceeds the weight of the TDM mask. Report that constraint in startup of FE.
--- sound/soc/apple/mca.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
sound/soc/apple/mca.c +23 -0
@@ -464,6 +464,28 @@ static int mca_configure_serdes(struct mca_cluster *cl, int serdes_unit,return -EINVAL ; } +static int mca_fe_startup (struct snd_pcm_substream *substream, +struct snd_soc_dai *dai) +{ +struct mca_cluster *cl =mca_dai_to_cluster (dai); +unsigned int mask, nchannels; + +if (cl->tdm_slots) { +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) + mask = cl->tdm_tx_mask; +else + mask = cl->tdm_rx_mask; + + nchannels =hweight32 (mask); + }else { + nchannels =2 ; + } + +return snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_CHANNELS , +1 , nchannels); +} +static int mca_fe_set_tdm_slot (struct snd_soc_dai *dai,unsigned int tx_mask,unsigned int rx_mask,int slots,int slot_width) {
@@ -680,6 +702,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream, }static const struct snd_soc_dai_ops mca_fe_ops = { + .startup = mca_fe_startup, .set_fmt = mca_fe_set_fmt, .set_bclk_ratio = mca_set_bclk_ratio, .set_tdm_slot = mca_fe_set_tdm_slot,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 58/512 ALSA: core: fix up bus match const issues.
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 62f134ab190c5fd5c9f68fe638ad8e13bb8a4cb4 ]
In commit d69d80484598 ("driver core: have match() callback in struct bus_type take a const *"), the match bus callback was changed to have the driver be a const pointer. Unfortunately that const attribute was thrown away when container_of() is called, which is not correct and was not caught by the compiler due to how container_of() is implemented. Fix this up by correctly preserving the const attribute of the driver passed to the bus match function which requires the hdac_driver match function to also take a const pointer for the driver structure.
--- include/sound/hdaudio.h | 4 ++-- sound/core/seq_device.c | 2 +- sound/hda/hda_bus_type.c | 6 +++--- sound/pci/hda/hda_bind.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
include/sound/hdaudio.h +2 -2
@@ -223,7 +223,7 @@ struct hdac_driver {struct device_driver driver;int type;const struct hda_device_id *id_table; -int (*match)(struct hdac_device *dev,struct hdac_driver *drv); +int (*match)(struct hdac_device *dev,const struct hdac_driver *drv);void (*unsol_event)(struct hdac_device *dev,unsigned int event);/* fields used by ext bus APIs */
@@ -235,7 +235,7 @@ struct hdac_driver {#define drv_to_hdac_driver (_drv) container_of(_drv, struct hdac_driver, driver)const struct hda_device_id * -hdac_get_device_id (struct hdac_device *hdev,struct hdac_driver *drv); +hdac_get_device_id (struct hdac_device *hdev,const struct hdac_driver *drv);/* * Bus verb operators
sound/core/seq_device.c +1 -1
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");static int snd_seq_bus_match (struct device *dev,const struct device_driver *drv) {struct snd_seq_device *sdev =to_seq_dev (dev); -struct snd_seq_driver *sdrv =to_seq_drv (drv); +const struct snd_seq_driver *sdrv =to_seq_drv (drv);return strcmp (sdrv->id, sdev->id) ==0 && sdrv->argsize == sdev->argsize;
sound/hda/hda_bus_type.c +3 -3
@@ -21,7 +21,7 @@ MODULE_LICENSE("GPL");* driver id_table and returns the matching device id entry. */ const struct hda_device_id * -hdac_get_device_id (struct hdac_device *hdev,struct hdac_driver *drv) +hdac_get_device_id (struct hdac_device *hdev,const struct hdac_driver *drv) {if (drv->id_table) {const struct hda_device_id *id = drv->id_table;
@@ -38,7 +38,7 @@ hdac_get_device_id(struct hdac_device *hdev, struct hdac_driver *drv) }EXPORT_SYMBOL_GPL (hdac_get_device_id); -static int hdac_codec_match (struct hdac_device *dev,struct hdac_driver *drv) +static int hdac_codec_match (struct hdac_device *dev,const struct hdac_driver *drv) {if (hdac_get_device_id (dev, drv))return 1 ;
@@ -49,7 +49,7 @@ static int hdac_codec_match(struct hdac_device *dev, struct hdac_driver *drv)static int hda_bus_match (struct device *dev,const struct device_driver *drv) {struct hdac_device *hdev =dev_to_hdac_dev (dev); -struct hdac_driver *hdrv =drv_to_hdac_driver (drv); +const struct hdac_driver *hdrv =drv_to_hdac_driver (drv);if (hdev->type != hdrv->type)return 0 ;
sound/pci/hda/hda_bind.c +2 -2
@@ -18,10 +18,10 @@/* * find a matching codec id */ -static int hda_codec_match (struct hdac_device *dev,struct hdac_driver *drv) +static int hda_codec_match (struct hdac_device *dev,const struct hdac_driver *drv) { struct hda_codec *codec = container_of(dev, struct hda_codec, core); -struct hda_codec_driver *driver = +const struct hda_codec_driver *driver = container_of(drv, struct hda_codec_driver, core);const struct hda_device_id *list;/* check probe_id instead of vendor_id if set */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 59/512 drm/vmwgfx: Add seqno waiter for sync_files
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Forbes <[email protected]>
[ Upstream commit 0039a3b35b10d9c15d3d26320532ab56cc566750 ]
Because sync_files are passive waiters they do not participate in the processing of fences like the traditional vmw_fence_wait IOCTL. If userspace exclusively uses sync_files for synchronization then nothing in the kernel actually processes fence updates as interrupts for fences are masked and ignored if the kernel does not indicate to the SVGA device that there are active waiters.
This oversight results in a bug where the entire GUI can freeze waiting on a sync_file that will never be signalled as we've masked the interrupts to signal its completion. This bug is incredibly racy as any process which interacts with the fencing code via the 3D stack can process the stuck fences on behalf of the stuck process causing it to run again. Even a simple app like eglinfo is enough to resume the stuck process. Usually this bug is seen at a login screen like GDM because there are no other 3D apps running.
By adding a seqno waiter we re-enable interrupt based processing of the dma_fences associated with the sync_file which is signalled as part of a dma_fence_callback.
This has likely been broken since it was initially added to the kernel in 2017 but has gone unnoticed until mutter recently started using sync_files heavily over the course of 2024 as part of their explicit sync support.
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +26 -0
@@ -4086,6 +4086,23 @@ static int vmw_execbuf_tie_context(struct vmw_private *dev_priv,return 0 ; } +/* +* DMA fence callback to remove a seqno_waiter +*/ +struct seqno_waiter_rm_context { +struct dma_fence_cb base; +struct vmw_private *dev_priv; +}; + +static void seqno_waiter_rm_cb (struct dma_fence *f,struct dma_fence_cb *cb) +{ +struct seqno_waiter_rm_context *ctx = + container_of(cb, struct seqno_waiter_rm_context, base); + +vmw_seqno_waiter_remove (ctx->dev_priv); +kfree (ctx); +} + int vmw_execbuf_process(struct drm_file *file_priv, struct vmw_private *dev_priv, void __user *user_commands, void *kernel_commands,
@@ -4266,6 +4283,15 @@ int vmw_execbuf_process(struct drm_file *file_priv, }else {/* Link the fence with the FD created earlier */ fd_install (out_fence_fd, sync_file->file); +struct seqno_waiter_rm_context *ctx = +kmalloc (sizeof (*ctx),GFP_KERNEL ); + ctx->dev_priv = dev_priv; +vmw_seqno_waiter_add (dev_priv); +if (dma_fence_add_callback (&fence->base, &ctx->base, + seqno_waiter_rm_cb) <0 ) { +vmw_seqno_waiter_remove (dev_priv); +kfree (ctx); + } } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 60/512 drm/vmwgfx: Add error path for xa_store in vmw_bo_add_detached_resource
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keisuke Nishimura <[email protected]>
[ Upstream commit 3282422bf251db541fe07c548ca304130d37d754 ]
The xa_store() may fail due to memory allocation failure because there is no guarantee that the index is already used. This fix introduces new paths to handle the error.
This patch also aligns the order of function calls by calling vmw_bo_add_detached_resource() before ttm_prime_object_init() in order to allow consistent error handling.
--- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 4 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_bo.h | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +2 -2
@@ -849,9 +849,9 @@ void vmw_bo_placement_set_default_accelerated(struct vmw_bo *bo)vmw_bo_placement_set (bo, domain, domain); } -void vmw_bo_add_detached_resource (struct vmw_bo *vbo,struct vmw_resource *res) +int vmw_bo_add_detached_resource (struct vmw_bo *vbo,struct vmw_resource *res) { -xa_store (&vbo->detached_resources, (unsigned long )res, res,GFP_KERNEL ); +return xa_err (xa_store (&vbo->detached_resources, (unsigned long )res, res,GFP_KERNEL )); }void vmw_bo_del_detached_resource (struct vmw_bo *vbo,struct vmw_resource *res)
drivers/gpu/drm/vmwgfx/vmwgfx_bo.h +1 -1
@@ -142,7 +142,7 @@ void vmw_bo_move_notify(struct ttm_buffer_object *bo, struct ttm_resource *mem);void vmw_bo_swap_notify (struct ttm_buffer_object *bo); -void vmw_bo_add_detached_resource (struct vmw_bo *vbo,struct vmw_resource *res); +int vmw_bo_add_detached_resource (struct vmw_bo *vbo,struct vmw_resource *res);void vmw_bo_del_detached_resource (struct vmw_bo *vbo,struct vmw_resource *res);struct vmw_surface *vmw_bo_surface (struct vmw_bo *vbo);
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +14 -2
@@ -871,7 +871,12 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,vmw_resource_unreference (&res); goto out_unlock; } -vmw_bo_add_detached_resource (res->guest_memory_bo, res); + + ret =vmw_bo_add_detached_resource (res->guest_memory_bo, res); +if (unlikely (ret !=0 )) { +vmw_resource_unreference (&res); + goto out_unlock; + } } tmp =vmw_resource_reference (&srf->res);
@@ -1670,6 +1675,14 @@ vmw_gb_surface_define_internal(struct drm_device *dev, } +if (res->guest_memory_bo) { + ret =vmw_bo_add_detached_resource (res->guest_memory_bo, res); +if (unlikely (ret !=0 )) { +vmw_resource_unreference (&res); + goto out_unlock; + } + } + tmp =vmw_resource_reference (res); ret = ttm_prime_object_init(tfile, res->guest_memory_size, &user_srf->prime, VMW_RES_SURFACE,
@@ -1684,7 +1697,6 @@ vmw_gb_surface_define_internal(struct drm_device *dev, rep->handle = user_srf->prime.base.handle; rep->backup_size = res->guest_memory_size;if (res->guest_memory_bo) { -vmw_bo_add_detached_resource (res->guest_memory_bo, res); rep->buffer_map_handle =drm_vma_node_offset_addr (&res->guest_memory_bo->tbo.base.vma_node); rep->buffer_size = res->guest_memory_bo->tbo.base.size;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 61/512 drm/vmwgfx: Fix dumb buffer leak
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Forbes <[email protected]>
[ Upstream commit f42c09e614f1bda96f5690be8d0bb273234febbc ]
Dumb buffers were not being freed because the GEM reference that was acquired in gb_surface_define was not dropped like it is in the 2D case. Dropping this ref uncovered a few additional issues with freeing the resources associated with dirty tracking in vmw_bo_free/release.
Additionally the TTM object associated with the surface were also leaking which meant that when the ttm_object_file was closed at process exit the destructor unreferenced an already destroyed surface.
The solution is to remove the destructor from the vmw_user_surface associated with the dumb_buffer and immediately unreferencing the TTM object which his removes it from the ttm_object_file.
This also allows the early return in vmw_user_surface_base_release for the dumb buffer case to be removed as it should no longer occur.
The chain of references now has the GEM handle(s) owning the dumb buffer. The GEM handles have a singular GEM reference to the vmw_bo which is dropped when all handles are closed. When the GEM reference count hits zero the vmw_bo is freed which then unreferences the surface via vmw_resource_release in vmw_bo_release.
--- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 6 ++++-- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 18 ++++++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +4 -2
@@ -51,11 +51,13 @@ static void vmw_bo_release(struct vmw_bo *vbo)mutex_lock (&res->dev_priv->cmdbuf_mutex); (void )vmw_resource_reserve (res, false, true);vmw_resource_mob_detach (res); +if (res->dirty) + res->func->dirty_free (res);if (res->coherent)vmw_bo_dirty_release (res->guest_memory_bo); res->guest_memory_bo =NULL ; res->guest_memory_offset =0 ; -vmw_resource_unreserve (res, false, false, false,NULL , +vmw_resource_unreserve (res, true, false, false,NULL ,0 );mutex_unlock (&res->dev_priv->cmdbuf_mutex); }
@@ -73,9 +75,9 @@ static void vmw_bo_free(struct ttm_buffer_object *bo) {struct vmw_bo *vbo =to_vmw_bo (&bo->base); -WARN_ON (vbo->dirty);WARN_ON (!RB_EMPTY_ROOT (&vbo->res_tree));vmw_bo_release (vbo); +WARN_ON (vbo->dirty);kfree (vbo); }
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +1 -1
@@ -273,7 +273,7 @@ int vmw_user_resource_lookup_handle(struct vmw_private *dev_priv, goto out_bad_resource; res = converter->base_obj_to_res (base); -kref_get (&res->kref); +vmw_resource_reference (res); *p_res = res; ret =0 ;
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +12 -6
@@ -658,7 +658,7 @@ static void vmw_user_surface_free(struct vmw_resource *res)struct vmw_user_surface *user_srf = container_of(srf, struct vmw_user_surface, srf); -WARN_ON_ONCE (res->dirty); +WARN_ON (res->dirty);if (user_srf->master)drm_master_put (&user_srf->master);kfree (srf->offsets);
@@ -689,8 +689,7 @@ static void vmw_user_surface_base_release(struct ttm_base_object **p_base)* Dumb buffers own the resource and they'll unref the * resource themselves */ -if (res && res->guest_memory_bo && res->guest_memory_bo->is_dumb) -return ; +WARN_ON (res && res->guest_memory_bo && res->guest_memory_bo->is_dumb);vmw_resource_unreference (&res); }
@@ -2370,12 +2369,19 @@ int vmw_dumb_create(struct drm_file *file_priv, vbo = res->guest_memory_bo; vbo->is_dumb = true; vbo->dumb_surface =vmw_res_to_srf (res); - +drm_gem_object_put (&vbo->tbo.base); +/* +* Unset the user surface dtor since this in not actually exposed +* to userspace. The suface is owned via the dumb_buffer's GEM handle +*/ +struct vmw_user_surface *usurf =container_of (vbo->dumb_surface, + struct vmw_user_surface, srf); + usurf->prime.base.refcount_release =NULL ; err:if (res)vmw_resource_unreference (&res); -if (ret) -ttm_ref_object_base_unref (tfile, arg.rep.handle); + +ttm_ref_object_base_unref (tfile, arg.rep.handle);return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 62/512 drm/xe/d3cold: Set power state to D3Cold during s2idle/s3
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Badal Nilawar <[email protected]>
[ Upstream commit f945dd89fa8da3f662508165453dafdb4035d9d3 ]
According to pci core guidelines, pci_save_config is recommended when the driver explicitly needs to set the pci power state. As of now xe kmd is only doing pci_save_config while entering to s2idle/s3 state, which makes pci core think that device driver has already applied required pci power state. This leads to GPU remain in D0 state. To fix the issue setting the pci power state to D3Cold.
--- drivers/gpu/drm/xe/xe_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/xe/xe_pci.c +1 -0
@@ -910,6 +910,7 @@ static int xe_pci_suspend(struct device *dev)pci_save_state (pdev);pci_disable_device (pdev); +pci_set_power_state (pdev, PCI_D3cold);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 63/512 drm/vc4: tests: Use return instead of assert
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit 9e26a3740cc08ef8bcdc5e5d824792cd677affce ]
The vc4_mock_atomic_add_output() and vc4_mock_atomic_del_output() assert that the functions they are calling didn't fail. Since some of them can return EDEADLK, we can't properly deal with it.
Since both functions are expected to return an int, and all caller check the return value, let's just properly propagate the errors when they occur.
--- drivers/gpu/drm/vc4/tests/vc4_mock_output.c | 36 ++++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-)
drivers/gpu/drm/vc4/tests/vc4_mock_output.c +24 -12
@@ -75,24 +75,30 @@ int vc4_mock_atomic_add_output(struct kunit *test,int ret; encoder =vc4_find_encoder_by_type (drm, type); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, encoder); +if (!encoder) +return -ENODEV ; crtc =vc4_find_crtc_for_encoder (test, drm, encoder); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, crtc); +if (!crtc) +return -ENODEV ; output =encoder_to_vc4_dummy_output (encoder); conn = &output->connector; conn_state =drm_atomic_get_connector_state (state, conn); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, conn_state); +if (IS_ERR (conn_state)) +return PTR_ERR (conn_state); ret =drm_atomic_set_crtc_for_connector (conn_state, crtc); -KUNIT_EXPECT_EQ (test, ret,0 ); +if (ret) +return ret; crtc_state =drm_atomic_get_crtc_state (state, crtc); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, crtc_state); +if (IS_ERR (crtc_state)) +return PTR_ERR (crtc_state); ret =drm_atomic_set_mode_for_crtc (crtc_state, &default_mode); -KUNIT_EXPECT_EQ (test, ret,0 ); +if (ret) +return ret; crtc_state->active = true;
@@ -113,26 +119,32 @@ int vc4_mock_atomic_del_output(struct kunit *test,int ret; encoder =vc4_find_encoder_by_type (drm, type); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, encoder); +if (!encoder) +return -ENODEV ; crtc =vc4_find_crtc_for_encoder (test, drm, encoder); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, crtc); +if (!crtc) +return -ENODEV ; crtc_state =drm_atomic_get_crtc_state (state, crtc); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, crtc_state); +if (IS_ERR (crtc_state)) +return PTR_ERR (crtc_state); crtc_state->active = false; ret =drm_atomic_set_mode_for_crtc (crtc_state,NULL ); -KUNIT_ASSERT_EQ (test, ret,0 ); +if (ret) +return ret; output =encoder_to_vc4_dummy_output (encoder); conn = &output->connector; conn_state =drm_atomic_get_connector_state (state, conn); -KUNIT_ASSERT_NOT_ERR_OR_NULL (test, conn_state); +if (IS_ERR (conn_state)) +return PTR_ERR (conn_state); ret =drm_atomic_set_crtc_for_connector (conn_state,NULL ); -KUNIT_ASSERT_EQ (test, ret,0 ); +if (ret) +return ret;return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 64/512 drm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Han <[email protected]>
[ Upstream commit 820116a39f96bdc7d426c33a804b52f53700a919 ]
The function atomctrl_initialize_mc_reg_table() and atomctrl_initialize_mc_reg_table_v2_2() does not check the return value of smu_atom_get_data_table(). If smu_atom_get_data_table() fails to retrieve vram_info, it returns NULL which is later dereferenced.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +8 -0
@@ -144,6 +144,10 @@ int atomctrl_initialize_mc_reg_table( vram_info = (ATOM_VRAM_INFO_HEADER_V2_1 *)smu_atom_get_data_table (hwmgr->adev,GetIndexIntoMasterTable (DATA , VRAM_Info), &size, &frev, &crev); +if (!vram_info) { +pr_err ("Could not retrieve the VramInfo table!" ); +return -EINVAL ; + }if (module_index >= vram_info->ucNumOfVRAMModule) {pr_err ("Invalid VramInfo table." );
@@ -181,6 +185,10 @@ int atomctrl_initialize_mc_reg_table_v2_2( vram_info = (ATOM_VRAM_INFO_HEADER_V2_2 *)smu_atom_get_data_table (hwmgr->adev,GetIndexIntoMasterTable (DATA , VRAM_Info), &size, &frev, &crev); +if (!vram_info) { +pr_err ("Could not retrieve the VramInfo table!" ); +return -EINVAL ; + }if (module_index >= vram_info->ucNumOfVRAMModule) {pr_err ("Invalid VramInfo table." );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 65/512 media: rkvdec: Fix frame size enumeration
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Karlman <[email protected]>
[ Upstream commit f270005b99fa19fee9a6b4006e8dee37c10f1944 ]
The VIDIOC_ENUM_FRAMESIZES ioctl should return all frame sizes (i.e. width and height in pixels) that the device supports for the given pixel format.
It doesn't make a lot of sense to return the frame-sizes in a stepwise manner, which is used to enforce hardware alignments requirements for CAPTURE buffers, for coded formats.
Instead, applications should receive an indication, about the maximum supported frame size for that hardware decoder, via a continuous frame-size enumeration.
--- drivers/staging/media/rkvdec/rkvdec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/staging/media/rkvdec/rkvdec.c +8 -2
@@ -213,8 +213,14 @@ static int rkvdec_enum_framesizes(struct file *file, void *priv,if (!fmt)return -EINVAL ; - fsize->type =V4L2_FRMSIZE_TYPE_STEPWISE ; - fsize->stepwise = fmt->frmsize; + fsize->type =V4L2_FRMSIZE_TYPE_CONTINUOUS ; + fsize->stepwise.min_width =1 ; + fsize->stepwise.max_width = fmt->frmsize.max_width; + fsize->stepwise.step_width =1 ; + fsize->stepwise.min_height =1 ; + fsize->stepwise.max_height = fmt->frmsize.max_height; + fsize->stepwise.step_height =1 ; +return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 66/512 arm64/fpsimd: Avoid RES0 bits in the SME trap handler
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 95507570fb2f75544af69760cd5d8f48fc5c7f20 ]
The SME trap handler consumes RES0 bits from the ESR when determining the reason for the trap, and depends upon those bits reading as zero. This may break in future when those RES0 bits are allocated a meaning and stop reading as zero.
For SME traps taken with ESR_ELx.EC == 0b011101, the specific reason for the trap is indicated by ESR_ELx.ISS.SMTC ("SME Trap Code"). This field occupies bits [2:0] of ESR_ELx.ISS, and as of ARM DDI 0487 L.a, bits [24:3] of ESR_ELx.ISS are RES0. ESR_ELx.ISS itself occupies bits [24:0] of ESR_ELx.
Extract the SMTC field specifically, matching the way we handle ESR_ELx fields elsewhere, and ensuring that the handler is future-proof.
--- arch/arm64/include/asm/esr.h | 14 ++++++++------ arch/arm64/kernel/fpsimd.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-)
arch/arm64/include/asm/esr.h +8 -6
@@ -370,12 +370,14 @@/* * ISS values for SME traps */ - -#define ESR_ELx_SME_ISS_SME_DISABLED 0 -#define ESR_ELx_SME_ISS_ILL 1 -#define ESR_ELx_SME_ISS_SM_DISABLED 2 -#define ESR_ELx_SME_ISS_ZA_DISABLED 3 -#define ESR_ELx_SME_ISS_ZT_DISABLED 4 +#define ESR_ELx_SME_ISS_SMTC_MASK GENMASK(2, 0) +#define ESR_ELx_SME_ISS_SMTC (esr) ((esr) & ESR_ELx_SME_ISS_SMTC_MASK) + +#define ESR_ELx_SME_ISS_SMTC_SME_DISABLED 0 +#define ESR_ELx_SME_ISS_SMTC_ILL 1 +#define ESR_ELx_SME_ISS_SMTC_SM_DISABLED 2 +#define ESR_ELx_SME_ISS_SMTC_ZA_DISABLED 3 +#define ESR_ELx_SME_ISS_SMTC_ZT_DISABLED 4/* ISS field definitions for MOPS exceptions */ #define ESR_ELx_MOPS_ISS_MEM_INST (UL(1) << 24)
arch/arm64/kernel/fpsimd.c +1 -1
@@ -1436,7 +1436,7 @@ void do_sme_acc(unsigned long esr, struct pt_regs *regs)* If this not a trap due to SME being disabled then something * is being used in the wrong mode, report as SIGILL. */ -if (ESR_ELx_ISS (esr) != ESR_ELx_SME_ISS_SME_DISABLED) { +if (ESR_ELx_SME_ISS_SMTC (esr) != ESR_ELx_SME_ISS_SMTC_SME_DISABLED) {force_signal_inject (SIGILL ,ILL_ILLOPC , regs->pc,0 );return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 67/512 arm64/fpsimd: Discard stale CPU state when handling SME traps
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit d3eaab3c70905c5467e5c4ea403053d67505adeb ]
The logic for handling SME traps manipulates saved FPSIMD/SVE/SME state incorrectly, and a race with preemption can result in a task having TIF_SME set and TIF_FOREIGN_FPSTATE clear even though the live CPU state is stale (e.g. with SME traps enabled). This can result in warnings from do_sme_acc() where SME traps are not expected while TIF_SME is set:
| /* With TIF_SME userspace shouldn't generate any traps */ | if (test_and_set_thread_flag(TIF_SME)) | WARN_ON(1);
This is very similar to the SVE issue we fixed in commit:
751ecf6afd6568ad ("arm64/sve: Discard stale CPU state when handling SVE traps")
The race can occur when the SME trap handler is preempted before and after manipulating the saved FPSIMD/SVE/SME state, starting and ending on the same CPU, e.g.
| void do_sme_acc(unsigned long esr, struct pt_regs *regs)
| {
| // Trap on CPU 0 with TIF_SME clear, SME traps enabled
| // task->fpsimd_cpu is 0.
| // per_cpu_ptr(&fpsimd_last_state, 0) is task.
|
| ...
|
| // Preempted; migrated from CPU 0 to CPU 1.
| // TIF_FOREIGN_FPSTATE is set.
|
| get_cpu_fpsimd_context();
|
| /* With TIF_SME userspace shouldn't generate any traps */
| if (test_and_set_thread_flag(TIF_SME))
| WARN_ON(1);
|
| if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) {
| unsigned long vq_minus_one =
| sve_vq_from_vl(task_get_sme_vl(current)) - 1;
| sme_set_vq(vq_minus_one);
|
| fpsimd_bind_task_to_cpu();
| }
|
| put_cpu_fpsimd_context();
|
| // Preempted; migrated from CPU 1 to CPU 0.
| // task->fpsimd_cpu is still 0
| // If per_cpu_ptr(&fpsimd_last_state, 0) is still task then:
| // - Stale HW state is reused (with SME traps enabled)
| // - TIF_FOREIGN_FPSTATE is cleared
| // - A return to userspace skips HW state restore
| }Fix the case where the state is not live and TIF_FOREIGN_FPSTATE is set by calling fpsimd_flush_task_state() to detach from the saved CPU state. This ensures that a subsequent context switch will not reuse the stale CPU state, and will instead set TIF_FOREIGN_FPSTATE, forcing the new state to be reloaded from memory prior to a return to userspace.
Note: this was originallly posted as [1].
--- arch/arm64/kernel/fpsimd.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/kernel/fpsimd.c +2 -0
@@ -1460,6 +1460,8 @@ void do_sme_acc(unsigned long esr, struct pt_regs *regs)sme_set_vq (vq_minus_one);fpsimd_bind_task_to_cpu (); + }else { +fpsimd_flush_task_state (current); }put_cpu_fpsimd_context ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 68/512 arm64/fpsimd: Dont corrupt FPMR when streaming mode changes
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
[ Upstream commit e5fa85fce08b21ed41643cb7968bf66bbd0532e3 ]
When the effective value of PSTATE.SM is changed from 0 to 1 or from 1 to 0 by any method, an entry or exit to/from streaming SVE mode is performed, and hardware automatically resets a number of registers. As of ARM DDI 0487 L.a, this means:
* All implemented bits of the SVE vector registers are set to zero.
* All implemented bits of the SVE predicate registers are set to zero.
* All implemented bits of FFR are set to zero, if FFR is implemented in the new mode.
* FPSR is set to 0x0000_0000_0800_009f.
* FPMR is set to 0, if FPMR is implemented.
Currently task_fpsimd_load() restores FPMR before restoring SVCR (which is an accessor for PSTATE.{SM,ZA}), and so the restored value of FPMR may be clobbered if the restored value of PSTATE.SM happens to differ from the initial value of PSTATE.SM.
Fix this by moving the restore of FPMR later.
Note: this was originally posted as [1].
--- arch/arm64/kernel/fpsimd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/fpsimd.c +3 -3
@@ -359,9 +359,6 @@ static void task_fpsimd_load(void)WARN_ON (preemptible ());WARN_ON (test_thread_flag (TIF_KERNEL_FPSTATE )); -if (system_supports_fpmr ()) -write_sysreg_s (current->thread.uw.fpmr,SYS_FPMR ); -if (system_supports_sve () ||system_supports_sme ()) {switch (current->thread.fp_type) {case FP_STATE_FPSIMD :
@@ -413,6 +410,9 @@ static void task_fpsimd_load(void) restore_ffr =system_supports_fa64 (); } +if (system_supports_fpmr ()) +write_sysreg_s (current->thread.uw.fpmr,SYS_FPMR ); +if (restore_sve_regs) {WARN_ON_ONCE (current->thread.fp_type !=FP_STATE_SVE ); sve_load_state(sve_pffr(¤t->thread),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 69/512 arm64/fpsimd: Avoid clobbering kernel FPSIMD state with SMSTOP
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 01098d893fa8a6edb2b56e178b798e3e6b674f02 ]
On system with SME, a thread's kernel FPSIMD state may be erroneously clobbered during a context switch immediately after that state is restored. Systems without SME are unaffected.
If the CPU happens to be in streaming SVE mode before a context switch to a thread with kernel FPSIMD state, fpsimd_thread_switch() will restore the kernel FPSIMD state using fpsimd_load_kernel_state() while the CPU is still in streaming SVE mode. When fpsimd_thread_switch() subsequently calls fpsimd_flush_cpu_state(), this will execute an SMSTOP, causing an exit from streaming SVE mode. The exit from streaming SVE mode will cause the hardware to reset a number of FPSIMD/SVE/SME registers, clobbering the FPSIMD state.
Fix this by calling fpsimd_flush_cpu_state() before restoring the kernel FPSIMD state.
--- arch/arm64/kernel/fpsimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/fpsimd.c +1 -1
@@ -1575,8 +1575,8 @@ void fpsimd_thread_switch(struct task_struct *next)fpsimd_save_user_state ();if (test_tsk_thread_flag (next,TIF_KERNEL_FPSTATE )) { -fpsimd_load_kernel_state (next);fpsimd_flush_cpu_state (); +fpsimd_load_kernel_state (next); }else {/* * Fix up TIF_FOREIGN_FPSTATE to correctly describe next's
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 70/512 arm64/fpsimd: Reset FPMR upon exec()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit a90878f297d3dba906a6261deccb1bd4a791ba52 ]
An exec() is expected to reset all FPSIMD/SVE/SME state, and barring special handling of the vector lengths, the state is expected to reset to zero. This reset is handled in fpsimd_flush_thread(), which the core exec() code calls via flush_thread().
When support was added for FPMR, no logic was added to fpsimd_flush_thread() to reset the FPMR value, and thus it is erroneously inherited across an exec().
Add the missing reset of FPMR.
--- arch/arm64/kernel/fpsimd.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/kernel/fpsimd.c +3 -0
@@ -1663,6 +1663,9 @@ void fpsimd_flush_thread(void) current->thread.svcr =0 ; } +if (system_supports_fpmr ()) + current->thread.uw.fpmr =0 ; + current->thread.fp_type =FP_STATE_FPSIMD ;put_cpu_fpsimd_context ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 71/512 arm64/fpsimd: Fix merging of FPSIMD state during signal return
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit c94f2f326146a34066a0070ed90b8bc656b1842f ]
For backwards compatibility reasons, when a signal return occurs which restores SVE state, the effective lower 128 bits of each of the SVE vector registers are restored from the corresponding FPSIMD vector register in the FPSIMD signal frame, overriding the values in the SVE signal frame. This is intended to be the case regardless of streaming mode.
To make this happen, restore_sve_fpsimd_context() uses fpsimd_update_current_state() to merge the lower 128 bits from the FPSIMD signal frame into the SVE register state. Unfortunately, fpsimd_update_current_state() performs this merging dependent upon TIF_SVE, which is not always correct for streaming SVE register state:
* When restoring non-streaming SVE register state there is no observable problem, as the signal return code configures TIF_SVE and the saved fp_type to match before calling fpsimd_update_current_state(), which observes either:
- TIF_SVE set AND fp_type == FP_STATE_SVE - TIF_SVE clear AND fp_type == FP_STATE_FPSIMD
* On systems which have SME but not SVE, TIF_SVE cannot be set. Thus the merging will never happen for the streaming SVE register state.
* On systems which have SVE and SME, TIF_SVE can be set and cleared independently of PSTATE.SM. Thus the merging may or may not happen for streaming SVE register state.
As TIF_SVE can be cleared non-deterministically during syscalls (including at the start of sigreturn()), the merging may occur non-deterministically from the perspective of userspace.
This logic has been broken since its introduction in commit:
85ed24dad2904f7c ("arm64/sme: Implement streaming SVE signal handling")
... at which point both fpsimd_signal_preserve_current_state() and fpsimd_update_current_state() only checked TIF SVE. When PSTATE.SM==1 and TIF_SVE was clear, signal delivery would place stale FPSIMD state into the FPSIMD signal frame, and signal return would not merge this into the restored register state.
Subsequently, signal delivery was fixed as part of commit:
61da7c8e2a602f66 ("arm64/signal: Don't assume that TIF_SVE means we saved SVE state")
... but signal restore was not given a corresponding fix, and when TIF_SVE was clear, signal restore would still fail to merge the FPSIMD state into the restored SVE register state. The 'Fixes' tag did not indicate that this had been broken since its introduction.
Fix this by merging the FPSIMD state dependent upon the saved fp_type, matching what we (currently) do during signal delivery.
As described above, when backporting this commit, it will also be necessary to backport commit:
61da7c8e2a602f66 ("arm64/signal: Don't assume that TIF_SVE means we saved SVE state")
... and prior to commit:
baa8515281b30861 ("arm64/fpsimd: Track the saved FPSIMD state type separately to TIF_SVE")
... it will be necessary for fpsimd_signal_preserve_current_state() and fpsimd_update_current_state() to consider both TIF_SVE and thread_sm_enabled(¤t->thread), in place of the saved fp_type.
--- arch/arm64/kernel/fpsimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/fpsimd.c +1 -1
@@ -1806,7 +1806,7 @@ void fpsimd_update_current_state(struct user_fpsimd_state const *state)get_cpu_fpsimd_context (); current->thread.uw.fpsimd_state = *state; -if (test_thread_flag (TIF_SVE )) +if (current->thread.fp_type ==FP_STATE_SVE )fpsimd_to_sve (current);task_fpsimd_load ();
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 72/512 drm/panthor: Fix GPU_COHERENCY_ACE[_LITE] definitions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Brezillon <[email protected]>
[ Upstream commit d1df2907fb69df56aad8e4a0734dac0778c234a7 ]
GPU_COHERENCY_ACE and GPU_COHERENCY_ACE_LITE definitions have been swapped.
Changes in v2:
- New patch
Changes in v3:
- Add Steve's R-b
--- drivers/gpu/drm/panthor/panthor_regs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panthor/panthor_regs.h +2 -2
@@ -133,8 +133,8 @@#define GPU_COHERENCY_PROT_BIT (name) BIT(GPU_COHERENCY_ ## name)#define GPU_COHERENCY_PROTOCOL 0x304 -#define GPU_COHERENCY_ACE 0 -#define GPU_COHERENCY_ACE_LITE 1 +#define GPU_COHERENCY_ACE_LITE 0 +#define GPU_COHERENCY_ACE 1#define GPU_COHERENCY_NONE 31#define MCU_CONTROL 0x700
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 73/512 drm/panthor: Update panthor_mmu::irq::mask when needed
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris Brezillon <[email protected]>
[ Upstream commit 8ba64cf2f358079d09faba7529aad2b0a46c7903 ]
When we clear the faulty bits in the AS mask, we also need to update the panthor_mmu::irq::mask field otherwise our IRQ handler won't get called again until the GPU is reset.
Changes in v2:
- Add Liviu's R-b
Changes in v3:
- Add Steve's R-b
--- drivers/gpu/drm/panthor/panthor_mmu.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panthor/panthor_mmu.c +1 -0
@@ -780,6 +780,7 @@ int panthor_vm_active(struct panthor_vm *vm)if (ptdev->mmu->as.faulty_mask &panthor_mmu_as_fault_mask (ptdev, as)) {gpu_write (ptdev,MMU_INT_CLEAR ,panthor_mmu_as_fault_mask (ptdev, as)); ptdev->mmu->as.faulty_mask &= ~panthor_mmu_as_fault_mask (ptdev, as); + ptdev->mmu->irq.mask |=panthor_mmu_as_fault_mask (ptdev, as);gpu_write (ptdev,MMU_INT_MASK , ~ptdev->mmu->as.faulty_mask); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 74/512 perf: arm-ni: Unregister PMUs on probe failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongbo Yao <[email protected]>
[ Upstream commit 7f57afde6a44d9e044885e1125034edd4fda02e8 ]
When a resource allocation fails in one clock domain of an NI device, we need to properly roll back all previously registered perf PMUs in other clock domains of the same device.
Otherwise, it can lead to kernel panics.
Calling arm_ni_init+0x0/0xff8 [arm_ni] @ 2374
arm-ni ARMHCB70:00: Failed to request PMU region 0x1f3c13000 arm-ni ARMHCB70:00: probe with driver arm-ni failed with error -16 list_add corruption: next->prev should be prev (fffffd01e9698a18), but was 0000000000000000. (next=ffff10001a0decc8).
pstate: 6340009 (nZCv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : list_add_valid_or_report+0x7c/0xb8 lr : list_add_valid_or_report+0x7c/0xb8 Call trace: __list_add_valid_or_report+0x7c/0xb8 perf_pmu_register+0x22c/0x3a0 arm_ni_probe+0x554/0x70c [arm_ni] platform_probe+0x70/0xe8 really_probe+0xc6/0x4d8 driver_probe_device+0x48/0x170 __driver_attach+0x8e/0x1c0 bus_for_each_dev+0x64/0xf0 driver_add+0x138/0x260 bus_add_driver+0x68/0x138 __platform_driver_register+0x2c/0x40 arm_ni_init+0x14/0x2a [arm_ni] do_init_module+0x36/0x298 ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Oops - BUG: Fatal exception
SMP: stopping secondary CPUs
--- drivers/perf/arm-ni.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-)
drivers/perf/arm-ni.c +21 -18
@@ -576,6 +576,23 @@ static int arm_ni_init_cd(struct arm_ni *ni, struct arm_ni_node *node, u64 res_sreturn err; } +static void arm_ni_remove (struct platform_device *pdev) +{ +struct arm_ni *ni =platform_get_drvdata (pdev); + +for (int i =0 ; i < ni->num_cds; i++) { +struct arm_ni_cd *cd = ni->cds + i; + +if (!cd->pmu_base) +continue ; + +writel_relaxed (0 , cd->pmu_base +NI_PMCR ); +writel_relaxed (U32_MAX , cd->pmu_base +NI_PMINTENCLR ); +perf_pmu_unregister (&cd->pmu); +cpuhp_state_remove_instance_nocalls (arm_ni_hp_state, &cd->cpuhp_node); + } +} +static void arm_ni_probe_domain (void __iomem *base,struct arm_ni_node *node) {u32 reg =readl_relaxed (base +NI_NODE_TYPE );
@@ -657,8 +674,11 @@ static int arm_ni_probe(struct platform_device *pdev) reg =readl_relaxed (pd.base +NI_CHILD_PTR (c));arm_ni_probe_domain (base + reg, &cd); ret =arm_ni_init_cd (ni, &cd, res->start); -if (ret) +if (ret) { + ni->cds[cd.id].pmu_base =NULL ; +arm_ni_remove (pdev);return ret; + } } } }
@@ -666,23 +686,6 @@ static int arm_ni_probe(struct platform_device *pdev)return 0 ; } -static void arm_ni_remove (struct platform_device *pdev) -{ -struct arm_ni *ni =platform_get_drvdata (pdev); - -for (int i =0 ; i < ni->num_cds; i++) { -struct arm_ni_cd *cd = ni->cds + i; - -if (!cd->pmu_base) -continue ; - -writel_relaxed (0 , cd->pmu_base +NI_PMCR ); -writel_relaxed (U32_MAX , cd->pmu_base +NI_PMINTENCLR ); -perf_pmu_unregister (&cd->pmu); -cpuhp_state_remove_instance_nocalls (arm_ni_hp_state, &cd->cpuhp_node); - } -} -#ifdef CONFIG_OF static const struct of_device_id arm_ni_of_match[] = { { .compatible = "arm,ni-700" },
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 75/512 perf: arm-ni: Fix missing platform_set_drvdata()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongbo Yao <[email protected]>
[ Upstream commit fc5106088d6db75df61308ef6de314d1f7959646 ]
Add missing platform_set_drvdata in arm_ni_probe(), otherwise calling platform_get_drvdata() in remove returns NULL.
--- drivers/perf/arm-ni.c | 1 + 1 file changed, 1 insertion(+)
drivers/perf/arm-ni.c +1 -0
@@ -661,6 +661,7 @@ static int arm_ni_probe(struct platform_device *pdev) ni->num_cds = num_cds; ni->part = part; ni->id =atomic_fetch_inc (&id); +platform_set_drvdata (pdev, ni);for (int v =0 ; v < cfg.num_components; v++) { reg =readl_relaxed (cfg.base +NI_CHILD_PTR (v));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 76/512 drm/panel: samsung-sofef00: Drop s6e3fc2x01 support
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Casey Connolly <[email protected]>
[ Upstream commit e1eb7293ab4107e9e19fa609835e657fe30dfec7 ]
We never properly supported this panel and always used the wrong init sequence. Drop support so we can move it to it's own proper driver.
--- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-)
drivers/gpu/drm/panel/panel-samsung-sofef00.c +2 -32
@@ -22,7 +22,6 @@ struct sofef00_panel {struct mipi_dsi_device *dsi;struct regulator *supply;struct gpio_desc *reset_gpio; -const struct drm_display_mode *mode; }; static inline
@@ -159,26 +158,11 @@ static const struct drm_display_mode enchilada_panel_mode = { .height_mm = 145, }; -static const struct drm_display_mode fajita_panel_mode = { - .clock = (1080 +72 +16 +36 ) * (2340 +32 +4 +18 ) *60 /1000 , - .hdisplay =1080 , - .hsync_start =1080 +72 , - .hsync_end =1080 +72 +16 , - .htotal =1080 +72 +16 +36 , - .vdisplay =2340 , - .vsync_start =2340 +32 , - .vsync_end =2340 +32 +4 , - .vtotal =2340 +32 +4 +18 , - .width_mm =68 , - .height_mm =145 , -}; -static int sofef00_panel_get_modes (struct drm_panel *panel,struct drm_connector *connector) {struct drm_display_mode *mode; -struct sofef00_panel *ctx =to_sofef00_panel (panel); - mode =drm_mode_duplicate (connector->dev, ctx->mode); + mode =drm_mode_duplicate (connector->dev, &enchilada_panel_mode);if (!mode)return -ENOMEM ;
@@ -239,13 +223,6 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)if (!ctx)return -ENOMEM ; - ctx->mode =of_device_get_match_data (dev); - -if (!ctx->mode) { -dev_err (dev,"Missing device mode\n" ); -return -ENODEV ; - } - ctx->supply =devm_regulator_get (dev,"vddio" );if (IS_ERR (ctx->supply)) return dev_err_probe(dev, PTR_ERR(ctx->supply),
@@ -295,14 +272,7 @@ static void sofef00_panel_remove(struct mipi_dsi_device *dsi) }static const struct of_device_id sofef00_panel_of_match[] = { - {// OnePlus 6 / enchilada - .compatible ="samsung,sofef00" , - .data = &enchilada_panel_mode, - }, - {// OnePlus 6T / fajita - .compatible ="samsung,s6e3fc2x01" , - .data = &fajita_panel_mode, - }, + { .compatible ="samsung,sofef00" }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, sofef00_panel_of_match);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 77/512 drm/bridge: lt9611uxc: Fix an error handling path in lt9611uxc_probe()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit b848cd418aebdb313364b4843f41fae82281a823 ]
If lt9611uxc_audio_init() fails, some resources still need to be released before returning the error code.
Use the existing error handling path.
--- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +5 -1
@@ -879,7 +879,11 @@ static int lt9611uxc_probe(struct i2c_client *client) } } -return lt9611uxc_audio_init (dev, lt9611uxc); + ret =lt9611uxc_audio_init (dev, lt9611uxc); +if (ret) + goto err_remove_bridge; + +return 0 ; err_remove_bridge:free_irq (client->irq, lt9611uxc);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/512 fs/ntfs3: handle hdr_first_de() return value
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Vatoropin <[email protected]>
[ Upstream commit af5cab0e5b6f8edb0be51a9f47f3f620e0b4fd70 ]
The hdr_first_de() function returns a pointer to a struct NTFS_DE. This pointer may be NULL. To handle the NULL error effectively, it is important to implement an error handler. This will help manage potential errors consistently.
Additionally, error handling for the return value already exists at other points where this function is called.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/ntfs3/index.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ntfs3/index.c +8 -0
@@ -2182,6 +2182,10 @@ static int indx_get_entry_to_replace(struct ntfs_index *indx, e =hdr_first_de (&n->index->ihdr);fnd_push (fnd, n, e); +if (!e) { + err = -EINVAL ; + goto out; + }if (!de_is_last (e)) {/*
@@ -2203,6 +2207,10 @@ static int indx_get_entry_to_replace(struct ntfs_index *indx, n = fnd->nodes[level]; te =hdr_first_de (&n->index->ihdr); +if (!te) { + err = -EINVAL ; + goto out; + }/* Copy the candidate entry into the replacement entry buffer. */ re =kmalloc (le16_to_cpu (te->size) +sizeof (u64),GFP_NOFS );if (!re) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/512 fs/ntfs3: Add missing direct_IO in ntfs_aops_cmpr
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lizhi Xu <[email protected]>
[ Upstream commit 8b26c8c376b29cf29710fbfd093df194cefe26ad ]
The ntfs3 can use the page cache directly, so its address_space_operations need direct_IO. Exit ntfs_direct_IO() if it is a compressed file.
--- fs/ntfs3/inode.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/ntfs3/inode.c +5 -0
@@ -805,6 +805,10 @@ static ssize_t ntfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter) ret =0 ; goto out; } +if (is_compressed (ni)) { + ret =0 ; + goto out; + } ret = blockdev_direct_IO(iocb, inode, iter, wr ? ntfs_get_block_direct_IO_W :
@@ -2108,5 +2112,6 @@ const struct address_space_operations ntfs_aops_cmpr = { .read_folio = ntfs_read_folio, .readahead = ntfs_readahead, .dirty_folio = block_dirty_folio, + .direct_IO = ntfs_direct_IO, };// clang-format on
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/512 kunit/usercopy: Disable u64 test on 32-bit SPARC
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <[email protected]>
[ Upstream commit 0d6efa20e384a41a7f4afdcd8a0aec442c19d33e ]
usercopy of 64 bit values does not work on 32-bit SPARC:
# usercopy_test_valid: EXPECTATION FAILED at lib/tests/usercopy_kunit.c:209
Expected val_u64 == 0x5a5b5c5d6a6b6c6d, but
val_u64 == 1515936861 (0x5a5b5c5d)
0x5a5b5c5d6a6b6c6d == 6510899242581322861 (0x5a5b5c5d6a6b6c6d)Disable the test.
--- lib/usercopy_kunit.c | 1 + 1 file changed, 1 insertion(+)
lib/usercopy_kunit.c +1 -0
@@ -27,6 +27,7 @@ !defined(CONFIG_MICROBLAZE) && \ !defined(CONFIG_NIOS2) && \ !defined(CONFIG_PPC32) && \ + !defined(CONFIG_SPARC32) && \ !defined(CONFIG_SUPERH))# define TEST_U64 #endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/512 watchdog: exar: Shorten identity name to fit correctly
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 8e28276a569addb8a2324439ae473848ee52b056 ]
The static initializer for struct watchdog_info::identity is too long and gets initialized without a trailing NUL byte. Since the length of "identity" is part of UAPI and tied to ioctls, just shorten the name of the device. Avoids the warning seen with GCC 15's -Wunterminated-string-initialization option:
drivers/watchdog/exar_wdt.c:224:27: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (33 chars into 32 available) [-Wunterminated-string-initialization]
224 | .identity = "Exar/MaxLinear XR28V38x Watchdog",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- drivers/watchdog/exar_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/exar_wdt.c +1 -1
@@ -221,7 +221,7 @@ static const struct watchdog_info exar_wdt_info = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, - .identity = "Exar/MaxLinear XR28V38x Watchdog", + .identity = "Exar XR28V38x Watchdog", };static const struct watchdog_ops exar_wdt_ops = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 82/512 m68k: mac: Fix macintosh_config for Mac II
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 52ae3f5da7e5adbe3d1319573b55dac470abb83c ]
When booted on my Mac II, the kernel prints this:
Detected Macintosh model: 6
Apple Macintosh Unknown
The catch-all entry ("Unknown") is mac_data_table[0] which is only needed in the unlikely event that the bootinfo model ID can't be matched. When model ID is 6, the search should begin and end at mac_data_table[1]. Fix the off-by-one error that causes this problem.
--- arch/m68k/mac/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/mac/config.c +1 -1
@@ -793,7 +793,7 @@ static void __init mac_identify(void) } macintosh_config = mac_data_table; -for (m = macintosh_config; m->ident !=-1 ; m++) { +for (m = &mac_data_table[1 ]; m->ident !=-1 ; m++) {if (m->ident == model) { macintosh_config = m;break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 83/512 firmware: psci: Fix refcount leak in psci_dt_init
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqian Lin <[email protected]>
[ Upstream commit 7ff37d29fd5c27617b9767e1b8946d115cf93a1e ]
Fix a reference counter leak in psci_dt_init() where of_node_put(np) was missing after of_find_matching_node_and_match() when np is unavailable.
--- drivers/firmware/psci/psci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/firmware/psci/psci.c +3 -1
@@ -759,8 +759,10 @@ int __init psci_dt_init(void) np =of_find_matching_node_and_match (NULL , psci_of_match, &matched_np); -if (!np || !of_device_is_available (np)) +if (!np || !of_device_is_available (np)) { +of_node_put (np);return -ENODEV ; + } init_fn = (psci_initcall_t )matched_np->data; ret =init_fn (np);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/512 arm64: Support ARM64_VA_BITS=52 when setting ARCH_MMAP_RND_BITS_MAX
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kornel Dulęba <[email protected]>
[ Upstream commit f101c56447717c595d803894ba0e215f56c6fba4 ]
When the 52-bit virtual addressing was introduced the select like ARCH_MMAP_RND_BITS_MAX logic was never updated to account for it. Because of that the rnd max bits knob is set to the default value of 18 when ARM64_VA_BITS=52.
Fix this by setting ARCH_MMAP_RND_BITS_MAX to the same value that would be used if 48-bit addressing was used. Higher values can't used here because 52-bit addressing is used only if the caller provides a hint to mmap, with a fallback to 48-bit. The knob in question is an upper bound for what the user can set in /proc/sys/vm/mmap_rnd_bits, which in turn is used to determine how many random bits can be inserted into the base address used for mmap allocations. Since 48-bit allocations are legal with ARM64_VA_BITS=52, we need to make sure that the base address is small enough to facilitate this.
--- arch/arm64/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/Kconfig +3 -3
@@ -322,9 +322,9 @@ config ARCH_MMAP_RND_BITS_MAX default 24 if ARM64_VA_BITS=39 default 27 if ARM64_VA_BITS=42 default 30 if ARM64_VA_BITS=47 - default 29 if ARM64_VA_BITS=48 && ARM64_64K_PAGES - default 31 if ARM64_VA_BITS=48 && ARM64_16K_PAGES - default 33 if ARM64_VA_BITS=48 + default 29 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_64K_PAGES + default 31 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_16K_PAGES + default 33 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) default 14 if ARM64_64K_PAGES default 16 if ARM64_16K_PAGES default 18
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 85/512 arm64/fpsimd: Avoid warning when sve_to_fpsimd() is unused
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit f699c66691fb7e08a5a631c5baf5f2a19b7a6468 ]
Historically fpsimd_to_sve() and sve_to_fpsimd() were (conditionally) called by functions which were defined regardless of CONFIG_ARM64_SVE. Hence it was necessary that both fpsimd_to_sve() and sve_to_fpsimd() were always defined and not guarded by ifdeffery.
As a result of the removal of fpsimd_signal_preserve_current_state() in commit:
929fa99b1215966f ("arm64/fpsimd: signal: Always save+flush state early")
... sve_to_fpsimd() has no callers when CONFIG_ARM64_SVE=n, resulting in a build-time warnign that it is unused:
| arch/arm64/kernel/fpsimd.c:676:13: warning: unused function 'sve_to_fpsimd' [-Wunused-function] | 676 | static void sve_to_fpsimd(struct task_struct *task) | | ^~~~~~~~~~~~~ | 1 warning generated.
In contrast, fpsimd_to_sve() still has callers which are defined when CONFIG_ARM64_SVE=n, and it would be awkward to hide this behind ifdeffery and/or to use stub functions.
For now, suppress the warning by marking both fpsimd_to_sve() and sve_to_fpsimd() as 'static inline', as we usually do for stub functions. The compiler will no longer warn if either function is unused.
Aside from suppressing the warning, there should be no functional change as a result of this patch.
--- arch/arm64/kernel/fpsimd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/kernel/fpsimd.c +2 -2
@@ -651,7 +651,7 @@ static void __fpsimd_to_sve(void *sst, struct user_fpsimd_state const *fst,* task->thread.uw.fpsimd_state must be up to date before calling this * function. */ -static void fpsimd_to_sve (struct task_struct *task) +static inline void fpsimd_to_sve (struct task_struct *task) {unsigned int vq;void *sst = task->thread.sve_state;
@@ -675,7 +675,7 @@ static void fpsimd_to_sve(struct task_struct *task)* bytes of allocated kernel memory. * task->thread.sve_state must be up to date before calling this function. */ -static void sve_to_fpsimd (struct task_struct *task) +static inline void sve_to_fpsimd (struct task_struct *task) {unsigned int vq, vl;void const *sst = task->thread.sve_state;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 86/512 selftests/seccomp: fix syscall_restart test for arm compat
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neill Kapron <[email protected]>
[ Upstream commit 797002deed03491215a352ace891749b39741b69 ]
The inconsistencies in the systcall ABI between arm and arm-compat can can cause a failure in the syscall_restart test due to the logic attempting to work around the differences. The 'machine' field for an ARM64 device running in compat mode can report 'armv8l' or 'armv8b' which matches with the string 'arm' when only examining the first three characters of the string.
This change adds additional validation to the workaround logic to make sure we only take the arm path when running natively, not in arm-compat.
--- tools/testing/selftests/seccomp/seccomp_bpf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
tools/testing/selftests/seccomp/seccomp_bpf.c +5 -2
@@ -3155,12 +3155,15 @@ TEST(syscall_restart) ret =get_syscall (_metadata, child_pid);#if defined(__arm__)/* -* FIXME: * - native ARM registers do NOT expose true syscall. * - compat ARM registers on ARM64 DO expose true syscall. +* - values of utsbuf.machine include 'armv8l' or 'armb8b' +* for ARM64 running in compat mode. */ ASSERT_EQ (0 ,uname (&utsbuf)); -if (strncmp (utsbuf.machine,"arm" ,3 ) ==0 ) { +if ((strncmp (utsbuf.machine,"arm" ,3 ) ==0 ) && + (strncmp (utsbuf.machine,"armv8l" ,6 ) !=0 ) && + (strncmp (utsbuf.machine,"armv8b" ,6 ) !=0 )) {EXPECT_EQ (__NR_nanosleep, ret); } else#endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 87/512 drm/msm/dpu: enable SmartDMA on SM8150
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 6a2343de0b6f70a21bf503ac4688dc905cb068e1 ]
Reworking of the catalog dropped the SmartDMA feature bit on the SM8150 platform. Renable SmartDMA support on this SoC.
Patchwork: https://patchwork.freedesktop.org/patch/650418/
--- .../drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h +8 -8
@@ -76,7 +76,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { { .name = "sspp_0", .id = SSPP_VIG0, .base = 0x4000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 0, .type = SSPP_TYPE_VIG,
@@ -84,7 +84,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_1", .id = SSPP_VIG1, .base = 0x6000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 4, .type = SSPP_TYPE_VIG,
@@ -92,7 +92,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_2", .id = SSPP_VIG2, .base = 0x8000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 8, .type = SSPP_TYPE_VIG,
@@ -100,7 +100,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_3", .id = SSPP_VIG3, .base = 0xa000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 12, .type = SSPP_TYPE_VIG,
@@ -108,7 +108,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_8", .id = SSPP_DMA0, .base = 0x24000, .len = 0x1f0, - .features = DMA_SDM845_MASK, + .features = DMA_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 1, .type = SSPP_TYPE_DMA,
@@ -116,7 +116,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_9", .id = SSPP_DMA1, .base = 0x26000, .len = 0x1f0, - .features = DMA_SDM845_MASK, + .features = DMA_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 5, .type = SSPP_TYPE_DMA,
@@ -124,7 +124,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_10", .id = SSPP_DMA2, .base = 0x28000, .len = 0x1f0, - .features = DMA_CURSOR_SDM845_MASK, + .features = DMA_CURSOR_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 9, .type = SSPP_TYPE_DMA,
@@ -132,7 +132,7 @@ static const struct dpu_sspp_cfg sm8150_sspp[] = { }, { .name = "sspp_11", .id = SSPP_DMA3, .base = 0x2a000, .len = 0x1f0, - .features = DMA_CURSOR_SDM845_MASK, + .features = DMA_CURSOR_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 13, .type = SSPP_TYPE_DMA,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 88/512 drm/msm/dpu: enable SmartDMA on SC8180X
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 8dcccd7a156ffb3157de7f527cc7c6100e9a455a ]
Reworking of the catalog dropped the SmartDMA feature bit on the SC8180X platform. Renable SmartDMA support on this SoC.
Patchwork: https://patchwork.freedesktop.org/patch/650421/
--- .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h +8 -8
@@ -75,7 +75,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { { .name = "sspp_0", .id = SSPP_VIG0, .base = 0x4000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 0, .type = SSPP_TYPE_VIG,
@@ -83,7 +83,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_1", .id = SSPP_VIG1, .base = 0x6000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 4, .type = SSPP_TYPE_VIG,
@@ -91,7 +91,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_2", .id = SSPP_VIG2, .base = 0x8000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 8, .type = SSPP_TYPE_VIG,
@@ -99,7 +99,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_3", .id = SSPP_VIG3, .base = 0xa000, .len = 0x1f0, - .features = VIG_SDM845_MASK, + .features = VIG_SDM845_MASK_SDMA, .sblk = &dpu_vig_sblk_qseed3_1_4, .xin_id = 12, .type = SSPP_TYPE_VIG,
@@ -107,7 +107,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_8", .id = SSPP_DMA0, .base = 0x24000, .len = 0x1f0, - .features = DMA_SDM845_MASK, + .features = DMA_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 1, .type = SSPP_TYPE_DMA,
@@ -115,7 +115,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_9", .id = SSPP_DMA1, .base = 0x26000, .len = 0x1f0, - .features = DMA_SDM845_MASK, + .features = DMA_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 5, .type = SSPP_TYPE_DMA,
@@ -123,7 +123,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_10", .id = SSPP_DMA2, .base = 0x28000, .len = 0x1f0, - .features = DMA_CURSOR_SDM845_MASK, + .features = DMA_CURSOR_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 9, .type = SSPP_TYPE_DMA,
@@ -131,7 +131,7 @@ static const struct dpu_sspp_cfg sc8180x_sspp[] = { }, { .name = "sspp_11", .id = SSPP_DMA3, .base = 0x2a000, .len = 0x1f0, - .features = DMA_CURSOR_SDM845_MASK, + .features = DMA_CURSOR_SDM845_MASK_SDMA, .sblk = &dpu_dma_sblk, .xin_id = 13, .type = SSPP_TYPE_DMA,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 89/512 drm: rcar-du: Fix memory leak in rcar_du_vsps_init()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Biju Das <[email protected]>
[ Upstream commit 91e3bf09a90bb4340c0c3c51396e7531555efda4 ]
The rcar_du_vsps_init() doesn't free the np allocated by of_parse_phandle_with_fixed_args() for the non-error case.
Fix memory leak for the non-error case.
While at it, replace the label 'error'->'done' as it applies to non-error case as well and update the error check condition for rcar_du_vsp_init() to avoid breakage in future, if it returns positive value.
--- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c +4 -6
@@ -705,7 +705,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu) ret =of_parse_phandle_with_fixed_args (np, vsps_prop_name, cells, i, &args);if (ret <0 ) - goto error; + goto done;/* * Add the VSP to the list or update the corresponding existing
@@ -743,13 +743,11 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu) vsp->dev = rcdu; ret =rcar_du_vsp_init (vsp, vsps[i].np, vsps[i].crtcs_mask); -if (ret <0 ) - goto error; +if (ret) + goto done; } -return 0 ; - -error: +done:for (i =0 ; i <ARRAY_SIZE (vsps); ++i)of_node_put (vsps[i].np);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 90/512 drm/vkms: Adjust vkms_state->active_planes allocation type
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 258aebf100540d36aba910f545d4d5ddf4ecaf0b ]
In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.)
The assigned type is "struct vkms_plane_state **", but the returned type will be "struct drm_plane **". These are the same size (pointer size), but the types don't match. Adjust the allocation type to match the assignment.
--- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_crtc.c +1 -1
@@ -198,7 +198,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc, i++; } - vkms_state->active_planes =kcalloc (i,sizeof (plane),GFP_KERNEL ); + vkms_state->active_planes =kcalloc (i,sizeof (*vkms_state->active_planes),GFP_KERNEL );if (!vkms_state->active_planes)return -ENOMEM ; vkms_state->num_active_planes = i;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 91/512 drm/tegra: rgb: Fix the unbound reference count
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Biju Das <[email protected]>
[ Upstream commit 3c3642335065c3bde0742b0edc505b6ea8fdc2b3 ]
The of_get_child_by_name() increments the refcount in tegra_dc_rgb_probe, but the driver does not decrement the refcount during unbind. Fix the unbound reference count using devm_add_action_or_reset() helper.
--- drivers/gpu/drm/tegra/rgb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/tegra/rgb.c +13 -1
@@ -200,6 +200,11 @@ static const struct drm_encoder_helper_funcs tegra_rgb_encoder_helper_funcs = { .atomic_check = tegra_rgb_encoder_atomic_check, }; +static void tegra_dc_of_node_put (void *data) +{ +of_node_put (data); +} +int tegra_dc_rgb_probe (struct tegra_dc *dc) {struct device_node *np;
@@ -207,7 +212,14 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)int err; np =of_get_child_by_name (dc->dev->of_node,"rgb" ); -if (!np || !of_device_is_available (np)) +if (!np) +return -ENODEV ; + + err =devm_add_action_or_reset (dc->dev, tegra_dc_of_node_put, np); +if (err <0 ) +return err; + +if (!of_device_is_available (np))return -ENODEV ; rgb =devm_kzalloc (dc->dev,sizeof (*rgb),GFP_KERNEL );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 92/512 firmware: SDEI: Allow sdei initialization without ACPI_APEI_GHES
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huang Yiwei <[email protected]>
[ Upstream commit 59529bbe642de4eb2191a541d9b4bae7eb73862e ]
SDEI usually initialize with the ACPI table, but on platforms where ACPI is not used, the SDEI feature can still be used to handle specific firmware calls or other customized purposes. Therefore, it is not necessary for ARM_SDE_INTERFACE to depend on ACPI_APEI_GHES.
In commit dc4e8c07e9e2 ("ACPI: APEI: explicit init of HEST and GHES in acpi_init()"), to make APEI ready earlier, sdei_init was moved into acpi_ghes_init instead of being a standalone initcall, adding ACPI_APEI_GHES dependency to ARM_SDE_INTERFACE. This restricts the flexibility and usability of SDEI.
This patch corrects the dependency in Kconfig and splits sdei_init() into two separate functions: sdei_init() and acpi_sdei_init(). sdei_init() will be called by arch_initcall and will only initialize the platform driver, while acpi_sdei_init() will initialize the device from acpi_ghes_init() when ACPI is ready. This allows the initialization of SDEI without ACPI_APEI_GHES enabled.
--- drivers/acpi/apei/Kconfig | 1 + drivers/acpi/apei/ghes.c | 2 +- drivers/firmware/Kconfig | 1 - drivers/firmware/arm_sdei.c | 11 ++++++++--- include/linux/arm_sdei.h | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-)
drivers/acpi/apei/Kconfig +1 -0
@@ -23,6 +23,7 @@ config ACPI_APEI_GHES select ACPI_HED select IRQ_WORK select GENERIC_ALLOCATOR + select ARM_SDE_INTERFACE if ARM64 help Generic Hardware Error Source provides a way to report platform hardware errors (such as that from chipset). It
drivers/acpi/apei/ghes.c +1 -1
@@ -1612,7 +1612,7 @@ void __init acpi_ghes_init(void) {int rc; -sdei_init (); +acpi_sdei_init ();if (acpi_disabled)return ;
drivers/firmware/Kconfig +0 -1
@@ -31,7 +31,6 @@ config ARM_SCPI_PROTOCOL config ARM_SDE_INTERFACE bool "ARM Software Delegated Exception Interface (SDEI)" depends on ARM64 - depends on ACPI_APEI_GHES help The Software Delegated Exception Interface (SDEI) is an ARM standard for registering callbacks from the platform firmware
drivers/firmware/arm_sdei.c +8 -3
@@ -1062,13 +1062,12 @@ static bool __init sdei_present_acpi(void)return true; } -void __init sdei_init (void ) +void __init acpi_sdei_init (void ) {struct platform_device *pdev;int ret; - ret =platform_driver_register (&sdei_driver); -if (ret || !sdei_present_acpi ()) +if (!sdei_present_acpi ())return ; pdev = platform_device_register_simple(sdei_driver.driver.name,
@@ -1081,6 +1080,12 @@ void __init sdei_init(void) } } +static int __init sdei_init (void ) +{ +return platform_driver_register (&sdei_driver); +} +arch_initcall (sdei_init); +int sdei_event_handler (struct pt_regs *regs,struct sdei_registered_event *arg) {
include/linux/arm_sdei.h +2 -2
@@ -46,12 +46,12 @@ int sdei_unregister_ghes(struct ghes *ghes);/* For use by arch code when CPU hotplug notifiers are not appropriate. */ int sdei_mask_local_cpu (void );int sdei_unmask_local_cpu (void ); -void __init sdei_init (void ); +void __init acpi_sdei_init (void );void sdei_handler_abort (void );#else static inline int sdei_mask_local_cpu (void ) {return 0 ; }static inline int sdei_unmask_local_cpu (void ) {return 0 ; } -static inline void sdei_init (void ) { } +static inline void acpi_sdei_init (void ) { }static inline void sdei_handler_abort (void ) { }#endif /* CONFIG_ARM_SDE_INTERFACE */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 93/512 arm64/fpsimd: Do not discard modified SVE state
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 398edaa12f9cf2be7902f306fc023c20e3ebd3e4 ]
Historically SVE state was discarded deterministically early in the syscall entry path, before ptrace is notified of syscall entry. This permitted ptrace to modify SVE state before and after the "real" syscall logic was executed, with the modified state being retained.
This behaviour was changed by commit:
8c845e2731041f0f ("arm64/sve: Leave SVE enabled on syscall if we don't context switch")
That commit was intended to speed up workloads that used SVE by opportunistically leaving SVE enabled when returning from a syscall. The syscall entry logic was modified to truncate the SVE state without disabling userspace access to SVE, and fpsimd_save_user_state() was modified to discard userspace SVE state whenever in_syscall(current_pt_regs()) is true, i.e. when current_pt_regs()->syscallno != NO_SYSCALL.
Leaving SVE enabled opportunistically resulted in a couple of changes to userspace visible behaviour which weren't described at the time, but are logical consequences of opportunistically leaving SVE enabled:
* Signal handlers can observe the type of saved state in the signal's sve_context record. When the kernel only tracks FPSIMD state, the 'vq' field is 0 and there is no space allocated for register contents. When the kernel tracks SVE state, the 'vq' field is non-zero and the register contents are saved into the record.
As a result of the above commit, 'vq' (and the presence of SVE register state) is non-deterministically zero or non-zero for a period of time after a syscall. The effective register state is still deterministic.
Hopefully no-one relies on this being deterministic. In general, handlers for asynchronous events cannot expect a deterministic state.
* Similarly to signal handlers, ptrace requests can observe the type of saved state in the NT_ARM_SVE and NT_ARM_SSVE regsets, as this is exposed in the header flags. As a result of the above commit, this is now in a non-deterministic state after a syscall. The effective register state is still deterministic.
Hopefully no-one relies on this being deterministic. In general, debuggers would have to handle this changing at arbitrary points during program flow.
Discarding the SVE state within fpsimd_save_user_state() resulted in other changes to userspace visible behaviour which are not desirable:
* A ptrace tracer can modify (or create) a tracee's SVE state at syscall entry or syscall exit. As a result of the above commit, the tracee's SVE state can be discarded non-deterministically after modification, rather than being retained as it previously was.
Note that for co-operative tracer/tracee pairs, the tracer may (re)initialise the tracee's state arbitrarily after the tracee sends itself an initial SIGSTOP via a syscall, so this affects realistic design patterns.
* The current_pt_regs()->syscallno field can be modified via ptrace, and can be altered even when the tracee is not really in a syscall, causing non-deterministic discarding to occur in situations where this was not previously possible.
Further, using current_pt_regs()->syscallno in this way is unsound:
* There are data races between readers and writers of the current_pt_regs()->syscallno field.
The current_pt_regs()->syscallno field is written in interruptible task context using plain C accesses, and is read in irq/softirq context using plain C accesses. These accesses are subject to data races, with the usual concerns with tearing, etc.
* Writes to current_pt_regs()->syscallno are subject to compiler reordering.
As current_pt_regs()->syscallno is written with plain C accesses, the compiler is free to move those writes arbitrarily relative to anything which doesn't access the same memory location.
In theory this could break signal return, where prior to restoring the SVE state, restore_sigframe() calls forget_syscall(). If the write were hoisted after restore of some SVE state, that state could be discarded unexpectedly.
In practice that reordering cannot happen in the absence of LTO (as cross compilation-unit function calls happen prevent this reordering), and that reordering appears to be unlikely in the presence of LTO.
Additionally, since commit:
f130ac0ae4412dbe ("arm64: syscall: unmask DAIF earlier for SVCs")
... DAIF is unmasked before el0_svc_common() sets regs->syscallno to the real syscall number. Consequently state may be saved in SVE format prior to this point.
Considering all of the above, current_pt_regs()->syscallno should not be used to infer whether the SVE state can be discarded. Luckily we can instead use cpu_fp_state::to_save to track when it is safe to discard the SVE state:
* At syscall entry, after the live SVE register state is truncated, set cpu_fp_state::to_save to FP_STATE_FPSIMD to indicate that only the FPSIMD portion is live and needs to be saved.
* At syscall exit, once the task's state is guaranteed to be live, set cpu_fp_state::to_save to FP_STATE_CURRENT to indicate that TIF_SVE must be considered to determine which state needs to be saved.
* Whenever state is modified, it must be saved+flushed prior to manipulation. The state will be truncated if necessary when it is saved, and reloading the state will set fp_state::to_save to FP_STATE_CURRENT, preventing subsequent discarding.
This permits SVE state to be discarded *only* when it is known to have been truncated (and the non-FPSIMD portions must be zero), and ensures that SVE state is retained after it is explicitly modified.
For backporting, note that this fix depends on the following commits:
* b2482807fbd4 ("arm64/sme: Optimise SME exit on syscall entry")
* f130ac0ae441 ("arm64: syscall: unmask DAIF earlier for SVCs")
* 929fa99b1215 ("arm64/fpsimd: signal: Always save+flush state early")
--- arch/arm64/include/asm/fpsimd.h | 3 +++ arch/arm64/kernel/entry-common.c | 46 ++++++++++++++++++++++++-------- arch/arm64/kernel/fpsimd.c | 15 ++++++----- 3 files changed, 47 insertions(+), 17 deletions(-)
arch/arm64/include/asm/fpsimd.h +3 -0
@@ -6,6 +6,7 @@#define __ASM_FP_H#include <asm/errno.h> +#include <asm/percpu.h> #include <asm/ptrace.h> #include <asm/processor.h> #include <asm/sigcontext.h>
@@ -94,6 +95,8 @@ struct cpu_fp_state {enum fp_type to_save; }; +DECLARE_PER_CPU(struct cpu_fp_state, fpsimd_last_state); +extern void fpsimd_bind_state_to_cpu (struct cpu_fp_state *fp_state);extern void fpsimd_flush_task_state (struct task_struct *target);
arch/arm64/kernel/entry-common.c +35 -11
71 lines not on this page · raw message
arch/arm64/kernel/fpsimd.c +9 -6
@@ -119,7 +119,7 @@* whatever is in the FPSIMD registers is not saved to memory, but discarded. */ -static DEFINE_PER_CPU(struct cpu_fp_state, fpsimd_last_state); +DEFINE_PER_CPU(struct cpu_fp_state, fpsimd_last_state); __ro_after_init struct vl_info vl_info[ARM64_VEC_MAX] = {#ifdef CONFIG_ARM64_SVE
@@ -453,12 +453,15 @@ static void fpsimd_save_user_state(void) *(last->fpmr) =read_sysreg_s (SYS_FPMR );/* -* If a task is in a syscall the ABI allows us to only -* preserve the state shared with FPSIMD so don't bother -* saving the full SVE state in that case. +* Save SVE state if it is live. +* +* The syscall ABI discards live SVE state at syscall entry. When +* entering a syscall, fpsimd_syscall_enter() sets to_save to +* FP_STATE_FPSIMD to allow the SVE state to be lazily discarded until +* either new SVE state is loaded+bound or fpsimd_syscall_exit() is +* called prior to a return to userspace. */ -if ((last->to_save ==FP_STATE_CURRENT &&test_thread_flag (TIF_SVE ) && - !in_syscall (current_pt_regs ())) || +if ((last->to_save ==FP_STATE_CURRENT &&test_thread_flag (TIF_SVE )) || last->to_save ==FP_STATE_SVE ) { save_sve_regs = true; save_ffr = true;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/512 overflow: Fix direct struct member initialization in _DEFINE_FLEX()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
[ Upstream commit 47e36ed7840661a9f7fb53554a1b04a5f8daffea ]
Currently, to statically initialize the struct members of the type object created by _DEFINE_FLEX(), the internal obj member must be explicitly referenced at the call site. See:
struct flex {
int a;
int b;
struct foo flex_array[];
};_DEFINE_FLEX(struct flex, instance, flex_array,
FIXED_SIZE, = {
.obj = {
.a = 0,
.b = 1,
},
});This leaks _DEFINE_FLEX() internal implementation details and make the helper harder to use and read.
Fix this and allow for a more natural and intuitive C99 init-style:
_DEFINE_FLEX(struct flex, instance, flex_array,
FIXED_SIZE, = {
.a = 0,
.b = 1,
});Note that before these changes, the initializer argument was optional, but now it's required.
Also, update "counter" member initialization in DEFINE_FLEX().
--- include/linux/overflow.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/overflow.h +3 -3
@@ -396,7 +396,7 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend)* @name: Name for a variable to define. * @member: Name of the array member. * @count: Number of elements in the array; must be compile-time const. -* @initializer: initializer expression (could be empty for no init). +* @initializer: Initializer expression (e.g., pass `= { }` at minimum). */ #define _DEFINE_FLEX(type, name, member, count, initializer...) \ _Static_assert(__builtin_constant_p(count), \
@@ -404,7 +404,7 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend)union { \u8 bytes[struct_size_t (type, member, count)]; \type obj; \ - } name##_u initializer; \ + } name##_u = { .obj initializer }; \ type *name = (type *)&name##_u/**
@@ -438,6 +438,6 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend)* Use __struct_size(@NAME) to get compile-time size of it afterwards. */ #define DEFINE_FLEX (TYPE ,NAME ,MEMBER ,COUNTER ,COUNT ) \ - _DEFINE_FLEX(TYPE, NAME, MEMBER, COUNT, = { .obj.COUNTER = COUNT, }) + _DEFINE_FLEX(TYPE, NAME, MEMBER, COUNT, = { .COUNTER = COUNT, })#endif /* __LINUX_OVERFLOW_H */
Signature · 1 line
2.39.5
Re: [PATCH 6.12 094/512] overflow: Fix direct struct member initialization in _DEFINE_FLEX()
Hi!
Quoted 22 lines
From: Gustavo A. R. Silva <[email protected]>
[ Upstream commit
47e36ed7840661a9f7fb53554a1b04a5f8daffea]Currently, to statically initialize the struct members of the
typeobject created by_DEFINE_FLEX(), the internalobjmember must be explicitly referenced at the call site. See:struct flex { int a; int b; struct foo flex_array[]; };_DEFINE_FLEX(struct flex, instance,
flex_array,FIXED_SIZE, = { .obj = { .a = 0, .b = 1, }, });
Quoted 2 lines
This leaks
_DEFINE_FLEX()internal implementation details and make the helper harder to use and read.
Not sure why this was selected for -stable.
BR,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Greg Kroah-Hartman
maintainerPATCH 95/512 scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit d8720235d5b5cad86c1f07f65117ef2a96f8bec7 ]
Recent fixes to the randstruct GCC plugin allowed it to notice that this structure is entirely function pointers and is therefore subject to randomization, but doing so requires that it always use designated initializers. Explicitly specify the "common" member as being initialized. Silences:
drivers/scsi/qedf/qedf_main.c:702:9: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
702 | {
| ^--- drivers/scsi/qedf/qedf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qedf/qedf_main.c +1 -1
@@ -699,7 +699,7 @@ static u32 qedf_get_login_failures(void *cookie) }static struct qed_fcoe_cb_ops qedf_cb_ops = { - { + .common = { .link_update = qedf_link_update, .bw_update = qedf_bw_update, .schedule_recovery_handler = qedf_schedule_recovery_handler,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 96/512 perf/amlogic: Replace smp_processor_id() with raw_smp_processor_id() in meson_ddr_pmu_create()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anand Moon <[email protected]>
[ Upstream commit 097469a2b0f12b91b4f27b9e9e4f2c46484cde30 ]
The Amlogic DDR PMU driver meson_ddr_pmu_create() function incorrectly uses smp_processor_id(), which assumes disabled preemption. This leads to kernel warnings during module loading because meson_ddr_pmu_create() can be called in a preemptible context.
Following kernel warning and stack trace:
[ 31.745138] [ T2289] BUG: using smp_processor_id() in preemptible [00000000] code: (udev-worker)/2289 [ 31.745154] [ T2289] caller is debug_smp_processor_id+0x28/0x38 [ 31.745172] [ T2289] CPU: 4 UID: 0 PID: 2289 Comm: (udev-worker) Tainted: GW 6.14.0-0-MANJARO-ARM #1 59519addcbca6ba8de735e151fd7b9e97aac7ff0 [ 31.745181] [ T2289] Tainted: [W]=WARN [ 31.745183] [ T2289] Hardware name: Hardkernel ODROID-N2Plus (DT) [ 31.745188] [ T2289] Call trace: [ 31.745191] [ T2289] show_stack+0x28/0x40 (C) [ 31.745199] [ T2289] dump_stack_lvl+0x4c/0x198 [ 31.745205] [ T2289] dump_stack+0x20/0x50 [ 31.745209] [ T2289] check_preemption_disabled+0xec/0xf0 [ 31.745213] [ T2289] debug_smp_processor_id+0x28/0x38 [ 31.745216] [ T2289] meson_ddr_pmu_create+0x200/0x560 [meson_ddr_pmu_g12 8095101c49676ad138d9961e3eddaee10acca7bd] [ 31.745237] [ T2289] g12_ddr_pmu_probe+0x20/0x38 [meson_ddr_pmu_g12 8095101c49676ad138d9961e3eddaee10acca7bd] [ 31.745246] [ T2289] platform_probe+0x98/0xe0 [ 31.745254] [ T2289] really_probe+0x144/0x3f8 [ 31.745258] [ T2289] __driver_probe_device+0xb8/0x180 [ 31.745261] [ T2289] driver_probe_device+0x54/0x268 [ 31.745264] [ T2289] __driver_attach+0x11c/0x288 [ 31.745267] [ T2289] bus_for_each_dev+0xfc/0x160 [ 31.745274] [ T2289] driver_attach+0x34/0x50 [ 31.745277] [ T2289] bus_add_driver+0x160/0x2b0 [ 31.745281] [ T2289] driver_register+0x78/0x120 [ 31.745285] [ T2289] __platform_driver_register+0x30/0x48 [ 31.745288] [ T2289] init_module+0x30/0xfe0 [meson_ddr_pmu_g12 8095101c49676ad138d9961e3eddaee10acca7bd] [ 31.745298] [ T2289] do_one_initcall+0x11c/0x438 [ 31.745303] [ T2289] do_init_module+0x68/0x228 [ 31.745311] [ T2289] load_module+0x118c/0x13a8 [ 31.745315] [ T2289] __arm64_sys_finit_module+0x274/0x390 [ 31.745320] [ T2289] invoke_syscall+0x74/0x108 [ 31.745326] [ T2289] el0_svc_common+0x90/0xf8 [ 31.745330] [ T2289] do_el0_svc+0x2c/0x48 [ 31.745333] [ T2289] el0_svc+0x60/0x150 [ 31.745337] [ T2289] el0t_64_sync_handler+0x80/0x118 [ 31.745341] [ T2289] el0t_64_sync+0x1b8/0x1c0
Changes replaces smp_processor_id() with raw_smp_processor_id() to ensure safe CPU ID retrieval in preemptible contexts.
--- drivers/perf/amlogic/meson_ddr_pmu_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/amlogic/meson_ddr_pmu_core.c +1 -1
@@ -511,7 +511,7 @@ int meson_ddr_pmu_create(struct platform_device *pdev)fmt_attr_fill (pmu->info.hw_info->fmt_attr); - pmu->cpu =smp_processor_id (); + pmu->cpu =raw_smp_processor_id (); name =devm_kasprintf (&pdev->dev,GFP_KERNEL ,DDR_PERF_DEV_NAME );if (!name)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 97/512 selftests/seccomp: fix negative_ENOSYS tracer tests on arm32
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Terry Tritton <[email protected]>
[ Upstream commit 73989c998814d82c71d523c104c398925470d59e ]
TRACE_syscall.ptrace.negative_ENOSYS and TRACE_syscall.seccomp.negative_ENOSYS on arm32 are being reported as failures instead of skipping.
The teardown_trace_fixture function sets the test to KSFT_FAIL in case of a non 0 return value from the tracer process.
Due to _metadata now being shared between the forked processes the tracer is returning the KSFT_SKIP value set by the tracee which is non 0.
Remove the setting of the _metadata.exit_code in teardown_trace_fixture.
--- tools/testing/selftests/seccomp/seccomp_bpf.c | 6 ------ 1 file changed, 6 deletions(-)
tools/testing/selftests/seccomp/seccomp_bpf.c +0 -6
@@ -1618,14 +1618,8 @@ void teardown_trace_fixture(struct __test_metadata *_metadata, {if (tracer) {int status; -/* -* Extract the exit code from the other process and -* adopt it for ourselves in case its asserts failed. -*/ ASSERT_EQ (0 ,kill (tracer,SIGUSR1 ));ASSERT_EQ (tracer,waitpid (tracer, &status,0 )); -if (WEXITSTATUS (status)) - _metadata->exit_code =KSFT_FAIL ; } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 98/512 drm/msm/a6xx: Disable rgb565_predicator on Adreno 7c3
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <[email protected]>
[ Upstream commit 5a9c1bea011fb42088ba08ceaa252fb20e695626 ]
This feature is supposed to be enabled with UBWC v4 or later. Implementations of this SKU feature an effective UBWC version of 3, so disable it, in line with the BSP kernel.
Patchwork: https://patchwork.freedesktop.org/patch/651759/
--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +0 -1
@@ -554,7 +554,6 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu)if (adreno_is_7c3 (gpu)) { gpu->ubwc_config.highest_bank_bit =14 ; gpu->ubwc_config.amsbc =1 ; - gpu->ubwc_config.rgb565_predicator =1 ; gpu->ubwc_config.uavflagprd_inv =2 ; gpu->ubwc_config.macrotile_mode =1 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 99/512 drm/mediatek: mtk_drm_drv: Fix kobject put for mtk_mutex device ptr
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 22918591fb747a6d16801e74a170cf98e886f83b ]
This driver is taking a kobject for mtk_mutex only once per mmsys device for each drm-mediatek driver instance, differently from the behavior with other components, but it is decrementing the kobj's refcount in a loop and once per mmsys: this is not right and will result in a refcount_t underflow warning when mediatek-drm returns multiple probe deferrals in one boot (or when manually bound and unbound).
Besides that, the refcount for mutex_dev was not decremented for error cases in mtk_drm_bind(), causing another refcount_t warning but this time for overflow, when the failure happens not during driver bind but during component bind.
In order to fix one of the reasons why this is happening, remove the put_device(xx->mutex_dev) loop from the mtk_drm_kms_init()'s put_mutex_dev label (and drop the label) and add a single call to correctly free the single incremented refcount of mutex_dev to the mtk_drm_unbind() function to fix the refcount_t underflow.
Moreover, add the same call to the error cases in mtk_drm_bind() to fix the refcount_t overflow.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +10 -7
@@ -463,7 +463,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) ret =drmm_mode_config_init (drm);if (ret) - goto put_mutex_dev; +return ret; drm->mode_config.min_width =64 ; drm->mode_config.min_height =64 ;
@@ -482,7 +482,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) drm->dev_private = private->all_drm_private[i]; ret =component_bind_all (private->all_drm_private[i]->dev, drm);if (ret) - goto put_mutex_dev; +return ret; }/*
@@ -575,9 +575,6 @@ static int mtk_drm_kms_init(struct drm_device *drm) err_component_unbind:for (i =0 ; i < private->data->mmsys_dev_num; i++)component_unbind_all (private->all_drm_private[i]->dev, drm); -put_mutex_dev: -for (i =0 ; i < private->data->mmsys_dev_num; i++) -put_device (private->all_drm_private[i]->mutex_dev);return ret; }
@@ -648,8 +645,10 @@ static int mtk_drm_bind(struct device *dev)return 0 ; drm =drm_dev_alloc (&mtk_drm_driver, dev); -if (IS_ERR (drm)) -return PTR_ERR (drm); +if (IS_ERR (drm)) { + ret =PTR_ERR (drm); + goto err_put_dev; + } private->drm_master = true; drm->dev_private = private;
@@ -675,6 +674,8 @@ static int mtk_drm_bind(struct device *dev)drm_dev_put (drm);for (i =0 ; i < private->data->mmsys_dev_num; i++) private->all_drm_private[i]->drm =NULL ; +err_put_dev: +put_device (private->mutex_dev);return ret; }
@@ -687,6 +688,8 @@ static void mtk_drm_unbind(struct device *dev)drm_dev_unregister (private->drm);mtk_drm_kms_deinit (private->drm);drm_dev_put (private->drm); + +put_device (private->mutex_dev); } private->mtk_drm_bound = false; private->drm_master = false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 100/512 drm/mediatek: Fix kobject put for component sub-drivers
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 80805b62ea5b95eda54c225b989f929ca0691ab0 ]
In function mtk_drm_get_all_drm_priv(), this driver is incrementing the refcount for the sub-drivers of mediatek-drm with a call to device_find_child() when taking a reference to all of those child devices.
When the component bind fails multiple times this results in a refcount_t overflow, as the reference count is never decremented:
fix that by adding a call to put_device() for all of the mmsys devices in a loop, in error cases of mtk_drm_bind() and in the mtk_drm_unbind() callback.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +9 -0
@@ -675,6 +675,10 @@ static int mtk_drm_bind(struct device *dev)for (i =0 ; i < private->data->mmsys_dev_num; i++) private->all_drm_private[i]->drm =NULL ; err_put_dev: +for (i =0 ; i < private->data->mmsys_dev_num; i++) { +/* For device_find_child in mtk_drm_get_all_priv() */ +put_device (private->all_drm_private[i]->dev); + }put_device (private->mutex_dev);return ret; }
@@ -682,6 +686,7 @@ static int mtk_drm_bind(struct device *dev)static void mtk_drm_unbind (struct device *dev) {struct mtk_drm_private *private =dev_get_drvdata (dev); +int i;/* for multi mmsys dev, unregister drm dev in mmsys master */ if (private->drm_master) {
@@ -689,6 +694,10 @@ static void mtk_drm_unbind(struct device *dev)mtk_drm_kms_deinit (private->drm);drm_dev_put (private->drm); +for (i =0 ; i < private->data->mmsys_dev_num; i++) { +/* For device_find_child in mtk_drm_get_all_priv() */ +put_device (private->all_drm_private[i]->dev); + }put_device (private->mutex_dev); } private->mtk_drm_bound = false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 101/512 drm/mediatek: mtk_drm_drv: Unbind secondary mmsys components on err
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 94c933716567084bfb9e79dcd81eb2b2308e84e1 ]
When calling component_bind_all(), if a component that is included in the list fails, all of those that have been successfully bound will be unbound, but this driver has two components lists for two actual devices, as in, each mmsys instance has its own components list.
In case mmsys0 (or actually vdosys0) is able to bind all of its components, but the secondary one fails, all of the components of the first are kept bound, while the ones of mmsys1/vdosys1 are correctly cleaned up.
This is not right because, in case of a failure, the components are re-bound for all of the mmsys/vdosys instances without caring about the ones that were previously left in a bound state.
Fix that by calling component_unbind_all() on all of the previous component masters that succeeded binding all subdevices when any of the other masters errors out.
--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +4 -1
@@ -481,8 +481,11 @@ static int mtk_drm_kms_init(struct drm_device *drm)for (i =0 ; i < private->data->mmsys_dev_num; i++) { drm->dev_private = private->all_drm_private[i]; ret =component_bind_all (private->all_drm_private[i]->dev, drm); -if (ret) +if (ret) { +while (--i >=0 ) +component_unbind_all (private->all_drm_private[i]->dev, drm);return ret; + } }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 102/512 media: verisilicon: Free post processor buffers on error
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Detlev Casanova <[email protected]>
[ Upstream commit 11beb0fc346e00c412b3bfd19013206f6b655604 ]
During initialization, the post processor allocates the same number of buffers as the buf queue.
As the init function is called in streamon(), if an allocation fails, streamon will return an error and streamoff() will not be called, keeping all post processor buffers allocated.
To avoid that, all post proc buffers are freed in case of an allocation error.
--- drivers/media/platform/verisilicon/hantro_postproc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/verisilicon/hantro_postproc.c +3 -1
@@ -260,8 +260,10 @@ int hantro_postproc_init(struct hantro_ctx *ctx)for (i =0 ; i < num_buffers; i++) { ret =hantro_postproc_alloc (ctx, i); -if (ret) +if (ret) { +hantro_postproc_free (ctx);return ret; + } }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 103/512 svcrdma: Reduce the number of rdma_rw contexts per-QP
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
[ Upstream commit 59243315890578a040a2d50ae9e001a2ef2fcb62 ]
There is an upper bound on the number of rdma_rw contexts that can be created per QP.
This invisible upper bound is because rdma_create_qp() adds one or more additional SQEs for each ctxt that the ULP requests via qp_attr.cap.max_rdma_ctxs. The QP's actual Send Queue length is on the order of the sum of qp_attr.cap.max_send_wr and a factor times qp_attr.cap.max_rdma_ctxs. The factor can be up to three, depending on whether MR operations are required before RDMA Reads.
This limit is not visible to RDMA consumers via dev->attrs. When the limit is surpassed, QP creation fails with -ENOMEM. For example:
svcrdma's estimate of the number of rdma_rw contexts it needs is three times the number of pages in RPCSVC_MAXPAGES. When MAXPAGES is about 260, the internally-computed SQ length should be:
64 credits + 10 backlog + 3 * (3 * 260) = 2414
Which is well below the advertised qp_max_wr of 32768.
If RPCSVC_MAXPAGES is increased to 4MB, that's 1040 pages:
64 credits + 10 backlog + 3 * (3 * 1040) = 9434
However, QP creation fails. Dynamic printk for mlx5 shows:
calc_sq_size:618:(pid 1514): send queue size (9326 * 256 / 64 -> 65536) exceeds limits(32768)
Although 9326 is still far below qp_max_wr, QP creation still fails.
Because the total SQ length calculation is opaque to RDMA consumers, there doesn't seem to be much that can be done about this except for consumers to try to keep the requested rdma_rw ctxt count low.
--- net/sunrpc/xprtrdma/svc_rdma_transport.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_transport.c +8 -6
@@ -406,12 +406,12 @@ static void svc_rdma_xprt_done(struct rpcrdma_notification *rn)*/ static struct svc_xprt *svc_rdma_accept (struct svc_xprt *xprt) { +unsigned int ctxts, rq_depth, maxpayload;struct svcxprt_rdma *listen_rdma;struct svcxprt_rdma *newxprt =NULL ;struct rdma_conn_param conn_param;struct rpcrdma_connect_private pmsg;struct ib_qp_init_attr qp_attr; -unsigned int ctxts, rq_depth;struct ib_device *dev;int ret =0 ; RPC_IFDEBUG(struct sockaddr *sap);
@@ -462,12 +462,14 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) newxprt->sc_max_bc_requests =2 ; } -/* Arbitrarily estimate the number of rw_ctxs needed for -* this transport. This is enough rw_ctxs to make forward -* progress even if the client is using one rkey per page -* in each Read chunk. +/* Arbitrary estimate of the needed number of rdma_rw contexts. */ - ctxts =3 *RPCSVC_MAXPAGES ; + maxpayload =min (xprt->xpt_server->sv_max_payload, +RPCSVC_MAXPAYLOAD_RDMA ); + ctxts = newxprt->sc_max_requests *3 * +rdma_rw_mr_factor (dev, newxprt->sc_port_num, + maxpayload >>PAGE_SHIFT ); + newxprt->sc_sq_depth = rq_depth + ctxts;if (newxprt->sc_sq_depth > dev->attrs.max_qp_wr) newxprt->sc_sq_depth = dev->attrs.max_qp_wr;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 104/512 xen/x86: fix initial memory balloon target
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Pau Monne <[email protected]>
[ Upstream commit 74287971dbb3fe322bb316afd9e7fb5807e23bee ]
When adding extra memory regions as ballooned pages also adjust the balloon target, otherwise when the balloon driver is started it will populate memory to match the target value and consume all the extra memory regions added.
This made the usage of the Xen dom0_mem=,max: command line parameter for dom0 not work as expected, as the target won't be adjusted and when the balloon is started it will populate memory straight to the 'max:' value. It would equally affect domUs that have memory != maxmem.
Kernels built with CONFIG_XEN_UNPOPULATED_ALLOC are not affected, because the extra memory regions are consumed by the unpopulated allocation driver, and then balloon_add_regions() becomes a no-op.
Message-ID: <[email protected]>
--- drivers/xen/balloon.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/xen/balloon.c +8 -5
@@ -700,15 +700,18 @@ static int __init balloon_add_regions(void)/* * Extra regions are accounted for in the physmap, but need -* decreasing from current_pages to balloon down the initial -* allocation, because they are already accounted for in -* total_pages. +* decreasing from current_pages and target_pages to balloon +* down the initial allocation, because they are already +* accounted for in total_pages. */ -if (extra_pfn_end - start_pfn >= balloon_stats.current_pages) { + pages = extra_pfn_end - start_pfn; +if (pages >= balloon_stats.current_pages || + pages >= balloon_stats.target_pages) {WARN (1 ,"Extra pages underflow current target" );return -ERANGE ; } - balloon_stats.current_pages -= extra_pfn_end - start_pfn; + balloon_stats.current_pages -= pages; + balloon_stats.target_pages -= pages; }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 105/512 wifi: ath11k: fix node corruption in ar->arvifs list
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stone Zhang <[email protected]>
[ Upstream commit 31e98e277ae47f56632e4d663b1d4fd12ba33ea8 ]
In current WLAN recovery code flow, ath11k_core_halt() only reinitializes the "arvifs" list head. This will cause the list node immediately following the list head to become an invalid list node. Because the prev of that node still points to the list head "arvifs", but the next of the list head "arvifs" no longer points to that list node.
When a WLAN recovery occurs during the execution of a vif removal, and it happens before the spin_lock_bh(&ar->data_lock) in ath11k_mac_op_remove_interface(), list_del() will detect the previously mentioned situation, thereby triggering a kernel panic.
The fix is to remove and reinitialize all vif list nodes from the list head "arvifs" during WLAN halt. The reinitialization is to make the list nodes valid, ensuring that the list_del() in ath11k_mac_op_remove_interface() can execute normally.
Call trace: __list_del_entry_valid_or_report+0xb8/0xd0 ath11k_mac_op_remove_interface+0xb0/0x27c [ath11k] drv_remove_interface+0x48/0x194 [mac80211] ieee80211_do_stop+0x6e0/0x844 [mac80211] ieee80211_stop+0x44/0x17c [mac80211] __dev_close_many+0xac/0x150 __dev_change_flags+0x194/0x234 dev_change_flags+0x24/0x6c devinet_ioctl+0x3a0/0x670 inet_ioctl+0x200/0x248 sock_do_ioctl+0x60/0x118 sock_ioctl+0x274/0x35c __arm64_sys_ioctl+0xac/0xf0 invoke_syscall+0x48/0x114
...
Tested-on: QCA6698AQ hw2.1 PCI WLAN.HSP.1.1-04591-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
--- drivers/net/wireless/ath/ath11k/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/core.c +7 -1
@@ -1915,6 +1915,7 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)void ath11k_core_halt (struct ath11k *ar) {struct ath11k_base *ab = ar->ab; +struct list_head *pos, *n;lockdep_assert_held (&ar->conf_mutex);
@@ -1929,7 +1930,12 @@ void ath11k_core_halt(struct ath11k *ar)rcu_assign_pointer (ab->pdevs_active[ar->pdev_idx],NULL );synchronize_rcu (); -INIT_LIST_HEAD (&ar->arvifs); + +spin_lock_bh (&ar->data_lock); +list_for_each_safe (pos, n, &ar->arvifs) +list_del_init (pos); +spin_unlock_bh (&ar->data_lock); +idr_init (&ar->txmgmt_idr); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 106/512 wifi: ath12k: Fix memory leak during vdev_id mismatch
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: P Praneesh <[email protected]>
[ Upstream commit 75ec94db880b1e4b4f9182885d60db0db6e2ee56 ]
Currently driver enables vdev_id check as part of the bank configuration in ath12k_dp_tx_get_vdev_bank_config(). This check ensures that the vdev_id configured in the bank register aligns with the vdev_id in the packet's address search table within the firmware. If there is a mismatch, the firmware forwards the packet with the HTT status HAL_WBM_REL_HTT_TX_COMP_STATUS_VDEVID_MISMATCH. Since driver does not handle this vdev_id mismatch HTT status, the corresponding buffers are not freed properly, causing a memory leak. Fix this issue by adding handling to free the buffers when a vdev_id mismatch HTT status is encountered.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-
--- drivers/net/wireless/ath/ath12k/dp_tx.c | 1 + drivers/net/wireless/ath/ath12k/hal_desc.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/dp_tx.c +1 -0
@@ -566,6 +566,7 @@ ath12k_dp_tx_process_htt_tx_complete(struct ath12k_base *ab,case HAL_WBM_REL_HTT_TX_COMP_STATUS_TTL :case HAL_WBM_REL_HTT_TX_COMP_STATUS_REINJ :case HAL_WBM_REL_HTT_TX_COMP_STATUS_INSPECT : +case HAL_WBM_REL_HTT_TX_COMP_STATUS_VDEVID_MISMATCH :ath12k_dp_tx_free_txbuf (ab, msdu, mac_id, tx_ring);break ;case HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY :
drivers/net/wireless/ath/ath12k/hal_desc.h +2 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2022, 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include "core.h"
@@ -1296,6 +1296,7 @@ enum hal_wbm_htt_tx_comp_status {HAL_WBM_REL_HTT_TX_COMP_STATUS_REINJ ,HAL_WBM_REL_HTT_TX_COMP_STATUS_INSPECT ,HAL_WBM_REL_HTT_TX_COMP_STATUS_MEC_NOTIFY , +HAL_WBM_REL_HTT_TX_COMP_STATUS_VDEVID_MISMATCH , HAL_WBM_REL_HTT_TX_COMP_STATUS_MAX, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 107/512 wifi: ath12k: Fix invalid memory access while forming 802.11 header
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: P Praneesh <[email protected]>
[ Upstream commit be908d2360341f8bbc982fff5a5e4f8030c17f74 ]
While forming the 802.11 header from the rx descriptor, skb_push() is performed for the 802.11 header length and then calls ath12k_dp_rx_desc_get_dot11_hdr(). Since skb_push() moves the skb->data pointer backwards by the 802.11 header length, the rx descriptor points to a different memory area than intended, causing invalid information to be fetched from the rx descriptor.
Also, when IV and ICV are not stripped from the given MSDU, mac80211 performs PN validation for these MSDUs, which requires the crypto header. Before forming the crypto header from the given rx descriptor, skb_push() is performed for the crypto header length, which overwrites the memory pointed to by the rx descriptor, causing invalid information to form the 802.11 header.
Fix these issues by moving all rx descriptor accesses before the skb_push() operation which ensures the proper 802.11 headers are generated from the given rx descriptor and removing ath12k_dp_rxdesc_get_mpdu_frame_ctrl() for filling frame control, as this information is already fetched by ath12k_dp_rx_desc_get_dot11_hdr().
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/dp_rx.c | 27 +++++++++---------------- drivers/net/wireless/ath/ath12k/hal.c | 19 ----------------- drivers/net/wireless/ath/ath12k/hal.h | 1 - 3 files changed, 9 insertions(+), 38 deletions(-)
drivers/net/wireless/ath/ath12k/dp_rx.c +9 -18
@@ -228,12 +228,6 @@ static void ath12k_dp_rx_desc_get_crypto_header(struct ath12k_base *ab, ab->hal_rx_ops->rx_desc_get_crypto_header (desc, crypto_hdr, enctype); } -static u16 ath12k_dp_rxdesc_get_mpdu_frame_ctrl (struct ath12k_base *ab, -struct hal_rx_desc *desc) -{ -return ab->hal_rx_ops->rx_desc_get_mpdu_frame_ctl (desc); -} -static inline u8 ath12k_dp_rx_get_msdu_src_link (struct ath12k_base *ab,struct hal_rx_desc *desc) {
@@ -2067,10 +2061,13 @@ static void ath12k_get_dot11_hdr_from_rx_desc(struct ath12k *ar,struct hal_rx_desc *rx_desc = rxcb->rx_desc;struct ath12k_base *ab = ar->ab;size_t hdr_len, crypto_len; -struct ieee80211_hdr *hdr; +struct ieee80211_hdr hdr;u16 qos_ctl; -__le16 fc; -u8 *crypto_hdr; +u8 *crypto_hdr, mesh_ctrl; + +ath12k_dp_rx_desc_get_dot11_hdr (ab, rx_desc, &hdr); + hdr_len =ieee80211_hdrlen (hdr.frame_control); + mesh_ctrl =ath12k_dp_rx_h_mesh_ctl_present (ab, rx_desc);if (!(status->flag &RX_FLAG_IV_STRIPPED )) { crypto_len =ath12k_dp_rx_crypto_param_len (ar, enctype);
@@ -2078,22 +2075,16 @@ static void ath12k_get_dot11_hdr_from_rx_desc(struct ath12k *ar,ath12k_dp_rx_desc_get_crypto_header (ab, rx_desc, crypto_hdr, enctype); } - fc =cpu_to_le16 (ath12k_dp_rxdesc_get_mpdu_frame_ctrl (ab, rx_desc)); - hdr_len =ieee80211_hdrlen (fc);skb_push (msdu, hdr_len); - hdr = (struct ieee80211_hdr *)msdu->data; - hdr->frame_control = fc; - -/* Get wifi header from rx_desc */ -ath12k_dp_rx_desc_get_dot11_hdr (ab, rx_desc, hdr); +memcpy (msdu->data, &hdr,min (hdr_len,sizeof (hdr)));if (rxcb->is_mcbc) status->flag &= ~RX_FLAG_PN_VALIDATED ;/* Add QOS header */ -if (ieee80211_is_data_qos (hdr->frame_control)) { +if (ieee80211_is_data_qos (hdr.frame_control)) { qos_ctl = rxcb->tid; -if (ath12k_dp_rx_h_mesh_ctl_present (ab, rx_desc)) +if (mesh_ctrl) qos_ctl |=IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT ;/* TODO: Add other QoS ctl fields when required */
drivers/net/wireless/ath/ath12k/hal.c +0 -19
@@ -511,11 +511,6 @@ static void ath12k_hw_qcn9274_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc, crypto_hdr[7 ] =HAL_RX_MPDU_INFO_PN_GET_BYTE2 (desc->u.qcn9274.mpdu_start.pn[1 ]); } -static u16 ath12k_hw_qcn9274_rx_desc_get_mpdu_frame_ctl (struct hal_rx_desc *desc) -{ -return __le16_to_cpu (desc->u.qcn9274.mpdu_start.frame_ctrl); -} -static int ath12k_hal_srng_create_config_qcn9274 (struct ath12k_base *ab) {struct ath12k_hal *hal = &ab->hal;
@@ -736,7 +731,6 @@ const struct hal_rx_ops hal_rx_qcn9274_ops = { .rx_desc_is_da_mcbc = ath12k_hw_qcn9274_rx_desc_is_da_mcbc, .rx_desc_get_dot11_hdr = ath12k_hw_qcn9274_rx_desc_get_dot11_hdr, .rx_desc_get_crypto_header = ath12k_hw_qcn9274_rx_desc_get_crypto_hdr, - .rx_desc_get_mpdu_frame_ctl = ath12k_hw_qcn9274_rx_desc_get_mpdu_frame_ctl, .dp_rx_h_msdu_done = ath12k_hw_qcn9274_dp_rx_h_msdu_done, .dp_rx_h_l4_cksum_fail = ath12k_hw_qcn9274_dp_rx_h_l4_cksum_fail, .dp_rx_h_ip_cksum_fail = ath12k_hw_qcn9274_dp_rx_h_ip_cksum_fail,
@@ -975,11 +969,6 @@ ath12k_hw_qcn9274_compact_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc,HAL_RX_MPDU_INFO_PN_GET_BYTE2 (desc->u.qcn9274_compact.mpdu_start.pn[1 ]); } -static u16 ath12k_hw_qcn9274_compact_rx_desc_get_mpdu_frame_ctl (struct hal_rx_desc *desc) -{ -return __le16_to_cpu (desc->u.qcn9274_compact.mpdu_start.frame_ctrl); -} -static bool ath12k_hw_qcn9274_compact_dp_rx_h_msdu_done (struct hal_rx_desc *desc) { return !!le32_get_bits(desc->u.qcn9274_compact.msdu_end.info14,
@@ -1080,8 +1069,6 @@ const struct hal_rx_ops hal_rx_qcn9274_compact_ops = { .rx_desc_is_da_mcbc = ath12k_hw_qcn9274_compact_rx_desc_is_da_mcbc, .rx_desc_get_dot11_hdr = ath12k_hw_qcn9274_compact_rx_desc_get_dot11_hdr, .rx_desc_get_crypto_header = ath12k_hw_qcn9274_compact_rx_desc_get_crypto_hdr, - .rx_desc_get_mpdu_frame_ctl = - ath12k_hw_qcn9274_compact_rx_desc_get_mpdu_frame_ctl, .dp_rx_h_msdu_done = ath12k_hw_qcn9274_compact_dp_rx_h_msdu_done, .dp_rx_h_l4_cksum_fail = ath12k_hw_qcn9274_compact_dp_rx_h_l4_cksum_fail, .dp_rx_h_ip_cksum_fail = ath12k_hw_qcn9274_compact_dp_rx_h_ip_cksum_fail,
@@ -1330,11 +1317,6 @@ static void ath12k_hw_wcn7850_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc, crypto_hdr[7 ] =HAL_RX_MPDU_INFO_PN_GET_BYTE2 (desc->u.wcn7850.mpdu_start.pn[1 ]); } -static u16 ath12k_hw_wcn7850_rx_desc_get_mpdu_frame_ctl (struct hal_rx_desc *desc) -{ -return __le16_to_cpu (desc->u.wcn7850.mpdu_start.frame_ctrl); -} -static int ath12k_hal_srng_create_config_wcn7850 (struct ath12k_base *ab) {struct ath12k_hal *hal = &ab->hal;
@@ -1555,7 +1537,6 @@ const struct hal_rx_ops hal_rx_wcn7850_ops = { .rx_desc_is_da_mcbc = ath12k_hw_wcn7850_rx_desc_is_da_mcbc, .rx_desc_get_dot11_hdr = ath12k_hw_wcn7850_rx_desc_get_dot11_hdr, .rx_desc_get_crypto_header = ath12k_hw_wcn7850_rx_desc_get_crypto_hdr, - .rx_desc_get_mpdu_frame_ctl = ath12k_hw_wcn7850_rx_desc_get_mpdu_frame_ctl, .dp_rx_h_msdu_done = ath12k_hw_wcn7850_dp_rx_h_msdu_done, .dp_rx_h_l4_cksum_fail = ath12k_hw_wcn7850_dp_rx_h_l4_cksum_fail, .dp_rx_h_ip_cksum_fail = ath12k_hw_wcn7850_dp_rx_h_ip_cksum_fail,
drivers/net/wireless/ath/ath12k/hal.h +0 -1
@@ -1068,7 +1068,6 @@ struct hal_rx_ops {bool (*rx_desc_is_da_mcbc)(struct hal_rx_desc *desc);void (*rx_desc_get_dot11_hdr)(struct hal_rx_desc *desc,struct ieee80211_hdr *hdr); -u16 (*rx_desc_get_mpdu_frame_ctl)(struct hal_rx_desc *desc);void (*rx_desc_get_crypto_header)(struct hal_rx_desc *desc,u8 *crypto_hdr,enum hal_encrypt_type enctype);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 108/512 IB/cm: use rwlock for MAD agent lock
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <[email protected]>
[ Upstream commit 4dab26bed543584577b64b36aadb8b5b165bf44f ]
In workloads where there are many processes establishing connections using RDMA CM in parallel (large scale MPI), there can be heavy contention for mad_agent_lock in cm_alloc_msg.
This contention can occur while inside of a spin_lock_irq region, leading to interrupts being disabled for extended durations on many cores. Furthermore, it leads to the serialization of rdma_create_ah calls, which has negative performance impacts for NICs which are capable of processing multiple address handle creations in parallel.
The end result is the machine becoming unresponsive, hung task warnings, netdev TX timeouts, etc.
Since the lock appears to be only for protection from cm_remove_one, it can be changed to a rwlock to resolve these issues.
Reproducer:
Server:
for i in $(seq 1 512); do
ucmatose -c 32 -p $((i + 5000)) &
done
Client:
for i in $(seq 1 512); do
ucmatose -c 32 -p $((i + 5000)) -s 10.2.0.52 &
done
--- drivers/infiniband/core/cm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/infiniband/core/cm.c +8 -8
@@ -166,7 +166,7 @@ struct cm_port {struct cm_device {struct kref kref;struct list_head list; -spinlock_t mad_agent_lock; +rwlock_t mad_agent_lock;struct ib_device *ib_device;u8 ack_delay;int going_down;
@@ -284,7 +284,7 @@ static struct ib_mad_send_buf *cm_alloc_msg(struct cm_id_private *cm_id_priv)if (!cm_id_priv->av.port)return ERR_PTR (-EINVAL ); -spin_lock (&cm_id_priv->av.port->cm_dev->mad_agent_lock); +read_lock (&cm_id_priv->av.port->cm_dev->mad_agent_lock); mad_agent = cm_id_priv->av.port->mad_agent;if (!mad_agent) { m =ERR_PTR (-EINVAL );
@@ -315,7 +315,7 @@ static struct ib_mad_send_buf *cm_alloc_msg(struct cm_id_private *cm_id_priv) m->context[0 ] = cm_id_priv; out: -spin_unlock (&cm_id_priv->av.port->cm_dev->mad_agent_lock); +read_unlock (&cm_id_priv->av.port->cm_dev->mad_agent_lock);return m; }
@@ -1294,10 +1294,10 @@ static __be64 cm_form_tid(struct cm_id_private *cm_id_priv)if (!cm_id_priv->av.port)return cpu_to_be64 (low_tid); -spin_lock (&cm_id_priv->av.port->cm_dev->mad_agent_lock); +read_lock (&cm_id_priv->av.port->cm_dev->mad_agent_lock);if (cm_id_priv->av.port->mad_agent) hi_tid = ((u64 )cm_id_priv->av.port->mad_agent->hi_tid) <<32 ; -spin_unlock (&cm_id_priv->av.port->cm_dev->mad_agent_lock); +read_unlock (&cm_id_priv->av.port->cm_dev->mad_agent_lock);return cpu_to_be64 (hi_tid | low_tid); }
@@ -4374,7 +4374,7 @@ static int cm_add_one(struct ib_device *ib_device)return -ENOMEM ;kref_init (&cm_dev->kref); -spin_lock_init (&cm_dev->mad_agent_lock); +rwlock_init (&cm_dev->mad_agent_lock); cm_dev->ib_device = ib_device; cm_dev->ack_delay = ib_device->attrs.local_ca_ack_delay; cm_dev->going_down =0 ;
@@ -4490,9 +4490,9 @@ static void cm_remove_one(struct ib_device *ib_device, void *client_data)* The above ensures no call paths from the work are running, * the remaining paths all take the mad_agent_lock. */ -spin_lock (&cm_dev->mad_agent_lock); +write_lock (&cm_dev->mad_agent_lock); port->mad_agent =NULL ; -spin_unlock (&cm_dev->mad_agent_lock); +write_unlock (&cm_dev->mad_agent_lock);ib_unregister_mad_agent (mad_agent);ib_port_unregister_client_groups (ib_device, i, cm_counter_groups);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 109/512 bpf: Check link_create.flags parameter for multi_kprobe
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tao Chen <[email protected]>
[ Upstream commit 243911982aa9faf4361aa952f879331ad66933fe ]
The link_create.flags are currently not used for multi-kprobes, so return -EINVAL if it is set, same as for other attach APIs.
We allow target_fd, on the other hand, to have an arbitrary value for multi-kprobe, as there are existing users (libbpf) relying on this.
--- kernel/trace/bpf_trace.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/trace/bpf_trace.c +3 -0
@@ -2932,6 +2932,9 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prif (sizeof (u64) !=sizeof (void *))return -EOPNOTSUPP ; +if (attr->link_create.flags) +return -EINVAL ; +if (!is_kprobe_multi (prog))return -EINVAL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 110/512 selftests/bpf: Fix bpf_nf selftest failure
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Saket Kumar Bhaskar <[email protected]>
[ Upstream commit 967e8def1100cb4b08c28a54d27ce69563fdf281 ]
For systems with missing iptables-legacy tool this selftest fails.
Add check to find if iptables-legacy tool is available and skip the test if the tool is missing.
--- tools/testing/selftests/bpf/prog_tests/bpf_nf.c | 6 ++++++ 1 file changed, 6 insertions(+)
tools/testing/selftests/bpf/prog_tests/bpf_nf.c +6 -0
@@ -63,6 +63,12 @@ static void test_bpf_nf_ct(int mode) .repeat = 1, ); +if (SYS_NOFAIL ("iptables-legacy --version" )) { +fprintf (stdout,"Missing required iptables-legacy tool\n" ); +test__skip (); +return ; + } + skel =test_bpf_nf__open_and_load ();if (!ASSERT_OK_PTR (skel,"test_bpf_nf__open_and_load" ))return ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 111/512 bpf: fix ktls panic with sockmap
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit 54a3ecaeeeae8176da8badbd7d72af1017032c39 ]
[ 2172.936997] ------------[ cut here ]------------ [ 2172.936999] kernel BUG at lib/iov_iter.c:629! ...... [ 2172.944996] PKRU: 55555554 [ 2172.945155] Call Trace: [ 2172.945299] <TASK> [ 2172.945428] ? die+0x36/0x90 [ 2172.945601] ? do_trap+0xdd/0x100 [ 2172.945795] ? iov_iter_revert+0x178/0x180 [ 2172.946031] ? iov_iter_revert+0x178/0x180 [ 2172.946267] ? do_error_trap+0x7d/0x110 [ 2172.946499] ? iov_iter_revert+0x178/0x180 [ 2172.946736] ? exc_invalid_op+0x50/0x70 [ 2172.946961] ? iov_iter_revert+0x178/0x180 [ 2172.947197] ? asm_exc_invalid_op+0x1a/0x20 [ 2172.947446] ? iov_iter_revert+0x178/0x180 [ 2172.947683] ? iov_iter_revert+0x5c/0x180 [ 2172.947913] tls_sw_sendmsg_locked.isra.0+0x794/0x840 [ 2172.948206] tls_sw_sendmsg+0x52/0x80 [ 2172.948420] ? inet_sendmsg+0x1f/0x70 [ 2172.948634] __sys_sendto+0x1cd/0x200 [ 2172.948848] ? find_held_lock+0x2b/0x80 [ 2172.949072] ? syscall_trace_enter+0x140/0x270 [ 2172.949330] ? __lock_release.isra.0+0x5e/0x170 [ 2172.949595] ? find_held_lock+0x2b/0x80 [ 2172.949817] ? syscall_trace_enter+0x140/0x270 [ 2172.950211] ? lockdep_hardirqs_on_prepare+0xda/0x190 [ 2172.950632] ? ktime_get_coarse_real_ts64+0xc2/0xd0 [ 2172.951036] __x64_sys_sendto+0x24/0x30 [ 2172.951382] do_syscall_64+0x90/0x170
......
After calling bpf_exec_tx_verdict(), the size of msg_pl->sg may increase, e.g., when the BPF program executes bpf_msg_push_data().
If the BPF program sets cork_bytes and sg.size is smaller than cork_bytes, it will return -ENOSPC and attempt to roll back to the non-zero copy logic. However, during rollback, msg->msg_iter is reset, but since msg_pl->sg.size has been increased, subsequent executions will exceed the actual size of msg_iter.
'''iov_iter_revert(&msg->msg_iter, msg_pl->sg.size - orig_size); '''
The changes in this commit are based on the following considerations:
1. When cork_bytes is set, rolling back to non-zero copy logic is pointless and can directly go to zero-copy logic.
2. We can not calculate the correct number of bytes to revert msg_iter.
Assume the original data is "abcdefgh" (8 bytes), and after 3 pushes by the BPF program, it becomes 11-byte data: "abc?de?fgh?". Then, we set cork_bytes to 6, which means the first 6 bytes have been processed, and the remaining 5 bytes "?fgh?" will be cached until the length meets the cork_bytes requirement.
However, some data in "?fgh?" is not within 'sg->msg_iter' (but in msg_pl instead), especially the data "?" we pushed.
So it doesn't seem as simple as just reverting through an offset of msg_iter.
3. For non-TLS sockets in tcp_bpf_sendmsg, when a "cork" situation occurs, the user-space send() doesn't return an error, and the returned length is the same as the input length parameter, even if some data is cached.
Additionally, I saw that the current non-zero-copy logic for handling corking is written as:
'''
line 1177
else if (ret != -EAGAIN) {
if (ret == -ENOSPC)
ret = 0;
goto send_end;'''
So it's ok to just return 'copied' without error when a "cork" situation occurs.
--- net/tls/tls_sw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/tls/tls_sw.c +6 -2
@@ -1120,9 +1120,13 @@ static int tls_sw_sendmsg_locked(struct sock *sk, struct msghdr *msg, num_async++; else if (ret == -ENOMEM) goto wait_for_memory; - else if (ctx->open_rec && ret == -ENOSPC) + else if (ctx->open_rec && ret == -ENOSPC) { +if (msg_pl->cork_bytes) { + ret =0 ; + goto send_end; + } goto rollback_iter; - else if (ret != -EAGAIN) + } else if (ret != -EAGAIN) goto send_end; }continue ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 112/512 bpf, sockmap: fix duplicated data transmission
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit 3b4f14b794287be137ea2c6158765d1ea1e018a4 ]
In the !ingress path under sk_psock_handle_skb(), when sending data to the remote under snd_buf limitations, partial skb data might be transmitted.
Although we preserved the partial transmission state (offset/length), the state wasn't properly consumed during retries. This caused the retry path to resend the entire skb data instead of continuing from the previous offset, resulting in data overlap at the receiver side.
--- net/core/skmsg.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
net/core/skmsg.c +9 -5
@@ -655,11 +655,6 @@ static void sk_psock_backlog(struct work_struct *work)int ret;mutex_lock (&psock->work_mutex); -if (unlikely (state->len)) { - len = state->len; - off = state->off; - } -while ((skb =skb_peek (&psock->ingress_skb))) { len = skb->len; off =0 ;
@@ -669,6 +664,13 @@ static void sk_psock_backlog(struct work_struct *work) off = stm->offset; len = stm->full_len; } + +/* Resume processing from previous partial state */ +if (unlikely (state->len)) { + len = state->len; + off = state->off; + } + ingress =skb_bpf_ingress (skb);skb_bpf_redirect_clear (skb); do {
@@ -696,6 +698,8 @@ static void sk_psock_backlog(struct work_struct *work) len -= ret; }while (len); +/* The entire skb sent, clear state */ +sk_psock_skb_state (psock, state,0 ,0 ); skb =skb_dequeue (&psock->ingress_skb);kfree_skb (skb); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 113/512 bpf, sockmap: Fix panic when calling skb_linearize
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit 5ca2e29f6834c64c0e5a9ccf1278c21fb49b827e ]
The panic can be reproduced by executing the command:
./bench sockmap -c 2 -p 1 -a --rx-verdict-ingress --rx-strp 100000
Then a kernel panic was captured:
'''
[ 657.460555] kernel BUG at net/core/skbuff.c:2178! [ 657.462680] Tainted: [W]=WARN [ 657.463287] Workqueue: events sk_psock_backlog ... [ 657.469610] <TASK> [ 657.469738] ? die+0x36/0x90 [ 657.469916] ? do_trap+0x1d0/0x270 [ 657.470118] ? pskb_expand_head+0x612/0xf40 [ 657.470376] ? pskb_expand_head+0x612/0xf40 [ 657.470620] ? do_error_trap+0xa3/0x170 [ 657.470846] ? pskb_expand_head+0x612/0xf40 [ 657.471092] ? handle_invalid_op+0x2c/0x40 [ 657.471335] ? pskb_expand_head+0x612/0xf40 [ 657.471579] ? exc_invalid_op+0x2d/0x40 [ 657.471805] ? asm_exc_invalid_op+0x1a/0x20 [ 657.472052] ? pskb_expand_head+0xd1/0xf40 [ 657.472292] ? pskb_expand_head+0x612/0xf40 [ 657.472540] ? lock_acquire+0x18f/0x4e0 [ 657.472766] ? find_held_lock+0x2d/0x110 [ 657.472999] ? __pfx_pskb_expand_head+0x10/0x10 [ 657.473263] ? __kmalloc_cache_noprof+0x5b/0x470 [ 657.473537] ? __pfx___lock_release.isra.0+0x10/0x10 [ 657.473826] __pskb_pull_tail+0xfd/0x1d20 [ 657.474062] ? __kasan_slab_alloc+0x4e/0x90 [ 657.474707] sk_psock_skb_ingress_enqueue+0x3bf/0x510 [ 657.475392] ? __kasan_kmalloc+0xaa/0xb0 [ 657.476010] sk_psock_backlog+0x5cf/0xd70 [ 657.476637] process_one_work+0x858/0x1a20
'''
The panic originates from the assertion BUG_ON(skb_shared(skb)) in skb_linearize(). A previous commit(see Fixes tag) introduced skb_get() to avoid race conditions between skb operations in the backlog and skb release in the recvmsg path. However, this caused the panic to always occur when skb_linearize is executed.
The "--rx-strp 100000" parameter forces the RX path to use the strparser module which aggregates data until it reaches 100KB before calling sockmap logic. The 100KB payload exceeds MAX_MSG_FRAGS, triggering skb_linearize.
To fix this issue, just move skb_get into sk_psock_skb_ingress_enqueue.
'''sk_psock_backlog:
sk_psock_handle_skb
skb_get(skb) <== we move it into 'sk_psock_skb_ingress_enqueue'
sk_psock_skb_ingress____________
↓
|
| → sk_psock_skb_ingress_self
| sk_psock_skb_ingress_enqueuesk_psock_verdict_apply_________________↑ skb_linearize
'''
Note that for verdict_apply path, the skb_get operation is unnecessary so we add 'take_ref' param to control it's behavior.
--- net/core/skmsg.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
net/core/skmsg.c +16 -15
@@ -529,16 +529,22 @@ static int sk_psock_skb_ingress_enqueue(struct sk_buff *skb, u32 off, u32 len, struct sk_psock *psock, struct sock *sk, - struct sk_msg *msg) + struct sk_msg *msg, + bool take_ref) { int num_sge, copied; +/* skb_to_sgvec will fail when the total number of fragments in +* frag_list and frags exceeds MAX_MSG_FRAGS. For example, the +* caller may aggregate multiple skbs. +*/ num_sge =skb_to_sgvec (skb, msg->sg.data, off, len);if (num_sge <0 ) {/* skb linearize may fail with ENOMEM, but lets simply try again * later if this happens. Under memory pressure we don't want to * drop the skb. We need to linearize the skb so that the mapping * in skb_to_sgvec can not error. +* Note that skb_linearize requires the skb not to be shared. */ if (skb_linearize (skb))return -EAGAIN ;
@@ -555,7 +561,7 @@ static int sk_psock_skb_ingress_enqueue(struct sk_buff *skb, msg->sg.start =0 ; msg->sg.size = copied; msg->sg.end = num_sge; - msg->skb = skb; + msg->skb = take_ref ?skb_get (skb) : skb;sk_psock_queue_msg (psock, msg);sk_psock_data_ready (sk, psock);
@@ -563,7 +569,7 @@ static int sk_psock_skb_ingress_enqueue(struct sk_buff *skb, }static int sk_psock_skb_ingress_self (struct sk_psock *psock,struct sk_buff *skb, -u32 off,u32 len); +u32 off,u32 len,bool take_ref);static int sk_psock_skb_ingress (struct sk_psock *psock,struct sk_buff *skb,u32 off,u32 len)
@@ -577,7 +583,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb,* correctly. */ if (unlikely (skb->sk == sk)) -return sk_psock_skb_ingress_self (psock, skb, off, len); +return sk_psock_skb_ingress_self (psock, skb, off, len, true); msg =sk_psock_create_ingress_msg (sk, skb);if (!msg)return -EAGAIN ;
@@ -589,7 +595,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb,* into user buffers. */ skb_set_owner_r (skb, sk); - err =sk_psock_skb_ingress_enqueue (skb, off, len, psock, sk, msg); + err =sk_psock_skb_ingress_enqueue (skb, off, len, psock, sk, msg, true);if (err <0 )kfree (msg);return err;
@@ -600,7 +606,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb,* because the skb is already accounted for here. */ static int sk_psock_skb_ingress_self (struct sk_psock *psock,struct sk_buff *skb, -u32 off,u32 len) +u32 off,u32 len,bool take_ref) {struct sk_msg *msg =alloc_sk_msg (GFP_ATOMIC );struct sock *sk = psock->sk;
@@ -609,7 +615,7 @@ static int sk_psock_skb_ingress_self(struct sk_psock *psock, struct sk_buff *skbif (unlikely (!msg))return -EAGAIN ;skb_set_owner_r (skb, sk); - err =sk_psock_skb_ingress_enqueue (skb, off, len, psock, sk, msg); + err =sk_psock_skb_ingress_enqueue (skb, off, len, psock, sk, msg, take_ref);if (err <0 )kfree (msg);return err;
@@ -618,18 +624,13 @@ static int sk_psock_skb_ingress_self(struct sk_psock *psock, struct sk_buff *skbstatic int sk_psock_handle_skb (struct sk_psock *psock,struct sk_buff *skb,u32 off,u32 len,bool ingress) { -int err =0 ; -if (!ingress) {if (!sock_writeable (psock->sk))return -EAGAIN ;return skb_send_sock (psock->sk, skb, off, len); } -skb_get (skb); - err =sk_psock_skb_ingress (psock, skb, off, len); -if (err <0 ) -kfree_skb (skb); -return err; + +return sk_psock_skb_ingress (psock, skb, off, len); } static void sk_psock_skb_state(struct sk_psock *psock,
@@ -1017,7 +1018,7 @@ static int sk_psock_verdict_apply(struct sk_psock *psock, struct sk_buff *skb, off = stm->offset; len = stm->full_len; } - err =sk_psock_skb_ingress_self (psock, skb, off, len); + err =sk_psock_skb_ingress_self (psock, skb, off, len, false); }if (err <0 ) {spin_lock_bh (&psock->ingress_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 114/512 f2fs: zone: fix to avoid inconsistence in between SIT and SSA
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit 773704c1ef96a8b70d0d186ab725f50548de82c4 ]
w/ below testcase, it will cause inconsistence in between SIT and SSA.
create_null_blk 512 2 1024 1024
mkfs.f2fs -m /dev/nullb0
mount /dev/nullb0 /mnt/f2fs/
touch /mnt/f2fs/filef2fs_io pinfile set /mnt/f2fs/file
fallocate -l 4GiB /mnt/f2fs/file
F2FS-fs (nullb0): Inconsistent segment (0) type [1, 0] in SSA and SIT
CPU: 5 UID: 0 PID: 2398 Comm: fallocate Tainted: G O 6.13.0-rc1 #84 Tainted: [O]=OOT_MODULE Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 Call Trace: <TASK> dump_stack_lvl+0xb3/0xd0 dump_stack+0x14/0x20 f2fs_handle_critical_error+0x18c/0x220 [f2fs] f2fs_stop_checkpoint+0x38/0x50 [f2fs] do_garbage_collect+0x674/0x6e0 [f2fs] f2fs_gc_range+0x12b/0x230 [f2fs] f2fs_allocate_pinning_section+0x5c/0x150 [f2fs] f2fs_expand_inode_data+0x1cc/0x3c0 [f2fs] f2fs_fallocate+0x3c3/0x410 [f2fs] vfs_fallocate+0x15f/0x4b0 __x64_sys_fallocate+0x4a/0x80 x64_sys_call+0x15e8/0x1b80 do_syscall_64+0x68/0x130 entry_SYSCALL_64_after_hwframe+0x67/0x6f RIP: 0033:0x7f9dba5197ca
F2FS-fs (nullb0): Stopped filesystem due to reason: 4
The reason is f2fs_gc_range() may try to migrate block in curseg, however, its SSA block is not uptodate due to the last summary block data is still in cache of curseg.
In this patch, we add a condition in f2fs_gc_range() to check whether section is opened or not, and skip block migration for opened section.
--- fs/f2fs/gc.c | 3 +++ 1 file changed, 3 insertions(+)
fs/f2fs/gc.c +3 -0
@@ -2072,6 +2072,9 @@ int f2fs_gc_range(struct f2fs_sb_info *sbi, .iroot = RADIX_TREE_INIT(gc_list.iroot, GFP_NOFS), }; +if (IS_CURSEC (sbi,GET_SEC_FROM_SEG (sbi, segno))) +continue ; +do_garbage_collect (sbi, segno, &gc_list,FG_GC , true, false);put_gc_inode (&gc_list);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 115/512 wifi: ath12k: fix cleanup path after mhi init
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raj Kumar Bhagat <[email protected]>
[ Upstream commit 6177c97fb6f05bf0473a2806e3bece7e77693209 ]
Currently, the 'err_pci_msi_free' label is misplaced, causing the cleanup sequence to be incorrect. Fix this by moving the 'err_pci_msi_free' label to the correct position after 'err_irq_affinity_cleanup'.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00209-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/pci.c +3 -3
@@ -1514,12 +1514,12 @@ static int ath12k_pci_probe(struct pci_dev *pdev, err_mhi_unregister:ath12k_mhi_unregister (ab_pci); -err_pci_msi_free: -ath12k_pci_msi_free (ab_pci); - err_irq_affinity_cleanup:ath12k_pci_set_irq_affinity_hint (ab_pci,NULL ); +err_pci_msi_free: +ath12k_pci_msi_free (ab_pci); + err_pci_free_region:ath12k_pci_free_region (ab_pci);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 116/512 wifi: ath12k: Fix WMI tag for EHT rate in peer assoc
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ramya Gnanasekar <[email protected]>
[ Upstream commit 1a0e65750b55d2cf5de4a9bf7d6d55718784bdb7 ]
Incorrect WMI tag is used for EHT rate update from host to firmware while encoding peer assoc WMI.
Correct the WMI tag used for EHT rate update from WMI_TAG_HE_RATE_SET
to the proper tag. This ensures firmware does not mistakenly update HE rate during parsing.
Found during code review. Compile tested only.
--- drivers/net/wireless/ath/ath12k/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/wmi.c +1 -1
@@ -2157,7 +2157,7 @@ int ath12k_wmi_send_peer_assoc_cmd(struct ath12k *ar,for (i =0 ; i < arg->peer_eht_mcs_count; i++) { eht_mcs = ptr; - eht_mcs->tlv_header =ath12k_wmi_tlv_cmd_hdr (WMI_TAG_HE_RATE_SET , + eht_mcs->tlv_header =ath12k_wmi_tlv_cmd_hdr (WMI_TAG_EHT_RATE_SET ,sizeof (*eht_mcs)); eht_mcs->rx_mcs_set =cpu_to_le32 (arg->peer_eht_rx_mcs_set[i]);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 117/512 wifi: ath12k: Fix buffer overflow in debugfs
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 8c7a5031a6b0d42e640fbd2d5d05f61f74e32dce ]
If the user tries to write more than 32 bytes then it results in memory corruption. Fortunately, this is debugfs so it's limited to root users.
--- drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c +3 -0
@@ -1646,6 +1646,9 @@ static ssize_t ath12k_write_htt_stats_type(struct file *file,const int size =32 ;int num_args; +if (count > size) +return -EINVAL ; + char *buf __free(kfree) = kzalloc(size, GFP_KERNEL);if (!buf)return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 118/512 f2fs: clean up unnecessary indentation
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaegeuk Kim <[email protected]>
[ Upstream commit 05d3273ad03fa5ea1177b4f3dfeeb6de4899b504 ]
No functional change.
--- fs/f2fs/segment.h | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-)
fs/f2fs/segment.h +24 -16
@@ -431,7 +431,6 @@ static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno)unsigned int secno =GET_SEC_FROM_SEG (sbi, segno);unsigned int start_segno =GET_SEG_FROM_SEC (sbi, secno);unsigned int next; -unsigned int usable_segs =f2fs_usable_segs_in_sec (sbi);spin_lock (&free_i->segmap_lock);clear_bit (segno, free_i->free_segmap);
@@ -439,7 +438,7 @@ static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno) next =find_next_bit (free_i->free_segmap, start_segno +SEGS_PER_SEC (sbi), start_segno); -if (next >= start_segno + usable_segs) { +if (next >= start_segno +f2fs_usable_segs_in_sec (sbi)) {clear_bit (secno, free_i->free_secmap); free_i->free_sections++; }
@@ -465,22 +464,31 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,unsigned int secno =GET_SEC_FROM_SEG (sbi, segno);unsigned int start_segno =GET_SEG_FROM_SEC (sbi, secno);unsigned int next; -unsigned int usable_segs =f2fs_usable_segs_in_sec (sbi); +bool ret;spin_lock (&free_i->segmap_lock); -if (test_and_clear_bit (segno, free_i->free_segmap)) { - free_i->free_segments++; - -if (!inmem &&IS_CURSEC (sbi, secno)) - goto skip_free; - next =find_next_bit (free_i->free_segmap, - start_segno +SEGS_PER_SEC (sbi), start_segno); -if (next >= start_segno + usable_segs) { -if (test_and_clear_bit (secno, free_i->free_secmap)) - free_i->free_sections++; - } - } -skip_free: + ret =test_and_clear_bit (segno, free_i->free_segmap); +if (!ret) + goto unlock_out; + + free_i->free_segments++; + +if (!inmem &&IS_CURSEC (sbi, secno)) + goto unlock_out; + +/* check large section */ + next =find_next_bit (free_i->free_segmap, + start_segno +SEGS_PER_SEC (sbi), start_segno); +if (next < start_segno +f2fs_usable_segs_in_sec (sbi)) + goto unlock_out; + + ret =test_and_clear_bit (secno, free_i->free_secmap); +if (!ret) + goto unlock_out; + + free_i->free_sections++; + +unlock_out:spin_unlock (&free_i->segmap_lock); }
Signature · 1 line
2.39.5
Re: [PATCH 6.12 118/512] f2fs: clean up unnecessary indentation
Hi!
Quoted 3 lines
[ Upstream commit
05d3273ad03fa5ea1177b4f3dfeeb6de4899b504]No functional change.
Exactly. Stable rules say we don't take cleanups. Bad bot.
BR,
Pavel
Quoted 75 lines
Reviewed-by Chao Yu <[email protected]>Signed-off-by Jaegeuk Kim <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- fs/f2fs/segment.h | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-)fs/f2fs/segment.h +24
-16@@ -431,7 +431,6 @@ static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno)unsigned int secno =GET_SEC_FROM_SEG (sbi, segno);unsigned int start_segno =GET_SEG_FROM_SEC (sbi, secno);unsigned int next; -unsigned int usable_segs =f2fs_usable_segs_in_sec (sbi);spin_lock (&free_i->segmap_lock);clear_bit (segno, free_i->free_segmap);@@ -439,7 +438,7 @@ static inline void __set_free(struct f2fs_sb_info *sbi, unsigned int segno) next =find_next_bit (free_i->free_segmap, start_segno +SEGS_PER_SEC (sbi), start_segno); -if (next >= start_segno + usable_segs) { +if (next >= start_segno +f2fs_usable_segs_in_sec (sbi)) {clear_bit (secno, free_i->free_secmap); free_i->free_sections++; }@@ -465,22 +464,31 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi,unsigned int secno =GET_SEC_FROM_SEG (sbi, segno);unsigned int start_segno =GET_SEG_FROM_SEC (sbi, secno);unsigned int next; -unsigned int usable_segs =f2fs_usable_segs_in_sec (sbi); +bool ret;spin_lock (&free_i->segmap_lock); -if (test_and_clear_bit (segno, free_i->free_segmap)) { - free_i->free_segments++; - -if (!inmem &&IS_CURSEC (sbi, secno)) - goto skip_free; - next =find_next_bit (free_i->free_segmap, - start_segno +SEGS_PER_SEC (sbi), start_segno); -if (next >= start_segno + usable_segs) { -if (test_and_clear_bit (secno, free_i->free_secmap)) - free_i->free_sections++; - } - } -skip_free: + ret =test_and_clear_bit (segno, free_i->free_segmap); +if (!ret) + goto unlock_out; + + free_i->free_segments++; + +if (!inmem &&IS_CURSEC (sbi, secno)) + goto unlock_out; + +/* check large section */ + next =find_next_bit (free_i->free_segmap, + start_segno +SEGS_PER_SEC (sbi), start_segno); +if (next < start_segno +f2fs_usable_segs_in_sec (sbi)) + goto unlock_out; + + ret =test_and_clear_bit (secno, free_i->free_secmap); +if (!ret) + goto unlock_out; + + free_i->free_sections++; + +unlock_out:spin_unlock (&free_i->segmap_lock); }
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Greg Kroah-Hartman
maintainerPATCH 119/512 f2fs: prevent the current section from being selected as a victim during GC
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: yohan.joung <[email protected]>
[ Upstream commit d26fecb03e1f1069480d41fa2a6cea87ebbb89b8 ]
When selecting a victim using next_victim_seg in a large section, the selected section might already have been cleared and designated as the new current section, making it actively in use.
This behavior causes inconsistency between the SIT and SSA.
F2FS-fs (dm-54): Inconsistent segment (70961) type [0, 1] in SSA and SIT
Call trace: dump_backtrace+0xe8/0x10c show_stack+0x18/0x28 dump_stack_lvl+0x50/0x6c dump_stack+0x18/0x28 f2fs_stop_checkpoint+0x1c/0x3c do_garbage_collect+0x41c/0x271c f2fs_gc+0x27c/0x828 gc_thread_func+0x290/0x88c kthread+0x11c/0x164 ret_from_fork+0x10/0x20
issue scenario
segs_per_sec=2
- seg#0 and seg#1 are all dirty
- all valid blocks are removed in seg#1
- gc select this sec and next_victim_seg=seg#0
- migrate seg#0, next_victim_seg=seg#1
- checkpoint -> sec(seg#0, seg#1) becomes free
- allocator assigns sec(seg#0, seg#1) to curseg
- gc tries to migrate seg#1
--- fs/f2fs/segment.h | 5 +++++ 1 file changed, 5 insertions(+)
fs/f2fs/segment.h +5 -0
@@ -488,6 +488,11 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi, free_i->free_sections++; +if (GET_SEC_FROM_SEG (sbi, sbi->next_victim_seg[BG_GC ]) == secno) + sbi->next_victim_seg[BG_GC ] =NULL_SEGNO ; +if (GET_SEC_FROM_SEG (sbi, sbi->next_victim_seg[FG_GC ]) == secno) + sbi->next_victim_seg[FG_GC ] =NULL_SEGNO ; + unlock_out:spin_unlock (&free_i->segmap_lock); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 120/512 f2fs: fix to do sanity check on sbi->total_valid_block_count
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit 05872a167c2cab80ef186ef23cc34a6776a1a30c ]
syzbot reported a f2fs bug as below:
------------[ cut here ]------------ kernel BUG at fs/f2fs/f2fs.h:2521! RIP: 0010:dec_valid_block_count+0x3b2/0x3c0 fs/f2fs/f2fs.h:2521 Call Trace: f2fs_truncate_data_blocks_range+0xc8c/0x11a0 fs/f2fs/file.c:695 truncate_dnode+0x417/0x740 fs/f2fs/node.c:973 truncate_nodes+0x3ec/0xf50 fs/f2fs/node.c:1014 f2fs_truncate_inode_blocks+0x8e3/0x1370 fs/f2fs/node.c:1197 f2fs_do_truncate_blocks+0x840/0x12b0 fs/f2fs/file.c:810 f2fs_truncate_blocks+0x10d/0x300 fs/f2fs/file.c:838 f2fs_truncate+0x417/0x720 fs/f2fs/file.c:888 f2fs_setattr+0xc4f/0x12f0 fs/f2fs/file.c:1112 notify_change+0xbca/0xe90 fs/attr.c:552 do_truncate+0x222/0x310 fs/open.c:65 handle_truncate fs/namei.c:3466 [inline] do_open fs/namei.c:3849 [inline] path_openat+0x2e4f/0x35d0 fs/namei.c:4004 do_filp_open+0x284/0x4e0 fs/namei.c:4031 do_sys_openat2+0x12b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_creat fs/open.c:1522 [inline] __se_sys_creat fs/open.c:1516 [inline] __x64_sys_creat+0x124/0x170 fs/open.c:1516 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94
The reason is: in fuzzed image, sbi->total_valid_block_count is inconsistent w/ mapped blocks indexed by inode, so, we should not trigger panic for such case, instead, let's print log and set fsck flag.
--- fs/f2fs/f2fs.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
fs/f2fs/f2fs.h +8 -2
@@ -2508,8 +2508,14 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,blkcnt_t sectors = count <<F2FS_LOG_SECTORS_PER_BLOCK ;spin_lock (&sbi->stat_lock); -f2fs_bug_on (sbi, sbi->total_valid_block_count < (block_t ) count); - sbi->total_valid_block_count -= (block_t )count; +if (unlikely (sbi->total_valid_block_count < count)) { +f2fs_warn (sbi,"Inconsistent total_valid_block_count:%u, ino:%lu, count:%u" , + sbi->total_valid_block_count, inode->i_ino, count); + sbi->total_valid_block_count =0 ; +set_sbi_flag (sbi,SBI_NEED_FSCK ); + }else { + sbi->total_valid_block_count -= count; + }if (sbi->reserved_blocks && sbi->current_reserved_blocks < sbi->reserved_blocks) sbi->current_reserved_blocks = min(sbi->reserved_blocks,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 121/512 page_pool: Move pp_magic check into helper functions
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit cd3c93167da0e760b5819246eae7a4ea30fd014b ]
Since we are about to stash some more information into the pp_magic field, let's move the magic signature checks into a pair of helper functions so it can be changed in one place.
--- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 4 ++-- include/linux/mm.h | 20 +++++++++++++++++++ mm/page_alloc.c | 8 ++------ net/core/netmem_priv.h | 5 +++++ net/core/skbuff.c | 16 ++------------- net/core/xdp.c | 4 ++-- 6 files changed, 33 insertions(+), 24 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +2 -2
@@ -706,8 +706,8 @@ static void mlx5e_free_xdpsq_desc(struct mlx5e_xdpsq *sq, xdpi =mlx5e_xdpi_fifo_pop (xdpi_fifo); page = xdpi.page.page; -/* No need to check ((page->pp_magic & ~0x3UL) == PP_SIGNATURE) -* as we know this is a page_pool page. +/* No need to check page_pool_page_is_pp() as we +* know this is a page_pool page. */ page_pool_recycle_direct (page->pp, page); }while (++n < num);
include/linux/mm.h +20 -0
@@ -4243,4 +4243,24 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) }#endif /* CONFIG_MEM_ALLOC_PROFILING */ +/* Mask used for checking in page_pool_page_is_pp() below. page->pp_magic is +* OR'ed with PP_SIGNATURE after the allocation in order to preserve bit 0 for +* the head page of compound page and bit 1 for pfmemalloc page. +* page_is_pfmemalloc() is checked in __page_pool_put_page() to avoid recycling +* the pfmemalloc page. +*/ +#define PP_MAGIC_MASK ~0x3UL + +#ifdef CONFIG_PAGE_POOL +static inline bool page_pool_page_is_pp (struct page *page) +{ +return (page->pp_magic &PP_MAGIC_MASK ) ==PP_SIGNATURE ; +} +#else +static inline bool page_pool_page_is_pp (struct page *page) +{ +return false; +} +#endif +#endif /* _LINUX_MM_H */
mm/page_alloc.c +2 -6
@@ -872,9 +872,7 @@ static inline bool page_expected_state(struct page *page,#ifdef CONFIG_MEMCG page->memcg_data | #endif -#ifdef CONFIG_PAGE_POOL - ((page->pp_magic & ~0x3UL) == PP_SIGNATURE) | -#endif +page_pool_page_is_pp (page) | (page->flags & check_flags))) return false;
@@ -901,10 +899,8 @@ static const char *page_bad_reason(struct page *page, unsigned long flags)if (unlikely (page->memcg_data)) bad_reason ="page still charged to cgroup" ;#endif -#ifdef CONFIG_PAGE_POOL -if (unlikely ((page->pp_magic & ~0x3UL ) ==PP_SIGNATURE )) +if (unlikely (page_pool_page_is_pp (page))) bad_reason ="page_pool leak" ; -#endif return bad_reason; }
net/core/netmem_priv.h +5 -0
@@ -18,6 +18,11 @@ static inline void netmem_clear_pp_magic(netmem_ref netmem)__netmem_clear_lsb (netmem)->pp_magic =0 ; } +static inline bool netmem_is_pp (netmem_ref netmem) +{ +return (netmem_get_pp_magic (netmem) &PP_MAGIC_MASK ) ==PP_SIGNATURE ; +} +static inline void netmem_set_pp (netmem_ref netmem,struct page_pool *pool) {__netmem_clear_lsb (netmem)->pp = pool;
net/core/skbuff.c +2 -14
@@ -925,11 +925,6 @@ static void skb_clone_fraglist(struct sk_buff *skb)skb_get (list); } -static bool is_pp_netmem (netmem_ref netmem) -{ -return (netmem_get_pp_magic (netmem) & ~0x3UL ) ==PP_SIGNATURE ; -} -int skb_pp_cow_data (struct page_pool *pool,struct sk_buff **pskb,unsigned int headroom) {
@@ -1027,14 +1022,7 @@ bool napi_pp_put_page(netmem_ref netmem) { netmem =netmem_compound_head (netmem); -/* page->pp_magic is OR'ed with PP_SIGNATURE after the allocation -* in order to preserve any existing bits, such as bit 0 for the -* head page of compound page and bit 1 for pfmemalloc page, so -* mask those bits for freeing side when doing below checking, -* and page_is_pfmemalloc() is checked in __page_pool_put_page() -* to avoid recycling the pfmemalloc page. -*/ -if (unlikely (!is_pp_netmem (netmem))) +if (unlikely (!netmem_is_pp (netmem)))return false;page_pool_put_full_netmem (netmem_get_pp (netmem), netmem, false);
@@ -1074,7 +1062,7 @@ static int skb_pp_frag_ref(struct sk_buff *skb)for (i =0 ; i < shinfo->nr_frags; i++) { head_netmem =netmem_compound_head (shinfo->frags[i].netmem); -if (likely (is_pp_netmem (head_netmem))) +if (likely (netmem_is_pp (head_netmem)))page_pool_ref_netmem (head_netmem);else page_ref_inc (netmem_to_page (head_netmem));
net/core/xdp.c +2 -2
@@ -381,8 +381,8 @@ void __xdp_return(void *data, struct xdp_mem_info *mem, bool napi_direct, page =virt_to_head_page (data);if (napi_direct &&xdp_return_frame_no_direct ()) napi_direct = false; -/* No need to check ((page->pp_magic & ~0x3UL) == PP_SIGNATURE) -* as mem->type knows this a page_pool page +/* No need to check netmem_is_pp() as mem->type knows this a +* page_pool page */ page_pool_put_full_page (page->pp, page, napi_direct);break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 122/512 page_pool: Track DMA-mapped pages and unmap them when destroying the pool
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit ee62ce7a1d909ccba0399680a03c2dee83bcae95 ]
When enabling DMA mapping in page_pool, pages are kept DMA mapped until they are released from the pool, to avoid the overhead of re-mapping the pages every time they are used. This causes resource leaks and/or crashes when there are pages still outstanding while the device is torn down, because page_pool will attempt an unmap through a non-existent DMA device on the subsequent page return.
To fix this, implement a simple tracking of outstanding DMA-mapped pages in page pool using an xarray. This was first suggested by Mina[0], and turns out to be fairly straight forward: We simply store pointers to pages directly in the xarray with xa_alloc() when they are first DMA mapped, and remove them from the array on unmap. Then, when a page pool is torn down, it can simply walk the xarray and unmap all pages still present there before returning, which also allows us to get rid of the get/put_device() calls in page_pool. Using xa_cmpxchg(), no additional synchronisation is needed, as a page will only ever be unmapped once.
To avoid having to walk the entire xarray on unmap to find the page reference, we stash the ID assigned by xa_alloc() into the page structure itself, using the upper bits of the pp_magic field. This requires a couple of defines to avoid conflicting with the POINTER_POISON_DELTA define, but this is all evaluated at compile-time, so does not affect run-time performance. The bitmap calculations in this patch gives the following number of bits for different architectures:
- 23 bits on 32-bit architectures
- 21 bits on PPC64 (because of the definition of ILLEGAL_POINTER_VALUE)
- 32 bits on other 64-bit architectures
Stashing a value into the unused bits of pp_magic does have the effect that it can make the value stored there lie outside the unmappable range (as governed by the mmap_min_addr sysctl), for architectures that don't define ILLEGAL_POINTER_VALUE. This means that if one of the pointers that is aliased to the pp_magic field (such as page->lru.next) is dereferenced while the page is owned by page_pool, that could lead to a dereference into userspace, which is a security concern. The risk of this is mitigated by the fact that (a) we always clear pp_magic before releasing a page from page_pool, and (b) this would need a use-after-free bug for struct page, which can have many other risks since page->lru.next is used as a generic list pointer in multiple places in the kernel. As such, with this patch we take the position that this risk is negligible in practice. For more discussion, see[1].
Since all the tracking added in this patch is performed on DMA map/unmap, no additional code is needed in the fast path, meaning the performance overhead of this tracking is negligible there. A micro-benchmark shows that the total overhead of the tracking itself is about 400 ns (39 cycles(tsc) 395.218 ns; sum for both map and unmap[2]). Since this cost is only paid on DMA map and unmap, it seems like an acceptable cost to fix the late unmap issue. Further optimisation can narrow the cases where this cost is paid (for instance by eliding the tracking when DMA map/unmap is a no-op).
The extra memory needed to track the pages is neatly encapsulated inside xarray, which uses the 'struct xa_node' structure to track items. This structure is 576 bytes long, with slots for 64 items, meaning that a full node occurs only 9 bytes of overhead per slot it tracks (in practice, it probably won't be this efficient, but in any case it should be an acceptable overhead).
[0] https://lore.kernel.org/all/CAHS8izPg7B5DwKfSuzz-iOop_YRbk3Sd6Y4rX7KBG9DcVJcyWg@mail.gmail.com/
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
--- include/linux/mm.h | 46 ++++++++++++++++++-- include/linux/poison.h | 4 ++ include/net/page_pool/types.h | 6 +++ net/core/netmem_priv.h | 28 +++++++++++- net/core/page_pool.c | 81 +++++++++++++++++++++++++++++------ 5 files changed, 147 insertions(+), 18 deletions(-)
include/linux/mm.h +42 -4
@@ -4243,13 +4243,51 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old) }#endif /* CONFIG_MEM_ALLOC_PROFILING */ +/* +* DMA mapping IDs for page_pool +* +* When DMA-mapping a page, page_pool allocates an ID (from an xarray) and +* stashes it in the upper bits of page->pp_magic. We always want to be able to +* unambiguously identify page pool pages (using page_pool_page_is_pp()). Non-PP +* pages can have arbitrary kernel pointers stored in the same field as pp_magic +* (since it overlaps with page->lru.next), so we must ensure that we cannot +* mistake a valid kernel pointer with any of the values we write into this +* field. +* +* On architectures that set POISON_POINTER_DELTA, this is already ensured, +* since this value becomes part of PP_SIGNATURE; meaning we can just use the +* space between the PP_SIGNATURE value (without POISON_POINTER_DELTA), and the +* lowest bits of POISON_POINTER_DELTA. On arches where POISON_POINTER_DELTA is +* 0, we make sure that we leave the two topmost bits empty, as that guarantees +* we won't mistake a valid kernel pointer for a value we set, regardless of the +* VMSPLIT setting. +* +* Altogether, this means that the number of bits available is constrained by +* the size of an unsigned long (at the upper end, subtracting two bits per the +* above), and the definition of PP_SIGNATURE (with or without +* POISON_POINTER_DELTA). +*/ +#define PP_DMA_INDEX_SHIFT (1 + __fls(PP_SIGNATURE - POISON_POINTER_DELTA)) +#if POISON_POINTER_DELTA >0 +/* PP_SIGNATURE includes POISON_POINTER_DELTA, so limit the size of the DMA +* index to not overlap with that if set +*/ +#define PP_DMA_INDEX_BITS MIN(32, __ffs(POISON_POINTER_DELTA) - PP_DMA_INDEX_SHIFT) +#else +/* Always leave out the topmost two; see above. */ +#define PP_DMA_INDEX_BITS MIN(32, BITS_PER_LONG - PP_DMA_INDEX_SHIFT - 2) +#endif + +#define PP_DMA_INDEX_MASK GENMASK(PP_DMA_INDEX_BITS + PP_DMA_INDEX_SHIFT - 1, \ + PP_DMA_INDEX_SHIFT) +/* Mask used for checking in page_pool_page_is_pp() below. page->pp_magic is * OR'ed with PP_SIGNATURE after the allocation in order to preserve bit 0 for -* the head page of compound page and bit 1 for pfmemalloc page. -* page_is_pfmemalloc() is checked in __page_pool_put_page() to avoid recycling -* the pfmemalloc page. +* the head page of compound page and bit 1 for pfmemalloc page, as well as the +* bits used for the DMA index. page_is_pfmemalloc() is checked in +* __page_pool_put_page() to avoid recycling the pfmemalloc page. */ -#define PP_MAGIC_MASK ~0x3UL +#define PP_MAGIC_MASK ~(PP_DMA_INDEX_MASK | 0x3UL)#ifdef CONFIG_PAGE_POOL static inline bool page_pool_page_is_pp (struct page *page)
include/linux/poison.h +4 -0
@@ -70,6 +70,10 @@#define KEY_DESTROY 0xbd/********** net/core/page_pool.c **********/ +/* +* page_pool uses additional free bits within this value to store data, see the +* definition of PP_DMA_INDEX_MASK in mm.h +*/ #define PP_SIGNATURE (0x40 + POISON_POINTER_DELTA)/********** net/core/skbuff.c **********/
include/net/page_pool/types.h +6 -0
@@ -6,6 +6,7 @@#include <linux/dma-direction.h> #include <linux/ptr_ring.h> #include <linux/types.h> +#include <linux/xarray.h> #include <net/netmem.h> #define PP_FLAG_DMA_MAP BIT(0)/* Should page_pool do the DMA
@@ -33,6 +34,9 @@#define PP_FLAG_ALL (PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV | \ PP_FLAG_SYSTEM_POOL | PP_FLAG_ALLOW_UNREADABLE_NETMEM) +/* Index limit to stay within PP_DMA_INDEX_BITS for DMA indices */ +#define PP_DMA_INDEX_LIMIT XA_LIMIT(1, BIT(PP_DMA_INDEX_BITS) - 1) +/* * Fast allocation side cache array/stack *
@@ -216,6 +220,8 @@ struct page_pool {void *mp_priv; +struct xarray dma_mapped; +#ifdef CONFIG_PAGE_POOL_STATS /* recycle stats are per-cpu to avoid locking */ struct page_pool_recycle_stats __percpu *recycle_stats;
net/core/netmem_priv.h +27 -1
@@ -5,7 +5,7 @@static inline unsigned long netmem_get_pp_magic (netmem_ref netmem) { -return __netmem_clear_lsb (netmem)->pp_magic; +return __netmem_clear_lsb (netmem)->pp_magic & ~PP_DMA_INDEX_MASK ; }static inline void netmem_or_pp_magic (netmem_ref netmem,unsigned long pp_magic)
@@ -15,6 +15,8 @@ static inline void netmem_or_pp_magic(netmem_ref netmem, unsigned long pp_magic)static inline void netmem_clear_pp_magic (netmem_ref netmem) { +WARN_ON_ONCE (__netmem_clear_lsb (netmem)->pp_magic &PP_DMA_INDEX_MASK ); +__netmem_clear_lsb (netmem)->pp_magic =0 ; }
@@ -33,4 +35,28 @@ static inline void netmem_set_dma_addr(netmem_ref netmem, {__netmem_clear_lsb (netmem)->dma_addr = dma_addr; } + +static inline unsigned long netmem_get_dma_index (netmem_ref netmem) +{ +unsigned long magic; + +if (WARN_ON_ONCE (netmem_is_net_iov (netmem))) +return 0 ; + + magic =__netmem_clear_lsb (netmem)->pp_magic; + +return (magic &PP_DMA_INDEX_MASK ) >>PP_DMA_INDEX_SHIFT ; +} + +static inline void netmem_set_dma_index (netmem_ref netmem, +unsigned long id) +{ +unsigned long magic; + +if (WARN_ON_ONCE (netmem_is_net_iov (netmem))) +return ; + + magic =netmem_get_pp_magic (netmem) | (id <<PP_DMA_INDEX_SHIFT ); +__netmem_clear_lsb (netmem)->pp_magic = magic; +}#endif
net/core/page_pool.c +68 -13
153 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 123/512 net: ncsi: Fix GCPS 64-bit member variables
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hari Kalavakunta <[email protected]>
[ Upstream commit e8a1bd8344054ce27bebf59f48e3f6bc10bc419b ]
Correct Get Controller Packet Statistics (GCPS) 64-bit wide member variables, as per DSP0222 v1.0.0 and forward specs. The Driver currently collects these stats, but they are yet to be exposed to the user. Therefore, no user impact.
Statistics fixes:
Total Bytes Received (byte range 28..35)
Total Bytes Transmitted (byte range 36..43) Total Unicast Packets Received (byte range 44..51) Total Multicast Packets Received (byte range 52..59) Total Broadcast Packets Received (byte range 60..67) Total Unicast Packets Transmitted (byte range 68..75) Total Multicast Packets Transmitted (byte range 76..83) Total Broadcast Packets Transmitted (byte range 84..91) Valid Bytes Received (byte range 204..11)
--- net/ncsi/internal.h | 21 ++++++++++----------- net/ncsi/ncsi-pkt.h | 23 +++++++++++------------ net/ncsi/ncsi-rsp.c | 21 ++++++++++----------- 3 files changed, 31 insertions(+), 34 deletions(-)
net/ncsi/internal.h +10 -11
@@ -143,16 +143,15 @@ struct ncsi_channel_vlan_filter { };struct ncsi_channel_stats { -u32 hnc_cnt_hi;/* Counter cleared */ -u32 hnc_cnt_lo;/* Counter cleared */ -u32 hnc_rx_bytes;/* Rx bytes */ -u32 hnc_tx_bytes;/* Tx bytes */ -u32 hnc_rx_uc_pkts;/* Rx UC packets */ -u32 hnc_rx_mc_pkts;/* Rx MC packets */ -u32 hnc_rx_bc_pkts;/* Rx BC packets */ -u32 hnc_tx_uc_pkts;/* Tx UC packets */ -u32 hnc_tx_mc_pkts;/* Tx MC packets */ -u32 hnc_tx_bc_pkts;/* Tx BC packets */ +u64 hnc_cnt;/* Counter cleared */ +u64 hnc_rx_bytes;/* Rx bytes */ +u64 hnc_tx_bytes;/* Tx bytes */ +u64 hnc_rx_uc_pkts;/* Rx UC packets */ +u64 hnc_rx_mc_pkts;/* Rx MC packets */ +u64 hnc_rx_bc_pkts;/* Rx BC packets */ +u64 hnc_tx_uc_pkts;/* Tx UC packets */ +u64 hnc_tx_mc_pkts;/* Tx MC packets */ +u64 hnc_tx_bc_pkts;/* Tx BC packets */ u32 hnc_fcs_err;/* FCS errors */ u32 hnc_align_err;/* Alignment errors */ u32 hnc_false_carrier;/* False carrier detection */
@@ -181,7 +180,7 @@ struct ncsi_channel_stats {u32 hnc_tx_1023_frames;/* Tx 512-1023 bytes frames */ u32 hnc_tx_1522_frames;/* Tx 1024-1522 bytes frames */ u32 hnc_tx_9022_frames;/* Tx 1523-9022 bytes frames */ -u32 hnc_rx_valid_bytes;/* Rx valid bytes */ +u64 hnc_rx_valid_bytes;/* Rx valid bytes */ u32 hnc_rx_runt_pkts;/* Rx error runt packets */ u32 hnc_rx_jabber_pkts;/* Rx error jabber packets */ u32 ncsi_rx_cmds;/* Rx NCSI commands */
net/ncsi/ncsi-pkt.h +11 -12
@@ -252,16 +252,15 @@ struct ncsi_rsp_gp_pkt {/* Get Controller Packet Statistics */ struct ncsi_rsp_gcps_pkt {struct ncsi_rsp_pkt_hdr rsp;/* Response header */ -__be32 cnt_hi;/* Counter cleared */ -__be32 cnt_lo;/* Counter cleared */ -__be32 rx_bytes;/* Rx bytes */ -__be32 tx_bytes;/* Tx bytes */ -__be32 rx_uc_pkts;/* Rx UC packets */ -__be32 rx_mc_pkts;/* Rx MC packets */ -__be32 rx_bc_pkts;/* Rx BC packets */ -__be32 tx_uc_pkts;/* Tx UC packets */ -__be32 tx_mc_pkts;/* Tx MC packets */ -__be32 tx_bc_pkts;/* Tx BC packets */ +__be64 cnt;/* Counter cleared */ +__be64 rx_bytes;/* Rx bytes */ +__be64 tx_bytes;/* Tx bytes */ +__be64 rx_uc_pkts;/* Rx UC packets */ +__be64 rx_mc_pkts;/* Rx MC packets */ +__be64 rx_bc_pkts;/* Rx BC packets */ +__be64 tx_uc_pkts;/* Tx UC packets */ +__be64 tx_mc_pkts;/* Tx MC packets */ +__be64 tx_bc_pkts;/* Tx BC packets */ __be32 fcs_err;/* FCS errors */ __be32 align_err;/* Alignment errors */ __be32 false_carrier;/* False carrier detection */
@@ -290,11 +289,11 @@ struct ncsi_rsp_gcps_pkt {__be32 tx_1023_frames;/* Tx 512-1023 bytes frames */ __be32 tx_1522_frames;/* Tx 1024-1522 bytes frames */ __be32 tx_9022_frames;/* Tx 1523-9022 bytes frames */ -__be32 rx_valid_bytes;/* Rx valid bytes */ +__be64 rx_valid_bytes;/* Rx valid bytes */ __be32 rx_runt_pkts;/* Rx error runt packets */ __be32 rx_jabber_pkts;/* Rx error jabber packets */ __be32 checksum;/* Checksum */ -}; +} __packed__aligned(4) ;/* Get NCSI Statistics */ struct ncsi_rsp_gns_pkt {
net/ncsi/ncsi-rsp.c +10 -11
@@ -926,16 +926,15 @@ static int ncsi_rsp_handler_gcps(struct ncsi_request *nr)/* Update HNC's statistics */ ncs = &nc->stats; - ncs->hnc_cnt_hi =ntohl (rsp->cnt_hi); - ncs->hnc_cnt_lo =ntohl (rsp->cnt_lo); - ncs->hnc_rx_bytes =ntohl (rsp->rx_bytes); - ncs->hnc_tx_bytes =ntohl (rsp->tx_bytes); - ncs->hnc_rx_uc_pkts =ntohl (rsp->rx_uc_pkts); - ncs->hnc_rx_mc_pkts =ntohl (rsp->rx_mc_pkts); - ncs->hnc_rx_bc_pkts =ntohl (rsp->rx_bc_pkts); - ncs->hnc_tx_uc_pkts =ntohl (rsp->tx_uc_pkts); - ncs->hnc_tx_mc_pkts =ntohl (rsp->tx_mc_pkts); - ncs->hnc_tx_bc_pkts =ntohl (rsp->tx_bc_pkts); + ncs->hnc_cnt =be64_to_cpu (rsp->cnt); + ncs->hnc_rx_bytes =be64_to_cpu (rsp->rx_bytes); + ncs->hnc_tx_bytes =be64_to_cpu (rsp->tx_bytes); + ncs->hnc_rx_uc_pkts =be64_to_cpu (rsp->rx_uc_pkts); + ncs->hnc_rx_mc_pkts =be64_to_cpu (rsp->rx_mc_pkts); + ncs->hnc_rx_bc_pkts =be64_to_cpu (rsp->rx_bc_pkts); + ncs->hnc_tx_uc_pkts =be64_to_cpu (rsp->tx_uc_pkts); + ncs->hnc_tx_mc_pkts =be64_to_cpu (rsp->tx_mc_pkts); + ncs->hnc_tx_bc_pkts =be64_to_cpu (rsp->tx_bc_pkts); ncs->hnc_fcs_err =ntohl (rsp->fcs_err); ncs->hnc_align_err =ntohl (rsp->align_err); ncs->hnc_false_carrier =ntohl (rsp->false_carrier);
@@ -964,7 +963,7 @@ static int ncsi_rsp_handler_gcps(struct ncsi_request *nr) ncs->hnc_tx_1023_frames =ntohl (rsp->tx_1023_frames); ncs->hnc_tx_1522_frames =ntohl (rsp->tx_1522_frames); ncs->hnc_tx_9022_frames =ntohl (rsp->tx_9022_frames); - ncs->hnc_rx_valid_bytes =ntohl (rsp->rx_valid_bytes); + ncs->hnc_rx_valid_bytes =be64_to_cpu (rsp->rx_valid_bytes); ncs->hnc_rx_runt_pkts =ntohl (rsp->rx_runt_pkts); ncs->hnc_rx_jabber_pkts =ntohl (rsp->rx_jabber_pkts);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 124/512 libbpf: Fix buffer overflow in bpf_object__init_prog
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viktor Malik <[email protected]>
[ Upstream commit ee684de5c1b0ac01821320826baec7da93f3615b ]
As shown in [1], it is possible to corrupt a BPF ELF file such that arbitrary BPF instructions are loaded by libbpf. This can be done by setting a symbol (BPF program) section offset to a large (unsigned) number such that <section start + symbol offset> overflows and points before the section data in the memory.
Consider the situation below where:
- prog_start = sec_start + symbol_offset <-- size_t overflow here
- prog_end = prog_start + prog_size
prog_start sec_start prog_end sec_end
| | | |
v v v v
.....................|################################|............
The report in [1] also provides a corrupted BPF ELF which can be used as a reproducer:
$ readelf -S crash
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
...
[ 2] uretprobe.mu[...] PROGBITS 0000000000000000 00000040
0000000000000068 0000000000000000 AX 0 0 8 $ readelf -s crash
Symbol table '.symtab' contains 8 entries:
Num: Value Size Type Bind Vis Ndx Name
...
6: ffffffffffffffb8 104 FUNC GLOBAL DEFAULT 2 handle_tpHere, the handle_tp prog has section offset ffffffffffffffb8, i.e. will point before the actual memory where section 2 is allocated.
This is also reported by AddressSanitizer:
=================================================================
==1232==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7c7302fe0000 at pc 0x7fc3046e4b77 bp 0x7ffe64677cd0 sp 0x7ffe64677490
READ of size 104 at 0x7c7302fe0000 thread T0
#0 0x7fc3046e4b76 in memcpy (/lib64/libasan.so.8+0xe4b76)
#1 0x00000040df3e in bpf_object__init_prog /src/libbpf/src/libbpf.c:856
#2 0x00000040df3e in bpf_object__add_programs /src/libbpf/src/libbpf.c:928
#3 0x00000040df3e in bpf_object__elf_collect /src/libbpf/src/libbpf.c:3930
#4 0x00000040df3e in bpf_object_open /src/libbpf/src/libbpf.c:8067
#5 0x00000040f176 in bpf_object__open_file /src/libbpf/src/libbpf.c:8090
#6 0x000000400c16 in main /poc/poc.c:8
#7 0x7fc3043d25b4 in __libc_start_call_main (/lib64/libc.so.6+0x35b4)
#8 0x7fc3043d2667 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x3667)
#9 0x000000400b34 in _start (/poc/poc+0x400b34)
0x7c7302fe0000 is located 64 bytes before 104-byte region [0x7c7302fe0040,0x7c7302fe00a8)
allocated by thread T0 here:
#0 0x7fc3046e716b in malloc (/lib64/libasan.so.8+0xe716b)
#1 0x7fc3045ee600 in __libelf_set_rawdata_wrlock (/lib64/libelf.so.1+0xb600)
#2 0x7fc3045ef018 in __elf_getdata_rdlock (/lib64/libelf.so.1+0xc018)
#3 0x00000040642f in elf_sec_data /src/libbpf/src/libbpf.c:3740The problem here is that currently, libbpf only checks that the program end is within the section bounds. There used to be a check while (sec_off < sec_sz) in bpf_object__add_programs, however, it was removed by commit 6245947c1b3c ("libbpf: Allow gaps in BPF program sections to support overriden weak functions").
Add a check for detecting the overflow of sec_off + prog_sz to bpf_object__init_prog to fix this issue.
[1] https://github.com/lmarch2/poc/blob/main/libbpf/libbpf.md
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -887,7 +887,7 @@ bpf_object__add_programs(struct bpf_object *obj, Elf_Data *sec_data,return -LIBBPF_ERRNO__FORMAT ; } -if (sec_off + prog_sz > sec_sz) { +if (sec_off + prog_sz > sec_sz || sec_off + prog_sz < sec_off) {pr_warn ("sec '%s': program at offset %zu crosses section boundary\n" , sec_name, sec_off);return -LIBBPF_ERRNO__FORMAT ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 125/512 net/mlx5: Avoid using xso.real_dev unnecessarily
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <[email protected]>
[ Upstream commit d79444e8c3d40b11f5e155e5591d53bd1e512e1f ]
xso.real_dev is the active device of an offloaded xfrm state and is managed by bonding. As such, it's subject to change when states are migrated to a new device. Using it in places other than offloading/unoffloading the states is risky.
This commit saves the device into the driver-specific struct mlx5e_ipsec_sa_entry and switches mlx5e_ipsec_init_macs() and mlx5e_ipsec_netevent_event() to make use of it.
Additionally, mlx5e_xfrm_update_stats() used xso.real_dev to validate that correct net locks are held. But in a bonding config, the net of the master device is the same as the underlying devices, and the net is already a local var, so use that instead.
The only remaining references to xso.real_dev are now in the .xdo_dev_state_add() / .xdo_dev_state_delete() path.
--- .../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 16 +++++----------- .../ethernet/mellanox/mlx5/core/en_accel/ipsec.h | 1 + 2 files changed, 6 insertions(+), 11 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +5 -11
@@ -266,8 +266,7 @@ static void mlx5e_ipsec_init_macs(struct mlx5e_ipsec_sa_entry *sa_entry, struct mlx5_accel_esp_xfrm_attrs *attrs) {struct mlx5_core_dev *mdev =mlx5e_ipsec_sa2dev (sa_entry); -struct xfrm_state *x = sa_entry->x; -struct net_device *netdev; +struct net_device *netdev = sa_entry->dev;struct neighbour *n;u8 addr[ETH_ALEN ];const void *pkey;
@@ -277,8 +276,6 @@ static void mlx5e_ipsec_init_macs(struct mlx5e_ipsec_sa_entry *sa_entry, attrs->type != XFRM_DEV_OFFLOAD_PACKET)return ; - netdev = x->xso.real_dev; -mlx5_query_mac_address (mdev, addr);switch (attrs->dir) {case XFRM_DEV_OFFLOAD_IN :
@@ -707,6 +704,7 @@ static int mlx5e_xfrm_add_state(struct xfrm_state *x,return -ENOMEM ; sa_entry->x = x; + sa_entry->dev = netdev; sa_entry->ipsec = ipsec;/* Check if this SA is originated from acquire flow temporary SA */ if (x->xso.flags &XFRM_DEV_OFFLOAD_FLAG_ACQ )
@@ -849,8 +847,6 @@ static int mlx5e_ipsec_netevent_event(struct notifier_block *nb,struct mlx5e_ipsec_sa_entry *sa_entry;struct mlx5e_ipsec *ipsec;struct neighbour *n = ptr; -struct net_device *netdev; -struct xfrm_state *x;unsigned long idx;if (event !=NETEVENT_NEIGH_UPDATE || !(n->nud_state &NUD_VALID ))
@@ -870,11 +866,9 @@ static int mlx5e_ipsec_netevent_event(struct notifier_block *nb,continue ; } - x = sa_entry->x; - netdev = x->xso.real_dev; data = sa_entry->work->data; -neigh_ha_snapshot (data->addr, n, netdev); +neigh_ha_snapshot (data->addr, n, sa_entry->dev);queue_work (ipsec->wq, &sa_entry->work->work); }
@@ -1005,8 +999,8 @@ static void mlx5e_xfrm_update_stats(struct xfrm_state *x)size_t headers;lockdep_assert (lockdep_is_held (&x->lock) || -lockdep_is_held (&dev_net (x->xso.real_dev)->xfrm.xfrm_cfg_mutex) || -lockdep_is_held (&dev_net (x->xso.real_dev)->xfrm.xfrm_state_lock)); +lockdep_is_held (&net->xfrm.xfrm_cfg_mutex) || +lockdep_is_held (&net->xfrm.xfrm_state_lock));if (x->xso.flags &XFRM_DEV_OFFLOAD_FLAG_ACQ )return ;
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h +1 -0
@@ -260,6 +260,7 @@ struct mlx5e_ipsec_limits {struct mlx5e_ipsec_sa_entry {struct mlx5e_ipsec_esn_state esn_state;struct xfrm_state *x; +struct net_device *dev;struct mlx5e_ipsec *ipsec;struct mlx5_accel_esp_xfrm_attrs attrs; void (*set_iv_op)(struct sk_buff *skb, struct xfrm_state *x,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 126/512 xfrm: Use xdo.dev instead of xdo.real_dev
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cosmin Ratiu <[email protected]>
[ Upstream commit 25ac138f58e7d5c8bffa31e8891418d2819180c4 ]
The policy offload struct was reused from the state offload and real_dev was copied from dev, but it was never set to anything else. Simplify the code by always using xdo.dev for policies.
--- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 2 +- net/xfrm/xfrm_device.c | 2 -- net/xfrm/xfrm_state.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +1 -1
@@ -1135,7 +1135,7 @@ mlx5e_ipsec_build_accel_pol_attrs(struct mlx5e_ipsec_pol_entry *pol_entry,static int mlx5e_xfrm_add_policy (struct xfrm_policy *x,struct netlink_ext_ack *extack) { -struct net_device *netdev = x->xdo.real_dev; +struct net_device *netdev = x->xdo.dev;struct mlx5e_ipsec_pol_entry *pol_entry;struct mlx5e_priv *priv;int err;
net/xfrm/xfrm_device.c +0 -2
@@ -373,7 +373,6 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp, xdo->dev = dev;netdev_tracker_alloc (dev, &xdo->dev_tracker,GFP_ATOMIC ); - xdo->real_dev = dev; xdo->type =XFRM_DEV_OFFLOAD_PACKET ;switch (dir) {case XFRM_POLICY_IN :
@@ -395,7 +394,6 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp, err = dev->xfrmdev_ops->xdo_dev_policy_add (xp, extack);if (err) { xdo->dev =NULL ; - xdo->real_dev =NULL ; xdo->type =XFRM_DEV_OFFLOAD_UNSPECIFIED ; xdo->dir =0 ;netdev_put (dev, &xdo->dev_tracker);
net/xfrm/xfrm_state.c +0 -2
@@ -1487,7 +1487,6 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, xso->type =XFRM_DEV_OFFLOAD_PACKET ; xso->dir = xdo->dir; xso->dev = xdo->dev; - xso->real_dev = xdo->real_dev; xso->flags =XFRM_DEV_OFFLOAD_FLAG_ACQ ;netdev_hold (xso->dev, &xso->dev_tracker,GFP_ATOMIC ); error = xso->dev->xfrmdev_ops->xdo_dev_state_add (x,NULL );
@@ -1495,7 +1494,6 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, xso->dir =0 ;netdev_put (xso->dev, &xso->dev_tracker); xso->dev =NULL ; - xso->real_dev =NULL ; xso->type =XFRM_DEV_OFFLOAD_UNSPECIFIED ; x->km.state =XFRM_STATE_DEAD ; to_put = x;
Signature · 1 line
2.39.5
Re: [PATCH 6.12 126/512] xfrm: Use xdo.dev instead of xdo.real_dev
Quoted 8 lines
From: Cosmin Ratiu <[email protected]>
[ Upstream commit
25ac138f58e7d5c8bffa31e8891418d2819180c4]The policy offload struct was reused from the state offload and
real_devwas copied from dev, but it was never set to anything else. Simplify the code by always using xdo.dev for policies.
Cleanup, not a bugfix.
BR,
Pavel
Quoted 50 lines
+++
b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.cdrivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +1
-1@@ -1135,7 +1135,7 @@ mlx5e_ipsec_build_accel_pol_attrs(struct mlx5e_ipsec_pol_entry *pol_entry,static int mlx5e_xfrm_add_policy (struct xfrm_policy *x,struct netlink_ext_ack *extack) { -struct net_device *netdev = x->xdo.real_dev; +struct net_device *netdev = x->xdo.dev;struct mlx5e_ipsec_pol_entry *pol_entry;struct mlx5e_priv *priv;int err;net/xfrm/xfrm_device.c +0
-2@@ -373,7 +373,6 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp, xdo->dev = dev;netdev_tracker_alloc (dev, &xdo->dev_tracker,GFP_ATOMIC ); - xdo->real_dev = dev; xdo->type =XFRM_DEV_OFFLOAD_PACKET ;switch (dir) {case XFRM_POLICY_IN :@@ -395,7 +394,6 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp, err = dev->xfrmdev_ops->xdo_dev_policy_add (xp, extack);if (err) { xdo->dev =NULL ; - xdo->real_dev =NULL ; xdo->type =XFRM_DEV_OFFLOAD_UNSPECIFIED ; xdo->dir =0 ;netdev_put (dev, &xdo->dev_tracker);net/xfrm/xfrm_state.c +0
-2@@ -1487,7 +1487,6 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, xso->type =XFRM_DEV_OFFLOAD_PACKET ; xso->dir = xdo->dir; xso->dev = xdo->dev; - xso->real_dev = xdo->real_dev; xso->flags =XFRM_DEV_OFFLOAD_FLAG_ACQ ;netdev_hold (xso->dev, &xso->dev_tracker,GFP_ATOMIC ); error = xso->dev->xfrmdev_ops->xdo_dev_state_add (x,NULL );@@ -1495,7 +1494,6 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr, xso->dir =0 ;netdev_put (xso->dev, &xso->dev_tracker); xso->dev =NULL ; - xso->real_dev =NULL ; xso->type =XFRM_DEV_OFFLOAD_UNSPECIFIED ; x->km.state =XFRM_STATE_DEAD ; to_put = x;
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Greg Kroah-Hartman
maintainerPATCH 127/512 wifi: rtw88: sdio: map mgmt frames to queue TX_DESC_QSEL_MGMT
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhen XIN <[email protected]>
[ Upstream commit b2effcdc237979dcc533d446a792fc54fd0e1213 ]
The rtw88-sdio do not work in AP mode due to the lack of TX status report for management frames.
Map the management frames to queue TX_DESC_QSEL_MGMT, which enables the chip to generate TX reports for these frames
Tested-on: rtl8723ds
--- drivers/net/wireless/realtek/rtw88/sdio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw88/sdio.c +1 -4
@@ -718,10 +718,7 @@ static u8 rtw_sdio_get_tx_qsel(struct rtw_dev *rtwdev, struct sk_buff *skb,case RTW_TX_QUEUE_H2C :return TX_DESC_QSEL_H2C ;case RTW_TX_QUEUE_MGMT : -if (rtw_chip_wcpu_11n (rtwdev)) -return TX_DESC_QSEL_HIGH ; -else -return TX_DESC_QSEL_MGMT ; +return TX_DESC_QSEL_MGMT ;case RTW_TX_QUEUE_HI0 :return TX_DESC_QSEL_HIGH ;default :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 128/512 wifi: rtw88: sdio: call rtw_sdio_indicate_tx_status unconditionally
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhen XIN <[email protected]>
[ Upstream commit fc5f5a0ec463ae6a07850428bd3082947e01d276 ]
The rtw88-sdio do not work in AP mode due to the lack of TX status report for management frames.
Make the invocation of rtw_sdio_indicate_tx_status unconditional and cover all packet queues
Tested-on: rtl8723ds
--- drivers/net/wireless/realtek/rtw88/sdio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw88/sdio.c +1 -4
@@ -1225,10 +1225,7 @@ static void rtw_sdio_process_tx_queue(struct rtw_dev *rtwdev,return ; } -if (queue <=RTW_TX_QUEUE_VO ) -rtw_sdio_indicate_tx_status (rtwdev, skb); -else -dev_kfree_skb_any (skb); +rtw_sdio_indicate_tx_status (rtwdev, skb); }static void rtw_sdio_tx_handler (struct work_struct *work)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 129/512 wifi: rtw88: do not ignore hardware read error during DPK
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit 20d3c19bd8f9b498173c198eadf54580c8caa336 ]
In 'rtw8822c_dpk_cal_coef1()', do not ignore error returned by 'check_hw_ready()' but issue a warning to denote possible DPK issue. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/rtw8822c.c +2 -1
@@ -3993,7 +3993,8 @@ static void rtw8822c_dpk_cal_coef1(struct rtw_dev *rtwdev)rtw_write32 (rtwdev,REG_NCTL0 ,0x00001148 );rtw_write32 (rtwdev,REG_NCTL0 ,0x00001149 ); -check_hw_ready (rtwdev,0x2d9c ,MASKBYTE0 ,0x55 ); +if (!check_hw_ready (rtwdev,0x2d9c ,MASKBYTE0 ,0x55 )) +rtw_warn (rtwdev,"DPK stuck, performance may be suboptimal" );rtw_write8 (rtwdev,0x1b10 ,0x0 );rtw_write32_mask (rtwdev,REG_NCTL0 ,BIT_SUBPAGE ,0x0000000c );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 130/512 wifi: ath12k: fix invalid access to memory
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarika Sharma <[email protected]>
[ Upstream commit 9f17747fbda6fca934854463873c4abf8061491d ]
In ath12k_dp_rx_msdu_coalesce(), rxcb is fetched from skb and boolean is_continuation is part of rxcb.
Currently, after freeing the skb, the rxcb->is_continuation accessed again which is wrong since the memory is already freed. This might lead use-after-free error.
Hence, fix by locally defining bool is_continuation from rxcb, so that after freeing skb, is_continuation can be used.
Compile tested only.
--- drivers/net/wireless/ath/ath12k/dp_rx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/dp_rx.c +4 -2
@@ -1762,6 +1762,7 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar,struct hal_rx_desc *ldesc;int space_extra, rem_len, buf_len;u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; +bool is_continuation;/* As the msdu is spread across multiple rx buffers, * find the offset to the start of msdu for computing
@@ -1810,7 +1811,8 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar, rem_len = msdu_len - buf_first_len;while ((skb =__skb_dequeue (msdu_list)) !=NULL && rem_len >0 ) { rxcb =ATH12K_SKB_RXCB (skb); -if (rxcb->is_continuation) + is_continuation = rxcb->is_continuation; +if (is_continuation) buf_len =DP_RX_BUFFER_SIZE - hal_rx_desc_sz;else buf_len = rem_len;
@@ -1828,7 +1830,7 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar,dev_kfree_skb_any (skb); rem_len -= buf_len; -if (!rxcb->is_continuation) +if (!is_continuation)break ; }
Signature · 1 line
2.39.5