6.6.15-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainercover 6.6.15-rc1 review
This is the start of the stable review cycle for the 6.6.15 release. There are 331 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, 31 Jan 2024 16:59:28 +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.6.15-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.6.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.6.15-rc1
Rafael J. Wysocki <[email protected]>
thermal: trip: Drop lockdep assertion from thermal_zone_trip_id()
Randy Dunlap <[email protected]>
serial: core: fix kernel-doc for uart_port_unlock_irqrestore()
Richard Palethorpe <[email protected]>
x86/entry/ia32: Ensure s32 is sign extended to s64
Tim Chen <[email protected]>
tick/sched: Preserve number of idle sleeps across CPU hotplug events
Jiri Wiesner <[email protected]>
clocksource: Skip watchdog check for large watchdog intervals
Dawei Li <[email protected]>
genirq: Initialize resend_node hlist for all interrupt descriptors
Xi Ruoyao <[email protected]>
mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
Quanquan Cao <[email protected]>
cxl/region:Fix overflow issue in alloc_hpa()
Michael Walle <[email protected]>
drm: bridge: samsung-dsim: Don't use FORCE_STOP_STATE
Aleksander Jan Bajkowski <[email protected]>
MIPS: lantiq: register smp_ops on non-smp platforms
David Lechner <[email protected]>
spi: fix finalize message on error return
Shyam Prasad N <[email protected]>
cifs: fix stray unlock in cifs_chan_skip_or_disable
Amit Kumar Mahapatra <[email protected]>
spi: spi-cadence: Reverse the order of interleaved write and read operations
Kamal Dasu <[email protected]>
spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
Mario Limonciello <[email protected]>
cpufreq/amd-pstate: Fix setting scaling max/min freq values
Hsin-Yi Wang <[email protected]>
drm/bridge: anx7625: Ensure bridge is suspended in disable()
Li Lingfeng <[email protected]>
block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
Mika Westerberg <[email protected]>
spi: intel-pci: Remove Meteor Lake-S SoC PCI ID from the list
Artur Weber <[email protected]>
ARM: dts: exynos4212-tab3: add samsung,invert-vclk flag to fimd
Wenhua Lin <[email protected]>
gpio: eic-sprd: Clear interrupt after set the interrupt type
Cristian Marussi <[email protected]>
firmware: arm_scmi: Use xa_insert() when saving raw queues
Cristian Marussi <[email protected]>
firmware: arm_scmi: Use xa_insert() to store opps
Fedor Pchelkin <[email protected]>
drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
Arnd Bergmann <[email protected]>
drm/exynos: fix accidental on-stack copy of exynos_drm_plane
Yajun Deng <[email protected]>
memblock: fix crash when reserved memory is not added to memory
Douglas Anderson <[email protected]>
drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case
Pin-yen Lin <[email protected]>
drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()
Tomi Valkeinen <[email protected]>
drm/bridge: sii902x: Fix audio codec unregistration
Tomi Valkeinen <[email protected]>
drm/bridge: sii902x: Fix probing race issue
Artur Weber <[email protected]>
drm/panel: samsung-s6d7aa0: drop DRM_BUS_FLAG_DE_HIGH for lsl080al02
Markus Niebel <[email protected]>
drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33]
Douglas Anderson <[email protected]>
drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer
Alex Deucher <[email protected]>
drm/amdgpu/gfx11: set UNORD_DISPATCH in compute MQDs
Alex Deucher <[email protected]>
drm/amdgpu/gfx10: set UNORD_DISPATCH in compute MQDs
Hsin-Yi Wang <[email protected]>
drm/panel-edp: drm/panel-edp: Fix AUO B116XTN02 name
Hsin-Yi Wang <[email protected]>
drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing
Sheng-Liang Pan <[email protected]>
drm/panel-edp: Add AUO B116XTN02, BOE NT116WHM-N21,836X2, NV116WHM-N49 V8.0
Ville Syrjälä <[email protected]>
drm/i915/psr: Only allow PSR in LPSP mode on HSW non-ULT
Mika Kahola <[email protected]>
drm/i915/lnl: Remove watchdog timers for PSR
Naohiro Aota <[email protected]>
btrfs: zoned: optimize hint byte for zoned allocator
Naohiro Aota <[email protected]>
btrfs: zoned: factor out prepare_allocation_zoned()
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: fix unconditional activation of THRI interrupt
Thomas Gleixner <[email protected]>
serial: sc16is7xx: Use port lock wrappers
Thomas Gleixner <[email protected]>
serial: core: Provide port lock wrappers
Baolin Wang <[email protected]>
mm: migrate: fix getting incorrect page mapping during page migration
Baolin Wang <[email protected]>
mm: migrate: record the mlocked page status to remove unnecessary lru drain
Di Shen <[email protected]>
thermal: gov_power_allocator: avoid inability to reset a cdev
Rafael J. Wysocki <[email protected]>
thermal: core: Store trip pointer in struct thermal_instance
Rafael J. Wysocki <[email protected]>
thermal: trip: Drop redundant trips check from for_each_thermal_trip()
Alexander Stein <[email protected]>
media: i2c: imx290: Properly encode registers as little-endian
Alexander Stein <[email protected]>
media: v4l2-cci: Add support for little-endian encoded registers
Sakari Ailus <[email protected]>
media: v4l: cci: Add macros to obtain register width and address
Sakari Ailus <[email protected]>
media: v4l: cci: Include linux/bits.h
Lukas Schauer <[email protected]>
pipe: wakeup wr_wait after setting max_usage
Max Kellermann <[email protected]>
fs/pipe: move check to pipe_has_watch_queue()
Ricardo Neri <[email protected]>
thermal: intel: hfi: Add syscore callbacks for system-wide PM
Ricardo Neri <[email protected]>
thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline
Ricardo Neri <[email protected]>
thermal: intel: hfi: Refactor enabling code into helper functions
Martin KaFai Lau <[email protected]>
net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set
Srinivasan Shanmugam <[email protected]>
drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions
Ma Jun <[email protected]>
drm/amdgpu/pm: Fix the power source flag error
Srinivasan Shanmugam <[email protected]>
drm/amd/display: Fix late derefrence 'dsc' check in 'link_set_dsc_pps_packet()'
Wayne Lin <[email protected]>
drm/amd/display: Align the returned error code with legacy DP
Nicholas Kazlauskas <[email protected]>
drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A
Srinivasan Shanmugam <[email protected]>
drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay()
Likun Gao <[email protected]>
drm/amdgpu: correct the cu count for gfx v11
Dan Carpenter <[email protected]>
drm/bridge: nxp-ptn3460: simplify some error checking
Ivan Lipski <[email protected]>
Revert "drm/amd/display: fix bandwidth validation failure on DCN 2.1"
Mario Limonciello <[email protected]>
drm/amd/display: Disable PSR-SU on Parade 0803 TCON again
Melissa Wen <[email protected]>
drm/amd/display: fix bandwidth validation failure on DCN 2.1
Javier Martinez Canillas <[email protected]>
drm: Allow drivers to indicate the damage helpers to ignore damage clips
Javier Martinez Canillas <[email protected]>
drm/virtio: Disable damage clipping if FB changed since last page-flip
Zack Rusin <[email protected]>
drm: Disable the cursor plane on atomic contexts with virtualized drivers
Tomi Valkeinen <[email protected]>
drm/tidss: Fix atomic_flush check
Thomas Zimmermann <[email protected]>
drm: Fix TODO list mentioning non-KMS drivers
Dan Carpenter <[email protected]>
drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
Ville Syrjälä <[email protected]>
drm: Don't unref the same fb many times by mistake due to deadlock handling
Ville Syrjälä <[email protected]>
Revert "drm/i915/dsi: Do display on sequence later on icl+"
Rafael J. Wysocki <[email protected]>
cpufreq: intel_pstate: Refine computation of P-state for given frequency
Mario Limonciello <[email protected]>
gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
Dave Chinner <[email protected]>
xfs: read only mounts with fsopen mount API are busted
Ma Jun <[email protected]>
drm/amdgpu: Fix the null pointer when load rlc firmware
Thomas Zimmermann <[email protected]>
Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync"
Cristian Marussi <[email protected]>
firmware: arm_scmi: Check mailbox/SMT channel for consistency
Lin Ma <[email protected]>
ksmbd: fix global oob in ksmbd_nl_policy
Shin'ichiro Kawasaki <[email protected]>
platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
Nathan Chancellor <[email protected]>
platform/x86: intel-uncore-freq: Fix types in sysfs callbacks
Florian Westphal <[email protected]>
netfilter: nf_tables: reject QUEUE/DROP verdict parameters
Pablo Neira Ayuso <[email protected]>
netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain
Michael Kelley <[email protected]>
hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes
NeilBrown <[email protected]>
nfsd: fix RELEASE_LOCKOWNER
Emmanuel Grumbach <[email protected]>
wifi: iwlwifi: fix a memory corruption
Bernd Edlinger <[email protected]>
exec: Fix error handling in begin_new_exec()
Ilya Dryomov <[email protected]>
rbd: don't move requests to the running list on errors
Omar Sandoval <[email protected]>
btrfs: don't abort filesystem when attempting to snapshot deleted subvolume
Qu Wenruo <[email protected]>
btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
David Sterba <[email protected]>
btrfs: don't warn if discard range is not aligned to sector
Chung-Chiang Cheng <[email protected]>
btrfs: tree-checker: fix inline ref size in error messages
Fedor Pchelkin <[email protected]>
btrfs: ref-verify: free ref cache before clearing mount opt
Omar Sandoval <[email protected]>
btrfs: avoid copying BTRFS_ROOT_SUBVOL_DEAD flag to snapshot of subvolume being deleted
Naohiro Aota <[email protected]>
btrfs: zoned: fix lock ordering in btrfs_zone_activate()
Qu Wenruo <[email protected]>
btrfs: scrub: avoid use-after-free when chunk length is not 64K aligned
Gerhard Engleder <[email protected]>
tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring
Gerhard Engleder <[email protected]>
tsnep: Remove FCS for XDP data path
Shenwei Wang <[email protected]>
net: fec: fix the unhandled context fault from smmu
Hangbin Liu <[email protected]>
selftests: bonding: do not test arp/ns target with mode balance-alb/tlb
Zhipeng Lu <[email protected]>
fjes: fix memleaks in fjes_hw_setup
Maciej Fijalkowski <[email protected]>
i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue
Maciej Fijalkowski <[email protected]>
i40e: set xdp_rxq_info::frag_size
Maciej Fijalkowski <[email protected]>
xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL
Maciej Fijalkowski <[email protected]>
ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue
Maciej Fijalkowski <[email protected]>
intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers
Maciej Fijalkowski <[email protected]>
ice: remove redundant xdp_rxq_info registration
Tirthendu Sarkar <[email protected]>
i40e: handle multi-buffer packets that are shrunk by xdp prog
Maciej Fijalkowski <[email protected]>
ice: work on pre-XDP prog frag count
Maciej Fijalkowski <[email protected]>
xsk: fix usage of multi-buffer BPF helpers for ZC XDP
Daan De Meyer <[email protected]>
bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf
Daan De Meyer <[email protected]>
bpf: Propagate modified uaddrlen from cgroup sockaddr programs
Maciej Fijalkowski <[email protected]>
xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags
Maciej Fijalkowski <[email protected]>
xsk: recycle buffer in case Rx queue was full
Jakub Kicinski <[email protected]>
selftests: netdevsim: fix the udp_tunnel_nic test
Jakub Kicinski <[email protected]>
selftests: net: fix rps_default_mask with >32 CPUs
Jenishkumar Maheshbhai Patel <[email protected]>
net: mvpp2: clear BM pool before initialization
Bernd Edlinger <[email protected]>
net: stmmac: Wait a bit for the reset to take effect
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: validate NFPROTO_* family
Florian Westphal <[email protected]>
netfilter: nf_tables: restrict anonymous set and map names to 16 bytes
Florian Westphal <[email protected]>
netfilter: nft_limit: reject configurations that cause integer overflow
Frederic Weisbecker <[email protected]>
rcu: Defer RCU kthreads wakeup when CPU is dying
Dinghao Liu <[email protected]>
net/mlx5e: fix a potential double-free in fs_any_create_groups
Zhipeng Lu <[email protected]>
net/mlx5e: fix a double-free in arfs_create_groups
Leon Romanovsky <[email protected]>
net/mlx5e: Ignore IPsec replay window values on sender side
Leon Romanovsky <[email protected]>
net/mlx5e: Allow software parsing when IPsec crypto is enabled
Rahul Rameshbabu <[email protected]>
net/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO
Yevgeny Kliteynik <[email protected]>
net/mlx5: DR, Can't go to uplink vport on RX rule
Yevgeny Kliteynik <[email protected]>
net/mlx5: DR, Use the right GVMI number for drop action
Moshe Shemesh <[email protected]>
net/mlx5: Bridge, fix multicast packets sent to uplink
Erez Shitrit <[email protected]>
net/mlx5: Bridge, Enable mcast in smfs steering mode
Yishai Hadas <[email protected]>
net/mlx5: Fix a WARN upon a callback command failure
Vlad Buslov <[email protected]>
net/mlx5e: Fix peer flow lists handling
Rahul Rameshbabu <[email protected]>
net/mlx5e: Fix operation precedence bug in port timestamping napi_poll context
Ido Schimmel <[email protected]>
net/sched: flower: Fix chain template offload
Jakub Kicinski <[email protected]>
selftests: fill in some missing configs for net
Zhengchao Shao <[email protected]>
ipv6: init the accept_queue's spinlocks in inet6_create
Zhengchao Shao <[email protected]>
netlink: fix potential sleeping issue in mqueue_flush_file
Kuniyuki Iwashima <[email protected]>
selftest: Don't reuse port for SO_INCOMING_CPU test.
Salvatore Dipietro <[email protected]>
tcp: Add memory barrier to tcp_push()
David Howells <[email protected]>
afs: Hide silly-rename files from userspace
Petr Pavlu <[email protected]>
tracing: Ensure visibility when inserting an element into tracing_map
Dan Carpenter <[email protected]>
netfs, fscache: Prevent Oops in fscache_put_cache()
Sharath Srinivasan <[email protected]>
net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv
Horatiu Vultur <[email protected]>
net: micrel: Fix PTP frame parsing for lan8814
Yunjian Wang <[email protected]>
tun: add missing rx stats accounting in tun_xdp_act
Yunjian Wang <[email protected]>
tun: fix missing dropped counter in tun_xdp_act
Jakub Kicinski <[email protected]>
net: fix removing a namespace with conflicting altnames
Eric Dumazet <[email protected]>
udp: fix busy polling
Kuniyuki Iwashima <[email protected]>
llc: Drop support for ETH_P_TR_802_2.
Eric Dumazet <[email protected]>
llc: make llc_ui_sendmsg() more robust against bonding changes
Lin Ma <[email protected]>
vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING
Michael Chan <[email protected]>
bnxt_en: Prevent kernel warning when running offline self test
Michael Chan <[email protected]>
bnxt_en: Wait for FLR to complete during probe
Zhengchao Shao <[email protected]>
tcp: make sure init the accept_queue's spinlocks once
Benjamin Poirier <[email protected]>
selftests: bonding: Increase timeout to 1200s
Wen Gu <[email protected]>
net/smc: fix illegal rmb_desc access in SMC-D connection dump
Johannes Berg <[email protected]>
wifi: mac80211: fix potential sta-link leak
Lucas Stach <[email protected]>
SUNRPC: use request size to initialize bio_vec in svc_udp_sendto()
Shyam Prasad N <[email protected]>
cifs: after disabling multichannel, mark tcon for reconnect
Shyam Prasad N <[email protected]>
cifs: fix a pending undercount of srv_count
Shyam Prasad N <[email protected]>
cifs: fix lock ordering while disabling multichannel
Jonathan Gray <[email protected]>
Revert "drm/amd: Enable PCIe PME from D3"
Eduard Zingerman <[email protected]>
selftests/bpf: check if max number of bpf_loop iterations is tracked
Eduard Zingerman <[email protected]>
bpf: keep track of max number of bpf_loop callback iterations
Eduard Zingerman <[email protected]>
selftests/bpf: test widening for iterating callbacks
Eduard Zingerman <[email protected]>
bpf: widening for callback iterators
Eduard Zingerman <[email protected]>
selftests/bpf: tests for iterating callbacks
Eduard Zingerman <[email protected]>
bpf: verify callbacks as if they are called unknown number of times
Eduard Zingerman <[email protected]>
bpf: extract setup_func_entry() utility function
Eduard Zingerman <[email protected]>
bpf: extract __check_reg_arg() utility function
Eduard Zingerman <[email protected]>
selftests/bpf: track string payload offset as scalar in strobemeta
Eduard Zingerman <[email protected]>
selftests/bpf: track tcp payload offset as scalar in xdp_synproxy
Eduard Zingerman <[email protected]>
bpf: print full verifier states on infinite loop detection
Eduard Zingerman <[email protected]>
selftests/bpf: test if state loops are detected in a tricky case
Eduard Zingerman <[email protected]>
bpf: correct loop detection for iterators convergence
Eduard Zingerman <[email protected]>
selftests/bpf: tests with delayed read/precision makrs in loop body
Eduard Zingerman <[email protected]>
bpf: exact states comparison for iterator convergence checks
Eduard Zingerman <[email protected]>
bpf: extract same_callsites() as utility function
Eduard Zingerman <[email protected]>
bpf: move explored_state() closer to the beginning of verifier.c
Rohan G Thomas <[email protected]>
dt-bindings: net: snps,dwmac: Tx coe unsupported
Namjae Jeon <[email protected]>
ksmbd: Add missing set_freezable() for freezable kthread
Namjae Jeon <[email protected]>
ksmbd: send lease break notification on FILE_RENAME_INFORMATION
Namjae Jeon <[email protected]>
ksmbd: don't increment epoch if current state and request state are same
Namjae Jeon <[email protected]>
ksmbd: fix potential circular locking issue in smb2_set_ea()
Namjae Jeon <[email protected]>
ksmbd: set v2 lease version on lease upgrade
Lino Sanfilippo <[email protected]>
serial: Do not hold the port lock when setting rx-during-tx GPIO
Charan Teja Kalla <[email protected]>
mm: page_alloc: unreserve highatomic page blocks before oom
Huacai Chen <[email protected]>
LoongArch/smp: Call rcutree_report_cpu_starting() earlier
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: improve do/while loop in sc16is7xx_irq()
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: remove obsolete loop in sc16is7xx_port_irq()
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: fix invalid sc16is7xx_lines bitfield in case of probe error
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: change EFR lock to operate on each channels
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: remove unused line structure member
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: remove global regmap from struct sc16is7xx_port
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: remove wasteful static buffer in sc16is7xx_regmap_name()
Hugo Villeneuve <[email protected]>
serial: sc16is7xx: improve regmap debugfs by using one regmap per port
Al Viro <[email protected]>
rename(): fix the locking of subdirectories
Charan Teja Kalla <[email protected]>
mm/sparsemem: fix race in accessing memory_section->usage
Steven Rostedt (Google) <[email protected]>
mm/rmap: fix misplaced parenthesis of a likely()
Donet Tom <[email protected]>
selftests: mm: hugepage-vmemmap fails on 64K page size systems
James Gowans <[email protected]>
kexec: do syscore_shutdown() in kernel_kexec
Zhihao Cheng <[email protected]>
ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path
Ma Wupeng <[email protected]>
efi: disable mirror feature during crashkernel
Dave Airlie <[email protected]>
nouveau/vmm: don't set addr on the fail path to avoid warning
Mario Limonciello <[email protected]>
rtc: Extend timeout for waiting for UIP to clear to 1s
Mario Limonciello <[email protected]>
rtc: Add support for configuring the UIP timeout for RTC reads
Mario Limonciello <[email protected]>
rtc: mc146818-lib: Adjust failure return code for mc146818_get_time()
Mario Limonciello <[email protected]>
rtc: Adjust failure return code for cmos_set_alarm()
Mario Limonciello <[email protected]>
rtc: cmos: Use ACPI alarm for non-Intel x86 systems too
Mark Rutland <[email protected]>
arm64: entry: fix ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
Mark Brown <[email protected]>
arm64/sme: Always exit sme_alloc() early with existing storage
Rob Herring <[email protected]>
arm64: errata: Add Cortex-A510 speculative unprivileged load workaround
Rob Herring <[email protected]>
arm64: Rename ARM64_WORKAROUND_2966298
Guo Ren <[email protected]>
riscv: mm: Fixup compat mode boot failure
Guo Ren <[email protected]>
riscv: mm: Fixup compat arch_get_mmap_end
Zheng Wang <[email protected]>
media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
Zheng Wang <[email protected]>
media: mtk-jpeg: Fix timeout schedule error in mtk_jpegdec_worker.
Alain Volmat <[email protected]>
media: i2c: st-mipid02: correct format propagation
Andy Shevchenko <[email protected]>
mmc: mmc_spi: remove custom DMA mapped buffers
Avri Altman <[email protected]>
mmc: core: Use mrq.sbc in close-ended ffu
Michael Grzeschik <[email protected]>
media: videobuf2-dma-sg: fix vmap callback
Vegard Nossum <[email protected]>
scripts/get_abi: fix source path leak
Vegard Nossum <[email protected]>
docs: kernel_abi.py: fix command injection
Jordan Rife <[email protected]>
dlm: use kernel_connect() and kernel_bind()
Alfred Piccioni <[email protected]>
lsm: new security_file_ioctl_compat() hook
Johan Hovold <[email protected]>
ARM: dts: qcom: sdx55: fix USB SS wakeup
Johan Hovold <[email protected]>
arm64: dts: qcom: sdm670: fix USB SS wakeup
Johan Hovold <[email protected]>
arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8180x: fix USB SS wakeup
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8180x: fix USB DP/DM HS PHY interrupts
Johan Hovold <[email protected]>
arm64: dts: qcom: sm8150: fix USB SS wakeup
Johan Hovold <[email protected]>
arm64: dts: qcom: sm8150: fix USB DP/DM HS PHY interrupts
Johan Hovold <[email protected]>
arm64: dts: qcom: sdm845: fix USB SS wakeup
Johan Hovold <[email protected]>
arm64: dts: qcom: sdm845: fix USB DP/DM HS PHY interrupts
Johan Hovold <[email protected]>
ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts
Stephan Gerhold <[email protected]>
arm64: dts: qcom: Add missing vio-supply for AW2013
Johan Hovold <[email protected]>
arm64: dts: qcom: sc7280: fix usb_1 wakeup interrupt types
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8180x: fix USB wakeup interrupt types
Johan Hovold <[email protected]>
arm64: dts: qcom: sm8150: fix USB wakeup interrupt types
Johan Hovold <[email protected]>
arm64: dts: qcom: sdm670: fix USB wakeup interrupt types
Johan Hovold <[email protected]>
arm64: dts: qcom: sdm845: fix USB wakeup interrupt types
Johan Hovold <[email protected]>
arm64: dts: qcom: sc7180: fix USB wakeup interrupt types
Stephan Gerhold <[email protected]>
arm64: dts: qcom: msm8939: Make blsp_dma controlled-remotely
Stephan Gerhold <[email protected]>
arm64: dts: qcom: msm8916: Make blsp_dma controlled-remotely
Sam Edwards <[email protected]>
arm64: dts: rockchip: Fix rk3588 USB power-domain clocks
Tianling Shen <[email protected]>
arm64: dts: rockchip: configure eth pad driver strength for orangepi r1 plus lts
Cixi Geng <[email protected]>
arm64: dts: sprd: fix the cpu node for UMS512
Johan Hovold <[email protected]>
ARM: dts: qcom: sdx55: fix pdc '#interrupt-cells'
Paul Cercueil <[email protected]>
ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12
Johan Hovold <[email protected]>
ARM: dts: qcom: sdx55: fix USB wakeup interrupt types
Johan Hovold <[email protected]>
arm64: dts: qcom: sc8280xp-crd: fix eDP phy compatible
Andrejs Cainikovs <[email protected]>
ARM: dts: imx6q-apalis: add can power-up delay on ixora board
Helge Deller <[email protected]>
parisc/power: Fix power soft-off button emulation on qemu
Helge Deller <[email protected]>
parisc/firmware: Fix F-extend for PDC addresses
Bhaumik Bhatt <[email protected]>
bus: mhi: host: Add spinlock to protect WP access when queueing TREs
Qiang Yu <[email protected]>
bus: mhi: host: Drop chan lock before queuing buffers
Krishna chaitanya chundru <[email protected]>
bus: mhi: host: Add alignment check for event ring read pointer
Serge Semin <[email protected]>
mips: Fix max_mapnr being uninitialized on early stages
Eric Dumazet <[email protected]>
nbd: always initialize struct msghdr completely
Tony Krowiak <[email protected]>
s390/vfio-ap: do not reset queue removed from host config
Tony Krowiak <[email protected]>
s390/vfio-ap: reset queues associated with adapter for queue unbound from driver
Tony Krowiak <[email protected]>
s390/vfio-ap: reset queues filtered from the guest's AP config
Tony Krowiak <[email protected]>
s390/vfio-ap: let on_scan_complete() callback filter matrix and update guest's APCB
Tony Krowiak <[email protected]>
s390/vfio-ap: loop over the shadow APCB when filtering guest's AP configuration
Tony Krowiak <[email protected]>
s390/vfio-ap: always filter entire AP matrix
Herve Codina <[email protected]>
soc: fsl: cpm1: qmc: Fix rx channel reset
Herve Codina <[email protected]>
soc: fsl: cpm1: qmc: Fix __iomem addresses declaration
Herve Codina <[email protected]>
soc: fsl: cpm1: tsa: Fix __iomem addresses declaration
Bingbu Cao <[email protected]>
media: ov01a10: Enable runtime PM before registering async sub-device
Bingbu Cao <[email protected]>
media: ov13b10: Enable runtime PM before registering async sub-device
Bingbu Cao <[email protected]>
media: ov9734: Enable runtime PM before registering async sub-device
Xiaolei Wang <[email protected]>
rpmsg: virtio: Free driver_override when rpmsg_remove()
Bingbu Cao <[email protected]>
media: imx355: Enable runtime PM before registering async sub-device
Johan Hovold <[email protected]>
soc: qcom: pmic_glink_altmode: fix port sanity check
Miquel Raynal <[email protected]>
mtd: rawnand: Clarify conditions to enable continuous reads
Miquel Raynal <[email protected]>
mtd: rawnand: Prevent sequential reads with on-die ECC engines
Miquel Raynal <[email protected]>
mtd: rawnand: Fix core interference with sequential reads
Miquel Raynal <[email protected]>
mtd: rawnand: Prevent crossing LUN boundaries during sequential reads
Miquel Raynal <[email protected]>
mtd: maps: vmu-flash: Fix the (mtd core) switch to ref counters
Christian Marangi <[email protected]>
PM / devfreq: Fix buffer overflow in trans_stat_show
Anthony Krowiak <[email protected]>
s390/vfio-ap: unpin pages on gisc registration failure
Herbert Xu <[email protected]>
crypto: s390/aes - Fix buffer overread in CTR mode
Herbert Xu <[email protected]>
hwrng: core - Fix page fault dead lock on mmap-ed hwrng
Hongchen Zhang <[email protected]>
PM: hibernate: Enforce ordering during image compression/decompression
Herbert Xu <[email protected]>
crypto: api - Disallow identical driver names
Gao Xiang <[email protected]>
erofs: fix lz4 inplace decompression
Tianjia Zhang <[email protected]>
crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_init
David Disseldorp <[email protected]>
btrfs: sysfs: validate scrub_speed_max value
Viresh Kumar <[email protected]>
OPP: Pass rounded rate to _set_opp()
Josef Bacik <[email protected]>
arm64: properly install vmlinuz.efi
Rafael J. Wysocki <[email protected]>
PM: sleep: Fix possible deadlocks in core system-wide PM code
Rafael J. Wysocki <[email protected]>
async: Introduce async_schedule_dev_nocall()
Rafael J. Wysocki <[email protected]>
async: Split async_schedule_node_domain()
Suraj Jitindar Singh <[email protected]>
ext4: allow for the last group to be marked as trimmed
Geoff Levand <[email protected]>
powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2
Shyam Prasad N <[email protected]>
cifs: update iface_last_update on each query-and-update
Shyam Prasad N <[email protected]>
cifs: handle servers that still advertise multichannel after disabling
Shyam Prasad N <[email protected]>
cifs: reconnect worker should take reference on server struct unconditionally
Shyam Prasad N <[email protected]>
Revert "cifs: reconnect work should have reference on server struct"
Shyam Prasad N <[email protected]>
cifs: handle when server stops supporting multichannel
Shyam Prasad N <[email protected]>
cifs: handle when server starts supporting multichannel
Shyam Prasad N <[email protected]>
cifs: reconnect work should have reference on server struct
Shyam Prasad N <[email protected]>
cifs: handle cases where a channel is closed
Paulo Alcantara <[email protected]>
smb: client: fix parsing of SMB3.1.1 POSIX create context
Geert Uytterhoeven <[email protected]>
sh: ecovec24: Rename missed backlight field from fbdev to dev
Niklas Cassel <[email protected]>
scsi: core: Kick the requeue list after inserting when flushing
Christophe JAILLET <[email protected]>
riscv: Fix an off-by-one in get_early_cmdline()
Bart Van Assche <[email protected]>
scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan()
Rex Zhang <[email protected]>
dmaengine: idxd: Move dma_free_coherent() out of spinlocked context
Amelie Delaunay <[email protected]>
dmaengine: fix NULL pointer in channel unregistration function
Frank Li <[email protected]>
dmaengine: fsl-edma: fix eDMAv4 channel allocation issue
Marcelo Schmitt <[email protected]>
iio: adc: ad7091r: Enable internal vref if external vref is not supplied
Marcelo Schmitt <[email protected]>
iio: adc: ad7091r: Allow users to configure device events
Marcelo Schmitt <[email protected]>
iio: adc: ad7091r: Set alert bit in config register
Romain Gantois <[email protected]>
net: stmmac: Prevent DSA tags from breaking COE
Rohan G Thomas <[email protected]>
net: stmmac: Tx coe sw fallback
Krzysztof Kozlowski <[email protected]>
soundwire: fix initializing sysfs for same devices on different buses
Pierre-Louis Bossart <[email protected]>
soundwire: bus: introduce controller_id
Lino Sanfilippo <[email protected]>
serial: core: set missing supported flag for RX during TX GPIO
Andy Shevchenko <[email protected]>
serial: core: Simplify uart_get_rs485_mode()
Vegard Nossum <[email protected]>
docs: kernel_feat.py: fix potential command injection
Min-Hua Chen <[email protected]>
docs: sparse: add sparse.rst to toctree
Min-Hua Chen <[email protected]>
docs: sparse: move TW sparse.txt to TW dev-tools
-------------
Diffstat:
Documentation/ABI/testing/sysfs-class-devfreq | 3 +
Documentation/admin-guide/abi-obsolete.rst | 2 +-
Documentation/admin-guide/abi-removed.rst | 2 +-
Documentation/admin-guide/abi-stable.rst | 2 +-
Documentation/admin-guide/abi-testing.rst | 2 +-
Documentation/admin-guide/features.rst | 2 +-
Documentation/arch/arc/features.rst | 2 +-
Documentation/arch/arm/features.rst | 2 +-
Documentation/arch/arm64/features.rst | 2 +-
Documentation/arch/arm64/silicon-errata.rst | 2 +
Documentation/arch/loongarch/features.rst | 2 +-
Documentation/arch/m68k/features.rst | 2 +-
Documentation/arch/mips/features.rst | 2 +-
Documentation/arch/nios2/features.rst | 2 +-
Documentation/arch/openrisc/features.rst | 2 +-
Documentation/arch/parisc/features.rst | 2 +-
Documentation/arch/s390/features.rst | 2 +-
Documentation/arch/sh/features.rst | 2 +-
Documentation/arch/sparc/features.rst | 2 +-
Documentation/arch/x86/features.rst | 2 +-
Documentation/arch/xtensa/features.rst | 2 +-
.../devicetree/bindings/net/snps,dwmac.yaml | 5 +
Documentation/filesystems/directory-locking.rst | 29 +-
Documentation/filesystems/locking.rst | 5 +-
Documentation/filesystems/porting.rst | 18 +
Documentation/gpu/drm-kms.rst | 2 +
Documentation/gpu/todo.rst | 7 +-
Documentation/powerpc/features.rst | 2 +-
Documentation/riscv/features.rst | 2 +-
Documentation/sphinx/kernel_abi.py | 56 +-
Documentation/sphinx/kernel_feat.py | 55 +-
.../translations/zh_CN/arch/loongarch/features.rst | 2 +-
.../translations/zh_CN/arch/mips/features.rst | 2 +-
.../translations/zh_TW/dev-tools/index.rst | 40 +
.../translations/zh_TW/{ => dev-tools}/sparse.txt | 0
Documentation/translations/zh_TW/index.rst | 2 +-
Makefile | 4 +-
arch/alpha/kernel/rtc.c | 2 +-
.../boot/dts/nxp/imx/imx6q-apalis-ixora-v1.2.dts | 2 +
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 10 +-
arch/arm/boot/dts/samsung/exynos4210-i9100.dts | 8 +
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 1 +
arch/arm64/Kconfig | 18 +
.../boot/dts/qcom/msm8916-longcheer-l8150.dts | 1 +
.../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 1 +
arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8939.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8953-xiaomi-mido.dts | 1 +
arch/arm64/boot/dts/qcom/msm8953-xiaomi-tissot.dts | 1 +
arch/arm64/boot/dts/qcom/msm8953-xiaomi-vince.dts | 1 +
arch/arm64/boot/dts/qcom/sc7180.dtsi | 4 +-
arch/arm64/boot/dts/qcom/sc7280.dtsi | 4 +-
arch/arm64/boot/dts/qcom/sc8180x.dtsi | 16 +-
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 2 +
arch/arm64/boot/dts/qcom/sdm670.dtsi | 8 +-
arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 16 +-
.../dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 4 +-
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 1 +
arch/arm64/boot/dts/sprd/ums512.dtsi | 4 +-
arch/arm64/boot/install.sh | 3 +-
arch/arm64/kernel/cpu_errata.c | 21 +-
arch/arm64/kernel/entry.S | 22 +-
arch/arm64/kernel/fpsimd.c | 6 +-
arch/arm64/tools/cpucaps | 2 +-
arch/loongarch/kernel/smp.c | 3 +-
arch/mips/kernel/elf.c | 6 +
arch/mips/lantiq/prom.c | 7 +-
arch/mips/mm/init.c | 12 +-
arch/parisc/kernel/firmware.c | 4 +-
arch/powerpc/configs/ps3_defconfig | 1 +
arch/riscv/include/asm/pgtable.h | 2 +-
arch/riscv/include/asm/processor.h | 2 +-
arch/riscv/kernel/pi/cmdline_early.c | 3 +-
arch/s390/crypto/aes_s390.c | 4 +-
arch/s390/crypto/paes_s390.c | 4 +-
arch/sh/boards/mach-ecovec24/setup.c | 2 +-
arch/x86/include/asm/syscall_wrapper.h | 25 +-
arch/x86/kernel/hpet.c | 2 +-
arch/x86/kernel/rtc.c | 2 +-
block/ioctl.c | 2 -
block/partitions/core.c | 5 +
crypto/algapi.c | 1 +
drivers/base/power/main.c | 148 ++--
drivers/base/power/trace.c | 2 +-
drivers/block/nbd.c | 6 +-
drivers/block/rbd.c | 22 +-
drivers/bus/mhi/host/main.c | 29 +-
drivers/char/hw_random/core.c | 34 +-
drivers/cpufreq/amd-pstate.c | 7 +-
drivers/cpufreq/intel_pstate.c | 55 +-
drivers/cxl/core/region.c | 4 +-
drivers/devfreq/devfreq.c | 57 +-
drivers/dma/dmaengine.c | 3 +
drivers/dma/fsl-edma-main.c | 8 +
drivers/dma/idxd/device.c | 9 +-
drivers/firmware/arm_scmi/common.h | 1 +
drivers/firmware/arm_scmi/mailbox.c | 14 +
drivers/firmware/arm_scmi/perf.c | 23 +-
drivers/firmware/arm_scmi/raw_mode.c | 12 +-
drivers/firmware/arm_scmi/shmem.c | 6 +
drivers/firmware/sysfb.c | 2 +-
drivers/gpio/gpio-eic-sprd.c | 32 +-
drivers/gpio/gpiolib-acpi.c | 14 +
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 -
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 17 +-
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 5 +-
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 +
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 1 +
.../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +
.../amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 21 +-
drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 8 +-
.../drm/amd/display/dc/link/protocols/link_dpcd.c | 4 +-
.../dc/link/protocols/link_edp_panel_control.c | 11 +-
.../drm/amd/display/modules/power/power_helpers.c | 2 +
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 +-
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 2 +
drivers/gpu/drm/bridge/analogix/anx7625.c | 7 +-
drivers/gpu/drm/bridge/analogix/anx7625.h | 2 +
drivers/gpu/drm/bridge/nxp-ptn3460.c | 6 +-
drivers/gpu/drm/bridge/parade-ps8640.c | 23 +
drivers/gpu/drm/bridge/samsung-dsim.c | 32 +-
drivers/gpu/drm/bridge/sii902x.c | 42 +-
drivers/gpu/drm/drm_damage_helper.c | 3 +-
drivers/gpu/drm/drm_plane.c | 14 +
drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 +-
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 +-
drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +-
drivers/gpu/drm/i915/display/icl_dsi.c | 3 +-
drivers/gpu/drm/i915/display/intel_psr.c | 22 +-
drivers/gpu/drm/nouveau/nouveau_vmm.c | 3 +
drivers/gpu/drm/panel/panel-edp.c | 7 +-
drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 2 +-
drivers/gpu/drm/panel/panel-simple.c | 2 +
drivers/gpu/drm/qxl/qxl_drv.c | 2 +-
drivers/gpu/drm/tidss/tidss_crtc.c | 10 +-
drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +-
drivers/gpu/drm/virtio/virtgpu_plane.c | 10 +
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +-
drivers/iio/adc/ad7091r-base.c | 169 ++++
drivers/iio/adc/ad7091r-base.h | 8 +
drivers/iio/adc/ad7091r5.c | 28 +-
drivers/media/common/videobuf2/videobuf2-dma-sg.c | 10 +-
drivers/media/i2c/imx290.c | 42 +-
drivers/media/i2c/imx355.c | 12 +-
drivers/media/i2c/ov01a10.c | 18 +-
drivers/media/i2c/ov13b10.c | 14 +-
drivers/media/i2c/ov9734.c | 19 +-
drivers/media/i2c/st-mipid02.c | 9 +-
.../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 12 +-
drivers/media/v4l2-core/v4l2-cci.c | 52 +-
drivers/mmc/core/block.c | 46 +-
drivers/mmc/host/mmc_spi.c | 186 +----
drivers/mtd/maps/vmu-flash.c | 2 +-
drivers/mtd/nand/raw/nand_base.c | 87 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 +
drivers/net/ethernet/engleder/tsnep_main.c | 17 +-
drivers/net/ethernet/freescale/fec_main.c | 2 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 47 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 49 +-
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 +-
drivers/net/ethernet/intel/ice/ice_base.c | 37 +-
drivers/net/ethernet/intel/ice/ice_txrx.c | 19 +-
drivers/net/ethernet/intel/ice/ice_txrx.h | 1 +
drivers/net/ethernet/intel/ice/ice_txrx_lib.h | 31 +-
drivers/net/ethernet/intel/ice/ice_xsk.c | 4 +-
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 27 +-
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 5 +-
.../mellanox/mlx5/core/en/fs_tt_redirect.c | 1 +
.../net/ethernet/mellanox/mlx5/core/en/params.c | 4 +-
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 2 +-
.../ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 10 +-
drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 26 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 +-
.../ethernet/mellanox/mlx5/core/esw/bridge_mcast.c | 14 +-
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 2 +
drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c | 2 +-
.../mellanox/mlx5/core/steering/dr_action.c | 17 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 43 +-
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +
drivers/net/fjes/fjes_hw.c | 37 +-
drivers/net/hyperv/netvsc_drv.c | 4 +-
drivers/net/phy/micrel.c | 11 +
drivers/net/tun.c | 10 +-
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 4 +-
drivers/opp/core.c | 6 +-
drivers/parisc/power.c | 2 +-
.../uncore-frequency/uncore-frequency-common.c | 82 +-
.../uncore-frequency/uncore-frequency-common.h | 32 +-
drivers/platform/x86/p2sb.c | 180 ++++-
drivers/rpmsg/virtio_rpmsg_bus.c | 1 +
drivers/rtc/rtc-cmos.c | 28 +-
drivers/rtc/rtc-mc146818-lib.c | 39 +-
drivers/s390/crypto/vfio_ap_ops.c | 269 ++++---
drivers/s390/crypto/vfio_ap_private.h | 3 +
drivers/scsi/scsi_error.c | 9 +-
drivers/soc/fsl/qe/qmc.c | 35 +-
drivers/soc/fsl/qe/tsa.c | 22 +-
drivers/soc/qcom/pmic_glink_altmode.c | 4 +-
drivers/soundwire/amd_manager.c | 8 +
drivers/soundwire/bus.c | 4 +
drivers/soundwire/debugfs.c | 2 +-
drivers/soundwire/intel_auxdevice.c | 3 +
drivers/soundwire/master.c | 2 +-
drivers/soundwire/qcom.c | 3 +
drivers/soundwire/slave.c | 12 +-
drivers/spi/spi-bcm-qspi.c | 4 +-
drivers/spi/spi-cadence.c | 17 +-
drivers/spi/spi-intel-pci.c | 1 -
drivers/spi/spi.c | 4 +
drivers/thermal/gov_bang_bang.c | 23 +-
drivers/thermal/gov_fair_share.c | 5 +-
drivers/thermal/gov_power_allocator.c | 13 +-
drivers/thermal/gov_step_wise.c | 16 +-
drivers/thermal/intel/intel_hfi.c | 106 ++-
drivers/thermal/thermal_core.c | 15 +-
drivers/thermal/thermal_core.h | 4 +-
drivers/thermal/thermal_helpers.c | 5 +-
drivers/thermal/thermal_sysfs.c | 3 +-
drivers/thermal/thermal_trip.c | 16 +-
drivers/tty/serial/imx.c | 4 -
drivers/tty/serial/sc16is7xx.c | 389 ++++-----
drivers/tty/serial/serial_core.c | 58 +-
drivers/tty/serial/stm32-usart.c | 8 +-
drivers/ufs/core/ufshcd.c | 7 +-
fs/afs/dir.c | 8 +
fs/btrfs/extent-tree.c | 53 +-
fs/btrfs/inode.c | 22 +-
fs/btrfs/ioctl.c | 7 +
fs/btrfs/ref-verify.c | 6 +-
fs/btrfs/scrub.c | 29 +-
fs/btrfs/sysfs.c | 4 +
fs/btrfs/tree-checker.c | 2 +-
fs/btrfs/zoned.c | 8 +-
fs/dlm/lowcomms.c | 14 +-
fs/erofs/decompressor.c | 31 +-
fs/exec.c | 3 +
fs/ext4/mballoc.c | 15 +-
fs/fscache/cache.c | 3 +-
fs/ioctl.c | 3 +-
fs/namei.c | 60 +-
fs/nfsd/nfs4state.c | 26 +-
fs/pipe.c | 19 +-
fs/smb/client/cifs_debug.c | 5 +
fs/smb/client/cifsglob.h | 2 +
fs/smb/client/cifsproto.h | 5 +-
fs/smb/client/connect.c | 31 +-
fs/smb/client/sess.c | 96 ++-
fs/smb/client/smb2ops.c | 10 +-
fs/smb/client/smb2pdu.c | 162 +++-
fs/smb/client/smb2transport.c | 8 +-
fs/smb/client/transport.c | 2 +-
fs/smb/server/connection.c | 1 +
fs/smb/server/ksmbd_netlink.h | 3 +-
fs/smb/server/oplock.c | 16 +-
fs/smb/server/smb2pdu.c | 8 +-
fs/smb/server/transport_ipc.c | 4 +-
fs/ubifs/dir.c | 2 +
fs/xfs/xfs_super.c | 27 +-
include/drm/drm_drv.h | 9 +
include/drm/drm_file.h | 12 +
include/drm/drm_plane.h | 10 +
include/linux/async.h | 2 +
include/linux/bpf-cgroup.h | 73 +-
include/linux/bpf_verifier.h | 32 +
include/linux/filter.h | 1 +
include/linux/lsm_hook_defs.h | 2 +
include/linux/mc146818rtc.h | 3 +-
include/linux/mlx5/fs.h | 2 +
include/linux/mlx5/mlx5_ifc.h | 2 +-
include/linux/mmzone.h | 14 +-
include/linux/mtd/rawnand.h | 2 +
include/linux/pipe_fs_i.h | 16 +
include/linux/rmap.h | 4 +-
include/linux/security.h | 9 +
include/linux/serial_core.h | 79 ++
include/linux/skmsg.h | 6 -
include/linux/soundwire/sdw.h | 4 +-
include/linux/stmmac.h | 1 +
include/linux/syscalls.h | 1 +
include/media/v4l2-cci.h | 11 +
include/net/inet_connection_sock.h | 8 +
include/net/inet_sock.h | 5 -
include/net/llc_pdu.h | 6 +-
include/net/sch_generic.h | 4 +
include/net/sock.h | 18 +-
include/net/xdp_sock_drv.h | 27 +
include/uapi/linux/btrfs.h | 3 +
kernel/async.c | 85 +-
kernel/bpf/btf.c | 1 +
kernel/bpf/cgroup.c | 17 +-
kernel/bpf/verifier.c | 875 ++++++++++++++++-----
kernel/irq/irqdesc.c | 2 +-
kernel/kexec_core.c | 1 +
kernel/power/swap.c | 38 +-
kernel/rcu/tree.c | 34 +-
kernel/rcu/tree_exp.h | 3 +-
kernel/time/clocksource.c | 25 +-
kernel/time/tick-sched.c | 5 +
kernel/trace/tracing_map.c | 7 +-
lib/crypto/mpi/ec.c | 3 +
mm/memblock.c | 3 +
mm/migrate.c | 65 +-
mm/mm_init.c | 6 +
mm/page_alloc.c | 16 +-
mm/sparse.c | 17 +-
net/8021q/vlan_netlink.c | 4 +
net/core/dev.c | 9 +
net/core/dev.h | 3 +
net/core/filter.c | 79 +-
net/core/request_sock.c | 3 -
net/core/sock.c | 11 +-
net/ipv4/af_inet.c | 12 +-
net/ipv4/inet_connection_sock.c | 4 +
net/ipv4/ping.c | 2 +-
net/ipv4/tcp.c | 1 +
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv4/udp.c | 9 +-
net/ipv6/af_inet6.c | 12 +-
net/ipv6/ping.c | 2 +-
net/ipv6/tcp_ipv6.c | 2 +-
net/ipv6/udp.c | 6 +-
net/llc/af_llc.c | 24 +-
net/llc/llc_core.c | 7 -
net/mac80211/sta_info.c | 5 +-
net/netfilter/nf_tables_api.c | 20 +-
net/netfilter/nft_chain_filter.c | 11 +-
net/netfilter/nft_compat.c | 12 +
net/netfilter/nft_flow_offload.c | 5 +
net/netfilter/nft_limit.c | 23 +-
net/netfilter/nft_nat.c | 5 +
net/netfilter/nft_rt.c | 5 +
net/netfilter/nft_socket.c | 5 +
net/netfilter/nft_synproxy.c | 7 +-
net/netfilter/nft_tproxy.c | 5 +
net/netfilter/nft_xfrm.c | 5 +
net/netlink/af_netlink.c | 2 +-
net/rds/af_rds.c | 2 +-
net/sched/cls_api.c | 9 +-
net/sched/cls_flower.c | 23 +
net/smc/smc_diag.c | 2 +-
net/sunrpc/svcsock.c | 4 +-
net/xdp/xsk.c | 12 +-
net/xdp/xsk_buff_pool.c | 1 +
scripts/get_abi.pl | 2 +-
security/security.c | 18 +
security/selinux/hooks.c | 28 +
security/smack/smack_lsm.c | 1 +
security/tomoyo/tomoyo.c | 1 +
sound/soc/intel/boards/sof_sdw.c | 4 +-
tools/testing/selftests/bpf/prog_tests/verifier.c | 2 +
tools/testing/selftests/bpf/progs/cb_refs.c | 1 +
tools/testing/selftests/bpf/progs/iters.c | 695 ++++++++++++++++
tools/testing/selftests/bpf/progs/strobemeta.h | 78 +-
.../bpf/progs/verifier_iterating_callbacks.c | 242 ++++++
.../bpf/progs/verifier_subprog_precision.c | 86 +-
.../selftests/bpf/progs/xdp_synproxy_kern.c | 84 +-
.../selftests/drivers/net/bonding/bond_options.sh | 8 +-
.../testing/selftests/drivers/net/bonding/settings | 2 +-
.../drivers/net/netdevsim/udp_tunnel_nic.sh | 9 +
tools/testing/selftests/mm/hugepage-vmemmap.c | 29 +-
tools/testing/selftests/net/config | 28 +
tools/testing/selftests/net/rps_default_mask.sh | 6 +-
tools/testing/selftests/net/so_incoming_cpu.c | 68 +-
366 files changed, 5747 insertions(+), 2192 deletions(-)Greg Kroah-Hartman
maintainerPATCH 1/331 docs: sparse: move TW sparse.txt to TW dev-tools
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Min-Hua Chen <[email protected]>
[ Upstream commit 253f68f413a87a4e2bd93e61b00410e5e1b7b774 ]
Follow Randy's advice [1] to move Documentation/translations/zh_TW/sparse.txt to Documentation/translations/zh_TW/dev-tools/sparse.txt
[1] https://lore.kernel.org/lkml/[email protected]/
Stable-dep-of: c48a7c44a1d0 ("docs: kernel_feat.py: fix potential command injection")
---
Documentation/translations/zh_TW/{ => dev-tools}/sparse.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename Documentation/translations/zh_TW/{ => dev-tools}/sparse.txt (100%)Documentation/translations/zh_TW/dev-tools/sparse.txt renamed from Documentation/translations/zh_TW/sparse.txt +0 -0
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 2/331 docs: sparse: add sparse.rst to toctree
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Min-Hua Chen <[email protected]>
[ Upstream commit c9ad95adc096f25004d4192258863806a68a9bc8 ]
Add sparst.rst to toctree, so it can be part of the docs build.
Stable-dep-of: c48a7c44a1d0 ("docs: kernel_feat.py: fix potential command injection")
--- .../translations/zh_TW/dev-tools/index.rst | 40 +++++++++++++++++++ Documentation/translations/zh_TW/index.rst | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 Documentation/translations/zh_TW/dev-tools/index.rst
Documentation/translations/zh_TW/dev-tools/index.rst new file +40 -0
@@ -0,0 +1,40 @@ +.. include:: ../disclaimer-zh_TW.rst + +:Original: Documentation/dev-tools/index.rst +:Translator: Min-Hua Chen <[email protected]> + +============ +內核開發工具 +============ + +本文檔是有關內核開發工具文檔的合集。 +目前這些文檔已經整理在一起,不需要再花費額外的精力。 +歡迎任何補丁。 + +有關測試專用工具的簡要概述,參見 +Documentation/dev-tools/testing-overview.rst + +.. class:: toc-title + + 目錄 + +.. toctree:: + :maxdepth: 2 + + sparse + +Todolist: + + - coccinelle + - kcov + - ubsan + - kmemleak + - kcsan + - kfence + - kgdb + - kselftest + - kunit/index + - testing-overview + - gcov + - kasan + - gdb-kernel-debugging
Documentation/translations/zh_TW/index.rst +1 -1
@@ -55,11 +55,11 @@ TODOList: :maxdepth: 1 process/license-rules + dev-tools/index TODOList: * doc-guide/index -* dev-tools/index * dev-tools/testing-overview * kernel-hacking/index * rust/index
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 3/331 docs: kernel_feat.py: fix potential command injection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit c48a7c44a1d02516309015b6134c9bb982e17008 ]
The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use subprocess.check_call() instead of subprocess.Popen(shell=True).
This also makes the code shorter.
This is analogous to commit 3231dd586277 ("docs: kernel_abi.py: fix command injection") where we did exactly the same thing for kernel_abi.py, somehow I completely missed this one.
--- Documentation/admin-guide/features.rst | 2 +- Documentation/arch/arc/features.rst | 2 +- Documentation/arch/arm/features.rst | 2 +- Documentation/arch/arm64/features.rst | 2 +- Documentation/arch/loongarch/features.rst | 2 +- Documentation/arch/m68k/features.rst | 2 +- Documentation/arch/mips/features.rst | 2 +- Documentation/arch/nios2/features.rst | 2 +- Documentation/arch/openrisc/features.rst | 2 +- Documentation/arch/parisc/features.rst | 2 +- Documentation/arch/s390/features.rst | 2 +- Documentation/arch/sh/features.rst | 2 +- Documentation/arch/sparc/features.rst | 2 +- Documentation/arch/x86/features.rst | 2 +- Documentation/arch/xtensa/features.rst | 2 +- Documentation/powerpc/features.rst | 2 +- Documentation/riscv/features.rst | 2 +- Documentation/sphinx/kernel_feat.py | 55 ++++--------------- .../zh_CN/arch/loongarch/features.rst | 2 +- .../translations/zh_CN/arch/mips/features.rst | 2 +- 20 files changed, 30 insertions(+), 63 deletions(-)
Documentation/admin-guide/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features +.. kernel-feat:: features
Documentation/arch/arc/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features arc +.. kernel-feat:: features arc
Documentation/arch/arm/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features arm +.. kernel-feat:: features arm
Documentation/arch/arm64/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features arm64 +.. kernel-feat:: features arm64
Documentation/arch/loongarch/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features loongarch +.. kernel-feat:: features loongarch
Documentation/arch/m68k/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features m68k +.. kernel-feat:: features m68k
Documentation/arch/mips/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features mips +.. kernel-feat:: features mips
Documentation/arch/nios2/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features nios2 +.. kernel-feat:: features nios2
Documentation/arch/openrisc/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features openrisc +.. kernel-feat:: features openrisc
Documentation/arch/parisc/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features parisc +.. kernel-feat:: features parisc
Documentation/arch/s390/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features s390 +.. kernel-feat:: features s390
Documentation/arch/sh/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features sh +.. kernel-feat:: features sh
Documentation/arch/sparc/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features sparc +.. kernel-feat:: features sparc
Documentation/arch/x86/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features x86 +.. kernel-feat:: features x86
Documentation/arch/xtensa/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features xtensa +.. kernel-feat:: features xtensa
Documentation/powerpc/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features powerpc +.. kernel-feat:: features powerpc
Documentation/riscv/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features riscv +.. kernel-feat:: features riscv
Documentation/sphinx/kernel_feat.py +11 -44
82 lines not on this page · raw message
Documentation/translations/zh_CN/arch/loongarch/features.rst +1 -1
@@ -5,4 +5,4 @@ :Original: Documentation/arch/loongarch/features.rst :Translator: Huacai Chen <[email protected]> -.. kernel-feat:: $srctree/Documentation/features loongarch +.. kernel-feat:: features loongarch
Documentation/translations/zh_CN/arch/mips/features.rst +1 -1
@@ -10,4 +10,4 @@ .. _cn_features: -.. kernel-feat:: $srctree/Documentation/features mips +.. kernel-feat:: features mips
Signature · 1 line
2.43.0
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.
Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex = re.compile("^\.\. LINENO ([0-9]+)$")
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/maintainers_include.py:80: SyntaxWarning: invalid escape sequence '\s'
pat = '(Documentation/([^\s\?\*]*)\.rst)'
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/maintainers_include.py:93: SyntaxWarning: invalid escape sequence '\s'
m = re.search("\s(\S):\s", line)
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/maintainers_include.py:97: SyntaxWarning: invalid escape sequence '\*'
m = re.search("\*([^\*]+)\*", line)
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/maintainers_include.py:115: SyntaxWarning: invalid escape sequence '\s'
heading = re.sub("\s+", " ", line)
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kernel_abi.py:105: SyntaxWarning: invalid escape sequence '\.'
line_regex = re.compile("^\.\. LINENO (\S+)\#([0-9]+)$")
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kernel_feat.py:98: SyntaxWarning: invalid escape sequence '\.'
line_regex = re.compile("^\.\. FILE (\S+)$")
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Makefile:1715: htmldocs] Error 2
Reverting this patch allows docs to build.
Thanks,
Justin
Jonathan Corbet
maintainerRe: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 29 lines · Justin Forbes
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")
Ah ... you're missing 86a0adc029d3 (Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.
Thanks,
jon
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 35 lines · Jonathan Corbet
Quoted 32 lines · Justin Forbes
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
Quoted 6 lines
Quoted 2 lines
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.
Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with 86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?
Jusitn
Quoted 4 lines
Thanks,
jon
Greg Kroah-Hartman
maintainerRe: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 39 lines · Justin Forbes
Quoted 38 lines · Jonathan Corbet
Quoted 34 lines · Justin Forbes
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")
Quoted 8 lines
Quoted 3 lines
Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?
Sure, but again, that should be independent of this change, right?
thanks,
greg k-h
Quoted 8 lines
Jusitn
Quoted 4 lines
Thanks,
jon
Jonathan Corbet
maintainerRe: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 7 lines · Greg Kroah-Hartman
Quoted 4 lines · Justin Forbes
Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Sure, but again, that should be independent of this change, right?
Yes, it's an independent change but seems worth backporting if people are running into the issue.
Thanks,
jon
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
In reply to Greg Kroah-HartmanQuoted 45 lines · Greg Kroah-Hartman
Quoted 43 lines · Justin Forbes
Quoted 41 lines · Jonathan Corbet
Quoted 29 lines · Justin Forbes
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.
Quoted 6 lines
Quoted 4 lines
Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
Justin
Quoted 14 lines
thanks,
greg k-h
Quoted 8 lines
Jusitn
Quoted 4 lines
Thanks,
jon
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 53 lines · Justin Forbes
Quoted 50 lines · Greg Kroah-Hartman
Quoted 47 lines · Justin Forbes
Quoted 35 lines · Jonathan Corbet
Quoted 32 lines · Justin Forbes
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
Quoted 6 lines
Quoted 2 lines
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
Justin
Quoted 16 lines
Justin
Quoted 14 lines
thanks,
greg k-h
Quoted 8 lines
Jusitn
Quoted 4 lines
Thanks,
jon
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 55 lines · Justin Forbes
Quoted 53 lines · Justin Forbes
Quoted 50 lines · Greg Kroah-Hartman
Quoted 47 lines · Justin Forbes
Quoted 35 lines · Jonathan Corbet
Quoted 32 lines · Justin Forbes
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use
subprocess.check_call()instead ofsubprocess.Popen(shell=True).This also makes the code shorter.
This is analogous to commit
3231dd586277("docs:kernel_abi.py: fix command injection") where we did exactly the same thing forkernel_abi.py, somehow I completely missed this one.Quoted 7 lines
Reported-by Jani Nikula <[email protected]>Signed-off-by Vegard Nossum <[email protected]>Signed-off-by Jonathan Corbet <[email protected]>Signed-off-by Sasha Levin <[email protected]>This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
Quoted 6 lines
Quoted 2 lines
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
I lied, it just fails slightly differently. Some of the noise is gone,
but we still have:
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is
not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.15/linux-6.6.15-200.fc39.noarch/Makefile:1715:
htmldocs] Error 2
Quoted 18 lines
Justin
Quoted 16 lines
Justin
Quoted 14 lines
thanks,
greg k-h
Quoted 8 lines
Jusitn
Quoted 4 lines
Thanks,
jon
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 18 lines · Justin Forbes
Quoted 17 lines · Justin Forbes
Quoted 16 lines · Justin Forbes
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Justin Forbes
Quoted 12 lines · Jonathan Corbet
Quoted 11 lines · Justin Forbes
Quoted 10 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
[...]
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines
Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
Quoted 8 lines
I lied, it just fails slightly differently. Some of the noise is gone,
but we still have:
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is
not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.15/linux-6.6.15-200.fc39.noarch/Makefile:1715:
htmldocs] Error 2
The old version of the script unconditionally assigned a value to the local variable 'fname' (not a value that makes sense to me, since it's literally assigning the whole command, not just a filename, but that's a separate issue), and I removed that so it's only conditionally assigned. This is almost certainly a bug in my patch.
I'm guessing maybe a different patch between 6.6 and current mainline is causing 'fname' to always get assigned for the newer versions and thus make the run succeed, in spite of the bug.
Something like the patch below (completely untested) should restore the previous behaviour, but I'm not convinced it's correct.
Vegard
Documentation/sphinx/kernel_feat.py +2 -0
@@ -93,6 +93,8 @@ class KernelFeat(Directive): if len(self.arguments) > 1: args.extend(['--arch', self.arguments[1]]) + fname = ' '.join(args) + lines = subprocess.check_output(args,
cwd=os.path.dirname(doc.current_source)).decode('utf-8')
line_regex = re.compile(r"^\.\. FILE (\S+)$")
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Hi,
Quoted 86 lines · Vegard Nossum
Quoted 18 lines · Justin Forbes
Quoted 17 lines · Justin Forbes
Quoted 16 lines · Justin Forbes
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Justin Forbes
Quoted 12 lines · Jonathan Corbet
Quoted 11 lines · Justin Forbes
Quoted 10 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
[...]
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines
Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
Quoted 8 lines
I lied, it just fails slightly differently. Some of the noise is gone,
but we still have:
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is
not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.15/linux-6.6.15-200.fc39.noarch/Makefile:1715:
htmldocs] Error 2The old version of the script unconditionally assigned a value to the local variable 'fname' (not a value that makes sense to me, since it's literally assigning the whole command, not just a filename, but that's a separate issue), and I removed that so it's only conditionally assigned. This is almost certainly a bug in my patch.
I'm guessing maybe a different patch between 6.6 and current mainline is causing 'fname' to always get assigned for the newer versions and thus make the run succeed, in spite of the bug.
Something like the patch below (completely untested) should restore the previous behaviour, but I'm not convinced it's correct.
Vegard
Documentation/sphinx/kernel_feat.py +2
-0@@ -93,6 +93,8 @@ class KernelFeat(Directive): if len(self.arguments) > 1: args.extend(['--arch', self.arguments[1]]) + fname = ' '.join(args) + lines = subprocess.check_output(args, cwd=os.path.dirname(doc.current_source)).decode('utf-8')
Quoted 1 line
line_regex = re.compile(r"^\.\. FILE (\S+)$")
We have as well a documention build problem in Debian, cf.
https://buildd.debian.org/status/fetch.php?pkg=linux&arch=all&ver=6.6.15-1&stamp=1707050360&raw=0
though not yet using python 3.12 as default.
Your above change seems to workaround the issue in fact, but need to do a full build yet.
Regards,
Salvatore
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 89 lines · Salvatore Bonaccorso
Hi,
Quoted 86 lines · Vegard Nossum
Quoted 18 lines · Justin Forbes
Quoted 17 lines · Justin Forbes
Quoted 16 lines · Justin Forbes
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Justin Forbes
Quoted 12 lines · Jonathan Corbet
Quoted 11 lines · Justin Forbes
Quoted 10 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
[...]
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines
Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
Quoted 8 lines
I lied, it just fails slightly differently. Some of the noise is gone,
but we still have:
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is
not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.15/linux-6.6.15-200.fc39.noarch/Makefile:1715:
htmldocs] Error 2The old version of the script unconditionally assigned a value to the local variable 'fname' (not a value that makes sense to me, since it's literally assigning the whole command, not just a filename, but that's a separate issue), and I removed that so it's only conditionally assigned. This is almost certainly a bug in my patch.
I'm guessing maybe a different patch between 6.6 and current mainline is causing 'fname' to always get assigned for the newer versions and thus make the run succeed, in spite of the bug.
Something like the patch below (completely untested) should restore the previous behaviour, but I'm not convinced it's correct.
Vegard
Documentation/sphinx/kernel_feat.py +2
-0@@ -93,6 +93,8 @@ class KernelFeat(Directive): if len(self.arguments) > 1: args.extend(['--arch', self.arguments[1]]) + fname = ' '.join(args) + lines = subprocess.check_output(args, cwd=os.path.dirname(doc.current_source)).decode('utf-8')
Quoted 8 lines
Quoted 1 line
line_regex = re.compile(r"^\.\. FILE (\S+)$")We have as well a documention build problem in Debian, cf.
https://buildd.debian.org/status/fetch.php?pkg=linux&arch=all&ver=6.6.15-1&stamp=1707050360&raw=0
though not yet using python 3.12 as default.Your above change seems to workaround the issue in fact, but need to do a full build yet.
For Debian I'm temporarily reverting from the 6.6.15 upload:
e961f8c6966a ("docs: kernel_feat.py: fix potential command injection")
This is not the best solution, but unbreaks several other builds.
The alternative would be to apply Vegard's workaround or the proper solution for that.
Regards,
Salvatore
Greg Kroah-Hartman
maintainerRe: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 99 lines · Salvatore Bonaccorso
Quoted 89 lines · Salvatore Bonaccorso
Hi,
Quoted 86 lines · Vegard Nossum
Quoted 18 lines · Justin Forbes
Quoted 17 lines · Justin Forbes
Quoted 16 lines · Justin Forbes
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Justin Forbes
Quoted 12 lines · Jonathan Corbet
Quoted 11 lines · Justin Forbes
Quoted 10 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
[...]
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines
Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
Quoted 8 lines
I lied, it just fails slightly differently. Some of the noise is gone,
but we still have:
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is
not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.15/linux-6.6.15-200.fc39.noarch/Makefile:1715:
htmldocs] Error 2The old version of the script unconditionally assigned a value to the local variable 'fname' (not a value that makes sense to me, since it's literally assigning the whole command, not just a filename, but that's a separate issue), and I removed that so it's only conditionally assigned. This is almost certainly a bug in my patch.
I'm guessing maybe a different patch between 6.6 and current mainline is causing 'fname' to always get assigned for the newer versions and thus make the run succeed, in spite of the bug.
Something like the patch below (completely untested) should restore the previous behaviour, but I'm not convinced it's correct.
Vegard
Documentation/sphinx/kernel_feat.py +2
-0@@ -93,6 +93,8 @@ class KernelFeat(Directive): if len(self.arguments) > 1: args.extend(['--arch', self.arguments[1]]) + fname = ' '.join(args) + lines = subprocess.check_output(args, cwd=os.path.dirname(doc.current_source)).decode('utf-8')Quoted 8 lines
Quoted 1 line
line_regex = re.compile(r"^\.\. FILE (\S+)$")We have as well a documention build problem in Debian, cf.
https://buildd.debian.org/status/fetch.php?pkg=linux&arch=all&ver=6.6.15-1&stamp=1707050360&raw=0
though not yet using python 3.12 as default.Your above change seems to workaround the issue in fact, but need to do a full build yet.
Quoted 8 lines
For Debian I'm temporarily reverting from the 6.6.15 upload:
e961f8c6966a("docs:kernel_feat.py: fix potential command injection")This is not the best solution, but unbreaks several other builds.
The alternative would be to apply Vegard's workaround or the proper solution for that.
What is the "proper" solution here? Does 6.8-rc3 work? What are we missing to be backported here?
thanks,
greg k-h
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 105 lines · Greg Kroah-Hartman
Quoted 103 lines · Salvatore Bonaccorso
Quoted 89 lines · Salvatore Bonaccorso
Hi,
Quoted 86 lines · Vegard Nossum
Quoted 18 lines · Justin Forbes
Quoted 17 lines · Justin Forbes
Quoted 16 lines · Justin Forbes
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Justin Forbes
Quoted 12 lines · Jonathan Corbet
Quoted 11 lines · Justin Forbes
Quoted 10 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
[ Upstream commit
c48a7c44a1d02516309015b6134c9bb982e17008]The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.
[...]
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines
Quoted 5 lines
This patch seems to be missing something. In 6.6.15-rc1 I get a doc build failure with:
/builddir/build/BUILD/kernel-6.6.14-332-g1ff49073b88b/linux-6.6.15-0.rc1.1ff49073b88b.200.fc39.noarch/Documentation/sphinx/kerneldoc.py:133: SyntaxWarning: invalid escape sequence '\.'
line_regex= re.compile("^\.\. LINENO ([0-9]+)$")Ah ... you're missing
86a0adc029d3(Documentation/sphinx: fix Python string escapes). That is not a problem with this patch, though; I would expect you to get the same error (with Python 3.12) without.Well, it appears that 6.6.15 shipped anyway, with this patch included, but not with
86a0adc029d3. If anyone else builds docs, this thread should at least show them the fix. Perhaps we can get the missing patch into 6.6.16?Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Sure, but again, that should be independent of this change, right?
I am not sure I would say independent. This particular change causes docs to fail the build as I mentioned during rc1. There were no issues building 6.6.14 or previous releases, and no problem building 6.7.3.
I can confirm that adding this patch to 6.6.15 makes docs build again.
Quoted 8 lines
I lied, it just fails slightly differently. Some of the noise is gone,
but we still have:
Sphinx parallel build error:
UnboundLocalError: cannot access local variable 'fname' where it is
not associated with a value
make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
make[1]: *** [/builddir/build/BUILD/kernel-6.6.15/linux-6.6.15-200.fc39.noarch/Makefile:1715:
htmldocs] Error 2The old version of the script unconditionally assigned a value to the local variable 'fname' (not a value that makes sense to me, since it's literally assigning the whole command, not just a filename, but that's a separate issue), and I removed that so it's only conditionally assigned. This is almost certainly a bug in my patch.
I'm guessing maybe a different patch between 6.6 and current mainline is causing 'fname' to always get assigned for the newer versions and thus make the run succeed, in spite of the bug.
Something like the patch below (completely untested) should restore the previous behaviour, but I'm not convinced it's correct.
Vegard
Documentation/sphinx/kernel_feat.py +2
-0@@ -93,6 +93,8 @@ class KernelFeat(Directive): if len(self.arguments) > 1: args.extend(['--arch', self.arguments[1]]) + fname = ' '.join(args) + lines = subprocess.check_output(args, cwd=os.path.dirname(doc.current_source)).decode('utf-8')Quoted 8 lines
Quoted 1 line
line_regex = re.compile(r"^\.\. FILE (\S+)$")We have as well a documention build problem in Debian, cf.
https://buildd.debian.org/status/fetch.php?pkg=linux&arch=all&ver=6.6.15-1&stamp=1707050360&raw=0
though not yet using python 3.12 as default.Your above change seems to workaround the issue in fact, but need to do a full build yet.
For Debian I'm temporarily reverting from the 6.6.15 upload:
e961f8c6966a("docs:kernel_feat.py: fix potential command injection")
Quoted 7 lines
Quoted 4 lines
This is not the best solution, but unbreaks several other builds.
The alternative would be to apply Vegard's workaround or the proper solution for that.
What is the "proper" solution here? Does 6.8-rc3 work? What are we missing to be backported here?
I am not sure what the "proper"fix was, but as I mentioned with 6.6.15, this patch broke the build with 6.6.15, but 6.7.3 and newer were fine. I think the fix came in through another path incidentally, but Vegard mentioned a possible fox for 6.6 kernels. Realistically, Fedora has moved on to 6.7.x now, but I do still test 6.6.x stable rcs and while I reported that 6.6.16 was good, it was only because I saw no regressions from 6.6.15. The docs failure from this patch still exists.
Justin
Quoted 4 lines
thanks,
greg k-h
Re: [PATCH 6.6 003/331] docs: kernel_feat.py: fix potential command injection
Quoted 5 lines · Justin Forbes
Quoted 3 lines · Greg Kroah-Hartman
Quoted 2 lines · Salvatore Bonaccorso
Quoted 1 line · Salvatore Bonaccorso
On Thu, Feb 01, 2024 at 05:34:25PM +0100, Vegard Nossum wrote:
[...]
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
I'm guessing maybe a different patch between 6.6 and current mainline is causing 'fname' to always get assigned for the newer versions and thus make the run succeed, in spite of the bug.
Something like the patch below (completely untested) should restore the previous behaviour, but I'm not convinced it's correct.
[...]
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Your above change seems to workaround the issue in fact, but need to do a full build yet.
For Debian I'm temporarily reverting from the 6.6.15 upload:
e961f8c6966a("docs:kernel_feat.py: fix potential command injection")Quoted 7 lines
Quoted 4 lines
This is not the best solution, but unbreaks several other builds.
The alternative would be to apply Vegard's workaround or the proper solution for that.
What is the "proper" solution here? Does 6.8-rc3 work? What are we missing to be backported here?
Quoted 8 lines
I am not sure what the "proper"fix was, but as I mentioned with 6.6.15, this patch broke the build with 6.6.15, but 6.7.3 and newer were fine. I think the fix came in through another path incidentally, but Vegard mentioned a possible fox for 6.6 kernels. Realistically, Fedora has moved on to 6.7.x now, but I do still test 6.6.x stable rcs and while I reported that 6.6.16 was good, it was only because I saw no regressions from 6.6.15. The docs failure from this patch still exists.
I'm thinking this might be missing from the backport of the stable patch, causing it to break on 6.6.15 (since ia64 was removed in 6.7):
Documentation/arch/ia64/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features ia64 +.. kernel-feat:: features ia64
I also think I understand the kernel_feat.py code a bit better and will submit a proper fix for that -- basically, if it doesn't manage to process any lines from the referenced file (which it won't for ia64 since it literally tries to open a file called $srctree/...) then it calls self.nestedParse() with a non-existent 'fname' and an empty 'lines' -- so the value of the fname parameter is truly unused in the degenerate case, but it's still referencing the undefined 'fname'.
So I'm thinking:
1) the ia64/features.rst patch above for stable (only) to fix the immediate breakage in stable,
2) kernel_feat.py patch for mainline that can trickle down into stable once it's been merged.
Thanks, and sorry for the breakage.
Vegard
PATCH 1/1 Documentation/arch/ia64/features.rst: fix kernel-feat directive
My mainline commit c48a7c44a1d0 ("docs: kernel_feat.py: fix potential command injection") contains a bug which can manifests like this when building the documentation:
Sphinx parallel build error:
UnboundLocalError: local variable 'fname' referenced before assignment make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2
However, this only appears when there exists a '.. kernel-feat::' directive that points to a non-existent file, which isn't the case in mainline.
When this commit was backported to stable 6.6, it didn't change Documentation/arch/ia64/features.rst since ia64 was removed in 6.7 in commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture"). This lead to the build failure seen above -- but only in stable kernels.
This patch fixes the backport and should only be applied to kernels where Documentation/arch/ia64/features.rst exists and commit c48a7c44a1d0 has also been applied.
A second patch will follow to fix kernel_feat.py in mainline so that it doesn't error out when the '.. kernel-feat::' directive points to a nonexistent file.
Reported-y: Salvatore Bonaccorso <[email protected]>
--- Documentation/arch/ia64/features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/arch/ia64/features.rst +1 -1
@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features ia64 +.. kernel-feat:: features ia64
Signature · 1 line
2.34.1
Greg Kroah-Hartman
maintainerRe: [PATCH -stable] Documentation/arch/ia64/features.rst: fix kernel-feat directive
Quoted 45 lines · Vegard Nossum
My mainline commit
c48a7c44a1d0("docs:kernel_feat.py: fix potential command injection") contains a bug which can manifests like this when building the documentation:Sphinx parallel build error:
UnboundLocalError: local variable 'fname' referenced before assignment make[2]: *** [Documentation/Makefile:102: htmldocs] Error 2However, this only appears when there exists a '.. kernel-feat::' directive that points to a non-existent file, which isn't the case in mainline.
When this commit was backported to stable 6.6, it didn't change
Documentation/arch/ia64/features.rstsince ia64 was removed in 6.7 in commitcf8e8658100d("arch: Remove Itanium (IA-64) architecture"). This lead to the build failure seen above -- but only in stable kernels.This patch fixes the backport and should only be applied to kernels where
Documentation/arch/ia64/features.rstexists and commitc48a7c44a1d0has also been applied.A second patch will follow to fix
kernel_feat.pyin mainline so that it doesn't error out when the '.. kernel-feat::' directive points to a nonexistent file.Fixes e961f8c6966a ("docs: kernel_feat.py: fix potential command injection") # stable 6.6.15Reported-by Justin Forbes <[email protected]>Reported-y: Salvatore Bonaccorso <[email protected]>
Signed-off-by Vegard Nossum <[email protected]>--- Documentation/arch/ia64/features.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/arch/ia64/features.rst +1
-1@@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 -.. kernel-feat:: $srctree/Documentation/features ia64 +.. kernel-feat:: features ia64Signature · 1 line
2.34.1
Sorry for the delay, now queued up.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 4/331 serial: core: Simplify uart_get_rs485_mode()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit 7cda0b9eb6eb9e761f452e2ef4e81eca20b19938 ]
Simplify uart_get_rs485_mode() by using temporary variable for the GPIO descriptor. With that, use proper type for the flags of the GPIO descriptor.
Stable-dep-of: 1a33e33ca0e8 ("serial: core: set missing supported flag for RX during TX GPIO")
--- drivers/tty/serial/serial_core.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-)
drivers/tty/serial/serial_core.c +12 -18
@@ -3572,9 +3572,10 @@ int uart_get_rs485_mode(struct uart_port *port) {struct serial_rs485 *rs485conf = &port->rs485;struct device *dev = port->dev; +enum gpiod_flags dflags; +struct gpio_desc *desc;u32 rs485_delay[2 ];int ret; -int rx_during_tx_gpio_flag;if (!(port->rs485_supported.flags &SER_RS485_ENABLED ))return 0 ;
@@ -3616,26 +3617,19 @@ int uart_get_rs485_mode(struct uart_port *port)* bus participants enable it, no communication is possible at all. * Works fine for short cables and users may enable for longer cables. */ - port->rs485_term_gpio =devm_gpiod_get_optional (dev,"rs485-term" , -GPIOD_OUT_LOW ); -if (IS_ERR (port->rs485_term_gpio)) { - ret =PTR_ERR (port->rs485_term_gpio); - port->rs485_term_gpio =NULL ; -return dev_err_probe (dev, ret,"Cannot get rs485-term-gpios\n" ); - } + desc =devm_gpiod_get_optional (dev,"rs485-term" ,GPIOD_OUT_LOW ); +if (IS_ERR (desc)) +return dev_err_probe (dev,PTR_ERR (desc),"Cannot get rs485-term-gpios\n" ); + port->rs485_term_gpio = desc;if (port->rs485_term_gpio) port->rs485_supported.flags |=SER_RS485_TERMINATE_BUS ; - rx_during_tx_gpio_flag = (rs485conf->flags &SER_RS485_RX_DURING_TX ) ? -GPIOD_OUT_HIGH :GPIOD_OUT_LOW ; - port->rs485_rx_during_tx_gpio =devm_gpiod_get_optional (dev, -"rs485-rx-during-tx" , - rx_during_tx_gpio_flag); -if (IS_ERR (port->rs485_rx_during_tx_gpio)) { - ret =PTR_ERR (port->rs485_rx_during_tx_gpio); - port->rs485_rx_during_tx_gpio =NULL ; -return dev_err_probe (dev, ret,"Cannot get rs485-rx-during-tx-gpios\n" ); - } + dflags = (rs485conf->flags &SER_RS485_RX_DURING_TX ) ? +GPIOD_OUT_HIGH :GPIOD_OUT_LOW ; + desc =devm_gpiod_get_optional (dev,"rs485-rx-during-tx" , dflags); +if (IS_ERR (desc)) +return dev_err_probe (dev,PTR_ERR (desc),"Cannot get rs485-rx-during-tx-gpios\n" ); + port->rs485_rx_during_tx_gpio = desc;return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 5/331 serial: core: set missing supported flag for RX during TX GPIO
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lino Sanfilippo <[email protected]>
[ Upstream commit 1a33e33ca0e80d485458410f149265cdc0178cfa ]
If the RS485 feature RX-during-TX is supported by means of a GPIO set the according supported flag. Otherwise setting this feature from userspace may not be possible, since in uart_sanitize_serial_rs485() the passed RS485 configuration is matched against the supported features and unsupported settings are thereby removed and thus take no effect.
--- drivers/tty/serial/serial_core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/serial/serial_core.c +2 -0
@@ -3630,6 +3630,8 @@ int uart_get_rs485_mode(struct uart_port *port)if (IS_ERR (desc))return dev_err_probe (dev,PTR_ERR (desc),"Cannot get rs485-rx-during-tx-gpios\n" ); port->rs485_rx_during_tx_gpio = desc; +if (port->rs485_rx_during_tx_gpio) + port->rs485_supported.flags |=SER_RS485_RX_DURING_TX ;return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 6/331 soundwire: bus: introduce controller_id
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 6543ac13c623f906200dfd3f1c407d8d333b6995 ]
The existing SoundWire support misses a clear Controller/Manager hiearchical definition to deal with all variants across SOC vendors.
a) Intel platforms have one controller with 4 or more Managers.
b) AMD platforms have two controllers with one Manager each, but due to BIOS issues use two different link_id values within the scope of a single controller.
c) QCOM platforms have one or more controller with one Manager each.
This patch adds a 'controller_id' which can be set by higher levels. If assigned to -1, the controller_id will be set to the system-unique IDA-assigned bus->id.
The main change is that the bus->id is no longer used for any device name, which makes the definition completely predictable and not dependent on any enumeration order. The bus->id is only used to insert the Managers in the stream rt context.
Stable-dep-of: 8a8a9ac8a497 ("soundwire: fix initializing sysfs for same devices on different buses")
--- drivers/soundwire/amd_manager.c | 8 ++++++++ drivers/soundwire/bus.c | 4 ++++ drivers/soundwire/debugfs.c | 2 +- drivers/soundwire/intel_auxdevice.c | 3 +++ drivers/soundwire/master.c | 2 +- drivers/soundwire/qcom.c | 3 +++ include/linux/soundwire/sdw.h | 4 +++- 7 files changed, 23 insertions(+), 3 deletions(-)
drivers/soundwire/amd_manager.c +8 -0
@@ -927,6 +927,14 @@ static int amd_sdw_manager_probe(struct platform_device *pdev) amd_manager->bus.clk_stop_timeout =200 ; amd_manager->bus.link_id = amd_manager->instance; +/* +* Due to BIOS compatibility, the two links are exposed within +* the scope of a single controller. If this changes, the +* controller_id will have to be updated with drv_data +* information. +*/ + amd_manager->bus.controller_id =0 ; +switch (amd_manager->instance) {case ACP_SDW0 : amd_manager->num_dout_ports =AMD_SDW0_MAX_TX_PORTS ;
drivers/soundwire/bus.c +4 -0
@@ -22,6 +22,10 @@ static int sdw_get_id(struct sdw_bus *bus)return rc; bus->id = rc; + +if (bus->controller_id ==-1 ) + bus->controller_id = rc; +return 0 ; }
drivers/soundwire/debugfs.c +1 -1
@@ -20,7 +20,7 @@ void sdw_bus_debugfs_init(struct sdw_bus *bus)return ;/* create the debugfs master-N */ -snprintf (name,sizeof (name),"master-%d-%d" , bus->id, bus->link_id); +snprintf (name,sizeof (name),"master-%d-%d" , bus->controller_id, bus->link_id); bus->debugfs =debugfs_create_dir (name, sdw_debugfs_root); }
drivers/soundwire/intel_auxdevice.c +3 -0
@@ -234,6 +234,9 @@ static int intel_link_probe(struct auxiliary_device *auxdev, cdns->instance = sdw->instance; cdns->msg_count =0 ; +/* single controller for all SoundWire links */ + bus->controller_id =0 ; + bus->link_id = auxdev->id; bus->clk_stop_timeout =1 ;
drivers/soundwire/master.c +1 -1
@@ -145,7 +145,7 @@ int sdw_master_device_add(struct sdw_bus *bus, struct device *parent, md->dev.fwnode = fwnode; md->dev.dma_mask = parent->dma_mask; -dev_set_name (&md->dev,"sdw-master-%d" , bus->id); +dev_set_name (&md->dev,"sdw-master-%d-%d" , bus->controller_id, bus->link_id); ret =device_register (&md->dev);if (ret) {
drivers/soundwire/qcom.c +3 -0
@@ -1612,6 +1612,9 @@ static int qcom_swrm_probe(struct platform_device *pdev) } } +/* FIXME: is there a DT-defined value to use ? */ + ctrl->bus.controller_id =-1 ; + ret =sdw_bus_master_add (&ctrl->bus, dev, dev->fwnode);if (ret) { dev_err(dev, "Failed to register Soundwire controller (%d)\n",
include/linux/soundwire/sdw.h +3 -1
@@ -886,7 +886,8 @@ struct sdw_master_ops {* struct sdw_bus - SoundWire bus * @dev: Shortcut to &bus->md->dev to avoid changing the entire code. * @md: Master device -* @link_id: Link id number, can be 0 to N, unique for each Master +* @controller_id: system-unique controller ID. If set to -1, the bus @id will be used. +* @link_id: Link id number, can be 0 to N, unique for each Controller * @id: bus system-wide unique id * @slaves: list of Slaves on this bus * @assigned: Bitmap for Slave device numbers.
@@ -918,6 +919,7 @@ struct sdw_master_ops {struct sdw_bus {struct device *dev;struct sdw_master_device *md; +int controller_id;unsigned int link_id;int id;struct list_head slaves;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 7/331 soundwire: fix initializing sysfs for same devices on different buses
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 8a8a9ac8a4972ee69d3dd3d1ae43963ae39cee18 ]
If same devices with same device IDs are present on different soundwire buses, the probe fails due to conflicting device names and sysfs entries:
sysfs: cannot create duplicate filename '/bus/soundwire/devices/sdw:0:0217:0204:00:0'
The link ID is 0 for both devices, so they should be differentiated by the controller ID. Add the controller ID so, the device names and sysfs entries look like:
sdw:1:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6ab0000.soundwire-controller/sdw-master-1-0/sdw:1:0:0217:0204:00:0 sdw:3:0:0217:0204:00:0 -> ../../../devices/platform/soc@0/6b10000.soundwire-controller/sdw-master-3-0/sdw:3:0:0217:0204:00:0
[PLB changes: use bus->controller_id instead of bus->id]
--- drivers/soundwire/slave.c | 12 ++++++------ sound/soc/intel/boards/sof_sdw.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/soundwire/slave.c +6 -6
@@ -39,14 +39,14 @@ int sdw_slave_add(struct sdw_bus *bus, slave->dev.fwnode = fwnode;if (id->unique_id ==SDW_IGNORED_UNIQUE_ID ) { -/* name shall be sdw:link:mfg:part:class */ -dev_set_name (&slave->dev,"sdw:%01x:%04x:%04x:%02x" , - bus->link_id, id->mfg_id, id->part_id, +/* name shall be sdw:ctrl:link:mfg:part:class */ +dev_set_name (&slave->dev,"sdw:%01x:%01x:%04x:%04x:%02x" , + bus->controller_id, bus->link_id, id->mfg_id, id->part_id, id->class_id); }else { -/* name shall be sdw:link:mfg:part:class:unique */ -dev_set_name (&slave->dev,"sdw:%01x:%04x:%04x:%02x:%01x" , - bus->link_id, id->mfg_id, id->part_id, +/* name shall be sdw:ctrl:link:mfg:part:class:unique */ +dev_set_name (&slave->dev,"sdw:%01x:%01x:%04x:%04x:%02x:%01x" , + bus->controller_id, bus->link_id, id->mfg_id, id->part_id, id->class_id, id->unique_id); }
sound/soc/intel/boards/sof_sdw.c +2 -2
@@ -1197,11 +1197,11 @@ static int fill_sdw_codec_dlc(struct device *dev,else if (is_unique_device (adr_link, sdw_version, mfg_id, part_id, class_id, adr_index)) codec->name =devm_kasprintf (dev,GFP_KERNEL , -"sdw:%01x:%04x:%04x:%02x" , link_id, +"sdw:0:%01x:%04x:%04x:%02x" , link_id, mfg_id, part_id, class_id);else codec->name =devm_kasprintf (dev,GFP_KERNEL , -"sdw:%01x:%04x:%04x:%02x:%01x" , link_id, +"sdw:0:%01x:%04x:%04x:%02x:%01x" , link_id, mfg_id, part_id, class_id, unique_id);if (!codec->name)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 8/331 net: stmmac: Tx coe sw fallback
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rohan G Thomas <[email protected]>
[ Upstream commit 8452a05b2c633b708dbe3e742f71b24bf21fe42d ]
Add sw fallback of tx checksum calculation for those tx queues that don't support tx checksum offloading. DW xGMAC IP can be synthesized such that it can support tx checksum offloading only for a few initial tx queues. Also as Serge pointed out, for the DW QoS IP, tx coe can be individually configured for each tx queue.
So when tx coe is enabled, for any tx queue that doesn't support tx coe with 'coe-unsupported' flag set will have a sw fallback happen in the driver for tx checksum calculation when any packets to be transmitted on these tx queues.
Stable-dep-of: c2945c435c99 ("net: stmmac: Prevent DSA tags from breaking COE")
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ++++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +++ include/linux/stmmac.h | 1 + 3 files changed, 14 insertions(+)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +10 -0
@@ -4417,6 +4417,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)WARN_ON (tx_q->tx_skbuff[first_entry]); csum_insertion = (skb->ip_summed ==CHECKSUM_PARTIAL ); +/* DWMAC IPs can be synthesized to support tx coe only for a few tx +* queues. In that case, checksum offloading for those queues that don't +* support tx coe needs to fallback to software checksum calculation. +*/ +if (csum_insertion && + priv->plat->tx_queues_cfg[queue].coe_unsupported) { +if (unlikely (skb_checksum_help (skb))) + goto dma_map_err; + csum_insertion = !csum_insertion; + }if (likely (priv->extend_desc)) desc = (struct dma_desc *)(tx_q->dma_etx + entry);
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
@@ -276,6 +276,9 @@ static int stmmac_mtl_setup(struct platform_device *pdev, plat->tx_queues_cfg[queue].use_prio = true; } + plat->tx_queues_cfg[queue].coe_unsupported = +of_property_read_bool (q_node,"snps,coe-unsupported" ); + queue++; }if (queue != plat->tx_queues_to_use) {
include/linux/stmmac.h +1 -0
@@ -139,6 +139,7 @@ struct stmmac_rxq_cfg {struct stmmac_txq_cfg {u32 weight; +bool coe_unsupported;u8 mode_to_use;/* Credit Base Shaper parameters */ u32 send_slope;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 9/331 net: stmmac: Prevent DSA tags from breaking COE
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Romain Gantois <[email protected]>
[ Upstream commit c2945c435c999c63e47f337bc7c13c98c21d0bcc ]
Some DSA tagging protocols change the EtherType field in the MAC header e.g. DSA_TAG_PROTO_(DSA/EDSA/BRCM/MTK/RTL4C_A/SJA1105). On TX these tagged frames are ignored by the checksum offload engine and IP header checker of some stmmac cores.
On RX, the stmmac driver wrongly assumes that checksums have been computed for these tagged packets, and sets CHECKSUM_UNNECESSARY.
Add an additional check in the stmmac TX and RX hotpaths so that COE is deactivated for packets with ethertypes that will not trigger the COE and IP header checks.
--- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +29 -3
@@ -4356,6 +4356,28 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)return NETDEV_TX_OK ; } +/** +* stmmac_has_ip_ethertype() - Check if packet has IP ethertype +* @skb: socket buffer to check +* +* Check if a packet has an ethertype that will trigger the IP header checks +* and IP/TCP checksum engine of the stmmac core. +* +* Return: true if the ethertype can trigger the checksum engine, false +* otherwise +*/ +static bool stmmac_has_ip_ethertype (struct sk_buff *skb) +{ +int depth =0 ; +__be16 proto; + + proto =__vlan_get_protocol (skb,eth_header_parse_protocol (skb), + &depth); + +return (depth <=ETH_HLEN ) && + (proto ==htons (ETH_P_IP ) || proto ==htons (ETH_P_IPV6 )); +} +/** * stmmac_xmit - Tx entry point of the driver * @skb : the socket buffer
@@ -4420,9 +4442,13 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)/* DWMAC IPs can be synthesized to support tx coe only for a few tx * queues. In that case, checksum offloading for those queues that don't * support tx coe needs to fallback to software checksum calculation. +* +* Packets that won't trigger the COE e.g. most DSA-tagged packets will +* also have to be checksummed in software. */ if (csum_insertion && - priv->plat->tx_queues_cfg[queue].coe_unsupported) { + (priv->plat->tx_queues_cfg[queue].coe_unsupported || + !stmmac_has_ip_ethertype (skb))) {if (unlikely (skb_checksum_help (skb))) goto dma_map_err; csum_insertion = !csum_insertion;
@@ -4982,7 +5008,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,stmmac_rx_vlan (priv->dev, skb); skb->protocol =eth_type_trans (skb, priv->dev); -if (unlikely (!coe)) +if (unlikely (!coe) || !stmmac_has_ip_ethertype (skb))skb_checksum_none_assert (skb);else skb->ip_summed =CHECKSUM_UNNECESSARY ;
@@ -5498,7 +5524,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)stmmac_rx_vlan (priv->dev, skb); skb->protocol =eth_type_trans (skb, priv->dev); -if (unlikely (!coe)) +if (unlikely (!coe) || !stmmac_has_ip_ethertype (skb))skb_checksum_none_assert (skb);else skb->ip_summed =CHECKSUM_UNNECESSARY ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 10/331 iio: adc: ad7091r: Set alert bit in config register
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Schmitt <[email protected]>
[ Upstream commit 149694f5e79b0c7a36ceb76e7c0d590db8f151c1 ]
The ad7091r-base driver sets up an interrupt handler for firing events when inputs are either above or below a certain threshold. However, for the interrupt signal to come from the device it must be configured to enable the ALERT/BUSY/GPO pin to be used as ALERT, which was not being done until now.
Enable interrupt signals on the ALERT/BUSY/GPO pin by setting the proper bit in the configuration register.
Stable-dep-of: 020e71c7ffc2 ("iio: adc: ad7091r: Allow users to configure device events")
--- drivers/iio/adc/ad7091r-base.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/iio/adc/ad7091r-base.c +6 -0
@@ -28,6 +28,7 @@#define AD7091R_REG_RESULT_CONV_RESULT (x) ((x) & 0xfff)/* AD7091R_REG_CONF */ +#define AD7091R_REG_CONF_ALERT_EN BIT(4)#define AD7091R_REG_CONF_AUTO BIT(8)#define AD7091R_REG_CONF_CMD BIT(10)
@@ -232,6 +233,11 @@ int ad7091r_probe(struct device *dev, const char *name, iio_dev->channels = chip_info->channels;if (irq) { + ret =regmap_update_bits (st->map,AD7091R_REG_CONF , +AD7091R_REG_CONF_ALERT_EN ,BIT (4 )); +if (ret) +return ret; + ret =devm_request_threaded_irq (dev, irq,NULL , ad7091r_event_handler,IRQF_TRIGGER_FALLING |IRQF_ONESHOT , name, iio_dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 11/331 iio: adc: ad7091r: Allow users to configure device events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Schmitt <[email protected]>
[ Upstream commit 020e71c7ffc25dfe29ed9be6c2d39af7bd7f661f ]
AD7091R-5 devices are supported by the ad7091r-5 driver together with the ad7091r-base driver. Those drivers declared iio events for notifying user space when ADC readings fall bellow the thresholds of low limit registers or above the values set in high limit registers. However, to configure iio events and their thresholds, a set of callback functions must be implemented and those were not present until now. The consequence of trying to configure ad7091r-5 events without the proper callback functions was a null pointer dereference in the kernel because the pointers to the callback functions were not set.
Implement event configuration callbacks allowing users to read/write event thresholds and enable/disable event generation.
Since the event spec structs are generic to AD7091R devices, also move those from the ad7091r-5 driver the base driver so they can be reused when support for ad7091r-2/-4/-8 be added.
--- drivers/iio/adc/ad7091r-base.c | 156 +++++++++++++++++++++++++++++++++ drivers/iio/adc/ad7091r-base.h | 6 ++ drivers/iio/adc/ad7091r5.c | 28 +----- 3 files changed, 166 insertions(+), 24 deletions(-)
drivers/iio/adc/ad7091r-base.c +156 -0
@@ -6,6 +6,7 @@*/ #include <linux/bitops.h> +#include <linux/bitfield.h> #include <linux/iio/events.h> #include <linux/iio/iio.h> #include <linux/interrupt.h>
@@ -50,6 +51,27 @@ struct ad7091r_state {struct mutex lock;/*lock to prevent concurent reads */ }; +const struct iio_event_spec ad7091r_events[] = { + { + .type =IIO_EV_TYPE_THRESH , + .dir =IIO_EV_DIR_RISING , + .mask_separate =BIT (IIO_EV_INFO_VALUE ) | +BIT (IIO_EV_INFO_ENABLE ), + }, + { + .type =IIO_EV_TYPE_THRESH , + .dir =IIO_EV_DIR_FALLING , + .mask_separate =BIT (IIO_EV_INFO_VALUE ) | +BIT (IIO_EV_INFO_ENABLE ), + }, + { + .type =IIO_EV_TYPE_THRESH , + .dir =IIO_EV_DIR_EITHER , + .mask_separate =BIT (IIO_EV_INFO_HYSTERESIS ), + }, +}; +EXPORT_SYMBOL_NS_GPL (ad7091r_events,IIO_AD7091R ); +static int ad7091r_set_mode (struct ad7091r_state *st,enum ad7091r_mode mode) {int ret, conf;
@@ -169,8 +191,142 @@ static int ad7091r_read_raw(struct iio_dev *iio_dev,return ret; } +static int ad7091r_read_event_config (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir) +{ +struct ad7091r_state *st =iio_priv (indio_dev); +int val, ret; + +switch (dir) { +case IIO_EV_DIR_RISING : + ret =regmap_read (st->map, +AD7091R_REG_CH_HIGH_LIMIT (chan->channel), + &val); +if (ret) +return ret; +return val !=AD7091R_HIGH_LIMIT ; +case IIO_EV_DIR_FALLING : + ret =regmap_read (st->map, +AD7091R_REG_CH_LOW_LIMIT (chan->channel), + &val); +if (ret) +return ret; +return val !=AD7091R_LOW_LIMIT ; +default : +return -EINVAL ; + } +} + +static int ad7091r_write_event_config (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir,int state) +{ +struct ad7091r_state *st =iio_priv (indio_dev); + +if (state) { +return regmap_set_bits (st->map,AD7091R_REG_CONF , +AD7091R_REG_CONF_ALERT_EN ); + }else { +/* +* Set thresholds either to 0 or to 2^12 - 1 as appropriate to +* prevent alerts and thus disable event generation. +*/ +switch (dir) { +case IIO_EV_DIR_RISING : +return regmap_write (st->map, +AD7091R_REG_CH_HIGH_LIMIT (chan->channel), +AD7091R_HIGH_LIMIT ); +case IIO_EV_DIR_FALLING : +return regmap_write (st->map, +AD7091R_REG_CH_LOW_LIMIT (chan->channel), +AD7091R_LOW_LIMIT ); +default : +return -EINVAL ; + } + } +} + +static int ad7091r_read_event_value (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir, +enum iio_event_info info,int *val,int *val2) +{ +struct ad7091r_state *st =iio_priv (indio_dev); +int ret; + +switch (info) { +case IIO_EV_INFO_VALUE : +switch (dir) { +case IIO_EV_DIR_RISING : + ret =regmap_read (st->map, +AD7091R_REG_CH_HIGH_LIMIT (chan->channel), + val); +if (ret) +return ret; +return IIO_VAL_INT ; +case IIO_EV_DIR_FALLING : + ret =regmap_read (st->map, +AD7091R_REG_CH_LOW_LIMIT (chan->channel), + val); +if (ret) +return ret; +return IIO_VAL_INT ; +default : +return -EINVAL ; + } +case IIO_EV_INFO_HYSTERESIS : + ret =regmap_read (st->map, +AD7091R_REG_CH_HYSTERESIS (chan->channel), + val); +if (ret) +return ret; +return IIO_VAL_INT ; +default : +return -EINVAL ; + } +} + +static int ad7091r_write_event_value (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir, +enum iio_event_info info,int val,int val2) +{ +struct ad7091r_state *st =iio_priv (indio_dev); + +switch (info) { +case IIO_EV_INFO_VALUE : +switch (dir) { +case IIO_EV_DIR_RISING : +return regmap_write (st->map, +AD7091R_REG_CH_HIGH_LIMIT (chan->channel), + val); +case IIO_EV_DIR_FALLING : +return regmap_write (st->map, +AD7091R_REG_CH_LOW_LIMIT (chan->channel), + val); +default : +return -EINVAL ; + } +case IIO_EV_INFO_HYSTERESIS : +return regmap_write (st->map, +AD7091R_REG_CH_HYSTERESIS (chan->channel), + val); +default : +return -EINVAL ; + } +} +static const struct iio_info ad7091r_info = { .read_raw = ad7091r_read_raw, + .read_event_config = &ad7091r_read_event_config, + .write_event_config = &ad7091r_write_event_config, + .read_event_value = &ad7091r_read_event_value, + .write_event_value = &ad7091r_write_event_value, };static irqreturn_t ad7091r_event_handler (int irq,void *private)
drivers/iio/adc/ad7091r-base.h +6 -0
@@ -8,6 +8,10 @@#ifndef __DRIVERS_IIO_ADC_AD7091R_BASE_H__#define __DRIVERS_IIO_ADC_AD7091R_BASE_H__ +/* AD7091R_REG_CH_LIMIT */ +#define AD7091R_HIGH_LIMIT 0xFFF +#define AD7091R_LOW_LIMIT 0x0 +struct device ;struct ad7091r_state ;
@@ -17,6 +21,8 @@ struct ad7091r_chip_info {unsigned int vref_mV; }; +extern const struct iio_event_spec ad7091r_events[3 ]; +extern const struct regmap_config ad7091r_regmap_config; int ad7091r_probe(struct device *dev, const char *name,
drivers/iio/adc/ad7091r5.c +4 -24
@@ -12,26 +12,6 @@#include "ad7091r-base.h" -static const struct iio_event_spec ad7091r5_events[] = { - { - .type =IIO_EV_TYPE_THRESH , - .dir =IIO_EV_DIR_RISING , - .mask_separate =BIT (IIO_EV_INFO_VALUE ) | -BIT (IIO_EV_INFO_ENABLE ), - }, - { - .type =IIO_EV_TYPE_THRESH , - .dir =IIO_EV_DIR_FALLING , - .mask_separate =BIT (IIO_EV_INFO_VALUE ) | -BIT (IIO_EV_INFO_ENABLE ), - }, - { - .type =IIO_EV_TYPE_THRESH , - .dir =IIO_EV_DIR_EITHER , - .mask_separate =BIT (IIO_EV_INFO_HYSTERESIS ), - }, -}; -#define AD7091R_CHANNEL (idx, bits, ev, num_ev) { \ .type = IIO_VOLTAGE, \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
@@ -44,10 +24,10 @@ static const struct iio_event_spec ad7091r5_events[] = { .scan_type.realbits = bits, \ }static const struct iio_chan_spec ad7091r5_channels_irq[] = { -AD7091R_CHANNEL (0 ,12 , ad7091r5_events,ARRAY_SIZE (ad7091r5_events)), -AD7091R_CHANNEL (1 ,12 , ad7091r5_events,ARRAY_SIZE (ad7091r5_events)), -AD7091R_CHANNEL (2 ,12 , ad7091r5_events,ARRAY_SIZE (ad7091r5_events)), -AD7091R_CHANNEL (3 ,12 , ad7091r5_events,ARRAY_SIZE (ad7091r5_events)), +AD7091R_CHANNEL (0 ,12 , ad7091r_events,ARRAY_SIZE (ad7091r_events)), +AD7091R_CHANNEL (1 ,12 , ad7091r_events,ARRAY_SIZE (ad7091r_events)), +AD7091R_CHANNEL (2 ,12 , ad7091r_events,ARRAY_SIZE (ad7091r_events)), +AD7091R_CHANNEL (3 ,12 , ad7091r_events,ARRAY_SIZE (ad7091r_events)), };static const struct iio_chan_spec ad7091r5_channels_noirq[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 12/331 iio: adc: ad7091r: Enable internal vref if external vref is not supplied
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Schmitt <[email protected]>
[ Upstream commit e71c5c89bcb165a02df35325aa13d1ee40112401 ]
The ADC needs a voltage reference to work correctly.
Users can provide an external voltage reference or use the chip internal reference to operate the ADC.
The availability of an in chip reference for the ADC saves the user from having to supply an external voltage reference, which makes the external reference an optional property as described in the device tree documentation.
Though, to use the internal reference, it must be enabled by writing to the configuration register.
Enable AD7091R internal voltage reference if no external vref is supplied.
--- drivers/iio/adc/ad7091r-base.c | 7 +++++++ drivers/iio/adc/ad7091r-base.h | 2 ++ 2 files changed, 9 insertions(+)
drivers/iio/adc/ad7091r-base.c +7 -0
@@ -405,7 +405,14 @@ int ad7091r_probe(struct device *dev, const char *name,if (IS_ERR (st->vref)) {if (PTR_ERR (st->vref) == -EPROBE_DEFER )return -EPROBE_DEFER ; + st->vref =NULL ; +/* Enable internal vref */ + ret =regmap_set_bits (st->map,AD7091R_REG_CONF , +AD7091R_REG_CONF_INT_VREF ); +if (ret) +return dev_err_probe (st->dev, ret, +"Error on enable internal reference\n" ); }else { ret =regulator_enable (st->vref);if (ret)
drivers/iio/adc/ad7091r-base.h +2 -0
@@ -8,6 +8,8 @@#ifndef __DRIVERS_IIO_ADC_AD7091R_BASE_H__#define __DRIVERS_IIO_ADC_AD7091R_BASE_H__ +#define AD7091R_REG_CONF_INT_VREF BIT(0) +/* AD7091R_REG_CH_LIMIT */ #define AD7091R_HIGH_LIMIT 0xFFF#define AD7091R_LOW_LIMIT 0x0
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 13/331 dmaengine: fsl-edma: fix eDMAv4 channel allocation issue
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Li <[email protected]>
[ Upstream commit dc51b4442dd94ab12c146c1897bbdb40e16d5636 ]
The eDMAv4 channel mux has a limitation where certain requests must use even channels, while others must use odd numbers.
Add two flags (ARGS_EVEN_CH and ARGS_ODD_CH) to reflect this limitation. The device tree source (dts) files need to be updated accordingly.
This issue was identified by the following commit:
commit a725990557e7 ("arm64: dts: imx93: Fix the dmas entries order")
Reverting channel orders triggered this problem.
--- drivers/dma/fsl-edma-main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/dma/fsl-edma-main.c +8 -0
@@ -26,6 +26,8 @@#define ARGS_RX BIT(0)#define ARGS_REMOTE BIT(1)#define ARGS_MULTI_FIFO BIT(2) +#define ARGS_EVEN_CH BIT(3) +#define ARGS_ODD_CH BIT(4)static void fsl_edma_synchronize (struct dma_chan *chan) {
@@ -159,6 +161,12 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, fsl_chan->is_remote = dma_spec->args[2 ] &ARGS_REMOTE ; fsl_chan->is_multi_fifo = dma_spec->args[2 ] &ARGS_MULTI_FIFO ; +if ((dma_spec->args[2 ] &ARGS_EVEN_CH ) && (i &0x1 )) +continue ; + +if ((dma_spec->args[2 ] &ARGS_ODD_CH ) && !(i &0x1 )) +continue ; +if (!b_chmux && i == dma_spec->args[0 ]) { chan =dma_get_slave_channel (chan); chan->device->privatecnt++;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 14/331 dmaengine: fix NULL pointer in channel unregistration function
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amelie Delaunay <[email protected]>
[ Upstream commit f5c24d94512f1b288262beda4d3dcb9629222fc7 ]
__dma_async_device_channel_register() can fail. In case of failure, chan->local is freed (with free_percpu()), and chan->local is nullified. When dma_async_device_unregister() is called (because of managed API or intentionally by DMA controller driver), channels are unconditionally unregistered, leading to this NULL pointer:
[ 1.318693] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 [...] [ 1.484499] Call trace: [ 1.486930] device_del+0x40/0x394 [ 1.490314] device_unregister+0x20/0x7c [ 1.494220] __dma_async_device_channel_unregister+0x68/0xc0
Look at dma_async_device_register() function error path, channel device unregistration is done only if chan->local is not NULL.
Then add the same condition at the beginning of __dma_async_device_channel_unregister() function, to avoid NULL pointer issue whatever the API used to reach this function.
--- drivers/dma/dmaengine.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/dma/dmaengine.c +3 -0
@@ -1103,6 +1103,9 @@ EXPORT_SYMBOL_GPL(dma_async_device_channel_register);static void __dma_async_device_channel_unregister (struct dma_device *device,struct dma_chan *chan) { +if (chan->local ==NULL ) +return ; +WARN_ONCE (!device->device_release && chan->client_count,"%s called while %d clients hold a reference\n" , __func__, chan->client_count);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 15/331 dmaengine: idxd: Move dma_free_coherent() out of spinlocked context
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rex Zhang <[email protected]>
[ Upstream commit e271c0ba3f919c48e90c64b703538fbb7865cb63 ]
Task may be rescheduled within dma_free_coherent(). So dma_free_coherent() can't be called between spin_lock() and spin_unlock() to avoid Call Trace:
Call Trace:
<TASK>
dump_stack_lvl+0x37/0x50
__might_resched+0x16a/0x1c0
vunmap+0x2c/0x70
__iommu_dma_free+0x96/0x100
idxd_device_evl_free+0xd5/0x100 [idxd]
device_release_driver_internal+0x197/0x200
unbind_store+0xa1/0xb0
kernfs_fop_write_iter+0x120/0x1c0
vfs_write+0x2d3/0x400
ksys_write+0x63/0xe0
do_syscall_64+0x44/0xa0
entry_SYSCALL_64_after_hwframe+0x6e/0xd8Move it out of the context.
--- drivers/dma/idxd/device.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/dma/idxd/device.c +8 -1
@@ -802,6 +802,9 @@ static int idxd_device_evl_setup(struct idxd_device *idxd)static void idxd_device_evl_free (struct idxd_device *idxd) { +void *evl_log; +unsigned int evl_log_size; +dma_addr_t evl_dma;union gencfg_reg gencfg;union genctrl_reg genctrl;struct device *dev = &idxd->pdev->dev;
@@ -822,11 +825,15 @@ static void idxd_device_evl_free(struct idxd_device *idxd)iowrite64 (0 , idxd->reg_base +IDXD_EVLCFG_OFFSET );iowrite64 (0 , idxd->reg_base +IDXD_EVLCFG_OFFSET +8 ); -dma_free_coherent (dev, evl->log_size, evl->log, evl->dma);bitmap_free (evl->bmap); + evl_log = evl->log; + evl_log_size = evl->log_size; + evl_dma = evl->dma; evl->log =NULL ; evl->size =IDXD_EVL_SIZE_MIN ;spin_unlock (&evl->lock); + +dma_free_coherent (dev, evl_log_size, evl_log, evl_dma); }static void idxd_group_config_write (struct idxd_group *group)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 16/331 scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
[ Upstream commit ee36710912b2075c417100a8acc642c9c6496501 ]
Calling ufshcd_hba_exit() from a function that is called asynchronously from ufshcd_init() is wrong because this triggers multiple race conditions. Instead of calling ufshcd_hba_exit(), log an error message.
--- drivers/ufs/core/ufshcd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ufs/core/ufshcd.c +2 -5
@@ -8810,12 +8810,9 @@ static void ufshcd_async_scan(void *data, async_cookie_t cookie) out:pm_runtime_put_sync (hba->dev); -/* -* If we failed to initialize the device or the device is not -* present, turn off the power/clocks etc. -*/ +if (ret) -ufshcd_hba_exit (hba); +dev_err (hba->dev,"%s failed: %d\n" , __func__, ret); }static enum scsi_timeout_action ufshcd_eh_timed_out (struct scsi_cmnd *scmd)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 17/331 riscv: Fix an off-by-one in get_early_cmdline()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit adb1f95d388a43c4c564ef3e436f18900dde978e ]
The ending NULL is not taken into account by strncat(), so switch to strlcat() to correctly compute the size of the available memory when appending CONFIG_CMDLINE to 'early_cmdline'.
--- arch/riscv/kernel/pi/cmdline_early.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/riscv/kernel/pi/cmdline_early.c +1 -2
@@ -38,8 +38,7 @@ static char *get_early_cmdline(uintptr_t dtb_pa)if (IS_ENABLED (CONFIG_CMDLINE_EXTEND ) ||IS_ENABLED (CONFIG_CMDLINE_FORCE ) || fdt_cmdline_size ==0 /* CONFIG_CMDLINE_FALLBACK */ ) { -strncat (early_cmdline,CONFIG_CMDLINE , -COMMAND_LINE_SIZE - fdt_cmdline_size); +strlcat (early_cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); }return early_cmdline;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 18/331 scsi: core: Kick the requeue list after inserting when flushing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
[ Upstream commit 6df0e077d76bd144c533b61d6182676aae6b0a85 ]
When libata calls ata_link_abort() to abort all ata queued commands, it calls blk_abort_request() on the SCSI command representing each QC.
This causes scsi_timeout() to be called, which calls scsi_eh_scmd_add() for each SCSI command.
scsi_eh_scmd_add() sets the SCSI host to state recovery, and then adds the command to shost->eh_cmd_q.
This will wake up the SCSI EH, and eventually the libata EH strategy handler will be called, which calls scsi_eh_flush_done_q() to either flush retry or flush finish each failed command.
The commands that are flush retried by scsi_eh_flush_done_q() are done so using scsi_queue_insert().
Before commit 8b566edbdbfb ("scsi: core: Only kick the requeue list if necessary"), __scsi_queue_insert() called blk_mq_requeue_request() with the second argument set to true, indicating that it should always kick/run the requeue list after inserting.
After commit 8b566edbdbfb ("scsi: core: Only kick the requeue list if necessary"), __scsi_queue_insert() does not kick/run the requeue list after inserting, if the current SCSI host state is recovery (which is the case in the libata example above).
This optimization is probably fine in most cases, as I can only assume that most often someone will eventually kick/run the queues.
However, that is not the case for scsi_eh_flush_done_q(), where we can see that the request gets inserted to the requeue list, but the queue is never started after the request has been inserted, leading to the block layer waiting for the completion of command that never gets to run.
Since scsi_eh_flush_done_q() is called by SCSI EH context, the SCSI host state is most likely always in recovery when this function is called.
Thus, let scsi_eh_flush_done_q() explicitly kick the requeue list after inserting a flush retry command, so that scsi_eh_flush_done_q() keeps the same behavior as before commit 8b566edbdbfb ("scsi: core: Only kick the requeue list if necessary").
Simple reproducer for the libata example above:
$ hdparm -Y /dev/sda $ echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/delete
--- drivers/scsi/scsi_error.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/scsi/scsi_error.c +6 -3
@@ -2196,15 +2196,18 @@ void scsi_eh_flush_done_q(struct list_head *done_q)struct scsi_cmnd *scmd, *next;list_for_each_entry_safe (scmd, next, done_q, eh_entry) { +struct scsi_device *sdev = scmd->device; +list_del_init (&scmd->eh_entry); -if (scsi_device_online (scmd->device) && - !scsi_noretry_cmd (scmd) &&scsi_cmd_retry_allowed (scmd) && -scsi_eh_should_retry_cmd (scmd)) { +if (scsi_device_online (sdev) && !scsi_noretry_cmd (scmd) && +scsi_cmd_retry_allowed (scmd) && +scsi_eh_should_retry_cmd (scmd)) {SCSI_LOG_ERROR_RECOVERY (3 ,scmd_printk (KERN_INFO , scmd,"%s: flush retry cmd\n" , current->comm));scsi_queue_insert (scmd,SCSI_MLQUEUE_EH_RETRY ); +blk_mq_kick_requeue_list (sdev->request_queue); }else {/* * If just we got sense for the device (called
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 19/331 sh: ecovec24: Rename missed backlight field from fbdev to dev
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit d87123aa9a7920e88633ffc5c5a0a22ab08bdc06 ]
One instance of gpio_backlight_platform_data.fbdev was renamed, but the second instance was forgotten, causing a build failure:
arch/sh/boards/mach-ecovec24/setup.c: In function ‘arch_setup’:
arch/sh/boards/mach-ecovec24/setup.c:1223:37: error: ‘struct gpio_backlight_platform_data’ has no member named ‘fbdev’; did you mean ‘dev’?
1223 | gpio_backlight_data.fbdev = NULL;
| ^~~~~
| dev
Fix this by updating the second instance.
--- arch/sh/boards/mach-ecovec24/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/boards/mach-ecovec24/setup.c +1 -1
@@ -1220,7 +1220,7 @@ static int __init arch_setup(void) lcdc_info.ch[0 ].num_modes =ARRAY_SIZE (ecovec_dvi_modes);/* No backlight */ - gpio_backlight_data.fbdev =NULL ; + gpio_backlight_data.dev =NULL ;gpio_set_value (GPIO_PTA2 ,1 );gpio_set_value (GPIO_PTU1 ,1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 20/331 smb: client: fix parsing of SMB3.1.1 POSIX create context
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
[ Upstream commit 76025cc2285d9ede3d717fe4305d66f8be2d9346 ]
The data offset for the SMB3.1.1 POSIX create context will always be 8-byte aligned so having the check 'noff + nlen >= doff' in smb2_parse_contexts() is wrong as it will lead to -EINVAL because noff
+ nlen == doff.
Fix the sanity check to correctly handle aligned create context data.
--- fs/smb/client/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/smb2pdu.c +1 -1
@@ -2185,7 +2185,7 @@ int smb2_parse_contexts(struct TCP_Server_Info *server, noff =le16_to_cpu (cc->NameOffset); nlen =le16_to_cpu (cc->NameLength); -if (noff + nlen >= doff) +if (noff + nlen > doff)return -EINVAL ; name = (char *)cc + noff;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 21/331 cifs: handle cases where a channel is closed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 0c51cc6f2cb0108e7d49805f6e089cd85caab279 ]
So far, SMB multichannel could only scale up, but not scale down the number of channels. In this series of patch, we now allow the client to deal with the case of multichannel disabled on the server when the share is mounted. With that change, we now need the ability to scale down the channels.
This change allows the client to deal with cases of missing channels more gracefully.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/cifs_debug.c | 5 +++++ fs/smb/client/cifsglob.h | 1 + fs/smb/client/cifsproto.h | 2 +- fs/smb/client/connect.c | 6 +++++- fs/smb/client/sess.c | 28 ++++++++++++++++++++++++---- fs/smb/client/smb2transport.c | 8 +++++++- 6 files changed, 43 insertions(+), 7 deletions(-)
fs/smb/client/cifs_debug.c +5 -0
@@ -138,6 +138,11 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan) {struct TCP_Server_Info *server = chan->server; +if (!server) { +seq_printf (m,"\n\n\t\tChannel: %d DISABLED" , i+1 ); +return ; + } +seq_printf (m,"\n\n\t\tChannel: %d ConnectionId: 0x%llx" "\n\t\tNumber of credits: %d,%d,%d Dialect 0x%x" "\n\t\tTCP status: %d Instance: %d"
fs/smb/client/cifsglob.h +1 -0
@@ -1060,6 +1060,7 @@ struct cifs_ses {spinlock_t chan_lock;/* ========= begin: protected by chan_lock ======== */ #define CIFS_MAX_CHANNELS 16 +#define CIFS_INVAL_CHAN_INDEX (-1)#define CIFS_ALL_CHANNELS_SET (ses) \ ((1UL << (ses)->chan_count) - 1)#define CIFS_ALL_CHANS_GOOD (ses) \
fs/smb/client/cifsproto.h +1 -1
@@ -622,7 +622,7 @@ bool is_server_using_iface(struct TCP_Server_Info *server,bool is_ses_using_iface (struct cifs_ses *ses,struct cifs_server_iface *iface);void cifs_ses_mark_for_reconnect (struct cifs_ses *ses); -unsigned int +int cifs_ses_get_chan_index (struct cifs_ses *ses,struct TCP_Server_Info *server);void
fs/smb/client/connect.c +5 -1
@@ -169,8 +169,12 @@ cifs_signal_cifsd_for_reconnect(struct TCP_Server_Info *server,list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {spin_lock (&ses->chan_lock);for (i =0 ; i < ses->chan_count; i++) { +if (!ses->chans[i].server) +continue ; +spin_lock (&ses->chans[i].server->srv_lock); - ses->chans[i].server->tcpStatus = CifsNeedReconnect; +if (ses->chans[i].server->tcpStatus != CifsExiting) + ses->chans[i].server->tcpStatus = CifsNeedReconnect;spin_unlock (&ses->chans[i].server->srv_lock); }spin_unlock (&ses->chan_lock);
fs/smb/client/sess.c +24 -4
@@ -69,7 +69,7 @@ bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface)/* channel helper functions. assumed that chan_lock is held by caller. */ -unsigned int +int cifs_ses_get_chan_index (struct cifs_ses *ses,struct TCP_Server_Info *server) {
@@ -85,14 +85,17 @@ cifs_ses_get_chan_index(struct cifs_ses *ses,cifs_dbg (VFS ,"unable to get chan index for server: 0x%llx" , server->conn_id);WARN_ON (1 ); -return 0 ; +return CIFS_INVAL_CHAN_INDEX ; }void cifs_chan_set_in_reconnect (struct cifs_ses *ses,struct TCP_Server_Info *server) { -unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +int chan_index =cifs_ses_get_chan_index (ses, server); + +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return ; ses->chans[chan_index].in_reconnect = true; }
@@ -102,6 +105,8 @@ cifs_chan_clear_in_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) {unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return ; ses->chans[chan_index].in_reconnect = false; }
@@ -111,6 +116,8 @@ cifs_chan_in_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) {unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return true;/* err on the safer side */ return CIFS_CHAN_IN_RECONNECT (ses, chan_index); }
@@ -120,6 +127,8 @@ cifs_chan_set_need_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) {unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return ;set_bit (chan_index, &ses->chans_need_reconnect); cifs_dbg(FYI, "Set reconnect bitmask for chan %u; now 0x%lx\n",
@@ -131,6 +140,8 @@ cifs_chan_clear_need_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) {unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return ;clear_bit (chan_index, &ses->chans_need_reconnect); cifs_dbg(FYI, "Cleared reconnect bitmask for chan %u; now 0x%lx\n",
@@ -142,6 +153,8 @@ cifs_chan_needs_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) {unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return true;/* err on the safer side */ return CIFS_CHAN_NEEDS_RECONNECT (ses, chan_index); }
@@ -151,6 +164,8 @@ cifs_chan_is_iface_active(struct cifs_ses *ses, struct TCP_Server_Info *server) {unsigned int chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) +return true;/* err on the safer side */ return ses->chans[chan_index].iface && ses->chans[chan_index].iface->is_active;
@@ -293,7 +308,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)spin_lock (&ses->chan_lock); chan_index =cifs_ses_get_chan_index (ses, server); -if (!chan_index) { +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) {spin_unlock (&ses->chan_lock);return 0 ; }
@@ -403,6 +418,11 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)spin_lock (&ses->chan_lock); chan_index =cifs_ses_get_chan_index (ses, server); +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) { +spin_unlock (&ses->chan_lock); +return 0 ; + } + ses->chans[chan_index].iface = iface;/* No iface is found. if secondary chan, drop connection */
fs/smb/client/smb2transport.c +7 -1
@@ -413,7 +413,13 @@ generate_smb3signingkey(struct cifs_ses *ses, ses->ses_status == SES_GOOD); chan_index =cifs_ses_get_chan_index (ses, server); -/* TODO: introduce ref counting for channels when the can be freed */ +if (chan_index ==CIFS_INVAL_CHAN_INDEX ) { +spin_unlock (&ses->chan_lock); +spin_unlock (&ses->ses_lock); + +return -EINVAL ; + } +spin_unlock (&ses->chan_lock);spin_unlock (&ses->ses_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 22/331 cifs: reconnect work should have reference on server struct
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 19a4b9d6c372cab6a3b2c9a061a236136fe95274 ]
The delayed work for reconnect takes server struct as a parameter. But it does so without holding a ref to it. Normally, this may not show a problem as the reconnect work is only cancelled on umount.
However, since we now plan to support scaling down of channels, and the scale down can happen from reconnect work itself, we need to fix it.
This change takes a reference on the server struct before it is passed to the delayed work. And drops the reference in the delayed work itself. Or if the delayed work is successfully cancelled, by the process that cancels it.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/connect.c | 27 +++++++++++++++++++++------ fs/smb/client/smb2pdu.c | 23 +++++++++++++---------- 2 files changed, 34 insertions(+), 16 deletions(-)
fs/smb/client/connect.c +21 -6
@@ -388,7 +388,13 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,spin_unlock (&server->srv_lock);cifs_swn_reset_server_dstaddr (server);cifs_server_unlock (server); -mod_delayed_work (cifsiod_wq, &server->reconnect,0 ); + +/* increase ref count which reconnect work will drop */ +spin_lock (&cifs_tcp_ses_lock); + server->srv_count++; +spin_unlock (&cifs_tcp_ses_lock); +if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) +cifs_put_tcp_session (server, false); } }while (server->tcpStatus == CifsNeedReconnect);
@@ -518,7 +524,13 @@ static int reconnect_dfs_server(struct TCP_Server_Info *server)spin_unlock (&server->srv_lock);cifs_swn_reset_server_dstaddr (server);cifs_server_unlock (server); -mod_delayed_work (cifsiod_wq, &server->reconnect,0 ); + +/* increase ref count which reconnect work will drop */ +spin_lock (&cifs_tcp_ses_lock); + server->srv_count++; +spin_unlock (&cifs_tcp_ses_lock); +if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) +cifs_put_tcp_session (server, false); }while (server->tcpStatus == CifsNeedReconnect);mutex_lock (&server->refpath_lock);
@@ -1605,16 +1617,19 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)cancel_delayed_work_sync (&server->echo); -if (from_reconnect) +if (from_reconnect) {/* * Avoid deadlock here: reconnect work calls * cifs_put_tcp_session() at its end. Need to be sure * that reconnect work does nothing with server pointer after * that step. */ -cancel_delayed_work (&server->reconnect); -else -cancel_delayed_work_sync (&server->reconnect); +if (cancel_delayed_work (&server->reconnect)) +cifs_put_tcp_session (server, from_reconnect); + }else { +if (cancel_delayed_work_sync (&server->reconnect)) +cifs_put_tcp_session (server, from_reconnect); + }spin_lock (&server->srv_lock); server->tcpStatus = CifsExiting;
fs/smb/client/smb2pdu.c +13 -10
@@ -3879,12 +3879,6 @@ void smb2_reconnect_server(struct work_struct *work) }spin_unlock (&ses->chan_lock); } -/* -* Get the reference to server struct to be sure that the last call of -* cifs_put_tcon() in the loop below won't release the server pointer. -*/ -if (tcon_exist || ses_exist) - server->srv_count++;spin_unlock (&cifs_tcp_ses_lock);
@@ -3932,13 +3926,17 @@ void smb2_reconnect_server(struct work_struct *work) done:cifs_dbg (FYI ,"Reconnecting tcons and channels finished\n" ); -if (resched) +if (resched) {queue_delayed_work (cifsiod_wq, &server->reconnect,2 *HZ ); +mutex_unlock (&pserver->reconnect_mutex); + +/* no need to put tcp session as we're retrying */ +return ; + }mutex_unlock (&pserver->reconnect_mutex);/* now we can safely release srv struct */ -if (tcon_exist || ses_exist) -cifs_put_tcp_session (server,1 ); +cifs_put_tcp_session (server, true); }int
@@ -3958,7 +3956,12 @@ SMB2_echo(struct TCP_Server_Info *server) server->ops->need_neg(server)) {spin_unlock (&server->srv_lock);/* No need to send echo on newly established connections */ -mod_delayed_work (cifsiod_wq, &server->reconnect,0 ); +spin_lock (&cifs_tcp_ses_lock); + server->srv_count++; +spin_unlock (&cifs_tcp_ses_lock); +if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) +cifs_put_tcp_session (server, false); +return rc; }spin_unlock (&server->srv_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 23/331 cifs: handle when server starts supporting multichannel
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 705fc522fe9d58848c253ee0948567060f36e2a7 ]
When the user mounts with multichannel option, but the server does not support it, there can be a time in future where it can be supported.
With this change, such a case is handled.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/cifsproto.h | 1 + fs/smb/client/connect.c | 3 +++ fs/smb/client/smb2pdu.c | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-)
fs/smb/client/cifsproto.h +1 -0
@@ -132,6 +132,7 @@ extern int SendReceiveBlockingLock(const unsigned int xid,struct smb_hdr *in_buf, struct smb_hdr *out_buf, int *bytes_returned); +void cifs_signal_cifsd_for_reconnect (struct TCP_Server_Info *server,bool all_channels);
fs/smb/client/connect.c +3 -0
@@ -128,6 +128,9 @@ static void smb2_query_server_interfaces(struct work_struct *work)*/ rc =SMB3_request_interfaces (0 , tcon, false);if (rc) { +if (rc == -EOPNOTSUPP ) +return ; +cifs_dbg (FYI ,"%s: failed to query server interfaces: %d\n" , __func__, rc); }
fs/smb/client/smb2pdu.c +30 -2
@@ -163,6 +163,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,int rc =0 ;struct nls_table *nls_codepage =NULL ;struct cifs_ses *ses; +int xid;/* * SMB2s NegProt, SessSetup, Logoff do not have tcon yet so
@@ -307,17 +308,44 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon, tcon->need_reopen_files = true; rc =cifs_tree_connect (0 , tcon, nls_codepage); -mutex_unlock (&ses->session_mutex);cifs_dbg (FYI ,"reconnect tcon rc = %d\n" , rc);if (rc) {/* If sess reconnected but tcon didn't, something strange ... */ +mutex_unlock (&ses->session_mutex);cifs_dbg (VFS ,"reconnect tcon failed rc = %d\n" , rc); goto out; } +if (!rc && + (server->capabilities &SMB2_GLOBAL_CAP_MULTI_CHANNEL )) { +mutex_unlock (&ses->session_mutex); + +/* +* query server network interfaces, in case they change +*/ + xid =get_xid (); + rc =SMB3_request_interfaces (xid, tcon, false); +free_xid (xid); + +if (rc) +cifs_dbg (FYI ,"%s: failed to query server interfaces: %d\n" , + __func__, rc); + +if (ses->chan_max > ses->chan_count && + !SERVER_IS_CHAN (server)) { +if (ses->chan_count ==1 ) +cifs_server_dbg (VFS ,"supports multichannel now\n" ); + +cifs_try_adding_channels (ses); + } + }else { +mutex_unlock (&ses->session_mutex); + } +if (smb2_command !=SMB2_INTERNAL_CMD ) -mod_delayed_work (cifsiod_wq, &server->reconnect,0 ); +if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) +cifs_put_tcp_session (server, false);atomic_inc (&tconInfoReconnectCount); out:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 24/331 cifs: handle when server stops supporting multichannel
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit ee1d21794e55ab76505745d24101331552182002 ]
When a server stops supporting multichannel, we will keep attempting reconnects to the secondary channels today. Avoid this by freeing extra channels when negotiate returns no multichannel support.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/cifsglob.h | 1 + fs/smb/client/cifsproto.h | 2 ++ fs/smb/client/connect.c | 10 ++++++ fs/smb/client/sess.c | 64 ++++++++++++++++++++++++++++----- fs/smb/client/smb2pdu.c | 76 ++++++++++++++++++++++++++++++++++++++- fs/smb/client/transport.c | 2 +- 6 files changed, 145 insertions(+), 10 deletions(-)
fs/smb/client/cifsglob.h +1 -0
@@ -659,6 +659,7 @@ struct TCP_Server_Info {bool noautotune;/* do not autotune send buf sizes */ bool nosharesock;bool tcp_nodelay; +bool terminate;unsigned int credits;/* send no more requests at once */ unsigned int max_credits;/* can override large 32000 default at mnt */ unsigned int in_flight;/* number of requests on the wire to server */
fs/smb/client/cifsproto.h +2 -0
@@ -647,6 +647,8 @@ cifs_chan_needs_reconnect(struct cifs_ses *ses,bool cifs_chan_is_iface_active (struct cifs_ses *ses,struct TCP_Server_Info *server); +void +cifs_disable_secondary_channels (struct cifs_ses *ses);int cifs_chan_update_iface (struct cifs_ses *ses,struct TCP_Server_Info *server);int
fs/smb/client/connect.c +10 -0
@@ -215,6 +215,14 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,spin_lock (&cifs_tcp_ses_lock);list_for_each_entry_safe (ses, nses, &pserver->smb_ses_list, smb_ses_list) { +/* +* if channel has been marked for termination, nothing to do +* for the channel. in fact, we cannot find the channel for the +* server. So safe to exit here +*/ +if (server->terminate) +break ; +/* check if iface is still active */ spin_lock (&ses->chan_lock);if (!cifs_chan_is_iface_active (ses, server)) {
@@ -252,6 +260,8 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,spin_lock (&tcon->tc_lock); tcon->status =TID_NEED_RECON ;spin_unlock (&tcon->tc_lock); + +cancel_delayed_work (&tcon->query_interfaces); }if (ses->tcon_ipc) { ses->tcon_ipc->need_reconnect = true;
fs/smb/client/sess.c +56 -8
84 lines not on this page · raw message
fs/smb/client/smb2pdu.c +75 -1
111 lines not on this page · raw message
fs/smb/client/transport.c +1 -1
@@ -1023,7 +1023,7 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)spin_lock (&ses->chan_lock);for (i =0 ; i < ses->chan_count; i++) { server = ses->chans[i].server; -if (!server) +if (!server || server->terminate)continue ;/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 25/331 Revert "cifs: reconnect work should have reference on server struct"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 823342524868168bf681f135d01b4ae10f5863ec ]
This reverts commit 19a4b9d6c372cab6a3b2c9a061a236136fe95274.
This earlier commit was making an assumption that each mod_delayed_work called for the reconnect work would result in smb2_reconnect_server being called twice. This assumption turns out to be untrue. So reverting this change for now.
I will submit a follow-up patch to fix the actual problem in a different way.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/connect.c | 27 ++++++--------------------- fs/smb/client/smb2pdu.c | 23 ++++++++++------------- 2 files changed, 16 insertions(+), 34 deletions(-)
fs/smb/client/connect.c +6 -21
@@ -401,13 +401,7 @@ static int __cifs_reconnect(struct TCP_Server_Info *server,spin_unlock (&server->srv_lock);cifs_swn_reset_server_dstaddr (server);cifs_server_unlock (server); - -/* increase ref count which reconnect work will drop */ -spin_lock (&cifs_tcp_ses_lock); - server->srv_count++; -spin_unlock (&cifs_tcp_ses_lock); -if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) -cifs_put_tcp_session (server, false); +mod_delayed_work (cifsiod_wq, &server->reconnect,0 ); } }while (server->tcpStatus == CifsNeedReconnect);
@@ -537,13 +531,7 @@ static int reconnect_dfs_server(struct TCP_Server_Info *server)spin_unlock (&server->srv_lock);cifs_swn_reset_server_dstaddr (server);cifs_server_unlock (server); - -/* increase ref count which reconnect work will drop */ -spin_lock (&cifs_tcp_ses_lock); - server->srv_count++; -spin_unlock (&cifs_tcp_ses_lock); -if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) -cifs_put_tcp_session (server, false); +mod_delayed_work (cifsiod_wq, &server->reconnect,0 ); }while (server->tcpStatus == CifsNeedReconnect);mutex_lock (&server->refpath_lock);
@@ -1630,19 +1618,16 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)cancel_delayed_work_sync (&server->echo); -if (from_reconnect) { +if (from_reconnect)/* * Avoid deadlock here: reconnect work calls * cifs_put_tcp_session() at its end. Need to be sure * that reconnect work does nothing with server pointer after * that step. */ -if (cancel_delayed_work (&server->reconnect)) -cifs_put_tcp_session (server, from_reconnect); - }else { -if (cancel_delayed_work_sync (&server->reconnect)) -cifs_put_tcp_session (server, from_reconnect); - } +cancel_delayed_work (&server->reconnect); +else +cancel_delayed_work_sync (&server->reconnect);spin_lock (&server->srv_lock); server->tcpStatus = CifsExiting;
fs/smb/client/smb2pdu.c +10 -13
@@ -3981,6 +3981,12 @@ void smb2_reconnect_server(struct work_struct *work) }spin_unlock (&ses->chan_lock); } +/* +* Get the reference to server struct to be sure that the last call of +* cifs_put_tcon() in the loop below won't release the server pointer. +*/ +if (tcon_exist || ses_exist) + server->srv_count++;spin_unlock (&cifs_tcp_ses_lock);
@@ -4028,17 +4034,13 @@ void smb2_reconnect_server(struct work_struct *work) done:cifs_dbg (FYI ,"Reconnecting tcons and channels finished\n" ); -if (resched) { +if (resched)queue_delayed_work (cifsiod_wq, &server->reconnect,2 *HZ ); -mutex_unlock (&pserver->reconnect_mutex); - -/* no need to put tcp session as we're retrying */ -return ; - }mutex_unlock (&pserver->reconnect_mutex);/* now we can safely release srv struct */ -cifs_put_tcp_session (server, true); +if (tcon_exist || ses_exist) +cifs_put_tcp_session (server,1 ); }int
@@ -4058,12 +4060,7 @@ SMB2_echo(struct TCP_Server_Info *server) server->ops->need_neg(server)) {spin_unlock (&server->srv_lock);/* No need to send echo on newly established connections */ -spin_lock (&cifs_tcp_ses_lock); - server->srv_count++; -spin_unlock (&cifs_tcp_ses_lock); -if (mod_delayed_work (cifsiod_wq, &server->reconnect,0 )) -cifs_put_tcp_session (server, false); - +mod_delayed_work (cifsiod_wq, &server->reconnect,0 );return rc; }spin_unlock (&server->srv_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 26/331 cifs: reconnect worker should take reference on server struct unconditionally
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 04909192ada3285070f8ced0af7f07735478b364 ]
Reconnect worker currently assumes that the server struct is alive and only takes reference on the server if it needs to call smb2_reconnect.
With the new ability to disable channels based on whether the server has multichannel disabled, this becomes a problem when we need to disable established channels. While disabling the channels and deallocating the server, there could be reconnect work that could not be cancelled (because it started).
This change forces the reconnect worker to unconditionally take a reference on the server when it runs.
Also, this change now allows smb2_reconnect to know if it was called by the reconnect worker. Based on this, the cifs_put_tcp_session can decide whether it can cancel the reconnect work synchronously or not.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/connect.c | 8 ++++---- fs/smb/client/smb2pdu.c | 29 +++++++++++++++-------------- 2 files changed, 19 insertions(+), 18 deletions(-)
fs/smb/client/connect.c +4 -4
@@ -1612,10 +1612,6 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)list_del_init (&server->tcp_ses_list);spin_unlock (&cifs_tcp_ses_lock); -/* For secondary channels, we pick up ref-count on the primary server */ -if (SERVER_IS_CHAN (server)) -cifs_put_tcp_session (server->primary_server, from_reconnect); -cancel_delayed_work_sync (&server->echo);if (from_reconnect)
@@ -1629,6 +1625,10 @@ cifs_put_tcp_session(struct TCP_Server_Info *server, int from_reconnect)else cancel_delayed_work_sync (&server->reconnect); +/* For secondary channels, we pick up ref-count on the primary server */ +if (SERVER_IS_CHAN (server)) +cifs_put_tcp_session (server->primary_server, from_reconnect); +spin_lock (&server->srv_lock); server->tcpStatus = CifsExiting;spin_unlock (&server->srv_lock);
fs/smb/client/smb2pdu.c +15 -14
@@ -158,7 +158,7 @@ smb2_hdr_assemble(struct smb2_hdr *shdr, __le16 smb2_cmd,static int smb2_reconnect (__le16 smb2_command,struct cifs_tcon *tcon, -struct TCP_Server_Info *server) +struct TCP_Server_Info *server,bool from_reconnect) {int rc =0 ;struct nls_table *nls_codepage =NULL ;
@@ -331,7 +331,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,* as cifs_put_tcp_session takes a higher lock * i.e. cifs_tcp_ses_lock */ -cifs_put_tcp_session (server,1 ); +cifs_put_tcp_session (server, from_reconnect); server->terminate = true;cifs_signal_cifsd_for_reconnect (server, false);
@@ -504,7 +504,7 @@ static int smb2_plain_req_init(__le16 smb2_command, struct cifs_tcon *tcon, {int rc; - rc =smb2_reconnect (smb2_command, tcon, server); + rc =smb2_reconnect (smb2_command, tcon, server, false);if (rc)return rc;
@@ -3924,6 +3924,15 @@ void smb2_reconnect_server(struct work_struct *work)int rc;bool resched = false; +/* first check if ref count has reached 0, if not inc ref count */ +spin_lock (&cifs_tcp_ses_lock); +if (!server->srv_count) { +spin_unlock (&cifs_tcp_ses_lock); +return ; + } + server->srv_count++; +spin_unlock (&cifs_tcp_ses_lock); +/* If server is a channel, select the primary channel */ pserver =SERVER_IS_CHAN (server) ? server->primary_server : server;
@@ -3981,17 +3990,10 @@ void smb2_reconnect_server(struct work_struct *work) }spin_unlock (&ses->chan_lock); } -/* -* Get the reference to server struct to be sure that the last call of -* cifs_put_tcon() in the loop below won't release the server pointer. -*/ -if (tcon_exist || ses_exist) - server->srv_count++; -spin_unlock (&cifs_tcp_ses_lock);list_for_each_entry_safe (tcon, tcon2, &tmp_list, rlist) { - rc =smb2_reconnect (SMB2_INTERNAL_CMD , tcon, server); + rc =smb2_reconnect (SMB2_INTERNAL_CMD , tcon, server, true);if (!rc)cifs_reopen_persistent_handles (tcon);else
@@ -4024,7 +4026,7 @@ void smb2_reconnect_server(struct work_struct *work)/* now reconnect sessions for necessary channels */ list_for_each_entry_safe (ses, ses2, &tmp_ses_list, rlist) { tcon->ses = ses; - rc =smb2_reconnect (SMB2_INTERNAL_CMD , tcon, server); + rc =smb2_reconnect (SMB2_INTERNAL_CMD , tcon, server, true);if (rc) resched = true;list_del_init (&ses->rlist);
@@ -4039,8 +4041,7 @@ void smb2_reconnect_server(struct work_struct *work)mutex_unlock (&pserver->reconnect_mutex);/* now we can safely release srv struct */ -if (tcon_exist || ses_exist) -cifs_put_tcp_session (server,1 ); +cifs_put_tcp_session (server, true); }int
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 27/331 cifs: handle servers that still advertise multichannel after disabling
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit f591062bdbf4742b7f1622173017f19e927057b0 ]
Some servers like Azure SMB servers always advertise multichannel capability in server capabilities list. Such servers return error STATUS_NOT_IMPLEMENTED for ioctl calls to query server interfaces, and expect clients to consider that as a sign that they do not support multichannel.
We already handled this at mount time. Soon after the tree connect, we query server interfaces. And when server returned STATUS_NOT_IMPLEMENTED, we kept interface list as empty. When cifs_try_adding_channels gets called, it would not find any interfaces, so will not add channels.
For the case where an active multichannel mount exists, and multichannel is disabled by such a server, this change will now allow the client to disable secondary channels on the mount. It will check the return status of query server interfaces call soon after a tree reconnect. If the return status is EOPNOTSUPP, then instead of the check to add more channels, we'll disable the secondary channels instead.
For better code reuse, this change also moves the common code for disabling multichannel to a helper function.
Stable-dep-of: 78e727e58e54 ("cifs: update iface_last_update on each query-and-update")
--- fs/smb/client/smb2ops.c | 8 +-- fs/smb/client/smb2pdu.c | 107 +++++++++++++++++++++++++--------------- 2 files changed, 69 insertions(+), 46 deletions(-)
fs/smb/client/smb2ops.c +1 -7
@@ -614,7 +614,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,"multichannel not available\n" "Empty network interface list returned by server %s\n" , ses->server->hostname); - rc = -EINVAL ; + rc = -EOPNOTSUPP ; goto out; }
@@ -734,12 +734,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,if ((bytes_left >8 ) || p->Next)cifs_dbg (VFS ,"%s: incomplete interface info\n" , __func__); - -if (!ses->iface_count) { - rc = -EINVAL ; - goto out; - } - out:/* * Go through the list again and put the inactive entries
fs/smb/client/smb2pdu.c +68 -39
143 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 28/331 cifs: update iface_last_update on each query-and-update
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 78e727e58e54efca4c23863fbd9e16e9d2d83f81 ]
iface_last_update was an unused field when it was introduced. Later, when we had periodic update of server interface list, this field was used regularly to decide when to update next.
However, with the new logic of updating the interfaces, it becomes crucial that this field be updated whenever parse_server_interfaces runs successfully.
This change updates this field when either the server does not support query of interfaces; so that we do not query the interfaces repeatedly. It also updates the field when the function reaches the end.
--- fs/smb/client/smb2ops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/smb/client/smb2ops.c +3 -1
@@ -615,6 +615,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,"Empty network interface list returned by server %s\n" , ses->server->hostname); rc = -EOPNOTSUPP ; + ses->iface_last_update = jiffies; goto out; }
@@ -712,7 +713,6 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf, ses->iface_count++;spin_unlock (&ses->iface_lock); - ses->iface_last_update = jiffies; next_iface: nb_iface++; next =le32_to_cpu (p->Next);
@@ -734,6 +734,8 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,if ((bytes_left >8 ) || p->Next)cifs_dbg (VFS ,"%s: incomplete interface info\n" , __func__); + ses->iface_last_update = jiffies; + out:/* * Go through the list again and put the inactive entries
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 29/331 powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geoff Levand <[email protected]>
commit 482b718a84f08b6fc84879c3e90cc57dba11c115 upstream.
Commit 8c5fa3b5c4df ("powerpc/64: Make ELFv2 the default for big-endian builds"), merged in Linux-6.5-rc1 changes the calling ABI in a way that is incompatible with the current code for the PS3's LV1 hypervisor calls.
This change just adds the line '# CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not set' to the ps3_defconfig file so that the PPC64_ELF_ABI_V1 is used.
Fixes run time errors like these:
BUG: Kernel NULL pointer dereference at 0x00000000 Faulting instruction address: 0xc000000000047cf0 Oops: Kernel access of bad area, sig: 11 [#1] Call Trace: [c0000000023039e0] [c00000000100ebfc] ps3_create_spu+0xc4/0x2b0 (unreliable) [c000000002303ab0] [c00000000100d4c4] create_spu+0xcc/0x3c4 [c000000002303b40] [c00000000100eae4] ps3_enumerate_spus+0xa4/0xf8
--- arch/powerpc/configs/ps3_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/configs/ps3_defconfig +1 -0
@@ -24,6 +24,7 @@ CONFIG_PS3_VRAM=m CONFIG_PS3_LPM=m # CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set CONFIG_KEXEC=y +# CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2 is not set CONFIG_PPC_4K_PAGES=y CONFIG_SCHED_SMT=y CONFIG_PM=y
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 30/331 ext4: allow for the last group to be marked as trimmed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suraj Jitindar Singh <[email protected]>
commit 7c784d624819acbeefb0018bac89e632467cca5a upstream.
The ext4 filesystem tracks the trim status of blocks at the group level. When an entire group has been trimmed then it is marked as such and subsequent trim invocations with the same minimum trim size will not be attempted on that group unless it is marked as able to be trimmed again such as when a block is freed.
Currently the last group can't be marked as trimmed due to incorrect logic in ext4_last_grp_cluster(). ext4_last_grp_cluster() is supposed to return the zero based index of the last cluster in a group. This is then used by ext4_try_to_trim_range() to determine if the trim operation spans the entire group and as such if the trim status of the group should be recorded.
ext4_last_grp_cluster() takes a 0 based group index, thus the valid values for grp are 0..(ext4_get_groups_count - 1). Any group index less than (ext4_get_groups_count - 1) is not the last group and must have EXT4_CLUSTERS_PER_GROUP(sb) clusters. For the last group we need to calculate the number of clusters based on the number of blocks in the group. Finally subtract 1 from the number of clusters as zero based indexing is expected. Rearrange the function slightly to make it clear what we are calculating and returning.
Reproducer:
// Create file system where the last group has fewer blocks than // blocks per group
$ mkfs.ext4 -b 4096 -g 8192 /dev/nvme0n1 8191 $ mount /dev/nvme0n1 /mnt
Before Patch:
$ fstrim -v /mnt /mnt: 25.9 MiB (27156480 bytes) trimmed // Group not marked as trimmed so second invocation still discards blocks $ fstrim -v /mnt /mnt: 25.9 MiB (27156480 bytes) trimmed
After Patch:
fstrim -v /mnt
/mnt: 25.9 MiB (27156480 bytes) trimmed
// Group marked as trimmed so second invocation DOESN'T discard any blocks fstrim -v /mnt
/mnt: 0 B (0 bytes) trimmed
--- fs/ext4/mballoc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
fs/ext4/mballoc.c +10 -5
@@ -6887,11 +6887,16 @@ __acquires(bitlock)static ext4_grpblk_t ext4_last_grp_cluster (struct super_block *sb,ext4_group_t grp) { -if (grp <ext4_get_groups_count (sb)) -return EXT4_CLUSTERS_PER_GROUP (sb) -1 ; -return (ext4_blocks_count (EXT4_SB (sb)->s_es) - -ext4_group_first_block_no (sb, grp) -1 ) >> -EXT4_CLUSTER_BITS (sb); +unsigned long nr_clusters_in_group; + +if (grp < (ext4_get_groups_count (sb) -1 )) + nr_clusters_in_group =EXT4_CLUSTERS_PER_GROUP (sb); +else + nr_clusters_in_group = (ext4_blocks_count (EXT4_SB (sb)->s_es) - +ext4_group_first_block_no (sb, grp)) + >>EXT4_CLUSTER_BITS (sb); + +return nr_clusters_in_group -1 ; }static bool ext4_trim_interrupted (void )
Greg Kroah-Hartman
maintainerPATCH 31/331 async: Split async_schedule_node_domain()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 6aa09a5bccd8e224d917afdb4c278fc66aacde4d upstream.
In preparation for subsequent changes, split async_schedule_node_domain() in two pieces so as to allow the bottom part of it to be called from a somewhat different code path.
No functional impact.
--- kernel/async.c | 56 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 22 deletions(-)
kernel/async.c +34 -22
@@ -145,6 +145,39 @@ static void async_run_entry_fn(struct wowake_up (&async_done); } +static async_cookie_t __async_schedule_node_domain (async_func_t func, +void *data,int node, +struct async_domain *domain, +struct async_entry *entry) +{ +async_cookie_t newcookie; +unsigned long flags; + +INIT_LIST_HEAD (&entry->domain_list); +INIT_LIST_HEAD (&entry->global_list); +INIT_WORK (&entry->work, async_run_entry_fn); + entry->func = func; + entry->data = data; + entry->domain = domain; + +spin_lock_irqsave (&async_lock, flags); + +/* allocate cookie and queue */ + newcookie = entry->cookie = next_cookie++; + +list_add_tail (&entry->domain_list, &domain->pending); +if (domain->registered) +list_add_tail (&entry->global_list, &async_global_pending); + +atomic_inc (&entry_count); +spin_unlock_irqrestore (&async_lock, flags); + +/* schedule for execution */ +queue_work_node (node, system_unbound_wq, &entry->work); + +return newcookie; +} +/** * async_schedule_node_domain - NUMA specific version of async_schedule_domain * @func: function to execute asynchronously
@@ -186,29 +219,8 @@ async_cookie_t async_schedule_node_domaifunc (data, newcookie);return newcookie; } -INIT_LIST_HEAD (&entry->domain_list); -INIT_LIST_HEAD (&entry->global_list); -INIT_WORK (&entry->work, async_run_entry_fn); - entry->func = func; - entry->data = data; - entry->domain = domain; - -spin_lock_irqsave (&async_lock, flags); -/* allocate cookie and queue */ - newcookie = entry->cookie = next_cookie++; - -list_add_tail (&entry->domain_list, &domain->pending); -if (domain->registered) -list_add_tail (&entry->global_list, &async_global_pending); - -atomic_inc (&entry_count); -spin_unlock_irqrestore (&async_lock, flags); - -/* schedule for execution */ -queue_work_node (node, system_unbound_wq, &entry->work); - -return newcookie; +return __async_schedule_node_domain (func, data, node, domain, entry); }EXPORT_SYMBOL_GPL (async_schedule_node_domain);
Greg Kroah-Hartman
maintainerPATCH 32/331 async: Introduce async_schedule_dev_nocall()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 7d4b5d7a37bdd63a5a3371b988744b060d5bb86f upstream.
In preparation for subsequent changes, introduce a specialized variant of async_schedule_dev() that will not invoke the argument function synchronously when it cannot be scheduled for asynchronous execution.
The new function, async_schedule_dev_nocall(), will be used for fixing possible deadlocks in the system-wide power management core code.
--- include/linux/async.h | 2 ++ kernel/async.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+)
include/linux/async.h +2 -0
@@ -90,6 +90,8 @@ async_schedule_dev(async_func_t func, streturn async_schedule_node (func, dev,dev_to_node (dev)); } +bool async_schedule_dev_nocall (async_func_t func,struct device *dev); +/** * async_schedule_dev_domain - A device specific version of async_schedule_domain * @func: function to execute asynchronously
kernel/async.c +29 -0
@@ -244,6 +244,35 @@ async_cookie_t async_schedule_node(asyncEXPORT_SYMBOL_GPL (async_schedule_node);/** +* async_schedule_dev_nocall - A simplified variant of async_schedule_dev() +* @func: function to execute asynchronously +* @dev: device argument to be passed to function +* +* @dev is used as both the argument for the function and to provide NUMA +* context for where to run the function. +* +* If the asynchronous execution of @func is scheduled successfully, return +* true. Otherwise, do nothing and return false, unlike async_schedule_dev() +* that will run the function synchronously then. +*/ +bool async_schedule_dev_nocall (async_func_t func,struct device *dev) +{ +struct async_entry *entry; + + entry =kzalloc (sizeof (struct async_entry ),GFP_KERNEL ); + +/* Give up if there is no memory or too much work. */ +if (!entry ||atomic_read (&entry_count) >MAX_WORK ) { +kfree (entry); +return false; + } + +__async_schedule_node_domain (func, dev,dev_to_node (dev), + &async_dfl_domain, entry); +return true; +} + +/** * async_synchronize_full - synchronize all asynchronous function calls * * This function waits until all asynchronous function calls have been done.
Greg Kroah-Hartman
maintainerPATCH 33/331 PM: sleep: Fix possible deadlocks in core system-wide PM code
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 7839d0078e0d5e6cc2fa0b0dfbee71de74f1e557 upstream.
It is reported that in low-memory situations the system-wide resume core code deadlocks, because async_schedule_dev() executes its argument function synchronously if it cannot allocate memory (and not only in that case) and that function attempts to acquire a mutex that is already held. Executing the argument function synchronously from within dpm_async_fn() may also be problematic for ordering reasons (it may cause a consumer device's resume callback to be invoked before a requisite supplier device's one, for example).
Address this by changing the code in question to use async_schedule_dev_nocall() for scheduling the asynchronous execution of device suspend and resume functions and to directly run them synchronously if async_schedule_dev_nocall() returns false.
--- drivers/base/power/main.c | 148 +++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 80 deletions(-)
drivers/base/power/main.c +68 -80
@@ -579,7 +579,7 @@ bool dev_pm_skip_resume(struct device *d }/** -* device_resume_noirq - Execute a "noirq resume" callback for given device. +* __device_resume_noirq - Execute a "noirq resume" callback for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously.
@@ -587,7 +587,7 @@ bool dev_pm_skip_resume(struct device *d* The driver of @dev will not receive interrupts while this function is being * executed. */ -static int device_resume_noirq (struct device *dev,pm_message_t state,bool async) +static void __device_resume_noirq (struct device *dev,pm_message_t state,bool async) {pm_callback_t callback =NULL ;const char *info =NULL ;
@@ -655,7 +655,13 @@ Skip: Out:complete_all (&dev->power.completion);TRACE_RESUME (error); -return error; + +if (error) { + suspend_stats.failed_resume_noirq++; +dpm_save_failed_step (SUSPEND_RESUME_NOIRQ ); +dpm_save_failed_dev (dev_name (dev)); +pm_dev_err (dev, state, async ?" async noirq" :" noirq" , error); + } }static bool is_async (struct device *dev)
@@ -668,11 +674,15 @@ static bool dpm_async_fn(struct device * {reinit_completion (&dev->power.completion); -if (is_async (dev)) { -get_device (dev); -async_schedule_dev (func, dev); +if (!is_async (dev)) +return false; + +get_device (dev); + +if (async_schedule_dev_nocall (func, dev))return true; - } + +put_device (dev);return false; }
@@ -680,15 +690,19 @@ static bool dpm_async_fn(struct device *static void async_resume_noirq (void *data,async_cookie_t cookie) {struct device *dev = data; -int error; - - error =device_resume_noirq (dev, pm_transition, true); -if (error) -pm_dev_err (dev, pm_transition," async" , error); +__device_resume_noirq (dev, pm_transition, true);put_device (dev); } +static void device_resume_noirq (struct device *dev) +{ +if (dpm_async_fn (dev, async_resume_noirq)) +return ; + +__device_resume_noirq (dev, pm_transition, false); +} +static void dpm_noirq_resume_devices (pm_message_t state) {struct device *dev;
@@ -698,14 +712,6 @@ static void dpm_noirq_resume_devices(pm_mutex_lock (&dpm_list_mtx); pm_transition = state; -/* -* Advanced the async threads upfront, -* in case the starting of async threads is -* delayed by non-async resuming devices. -*/ -list_for_each_entry (dev, &dpm_noirq_list, power.entry) -dpm_async_fn (dev, async_resume_noirq); -while (!list_empty (&dpm_noirq_list)) { dev =to_device (dpm_noirq_list.next);get_device (dev);
@@ -713,17 +719,7 @@ static void dpm_noirq_resume_devices(pm_mutex_unlock (&dpm_list_mtx); -if (!is_async (dev)) { -int error; - - error =device_resume_noirq (dev, state, false); -if (error) { - suspend_stats.failed_resume_noirq++; -dpm_save_failed_step (SUSPEND_RESUME_NOIRQ ); -dpm_save_failed_dev (dev_name (dev)); -pm_dev_err (dev, state," noirq" , error); - } - } +device_resume_noirq (dev);put_device (dev);
@@ -751,14 +747,14 @@ void dpm_resume_noirq(pm_message_t state }/** -* device_resume_early - Execute an "early resume" callback for given device. +* __device_resume_early - Execute an "early resume" callback for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. * * Runtime PM is disabled for @dev while this function is being executed. */ -static int device_resume_early (struct device *dev,pm_message_t state,bool async) +static void __device_resume_early (struct device *dev,pm_message_t state,bool async) {pm_callback_t callback =NULL ;const char *info =NULL ;
@@ -811,21 +807,31 @@ Out:pm_runtime_enable (dev);complete_all (&dev->power.completion); -return error; + +if (error) { + suspend_stats.failed_resume_early++; +dpm_save_failed_step (SUSPEND_RESUME_EARLY ); +dpm_save_failed_dev (dev_name (dev)); +pm_dev_err (dev, state, async ?" async early" :" early" , error); + } }static void async_resume_early (void *data,async_cookie_t cookie) {struct device *dev = data; -int error; - - error =device_resume_early (dev, pm_transition, true); -if (error) -pm_dev_err (dev, pm_transition," async" , error); +__device_resume_early (dev, pm_transition, true);put_device (dev); } +static void device_resume_early (struct device *dev) +{ +if (dpm_async_fn (dev, async_resume_early)) +return ; + +__device_resume_early (dev, pm_transition, false); +} +/** * dpm_resume_early - Execute "early resume" callbacks for all devices. * @state: PM transition of the system being carried out.
@@ -839,14 +845,6 @@ void dpm_resume_early(pm_message_t statemutex_lock (&dpm_list_mtx); pm_transition = state; -/* -* Advanced the async threads upfront, -* in case the starting of async threads is -* delayed by non-async resuming devices. -*/ -list_for_each_entry (dev, &dpm_late_early_list, power.entry) -dpm_async_fn (dev, async_resume_early); -while (!list_empty (&dpm_late_early_list)) { dev =to_device (dpm_late_early_list.next);get_device (dev);
@@ -854,17 +852,7 @@ void dpm_resume_early(pm_message_t statemutex_unlock (&dpm_list_mtx); -if (!is_async (dev)) { -int error; - - error =device_resume_early (dev, state, false); -if (error) { - suspend_stats.failed_resume_early++; -dpm_save_failed_step (SUSPEND_RESUME_EARLY ); -dpm_save_failed_dev (dev_name (dev)); -pm_dev_err (dev, state," early" , error); - } - } +device_resume_early (dev);put_device (dev);
@@ -888,12 +876,12 @@ void dpm_resume_start(pm_message_t stateEXPORT_SYMBOL_GPL (dpm_resume_start);/** -* device_resume - Execute "resume" callbacks for given device. +* __device_resume - Execute "resume" callbacks for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. */ -static int device_resume (struct device *dev,pm_message_t state,bool async) +static void __device_resume (struct device *dev,pm_message_t state,bool async) {pm_callback_t callback =NULL ;const char *info =NULL ;
@@ -975,20 +963,30 @@ static int device_resume(struct device *TRACE_RESUME (error); -return error; +if (error) { + suspend_stats.failed_resume++; +dpm_save_failed_step (SUSPEND_RESUME ); +dpm_save_failed_dev (dev_name (dev)); +pm_dev_err (dev, state, async ?" async" :"" , error); + } }static void async_resume (void *data,async_cookie_t cookie) {struct device *dev = data; -int error; - error =device_resume (dev, pm_transition, true); -if (error) -pm_dev_err (dev, pm_transition," async" , error); +__device_resume (dev, pm_transition, true);put_device (dev); } +static void device_resume (struct device *dev) +{ +if (dpm_async_fn (dev, async_resume)) +return ; + +__device_resume (dev, pm_transition, false); +} +/** * dpm_resume - Execute "resume" callbacks for non-sysdev devices. * @state: PM transition of the system being carried out.
@@ -1008,27 +1006,17 @@ void dpm_resume(pm_message_t state) pm_transition = state; async_error =0 ; -list_for_each_entry (dev, &dpm_suspended_list, power.entry) -dpm_async_fn (dev, async_resume); -while (!list_empty (&dpm_suspended_list)) { dev =to_device (dpm_suspended_list.next); +get_device (dev); -if (!is_async (dev)) { -int error; -mutex_unlock (&dpm_list_mtx); +mutex_unlock (&dpm_list_mtx); - error =device_resume (dev, state, false); -if (error) { - suspend_stats.failed_resume++; -dpm_save_failed_step (SUSPEND_RESUME ); -dpm_save_failed_dev (dev_name (dev)); -pm_dev_err (dev, state,"" , error); - } +device_resume (dev); + +mutex_lock (&dpm_list_mtx); -mutex_lock (&dpm_list_mtx); - }if (!list_empty (&dev->power.entry))list_move_tail (&dev->power.entry, &dpm_prepared_list);
Greg Kroah-Hartman
maintainerPATCH 34/331 arm64: properly install vmlinuz.efi
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
commit 7b21ed7d119dc06b0ed2ba3e406a02cafe3a8d03 upstream.
If you select CONFIG_EFI_ZBOOT, we will generate vmlinuz.efi, and then when we go to install the kernel we'll install the vmlinux instead because install.sh only recognizes Image.gz as wanting the compressed install image. With CONFIG_EFI_ZBOOT we don't get the proper kernel installed, which means it doesn't boot, which makes for a very confused and subsequently angry kernel developer.
Fix this by properly installing our compressed kernel if we've enabled CONFIG_EFI_ZBOOT.
--- arch/arm64/boot/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/install.sh +2 -1
@@ -17,7 +17,8 @@ # $3 - kernel map file # $4 - default install path (blank if root directory) -if [ "$(basename $2)" = "Image.gz" ]; then +if [ "$(basename $2)" = "Image.gz" ] || [ "$(basename $2)" = "vmlinuz.efi" ] +then # Compressed install echo "Installing compressed kernel" base=vmlinuz
Greg Kroah-Hartman
maintainerPATCH 35/331 OPP: Pass rounded rate to _set_opp()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <[email protected]>
commit 7269c250db1b89cda72ca419b7bd5e37997309d6 upstream.
The OPP core finds the eventual frequency to set with the help of clk_round_rate() and the same was earlier getting passed to _set_opp() and that's what would get configured.
The commit 1efae8d2e777 ("OPP: Make dev_pm_opp_set_opp() independent of frequency") mistakenly changed that. Fix it.
--- drivers/opp/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/opp/core.c +3 -3
@@ -1322,12 +1322,12 @@ int dev_pm_opp_set_rate(struct device *d* value of the frequency. In such a case, do not abort but * configure the hardware to the desired frequency forcefully. */ - forced = opp_table->rate_clk_single != target_freq; + forced = opp_table->rate_clk_single != freq; } - ret =_set_opp (dev, opp_table, opp, &target_freq, forced); + ret =_set_opp (dev, opp_table, opp, &freq, forced); -if (target_freq) +if (freq)dev_pm_opp_put (opp); put_opp_table:
Greg Kroah-Hartman
maintainerPATCH 36/331 btrfs: sysfs: validate scrub_speed_max value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Disseldorp <[email protected]>
commit 2b0122aaa800b021e36027d7f29e206f87c761d6 upstream.
The value set as scrub_speed_max accepts size with suffixes (k/m/g/t/p/e) but we should still validate it for trailing characters, similar to what we do with chunk_size_store.
--- fs/btrfs/sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/btrfs/sysfs.c +4 -0
@@ -1760,6 +1760,10 @@ static ssize_t btrfs_devinfo_scrub_speedunsigned long long limit; limit =memparse (buf, &endptr); +/* There could be trailing '\n', also catch any typos after the value. */ + endptr =skip_spaces (endptr); +if (*endptr !=0 ) +return -EINVAL ;WRITE_ONCE (device->scrub_speed_max, limit);return len; }
Greg Kroah-Hartman
maintainerPATCH 37/331 crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_init
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianjia Zhang <[email protected]>
commit ba3c5574203034781ac4231acf117da917efcd2a upstream.
When the mpi_ec_ctx structure is initialized, some fields are not cleared, causing a crash when referencing the field when the structure was released. Initially, this issue was ignored because memory for mpi_ec_ctx is allocated with the __GFP_ZERO flag. For example, this error will be triggered when calculating the Za value for SM2 separately.
--- lib/crypto/mpi/ec.c | 3 +++ 1 file changed, 3 insertions(+)
lib/crypto/mpi/ec.c +3 -0
@@ -584,6 +584,9 @@ void mpi_ec_init(struct mpi_ec_ctx *ctx, enum gcry_mpi_ec_models model, ctx->a =mpi_copy (a); ctx->b =mpi_copy (b); + ctx->d =NULL ; + ctx->t.two_inv_p =NULL ; + ctx->t.p_barrett = use_barrett >0 ?mpi_barrett_init (ctx->p,0 ) :NULL ;mpi_ec_get_reset (ctx);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 38/331 erofs: fix lz4 inplace decompression
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gao Xiang <[email protected]>
commit 3c12466b6b7bf1e56f9b32c366a3d83d87afb4de upstream.
Currently EROFS can map another compressed buffer for inplace decompression, that was used to handle the cases that some pages of compressed data are actually not in-place I/O.
However, like most simple LZ77 algorithms, LZ4 expects the compressed data is arranged at the end of the decompressed buffer and it explicitly uses memmove() to handle overlapping:
__________________________________________________________
|_ direction of decompression --> ____ |_ compressed data _|
Although EROFS arranges compressed data like this, it typically maps two individual virtual buffers so the relative order is uncertain. Previously, it was hardly observed since LZ4 only uses memmove() for short overlapped literals and x86/arm64 memmove implementations seem to completely cover it up and they don't have this issue. Juhyung reported that EROFS data corruption can be found on a new Intel x86 processor. After some analysis, it seems that recent x86 processors with the new FSRM feature expose this issue with "rep movsb".
Let's strictly use the decompressed buffer for lz4 inplace decompression for now. Later, as an useful improvement, we could try to tie up these two buffers together in the correct order.
--- fs/erofs/decompressor.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
fs/erofs/decompressor.c +16 -15
@@ -122,11 +122,11 @@ static int z_erofs_lz4_prepare_dstpages( }static void *z_erofs_lz4_handle_overlap (struct z_erofs_lz4_decompress_ctx *ctx, -void *inpage,unsigned int *inputmargin,int *maptype, -bool may_inplace) +void *inpage,void *out,unsigned int *inputmargin, +int *maptype,bool may_inplace) {struct z_erofs_decompress_req *rq = ctx->rq; -unsigned int omargin, total, i, j; +unsigned int omargin, total, i;struct page **in;void *src, *tmp;
@@ -136,12 +136,13 @@ static void *z_erofs_lz4_handle_overlap( omargin < LZ4_DECOMPRESS_INPLACE_MARGIN(rq->inputsize)) goto docopy; -for (i =0 ; i < ctx->inpages; ++i) { -DBG_BUGON (rq->in[i] ==NULL ); -for (j =0 ; j < ctx->outpages - ctx->inpages + i; ++j) -if (rq->out[j] == rq->in[i]) - goto docopy; - } +for (i =0 ; i < ctx->inpages; ++i) +if (rq->out[ctx->outpages - ctx->inpages + i] != + rq->in[i]) + goto docopy; +kunmap_local (inpage); + *maptype =3 ; +return out + ((ctx->outpages - ctx->inpages) <<PAGE_SHIFT ); }if (ctx->inpages <=1 ) {
@@ -149,7 +150,6 @@ static void *z_erofs_lz4_handle_overlap(return inpage; }kunmap_local (inpage); -might_sleep (); src =erofs_vm_map_ram (rq->in, ctx->inpages);if (!src)return ERR_PTR (-ENOMEM );
@@ -205,12 +205,12 @@ int z_erofs_fixup_insize(struct z_erofs_ }static int z_erofs_lz4_decompress_mem (struct z_erofs_lz4_decompress_ctx *ctx, -u8 *out) +u8 *dst) {struct z_erofs_decompress_req *rq = ctx->rq;bool support_0padding = false, may_inplace = false;unsigned int inputmargin; -u8 *headpage, *src; +u8 *out, *headpage, *src;int ret, maptype;DBG_BUGON (*rq->in ==NULL );
@@ -231,11 +231,12 @@ static int z_erofs_lz4_decompress_mem(st } inputmargin = rq->pageofs_in; - src =z_erofs_lz4_handle_overlap (ctx, headpage, &inputmargin, + src =z_erofs_lz4_handle_overlap (ctx, headpage, dst, &inputmargin, &maptype, may_inplace);if (IS_ERR (src))return PTR_ERR (src); + out = dst + rq->pageofs_out;/* legacy format could compress extra data in a pcluster. */ if (rq->partial_decoding || !support_0padding) ret = LZ4_decompress_safe_partial(src + inputmargin, out,
@@ -266,7 +267,7 @@ static int z_erofs_lz4_decompress_mem(stvm_unmap_ram (src, ctx->inpages); }else if (maptype ==2 ) {erofs_put_pcpubuf (src); - }else { + }else if (maptype !=3 ) {DBG_BUGON (1 );return -EFAULT ; }
@@ -309,7 +310,7 @@ static int z_erofs_lz4_decompress(struct } dstmap_out: - ret =z_erofs_lz4_decompress_mem (&ctx, dst + rq->pageofs_out); + ret =z_erofs_lz4_decompress_mem (&ctx, dst);if (!dst_maptype)kunmap_local (dst);else if (dst_maptype ==2 )
Greg Kroah-Hartman
maintainerPATCH 39/331 crypto: api - Disallow identical driver names
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit 27016f75f5ed47e2d8e0ca75a8ff1f40bc1a5e27 upstream.
Disallow registration of two algorithms with identical driver names.
--- crypto/algapi.c | 1 + 1 file changed, 1 insertion(+)
crypto/algapi.c +1 -0
@@ -341,6 +341,7 @@ __crypto_register_alg(struct crypto_alg }if (!strcmp (q->cra_driver_name, alg->cra_name) || + !strcmp (q->cra_driver_name, alg->cra_driver_name) || !strcmp (q->cra_name, alg->cra_driver_name)) goto err; }
Greg Kroah-Hartman
maintainerPATCH 40/331 PM: hibernate: Enforce ordering during image compression/decompression
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongchen Zhang <[email protected]>
commit 71cd7e80cfde548959952eac7063aeaea1f2e1c6 upstream.
An S4 (suspend to disk) test on the LoongArch 3A6000 platform sometimes fails with the following error messaged in the dmesg log:
Invalid LZO compressed length
That happens because when compressing/decompressing the image, the synchronization between the control thread and the compress/decompress/crc thread is based on a relaxed ordering interface, which is unreliable, and the following situation may occur:
CPU 0 CPU 1save_image_lzo lzo_compress_threadfn
atomic_set(&d->stop, 1);
atomic_read(&data[thr].stop)
data[thr].cmp = data[thr].cmp_len;
WRITE data[thr].cmp_len
Then CPU0 gets a stale cmp_len and writes it to disk. During resume from S4, wrong cmp_len is loaded.
To maintain data consistency between the two threads, use the acquire/release variants of atomic set and read operations.
--- kernel/power/swap.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
kernel/power/swap.c +19 -19
@@ -605,11 +605,11 @@ static int crc32_threadfn(void *data)unsigned i;while (1 ) { -wait_event (d->go,atomic_read (&d->ready) || +wait_event (d->go,atomic_read_acquire (&d->ready) ||kthread_should_stop ());if (kthread_should_stop ()) { d->thr =NULL ; -atomic_set (&d->stop,1 ); +atomic_set_release (&d->stop,1 );wake_up (&d->done);break ; }
@@ -618,7 +618,7 @@ static int crc32_threadfn(void *data)for (i =0 ; i < d->run_threads; i++) *d->crc32 =crc32_le (*d->crc32, d->unc[i], *d->unc_len[i]); -atomic_set (&d->stop,1 ); +atomic_set_release (&d->stop,1 );wake_up (&d->done); }return 0 ;
@@ -648,12 +648,12 @@ static int lzo_compress_threadfn(void *dstruct cmp_data *d = data;while (1 ) { -wait_event (d->go,atomic_read (&d->ready) || +wait_event (d->go,atomic_read_acquire (&d->ready) ||kthread_should_stop ());if (kthread_should_stop ()) { d->thr =NULL ; d->ret =-1 ; -atomic_set (&d->stop,1 ); +atomic_set_release (&d->stop,1 );wake_up (&d->done);break ; }
@@ -662,7 +662,7 @@ static int lzo_compress_threadfn(void *d d->ret =lzo1x_1_compress (d->unc, d->unc_len, d->cmp +LZO_HEADER , &d->cmp_len, d->wrk); -atomic_set (&d->stop,1 ); +atomic_set_release (&d->stop,1 );wake_up (&d->done); }return 0 ;
@@ -797,7 +797,7 @@ static int save_image_lzo(struct swap_ma data[thr].unc_len = off; -atomic_set (&data[thr].ready,1 ); +atomic_set_release (&data[thr].ready,1 );wake_up (&data[thr].go); }
@@ -805,12 +805,12 @@ static int save_image_lzo(struct swap_mabreak ; crc->run_threads = thr; -atomic_set (&crc->ready,1 ); +atomic_set_release (&crc->ready,1 );wake_up (&crc->go);for (run_threads = thr, thr =0 ; thr < run_threads; thr++) {wait_event (data[thr].done, -atomic_read (&data[thr].stop)); +atomic_read_acquire (&data[thr].stop));atomic_set (&data[thr].stop,0 ); ret = data[thr].ret;
@@ -849,7 +849,7 @@ static int save_image_lzo(struct swap_ma } } -wait_event (crc->done,atomic_read (&crc->stop)); +wait_event (crc->done,atomic_read_acquire (&crc->stop));atomic_set (&crc->stop,0 ); }
@@ -1131,12 +1131,12 @@ static int lzo_decompress_threadfn(voidstruct dec_data *d = data;while (1 ) { -wait_event (d->go,atomic_read (&d->ready) || +wait_event (d->go,atomic_read_acquire (&d->ready) ||kthread_should_stop ());if (kthread_should_stop ()) { d->thr =NULL ; d->ret =-1 ; -atomic_set (&d->stop,1 ); +atomic_set_release (&d->stop,1 );wake_up (&d->done);break ; }
@@ -1149,7 +1149,7 @@ static int lzo_decompress_threadfn(voidflush_icache_range ((unsigned long )d->unc, (unsigned long )d->unc + d->unc_len); -atomic_set (&d->stop,1 ); +atomic_set_release (&d->stop,1 );wake_up (&d->done); }return 0 ;
@@ -1334,7 +1334,7 @@ static int load_image_lzo(struct swap_ma }if (crc->run_threads) { -wait_event (crc->done,atomic_read (&crc->stop)); +wait_event (crc->done,atomic_read_acquire (&crc->stop));atomic_set (&crc->stop,0 ); crc->run_threads =0 ; }
@@ -1370,7 +1370,7 @@ static int load_image_lzo(struct swap_ma pg =0 ; } -atomic_set (&data[thr].ready,1 ); +atomic_set_release (&data[thr].ready,1 );wake_up (&data[thr].go); }
@@ -1389,7 +1389,7 @@ static int load_image_lzo(struct swap_mafor (run_threads = thr, thr =0 ; thr < run_threads; thr++) {wait_event (data[thr].done, -atomic_read (&data[thr].stop)); +atomic_read_acquire (&data[thr].stop));atomic_set (&data[thr].stop,0 ); ret = data[thr].ret;
@@ -1420,7 +1420,7 @@ static int load_image_lzo(struct swap_ma ret =snapshot_write_next (snapshot);if (ret <=0 ) { crc->run_threads = thr +1 ; -atomic_set (&crc->ready,1 ); +atomic_set_release (&crc->ready,1 );wake_up (&crc->go); goto out_finish; }
@@ -1428,13 +1428,13 @@ static int load_image_lzo(struct swap_ma } crc->run_threads = thr; -atomic_set (&crc->ready,1 ); +atomic_set_release (&crc->ready,1 );wake_up (&crc->go); } out_finish:if (crc->run_threads) { -wait_event (crc->done,atomic_read (&crc->stop)); +wait_event (crc->done,atomic_read_acquire (&crc->stop));atomic_set (&crc->stop,0 ); } stop =ktime_get ();
Greg Kroah-Hartman
maintainerPATCH 41/331 hwrng: core - Fix page fault dead lock on mmap-ed hwrng
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit 78aafb3884f6bc6636efcc1760c891c8500b9922 upstream.
There is a dead-lock in the hwrng device read path. This triggers when the user reads from /dev/hwrng into memory also mmap-ed from /dev/hwrng. The resulting page fault triggers a recursive read which then dead-locks.
Fix this by using a stack buffer when calling copy_to_user.
--- drivers/char/hw_random/core.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
drivers/char/hw_random/core.c +21 -13
@@ -23,10 +23,13 @@#include <linux/sched.h> #include <linux/sched/signal.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/uaccess.h> #define RNG_MODULE_NAME "hw_random" +#define RNG_BUFFER_SIZE (SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES) +static struct hwrng *current_rng;/* the current rng has been explicitly chosen by user via sysfs */ static int cur_rng_set_by_user;
@@ -58,7 +61,7 @@ static inline int rng_get_data(struct hwstatic size_t rng_buffer_size (void ) { -return SMP_CACHE_BYTES <32 ?32 :SMP_CACHE_BYTES ; +return RNG_BUFFER_SIZE ; }static void add_early_randomness (struct hwrng *rng)
@@ -209,6 +212,7 @@ static inline int rng_get_data(struct hwstatic ssize_t rng_dev_read (struct file *filp,char __user *buf,size_t size,loff_t *offp) { +u8 buffer[RNG_BUFFER_SIZE ];ssize_t ret =0 ;int err =0 ;int bytes_read, len;
@@ -236,34 +240,37 @@ static ssize_t rng_dev_read(struct fileif (bytes_read <0 ) { err = bytes_read; goto out_unlock_reading; + }else if (bytes_read ==0 && + (filp->f_flags &O_NONBLOCK )) { + err = -EAGAIN ; + goto out_unlock_reading; } + data_avail = bytes_read; } -if (!data_avail) { -if (filp->f_flags &O_NONBLOCK ) { - err = -EAGAIN ; - goto out_unlock_reading; - } - }else { - len = data_avail; + len = data_avail; +if (len) {if (len > size) len = size; data_avail -= len; -if (copy_to_user (buf + ret, rng_buffer + data_avail, - len)) { +memcpy (buffer, rng_buffer + data_avail, len); + } +mutex_unlock (&reading_mutex); +put_rng (rng); + +if (len) { +if (copy_to_user (buf + ret, buffer, len)) { err = -EFAULT ; - goto out_unlock_reading; + goto out; } size -= len; ret += len; } -mutex_unlock (&reading_mutex); -put_rng (rng);if (need_resched ())schedule_timeout_interruptible (1 );
@@ -274,6 +281,7 @@ static ssize_t rng_dev_read(struct file } } out: +memzero_explicit (buffer,sizeof (buffer));return ret ? : err; out_unlock_reading:
Greg Kroah-Hartman
maintainerPATCH 42/331 crypto: s390/aes - Fix buffer overread in CTR mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit d07f951903fa9922c375b8ab1ce81b18a0034e3b upstream.
When processing the last block, the s390 ctr code will always read a whole block, even if there isn't a whole block of data left. Fix this by using the actual length left and copy it into a buffer first for processing.
--- arch/s390/crypto/aes_s390.c | 4 +++- arch/s390/crypto/paes_s390.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
arch/s390/crypto/aes_s390.c +3 -1
@@ -597,7 +597,9 @@ static int ctr_aes_crypt(struct skcipher* final block may be < AES_BLOCK_SIZE, copy only nbytes */ if (nbytes) { -cpacf_kmctr (sctx->fc, sctx->key, buf, walk.src.virt.addr, +memset (buf,0 ,AES_BLOCK_SIZE ); +memcpy (buf, walk.src.virt.addr, nbytes); +cpacf_kmctr (sctx->fc, sctx->key, buf, buf,AES_BLOCK_SIZE , walk.iv);memcpy (walk.dst.virt.addr, buf, nbytes);crypto_inc (walk.iv,AES_BLOCK_SIZE );
arch/s390/crypto/paes_s390.c +3 -1
@@ -693,9 +693,11 @@ static int ctr_paes_crypt(struct skciphe* final block may be < AES_BLOCK_SIZE, copy only nbytes */ if (nbytes) { +memset (buf,0 ,AES_BLOCK_SIZE ); +memcpy (buf, walk.src.virt.addr, nbytes);while (1 ) {if (cpacf_kmctr (ctx->fc, ¶m, buf, - walk.src.virt.addr,AES_BLOCK_SIZE , + buf,AES_BLOCK_SIZE , walk.iv) ==AES_BLOCK_SIZE )break ;if (__paes_convert_key (ctx))
Greg Kroah-Hartman
maintainerPATCH 43/331 s390/vfio-ap: unpin pages on gisc registration failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Anthony Krowiak <[email protected]>
commit 7b2d039da622daa9ba259ac6f38701d542b237c3 upstream.
In the vfio_ap_irq_enable function, after the page containing the notification indicator byte (NIB) is pinned, the function attempts to register the guest ISC. If registration fails, the function sets the status response code and returns without unpinning the page containing the NIB. In order to avoid a memory leak, the NIB should be unpinned before returning from the vfio_ap_irq_enable function.
--- drivers/s390/crypto/vfio_ap_ops.c | 1 + 1 file changed, 1 insertion(+)
drivers/s390/crypto/vfio_ap_ops.c +1 -0
@@ -457,6 +457,7 @@ static struct ap_queue_status vfio_ap_irVFIO_AP_DBF_WARN ("%s: gisc registration failed: nisc=%d, isc=%d, apqn=%#04x\n" , __func__, nisc, isc, q->apqn); +vfio_unpin_pages (&q->matrix_mdev->vdev, nib,1 ); status.response_code =AP_RESPONSE_INVALID_GISA ;return status; }
Greg Kroah-Hartman
maintainerPATCH 44/331 PM / devfreq: Fix buffer overflow in trans_stat_show
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Marangi <[email protected]>
commit 08e23d05fa6dc4fc13da0ccf09defdd4bbc92ff4 upstream.
Fix buffer overflow in trans_stat_show().
Convert simple snprintf to the more secure scnprintf with size of PAGE_SIZE.
Add condition checking if we are exceeding PAGE_SIZE and exit early from loop. Also add at the end a warning that we exceeded PAGE_SIZE and that stats is disabled.
Return -EFBIG in the case where we don't have enough space to write the full transition table.
Also document in the ABI that this function can return -EFBIG error.
--- Documentation/ABI/testing/sysfs-class-devfreq | 3 + drivers/devfreq/devfreq.c | 59 +++++++++++++++++--------- 2 files changed, 43 insertions(+), 19 deletions(-)
Documentation/ABI/testing/sysfs-class-devfreq +3 -0
@@ -52,6 +52,9 @@ Description: echo 0 > /sys/class/devfreq/.../trans_stat + If the transition table is bigger than PAGE_SIZE, reading + this will return an -EFBIG error. + What: /sys/class/devfreq/.../available_frequencies Date: October 2012 Contact: Nishanth Menon <[email protected]>
drivers/devfreq/devfreq.c +40 -19
85 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 45/331 mtd: maps: vmu-flash: Fix the (mtd core) switch to ref counters
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit a7d84a2e7663bbe12394cc771107e04668ea313a upstream.
While switching to ref counters for track mtd devices use, the vmu-flash driver was forgotten. The reason for reading the ref counter seems debatable, but let's just fix the build for now.
--- drivers/mtd/maps/vmu-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/vmu-flash.c +1 -1
@@ -719,7 +719,7 @@ static int vmu_can_unload(struct maple_device *mdev) card =maple_get_drvdata (mdev);for (x =0 ; x < card->partitions; x++) { mtd = &((card->mtd)[x]); -if (mtd->usecount >0 ) +if (kref_read (&mtd->refcnt))return 0 ; }return 1 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 46/331 mtd: rawnand: Prevent crossing LUN boundaries during sequential reads
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit bbcd80f53a5e8c27c2511f539fec8c373f500cf4 upstream.
The ONFI specification states that devices do not need to support sequential reads across LUN boundaries. In order to prevent such event from happening and possibly failing, let's introduce the concept of "pause" in the sequential read to handle these cases. The first/last pages remain the same but any time we cross a LUN boundary we will end and restart (if relevant) the sequential read operation.
--- drivers/mtd/nand/raw/nand_base.c | 43 +++++++++++++++++++++++++++++++++------ include/linux/mtd/rawnand.h | 2 + 2 files changed, 39 insertions(+), 6 deletions(-)
drivers/mtd/nand/raw/nand_base.c +37 -6
@@ -1208,6 +1208,23 @@ static int nand_lp_exec_read_page_op(strreturn nand_exec_op (chip, &op); } +static void rawnand_cap_cont_reads (struct nand_chip *chip) +{ +struct nand_memory_organization *memorg; +unsigned int pages_per_lun, first_lun, last_lun; + + memorg =nanddev_get_memorg (&chip->base); + pages_per_lun = memorg->pages_per_eraseblock * memorg->eraseblocks_per_lun; + first_lun = chip->cont_read.first_page / pages_per_lun; + last_lun = chip->cont_read.last_page / pages_per_lun; + +/* Prevent sequential cache reads across LUN boundaries */ +if (first_lun != last_lun) + chip->cont_read.pause_page = first_lun * pages_per_lun + pages_per_lun -1 ; +else + chip->cont_read.pause_page = chip->cont_read.last_page; +} +static int nand_lp_exec_cont_read_page_op (struct nand_chip *chip,unsigned int page,unsigned int offset_in_page,void *buf,unsigned int len,bool check_only)
@@ -1226,7 +1243,7 @@ static int nand_lp_exec_cont_read_page_o NAND_OP_DATA_IN(len, buf, 0), };struct nand_op_instr cont_instrs[] = { -NAND_OP_CMD (page == chip->cont_read.last_page ? +NAND_OP_CMD (page == chip->cont_read.pause_page ?NAND_CMD_READCACHEEND :NAND_CMD_READCACHESEQ ,NAND_COMMON_TIMING_NS (conf, tWB_max)), NAND_OP_WAIT_RDY(NAND_COMMON_TIMING_MS(conf, tR_max),
@@ -1263,16 +1280,29 @@ static int nand_lp_exec_cont_read_page_o }if (page == chip->cont_read.first_page) -return nand_exec_op (chip, &start_op); + ret =nand_exec_op (chip, &start_op);else -return nand_exec_op (chip, &cont_op); + ret =nand_exec_op (chip, &cont_op); +if (ret) +return ret; + +if (!chip->cont_read.ongoing) +return 0 ; + +if (page == chip->cont_read.pause_page && + page != chip->cont_read.last_page) { + chip->cont_read.first_page = chip->cont_read.pause_page +1 ; +rawnand_cap_cont_reads (chip); + }else if (page == chip->cont_read.last_page) { + chip->cont_read.ongoing = false; + } + +return 0 ; }static bool rawnand_cont_read_ongoing (struct nand_chip *chip,unsigned int page) { -return chip->cont_read.ongoing && - page >= chip->cont_read.first_page && - page <= chip->cont_read.last_page; +return chip->cont_read.ongoing && page >= chip->cont_read.first_page; }/**
@@ -3446,6 +3476,7 @@ static void rawnand_enable_cont_reads(stif (col) chip->cont_read.first_page++; chip->cont_read.last_page = page + ((readlen >> chip->page_shift) & chip->pagemask); +rawnand_cap_cont_reads (chip); }/**
include/linux/mtd/rawnand.h +2 -0
@@ -1265,6 +1265,7 @@ struct nand_secure_region {* @cont_read: Sequential page read internals * @cont_read.ongoing: Whether a continuous read is ongoing or not * @cont_read.first_page: Start of the continuous read operation +* @cont_read.pause_page: End of the current sequential cache read operation * @cont_read.last_page: End of the continuous read operation * @controller: The hardware controller structure which is shared among multiple * independent devices
@@ -1321,6 +1322,7 @@ struct nand_chip {struct {bool ongoing;unsigned int first_page; +unsigned int pause_page;unsigned int last_page; } cont_read;
Greg Kroah-Hartman
maintainerPATCH 47/331 mtd: rawnand: Fix core interference with sequential reads
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit 7c9414c870c027737d0f2ed7b0ed10f26edb1c61 upstream.
A couple of reports pointed at some strange failures happening a bit randomly since the introduction of sequential page reads support. After investigation it turned out the most likely reason for these issues was the fact that sometimes a (longer) read might happen, starting at the same page that was read previously. This is optimized by the raw NAND core, by not sending the READ_PAGE command to the NAND device and just reading out the data in a local cache. When this page is also flagged as being the starting point for a sequential read, it means the page right next will be accessed without the right instructions. The NAND chip will be confused and will not output correct data. In order to avoid such situation from happening anymore, we can however handle this case with a bit of additional logic, to postpone the initialization of the read sequence by one page.
--- drivers/mtd/nand/raw/nand_base.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/mtd/nand/raw/nand_base.c +14 -0
@@ -3479,6 +3479,18 @@ static void rawnand_enable_cont_reads(strawnand_cap_cont_reads (chip); } +static void rawnand_cont_read_skip_first_page (struct nand_chip *chip,unsigned int page) +{ +if (!chip->cont_read.ongoing || page != chip->cont_read.first_page) +return ; + + chip->cont_read.first_page++; +if (chip->cont_read.first_page == chip->cont_read.pause_page) + chip->cont_read.first_page++; +if (chip->cont_read.first_page >= chip->cont_read.last_page) + chip->cont_read.ongoing = false; +} +/** * nand_setup_read_retry - [INTERN] Set the READ RETRY mode * @chip: NAND chip object
@@ -3653,6 +3665,8 @@ read_retry: buf += bytes; max_bitflips = max_t(unsigned int, max_bitflips, chip->pagecache.bitflips); + +rawnand_cont_read_skip_first_page (chip, page); } readlen -= bytes;
Greg Kroah-Hartman
maintainerPATCH 48/331 mtd: rawnand: Prevent sequential reads with on-die ECC engines
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit a62c4597953fe54c6af04166a5e2872efd0e1490 upstream.
Some devices support sequential reads when using the on-die ECC engines, some others do not. It is a bit hard to know which ones will break other than experimentally, so in order to avoid such a difficult and painful task, let's just pretend all devices should avoid using this optimization when configured like this.
--- drivers/mtd/nand/raw/nand_base.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/mtd/nand/raw/nand_base.c +8 -0
@@ -5171,6 +5171,14 @@ static void rawnand_late_check_supported/* The supported_op fields should not be set by individual drivers */ WARN_ON_ONCE (chip->controller->supported_op.cont_read); +/* +* Too many devices do not support sequential cached reads with on-die +* ECC correction enabled, so in this case refuse to perform the +* automation. +*/ +if (chip->ecc.engine_type ==NAND_ECC_ENGINE_TYPE_ON_DIE ) +return ; +if (!nand_has_exec_op (chip))return ;
Greg Kroah-Hartman
maintainerPATCH 49/331 mtd: rawnand: Clarify conditions to enable continuous reads
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miquel Raynal <[email protected]>
commit 828f6df1bcba7f64729166efc7086ea657070445 upstream.
The current logic is probably fine but is a bit convoluted. Plus, we don't want partial pages to be part of the sequential operation just in case the core would optimize the page read with a subpage read (which would break the sequence). This may happen on the first and last page only, so if the start offset or the end offset is not aligned with a page boundary, better avoid them to prevent any risk.
--- drivers/mtd/nand/raw/nand_base.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/mtd/nand/raw/nand_base.c +16 -8
@@ -3461,21 +3461,29 @@ static void rawnand_enable_cont_reads(st u32 readlen, int col) {struct mtd_info *mtd =nand_to_mtd (chip); +unsigned int end_page, end_col; + + chip->cont_read.ongoing = false;if (!chip->controller->supported_op.cont_read)return ; -if ((col && col + readlen < (3 * mtd->writesize)) || - (!col && readlen < (2 * mtd->writesize))) { - chip->cont_read.ongoing = false; + end_page =DIV_ROUND_UP (col + readlen, mtd->writesize); + end_col = (col + readlen) % mtd->writesize; + +if (col) + page++; + +if (end_col && end_page) + end_page--; + +if (page +1 > end_page)return ; - } - chip->cont_read.ongoing = true; chip->cont_read.first_page = page; -if (col) - chip->cont_read.first_page++; - chip->cont_read.last_page = page + ((readlen >> chip->page_shift) & chip->pagemask); + chip->cont_read.last_page = end_page; + chip->cont_read.ongoing = true; +rawnand_cap_cont_reads (chip); }
Greg Kroah-Hartman
maintainerPATCH 50/331 soc: qcom: pmic_glink_altmode: fix port sanity check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit c4fb7d2eac9ff9bfc35a2e4d40c7169a332416e0 upstream.
The PMIC GLINK altmode driver currently supports at most two ports.
Fix the incomplete port sanity check on notifications to avoid accessing and corrupting memory beyond the port array if we ever get a notification for an unsupported port.
--- drivers/soc/qcom/pmic_glink_altmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/qcom/pmic_glink_altmode.c +2 -2
@@ -285,7 +285,7 @@ static void pmic_glink_altmode_sc8180xp_ svid = mux ==2 ?USB_TYPEC_DP_SID :0 ; -if (!altmode->ports[port].altmode) { +if (port >=ARRAY_SIZE (altmode->ports) || !altmode->ports[port].altmode) {dev_dbg (altmode->dev,"notification on undefined port %d\n" , port);return ; }
@@ -328,7 +328,7 @@ static void pmic_glink_altmode_sc8280xp_ hpd_state =FIELD_GET (SC8280XP_HPD_STATE_MASK , notify->payload[8 ]); hpd_irq =FIELD_GET (SC8280XP_HPD_IRQ_MASK , notify->payload[8 ]); -if (!altmode->ports[port].altmode) { +if (port >=ARRAY_SIZE (altmode->ports) || !altmode->ports[port].altmode) {dev_dbg (altmode->dev,"notification on undefined port %d\n" , port);return ; }
Greg Kroah-Hartman
maintainerPATCH 51/331 media: imx355: Enable runtime PM before registering async sub-device
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bingbu Cao <[email protected]>
commit efa5fe19c0a9199f49e36e1f5242ed5c88da617d upstream.
As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail.
So runtime PM should be ready before its async sub-device is registered and accessible by others.
--- drivers/media/i2c/imx355.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/media/i2c/imx355.c +7 -5
@@ -1788,10 +1788,6 @@ static int imx355_probe(struct i2c_clien goto error_handler_free; } - ret =v4l2_async_register_subdev_sensor (&imx355->sd); -if (ret <0 ) - goto error_media_entity; -/* * Device is already turned on by i2c-core with ACPI domain PM. * Enable runtime PM and turn off the device.
@@ -1800,9 +1796,15 @@ static int imx355_probe(struct i2c_clienpm_runtime_enable (&client->dev);pm_runtime_idle (&client->dev); + ret =v4l2_async_register_subdev_sensor (&imx355->sd); +if (ret <0 ) + goto error_media_entity_runtime_pm; +return 0 ; -error_media_entity: +error_media_entity_runtime_pm: +pm_runtime_disable (&client->dev); +pm_runtime_set_suspended (&client->dev);media_entity_cleanup (&imx355->sd.entity); error_handler_free:
Greg Kroah-Hartman
maintainerPATCH 52/331 rpmsg: virtio: Free driver_override when rpmsg_remove()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaolei Wang <[email protected]>
commit d5362c37e1f8a40096452fc201c30e705750e687 upstream.
Free driver_override when rpmsg_remove(), otherwise the following memory leak will occur:
unreferenced object 0xffff0000d55d7080 (size 128):
comm "kworker/u8:2", pid 56, jiffies 4294893188 (age 214.272s) hex dump (first 32 bytes):
72 70 6d 73 67 5f 6e 73 00 00 00 00 00 00 00 00 rpmsg_ns........
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000009c94c9c1>] __kmem_cache_alloc_node+0x1f8/0x320
[<000000002300d89b>] __kmalloc_node_track_caller+0x44/0x70
[<00000000228a60c3>] kstrndup+0x4c/0x90
[<0000000077158695>] driver_set_override+0xd0/0x164
[<000000003e9c4ea5>] rpmsg_register_device_override+0x98/0x170
[<000000001c0c89a8>] rpmsg_ns_register_device+0x24/0x30
[<000000008bbf8fa2>] rpmsg_probe+0x2e0/0x3ec
[<00000000e65a68df>] virtio_dev_probe+0x1c0/0x280
[<00000000443331cc>] really_probe+0xbc/0x2dc
[<00000000391064b1>] __driver_probe_device+0x78/0xe0
[<00000000a41c9a5b>] driver_probe_device+0xd8/0x160
[<000000009c3bd5df>] __device_attach_driver+0xb8/0x140
[<0000000043cd7614>] bus_for_each_drv+0x7c/0xd4
[<000000003b929a36>] __device_attach+0x9c/0x19c
[<00000000a94e0ba8>] device_initial_probe+0x14/0x20
[<000000003c999637>] bus_probe_device+0xa0/0xac--- drivers/rpmsg/virtio_rpmsg_bus.c | 1 + 1 file changed, 1 insertion(+)
drivers/rpmsg/virtio_rpmsg_bus.c +1 -0
@@ -378,6 +378,7 @@ static void virtio_rpmsg_release_device(struct rpmsg_device *rpdev =to_rpmsg_device (dev);struct virtio_rpmsg_channel *vch =to_virtio_rpmsg_channel (rpdev); +kfree (rpdev->driver_override);kfree (vch); }
Greg Kroah-Hartman
maintainerPATCH 53/331 media: ov9734: Enable runtime PM before registering async sub-device
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bingbu Cao <[email protected]>
commit e242e9c144050ed120cf666642ba96b7c4462a4c upstream.
As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail.
So runtime PM should be ready before its async sub-device is registered and accessible by others.
--- drivers/media/i2c/ov9734.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/media/i2c/ov9734.c +11 -8
@@ -939,6 +939,7 @@ static void ov9734_remove(struct i2c_climedia_entity_cleanup (&sd->entity);v4l2_ctrl_handler_free (sd->ctrl_handler);pm_runtime_disable (&client->dev); +pm_runtime_set_suspended (&client->dev);mutex_destroy (&ov9734->mutex); }
@@ -984,13 +985,6 @@ static int ov9734_probe(struct i2c_clien goto probe_error_v4l2_ctrl_handler_free; } - ret =v4l2_async_register_subdev_sensor (&ov9734->sd); -if (ret <0 ) { -dev_err (&client->dev,"failed to register V4L2 subdev: %d" , - ret); - goto probe_error_media_entity_cleanup; - } -/* * Device is already turned on by i2c-core with ACPI domain PM. * Enable runtime PM and turn off the device.
@@ -999,9 +993,18 @@ static int ov9734_probe(struct i2c_clienpm_runtime_enable (&client->dev);pm_runtime_idle (&client->dev); + ret =v4l2_async_register_subdev_sensor (&ov9734->sd); +if (ret <0 ) { +dev_err (&client->dev,"failed to register V4L2 subdev: %d" , + ret); + goto probe_error_media_entity_cleanup_pm; + } +return 0 ; -probe_error_media_entity_cleanup: +probe_error_media_entity_cleanup_pm: +pm_runtime_disable (&client->dev); +pm_runtime_set_suspended (&client->dev);media_entity_cleanup (&ov9734->sd.entity); probe_error_v4l2_ctrl_handler_free:
Greg Kroah-Hartman
maintainerPATCH 54/331 media: ov13b10: Enable runtime PM before registering async sub-device
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bingbu Cao <[email protected]>
commit 7b0454cfd8edb3509619407c3b9f78a6d0dee1a5 upstream.
As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail.
So runtime PM should be ready before its async sub-device is registered and accessible by others.
--- drivers/media/i2c/ov13b10.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/media/i2c/ov13b10.c +9 -5
@@ -1536,24 +1536,27 @@ static int ov13b10_probe(struct i2c_clie goto error_handler_free; } - ret =v4l2_async_register_subdev_sensor (&ov13b->sd); -if (ret <0 ) - goto error_media_entity;/* * Device is already turned on by i2c-core with ACPI domain PM. * Enable runtime PM and turn off the device. */ -/* Set the device's state to active if it's in D0 state. */ if (full_power)pm_runtime_set_active (&client->dev);pm_runtime_enable (&client->dev);pm_runtime_idle (&client->dev); + ret =v4l2_async_register_subdev_sensor (&ov13b->sd); +if (ret <0 ) + goto error_media_entity_runtime_pm; +return 0 ; -error_media_entity: +error_media_entity_runtime_pm: +pm_runtime_disable (&client->dev); +if (full_power) +pm_runtime_set_suspended (&client->dev);media_entity_cleanup (&ov13b->sd.entity); error_handler_free:
@@ -1576,6 +1579,7 @@ static void ov13b10_remove(struct i2c_clov13b10_free_controls (ov13b);pm_runtime_disable (&client->dev); +pm_runtime_set_suspended (&client->dev); } static DEFINE_RUNTIME_DEV_PM_OPS(ov13b10_pm_ops, ov13b10_suspend,
Greg Kroah-Hartman
maintainerPATCH 55/331 media: ov01a10: Enable runtime PM before registering async sub-device
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bingbu Cao <[email protected]>
commit 47a78052db51b16e8045524fbf33373b58f1323b upstream.
As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail.
So runtime PM should be ready before its async sub-device is registered and accessible by others.
It also sets the runtime PM status to active as the sensor was turned on by i2c-core.
--- drivers/media/i2c/ov01a10.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/media/i2c/ov01a10.c +14 -4
@@ -907,6 +907,7 @@ static void ov01a10_remove(struct i2c_clv4l2_ctrl_handler_free (sd->ctrl_handler);pm_runtime_disable (&client->dev); +pm_runtime_set_suspended (&client->dev); }static int ov01a10_probe (struct i2c_client *client)
@@ -953,17 +954,26 @@ static int ov01a10_probe(struct i2c_clie goto err_media_entity_cleanup; } +/* +* Device is already turned on by i2c-core with ACPI domain PM. +* Enable runtime PM and turn off the device. +*/ +pm_runtime_set_active (&client->dev); +pm_runtime_enable (dev); +pm_runtime_idle (dev); + ret =v4l2_async_register_subdev_sensor (&ov01a10->sd);if (ret <0 ) {dev_err (dev,"Failed to register subdev: %d\n" , ret); - goto err_media_entity_cleanup; + goto err_pm_disable; } -pm_runtime_enable (dev); -pm_runtime_idle (dev); -return 0 ; +err_pm_disable: +pm_runtime_disable (dev); +pm_runtime_set_suspended (&client->dev); + err_media_entity_cleanup:media_entity_cleanup (&ov01a10->sd.entity);
Greg Kroah-Hartman
maintainerPATCH 56/331 soc: fsl: cpm1: tsa: Fix __iomem addresses declaration
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herve Codina <[email protected]>
commit fc0c64154e5ddeb6f63c954735bd646ce5b8d9a4 upstream.
Running sparse (make C=1) on tsa.c raises a lot of warning such as:
--- 8< ---
warning: incorrect type in assignment (different address spaces)
expected void *[noderef] si_regs
got void [noderef] __iomem *
--- 8< ---
Indeed, some variable were declared 'type *__iomem var' instead of 'type __iomem *var'.
Use the correct declaration to remove these warnings.
--- drivers/soc/fsl/qe/tsa.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/soc/fsl/qe/tsa.c +11 -11
@@ -98,9 +98,9 @@#define TSA_SIRP 0x10struct tsa_entries_area { -void *__iomem entries_start; -void *__iomem entries_next; -void *__iomem last_entry; +void __iomem *entries_start; +void __iomem *entries_next; +void __iomem *last_entry; };struct tsa_tdm {
@@ -117,8 +117,8 @@ struct tsa_tdm {struct tsa {struct device *dev; -void *__iomem si_regs; -void *__iomem si_ram; +void __iomem *si_regs; +void __iomem *si_ram;resource_size_t si_ram_sz;spinlock_t lock;int tdms;/* TSA_TDMx ORed */
@@ -135,27 +135,27 @@ static inline struct tsa *tsa_serial_get return container_of(tsa_serial, struct tsa, serials[tsa_serial->id]); } -static inline void tsa_write32 (void *__iomem addr,u32 val) +static inline void tsa_write32 (void __iomem *addr,u32 val) {iowrite32be (val, addr); } -static inline void tsa_write8 (void *__iomem addr,u32 val) +static inline void tsa_write8 (void __iomem *addr,u32 val) {iowrite8 (val, addr); } -static inline u32 tsa_read32 (void *__iomem addr) +static inline u32 tsa_read32 (void __iomem *addr) {return ioread32be (addr); } -static inline void tsa_clrbits32 (void *__iomem addr,u32 clr) +static inline void tsa_clrbits32 (void __iomem *addr,u32 clr) {tsa_write32 (addr,tsa_read32 (addr) & ~clr); } -static inline void tsa_clrsetbits32 (void *__iomem addr,u32 clr,u32 set) +static inline void tsa_clrsetbits32 (void __iomem *addr,u32 clr,u32 set) {tsa_write32 (addr, (tsa_read32 (addr) & ~clr) | set); }
@@ -313,7 +313,7 @@ static u32 tsa_serial_id2csel(struct tsastatic int tsa_add_entry (struct tsa *tsa,struct tsa_entries_area *area,u32 count,u32 serial_id) { -void *__iomem addr; +void __iomem *addr;u32 left;u32 val;u32 cnt;
Greg Kroah-Hartman
maintainerPATCH 57/331 soc: fsl: cpm1: qmc: Fix __iomem addresses declaration
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herve Codina <[email protected]>
commit a5ec3a21220da06bdda2e686012ca64fdb6c513d upstream.
Running sparse (make C=1) on qmc.c raises a lot of warning such as:
...
warning: incorrect type in assignment (different address spaces)
expected struct cpm_buf_desc [usertype] *[noderef] __iomem bd got struct cpm_buf_desc [noderef] [usertype] __iomem *txbd_free
...
Indeed, some variable were declared 'type *__iomem var' instead of 'type __iomem *var'.
Use the correct declaration to remove these warnings.
--- drivers/soc/fsl/qe/qmc.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/soc/fsl/qe/qmc.c +17 -17
@@ -175,7 +175,7 @@ struct qmc_chan {struct list_head list;unsigned int id;struct qmc *qmc; -void *__iomem s_param; +void __iomem *s_param;enum qmc_mode mode;u64 tx_ts_mask;u64 rx_ts_mask;
@@ -203,9 +203,9 @@ struct qmc_chan {struct qmc {struct device *dev;struct tsa_serial *tsa_serial; -void *__iomem scc_regs; -void *__iomem scc_pram; -void *__iomem dpram; +void __iomem *scc_regs; +void __iomem *scc_pram; +void __iomem *dpram;u16 scc_pram_offset;cbd_t __iomem *bd_table;dma_addr_t bd_dma_addr;
@@ -218,37 +218,37 @@ struct qmc {struct qmc_chan *chans[64 ]; }; -static inline void qmc_write16 (void *__iomem addr,u16 val) +static inline void qmc_write16 (void __iomem *addr,u16 val) {iowrite16be (val, addr); } -static inline u16 qmc_read16 (void *__iomem addr) +static inline u16 qmc_read16 (void __iomem *addr) {return ioread16be (addr); } -static inline void qmc_setbits16 (void *__iomem addr,u16 set) +static inline void qmc_setbits16 (void __iomem *addr,u16 set) {qmc_write16 (addr,qmc_read16 (addr) | set); } -static inline void qmc_clrbits16 (void *__iomem addr,u16 clr) +static inline void qmc_clrbits16 (void __iomem *addr,u16 clr) {qmc_write16 (addr,qmc_read16 (addr) & ~clr); } -static inline void qmc_write32 (void *__iomem addr,u32 val) +static inline void qmc_write32 (void __iomem *addr,u32 val) {iowrite32be (val, addr); } -static inline u32 qmc_read32 (void *__iomem addr) +static inline u32 qmc_read32 (void __iomem *addr) {return ioread32be (addr); } -static inline void qmc_setbits32 (void *__iomem addr,u32 set) +static inline void qmc_setbits32 (void __iomem *addr,u32 set) {qmc_write32 (addr,qmc_read32 (addr) | set); }
@@ -318,7 +318,7 @@ int qmc_chan_write_submit(struct qmc_chan *chan, dma_addr_t addr, size_t length, {struct qmc_xfer_desc *xfer_desc;unsigned long flags; -cbd_t *__iomem bd; +cbd_t __iomem *bd;u16 ctrl;int ret;
@@ -374,7 +374,7 @@ static void qmc_chan_write_done(struct qmc_chan *chan)void (*complete)(void *context);unsigned long flags;void *context; -cbd_t *__iomem bd; +cbd_t __iomem *bd;u16 ctrl;/*
@@ -425,7 +425,7 @@ int qmc_chan_read_submit(struct qmc_chan *chan, dma_addr_t addr, size_t length, {struct qmc_xfer_desc *xfer_desc;unsigned long flags; -cbd_t *__iomem bd; +cbd_t __iomem *bd;u16 ctrl;int ret;
@@ -488,7 +488,7 @@ static void qmc_chan_read_done(struct qmc_chan *chan)void (*complete)(void *context,size_t size);struct qmc_xfer_desc *xfer_desc;unsigned long flags; -cbd_t *__iomem bd; +cbd_t __iomem *bd;void *context;u16 datalen;u16 ctrl;
@@ -663,7 +663,7 @@ static void qmc_chan_reset_rx(struct qmc_chan *chan) {struct qmc_xfer_desc *xfer_desc;unsigned long flags; -cbd_t *__iomem bd; +cbd_t __iomem *bd;u16 ctrl;spin_lock_irqsave (&chan->rx_lock, flags);
@@ -694,7 +694,7 @@ static void qmc_chan_reset_tx(struct qmc_chan *chan) {struct qmc_xfer_desc *xfer_desc;unsigned long flags; -cbd_t *__iomem bd; +cbd_t __iomem *bd;u16 ctrl;spin_lock_irqsave (&chan->tx_lock, flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 58/331 soc: fsl: cpm1: qmc: Fix rx channel reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herve Codina <[email protected]>
commit dfe66d012af2ddfa566cf9c860b8472b412fb7e4 upstream.
The qmc_chan_reset_rx() set the is_rx_stopped flag. This leads to an inconsistent state in the following sequence.
qmc_chan_stop()
qmc_chan_reset()Indeed, after the qmc_chan_reset() call, the channel must still be stopped. Only a qmc_chan_start() call can move the channel from stopped state to started state.
Fix the issue removing the is_rx_stopped flag setting from qmc_chan_reset()
--- drivers/soc/fsl/qe/qmc.c | 1 - 1 file changed, 1 deletion(-)
drivers/soc/fsl/qe/qmc.c +0 -1
@@ -685,7 +685,6 @@ static void qmc_chan_reset_rx(struct qmc_chan *chan) qmc_read16(chan->s_param + QMC_SPE_RBASE)); chan->rx_pending =0 ; - chan->is_rx_stopped = false;spin_unlock_irqrestore (&chan->rx_lock, flags); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 59/331 s390/vfio-ap: always filter entire AP matrix
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Krowiak <[email protected]>
commit 850fb7fa8c684a4c6bf0e4b6978f4ddcc5d43d11 upstream.
The vfio_ap_mdev_filter_matrix function is called whenever a new adapter or domain is assigned to the mdev. The purpose of the function is to update the guest's AP configuration by filtering the matrix of adapters and domains assigned to the mdev. When an adapter or domain is assigned, only the APQNs associated with the APID of the new adapter or APQI of the new domain are inspected. If an APQN does not reference a queue device bound to the vfio_ap device driver, then it's APID will be filtered from the mdev's matrix when updating the guest's AP configuration.
Inspecting only the APID of the new adapter or APQI of the new domain will result in passing AP queues through to a guest that are not bound to the vfio_ap device driver under certain circumstances. Consider the following:
guest's AP configuration (all also assigned to the mdev's matrix):
14.0004
14.0005
14.0006
16.0004
16.0005
16.0006
unassign domain 4
unbind queue 16.0005
assign domain 4
When domain 4 is re-assigned, since only domain 4 will be inspected, the APQNs that will be examined will be:
14.0004
16.0004
Since both of those APQNs reference queue devices that are bound to the vfio_ap device driver, nothing will get filtered from the mdev's matrix when updating the guest's AP configuration. Consequently, queue 16.0005 will get passed through despite not being bound to the driver. This violates the linux device model requirement that a guest shall only be given access to devices bound to the device driver facilitating their pass-through.
To resolve this problem, every adapter and domain assigned to the mdev will be inspected when filtering the mdev's matrix.
--- drivers/s390/crypto/vfio_ap_ops.c | 57 +++++++++++--------------------------- 1 file changed, 17 insertions(+), 40 deletions(-)
drivers/s390/crypto/vfio_ap_ops.c +17 -40
@@ -671,8 +671,7 @@ static bool vfio_ap_mdev_filter_cdoms(st* Return: a boolean value indicating whether the KVM guest's APCB was changed * by the filtering or not. */ -static bool vfio_ap_mdev_filter_matrix (unsigned long *apm,unsigned long *aqm, -struct ap_matrix_mdev *matrix_mdev) +static bool vfio_ap_mdev_filter_matrix (struct ap_matrix_mdev *matrix_mdev) {unsigned long apid, apqi, apqn;DECLARE_BITMAP (prev_shadow_apm,AP_DEVICES );
@@ -693,8 +692,8 @@ static bool vfio_ap_mdev_filter_matrix(ubitmap_and (matrix_mdev->shadow_apcb.aqm, matrix_mdev->matrix.aqm, (unsigned long *)matrix_dev->info.aqm,AP_DOMAINS ); -for_each_set_bit_inv (apid, apm,AP_DEVICES ) { -for_each_set_bit_inv (apqi, aqm,AP_DOMAINS ) { +for_each_set_bit_inv (apid, matrix_mdev->matrix.apm,AP_DEVICES ) { +for_each_set_bit_inv (apqi, matrix_mdev->matrix.aqm,AP_DOMAINS ) {/* * If the APQN is not bound to the vfio_ap device * driver, then we can't assign it to the guest's
@@ -959,7 +958,6 @@ static ssize_t assign_adapter_store(stru {int ret;unsigned long apid; -DECLARE_BITMAP (apm_delta,AP_DEVICES );struct ap_matrix_mdev *matrix_mdev =dev_get_drvdata (dev);mutex_lock (&ap_perms_mutex);
@@ -988,11 +986,8 @@ static ssize_t assign_adapter_store(stru }vfio_ap_mdev_link_adapter (matrix_mdev, apid); -memset (apm_delta,0 ,sizeof (apm_delta)); -set_bit_inv (apid, apm_delta); -if (vfio_ap_mdev_filter_matrix (apm_delta, - matrix_mdev->matrix.aqm, matrix_mdev)) +if (vfio_ap_mdev_filter_matrix (matrix_mdev))vfio_ap_mdev_update_guest_apcb (matrix_mdev); ret = count;
@@ -1168,7 +1163,6 @@ static ssize_t assign_domain_store(struc {int ret;unsigned long apqi; -DECLARE_BITMAP (aqm_delta,AP_DOMAINS );struct ap_matrix_mdev *matrix_mdev =dev_get_drvdata (dev);mutex_lock (&ap_perms_mutex);
@@ -1197,11 +1191,8 @@ static ssize_t assign_domain_store(struc }vfio_ap_mdev_link_domain (matrix_mdev, apqi); -memset (aqm_delta,0 ,sizeof (aqm_delta)); -set_bit_inv (apqi, aqm_delta); -if (vfio_ap_mdev_filter_matrix (matrix_mdev->matrix.apm, aqm_delta, - matrix_mdev)) +if (vfio_ap_mdev_filter_matrix (matrix_mdev))vfio_ap_mdev_update_guest_apcb (matrix_mdev); ret = count;
@@ -2092,9 +2083,7 @@ int vfio_ap_mdev_probe_queue(struct ap_dif (matrix_mdev) {vfio_ap_mdev_link_queue (matrix_mdev, q); -if (vfio_ap_mdev_filter_matrix (matrix_mdev->matrix.apm, - matrix_mdev->matrix.aqm, - matrix_mdev)) +if (vfio_ap_mdev_filter_matrix (matrix_mdev))vfio_ap_mdev_update_guest_apcb (matrix_mdev); }dev_set_drvdata (&apdev->device, q);
@@ -2444,34 +2433,22 @@ void vfio_ap_on_cfg_changed(struct ap_costatic void vfio_ap_mdev_hot_plug_cfg (struct ap_matrix_mdev *matrix_mdev) { -bool do_hotplug = false; -int filter_domains =0 ; -int filter_adapters =0 ; -DECLARE_BITMAP (apm,AP_DEVICES ); -DECLARE_BITMAP (aqm,AP_DOMAINS ); +bool filter_domains, filter_adapters, filter_cdoms, do_hotplug = false;mutex_lock (&matrix_mdev->kvm->lock);mutex_lock (&matrix_dev->mdevs_lock); - filter_adapters =bitmap_and (apm, matrix_mdev->matrix.apm, - matrix_mdev->apm_add,AP_DEVICES ); - filter_domains =bitmap_and (aqm, matrix_mdev->matrix.aqm, - matrix_mdev->aqm_add,AP_DOMAINS ); - -if (filter_adapters && filter_domains) - do_hotplug |=vfio_ap_mdev_filter_matrix (apm, aqm, matrix_mdev); -else if (filter_adapters) - do_hotplug |= -vfio_ap_mdev_filter_matrix (apm, - matrix_mdev->shadow_apcb.aqm, - matrix_mdev); -else - do_hotplug |= -vfio_ap_mdev_filter_matrix (matrix_mdev->shadow_apcb.apm, - aqm, matrix_mdev); + filter_adapters =bitmap_intersects (matrix_mdev->matrix.apm, + matrix_mdev->apm_add,AP_DEVICES ); + filter_domains =bitmap_intersects (matrix_mdev->matrix.aqm, + matrix_mdev->aqm_add,AP_DOMAINS ); + filter_cdoms =bitmap_intersects (matrix_mdev->matrix.adm, + matrix_mdev->adm_add,AP_DOMAINS ); + +if (filter_adapters || filter_domains) + do_hotplug =vfio_ap_mdev_filter_matrix (matrix_mdev); -if (bitmap_intersects (matrix_mdev->matrix.adm, matrix_mdev->adm_add, -AP_DOMAINS )) +if (filter_cdoms) do_hotplug |=vfio_ap_mdev_filter_cdoms (matrix_mdev);if (do_hotplug)
Greg Kroah-Hartman
maintainerPATCH 60/331 s390/vfio-ap: loop over the shadow APCB when filtering guests AP configuration
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Krowiak <[email protected]>
commit 16fb78cbf56e42b8efb2682a4444ab59e32e7959 upstream.
While filtering the mdev matrix, it doesn't make sense - and will have unexpected results - to filter an APID from the matrix if the APID or one of the associated APQIs is not in the host's AP configuration. There are two reasons for this:
1. An adapter or domain that is not in the host's AP configuration can be assigned to the matrix; this is known as over-provisioning. Queue devices, however, are only created for adapters and domains in the host's AP configuration, so there will be no queues associated with an over-provisioned adapter or domain to filter.
2. The adapter or domain may have been externally removed from the host's configuration via an SE or HMC attached to a DPM enabled LPAR. In this case, the vfio_ap device driver would have been notified by the AP bus via the on_config_changed callback and the adapter or domain would have already been filtered.
Since the matrix_mdev->shadow_apcb.apm and matrix_mdev->shadow_apcb.aqm are copied from the mdev matrix sans the APIDs and APQIs not in the host's AP configuration, let's loop over those bitmaps instead of those assigned to the matrix.
--- drivers/s390/crypto/vfio_ap_ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/s390/crypto/vfio_ap_ops.c +3 -2
@@ -692,8 +692,9 @@ static bool vfio_ap_mdev_filter_matrix(sbitmap_and (matrix_mdev->shadow_apcb.aqm, matrix_mdev->matrix.aqm, (unsigned long *)matrix_dev->info.aqm,AP_DOMAINS ); -for_each_set_bit_inv (apid, matrix_mdev->matrix.apm,AP_DEVICES ) { -for_each_set_bit_inv (apqi, matrix_mdev->matrix.aqm,AP_DOMAINS ) { +for_each_set_bit_inv (apid, matrix_mdev->shadow_apcb.apm,AP_DEVICES ) { +for_each_set_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm, +AP_DOMAINS ) {/* * If the APQN is not bound to the vfio_ap device * driver, then we can't assign it to the guest's
Greg Kroah-Hartman
maintainerPATCH 61/331 s390/vfio-ap: let on_scan_complete() callback filter matrix and update guests APCB
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Krowiak <[email protected]>
commit 774d10196e648e2c0b78da817f631edfb3dfa557 upstream.
When adapters and/or domains are added to the host's AP configuration, this may result in multiple queue devices getting created and probed by the vfio_ap device driver. For each queue device probed, the matrix of adapters and domains assigned to a matrix mdev will be filtered to update the guest's APCB. If any adapters or domains get added to or removed from the APCB, the guest's AP configuration will be dynamically updated (i.e., hot plug/unplug). To dynamically update the guest's configuration, its VCPUs must be taken out of SIE for the period of time it takes to make the update. This is disruptive to the guest's operation and if there are many queues probed due to a change in the host's AP configuration, this could be troublesome. The problem is exacerbated by the fact that the 'on_scan_complete' callback also filters the mdev's matrix and updates the guest's AP configuration.
In order to reduce the potential amount of disruption to the guest that may result from a change to the host's AP configuration, let's bypass the filtering of the matrix and updating of the guest's AP configuration in the probe callback - if due to a host config change - and defer it until the 'on_scan_complete' callback is invoked after the AP bus finishes its device scan operation. This way the filtering and updating will be performed only once regardless of the number of queues added.
--- drivers/s390/crypto/vfio_ap_ops.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/s390/crypto/vfio_ap_ops.c +13 -0
@@ -2084,9 +2084,22 @@ int vfio_ap_mdev_probe_queue(struct ap_dif (matrix_mdev) {vfio_ap_mdev_link_queue (matrix_mdev, q); +/* +* If we're in the process of handling the adding of adapters or +* domains to the host's AP configuration, then let the +* vfio_ap device driver's on_scan_complete callback filter the +* matrix and update the guest's AP configuration after all of +* the new queue devices are probed. +*/ +if (!bitmap_empty (matrix_mdev->apm_add,AP_DEVICES ) || + !bitmap_empty (matrix_mdev->aqm_add,AP_DOMAINS )) + goto done; +if (vfio_ap_mdev_filter_matrix (matrix_mdev))vfio_ap_mdev_update_guest_apcb (matrix_mdev); } + +done:dev_set_drvdata (&apdev->device, q);release_update_locks_for_mdev (matrix_mdev);
Greg Kroah-Hartman
maintainerPATCH 62/331 s390/vfio-ap: reset queues filtered from the guests AP config
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Krowiak <[email protected]>
commit f848cba767e59f8d5c54984b1d45451aae040d50 upstream.
When filtering the adapters from the configuration profile for a guest to create or update a guest's AP configuration, if the APID of an adapter and the APQI of a domain identify a queue device that is not bound to the vfio_ap device driver, the APID of the adapter will be filtered because an individual APQN can not be filtered due to the fact the APQNs are assigned to an AP configuration as a matrix of APIDs and APQIs. Consequently, a guest will not have access to all of the queues associated with the filtered adapter. If the queues are subsequently made available again to the guest, they should re-appear in a reset state; so, let's make sure all queues associated with an adapter unplugged from the guest are reset.
In order to identify the set of queues that need to be reset, let's allow a vfio_ap_queue object to be simultaneously stored in both a hashtable and a
list: A hashtable used to store all of the queues assigned
to a matrix mdev; and/or, a list used to store a subset of the queues that need to be reset. For example, when an adapter is hot unplugged from a guest, all guest queues associated with that adapter must be reset. Since that may be a subset of those assigned to the matrix mdev, they can be stored in a list that can be passed to the vfio_ap_mdev_reset_queues function.
--- drivers/s390/crypto/vfio_ap_ops.c | 171 +++++++++++++++++++++++++--------- drivers/s390/crypto/vfio_ap_private.h | 3 2 files changed, 129 insertions(+), 45 deletions(-)
drivers/s390/crypto/vfio_ap_ops.c +126 -45
@@ -32,7 +32,8 @@#define AP_RESET_INTERVAL 20/* Reset sleep interval (20ms) */ -static int vfio_ap_mdev_reset_queues (struct ap_queue_table *qtable); +static int vfio_ap_mdev_reset_queues (struct ap_matrix_mdev *matrix_mdev); +static int vfio_ap_mdev_reset_qlist (struct list_head *qlist);static struct vfio_ap_queue *vfio_ap_find_queue (int apqn);static const struct vfio_device_ops vfio_ap_matrix_dev_ops;static void vfio_ap_mdev_reset_queue (struct vfio_ap_queue *q);
@@ -662,16 +663,23 @@ static bool vfio_ap_mdev_filter_cdoms(st* device driver. * * @matrix_mdev: the matrix mdev whose matrix is to be filtered. +* @apm_filtered: a 256-bit bitmap for storing the APIDs filtered from the +* guest's AP configuration that are still in the host's AP +* configuration. * * Note: If an APQN referencing a queue device that is not bound to the vfio_ap * driver, its APID will be filtered from the guest's APCB. The matrix * structure precludes filtering an individual APQN, so its APID will be -* filtered. +* filtered. Consequently, all queues associated with the adapter that +* are in the host's AP configuration must be reset. If queues are +* subsequently made available again to the guest, they should re-appear +* in a reset state * * Return: a boolean value indicating whether the KVM guest's APCB was changed * by the filtering or not. */ -static bool vfio_ap_mdev_filter_matrix (struct ap_matrix_mdev *matrix_mdev) +static bool vfio_ap_mdev_filter_matrix (struct ap_matrix_mdev *matrix_mdev, +unsigned long *apm_filtered) {unsigned long apid, apqi, apqn;DECLARE_BITMAP (prev_shadow_apm,AP_DEVICES );
@@ -681,6 +689,7 @@ static bool vfio_ap_mdev_filter_matrix(sbitmap_copy (prev_shadow_apm, matrix_mdev->shadow_apcb.apm,AP_DEVICES );bitmap_copy (prev_shadow_aqm, matrix_mdev->shadow_apcb.aqm,AP_DOMAINS );vfio_ap_matrix_init (&matrix_dev->info, &matrix_mdev->shadow_apcb); +bitmap_clear (apm_filtered,0 ,AP_DEVICES );/* * Copy the adapters, domains and control domains to the shadow_apcb
@@ -706,8 +715,16 @@ static bool vfio_ap_mdev_filter_matrix(s apqn =AP_MKQID (apid, apqi); q =vfio_ap_mdev_get_queue (matrix_mdev, apqn);if (!q || q->reset_status.response_code) { -clear_bit_inv (apid, - matrix_mdev->shadow_apcb.apm); +clear_bit_inv (apid, matrix_mdev->shadow_apcb.apm); + +/* +* If the adapter was previously plugged into +* the guest, let's let the caller know that +* the APID was filtered. +*/ +if (test_bit_inv (apid, prev_shadow_apm)) +set_bit_inv (apid, apm_filtered); +break ; } }
@@ -809,7 +826,7 @@ static void vfio_ap_mdev_remove(struct mmutex_lock (&matrix_dev->guests_lock);mutex_lock (&matrix_dev->mdevs_lock); -vfio_ap_mdev_reset_queues (&matrix_mdev->qtable); +vfio_ap_mdev_reset_queues (matrix_mdev);vfio_ap_mdev_unlink_fr_queues (matrix_mdev);list_del (&matrix_mdev->node);mutex_unlock (&matrix_dev->mdevs_lock);
@@ -919,6 +936,47 @@ static void vfio_ap_mdev_link_adapter(st AP_MKQID(apid, apqi)); } +static int reset_queues_for_apids (struct ap_matrix_mdev *matrix_mdev, +unsigned long *apm_reset) +{ +struct vfio_ap_queue *q, *tmpq; +struct list_head qlist; +unsigned long apid, apqi; +int apqn, ret =0 ; + +if (bitmap_empty (apm_reset,AP_DEVICES )) +return 0 ; + +INIT_LIST_HEAD (&qlist); + +for_each_set_bit_inv (apid, apm_reset,AP_DEVICES ) { +for_each_set_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm, +AP_DOMAINS ) { +/* +* If the domain is not in the host's AP configuration, +* then resetting it will fail with response code 01 +* (APQN not valid). +*/ +if (!test_bit_inv (apqi, + (unsigned long *)matrix_dev->info.aqm)) +continue ; + + apqn =AP_MKQID (apid, apqi); + q =vfio_ap_mdev_get_queue (matrix_mdev, apqn); + +if (q) +list_add_tail (&q->reset_qnode, &qlist); + } + } + + ret =vfio_ap_mdev_reset_qlist (&qlist); + +list_for_each_entry_safe (q, tmpq, &qlist, reset_qnode) +list_del (&q->reset_qnode); + +return ret; +} +/** * assign_adapter_store - parses the APID from @buf and sets the * corresponding bit in the mediated matrix device's APM
@@ -959,6 +1017,7 @@ static ssize_t assign_adapter_store(stru {int ret;unsigned long apid; +DECLARE_BITMAP (apm_filtered,AP_DEVICES );struct ap_matrix_mdev *matrix_mdev =dev_get_drvdata (dev);mutex_lock (&ap_perms_mutex);
@@ -988,8 +1047,10 @@ static ssize_t assign_adapter_store(struvfio_ap_mdev_link_adapter (matrix_mdev, apid); -if (vfio_ap_mdev_filter_matrix (matrix_mdev)) +if (vfio_ap_mdev_filter_matrix (matrix_mdev, apm_filtered)) {vfio_ap_mdev_update_guest_apcb (matrix_mdev); +reset_queues_for_apids (matrix_mdev, apm_filtered); + } ret = count; done:
@@ -1020,11 +1081,12 @@ static struct vfio_ap_queue* adapter was assigned. * @matrix_mdev: the matrix mediated device to which the adapter was assigned. * @apid: the APID of the unassigned adapter. -* @qtable: table for storing queues associated with unassigned adapter. +* @qlist: list for storing queues associated with unassigned adapter that +* need to be reset. */ static void vfio_ap_mdev_unlink_adapter (struct ap_matrix_mdev *matrix_mdev,unsigned long apid, -struct ap_queue_table *qtable) +struct list_head *qlist) {unsigned long apqi;struct vfio_ap_queue *q;
@@ -1032,11 +1094,10 @@ static void vfio_ap_mdev_unlink_adapter(for_each_set_bit_inv (apqi, matrix_mdev->matrix.aqm,AP_DOMAINS ) { q =vfio_ap_unlink_apqn_fr_mdev (matrix_mdev, apid, apqi); -if (q && qtable) { +if (q && qlist) {if (test_bit_inv (apid, matrix_mdev->shadow_apcb.apm) &&test_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm)) -hash_add (qtable->queues, &q->mdev_qnode, - q->apqn); +list_add_tail (&q->reset_qnode, qlist); } } }
@@ -1044,26 +1105,23 @@ static void vfio_ap_mdev_unlink_adapter(static void vfio_ap_mdev_hot_unplug_adapter (struct ap_matrix_mdev *matrix_mdev,unsigned long apid) { -int loop_cursor; -struct vfio_ap_queue *q; -struct ap_queue_table *qtable =kzalloc (sizeof (*qtable),GFP_KERNEL ); +struct vfio_ap_queue *q, *tmpq; +struct list_head qlist; -hash_init (qtable->queues); -vfio_ap_mdev_unlink_adapter (matrix_mdev, apid, qtable); +INIT_LIST_HEAD (&qlist); +vfio_ap_mdev_unlink_adapter (matrix_mdev, apid, &qlist);if (test_bit_inv (apid, matrix_mdev->shadow_apcb.apm)) {clear_bit_inv (apid, matrix_mdev->shadow_apcb.apm);vfio_ap_mdev_update_guest_apcb (matrix_mdev); } -vfio_ap_mdev_reset_queues (qtable); +vfio_ap_mdev_reset_qlist (&qlist); -hash_for_each (qtable->queues, loop_cursor, q, mdev_qnode) { +list_for_each_entry_safe (q, tmpq, &qlist, reset_qnode) {vfio_ap_unlink_mdev_fr_queue (q); -hash_del (&q->mdev_qnode); +list_del (&q->reset_qnode); } - -kfree (qtable); }/**
@@ -1164,6 +1222,7 @@ static ssize_t assign_domain_store(struc {int ret;unsigned long apqi; +DECLARE_BITMAP (apm_filtered,AP_DEVICES );struct ap_matrix_mdev *matrix_mdev =dev_get_drvdata (dev);mutex_lock (&ap_perms_mutex);
@@ -1193,8 +1252,10 @@ static ssize_t assign_domain_store(strucvfio_ap_mdev_link_domain (matrix_mdev, apqi); -if (vfio_ap_mdev_filter_matrix (matrix_mdev)) +if (vfio_ap_mdev_filter_matrix (matrix_mdev, apm_filtered)) {vfio_ap_mdev_update_guest_apcb (matrix_mdev); +reset_queues_for_apids (matrix_mdev, apm_filtered); + } ret = count; done:
@@ -1207,7 +1268,7 @@ static DEVICE_ATTR_WO(assign_domain);static void vfio_ap_mdev_unlink_domain (struct ap_matrix_mdev *matrix_mdev,unsigned long apqi, -struct ap_queue_table *qtable) +struct list_head *qlist) {unsigned long apid;struct vfio_ap_queue *q;
@@ -1215,11 +1276,10 @@ static void vfio_ap_mdev_unlink_domain(sfor_each_set_bit_inv (apid, matrix_mdev->matrix.apm,AP_DEVICES ) { q =vfio_ap_unlink_apqn_fr_mdev (matrix_mdev, apid, apqi); -if (q && qtable) { +if (q && qlist) {if (test_bit_inv (apid, matrix_mdev->shadow_apcb.apm) &&test_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm)) -hash_add (qtable->queues, &q->mdev_qnode, - q->apqn); +list_add_tail (&q->reset_qnode, qlist); } } }
@@ -1227,26 +1287,23 @@ static void vfio_ap_mdev_unlink_domain(sstatic void vfio_ap_mdev_hot_unplug_domain (struct ap_matrix_mdev *matrix_mdev,unsigned long apqi) { -int loop_cursor; -struct vfio_ap_queue *q; -struct ap_queue_table *qtable =kzalloc (sizeof (*qtable),GFP_KERNEL ); +struct vfio_ap_queue *q, *tmpq; +struct list_head qlist; -hash_init (qtable->queues); -vfio_ap_mdev_unlink_domain (matrix_mdev, apqi, qtable); +INIT_LIST_HEAD (&qlist); +vfio_ap_mdev_unlink_domain (matrix_mdev, apqi, &qlist);if (test_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm)) {clear_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm);vfio_ap_mdev_update_guest_apcb (matrix_mdev); } -vfio_ap_mdev_reset_queues (qtable); +vfio_ap_mdev_reset_qlist (&qlist); -hash_for_each (qtable->queues, loop_cursor, q, mdev_qnode) { +list_for_each_entry_safe (q, tmpq, &qlist, reset_qnode) {vfio_ap_unlink_mdev_fr_queue (q); -hash_del (&q->mdev_qnode); +list_del (&q->reset_qnode); } - -kfree (qtable); }/**
@@ -1601,7 +1658,7 @@ static void vfio_ap_mdev_unset_kvm(strucget_update_locks_for_kvm (kvm);kvm_arch_crypto_clear_masks (kvm); -vfio_ap_mdev_reset_queues (&matrix_mdev->qtable); +vfio_ap_mdev_reset_queues (matrix_mdev);kvm_put_kvm (kvm); matrix_mdev->kvm =NULL ;
@@ -1737,15 +1794,33 @@ static void vfio_ap_mdev_reset_queue(str } } -static int vfio_ap_mdev_reset_queues (struct ap_queue_table *qtable) +static int vfio_ap_mdev_reset_queues (struct ap_matrix_mdev *matrix_mdev) {int ret =0 , loop_cursor;struct vfio_ap_queue *q; -hash_for_each (qtable->queues, loop_cursor, q, mdev_qnode) +hash_for_each (matrix_mdev->qtable.queues, loop_cursor, q, mdev_qnode)vfio_ap_mdev_reset_queue (q); -hash_for_each (qtable->queues, loop_cursor, q, mdev_qnode) { +hash_for_each (matrix_mdev->qtable.queues, loop_cursor, q, mdev_qnode) { +flush_work (&q->reset_work); + +if (q->reset_status.response_code) + ret = -EIO ; + } + +return ret; +} + +static int vfio_ap_mdev_reset_qlist (struct list_head *qlist) +{ +int ret =0 ; +struct vfio_ap_queue *q; + +list_for_each_entry (q, qlist, reset_qnode) +vfio_ap_mdev_reset_queue (q); + +list_for_each_entry (q, qlist, reset_qnode) {flush_work (&q->reset_work);if (q->reset_status.response_code)
@@ -1931,7 +2006,7 @@ static ssize_t vfio_ap_mdev_ioctl(struct ret =vfio_ap_mdev_get_device_info (arg);break ;case VFIO_DEVICE_RESET : - ret =vfio_ap_mdev_reset_queues (&matrix_mdev->qtable); + ret =vfio_ap_mdev_reset_queues (matrix_mdev);break ;case VFIO_DEVICE_GET_IRQ_INFO : ret =vfio_ap_get_irq_info (arg);
@@ -2063,6 +2138,7 @@ int vfio_ap_mdev_probe_queue(struct ap_d {int ret;struct vfio_ap_queue *q; +DECLARE_BITMAP (apm_filtered,AP_DEVICES );struct ap_matrix_mdev *matrix_mdev; ret =sysfs_create_group (&apdev->device.kobj, &vfio_queue_attr_group);
@@ -2095,15 +2171,17 @@ int vfio_ap_mdev_probe_queue(struct ap_d !bitmap_empty(matrix_mdev->aqm_add, AP_DOMAINS)) goto done; -if (vfio_ap_mdev_filter_matrix (matrix_mdev)) +if (vfio_ap_mdev_filter_matrix (matrix_mdev, apm_filtered)) {vfio_ap_mdev_update_guest_apcb (matrix_mdev); +reset_queues_for_apids (matrix_mdev, apm_filtered); + } } done:dev_set_drvdata (&apdev->device, q);release_update_locks_for_mdev (matrix_mdev); -return 0 ; +return ret; err_remove_group:sysfs_remove_group (&apdev->device.kobj, &vfio_queue_attr_group);
@@ -2447,6 +2525,7 @@ void vfio_ap_on_cfg_changed(struct ap_costatic void vfio_ap_mdev_hot_plug_cfg (struct ap_matrix_mdev *matrix_mdev) { +DECLARE_BITMAP (apm_filtered,AP_DEVICES );bool filter_domains, filter_adapters, filter_cdoms, do_hotplug = false;mutex_lock (&matrix_mdev->kvm->lock);
@@ -2460,7 +2539,7 @@ static void vfio_ap_mdev_hot_plug_cfg(st matrix_mdev->adm_add, AP_DOMAINS);if (filter_adapters || filter_domains) - do_hotplug =vfio_ap_mdev_filter_matrix (matrix_mdev); + do_hotplug =vfio_ap_mdev_filter_matrix (matrix_mdev, apm_filtered);if (filter_cdoms) do_hotplug |=vfio_ap_mdev_filter_cdoms (matrix_mdev);
@@ -2468,6 +2547,8 @@ static void vfio_ap_mdev_hot_plug_cfg(stif (do_hotplug)vfio_ap_mdev_update_guest_apcb (matrix_mdev); +reset_queues_for_apids (matrix_mdev, apm_filtered); +mutex_unlock (&matrix_dev->mdevs_lock);mutex_unlock (&matrix_mdev->kvm->lock); }
drivers/s390/crypto/vfio_ap_private.h +3 -0
@@ -133,6 +133,8 @@ struct ap_matrix_mdev {* @apqn: the APQN of the AP queue device * @saved_isc: the guest ISC registered with the GIB interface * @mdev_qnode: allows the vfio_ap_queue struct to be added to a hashtable +* @reset_qnode: allows the vfio_ap_queue struct to be added to a list of queues +* that need to be reset * @reset_status: the status from the last reset of the queue * @reset_work: work to wait for queue reset to complete */
@@ -143,6 +145,7 @@ struct vfio_ap_queue {#define VFIO_AP_ISC_INVALID 0xffunsigned char saved_isc;struct hlist_node mdev_qnode; +struct list_head reset_qnode;struct ap_queue_status reset_status;struct work_struct reset_work; };
Greg Kroah-Hartman
maintainerPATCH 63/331 s390/vfio-ap: reset queues associated with adapter for queue unbound from driver
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Krowiak <[email protected]>
commit f009cfa466558b7dfe97f167ba1875d6f9ea4c07 upstream.
When a queue is unbound from the vfio_ap device driver, if that queue is assigned to a guest's AP configuration, its associated adapter is removed because queues are defined to a guest via a matrix of adapters and domains; so, it is not possible to remove a single queue.
If an adapter is removed from the guest's AP configuration, all associated queues must be reset to prevent leaking crypto data should any of them be assigned to a different guest or device driver. The one caveat is that if the queue is being removed because the adapter or domain has been removed from the host's AP configuration, then an attempt to reset the queue will fail with response code 01, AP-queue number not valid; so resetting these queues should be skipped.
--- drivers/s390/crypto/vfio_ap_ops.c | 76 ++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 35 deletions(-)
drivers/s390/crypto/vfio_ap_ops.c +41 -35
@@ -936,45 +936,45 @@ static void vfio_ap_mdev_link_adapter(st AP_MKQID(apid, apqi)); } +static void collect_queues_to_reset (struct ap_matrix_mdev *matrix_mdev, +unsigned long apid, +struct list_head *qlist) +{ +struct vfio_ap_queue *q; +unsigned long apqi; + +for_each_set_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm,AP_DOMAINS ) { + q =vfio_ap_mdev_get_queue (matrix_mdev,AP_MKQID (apid, apqi)); +if (q) +list_add_tail (&q->reset_qnode, qlist); + } +} + +static void reset_queues_for_apid (struct ap_matrix_mdev *matrix_mdev, +unsigned long apid) +{ +struct list_head qlist; + +INIT_LIST_HEAD (&qlist); +collect_queues_to_reset (matrix_mdev, apid, &qlist); +vfio_ap_mdev_reset_qlist (&qlist); +} +static int reset_queues_for_apids (struct ap_matrix_mdev *matrix_mdev,unsigned long *apm_reset) { -struct vfio_ap_queue *q, *tmpq;struct list_head qlist; -unsigned long apid, apqi; -int apqn, ret =0 ; +unsigned long apid;if (bitmap_empty (apm_reset,AP_DEVICES ))return 0 ;INIT_LIST_HEAD (&qlist); -for_each_set_bit_inv (apid, apm_reset,AP_DEVICES ) { -for_each_set_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm, -AP_DOMAINS ) { -/* -* If the domain is not in the host's AP configuration, -* then resetting it will fail with response code 01 -* (APQN not valid). -*/ -if (!test_bit_inv (apqi, - (unsigned long *)matrix_dev->info.aqm)) -continue ; - - apqn =AP_MKQID (apid, apqi); - q =vfio_ap_mdev_get_queue (matrix_mdev, apqn); +for_each_set_bit_inv (apid, apm_reset,AP_DEVICES ) +collect_queues_to_reset (matrix_mdev, apid, &qlist); -if (q) -list_add_tail (&q->reset_qnode, &qlist); - } - } - - ret =vfio_ap_mdev_reset_qlist (&qlist); - -list_for_each_entry_safe (q, tmpq, &qlist, reset_qnode) -list_del (&q->reset_qnode); - -return ret; +return vfio_ap_mdev_reset_qlist (&qlist); }/**
@@ -2200,24 +2200,30 @@ void vfio_ap_mdev_remove_queue(struct ap matrix_mdev = q->matrix_mdev;if (matrix_mdev) { -vfio_ap_unlink_queue_fr_mdev (q); - apid =AP_QID_CARD (q->apqn); apqi =AP_QID_QUEUE (q->apqn); - -/* -* If the queue is assigned to the guest's APCB, then remove -* the adapter's APID from the APCB and hot it into the guest. -*/ +/* If the queue is assigned to the guest's AP configuration */ if (test_bit_inv (apid, matrix_mdev->shadow_apcb.apm) &&test_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm)) { +/* +* Since the queues are defined via a matrix of adapters +* and domains, it is not possible to hot unplug a +* single queue; so, let's unplug the adapter. +*/ clear_bit_inv (apid, matrix_mdev->shadow_apcb.apm);vfio_ap_mdev_update_guest_apcb (matrix_mdev); +reset_queues_for_apid (matrix_mdev, apid); + goto done; } }vfio_ap_mdev_reset_queue (q);flush_work (&q->reset_work); + +done: +if (matrix_mdev) +vfio_ap_unlink_queue_fr_mdev (q); +dev_set_drvdata (&apdev->device,NULL );kfree (q);release_update_locks_for_mdev (matrix_mdev);
Greg Kroah-Hartman
maintainerPATCH 64/331 s390/vfio-ap: do not reset queue removed from host config
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Krowiak <[email protected]>
commit b9bd10c43456d16abd97b717446f51afb3b88411 upstream.
When a queue is unbound from the vfio_ap device driver, it is reset to ensure its crypto data is not leaked when it is bound to another device driver. If the queue is unbound due to the fact that the adapter or domain was removed from the host's AP configuration, then attempting to reset it will fail with response code 01 (APID not valid) getting returned from the reset command. Let's ensure that the queue is assigned to the host's configuration before resetting it.
--- drivers/s390/crypto/vfio_ap_ops.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/s390/crypto/vfio_ap_ops.c +12 -4
@@ -2198,10 +2198,10 @@ void vfio_ap_mdev_remove_queue(struct ap q =dev_get_drvdata (&apdev->device);get_update_locks_for_queue (q); matrix_mdev = q->matrix_mdev; + apid =AP_QID_CARD (q->apqn); + apqi =AP_QID_QUEUE (q->apqn);if (matrix_mdev) { - apid =AP_QID_CARD (q->apqn); - apqi =AP_QID_QUEUE (q->apqn);/* If the queue is assigned to the guest's AP configuration */ if (test_bit_inv (apid, matrix_mdev->shadow_apcb.apm) &&test_bit_inv (apqi, matrix_mdev->shadow_apcb.aqm)) {
@@ -2217,8 +2217,16 @@ void vfio_ap_mdev_remove_queue(struct ap } } -vfio_ap_mdev_reset_queue (q); -flush_work (&q->reset_work); +/* +* If the queue is not in the host's AP configuration, then resetting +* it will fail with response code 01, (APQN not valid); so, let's make +* sure it is in the host's config. +*/ +if (test_bit_inv (apid, (unsigned long *)matrix_dev->info.apm) && +test_bit_inv (apqi, (unsigned long *)matrix_dev->info.aqm)) { +vfio_ap_mdev_reset_queue (q); +flush_work (&q->reset_work); + } done:if (matrix_mdev)
Greg Kroah-Hartman
maintainerPATCH 65/331 nbd: always initialize struct msghdr completely
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 78fbb92af27d0982634116c7a31065f24d092826 upstream.
syzbot complains that msg->msg_get_inq value can be uninitialized [1]
struct msghdr got many new fields recently, we should always make sure their values is zero by default.
[1]
BUG: KMSAN: uninit-value in tcp_recvmsg+0x686/0xac0 net/ipv4/tcp.c:2571 tcp_recvmsg+0x686/0xac0 net/ipv4/tcp.c:2571 inet_recvmsg+0x131/0x580 net/ipv4/af_inet.c:879 sock_recvmsg_nosec net/socket.c:1044 [inline] sock_recvmsg+0x12b/0x1e0 net/socket.c:1066 __sock_xmit+0x236/0x5c0 drivers/block/nbd.c:538 nbd_read_reply drivers/block/nbd.c:732 [inline] recv_work+0x262/0x3100 drivers/block/nbd.c:863 process_one_work kernel/workqueue.c:2627 [inline] process_scheduled_works+0x104e/0x1e70 kernel/workqueue.c:2700 worker_thread+0xf45/0x1490 kernel/workqueue.c:2781 kthread+0x3ed/0x540 kernel/kthread.c:388 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Local variable msg created at:
__sock_xmit+0x4c/0x5c0 drivers/block/nbd.c:513 nbd_read_reply drivers/block/nbd.c:732 [inline] recv_work+0x262/0x3100 drivers/block/nbd.c:863 CPU: 1 PID: 7465 Comm: kworker/u5:1 Not tainted 6.7.0-rc7-syzkaller-00041-gf016f7547aee #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Workqueue: nbd5-recv recv_work
--- drivers/block/nbd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/block/nbd.c +1 -5
@@ -510,7 +510,7 @@ static int __sock_xmit(struct nbd_device struct iov_iter *iter, int msg_flags, int *sent) { int result; -struct msghdr msg; +struct msghdr msg = {} ;unsigned int noreclaim_flag;if (unlikely (!sock)) {
@@ -526,10 +526,6 @@ static int __sock_xmit(struct nbd_device do { sock->sk->sk_allocation = GFP_NOIO | __GFP_MEMALLOC; sock->sk->sk_use_task_frag = false; - msg.msg_name = NULL; - msg.msg_namelen = 0; - msg.msg_control = NULL; - msg.msg_controllen = 0; msg.msg_flags = msg_flags | MSG_NOSIGNAL; if (send)
Greg Kroah-Hartman
maintainerPATCH 66/331 mips: Fix max_mapnr being uninitialized on early stages
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Serge Semin <[email protected]>
commit e1a9ae45736989c972a8d1c151bc390678ae6205 upstream.
max_mapnr variable is utilized in the pfn_valid() method in order to determine the upper PFN space boundary. Having it uninitialized effectively makes any PFN passed to that method invalid. That in its turn causes the kernel mm-subsystem occasion malfunctions even after the max_mapnr variable is actually properly updated. For instance, pfn_valid() is called in the init_unavailable_range() method in the framework of the calls-chain on MIPS:setup_arch()
+-> paging_init()
+-> free_area_init()
+-> memmap_init()
+-> memmap_init_zone_range()
+-> init_unavailable_range()Since pfn_valid() always returns "false" value before max_mapnr is initialized in the mem_init() method, any flatmem page-holes will be left in the poisoned/uninitialized state including the IO-memory pages. Thus any further attempts to map/remap the IO-memory by using MMU may fail. In particular it happened in my case on attempt to map the SRAM region. The kernel bootup procedure just crashed on the unhandled unaligned access bug raised in the __update_cache() method:
Quoted 11 lines
Unhandled kernel unaligned access[#1]:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc1-XXX-dirty #2056 ... Call Trace: [<8011ef9c>] __update_cache+0x88/0x1bc [<80385944>] ioremap_page_range+0x110/0x2a4 [<80126948>] ioremap_prot+0x17c/0x1f4 [<80711b80>] __devm_ioremap+0x8c/0x120 [<80711e0c>] __devm_ioremap_resource+0xf4/0x218 [<808bf244>] sram_probe+0x4f4/0x930 [<80889d20>] platform_probe+0x68/0xec
Quoted 1 line
...
Let's fix the problem by initializing the max_mapnr variable as soon as the required data is available. In particular it can be done right in the paging_init() method before free_area_init() is called since all the PFN zone boundaries have already been calculated by that time.
--- arch/mips/mm/init.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
arch/mips/mm/init.c +5 -7
@@ -422,7 +422,12 @@ void __init paging_init(void) (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10)); max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn; } + + max_mapnr = highend_pfn ? highend_pfn : max_low_pfn; +#else + max_mapnr = max_low_pfn;#endif + high_memory = (void *)__va (max_low_pfn <<PAGE_SHIFT );free_area_init (max_zone_pfns); }
@@ -458,13 +463,6 @@ void __init mem_init(void)*/ BUILD_BUG_ON (IS_ENABLED (CONFIG_32BIT ) && (PFN_PTE_SHIFT >PAGE_SHIFT )); -#ifdef CONFIG_HIGHMEM - max_mapnr = highend_pfn ? highend_pfn : max_low_pfn; -#else - max_mapnr = max_low_pfn; -#endif - high_memory = (void *)__va (max_low_pfn <<PAGE_SHIFT ); -maar_init ();memblock_free_all ();setup_zero_pages ();/* Setup zeroed pages. */
Greg Kroah-Hartman
maintainerPATCH 67/331 bus: mhi: host: Add alignment check for event ring read pointer
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krishna chaitanya chundru <[email protected]>
commit eff9704f5332a13b08fbdbe0f84059c9e7051d5f upstream.
Though we do check the event ring read pointer by "is_valid_ring_ptr" to make sure it is in the buffer range, but there is another risk the pointer may be not aligned. Since we are expecting event ring elements are 128 bits(struct mhi_ring_element) aligned, an unaligned read pointer could lead to multiple issues like DoS or ring buffer memory corruption.
So add a alignment check for event ring read pointer.
--- drivers/bus/mhi/host/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bus/mhi/host/main.c +2 -1
@@ -268,7 +268,8 @@ static void mhi_del_ring_element(structstatic bool is_valid_ring_ptr (struct mhi_ring *ring,dma_addr_t addr) { -return addr >= ring->iommu_base && addr < ring->iommu_base + ring->len; +return addr >= ring->iommu_base && addr < ring->iommu_base + ring->len && + !(addr & (sizeof (struct mhi_ring_element ) -1 )); }int mhi_destroy_device (struct device *dev,void *data)
Greg Kroah-Hartman
maintainerPATCH 68/331 bus: mhi: host: Drop chan lock before queuing buffers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qiang Yu <[email protected]>
commit 01bd694ac2f682fb8017e16148b928482bc8fa4b upstream.
Ensure read and write locks for the channel are not taken in succession by dropping the read lock from parse_xfer_event() such that a callback given to client can potentially queue buffers and acquire the write lock in that process. Any queueing of buffers should be done without channel read lock acquired as it can result in multiple locks and a soft lockup.
--- drivers/bus/mhi/host/main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/bus/mhi/host/main.c +4 -0
@@ -643,6 +643,8 @@ static int parse_xfer_event(struct mhi_cmhi_del_ring_element (mhi_cntrl, tre_ring); local_rp = tre_ring->rp; +read_unlock_bh (&mhi_chan->lock); +/* notify client */ mhi_chan->xfer_cb (mhi_chan->mhi_dev, &result);
@@ -668,6 +670,8 @@ static int parse_xfer_event(struct mhi_ckfree (buf_info->cb_buf); } } + +read_lock_bh (&mhi_chan->lock); }break ; }/* CC_EOT */
Greg Kroah-Hartman
maintainerPATCH 69/331 bus: mhi: host: Add spinlock to protect WP access when queueing TREs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bhaumik Bhatt <[email protected]>
commit b89b6a863dd53bc70d8e52d50f9cfaef8ef5e9c9 upstream.
Protect WP accesses such that multiple threads queueing buffers for incoming data do not race.
Meanwhile, if CONFIG_TRACE_IRQFLAGS is enabled, irq will be enabled once __local_bh_enable_ip is called as part of write_unlock_bh. Hence, let's take irqsave lock after TRE is generated to avoid running write_unlock_bh when irqsave lock is held.
--- drivers/bus/mhi/host/main.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/bus/mhi/host/main.c +13 -9
@@ -1127,17 +1127,15 @@ static int mhi_queue(struct mhi_device *if (unlikely (MHI_PM_IN_ERROR_STATE (mhi_cntrl->pm_state)))return -EIO ; -read_lock_irqsave (&mhi_cntrl->pm_lock, flags); - ret =mhi_is_ring_full (mhi_cntrl, tre_ring); -if (unlikely (ret)) { - ret = -EAGAIN ; - goto exit_unlock; - } +if (unlikely (ret)) +return -EAGAIN ; ret =mhi_gen_tre (mhi_cntrl, mhi_chan, buf_info, mflags);if (unlikely (ret)) - goto exit_unlock; +return ret; + +read_lock_irqsave (&mhi_cntrl->pm_lock, flags);/* Packet is queued, take a usage ref to exit M3 if necessary * for host->device buffer, balanced put is done on buffer completion
@@ -1157,7 +1155,6 @@ static int mhi_queue(struct mhi_device *if (dir ==DMA_FROM_DEVICE ) mhi_cntrl->runtime_put (mhi_cntrl); -exit_unlock:read_unlock_irqrestore (&mhi_cntrl->pm_lock, flags);return ret;
@@ -1209,6 +1206,9 @@ int mhi_gen_tre(struct mhi_controller *mint eot, eob, chain, bei;int ret; +/* Protect accesses for reading and incrementing WP */ +write_lock_bh (&mhi_chan->lock); + buf_ring = &mhi_chan->buf_ring; tre_ring = &mhi_chan->tre_ring;
@@ -1226,8 +1226,10 @@ int mhi_gen_tre(struct mhi_controller *mif (!info->pre_mapped) { ret = mhi_cntrl->map_single (mhi_cntrl, buf_info); -if (ret) +if (ret) { +write_unlock_bh (&mhi_chan->lock);return ret; + } } eob = !!(flags &MHI_EOB );
@@ -1244,6 +1246,8 @@ int mhi_gen_tre(struct mhi_controller *mmhi_add_ring_element (mhi_cntrl, tre_ring);mhi_add_ring_element (mhi_cntrl, buf_ring); +write_unlock_bh (&mhi_chan->lock); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 70/331 parisc/firmware: Fix F-extend for PDC addresses
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 735ae74f73e55c191d48689bd11ff4a06ea0508f upstream.
When running with narrow firmware (64-bit kernel using a 32-bit firmware), extend PDC addresses into the 0xfffffff0.00000000 region instead of the 0xf0f0f0f0.00000000 region.
This fixes the power button on the C3700 machine in qemu (64-bit CPU with 32-bit firmware), and my assumption is that the previous code was really never used (because most 64-bit machines have a 64-bit firmware), or it just worked on very old machines because they may only decode 40-bit of virtual addresses.
--- arch/parisc/kernel/firmware.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/parisc/kernel/firmware.c +2 -2
@@ -123,10 +123,10 @@ static unsigned long f_extend(unsigned l#ifdef CONFIG_64BIT if (unlikely (parisc_narrow_firmware)) {if ((address &0xff000000 ) ==0xf0000000 ) -return 0xf0f0f0f000000000UL | (u32 )address; +return (0xfffffff0UL <<32 ) | (u32 )address;if ((address &0xf0000000 ) ==0xf0000000 ) -return 0xffffffff00000000UL | (u32 )address; +return (0xffffffffUL <<32 ) | (u32 )address; }#endif return address;
Greg Kroah-Hartman
maintainerPATCH 71/331 parisc/power: Fix power soft-off button emulation on qemu
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 6472036581f947109b20664121db1d143e916f0b upstream.
Make sure to start the kthread to check the power button on qemu as well if the power button address was provided.
This fixes the qemu built-in system_powerdown runtime command.
--- drivers/parisc/power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/power.c +1 -1
@@ -238,7 +238,7 @@ static int __init power_init(void)if (running_on_qemu && soft_power_reg)register_sys_off_handler (SYS_OFF_MODE_POWER_OFF ,SYS_OFF_PRIO_DEFAULT , qemu_power_off, (void *)soft_power_reg); -else +if (!running_on_qemu || soft_power_reg) power_task =kthread_run (kpowerswd, (void *)soft_power_reg,KTHREAD_NAME );if (IS_ERR (power_task)) {
Greg Kroah-Hartman
maintainerPATCH 72/331 ARM: dts: imx6q-apalis: add can power-up delay on ixora board
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrejs Cainikovs <[email protected]>
commit b76bbf835d8945080b22b52fc1e6f41cde06865d upstream.
Newer variants of Ixora boards require a power-up delay when powering up the CAN transceiver of up to 1ms.
--- arch/arm/boot/dts/nxp/imx/imx6q-apalis-ixora-v1.2.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/nxp/imx/imx6q-apalis-ixora-v1.2.dts +2 -0
@@ -76,6 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enable_can1_power>; regulator-name = "can1_supply"; + startup-delay-us = <1000>; }; reg_can2_supply: regulator-can2-supply {
@@ -85,6 +86,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enable_can2_power>; regulator-name = "can2_supply"; + startup-delay-us = <1000>; }; };
Greg Kroah-Hartman
maintainerPATCH 73/331 arm64: dts: qcom: sc8280xp-crd: fix eDP phy compatible
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 663affdb12b3e26c77d103327cf27de720c8117e upstream.
The sc8280xp Display Port PHYs can be used in either DP or eDP mode and this is configured using the devicetree compatible string which defaults to DP mode in the SoC dtsi.
Override the default compatible string for the CRD eDP PHY node so that the eDP settings are used.
--- arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +2 -0
@@ -458,6 +458,8 @@ mdss0_dp3_out: endpoint { }; &mdss0_dp3_phy { + compatible = "qcom,sc8280xp-edp-phy"; + vdda-phy-supply = <&vreg_l6b>; vdda-pll-supply = <&vreg_l3b>;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 74/331 ARM: dts: qcom: sdx55: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit d0ec3c4c11c3b30e1f2d344973b2a7bf0f986734 upstream.
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi +2 -2
@@ -594,8 +594,8 @@ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 158 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 157 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 75/331 ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Cercueil <[email protected]>
commit 84228d5e29dbc7a6be51e221000e1d122125826c upstream.
The kernel hangs for a good 12 seconds without any info being printed to dmesg, very early in the boot process, if this regulator is not enabled.
Force-enable it to work around this issue, until we know more about the underlying problem.
--- arch/arm/boot/dts/samsung/exynos4210-i9100.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/samsung/exynos4210-i9100.dts +8 -0
@@ -527,6 +527,14 @@ regulator-name = "VT_CAM_1.8V"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + + /* + * Force-enable this regulator; otherwise the + * kernel hangs very early in the boot process + * for about 12 seconds, without apparent + * reason. + */ + regulator-always-on; }; vcclcd_reg: LDO13 {
Greg Kroah-Hartman
maintainerPATCH 76/331 ARM: dts: qcom: sdx55: fix pdc #interrupt-cells
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit cc25bd06c16aa582596a058d375b2e3133f79b93 upstream.
The Qualcomm PDC interrupt controller binding expects two cells in interrupt specifiers.
--- arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi +1 -1
@@ -619,7 +619,7 @@ compatible = "qcom,sdx55-pdc", "qcom,pdc"; reg = <0x0b210000 0x30000>; qcom,pdc-ranges = <0 179 52>; - #interrupt-cells = <3>; + #interrupt-cells = <2>; interrupt-parent = <&intc>; interrupt-controller; };
Greg Kroah-Hartman
maintainerPATCH 77/331 arm64: dts: sprd: fix the cpu node for UMS512
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cixi Geng <[email protected]>
commit 2da4f4a7b003441b80f0f12d8a216590f652a40f upstream.
The UMS512 Socs have 8 cores contains 6 a55 and 2 a75. modify the cpu nodes to correct information.
--- arch/arm64/boot/dts/sprd/ums512.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/sprd/ums512.dtsi +2 -2
@@ -96,7 +96,7 @@ CPU5: cpu@500 { CPU6: cpu@600 { device_type = "cpu"; - compatible = "arm,cortex-a55"; + compatible = "arm,cortex-a75"; reg = <0x0 0x600>; enable-method = "psci"; cpu-idle-states = <&CORE_PD>;
@@ -104,7 +104,7 @@ CPU6: cpu@600 { CPU7: cpu@700 { device_type = "cpu"; - compatible = "arm,cortex-a55"; + compatible = "arm,cortex-a75"; reg = <0x0 0x700>; enable-method = "psci"; cpu-idle-states = <&CORE_PD>;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 78/331 arm64: dts: rockchip: configure eth pad driver strength for orangepi r1 plus lts
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianling Shen <[email protected]>
commit fc5a80a432607d05e85bba37971712405f75c546 upstream.
The default strength is not enough to provide stable connection under 3.3v LDO voltage.
--- arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +3 -1
@@ -26,9 +26,11 @@ yt8531c: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c22"; reg = <0>; + motorcomm,auto-sleep-disabled; motorcomm,clk-out-frequency-hz = <125000000>; motorcomm,keep-pll-enabled; - motorcomm,auto-sleep-disabled; + motorcomm,rx-clk-drv-microamp = <5020>; + motorcomm,rx-data-drv-microamp = <5020>; pinctrl-0 = <ð_phy_reset_pin>; pinctrl-names = "default";
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 79/331 arm64: dts: rockchip: Fix rk3588 USB power-domain clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sam Edwards <[email protected]>
commit 44de8996ed5a10f08f2fe947182da6535edcfae5 upstream.
The QoS blocks saved/restored when toggling the PD_USB power domain are clocked by ACLK_USB. Attempting to access these memory regions without that clock running will result in an indefinite CPU stall.
The PD_USB node wasn't specifying this clock dependency, resulting in hangs when trying to toggle the power domain (either on or off), unless we get "lucky" and have ACLK_USB running for another reason at the time. This "luck" can result from the bootloader leaving USB powered/clocked, and if no built-in driver wants USB, Linux will disable the unused PD+CLK on boot when {pd,clk}_ignore_unused aren't given. This can also be unlucky because the two cleanup tasks run in parallel and race: if the CLK is disabled first, the PD deactivation stalls the boot. In any case, the PD cannot then be reenabled (if e.g. the driver loads later) once the clock has been stopped.
Fix this by specifying a dependency on ACLK_USB, instead of only ACLK_USB_ROOT. The child-parent relationship means the former implies the latter anyway.
--- arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/rockchip/rk3588s.dtsi +1 -0
@@ -890,6 +890,7 @@ reg = <RK3588_PD_USB>; clocks = <&cru PCLK_PHP_ROOT>, <&cru ACLK_USB_ROOT>, + <&cru ACLK_USB>, <&cru HCLK_USB_ROOT>, <&cru HCLK_HOST0>, <&cru HCLK_HOST_ARB0>,
Greg Kroah-Hartman
maintainerPATCH 80/331 arm64: dts: qcom: msm8916: Make blsp_dma controlled-remotely
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
commit 7c45b6ddbcff01f9934d11802010cfeb0879e693 upstream.
The blsp_dma controller is shared between the different subsystems, which is why it is already initialized by the firmware. We should not reinitialize it from Linux to avoid potential other users of the DMA engine to misbehave.
In mainline this can be described using the "qcom,controlled-remotely" property. In the downstream/vendor kernel from Qualcomm there is an opposite "qcom,managed-locally" property. This property is *not* set for the qcom,sps-dma@7884000 [1] so adding "qcom,controlled-remotely" upstream matches the behavior of the downstream/vendor kernel.
Adding this seems to fix some weird issues with UART where both input/output becomes garbled with certain obscure firmware versions on some devices.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/msm8916.dtsi +1 -0
@@ -2085,6 +2085,7 @@ clock-names = "bam_clk"; #dma-cells = <1>; qcom,ee = <0>; + qcom,controlled-remotely; }; blsp_uart1: serial@78af000 {
Greg Kroah-Hartman
maintainerPATCH 81/331 arm64: dts: qcom: msm8939: Make blsp_dma controlled-remotely
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
commit 4bbda9421f316efdaef5dbf642e24925ef7de130 upstream.
The blsp_dma controller is shared between the different subsystems, which is why it is already initialized by the firmware. We should not reinitialize it from Linux to avoid potential other users of the DMA engine to misbehave.
In mainline this can be described using the "qcom,controlled-remotely" property. In the downstream/vendor kernel from Qualcomm there is an opposite "qcom,managed-locally" property. This property is *not* set for the qcom,sps-dma@7884000 [1] so adding "qcom,controlled-remotely" upstream matches the behavior of the downstream/vendor kernel.
Adding this seems to fix some weird issues with UART where both input/output becomes garbled with certain obscure firmware versions on some devices.
--- arch/arm64/boot/dts/qcom/msm8939.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/msm8939.dtsi +1 -0
@@ -1661,6 +1661,7 @@ clock-names = "bam_clk"; #dma-cells = <1>; qcom,ee = <0>; + qcom,controlled-remotely; }; blsp_uart1: serial@78af000 {
Greg Kroah-Hartman
maintainerPATCH 82/331 arm64: dts: qcom: sc7180: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 9b956999bf725fd62613f719c3178fdbee6e5f47 upstream.
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -2
@@ -2978,8 +2978,8 @@ interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <&pdc 6 IRQ_TYPE_LEVEL_HIGH>, - <&pdc 8 IRQ_TYPE_LEVEL_HIGH>, - <&pdc 9 IRQ_TYPE_LEVEL_HIGH>; + <&pdc 8 IRQ_TYPE_EDGE_BOTH>, + <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 83/331 arm64: dts: qcom: sdm845: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 84ad9ac8d9ca29033d589e79a991866b38e23b85 upstream.
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +4 -4
@@ -4086,8 +4086,8 @@ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
@@ -4137,8 +4137,8 @@ interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 490 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 491 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 84/331 arm64: dts: qcom: sdm670: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit de3b3de30999106549da4df88a7963d0ac02b91e upstream.
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm64/boot/dts/qcom/sdm670.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +2 -2
@@ -1297,8 +1297,8 @@ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 85/331 arm64: dts: qcom: sm8150: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 54524b6987d1fffe64cbf3dded1b2fa6b903edf9 upstream.
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +4 -4
@@ -3594,8 +3594,8 @@ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
@@ -3647,8 +3647,8 @@ interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 490 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 491 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 86/331 arm64: dts: qcom: sc8180x: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 0dc0f6da3d43da8d2297105663e51ecb01b6f790 upstream.
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +4 -4
@@ -2562,8 +2562,8 @@ reg = <0 0x0a6f8800 0 0x400>; interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq",
@@ -2636,8 +2636,8 @@ power-domains = <&gcc USB30_SEC_GDSC>; interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 490 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 491 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 87/331 arm64: dts: qcom: sc7280: fix usb_1 wakeup interrupt types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit c34199d967a946e55381404fa949382691737521 upstream.
A recent cleanup reordering the usb_1 wakeup interrupts inadvertently switched the DP and SuperSpeed interrupt trigger types.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +2 -2
@@ -3668,9 +3668,9 @@ assigned-clock-rates = <19200000>, <200000000>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&pdc 14 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 14 IRQ_TYPE_EDGE_BOTH>, <&pdc 15 IRQ_TYPE_EDGE_BOTH>, - <&pdc 17 IRQ_TYPE_EDGE_BOTH>; + <&pdc 17 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "hs_phy_irq", "dp_hs_phy_irq", "dm_hs_phy_irq",
Greg Kroah-Hartman
maintainerPATCH 88/331 arm64: dts: qcom: Add missing vio-supply for AW2013
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
commit cc1ec484f2d0f464ad11b56fe3de2589c23f73ec upstream.
Add the missing vio-supply to all usages of the AW2013 LED controller to ensure that the regulator needed for pull-up of the interrupt and I2C lines is really turned on. While this seems to have worked fine so far some of these regulators are not guaranteed to be always-on. For example, pm8916_l6 is typically turned off together with the display if there aren't any other devices (e.g. sensors) keeping it always-on.
--- arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts | 1 + arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts | 1 + arch/arm64/boot/dts/qcom/msm8953-xiaomi-mido.dts | 1 + arch/arm64/boot/dts/qcom/msm8953-xiaomi-tissot.dts | 1 + arch/arm64/boot/dts/qcom/msm8953-xiaomi-vince.dts | 1 + 5 files changed, 5 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts +1 -0
@@ -88,6 +88,7 @@ #size-cells = <0>; vcc-supply = <&pm8916_l17>; + vio-supply = <&pm8916_l6>; led@0 { reg = <0>;
arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts +1 -0
@@ -118,6 +118,7 @@ #size-cells = <0>; vcc-supply = <&pm8916_l16>; + vio-supply = <&pm8916_l5>; led@0 { reg = <0>;
arch/arm64/boot/dts/qcom/msm8953-xiaomi-mido.dts +1 -0
@@ -111,6 +111,7 @@ reg = <0x45>; vcc-supply = <&pm8953_l10>; + vio-supply = <&pm8953_l5>; #address-cells = <1>; #size-cells = <0>;
arch/arm64/boot/dts/qcom/msm8953-xiaomi-tissot.dts +1 -0
@@ -104,6 +104,7 @@ reg = <0x45>; vcc-supply = <&pm8953_l10>; + vio-supply = <&pm8953_l5>; #address-cells = <1>; #size-cells = <0>;
arch/arm64/boot/dts/qcom/msm8953-xiaomi-vince.dts +1 -0
@@ -113,6 +113,7 @@ reg = <0x45>; vcc-supply = <&pm8953_l10>; + vio-supply = <&pm8953_l5>; #address-cells = <1>; #size-cells = <0>;
Greg Kroah-Hartman
maintainerPATCH 89/331 ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit de95f139394a5ed82270f005bc441d2e7c1e51b7 upstream.
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.
A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.
--- arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi +4 -4
@@ -592,10 +592,10 @@ <&gcc GCC_USB30_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 158 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 157 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 11 IRQ_TYPE_EDGE_BOTH>, + <&pdc 10 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 90/331 arm64: dts: qcom: sdm845: fix USB DP/DM HS PHY interrupts
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 204f9ed4bad6293933179517624143b8f412347c upstream.
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.
A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +8 -8
@@ -4084,10 +4084,10 @@ <&gcc GCC_USB30_PRIM_MASTER_CLK>; assigned-clock-rates = <19200000>, <150000000>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc_intc 8 IRQ_TYPE_EDGE_BOTH>, + <&pdc_intc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
@@ -4135,10 +4135,10 @@ <&gcc GCC_USB30_SEC_MASTER_CLK>; assigned-clock-rates = <19200000>, <150000000>; - interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, + <&pdc_intc 10 IRQ_TYPE_EDGE_BOTH>, + <&pdc_intc 11 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 91/331 arm64: dts: qcom: sdm845: fix USB SS wakeup
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 971f5d8b0618d09db75184ddd8cca0767514db5d upstream.
The USB SS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +2 -2
@@ -4085,7 +4085,7 @@ assigned-clock-rates = <19200000>, <150000000>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc_intc 6 IRQ_TYPE_LEVEL_HIGH>, <&pdc_intc 8 IRQ_TYPE_EDGE_BOTH>, <&pdc_intc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
@@ -4136,7 +4136,7 @@ assigned-clock-rates = <19200000>, <150000000>; interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, + <&pdc_intc 7 IRQ_TYPE_LEVEL_HIGH>, <&pdc_intc 10 IRQ_TYPE_EDGE_BOTH>, <&pdc_intc 11 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
Greg Kroah-Hartman
maintainerPATCH 92/331 arm64: dts: qcom: sm8150: fix USB DP/DM HS PHY interrupts
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 134de5e831775e8b178db9b131c1d3769a766982 upstream.
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.
A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +8 -8
@@ -3592,10 +3592,10 @@ <&gcc GCC_USB30_PRIM_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 8 IRQ_TYPE_EDGE_BOTH>, + <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
@@ -3645,10 +3645,10 @@ <&gcc GCC_USB30_SEC_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 10 IRQ_TYPE_EDGE_BOTH>, + <&pdc 11 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 93/331 arm64: dts: qcom: sm8150: fix USB SS wakeup
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit cc4e1da491b84ca05339a19893884cda78f74aef upstream.
The USB SS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +2 -2
@@ -3593,7 +3593,7 @@ assigned-clock-rates = <19200000>, <200000000>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 6 IRQ_TYPE_LEVEL_HIGH>, <&pdc 8 IRQ_TYPE_EDGE_BOTH>, <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
@@ -3646,7 +3646,7 @@ assigned-clock-rates = <19200000>, <200000000>; interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 7 IRQ_TYPE_LEVEL_HIGH>, <&pdc 10 IRQ_TYPE_EDGE_BOTH>, <&pdc 11 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
Greg Kroah-Hartman
maintainerPATCH 94/331 arm64: dts: qcom: sc8180x: fix USB DP/DM HS PHY interrupts
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 687d402bb350b392fa330e9d9d1b917777ee9ed1 upstream.
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.
A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +8 -8
@@ -2560,10 +2560,10 @@ usb_prim: usb@a6f8800 { compatible = "qcom,sc8180x-dwc3", "qcom,dwc3"; reg = <0 0x0a6f8800 0 0x400>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 8 IRQ_TYPE_EDGE_BOTH>, + <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq",
@@ -2634,10 +2634,10 @@ "xo"; resets = <&gcc GCC_USB30_SEC_BCR>; power-domains = <&gcc USB30_SEC_GDSC>; - interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 10 IRQ_TYPE_EDGE_BOTH>, + <&pdc 11 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 95/331 arm64: dts: qcom: sc8180x: fix USB SS wakeup
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 0afa885d42d05d30161ab8eab1ebacd993edb82b upstream.
The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.
--- arch/arm64/boot/dts/qcom/sc8180x.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8180x.dtsi +2 -2
@@ -2561,7 +2561,7 @@ compatible = "qcom,sc8180x-dwc3", "qcom,dwc3"; reg = <0 0x0a6f8800 0 0x400>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 6 IRQ_TYPE_LEVEL_HIGH>, <&pdc 8 IRQ_TYPE_EDGE_BOTH>, <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq",
@@ -2635,7 +2635,7 @@ resets = <&gcc GCC_USB30_SEC_BCR>; power-domains = <&gcc USB30_SEC_GDSC>; interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 7 IRQ_TYPE_LEVEL_HIGH>, <&pdc 10 IRQ_TYPE_EDGE_BOTH>, <&pdc 11 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
Greg Kroah-Hartman
maintainerPATCH 96/331 arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit c42d12ea105f67b0f137f1e52d5c59d13fe12b1f upstream.
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.
A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.
--- arch/arm64/boot/dts/qcom/sdm670.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +4 -4
@@ -1295,10 +1295,10 @@ <&gcc GCC_USB30_PRIM_MASTER_CLK>; assigned-clock-rates = <19200000>, <150000000>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 8 IRQ_TYPE_EDGE_BOTH>, + <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Greg Kroah-Hartman
maintainerPATCH 97/331 arm64: dts: qcom: sdm670: fix USB SS wakeup
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 047b2edc35b8db22354b4fba37818b548fc18896 upstream.
The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.
--- arch/arm64/boot/dts/qcom/sdm670.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm670.dtsi +1 -1
@@ -1296,7 +1296,7 @@ assigned-clock-rates = <19200000>, <150000000>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 6 IRQ_TYPE_LEVEL_HIGH>, <&pdc 8 IRQ_TYPE_EDGE_BOTH>, <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
Greg Kroah-Hartman
maintainerPATCH 98/331 ARM: dts: qcom: sdx55: fix USB SS wakeup
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 710dd03464e4ab5b3d329768388b165d61958577 upstream.
The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.
--- arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi +1 -1
@@ -593,7 +593,7 @@ assigned-clock-rates = <19200000>, <200000000>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 51 IRQ_TYPE_LEVEL_HIGH>, <&pdc 11 IRQ_TYPE_EDGE_BOTH>, <&pdc 10 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
Greg Kroah-Hartman
maintainerPATCH 99/331 lsm: new security_file_ioctl_compat() hook
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alfred Piccioni <[email protected]>
commit f1bb47a31dff6d4b34fb14e99850860ee74bb003 upstream.
Some ioctl commands do not require ioctl permission, but are routed to other permissions such as FILE_GETATTR or FILE_SETATTR. This routing is done by comparing the ioctl cmd to a set of 64-bit flags (FS_IOC_*).
However, if a 32-bit process is running on a 64-bit kernel, it emits 32-bit flags (FS_IOC32_*) for certain ioctl operations. These flags are being checked erroneously, which leads to these ioctl operations being routed to the ioctl permission, rather than the correct file permissions.
This was also noted in a RED-PEN finding from a while back - "/* RED-PEN how should LSM module know it's handling 32bit? */".
This patch introduces a new hook, security_file_ioctl_compat(), that is called from the compat ioctl syscall. All current LSMs have been changed to support this hook.
Reviewing the three places where we are currently using security_file_ioctl(), it appears that only SELinux needs a dedicated compat change; TOMOYO and SMACK appear to be functional without any change.
--- fs/ioctl.c | 3 +-- include/linux/lsm_hook_defs.h | 2 ++ include/linux/security.h | 9 +++++++++ security/security.c | 18 ++++++++++++++++++ security/selinux/hooks.c | 28 ++++++++++++++++++++++++++++ security/smack/smack_lsm.c | 1 + security/tomoyo/tomoyo.c | 1 + 7 files changed, 60 insertions(+), 2 deletions(-)
fs/ioctl.c +1 -2
@@ -920,8 +920,7 @@ COMPAT_SYSCALL_DEFINE3(ioctl, unsigned iif (!f.file)return -EBADF ; -/* RED-PEN how should LSM module know it's handling 32bit? */ - error =security_file_ioctl (f.file, cmd, arg); + error =security_file_ioctl_compat (f.file, cmd, arg);if (error) goto out;
include/linux/lsm_hook_defs.h +2 -0
@@ -171,6 +171,8 @@ LSM_HOOK(int, 0, file_alloc_security, st LSM_HOOK(void, LSM_RET_VOID, file_free_security, struct file *file) LSM_HOOK(int, 0, file_ioctl, struct file *file, unsigned int cmd, unsigned long arg) +LSM_HOOK(int, 0, file_ioctl_compat, struct file *file, unsigned int cmd, + unsigned long arg) LSM_HOOK(int, 0, mmap_addr, unsigned long addr) LSM_HOOK(int, 0, mmap_file, struct file *file, unsigned long reqprot, unsigned long prot, unsigned long flags)
include/linux/security.h +9 -0
@@ -389,6 +389,8 @@ int security_file_permission(struct fileint security_file_alloc (struct file *file);void security_file_free (struct file *file);int security_file_ioctl (struct file *file,unsigned int cmd,unsigned long arg); +int security_file_ioctl_compat (struct file *file,unsigned int cmd, +unsigned long arg);int security_mmap_file (struct file *file,unsigned long prot,unsigned long flags);int security_mmap_addr (unsigned long addr);
@@ -986,6 +988,13 @@ static inline int security_file_ioctl(st {return 0 ; } + +static inline int security_file_ioctl_compat (struct file *file, +unsigned int cmd, +unsigned long arg) +{ +return 0 ; +}static inline int security_mmap_file (struct file *file,unsigned long prot,unsigned long flags)
security/security.c +18 -0
@@ -2648,6 +2648,24 @@ int security_file_ioctl(struct file *fil }EXPORT_SYMBOL_GPL (security_file_ioctl); +/** +* security_file_ioctl_compat() - Check if an ioctl is allowed in compat mode +* @file: associated file +* @cmd: ioctl cmd +* @arg: ioctl arguments +* +* Compat version of security_file_ioctl() that correctly handles 32-bit +* processes running on 64-bit kernels. +* +* Return: Returns 0 if permission is granted. +*/ +int security_file_ioctl_compat (struct file *file,unsigned int cmd, +unsigned long arg) +{ +return call_int_hook (file_ioctl_compat,0 , file, cmd, arg); +} +EXPORT_SYMBOL_GPL (security_file_ioctl_compat); +static inline unsigned long mmap_prot (struct file *file,unsigned long prot) {/*
security/selinux/hooks.c +28 -0
@@ -3725,6 +3725,33 @@ static int selinux_file_ioctl(struct filreturn error; } +static int selinux_file_ioctl_compat (struct file *file,unsigned int cmd, +unsigned long arg) +{ +/* +* If we are in a 64-bit kernel running 32-bit userspace, we need to +* make sure we don't compare 32-bit flags to 64-bit flags. +*/ +switch (cmd) { +case FS_IOC32_GETFLAGS : + cmd =FS_IOC_GETFLAGS ; +break ; +case FS_IOC32_SETFLAGS : + cmd =FS_IOC_SETFLAGS ; +break ; +case FS_IOC32_GETVERSION : + cmd =FS_IOC_GETVERSION ; +break ; +case FS_IOC32_SETVERSION : + cmd =FS_IOC_SETVERSION ; +break ; +default : +break ; + } + +return selinux_file_ioctl (file, cmd, arg); +} +static int default_noexec__ro_after_init ;static int file_map_prot_check (struct file *file,unsigned long prot,int shared)
@@ -7037,6 +7064,7 @@ static struct security_hook_list selinuxLSM_HOOK_INIT (file_permission, selinux_file_permission),LSM_HOOK_INIT (file_alloc_security, selinux_file_alloc_security),LSM_HOOK_INIT (file_ioctl, selinux_file_ioctl), +LSM_HOOK_INIT (file_ioctl_compat, selinux_file_ioctl_compat),LSM_HOOK_INIT (mmap_file, selinux_mmap_file),LSM_HOOK_INIT (mmap_addr, selinux_mmap_addr), LSM_HOOK_INIT(file_mprotect, selinux_file_mprotect),
security/smack/smack_lsm.c +1 -0
@@ -4973,6 +4973,7 @@ static struct security_hook_list smack_hLSM_HOOK_INIT (file_alloc_security, smack_file_alloc_security),LSM_HOOK_INIT (file_ioctl, smack_file_ioctl), +LSM_HOOK_INIT (file_ioctl_compat, smack_file_ioctl),LSM_HOOK_INIT (file_lock, smack_file_lock),LSM_HOOK_INIT (file_fcntl, smack_file_fcntl), LSM_HOOK_INIT(mmap_file, smack_mmap_file),
security/tomoyo/tomoyo.c +1 -0
@@ -568,6 +568,7 @@ static struct security_hook_list tomoyo_LSM_HOOK_INIT (path_rename, tomoyo_path_rename),LSM_HOOK_INIT (inode_getattr, tomoyo_inode_getattr),LSM_HOOK_INIT (file_ioctl, tomoyo_file_ioctl), +LSM_HOOK_INIT (file_ioctl_compat, tomoyo_file_ioctl),LSM_HOOK_INIT (path_chmod, tomoyo_path_chmod),LSM_HOOK_INIT (path_chown, tomoyo_path_chown), LSM_HOOK_INIT(path_chroot, tomoyo_path_chroot),
Greg Kroah-Hartman
maintainerPATCH 100/331 dlm: use kernel_connect() and kernel_bind()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jordan Rife <[email protected]>
commit e9cdebbe23f1aa9a1caea169862f479ab3fa2773 upstream.
Recent changes to kernel_connect() and kernel_bind() ensure that callers are insulated from changes to the address parameter made by BPF SOCK_ADDR hooks. This patch wraps direct calls to ops->connect() and ops->bind() with kernel_connect() and kernel_bind() to protect callers in such cases.
--- fs/dlm/lowcomms.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
fs/dlm/lowcomms.c +7 -7
@@ -1805,8 +1805,8 @@ static int dlm_tcp_bind(struct socket *smemcpy (&src_addr, &dlm_local_addr[0 ],sizeof (src_addr));make_sockaddr (&src_addr,0 , &addr_len); - result = sock->ops->bind (sock, (struct sockaddr *)&src_addr, - addr_len); + result =kernel_bind (sock, (struct sockaddr *)&src_addr, + addr_len);if (result <0 ) {/* This *may* not indicate a critical error */ log_print ("could not bind for connect: %d" , result);
@@ -1818,7 +1818,7 @@ static int dlm_tcp_bind(struct socket *sstatic int dlm_tcp_connect (struct connection *con,struct socket *sock,struct sockaddr *addr,int addr_len) { -return sock->ops->connect (sock, addr, addr_len,O_NONBLOCK ); +return kernel_connect (sock, addr, addr_len,O_NONBLOCK ); }static int dlm_tcp_listen_validate (void )
@@ -1850,8 +1850,8 @@ static int dlm_tcp_listen_bind(struct so/* Bind to our port */ make_sockaddr (&dlm_local_addr[0 ], dlm_config.ci_tcp_port, &addr_len); -return sock->ops->bind (sock, (struct sockaddr *)&dlm_local_addr[0 ], - addr_len); +return kernel_bind (sock, (struct sockaddr *)&dlm_local_addr[0 ], + addr_len); }static const struct dlm_proto_ops dlm_tcp_ops = {
@@ -1876,12 +1876,12 @@ static int dlm_sctp_connect(struct conneint ret;/* -* Make sock->ops->connect() function return in specified time, +* Make kernel_connect() function return in specified time, * since O_NONBLOCK argument in connect() function does not work here, * then, we should restore the default value of this attribute. */ sock_set_sndtimeo (sock->sk,5 ); - ret = sock->ops->connect (sock, addr, addr_len,0 ); + ret =kernel_connect (sock, addr, addr_len,0 );sock_set_sndtimeo (sock->sk,0 );return ret; }
Greg Kroah-Hartman
maintainerPATCH 101/331 docs: kernel_abi.py: fix command injection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
commit 3231dd5862779c2e15633c96133a53205ad660ce upstream.
The kernel-abi directive passes its argument straight to the shell. This is unfortunate and unnecessary.
Let's always use paths relative to $srctree/Documentation/ and use subprocess.check_call() instead of subprocess.Popen(shell=True).
This also makes the code shorter.
--- Documentation/admin-guide/abi-obsolete.rst | 2 - Documentation/admin-guide/abi-removed.rst | 2 - Documentation/admin-guide/abi-stable.rst | 2 - Documentation/admin-guide/abi-testing.rst | 2 - Documentation/sphinx/kernel_abi.py | 56 +++++------------------------ 5 files changed, 14 insertions(+), 50 deletions(-)
Documentation/admin-guide/abi-obsolete.rst +1 -1
@@ -7,5 +7,5 @@ marked to be removed at some later point The description of the interface will document the reason why it is obsolete and when it can be expected to be removed. -.. kernel-abi:: $srctree/Documentation/ABI/obsolete +.. kernel-abi:: ABI/obsolete :rst:
Documentation/admin-guide/abi-removed.rst +1 -1
@@ -1,5 +1,5 @@ ABI removed symbols =================== -.. kernel-abi:: $srctree/Documentation/ABI/removed +.. kernel-abi:: ABI/removed :rst:
Documentation/admin-guide/abi-stable.rst +1 -1
@@ -10,5 +10,5 @@ for at least 2 years. Most interfaces (like syscalls) are expected to never change and always be available. -.. kernel-abi:: $srctree/Documentation/ABI/stable +.. kernel-abi:: ABI/stable :rst:
Documentation/admin-guide/abi-testing.rst +1 -1
@@ -16,5 +16,5 @@ Programs that use these interfaces are s name to the description of these interfaces, so that the kernel developers can easily notify them if any changes occur. -.. kernel-abi:: $srctree/Documentation/ABI/testing +.. kernel-abi:: ABI/testing :rst:
Documentation/sphinx/kernel_abi.py +10 -46
78 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 102/331 scripts/get_abi: fix source path leak
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vegard Nossum <[email protected]>
commit 5889d6ede53bc17252f79c142387e007224aa554 upstream.
The code currently leaks the absolute path of the ABI files into the rendered documentation.
There exists code to prevent this, but it is not effective when an absolute path is passed, which it is when $srctree is used.
I consider this to be a minimal, stop-gap fix; a better fix would strip off the actual prefix instead of hacking it off with a regex.
--- scripts/get_abi.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get_abi.pl +1 -1
@@ -98,7 +98,7 @@ sub parse_abi { $name =~ s,.*/,,; my $fn = $file; - $fn =~ s,Documentation/ABI/,,; + $fn =~ s,.*Documentation/ABI/,,; my $nametag = "File $fn"; $data{$nametag}->{what} = "File $name";
Greg Kroah-Hartman
maintainerPATCH 103/331 media: videobuf2-dma-sg: fix vmap callback
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Grzeschik <[email protected]>
commit 608ca5a60ee47b48fec210aeb7a795a64eb5dcee upstream.
For dmabuf import users to be able to use the vaddr from another videobuf2-dma-sg source, the exporter needs to set a proper vaddr on vb2_dma_sg_dmabuf_ops_vmap callback. This patch adds vmap on map if buf->vaddr was not set.
--- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/media/common/videobuf2/videobuf2-dma-sg.c +8 -2
@@ -487,9 +487,15 @@ vb2_dma_sg_dmabuf_ops_end_cpu_access(strstatic int vb2_dma_sg_dmabuf_ops_vmap (struct dma_buf *dbuf,struct iosys_map *map) { -struct vb2_dma_sg_buf *buf = dbuf->priv; +struct vb2_dma_sg_buf *buf; +void *vaddr; -iosys_map_set_vaddr (map, buf->vaddr); + buf = dbuf->priv; + vaddr =vb2_dma_sg_vaddr (buf->vb, buf); +if (!vaddr) +return -EINVAL ; + +iosys_map_set_vaddr (map, vaddr);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 104/331 mmc: core: Use mrq.sbc in close-ended ffu
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avri Altman <[email protected]>
commit 4d0c8d0aef6355660b6775d57ccd5d4ea2e15802 upstream.
Field Firmware Update (ffu) may use close-ended or open ended sequence. Each such sequence is comprised of a write commands enclosed between 2 switch commands - to and from ffu mode. So for the close-ended case, it will be: cmd6->cmd23-cmd25-cmd6.
Some host controllers however, get confused when multi-block rw is sent without sbc, and may generate auto-cmd12 which breaks the ffu sequence. I encountered this issue while testing fwupd (github.com/fwupd/fwupd) on HP Chromebook x2, a qualcomm based QC-7c, code name - strongbad.
Instead of a quirk, or hooking the request function of the msm ops, it would be better to fix the ioctl handling and make it use mrq.sbc instead of issuing SET_BLOCK_COUNT separately.
--- drivers/mmc/core/block.c | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-)
drivers/mmc/core/block.c +43 -3
@@ -400,6 +400,10 @@ struct mmc_blk_ioc_data {struct mmc_ioc_cmd ic;unsigned char *buf;u64 buf_bytes; +unsigned int flags; +#define MMC_BLK_IOC_DROP BIT(0)/* drop this mrq */ +#define MMC_BLK_IOC_SBC BIT(1)/* use mrq.sbc */ +struct mmc_rpmb_data *rpmb; };
@@ -465,7 +469,7 @@ static int mmc_blk_ioctl_copy_to_user(st }static int __mmc_blk_ioctl_cmd (struct mmc_card *card,struct mmc_blk_data *md, -struct mmc_blk_ioc_data *idata) +struct mmc_blk_ioc_data **idatas,int i) {struct mmc_command cmd = {}, sbc = {};struct mmc_data data = {};
@@ -475,10 +479,18 @@ static int __mmc_blk_ioctl_cmd(struct mmunsigned int busy_timeout_ms;int err;unsigned int target_part; +struct mmc_blk_ioc_data *idata = idatas[i]; +struct mmc_blk_ioc_data *prev_idata =NULL ;if (!card || !md || !idata)return -EINVAL ; +if (idata->flags &MMC_BLK_IOC_DROP ) +return 0 ; + +if (idata->flags &MMC_BLK_IOC_SBC ) + prev_idata = idatas[i -1 ]; +/* * The RPMB accesses comes in from the character device, so we * need to target these explicitly. Else we just target the
@@ -532,7 +544,7 @@ static int __mmc_blk_ioctl_cmd(struct mmreturn err; } -if (idata->rpmb) { +if (idata->rpmb || prev_idata) { sbc.opcode =MMC_SET_BLOCK_COUNT ;/* * We don't do any blockcount validation because the max size
@@ -540,6 +552,8 @@ static int __mmc_blk_ioctl_cmd(struct mm* 'Reliable Write' bit here. */ sbc.arg = data.blocks | (idata->ic.write_flag &BIT (31 )); +if (prev_idata) + sbc.arg = prev_idata->ic.arg; sbc.flags =MMC_RSP_R1 |MMC_CMD_AC ; mrq.sbc = &sbc; }
@@ -557,6 +571,15 @@ static int __mmc_blk_ioctl_cmd(struct mmmmc_wait_for_req (card->host, &mrq);memcpy (&idata->ic.response, cmd.resp,sizeof (cmd.resp)); +if (prev_idata) { +memcpy (&prev_idata->ic.response, sbc.resp,sizeof (sbc.resp)); +if (sbc.error) { +dev_err (mmc_dev (card->host),"%s: sbc error %d\n" , + __func__, sbc.error); +return sbc.error; + } + } +if (cmd.error) {dev_err (mmc_dev (card->host),"%s: cmd error %d\n" , __func__, cmd.error);
@@ -1034,6 +1057,20 @@ static inline void mmc_blk_reset_success md->reset_done &= ~type; } +static void mmc_blk_check_sbc (struct mmc_queue_req *mq_rq) +{ +struct mmc_blk_ioc_data **idata = mq_rq->drv_op_data; +int i; + +for (i =1 ; i < mq_rq->ioc_count; i++) { +if (idata[i -1 ]->ic.opcode ==MMC_SET_BLOCK_COUNT && +mmc_op_multi (idata[i]->ic.opcode)) { + idata[i -1 ]->flags |=MMC_BLK_IOC_DROP ; + idata[i]->flags |=MMC_BLK_IOC_SBC ; + } + } +} +/* * The non-block commands come back from the block layer after it queued it and * processed it with all other requests and then they get issued in this
@@ -1061,11 +1098,14 @@ static void mmc_blk_issue_drv_op(structif (ret)break ; } + +mmc_blk_check_sbc (mq_rq); + fallthrough;case MMC_DRV_OP_IOCTL_RPMB : idata = mq_rq->drv_op_data;for (i =0 , ret =0 ; i < mq_rq->ioc_count; i++) { - ret =__mmc_blk_ioctl_cmd (card, md, idata[i]); + ret =__mmc_blk_ioctl_cmd (card, md, idata, i);if (ret)break ; }
Greg Kroah-Hartman
maintainerPATCH 105/331 mmc: mmc_spi: remove custom DMA mapped buffers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
commit 84a6be7db9050dd2601c9870f65eab9a665d2d5d upstream.
There is no need to duplicate what SPI core or individual controller drivers already do, i.e. mapping the buffers for DMA capable transfers.
Note, that the code, besides its redundancy, was buggy: strictly speaking there is no guarantee, while it's true for those which can use this code (see below), that the SPI host controller _is_ the device which does DMA.
Also see the Link tags below.
Additional notes. Currently only two SPI host controller drivers may use premapped (by the user) DMA buffers:
- drivers/spi/spi-au1550.c
- drivers/spi/spi-fsl-spi.c
Both of them have DMA mapping support code. I don't expect that SPI host controller code is worse than what has been done in mmc_spi. Hence I do not expect any regressions here. Otherwise, I'm pretty much sure these regressions have to be fixed in the respective drivers, and not here.
That said, remove all related pieces of DMA mapping code from mmc_spi.
--- drivers/mmc/host/mmc_spi.c | 186 +-------------------------------------------- 1 file changed, 5 insertions(+), 181 deletions(-)
drivers/mmc/host/mmc_spi.c +5 -181
@@ -15,7 +15,7 @@#include <linux/slab.h> #include <linux/module.h> #include <linux/bio.h> -#include <linux/dma-mapping.h> +#include <linux/dma-direction.h> #include <linux/crc7.h> #include <linux/crc-itu-t.h> #include <linux/scatterlist.h>
@@ -119,19 +119,14 @@ struct mmc_spi_host {struct spi_transfer status;struct spi_message readback; -/* underlying DMA-aware controller, or null */ -struct device *dma_dev; -/* buffer used for commands and for message "overhead" */ struct scratch *data; -dma_addr_t data_dma;/* Specs say to write ones most of the time, even when the card * has no need to read its input data; and many cards won't care. * This is our source of those ones. */ void *ones; -dma_addr_t ones_dma; };
@@ -147,11 +142,8 @@ static inline int mmc_cs_off(struct mmc_return spi_setup (host->spi); } -static int -mmc_spi_readbytes (struct mmc_spi_host *host,unsigned len) +static int mmc_spi_readbytes (struct mmc_spi_host *host,unsigned int len) { -int status; -if (len >sizeof (*host->data)) {WARN_ON (1 );return -EIO ;
@@ -159,19 +151,7 @@ mmc_spi_readbytes(struct mmc_spi_host *h host->status.len = len; -if (host->dma_dev) -dma_sync_single_for_device (host->dma_dev, - host->data_dma,sizeof (*host->data), -DMA_FROM_DEVICE ); - - status =spi_sync_locked (host->spi, &host->readback); - -if (host->dma_dev) -dma_sync_single_for_cpu (host->dma_dev, - host->data_dma,sizeof (*host->data), -DMA_FROM_DEVICE ); - -return status; +return spi_sync_locked (host->spi, &host->readback); } static int mmc_spi_skip(struct mmc_spi_host *host, unsigned long timeout,
@@ -506,23 +486,11 @@ mmc_spi_command_send(struct mmc_spi_host t = &host->t;memset (t,0 ,sizeof (*t)); t->tx_buf = t->rx_buf = data->status; - t->tx_dma = t->rx_dma = host->data_dma; t->len = cp - data->status; t->cs_change =1 ;spi_message_add_tail (t, &host->m); -if (host->dma_dev) { - host->m.is_dma_mapped =1 ; -dma_sync_single_for_device (host->dma_dev, - host->data_dma,sizeof (*host->data), -DMA_BIDIRECTIONAL ); - } status =spi_sync_locked (host->spi, &host->m); - -if (host->dma_dev) -dma_sync_single_for_cpu (host->dma_dev, - host->data_dma,sizeof (*host->data), -DMA_BIDIRECTIONAL );if (status <0 ) {dev_dbg (&host->spi->dev," ... write returned %d\n" , status); cmd->error = status;
@@ -540,9 +508,6 @@ mmc_spi_command_send(struct mmc_spi_host* We always provide TX data for data and CRC. The MMC/SD protocol * requires us to write ones; but Linux defaults to writing zeroes; * so we explicitly initialize it to all ones on RX paths. -* -* We also handle DMA mapping, so the underlying SPI controller does -* not need to (re)do it for each message. */ static void mmc_spi_setup_data_message(
@@ -552,11 +517,8 @@ mmc_spi_setup_data_message( {struct spi_transfer *t;struct scratch *scratch = host->data; -dma_addr_t dma = host->data_dma;spi_message_init (&host->m); -if (dma) - host->m.is_dma_mapped =1 ;/* for reads, readblock() skips 0xff bytes before finding * the token; for writes, this transfer issues that token.
@@ -570,8 +532,6 @@ mmc_spi_setup_data_message(else scratch->data_token =SPI_TOKEN_SINGLE ; t->tx_buf = &scratch->data_token; -if (dma) - t->tx_dma = dma + offsetof(struct scratch , data_token);spi_message_add_tail (t, &host->m); }
@@ -581,7 +541,6 @@ mmc_spi_setup_data_message( t = &host->t;memset (t,0 ,sizeof (*t)); t->tx_buf = host->ones; - t->tx_dma = host->ones_dma;/* length and actual buffer info are written later */ spi_message_add_tail (t, &host->m);
@@ -591,14 +550,9 @@ mmc_spi_setup_data_message(if (direction ==DMA_TO_DEVICE ) {/* the actual CRC may get written later */ t->tx_buf = &scratch->crc_val; -if (dma) - t->tx_dma = dma + offsetof(struct scratch , crc_val); }else { t->tx_buf = host->ones; - t->tx_dma = host->ones_dma; t->rx_buf = &scratch->crc_val; -if (dma) - t->rx_dma = dma + offsetof(struct scratch , crc_val); }spi_message_add_tail (t, &host->m);
@@ -621,10 +575,7 @@ mmc_spi_setup_data_message(memset (t,0 ,sizeof (*t)); t->len = (direction ==DMA_TO_DEVICE ) ?sizeof (scratch->status) :1 ; t->tx_buf = host->ones; - t->tx_dma = host->ones_dma; t->rx_buf = scratch->status; -if (dma) - t->rx_dma = dma + offsetof(struct scratch , status); t->cs_change =1 ;spi_message_add_tail (t, &host->m); }
@@ -653,23 +604,13 @@ mmc_spi_writeblock(struct mmc_spi_host *if (host->mmc->use_spi_crc) scratch->crc_val =cpu_to_be16 (crc_itu_t (0 , t->tx_buf, t->len)); -if (host->dma_dev) -dma_sync_single_for_device (host->dma_dev, - host->data_dma,sizeof (*scratch), -DMA_BIDIRECTIONAL ); status =spi_sync_locked (spi, &host->m); -if (status !=0 ) {dev_dbg (&spi->dev,"write error (%d)\n" , status);return status; } -if (host->dma_dev) -dma_sync_single_for_cpu (host->dma_dev, - host->data_dma,sizeof (*scratch), -DMA_BIDIRECTIONAL ); -/* * Get the transmission data-response reply. It must follow * immediately after the data block we transferred. This reply
@@ -718,8 +659,6 @@ mmc_spi_writeblock(struct mmc_spi_host * } t->tx_buf += t->len; -if (host->dma_dev) - t->tx_dma += t->len;/* Return when not busy. If we didn't collect that status yet, * we'll need some more I/O.
@@ -783,30 +722,12 @@ mmc_spi_readblock(struct mmc_spi_host *h } leftover = status <<1 ; -if (host->dma_dev) { -dma_sync_single_for_device (host->dma_dev, - host->data_dma,sizeof (*scratch), -DMA_BIDIRECTIONAL ); -dma_sync_single_for_device (host->dma_dev, - t->rx_dma, t->len, -DMA_FROM_DEVICE ); - } - status =spi_sync_locked (spi, &host->m);if (status <0 ) {dev_dbg (&spi->dev,"read error %d\n" , status);return status; } -if (host->dma_dev) { -dma_sync_single_for_cpu (host->dma_dev, - host->data_dma,sizeof (*scratch), -DMA_BIDIRECTIONAL ); -dma_sync_single_for_cpu (host->dma_dev, - t->rx_dma, t->len, -DMA_FROM_DEVICE ); - } -if (bitshift) {/* Walk through the data and the crc and do * all the magic to get byte-aligned data.
@@ -841,8 +762,6 @@ mmc_spi_readblock(struct mmc_spi_host *h } t->rx_buf += t->len; -if (host->dma_dev) - t->rx_dma += t->len;return 0 ; }
@@ -857,7 +776,6 @@ mmc_spi_data_do(struct mmc_spi_host *hos struct mmc_data *data, u32 blk_size) {struct spi_device *spi = host->spi; -struct device *dma_dev = host->dma_dev;struct spi_transfer *t;enum dma_data_direction direction =mmc_get_dma_dir (data);struct scatterlist *sg;
@@ -884,31 +802,8 @@ mmc_spi_data_do(struct mmc_spi_host *hos*/ for_each_sg (data->sg, sg, data->sg_len, n_sg) {int status =0 ; -dma_addr_t dma_addr =0 ;void *kmap_addr;unsigned length = sg->length; -enum dma_data_direction dir = direction; - -/* set up dma mapping for controller drivers that might -* use DMA ... though they may fall back to PIO -*/ -if (dma_dev) { -/* never invalidate whole *shared* pages ... */ -if ((sg->offset !=0 || length !=PAGE_SIZE ) - && dir ==DMA_FROM_DEVICE ) - dir =DMA_BIDIRECTIONAL ; - - dma_addr =dma_map_page (dma_dev,sg_page (sg),0 , -PAGE_SIZE , dir); -if (dma_mapping_error (dma_dev, dma_addr)) { - data->error = -EFAULT ; -break ; - } -if (direction ==DMA_TO_DEVICE ) - t->tx_dma = dma_addr + sg->offset; -else - t->rx_dma = dma_addr + sg->offset; - }/* allow pio too; we don't allow highmem */ kmap_addr =kmap (sg_page (sg));
@@ -941,8 +836,6 @@ mmc_spi_data_do(struct mmc_spi_host *hosif (direction ==DMA_FROM_DEVICE )flush_dcache_page (sg_page (sg));kunmap (sg_page (sg)); -if (dma_dev) -dma_unmap_page (dma_dev, dma_addr,PAGE_SIZE , dir);if (status <0 ) { data->error = status;
@@ -977,21 +870,9 @@ mmc_spi_data_do(struct mmc_spi_host *hos scratch->status[0 ] =SPI_TOKEN_STOP_TRAN ; host->early_status.tx_buf = host->early_status.rx_buf; - host->early_status.tx_dma = host->early_status.rx_dma; host->early_status.len = statlen; -if (host->dma_dev) -dma_sync_single_for_device (host->dma_dev, - host->data_dma,sizeof (*scratch), -DMA_BIDIRECTIONAL ); - tmp =spi_sync_locked (spi, &host->m); - -if (host->dma_dev) -dma_sync_single_for_cpu (host->dma_dev, - host->data_dma,sizeof (*scratch), -DMA_BIDIRECTIONAL ); -if (tmp <0 ) {if (!data->error) data->error = tmp;
@@ -1265,52 +1146,6 @@ mmc_spi_detect_irq(int irq, void *mmc)return IRQ_HANDLED ; } -#ifdef CONFIG_HAS_DMA -static int mmc_spi_dma_alloc (struct mmc_spi_host *host) -{ -struct spi_device *spi = host->spi; -struct device *dev; - -if (!spi->master->dev.parent->dma_mask) -return 0 ; - - dev = spi->master->dev.parent; - - host->ones_dma =dma_map_single (dev, host->ones,MMC_SPI_BLOCKSIZE , -DMA_TO_DEVICE ); -if (dma_mapping_error (dev, host->ones_dma)) -return -ENOMEM ; - - host->data_dma =dma_map_single (dev, host->data,sizeof (*host->data), -DMA_BIDIRECTIONAL ); -if (dma_mapping_error (dev, host->data_dma)) { -dma_unmap_single (dev, host->ones_dma,MMC_SPI_BLOCKSIZE , -DMA_TO_DEVICE ); -return -ENOMEM ; - } - -dma_sync_single_for_cpu (dev, host->data_dma,sizeof (*host->data), -DMA_BIDIRECTIONAL ); - - host->dma_dev = dev; -return 0 ; -} - -static void mmc_spi_dma_free (struct mmc_spi_host *host) -{ -if (!host->dma_dev) -return ; - -dma_unmap_single (host->dma_dev, host->ones_dma,MMC_SPI_BLOCKSIZE , -DMA_TO_DEVICE ); -dma_unmap_single (host->dma_dev, host->data_dma,sizeof (*host->data), -DMA_BIDIRECTIONAL ); -} -#else -static inline int mmc_spi_dma_alloc (struct mmc_spi_host *host) {return 0 ; } -static inline void mmc_spi_dma_free (struct mmc_spi_host *host) {} -#endif -static int mmc_spi_probe (struct spi_device *spi) {void *ones;
@@ -1402,24 +1237,17 @@ static int mmc_spi_probe(struct spi_devi host->powerup_msecs =250 ; } -/* preallocate dma buffers */ +/* Preallocate buffers */ host->data =kmalloc (sizeof (*host->data),GFP_KERNEL );if (!host->data) goto fail_nobuf1; - status =mmc_spi_dma_alloc (host); -if (status) - goto fail_dma; -/* setup message for status/busy readback */ spi_message_init (&host->readback); - host->readback.is_dma_mapped = (host->dma_dev !=NULL );spi_message_add_tail (&host->status, &host->readback); host->status.tx_buf = host->ones; - host->status.tx_dma = host->ones_dma; host->status.rx_buf = &host->data->status; - host->status.rx_dma = host->data_dma + offsetof(struct scratch , status); host->status.cs_change =1 ;/* register card detect irq */
@@ -1464,9 +1292,8 @@ static int mmc_spi_probe(struct spi_deviif (!status) has_ro = true; - dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n", + dev_info(&spi->dev, "SD/MMC host %s%s%s%s\n", dev_name(&mmc->class_dev), - host->dma_dev ? "" : ", no DMA", has_ro ? "" : ", no WP", (host->pdata && host->pdata->setpower) ? "" : ", no poweroff",
@@ -1477,8 +1304,6 @@ static int mmc_spi_probe(struct spi_devi fail_gpiod_request:mmc_remove_host (mmc); fail_glue_init: -mmc_spi_dma_free (host); -fail_dma:kfree (host->data); fail_nobuf1:mmc_spi_put_pdata (spi);
@@ -1500,7 +1325,6 @@ static void mmc_spi_remove(struct spi_demmc_remove_host (mmc); -mmc_spi_dma_free (host);kfree (host->data);kfree (host->ones);
Greg Kroah-Hartman
maintainerPATCH 106/331 media: i2c: st-mipid02: correct format propagation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alain Volmat <[email protected]>
commit b33cb0cbe2893b96ecbfa16254407153f4b55d16 upstream.
Use a copy of the struct v4l2_subdev_format when propagating format from the sink to source pad in order to avoid impacting the sink format returned to the application.
Thanks to Jacopo Mondi for pointing the issue.
--- drivers/media/i2c/st-mipid02.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/media/i2c/st-mipid02.c +7 -2
@@ -770,6 +770,7 @@ static void mipid02_set_fmt_sink(struct struct v4l2_subdev_format *format) {struct mipid02_dev *bridge =to_mipid02_dev (sd); +struct v4l2_subdev_format source_fmt;struct v4l2_mbus_framefmt *fmt; format->format.code =get_fmt_code (format->format.code);
@@ -781,8 +782,12 @@ static void mipid02_set_fmt_sink(struct *fmt = format->format; -/* Propagate the format change to the source pad */ -mipid02_set_fmt_source (sd, sd_state, format); +/* +* Propagate the format change to the source pad, taking +* care not to update the format pointer given back to user +*/ + source_fmt = *format; +mipid02_set_fmt_source (sd, sd_state, &source_fmt); } static int mipid02_set_fmt(struct v4l2_subdev *sd,
Greg Kroah-Hartman
maintainerPATCH 107/331 media: mtk-jpeg: Fix timeout schedule error in mtk_jpegdec_worker.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Wang <[email protected]>
commit 38e1857933def4b3fafc28cc34ff3bbc84cad2c3 upstream.
In mtk_jpegdec_worker, if error occurs in mtk_jpeg_set_dec_dst, it will start the timeout worker and invoke v4l2_m2m_job_finish at the same time. This will break the logic of design for there should be only one function to call v4l2_m2m_job_finish. But now the timeout handler and mtk_jpegdec_worker will both invoke it.
Fix it by start the worker only if mtk_jpeg_set_dec_dst successfully finished.
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +3 -3
@@ -1749,9 +1749,6 @@ retry_select:v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx);v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); -schedule_delayed_work (&comp_jpeg[hw_id]->job_timeout_work, -msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC )); -mtk_jpeg_set_dec_src (ctx, &src_buf->vb2_buf, &bs); if (mtk_jpeg_set_dec_dst(ctx, &jpeg_src_buf->dec_param,
@@ -1761,6 +1758,9 @@ retry_select: goto setdst_end; } +schedule_delayed_work (&comp_jpeg[hw_id]->job_timeout_work, +msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC )); +spin_lock_irqsave (&comp_jpeg[hw_id]->hw_lock, flags); ctx->total_frame_num++;mtk_jpeg_dec_reset (comp_jpeg[hw_id]->reg_base);
Greg Kroah-Hartman
maintainerPATCH 108/331 media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Wang <[email protected]>
commit 206c857dd17d4d026de85866f1b5f0969f2a109e upstream.
In mtk_jpeg_probe, &jpeg->job_timeout_work is bound with mtk_jpeg_job_timeout_work.
In mtk_jpeg_dec_device_run, if error happens in mtk_jpeg_set_dec_dst, it will finally start the worker while mark the job as finished by invoking v4l2_m2m_job_finish.
There are two methods to trigger the bug. If we remove the module, it which will call mtk_jpeg_remove to make cleanup. The possible sequence is as follows, which will cause a use-after-free bug.
CPU0 CPU1mtk_jpeg_dec_... |
start worker |
|mtk_jpeg_job_timeout_work
mtk_jpeg_remove |
v4l2_m2m_release |
kfree(m2m_dev); |
|
| v4l2_m2m_get_curr_priv
| m2m_dev->curr_ctx //useIf we close the file descriptor, which will call mtk_jpeg_release, it will have a similar sequence.
Fix this bug by starting timeout worker only if started jpegdec worker successfully. Then v4l2_m2m_job_finish will only be called in either mtk_jpeg_job_timeout_work or mtk_jpeg_dec_device_run.
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +3 -3
@@ -1021,13 +1021,13 @@ static void mtk_jpeg_dec_device_run(voidif (ret <0 ) goto dec_end; -schedule_delayed_work (&jpeg->job_timeout_work, -msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC )); -mtk_jpeg_set_dec_src (ctx, &src_buf->vb2_buf, &bs);if (mtk_jpeg_set_dec_dst (ctx, &jpeg_src_buf->dec_param, &dst_buf->vb2_buf, &fb)) goto dec_end; +schedule_delayed_work (&jpeg->job_timeout_work, +msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC )); +spin_lock_irqsave (&jpeg->hw_lock, flags);mtk_jpeg_dec_reset (jpeg->reg_base); mtk_jpeg_dec_set_config(jpeg->reg_base,
Greg Kroah-Hartman
maintainerPATCH 109/331 riscv: mm: Fixup compat arch_get_mmap_end
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guo Ren <[email protected]>
commit 97b7ac69be2e5a683e898f5267f659fde52efdd5 upstream.
When the task is in COMPAT mode, the arch_get_mmap_end should be 2GB, not TASK_SIZE_64. The TASK_SIZE has contained is_compat_mode() detection, so change the definition of STACK_TOP_MAX to TASK_SIZE directly.
--- arch/riscv/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/processor.h +1 -1
@@ -15,7 +15,7 @@#ifdef CONFIG_64BIT #define DEFAULT_MAP_WINDOW (UL(1) << (MMAP_VA_BITS - 1)) -#define STACK_TOP_MAX TASK_SIZE_64 +#define STACK_TOP_MAX TASK_SIZE#define arch_get_mmap_end (addr, len, flags) \ ({ \
Greg Kroah-Hartman
maintainerPATCH 110/331 riscv: mm: Fixup compat mode boot failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guo Ren <[email protected]>
commit 5f449e245e5b0d9d63eef6c8968fbdc3a8594407 upstream.
In COMPAT mode, the STACK_TOP is DEFAULT_MAP_WINDOW (0x80000000), but the TASK_SIZE is 0x7fff000. When the user stack is upon 0x7fff000, it will cause a user segment fault. Sometimes, it would cause boot failure when the whole rootfs is rv32.
Freeing unused kernel image (initmem) memory: 2236K
Run /sbin/init as init process
Starting init: /sbin/init exists but couldn't execute it (error -14) Run /etc/init as init process
...
Increase the TASK_SIZE to cover STACK_TOP.
--- arch/riscv/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/pgtable.h +1 -1
@@ -880,7 +880,7 @@ static inline pte_t pte_swp_clear_exclus#define TASK_SIZE_MIN (PGDIR_SIZE_L3 * PTRS_PER_PGD / 2)#ifdef CONFIG_COMPAT -#define TASK_SIZE_32 (_AC(0x80000000, UL) - PAGE_SIZE) +#define TASK_SIZE_32 (_AC(0x80000000, UL))#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ TASK_SIZE_32 : TASK_SIZE_64)#else
Greg Kroah-Hartman
maintainerPATCH 111/331 arm64: Rename ARM64_WORKAROUND_2966298
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
commit 546b7cde9b1dd36089649101b75266564600ffe5 upstream.
In preparation to apply ARM64_WORKAROUND_2966298 for multiple errata, rename the kconfig and capability. No functional change.
--- arch/arm64/Kconfig | 4 ++++ arch/arm64/kernel/cpu_errata.c | 4 ++-- arch/arm64/kernel/entry.S | 2 +- arch/arm64/tools/cpucaps | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
arch/arm64/Kconfig +4 -0
@@ -1037,8 +1037,12 @@ config ARM64_ERRATUM_2645198 If unsure, say Y. +config ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD + bool + config ARM64_ERRATUM_2966298 bool "Cortex-A520: 2966298: workaround for speculatively executed unprivileged load" + select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD default y help This option adds the workaround for ARM Cortex-A520 erratum 2966298.
arch/arm64/kernel/cpu_errata.c +2 -2
@@ -730,10 +730,10 @@ const struct arm64_cpu_capabilities arm6 .cpu_enable = cpu_clear_bf16_from_user_emulation, },#endif -#ifdef CONFIG_ARM64_ERRATUM_2966298 +#ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD { .desc = "ARM erratum 2966298", - .capability = ARM64_WORKAROUND_2966298, + .capability = ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD, /* Cortex-A520 r0p0 - r0p1 */ ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A520, 0, 0, 1), },
arch/arm64/kernel/entry.S +1 -1
@@ -428,7 +428,7 @@ alternative_else_nop_endif ldp x28, x29, [sp, #16 * 14] .if \el == 0 -alternative_if ARM64_WORKAROUND_2966298 +alternative_if ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD tlbi vale1, xzr dsb nsh alternative_else_nop_endif
arch/arm64/tools/cpucaps +1 -1
@@ -84,7 +84,6 @@ WORKAROUND_2077057 WORKAROUND_2457168 WORKAROUND_2645198 WORKAROUND_2658417 -WORKAROUND_2966298 WORKAROUND_AMPERE_AC03_CPU_38 WORKAROUND_TRBE_OVERWRITE_FILL_MODE WORKAROUND_TSB_FLUSH_FAILURE
@@ -100,3 +99,4 @@ WORKAROUND_NVIDIA_CARMEL_CNP WORKAROUND_QCOM_FALKOR_E1003 WORKAROUND_REPEAT_TLBI WORKAROUND_SPECULATIVE_AT +WORKAROUND_SPECULATIVE_UNPRIV_LOAD
Greg Kroah-Hartman
maintainerPATCH 112/331 arm64: errata: Add Cortex-A510 speculative unprivileged load workaround
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
commit f827bcdafa2a2ac21c91e47f587e8d0c76195409 upstream.
Implement the workaround for ARM Cortex-A510 erratum 3117295. On an affected Cortex-A510 core, a speculatively executed unprivileged load might leak data from a privileged load via a cache side channel. The issue only exists for loads within a translation regime with the same translation (e.g. same ASID and VMID). Therefore, the issue only affects the return to EL0.
The erratum and workaround are the same as ARM Cortex-A520 erratum 2966298, so reuse the existing workaround.
--- Documentation/arch/arm64/silicon-errata.rst | 2 ++ arch/arm64/Kconfig | 14 ++++++++++++++ arch/arm64/kernel/cpu_errata.c | 17 +++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-)
Documentation/arch/arm64/silicon-errata.rst +2 -0
@@ -71,6 +71,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A510 | #2658417 | ARM64_ERRATUM_2658417 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A510 | #3117295 | ARM64_ERRATUM_3117295 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A520 | #2966298 | ARM64_ERRATUM_2966298 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A53 | #826319 | ARM64_ERRATUM_826319 |
arch/arm64/Kconfig +14 -0
@@ -1054,6 +1054,20 @@ config ARM64_ERRATUM_2966298 If unsure, say Y. +config ARM64_ERRATUM_3117295 + bool "Cortex-A510: 3117295: workaround for speculatively executed unprivileged load" + select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD + default y + help + This option adds the workaround for ARM Cortex-A510 erratum 3117295. + + On an affected Cortex-A510 core, a speculatively executed unprivileged + load might leak data from a privileged level via a cache side channel. + + Work around this problem by executing a TLBI before returning to EL0. + + If unsure, say Y. + config CAVIUM_ERRATUM_22375 bool "Cavium erratum 22375, 24313" default y
arch/arm64/kernel/cpu_errata.c +15 -2
@@ -432,6 +432,19 @@ static struct midr_range broken_aarch32_ };#endif /* CONFIG_ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE */ +#ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD +static const struct midr_range erratum_spec_unpriv_load_list[] = { +#ifdef CONFIG_ARM64_ERRATUM_3117295 +MIDR_ALL_VERSIONS (MIDR_CORTEX_A510 ), +#endif +#ifdef CONFIG_ARM64_ERRATUM_2966298 +/* Cortex-A520 r0p0 to r0p1 */ +MIDR_REV_RANGE (MIDR_CORTEX_A520 ,0 ,0 ,1 ), +#endif + {}, +}; +#endif + const struct arm64_cpu_capabilities arm64_errata[] = {#ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE {
@@ -732,10 +745,10 @@ const struct arm64_cpu_capabilities arm6#endif #ifdef CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD { - .desc = "ARM erratum 2966298", + .desc = "ARM errata 2966298, 3117295", .capability = ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD, /* Cortex-A520 r0p0 - r0p1 */ - ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A520, 0, 0, 1), + ERRATA_MIDR_RANGE_LIST(erratum_spec_unpriv_load_list), }, #endif #ifdef CONFIG_AMPERE_ERRATUM_AC03_CPU_38
Greg Kroah-Hartman
maintainerPATCH 113/331 arm64/sme: Always exit sme_alloc() early with existing storage
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Brown <[email protected]>
commit dc7eb8755797ed41a0d1b5c0c39df3c8f401b3d9 upstream.
When sme_alloc() is called with existing storage and we are not flushing we will always allocate new storage, both leaking the existing storage and corrupting the state. Fix this by separating the checks for flushing and for existing storage as we do for SVE.
Callers that reallocate (eg, due to changing the vector length) should call sme_free() themselves.
--- arch/arm64/kernel/fpsimd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm64/kernel/fpsimd.c +4 -2
@@ -1280,8 +1280,10 @@ void fpsimd_release_task(struct task_str*/ void sme_alloc (struct task_struct *task,bool flush) { -if (task->thread.sme_state && flush) { -memset (task->thread.sme_state,0 ,sme_state_size (task)); +if (task->thread.sme_state) { +if (flush) +memset (task->thread.sme_state,0 , +sme_state_size (task));return ; }