6.8.3-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainercover 6.8.3-rc1 review
This is the start of the stable review cycle for the 6.8.3 release. There are 399 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 03 Apr 2024 15:24:46 +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.8.3-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.8.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.8.3-rc1
Natanael Copa <[email protected]>
tools/resolve_btfids: fix build with musl libc
Kevin Loughlin <[email protected]>
x86/sev: Skip ROM range scans and validation for SEV-SNP guests
Sandipan Das <[email protected]>
perf/x86/amd/core: Update and fix stalled-cycles-* events for Zen 2 and later
Xingui Yang <[email protected]>
scsi: libsas: Fix disk not being scanned in after being removed
Xingui Yang <[email protected]>
scsi: libsas: Add a helper sas_get_sas_addr_and_dev_type()
Muhammad Usama Anjum <[email protected]>
scsi: lpfc: Correct size for wqe for memset()
Muhammad Usama Anjum <[email protected]>
scsi: lpfc: Correct size for cmdwqe/rspwqe for memset()
Heikki Krogerus <[email protected]>
usb: dwc3: pci: Drop duplicate ID
Dave Hansen <[email protected]>
Revert "x86/bugs: Use fixed addressing for VERW operand"
Pawan Gupta <[email protected]>
x86/bugs: Use fixed addressing for VERW operand
Hamza Mahfooz <[email protected]>
drm/amd/display: fix IPX enablement
Baoquan He <[email protected]>
crash: use macro to add crashk_res into iomem early for specific arch
Borislav Petkov (AMD) <[email protected]>
x86/bugs: Fix the SRSO mitigation on Zen3/4
Quinn Tran <[email protected]>
scsi: qla2xxx: Delay I/O Abort on PCI error
Saurav Kashyap <[email protected]>
scsi: qla2xxx: Change debug message during driver unload
Saurav Kashyap <[email protected]>
scsi: qla2xxx: Fix double free of fcport
Saurav Kashyap <[email protected]>
scsi: qla2xxx: Fix double free of the ha->vp_map pointer
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix command flush on cable pull
Quinn Tran <[email protected]>
scsi: qla2xxx: NVME|FCP prefer flag not being honored
Bikash Hazarika <[email protected]>
scsi: qla2xxx: Update manufacturer detail
Quinn Tran <[email protected]>
scsi: qla2xxx: Split FCE|EFT trace control
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix N2N stuck connection
Quinn Tran <[email protected]>
scsi: qla2xxx: Prevent command send on chip reset
Christian A. Ehrhardt <[email protected]>
usb: typec: ucsi: Clear UCSI_CCI_RESET_COMPLETE before reset
Christian A. Ehrhardt <[email protected]>
usb: typec: ucsi_acpi: Refactor and fix DELL quirk
Christian A. Ehrhardt <[email protected]>
usb: typec: ucsi: Ack unsupported commands
Christian A. Ehrhardt <[email protected]>
usb: typec: ucsi: Check for notifications after init
Christian A. Ehrhardt <[email protected]>
usb: typec: ucsi: Clear EVENT_PENDING under PPM lock
Kyle Tso <[email protected]>
usb: typec: Return size of buffer if pd_set operation succeeds
Kyle Tso <[email protected]>
usb: typec: tcpm: Update PD of Type-C port upon pd_set
Kyle Tso <[email protected]>
usb: typec: tcpm: Correct port source pdo array in pd_set callback
Xu Yang <[email protected]>
usb: typec: tcpm: fix double-free issue in tcpm_port_unregister_pd()
Krishna Kurapati <[email protected]>
usb: typec: ucsi: Fix race between typec_switch and role_switch
yuan linyu <[email protected]>
usb: udc: remove warning when queue disabled ep
Minas Harutyunyan <[email protected]>
usb: dwc2: gadget: LPM flow fix
Minas Harutyunyan <[email protected]>
usb: dwc2: gadget: Fix exiting from clock gating
Minas Harutyunyan <[email protected]>
usb: dwc2: host: Fix ISOC flow in DDMA mode
Minas Harutyunyan <[email protected]>
usb: dwc2: host: Fix hibernation flow
Minas Harutyunyan <[email protected]>
usb: dwc2: host: Fix remote wakeup from hibernation
Alan Stern <[email protected]>
USB: core: Fix deadlock in port "disable" sysfs attribute
Alan Stern <[email protected]>
USB: core: Add hub_get() and hub_put() routines
Alan Stern <[email protected]>
USB: core: Fix deadlock in usb_deauthorize_interface()
Thinh Nguyen <[email protected]>
usb: dwc3: Properly set system wakeup
Rafael J. Wysocki <[email protected]>
genirq: Introduce IRQF_COND_ONESHOT and use it in pinctrl-amd
Dan Carpenter <[email protected]>
staging: vc04_services: fix information leak in create_component()
Arnd Bergmann <[email protected]>
staging: vc04_services: changen strncpy() to strscpy_pad()
Guilherme G. Piccoli <[email protected]>
scsi: core: Fix unremoved procfs host directory regression
Alexander Wetzel <[email protected]>
scsi: sg: Avoid sg device teardown race
Damien Le Moal <[email protected]>
scsi: sd: Fix TCG OPAL unlock on system resume
Dmitry Baryshkov <[email protected]>
scsi: ufs: qcom: Provide default cycles_in_1us value
Duoming Zhou <[email protected]>
ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs
Filipe Manana <[email protected]>
btrfs: fix extent map leak in unexpected scenario at unpin_extent_cache()
Steven Rostedt (Google) <[email protected]>
ring-buffer: Make wake once of ring_buffer_wait() more robust
Brett Creeley <[email protected]>
vfio/pds: Make sure migration file isn't accessed after reset
Weitao Wang <[email protected]>
USB: UAS: return ENODEV when submit urbs fail with device not attached
Yongzhi Liu <[email protected]>
usb: misc: ljca: Fix double free in error handling path
Oliver Neukum <[email protected]>
usb: cdc-wdm: close race between read and workqueue
Alexander Stein <[email protected]>
Revert "usb: phy: generic: Get the vbus supply"
Ezra Buehler <[email protected]>
mtd: spinand: Add support for 5-byte IDs
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_sync: Fix not checking error on hci_cmd_sync_cancel_sync
Roman Li <[email protected]>
drm/amd/display: Fix bounds check for dcn35 DcfClocks
Chris Wilson <[email protected]>
drm/i915/gt: Reset queue_priority_hint on parking
Ville Syrjälä <[email protected]>
drm/i915: Pre-populate the cursor physical dma address
Jonathon Hall <[email protected]>
drm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed()
Ville Syrjälä <[email protected]>
drm/i915/dsb: Fix DSB vblank waits when using VRR
Ville Syrjälä <[email protected]>
drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly
Ville Syrjälä <[email protected]>
drm/i915/vrr: Generate VRR "safe window" for DSB
Ville Syrjälä <[email protected]>
drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
Janusz Krzysztofik <[email protected]>
drm/i915/vma: Fix UAF on destroy against retire race
Janusz Krzysztofik <[email protected]>
drm/i915/hwmon: Fix locking inversion in sysfs getter
Xi Liu <[email protected]>
drm/amd/display: Set DCN351 BB and IP the same as DCN35
George Shen <[email protected]>
drm/amd/display: Remove MPC rate control logic from DCN30 and above
Johannes Weiner <[email protected]>
drm/amdgpu: fix deadlock while reading mqd from debugfs
Eric Huang <[email protected]>
drm/amdkfd: fix TLB flush after unmap for GFX9.4.2
Jocelyn Falempe <[email protected]>
drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed
Chris Bainbridge <[email protected]>
drm/dp: Fix divide-by-zero regression on DP MST unplug with nouveau
Matthew Auld <[email protected]>
drm/xe/query: fix gt_id bounds check
Christian Marangi <[email protected]>
net: phy: qcom: at803x: fix kernel panic with at8031_probe
Herve Codina <[email protected]>
net: wan: framer: Add missing static inline qualifiers
Claus Hansen Ries <[email protected]>
net: ll_temac: platform_get_resource replaced by wrong function
Duoming Zhou <[email protected]>
nouveau/dmem: handle kcalloc() allocation failure
Daniel Lezcano <[email protected]>
Revert "thermal: core: Don't update trip points inside the hysteresis range"
Ye Zhang <[email protected]>
thermal: devfreq_cooling: Fix perf state when calculate dfc res_util
Damien Le Moal <[email protected]>
block: Do not force full zone append completion in req_bio_endio()
Liming Sun <[email protected]>
sdhci-of-dwcmshc: disable PM runtime in dwcmshc_remove()
Mikko Rapeli <[email protected]>
mmc: core: Avoid negative index with array access
Mikko Rapeli <[email protected]>
mmc: core: Initialize mmc_blk_ioc_data
Romain Naour <[email protected]>
mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode
Edward Liaw <[email protected]>
selftests/mm: fix ARM related issue with fork after pthread_create
Edward Liaw <[email protected]>
selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM
Johannes Weiner <[email protected]>
mm: cachestat: fix two shmem bugs
Nathan Chancellor <[email protected]>
hexagon: vmlinux.lds.S: handle attributes section
Max Filippov <[email protected]>
exec: Fix NOMMU linux_binprm::exec in transfer_args_to_stack()
Thomas Zimmermann <[email protected]>
fbdev: Select I/O-memory framebuffer ops for SBus
Bartosz Golaszewski <[email protected]>
gpio: cdev: sanitize the label before requesting the interrupt
Harry Wentland <[email protected]>
Revert "drm/amd/display: Fix sending VSC (+ colorimetry) packets for DP/eDP displays without PSR"
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: handle debugfs names more carefully
Johannes Berg <[email protected]>
wifi: iwlwifi: fw: don't always use FW dump trig
Johannes Berg <[email protected]>
wifi: iwlwifi: mvm: disable MLO for the time being
Johannes Berg <[email protected]>
wifi: cfg80211: add a flag to disable wireless extensions
Felix Fietkau <[email protected]>
wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes
Johannes Thumshirn <[email protected]>
btrfs: zoned: fix use-after-free in do_zone_finish()
Johannes Thumshirn <[email protected]>
btrfs: zoned: use zone aware sb location for scrub
Johannes Thumshirn <[email protected]>
btrfs: zoned: don't skip block groups with 100% zone unusable
Tavian Barnes <[email protected]>
btrfs: fix race in read_extent_buffer_pages()
Anand Jain <[email protected]>
btrfs: validate device maj:min during open
Carlos Maiolino <[email protected]>
tmpfs: fix race on handling dquot rbtree
Zev Weiss <[email protected]>
ARM: prctl: reject PR_SET_MDWE on pre-ARMv6
Zev Weiss <[email protected]>
prctl: generalize PR_SET_MDWE support check to be per-arch
Ard Biesheuvel <[email protected]>
x86/efistub: Reinstate soft limit for initrd loading
Ard Biesheuvel <[email protected]>
efi/libstub: Cast away type warning in use of max()
Ard Biesheuvel <[email protected]>
x86/efistub: Add missing boot_params for mixed mode compat entry
John Sperbeck <[email protected]>
init: open /initrd.image with O_LARGEFILE
Johannes Weiner <[email protected]>
mm: zswap: fix writeback shinker GFP_NOIO/GFP_NOFS recursion
Gergo Koteles <[email protected]>
ALSA: hda/tas2781: add locks to kcontrols
Gergo Koteles <[email protected]>
ALSA: hda/tas2781: remove digital gain kcontrol
Chris Park <[email protected]>
drm/amd/display: Prevent crash when disable stream
Tom Zanussi <[email protected]>
crypto: iaa - Fix nr_cpus < nr_iaa case
Ville Syrjälä <[email protected]>
drm/i915: Suppress old PLL pipe_mask checks for MG/TC/TBT PLLs
Ville Syrjälä <[email protected]>
drm/i915: Include the PLL name in the debug messages
Ville Syrjälä <[email protected]>
drm/i915: Try to preserve the current shared_dpll for fastset on type-c ports
Ville Syrjälä <[email protected]>
drm/i915: Replace a memset() with zero initialization
Aleksandrs Vinarskis <[email protected]>
mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530
Aleksandrs Vinarskis <[email protected]>
mfd: intel-lpss: Switch to generalized quirk table
Anand Jain <[email protected]>
btrfs: do not skip re-registration for the mounted device
Filipe Manana <[email protected]>
btrfs: fix warning messages not printing interval at unpin_extent_range()
David Sterba <[email protected]>
btrfs: handle errors returned from unpin_extent_cache()
Vitaly Chikunov <[email protected]>
selftests/mm: Fix build with _FORTIFY_SOURCE
Zoltan HERPAI <[email protected]>
pwm: img: fix pwm clock lookup
Oleksandr Tymoshenko <[email protected]>
efi: fix panic in kdump kernel
Adamos Ttofari <[email protected]>
x86/fpu: Keep xfd_state in sync with MSR_IA32_XFD
Thomas Gleixner <[email protected]>
x86/mpparse: Register APIC address only once
KONDO KAZUMA(近藤 和真) <[email protected]>
efi/libstub: fix efi_random_alloc() to allocate memory at alloc_min or higher address
Masami Hiramatsu (Google) <[email protected]>
kprobes/x86: Use copy_from_kernel_nofault() to read from unsafe address
Biju Das <[email protected]>
irqchip/renesas-rzg2l: Prevent spurious interrupts when setting trigger type
Biju Das <[email protected]>
irqchip/renesas-rzg2l: Rename rzg2l_irq_eoi()
Biju Das <[email protected]>
irqchip/renesas-rzg2l: Rename rzg2l_tint_eoi()
Biju Das <[email protected]>
irqchip/renesas-rzg2l: Flush posted write in irq_eoi()
John Ogness <[email protected]>
printk: Update @console_may_schedule in console_trylock_spinning()
Nicolin Chen <[email protected]>
iommu/dma: Force swiotlb_max_mapping_size on an untrusted device
Will Deacon <[email protected]>
swiotlb: Fix alignment checks when both allocation and DMA masks are present
Will Deacon <[email protected]>
swiotlb: Honour dma_alloc_coherent() alignment in swiotlb_alloc()
Will Deacon <[email protected]>
swiotlb: Fix double-allocation of slots due to broken alignment handling
André Rösti <[email protected]>
entry: Respect changes to system call number by trace_sys_enter()
Yongqiang Liu <[email protected]>
ARM: 9359/1: flush: check if the folio is reserved for no-mapping addresses
Ard Biesheuvel <[email protected]>
ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores
Martin Blumenstingl <[email protected]>
clocksource/drivers/arm_global_timer: Fix maximum prescaler value
Ard Biesheuvel <[email protected]>
x86/sev: Fix position dependent variable references in startup code
Borislav Petkov (AMD) <[email protected]>
x86/Kconfig: Remove CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
Bitterblue Smith <[email protected]>
wifi: rtw88: 8821cu: Fix connection failure
Linus Torvalds <[email protected]>
Fix memory leak in posix_clock_open()
Jiawei Wang <[email protected]>
ASoC: amd: yc: Revert "add new YC platform variant (0x63) support"
Jiawei Wang <[email protected]>
ASoC: amd: yc: Revert "Fix non-functional mic on Lenovo 21J2"
Ard Biesheuvel <[email protected]>
x86/efistub: Call mixed mode boot services on the firmware's stack
Eric Biggers <[email protected]>
Revert "crypto: pkcs7 - remove sha1 support"
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: reject constant set with timeout
Mario Limonciello <[email protected]>
drm/amd/display: Use freesync when DRM_EDID_FEATURE_CONTINUOUS_FREQ found
Audra Mitchell <[email protected]>
workqueue: Shorten events_freezable_power_efficient name
Wenjing Liu <[email protected]>
drm/amd/display: Revert Remove pixle rate limit for subvp
Alvin Lee <[email protected]>
drm/amd/display: Remove pixle rate limit for subvp
Jani Nikula <[email protected]>
drm/bridge: lt8912b: do not return negative values from .get_modes()
Jani Nikula <[email protected]>
drm/bridge: lt8912b: clear the EDID property on failures
Jani Nikula <[email protected]>
drm/bridge: lt8912b: use drm_bridge_edid_read()
Jani Nikula <[email protected]>
drm/bridge: add ->edid_read hook and drm_bridge_edid_read()
Alex Williamson <[email protected]>
vfio/pci: Create persistent INTx handler
Alex Williamson <[email protected]>
vfio: Introduce interface to flush virqfd inject workqueue
Qu Wenruo <[email protected]>
btrfs: qgroup: validate btrfs_qgroup_inherit parameter
David Sterba <[email protected]>
btrfs: add helper to get fs_info from struct inode pointer
David Sterba <[email protected]>
btrfs: add helpers to get fs_info from page/folio pointers
David Sterba <[email protected]>
btrfs: add helpers to get inode from page/folio pointers
David Sterba <[email protected]>
btrfs: replace sb::s_blocksize by fs_info::sectorsize
Matthew Wilcox (Oracle) <[email protected]>
btrfs: add set_folio_extent_mapped() helper
Nicholas Kazlauskas <[email protected]>
drm/amd/display: Add more checks for exiting idle in DC
Aric Cyr <[email protected]>
drm/amd/display: Unify optimize_required flags and VRR adjustments
Zack Rusin <[email protected]>
drm/ttm: Make sure the mapped tt pages are decrypted when needed
Hector Martin <[email protected]>
wifi: brcmfmac: Demote vendor-specific attach/detach messages to info
Hector Martin <[email protected]>
wifi: brcmfmac: cfg80211: Use WSEC to set SAE password
Arend van Spriel <[email protected]>
wifi: brcmfmac: add per-vendor feature detection callback
Anton Altaparmakov <[email protected]>
x86/pm: Work around false positive kmemleak report in msr_build_context()
Mikulas Patocka <[email protected]>
dm snapshot: fix lockup in dm_exception_table_exit
Leo Ma <[email protected]>
drm/amd/display: Fix noise issue on HDMI AV mute
Allen Pan <[email protected]>
drm/amd/display: Add a dc_state NULL check in dc_state_release
Rodrigo Siqueira <[email protected]>
drm/amd/display: Return the correct HDCP error code
Wenjing Liu <[email protected]>
drm/amd/display: Implement wait_for_odm_update_pending_complete
Wenjing Liu <[email protected]>
drm/amd/display: Lock all enabled otg pipes even with no planes
ChunTao Tso <[email protected]>
drm/amd/display: Amend coasting vtotal for replay low hz
Nicholas Kazlauskas <[email protected]>
drm/amd/display: Fix idle check for shared firmware state
Wenjing Liu <[email protected]>
drm/amd/display: Update odm when ODM combine is changed on an otg master pipe with no plane
Dillon Varone <[email protected]>
drm/amd/display: Init DPPCLK from SMU on dcn32
Josip Pavic <[email protected]>
drm/amd/display: Allow dirty rects to be sent to dmub when abm is active
Sohaib Nadeem <[email protected]>
drm/amd/display: Override min required DCFCLK in dml1_validate
Ma Jun <[email protected]>
drm/amdgpu/pm: Check the validity of overdiver power limit
Ma Jun <[email protected]>
drm/amdgpu/pm: Fix NULL pointer dereference when get power limit
Philip Yang <[email protected]>
drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag
Swapnil Patel <[email protected]>
drm/amd/display: Change default size for dummy plane in DML2
Conrad Kostecki <[email protected]>
ahci: asm1064: asm1166: don't limit reported ports
Jason A. Donenfeld <[email protected]>
wireguard: selftests: set RISCV_ISA_FALLBACK on riscv{32,64}Jason A. Donenfeld <[email protected]>
wireguard: netlink: access device through ctx instead of peer
Jason A. Donenfeld <[email protected]>
wireguard: netlink: check for dangling peer via is_dead instead of empty list
Yuli Wang <[email protected]>
LoongArch/crypto: Clean up useless assignment operations
Huacai Chen <[email protected]>
LoongArch: Define the __io_aw() hook as mmiowb()
Huacai Chen <[email protected]>
LoongArch: Change __my_cpu_offset definition to avoid mis-optimization
David Hildenbrand <[email protected]>
virtio: reenable config if freezing device failed
Namjae Jeon <[email protected]>
ksmbd: fix potencial out-of-bounds when buffer offset is invalid
Alison Schofield <[email protected]>
cxl/trace: Properly initialize cxl_poison region name
Steven Rostedt (Google) <[email protected]>
net: hns3: tracing: fix hclgevf trace event strings
Steven Rostedt (Google) <[email protected]>
drm/i915: Add missing ; to __assign_str() macros in tracepoint code
Steven Rostedt (Google) <[email protected]>
NFSD: Fix nfsd_clid_class use of __string_len() macro
Dragos Tatulea <[email protected]>
net: esp: fix bad handling of pages from page_pool
Namjae Jeon <[email protected]>
ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()
Borislav Petkov (AMD) <[email protected]>
x86/CPU/AMD: Update the Zenbleed microcode revisions
Jens Axboe <[email protected]>
io_uring/waitid: always remove waitid entry for cancel all
Jens Axboe <[email protected]>
io_uring/futex: always remove futex entry for cancel all
Marek Szyprowski <[email protected]>
cpufreq: dt: always allocate zeroed cpumask
Miquel Raynal <[email protected]>
mtd: rawnand: Constrain even more when continuous reads are enabled
Miquel Raynal <[email protected]>
mtd: rawnand: Ensure all continuous terms are always in sync
Miquel Raynal <[email protected]>
mtd: rawnand: Add a helper for calculating a page index
Miquel Raynal <[email protected]>
mtd: rawnand: Fix and simplify again the continuous read derivations
Eugene Korenevsky <[email protected]>
cifs: open_cached_dir(): add FILE_READ_EA to desired access
Shyam Prasad N <[email protected]>
cifs: reduce warning log level for server not advertising interfaces
Shyam Prasad N <[email protected]>
cifs: make sure server interfaces are requested only for SMB3+
Ryusuke Konishi <[email protected]>
nilfs2: prevent kernel bug at submit_bh_wbc()
Ryusuke Konishi <[email protected]>
nilfs2: fix failure to detect DAT corruption in btree and direct mappings
Sunmin Jeong <[email protected]>
f2fs: truncate page cache before clearing flags when aborting atomic write
Sunmin Jeong <[email protected]>
f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag
Paul Moore <[email protected]>
lsm: handle the NULL buffer case in lsm_fill_user_ctx()
Casey Schaufler <[email protected]>
lsm: use 32-bit compatible data types in LSM syscalls
Bart Van Assche <[email protected]>
Revert "block/mq-deadline: use correct way to throttling write requests"
Qiang Zhang <[email protected]>
memtest: use {READ,WRITE}_ONCE in memory scanning
Ley Foon Tan <[email protected]>
clocksource/drivers/timer-riscv: Clear timer interrupt on timer initialization
Jani Nikula <[email protected]>
drm/vc4: hdmi: do not return negative values from .get_modes()
Jani Nikula <[email protected]>
drm/imx/ipuv3: do not return negative values from .get_modes()
Jani Nikula <[email protected]>
drm/exynos: do not return negative values from .get_modes()
Jani Nikula <[email protected]>
drm/panel: do not return negative error codes from drm_panel_get_modes()
Jani Nikula <[email protected]>
drm/probe-helper: warn about negative .get_modes()
Harald Freudenberger <[email protected]>
s390/zcrypt: fix reference counting on zcrypt card objects
Sean Anderson <[email protected]>
soc: fsl: qbman: Use raw spinlock for cgr_lock
Sean Anderson <[email protected]>
soc: fsl: qbman: Always disable interrupts when taking cgr_lock
Alexander Aring <[email protected]>
dlm: fix user space lkb refcounting
Steven Rostedt (Google) <[email protected]>
tracing/ring-buffer: Fix wait_on_pipe() race
Steven Rostedt (Google) <[email protected]>
ring-buffer: Use wait_event_interruptible() in ring_buffer_wait()
Steven Rostedt (Google) <[email protected]>
ring-buffer: Fix full_waiters_pending in poll
Steven Rostedt (Google) <[email protected]>
ring-buffer: Do not set shortest_full when full target is hit
Pavel Begunkov <[email protected]>
io_uring: clean rings on NO_MMAP alloc fail
Jens Axboe <[email protected]>
io_uring/rw: return IOU_ISSUE_SKIP_COMPLETE for multishot retry
Srinivas Pandruvada <[email protected]>
platform/x86/intel/tpmi: Change vsec offset to u64
Marios Makassikis <[email protected]>
ksmbd: retrieve number of blocks using vfs_getattr in set_file_allocation_info
Marios Makassikis <[email protected]>
ksmbd: replace generic_fillattr with vfs_getattr
Lino Sanfilippo <[email protected]>
tpm,tpm_tis: Avoid warning splat at shutdown
Alex Williamson <[email protected]>
vfio/fsl-mc: Block calling interrupt handler without trigger
Alex Williamson <[email protected]>
vfio/platform: Create persistent IRQ handlers
Alex Williamson <[email protected]>
vfio/platform: Disable virqfds on cleanup
Alex Williamson <[email protected]>
vfio/pci: Lock external INTx masking ops
Alex Williamson <[email protected]>
vfio/pci: Disable auto-enable of exclusive INTx IRQ
Frank Wunderlich <[email protected]>
thermal/drivers/mediatek: Fix control buffer enablement on MT7896
Steve French <[email protected]>
cifs: allow changing password during remount
Bharath SM <[email protected]>
cifs: prevent updating file size from server if we have a read/write lease
Michael Kelley <[email protected]>
PCI: hv: Fix ring buffer size calculation
Niklas Cassel <[email protected]>
PCI: dwc: endpoint: Fix advertised resizable BAR size
Manivannan Sadhasivam <[email protected]>
PCI: qcom: Enable BDF to SID translation properly
Nathan Chancellor <[email protected]>
kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1
Benjamin Coddington <[email protected]>
NFS: Read unlock folio on nfs_page_create_from_folio() error
Josef Bacik <[email protected]>
nfs: fix UAF in direct writes
Sam Ravnborg <[email protected]>
sparc32: Fix parport build with sparc32
Johan Hovold <[email protected]>
PCI: qcom: Disable ASPM L0s for sc8280xp, sa8540p and sa8295p
Pavel Begunkov <[email protected]>
io_uring: fix mshot io-wq checks
Jens Axboe <[email protected]>
io_uring/net: correctly handle multishot recvmsg retry setup
Stanislaw Gruszka <[email protected]>
PCI/AER: Block runtime suspend when handling errors
Johannes Berg <[email protected]>
debugfs: fix wait/cancellation handling during remove
Samuel Thibault <[email protected]>
speakup: Fix 8bit characters from direct synth
Wayne Chang <[email protected]>
usb: gadget: tegra-xudc: Fix USB3 PHY retrieval logic
Wayne Chang <[email protected]>
phy: tegra: xusb: Add API to retrieve the port number of phy
Christophe JAILLET <[email protected]>
slimbus: core: Remove usage of the deprecated ida_simple_xx() API
Jerome Brunet <[email protected]>
nvmem: meson-efuse: fix function pointer type mismatch
Maximilian Heyne <[email protected]>
ext4: fix corruption during on-line resize
Pavel Begunkov <[email protected]>
io_uring: fix io_queue_proc modifying req->flags
Josua Mayer <[email protected]>
hwmon: (amc6821) add of_match table
Pavel Begunkov <[email protected]>
io_uring: fix mshot read defer taskrun cqe posting
Mickaël Salaün <[email protected]>
landlock: Warn once if a Landlock action is requested while disabled
Christian Gmeiner <[email protected]>
drm/etnaviv: Restore some id values
Christian Marangi <[email protected]>
leds: trigger: netdev: Fix kernel panic on interface rename trig notify
Marcel Ziswiler <[email protected]>
Bluetooth: btnxpuart: Fix btnxpuart_close
Dominique Martinet <[email protected]>
mmc: core: Fix switch on gp3 partition
Ryan Roberts <[email protected]>
mm: swap: fix race between free_swap_and_cache() and swapoff()
Fedor Pchelkin <[email protected]>
mac802154: fix llsec key resources release in mac802154_llsec_key_del
Tony Battersby <[email protected]>
block: Fix page refcounts for unaligned buffers in __bio_release_pages()
Nathan Chancellor <[email protected]>
powerpc: xor_vmx: Add '-mhard-float' to CFLAGS
Yu Kuai <[email protected]>
dm-raid: fix lockdep waring in "pers->hot_add_disk"
Yu Kuai <[email protected]>
dm-raid456, md/raid456: fix a deadlock for dm-raid456 while io concurrent with reshape
Yu Kuai <[email protected]>
dm-raid: add a new helper prepare_suspend() in md_personality
Yu Kuai <[email protected]>
md/dm-raid: don't call md_reap_sync_thread() directly
Yu Kuai <[email protected]>
dm-raid: really frozen sync_thread during suspend
Yu Kuai <[email protected]>
md: add a new helper reshape_interrupted()
Yu Kuai <[email protected]>
md: export helper md_is_rdwr()
Yu Kuai <[email protected]>
md: export helpers to stop sync_thread
Yu Kuai <[email protected]>
md: don't clear MD_RECOVERY_FROZEN for new dm-raid until resume
Song Liu <[email protected]>
Revert "Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d""
Jarred White <[email protected]>
ACPI: CPPC: Use access_width over bit_width for system memory accesses
Paul Menzel <[email protected]>
PCI/DPC: Quirk PIO log size for Intel Raptor Lake Root Ports
Rafael J. Wysocki <[email protected]>
PCI/PM: Drain runtime-idle callbacks before driver removal
Akira Yokosawa <[email protected]>
docs: Makefile: Add dependency to $(YNL_INDEX) for targets other than htmldocs
Nick Morrow <[email protected]>
wifi: rtw88: Add missing VID/PIDs for 8811CU and 8821CU
Filipe Manana <[email protected]>
btrfs: fix off-by-one chunk length calculation at contains_pending_extent()
Qu Wenruo <[email protected]>
btrfs: qgroup: always free reserved space for extent records
Peter Collingbourne <[email protected]>
serial: Lock console when calling into driver before registration
Jonas Gorski <[email protected]>
serial: core: only stop transmit when HW fifo is empty
Roger Quadros <[email protected]>
usb: dwc3-am62: Disable wakeup at remove
Roger Quadros <[email protected]>
usb: dwc3-am62: fix module unload/reload behavior
Jameson Thies <[email protected]>
usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
Miklos Szeredi <[email protected]>
fuse: don't unhash root
Miklos Szeredi <[email protected]>
fuse: fix root lookup with nonzero generation
Miklos Szeredi <[email protected]>
fuse: replace remaining make_bad_inode() with fuse_make_bad()
Wolfram Sang <[email protected]>
mmc: tmio: avoid concurrent runs of mmc_request_done()
Qingliang Li <[email protected]>
PM: sleep: wakeirq: fix wake irq warning in system suspend
Toru Katagiri <[email protected]>
USB: serial: cp210x: add pid/vid for TDK NC0110013M and MM0110113M
David Woodhouse <[email protected]>
KVM: x86/xen: inject vCPU upcall vector when local APIC is enabled
Aurélien Jacobs <[email protected]>
USB: serial: option: add MeiG Smart SLM320 product
Johannes Berg <[email protected]>
wifi: mac80211: track capability/opmode NSS separately
Christian Häggström <[email protected]>
USB: serial: cp210x: add ID for MGP Instruments PDS100
Cameron Williams <[email protected]>
USB: serial: add device ID for VeriFone adapter
Daniel Vogelbacher <[email protected]>
USB: serial: ftdi_sio: add support for GMC Z216C Adapter IR-USB
Michael Ellerman <[email protected]>
powerpc/fsl: Fix mfpmr build errors with newer binutils
Prashanth K <[email protected]>
usb: xhci: Add error handling in xhci_map_urb_for_dma
Gabor Juhos <[email protected]>
clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays
Gabor Juhos <[email protected]>
clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays
Gabor Juhos <[email protected]>
clk: qcom: camcc-sc8280xp: fix terminating of frequency table arrays
Gabor Juhos <[email protected]>
clk: qcom: gcc-ipq9574: fix terminating of frequency table arrays
Gabor Juhos <[email protected]>
clk: qcom: gcc-ipq8074: fix terminating of frequency table arrays
Gabor Juhos <[email protected]>
clk: qcom: gcc-ipq6018: fix terminating of frequency table arrays
Gabor Juhos <[email protected]>
clk: qcom: gcc-ipq5018: fix terminating of frequency table arrays
Brett Creeley <[email protected]>
vfio/pds: Always clear the save/restore FDs on reset
Maulik Shah <[email protected]>
PM: suspend: Set mem_sleep_current during kernel command line setup
Shivnandan Kumar <[email protected]>
cpufreq: Limit resolving a frequency to policy min/max
Akira Yokosawa <[email protected]>
docs: Restore "smart quotes" for quotes
Quentin Schulz <[email protected]>
iio: adc: rockchip_saradc: use mask for write_enable bitfield
Quentin Schulz <[email protected]>
iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2
Gui-Dong Han <[email protected]>
md/raid5: fix atomicity violation in raid5_cache_count
Guenter Roeck <[email protected]>
parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds
Guenter Roeck <[email protected]>
parisc: Fix csum_ipv6_magic on 64-bit systems
Guenter Roeck <[email protected]>
parisc: Fix csum_ipv6_magic on 32-bit systems
Guenter Roeck <[email protected]>
parisc: Fix ip_fast_csum
John David Anglin <[email protected]>
parisc: Avoid clobbering the C/B bits in the PSW with tophys and tovirt macros
Guenter Roeck <[email protected]>
parisc/unaligned: Rewrite 64-bit inline assembly of emulate_ldd()
Breno Leitao <[email protected]>
x86/nmi: Fix the inverse "in NMI handler" check
Heming Zhao <[email protected]>
md/md-bitmap: fix incorrect usage for sb_index
Arseniy Krasnov <[email protected]>
mtd: rawnand: meson: fix scrambling mode value in command macro
Zhihao Cheng <[email protected]>
ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path
Zhang Yi <[email protected]>
ubi: correct the calculation of fastmap size
Richard Weinberger <[email protected]>
ubi: Check for too small LEB size in VTBL code
Matthew Wilcox (Oracle) <[email protected]>
ubifs: Set page uptodate in the correct place
Alexander Sverdlin <[email protected]>
mfd: twl: Select MFD_CORE
Bernd Schubert <[email protected]>
fuse: fix VM_MAYSHARE and direct_io_allow_mmap
Jan Kara <[email protected]>
fat: fix uninitialized field in nostale filehandles
Matthew Wilcox (Oracle) <[email protected]>
bounds: support non-power-of-two CONFIG_NR_CPUS
Arnd Bergmann <[email protected]>
kasan/test: avoid gcc warning for intentional overflow
Damien Le Moal <[email protected]>
block: Clear zone limits for a non-zoned stacked queue
Srinivasan Shanmugam <[email protected]>
drm/amdgpu/display: Address kdoc for 'is_psr_su' in 'fill_dc_dirty_rects'
Baokun Li <[email protected]>
ext4: correct best extent lstart adjustment logic
Krzysztof Kozlowski <[email protected]>
pinctrl: qcom: sm8650-lpass-lpi: correct Kconfig name
SeongJae Park <[email protected]>
selftests/mqueue: Set timeout to 180 seconds
Damian Muszynski <[email protected]>
crypto: qat - resolve race condition during AER recovery
Damian Muszynski <[email protected]>
crypto: qat - change SLAs cleanup flow at shutdown
Randy Dunlap <[email protected]>
sparc: vDSO: fix return value of __setup handler
Randy Dunlap <[email protected]>
sparc64: NMI watchdog: fix return value of __setup handler
Michael Ellerman <[email protected]>
powerpc/smp: Increase nr_cpu_ids to include the boot CPU
Michael Ellerman <[email protected]>
powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core
Zhang Rui <[email protected]>
powercap: intel_rapl_tpmi: Fix System Domain probing
Zhang Rui <[email protected]>
powercap: intel_rapl_tpmi: Fix a register bug
Zhang Rui <[email protected]>
powercap: intel_rapl: Fix locking in TPMI RAPL
Zhang Rui <[email protected]>
powercap: intel_rapl: Fix a NULL pointer dereference
Zhang Rui <[email protected]>
thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature
Tor Vic <[email protected]>
cpufreq: amd-pstate: Fix min_perf assignment in amd_pstate_adjust_perf()
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping
Sean Christopherson <[email protected]>
KVM: Always flush async #PF workqueue when vCPU is being destroyed
Li Lingfeng <[email protected]>
md: use RCU lock to protect traversal in md_spares_need_change()
Laurent Pinchart <[email protected]>
media: nxp: imx8-isi: Mark all crossbar sink pads as MUST_CONNECT
Laurent Pinchart <[email protected]>
media: mc: Expand MUST_CONNECT flag to always require an enabled link
Laurent Pinchart <[email protected]>
media: mc: Rename pad variable to clarify intent
Laurent Pinchart <[email protected]>
media: mc: Add num_links flag to media_pad
Marek Vasut <[email protected]>
media: nxp: imx8-isi: Check whether crossbar pad is non-NULL before access
Laurent Pinchart <[email protected]>
media: mc: Fix flags handling when creating pad links
Laurent Pinchart <[email protected]>
media: mc: Add local pad to pipeline regardless of the link state
Gui-Dong Han <[email protected]>
media: xc4000: Fix atomicity violation in xc4000_get_frequency
Philipp Stanner <[email protected]>
pci_iounmap(): Fix MMIO mapping leak
Zack Rusin <[email protected]>
drm/vmwgfx: Fix the lifetime of the bo cursor memory
Hugo Villeneuve <[email protected]>
serial: max310x: fix NULL pointer dereference in I2C instantiation
Krzysztof Kozlowski <[email protected]>
arm64: dts: qcom: sm8450-hdk: correct AMIC4 and AMIC5 microphones
Zack Rusin <[email protected]>
drm/vmwgfx: Fix possible null pointer derefence with invalid contexts
Duje Mihanović <[email protected]>
arm: dts: marvell: Fix maxium->maxim typo in brownstone dts
Roberto Sassu <[email protected]>
smack: Handle SMACK64TRANSMUTE in smack_inode_setsecurity()
Roberto Sassu <[email protected]>
smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr()
Amit Pundir <[email protected]>
clk: qcom: gcc-sdm845: Add soft dependency on rpmhpd
Joakim Zhang <[email protected]>
remoteproc: virtio: Fix wdg cannot recovery remote processor
Krishna chaitanya chundru <[email protected]>
arm64: dts: qcom: sc7280: Add additional MSI interrupts
Hidenori Kobayashi <[email protected]>
media: staging: ipu3-imgu: Set fields before media_entity_pads_init()
Arend van Spriel <[email protected]>
wifi: brcmfmac: avoid invalid list operation when vendor attach fails
Zheng Wang <[email protected]>
wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach
Zack Rusin <[email protected]>
drm/vmwgfx: Unmap the surface before resetting it on a plane state
-------------
Diffstat:
Documentation/Makefile | 4 +- Documentation/admin-guide/kernel-parameters.txt | 4 +- Documentation/arch/x86/amd-memory-encryption.rst | 16 +- Documentation/conf.py | 6 +- .../userspace-api/media/mediactl/media-types.rst | 11 +- Makefile | 4 +- arch/arm/Kconfig | 4 +- arch/arm/boot/dts/marvell/mmp2-brownstone.dts | 2 +- arch/arm/include/asm/mman.h | 14 ++ arch/arm/kernel/Makefile | 2 - arch/arm/kernel/iwmmxt.S | 51 ++-- arch/arm/kernel/pj4-cp0.c | 135 ----------- arch/arm/mm/flush.c | 3 + arch/arm64/boot/dts/qcom/sc7280.dtsi | 12 +- arch/arm64/boot/dts/qcom/sm8450-hdk.dts | 4 +- arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 2 +- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 2 +- arch/hexagon/kernel/vmlinux.lds.S | 1 + arch/loongarch/crypto/crc32-loongarch.c | 2 - arch/loongarch/include/asm/Kbuild | 1 + arch/loongarch/include/asm/io.h | 2 + arch/loongarch/include/asm/percpu.h | 7 +- arch/loongarch/include/asm/qspinlock.h | 18 -- arch/parisc/include/asm/assembly.h | 18 +- arch/parisc/include/asm/checksum.h | 10 +- arch/parisc/include/asm/mman.h | 14 ++ arch/parisc/kernel/unaligned.c | 27 +-- arch/powerpc/include/asm/reg_fsl_emb.h | 11 +- arch/powerpc/kernel/prom.c | 12 + arch/powerpc/lib/Makefile | 2 +- arch/sparc/include/asm/parport.h | 259 +-------------------- arch/sparc/include/asm/parport_64.h | 256 ++++++++++++++++++++ arch/sparc/kernel/nmi.c | 2 +- arch/sparc/vdso/vma.c | 7 +- arch/x86/Kconfig | 13 -- arch/x86/boot/compressed/efi_mixed.S | 29 ++- arch/x86/coco/core.c | 7 +- arch/x86/events/amd/core.c | 20 +- arch/x86/include/asm/asm-prototypes.h | 1 + arch/x86/include/asm/asm.h | 14 ++ arch/x86/include/asm/coco.h | 8 +- arch/x86/include/asm/crash_core.h | 2 + arch/x86/include/asm/mem_encrypt.h | 15 +- arch/x86/include/asm/nospec-branch.h | 21 +- arch/x86/include/asm/sev.h | 4 +- arch/x86/include/asm/suspend_32.h | 10 +- arch/x86/include/asm/x86_init.h | 3 +- arch/x86/kernel/cpu/amd.c | 10 +- arch/x86/kernel/eisa.c | 3 +- arch/x86/kernel/fpu/xstate.c | 5 +- arch/x86/kernel/fpu/xstate.h | 14 +- arch/x86/kernel/kprobes/core.c | 11 +- arch/x86/kernel/mpparse.c | 10 +- arch/x86/kernel/nmi.c | 2 +- arch/x86/kernel/probe_roms.c | 10 - arch/x86/kernel/setup.c | 3 +- arch/x86/kernel/sev-shared.c | 12 +- arch/x86/kernel/sev.c | 31 ++- arch/x86/kernel/x86_init.c | 2 + arch/x86/kvm/lapic.c | 5 +- arch/x86/kvm/xen.c | 2 +- arch/x86/kvm/xen.h | 18 ++ arch/x86/lib/retpoline.S | 11 +- arch/x86/mm/mem_encrypt_amd.c | 18 ++ arch/x86/mm/mem_encrypt_identity.c | 38 ++- block/bio.c | 7 +- block/blk-mq.c | 9 +- block/blk-settings.c | 4 + block/mq-deadline.c | 3 +- crypto/asymmetric_keys/mscode_parser.c | 3 + crypto/asymmetric_keys/pkcs7_parser.c | 4 + crypto/asymmetric_keys/public_key.c | 3 +- crypto/asymmetric_keys/signature.c | 2 +- crypto/asymmetric_keys/x509_cert_parser.c | 8 + crypto/testmgr.h | 80 +++++++ drivers/accessibility/speakup/synth.c | 4 +- drivers/acpi/cppc_acpi.c | 31 ++- drivers/ata/ahci.c | 13 -- drivers/ata/libata-eh.c | 5 +- drivers/ata/libata-scsi.c | 9 + drivers/base/power/wakeirq.c | 4 +- drivers/bluetooth/btnxpuart.c | 3 + drivers/char/tpm/tpm_tis_core.c | 3 +- drivers/clk/qcom/camcc-sc8280xp.c | 21 ++ drivers/clk/qcom/gcc-ipq5018.c | 3 + drivers/clk/qcom/gcc-ipq6018.c | 2 + drivers/clk/qcom/gcc-ipq8074.c | 2 + drivers/clk/qcom/gcc-ipq9574.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/mmcc-apq8084.c | 2 + drivers/clk/qcom/mmcc-msm8974.c | 2 + drivers/clocksource/arm_global_timer.c | 2 +- drivers/clocksource/timer-riscv.c | 3 + drivers/cpufreq/amd-pstate.c | 2 +- drivers/cpufreq/cpufreq-dt.c | 2 +- drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 +- drivers/crypto/intel/qat/qat_common/adf_aer.c | 22 +- drivers/crypto/intel/qat/qat_common/adf_rl.c | 20 +- drivers/cxl/core/trace.h | 14 +- drivers/firmware/efi/efi.c | 2 + drivers/firmware/efi/libstub/randomalloc.c | 2 +- drivers/firmware/efi/libstub/x86-stub.c | 1 + drivers/gpio/gpiolib-cdev.c | 38 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 46 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 34 +-- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h | 2 +- .../amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 14 ++ .../amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 127 ++++++++-- drivers/gpu/drm/amd/display/dc/core/dc_state.c | 3 +- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 18 ++ drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 2 + drivers/gpu/drm/amd/display/dc/dc.h | 2 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 - drivers/gpu/drm/amd/display/dc/dc_types.h | 4 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | 1 + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.c | 14 ++ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_opp.h | 2 + drivers/gpu/drm/amd/display/dc/dcn201/dcn201_opp.c | 1 + drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 54 +++-- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.h | 14 +- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_mpc.c | 5 +- .../amd/display/dc/dcn32/dcn32_resource_helpers.c | 6 + .../amd/display/dc/dml2/dml2_translation_helper.c | 24 +- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 28 ++- drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h | 3 + .../drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 3 +- .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 2 +- .../drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c | 53 ++--- .../drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 12 +- .../drm/amd/display/dc/hwss/dcn314/dcn314_hwseq.c | 41 ---- .../drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 71 +++--- .../drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.h | 2 + .../gpu/drm/amd/display/dc/hwss/dcn32/dcn32_init.c | 2 +- .../drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 41 ---- drivers/gpu/drm/amd/display/dc/inc/hw/opp.h | 3 + .../drm/amd/display/dc/inc/hw/timing_generator.h | 1 + drivers/gpu/drm/amd/display/dc/inc/link.h | 4 +- .../dc/link/protocols/link_edp_panel_control.c | 4 +- .../dc/link/protocols/link_edp_panel_control.h | 4 +- .../gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.h | 3 +- .../gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.c | 8 + .../gpu/drm/amd/display/dc/optc/dcn32/dcn32_optc.h | 1 + .../amd/display/dc/resource/dcn32/dcn32_resource.c | 3 + .../amd/display/dc/resource/dcn32/dcn32_resource.h | 3 + .../display/dc/resource/dcn321/dcn321_resource.c | 2 + drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 8 + .../gpu/drm/amd/display/modules/hdcp/hdcp_psp.c | 3 + .../amd/display/modules/info_packet/info_packet.c | 13 +- .../drm/amd/display/modules/power/power_helpers.c | 2 +- .../drm/amd/display/modules/power/power_helpers.h | 2 +- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 19 +- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 19 +- .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 31 +-- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 18 +- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 18 +- drivers/gpu/drm/bridge/lontium-lt8912b.c | 24 +- drivers/gpu/drm/display/drm_dp_helper.c | 7 + drivers/gpu/drm/drm_bridge.c | 46 +++- drivers/gpu/drm/drm_panel.c | 17 +- drivers/gpu/drm/drm_probe_helper.c | 7 + drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_hwdb.c | 9 + drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 4 +- drivers/gpu/drm/i915/display/icl_dsi.c | 3 +- drivers/gpu/drm/i915/display/intel_bios.c | 46 +++- drivers/gpu/drm/i915/display/intel_cursor.c | 4 +- drivers/gpu/drm/i915/display/intel_display_trace.h | 6 +- drivers/gpu/drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 76 +++--- drivers/gpu/drm/i915/display/intel_dpll_mgr.h | 4 + drivers/gpu/drm/i915/display/intel_dsb.c | 14 ++ drivers/gpu/drm/i915/display/intel_fb_pin.c | 10 + drivers/gpu/drm/i915/display/intel_vrr.c | 7 +- drivers/gpu/drm/i915/gt/intel_engine_pm.c | 3 - .../gpu/drm/i915/gt/intel_execlists_submission.c | 3 + drivers/gpu/drm/i915/i915_hwmon.c | 37 +-- drivers/gpu/drm/i915/i915_reg.h | 2 +- drivers/gpu/drm/i915/i915_vma.c | 50 +++- drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 12 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +- drivers/gpu/drm/ttm/ttm_tt.c | 13 ++ drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 15 +- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 14 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 17 +- drivers/gpu/drm/xe/xe_query.c | 2 +- drivers/hwmon/amc6821.c | 11 + drivers/iio/adc/rockchip_saradc.c | 6 +- drivers/iommu/dma-iommu.c | 9 + drivers/irqchip/irq-renesas-rzg2l.c | 67 ++++-- drivers/leds/trigger/ledtrig-netdev.c | 4 +- drivers/md/dm-raid.c | 93 ++++++-- drivers/md/dm-snap.c | 4 +- drivers/md/md-bitmap.c | 9 +- drivers/md/md.c | 82 +++++-- drivers/md/md.h | 38 ++- drivers/md/raid5.c | 58 ++++- drivers/media/mc/mc-entity.c | 93 ++++++-- .../platform/nxp/imx8-isi/imx8-isi-crossbar.c | 4 +- drivers/media/tuners/xc4000.c | 4 +- drivers/mfd/Kconfig | 1 + drivers/mfd/intel-lpss-pci.c | 28 ++- drivers/mfd/intel-lpss.c | 9 +- drivers/mfd/intel-lpss.h | 14 +- drivers/mmc/core/block.c | 14 +- drivers/mmc/host/sdhci-of-dwcmshc.c | 28 ++- drivers/mmc/host/sdhci-omap.c | 3 + drivers/mmc/host/tmio_mmc_core.c | 2 + drivers/mtd/nand/raw/meson_nand.c | 2 +- drivers/mtd/nand/raw/nand_base.c | 87 ++++--- drivers/mtd/ubi/fastmap.c | 7 +- drivers/mtd/ubi/vtbl.c | 6 + .../ethernet/hisilicon/hns3/hns3pf/hclge_trace.h | 8 +- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_trace.h | 8 +- drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +- drivers/net/phy/at803x.c | 4 +- drivers/net/wireguard/netlink.c | 10 +- .../broadcom/brcm80211/brcmfmac/bca/core.c | 15 +- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 60 ++--- .../broadcom/brcm80211/brcmfmac/cfg80211.h | 2 + .../broadcom/brcm80211/brcmfmac/cyw/core.c | 33 ++- .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 3 + .../wireless/broadcom/brcm80211/brcmfmac/fwil.c | 1 + .../broadcom/brcm80211/brcmfmac/fwil_types.h | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/fwvid.c | 14 +- .../wireless/broadcom/brcm80211/brcmfmac/fwvid.h | 39 ++-- .../broadcom/brcm80211/brcmfmac/wcc/core.c | 16 +- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 15 +- .../net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 11 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/realtek/rtw88/mac.c | 7 + drivers/net/wireless/realtek/rtw88/rtw8821cu.c | 46 ++-- drivers/nvmem/meson-efuse.c | 25 +- drivers/pci/controller/dwc/pcie-designware-ep.c | 7 +- drivers/pci/controller/dwc/pcie-qcom.c | 41 +++- drivers/pci/controller/pci-hyperv.c | 3 +- drivers/pci/pci-driver.c | 7 + drivers/pci/pcie/err.c | 20 ++ drivers/pci/quirks.c | 2 + drivers/phy/tegra/xusb.c | 13 ++ drivers/pinctrl/pinctrl-amd.c | 2 +- drivers/pinctrl/qcom/Kconfig | 2 +- drivers/platform/x86/intel/tpmi.c | 9 +- drivers/powercap/intel_rapl_common.c | 34 ++- drivers/powercap/intel_rapl_msr.c | 8 +- drivers/powercap/intel_rapl_tpmi.c | 15 ++ drivers/pwm/pwm-img.c | 4 +- drivers/remoteproc/remoteproc_virtio.c | 6 +- drivers/s390/crypto/zcrypt_api.c | 2 + drivers/scsi/hosts.c | 7 +- drivers/scsi/libsas/sas_expander.c | 51 ++-- drivers/scsi/lpfc/lpfc_bsg.c | 4 +- drivers/scsi/lpfc/lpfc_nvmet.c | 2 +- drivers/scsi/qla2xxx/qla_attr.c | 14 +- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/qla_gbl.h | 2 +- drivers/scsi/qla2xxx/qla_init.c | 128 +++++----- drivers/scsi/qla2xxx/qla_iocb.c | 68 ++++-- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 3 +- drivers/scsi/qla2xxx/qla_target.c | 10 + drivers/scsi/scsi_scan.c | 34 +++ drivers/scsi/sd.c | 23 +- drivers/scsi/sg.c | 4 +- drivers/slimbus/core.c | 4 +- drivers/soc/fsl/qbman/qman.c | 25 +- drivers/staging/media/ipu3/ipu3-v4l2.c | 16 +- .../staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 5 +- drivers/thermal/devfreq_cooling.c | 2 +- .../int340x_thermal/processor_thermal_device.c | 8 +- .../intel/int340x_thermal/processor_thermal_rapl.c | 8 +- drivers/thermal/intel/intel_tcc.c | 12 +- drivers/thermal/intel/x86_pkg_temp_thermal.c | 8 +- drivers/thermal/mediatek/auxadc_thermal.c | 3 + drivers/thermal/thermal_trip.c | 19 +- drivers/tty/serial/8250/8250_port.c | 6 - drivers/tty/serial/max310x.c | 7 +- drivers/tty/serial/serial_core.c | 12 + drivers/ufs/host/ufs-qcom.c | 6 +- drivers/usb/class/cdc-wdm.c | 6 +- drivers/usb/core/hub.c | 23 +- drivers/usb/core/hub.h | 2 + drivers/usb/core/port.c | 38 ++- drivers/usb/core/sysfs.c | 16 +- drivers/usb/dwc2/core.h | 14 ++ drivers/usb/dwc2/core_intr.c | 72 ++++-- drivers/usb/dwc2/gadget.c | 10 + drivers/usb/dwc2/hcd.c | 49 +++- drivers/usb/dwc2/hcd_ddma.c | 17 +- drivers/usb/dwc2/hw.h | 2 +- drivers/usb/dwc2/platform.c | 2 +- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/core.h | 2 + drivers/usb/dwc3/dwc3-am62.c | 13 +- drivers/usb/dwc3/dwc3-pci.c | 2 - drivers/usb/dwc3/gadget.c | 10 + drivers/usb/dwc3/host.c | 11 + drivers/usb/gadget/udc/core.c | 4 +- drivers/usb/gadget/udc/tegra-xudc.c | 39 ++-- drivers/usb/host/xhci.c | 2 + drivers/usb/misc/usb-ljca.c | 22 +- drivers/usb/phy/phy-generic.c | 7 - drivers/usb/serial/cp210x.c | 4 + drivers/usb/serial/ftdi_sio.c | 2 + drivers/usb/serial/ftdi_sio_ids.h | 6 + drivers/usb/serial/option.c | 6 + drivers/usb/storage/uas.c | 28 ++- drivers/usb/typec/class.c | 7 +- drivers/usb/typec/tcpm/tcpm.c | 6 +- drivers/usb/typec/ucsi/ucsi.c | 56 ++++- drivers/usb/typec/ucsi/ucsi.h | 4 +- drivers/usb/typec/ucsi/ucsi_acpi.c | 71 +++--- drivers/usb/typec/ucsi/ucsi_glink.c | 14 ++ drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c | 7 +- drivers/vfio/pci/pds/lm.c | 13 ++ drivers/vfio/pci/pds/lm.h | 1 + drivers/vfio/pci/pds/vfio_dev.c | 4 +- drivers/vfio/pci/vfio_pci_intrs.c | 180 ++++++++------ drivers/vfio/platform/vfio_platform_irq.c | 105 ++++++--- drivers/vfio/virqfd.c | 21 ++ drivers/video/fbdev/Kconfig | 3 + drivers/virtio/virtio.c | 4 +- fs/btrfs/block-group.c | 3 +- fs/btrfs/compression.c | 8 +- fs/btrfs/defrag.c | 4 +- fs/btrfs/disk-io.c | 13 +- fs/btrfs/export.c | 2 +- fs/btrfs/extent_io.c | 61 +++-- fs/btrfs/extent_io.h | 1 + fs/btrfs/extent_map.c | 16 +- fs/btrfs/file.c | 14 +- fs/btrfs/free-space-cache.c | 2 +- fs/btrfs/fs.h | 11 + fs/btrfs/inode.c | 54 +++-- fs/btrfs/ioctl.c | 58 ++--- fs/btrfs/lzo.c | 4 +- fs/btrfs/props.c | 2 +- fs/btrfs/qgroup.c | 61 ++++- fs/btrfs/qgroup.h | 3 + fs/btrfs/reflink.c | 12 +- fs/btrfs/relocation.c | 2 +- fs/btrfs/scrub.c | 12 +- fs/btrfs/send.c | 2 +- fs/btrfs/super.c | 2 +- fs/btrfs/volumes.c | 69 +++++- fs/btrfs/zoned.c | 14 +- fs/debugfs/inode.c | 25 +- fs/dlm/user.c | 10 +- fs/exec.c | 1 + fs/ext4/mballoc.c | 17 +- fs/ext4/resize.c | 3 +- fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.c | 4 +- fs/fat/nfs.c | 6 + fs/fuse/dir.c | 6 +- fs/fuse/file.c | 8 +- fs/fuse/fuse_i.h | 1 - fs/fuse/inode.c | 7 +- fs/nfs/direct.c | 11 +- fs/nfs/read.c | 2 + fs/nfs/write.c | 2 +- fs/nfsd/trace.h | 2 +- fs/nilfs2/btree.c | 9 +- fs/nilfs2/direct.c | 9 +- fs/nilfs2/inode.c | 2 +- fs/smb/client/cached_dir.c | 3 +- fs/smb/client/cifs_debug.c | 2 + fs/smb/client/cifsglob.h | 4 + fs/smb/client/cifsproto.h | 6 +- fs/smb/client/connect.c | 6 +- fs/smb/client/file.c | 8 +- fs/smb/client/fs_context.c | 27 ++- fs/smb/client/inode.c | 13 +- fs/smb/client/readdir.c | 2 +- fs/smb/client/sess.c | 4 +- fs/smb/client/smb2ops.c | 2 + fs/smb/client/smb2pdu.c | 10 +- fs/smb/server/smb2misc.c | 26 ++- fs/smb/server/smb2pdu.c | 228 +++++++++++------- fs/smb/server/smb_common.c | 11 +- fs/smb/server/vfs.c | 12 +- fs/ubifs/dir.c | 2 + fs/ubifs/file.c | 13 +- include/drm/drm_bridge.h | 33 +++ include/drm/drm_modeset_helper_vtables.h | 3 +- include/drm/ttm/ttm_tt.h | 9 +- include/linux/cpufreq.h | 15 +- include/linux/framer/framer.h | 4 +- include/linux/intel_rapl.h | 6 + include/linux/intel_tcc.h | 2 +- include/linux/interrupt.h | 3 + include/linux/libata.h | 1 + include/linux/lsm_hook_defs.h | 4 +- include/linux/mman.h | 8 + include/linux/mtd/spinand.h | 2 +- include/linux/nfs_fs.h | 1 + include/linux/oid_registry.h | 4 + include/linux/phy/tegra/xusb.h | 1 + include/linux/ring_buffer.h | 4 +- include/linux/security.h | 8 +- include/linux/serial_core.h | 3 +- include/linux/skbuff.h | 10 + include/linux/syscalls.h | 6 +- include/linux/trace_events.h | 5 +- include/linux/vfio.h | 2 + include/media/media-entity.h | 2 + include/net/cfg80211.h | 2 + include/net/cfg802154.h | 1 + include/scsi/scsi_driver.h | 1 + include/scsi/scsi_host.h | 1 + include/uapi/linux/btrfs.h | 1 + init/initramfs.c | 2 +- io_uring/futex.c | 1 + io_uring/io_uring.c | 5 +- io_uring/net.c | 5 +- io_uring/poll.c | 19 +- io_uring/rw.c | 4 + io_uring/waitid.c | 7 +- kernel/bounds.c | 2 +- kernel/crash_core.c | 8 + kernel/dma/swiotlb.c | 37 +-- kernel/entry/common.c | 8 +- kernel/irq/manage.c | 9 +- kernel/module/Kconfig | 5 + kernel/power/suspend.c | 1 + kernel/printk/printk.c | 27 ++- kernel/sys.c | 7 +- kernel/time/posix-clock.c | 16 +- kernel/trace/ring_buffer.c | 161 ++++++++----- kernel/trace/trace.c | 43 +++- kernel/workqueue.c | 2 +- lib/pci_iomap.c | 2 +- mm/filemap.c | 16 ++ mm/kasan/kasan_test.c | 3 +- mm/memtest.c | 4 +- mm/shmem_quota.c | 10 +- mm/swapfile.c | 13 +- mm/zswap.c | 8 + net/bluetooth/hci_core.c | 6 +- net/bluetooth/hci_sync.c | 5 +- net/ipv4/esp4.c | 8 +- net/ipv6/esp6.c | 8 +- net/mac80211/cfg.c | 7 +- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/rate.c | 2 +- net/mac80211/sta_info.h | 6 +- net/mac80211/vht.c | 46 ++-- net/mac802154/llsec.c | 18 +- net/netfilter/nf_tables_api.c | 3 + net/wireless/wext-core.c | 7 +- scripts/Makefile.extrawarn | 2 + security/apparmor/lsm.c | 4 +- security/landlock/syscalls.c | 18 +- security/lsm_syscalls.c | 10 +- security/security.c | 20 +- security/selinux/hooks.c | 4 +- security/smack/smack_lsm.c | 16 +- sound/pci/hda/tas2781_hda_i2c.c | 83 ++++--- sound/sh/aica.c | 17 +- sound/soc/amd/yc/acp6x-mach.c | 7 - sound/soc/amd/yc/pci-acp6x.c | 1 - tools/include/linux/btf_ids.h | 2 + tools/testing/selftests/lsm/common.h | 6 +- .../testing/selftests/lsm/lsm_get_self_attr_test.c | 10 +- .../testing/selftests/lsm/lsm_list_modules_test.c | 8 +- .../testing/selftests/lsm/lsm_set_self_attr_test.c | 6 +- tools/testing/selftests/mm/gup_test.c | 2 +- tools/testing/selftests/mm/soft-dirty.c | 2 +- tools/testing/selftests/mm/split_huge_page_test.c | 2 +- tools/testing/selftests/mm/uffd-common.c | 3 + tools/testing/selftests/mm/uffd-common.h | 2 + tools/testing/selftests/mm/uffd-unit-tests.c | 13 +- tools/testing/selftests/mqueue/setting | 1 + .../selftests/wireguard/qemu/arch/riscv32.config | 1 + .../selftests/wireguard/qemu/arch/riscv64.config | 1 + virt/kvm/async_pf.c | 31 ++- 482 files changed, 4826 insertions(+), 2566 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/399 drm/vmwgfx: Unmap the surface before resetting it on a plane state
6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
[ Upstream commit 27571c64f1855881753e6f33c3186573afbab7ba ]
Switch to a new plane state requires unreferencing of all held surfaces. In the work required for mob cursors the mapped surfaces started being cached but the variable indicating whether the surface is currently mapped was not being reset. This leads to crashes as the duplicated state, incorrectly, indicates the that surface is mapped even when no surface is present. That's because after unreferencing the surface it's perfectly possible for the plane to be backed by a bo instead of a surface.
Reset the surface mapped flag when unreferencing the plane state surface to fix null derefs in cleanup. Fixes crashes in KDE KWin 6.0 on Wayland:
Oops: 0000 [#1] PREEMPT SMP PTI CPU: 4 PID: 2533 Comm: kwin_wayland Not tainted 6.7.0-rc3-vmwgfx #2 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020 RIP: 0010:vmw_du_cursor_plane_cleanup_fb+0x124/0x140 [vmwgfx] Code: 00 00 00 75 3a 48 83 c4 10 5b 5d c3 cc cc cc cc 48 8b b3 a8 00 00 00 48 c7 c7 99 90 43 c0 e8 93 c5 db ca 48 8b 83 a8 00 00 00 <48> 8b 78 28 e8 e3 f> RSP: 0018:ffffb6b98216fa80 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff969d84cdcb00 RCX: 0000000000000027 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff969e75f21600 RBP: ffff969d4143dc50 R08: 0000000000000000 R09: ffffb6b98216f920 R10: 0000000000000003 R11: ffff969e7feb3b10 R12: 0000000000000000 R13: 0000000000000000 R14: 000000000000027b R15: ffff969d49c9fc00 FS: 00007f1e8f1b4180(0000) GS:ffff969e75f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000028 CR3: 0000000104006004 CR4: 00000000003706f0 Call Trace: <TASK> ? __die+0x23/0x70 ? page_fault_oops+0x171/0x4e0 ? exc_page_fault+0x7f/0x180 ? asm_exc_page_fault+0x26/0x30 ? vmw_du_cursor_plane_cleanup_fb+0x124/0x140 [vmwgfx] drm_atomic_helper_cleanup_planes+0x9b/0xc0 commit_tail+0xd1/0x130 drm_atomic_helper_commit+0x11a/0x140 drm_atomic_commit+0x97/0xd0 ? __pfx___drm_printfn_info+0x10/0x10 drm_atomic_helper_update_plane+0xf5/0x160 drm_mode_cursor_universal+0x10e/0x270 drm_mode_cursor_common+0x102/0x230 ? __pfx_drm_mode_cursor2_ioctl+0x10/0x10 drm_ioctl_kernel+0xb2/0x110 drm_ioctl+0x26d/0x4b0 ? __pfx_drm_mode_cursor2_ioctl+0x10/0x10 ? __pfx_drm_ioctl+0x10/0x10 vmw_generic_ioctl+0xa4/0x110 [vmwgfx] __x64_sys_ioctl+0x94/0xd0 do_syscall_64+0x61/0xe0 ? __x64_sys_ioctl+0xaf/0xd0 ? syscall_exit_to_user_mode+0x2b/0x40 ? do_syscall_64+0x70/0xe0 ? __x64_sys_ioctl+0xaf/0xd0 ? syscall_exit_to_user_mode+0x2b/0x40 ? do_syscall_64+0x70/0xe0 ? exc_page_fault+0x7f/0x180 entry_SYSCALL_64_after_hwframe+0x6e/0x76 RIP: 0033:0x7f1e93f279ed Code: 04 25 28 00 00 00 48 89 45 c8 31 c0 48 8d 45 10 c7 45 b0 10 00 00 00 48 89 45 b8 48 8d 45 d0 48 89 45 c0 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff f> RSP: 002b:00007ffca0faf600 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 000055db876ed2c0 RCX: 00007f1e93f279ed RDX: 00007ffca0faf6c0 RSI: 00000000c02464bb RDI: 0000000000000015 RBP: 00007ffca0faf650 R08: 000055db87184010 R09: 0000000000000007 R10: 000055db886471a0 R11: 0000000000000246 R12: 00007ffca0faf6c0 R13: 00000000c02464bb R14: 0000000000000015 R15: 00007ffca0faf790 </TASK> Modules linked in: snd_seq_dummy snd_hrtimer nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_ine> CR2: 0000000000000028 ---[ end trace 0000000000000000 ]--- RIP: 0010:vmw_du_cursor_plane_cleanup_fb+0x124/0x140 [vmwgfx] Code: 00 00 00 75 3a 48 83 c4 10 5b 5d c3 cc cc cc cc 48 8b b3 a8 00 00 00 48 c7 c7 99 90 43 c0 e8 93 c5 db ca 48 8b 83 a8 00 00 00 <48> 8b 78 28 e8 e3 f> RSP: 0018:ffffb6b98216fa80 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff969d84cdcb00 RCX: 0000000000000027 RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff969e75f21600 RBP: ffff969d4143dc50 R08: 0000000000000000 R09: ffffb6b98216f920 R10: 0000000000000003 R11: ffff969e7feb3b10 R12: 0000000000000000 R13: 0000000000000000 R14: 000000000000027b R15: ffff969d49c9fc00 FS: 00007f1e8f1b4180(0000) GS:ffff969e75f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000028 CR3: 0000000104006004 CR4: 00000000003706f0
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 -0
@@ -703,6 +703,10 @@ vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane,int ret =0 ;if (vps->surf) { +if (vps->surf_mapped) { +vmw_bo_unmap (vps->surf->res.guest_memory_bo); + vps->surf_mapped = false; + }vmw_surface_unreference (&vps->surf); vps->surf =NULL ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 2/399 wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Wang <[email protected]>
[ Upstream commit 0f7352557a35ab7888bc7831411ec8a3cbe20d78 ]
This is the candidate patch of CVE-2023-47233 :
https://nvd.nist.gov/vuln/detail/CVE-2023-47233
In brcm80211 driver,it starts with the following invoking chain to start init a timeout worker:
->brcmf_usb_probe
->brcmf_usb_probe_cb
->brcmf_attach
->brcmf_bus_started
->brcmf_cfg80211_attach
->wl_init_priv
->brcmf_init_escan
->INIT_WORK(&cfg->escan_timeout_work,
brcmf_cfg80211_escan_timeout_worker);If we disconnect the USB by hotplug, it will call brcmf_usb_disconnect to make cleanup. The invoking chain is :
brcmf_usb_disconnect
->brcmf_usb_disconnect_cb
->brcmf_detach
->brcmf_cfg80211_detach
->kfree(cfg);While the timeout woker may still be running. This will cause a use-after-free bug on cfg in brcmf_cfg80211_escan_timeout_worker.
Fix it by deleting the timer and canceling the worker in brcmf_cfg80211_detach.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +2 -2
@@ -1179,8 +1179,7 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, scan_request = cfg->scan_request; cfg->scan_request =NULL ; -if (timer_pending (&cfg->escan_timeout)) -del_timer_sync (&cfg->escan_timeout); +timer_delete_sync (&cfg->escan_timeout);if (fw_abort) {/* Do a scan abort to stop the driver's scan engine */
@@ -8440,6 +8439,7 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg)brcmf_btcoex_detach (cfg);wiphy_unregister (cfg->wiphy);wl_deinit_priv (cfg); +cancel_work_sync (&cfg->escan_timeout_work);brcmf_free_wiphy (cfg->wiphy);kfree (cfg); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 3/399 wifi: brcmfmac: avoid invalid list operation when vendor attach fails
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arend van Spriel <[email protected]>
[ Upstream commit b822015a1f57268f5b2ff656736dc4004e7097da ]
When the brcmf_fwvid_attach() fails the driver instance is not added to the vendor list. Hence we should not try to delete it from that list when the brcmf_fwvid_detach() function is called in cleanup path.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c +4 -3
@@ -187,9 +187,10 @@ void brcmf_fwvid_detach_ops(struct brcmf_pub *drvr)mutex_lock (&fwvid_list_lock); - drvr->vops =NULL ; -list_del (&drvr->bus_if->list); - +if (drvr->vops) { + drvr->vops =NULL ; +list_del (&drvr->bus_if->list); + }mutex_unlock (&fwvid_list_lock); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 4/399 media: staging: ipu3-imgu: Set fields before media_entity_pads_init()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hidenori Kobayashi <[email protected]>
[ Upstream commit 87318b7092670d4086bfec115a0280a60c51c2dd ]
The imgu driver fails to probe with the following message because it does not set the pad's flags before calling media_entity_pads_init().
[ 14.596315] ipu3-imgu 0000:00:05.0: failed initialize subdev media entity (-22) [ 14.596322] ipu3-imgu 0000:00:05.0: failed to register subdev0 ret (-22) [ 14.596327] ipu3-imgu 0000:00:05.0: failed to register pipes (-22) [ 14.596331] ipu3-imgu 0000:00:05.0: failed to create V4L2 devices (-22)
Fix the initialization order so that the driver probe succeeds. The ops initialization is also moved together for readability.
--- drivers/staging/media/ipu3/ipu3-v4l2.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/media/ipu3/ipu3-v4l2.c +8 -8
@@ -1069,6 +1069,11 @@ static int imgu_v4l2_subdev_register(struct imgu_device *imgu,struct imgu_media_pipe *imgu_pipe = &imgu->imgu_pipe[pipe];/* Initialize subdev media entity */ + imgu_sd->subdev.entity.ops = &imgu_media_ops; +for (i =0 ; i <IMGU_NODE_NUM ; i++) { + imgu_sd->subdev_pads[i].flags = imgu_pipe->nodes[i].output ? +MEDIA_PAD_FL_SINK :MEDIA_PAD_FL_SOURCE ; + } r =media_entity_pads_init (&imgu_sd->subdev.entity,IMGU_NODE_NUM , imgu_sd->subdev_pads);if (r) {
@@ -1076,11 +1081,6 @@ static int imgu_v4l2_subdev_register(struct imgu_device *imgu, "failed initialize subdev media entity (%d)\n", r);return r; } - imgu_sd->subdev.entity.ops = &imgu_media_ops; -for (i =0 ; i <IMGU_NODE_NUM ; i++) { - imgu_sd->subdev_pads[i].flags = imgu_pipe->nodes[i].output ? -MEDIA_PAD_FL_SINK :MEDIA_PAD_FL_SOURCE ; - }/* Initialize subdev */ v4l2_subdev_init (&imgu_sd->subdev, &imgu_subdev_ops);
@@ -1177,15 +1177,15 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe, }/* Initialize media entities */ + node->vdev_pad.flags = node->output ? +MEDIA_PAD_FL_SOURCE :MEDIA_PAD_FL_SINK ; + vdev->entity.ops =NULL ; r =media_entity_pads_init (&vdev->entity,1 , &node->vdev_pad);if (r) {dev_err (dev,"failed initialize media entity (%d)\n" , r);mutex_destroy (&node->lock);return r; } - node->vdev_pad.flags = node->output ? -MEDIA_PAD_FL_SOURCE :MEDIA_PAD_FL_SINK ; - vdev->entity.ops =NULL ;/* Initialize vbq */ vbq->type = node->vdev_fmt.type;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/399 arm64: dts: qcom: sc7280: Add additional MSI interrupts
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krishna chaitanya chundru <[email protected]>
[ Upstream commit b8ba66b40da3230a8675cb5dd5c2dea5bce24d62 ]
Current MSI's mapping doesn't have all the vectors. This platform supports 8 vectors each vector supports 32 MSI's, so total MSI's supported is 256.
Add all the MSI groups supported for this PCIe instance in this platform.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +10 -2
@@ -2178,8 +2178,16 @@ pcie1: pcie@1c08000 { ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; - interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "msi"; + interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7"; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; interrupt-map = <0 0 0 1 &intc 0 0 0 434 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/399 remoteproc: virtio: Fix wdg cannot recovery remote processor
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joakim Zhang <[email protected]>
[ Upstream commit b327c72753d6a78de37aed6c35756f2ef62897ee ]
Recovery remote processor failed when wdg irq received:
[ 0.842574] remoteproc remoteproc0: crash detected in cix-dsp-rproc: type watchdog [ 0.842750] remoteproc remoteproc0: handling crash #1 in cix-dsp-rproc [ 0.842824] remoteproc remoteproc0: recovering cix-dsp-rproc [ 0.843342] remoteproc remoteproc0: stopped remote processor cix-dsp-rproc [ 0.847901] rproc-virtio rproc-virtio.0.auto: Failed to associate buffer [ 0.847979] remoteproc remoteproc0: failed to probe subdevices for cix-dsp-rproc: -16
The reason is that dma coherent mem would not be released when recovering the remote processor, due to rproc_virtio_remove() would not be called, where the mem released. It will fail when it try to allocate and associate buffer again.
Releasing reserved memory from rproc_virtio_dev_release(), instead of rproc_virtio_remove().
--- drivers/remoteproc/remoteproc_virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/remoteproc/remoteproc_virtio.c +3 -3
@@ -351,6 +351,9 @@ static void rproc_virtio_dev_release(struct device *dev)kfree (vdev); +of_reserved_mem_device_release (&rvdev->pdev->dev); +dma_release_coherent_memory (&rvdev->pdev->dev); +put_device (&rvdev->pdev->dev); }
@@ -584,9 +587,6 @@ static void rproc_virtio_remove(struct platform_device *pdev)rproc_remove_subdev (rproc, &rvdev->subdev);rproc_remove_rvdev (rvdev); -of_reserved_mem_device_release (&pdev->dev); -dma_release_coherent_memory (&pdev->dev); -put_device (&rproc->dev); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 7/399 clk: qcom: gcc-sdm845: Add soft dependency on rpmhpd
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Pundir <[email protected]>
[ Upstream commit 1d9054e3a4fd36e2949e616f7360bdb81bcc1921 ]
With the addition of RPMh power domain to the GCC node in device tree, we noticed a significant delay in getting the UFS driver probed on AOSP which futher led to mount failures because Android do not support rootwait. So adding a soft dependency on RPMh power domain which informs modprobe to load rpmhpd module before gcc-sdm845.
--- drivers/clk/qcom/gcc-sdm845.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/qcom/gcc-sdm845.c +1 -0
@@ -4037,3 +4037,4 @@ module_exit(gcc_sdm845_exit);MODULE_DESCRIPTION ("QTI GCC SDM845 Driver" );MODULE_LICENSE ("GPL v2" );MODULE_ALIAS ("platform:gcc-sdm845" ); +MODULE_SOFTDEP ("pre: rpmhpd" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 8/399 smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roberto Sassu <[email protected]>
[ Upstream commit 9c82169208dde516510aaba6bbd8b13976690c5d ]
Since the SMACK64TRANSMUTE xattr makes sense only for directories, enforce this restriction in smack_inode_setxattr().
--- security/smack/smack_lsm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
security/smack/smack_lsm.c +2 -1
@@ -1314,7 +1314,8 @@ static int smack_inode_setxattr(struct mnt_idmap *idmap, check_star =1 ; }else if (strcmp (name,XATTR_NAME_SMACKTRANSMUTE ) ==0 ) { check_priv =1 ; -if (size !=TRANS_TRUE_SIZE || +if (!S_ISDIR (d_backing_inode (dentry)->i_mode) || + size !=TRANS_TRUE_SIZE ||strncmp (value,TRANS_TRUE ,TRANS_TRUE_SIZE ) !=0 ) rc = -EINVAL ; }else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 9/399 smack: Handle SMACK64TRANSMUTE in smack_inode_setsecurity()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roberto Sassu <[email protected]>
[ Upstream commit ac02f007d64eb2769d0bde742aac4d7a5fc6e8a5 ]
If the SMACK64TRANSMUTE xattr is provided, and the inode is a directory, update the in-memory inode flags by setting SMK_INODE_TRANSMUTE.
--- security/smack/smack_lsm.c | 9 +++++++++ 1 file changed, 9 insertions(+)
security/smack/smack_lsm.c +9 -0
@@ -2856,6 +2856,15 @@ static int smack_inode_setsecurity(struct inode *inode, const char *name,if (value ==NULL || size >SMK_LONGLABEL || size ==0 )return -EINVAL ; +if (strcmp (name,XATTR_SMACK_TRANSMUTE ) ==0 ) { +if (!S_ISDIR (inode->i_mode) || size !=TRANS_TRUE_SIZE || +strncmp (value,TRANS_TRUE ,TRANS_TRUE_SIZE ) !=0 ) +return -EINVAL ; + + nsp->smk_flags |=SMK_INODE_TRANSMUTE ; +return 0 ; + } + skp =smk_import_entry (value, size);if (IS_ERR (skp))return PTR_ERR (skp);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 10/399 arm: dts: marvell: Fix maxium->maxim typo in brownstone dts
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duje Mihanović <[email protected]>
[ Upstream commit 831e0cd4f9ee15a4f02ae10b67e7fdc10eb2b4fc ]
Fix an obvious spelling error in the PMIC compatible in the MMP2 Brownstone DTS file.
[krzysztof: Just 10 years to take a patch, not bad! Rephrased commit
msg]
--- arch/arm/boot/dts/marvell/mmp2-brownstone.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/marvell/mmp2-brownstone.dts +1 -1
@@ -28,7 +28,7 @@ &uart3 { &twsi1 { status = "okay"; pmic: max8925@3c { - compatible = "maxium,max8925"; + compatible = "maxim,max8925"; reg = <0x3c>; interrupts = <1>; interrupt-parent = <&intcmux4>;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 11/399 drm/vmwgfx: Fix possible null pointer derefence with invalid contexts
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
[ Upstream commit 517621b7060096e48e42f545fa6646fc00252eac ]
vmw_context_cotable can return either an error or a null pointer and its usage sometimes went unchecked. Subsequent code would then try to access either a null pointer or an error value.
The invalid dereferences were only possible with malformed userspace apps which never properly initialized the rendering contexts.
Check the results of vmw_context_cotable to fix the invalid derefs.
Thanks:
ziming zhang(@ezrak1e) from Ant Group Light-Year Security Lab who was the first person to discover it.
Niels De Graef who reported it and helped to track down the poc.
--- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +11 -3
@@ -447,7 +447,7 @@ static int vmw_resource_context_res_add(struct vmw_private *dev_priv, vmw_res_type(ctx) == vmw_res_dx_context) {for (i =0 ; i < cotable_max; ++i) { res =vmw_context_cotable (ctx, i); -if (IS_ERR (res)) +if (IS_ERR_OR_NULL (res))continue ; ret = vmw_execbuf_res_val_add(sw_context, res,
@@ -1266,6 +1266,8 @@ static int vmw_cmd_dx_define_query(struct vmw_private *dev_priv,return -EINVAL ; cotable_res =vmw_context_cotable (ctx_node->ctx,SVGA_COTABLE_DXQUERY ); +if (IS_ERR_OR_NULL (cotable_res)) +return cotable_res ?PTR_ERR (cotable_res) : -EINVAL ; ret =vmw_cotable_notify (cotable_res, cmd->body.queryId);return ret;
@@ -2484,6 +2486,8 @@ static int vmw_cmd_dx_view_define(struct vmw_private *dev_priv,return ret; res =vmw_context_cotable (ctx_node->ctx, vmw_view_cotables[view_type]); +if (IS_ERR_OR_NULL (res)) +return res ?PTR_ERR (res) : -EINVAL ; ret =vmw_cotable_notify (res, cmd->defined_id);if (unlikely (ret !=0 ))return ret;
@@ -2569,8 +2573,8 @@ static int vmw_cmd_dx_so_define(struct vmw_private *dev_priv, so_type =vmw_so_cmd_to_type (header->id); res =vmw_context_cotable (ctx_node->ctx, vmw_so_cotables[so_type]); -if (IS_ERR (res)) -return PTR_ERR (res); +if (IS_ERR_OR_NULL (res)) +return res ?PTR_ERR (res) : -EINVAL ; cmd =container_of (header,typeof (*cmd), header); ret =vmw_cotable_notify (res, cmd->defined_id);
@@ -2689,6 +2693,8 @@ static int vmw_cmd_dx_define_shader(struct vmw_private *dev_priv,return -EINVAL ; res =vmw_context_cotable (ctx_node->ctx,SVGA_COTABLE_DXSHADER ); +if (IS_ERR_OR_NULL (res)) +return res ?PTR_ERR (res) : -EINVAL ; ret =vmw_cotable_notify (res, cmd->body.shaderId);if (ret)return ret;
@@ -3010,6 +3016,8 @@ static int vmw_cmd_dx_define_streamoutput(struct vmw_private *dev_priv, } res =vmw_context_cotable (ctx_node->ctx,SVGA_COTABLE_STREAMOUTPUT ); +if (IS_ERR_OR_NULL (res)) +return res ?PTR_ERR (res) : -EINVAL ; ret =vmw_cotable_notify (res, cmd->body.soid);if (ret)return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 12/399 arm64: dts: qcom: sm8450-hdk: correct AMIC4 and AMIC5 microphones
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 915253bdd64f2372fa5f6c58d75cb99972c7401d ]
Due to lack of documentation the AMIC4 and AMIC5 analogue microphones were never actually working, so the audio routing for them was added hoping it is correct. It turned out not correct - their routing should point to SWR_INPUT0 (so audio mixer TX SMIC MUX0 = SWR_MIC0) and SWR_INPUT1 (so audio mixer TX SMIC MUX0 = SWR_MIC1), respectively. With proper mixer settings and fixed LPASS TX macr codec TX SMIC MUXn widgets, this makes all microphones working on HDK8450.
--- arch/arm64/boot/dts/qcom/sm8450-hdk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8450-hdk.dts +2 -2
@@ -938,8 +938,8 @@ &sound { "TX DMIC3", "MIC BIAS1", "TX SWR_INPUT0", "ADC1_OUTPUT", "TX SWR_INPUT1", "ADC2_OUTPUT", - "TX SWR_INPUT2", "ADC3_OUTPUT", - "TX SWR_INPUT3", "ADC4_OUTPUT"; + "TX SWR_INPUT0", "ADC3_OUTPUT", + "TX SWR_INPUT1", "ADC4_OUTPUT"; wcd-playback-dai-link { link-name = "WCD Playback";
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 13/399 serial: max310x: fix NULL pointer dereference in I2C instantiation
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 0d27056c24efd3d63a03f3edfbcfc4827086b110 ]
When trying to instantiate a max14830 device from userspace:
echo max14830 0x60 > /sys/bus/i2c/devices/i2c-2/new_device
we get the following error:
Unable to handle kernel NULL pointer dereference at virtual address...
...
Call trace:
max310x_i2c_probe+0x48/0x170 [max310x]
i2c_device_probe+0x150/0x2a0
...Add check for validity of devtype to prevent the error, and abort probe with a meaningful error message.
--- drivers/tty/serial/max310x.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/tty/serial/max310x.c +5 -2
@@ -1635,13 +1635,16 @@ static unsigned short max310x_i2c_slave_addr(unsigned short addr,static int max310x_i2c_probe (struct i2c_client *client) { -const struct max310x_devtype *devtype = -device_get_match_data (&client->dev); +const struct max310x_devtype *devtype;struct i2c_client *port_client;struct regmap *regmaps[4 ];unsigned int i;u8 port_addr; + devtype =device_get_match_data (&client->dev); +if (!devtype) +return dev_err_probe (&client->dev, -ENODEV ,"Failed to match device\n" ); +if (client->addr < devtype->slave_addr.min || client->addr > devtype->slave_addr.max) return dev_err_probe(&client->dev, -EINVAL,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 14/399 drm/vmwgfx: Fix the lifetime of the bo cursor memory
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
[ Upstream commit 9a9e8a7159ca09af9b1a300a6c8e8b6ff7501c76 ]
The cleanup can be dispatched while the atomic update is still active, which means that the memory acquired in the atomic update needs to not be invalidated by the cleanup. The buffer objects in vmw_plane_state instead of using the builtin map_and_cache were trying to handle the lifetime of the mapped memory themselves, leading to crashes.
Use the map_and_cache instead of trying to manage the lifetime of the buffer objects held by the vmw_plane_state.
Fixes kernel oops'es in IGT's kms_cursor_legacy forked-bo.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -12
@@ -184,13 +184,12 @@ static u32 vmw_du_cursor_mob_size(u32 w, u32 h)*/ static u32 *vmw_du_cursor_plane_acquire_image (struct vmw_plane_state *vps) { -bool is_iomem;if (vps->surf) {if (vps->surf_mapped)return vmw_bo_map_and_cache (vps->surf->res.guest_memory_bo);return vps->surf->snooper.image; }else if (vps->bo) -return ttm_kmap_obj_virtual (&vps->bo->map, &is_iomem); +return vmw_bo_map_and_cache (vps->bo);return NULL ; }
@@ -652,22 +651,12 @@ vmw_du_cursor_plane_cleanup_fb(struct drm_plane *plane, {struct vmw_cursor_plane *vcp =vmw_plane_to_vcp (plane);struct vmw_plane_state *vps =vmw_plane_state_to_vps (old_state); -bool is_iomem;if (vps->surf_mapped) {vmw_bo_unmap (vps->surf->res.guest_memory_bo); vps->surf_mapped = false; } -if (vps->bo &&ttm_kmap_obj_virtual (&vps->bo->map, &is_iomem)) { -const int ret =ttm_bo_reserve (&vps->bo->tbo, true, false,NULL ); - -if (likely (ret ==0 )) { -ttm_bo_kunmap (&vps->bo->map); -ttm_bo_unreserve (&vps->bo->tbo); - } - } -vmw_du_cursor_plane_unmap_cm (vps);vmw_du_put_cursor_mob (vcp, vps);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 15/399 pci_iounmap(): Fix MMIO mapping leak
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philipp Stanner <[email protected]>
[ Upstream commit 7626913652cc786c238e2dd7d8740b17d41b2637 ]
The #ifdef ARCH_HAS_GENERIC_IOPORT_MAP accidentally also guards iounmap(), which means MMIO mappings are leaked.
Move the guard so we call iounmap() for MMIO mappings.
--- lib/pci_iomap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/pci_iomap.c +1 -1
@@ -170,8 +170,8 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *p)if (addr >= start && addr < start +IO_SPACE_LIMIT )return ; -iounmap (p);#endif +iounmap (p); }EXPORT_SYMBOL (pci_iounmap);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 16/399 media: xc4000: Fix atomicity violation in xc4000_get_frequency
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gui-Dong Han <[email protected]>
[ Upstream commit 36d503ad547d1c75758a6fcdbec2806f1b6aeb41 ]
In xc4000_get_frequency():
*freq = priv->freq_hz + priv->freq_offset;
The code accesses priv->freq_hz and priv->freq_offset without holding any lock.
In xc4000_set_params():
// Code that updates priv->freq_hz and priv->freq_offset ...
xc4000_get_frequency() and xc4000_set_params() may execute concurrently, risking inconsistent reads of priv->freq_hz and priv->freq_offset. Since these related data may update during reading, it can result in incorrect frequency calculation, leading to atomicity violations.
This possible bug is found by an experimental static analysis tool developed by our team, BassCheck[1]. This tool analyzes the locking APIs to extract function pairs that can be concurrently executed, and then analyzes the instructions in the paired functions to identify possible concurrency bugs including data races and atomicity violations. The above possible bug is reported when our tool analyzes the source code of Linux 6.2.
To address this issue, it is proposed to add a mutex lock pair in xc4000_get_frequency() to ensure atomicity. With this patch applied, our tool no longer reports the possible bug, with the kernel configuration allyesconfig for x86_64. Due to the lack of associated hardware, we cannot test the patch in runtime testing, and just verify it according to the code logic.
[1] https://sites.google.com/view/basscheck/
--- drivers/media/tuners/xc4000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/tuners/xc4000.c +2 -2
@@ -1515,10 +1515,10 @@ static int xc4000_get_frequency(struct dvb_frontend *fe, u32 *freq) {struct xc4000_priv *priv = fe->tuner_priv; +mutex_lock (&priv->lock); *freq = priv->freq_hz + priv->freq_offset;if (debug) { -mutex_lock (&priv->lock);if ((priv->cur_fw.type & (BASE |FM |DTV6 |DTV7 |DTV78 |DTV8 )) ==BASE ) {u16 snr =0 ;
@@ -1529,8 +1529,8 @@ static int xc4000_get_frequency(struct dvb_frontend *fe, u32 *freq)return 0 ; } } -mutex_unlock (&priv->lock); } +mutex_unlock (&priv->lock);dprintk (1 ,"%s()\n" , __func__);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 17/399 media: mc: Add local pad to pipeline regardless of the link state
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit 78f0daa026d4c5e192d31801d1be6caf88250220 ]
When building pipelines by following links, the media_pipeline_explore_next_link() function only traverses enabled links. The remote pad of a disabled link is not added to the pipeline, and neither is the local pad. While the former is correct as disabled links should not be followed, not adding the local pad breaks processing of the MEDIA_PAD_FL_MUST_CONNECT flag.
The MEDIA_PAD_FL_MUST_CONNECT flag is checked in the __media_pipeline_start() function that iterates over all pads after populating the pipeline. If the pad is not present, the check gets skipped, rendering it useless.
Fix this by adding the local pad of all links regardless of their state, only skipping the remote pad for disabled links.
--- drivers/media/mc/mc-entity.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/media/mc/mc-entity.c +9 -9
@@ -620,13 +620,6 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, link->source->entity->name, link->source->index, link->sink->entity->name, link->sink->index); -/* Skip links that are not enabled. */ -if (!(link->flags &MEDIA_LNK_FL_ENABLED )) { -dev_dbg (walk->mdev->dev, -"media pipeline: skipping link (disabled)\n" ); -return 0 ; - } -/* Get the local pad and remote pad. */ if (link->source->entity == pad->entity) { local = link->source;
@@ -648,13 +641,20 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, }/* -* Add the local and remote pads of the link to the pipeline and push -* them to the stack, if they're not already present. +* Add the local pad of the link to the pipeline and push it to the +* stack, if not already present. */ ret =media_pipeline_add_pad (pipe, walk, local);if (ret)return ret; +/* Similarly, add the remote pad, but only if the link is enabled. */ +if (!(link->flags &MEDIA_LNK_FL_ENABLED )) { +dev_dbg (walk->mdev->dev, +"media pipeline: skipping link (disabled)\n" ); +return 0 ; + } + ret =media_pipeline_add_pad (pipe, walk, remote);if (ret)return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 18/399 media: mc: Fix flags handling when creating pad links
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit 422f7af75d03d50895938d38bc9cb8be759c440f ]
The media_create_pad_link() function doesn't correctly clear reject link type flags, nor does it set the DATA_LINK flag. It only works because the MEDIA_LNK_FL_DATA_LINK flag's value is 0.
Fix it by returning an error if any link type flag is set. This doesn't introduce any regression, as nobody calls the media_create_pad_link() function with link type flags (easily checked by grepping for the flag in the source code, there are very few hits).
Set the MEDIA_LNK_FL_DATA_LINK explicitly, which is a no-op that the compiler will optimize out, but is still useful to make the code more explicit and easier to understand.
--- drivers/media/mc/mc-entity.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/media/mc/mc-entity.c +6 -1
@@ -1092,6 +1092,11 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,struct media_link *link;struct media_link *backlink; +if (flags &MEDIA_LNK_FL_LINK_TYPE ) +return -EINVAL ; + + flags |=MEDIA_LNK_FL_DATA_LINK ; +if (WARN_ON (!source || !sink) ||WARN_ON (source_pad >= source->num_pads) ||WARN_ON (sink_pad >= sink->num_pads))
@@ -1107,7 +1112,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, link->source = &source->pads[source_pad]; link->sink = &sink->pads[sink_pad]; - link->flags = flags & ~MEDIA_LNK_FL_INTERFACE_LINK ; + link->flags = flags;/* Initialize graph object embedded at the new link */ media_gobj_create(source->graph_obj.mdev, MEDIA_GRAPH_LINK,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 19/399 media: nxp: imx8-isi: Check whether crossbar pad is non-NULL before access
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit eb2f932100288dbb881eadfed02e1459c6b9504c ]
When translating source to sink streams in the crossbar subdev, the driver tries to locate the remote subdev connected to the sink pad. The remote pad may be NULL, if userspace tries to enable a stream that ends at an unconnected crossbar sink. When that occurs, the driver dereferences the NULL pad, leading to a crash.
Prevent the crash by checking if the pad is NULL before using it, and return an error if it is.
--- drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +7 -1
@@ -160,8 +160,14 @@ mxc_isi_crossbar_xlate_streams(struct mxc_isi_crossbar *xbar, } pad =media_pad_remote_pad_first (&xbar->pads[sink_pad]); - sd =media_entity_to_v4l2_subdev (pad->entity); +if (!pad) { +dev_dbg (xbar->isi->dev, +"no pad connected to crossbar input %u\n" , + sink_pad); +return ERR_PTR (-EPIPE ); + } + sd =media_entity_to_v4l2_subdev (pad->entity);if (!sd) { dev_dbg(xbar->isi->dev, "no entity connected to crossbar input %u\n",
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 20/399 media: mc: Add num_links flag to media_pad
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit baeddf94aa61879b118f2faa37ed126d772670cc ]
Maintain a counter of the links connected to a pad in the media_pad structure. This helps checking if a pad is connected to anything, which will be used in the pipeline building code.
--- drivers/media/mc/mc-entity.c | 6 ++++++ include/media/media-entity.h | 2 ++ 2 files changed, 8 insertions(+)
drivers/media/mc/mc-entity.c +6 -0
@@ -1038,6 +1038,9 @@ static void __media_entity_remove_link(struct media_entity *entity,/* Remove the reverse links for a data link. */ if ((link->flags &MEDIA_LNK_FL_LINK_TYPE ) ==MEDIA_LNK_FL_DATA_LINK ) { + link->source->num_links--; + link->sink->num_links--; +if (link->source->entity == entity) remote = link->sink->entity;else
@@ -1143,6 +1146,9 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, sink->num_links++; source->num_links++; + link->source->num_links++; + link->sink->num_links++; +return 0 ; }EXPORT_SYMBOL_GPL (media_create_pad_link);
include/media/media-entity.h +2 -0
@@ -225,6 +225,7 @@ enum media_pad_signal_type {* @graph_obj: Embedded structure containing the media object common data * @entity: Entity this pad belongs to * @index: Pad index in the entity pads array, numbered from 0 to n +* @num_links: Number of links connected to this pad * @sig_type: Type of the signal inside a media pad * @flags: Pad flags, as defined in * :ref:`include/uapi/linux/media.h <media_header>`
@@ -236,6 +237,7 @@ struct media_pad {struct media_gobj graph_obj;/* must be first field in struct */ struct media_entity *entity;u16 index; +u16 num_links;enum media_pad_signal_type sig_type;unsigned long flags;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 21/399 media: mc: Rename pad variable to clarify intent
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit 9ec9109cf9f611e3ec9ed0355afcc7aae5e73176 ]
The pad local variable in the media_pipeline_explore_next_link() function is used to store the pad through which the entity has been reached. Rename it to origin to reflect that and make the code easier to read. This will be even more important in subsequent commits when expanding the function with additional logic.
--- drivers/media/mc/mc-entity.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/media/mc/mc-entity.c +6 -5
@@ -605,13 +605,13 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, struct media_pipeline_walk *walk) {struct media_pipeline_walk_entry *entry =media_pipeline_walk_top (walk); -struct media_pad *pad; +struct media_pad *origin;struct media_link *link;struct media_pad *local;struct media_pad *remote;int ret; - pad = entry->pad; + origin = entry->pad; link =list_entry (entry->links,typeof (*link), list);media_pipeline_walk_pop (walk);
@@ -621,7 +621,7 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe, link->sink->entity->name, link->sink->index);/* Get the local pad and remote pad. */ -if (link->source->entity == pad->entity) { +if (link->source->entity == origin->entity) { local = link->source; remote = link->sink; }else {
@@ -633,8 +633,9 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe,* Skip links that originate from a different pad than the incoming pad * that is not connected internally in the entity to the incoming pad. */ -if (pad != local && - !media_entity_has_pad_interdep (pad->entity, pad->index, local->index)) { +if (origin != local && + !media_entity_has_pad_interdep (origin->entity, origin->index, + local->index)) {dev_dbg (walk->mdev->dev,"media pipeline: skipping link (no route)\n" );return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 22/399 media: mc: Expand MUST_CONNECT flag to always require an enabled link
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit b3decc5ce7d778224d266423b542326ad469cb5f ]
The MEDIA_PAD_FL_MUST_CONNECT flag indicates that the pad requires an enabled link to stream, but only if it has any link at all. This makes little sense, as if a pad is part of a pipeline, there are very few use cases for an active link to be mandatory only if links exist at all. A review of in-tree drivers confirms they all need an enabled link for pads marked with the MEDIA_PAD_FL_MUST_CONNECT flag.
Expand the scope of the flag by rejecting pads that have no links at all. This requires modifying the pipeline build code to add those pads to the pipeline.
--- .../media/mediactl/media-types.rst | 11 ++-- drivers/media/mc/mc-entity.c | 53 +++++++++++++++---- 2 files changed, 48 insertions(+), 16 deletions(-)
Documentation/userspace-api/media/mediactl/media-types.rst +5 -6
@@ -375,12 +375,11 @@ Types and flags used to represent the media graph elements are origins of links. * - ``MEDIA_PAD_FL_MUST_CONNECT`` - - If this flag is set and the pad is linked to any other pad, then - at least one of those links must be enabled for the entity to be - able to stream. There could be temporary reasons (e.g. device - configuration dependent) for the pad to need enabled links even - when this flag isn't set; the absence of the flag doesn't imply - there is none. + - If this flag is set, then for this pad to be able to stream, it must + be connected by at least one enabled link. There could be temporary + reasons (e.g. device configuration dependent) for the pad to need + enabled links even when this flag isn't set; the absence of the flag + doesn't imply there is none. One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE``
drivers/media/mc/mc-entity.c +43 -10
122 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 23/399 media: nxp: imx8-isi: Mark all crossbar sink pads as MUST_CONNECT
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit 9b71021b2ea537632b01e51e3f003df24a637858 ]
All the sink pads of the crossbar switch require an active link if they're part of the pipeline. Mark them with the MEDIA_PAD_FL_MUST_CONNECT flag to fail pipeline validation if they're not connected. This allows removing a manual check when translating streams.
--- .../media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +2 -8
@@ -160,13 +160,6 @@ mxc_isi_crossbar_xlate_streams(struct mxc_isi_crossbar *xbar, } pad =media_pad_remote_pad_first (&xbar->pads[sink_pad]); -if (!pad) { -dev_dbg (xbar->isi->dev, -"no pad connected to crossbar input %u\n" , - sink_pad); -return ERR_PTR (-EPIPE ); - } - sd =media_entity_to_v4l2_subdev (pad->entity);if (!sd) { dev_dbg(xbar->isi->dev,
@@ -475,7 +468,8 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi) }for (i =0 ; i < xbar->num_sinks; ++i) - xbar->pads[i].flags =MEDIA_PAD_FL_SINK ; + xbar->pads[i].flags =MEDIA_PAD_FL_SINK + |MEDIA_PAD_FL_MUST_CONNECT ;for (i =0 ; i < xbar->num_sources; ++i) xbar->pads[i + xbar->num_sinks].flags =MEDIA_PAD_FL_SOURCE ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 24/399 md: use RCU lock to protect traversal in md_spares_need_change()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Lingfeng <[email protected]>
[ Upstream commit 570b9147deb6b07b955b55e06c714ca12a5f3e16 ]
Since md_start_sync() will be called without the protect of mddev_lock, and it can run concurrently with array reconfiguration, traversal of rdev in it should be protected by RCU lock.
Commit bc08041b32ab ("md: suspend array in md_start_sync() if array need reconfiguration") added md_spares_need_change() to md_start_sync(), casusing use of rdev without any protection.
Fix this by adding RCU lock in md_spares_need_change().
--- drivers/md/md.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/md/md.c +7 -2
@@ -9277,9 +9277,14 @@ static bool md_spares_need_change(struct mddev *mddev) {struct md_rdev *rdev; -rdev_for_each (rdev, mddev) -if (rdev_removeable (rdev) ||rdev_addable (rdev)) +rcu_read_lock (); +rdev_for_each_rcu (rdev, mddev) { +if (rdev_removeable (rdev) ||rdev_addable (rdev)) { +rcu_read_unlock ();return true; + } + } +rcu_read_unlock ();return false; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 25/399 KVM: Always flush async #PF workqueue when vCPU is being destroyed
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Christopherson <[email protected]>
[ Upstream commit 3d75b8aa5c29058a512db29da7cbee8052724157 ]
Always flush the per-vCPU async #PF workqueue when a vCPU is clearing its completion queue, e.g. when a VM and all its vCPUs is being destroyed. KVM must ensure that none of its workqueue callbacks is running when the last reference to the KVM _module_ is put. Gifting a reference to the associated VM prevents the workqueue callback from dereferencing freed vCPU/VM memory, but does not prevent the KVM module from being unloaded before the callback completes.
Drop the misguided VM refcount gifting, as calling kvm_put_kvm() from async_pf_execute() if kvm_put_kvm() flushes the async #PF workqueue will result in deadlock. async_pf_execute() can't return until kvm_put_kvm() finishes, and kvm_put_kvm() can't return until async_pf_execute() finishes:
WARNING: CPU: 8 PID: 251 at virt/kvm/kvm_main.c:1435 kvm_put_kvm+0x2d/0x320 [kvm]
Modules linked in: vhost_net vhost vhost_iotlb tap kvm_intel kvm irqbypass
CPU: 8 PID: 251 Comm: kworker/8:1 Tainted: G W 6.6.0-rc1-e7af8d17224a-x86/gmem-vm #119
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
Workqueue: events async_pf_execute [kvm]
RIP: 0010:kvm_put_kvm+0x2d/0x320 [kvm]
Call Trace:
<TASK>
async_pf_execute+0x198/0x260 [kvm]
process_one_work+0x145/0x2d0
worker_thread+0x27e/0x3a0
kthread+0xba/0xe0
ret_from_fork+0x2d/0x50
ret_from_fork_asm+0x11/0x20
</TASK>
---[ end trace 0000000000000000 ]---
INFO: task kworker/8:1:251 blocked for more than 120 seconds.
Tainted: G W 6.6.0-rc1-e7af8d17224a-x86/gmem-vm #119
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/8:1 state:D stack:0 pid:251 ppid:2 flags:0x00004000
Workqueue: events async_pf_execute [kvm]
Call Trace:
<TASK>
__schedule+0x33f/0xa40
schedule+0x53/0xc0
schedule_timeout+0x12a/0x140
__wait_for_common+0x8d/0x1d0
__flush_work.isra.0+0x19f/0x2c0
kvm_clear_async_pf_completion_queue+0x129/0x190 [kvm]
kvm_arch_destroy_vm+0x78/0x1b0 [kvm]
kvm_put_kvm+0x1c1/0x320 [kvm]
async_pf_execute+0x198/0x260 [kvm]
process_one_work+0x145/0x2d0
worker_thread+0x27e/0x3a0
kthread+0xba/0xe0
ret_from_fork+0x2d/0x50
ret_from_fork_asm+0x11/0x20
</TASK>If kvm_clear_async_pf_completion_queue() actually flushes the workqueue, then there's no need to gift async_pf_execute() a reference because all invocations of async_pf_execute() will be forced to complete before the vCPU and its VM are destroyed/freed. And that in turn fixes the module unloading bug as __fput() won't do module_put() on the last vCPU reference until the vCPU has been freed, e.g. if closing the vCPU file also puts the last reference to the KVM module.
Note that kvm_check_async_pf_completion() may also take the work item off the completion queue and so also needs to flush the work queue, as the work will not be seen by kvm_clear_async_pf_completion_queue(). Waiting on the workqueue could theoretically delay a vCPU due to waiting for the work to complete, but that's a very, very small chance, and likely a very small delay. kvm_arch_async_page_present_queued() unconditionally makes a new request, i.e. will effectively delay entering the guest, so the remaining work is really just:
trace_kvm_async_pf_completed(addr, cr2_or_gpa);
__kvm_vcpu_wake_up(vcpu);
mmput(mm);and mmput() can't drop the last reference to the page tables if the vCPU is still alive, i.e. the vCPU won't get stuck tearing down page tables.
Add a helper to do the flushing, specifically to deal with "wakeup all" work items, as they aren't actually work items, i.e. are never placed in a workqueue. Trying to flush a bogus workqueue entry rightly makes __flush_work() complain (kudos to whoever added that sanity check).
Note, commit 5f6de5cbebee ("KVM: Prevent module exit until all VMs are freed") *tried* to fix the module refcounting issue by having VMs grab a reference to the module, but that only made the bug slightly harder to hit as it gave async_pf_execute() a bit more time to complete before the KVM module could be unloaded.
--- virt/kvm/async_pf.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
virt/kvm/async_pf.c +26 -5
@@ -87,7 +87,27 @@ static void async_pf_execute(struct work_struct *work)__kvm_vcpu_wake_up (vcpu);mmput (mm); -kvm_put_kvm (vcpu->kvm); +} + +static void kvm_flush_and_free_async_pf_work (struct kvm_async_pf *work) +{ +/* +* The async #PF is "done", but KVM must wait for the work item itself, +* i.e. async_pf_execute(), to run to completion. If KVM is a module, +* KVM must ensure *no* code owned by the KVM (the module) can be run +* after the last call to module_put(). Note, flushing the work item +* is always required when the item is taken off the completion queue. +* E.g. even if the vCPU handles the item in the "normal" path, the VM +* could be terminated before async_pf_execute() completes. +* +* Wake all events skip the queue and go straight done, i.e. don't +* need to be flushed (but sanity check that the work wasn't queued). +*/ +if (work->wakeup_all) +WARN_ON_ONCE (work->work.func); +else +flush_work (&work->work); +kmem_cache_free (async_pf_cache, work); }void kvm_clear_async_pf_completion_queue (struct kvm_vcpu *vcpu)
@@ -114,7 +134,6 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)#else if (cancel_work_sync (&work->work)) {mmput (work->mm); -kvm_put_kvm (vcpu->kvm);/* == work->vcpu->kvm */ kmem_cache_free (async_pf_cache, work); }#endif
@@ -126,7 +145,10 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)list_first_entry (&vcpu->async_pf.done,typeof (*work), link);list_del (&work->link); -kmem_cache_free (async_pf_cache, work); + +spin_unlock (&vcpu->async_pf.lock); +kvm_flush_and_free_async_pf_work (work); +spin_lock (&vcpu->async_pf.lock); }spin_unlock (&vcpu->async_pf.lock);
@@ -151,7 +173,7 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu)list_del (&work->queue); vcpu->async_pf.queued--; -kmem_cache_free (async_pf_cache, work); +kvm_flush_and_free_async_pf_work (work); } }
@@ -186,7 +208,6 @@ bool kvm_setup_async_pf(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, work->arch = *arch; work->mm = current->mm;mmget (work->mm); -kvm_get_kvm (work->vcpu->kvm);INIT_WORK (&work->work, async_pf_execute);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 26/399 arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 8ca7fbd92c1b28edb5d5df7aeb8bb4886ddb9829 ]
WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact it is offset by one. Correct it to fix recording via analogue microphones.
--- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550-qrd.dts +1 -1
@@ -978,7 +978,7 @@ &swr2 { wcd_tx: codec@0,3 { compatible = "sdw20217010d00"; reg = <0 3>; - qcom,tx-port-mapping = <1 1 2 3>; + qcom,tx-port-mapping = <2 2 3 4>; }; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 27/399 arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit b66966b1bbc0aa58f7af83cbd56d5a206892857c ]
WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact it is offset by one. Correct it to fix recording via analogue microphones.
The change is based on QRD8550 and should be correct here as well, but was not tested on MTP8550.
--- arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8550-mtp.dts +1 -1
@@ -874,7 +874,7 @@ &swr2 { wcd_tx: codec@0,3 { compatible = "sdw20217010d00"; reg = <0 3>; - qcom,tx-port-mapping = <1 1 2 3>; + qcom,tx-port-mapping = <2 2 3 4>; }; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 28/399 cpufreq: amd-pstate: Fix min_perf assignment in amd_pstate_adjust_perf()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tor Vic <[email protected]>
[ Upstream commit b26ffbf800ae3c8d01bdf90d9cd8a37e1606ff06 ]
In the function amd_pstate_adjust_perf(), the 'min_perf' variable is set to 'highest_perf' instead of 'lowest_perf'.
--- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/amd-pstate.c +1 -1
@@ -570,7 +570,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu,if (target_perf < capacity) des_perf =DIV_ROUND_UP (cap_perf * target_perf, capacity); - min_perf =READ_ONCE (cpudata->highest_perf); + min_perf =READ_ONCE (cpudata->lowest_perf);if (_min_perf < capacity) min_perf =DIV_ROUND_UP (cap_perf * _min_perf, capacity);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 29/399 thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <[email protected]>
[ Upstream commit 7251b9e8a007ddd834aa81f8c7ea338884629fec ]
CPU temperature can be negative in some cases. Thus the negative CPU temperature should not be considered as a failure.
Fix intel_tcc_get_temp() and its users to support negative CPU temperature.
--- .../intel/int340x_thermal/processor_thermal_device.c | 8 ++++---- drivers/thermal/intel/intel_tcc.c | 12 ++++++------ drivers/thermal/intel/x86_pkg_temp_thermal.c | 8 ++++---- include/linux/intel_tcc.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +4 -4
@@ -176,14 +176,14 @@ static int proc_thermal_get_zone_temp(struct thermal_zone_device *zone, int *temp) {int cpu; -int curr_temp; +int curr_temp, ret; *temp =0 ;for_each_online_cpu (cpu) { - curr_temp =intel_tcc_get_temp (cpu, false); -if (curr_temp <0 ) -return curr_temp; + ret =intel_tcc_get_temp (cpu, &curr_temp, false); +if (ret <0 ) +return ret;if (!*temp || curr_temp > *temp) *temp = curr_temp; }
drivers/thermal/intel/intel_tcc.c +6 -6
@@ -103,18 +103,19 @@ EXPORT_SYMBOL_NS_GPL(intel_tcc_set_offset, INTEL_TCC);/** * intel_tcc_get_temp() - returns the current temperature * @cpu: cpu that the MSR should be run on, nagative value means any cpu. +* @temp: pointer to the memory for saving cpu temperature. * @pkg: true: Package Thermal Sensor. false: Core Thermal Sensor. * * Get the current temperature returned by the CPU core/package level * thermal sensor, in degrees C. * -* Return: Temperature in degrees C on success, negative error code otherwise. +* Return: 0 on success, negative error code otherwise. */ -int intel_tcc_get_temp (int cpu,bool pkg) +int intel_tcc_get_temp (int cpu,int *temp,bool pkg) {u32 low, high;u32 msr = pkg ?MSR_IA32_PACKAGE_THERM_STATUS :MSR_IA32_THERM_STATUS ; -int tjmax, temp, err; +int tjmax, err; tjmax =intel_tcc_get_tjmax (cpu);if (tjmax <0 )
@@ -131,9 +132,8 @@ int intel_tcc_get_temp(int cpu, bool pkg)if (!(low &BIT (31 )))return -ENODATA ; - temp = tjmax - ((low >>16 ) &0x7f ); + *temp = tjmax - ((low >>16 ) &0x7f ); -/* Do not allow negative CPU temperature */ -return temp >=0 ? temp : -ENODATA ; +return 0 ; }EXPORT_SYMBOL_NS_GPL (intel_tcc_get_temp,INTEL_TCC );
drivers/thermal/intel/x86_pkg_temp_thermal.c +4 -4
@@ -108,11 +108,11 @@ static struct zone_device *pkg_temp_thermal_get_dev(unsigned int cpu)static int sys_get_curr_temp (struct thermal_zone_device *tzd,int *temp) {struct zone_device *zonedev =thermal_zone_device_priv (tzd); -int val; +int val, ret; - val =intel_tcc_get_temp (zonedev->cpu, true); -if (val <0 ) -return val; + ret =intel_tcc_get_temp (zonedev->cpu, &val, true); +if (ret <0 ) +return ret; *temp = val *1000 ;pr_debug ("sys_get_curr_temp %d\n" , *temp);
include/linux/intel_tcc.h +1 -1
@@ -13,6 +13,6 @@int intel_tcc_get_tjmax (int cpu);int intel_tcc_get_offset (int cpu);int intel_tcc_set_offset (int cpu,int offset); -int intel_tcc_get_temp (int cpu,bool pkg); +int intel_tcc_get_temp (int cpu,int *temp,bool pkg);#endif /* __INTEL_TCC_H__ */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 30/399 powercap: intel_rapl: Fix a NULL pointer dereference
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <[email protected]>
[ Upstream commit 2d1f5006ff95770da502f8cee2a224a1ff83866e ]
A NULL pointer dereference is triggered when probing the MMIO RAPL driver on platforms with CPU ID not listed in intel_rapl_common CPU model list.
This is because the intel_rapl_common module still probes on such platforms even if 'defaults_msr' is not set after commit 1488ac990ac8 ("powercap: intel_rapl: Allow probing without CPUID match"). Thus the MMIO RAPL rp->priv->defaults is NULL when registering to RAPL framework.
Fix the problem by adding sanity check to ensure rp->priv->rapl_defaults is always valid.
--- drivers/powercap/intel_rapl_common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/powercap/intel_rapl_common.c +5 -0
@@ -759,6 +759,11 @@ static int rapl_config(struct rapl_package *rp)default :return -EINVAL ; } + +/* defaults_msr can be NULL on unsupported platforms */ +if (!rp->priv->defaults || !rp->priv->rpi) +return -ENODEV ; +return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 31/399 powercap: intel_rapl: Fix locking in TPMI RAPL
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <[email protected]>
[ Upstream commit 1aa09b9379a7a644cd2f75ae0bac82b8783df600 ]
The RAPL framework uses CPU hotplug locking to protect the rapl_packages list and rp->lead_cpu to guarantee that
1. the RAPL package device is not unprobed and freed
2. the cached rp->lead_cpu is always valid
for operations like powercap sysfs accesses.
Current RAPL APIs assume being called from CPU hotplug callbacks which hold the CPU hotplug lock, but TPMI RAPL driver invokes the APIs in the driver's .probe() function without acquiring the CPU hotplug lock.
Fix the problem by providing both locked and lockless versions of RAPL APIs.
--- drivers/powercap/intel_rapl_common.c | 29 +++++++++++++++++-- drivers/powercap/intel_rapl_msr.c | 8 ++--- .../int340x_thermal/processor_thermal_rapl.c | 8 ++--- include/linux/intel_rapl.h | 6 ++++ 4 files changed, 40 insertions(+), 11 deletions(-)
drivers/powercap/intel_rapl_common.c +26 -3
@@ -5,6 +5,7 @@*/ #define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/cleanup.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/list.h>
@@ -1504,7 +1505,7 @@ static int rapl_detect_domains(struct rapl_package *rp) }/* called from CPU hotplug notifier, hotplug lock held */ -void rapl_remove_package (struct rapl_package *rp) +void rapl_remove_package_cpuslocked (struct rapl_package *rp) {struct rapl_domain *rd, *rd_package =NULL ;
@@ -1533,10 +1534,18 @@ void rapl_remove_package(struct rapl_package *rp)list_del (&rp->plist);kfree (rp); } +EXPORT_SYMBOL_GPL (rapl_remove_package_cpuslocked); + +void rapl_remove_package (struct rapl_package *rp) +{ +guard (cpus_read_lock)(); +rapl_remove_package_cpuslocked (rp); +}EXPORT_SYMBOL_GPL (rapl_remove_package);/* caller to ensure CPU hotplug lock is held */ -struct rapl_package *rapl_find_package_domain (int id,struct rapl_if_priv *priv,bool id_is_cpu) +struct rapl_package *rapl_find_package_domain_cpuslocked (int id,struct rapl_if_priv *priv, +bool id_is_cpu) {struct rapl_package *rp;int uid;
@@ -1554,10 +1563,17 @@ struct rapl_package *rapl_find_package_domain(int id, struct rapl_if_priv *priv,return NULL ; } +EXPORT_SYMBOL_GPL (rapl_find_package_domain_cpuslocked); + +struct rapl_package *rapl_find_package_domain (int id,struct rapl_if_priv *priv,bool id_is_cpu) +{ +guard (cpus_read_lock)(); +return rapl_find_package_domain_cpuslocked (id, priv, id_is_cpu); +}EXPORT_SYMBOL_GPL (rapl_find_package_domain);/* called from CPU hotplug notifier, hotplug lock held */ -struct rapl_package *rapl_add_package (int id,struct rapl_if_priv *priv,bool id_is_cpu) +struct rapl_package *rapl_add_package_cpuslocked (int id,struct rapl_if_priv *priv,bool id_is_cpu) {struct rapl_package *rp;int ret;
@@ -1603,6 +1619,13 @@ struct rapl_package *rapl_add_package(int id, struct rapl_if_priv *priv, bool idkfree (rp);return ERR_PTR (ret); } +EXPORT_SYMBOL_GPL (rapl_add_package_cpuslocked); + +struct rapl_package *rapl_add_package (int id,struct rapl_if_priv *priv,bool id_is_cpu) +{ +guard (cpus_read_lock)(); +return rapl_add_package_cpuslocked (id, priv, id_is_cpu); +}EXPORT_SYMBOL_GPL (rapl_add_package);static void power_limit_state_save (void )
drivers/powercap/intel_rapl_msr.c +4 -4
@@ -73,9 +73,9 @@ static int rapl_cpu_online(unsigned int cpu) {struct rapl_package *rp; - rp =rapl_find_package_domain (cpu, rapl_msr_priv, true); + rp =rapl_find_package_domain_cpuslocked (cpu, rapl_msr_priv, true);if (!rp) { - rp =rapl_add_package (cpu, rapl_msr_priv, true); + rp =rapl_add_package_cpuslocked (cpu, rapl_msr_priv, true);if (IS_ERR (rp))return PTR_ERR (rp); }
@@ -88,14 +88,14 @@ static int rapl_cpu_down_prep(unsigned int cpu)struct rapl_package *rp;int lead_cpu; - rp =rapl_find_package_domain (cpu, rapl_msr_priv, true); + rp =rapl_find_package_domain_cpuslocked (cpu, rapl_msr_priv, true);if (!rp)return 0 ;cpumask_clear_cpu (cpu, &rp->cpumask); lead_cpu =cpumask_first (&rp->cpumask);if (lead_cpu >= nr_cpu_ids) -rapl_remove_package (rp); +rapl_remove_package_cpuslocked (rp);else if (rp->lead_cpu == cpu) rp->lead_cpu = lead_cpu;return 0 ;
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c +4 -4
@@ -27,9 +27,9 @@ static int rapl_mmio_cpu_online(unsigned int cpu)if (topology_physical_package_id (cpu))return 0 ; - rp =rapl_find_package_domain (cpu, &rapl_mmio_priv, true); + rp =rapl_find_package_domain_cpuslocked (cpu, &rapl_mmio_priv, true);if (!rp) { - rp =rapl_add_package (cpu, &rapl_mmio_priv, true); + rp =rapl_add_package_cpuslocked (cpu, &rapl_mmio_priv, true);if (IS_ERR (rp))return PTR_ERR (rp); }
@@ -42,14 +42,14 @@ static int rapl_mmio_cpu_down_prep(unsigned int cpu)struct rapl_package *rp;int lead_cpu; - rp =rapl_find_package_domain (cpu, &rapl_mmio_priv, true); + rp =rapl_find_package_domain_cpuslocked (cpu, &rapl_mmio_priv, true);if (!rp)return 0 ;cpumask_clear_cpu (cpu, &rp->cpumask); lead_cpu =cpumask_first (&rp->cpumask);if (lead_cpu >= nr_cpu_ids) -rapl_remove_package (rp); +rapl_remove_package_cpuslocked (rp);else if (rp->lead_cpu == cpu) rp->lead_cpu = lead_cpu;return 0 ;
include/linux/intel_rapl.h +6 -0
@@ -178,6 +178,12 @@ struct rapl_package {struct rapl_if_priv *priv; }; +struct rapl_package *rapl_find_package_domain_cpuslocked (int id,struct rapl_if_priv *priv, +bool id_is_cpu); +struct rapl_package *rapl_add_package_cpuslocked (int id,struct rapl_if_priv *priv, +bool id_is_cpu); +void rapl_remove_package_cpuslocked (struct rapl_package *rp); +struct rapl_package *rapl_find_package_domain (int id,struct rapl_if_priv *priv,bool id_is_cpu);struct rapl_package *rapl_add_package (int id,struct rapl_if_priv *priv,bool id_is_cpu);void rapl_remove_package (struct rapl_package *rp);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 32/399 powercap: intel_rapl_tpmi: Fix a register bug
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <[email protected]>
[ Upstream commit faa9130ce716b286d786d59032bacfd9052c2094 ]
Add the missing Domain Info register. This also fixes the bogus definition of the Interrupt register.
Neither of these two registers was used previously.
--- drivers/powercap/intel_rapl_tpmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/powercap/intel_rapl_tpmi.c +1 -0
@@ -40,6 +40,7 @@ enum tpmi_rapl_register {TPMI_RAPL_REG_ENERGY_STATUS ,TPMI_RAPL_REG_PERF_STATUS ,TPMI_RAPL_REG_POWER_INFO , +TPMI_RAPL_REG_DOMAIN_INFO ,TPMI_RAPL_REG_INTERRUPT , TPMI_RAPL_REG_MAX = 15, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 33/399 powercap: intel_rapl_tpmi: Fix System Domain probing
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <[email protected]>
[ Upstream commit 903eb9fb85e32810f376a2858aad77c9298f9488 ]
Only domain root packages can enumerate System (Psys) domain. Whether a package is domain root or not is described in the Bit 0 of the Domain Info register.
Add support for Domain Info register and fix the System domain probing accordingly.
--- drivers/powercap/intel_rapl_tpmi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/powercap/intel_rapl_tpmi.c +14 -0
@@ -131,6 +131,12 @@ static void trp_release(struct tpmi_rapl_package *trp)mutex_unlock (&tpmi_rapl_lock); } +/* +* Bit 0 of TPMI_RAPL_REG_DOMAIN_INFO indicates if the current package is a domain +* root or not. Only domain root packages can enumerate System (Psys) Domain. +*/ +#define TPMI_RAPL_DOMAIN_ROOT BIT(0) +static int parse_one_domain (struct tpmi_rapl_package *trp,u32 offset) {u8 tpmi_domain_version;
@@ -140,6 +146,7 @@ static int parse_one_domain(struct tpmi_rapl_package *trp, u32 offset)enum rapl_domain_reg_id reg_id;int tpmi_domain_size, tpmi_domain_flags;u64 tpmi_domain_header =readq (trp->base + offset); +u64 tpmi_domain_info;/* Domain Parent bits are ignored for now */ tpmi_domain_version = tpmi_domain_header &0xff ;
@@ -170,6 +177,13 @@ static int parse_one_domain(struct tpmi_rapl_package *trp, u32 offset) domain_type =RAPL_DOMAIN_PACKAGE ;break ;case TPMI_RAPL_DOMAIN_SYSTEM : +if (!(tpmi_domain_flags &BIT (TPMI_RAPL_REG_DOMAIN_INFO ))) { +pr_warn (FW_BUG "System domain must support Domain Info register\n" ); +return -ENODEV ; + } + tpmi_domain_info =readq (trp->base + offset +TPMI_RAPL_REG_DOMAIN_INFO ); +if (!(tpmi_domain_info &TPMI_RAPL_DOMAIN_ROOT )) +return 0 ; domain_type =RAPL_DOMAIN_PLATFORM ;break ;case TPMI_RAPL_DOMAIN_MEMORY :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 34/399 powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
[ Upstream commit 5580e96dad5a439d561d9648ffcbccb739c2a120 ]
If nr_cpu_ids is too low to include at least all the threads of a single core adjust nr_cpu_ids upwards. This avoids triggering odd bugs in code that assumes all threads of a core are available.
--- arch/powerpc/kernel/prom.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/kernel/prom.c +6 -0
@@ -375,6 +375,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node,if (IS_ENABLED (CONFIG_PPC64 )) boot_cpu_hwid =be32_to_cpu (intserv[found_thread]); +if (nr_cpu_ids % nthreads !=0 ) { +set_nr_cpu_ids (ALIGN (nr_cpu_ids, nthreads)); +pr_warn ("nr_cpu_ids was not a multiple of threads_per_core, adjusted to %d\n" , + nr_cpu_ids); + } +/* * PAPR defines "logical" PVR values for cpus that * meet various levels of the architecture:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 35/399 powerpc/smp: Increase nr_cpu_ids to include the boot CPU
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
[ Upstream commit 777f81f0a9c780a6443bcf2c7785f0cc2e87c1ef ]
If nr_cpu_ids is too low to include the boot CPU adjust nr_cpu_ids upward. Otherwise the kernel will BUG when trying to allocate a paca for the boot CPU and fail to boot.
--- arch/powerpc/kernel/prom.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/kernel/prom.c +6 -0
@@ -381,6 +381,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node, nr_cpu_ids); } +if (boot_cpuid >= nr_cpu_ids) { +set_nr_cpu_ids (min (CONFIG_NR_CPUS ,ALIGN (boot_cpuid +1 , nthreads))); +pr_warn ("Boot CPU %d >= nr_cpu_ids, adjusted nr_cpu_ids to %d\n" , + boot_cpuid, nr_cpu_ids); + } +/* * PAPR defines "logical" PVR values for cpus that * meet various levels of the architecture:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 36/399 sparc64: NMI watchdog: fix return value of __setup handler
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit 3ed7c61e49d65dacb96db798c0ab6fcd55a1f20f ]
__setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from setup_nmi_watchdog().
--- arch/sparc/kernel/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/nmi.c +1 -1
@@ -279,7 +279,7 @@ static int __init setup_nmi_watchdog(char *str)if (!strncmp (str,"panic" ,5 )) panic_on_timeout =1 ; -return 0 ; +return 1 ; }__setup ("nmi_watchdog=" , setup_nmi_watchdog);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 37/399 sparc: vDSO: fix return value of __setup handler
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit 5378f00c935bebb846b1fdb0e79cb76c137c56b5 ]
__setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from vdso_setup().
--- arch/sparc/vdso/vma.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/sparc/vdso/vma.c +3 -4
@@ -449,9 +449,8 @@ static __init int vdso_setup(char *s)unsigned long val; err =kstrtoul (s,10 , &val); -if (err) -return err; - vdso_enabled = val; -return 0 ; +if (!err) + vdso_enabled = val; +return 1 ; }__setup ("vdso=" , vdso_setup);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 38/399 crypto: qat - change SLAs cleanup flow at shutdown
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damian Muszynski <[email protected]>
[ Upstream commit c2304e1a0b8051a60d4eb9c99a1c509d90380ae5 ]
The implementation of the Rate Limiting (RL) feature includes the cleanup of all SLAs during device shutdown. For each SLA, the firmware is notified of the removal through an admin message, the data structures that take into account the budgets are updated and the memory is freed. However, this explicit cleanup is not necessary as (1) the device is reset, and the firmware state is lost and (2) all RL data structures are freed anyway.
In addition, if the device is unresponsive, for example after a PCI AER error is detected, the admin interface might not be available. This might slow down the shutdown sequence and cause a timeout in the recovery flows which in turn makes the driver believe that the device is not recoverable.
Fix by replacing the explicit SLAs removal with just a free of the SLA data structures.
--- drivers/crypto/intel/qat/qat_common/adf_rl.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/crypto/intel/qat/qat_common/adf_rl.c +19 -1
@@ -788,6 +788,24 @@ static void clear_sla(struct adf_rl *rl_data, struct rl_sla *sla) sla_type_arr[node_id] =NULL ; } +static void free_all_sla (struct adf_accel_dev *accel_dev) +{ +struct adf_rl *rl_data = accel_dev->rate_limiting; +int sla_id; + +mutex_lock (&rl_data->rl_lock); + +for (sla_id =0 ; sla_id <RL_NODES_CNT_MAX ; sla_id++) { +if (!rl_data->sla[sla_id]) +continue ; + +kfree (rl_data->sla[sla_id]); + rl_data->sla[sla_id] =NULL ; + } + +mutex_unlock (&rl_data->rl_lock); +} +/** * add_update_sla() - handles the creation and the update of an SLA * @accel_dev: pointer to acceleration device structure
@@ -1155,7 +1173,7 @@ void adf_rl_stop(struct adf_accel_dev *accel_dev)return ;adf_sysfs_rl_rm (accel_dev); -adf_rl_remove_sla_all (accel_dev, true); +free_all_sla (accel_dev); }void adf_rl_exit (struct adf_accel_dev *accel_dev)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 39/399 crypto: qat - resolve race condition during AER recovery
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damian Muszynski <[email protected]>
[ Upstream commit 7d42e097607c4d246d99225bf2b195b6167a210c ]
During the PCI AER system's error recovery process, the kernel driver may encounter a race condition with freeing the reset_data structure's memory. If the device restart will take more than 10 seconds the function scheduling that restart will exit due to a timeout, and the reset_data structure will be freed. However, this data structure is used for completion notification after the restart is completed, which leads to a UAF bug.
This results in a KFENCE bug notice.
BUG: KFENCE: use-after-free read in adf_device_reset_worker+0x38/0xa0 [intel_qat] Use-after-free read at 0x00000000bc56fddf (in kfence-#142): adf_device_reset_worker+0x38/0xa0 [intel_qat] process_one_work+0x173/0x340
To resolve this race condition, the memory associated to the container of the work_struct is freed on the worker if the timeout expired, otherwise on the function that schedules the worker.
The timeout detection can be done by checking if the caller is still waiting for completion or not by using completion_done() function.
--- drivers/crypto/intel/qat/qat_common/adf_aer.c | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/crypto/intel/qat/qat_common/adf_aer.c +16 -6
@@ -92,7 +92,8 @@ static void adf_device_reset_worker(struct work_struct *work)if (adf_dev_restart (accel_dev)) {/* The device hanged and we can't restart it so stop here */ dev_err (&GET_DEV (accel_dev),"Restart device failed\n" ); -if (reset_data->mode ==ADF_DEV_RESET_ASYNC ) +if (reset_data->mode ==ADF_DEV_RESET_ASYNC || +completion_done (&reset_data->compl))kfree (reset_data);WARN (1 ,"QAT: device restart failed. Device is unusable\n" );return ;
@@ -100,11 +101,19 @@ static void adf_device_reset_worker(struct work_struct *work)adf_dev_restarted_notify (accel_dev);clear_bit (ADF_STATUS_RESTARTING , &accel_dev->status); -/* The dev is back alive. Notify the caller if in sync mode */ -if (reset_data->mode ==ADF_DEV_RESET_SYNC ) -complete (&reset_data->compl); -else +/* +* The dev is back alive. Notify the caller if in sync mode +* +* If device restart will take a more time than expected, +* the schedule_reset() function can timeout and exit. This can be +* detected by calling the completion_done() function. In this case +* the reset_data structure needs to be freed here. +*/ +if (reset_data->mode ==ADF_DEV_RESET_ASYNC || +completion_done (&reset_data->compl))kfree (reset_data); +else +complete (&reset_data->compl); } static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
@@ -137,8 +146,9 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,dev_err (&GET_DEV (accel_dev),"Reset device timeout expired\n" ); ret = -EFAULT ; + }else { +kfree (reset_data); } -kfree (reset_data);return ret; }return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 40/399 selftests/mqueue: Set timeout to 180 seconds
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: SeongJae Park <[email protected]>
[ Upstream commit 85506aca2eb4ea41223c91c5fe25125953c19b13 ]
While mq_perf_tests runs with the default kselftest timeout limit, which is 45 seconds, the test takes about 60 seconds to complete on i3.metal AWS instances. Hence, the test always times out. Increase the timeout to 180 seconds.
--- tools/testing/selftests/mqueue/setting | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/testing/selftests/mqueue/setting
tools/testing/selftests/mqueue/setting new file +1 -0
@@ -0,0 +1 @@ +timeout=180
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 41/399 pinctrl: qcom: sm8650-lpass-lpi: correct Kconfig name
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 47847b9bcdb13c2da1829323a66651ef63047b77 ]
Use proper model name in SM8650 LPASS pin controller Kconfig entry.
--- drivers/pinctrl/qcom/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/Kconfig +1 -1
@@ -125,7 +125,7 @@ config PINCTRL_SM8550_LPASS_LPI platform. config PINCTRL_SM8650_LPASS_LPI - tristate "Qualcomm Technologies Inc SM8550 LPASS LPI pin controller driver" + tristate "Qualcomm Technologies Inc SM8650 LPASS LPI pin controller driver" depends on ARM64 || COMPILE_TEST depends on PINCTRL_LPASS_LPI help
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 42/399 ext4: correct best extent lstart adjustment logic
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 4fbf8bc733d14bceb16dda46a3f5e19c6a9621c5 ]
When yangerkun review commit 93cdf49f6eca ("ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()"), it was found that the best extent did not completely cover the original request after adjusting the best extent lstart in ext4_mb_new_inode_pa() as follows:
original request: 2/10(8)
normalized request: 0/64(64)
best extent: 0/9(9)
When we check if best ex can be kept at start of goal, ac_o_ex.fe_logical is 2 less than the adjusted best extent logical end 9, so we think the adjustment is done. But obviously 0/9(9) doesn't cover 2/10(8), so we should determine here if the original request logical end is less than or equal to the adjusted best extent logical end.
In addition, add a comment stating when adjusted best_ex will not cover the original request, and remove the duplicate assertion because adjusting lstart makes no change to b_ex.fe_len.
--- fs/ext4/mballoc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
fs/ext4/mballoc.c +11 -6
@@ -5169,10 +5169,16 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) .fe_len = ac->ac_orig_goal_len, };loff_t orig_goal_end =extent_logical_end (sbi, &ex); +loff_t o_ex_end =extent_logical_end (sbi, &ac->ac_o_ex); -/* we can't allocate as much as normalizer wants. -* so, found space must get proper lstart -* to cover original request */ +/* +* We can't allocate as much as normalizer wants, so we try +* to get proper lstart to cover the original request, except +* when the goal doesn't cover the original request as below: +* +* orig_ex:2045/2055(10), isize:8417280 -> normalized:0/2048 +* best_ex:0/200(200) -> adjusted: 1848/2048(200) +*/ BUG_ON (ac->ac_g_ex.fe_logical > ac->ac_o_ex.fe_logical);BUG_ON (ac->ac_g_ex.fe_len < ac->ac_o_ex.fe_len);
@@ -5184,7 +5190,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)* 1. Check if best ex can be kept at end of goal (before * cr_best_avail trimmed it) and still cover original start * 2. Else, check if best ex can be kept at start of goal and -* still cover original start +* still cover original end * 3. Else, keep the best ex at start of original request. */ ex.fe_len = ac->ac_b_ex.fe_len;
@@ -5194,7 +5200,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) goto adjust_bex; ex.fe_logical = ac->ac_g_ex.fe_logical; -if (ac->ac_o_ex.fe_logical <extent_logical_end (sbi, &ex)) +if (o_ex_end <=extent_logical_end (sbi, &ex)) goto adjust_bex; ex.fe_logical = ac->ac_o_ex.fe_logical;
@@ -5202,7 +5208,6 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) ac->ac_b_ex.fe_logical = ex.fe_logical;BUG_ON (ac->ac_o_ex.fe_logical < ac->ac_b_ex.fe_logical); -BUG_ON (ac->ac_o_ex.fe_len > ac->ac_b_ex.fe_len);BUG_ON (extent_logical_end (sbi, &ex) > orig_goal_end); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 43/399 drm/amdgpu/display: Address kdoc for is_psr_su in fill_dc_dirty_rects
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
[ Upstream commit 3651306ae4c7f3f54caa9feb826a93cc69ccebbf ]
The is_psr_su parameter is a boolean flag indicating whether the Panel Self Refresh Selective Update (PSR SU) feature is enabled which is a power-saving feature that allows only the updated regions of the screen to be refreshed, reducing the amount of data that needs to be sent to the display.
Fixes the below with gcc W=1:drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5257: warning: Function parameter or member 'is_psr_su' not described in 'fill_dc_dirty_rects'
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
@@ -5199,6 +5199,10 @@ static inline void fill_dc_dirty_rect(struct drm_plane *plane,* @new_plane_state: New state of @plane * @crtc_state: New state of CRTC connected to the @plane * @flip_addrs: DC flip tracking struct, which also tracts dirty rects +* @is_psr_su: Flag indicating whether Panel Self Refresh Selective Update (PSR SU) is enabled. +* If PSR SU is enabled and damage clips are available, only the regions of the screen +* that have changed will be updated. If PSR SU is not enabled, +* or if damage clips are not available, the entire screen will be updated. * @dirty_regions_changed: dirty regions changed * * For PSR SU, DC informs the DMUB uController of dirty rectangle regions
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 44/399 block: Clear zone limits for a non-zoned stacked queue
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
[ Upstream commit c8f6f88d25929ad2f290b428efcae3b526f3eab0 ]
Device mapper may create a non-zoned mapped device out of a zoned device (e.g., the dm-zoned target). In such case, some queue limit such as the max_zone_append_sectors and zone_write_granularity endup being non zero values for a block device that is not zoned. Avoid this by clearing these limits in blk_stack_limits() when the stacked zoned limit is false.
--- block/blk-settings.c | 4 ++++ 1 file changed, 4 insertions(+)
block/blk-settings.c +4 -0
@@ -689,6 +689,10 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, t->zone_write_granularity =max (t->zone_write_granularity, b->zone_write_granularity); t->zoned =max (t->zoned, b->zoned); +if (!t->zoned) { + t->zone_write_granularity =0 ; + t->max_zone_append_sectors =0 ; + }return ret; }EXPORT_SYMBOL (blk_stack_limits);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 45/399 kasan/test: avoid gcc warning for intentional overflow
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit e10aea105e9ed14b62a11844fec6aaa87c6935a3 ]
The out-of-bounds test allocates an object that is three bytes too short in order to validate the bounds checking. Starting with gcc-14, this causes a compile-time warning as gcc has grown smart enough to understand the sizeof() logic:
mm/kasan/kasan_test.c: In function 'kmalloc_oob_16':mm/kasan/kasan_test.c:443:14: error: allocation of insufficient size '13' for type 'struct <anonymous>' with size '16' [-Werror=alloc-size]
443 | ptr1 = kmalloc(sizeof(*ptr1) - 3, GFP_KERNEL);
| ^
Hide the actual computation behind a RELOC_HIDE() that ensures the compiler misses the intentional bug.
--- mm/kasan/kasan_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/kasan/kasan_test.c +2 -1
@@ -440,7 +440,8 @@ static void kmalloc_oob_16(struct kunit *test)/* This test is specifically crafted for the generic mode. */ KASAN_TEST_NEEDS_CONFIG_ON (test,CONFIG_KASAN_GENERIC ); - ptr1 =kmalloc (sizeof (*ptr1) -3 ,GFP_KERNEL ); +/* RELOC_HIDE to prevent gcc from warning about short alloc */ + ptr1 =RELOC_HIDE (kmalloc (sizeof (*ptr1) -3 ,GFP_KERNEL ),0 );KUNIT_ASSERT_NOT_ERR_OR_NULL (test, ptr1); ptr2 =kmalloc (sizeof (*ptr2),GFP_KERNEL );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 46/399 bounds: support non-power-of-two CONFIG_NR_CPUS
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit f2d5dcb48f7ba9e3ff249d58fc1fa963d374e66a ]
ilog2() rounds down, so for example when PowerPC 85xx sets CONFIG_NR_CPUS to 24, we will only allocate 4 bits to store the number of CPUs instead of
5. Use bits_per() instead, which rounds up. Found by code inspection. The effect of this would probably be a misaccounting when doing NUMA balancing, so to a user, it would only be a performance penalty. The effects may be more wide-spread; it's hard to tell.
--- kernel/bounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bounds.c +1 -1
@@ -19,7 +19,7 @@ int main(void)DEFINE (NR_PAGEFLAGS , __NR_PAGEFLAGS);DEFINE (MAX_NR_ZONES , __MAX_NR_ZONES);#ifdef CONFIG_SMP -DEFINE (NR_CPUS_BITS ,ilog2 (CONFIG_NR_CPUS )); +DEFINE (NR_CPUS_BITS ,bits_per (CONFIG_NR_CPUS ));#endif DEFINE (SPINLOCK_SIZE ,sizeof (spinlock_t));#ifdef CONFIG_LRU_GEN
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 47/399 fat: fix uninitialized field in nostale filehandles
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit fde2497d2bc3a063d8af88b258dbadc86bd7b57c ]
When fat_encode_fh_nostale() encodes file handle without a parent it stores only first 10 bytes of the file handle. However the length of the file handle must be a multiple of 4 so the file handle is actually 12 bytes long and the last two bytes remain uninitialized. This is not great at we potentially leak uninitialized information with the handle to userspace. Properly initialize the full handle length.
--- fs/fat/nfs.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/fat/nfs.c +6 -0
@@ -130,6 +130,12 @@ fat_encode_fh_nostale(struct inode *inode, __u32 *fh, int *lenp, fid->parent_i_gen = parent->i_generation; type =FILEID_FAT_WITH_PARENT ; *lenp =FAT_FID_SIZE_WITH_PARENT ; + }else { +/* +* We need to initialize this field because the fh is actually +* 12 bytes long +*/ + fid->parent_i_pos_hi =0 ; }return type;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 48/399 fuse: fix VM_MAYSHARE and direct_io_allow_mmap
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernd Schubert <[email protected]>
[ Upstream commit 9511176bbaee0ac60ecc84e7b01cf5972a59ea17 ]
There were multiple issues with direct_io_allow_mmap:
- fuse_link_write_file() was missing, resulting in warnings in fuse_write_file_get() and EIO from msync()
- "vma->vm_ops = &fuse_file_vm_ops" was not set, but especially fuse_page_mkwrite is needed.
The semantics of invalidate_inode_pages2() is so far not clearly defined in fuse_file_mmap. It dates back to commit 3121bfe76311 ("fuse: fix "direct_io" private mmap") Though, as direct_io_allow_mmap is a new feature, that was for MAP_PRIVATE only. As invalidate_inode_pages2() is calling into fuse_launder_folio() and writes out dirty pages, it should be safe to call invalidate_inode_pages2 for MAP_PRIVATE and MAP_SHARED as well.
--- fs/fuse/file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
fs/fuse/file.c +6 -2
@@ -2468,7 +2468,8 @@ static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma)return fuse_dax_mmap (file, vma);if (ff->open_flags &FOPEN_DIRECT_IO ) { -/* Can't provide the coherency needed for MAP_SHARED +/* +* Can't provide the coherency needed for MAP_SHARED * if FUSE_DIRECT_IO_ALLOW_MMAP isn't set. */ if ((vma->vm_flags &VM_MAYSHARE ) && !fc->direct_io_allow_mmap)
@@ -2476,7 +2477,10 @@ static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma)invalidate_inode_pages2 (file->f_mapping); -return generic_file_mmap (file, vma); +if (!(vma->vm_flags &VM_MAYSHARE )) { +/* MAP_PRIVATE */ +return generic_file_mmap (file, vma); + } }if ((vma->vm_flags &VM_SHARED ) && (vma->vm_flags &VM_MAYWRITE ))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 49/399 mfd: twl: Select MFD_CORE
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Sverdlin <[email protected]>
[ Upstream commit 3bb36528d46e494987ee5e9682d08318928ae041 ]
Fix link error:
ld.bfd: drivers/mfd/twl-core.o: in function `twl_probe':git/drivers/mfd/twl-core.c:846: undefined reference to `devm_mfd_add_devices'
--- drivers/mfd/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/Kconfig +1 -0
@@ -1773,6 +1773,7 @@ config TWL4030_CORE bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 Support" depends on I2C=y select IRQ_DOMAIN + select MFD_CORE select REGMAP_I2C help Say yes here if you have TWL4030 / TWL6030 family chip on your board.
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 50/399 ubifs: Set page uptodate in the correct place
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit 723012cab779eee8228376754e22c6594229bf8f ]
Page cache reads are lockless, so setting the freshly allocated page uptodate before we've overwritten it with the data it's supposed to have in it will allow a simultaneous reader to see old data. Move the call to SetPageUptodate into ubifs_write_end(), which is after we copied the new data into the page.
--- fs/ubifs/file.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
fs/ubifs/file.c +4 -9
@@ -261,9 +261,6 @@ static int write_begin_slow(struct address_space *mapping,return err; } } - -SetPageUptodate (page); -ClearPageError (page); }if (PagePrivate (page))
@@ -463,9 +460,6 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,return err; } } - -SetPageUptodate (page); -ClearPageError (page); } err =allocate_budget (c, page, ui, appending);
@@ -475,10 +469,8 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,* If we skipped reading the page because we were going to * write all of it, then it is not up to date. */ -if (skipped_read) { +if (skipped_read)ClearPageChecked (page); -ClearPageUptodate (page); - }/* * Budgeting failed which means it would have to force * write-back but didn't, because we set the @fast flag in the
@@ -569,6 +561,9 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping, goto out; } +if (len ==PAGE_SIZE ) +SetPageUptodate (page); +if (!PagePrivate (page)) {attach_page_private (page, (void *)1 );atomic_long_inc (&c->dirty_pg_cnt);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 51/399 ubi: Check for too small LEB size in VTBL code
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Weinberger <[email protected]>
[ Upstream commit 68a24aba7c593eafa8fd00f2f76407b9b32b47a9 ]
If the LEB size is smaller than a volume table record we cannot have volumes.
In this case abort attaching.
--- drivers/mtd/ubi/vtbl.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/mtd/ubi/vtbl.c +6 -0
@@ -791,6 +791,12 @@ int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai)* The number of supported volumes is limited by the eraseblock size * and by the UBI_MAX_VOLUMES constant. */ + +if (ubi->leb_size <UBI_VTBL_RECORD_SIZE ) { +ubi_err (ubi,"LEB size too small for a volume record" ); +return -EINVAL ; + } + ubi->vtbl_slots = ubi->leb_size /UBI_VTBL_RECORD_SIZE ;if (ubi->vtbl_slots >UBI_MAX_VOLUMES ) ubi->vtbl_slots =UBI_MAX_VOLUMES ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 52/399 ubi: correct the calculation of fastmap size
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Yi <[email protected]>
[ Upstream commit 7f174ae4f39e8475adcc09d26c5a43394689ad6c ]
Now that the calculation of fastmap size in ubi_calc_fm_size() is incorrect since it miss each user volume's ubi_fm_eba structure and the Internal UBI volume info. Let's correct the calculation.
--- drivers/mtd/ubi/fastmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mtd/ubi/fastmap.c +4 -3
@@ -85,9 +85,10 @@ size_t ubi_calc_fm_size(struct ubi_device *ubi)sizeof (struct ubi_fm_scan_pool ) +sizeof (struct ubi_fm_scan_pool ) + (ubi->peb_count *sizeof (struct ubi_fm_ec )) + - (sizeof (struct ubi_fm_eba ) + - (ubi->peb_count *sizeof (__be32))) + -sizeof (struct ubi_fm_volhdr ) *UBI_MAX_VOLUMES ; + ((sizeof (struct ubi_fm_eba ) + +sizeof (struct ubi_fm_volhdr )) * + (UBI_MAX_VOLUMES +UBI_INT_VOL_COUNT )) + + (ubi->peb_count *sizeof (__be32));return roundup (size, ubi->leb_size); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 53/399 ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhihao Cheng <[email protected]>
[ Upstream commit 6379b44cdcd67f5f5d986b73953e99700591edfa ]
For error handling path in ubifs_symlink(), inode will be marked as bad first, then iput() is invoked. If inode->i_link is initialized by fscrypt_encrypt_symlink() in encryption scenario, inode->i_link won't be freed by callchain ubifs_free_inode -> fscrypt_free_inode in error handling path, because make_bad_inode() has changed 'inode->i_mode' as 'S_IFREG'.
Following kmemleak is easy to be reproduced by injecting error in ubifs_jnl_update() when doing symlink in encryption scenario:
unreferenced object 0xffff888103da3d98 (size 8):
comm "ln", pid 1692, jiffies 4294914701 (age 12.045s) backtrace:
kmemdup+0x32/0x70 __fscrypt_encrypt_symlink+0xed/0x1c0 ubifs_symlink+0x210/0x300 [ubifs] vfs_symlink+0x216/0x360 do_symlinkat+0x11a/0x190 do_syscall_64+0x3b/0xe0
There are two ways fixing it:
1. Remove make_bad_inode() in error handling path. We can do that because ubifs_evict_inode() will do same processes for good symlink inode and bad symlink inode, for inode->i_nlink checking is before is_bad_inode().
2. Free inode->i_link before marking inode bad.
Method 2 is picked, it has less influence, personally, I think.
--- fs/ubifs/dir.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ubifs/dir.c +2 -0
@@ -1134,6 +1134,8 @@ static int ubifs_mknod(struct mnt_idmap *idmap, struct inode *dir, dir_ui->ui_size = dir->i_size;mutex_unlock (&dir_ui->ui_mutex); out_inode: +/* Free inode->i_link before inode is marked as bad. */ +fscrypt_free_inode (inode);make_bad_inode (inode);iput (inode); out_fname:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 54/399 mtd: rawnand: meson: fix scrambling mode value in command macro
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arseniy Krasnov <[email protected]>
[ Upstream commit ef6f463599e16924cdd02ce5056ab52879dc008c ]
Scrambling mode is enabled by value (1 << 19). NFC_CMD_SCRAMBLER_ENABLE is already (1 << 19), so there is no need to shift it again in CMDRWGEN macro.
--- drivers/mtd/nand/raw/meson_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/meson_nand.c +1 -1
@@ -63,7 +63,7 @@#define CMDRWGEN (cmd_dir, ran, bch, short_mode, page_size, pages) \ ( \ (cmd_dir) | \ - ((ran) << 19) | \ + (ran) | \ ((bch) << 14) | \ ((short_mode) << 13) | \ (((page_size) & 0x7f) << 6) | \
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 55/399 md/md-bitmap: fix incorrect usage for sb_index
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heming Zhao <[email protected]>
[ Upstream commit ecbd8ebb51bf7e4939d83b9e6022a55cac44ef06 ]
Commit d7038f951828 ("md-bitmap: don't use ->index for pages backing the bitmap file") removed page->index from bitmap code, but left wrong code logic for clustered-md. current code never set slot offset for cluster nodes, will sometimes cause crash in clustered env.
Call trace (partly):
md_bitmap_file_set_bit+0x110/0x1d8 [md_mod] md_bitmap_startwrite+0x13c/0x240 [md_mod] raid1_make_request+0x6b0/0x1c08 [raid1] md_handle_request+0x1dc/0x368 [md_mod] md_submit_bio+0x80/0xf8 [md_mod] __submit_bio+0x178/0x300 submit_bio_noacct_nocheck+0x11c/0x338 submit_bio_noacct+0x134/0x614 submit_bio+0x28/0xdc submit_bh_wbc+0x130/0x1cc submit_bh+0x1c/0x28
--- drivers/md/md-bitmap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/md/md-bitmap.c +6 -3
@@ -234,7 +234,8 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,sector_t doff; bdev = (rdev->meta_bdev) ? rdev->meta_bdev : rdev->bdev; -if (pg_index == store->file_pages -1 ) { +/* we compare length (page numbers), not page offset. */ +if ((pg_index - store->sb_index) == store->file_pages -1 ) {unsigned int last_page_size = store->bytes & (PAGE_SIZE -1 );if (last_page_size ==0 )
@@ -438,8 +439,8 @@ static void filemap_write_page(struct bitmap *bitmap, unsigned long pg_index,struct page *page = store->filemap[pg_index];if (mddev_is_clustered (bitmap->mddev)) { - pg_index += bitmap->cluster_slot * -DIV_ROUND_UP (store->bytes,PAGE_SIZE ); +/* go to node bitmap area starting point */ + pg_index += store->sb_index; }if (store->file)
@@ -952,6 +953,7 @@ static void md_bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)unsigned long index =file_page_index (store, chunk);unsigned long node_offset =0 ; + index += store->sb_index;if (mddev_is_clustered (bitmap->mddev)) node_offset = bitmap->cluster_slot * store->file_pages;
@@ -982,6 +984,7 @@ static void md_bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)unsigned long index =file_page_index (store, chunk);unsigned long node_offset =0 ; + index += store->sb_index;if (mddev_is_clustered (bitmap->mddev)) node_offset = bitmap->cluster_slot * store->file_pages;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 56/399 x86/nmi: Fix the inverse "in NMI handler" check
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
[ Upstream commit d54e56f31a34fa38fcb5e91df609f9633419a79a ]
Commit 344da544f177 ("x86/nmi: Print reasons why backtrace NMIs are ignored") creates a super nice framework to diagnose NMIs.
Every time nmi_exc() is called, it increments a per_cpu counter (nsp->idt_nmi_seq). At its exit, it also increments the same counter. By reading this counter it can be seen how many times that function was called (dividing by 2), and, if the function is still being executed, by checking the idt_nmi_seq's least significant bit.
On the check side (nmi_backtrace_stall_check()), that variable is queried to check if the NMI is still being executed, but, there is a mistake in the bitwise operation. That code wants to check if the least significant bit of the idt_nmi_seq is set or not, but does the opposite, and checks for all the other bits, which will always be true after the first exc_nmi() executed successfully.
This appends the misleading string to the dump "(CPU currently in NMI handler function)"
Fix it by checking the least significant bit, and if it is set, append the string.
--- arch/x86/kernel/nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/nmi.c +1 -1
@@ -636,7 +636,7 @@ void nmi_backtrace_stall_check(const struct cpumask *btp) msgp = nmi_check_stall_msg[idx];if (nsp->idt_ignored_snap !=READ_ONCE (nsp->idt_ignored) && (idx &0x1 )) modp =", but OK because ignore_nmis was set" ; -if (nmi_seq & ~0x1 ) +if (nmi_seq &0x1 ) msghp =" (CPU currently in NMI handler function)" ;else if (nsp->idt_nmi_seq_snap +1 == nmi_seq) msghp =" (CPU exited one NMI handler function)" ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 57/399 parisc/unaligned: Rewrite 64-bit inline assembly of emulate_ldd()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit e5db6a74571a8baf87a116ea39aab946283362ff ]
Convert to use real temp variables instead of clobbering processor registers. This aligns the 64-bit inline assembly code with the 32-bit assembly code which was rewritten with commit 427c1073a2a1 ("parisc/unaligned: Rewrite 32-bit inline assembly of emulate_ldd()").
While at it, fix comment in 32-bit rewrite code. Temporary variables are now used for both 32-bit and 64-bit code, so move their declarations to the function header.
No functional change intended.
--- arch/parisc/kernel/unaligned.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
arch/parisc/kernel/unaligned.c +12 -15
@@ -169,6 +169,7 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop)static int emulate_ldd (struct pt_regs *regs,int toreg,int flop) {unsigned long saddr = regs->ior; +unsigned long shift, temp1;__u64 val =0 ;ASM_EXCEPTIONTABLE_VAR (ret);
@@ -180,25 +181,22 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop)#ifdef CONFIG_64BIT __asm__ __volatile__ ( -" depd,z %3,60,3,%%r19\n" /* r19=(ofs&7)*8 */ -" mtsp %4, %%sr1\n" -" depd %%r0,63,3,%3\n" -"1: ldd 0(%%sr1,%3),%0\n" -"2: ldd 8(%%sr1,%3),%%r20\n" -" subi 64,%%r19,%%r19\n" -" mtsar %%r19\n" -" shrpd %0,%%r20,%%sar,%0\n" +" depd,z %2,60,3,%3\n" /* shift=(ofs&7)*8 */ +" mtsp %5, %%sr1\n" +" depd %%r0,63,3,%2\n" +"1: ldd 0(%%sr1,%2),%0\n" +"2: ldd 8(%%sr1,%2),%4\n" +" subi 64,%3,%3\n" +" mtsar %3\n" +" shrpd %0,%4,%%sar,%0\n" "3: \n" ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1") ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1") - : "=r" (val), "+r" (ret) - : "0" (val), "r" (saddr), "r" (regs->isr) - : "r19", "r20" ); + : "+r" (val), "+r" (ret), "+r" (saddr), "=&r" (shift), "=&r" (temp1) + : "r" (regs->isr) );#else - { -unsigned long shift, temp1; __asm__ __volatile__ ( -" zdep %2,29,2,%3\n" /* r19=(ofs&3)*8 */ +" zdep %2,29,2,%3\n" /* shift=(ofs&3)*8 */ " mtsp %5, %%sr1\n" " dep %%r0,31,2,%2\n" "1: ldw 0(%%sr1,%2),%0\n"
@@ -214,7 +212,6 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop) ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 4b, "%1") : "+r" (val), "+r" (ret), "+r" (saddr), "=&r" (shift), "=&r" (temp1) : "r" (regs->isr) ); - }#endif DPRINTF ("val = 0x%llx\n" , val);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 58/399 parisc: Avoid clobbering the C/B bits in the PSW with tophys and tovirt macros
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: John David Anglin <[email protected]>
[ Upstream commit 4603fbaa76b5e703b38ac8cc718102834eb6e330 ]
Use add,l to avoid clobbering the C/B bits in the PSW.
--- arch/parisc/include/asm/assembly.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
arch/parisc/include/asm/assembly.h +10 -8
@@ -97,26 +97,28 @@* version takes two arguments: a src and destination register. * However, the source and destination registers can not be * the same register. +* +* We use add,l to avoid clobbering the C/B bits in the PSW. */ .macro tophys grvirt, grphys - ldil L%(__PAGE_OFFSET), \grphys - sub \grvirt, \grphys, \grphys + ldil L%(-__PAGE_OFFSET), \grphys + addl \grvirt, \grphys, \grphys .endm - + .macro tovirt grphys, grvirt ldil L%(__PAGE_OFFSET), \grvirt - add \grphys, \grvirt, \grvirt + addl \grphys, \grvirt, \grvirt .endm .macro tophys_r1 gr - ldil L%(__PAGE_OFFSET), %r1 - sub \gr, %r1, \gr + ldil L%(-__PAGE_OFFSET), %r1 + addl \gr, %r1, \gr .endm - + .macro tovirt_r1 gr ldil L%(__PAGE_OFFSET), %r1 - add \gr, %r1, \gr + addl \gr, %r1, \gr .endm .macro delay value
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 59/399 parisc: Fix ip_fast_csum
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit a2abae8f0b638c31bb9799d9dd847306e0d005bd ]
IP checksum unit tests report the following error when run on hppa/hppa64.
# test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:463
Expected ( u64)csum_result == ( u64)expected, but
( u64)csum_result == 33754 (0x83da)
( u64)expected == 10946 (0x2ac2)
not ok 4 test_ip_fast_csum0x83da is the expected result if the IP header length is 20 bytes. 0x2ac2 is the expected result if the IP header length is 24 bytes. The test fails with an IP header length of 24 bytes. It appears that ip_fast_csum() always returns the checksum for a 20-byte header, no matter how long the header actually is.
Code analysis shows a suspicious assembler sequence in ip_fast_csum().
" addc %0, %3, %0\n" "1: ldws,ma 4(%1), %3\n" " addib,< 0, %2, 1b\n" <---
While my understanding of HPPA assembler is limited, it does not seem to make much sense to subtract 0 from a register and to expect the result to ever be negative. Subtracting 1 from the length parameter makes more sense. On top of that, the operation should be repeated if and only if the result is still > 0, so change the suspicious instruction to
" addib,> -1, %2, 1b\n"
The IP checksum unit test passes after this change.
--- arch/parisc/include/asm/checksum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/include/asm/checksum.h +1 -1
@@ -40,7 +40,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)" addc %0, %5, %0\n" " addc %0, %3, %0\n" "1: ldws,ma 4(%1), %3\n" -" addib,< 0, %2, 1b\n" +" addib,> -1, %2, 1b\n" " addc %0, %3, %0\n" "\n" " extru %0, 31, 16, %4\n"
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 60/399 parisc: Fix csum_ipv6_magic on 32-bit systems
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 4408ba75e4ba80c91fde7e10bccccf388f5c09be ]
Calculating the IPv6 checksum on 32-bit systems missed overflows when adding the proto+len fields into the checksum. This results in the following unit test failure.
# test_csum_ipv6_magic: ASSERTION FAILED at lib/checksum_kunit.c:506
Expected ( u64)csum_result == ( u64)expected, but
( u64)csum_result == 46722 (0xb682)
( u64)expected == 46721 (0xb681)
not ok 5 test_csum_ipv6_magicThis is probably rarely seen in the real world because proto+len are usually small values which will rarely result in overflows when calculating the checksum. However, the unit test code uses large values for the length field, causing the test to fail.
Fix the problem by adding the missing carry into the final checksum.
--- arch/parisc/include/asm/checksum.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/parisc/include/asm/checksum.h +2 -1
@@ -163,7 +163,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr," ldw,ma 4(%2), %7\n" /* 4th daddr */ " addc %6, %0, %0\n" " addc %7, %0, %0\n" -" addc %3, %0, %0\n" /* fold in proto+len, catch carry */ +" addc %3, %0, %0\n" /* fold in proto+len */ +" addc 0, %0, %0\n" /* add carry */ #endif : "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 61/399 parisc: Fix csum_ipv6_magic on 64-bit systems
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 4b75b12d70506e31fc02356bbca60f8d5ca012d0 ]
hppa 64-bit systems calculates the IPv6 checksum using 64-bit add operations. The last add folds protocol and length fields into the 64-bit result. While unlikely, this operation can overflow. The overflow can be triggered with a code sequence such as the following.
/* try to trigger massive overflows */ memset(tmp_buf, 0xff, sizeof(struct in6_addr)); csum_result = csum_ipv6_magic((struct in6_addr *)tmp_buf, (struct in6_addr *)tmp_buf, 0xffff, 0xff, 0xffffffff);
Fix the problem by adding any overflows from the final add operation into the calculated checksum. Fortunately, we can do this without additional cost by replacing the add operation used to fold the checksum into 32 bit with "add,dc" to add in the missing carry.
--- arch/parisc/include/asm/checksum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/parisc/include/asm/checksum.h +2 -2
@@ -137,8 +137,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr," add,dc %3, %0, %0\n" /* fold in proto+len | carry bit */ " extrd,u %0, 31, 32, %4\n" /* copy upper half down */ " depdi 0, 31, 32, %0\n" /* clear upper half */ -" add %4, %0, %0\n" /* fold into 32-bits */ -" addc 0, %0, %0\n" /* add carry */ +" add,dc %4, %0, %0\n" /* fold into 32-bits, plus carry */ +" addc 0, %0, %0\n" /* add final carry */ #else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 62/399 parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <[email protected]>
[ Upstream commit 0568b6f0d863643db2edcc7be31165740c89fa82 ]
IPv6 checksum tests with unaligned addresses on 64-bit builds result in unexpected failures.
Expected expected == csum_result, but
expected == 46591 (0xb5ff)
csum_result == 46381 (0xb52d)with alignment offset 1
Oddly enough, the problem disappeared after adding test code into the beginning of csum_ipv6_magic().
As it turns out, the 'sum' parameter of csum_ipv6_magic() is declared as __wsum, which is a 32-bit variable. However, it is treated as 64-bit variable in the 64-bit assembler code. Tests showed that the upper 32 bit of the register used to pass the variable are _not_ cleared when entering the function. This can result in checksum calculation errors.
Clearing the upper 32 bit of 'sum' as first operation in the assembler code fixes the problem.
--- arch/parisc/include/asm/checksum.h | 1 + 1 file changed, 1 insertion(+)
arch/parisc/include/asm/checksum.h +1 -0
@@ -126,6 +126,7 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,** Try to keep 4 registers with "live" values ahead of the ALU. */ +" depdi 0, 31, 32, %0\n" /* clear upper half of incoming checksum */ " ldd,ma 8(%1), %4\n" /* get 1st saddr word */ " ldd,ma 8(%2), %5\n" /* get 1st daddr word */ " add %4, %0, %0\n"
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 63/399 md/raid5: fix atomicity violation in raid5_cache_count
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gui-Dong Han <[email protected]>
[ Upstream commit dfd2bf436709b2bccb78c2dda550dde93700efa7 ]
In raid5_cache_count():
if (conf->max_nr_stripes < conf->min_nr_stripes)
return 0;
return conf->max_nr_stripes - conf->min_nr_stripes;The current check is ineffective, as the values could change immediately after being checked.
In raid5_set_cache_size():
...
conf->min_nr_stripes = size;
...
while (size > conf->max_nr_stripes)
conf->min_nr_stripes = conf->max_nr_stripes;
...Due to intermediate value updates in raid5_set_cache_size(), concurrent execution of raid5_cache_count() and raid5_set_cache_size() may lead to inconsistent reads of conf->max_nr_stripes and conf->min_nr_stripes. The current checks are ineffective as values could change immediately after being checked, raising the risk of conf->min_nr_stripes exceeding conf->max_nr_stripes and potentially causing an integer overflow.
This possible bug is found by an experimental static analysis tool developed by our team. This tool analyzes the locking APIs to extract function pairs that can be concurrently executed, and then analyzes the instructions in the paired functions to identify possible concurrency bugs including data races and atomicity violations. The above possible bug is reported when our tool analyzes the source code of Linux 6.2.
To resolve this issue, it is suggested to introduce local variables 'min_stripes' and 'max_stripes' in raid5_cache_count() to ensure the values remain stable throughout the check. Adding locks in raid5_cache_count() fails to resolve atomicity violations, as raid5_set_cache_size() may hold intermediate values of conf->min_nr_stripes while unlocked. With this patch applied, our tool no longer reports the bug, with the kernel configuration allyesconfig for x86_64. Due to the lack of associated hardware, we cannot test the patch in runtime testing, and just verify it according to the code logic.
--- drivers/md/raid5.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/md/raid5.c +8 -6
@@ -2412,7 +2412,7 @@ static int grow_one_stripe(struct r5conf *conf, gfp_t gfp)atomic_inc (&conf->active_stripes);raid5_release_stripe (sh); - conf->max_nr_stripes++; +WRITE_ONCE (conf->max_nr_stripes, conf->max_nr_stripes +1 );return 1 ; }
@@ -2707,7 +2707,7 @@ static int drop_one_stripe(struct r5conf *conf)shrink_buffers (sh);free_stripe (conf->slab_cache, sh);atomic_dec (&conf->active_stripes); - conf->max_nr_stripes--; +WRITE_ONCE (conf->max_nr_stripes, conf->max_nr_stripes -1 );return 1 ; }
@@ -6820,7 +6820,7 @@ raid5_set_cache_size(struct mddev *mddev, int size)if (size <=16 || size >32768 )return -EINVAL ; - conf->min_nr_stripes = size; +WRITE_ONCE (conf->min_nr_stripes, size);mutex_lock (&conf->cache_size_mutex);while (size < conf->max_nr_stripes &&drop_one_stripe (conf))
@@ -6832,7 +6832,7 @@ raid5_set_cache_size(struct mddev *mddev, int size)mutex_lock (&conf->cache_size_mutex);while (size > conf->max_nr_stripes)if (!grow_one_stripe (conf,GFP_KERNEL )) { - conf->min_nr_stripes = conf->max_nr_stripes; +WRITE_ONCE (conf->min_nr_stripes, conf->max_nr_stripes); result = -ENOMEM ;break ; }
@@ -7390,11 +7390,13 @@ static unsigned long raid5_cache_count(struct shrinker *shrink, struct shrink_control *sc) {struct r5conf *conf = shrink->private_data; +int max_stripes =READ_ONCE (conf->max_nr_stripes); +int min_stripes =READ_ONCE (conf->min_nr_stripes); -if (conf->max_nr_stripes < conf->min_nr_stripes) +if (max_stripes < min_stripes)/* unlikely, but not impossible */ return 0 ; -return conf->max_nr_stripes - conf->min_nr_stripes; +return max_stripes - min_stripes; }static struct r5conf *setup_conf (struct mddev *mddev)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 64/399 iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Schulz <[email protected]>
[ Upstream commit b0a4546df24a4f8c59b2d05ae141bd70ceccc386 ]
The SARADCv2 on RK3588 (the only SoC currently supported that has an SARADCv2) selects the channel through the channel_sel bitfield which is the 4 lowest bits, therefore the mask should be GENMASK(3, 0) and not GENMASK(15, 0).
--- drivers/iio/adc/rockchip_saradc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/rockchip_saradc.c +1 -1
@@ -52,7 +52,7 @@#define SARADC2_START BIT(4)#define SARADC2_SINGLE_MODE BIT(5) -#define SARADC2_CONV_CHANNELS GENMASK(15, 0) +#define SARADC2_CONV_CHANNELS GENMASK(3, 0)struct rockchip_saradc ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 65/399 iio: adc: rockchip_saradc: use mask for write_enable bitfield
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Schulz <[email protected]>
[ Upstream commit 5b4e4b72034f85f7a0cdd147d3d729c5a22c8764 ]
Some of the registers on the SARADCv2 have bits write protected except if another bit is set. This is usually done by having the lowest 16 bits store the data to write and the highest 16 bits specify which of the 16 lowest bits should have their value written to the hardware block.
The write_enable mask for the channel selection was incorrect because it was just the value shifted by 16 bits, which means it would only ever write bits and never clear them. So e.g. if someone starts a conversion on channel 5, the lowest 4 bits would be 0x5, then starts a conversion on channel 0, it would still be 5.
Instead of shifting the value by 16 as the mask, let's use the OR'ing of the appropriate masks shifted by 16.
Note that this is not an issue currently because the only SARADCv2 currently supported has a reset defined in its Device Tree, that reset resets the SARADC controller before starting a conversion on a channel. However, this reset is handled as optional by the probe function and thus proper masking should be used in the event an SARADCv2 without a reset ever makes it upstream.
--- drivers/iio/adc/rockchip_saradc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/rockchip_saradc.c +2 -2
@@ -102,12 +102,12 @@ static void rockchip_saradc_start_v2(struct rockchip_saradc *info, int chn)writel_relaxed (0xc , info->regs +SARADC_T_DAS_SOC );writel_relaxed (0x20 , info->regs +SARADC_T_PD_SOC ); val =FIELD_PREP (SARADC2_EN_END_INT ,1 ); - val |= val <<16 ; + val |=SARADC2_EN_END_INT <<16 ;writel_relaxed (val, info->regs +SARADC2_END_INT_EN ); val =FIELD_PREP (SARADC2_START ,1 ) |FIELD_PREP (SARADC2_SINGLE_MODE ,1 ) |FIELD_PREP (SARADC2_CONV_CHANNELS , chn); - val |= val <<16 ; + val |= (SARADC2_START |SARADC2_SINGLE_MODE |SARADC2_CONV_CHANNELS ) <<16 ;writel (val, info->regs +SARADC2_CONV_CON ); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 66/399 docs: Restore "smart quotes" for quotes
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akira Yokosawa <[email protected]>
[ Upstream commit fe2562582bffe675721e77e00b3bf5bfa1d7aeab ]
Commit eaae75754d81 ("docs: turn off "smart quotes" in the HTML build") disabled conversion of quote marks along with that of dashes. Despite the short summary, the change affects not only HTML build but also other build targets including PDF.
However, as "smart quotes" had been enabled for more than half a decade already, quite a few readers of HTML pages are likely expecting conversions of "foo" -> “foo” and 'bar' -> ‘bar’.
Furthermore, in LaTeX typesetting convention, it is common to use distinct marks for opening and closing quote marks.
To satisfy such readers' expectation, restore conversion of quotes only by setting smartquotes_action [1].
--- Documentation/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/conf.py +3 -3
@@ -346,9 +346,9 @@ sys.stderr.write("Using %s theme\n" % html_theme) html_static_path = ['sphinx-static'] # If true, Docutils "smart quotes" will be used to convert quotes and dashes -# to typographically correct entities. This will convert "--" to "—", -# which is not always what we want, so disable it. -smartquotes = False +# to typographically correct entities. However, conversion of "--" to "—" +# is not always what we want, so enable only quotes. +smartquotes_action = 'q' # Custom sidebar templates, maps document names to template names. # Note that the RTD theme ignores this
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 67/399 cpufreq: Limit resolving a frequency to policy min/max
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shivnandan Kumar <[email protected]>
[ Upstream commit d394abcb12bb1a6f309c1221fdb8e73594ecf1b4 ]
Resolving a frequency to an efficient one should not transgress policy->max (which can be set for thermal reason) and policy->min.
Currently, there is possibility where scaling_cur_freq can exceed scaling_max_freq when scaling_max_freq is an inefficient frequency.
Add a check to ensure that resolving a frequency will respect policy->min/max.
--- include/linux/cpufreq.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
include/linux/cpufreq.h +14 -1
@@ -1021,6 +1021,18 @@ static inline int cpufreq_table_find_index_c(struct cpufreq_policy *policy, efficiencies); } +static inline bool cpufreq_is_in_limits (struct cpufreq_policy *policy,int idx) +{ +unsigned int freq; + +if (idx <0 ) +return false; + + freq = policy->freq_table[idx].frequency; + +return freq ==clamp_val (freq, policy->min, policy->max); +} +static inline int cpufreq_frequency_table_target (struct cpufreq_policy *policy,unsigned int target_freq,unsigned int relation)
@@ -1054,7 +1066,8 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,return 0 ; } -if (idx <0 && efficiencies) { +/* Limit frequency index to honor policy->min/max */ +if (!cpufreq_is_in_limits (policy, idx) && efficiencies) { efficiencies = false; goto retry; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 68/399 PM: suspend: Set mem_sleep_current during kernel command line setup
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maulik Shah <[email protected]>
[ Upstream commit 9bc4ffd32ef8943f5c5a42c9637cfd04771d021b ]
psci_init_system_suspend() invokes suspend_set_ops() very early during bootup even before kernel command line for mem_sleep_default is setup. This leads to kernel command line mem_sleep_default=s2idle not working as mem_sleep_current gets changed to deep via suspend_set_ops() and never changes back to s2idle.
Set mem_sleep_current along with mem_sleep_default during kernel command line setup as default suspend mode.
--- kernel/power/suspend.c | 1 + 1 file changed, 1 insertion(+)
kernel/power/suspend.c +1 -0
@@ -192,6 +192,7 @@ static int __init mem_sleep_default_setup(char *str)if (mem_sleep_labels[state] && !strcmp (str, mem_sleep_labels[state])) { mem_sleep_default = state; + mem_sleep_current = state;break ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 69/399 vfio/pds: Always clear the save/restore FDs on reset
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brett Creeley <[email protected]>
[ Upstream commit 8512ed256334f6637fc0699ce794792c357544ec ]
After reset the VFIO device state will always be put in VFIO_DEVICE_STATE_RUNNING, but the save/restore files will only be cleared if the previous state was VFIO_DEVICE_STATE_ERROR. This can/will cause the restore/save files to be leaked if/when the migration state machine transitions through the states that re-allocates these files. Fix this by always clearing the restore/save files for resets.
--- drivers/vfio/pci/pds/vfio_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/vfio/pci/pds/vfio_dev.c +2 -2
@@ -32,9 +32,9 @@ void pds_vfio_state_mutex_unlock(struct pds_vfio_pci_device *pds_vfio)mutex_lock (&pds_vfio->reset_mutex);if (pds_vfio->deferred_reset) { pds_vfio->deferred_reset = false; +pds_vfio_put_restore_file (pds_vfio); +pds_vfio_put_save_file (pds_vfio);if (pds_vfio->state ==VFIO_DEVICE_STATE_ERROR ) { -pds_vfio_put_restore_file (pds_vfio); -pds_vfio_put_save_file (pds_vfio);pds_vfio_dirty_disable (pds_vfio, false); } pds_vfio->state = pds_vfio->deferred_reset_state;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 70/399 clk: qcom: gcc-ipq5018: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit 90ad946fff70f312b8d23226afc38c13ddd88c4b ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
--- drivers/clk/qcom/gcc-ipq5018.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/clk/qcom/gcc-ipq5018.c +3 -0
@@ -857,6 +857,7 @@ static struct clk_rcg2 lpass_sway_clk_src = {static const struct freq_tbl ftbl_pcie0_aux_clk_src[] = {F (2000000 ,P_XO ,12 ,0 ,0 ), + { } };static struct clk_rcg2 pcie0_aux_clk_src = {
@@ -1099,6 +1100,7 @@ static const struct freq_tbl ftbl_qpic_io_macro_clk_src[] = {F (100000000 ,P_GPLL0 ,8 ,0 ,0 ),F (200000000 ,P_GPLL0 ,4 ,0 ,0 ), F(320000000, P_GPLL0, 2.5, 0, 0), + { } }; static struct clk_rcg2 qpic_io_macro_clk_src = {
@@ -1194,6 +1196,7 @@ static struct clk_rcg2 ubi0_axi_clk_src = {static const struct freq_tbl ftbl_ubi0_core_clk_src[] = {F (850000000 ,P_UBI32_PLL ,1 ,0 ,0 ),F (1000000000 ,P_UBI32_PLL ,1 ,0 ,0 ), + { } };static struct clk_rcg2 ubi0_core_clk_src = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 71/399 clk: qcom: gcc-ipq6018: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit cdbc6e2d8108bc47895e5a901cfcaf799b00ca8d ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
Only compile tested.
--- drivers/clk/qcom/gcc-ipq6018.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/gcc-ipq6018.c +2 -0
@@ -1554,6 +1554,7 @@ static struct clk_regmap_div nss_ubi0_div_clk_src = {static const struct freq_tbl ftbl_pcie_aux_clk_src[] = {F (24000000 ,P_XO ,1 ,0 ,0 ), + { } };static const struct clk_parent_data gcc_xo_gpll0_core_pi_sleep_clk[] = {
@@ -1734,6 +1735,7 @@ static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = {F (160000000 ,P_GPLL0 ,5 ,0 ,0 ),F (216000000 ,P_GPLL6 ,5 ,0 ,0 ), F(308570000, P_GPLL6, 3.5, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_div2[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 72/399 clk: qcom: gcc-ipq8074: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit 1040ef5ed95d6fd2628bad387d78a61633e09429 ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
Only compile tested.
--- drivers/clk/qcom/gcc-ipq8074.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/gcc-ipq8074.c +2 -0
@@ -644,6 +644,7 @@ static struct clk_rcg2 pcie0_axi_clk_src = {static const struct freq_tbl ftbl_pcie_aux_clk_src[] = {F (19200000 ,P_XO ,1 ,0 ,0 ), + { } };static const struct clk_parent_data gcc_xo_gpll0_sleep_clk[] = {
@@ -795,6 +796,7 @@ static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = {F (19200000 ,P_XO ,1 ,0 ,0 ),F (160000000 ,P_GPLL0 ,5 ,0 ,0 ), F(308570000, P_GPLL6, 3.5, 0, 0), + { } }; static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_div2[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 73/399 clk: qcom: gcc-ipq9574: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit bd2b6395671d823caa38d8e4d752de2448ae61e1 ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
Only compile tested.
--- drivers/clk/qcom/gcc-ipq9574.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/qcom/gcc-ipq9574.c +1 -0
@@ -2082,6 +2082,7 @@ static struct clk_branch gcc_sdcc1_apps_clk = {static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = {F (150000000 ,P_GPLL4 ,8 ,0 ,0 ),F (300000000 ,P_GPLL4 ,4 ,0 ,0 ), + { } };static struct clk_rcg2 sdcc1_ice_core_clk_src = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 74/399 clk: qcom: camcc-sc8280xp: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit 6a3d70f7802a98e6c28a74f997a264118b9f50cd ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
Only compile tested.
--- drivers/clk/qcom/camcc-sc8280xp.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/clk/qcom/camcc-sc8280xp.c +21 -0
@@ -630,6 +630,7 @@ static const struct freq_tbl ftbl_camcc_bps_clk_src[] = {F (480000000 ,P_CAMCC_PLL7_OUT_EVEN ,1 ,0 ,0 ),F (600000000 ,P_CAMCC_PLL0_OUT_MAIN ,2 ,0 ,0 ), F(760000000, P_CAMCC_PLL3_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_bps_clk_src = {
@@ -654,6 +655,7 @@ static const struct freq_tbl ftbl_camcc_camnoc_axi_clk_src[] = {F (320000000 ,P_CAMCC_PLL7_OUT_ODD ,1 ,0 ,0 ),F (400000000 ,P_CAMCC_PLL0_OUT_ODD ,1 ,0 ,0 ), F(480000000, P_CAMCC_PLL7_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_camnoc_axi_clk_src = {
@@ -673,6 +675,7 @@ static struct clk_rcg2 camcc_camnoc_axi_clk_src = {static const struct freq_tbl ftbl_camcc_cci_0_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ),F (37500000 ,P_CAMCC_PLL0_OUT_EVEN ,16 ,0 ,0 ), + { } };static struct clk_rcg2 camcc_cci_0_clk_src = {
@@ -735,6 +738,7 @@ static const struct freq_tbl ftbl_camcc_cphy_rx_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ),F (240000000 ,P_CAMCC_PLL0_OUT_EVEN ,2.5 ,0 ,0 ), F(400000000, P_CAMCC_PLL0_OUT_ODD, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_cphy_rx_clk_src = {
@@ -754,6 +758,7 @@ static struct clk_rcg2 camcc_cphy_rx_clk_src = {static const struct freq_tbl ftbl_camcc_csi0phytimer_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ),F (300000000 ,P_CAMCC_PLL0_OUT_EVEN ,2 ,0 ,0 ), + { } };static struct clk_rcg2 camcc_csi0phytimer_clk_src = {
@@ -818,6 +823,7 @@ static const struct freq_tbl ftbl_camcc_fast_ahb_clk_src[] = {F (200000000 ,P_CAMCC_PLL0_OUT_EVEN ,3 ,0 ,0 ),F (300000000 ,P_CAMCC_PLL0_OUT_MAIN ,4 ,0 ,0 ), F(400000000, P_CAMCC_PLL0_OUT_MAIN, 3, 0, 0), + { } }; static struct clk_rcg2 camcc_fast_ahb_clk_src = {
@@ -838,6 +844,7 @@ static const struct freq_tbl ftbl_camcc_icp_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ),F (400000000 ,P_CAMCC_PLL0_OUT_ODD ,1 ,0 ,0 ), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_icp_clk_src = {
@@ -860,6 +867,7 @@ static const struct freq_tbl ftbl_camcc_ife_0_clk_src[] = {F (558000000 ,P_CAMCC_PLL3_OUT_EVEN ,1 ,0 ,0 ),F (637000000 ,P_CAMCC_PLL3_OUT_EVEN ,1 ,0 ,0 ), F(760000000, P_CAMCC_PLL3_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_0_clk_src = {
@@ -883,6 +891,7 @@ static const struct freq_tbl ftbl_camcc_ife_0_csid_clk_src[] = {F (400000000 ,P_CAMCC_PLL0_OUT_ODD ,1 ,0 ,0 ),F (480000000 ,P_CAMCC_PLL7_OUT_EVEN ,1 ,0 ,0 ), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_0_csid_clk_src = {
@@ -905,6 +914,7 @@ static const struct freq_tbl ftbl_camcc_ife_1_clk_src[] = {F (558000000 ,P_CAMCC_PLL4_OUT_EVEN ,1 ,0 ,0 ),F (637000000 ,P_CAMCC_PLL4_OUT_EVEN ,1 ,0 ,0 ), F(760000000, P_CAMCC_PLL4_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_1_clk_src = {
@@ -941,6 +951,7 @@ static const struct freq_tbl ftbl_camcc_ife_2_clk_src[] = {F (558000000 ,P_CAMCC_PLL5_OUT_EVEN ,1 ,0 ,0 ),F (637000000 ,P_CAMCC_PLL5_OUT_EVEN ,1 ,0 ,0 ), F(760000000, P_CAMCC_PLL5_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_2_clk_src = {
@@ -962,6 +973,7 @@ static const struct freq_tbl ftbl_camcc_ife_2_csid_clk_src[] = {F (400000000 ,P_CAMCC_PLL0_OUT_ODD ,1 ,0 ,0 ),F (480000000 ,P_CAMCC_PLL7_OUT_EVEN ,1 ,0 ,0 ), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_2_csid_clk_src = {
@@ -984,6 +996,7 @@ static const struct freq_tbl ftbl_camcc_ife_3_clk_src[] = {F (558000000 ,P_CAMCC_PLL6_OUT_EVEN ,1 ,0 ,0 ),F (637000000 ,P_CAMCC_PLL6_OUT_EVEN ,1 ,0 ,0 ), F(760000000, P_CAMCC_PLL6_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_3_clk_src = {
@@ -1020,6 +1033,7 @@ static const struct freq_tbl ftbl_camcc_ife_lite_0_clk_src[] = {F (400000000 ,P_CAMCC_PLL0_OUT_ODD ,1 ,0 ,0 ),F (480000000 ,P_CAMCC_PLL7_OUT_EVEN ,1 ,0 ,0 ), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_ife_lite_0_clk_src = {
@@ -1140,6 +1154,7 @@ static const struct freq_tbl ftbl_camcc_ipe_0_clk_src[] = {F (475000000 ,P_CAMCC_PLL1_OUT_EVEN ,1 ,0 ,0 ),F (520000000 ,P_CAMCC_PLL1_OUT_EVEN ,1 ,0 ,0 ), F(600000000, P_CAMCC_PLL1_OUT_EVEN, 1, 0, 0), + { } }; static struct clk_rcg2 camcc_ipe_0_clk_src = {
@@ -1163,6 +1178,7 @@ static const struct freq_tbl ftbl_camcc_jpeg_clk_src[] = {F (400000000 ,P_CAMCC_PLL0_OUT_ODD ,1 ,0 ,0 ),F (480000000 ,P_CAMCC_PLL7_OUT_EVEN ,1 ,0 ,0 ), F(600000000, P_CAMCC_PLL0_OUT_MAIN, 2, 0, 0), + { } }; static struct clk_rcg2 camcc_jpeg_clk_src = {
@@ -1184,6 +1200,7 @@ static const struct freq_tbl ftbl_camcc_lrme_clk_src[] = {F (300000000 ,P_CAMCC_PLL0_OUT_EVEN ,2 ,0 ,0 ),F (320000000 ,P_CAMCC_PLL7_OUT_ODD ,1 ,0 ,0 ), F(400000000, P_CAMCC_PLL0_OUT_MAIN, 3, 0, 0), + { } }; static struct clk_rcg2 camcc_lrme_clk_src = {
@@ -1204,6 +1221,7 @@ static const struct freq_tbl ftbl_camcc_mclk0_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ),F (24000000 ,P_CAMCC_PLL2_OUT_EARLY ,10 ,1 ,4 ), F(64000000, P_CAMCC_PLL2_OUT_EARLY, 15, 0, 0), + { } }; static struct clk_rcg2 camcc_mclk0_clk_src = {
@@ -1320,6 +1338,7 @@ static struct clk_rcg2 camcc_mclk7_clk_src = {static const struct freq_tbl ftbl_camcc_sleep_clk_src[] = {F (32000 ,P_SLEEP_CLK ,1 ,0 ,0 ), + { } };static struct clk_rcg2 camcc_sleep_clk_src = {
@@ -1339,6 +1358,7 @@ static struct clk_rcg2 camcc_sleep_clk_src = {static const struct freq_tbl ftbl_camcc_slow_ahb_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ),F (80000000 ,P_CAMCC_PLL7_OUT_EVEN ,6 ,0 ,0 ), + { } };static struct clk_rcg2 camcc_slow_ahb_clk_src = {
@@ -1357,6 +1377,7 @@ static struct clk_rcg2 camcc_slow_ahb_clk_src = {static const struct freq_tbl ftbl_camcc_xo_clk_src[] = {F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ), + { } };static struct clk_rcg2 camcc_xo_clk_src = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 75/399 clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit a903cfd38d8dee7e754fb89fd1bebed99e28003d ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
Only compile tested.
--- drivers/clk/qcom/mmcc-apq8084.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/mmcc-apq8084.c +2 -0
@@ -348,6 +348,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = {F (333430000 ,P_MMPLL1 ,3.5 ,0 ,0 ),F (400000000 ,P_MMPLL0 ,2 ,0 ,0 ), F(466800000, P_MMPLL1, 2.5, 0, 0), + { } }; static struct clk_rcg2 mmss_axi_clk_src = {
@@ -372,6 +373,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = {F (150000000 ,P_GPLL0 ,4 ,0 ,0 ),F (228570000 ,P_MMPLL0 ,3.5 ,0 ,0 ), F(320000000, P_MMPLL0, 2.5, 0, 0), + { } }; static struct clk_rcg2 ocmemnoc_clk_src = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 76/399 clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit e2c02a85bf53ae86d79b5fccf0a75ac0b78e0c96 ]
The frequency table arrays are supposed to be terminated with an empty element. Add such entry to the end of the arrays where it is missing in order to avoid possible out-of-bound access when the table is traversed by functions like qcom_find_freq() or qcom_find_freq_floor().
Only compile tested.
--- drivers/clk/qcom/mmcc-msm8974.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/mmcc-msm8974.c +2 -0
@@ -290,6 +290,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = {F (291750000 ,P_MMPLL1 ,4 ,0 ,0 ),F (400000000 ,P_MMPLL0 ,2 ,0 ,0 ), F(466800000, P_MMPLL1, 2.5, 0, 0), + { } }; static struct clk_rcg2 mmss_axi_clk_src = {
@@ -314,6 +315,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = {F (150000000 ,P_GPLL0 ,4 ,0 ,0 ),F (291750000 ,P_MMPLL1 ,4 ,0 ,0 ), F(400000000, P_MMPLL0, 2, 0, 0), + { } }; static struct clk_rcg2 ocmemnoc_clk_src = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 77/399 usb: xhci: Add error handling in xhci_map_urb_for_dma
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prashanth K <[email protected]>
[ Upstream commit be95cc6d71dfd0cba66e3621c65413321b398052 ]
Currently xhci_map_urb_for_dma() creates a temporary buffer and copies the SG list to the new linear buffer. But if the kzalloc_node() fails, then the following sg_pcopy_to_buffer() can lead to crash since it tries to memcpy to NULL pointer.
So return -ENOMEM if kzalloc returns null pointer.
--- drivers/usb/host/xhci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/xhci.c +2 -0
@@ -1220,6 +1220,8 @@ static int xhci_map_temp_buffer(struct usb_hcd *hcd, struct urb *urb) temp =kzalloc_node (buf_len,GFP_ATOMIC ,dev_to_node (hcd->self.sysdev)); +if (!temp) +return -ENOMEM ;if (usb_urb_dir_out (urb)) sg_pcopy_to_buffer(urb->sg, urb->num_sgs,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 78/399 powerpc/fsl: Fix mfpmr build errors with newer binutils
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Ellerman <[email protected]>
[ Upstream commit 5f491356b7149564ab22323ccce79c8d595bfd0c ]
Binutils 2.38 complains about the use of mfpmr when building ppc6xx_defconfig:
CC arch/powerpc/kernel/pmc.o
{standard input}: Assembler messages:
{standard input}:45: Error: unrecognized opcode: mfpmr' {standard input}:56: Error: unrecognized opcode: mtpmr'
This is because by default the kernel is built with -mcpu=powerpc, and the mt/mfpmr instructions are not defined.
It can be avoided by enabling CONFIG_E300C3_CPU, but just adding that to the defconfig will leave open the possibility of randconfig failures.
So add machine directives around the mt/mfpmr instructions to tell binutils how to assemble them.
--- arch/powerpc/include/asm/reg_fsl_emb.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/reg_fsl_emb.h +9 -2
@@ -12,9 +12,16 @@#ifndef __ASSEMBLY__/* Performance Monitor Registers */ #define mfpmr (rn) ({unsigned int rval; \ - asm volatile("mfpmr %0," __stringify(rn) \ + asm volatile(".machine push; " \ + ".machine e300; " \ + "mfpmr %0," __stringify(rn) ";" \ + ".machine pop; " \ : "=r" (rval)); rval;}) -#define mtpmr (rn, v) asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v)) +#define mtpmr (rn, v) asm volatile(".machine push; " \ + ".machine e300; " \ + "mtpmr " __stringify(rn) ",%0; " \ + ".machine pop; " \ + : : "r" (v))#endif /* __ASSEMBLY__ */ /* Freescale Book E Performance Monitor APU Registers */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 79/399 USB: serial: ftdi_sio: add support for GMC Z216C Adapter IR-USB
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Vogelbacher <[email protected]>
[ Upstream commit 3fb7bc4f3a98c48981318b87cf553c5f115fd5ca ]
The GMC IR-USB adapter cable utilizes a FTDI FT232R chip.
Add VID/PID for this adapter so it can be used as serial device via ftdi_sio.
--- drivers/usb/serial/ftdi_sio.c | 2 ++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -1077,6 +1077,8 @@ static const struct usb_device_id id_table_combined[] = { .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, +/* GMC devices */ + { USB_DEVICE(GMC_VID, GMC_Z216C_PID) }, { }/* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1606,3 +1606,9 @@#define UBLOX_VID 0x1546#define UBLOX_C099F9P_ZED_PID 0x0502#define UBLOX_C099F9P_ODIN_PID 0x0503 + +/* +* GMC devices +*/ +#define GMC_VID 0x1cd7 +#define GMC_Z216C_PID 0x0217/* GMC Z216C Adapter IR-USB */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 80/399 USB: serial: add device ID for VeriFone adapter
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cameron Williams <[email protected]>
[ Upstream commit cda704809797a8a86284f9df3eef5e62ec8a3175 ]
Add device ID for a (probably fake) CP2102 UART device.
lsusb -v output:
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 [unknown] bDeviceSubClass 0 [unknown] bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x11ca VeriFone Inc idProduct 0x0212 Verifone USB to Printer bcdDevice 1.00 iManufacturer 1 Silicon Labs iProduct 2 Verifone USB to Printer iSerial 3 0001 bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0020
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 2 Verifone USB to Printer
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0xF004) }, /* Elan Digital Systems USBcount50 */ { USB_DEVICE(0x10C5, 0xEA61) }, /* Silicon Labs MobiData GPRS USB Modem */ { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */ + { USB_DEVICE(0x11CA, 0x0212) }, /* Verifone USB to Printer (UART, CP2102) */ { USB_DEVICE(0x12B8, 0xEC60) }, /* Link G4 ECU */ { USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */ { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 81/399 USB: serial: cp210x: add ID for MGP Instruments PDS100
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Häggström <[email protected]>
[ Upstream commit a0d9d868491a362d421521499d98308c8e3a0398 ]
The radiation meter has the text MGP Instruments PDS-100G or PDS-100GN produced by Mirion Technologies. Tested by forcing the driver association with
echo 10c4 863c > /sys/bus/usb-serial/drivers/cp210x/new_id
and then setting the serial port in 115200 8N1 mode. The device announces ID_USB_VENDOR_ENC=Silicon\x20Labs and ID_USB_MODEL_ENC=PDS100
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -144,6 +144,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ + { USB_DEVICE(0x10C4, 0x863C) }, /* MGP Instruments PDS100 */ { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ { USB_DEVICE(0x10C4, 0x87ED) }, /* IMST USB-Stick for Smart Meter */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 82/399 wifi: mac80211: track capability/opmode NSS separately
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit a8bca3e9371dc5e276af4168be099b2a05554c2a ]
We're currently tracking rx_nss for each station, and that is meant to be initialized to the capability NSS and later reduced by the operating mode notification NSS.
However, we're mixing up capabilities and operating mode NSS in the same variable. This forces us to recalculate the NSS capability on operating mode notification RX, which is a bit strange; due to the previous fix I had to never keep rx_nss as zero, it also means that the capa is never taken into account properly.
Fix all this by storing the capability value, that can be recalculated unconditionally whenever needed, and storing the operating mode notification NSS separately, taking it into account when assigning the final rx_nss value.
--- net/mac80211/cfg.c | 2 +- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/rate.c | 2 +- net/mac80211/sta_info.h | 6 ++++- net/mac80211/vht.c | 46 ++++++++++++++++++-------------------- 5 files changed, 30 insertions(+), 28 deletions(-)
net/mac80211/cfg.c +1 -1
@@ -1869,7 +1869,7 @@ static int sta_link_apply_parameters(struct ieee80211_local *local, sband->band); } -ieee80211_sta_set_rx_nss (link_sta); +ieee80211_sta_init_nss (link_sta);return ret; }
net/mac80211/ieee80211_i.h +1 -1
@@ -2112,7 +2112,7 @@ enum ieee80211_sta_rx_bandwidth ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta);enum ieee80211_sta_rx_bandwidth ieee80211_sta_cur_vht_bw (struct link_sta_info *link_sta); -void ieee80211_sta_set_rx_nss (struct link_sta_info *link_sta); +void ieee80211_sta_init_nss (struct link_sta_info *link_sta);enum ieee80211_sta_rx_bandwidth ieee80211_chan_width_to_rx_bw (enum nl80211_chan_width width);enum nl80211_chan_width
net/mac80211/rate.c +1 -1
@@ -37,7 +37,7 @@ void rate_control_rate_init(struct sta_info *sta)struct ieee80211_supported_band *sband;struct ieee80211_chanctx_conf *chanctx_conf; -ieee80211_sta_set_rx_nss (&sta->deflink); +ieee80211_sta_init_nss (&sta->deflink);if (!ref)return ;
net/mac80211/sta_info.h +5 -1
@@ -3,7 +3,7 @@* Copyright 2002-2005, Devicescape Software, Inc. * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright(c) 2015-2017 Intel Deutschland GmbH -* Copyright(c) 2020-2023 Intel Corporation +* Copyright(c) 2020-2024 Intel Corporation */ #ifndef STA_INFO_H
@@ -482,6 +482,8 @@ struct ieee80211_fragment_cache {* same for non-MLD STA. This is used as key for searching link STA * @link_id: Link ID uniquely identifying the link STA. This is 0 for non-MLD * and set to the corresponding vif LinkId for MLD STA +* @op_mode_nss: NSS limit as set by operating mode notification, or 0 +* @capa_nss: NSS limit as determined by local and peer capabilities * @link_hash_node: hash node for rhashtable * @sta: Points to the STA info * @gtk: group keys negotiated with this station, if any
@@ -518,6 +520,8 @@ struct link_sta_info {u8 addr[ETH_ALEN ];u8 link_id; +u8 op_mode_nss, capa_nss; +struct rhlist_head link_hash_node;struct sta_info *sta;
net/mac80211/vht.c +22 -24
81 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 83/399 USB: serial: option: add MeiG Smart SLM320 product
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aurélien Jacobs <[email protected]>
[ Upstream commit 46809c51565b83881aede6cdf3b0d25254966a41 ]
Update the USB serial option driver to support MeiG Smart SLM320.
ID 2dee:4d41 UNISOC UNISOC-8910
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 9 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=2dee ProdID=4d41 Rev=00.00
S: Manufacturer=UNISOC
S: Product=UNISOC-8910
C: #Ifs= 8 Cfg#= 1 Atr=e0 MxPwr=400mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
Tested successfully a PPP LTE connection using If#= 0. Not sure of the purpose of every other serial interfaces.
--- drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/option.c +6 -0
@@ -613,6 +613,11 @@ static void option_instat_callback(struct urb *urb);/* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */ #define LUAT_PRODUCT_AIR720U 0x4e00 +/* MeiG Smart Technology products */ +#define MEIGSMART_VENDOR_ID 0x2dee +/* MeiG Smart SLM320 based on UNISOC UIS8910 */ +#define MEIGSMART_PRODUCT_SLM320 0x4d41 +/* Device flags */ /* Highest interface number which can be used with NCTRL() and RSVD() */
@@ -2282,6 +2287,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 84/399 KVM: x86/xen: inject vCPU upcall vector when local APIC is enabled
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
[ Upstream commit 8e62bf2bfa46367e14d0ffdcde5aada08759497c ]
Linux guests since commit b1c3497e604d ("x86/xen: Add support for HVMOP_set_evtchn_upcall_vector") in v6.0 onwards will use the per-vCPU upcall vector when it's advertised in the Xen CPUID leaves.
This upcall is injected through the guest's local APIC as an MSI, unlike the older system vector which was merely injected by the hypervisor any time the CPU was able to receive an interrupt and the upcall_pending flags is set in its vcpu_info.
Effectively, that makes the per-CPU upcall edge triggered instead of level triggered, which results in the upcall being lost if the MSI is delivered when the local APIC is *disabled*.
Xen checks the vcpu_info->evtchn_upcall_pending flag when the local APIC for a vCPU is software enabled (in fact, on any write to the SPIV register which doesn't disable the APIC). Do the same in KVM since KVM doesn't provide a way for userspace to intervene and trap accesses to the SPIV register of a local APIC emulated by KVM.
--- arch/x86/kvm/lapic.c | 5 ++++- arch/x86/kvm/xen.c | 2 +- arch/x86/kvm/xen.h | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-)
arch/x86/kvm/lapic.c +4 -1
@@ -41,6 +41,7 @@#include "ioapic.h" #include "trace.h" #include "x86.h" +#include "xen.h" #include "cpuid.h" #include "hyperv.h" #include "smm.h"
@@ -499,8 +500,10 @@ static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val) }/* Check if there are APF page ready requests pending */ -if (enabled) +if (enabled) {kvm_make_request (KVM_REQ_APF_READY , apic->vcpu); +kvm_xen_sw_enable_lapic (apic->vcpu); + } }static inline void kvm_apic_set_xapic_id (struct kvm_lapic *apic,u8 id)
arch/x86/kvm/xen.c +1 -1
@@ -493,7 +493,7 @@ void kvm_xen_update_runstate(struct kvm_vcpu *v, int state)kvm_xen_update_runstate_guest (v, state == RUNSTATE_runnable); } -static void kvm_xen_inject_vcpu_vector (struct kvm_vcpu *v) +void kvm_xen_inject_vcpu_vector (struct kvm_vcpu *v) {struct kvm_lapic_irq irq = { };int r;
arch/x86/kvm/xen.h +18 -0
@@ -18,6 +18,7 @@ extern struct static_key_false_deferred kvm_xen_enabled;int __kvm_xen_has_interrupt (struct kvm_vcpu *vcpu);void kvm_xen_inject_pending_events (struct kvm_vcpu *vcpu); +void kvm_xen_inject_vcpu_vector (struct kvm_vcpu *vcpu);int kvm_xen_vcpu_set_attr (struct kvm_vcpu *vcpu,struct kvm_xen_vcpu_attr *data);int kvm_xen_vcpu_get_attr (struct kvm_vcpu *vcpu,struct kvm_xen_vcpu_attr *data);int kvm_xen_hvm_set_attr (struct kvm *kvm,struct kvm_xen_hvm_attr *data);
@@ -36,6 +37,19 @@ int kvm_xen_setup_evtchn(struct kvm *kvm, const struct kvm_irq_routing_entry *ue);void kvm_xen_update_tsc_info (struct kvm_vcpu *vcpu); +static inline void kvm_xen_sw_enable_lapic (struct kvm_vcpu *vcpu) +{ +/* +* The local APIC is being enabled. If the per-vCPU upcall vector is +* set and the vCPU's evtchn_upcall_pending flag is set, inject the +* interrupt. +*/ +if (static_branch_unlikely (&kvm_xen_enabled.key) && + vcpu->arch.xen.vcpu_info_cache.active && + vcpu->arch.xen.upcall_vector &&__kvm_xen_has_interrupt (vcpu)) +kvm_xen_inject_vcpu_vector (vcpu); +} +static inline bool kvm_xen_msr_enabled (struct kvm *kvm) { return static_branch_unlikely(&kvm_xen_enabled.key) &&
@@ -101,6 +115,10 @@ static inline void kvm_xen_destroy_vcpu(struct kvm_vcpu *vcpu) { } +static inline void kvm_xen_sw_enable_lapic (struct kvm_vcpu *vcpu) +{ +} +static inline bool kvm_xen_msr_enabled (struct kvm *kvm) {return false;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 85/399 USB: serial: cp210x: add pid/vid for TDK NC0110013M and MM0110113M
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toru Katagiri <[email protected]>
[ Upstream commit b1a8da9ff1395c4879b4bd41e55733d944f3d613 ]
TDK NC0110013M and MM0110113M have custom USB IDs for CP210x, so we need to add them to the driver.
--- drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/cp210x.c +2 -0
@@ -56,6 +56,8 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ + { USB_DEVICE(0x04BF, 0x1301) }, /* TDK Corporation NC0110013M - Network Controller */ + { USB_DEVICE(0x04BF, 0x1303) }, /* TDK Corporation MM0110113M - i3 Micro Module */ { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */ { USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */ { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 86/399 PM: sleep: wakeirq: fix wake irq warning in system suspend
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qingliang Li <[email protected]>
[ Upstream commit e7a7681c859643f3f2476b2a28a494877fd89442 ]
When driver uses pm_runtime_force_suspend() as the system suspend callback function and registers the wake irq with reverse enable ordering, the wake irq will be re-enabled when entering system suspend, triggering an 'Unbalanced enable for IRQ xxx' warning. In this scenario, the call sequence during system suspend is as follows:
suspend_devices_and_enter()
-> dpm_suspend_start()
-> dpm_run_callback()
-> pm_runtime_force_suspend()
-> dev_pm_enable_wake_irq_check()
-> dev_pm_enable_wake_irq_complete()
-> suspend_enter()
-> dpm_suspend_noirq()
-> device_wakeup_arm_wake_irqs()
-> dev_pm_arm_wake_irq()To fix this issue, complete the setting of WAKE_IRQ_DEDICATED_ENABLED flag in dev_pm_enable_wake_irq_complete() to avoid redundant irq enablement.
--- drivers/base/power/wakeirq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/base/power/wakeirq.c +3 -1
@@ -313,8 +313,10 @@ void dev_pm_enable_wake_irq_complete(struct device *dev)return ;if (wirq->status &WAKE_IRQ_DEDICATED_MANAGED && - wirq->status &WAKE_IRQ_DEDICATED_REVERSE ) + wirq->status &WAKE_IRQ_DEDICATED_REVERSE ) {enable_irq (wirq->irq); + wirq->status |=WAKE_IRQ_DEDICATED_ENABLED ; + } }/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 87/399 mmc: tmio: avoid concurrent runs of mmc_request_done()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wolfram Sang <[email protected]>
[ Upstream commit e8d1b41e69d72c62865bebe8f441163ec00b3d44 ]
With the to-be-fixed commit, the reset_work handler cleared 'host->mrq' outside of the spinlock protected critical section. That leaves a small race window during execution of 'tmio_mmc_reset()' where the done_work handler could grab a pointer to the now invalid 'host->mrq'. Both would use it to call mmc_request_done() causing problems (see link below).
However, 'host->mrq' cannot simply be cleared earlier inside the critical section. That would allow new mrqs to come in asynchronously while the actual reset of the controller still needs to be done. So, like 'tmio_mmc_set_ios()', an ERR_PTR is used to prevent new mrqs from coming in but still avoiding concurrency between work handlers.
--- drivers/mmc/host/tmio_mmc_core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/host/tmio_mmc_core.c +2 -0
@@ -259,6 +259,8 @@ static void tmio_mmc_reset_work(struct work_struct *work)else mrq->cmd->error = -ETIMEDOUT ; +/* No new calls yet, but disallow concurrent tmio_mmc_done_work() */ + host->mrq =ERR_PTR (-EBUSY ); host->cmd =NULL ; host->data =NULL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 88/399 fuse: replace remaining make_bad_inode() with fuse_make_bad()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <[email protected]>
[ Upstream commit 82e081aebe4d9c26e196c8260005cc4762b57a5d ]
fuse_do_statx() was added with the wrong helper.
--- fs/fuse/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/dir.c +1 -1
@@ -1210,7 +1210,7 @@ static int fuse_do_statx(struct inode *inode, struct file *file,if (((sx->mask &STATX_SIZE ) && !fuse_valid_size (sx->size)) || ((sx->mask &STATX_TYPE ) && (!fuse_valid_type (sx->mode) ||inode_wrong_type (inode, sx->mode)))) { -make_bad_inode (inode); +fuse_make_bad (inode);return -EIO ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 89/399 fuse: fix root lookup with nonzero generation
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <[email protected]>
[ Upstream commit 68ca1b49e430f6534d0774a94147a823e3b8b26e ]
The root inode has a fixed nodeid and generation (1, 0).
Prior to the commit 15db16837a35 ("fuse: fix illegal access to inode with reused nodeid") generation number on lookup was ignored. After this commit lookup with the wrong generation number resulted in the inode being unhashed. This is correct for non-root inodes, but replacing the root inode is wrong and results in weird behavior.
Fix by reverting to the old behavior if ignoring the generation for the root inode, but issuing a warning in dmesg.
--- fs/fuse/dir.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/fuse/dir.c +4 -0
@@ -391,6 +391,10 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name err = -EIO ;if (fuse_invalid_attr (&outarg->attr)) goto out_put_forget; +if (outarg->nodeid ==FUSE_ROOT_ID && outarg->generation !=0 ) { +pr_warn_once ("root generation should be zero\n" ); + outarg->generation =0 ; + } *inode = fuse_iget(sb, outarg->nodeid, outarg->generation, &outarg->attr, ATTR_TIMEOUT(outarg),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 90/399 fuse: dont unhash root
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <[email protected]>
[ Upstream commit b1fe686a765e6c0d71811d825b5a1585a202b777 ]
The root inode is assumed to be always hashed. Do not unhash the root inode even if it is marked BAD.
--- fs/fuse/fuse_i.h | 1 - fs/fuse/inode.c | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
fs/fuse/fuse_i.h +0 -1
@@ -940,7 +940,6 @@ static inline bool fuse_stale_inode(const struct inode *inode, int generation,static inline void fuse_make_bad (struct inode *inode) { -remove_inode_hash (inode);set_bit (FUSE_I_BAD , &get_fuse_inode (inode)->state); }
fs/fuse/inode.c +5 -2
@@ -469,8 +469,11 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, }else if (fuse_stale_inode (inode, generation, attr)) {/* nodeid was reused, any I/O on the old inode should fail */ fuse_make_bad (inode); -iput (inode); - goto retry; +if (inode !=d_inode (sb->s_root)) { +remove_inode_hash (inode); +iput (inode); + goto retry; + } } fi =get_fuse_inode (inode);spin_lock (&fi->lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 91/399 usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jameson Thies <[email protected]>
[ Upstream commit 4d0a5a9915793377c0fe1a8d78de6bcd92cea963 ]
Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for plug type and updating the modal support macro for consistent naming.
--- drivers/usb/typec/ucsi/ucsi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/typec/ucsi/ucsi.h +2 -2
@@ -221,12 +221,12 @@ struct ucsi_cable_property {#define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE BIT(0)#define UCSI_CABLE_PROP_FLAG_ACTIVE_CABLE BIT(1)#define UCSI_CABLE_PROP_FLAG_DIRECTIONALITY BIT(2) -#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE (_f_) ((_f_) & GENMASK(3, 0)) +#define UCSI_CABLE_PROP_FLAG_PLUG_TYPE (_f_) (((_f_) & GENMASK(4, 3)) >> 3)#define UCSI_CABLE_PROPERTY_PLUG_TYPE_A 0#define UCSI_CABLE_PROPERTY_PLUG_TYPE_B 1#define UCSI_CABLE_PROPERTY_PLUG_TYPE_C 2#define UCSI_CABLE_PROPERTY_PLUG_OTHER 3 -#define UCSI_CABLE_PROP_MODE_SUPPORT BIT(5) +#define UCSI_CABLE_PROP_FLAG_MODE_SUPPORT BIT(5)u8 latency; } __packed;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 92/399 usb: dwc3-am62: fix module unload/reload behavior
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
[ Upstream commit 6661befe41009c210efa2c1bcd16a5cc4cff8a06 ]
As runtime PM is enabled, the module can be runtime suspended when .remove() is called.
Do a pm_runtime_get_sync() to make sure module is active before doing any register operations.
Doing a pm_runtime_put_sync() should disable the refclk so no need to disable it again.
Fixes the below warning at module removel.
[ 39.705310] ------------[ cut here ]------------ [ 39.710004] clk:162:3 already disabled [ 39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8
We called of_platform_populate() in .probe() so call the cleanup function of_platform_depopulate() in .remove(). Get rid of the now unnnecessary dwc3_ti_remove_core(). Without this, module re-load doesn't work properly.
--- drivers/usb/dwc3/dwc3-am62.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/usb/dwc3/dwc3-am62.c +2 -10
@@ -267,21 +267,14 @@ static int dwc3_ti_probe(struct platform_device *pdev)return ret; } -static int dwc3_ti_remove_core (struct device *dev,void *c) -{ -struct platform_device *pdev =to_platform_device (dev); - -platform_device_unregister (pdev); -return 0 ; -} -static void dwc3_ti_remove (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct dwc3_am62 *am62 =platform_get_drvdata (pdev);u32 reg; -device_for_each_child (dev,NULL , dwc3_ti_remove_core); +pm_runtime_get_sync (dev); +of_platform_depopulate (dev);/* Clear mode valid bit */ reg =dwc3_ti_readl (am62,USBSS_MODE_CONTROL );
@@ -289,7 +282,6 @@ static void dwc3_ti_remove(struct platform_device *pdev)dwc3_ti_writel (am62,USBSS_MODE_CONTROL , reg);pm_runtime_put_sync (dev); -clk_disable_unprepare (am62->usb2_refclk);pm_runtime_disable (dev);pm_runtime_set_suspended (dev); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 93/399 usb: dwc3-am62: Disable wakeup at remove
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
[ Upstream commit 4ead695e6b3cac06543d7bc7241ab75aee4ea6a6 ]
Disable wakeup at remove.
Fixes the below warnings on module unload and reload.
Quoted 2 lines
dwc3-am62 f900000.dwc3-usb: couldn't enable device as a wakeup source: -17 dwc3-am62 f910000.dwc3-usb: couldn't enable device as a wakeup source: -17
--- drivers/usb/dwc3/dwc3-am62.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/dwc3/dwc3-am62.c +1 -0
@@ -274,6 +274,7 @@ static void dwc3_ti_remove(struct platform_device *pdev)u32 reg;pm_runtime_get_sync (dev); +device_init_wakeup (dev, false);of_platform_depopulate (dev);/* Clear mode valid bit */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 94/399 serial: core: only stop transmit when HW fifo is empty
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Gorski <[email protected]>
[ Upstream commit 7bfb915a597a301abb892f620fe5c283a9fdbd77 ]
If the circular buffer is empty, it just means we fit all characters to send into the HW fifo, but not that the hardware finished transmitting them.
So if we immediately call stop_tx() after that, this may abort any pending characters in the HW fifo, and cause dropped characters on the console.
Fix this by only stopping tx when the tx HW fifo is actually empty.
--- include/linux/serial_core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/serial_core.h +2 -1
@@ -786,7 +786,8 @@ enum UART_TX_FLAGS {if (pending <WAKEUP_CHARS ) { \uart_write_wakeup (__port); \ \ -if (!((flags) &UART_TX_NOSTOP ) && pending ==0 ) \ +if (!((flags) &UART_TX_NOSTOP ) && pending ==0 && \ + __port->ops->tx_empty (__port)) \ __port->ops->stop_tx (__port); \ } \ \
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 95/399 serial: Lock console when calling into driver before registration
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Collingbourne <[email protected]>
[ Upstream commit 801410b26a0e8b8a16f7915b2b55c9528b69ca87 ]
During the handoff from earlycon to the real console driver, we have two separate drivers operating on the same device concurrently. In the case of the 8250 driver these concurrent accesses cause problems due to the driver's use of banked registers, controlled by LCR.DLAB. It is possible for the setup(), config_port(), pm() and set_mctrl() callbacks to set DLAB, which can cause the earlycon code that intends to access TX to instead access DLL, leading to missed output and corruption on the serial line due to unintended modifications to the baud rate.
In particular, for setup() we have:
univ8250_console_setup()
-> serial8250_console_setup()
-> uart_set_options()
-> serial8250_set_termios()
-> serial8250_do_set_termios()
-> serial8250_do_set_divisor()
For config_port() we have:
serial8250_config_port()
-> autoconfig()
For pm() we have:
serial8250_pm()
-> serial8250_do_pm()
-> serial8250_set_sleep()
For set_mctrl() we have (for some devices):
serial8250_set_mctrl()
-> omap8250_set_mctrl()
-> __omap8250_set_mctrl()
To avoid such problems, let's make it so that the console is locked during pre-registration calls to these callbacks, which will prevent the earlycon driver from running concurrently.
Remove the partial solution to this problem in the 8250 driver that locked the console only during autoconfig_irq(), as this would result in a deadlock with the new approach. The console continues to be locked during autoconfig_irq() because it can only be called through uart_configure_port().
Although this patch introduces more locking than strictly necessary (and in particular it also locks during the call to rs485_config() which is not affected by this issue as far as I can tell), it follows the principle that it is the responsibility of the generic console code to manage the earlycon handoff by ensuring that earlycon and real console driver code cannot run concurrently, and not the individual drivers.
--- drivers/tty/serial/8250/8250_port.c | 6 ------ drivers/tty/serial/serial_core.c | 12 ++++++++++++ kernel/printk/printk.c | 21 ++++++++++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-)
drivers/tty/serial/8250/8250_port.c +0 -6
@@ -1329,9 +1329,6 @@ static void autoconfig_irq(struct uart_8250_port *up)inb_p (ICP ); } -if (uart_console (port)) -console_lock (); -/* forget possible initially masked and pending IRQ */ probe_irq_off (probe_irq_on ()); save_mcr =serial8250_in_MCR (up);
@@ -1371,9 +1368,6 @@ static void autoconfig_irq(struct uart_8250_port *up)if (port->flags &UPF_FOURPORT )outb_p (save_ICP,ICP ); -if (uart_console (port)) -console_unlock (); - port->irq = (irq >0 ) ? irq :0 ; }
drivers/tty/serial/serial_core.c +12 -0
@@ -2608,7 +2608,12 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, port->type =PORT_UNKNOWN ; flags |=UART_CONFIG_TYPE ; } +/* Synchronize with possible boot console. */ +if (uart_console (port)) +console_lock (); port->ops->config_port (port, flags); +if (uart_console (port)) +console_unlock (); }if (port->type !=PORT_UNKNOWN ) {
@@ -2616,6 +2621,10 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,uart_report_port (drv, port); +/* Synchronize with possible boot console. */ +if (uart_console (port)) +console_lock (); +/* Power up port for set_mctrl() */ uart_change_pm (state,UART_PM_STATE_ON );
@@ -2632,6 +2641,9 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,uart_rs485_config (port); +if (uart_console (port)) +console_unlock (); +/* * If this driver supports console, and it hasn't been * successfully registered yet, try to re-register it.
kernel/printk/printk.c +18 -3
@@ -3295,6 +3295,21 @@ static int __init keep_bootcon_setup(char *str)early_param ("keep_bootcon" , keep_bootcon_setup); +static int console_call_setup (struct console *newcon,char *options) +{ +int err; + +if (!newcon->setup) +return 0 ; + +/* Synchronize with possible boot console. */ +console_lock (); + err = newcon->setup (newcon, options); +console_unlock (); + +return err; +} +/* * This is called by register_console() to try to match * the newly registered console with any of the ones selected
@@ -3330,8 +3345,8 @@ static int try_enable_preferred_console(struct console *newcon,if (_braille_register_console (newcon, c))return 0 ; -if (newcon->setup && - (err = newcon->setup (newcon, c->options)) !=0 ) + err =console_call_setup (newcon, c->options); +if (err)return err; } newcon->flags |=CON_ENABLED ;
@@ -3357,7 +3372,7 @@ static void try_enable_default_console(struct console *newcon)if (newcon->index <0 ) newcon->index =0 ; -if (newcon->setup && newcon->setup (newcon,NULL ) !=0 ) +if (console_call_setup (newcon,NULL ) !=0 )return ; newcon->flags |=CON_ENABLED ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 96/399 btrfs: qgroup: always free reserved space for extent records
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
[ Upstream commit d139ded8b9cdb897bb9539eb33311daf9a177fd2 ]
[BUG]
If qgroup is marked inconsistent (e.g. caused by operations needing full subtree rescan, like creating a snapshot and assign to a higher level qgroup), btrfs would immediately start leaking its data reserved space.
The following script can easily reproduce it:
mkfs.btrfs -O quota -f $dev
mount $dev $mnt
btrfs subvolume create $mnt/subv1
btrfs qgroup create 1/0 $mnt
# This snapshot creation would mark qgroup inconsistent,
# as the ownership involves different higher level qgroup, thus # we have to rescan both source and snapshot, which can be very # time consuming, thus here btrfs just choose to mark qgroup # inconsistent, and let users to determine when to do the rescan. btrfs subv snapshot -i 1/0 $mnt/subv1 $mnt/snap1
# Now this write would lead to qgroup rsv leak.
xfs_io -f -c "pwrite 0 64k" $mnt/file1
# And at unmount time, btrfs would report 64K DATA rsv space leaked. umount $mnt
And we would have the following dmesg output for the unmount:
BTRFS info (device dm-1): last unmount of filesystem 14a3d84e-f47b-4f72-b053-a8a36eef74d3 BTRFS warning (device dm-1): qgroup 0/5 has unreleased space, type 0 rsv 65536
[CAUSE]
Since commit e15e9f43c7ca ("btrfs: introduce BTRFS_QGROUP_RUNTIME_FLAG_NO_ACCOUNTING to skip qgroup accounting"), we introduce a mode for btrfs qgroup to skip the timing consuming backref walk, if the qgroup is already inconsistent.
But this skip also covered the data reserved freeing, thus the qgroup reserved space for each newly created data extent would not be freed, thus cause the leakage.
[FIX]
Make the data extent reserved space freeing mandatory.
The qgroup reserved space handling is way cheaper compared to the backref walking part, and we always have the super sensitive leak detector, thus it's definitely worth to always free the qgroup reserved data space.
--- fs/btrfs/qgroup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
fs/btrfs/qgroup.c +5 -5
@@ -2959,11 +2959,6 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans) ctx.roots =NULL ; } -/* Free the reserved data space */ -btrfs_qgroup_free_refroot (fs_info, - record->data_rsv_refroot, - record->data_rsv, -BTRFS_QGROUP_RSV_DATA );/* * Use BTRFS_SEQ_LAST as time_seq to do special search, * which doesn't lock tree or delayed_refs and search
@@ -2987,6 +2982,11 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans) record->old_roots =NULL ; new_roots =NULL ; } +/* Free the reserved data space */ +btrfs_qgroup_free_refroot (fs_info, + record->data_rsv_refroot, + record->data_rsv, +BTRFS_QGROUP_RSV_DATA ); cleanup:ulist_free (record->old_roots);ulist_free (new_roots);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 97/399 btrfs: fix off-by-one chunk length calculation at contains_pending_extent()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Filipe Manana <[email protected]>
[ Upstream commit ae6bd7f9b46a29af52ebfac25d395757e2031d0d ]
At contains_pending_extent() the value of the end offset of a chunk we found in the device's allocation state io tree is inclusive, so when we calculate the length we pass to the in_range() macro, we must sum 1 to the expression "physical_end - physical_offset".
In practice the wrong calculation should be harmless as chunks sizes are never 1 byte and we should never have 1 byte ranges of unallocated space. Nevertheless fix the wrong calculation.
--- fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/volumes.c +1 -1
@@ -1403,7 +1403,7 @@ static bool contains_pending_extent(struct btrfs_device *device, u64 *start,if (in_range (physical_start, *start, len) ||in_range (*start, physical_start, - physical_end - physical_start)) { + physical_end +1 - physical_start)) { *start = physical_end +1 ;return true; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 98/399 wifi: rtw88: Add missing VID/PIDs for 8811CU and 8821CU
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nick Morrow <[email protected]>
[ Upstream commit b8a62478f3b143592d1241de1a7f5f8629ad0f49 ]
Add VID/PIDs that are known to be missing for this driver.
Removed /* 8811CU */ and /* 8821CU */ as they are redundant since the file is specific to those chips.
Removed /* TOTOLINK A650UA v3 */ as the manufacturer. It has a REALTEK VID so it may not be specific to this adapter.
Verified and tested.
--- .../net/wireless/realtek/rtw88/rtw8821cu.c | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-)
drivers/net/wireless/realtek/rtw88/rtw8821cu.c +26 -14
@@ -9,24 +9,36 @@#include "usb.h" static const struct usb_device_id rtw_8821cu_id_table[] = { - {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xb82b ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8821CU */ + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0x2006 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0x8731 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0x8811 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xb820 ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8821CU */ - {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc821 ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8821CU */ + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xb82b ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc80c ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc811 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc820 ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8821CU */ + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc821 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc82a ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8821CU */ + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc82b ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8821CU */ - {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc811 ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8811CU */ - {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0x8811 ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* 8811CU */ - {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0x2006 ,0xff ,0xff ,0xff ), - .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* TOTOLINK A650UA v3 */ + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (RTW_USB_VENDOR_ID_REALTEK ,0xc82c ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) }, + {USB_DEVICE_AND_INTERFACE_INFO (0x2001 ,0x331d ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* D-Link */ + {USB_DEVICE_AND_INTERFACE_INFO (0x7392 ,0xc811 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* Edimax */ + {USB_DEVICE_AND_INTERFACE_INFO (0x7392 ,0xd811 ,0xff ,0xff ,0xff ), + .driver_info = (kernel_ulong_t)&(rtw8821c_hw_spec) },/* Edimax */ {}, };MODULE_DEVICE_TABLE (usb, rtw_8821cu_id_table);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 99/399 docs: Makefile: Add dependency to $(YNL_INDEX) for targets other than htmldocs
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akira Yokosawa <[email protected]>
[ Upstream commit a304fa1d10fcb974c117d391e5b4d34c2baa9a62 ]
Commit f061c9f7d058 ("Documentation: Document each netlink family") added recipes for YAML -> RST conversion.
Then commit 7da8bdbf8f5d ("docs: Makefile: Fix make cleandocs by deleting generated .rst files") made sure those converted .rst files are cleaned by "make cleandocs".
However, they took care of htmldocs build only.
If one of other targets such as latexdocs or epubdocs is built without building htmldocs, missing .rst files can cause additional WARNINGs from sphinx-build as follow:
./Documentation/userspace-api/netlink/specs.rst:18: WARNING: undefined label: 'specs' ./Documentation/userspace-api/netlink/netlink-raw.rst:64: WARNING: unknown document: '../../networking/netlink_spec/rt_link' ./Documentation/userspace-api/netlink/netlink-raw.rst:64: WARNING: unknown document: '../../networking/netlink_spec/tc' ./Documentation/userspace-api/netlink/index.rst:21: WARNING: undefined label: 'specs'
Add dependency to $(YNL_INDEX) for other targets and allow any targets to be built cleanly right after "make cleandocs".
Message-ID: <[email protected]>
--- Documentation/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/Makefile +3 -1
@@ -111,7 +111,9 @@ $(YNL_INDEX): $(YNL_RST_FILES) $(YNL_RST_DIR)/%.rst: $(YNL_YAML_DIR)/%.yaml $(YNL_TOOL) $(Q)$(YNL_TOOL) -i $< -o $@ -htmldocs: $(YNL_INDEX) +htmldocs texinfodocs latexdocs epubdocs xmldocs: $(YNL_INDEX) + +htmldocs: @$(srctree)/scripts/sphinx-pre-install --version-check @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 100/399 PCI/PM: Drain runtime-idle callbacks before driver removal
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 9d5286d4e7f68beab450deddbb6a32edd5ecf4bf ]
A race condition between the .runtime_idle() callback and the .remove() callback in the rtsx_pcr PCI driver leads to a kernel crash due to an unhandled page fault [1].
The problem is that rtsx_pci_runtime_idle() is not expected to be running after pm_runtime_get_sync() has been called, but the latter doesn't really guarantee that. It only guarantees that the suspend and resume callbacks will not be running when it returns.
However, if a .runtime_idle() callback is already running when pm_runtime_get_sync() is called, the latter will notice that the runtime PM status of the device is RPM_ACTIVE and it will return right away without waiting for the former to complete. In fact, it cannot wait for .runtime_idle() to complete because it may be called from that callback (it arguably does not make much sense to do that, but it is not strictly prohibited).
Thus in general, whoever is providing a .runtime_idle() callback needs to protect it from running in parallel with whatever code runs after pm_runtime_get_sync(). [Note that .runtime_idle() will not start after pm_runtime_get_sync() has returned, but it may continue running then if it has started earlier.]
One way to address that race condition is to call pm_runtime_barrier() after pm_runtime_get_sync() (not before it, because a nonzero value of the runtime PM usage counter is necessary to prevent runtime PM callbacks from being invoked) to wait for the .runtime_idle() callback to complete should it be running at that point. A suitable place for doing that is in pci_device_remove() which calls pm_runtime_get_sync() before removing the driver, so it may as well call pm_runtime_barrier() subsequently, which will prevent the race in question from occurring, not just in the rtsx_pcr driver, but in any PCI drivers providing .runtime_idle() callbacks.
--- drivers/pci/pci-driver.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/pci/pci-driver.c +7 -0
@@ -473,6 +473,13 @@ static void pci_device_remove(struct device *dev)if (drv->remove) {pm_runtime_get_sync (dev); +/* +* If the driver provides a .runtime_idle() callback and it has +* started to run already, it may continue to run in parallel +* with the code below, so wait until all of the runtime PM +* activity has completed. +*/ +pm_runtime_barrier (dev); drv->remove (pci_dev);pm_runtime_put_noidle (dev); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 101/399 PCI/DPC: Quirk PIO log size for Intel Raptor Lake Root Ports
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Menzel <[email protected]>
[ Upstream commit 627c6db20703b5d18d928464f411d0d4ec327508 ]
Commit 5459c0b70467 ("PCI/DPC: Quirk PIO log size for certain Intel Root Ports") and commit 3b8803494a06 ("PCI/DPC: Quirk PIO log size for Intel Ice Lake Root Ports") add quirks for Ice, Tiger and Alder Lake Root Ports. System firmware for Raptor Lake still has the bug, so Linux logs the warning below on several Raptor Lake systems like Dell Precision 3581 with Intel Raptor Lake processor (0W18NX) system firmware/BIOS version 1.10.1.
pci 0000:00:07.0: [8086:a76e] type 01 class 0x060400 pci 0000:00:07.0: DPC: RP PIO log size 0 is invalid pci 0000:00:07.1: [8086:a73f] type 01 class 0x060400 pci 0000:00:07.1: DPC: RP PIO log size 0 is invalid
Apply the quirk for Raptor Lake Root Ports as well.
This also enables the DPC driver to dump the RP PIO Log registers when DPC is triggered.
--- drivers/pci/quirks.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/quirks.c +2 -0
@@ -6226,6 +6226,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x9a2b, dpc_log_size);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x9a2d , dpc_log_size);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x9a2f , dpc_log_size);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x9a31 , dpc_log_size); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0xa73f , dpc_log_size); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0xa76e , dpc_log_size);#endif /*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 102/399 ACPI: CPPC: Use access_width over bit_width for system memory accesses
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jarred White <[email protected]>
[ Upstream commit 2f4a4d63a193be6fd530d180bb13c3592052904c ]
To align with ACPI 6.3+, since bit_width can be any 8-bit value, it cannot be depended on to be always on a clean 8b boundary. This was uncovered on the Cobalt 100 platform.
SError Interrupt on CPU26, code 0xbe000011 -- SError
CPU: 26 PID: 1510 Comm: systemd-udevd Not tainted 5.15.2.1-13 #1 Hardware name: MICROSOFT CORPORATION, BIOS MICROSOFT CORPORATION pstate: 62400009 (nZCv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) pc : cppc_get_perf_caps+0xec/0x410 lr : cppc_get_perf_caps+0xe8/0x410 sp : ffff8000155ab730 x29: ffff8000155ab730 x28: ffff0080139d0038 x27: ffff0080139d0078 x26: 0000000000000000 x25: ffff0080139d0058 x24: 00000000ffffffff x23: ffff0080139d0298 x22: ffff0080139d0278 x21: 0000000000000000 x20: ffff00802b251910 x19: ffff0080139d0000 x18: ffffffffffffffff x17: 0000000000000000 x16: ffffdc7e111bad04 x15: ffff00802b251008 x14: ffffffffffffffff x13: ffff013f1fd63300 x12: 0000000000000006 x11: ffffdc7e128f4420 x10: 0000000000000000 x9 : ffffdc7e111badec x8 : ffff00802b251980 x7 : 0000000000000000 x6 : ffff0080139d0028 x5 : 0000000000000000 x4 : ffff0080139d0018 x3 : 00000000ffffffff x2 : 0000000000000008 x1 : ffff8000155ab7a0 x0 : 0000000000000000 Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 26 PID: 1510 Comm: systemd-udevd Not tainted 5.15.2.1-13 #1 Hardware name: MICROSOFT CORPORATION, BIOS MICROSOFT CORPORATION Call trace: dump_backtrace+0x0/0x1e0 show_stack+0x24/0x30 dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 panic+0x16c/0x384 add_taint+0x0/0xc0 arm64_serror_panic+0x7c/0x90 arm64_is_fatal_ras_serror+0x34/0xa4 do_serror+0x50/0x6c el1h_64_error_handler+0x40/0x74 el1h_64_error+0x7c/0x80 cppc_get_perf_caps+0xec/0x410 cppc_cpufreq_cpu_init+0x74/0x400 [cppc_cpufreq] cpufreq_online+0x2dc/0xa30 cpufreq_add_dev+0xc0/0xd4 subsys_interface_register+0x134/0x14c cpufreq_register_driver+0x1b0/0x354 cppc_cpufreq_init+0x1a8/0x1000 [cppc_cpufreq] do_one_initcall+0x50/0x250 do_init_module+0x60/0x27c load_module+0x2300/0x2570 __do_sys_finit_module+0xa8/0x114 __arm64_sys_finit_module+0x2c/0x3c invoke_syscall+0x78/0x100 el0_svc_common.constprop.0+0x180/0x1a0 do_el0_svc+0x84/0xa0 el0_svc+0x2c/0xc0 el0t_64_sync_handler+0xa4/0x12c el0t_64_sync+0x1a4/0x1a8
Instead, use access_width to determine the size and use the offset and width to shift and mask the bits to read/write out. Make sure to add a check for system memory since pcc redefines the access_width to subspace id.
If access_width is not set, then fall back to using bit_width.
--- drivers/acpi/cppc_acpi.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
drivers/acpi/cppc_acpi.c +26 -5
@@ -166,6 +166,13 @@ show_cppc_data(cppc_get_perf_caps, cppc_perf_caps, nominal_freq);show_cppc_data (cppc_get_perf_ctrs, cppc_perf_fb_ctrs, reference_perf);show_cppc_data (cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time); +/* Check for valid access_width, otherwise, fallback to using bit_width */ +#define GET_BIT_WIDTH (reg) ((reg)->access_width ? (8 << ((reg)->access_width - 1)) : (reg)->bit_width) + +/* Shift and apply the mask for CPC reads/writes */ +#define MASK_VAL (reg, val) ((val) >> ((reg)->bit_offset & \ + GENMASK(((reg)->bit_width), 0))) +static ssize_t show_feedback_ctrs (struct kobject *kobj,struct kobj_attribute *attr,char *buf) {
@@ -780,6 +787,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) }else if (gas_t->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) {if (gas_t->address) {void __iomem *addr; +size_t access_width;if (!osc_cpc_flexible_adr_space_confirmed) {pr_debug ("Flexible address space capability not supported\n" );
@@ -787,7 +795,8 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) goto out_free; } - addr =ioremap (gas_t->address, gas_t->bit_width/8 ); + access_width =GET_BIT_WIDTH (gas_t) /8 ; + addr =ioremap (gas_t->address, access_width);if (!addr) goto out_free; cpc_ptr->cpc_regs[i-2 ].sys_mem_vaddr = addr;
@@ -983,6 +992,7 @@ int __weak cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val)static int cpc_read (int cpu,struct cpc_register_resource *reg_res,u64 *val) {void __iomem *vaddr =NULL ; +int size;int pcc_ss_id =per_cpu (cpu_pcc_subspace_idx, cpu);struct cpc_reg *reg = ®_res->cpc_entry.reg;
@@ -994,7 +1004,7 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val) *val =0 ;if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_IO ) { -u32 width =8 << (reg->access_width -1 ); +u32 width =GET_BIT_WIDTH (reg);u32 val_u32;acpi_status status;
@@ -1018,7 +1028,9 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)return acpi_os_read_memory ((acpi_physical_address )reg->address, val, reg->bit_width); -switch (reg->bit_width) { + size =GET_BIT_WIDTH (reg); + +switch (size) {case 8 : *val =readb_relaxed (vaddr);break ;
@@ -1037,18 +1049,22 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)return -EFAULT ; } +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) + *val =MASK_VAL (reg, *val); +return 0 ; }static int cpc_write (int cpu,struct cpc_register_resource *reg_res,u64 val) {int ret_val =0 ; +int size;void __iomem *vaddr =NULL ;int pcc_ss_id =per_cpu (cpu_pcc_subspace_idx, cpu);struct cpc_reg *reg = ®_res->cpc_entry.reg;if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_IO ) { -u32 width =8 << (reg->access_width -1 ); +u32 width =GET_BIT_WIDTH (reg);acpi_status status; status = acpi_os_write_port((acpi_io_address)reg->address,
@@ -1070,7 +1086,12 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)return acpi_os_write_memory ((acpi_physical_address )reg->address, val, reg->bit_width); -switch (reg->bit_width) { + size =GET_BIT_WIDTH (reg); + +if (reg->space_id ==ACPI_ADR_SPACE_SYSTEM_MEMORY ) + val =MASK_VAL (reg, val); + +switch (size) {case 8 :writeb_relaxed (val, vaddr);break ;
Signature · 1 line
2.43.0
Re: [PATCH 6.8 102/399] ACPI: CPPC: Use access_width over bit_width for system memory accesses
Quoted 4 lines · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Jarred White <[email protected]>
[ Upstream commit
2f4a4d63a193be6fd530d180bb13c3592052904c]To align with ACPI 6.3+, since
bit_widthcan be any 8-bit value, it cannot be depended on to be always on a clean 8b boundary. This was uncovered on the Cobalt 100 platform.
Hi Greg,
Please drop this patch from all stable kernels as we seem to have a regression reported
on AmpereOne systems: https://lore.kernel.org/all/[email protected]/
Thanks,
Easwar
Greg Kroah-Hartman
maintainerRe: [PATCH 6.8 102/399] ACPI: CPPC: Use access_width over bit_width for system memory accesses
Quoted 14 lines · Easwar Hariharan
Quoted 4 lines · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Jarred White <[email protected]>
[ Upstream commit
2f4a4d63a193be6fd530d180bb13c3592052904c]To align with ACPI 6.3+, since
bit_widthcan be any 8-bit value, it cannot be depended on to be always on a clean 8b boundary. This was uncovered on the Cobalt 100 platform.
Quoted 4 lines
Hi Greg,
Please drop this patch from all stable kernels as we seem to have a regression reported
on AmpereOne systems: https://lore.kernel.org/all/[email protected]/
Ok, all now dropped. Please let us know when the fix gets into Linus's tree (and also properly tag it for stable inclusion as it is fixing a commit that was tagged for stable inclusion.)
thanks,
greg k-h
Re: [PATCH 6.8 102/399] ACPI: CPPC: Use access_width over bit_width for system memory accesses
Hi stable team,
Quoted 20 lines · Greg Kroah-Hartman
Quoted 14 lines · Easwar Hariharan
Quoted 4 lines · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Jarred White <[email protected]>
[ Upstream commit
2f4a4d63a193be6fd530d180bb13c3592052904c]To align with ACPI 6.3+, since
bit_widthcan be any 8-bit value, it cannot be depended on to be always on a clean 8b boundary. This was uncovered on the Cobalt 100 platform.Quoted 4 lines
Hi Greg,
Please drop this patch from all stable kernels as we seem to have a regression reported
on AmpereOne systems: https://lore.kernel.org/all/[email protected]/
Quoted 7 lines
Ok, all now dropped. Please let us know when the fix gets into Linus's tree (and also properly tag it for stable inclusion as it is fixing a commit that was tagged for stable inclusion.)
thanks,
greg k-h
Despite having dropped the backport of this patch from all stable kernels, the 5.15 backport seems to have snuck through.
Both the regression fix for AmpereOne[1] and a fix for another bug[2] we found while testing haven't been accepted into Linus' tree yet, so 5.15.154 has a known issue. Please revert this for 5.15.155 and I'll send an email when the full set is in Linus' tree.
Thanks,
Easwar
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
Greg Kroah-Hartman
maintainerRe: [PATCH 6.8 102/399] ACPI: CPPC: Use access_width over bit_width for system memory accesses
Quoted 29 lines · Easwar Hariharan
Hi stable team,
Quoted 26 lines · Greg Kroah-Hartman
Quoted 14 lines · Easwar Hariharan
Quoted 4 lines · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
------------------
Quoted 8 lines
From: Jarred White <[email protected]>
[ Upstream commit
2f4a4d63a193be6fd530d180bb13c3592052904c]To align with ACPI 6.3+, since
bit_widthcan be any 8-bit value, it cannot be depended on to be always on a clean 8b boundary. This was uncovered on the Cobalt 100 platform.Quoted 4 lines
Hi Greg,
Please drop this patch from all stable kernels as we seem to have a regression reported
on AmpereOne systems: https://lore.kernel.org/all/[email protected]/Ok, all now dropped. Please let us know when the fix gets into Linus's tree (and also properly tag it for stable inclusion as it is fixing a commit that was tagged for stable inclusion.)
thanks,
Quoted 8 lines
Quoted 1 line
greg k-h
Despite having dropped the backport of this patch from all stable kernels, the 5.15 backport seems to have snuck through.
Both the regression fix for AmpereOne[1] and a fix for another bug[2] we found while testing haven't been accepted into Linus' tree yet, so 5.15.154 has a known issue. Please revert this for 5.15.155 and I'll send an email when the full set is in Linus' tree.
Now reverted, thansk.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 103/399 Revert "Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d""
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Song Liu <[email protected]>
[ Upstream commit 3445139e3a594be77eff48bc17eff67cf983daed ]
This reverts commit bed9e27baf52a09b7ba2a3714f1e24e17ced386d.
The original set [1][2] was expected to undo a suboptimal fix in [2], and replace it with a better fix [1]. However, as reported by Dan Moulding [2] causes an issue with raid5 with journal device.
Revert [2] for now to close the issue. We will follow up on another issue reported by Juxiao Bi, as [2] is expected to fix it. We believe this is a good trade-off, because the latter issue happens less freqently.
In the meanwhile, we will NOT revert [1], as it contains the right logic.
[1] commit d6e035aad6c0 ("md: bypass block throttle for superblock update")
[2] commit bed9e27baf52 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"")
--- drivers/md/raid5.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/md/raid5.c +12 -0
@@ -36,6 +36,7 @@*/ #include <linux/blkdev.h> +#include <linux/delay.h> #include <linux/kthread.h> #include <linux/raid/pq.h> #include <linux/async_tx.h>
@@ -6773,7 +6774,18 @@ static void raid5d(struct md_thread *thread)spin_unlock_irq (&conf->device_lock);md_check_recovery (mddev);spin_lock_irq (&conf->device_lock); + +/* +* Waiting on MD_SB_CHANGE_PENDING below may deadlock +* seeing md_check_recovery() is needed to clear +* the flag when using mdmon. +*/ +continue ; } + +wait_event_lock_irq (mddev->sb_wait, + !test_bit (MD_SB_CHANGE_PENDING , &mddev->sb_flags), + conf->device_lock); }pr_debug ("%d stripes handled\n" , handled);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 104/399 md: dont clear MD_RECOVERY_FROZEN for new dm-raid until resume
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 2f03d0c2cd451c7ac2f317079d4ec518f0986b55 ]
After commit 9dbd1aa3a81c ("dm raid: add reshaping support to the target") raid_ctr() will set MD_RECOVERY_FROZEN before md_run() and expect to keep array frozen until resume. However, md_run() will clear the flag by setting mddev->recovery to 0.
Before commit 1baae052cccd ("md: Don't ignore suspended array in md_check_recovery()"), dm-raid actually relied on suspending to prevent starting new sync_thread.
Fix this problem by keeping 'MD_RECOVERY_FROZEN' for dm-raid in md_run().
--- drivers/md/md.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/md/md.c +4 -1
@@ -6039,7 +6039,10 @@ int md_run(struct mddev *mddev)pr_warn ("True protection against single-disk failure might be compromised.\n" ); } - mddev->recovery =0 ; +/* dm-raid expect sync_thread to be frozen until resume */ +if (mddev->gendisk) + mddev->recovery =0 ; +/* may be over-ridden by personality */ mddev->resync_max_sectors = mddev->dev_sectors;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 105/399 md: export helpers to stop sync_thread
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 7a2347e284d7ec2f0759be4db60fa7ca937284fc ]
Add new helpers:
void md_idle_sync_thread(struct mddev *mddev); void md_frozen_sync_thread(struct mddev *mddev); void md_unfrozen_sync_thread(struct mddev *mddev);
The helpers will be used in dm-raid in later patches to fix regressions and prevent calling md_reap_sync_thread() directly.
--- drivers/md/md.c | 29 +++++++++++++++++++++++++++++ drivers/md/md.h | 3 +++ 2 files changed, 32 insertions(+)
drivers/md/md.c +29 -0
@@ -4920,6 +4920,35 @@ static void stop_sync_thread(struct mddev *mddev, bool locked, bool check_seq)mddev_lock_nointr (mddev); } +void md_idle_sync_thread (struct mddev *mddev) +{ +lockdep_assert_held (&mddev->reconfig_mutex); + +clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); +stop_sync_thread (mddev, true, true); +} +EXPORT_SYMBOL_GPL (md_idle_sync_thread); + +void md_frozen_sync_thread (struct mddev *mddev) +{ +lockdep_assert_held (&mddev->reconfig_mutex); + +set_bit (MD_RECOVERY_FROZEN , &mddev->recovery); +stop_sync_thread (mddev, true, false); +} +EXPORT_SYMBOL_GPL (md_frozen_sync_thread); + +void md_unfrozen_sync_thread (struct mddev *mddev) +{ +lockdep_assert_held (&mddev->reconfig_mutex); + +clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); +set_bit (MD_RECOVERY_NEEDED , &mddev->recovery); +md_wakeup_thread (mddev->thread); +sysfs_notify_dirent_safe (mddev->sysfs_action); +} +EXPORT_SYMBOL_GPL (md_unfrozen_sync_thread); +static void idle_sync_thread (struct mddev *mddev) {mutex_lock (&mddev->sync_mutex);
drivers/md/md.h +3 -0
@@ -782,6 +782,9 @@ extern void md_rdev_clear(struct md_rdev *rdev);extern void md_handle_request (struct mddev *mddev,struct bio *bio);extern int mddev_suspend (struct mddev *mddev,bool interruptible);extern void mddev_resume (struct mddev *mddev); +extern void md_idle_sync_thread (struct mddev *mddev); +extern void md_frozen_sync_thread (struct mddev *mddev); +extern void md_unfrozen_sync_thread (struct mddev *mddev);extern void md_reload_sb (struct mddev *mddev,int raid_disk);extern void md_update_sb (struct mddev *mddev,int force);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 106/399 md: export helper md_is_rdwr()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 314e9af065513ff86ec9e32eaa96b9bd275cf51d ]
There are no functional changes for now, prepare to fix a deadlock for dm-raid456.
--- drivers/md/md.c | 12 ------------ drivers/md/md.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/md/md.c +0 -12
@@ -99,18 +99,6 @@ static void mddev_detach(struct mddev *mddev);static void export_rdev (struct md_rdev *rdev,struct mddev *mddev);static void md_wakeup_thread_directly (struct md_thread __rcu *thread); -enum md_ro_state { -MD_RDWR , -MD_RDONLY , -MD_AUTO_READ , -MD_MAX_STATE -}; - -static bool md_is_rdwr (struct mddev *mddev) -{ -return (mddev->ro ==MD_RDWR ); -} -/* * Default number of read corrections we'll attempt on an rdev * before ejecting it from the array. We divide the read error
drivers/md/md.h +12 -0
@@ -559,6 +559,18 @@ enum recovery_flags { MD_RESYNCING_REMOTE, /* remote node is running resync thread */ }; +enum md_ro_state { +MD_RDWR , +MD_RDONLY , +MD_AUTO_READ , +MD_MAX_STATE +}; + +static inline bool md_is_rdwr (struct mddev *mddev) +{ +return (mddev->ro ==MD_RDWR ); +} +static inline int __must_check mddev_lock (struct mddev *mddev) {return mutex_lock_interruptible (&mddev->reconfig_mutex);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 107/399 md: add a new helper reshape_interrupted()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 503f9d43790fdd0c6e6ae2f4dd3f70b146ac4159 ]
The helper will be used for dm-raid456 later to detect the case that reshape can't make progress.
--- drivers/md/md.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/md/md.h +19 -0
@@ -571,6 +571,25 @@ static inline bool md_is_rdwr(struct mddev *mddev)return (mddev->ro ==MD_RDWR ); } +static inline bool reshape_interrupted (struct mddev *mddev) +{ +/* reshape never start */ +if (mddev->reshape_position == MaxSector) +return false; + +/* interrupted */ +if (!test_bit (MD_RECOVERY_RUNNING , &mddev->recovery)) +return true; + +/* running reshape will be interrupted soon. */ +if (test_bit (MD_RECOVERY_WAIT , &mddev->recovery) || +test_bit (MD_RECOVERY_INTR , &mddev->recovery) || +test_bit (MD_RECOVERY_FROZEN , &mddev->recovery)) +return true; + +return false; +} +static inline int __must_check mddev_lock (struct mddev *mddev) {return mutex_lock_interruptible (&mddev->reconfig_mutex);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 108/399 dm-raid: really frozen sync_thread during suspend
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 16c4770c75b1223998adbeb7286f9a15c65fba73 ]
1) commit f52f5c71f3d4 ("md: fix stopping sync thread") remove MD_RECOVERY_FROZEN from __md_stop_writes() and doesn't realize that dm-raid relies on __md_stop_writes() to frozen sync_thread indirectly. Fix this problem by adding MD_RECOVERY_FROZEN in md_stop_writes(), and since stop_sync_thread() is only used for dm-raid in this case, also move stop_sync_thread() to md_stop_writes().
2) The flag MD_RECOVERY_FROZEN doesn't mean that sync thread is frozen, it only prevent new sync_thread to start, and it can't stop the running sync thread; In order to frozen sync_thread, after seting the flag, stop_sync_thread() should be used.
3) The flag MD_RECOVERY_FROZEN doesn't mean that writes are stopped, use it as condition for md_stop_writes() in raid_postsuspend() doesn't look correct. Consider that reentrant stop_sync_thread() do nothing, always call md_stop_writes() in raid_postsuspend().
4) raid_message can set/clear the flag MD_RECOVERY_FROZEN at anytime, and if MD_RECOVERY_FROZEN is cleared while the array is suspended, new sync_thread can start unexpected. Fix this by disallow raid_message() to change sync_thread status during suspend.
Note that after commit f52f5c71f3d4 ("md: fix stopping sync thread"), the test shell/lvconvert-raid-reshape.sh start to hang in stop_sync_thread(), and with previous fixes, the test won't hang there anymore, however, the test will still fail and complain that ext4 is corrupted. And with this patch, the test won't hang due to stop_sync_thread() or fail due to ext4 is corrupted anymore. However, there is still a deadlock related to dm-raid456 that will be fixed in following patches.
--- drivers/md/dm-raid.c | 25 +++++++++++++++---------- drivers/md/md.c | 3 ++- 2 files changed, 17 insertions(+), 11 deletions(-)
drivers/md/dm-raid.c +15 -10
@@ -3240,11 +3240,12 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) rs->md.ro =1 ; rs->md.in_sync =1 ; -/* Keep array frozen until resume. */ -set_bit (MD_RECOVERY_FROZEN , &rs->md.recovery); -/* Has to be held on running the array */ mddev_suspend_and_lock_nointr (&rs->md); + +/* Keep array frozen until resume. */ +md_frozen_sync_thread (&rs->md); + r =md_run (&rs->md); rs->md.in_sync =0 ;/* Assume already marked dirty */ if (r) {
@@ -3722,6 +3723,9 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv,if (!mddev->pers || !mddev->pers->sync_request)return -EINVAL ; +if (test_bit (RT_FLAG_RS_SUSPENDED , &rs->runtime_flags)) +return -EBUSY ; +if (!strcasecmp (argv[0 ],"frozen" ))set_bit (MD_RECOVERY_FROZEN , &mddev->recovery);else
@@ -3796,10 +3800,11 @@ static void raid_postsuspend(struct dm_target *ti)struct raid_set *rs = ti->private;if (!test_and_set_bit (RT_FLAG_RS_SUSPENDED , &rs->runtime_flags)) { -/* Writes have to be stopped before suspending to avoid deadlocks. */ -if (!test_bit (MD_RECOVERY_FROZEN , &rs->md.recovery)) -md_stop_writes (&rs->md); - +/* +* sync_thread must be stopped during suspend, and writes have +* to be stopped before suspending to avoid deadlocks. +*/ +md_stop_writes (&rs->md);mddev_suspend (&rs->md, false); } }
@@ -4012,8 +4017,6 @@ static int raid_preresume(struct dm_target *ti) }/* Check for any resize/reshape on @rs and adjust/initiate */ -/* Be prepared for mddev_resume() in raid_resume() */ -set_bit (MD_RECOVERY_FROZEN , &mddev->recovery);if (mddev->recovery_cp && mddev->recovery_cp < MaxSector) {set_bit (MD_RECOVERY_REQUESTED , &mddev->recovery); mddev->resync_min = mddev->recovery_cp;
@@ -4055,10 +4058,12 @@ static void raid_resume(struct dm_target *ti)if (mddev->delta_disks <0 )rs_set_capacity (rs); +WARN_ON_ONCE (!test_bit (MD_RECOVERY_FROZEN , &mddev->recovery)); +WARN_ON_ONCE (test_bit (MD_RECOVERY_RUNNING , &mddev->recovery));mddev_lock_nointr (mddev); -clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); mddev->ro =0 ; mddev->in_sync =0 ; +md_unfrozen_sync_thread (mddev);mddev_unlock_and_resume (mddev); } }
drivers/md/md.c +2 -1
@@ -6344,7 +6344,6 @@ static void md_clean(struct mddev *mddev)static void __md_stop_writes (struct mddev *mddev) { -stop_sync_thread (mddev, true, false);del_timer_sync (&mddev->safemode_timer);if (mddev->pers && mddev->pers->quiesce) {
@@ -6369,6 +6368,8 @@ static void __md_stop_writes(struct mddev *mddev)void md_stop_writes (struct mddev *mddev) {mddev_lock_nointr (mddev); +set_bit (MD_RECOVERY_FROZEN , &mddev->recovery); +stop_sync_thread (mddev, true, false);__md_stop_writes (mddev);mddev_unlock (mddev); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 109/399 md/dm-raid: dont call md_reap_sync_thread() directly
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit cd32b27a66db8776d8b8e82ec7d7dde97a8693b0 ]
Currently md_reap_sync_thread() is called from raid_message() directly without holding 'reconfig_mutex', this is definitely unsafe because md_reap_sync_thread() can change many fields that is protected by 'reconfig_mutex'.
However, hold 'reconfig_mutex' here is still problematic because this will cause deadlock, for example, commit 130443d60b1b ("md: refactor idle/frozen_sync_thread() to fix deadlock").
Fix this problem by using stop_sync_thread() to unregister sync_thread, like md/raid did.
--- drivers/md/dm-raid.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/md/dm-raid.c +18 -10
@@ -3719,6 +3719,7 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv, {struct raid_set *rs = ti->private;struct mddev *mddev = &rs->md; +int ret =0 ;if (!mddev->pers || !mddev->pers->sync_request)return -EINVAL ;
@@ -3726,17 +3727,24 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv,if (test_bit (RT_FLAG_RS_SUSPENDED , &rs->runtime_flags))return -EBUSY ; -if (!strcasecmp (argv[0 ],"frozen" )) -set_bit (MD_RECOVERY_FROZEN , &mddev->recovery); -else -clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); +if (!strcasecmp (argv[0 ],"frozen" )) { + ret =mddev_lock (mddev); +if (ret) +return ret; -if (!strcasecmp (argv[0 ],"idle" ) || !strcasecmp (argv[0 ],"frozen" )) { -if (mddev->sync_thread) { -set_bit (MD_RECOVERY_INTR , &mddev->recovery); -md_reap_sync_thread (mddev); - } - }else if (decipher_sync_action (mddev, mddev->recovery) != st_idle) +md_frozen_sync_thread (mddev); +mddev_unlock (mddev); + }else if (!strcasecmp (argv[0 ],"idle" )) { + ret =mddev_lock (mddev); +if (ret) +return ret; + +md_idle_sync_thread (mddev); +mddev_unlock (mddev); + } + +clear_bit (MD_RECOVERY_FROZEN , &mddev->recovery); +if (decipher_sync_action (mddev, mddev->recovery) != st_idle)return -EBUSY ;else if (!strcasecmp (argv[0 ],"resync" )) ;/* MD_RECOVERY_NEEDED set below */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 110/399 dm-raid: add a new helper prepare_suspend() in md_personality
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 5625ff8b72b0e5c13b0fc1fc1f198155af45f729 ]
There are no functional changes for now, prepare to fix a deadlock for dm-raid456.
--- drivers/md/dm-raid.c | 18 ++++++++++++++++++ drivers/md/md.h | 1 + 2 files changed, 19 insertions(+)
drivers/md/dm-raid.c +18 -0
@@ -3803,6 +3803,23 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)blk_limits_io_opt (limits, chunk_size_bytes *mddev_data_stripes (rs)); } +static void raid_presuspend (struct dm_target *ti) +{ +struct raid_set *rs = ti->private; +struct mddev *mddev = &rs->md; + +if (!reshape_interrupted (mddev)) +return ; + +/* +* For raid456, if reshape is interrupted, IO across reshape position +* will never make progress, while caller will wait for IO to be done. +* Inform raid456 to handle those IO to prevent deadlock. +*/ +if (mddev->pers && mddev->pers->prepare_suspend) + mddev->pers->prepare_suspend (mddev); +} +static void raid_postsuspend (struct dm_target *ti) {struct raid_set *rs = ti->private;
@@ -4087,6 +4104,7 @@ static struct target_type raid_target = { .message = raid_message, .iterate_devices = raid_iterate_devices, .io_hints = raid_io_hints, + .presuspend = raid_presuspend, .postsuspend = raid_postsuspend, .preresume = raid_preresume, .resume = raid_resume,
drivers/md/md.h +1 -0
@@ -649,6 +649,7 @@ struct md_personalityint (*start_reshape) (struct mddev *mddev);void (*finish_reshape) (struct mddev *mddev);void (*update_reshape_pos) (struct mddev *mddev); +void (*prepare_suspend) (struct mddev *mddev);/* quiesce suspends or resumes internal processing. * 1 - stop new actions and wait for action io to complete * 0 - return to normal behaviour
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 111/399 dm-raid456, md/raid456: fix a deadlock for dm-raid456 while io concurrent with reshape
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 41425f96d7aa59bc865f60f5dda3d7697b555677 ]
For raid456, if reshape is still in progress, then IO across reshape position will wait for reshape to make progress. However, for dm-raid, in following cases reshape will never make progress hence IO will hang:
1) the array is read-only;
2) MD_RECOVERY_WAIT is set;
3) MD_RECOVERY_FROZEN is set;
After commit c467e97f079f ("md/raid6: use valid sector values to determine if an I/O should wait on the reshape") fix the problem that IO across reshape position doesn't wait for reshape, the dm-raid test shell/lvconvert-raid-reshape.sh start to hang:
[root@fedora ~]# cat /proc/979/stack
[<0>] wait_woken+0x7d/0x90 [<0>] raid5_make_request+0x929/0x1d70 [raid456] [<0>] md_handle_request+0xc2/0x3b0 [md_mod] [<0>] raid_map+0x2c/0x50 [dm_raid] [<0>] __map_bio+0x251/0x380 [dm_mod] [<0>] dm_submit_bio+0x1f0/0x760 [dm_mod] [<0>] __submit_bio+0xc2/0x1c0 [<0>] submit_bio_noacct_nocheck+0x17f/0x450 [<0>] submit_bio_noacct+0x2bc/0x780 [<0>] submit_bio+0x70/0xc0 [<0>] mpage_readahead+0x169/0x1f0 [<0>] blkdev_readahead+0x18/0x30 [<0>] read_pages+0x7c/0x3b0 [<0>] page_cache_ra_unbounded+0x1ab/0x280 [<0>] force_page_cache_ra+0x9e/0x130 [<0>] page_cache_sync_ra+0x3b/0x110 [<0>] filemap_get_pages+0x143/0xa30 [<0>] filemap_read+0xdc/0x4b0 [<0>] blkdev_read_iter+0x75/0x200 [<0>] vfs_read+0x272/0x460 [<0>] ksys_read+0x7a/0x170 [<0>] __x64_sys_read+0x1c/0x30 [<0>] do_syscall_64+0xc6/0x230 [<0>] entry_SYSCALL_64_after_hwframe+0x6c/0x74
This is because reshape can't make progress.
For md/raid, the problem doesn't exist because register new sync_thread doesn't rely on the IO to be done any more:
1) If array is read-only, it can switch to read-write by ioctl/sysfs;
2) md/raid never set MD_RECOVERY_WAIT;
3) If MD_RECOVERY_FROZEN is set, mddev_suspend() doesn't hold 'reconfig_mutex', hence it can be cleared and reshape can continue by sysfs api 'sync_action'.
However, I'm not sure yet how to avoid the problem in dm-raid yet. This patch on the one hand make sure raid_message() can't change sync_thread() through raid_message() after presuspend(), on the other hand detect the above 3 cases before wait for IO do be done in dm_suspend(), and let dm-raid requeue those IO.
--- drivers/md/dm-raid.c | 22 ++++++++++++++++++++-- drivers/md/md.c | 24 ++++++++++++++++++++++-- drivers/md/md.h | 3 ++- drivers/md/raid5.c | 32 ++++++++++++++++++++++++++++++-- 4 files changed, 74 insertions(+), 7 deletions(-)
drivers/md/dm-raid.c +20 -2
@@ -213,6 +213,7 @@ struct raid_dev {#define RT_FLAG_RS_IN_SYNC 6#define RT_FLAG_RS_RESYNCING 7#define RT_FLAG_RS_GROW 8 +#define RT_FLAG_RS_FROZEN 9/* Array elements of 64 bit needed for rebuild/failed disk bits */ #define DISKS_ARRAY_ELEMS ((MAX_RAID_DEVICES + (sizeof(uint64_t) * 8 - 1)) / sizeof(uint64_t) / 8)
@@ -3340,7 +3341,8 @@ static int raid_map(struct dm_target *ti, struct bio *bio)if (unlikely (bio_has_data (bio) &&bio_end_sector (bio) > mddev->array_sectors))return DM_MAPIO_REQUEUE ; -md_handle_request (mddev, bio); +if (unlikely (!md_handle_request (mddev, bio))) +return DM_MAPIO_REQUEUE ;return DM_MAPIO_SUBMITTED ; }
@@ -3724,7 +3726,8 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv,if (!mddev->pers || !mddev->pers->sync_request)return -EINVAL ; -if (test_bit (RT_FLAG_RS_SUSPENDED , &rs->runtime_flags)) +if (test_bit (RT_FLAG_RS_SUSPENDED , &rs->runtime_flags) || +test_bit (RT_FLAG_RS_FROZEN , &rs->runtime_flags))return -EBUSY ;if (!strcasecmp (argv[0 ],"frozen" )) {
@@ -3808,6 +3811,12 @@ static void raid_presuspend(struct dm_target *ti)struct raid_set *rs = ti->private;struct mddev *mddev = &rs->md; +/* +* From now on, disallow raid_message() to change sync_thread until +* resume, raid_postsuspend() is too late. +*/ +set_bit (RT_FLAG_RS_FROZEN , &rs->runtime_flags); +if (!reshape_interrupted (mddev))return ;
@@ -3820,6 +3829,13 @@ static void raid_presuspend(struct dm_target *ti) mddev->pers->prepare_suspend (mddev); } +static void raid_presuspend_undo (struct dm_target *ti) +{ +struct raid_set *rs = ti->private; + +clear_bit (RT_FLAG_RS_FROZEN , &rs->runtime_flags); +} +static void raid_postsuspend (struct dm_target *ti) {struct raid_set *rs = ti->private;
@@ -4085,6 +4101,7 @@ static void raid_resume(struct dm_target *ti)WARN_ON_ONCE (!test_bit (MD_RECOVERY_FROZEN , &mddev->recovery));WARN_ON_ONCE (test_bit (MD_RECOVERY_RUNNING , &mddev->recovery)); +clear_bit (RT_FLAG_RS_FROZEN , &rs->runtime_flags);mddev_lock_nointr (mddev); mddev->ro =0 ; mddev->in_sync =0 ;
@@ -4105,6 +4122,7 @@ static struct target_type raid_target = { .iterate_devices = raid_iterate_devices, .io_hints = raid_io_hints, .presuspend = raid_presuspend, + .presuspend_undo = raid_presuspend_undo, .postsuspend = raid_postsuspend, .preresume = raid_preresume, .resume = raid_resume,
drivers/md/md.c +22 -2
@@ -366,7 +366,7 @@ static bool is_suspended(struct mddev *mddev, struct bio *bio)return true; } -void md_handle_request (struct mddev *mddev,struct bio *bio) +bool md_handle_request (struct mddev *mddev,struct bio *bio) { check_suspended:if (is_suspended (mddev, bio)) {
@@ -374,7 +374,7 @@ void md_handle_request(struct mddev *mddev, struct bio *bio)/* Bail out if REQ_NOWAIT is set for the bio */ if (bio->bi_opf &REQ_NOWAIT ) {bio_wouldblock_error (bio); -return ; +return true; }for (;;) { prepare_to_wait(&mddev->sb_wait, &__wait,
@@ -390,10 +390,13 @@ void md_handle_request(struct mddev *mddev, struct bio *bio)if (!mddev->pers->make_request (mddev, bio)) {percpu_ref_put (&mddev->active_io); +if (!mddev->gendisk && mddev->pers->prepare_suspend) +return false; goto check_suspended; }percpu_ref_put (&mddev->active_io); +return true; }EXPORT_SYMBOL (md_handle_request);
@@ -8765,6 +8768,23 @@ void md_account_bio(struct mddev *mddev, struct bio **bio) }EXPORT_SYMBOL_GPL (md_account_bio); +void md_free_cloned_bio (struct bio *bio) +{ +struct md_io_clone *md_io_clone = bio->bi_private; +struct bio *orig_bio = md_io_clone->orig_bio; +struct mddev *mddev = md_io_clone->mddev; + +if (bio->bi_status && !orig_bio->bi_status) + orig_bio->bi_status = bio->bi_status; + +if (md_io_clone->start_time) +bio_end_io_acct (orig_bio, md_io_clone->start_time); + +bio_put (bio); +percpu_ref_put (&mddev->active_io); +} +EXPORT_SYMBOL_GPL (md_free_cloned_bio); +/* md_allow_write(mddev) * Calling this ensures that the array is marked 'active' so that writes * may proceed without blocking. It is important to call this before
drivers/md/md.h +2 -1
@@ -783,6 +783,7 @@ extern void md_finish_reshape(struct mddev *mddev);void md_submit_discard_bio (struct mddev *mddev,struct md_rdev *rdev,struct bio *bio,sector_t start,sector_t size);void md_account_bio (struct mddev *mddev,struct bio **bio); +void md_free_cloned_bio (struct bio *bio);extern bool __must_check md_flush_request (struct mddev *mddev,struct bio *bio); extern void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
@@ -811,7 +812,7 @@ extern void md_stop_writes(struct mddev *mddev);extern int md_rdev_init (struct md_rdev *rdev);extern void md_rdev_clear (struct md_rdev *rdev); -extern void md_handle_request (struct mddev *mddev,struct bio *bio); +extern bool md_handle_request (struct mddev *mddev,struct bio *bio);extern int mddev_suspend (struct mddev *mddev,bool interruptible);extern void mddev_resume (struct mddev *mddev);extern void md_idle_sync_thread (struct mddev *mddev);
drivers/md/raid5.c +30 -2
@@ -761,6 +761,7 @@ enum stripe_result {STRIPE_RETRY ,STRIPE_SCHEDULE_AND_RETRY ,STRIPE_FAIL , + STRIPE_WAIT_RESHAPE, }; struct stripe_request_ctx {
@@ -5947,7 +5948,8 @@ static enum stripe_result make_stripe_request(struct mddev *mddev,if (ahead_of_reshape (mddev, logical_sector, conf->reshape_safe)) {spin_unlock_irq (&conf->device_lock); -return STRIPE_SCHEDULE_AND_RETRY ; + ret =STRIPE_SCHEDULE_AND_RETRY ; + goto out; } }spin_unlock_irq (&conf->device_lock);
@@ -6026,6 +6028,12 @@ static enum stripe_result make_stripe_request(struct mddev *mddev, out_release:raid5_release_stripe (sh); +out: +if (ret ==STRIPE_SCHEDULE_AND_RETRY &&reshape_interrupted (mddev)) { + bi->bi_status =BLK_STS_RESOURCE ; + ret =STRIPE_WAIT_RESHAPE ; +pr_err_ratelimited ("dm-raid456: io across reshape position while reshape can't make progress" ); + }return ret; }
@@ -6147,7 +6155,7 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)while (1 ) { res =make_stripe_request (mddev, conf, &ctx, logical_sector, bi); -if (res ==STRIPE_FAIL ) +if (res ==STRIPE_FAIL || res ==STRIPE_WAIT_RESHAPE )break ;if (res ==STRIPE_RETRY )
@@ -6185,6 +6193,11 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi)if (rw ==WRITE )md_write_end (mddev); +if (res ==STRIPE_WAIT_RESHAPE ) { +md_free_cloned_bio (bi); +return false; + } +bio_endio (bi);return true; }
@@ -8923,6 +8936,18 @@ static int raid5_start(struct mddev *mddev)return r5l_start (conf->log); } +/* +* This is only used for dm-raid456, caller already frozen sync_thread, hence +* if rehsape is still in progress, io that is waiting for reshape can never be +* done now, hence wake up and handle those IO. +*/ +static void raid5_prepare_suspend (struct mddev *mddev) +{ +struct r5conf *conf = mddev->private; + +wake_up (&conf->wait_for_overlap); +} +static struct md_personality raid6_personality = { .name ="raid6" ,
@@ -8946,6 +8971,7 @@ static struct md_personality raid6_personality = .quiesce = raid5_quiesce, .takeover = raid6_takeover, .change_consistency_policy = raid5_change_consistency_policy, + .prepare_suspend = raid5_prepare_suspend, };static struct md_personality raid5_personality = {
@@ -8970,6 +8996,7 @@ static struct md_personality raid5_personality = .quiesce = raid5_quiesce, .takeover = raid5_takeover, .change_consistency_policy = raid5_change_consistency_policy, + .prepare_suspend = raid5_prepare_suspend, }; static struct md_personality raid4_personality =
@@ -8995,6 +9022,7 @@ static struct md_personality raid4_personality = .quiesce = raid5_quiesce, .takeover = raid4_takeover, .change_consistency_policy = raid5_change_consistency_policy, + .prepare_suspend = raid5_prepare_suspend, };static int __init raid5_init (void )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 112/399 dm-raid: fix lockdep waring in "pers->hot_add_disk"
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Kuai <[email protected]>
[ Upstream commit 95009ae904b1e9dca8db6f649f2d7c18a6e42c75 ]
The lockdep assert is added by commit a448af25becf ("md/raid10: remove rcu protection to access rdev from conf") in print_conf(). And I didn't notice that dm-raid is calling "pers->hot_add_disk" without holding 'reconfig_mutex'.
"pers->hot_add_disk" read and write many fields that is protected by 'reconfig_mutex', and raid_resume() already grab the lock in other contex. Hence fix this problem by protecting "pers->host_add_disk" with the lock.
--- drivers/md/dm-raid.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/dm-raid.c +2 -0
@@ -4091,7 +4091,9 @@ static void raid_resume(struct dm_target *ti)* Take this opportunity to check whether any failed * devices are reachable again. */ +mddev_lock_nointr (mddev);attempt_restore_of_faulty_devices (rs); +mddev_unlock (mddev); }if (test_and_clear_bit (RT_FLAG_RS_SUSPENDED , &rs->runtime_flags)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 113/399 powerpc: xor_vmx: Add -mhard-float to CFLAGS
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
[ Upstream commit 35f20786c481d5ced9283ff42de5c69b65e5ed13 ]
arch/powerpc/lib/xor_vmx.o is built with '-msoft-float' (from the main powerpc Makefile) and '-maltivec' (from its CFLAGS), which causes an error when building with clang after a recent change in main:
error: option '-msoft-float' cannot be specified with '-maltivec' make[6]: *** [scripts/Makefile.build:243: arch/powerpc/lib/xor_vmx.o] Error 1
Explicitly add '-mhard-float' before '-maltivec' in xor_vmx.o's CFLAGS to override the previous inclusion of '-msoft-float' (as the last option wins), which matches how other areas of the kernel use '-maltivec', such as AMDGPU.
--- arch/powerpc/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/lib/Makefile +1 -1
@@ -76,7 +76,7 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o -CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec) +CFLAGS_xor_vmx.o += -mhard-float -maltivec $(call cc-option,-mabi=altivec) # Enable <altivec.h> CFLAGS_xor_vmx.o += -isystem $(shell $(CC) -print-file-name=include)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 114/399 block: Fix page refcounts for unaligned buffers in __bio_release_pages()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Battersby <[email protected]>
[ Upstream commit 38b43539d64b2fa020b3b9a752a986769f87f7a6 ]
Fix an incorrect number of pages being released for buffers that do not start at the beginning of a page.
--- block/bio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
block/bio.c +4 -3
@@ -1152,7 +1152,7 @@ void __bio_release_pages(struct bio *bio, bool mark_dirty)bio_for_each_folio_all (fi, bio) {struct page *page; -size_t done =0 ; +size_t nr_pages;if (mark_dirty) {folio_lock (fi.folio);
@@ -1160,10 +1160,11 @@ void __bio_release_pages(struct bio *bio, bool mark_dirty)folio_unlock (fi.folio); } page =folio_page (fi.folio, fi.offset /PAGE_SIZE ); + nr_pages = (fi.offset + fi.length -1 ) /PAGE_SIZE - + fi.offset /PAGE_SIZE +1 ;do {bio_release_page (bio, page++); - done +=PAGE_SIZE ; - }while (done < fi.length); + }while (--nr_pages !=0 ); } }EXPORT_SYMBOL_GPL (__bio_release_pages);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 115/399 mac802154: fix llsec key resources release in mac802154_llsec_key_del
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
[ Upstream commit e8a1e58345cf40b7b272e08ac7b32328b2543e40 ]
mac802154_llsec_key_del() can free resources of a key directly without following the RCU rules for waiting before the end of a grace period. This may lead to use-after-free in case llsec_lookup_key() is traversing the list of keys in parallel with a key deletion:
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 4 PID: 16000 at lib/refcount.c:25 refcount_warn_saturate+0x162/0x2a0 Modules linked in: CPU: 4 PID: 16000 Comm: wpan-ping Not tainted 6.7.0 #19 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:refcount_warn_saturate+0x162/0x2a0 Call Trace: <TASK> llsec_lookup_key.isra.0+0x890/0x9e0 mac802154_llsec_encrypt+0x30c/0x9c0 ieee802154_subif_start_xmit+0x24/0x1e0 dev_hard_start_xmit+0x13e/0x690 sch_direct_xmit+0x2ae/0xbc0 __dev_queue_xmit+0x11dd/0x3c20 dgram_sendmsg+0x90b/0xd60 __sys_sendto+0x466/0x4c0 __x64_sys_sendto+0xe0/0x1c0 do_syscall_64+0x45/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76
Also, ieee802154_llsec_key_entry structures are not freed by mac802154_llsec_key_del():
unreferenced object 0xffff8880613b6980 (size 64):
comm "iwpan", pid 2176, jiffies 4294761134 (age 60.475s) hex dump (first 32 bytes):
78 0d 8f 18 80 88 ff ff 22 01 00 00 00 00 ad de x.......".......
00 00 00 00 00 00 00 00 03 00 cd ab 00 00 00 00 ................
backtrace:
[<ffffffff81dcfa62>] __kmem_cache_alloc_node+0x1e2/0x2d0
[<ffffffff81c43865>] kmalloc_trace+0x25/0xc0
[<ffffffff88968b09>] mac802154_llsec_key_add+0xac9/0xcf0
[<ffffffff8896e41a>] ieee802154_add_llsec_key+0x5a/0x80
[<ffffffff8892adc6>] nl802154_add_llsec_key+0x426/0x5b0
[<ffffffff86ff293e>] genl_family_rcv_msg_doit+0x1fe/0x2f0
[<ffffffff86ff46d1>] genl_rcv_msg+0x531/0x7d0
[<ffffffff86fee7a9>] netlink_rcv_skb+0x169/0x440
[<ffffffff86ff1d88>] genl_rcv+0x28/0x40
[<ffffffff86fec15c>] netlink_unicast+0x53c/0x820
[<ffffffff86fecd8b>] netlink_sendmsg+0x93b/0xe60
[<ffffffff86b91b35>] ____sys_sendmsg+0xac5/0xca0
[<ffffffff86b9c3dd>] ___sys_sendmsg+0x11d/0x1c0
[<ffffffff86b9c65a>] __sys_sendmsg+0xfa/0x1d0
[<ffffffff88eadbf5>] do_syscall_64+0x45/0xf0
[<ffffffff890000ea>] entry_SYSCALL_64_after_hwframe+0x6e/0x76Handle the proper resource release in the RCU callback function mac802154_llsec_key_del_rcu().
Note that if llsec_lookup_key() finds a key, it gets a refcount via llsec_key_get() and locally copies key id from key_entry (which is a list element). So it's safe to call llsec_key_put() and free the list entry after the RCU grace period elapses.
Found by Linux Verification Center (linuxtesting.org).
Message-ID: <[email protected]>
--- include/net/cfg802154.h | 1 + net/mac802154/llsec.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-)
include/net/cfg802154.h +1 -0
@@ -401,6 +401,7 @@ struct ieee802154_llsec_key {struct ieee802154_llsec_key_entry {struct list_head list; +struct rcu_head rcu;struct ieee802154_llsec_key_id id;struct ieee802154_llsec_key *key;
net/mac802154/llsec.c +13 -5
@@ -265,19 +265,27 @@ int mac802154_llsec_key_add(struct mac802154_llsec *sec,return -ENOMEM ; } +static void mac802154_llsec_key_del_rcu (struct rcu_head *rcu) +{ +struct ieee802154_llsec_key_entry *pos; +struct mac802154_llsec_key *mkey; + + pos = container_of(rcu, struct ieee802154_llsec_key_entry, rcu); + mkey = container_of(pos->key, struct mac802154_llsec_key, key); + +llsec_key_put (mkey); +kfree_sensitive (pos); +} +int mac802154_llsec_key_del (struct mac802154_llsec *sec,const struct ieee802154_llsec_key_id *key) {struct ieee802154_llsec_key_entry *pos;list_for_each_entry (pos, &sec->table.keys, list) { -struct mac802154_llsec_key *mkey; - - mkey = container_of(pos->key, struct mac802154_llsec_key, key); -if (llsec_key_id_equal (&pos->id, key)) {list_del_rcu (&pos->list); -llsec_key_put (mkey); +call_rcu (&pos->rcu, mac802154_llsec_key_del_rcu);return 0 ; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 116/399 mm: swap: fix race between free_swap_and_cache() and swapoff()
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ryan Roberts <[email protected]>
[ Upstream commit 82b1c07a0af603e3c47b906c8e991dc96f01688e ]
There was previously a theoretical window where swapoff() could run and teardown a swap_info_struct while a call to free_swap_and_cache() was running in another thread. This could cause, amongst other bad possibilities, swap_page_trans_huge_swapped() (called by free_swap_and_cache()) to access the freed memory for swap_map.
This is a theoretical problem and I haven't been able to provoke it from a test case. But there has been agreement based on code review that this is possible (see link below).
Fix it by using get_swap_device()/put_swap_device(), which will stall swapoff(). There was an extra check in _swap_info_get() to confirm that the swap entry was not free. This isn't present in get_swap_device() because it doesn't make sense in general due to the race between getting the reference and swapoff. So I've added an equivalent check directly in free_swap_and_cache().
Details of how to provoke one possible issue (thanks to David Hildenbrand for deriving this):
--8<-----
__swap_entry_free() might be the last user and result in "count == SWAP_HAS_CACHE".
swapoff->try_to_unuse() will stop as soon as soon as si->inuse_pages==0.
So the question is: could someone reclaim the folio and turn si->inuse_pages==0, before we completed swap_page_trans_huge_swapped().
Imagine the following: 2 MiB folio in the swapcache. Only 2 subpages are still references by swap entries.
Process 1 still references subpage 0 via swap entry. Process 2 still references subpage 1 via swap entry.
Process 1 quits. Calls free_swap_and_cache().
-> count == SWAP_HAS_CACHE
[then, preempted in the hypervisor etc.]
Process 2 quits. Calls free_swap_and_cache().
-> count == SWAP_HAS_CACHE
Process 2 goes ahead, passes swap_page_trans_huge_swapped(), and calls __try_to_reclaim_swap().
__try_to_reclaim_swap()->folio_free_swap()->delete_from_swap_cache()-> put_swap_folio()->free_swap_slot()->swapcache_free_entries()-> swap_entry_free()->swap_range_free()->
...WRITE_ONCE(si->inuse_pages, si->inuse_pages - nr_entries);
What stops swapoff to succeed after process 2 reclaimed the swap cache but before process1 finished its call to swap_page_trans_huge_swapped()?
--8<-----
--- mm/swapfile.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
mm/swapfile.c +12 -1
@@ -1227,6 +1227,11 @@ static unsigned char __swap_entry_free_locked(struct swap_info_struct *p,* with get_swap_device() and put_swap_device(), unless the swap * functions call get/put_swap_device() by themselves. * +* Note that when only holding the PTL, swapoff might succeed immediately +* after freeing a swap entry. Therefore, immediately after +* __swap_entry_free(), the swap info might become stale and should not +* be touched without a prior get_swap_device(). +* * Check whether swap entry is valid in the swap device. If so, * return pointer to swap_info_struct, and keep the swap entry valid * via preventing the swap device from being swapoff, until
@@ -1604,13 +1609,19 @@ int free_swap_and_cache(swp_entry_t entry)if (non_swap_entry (entry))return 1 ; - p =_swap_info_get (entry); + p =get_swap_device (entry);if (p) { +if (WARN_ON (data_race (!p->swap_map[swp_offset (entry)]))) { +put_swap_device (p); +return 0 ; + } + count =__swap_entry_free (p, entry);if (count ==SWAP_HAS_CACHE && !swap_page_trans_huge_swapped (p, entry))__try_to_reclaim_swap (p,swp_offset (entry),TTRS_UNMAPPED |TTRS_FULL ); +put_swap_device (p); }return p !=NULL ; }
Signature · 1 line
2.43.0
Re: [PATCH 6.8 116/399] mm: swap: fix race between free_swap_and_cache() and swapoff()
Quoted 1 line · Greg Kroah-Hartman
6.8-stable review patch. If anyone has any objections, please let me know.
LGTM!
Quoted 114 lines
------------------
From: Ryan Roberts <[email protected]>
[ Upstream commit
82b1c07a0af603e3c47b906c8e991dc96f01688e]There was previously a theoretical window where
swapoff()could run and teardown aswap_info_structwhile a call tofree_swap_and_cache()was running in another thread. This could cause, amongst other bad possibilities,swap_page_trans_huge_swapped()(called byfree_swap_and_cache()) to access the freed memory forswap_map.This is a theoretical problem and I haven't been able to provoke it from a test case. But there has been agreement based on code review that this is possible (see link below).
Fix it by using get_swap_device()/put_swap_device(), which will stall
swapoff(). There was an extra check in_swap_info_get()to confirm that the swap entry was not free. This isn't present inget_swap_device()because it doesn't make sense in general due to the race between getting the reference and swapoff. So I've added an equivalent check directly infree_swap_and_cache().Details of how to provoke one possible issue (thanks to David Hildenbrand for deriving this):
--8<-----
__swap_entry_free()might be the last user and result in "count ==SWAP_HAS_CACHE".
swapoff->try_to_unuse()will stop as soon as soon as si->inuse_pages==0.So the question is: could someone reclaim the folio and turn si->inuse_pages==0, before we completed
swap_page_trans_huge_swapped().Imagine the following: 2 MiB folio in the swapcache. Only 2 subpages are still references by swap entries.
Process 1 still references subpage 0 via swap entry. Process 2 still references subpage 1 via swap entry.
Process 1 quits. Calls
free_swap_and_cache().
-> count ==SWAP_HAS_CACHE
[then, preempted in the hypervisor etc.]Process 2 quits. Calls
free_swap_and_cache().
-> count ==SWAP_HAS_CACHEProcess 2 goes ahead, passes
swap_page_trans_huge_swapped(), and calls__try_to_reclaim_swap().__try_to_reclaim_swap()->folio_free_swap()->delete_from_swap_cache()-> put_swap_folio()->free_swap_slot()->swapcache_free_entries()-> swap_entry_free()->swap_range_free()->
...WRITE_ONCE(si->inuse_pages, si->inuse_pages - nr_entries);What stops swapoff to succeed after process 2 reclaimed the swap cache but before process1 finished its call to
swap_page_trans_huge_swapped()?--8<-----
Fixes 7c00bafee87c ("mm/swap: free swap slots in batch")Signed-off-by Ryan Roberts <[email protected]>Cc David Hildenbrand <[email protected]>Cc "Huang, Ying" <[email protected]>Cc <[email protected]>Signed-off-by Andrew Morton <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- mm/swapfile.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)mm/swapfile.c +12
-1@@ -1227,6 +1227,11 @@ static unsigned char __swap_entry_free_locked(struct swap_info_struct *p,* with get_swap_device() and put_swap_device(), unless the swap * functions call get/put_swap_device() by themselves. * +* Note that when only holding the PTL, swapoff might succeed immediately +* after freeing a swap entry. Therefore, immediately after +* __swap_entry_free(), the swap info might become stale and should not +* be touched without a prior get_swap_device(). +* * Check whether swap entry is valid in the swap device. If so, * return pointer to swap_info_struct, and keep the swap entry valid * via preventing the swap device from being swapoff, until @@ -1604,13 +1609,19 @@ int free_swap_and_cache(swp_entry_t entry)if (non_swap_entry (entry))return 1 ; - p =_swap_info_get (entry); + p =get_swap_device (entry);if (p) { +if (WARN_ON (data_race (!p->swap_map[swp_offset (entry)]))) { +put_swap_device (p); +return 0 ; + } + count =__swap_entry_free (p, entry);if (count ==SWAP_HAS_CACHE && !swap_page_trans_huge_swapped (p, entry))__try_to_reclaim_swap (p,swp_offset (entry),TTRS_UNMAPPED |TTRS_FULL ); +put_swap_device (p); }return p !=NULL ; }
Greg Kroah-Hartman
maintainerPATCH 117/399 mmc: core: Fix switch on gp3 partition
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dominique Martinet <[email protected]>
[ Upstream commit 4af59a8df5ea930038cd3355e822f5eedf4accc1 ]
Commit e7794c14fd73 ("mmc: rpmb: fixes pause retune on all RPMB partitions.") added a mask check for 'part_type', but the mask used was wrong leading to the code intended for rpmb also being executed for GP3.
On some MMCs (but not all) this would make gp3 partition inaccessible:
armadillo:~# head -c 1 < /dev/mmcblk2gp3 head: standard input: I/O error armadillo:~# dmesg -c [ 422.976583] mmc2: running CQE recovery [ 423.058182] mmc2: running CQE recovery [ 423.137607] mmc2: running CQE recovery [ 423.137802] blk_update_request: I/O error, dev mmcblk2gp3, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0 [ 423.237125] mmc2: running CQE recovery [ 423.318206] mmc2: running CQE recovery [ 423.397680] mmc2: running CQE recovery [ 423.397837] blk_update_request: I/O error, dev mmcblk2gp3, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 [ 423.408287] Buffer I/O error on dev mmcblk2gp3, logical block 0, async page read
the part_type values of interest here are defined as follow:
main 0
boot0 1
boot1 2
rpmb 3 gp0 4 gp1 5 gp2 6 gp3 7
so mask with EXT_CSD_PART_CONFIG_ACC_MASK (7) to correctly identify rpmb
--- drivers/mmc/core/block.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/mmc/core/block.c +6 -4
@@ -874,10 +874,11 @@ static const struct block_device_operations mmc_bdops = {static int mmc_blk_part_switch_pre (struct mmc_card *card,unsigned int part_type) { -const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_RPMB ; +const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_MASK ; +const unsigned int rpmb =EXT_CSD_PART_CONFIG_ACC_RPMB ;int ret =0 ; -if ((part_type & mask) == mask) { +if ((part_type & mask) == rpmb) {if (card->ext_csd.cmdq_en) { ret =mmc_cmdq_disable (card);if (ret)
@@ -892,10 +893,11 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,static int mmc_blk_part_switch_post (struct mmc_card *card,unsigned int part_type) { -const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_RPMB ; +const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_MASK ; +const unsigned int rpmb =EXT_CSD_PART_CONFIG_ACC_RPMB ;int ret =0 ; -if ((part_type & mask) == mask) { +if ((part_type & mask) == rpmb) {mmc_retune_unpause (card->host);if (card->reenable_cmdq && !card->ext_csd.cmdq_en) ret =mmc_cmdq_enable (card);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 118/399 Bluetooth: btnxpuart: Fix btnxpuart_close
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcel Ziswiler <[email protected]>
[ Upstream commit 664130c0b0309b360bc5bdd40a30604a9387bde8 ]
Fix scheduling while atomic BUG in btnxpuart_close(), properly purge the transmit queue and free the receive skb.
[ 10.973809] BUG: scheduling while atomic: kworker/u9:0/80/0x00000002 ... [ 10.980740] CPU: 3 PID: 80 Comm: kworker/u9:0 Not tainted 6.8.0-rc7-0.0.0-devel-00005-g61fdfceacf09 #1 [ 10.980751] Hardware name: Toradex Verdin AM62 WB on Dahlia Board (DT) [ 10.980760] Workqueue: hci0 hci_power_off [bluetooth] [ 10.981169] Call trace: ... [ 10.981363] uart_update_mctrl+0x58/0x78 [ 10.981373] uart_dtr_rts+0x104/0x114 [ 10.981381] tty_port_shutdown+0xd4/0xdc [ 10.981396] tty_port_close+0x40/0xbc [ 10.981407] uart_close+0x34/0x9c [ 10.981414] ttyport_close+0x50/0x94 [ 10.981430] serdev_device_close+0x40/0x50 [ 10.981442] btnxpuart_close+0x24/0x98 [btnxpuart] [ 10.981469] hci_dev_close_sync+0x2d8/0x718 [bluetooth] [ 10.981728] hci_dev_do_close+0x2c/0x70 [bluetooth] [ 10.981862] hci_power_off+0x20/0x64 [bluetooth]
--- drivers/bluetooth/btnxpuart.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/btnxpuart.c +3 -0
@@ -1234,6 +1234,9 @@ static int btnxpuart_close(struct hci_dev *hdev)ps_wakeup (nxpdev);serdev_device_close (nxpdev->serdev); +skb_queue_purge (&nxpdev->txq); +kfree_skb (nxpdev->rx_skb); + nxpdev->rx_skb =NULL ;clear_bit (BTNXPUART_SERDEV_OPEN , &nxpdev->tx_state);return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 119/399 leds: trigger: netdev: Fix kernel panic on interface rename trig notify
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Marangi <[email protected]>
[ Upstream commit 415798bc07dd1c1ae3a656aa026580816e0b9fe8 ]
Commit d5e01266e7f5 ("leds: trigger: netdev: add additional specific link speed mode") in the various changes, reworked the way to set the LINKUP mode in commit cee4bd16c319 ("leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename") and moved it to a generic function.
This changed the logic where, in the previous implementation the dev from the trigger event was used to check if the carrier was ok, but in the new implementation with the generic function, the dev in trigger_data is used instead.
This is problematic and cause a possible kernel panic due to the fact that the dev in the trigger_data still reference the old one as the new one (passed from the trigger event) still has to be hold and saved in the trigger_data struct (done in the NETDEV_REGISTER case).
On calling of get_device_state(), an invalid net_dev is used and this cause a kernel panic.
To handle this correctly, move the call to get_device_state() after the new net_dev is correctly set in trigger_data (in the NETDEV_REGISTER case) and correctly parse the new dev.
--- drivers/leds/trigger/ledtrig-netdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/leds/trigger/ledtrig-netdev.c +2 -2
@@ -504,12 +504,12 @@ static int netdev_trig_notify(struct notifier_block *nb, trigger_data->duplex =DUPLEX_UNKNOWN ;switch (evt) {case NETDEV_CHANGENAME : -get_device_state (trigger_data); - fallthrough;case NETDEV_REGISTER :dev_put (trigger_data->net_dev);dev_hold (dev); trigger_data->net_dev = dev; +if (evt ==NETDEV_CHANGENAME ) +get_device_state (trigger_data);break ;case NETDEV_UNREGISTER :dev_put (trigger_data->net_dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 120/399 drm/etnaviv: Restore some id values
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Gmeiner <[email protected]>
[ Upstream commit b735ee173f84d5d0d0733c53946a83c12d770d05 ]
The hwdb selection logic as a feature that allows it to mark some fields as 'don't care'. If we match with such a field we memcpy(..) the current etnaviv_chip_identity into ident.
This step can overwrite some id values read from the GPU with the 'don't care' value.
Fix this issue by restoring the affected values after the memcpy(..).
As this is crucial for user space to know when this feature works as expected increment the minor version too.
--- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_hwdb.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/etnaviv/etnaviv_drv.c +1 -1
@@ -494,7 +494,7 @@ static const struct drm_driver etnaviv_drm_driver = { .desc = "etnaviv DRM", .date = "20151214", .major = 1, - .minor = 3, + .minor = 4, };/*
drivers/gpu/drm/etnaviv/etnaviv_hwdb.c +9 -0
@@ -265,6 +265,9 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = {bool etnaviv_fill_identity_from_hwdb (struct etnaviv_gpu *gpu) {struct etnaviv_chip_identity *ident = &gpu->identity; +const u32 product_id = ident->product_id; +const u32 customer_id = ident->customer_id; +const u32 eco_id = ident->eco_id;int i;for (i =0 ; i <ARRAY_SIZE (etnaviv_chip_identities); i++) {
@@ -278,6 +281,12 @@ bool etnaviv_fill_identity_from_hwdb(struct etnaviv_gpu *gpu) etnaviv_chip_identities[i].eco_id == ~0U)) {memcpy (ident, &etnaviv_chip_identities[i],sizeof (*ident)); + +/* Restore some id values as ~0U aka 'don't care' might been used. */ + ident->product_id = product_id; + ident->customer_id = customer_id; + ident->eco_id = eco_id; +return true; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 121/399 landlock: Warn once if a Landlock action is requested while disabled
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mickaël Salaün <[email protected]>
[ Upstream commit 782191c74875cc33b50263e21d76080b1411884d ]
Because sandboxing can be used as an opportunistic security measure, user space may not log unsupported features. Let the system administrator know if an application tries to use Landlock but failed because it isn't enabled at boot time. This may be caused by boot loader configurations with outdated "lsm" kernel's command-line parameter.
--- security/landlock/syscalls.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
security/landlock/syscalls.c +15 -3
@@ -33,6 +33,18 @@#include "ruleset.h" #include "setup.h" +static bool is_initialized (void ) +{ +if (likely (landlock_initialized)) +return true; + +pr_warn_once ( +"Disabled but requested by user space. " +"You should enable Landlock at boot time: " +"https://docs.kernel.org/userspace-api/landlock.html#boot-time-configuration\n" ); +return false; +} +/** * copy_min_struct_from_user - Safe future-proof argument copying *
@@ -173,7 +185,7 @@ SYSCALL_DEFINE3(landlock_create_ruleset,/* Build-time checks. */ build_check_abi (); -if (!landlock_initialized) +if (!is_initialized ())return -EOPNOTSUPP ;if (flags) {
@@ -398,7 +410,7 @@ SYSCALL_DEFINE4(landlock_add_rule, const int, ruleset_fd,struct landlock_ruleset *ruleset;int err; -if (!landlock_initialized) +if (!is_initialized ())return -EOPNOTSUPP ;/* No flag for now. */
@@ -458,7 +470,7 @@ SYSCALL_DEFINE2(landlock_restrict_self, const int, ruleset_fd, const __u32,struct landlock_cred_security *new_llcred;int err; -if (!landlock_initialized) +if (!is_initialized ())return -EOPNOTSUPP ;/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 122/399 io_uring: fix mshot read defer taskrun cqe posting
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
[ Upstream commit 70581dcd0601a09f134f23268e3374e15d736824 ]
We can't post CQEs from io-wq with DEFER_TASKRUN set, normal completions are handled but aux should be explicitly disallowed by opcode handlers.
--- io_uring/rw.c | 2 ++ 1 file changed, 2 insertions(+)
io_uring/rw.c +2 -0
@@ -932,6 +932,8 @@ int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags)*/ if (!file_can_poll (req->file))return -EBADFD ; +if (issue_flags &IO_URING_F_IOWQ ) +return -EAGAIN ; ret =__io_read (req, issue_flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 123/399 hwmon: (amc6821) add of_match table
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josua Mayer <[email protected]>
[ Upstream commit 3f003fda98a7a8d5f399057d92e6ed56b468657c ]
Add of_match table for "ti,amc6821" compatible string.
This fixes automatic driver loading by userspace when using device-tree, and if built as a module like major linux distributions do.
While devices probe just fine with i2c_device_id table, userspace can't match the "ti,amc6821" compatible string from dt with the plain "amc6821" device id. As a result, the kernel module can not be loaded.
--- drivers/hwmon/amc6821.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/hwmon/amc6821.c +11 -0
@@ -934,10 +934,21 @@ static const struct i2c_device_id amc6821_id[] = {MODULE_DEVICE_TABLE (i2c, amc6821_id); +static const struct of_device_id __maybe_unused amc6821_of_match[] = { + { + .compatible ="ti,amc6821" , + .data = (void *)amc6821, + }, + { } +}; + +MODULE_DEVICE_TABLE (of, amc6821_of_match); +static struct i2c_driver amc6821_driver = { .class =I2C_CLASS_HWMON , .driver = { .name ="amc6821" , + .of_match_table =of_match_ptr (amc6821_of_match), }, .probe = amc6821_probe, .id_table = amc6821_id,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 124/399 io_uring: fix io_queue_proc modifying req->flags
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
[ Upstream commit 1a8ec63b2b6c91caec87d4e132b1f71b5df342be ]
With multiple poll entries __io_queue_proc() might be running in parallel with poll handlers and possibly task_work, we should not be carelessly modifying req->flags there. io_poll_double_prepare() handles a similar case with locking but it's much easier to move it into __io_arm_poll_handler().
--- io_uring/poll.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
io_uring/poll.c +11 -8
@@ -539,14 +539,6 @@ static void __io_queue_proc(struct io_poll *poll, struct io_poll_table *pt, poll->wait.private = (void *) wqe_private;if (poll->events &EPOLLEXCLUSIVE ) { -/* -* Exclusive waits may only wake a limited amount of entries -* rather than all of them, this may interfere with lazy -* wake if someone does wait(events > 1). Ensure we don't do -* lazy wake for those, as we need to process each one as they -* come in. -*/ - req->flags |=REQ_F_POLL_NO_LAZY ;add_wait_queue_exclusive (head, &poll->wait); }else {add_wait_queue (head, &poll->wait);
@@ -618,6 +610,17 @@ static int __io_arm_poll_handler(struct io_kiocb *req,if (issue_flags &IO_URING_F_UNLOCKED ) req->flags &= ~REQ_F_HASH_LOCKED ; + +/* +* Exclusive waits may only wake a limited amount of entries +* rather than all of them, this may interfere with lazy +* wake if someone does wait(events > 1). Ensure we don't do +* lazy wake for those, as we need to process each one as they +* come in. +*/ +if (poll->events &EPOLLEXCLUSIVE ) + req->flags |=REQ_F_POLL_NO_LAZY ; + mask =vfs_poll (req->file, &ipt->pt) & poll->events;if (unlikely (ipt->error || !ipt->nr_entries)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 125/399 ext4: fix corruption during on-line resize
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maximilian Heyne <[email protected]>
[ Upstream commit a6b3bfe176e8a5b05ec4447404e412c2a3fc92cc ]
We observed a corruption during on-line resize of a file system that is larger than 16 TiB with 4k block size. With having more then 2^32 blocks resize_inode is turned off by default by mke2fs. The issue can be reproduced on a smaller file system for convenience by explicitly turning off resize_inode. An on-line resize across an 8 GiB boundary (the size of a meta block group in this setup) then leads to a corruption:
dev=/dev/<some_dev> # should be >= 16 GiB mkdir -p /corruption /sbin/mke2fs -t ext4 -b 4096 -O ^resize_inode $dev $((2 * 2**21 - 2**15)) mount -t ext4 $dev /corruption dd if=/dev/zero bs=4096 of=/corruption/test count=$((2*2**21 - 4*2**15)) sha1sum /corruption/test # 79d2658b39dcfd77274e435b0934028adafaab11 /corruption/test /sbin/resize2fs $dev $((2*2**21)) # drop page cache to force reload the block from disk echo 1 > /proc/sys/vm/drop_caches
sha1sum /corruption/test
# 3c2abc63cbf1a94c9e6977e0fbd72cd832c4d5c3 /corruption/test
2^21 = 2^15*2^6 equals 8 GiB whereof 2^15 is the number of blocks per block group and 2^6 are the number of block groups that make a meta block group.
The last checksum might be different depending on how the file is laid out across the physical blocks. The actual corruption occurs at physical block 63*2^15 = 2064384 which would be the location of the backup of the meta block group's block descriptor. During the on-line resize the file system will be converted to meta_bg starting at s_first_meta_bg which is 2 in the example - meaning all block groups after 16 GiB. However, in ext4_flex_group_add we might add block groups that are not part of the first meta block group yet. In the reproducer we achieved this by substracting the size of a whole block group from the point where the meta block group would start. This must be considered when updating the backup block group descriptors to follow the non-meta_bg layout. The fix is to add a test whether the group to add is already part of the meta block group or not.
--- fs/ext4/resize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/resize.c +2 -1
@@ -1602,7 +1602,8 @@ static int ext4_flex_group_add(struct super_block *sb,int gdb_num = group /EXT4_DESC_PER_BLOCK (sb);int gdb_num_end = ((group + flex_gd->count -1 ) /EXT4_DESC_PER_BLOCK (sb)); -int meta_bg =ext4_has_feature_meta_bg (sb); +int meta_bg =ext4_has_feature_meta_bg (sb) && + gdb_num >=le32_to_cpu (es->s_first_meta_bg);sector_t padding_blocks = meta_bg ?0 : sbi->s_sbh->b_blocknr -ext4_group_first_block_no (sb,0 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 126/399 nvmem: meson-efuse: fix function pointer type mismatch
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jerome Brunet <[email protected]>
[ Upstream commit cbd38332c140829ab752ba4e727f98be5c257f18 ]
clang-16 warns about casting functions to incompatible types, as is done here to call clk_disable_unprepare:
drivers/nvmem/meson-efuse.c:78:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
78 | (void(*)(void *))clk_disable_unprepare,
The pattern of getting, enabling and setting a disable callback for a clock can be replaced with devm_clk_get_enabled(), which also fixes this warning.
--- drivers/nvmem/meson-efuse.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-)
drivers/nvmem/meson-efuse.c +3 -22
@@ -47,7 +47,6 @@ static int meson_efuse_probe(struct platform_device *pdev)struct nvmem_config *econfig;struct clk *clk;unsigned int size; -int ret; sm_np =of_parse_phandle (pdev->dev.of_node,"secure-monitor" ,0 );if (!sm_np) {
@@ -60,27 +59,9 @@ static int meson_efuse_probe(struct platform_device *pdev)if (!fw)return -EPROBE_DEFER ; - clk =devm_clk_get (dev,NULL ); -if (IS_ERR (clk)) { - ret =PTR_ERR (clk); -if (ret != -EPROBE_DEFER ) -dev_err (dev,"failed to get efuse gate" ); -return ret; - } - - ret =clk_prepare_enable (clk); -if (ret) { -dev_err (dev,"failed to enable gate" ); -return ret; - } - - ret =devm_add_action_or_reset (dev, - (void (*)(void *))clk_disable_unprepare, - clk); -if (ret) { -dev_err (dev,"failed to add disable callback" ); -return ret; - } + clk =devm_clk_get_enabled (dev,NULL ); +if (IS_ERR (clk)) +return dev_err_probe (dev,PTR_ERR (clk),"failed to get efuse gate" );if (meson_sm_call (fw,SM_EFUSE_USER_MAX , &size,0 ,0 ,0 ,0 ,0 ) <0 ) {dev_err (dev,"failed to get max user" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 127/399 slimbus: core: Remove usage of the deprecated ida_simple_xx() API
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 89ffa4cccec54467446f141a79b9e36893079fb8 ]
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove().
Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. So change this change allows one more device. Previously address 0xFE was never used.
--- drivers/slimbus/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/slimbus/core.c +2 -2
@@ -436,8 +436,8 @@ static int slim_device_alloc_laddr(struct slim_device *sbdev,if (ret <0 ) goto err; }else if (report_present) { - ret =ida_simple_get (&ctrl->laddr_ida, -0 ,SLIM_LA_MANAGER -1 ,GFP_KERNEL ); + ret =ida_alloc_max (&ctrl->laddr_ida, +SLIM_LA_MANAGER -1 ,GFP_KERNEL );if (ret <0 ) goto err;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 128/399 phy: tegra: xusb: Add API to retrieve the port number of phy
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Chang <[email protected]>
[ Upstream commit d843f031d9e90462253015bc0bd9e3852d206bf2 ]
This patch introduces a new API, tegra_xusb_padctl_get_port_number, to the Tegra XUSB Pad Controller driver. This API is used to identify the USB port that is associated with a given PHY.
The function takes a PHY pointer for either a USB2 PHY or USB3 PHY as input and returns the corresponding port number. If the PHY pointer is invalid, it returns -ENODEV.
--- drivers/phy/tegra/xusb.c | 13 +++++++++++++ include/linux/phy/tegra/xusb.h | 1 + 2 files changed, 14 insertions(+)
drivers/phy/tegra/xusb.c +13 -0
@@ -1531,6 +1531,19 @@ int tegra_xusb_padctl_get_usb3_companion(struct tegra_xusb_padctl *padctl, }EXPORT_SYMBOL_GPL (tegra_xusb_padctl_get_usb3_companion); +int tegra_xusb_padctl_get_port_number (struct phy *phy) +{ +struct tegra_xusb_lane *lane; + +if (!phy) +return -ENODEV ; + + lane =phy_get_drvdata (phy); + +return lane->index; +} +EXPORT_SYMBOL_GPL (tegra_xusb_padctl_get_port_number); +MODULE_AUTHOR ("Thierry Reding <[email protected]>" );MODULE_DESCRIPTION ("Tegra XUSB Pad Controller driver" );MODULE_LICENSE ("GPL v2" );
include/linux/phy/tegra/xusb.h +1 -0
@@ -26,6 +26,7 @@ void tegra_phy_xusb_utmi_pad_power_down(struct phy *phy);int tegra_phy_xusb_utmi_port_reset (struct phy *phy);int tegra_xusb_padctl_get_usb3_companion (struct tegra_xusb_padctl *padctl,unsigned int port); +int tegra_xusb_padctl_get_port_number (struct phy *phy);int tegra_xusb_padctl_enable_phy_sleepwalk (struct tegra_xusb_padctl *padctl,struct phy *phy,enum usb_device_speed speed);int tegra_xusb_padctl_disable_phy_sleepwalk (struct tegra_xusb_padctl *padctl,struct phy *phy);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 129/399 usb: gadget: tegra-xudc: Fix USB3 PHY retrieval logic
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Chang <[email protected]>
[ Upstream commit 84fa943d93c31ee978355e6c6c69592dae3c9f59 ]
This commit resolves an issue in the tegra-xudc USB gadget driver that incorrectly fetched USB3 PHY instances. The problem stemmed from the assumption of a one-to-one correspondence between USB2 and USB3 PHY names and their association with physical USB ports in the device tree.
Previously, the driver associated USB3 PHY names directly with the USB3 instance number, leading to mismatches when mapping the physical USB ports. For instance, if using USB3-1 PHY, the driver expect the corresponding PHY name as 'usb3-1'. However, the physical USB ports in the device tree were designated as USB2-0 and USB3-0 as we only have one device controller, causing a misalignment.
This commit rectifies the issue by adjusting the PHY naming logic. Now, the driver correctly correlates the USB2 and USB3 PHY instances, allowing the USB2-0 and USB3-1 PHYs to form a physical USB port pair while accurately reflecting their configuration in the device tree by naming them USB2-0 and USB3-0, respectively.
The change ensures that the PHY and PHY names align appropriately, resolving the mismatch between physical USB ports and their associated names in the device tree.
--- drivers/usb/gadget/udc/tegra-xudc.c | 39 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-)
drivers/usb/gadget/udc/tegra-xudc.c +25 -14
@@ -3491,8 +3491,8 @@ static void tegra_xudc_device_params_init(struct tegra_xudc *xudc)static int tegra_xudc_phy_get (struct tegra_xudc *xudc) { -int err =0 , usb3; -unsigned int i; +int err =0 , usb3_companion_port; +unsigned int i, j; xudc->utmi_phy =devm_kcalloc (xudc->dev, xudc->soc->num_phys,sizeof (*xudc->utmi_phy),GFP_KERNEL );
@@ -3520,7 +3520,7 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)if (IS_ERR (xudc->utmi_phy[i])) { err =PTR_ERR (xudc->utmi_phy[i]);dev_err_probe (xudc->dev, err, -"failed to get usb2-%d PHY\n" , i); +"failed to get PHY for phy-name usb2-%d\n" , i); goto clean_up; }else if (xudc->utmi_phy[i]) {/* Get usb-phy, if utmi phy is available */
@@ -3539,19 +3539,30 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc) }/* Get USB3 phy */ - usb3 =tegra_xusb_padctl_get_usb3_companion (xudc->padctl, i); -if (usb3 <0 ) + usb3_companion_port =tegra_xusb_padctl_get_usb3_companion (xudc->padctl, i); +if (usb3_companion_port <0 )continue ; -snprintf (phy_name,sizeof (phy_name),"usb3-%d" , usb3); - xudc->usb3_phy[i] =devm_phy_optional_get (xudc->dev, phy_name); -if (IS_ERR (xudc->usb3_phy[i])) { - err =PTR_ERR (xudc->usb3_phy[i]); -dev_err_probe (xudc->dev, err, -"failed to get usb3-%d PHY\n" , usb3); - goto clean_up; - }else if (xudc->usb3_phy[i]) -dev_dbg (xudc->dev,"usb3-%d PHY registered" , usb3); +for (j =0 ; j < xudc->soc->num_phys; j++) { +snprintf (phy_name,sizeof (phy_name),"usb3-%d" , j); + xudc->usb3_phy[i] =devm_phy_optional_get (xudc->dev, phy_name); +if (IS_ERR (xudc->usb3_phy[i])) { + err =PTR_ERR (xudc->usb3_phy[i]); +dev_err_probe (xudc->dev, err, +"failed to get PHY for phy-name usb3-%d\n" , j); + goto clean_up; + }else if (xudc->usb3_phy[i]) { +int usb2_port = +tegra_xusb_padctl_get_port_number (xudc->utmi_phy[i]); +int usb3_port = +tegra_xusb_padctl_get_port_number (xudc->usb3_phy[i]); +if (usb3_port == usb3_companion_port) { +dev_dbg (xudc->dev,"USB2 port %d is paired with USB3 port %d for device mode port %d\n" , + usb2_port, usb3_port, i); +break ; + } + } + } }return err;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 130/399 speakup: Fix 8bit characters from direct synth
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Thibault <[email protected]>
[ Upstream commit b6c8dafc9d86eb77e502bb018ec4105e8d2fbf78 ]
When userland echoes 8bit characters to /dev/synth with e.g.
echo -e '\xe9' > /dev/synth
synth_write would get characters beyond 0x7f, and thus negative when char is signed. When given to synth_buffer_add which takes a u16, this would sign-extend and produce a U+ffxy character rather than U+xy. Users thus get garbled text instead of accents in their output.
Let's fix this by making sure that we read unsigned characters.
--- drivers/accessibility/speakup/synth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/accessibility/speakup/synth.c +3 -1
@@ -208,8 +208,10 @@ void spk_do_flush(void)wake_up_process (speakup_task); } -void synth_write (const char *buf,size_t count) +void synth_write (const char *_buf,size_t count) { +const unsigned char *buf = (const unsigned char *) _buf; +while (count--)synth_buffer_add (*buf++);synth_start ();
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 131/399 debugfs: fix wait/cancellation handling during remove
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 952c3fce297f12c7ff59380adb66b564e2bc9b64 ]
Ben Greear further reports deadlocks during concurrent debugfs remove while files are being accessed, even though the code in question now uses debugfs cancellations. Turns out that despite all the review on the locking, we missed completely that the logic is wrong: if the refcount hits zero we can finish (and need not wait for the completion), but if it doesn't we have to trigger all the cancellations. As written, we can _never_ get into the loop triggering the cancellations. Fix this, and explain it better while at it.
--- fs/debugfs/inode.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
fs/debugfs/inode.c +20 -5
@@ -751,13 +751,28 @@ static void __debugfs_file_removed(struct dentry *dentry)if ((unsigned long )fsd &DEBUGFS_FSDATA_IS_REAL_FOPS_BIT )return ; -/* if we hit zero, just wait for all to finish */ -if (!refcount_dec_and_test (&fsd->active_users)) { -wait_for_completion (&fsd->active_users_drained); +/* if this was the last reference, we're done */ +if (refcount_dec_and_test (&fsd->active_users))return ; - } -/* if we didn't hit zero, try to cancel any we can */ +/* +* If there's still a reference, the code that obtained it can +* be in different states: +* - The common case of not using cancellations, or already +* after debugfs_leave_cancellation(), where we just need +* to wait for debugfs_file_put() which signals the completion; +* - inside a cancellation section, i.e. between +* debugfs_enter_cancellation() and debugfs_leave_cancellation(), +* in which case we need to trigger the ->cancel() function, +* and then wait for debugfs_file_put() just like in the +* previous case; +* - before debugfs_enter_cancellation() (but obviously after +* debugfs_file_get()), in which case we may not see the +* cancellation in the list on the first round of the loop, +* but debugfs_enter_cancellation() signals the completion +* after adding it, so this code gets woken up to call the +* ->cancel() function. +*/ while (refcount_read (&fsd->active_users)) {struct debugfs_cancellation *c;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 132/399 PCI/AER: Block runtime suspend when handling errors
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislaw Gruszka <[email protected]>
[ Upstream commit 002bf2fbc00e5c4b95fb167287e2ae7d1973281e ]
PM runtime can be done simultaneously with AER error handling. Avoid that by using pm_runtime_get_sync() before and pm_runtime_put() after reset in pcie_do_recovery() for all recovering devices.
pm_runtime_get_sync() will increase dev->power.usage_count counter to prevent any possible future request to runtime suspend a device. It will also resume a device, if it was previously in D3hot state.
I tested with igc device by doing simultaneous aer_inject and rpm suspend/resume via /sys/bus/pci/devices/PCI_ID/power/control and can reproduce:
igc 0000:02:00.0: not ready 65535ms after bus reset; giving up pcieport 0000:00:1c.2: AER: Root Port link has been reset (-25) pcieport 0000:00:1c.2: AER: subordinate device reset failed
pcieport 0000:00:1c.2: AER: device recovery failed
igc 0000:02:00.0: Unable to change power state from D3hot to D0, device inaccessible
The problem disappears when this patch is applied.
--- drivers/pci/pcie/err.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/pci/pcie/err.c +20 -0
@@ -13,6 +13,7 @@#define dev_fmt (fmt) "AER: " fmt#include <linux/pci.h> +#include <linux/pm_runtime.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h>
@@ -85,6 +86,18 @@ static int report_error_detected(struct pci_dev *dev,return 0 ; } +static int pci_pm_runtime_get_sync (struct pci_dev *pdev,void *data) +{ +pm_runtime_get_sync (&pdev->dev); +return 0 ; +} + +static int pci_pm_runtime_put (struct pci_dev *pdev,void *data) +{ +pm_runtime_put (&pdev->dev); +return 0 ; +} +static int report_frozen_detected (struct pci_dev *dev,void *data) {return report_error_detected (dev, pci_channel_io_frozen, data);
@@ -207,6 +220,8 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,else bridge =pci_upstream_bridge (dev); +pci_walk_bridge (bridge, pci_pm_runtime_get_sync,NULL ); +pci_dbg (bridge,"broadcast error_detected message\n" );if (state == pci_channel_io_frozen) {pci_walk_bridge (bridge, report_frozen_detected, &status);
@@ -251,10 +266,15 @@ pci_ers_result_t pcie_do_recovery(struct pci_dev *dev,pcie_clear_device_status (dev);pci_aer_clear_nonfatal_status (dev); } + +pci_walk_bridge (bridge, pci_pm_runtime_put,NULL ); +pci_info (bridge,"device recovery successful\n" );return status; failed: +pci_walk_bridge (bridge, pci_pm_runtime_put,NULL ); +pci_uevent_ers (bridge,PCI_ERS_RESULT_DISCONNECT );/* TODO: Should kernel panic here? */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 133/399 io_uring/net: correctly handle multishot recvmsg retry setup
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
[ Upstream commit deaef31bc1ec7966698a427da8c161930830e1cf ]
If we loop for multishot receive on the initial attempt, and then abort later on to wait for more, we miss a case where we should be copying the io_async_msghdr from the stack to stable storage. This leads to the next retry potentially failing, if the application had the msghdr on the stack.
--- io_uring/net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
io_uring/net.c +2 -1
@@ -915,7 +915,8 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)kfree (kmsg->free_iov);io_netmsg_recycle (req, issue_flags); req->flags &= ~REQ_F_NEED_CLEANUP ; - } + }else if (ret == -EAGAIN ) +return io_setup_async_msg (req, kmsg, issue_flags);return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 134/399 io_uring: fix mshot io-wq checks
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
[ Upstream commit 3a96378e22cc46c7c49b5911f6c8631527a133a9 ]
When checking for concurrent CQE posting, we're not only interested in requests running from the poll handler but also strayed requests ended up in normal io-wq execution. We're disallowing multishots in general from io-wq, not only when they came in a certain way.
--- io_uring/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/net.c +1 -1
@@ -87,7 +87,7 @@ static inline bool io_check_multishot(struct io_kiocb *req,* generic paths but multipoll may decide to post extra cqes. */ return !(issue_flags &IO_URING_F_IOWQ ) || - !(issue_flags &IO_URING_F_MULTISHOT ) || + !(req->flags &REQ_F_APOLL_MULTISHOT ) || !req->ctx->task_complete; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 135/399 PCI: qcom: Disable ASPM L0s for sc8280xp, sa8540p and sa8295p
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit d1997c98781459f7b6d0bf1858f538f48454a97b ]
Commit 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops") started enabling ASPM unconditionally when the hardware claims to support it. This triggers Correctable Errors for some PCIe devices on machines like the Lenovo ThinkPad X13s when L0s is enabled, which could indicate an incomplete driver ASPM implementation or that the hardware does in fact not support L0s.
This has now been confirmed by Qualcomm to be the case for sc8280xp and its derivate platforms (e.g. sa8540p and sa8295p). Specifically, the PHY configuration used on these platforms is not correctly tuned for L0s and there is currently no updated configuration available.
Add a new flag to the driver configuration data and use it to disable ASPM L0s on sc8280xp, sa8540p and sa8295p for now.
Note that only the 1.9.0 ops enable ASPM currently.
--- drivers/pci/controller/dwc/pcie-qcom.c | 31 ++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +29 -2
@@ -229,6 +229,7 @@ struct qcom_pcie_ops {struct qcom_pcie_cfg {const struct qcom_pcie_ops *ops; +bool no_l0s; };struct qcom_pcie {
@@ -272,6 +273,26 @@ static int qcom_pcie_start_link(struct dw_pcie *pci)return 0 ; } +static void qcom_pcie_clear_aspm_l0s (struct dw_pcie *pci) +{ +struct qcom_pcie *pcie =to_qcom_pcie (pci); +u16 offset; +u32 val; + +if (!pcie->cfg->no_l0s) +return ; + + offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP ); + +dw_pcie_dbi_ro_wr_en (pci); + + val =readl (pci->dbi_base + offset +PCI_EXP_LNKCAP ); + val &= ~PCI_EXP_LNKCAP_ASPM_L0S ; +writel (val, pci->dbi_base + offset +PCI_EXP_LNKCAP ); + +dw_pcie_dbi_ro_wr_dis (pci); +} +static void qcom_pcie_clear_hpc (struct dw_pcie *pci) {u16 offset =dw_pcie_find_capability (pci,PCI_CAP_ID_EXP );
@@ -961,6 +982,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)static int qcom_pcie_post_init_2_7_0 (struct qcom_pcie *pcie) { +qcom_pcie_clear_aspm_l0s (pcie->pci);qcom_pcie_clear_hpc (pcie->pci);return 0 ;
@@ -1358,6 +1380,11 @@ static const struct qcom_pcie_cfg cfg_2_9_0 = { .ops = &ops_2_9_0, }; +static const struct qcom_pcie_cfg cfg_sc8280xp = { + .ops = &ops_1_9_0, + .no_l0s = true, +}; +static const struct dw_pcie_ops dw_pcie_ops = { .link_up = qcom_pcie_link_up, .start_link = qcom_pcie_start_link,
@@ -1629,11 +1656,11 @@ static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8074-gen3", .data = &cfg_2_9_0 }, { .compatible = "qcom,pcie-msm8996", .data = &cfg_2_3_2 }, { .compatible = "qcom,pcie-qcs404", .data = &cfg_2_4_0 }, - { .compatible = "qcom,pcie-sa8540p", .data = &cfg_1_9_0 }, + { .compatible = "qcom,pcie-sa8540p", .data = &cfg_sc8280xp }, { .compatible = "qcom,pcie-sa8775p", .data = &cfg_1_9_0}, { .compatible = "qcom,pcie-sc7280", .data = &cfg_1_9_0 }, { .compatible = "qcom,pcie-sc8180x", .data = &cfg_1_9_0 }, - { .compatible = "qcom,pcie-sc8280xp", .data = &cfg_1_9_0 }, + { .compatible = "qcom,pcie-sc8280xp", .data = &cfg_sc8280xp }, { .compatible = "qcom,pcie-sdm845", .data = &cfg_2_7_0 }, { .compatible = "qcom,pcie-sdx55", .data = &cfg_1_9_0 }, { .compatible = "qcom,pcie-sm8150", .data = &cfg_1_9_0 },
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 136/399 sparc32: Fix parport build with sparc32
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sam Ravnborg <[email protected]>
[ Upstream commit 91d3ff922c346d6d8cb8de5ff8d504fe0ca9e17e ]
include/asm/parport.h is sparc64 specific.
Rename it to parport_64.h and use the generic version for sparc32.
This fixed all{mod,yes}config build errors like:
parport_pc.c:(.text):undefined-reference-to-ebus_dma_enable parport_pc.c:(.text):undefined-reference-to-ebus_dma_irq_enable parport_pc.c:(.text):undefined-reference-to-ebus_dma_register
The errors occur as the sparc32 build references sparc64 symbols.
--- arch/sparc/include/asm/parport.h | 259 +--------------------------- arch/sparc/include/asm/parport_64.h | 256 +++++++++++++++++++++++++++ 2 files changed, 263 insertions(+), 252 deletions(-) create mode 100644 arch/sparc/include/asm/parport_64.h
arch/sparc/include/asm/parport.h +7 -252
@@ -1,256 +1,11 @@/* SPDX-License-Identifier: GPL-2.0 */ -/* parport.h: sparc64 specific parport initialization and dma. -* -* Copyright (C) 1999 Eddie C. Dost ([email protected]) -*/ +#ifndef ___ASM_SPARC_PARPORT_H +#define ___ASM_SPARC_PARPORT_H -#ifndef _ASM_SPARC64_PARPORT_H -#define _ASM_SPARC64_PARPORT_H 1 - -#include <linux/of.h> -#include <linux/platform_device.h> - -#include <asm/ebus_dma.h> -#include <asm/ns87303.h> -#include <asm/prom.h> - -#define PARPORT_PC_MAX_PORTS PARPORT_MAX - -/* -* While sparc64 doesn't have an ISA DMA API, we provide something that looks -* close enough to make parport_pc happy -*/ -#define HAS_DMA - -#ifdef CONFIG_PARPORT_PC_FIFO -static DEFINE_SPINLOCK (dma_spin_lock); - -#define claim_dma_lock () \ -({ unsigned long flags; \ - spin_lock_irqsave(&dma_spin_lock, flags); \ - flags; \ -}) - -#define release_dma_lock (__flags) \ - spin_unlock_irqrestore(&dma_spin_lock, __flags); +#if defined(__sparc__) && defined(__arch64__) +#include <asm/parport_64.h> +#else +#include <asm-generic/parport.h> +#endif #endif -static struct sparc_ebus_info { -struct ebus_dma_info info; -unsigned int addr; -unsigned int count; -int lock; - -struct parport *port; -} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS ]; - -static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS); - -static inline int request_dma (unsigned int dmanr,const char *device_id) -{ -if (dmanr >=PARPORT_PC_MAX_PORTS ) -return -EINVAL ; -if (xchg (&sparc_ebus_dmas[dmanr].lock,1 ) !=0 ) -return -EBUSY ; -return 0 ; -} - -static inline void free_dma (unsigned int dmanr) -{ -if (dmanr >=PARPORT_PC_MAX_PORTS ) { -printk (KERN_WARNING "Trying to free DMA%d\n" , dmanr); -return ; - } -if (xchg (&sparc_ebus_dmas[dmanr].lock,0 ) ==0 ) { -printk (KERN_WARNING "Trying to free free DMA%d\n" , dmanr); -return ; - } -} - -static inline void enable_dma (unsigned int dmanr) -{ -ebus_dma_enable (&sparc_ebus_dmas[dmanr].info,1 ); - -if (ebus_dma_request (&sparc_ebus_dmas[dmanr].info, - sparc_ebus_dmas[dmanr].addr, - sparc_ebus_dmas[dmanr].count)) -BUG (); -} - -static inline void disable_dma (unsigned int dmanr) -{ -ebus_dma_enable (&sparc_ebus_dmas[dmanr].info,0 ); -} - -static inline void clear_dma_ff (unsigned int dmanr) -{ -/* nothing */ -} - -static inline void set_dma_mode (unsigned int dmanr,char mode) -{ -ebus_dma_prepare (&sparc_ebus_dmas[dmanr].info, (mode !=DMA_MODE_WRITE )); -} - -static inline void set_dma_addr (unsigned int dmanr,unsigned int addr) -{ - sparc_ebus_dmas[dmanr].addr = addr; -} - -static inline void set_dma_count (unsigned int dmanr,unsigned int count) -{ - sparc_ebus_dmas[dmanr].count = count; -} - -static inline unsigned int get_dma_residue (unsigned int dmanr) -{ -return ebus_dma_residue (&sparc_ebus_dmas[dmanr].info); -} - -static int ecpp_probe (struct platform_device *op) -{ -unsigned long base = op->resource[0 ].start; -unsigned long config = op->resource[1 ].start; -unsigned long d_base = op->resource[2 ].start; -unsigned long d_len; -struct device_node *parent; -struct parport *p; -int slot, err; - - parent = op->dev.of_node->parent; -if (of_node_name_eq (parent,"dma" )) { - p =parport_pc_probe_port (base, base +0x400 , - op->archdata.irqs[0 ],PARPORT_DMA_NOFIFO , - op->dev.parent->parent,0 ); -if (!p) -return -ENOMEM ; -dev_set_drvdata (&op->dev, p); -return 0 ; - } - -for (slot =0 ; slot <PARPORT_PC_MAX_PORTS ; slot++) { -if (!test_and_set_bit (slot, dma_slot_map)) -break ; - } - err = -ENODEV ; -if (slot >=PARPORT_PC_MAX_PORTS ) - goto out_err; - -spin_lock_init (&sparc_ebus_dmas[slot].info.lock); - - d_len = (op->resource[2 ].end - d_base) +1UL ; - sparc_ebus_dmas[slot].info.regs = -of_ioremap (&op->resource[2 ],0 , d_len,"ECPP DMA" ); - -if (!sparc_ebus_dmas[slot].info.regs) - goto out_clear_map; - - sparc_ebus_dmas[slot].info.flags =0 ; - sparc_ebus_dmas[slot].info.callback =NULL ; - sparc_ebus_dmas[slot].info.client_cookie =NULL ; - sparc_ebus_dmas[slot].info.irq =0xdeadbeef ; -strcpy (sparc_ebus_dmas[slot].info.name,"parport" ); -if (ebus_dma_register (&sparc_ebus_dmas[slot].info)) - goto out_unmap_regs; - -ebus_dma_irq_enable (&sparc_ebus_dmas[slot].info,1 ); - -/* Configure IRQ to Push Pull, Level Low */ -/* Enable ECP, set bit 2 of the CTR first */ -outb (0x04 , base +0x02 ); -ns87303_modify (config,PCR , -PCR_EPP_ENABLE | -PCR_IRQ_ODRAIN , -PCR_ECP_ENABLE | -PCR_ECP_CLK_ENA | -PCR_IRQ_POLAR ); - -/* CTR bit 5 controls direction of port */ -ns87303_modify (config,PTR , -0 ,PTR_LPT_REG_DIR ); - - p =parport_pc_probe_port (base, base +0x400 , - op->archdata.irqs[0 ], - slot, - op->dev.parent, -0 ); - err = -ENOMEM ; -if (!p) - goto out_disable_irq; - -dev_set_drvdata (&op->dev, p); - -return 0 ; - -out_disable_irq: -ebus_dma_irq_enable (&sparc_ebus_dmas[slot].info,0 ); -ebus_dma_unregister (&sparc_ebus_dmas[slot].info); - -out_unmap_regs: -of_iounmap (&op->resource[2 ], sparc_ebus_dmas[slot].info.regs, d_len); - -out_clear_map: -clear_bit (slot, dma_slot_map); - -out_err: -return err; -} - -static int ecpp_remove (struct platform_device *op) -{ -struct parport *p =dev_get_drvdata (&op->dev); -int slot = p->dma; - -parport_pc_unregister_port (p); - -if (slot !=PARPORT_DMA_NOFIFO ) { -unsigned long d_base = op->resource[2 ].start; -unsigned long d_len; - - d_len = (op->resource[2 ].end - d_base) +1UL ; - -ebus_dma_irq_enable (&sparc_ebus_dmas[slot].info,0 ); -ebus_dma_unregister (&sparc_ebus_dmas[slot].info); -of_iounmap (&op->resource[2 ], - sparc_ebus_dmas[slot].info.regs, - d_len); -clear_bit (slot, dma_slot_map); - } - -return 0 ; -} - -static const struct of_device_id ecpp_match[] = { - { - .name ="ecpp" , - }, - { - .name ="parallel" , - .compatible ="ecpp" , - }, - { - .name ="parallel" , - .compatible ="ns87317-ecpp" , - }, - { - .name ="parallel" , - .compatible ="pnpALI,1533,3" , - }, - {}, -}; - -static struct platform_driver ecpp_driver = { - .driver = { - .name ="ecpp" , - .of_match_table = ecpp_match, - }, - .probe = ecpp_probe, - .remove = ecpp_remove, -}; - -static int parport_pc_find_nonpci_ports (int autoirq,int autodma) -{ -return platform_driver_register (&ecpp_driver); -} - -#endif /* !(_ASM_SPARC64_PARPORT_H */
arch/sparc/include/asm/parport_64.h new file +256 -0
256 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 137/399 nfs: fix UAF in direct writes
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
[ Upstream commit 17f46b803d4f23c66cacce81db35fef3adb8f2af ]
In production we have been hitting the following warning consistently
------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 17 PID: 1800359 at lib/refcount.c:28 refcount_warn_saturate+0x9c/0xe0 Workqueue: nfsiod nfs_direct_write_schedule_work [nfs] RIP: 0010:refcount_warn_saturate+0x9c/0xe0 PKRU: 55555554 Call Trace: <TASK> ? __warn+0x9f/0x130 ? refcount_warn_saturate+0x9c/0xe0 ? report_bug+0xcc/0x150 ? handle_bug+0x3d/0x70 ? exc_invalid_op+0x16/0x40 ? asm_exc_invalid_op+0x16/0x20 ? refcount_warn_saturate+0x9c/0xe0 nfs_direct_write_schedule_work+0x237/0x250 [nfs] process_one_work+0x12f/0x4a0 worker_thread+0x14e/0x3b0 ? ZSTD_getCParams_internal+0x220/0x220 kthread+0xdc/0x120 ? __btf_name_valid+0xa0/0xa0 ret_from_fork+0x1f/0x30
This is because we're completing the nfs_direct_request twice in a row.
The source of this is when we have our commit requests to submit, we process them and send them off, and then in the completion path for the commit requests we have
if (nfs_commit_end(cinfo.mds))
nfs_direct_write_complete(dreq);
However since we're submitting asynchronous requests we sometimes have one that completes before we submit the next one, so we end up calling complete on the nfs_direct_request twice.
The only other place we use nfs_generic_commit_list() is in __nfs_commit_inode, which wraps this call in a
nfs_commit_begin();nfs_commit_end();
Which is a common pattern for this style of completion handling, one that is also repeated in the direct code with get_dreq()/put_dreq() calls around where we process events as well as in the completion paths.
Fix this by using the same pattern for the commit requests.
Before with my 200 node rocksdb stress running this warning would pop every 10ish minutes. With my patch the stress test has been running for several hours without popping.
--- fs/nfs/direct.c | 11 +++++++++-- fs/nfs/write.c | 2 +- include/linux/nfs_fs.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-)
fs/nfs/direct.c +9 -2
@@ -667,10 +667,17 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq)LIST_HEAD (mds_list);nfs_init_cinfo_from_dreq (&cinfo, dreq); +nfs_commit_begin (cinfo.mds);nfs_scan_commit (dreq->inode, &mds_list, &cinfo); res =nfs_generic_commit_list (dreq->inode, &mds_list,0 , &cinfo); -if (res <0 )/* res == -ENOMEM */ -nfs_direct_write_reschedule (dreq); +if (res <0 ) {/* res == -ENOMEM */ +spin_lock (&dreq->lock); +if (dreq->flags ==0 ) + dreq->flags =NFS_ODIRECT_RESCHED_WRITES ; +spin_unlock (&dreq->lock); + } +if (nfs_commit_end (cinfo.mds)) +nfs_direct_write_complete (dreq); }static void nfs_direct_write_clear_reqs (struct nfs_direct_req *dreq)
fs/nfs/write.c +1 -1
@@ -1650,7 +1650,7 @@ static int wait_on_commit(struct nfs_mds_commit_info *cinfo) !atomic_read(&cinfo->rpcs_out)); } -static void nfs_commit_begin (struct nfs_mds_commit_info *cinfo) +void nfs_commit_begin (struct nfs_mds_commit_info *cinfo) {atomic_inc (&cinfo->rpcs_out); }
include/linux/nfs_fs.h +1 -0
@@ -611,6 +611,7 @@ int nfs_wb_folio_cancel(struct inode *inode, struct folio *folio);extern int nfs_commit_inode (struct inode *,int );extern struct nfs_commit_data *nfs_commitdata_alloc (void );extern void nfs_commit_free (struct nfs_commit_data *data); +void nfs_commit_begin (struct nfs_mds_commit_info *cinfo);bool nfs_commit_end (struct nfs_mds_commit_info *cinfo);static inline bool nfs_have_writebacks (const struct inode *inode)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 138/399 NFS: Read unlock folio on nfs_page_create_from_folio() error
In reply to Greg Kroah-Hartman6.8-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <[email protected]>
[ Upstream commit 11974eec839c167362af685aae5f5e1baaf979eb ]
The netfs conversion lost a folio_unlock() for the case where nfs_page_create_from_folio() returns an error (usually -ENOMEM). Restore it.
--- fs/nfs/read.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/read.c +2 -0
@@ -305,6 +305,8 @@ int nfs_read_add_folio(struct nfs_pageio_descriptor *pgio, new =nfs_page_create_from_folio (ctx, folio,0 , aligned_len);if (IS_ERR (new)) { error =PTR_ERR (new); +if (nfs_netfs_folio_unlock (folio)) +folio_unlock (folio); goto out; }
Signature · 1 line
2.43.0