6.6.84-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainercover 6.6.84-rc1 review
This is the start of the stable review cycle for the 6.6.84 release. There are 166 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 Fri, 21 Mar 2025 14:29:55 +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.84-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.84-rc1
Florian Westphal <[email protected]>
netfilter: nf_tables: allow clone callbacks to sleep
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: bail out if stateful expression provides no .clone
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: use timestamp to check for set element timeout
Mitchell Levy <[email protected]>
rust: lockdep: Remove support for dynamically allocated LockClassKeys
Maurizio Lombardi <[email protected]>
nvme-tcp: Fix a C2HTermReq error message
Alex Henrie <[email protected]>
HID: apple: disable Fn key handling on the Omoton KB066
Daniel Wagner <[email protected]>
nvme-fc: rely on state transitions to handle connectivity loss
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix corrupted list in hci_chan_del
Henrique Carvalho <[email protected]>
smb: client: Fix match_session bug preventing session reuse
Steve French <[email protected]>
smb3: add support for IAKerb
Philipp Stanner <[email protected]>
stmmac: loongson: Pass correct arg to PCI function
Christophe JAILLET <[email protected]>
i2c: sis630: Fix an error handling path in sis630_probe()
Christophe JAILLET <[email protected]>
i2c: ali15x3: Fix an error handling path in ali15x3_probe()
Christophe JAILLET <[email protected]>
i2c: ali1535: Fix an error handling path in ali1535_probe()
Pali Rohár <[email protected]>
cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point()
Pali Rohár <[email protected]>
cifs: Validate content of WSL reparse point buffers
Murad Masimov <[email protected]>
cifs: Fix integer overflow while processing closetimeo mount option
Murad Masimov <[email protected]>
cifs: Fix integer overflow while processing actimeo mount option
Murad Masimov <[email protected]>
cifs: Fix integer overflow while processing acdirmax mount option
Murad Masimov <[email protected]>
cifs: Fix integer overflow while processing acregmax mount option
Tamir Duberstein <[email protected]>
scripts: generate_rust_analyzer: add missing macros deps
Christophe JAILLET <[email protected]>
ASoC: codecs: wm0010: Fix error handling path in wm0010_spi_probe()
Bard Liao <[email protected]>
ASoC: rt722-sdca: add missing readable registers
Alban Kurti <[email protected]>
rust: init: add missing newline to pr_info! calls
Charles Keepax <[email protected]>
ASoC: cs42l43: Fix maximum ADC Volume
Ivan Abramov <[email protected]>
drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data()
Alban Kurti <[email protected]>
rust: error: add missing newline to pr_warn! calls
Charles Keepax <[email protected]>
ASoC: ops: Consistently treat platform_max as control value
Kirill A. Shutemov <[email protected]>
mm: split critical region in remap_file_pages() and invoke LSMs in between
Andrii Nakryiko <[email protected]>
lib/buildid: Handle memfd_secret() files in build_id_parse()
Benno Lossin <[email protected]>
rust: init: fix Zeroable implementation for Option<NonNull<T>> and Option<KBox<T>>
Matthew Maurer <[email protected]>
rust: Disallow BTF generation with Rust + LTO
Paulo Alcantara <[email protected]>
smb: client: fix regression with guest option
Haoxiang Li <[email protected]>
qlcnic: fix memory leak issues in qlcnic_sriov_common.c
Zhenhua Huang <[email protected]>
arm64: mm: Populate vmemmap at the page level if not section aligned
Kent Overstreet <[email protected]>
dm-flakey: Fix memory corruption in optional corrupt_bio_byte feature
Thomas Mizrahi <[email protected]>
ASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model
Varada Pavani <[email protected]>
clk: samsung: update PLL locktime for PLL142XX used on FSD platform
Namjae Jeon <[email protected]>
ksmbd: prevent connection release during oplock break notification
Namjae Jeon <[email protected]>
ksmbd: fix use-after-free in ksmbd_free_work_struct
Mario Limonciello <[email protected]>
drm/amd/display: Fix slab-use-after-free on hdcp_work
Alex Hung <[email protected]>
drm/amd/display: Assign normalized_pix_clk when color depth = 14
Mario Limonciello <[email protected]>
drm/amd/display: Restore correct backlight brightness after a GPU reset
Leo Li <[email protected]>
drm/amd/display: Disable unneeded hpd interrupts during dm_init
Imre Deak <[email protected]>
drm/dp_mst: Fix locking when skipping CSN before topology probing
Ville Syrjälä <[email protected]>
drm/atomic: Filter out redundant DPMS calls
Ville Syrjälä <[email protected]>
drm/i915/cdclk: Do cdclk post plane programming later
Florent Revest <[email protected]>
x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes
Johan Hovold <[email protected]>
USB: serial: option: match on interface class for Telit FN990B
Fabio Porcedda <[email protected]>
USB: serial: option: fix Telit Cinterion FE990A name
Fabio Porcedda <[email protected]>
USB: serial: option: add Telit Cinterion FE990B compositions
Boon Khai Ng <[email protected]>
USB: serial: ftdi_sio: add support for Altera USB Blaster 3
Werner Sembach <[email protected]>
Input: i8042 - swap old quirk combination with new quirk for more devices
Werner Sembach <[email protected]>
Input: i8042 - swap old quirk combination with new quirk for several devices
Werner Sembach <[email protected]>
Input: i8042 - add required quirks for missing old boardnames
Werner Sembach <[email protected]>
Input: i8042 - swap old quirk combination with new quirk for NHxxRZQ
Antheas Kapenekakis <[email protected]>
Input: xpad - rename QH controller to Legion Go S
Antheas Kapenekakis <[email protected]>
Input: xpad - add support for TECNO Pocket Go
Antheas Kapenekakis <[email protected]>
Input: xpad - add support for ZOTAC Gaming Zone
Pavel Rojtberg <[email protected]>
Input: xpad - add multiple supported devices
Nilton Perim Neto <[email protected]>
Input: xpad - add 8BitDo SN30 Pro, Hyperkin X91 and Gamesir G7 SE controllers
Jeff LaBundy <[email protected]>
Input: iqs7222 - preserve system status register
H. Nikolaus Schaller <[email protected]>
Input: ads7846 - fix gpiod allocation
Pavel Begunkov <[email protected]>
io_uring: fix error pbuf checking
Jens Axboe <[email protected]>
io_uring: use unpin_user_pages() where appropriate
Jens Axboe <[email protected]>
io_uring/kbuf: use vm_insert_pages() for mmap'ed pbuf ring
Jens Axboe <[email protected]>
io_uring/kbuf: vmap pinned buffer ring
Jens Axboe <[email protected]>
io_uring: unify io_pin_pages()
Jens Axboe <[email protected]>
io_uring: use vmap() for ring mapping
Pavel Begunkov <[email protected]>
io_uring: fix corner case forgetting to vunmap
Jens Axboe <[email protected]>
io_uring: don't attempt to mmap larger than what the user asks for
Jens Axboe <[email protected]>
io_uring: get rid of remap_pfn_range() for mapping rings/sqes
Jens Axboe <[email protected]>
mm: add nommu variant of vm_insert_pages()
Ming Lei <[email protected]>
block: fix 'kmem_cache of name 'bio-108' already exists'
Frederic Weisbecker <[email protected]>
net: Handle napi_schedule() calls from non-interrupt
Thomas Zimmermann <[email protected]>
drm/nouveau: Do not override forced connector status
Matthieu Baerts (NGI0) <[email protected]>
mptcp: safety check before fallback
Arnd Bergmann <[email protected]>
x86/irq: Define trace events conditionally
Kan Liang <[email protected]>
perf/x86/intel: Use better start period for frequency mode
Harry Wentland <[email protected]>
drm/vkms: Round fixp2int conversion in lerp_u16
Miklos Szeredi <[email protected]>
fuse: don't truncate cached, mutated symlink
Hector Martin <[email protected]>
ASoC: tas2764: Set the SDOUT polarity correctly
Hector Martin <[email protected]>
ASoC: tas2764: Fix power control mask
Hector Martin <[email protected]>
ASoC: tas2770: Fix volume scale
Daniel Wagner <[email protected]>
nvme: only allow entering LIVE from CONNECTING state
Yu-Chun Lin <[email protected]>
sctp: Fix undefined behavior in left shift operation
Pali Rohár <[email protected]>
cifs: Treat unhandled directory name surrogate reparse points as mount directory nodes
Hector Martin <[email protected]>
apple-nvme: Release power domains when probe fails
Ruozhu Li <[email protected]>
nvmet-rdma: recheck queue state is LIVE in state lock in recv done
Maurizio Lombardi <[email protected]>
nvme-tcp: add basic support for the C2HTermReq PDU
Christopher Lentocha <[email protected]>
nvme-pci: quirk Acer FA100 for non-uniqueue identifiers
Uday Shankar <[email protected]>
io-wq: backoff when retrying worker creation
Stephan Gerhold <[email protected]>
net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors
Cristian Ciocaltea <[email protected]>
ASoC: SOF: amd: Handle IPC replies before FW_BOOT_COMPLETE
Terry Cheong <[email protected]>
ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module
Vitaly Rodionov <[email protected]>
ASoC: arizona/madera: use fsleep() in up/down DAPM event delays.
Kuninori Morimoto <[email protected]>
ASoC: rsnd: adjust convert rate limitation
Kuninori Morimoto <[email protected]>
ASoC: rsnd: don't indicate warning on rsnd_kctrl_accept_runtime()
Kuninori Morimoto <[email protected]>
ASoC: rsnd: indicate unsupported clock rate
Edson Juliano Drosdeck <[email protected]>
ALSA: hda/realtek: Limit mic boost on Positivo ARN50
Kuninori Morimoto <[email protected]>
ASoC: simple-card-utils.c: add missing dlc->of_node
Jiayuan Chen <[email protected]>
selftests/bpf: Fix invalid flag of recv()
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix slab-use-after-free Read in l2cap_send_cmd
Jan Beulich <[email protected]>
Xen/swiotlb: mark xen_swiotlb_fixup() __init
Daniel Lezcano <[email protected]>
thermal/cpufreq_cooling: Remove structure member documentation
Peter Oberparleiter <[email protected]>
s390/cio: Fix CHPID "configure" attribute caching
Mark Pearson <[email protected]>
platform/x86: thinkpad_acpi: Support for V9 DYTC platform profiles
Sybil Isabel Dorsett <[email protected]>
platform/x86: thinkpad_acpi: Fix invalid fan speed on ThinkPad X120e
Jann Horn <[email protected]>
sched: Clarify wake_up_q()'s write to task->wake_q.next
Josh Poimboeuf <[email protected]>
objtool: Ignore dangling jump table entries
Alex Henrie <[email protected]>
HID: apple: fix up the F6 key on the Omoton KB066 keyboard
Ievgen Vovk <[email protected]>
HID: hid-apple: Apple Magic Keyboard a3203 USB-C support
Daniel Brackenbury <[email protected]>
HID: topre: Fix n-key rollover on Realforce R3S TKL boards
Alexander Stein <[email protected]>
usb: phy: generic: Use proper helper for property detection
Chia-Lin Kao (AceLan) <[email protected]>
HID: ignore non-functional sensor in HP 5MP Camera
Zhang Lixu <[email protected]>
HID: intel-ish-hid: Send clock sync message immediately after reset
Zhang Lixu <[email protected]>
HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell
Brahmajit Das <[email protected]>
vboxsf: fix building with GCC 15
Eric W. Biederman <[email protected]>
alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support
Paulo Alcantara <[email protected]>
smb: client: fix noisy when tree connecting to DFS interlink targets
Gannon Kolding <[email protected]>
ACPI: resource: IRQ override for Eluktronics MECH-17
Magnus Lindholm <[email protected]>
scsi: qla1280: Fix kernel oops when debug level > 2
Seunghui Lee <[email protected]>
scsi: ufs: core: Fix error return with query response
Rik van Riel <[email protected]>
scsi: core: Use GFP_NOIO to avoid circular locking dependency
Dmitry Kandybka <[email protected]>
platform/x86/intel: pmc: fix ltr decode in pmc_core_ltr_show()
Christian Loehle <[email protected]>
sched/debug: Provide slice length for fair tasks
Chengen Du <[email protected]>
iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic()
Joe Hattori <[email protected]>
powercap: call put_device() on an error path in powercap_register_control_type()
Andy Shevchenko <[email protected]>
hrtimers: Mark is_migration_base() with __always_inline
Daniel Wagner <[email protected]>
nvme-fc: do not ignore connectivity loss during connecting
Daniel Wagner <[email protected]>
nvme-fc: go straight to connecting state when initializing
Carolina Jubran <[email protected]>
net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices
Jianbo Liu <[email protected]>
net/mlx5: Bridge, fix the crash caused by LAG state check
Shay Drory <[email protected]>
net/mlx5: Lag, Check shared fdb before creating MultiPort E-Switch
Ilya Maximets <[email protected]>
net: openvswitch: remove misbehaving actions length check
Guillaume Nault <[email protected]>
gre: Fix IPv6 link-local address generation.
Alexey Kashavkin <[email protected]>
netfilter: nft_exthdr: fix offset with ipv4_find_option()
Cong Wang <[email protected]>
net_sched: Prevent creation of classes with TC_H_ROOT
Dan Carpenter <[email protected]>
ipvs: prevent integer overflow in do_ip_vs_get_ctl()
Kohei Enju <[email protected]>
netfilter: nf_conncount: Fully initialize struct nf_conncount_tuple in insert_tree()
Hangbin Liu <[email protected]>
bonding: fix incorrect MAC address setting to receive NS messages
Amit Cohen <[email protected]>
net: switchdev: Convert blocking notification chain to a raw one
Taehee Yoo <[email protected]>
eth: bnxt: do not update checksum in bnxt_xdp_build_skb()
Wentao Liang <[email protected]>
net/mlx5: handle errors in mlx5_chains_create_table()
Michael Kelley <[email protected]>
Drivers: hv: vmbus: Don't release fb_mmio resource in vmbus_free_mmio()
Michael Kelley <[email protected]>
drm/hyperv: Fix address space leak when Hyper-V DRM device is removed
Breno Leitao <[email protected]>
netpoll: hold rcu read lock in __netpoll_send_skb()
Matt Johnston <[email protected]>
net: mctp i2c: Copy headers if cloned
Joseph Huang <[email protected]>
net: dsa: mv88e6xxx: Verify after ATU Load ops
Jiri Pirko <[email protected]>
net/mlx5: Fill out devlink dev info only for PFs
Luiz Augusto von Dentz <[email protected]>
Revert "Bluetooth: hci_core: Fix sleeping function called from invalid context"
Luiz Augusto von Dentz <[email protected]>
Bluetooth: hci_event: Fix enabling passive scanning
Miri Korenblit <[email protected]>
wifi: cfg80211: cancel wiphy_work before freeing wiphy
Jun Yang <[email protected]>
sched: address a potential NULL pointer dereference in the GRED scheduler.
Nicklas Bo Jensen <[email protected]>
netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around
Grzegorz Nitka <[email protected]>
ice: fix memory leak in aRFS after reset
Sebastian Andrzej Siewior <[email protected]>
netfilter: nft_ct: Use __refcount_inc() for per-CPU nft_ct_pcpu_template.
Artur Weber <[email protected]>
pinctrl: bcm281xx: Fix incorrect regmap max_registers value
Michael Kelley <[email protected]>
fbdev: hyperv_fb: iounmap() the correct memory when removing a device
Xueming Feng <[email protected]>
tcp: fix forever orphan socket caused by tcp_abort
Eric Dumazet <[email protected]>
tcp: fix races in tcp_abort()
Wander Lairson Costa <[email protected]>
bpf: Use raw_spinlock_t in ringbuf
Felix Moessbauer <[email protected]>
hrtimer: Use and report correct timerslack values for realtime tasks
Liu Shixin <[email protected]>
zram: fix NULL pointer in comp_algorithm_show()
Oleg Nesterov <[email protected]>
sched/isolation: Prevent boot crash when the boot CPU is nohz_full
David Woodhouse <[email protected]>
clockevents/drivers/i8253: Fix stop sequence for timer 0
-------------
Diffstat:
Documentation/timers/no_hz.rst | 7 +- Makefile | 4 +- arch/alpha/include/asm/elf.h | 6 +- arch/alpha/include/asm/pgtable.h | 2 +- arch/alpha/include/asm/processor.h | 8 +- arch/alpha/kernel/osf_sys.c | 11 +- arch/arm64/mm/mmu.c | 5 +- arch/x86/events/intel/core.c | 85 +++++++ arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/mshyperv.c | 11 - arch/x86/kernel/irq.c | 2 + block/bio.c | 2 +- drivers/acpi/resource.c | 6 + drivers/block/zram/zram_drv.c | 4 +- drivers/clk/samsung/clk-pll.c | 7 +- drivers/clocksource/i8253.c | 36 ++- drivers/firmware/iscsi_ibft.c | 5 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 1 + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 64 ++++-- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 7 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 40 ++-- drivers/gpu/drm/drm_atomic_uapi.c | 4 + drivers/gpu/drm/drm_connector.c | 4 + drivers/gpu/drm/gma500/mid_bios.c | 5 + drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 2 + drivers/gpu/drm/i915/display/intel_display.c | 5 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 1 - drivers/gpu/drm/vkms/vkms_composer.c | 2 +- drivers/hid/Kconfig | 3 +- drivers/hid/hid-apple.c | 13 +- drivers/hid/hid-ids.h | 3 + drivers/hid/hid-quirks.c | 1 + drivers/hid/hid-topre.c | 7 + drivers/hid/intel-ish-hid/ipc/ipc.c | 15 +- drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h | 2 + drivers/hv/vmbus_drv.c | 13 ++ drivers/i2c/busses/i2c-ali1535.c | 12 +- drivers/i2c/busses/i2c-ali15x3.c | 12 +- drivers/i2c/busses/i2c-sis630.c | 12 +- drivers/input/joystick/xpad.c | 39 +++- drivers/input/misc/iqs7222.c | 50 ++-- drivers/input/serio/i8042-acpipnpio.h | 111 +++++---- drivers/input/touchscreen/ads7846.c | 2 +- drivers/md/dm-flakey.c | 2 +- drivers/net/bonding/bond_options.c | 55 ++++- drivers/net/dsa/mv88e6xxx/chip.c | 59 ++++- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 11 +- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h | 3 +- drivers/net/ethernet/intel/ice/ice_arfs.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 3 + .../ethernet/mellanox/mlx5/core/en/rep/bridge.c | 12 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 +- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h | 1 + .../net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 3 +- .../ethernet/mellanox/mlx5/core/lib/fs_chains.c | 5 + .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 8 +- .../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 7 +- drivers/net/mctp/mctp-i2c.c | 5 + drivers/net/wwan/mhi_wwan_mbim.c | 2 +- drivers/nvme/host/apple.c | 2 + drivers/nvme/host/core.c | 2 - drivers/nvme/host/fc.c | 59 +---- drivers/nvme/host/pci.c | 2 + drivers/nvme/host/tcp.c | 43 ++++ drivers/nvme/target/rdma.c | 33 ++- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 2 +- drivers/platform/x86/intel/pmc/core.c | 4 +- drivers/platform/x86/thinkpad_acpi.c | 50 ++-- drivers/powercap/powercap_sys.c | 3 +- drivers/s390/cio/chp.c | 3 +- drivers/scsi/qla1280.c | 2 +- drivers/scsi/scsi_scan.c | 2 +- drivers/thermal/cpufreq_cooling.c | 2 - drivers/ufs/core/ufshcd.c | 7 +- drivers/usb/phy/phy-generic.c | 2 +- drivers/usb/serial/ftdi_sio.c | 14 ++ drivers/usb/serial/ftdi_sio_ids.h | 13 ++ drivers/usb/serial/option.c | 48 ++-- drivers/video/fbdev/hyperv_fb.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- fs/fuse/dir.c | 2 +- fs/namei.c | 24 +- fs/proc/base.c | 9 +- fs/select.c | 11 +- fs/smb/client/asn1.c | 2 + fs/smb/client/cifs_spnego.c | 4 +- fs/smb/client/cifsglob.h | 4 + fs/smb/client/connect.c | 16 +- fs/smb/client/fs_context.c | 18 +- fs/smb/client/inode.c | 13 ++ fs/smb/client/reparse.c | 10 +- fs/smb/client/sess.c | 3 +- fs/smb/client/smb2pdu.c | 4 +- fs/smb/common/smbfsctl.h | 3 + fs/smb/server/connection.c | 20 ++ fs/smb/server/connection.h | 2 + fs/smb/server/ksmbd_work.c | 3 - fs/smb/server/ksmbd_work.h | 1 - fs/smb/server/oplock.c | 43 ++-- fs/smb/server/oplock.h | 1 - fs/smb/server/server.c | 14 +- fs/vboxsf/super.c | 3 +- include/linux/fs.h | 2 + include/linux/i8253.h | 1 - include/linux/io_uring_types.h | 3 - include/linux/nvme-tcp.h | 2 + include/net/bluetooth/hci_core.h | 108 ++++----- include/net/bluetooth/l2cap.h | 3 +- include/net/netfilter/nf_tables.h | 20 +- include/sound/soc.h | 5 +- init/Kconfig | 2 +- io_uring/io-wq.c | 23 +- io_uring/io_uring.c | 251 +++++++++++++++------ io_uring/io_uring.h | 8 +- io_uring/kbuf.c | 173 ++++---------- io_uring/kbuf.h | 3 +- io_uring/rsrc.c | 39 ---- kernel/bpf/ringbuf.c | 12 +- kernel/sched/core.c | 13 +- kernel/sched/debug.c | 2 + kernel/sys.c | 2 + kernel/time/hrtimer.c | 40 ++-- lib/buildid.c | 5 + mm/mmap.c | 69 ++++-- mm/nommu.c | 7 + net/bluetooth/hci_core.c | 10 +- net/bluetooth/hci_event.c | 37 +-- net/bluetooth/iso.c | 6 - net/bluetooth/l2cap_core.c | 181 +++++++-------- net/bluetooth/l2cap_sock.c | 15 +- net/bluetooth/rfcomm/core.c | 6 - net/bluetooth/sco.c | 12 +- net/core/dev.c | 2 +- net/core/netpoll.c | 9 +- net/ipv4/tcp.c | 20 +- net/ipv6/addrconf.c | 15 +- net/mptcp/protocol.h | 2 + net/netfilter/ipvs/ip_vs_ctl.c | 8 +- net/netfilter/nf_conncount.c | 6 +- net/netfilter/nf_tables_api.c | 25 +- net/netfilter/nft_connlimit.c | 4 +- net/netfilter/nft_counter.c | 4 +- net/netfilter/nft_ct.c | 6 +- net/netfilter/nft_dynset.c | 2 +- net/netfilter/nft_exthdr.c | 10 +- net/netfilter/nft_last.c | 4 +- net/netfilter/nft_limit.c | 14 +- net/netfilter/nft_quota.c | 4 +- net/netfilter/nft_set_hash.c | 8 +- net/netfilter/nft_set_pipapo.c | 18 +- net/netfilter/nft_set_rbtree.c | 11 +- net/openvswitch/flow_netlink.c | 15 +- net/sched/sch_api.c | 6 + net/sched/sch_gred.c | 3 +- net/sctp/stream.c | 2 +- net/switchdev/switchdev.c | 25 +- net/wireless/core.c | 7 + rust/kernel/error.rs | 2 +- rust/kernel/init.rs | 23 +- rust/kernel/init/macros.rs | 6 +- rust/kernel/sync.rs | 10 +- scripts/generate_rust_analyzer.py | 30 ++- sound/pci/hda/patch_realtek.c | 1 + sound/soc/amd/yc/acp6x-mach.c | 7 + sound/soc/codecs/arizona.c | 14 +- sound/soc/codecs/cs42l43.c | 2 +- sound/soc/codecs/madera.c | 10 +- sound/soc/codecs/rt722-sdca-sdw.c | 4 + sound/soc/codecs/tas2764.c | 10 +- sound/soc/codecs/tas2764.h | 8 +- sound/soc/codecs/tas2770.c | 2 +- sound/soc/codecs/wm0010.c | 13 +- sound/soc/codecs/wm5110.c | 8 +- sound/soc/generic/simple-card-utils.c | 1 + sound/soc/sh/rcar/core.c | 14 -- sound/soc/sh/rcar/rsnd.h | 1 - sound/soc/sh/rcar/src.c | 116 ++++++++-- sound/soc/sh/rcar/ssi.c | 3 +- sound/soc/soc-ops.c | 15 +- sound/soc/sof/amd/acp-ipc.c | 23 +- sound/soc/sof/intel/hda-codec.c | 1 + tools/objtool/check.c | 9 + .../selftests/bpf/prog_tests/sockmap_basic.c | 6 +- 186 files changed, 1803 insertions(+), 1167 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/166 clockevents/drivers/i8253: Fix stop sequence for timer 0
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit 531b2ca0a940ac9db03f246c8b77c4201de72b00 upstream.
According to the data sheet, writing the MODE register should stop the counter (and thus the interrupts). This appears to work on real hardware, at least modern Intel and AMD systems. It should also work on Hyper-V.
However, on some buggy virtual machines the mode change doesn't have any effect until the counter is subsequently loaded (or perhaps when the IRQ next fires).
So, set MODE 0 and then load the counter, to ensure that those buggy VMs do the right thing and the interrupts stop. And then write MODE 0 *again* to stop the counter on compliant implementations too.
Apparently, Hyper-V keeps firing the IRQ *repeatedly* even in mode zero when it should only happen once, but the second MODE write stops that too.
Userspace test program (mostly written by tglx):
=====
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/io.h>
static __always_inline void __out##bwl(type value, uint16_t port) \
{ \
asm volatile("out" #bwl " %" #bw "0, %w1" \
: : "a"(value), "Nd"(port)); \
} \
\
static __always_inline type __in##bwl(uint16_t port) \
{ \
type value; \
asm volatile("in" #bwl " %w1, %" #bw "0" \
: "=a"(value) : "Nd"(port)); \
return value; \
}BUILDIO(b, b, uint8_t)
#define inb __inb
#define outb __outb
#define PIT_MODE 0x43
#define PIT_CH0 0x40
#define PIT_CH2 0x42
static int is8254;
static void dump_pit(void)
{
if (is8254) {
// Latch and output counter and status
outb(0xC2, PIT_MODE);
printf("%02x %02x %02x\n", inb(PIT_CH0), inb(PIT_CH0), inb(PIT_CH0));
} else {
// Latch and output counter
outb(0x0, PIT_MODE);
printf("%02x %02x\n", inb(PIT_CH0), inb(PIT_CH0));
}
}int main(int argc, char* argv[])
{
int nr_counts = 2;
if (argc > 1)
nr_counts = atoi(argv[1]);
if (argc > 2)
is8254 = 1;
if (ioperm(0x40, 4, 1) != 0)
return 1;
dump_pit();
printf("Set oneshot\n");
outb(0x38, PIT_MODE);
outb(0x00, PIT_CH0);
outb(0x0F, PIT_CH0);
dump_pit();
usleep(1000);
dump_pit();
printf("Set periodic\n");
outb(0x34, PIT_MODE);
outb(0x00, PIT_CH0);
outb(0x0F, PIT_CH0);
dump_pit();
usleep(1000);
dump_pit();
dump_pit();
usleep(100000);
dump_pit();
usleep(100000);
dump_pit();
printf("Set stop (%d counter writes)\n", nr_counts);
outb(0x30, PIT_MODE);
while (nr_counts--)
outb(0xFF, PIT_CH0);
dump_pit();
usleep(100000);
dump_pit();
usleep(100000);
dump_pit();
printf("Set MODE 0\n");
outb(0x30, PIT_MODE);
dump_pit();
usleep(100000);
dump_pit();
usleep(100000);
dump_pit();
return 0;
}=====
--- arch/x86/kernel/cpu/mshyperv.c | 11 ----------- drivers/clocksource/i8253.c | 36 +++++++++++++++++++++++++----------- include/linux/i8253.h | 1 - 3 files changed, 25 insertions(+), 23 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +0 -11
@@ -16,7 +16,6 @@#include <linux/interrupt.h> #include <linux/irq.h> #include <linux/kexec.h> -#include <linux/i8253.h> #include <linux/random.h> #include <asm/processor.h> #include <asm/hypervisor.h>
@@ -575,16 +574,6 @@ static void __init ms_hyperv_init_platfoif (efi_enabled (EFI_BOOT )) x86_platform.get_nmi_reason = hv_get_nmi_reason; -/* -* Hyper-V VMs have a PIT emulation quirk such that zeroing the -* counter register during PIT shutdown restarts the PIT. So it -* continues to interrupt @18.2 HZ. Setting i8253_clear_counter -* to false tells pit_shutdown() not to zero the counter so that -* the PIT really is shutdown. Generation 2 VMs don't have a PIT, -* and setting this value has no effect. -*/ - i8253_clear_counter_on_shutdown = false; -#if IS_ENABLED (CONFIG_HYPERV )if ((hv_get_isolation_type () ==HV_ISOLATION_TYPE_VBS ) || ms_hyperv.paravisor_present)
drivers/clocksource/i8253.c +25 -11
@@ -20,13 +20,6 @@DEFINE_RAW_SPINLOCK (i8253_lock);EXPORT_SYMBOL (i8253_lock); -/* -* Handle PIT quirk in pit_shutdown() where zeroing the counter register -* restarts the PIT, negating the shutdown. On platforms with the quirk, -* platform specific code can set this to false. -*/ -bool i8253_clear_counter_on_shutdown__ro_after_init = true; -#ifdef CONFIG_CLKSRC_I8253 /* * Since the PIT overflows every tick, its not very useful
@@ -112,12 +105,33 @@ void clockevent_i8253_disable(void) {raw_spin_lock (&i8253_lock); +/* +* Writing the MODE register should stop the counter, according to +* the datasheet. This appears to work on real hardware (well, on +* modern Intel and AMD boxes; I didn't dig the Pegasos out of the +* shed). +* +* However, some virtual implementations differ, and the MODE change +* doesn't have any effect until either the counter is written (KVM +* in-kernel PIT) or the next interrupt (QEMU). And in those cases, +* it may not stop the *count*, only the interrupts. Although in +* the virt case, that probably doesn't matter, as the value of the +* counter will only be calculated on demand if the guest reads it; +* it's the interrupts which cause steal time. +* +* Hyper-V apparently has a bug where even in mode 0, the IRQ keeps +* firing repeatedly if the counter is running. But it *does* do the +* right thing when the MODE register is written. +* +* So: write the MODE and then load the counter, which ensures that +* the IRQ is stopped on those buggy virt implementations. And then +* write the MODE again, which is the right way to stop it. +*/ outb_p (0x30 ,PIT_MODE ); +outb_p (0 ,PIT_CH0 ); +outb_p (0 ,PIT_CH0 ); -if (i8253_clear_counter_on_shutdown) { -outb_p (0 ,PIT_CH0 ); -outb_p (0 ,PIT_CH0 ); - } +outb_p (0x30 ,PIT_MODE );raw_spin_unlock (&i8253_lock); }
include/linux/i8253.h +0 -1
@@ -21,7 +21,6 @@#define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ)extern raw_spinlock_t i8253_lock; -extern bool i8253_clear_counter_on_shutdown;extern struct clock_event_device i8253_clockevent;extern void clockevent_i8253_init (bool oneshot);extern void clockevent_i8253_disable (void );
Greg Kroah-Hartman
maintainerPATCH 2/166 sched/isolation: Prevent boot crash when the boot CPU is nohz_full
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
Documentation/timers/no_hz.rst states that the "nohz_full=" mask must not include the boot CPU, which is no longer true after:
08ae95f4fd3b ("nohz_full: Allow the boot CPU to be nohz_full").
However after:
aae17ebb53cd ("workqueue: Avoid using isolated cpus' timers on queue_delayed_work")
the kernel will crash at boot time in this case; housekeeping_any_cpu() returns an invalid CPU number until smp_init() brings the first housekeeping CPU up.
Change housekeeping_any_cpu() to check the result of cpumask_any_and() and return smp_processor_id() in this case.
This is just the simple and backportable workaround which fixes the symptom, but smp_processor_id() at boot time should be safe at least for type == HK_TYPE_TIMER, this more or less matches the tick_do_timer_boot_cpu logic.
There is no worry about cpu_down(); tick_nohz_cpu_down() will not allow to offline tick_do_timer_cpu (the 1st online housekeeping CPU).
[ Apply only documentation changes as commit which causes boot
crash when boot CPU is nohz_full is not backported to stable kernels - Krishanth ]
[ strip out upstream commit and Fixes: so tools don't get confused that
this commit actually does anything real - gregkh]
--- Documentation/timers/no_hz.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/timers/no_hz.rst +2 -5
@@ -129,11 +129,8 @@ adaptive-tick CPUs: At least one non-ad online to handle timekeeping tasks in order to ensure that system calls like gettimeofday() returns accurate values on adaptive-tick CPUs. (This is not an issue for CONFIG_NO_HZ_IDLE=y because there are no running -user processes to observe slight drifts in clock rate.) Therefore, the -boot CPU is prohibited from entering adaptive-ticks mode. Specifying a -"nohz_full=" mask that includes the boot CPU will result in a boot-time -error message, and the boot CPU will be removed from the mask. Note that -this means that your system must have at least two CPUs in order for +user processes to observe slight drifts in clock rate.) Note that this +means that your system must have at least two CPUs in order for CONFIG_NO_HZ_FULL=y to do anything for you. Finally, adaptive-ticks CPUs must have their RCU callbacks offloaded.
Greg Kroah-Hartman
maintainerPATCH 3/166 zram: fix NULL pointer in comp_algorithm_show()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Shixin <[email protected]>
commit f364cdeb38938f9d03061682b8ff3779dd1730e5 upstream.
LTP reported a NULL pointer dereference as followed:
CPU: 7 UID: 0 PID: 5995 Comm: cat Kdump: loaded Not tainted 6.12.0-rc6+ #3 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __pi_strcmp+0x24/0x140 lr : zcomp_available_show+0x60/0x100 [zram] sp : ffff800088b93b90 x29: ffff800088b93b90 x28: 0000000000000001 x27: 0000000000400cc0 x26: 0000000000000ffe x25: ffff80007b3e2388 x24: 0000000000000000 x23: ffff80007b3e2390 x22: ffff0004041a9000 x21: ffff80007b3e2900 x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: ffff80007b3e2900 x9 : ffff80007b3cb280 x8 : 0101010101010101 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000040 x4 : 0000000000000000 x3 : 00656c722d6f7a6c x2 : 0000000000000000 x1 : ffff80007b3e2900 x0 : 0000000000000000 Call trace: __pi_strcmp+0x24/0x140 comp_algorithm_show+0x40/0x70 [zram] dev_attr_show+0x28/0x80 sysfs_kf_seq_show+0x90/0x140 kernfs_seq_show+0x34/0x48 seq_read_iter+0x1d4/0x4e8 kernfs_fop_read_iter+0x40/0x58 new_sync_read+0x9c/0x168 vfs_read+0x1a8/0x1f8 ksys_read+0x74/0x108 __arm64_sys_read+0x24/0x38 invoke_syscall+0x50/0x120 el0_svc_common.constprop.0+0xc8/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x38/0x138 el0t_64_sync_handler+0xc0/0xc8 el0t_64_sync+0x188/0x190
The zram->comp_algs[ZRAM_PRIMARY_COMP] can be NULL in zram_add() if comp_algorithm_set() has not been called. User can access the zram device by sysfs after device_add_disk(), so there is a time window to trigger the NULL pointer dereference. Move it ahead device_add_disk() to make sure when user can access the zram device, it is ready. comp_algorithm_set() is protected by zram->init_lock in other places and no such problem.
[This fix does not backport zram_comp_params_reset which was introduced after
v6.6, in commit f2bac7ad187d ("zram: introduce zcomp_params structure")]
--- drivers/block/zram/zram_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/zram/zram_drv.c +2 -2
@@ -2247,6 +2247,8 @@ static int zram_add(void) zram->disk->private_data = zram;snprintf (zram->disk->disk_name,16 ,"zram%d" , device_id); +comp_algorithm_set (zram,ZRAM_PRIMARY_COMP , default_compressor); +/* Actual capacity set using sysfs (/sys/block/zram<id>/disksize */ set_capacity (zram->disk,0 );/* zram devices sort of resembles non-rotational disks */
@@ -2281,8 +2283,6 @@ static int zram_add(void)if (ret) goto out_cleanup_disk; -comp_algorithm_set (zram,ZRAM_PRIMARY_COMP , default_compressor); -zram_debugfs_register (zram);pr_info ("Added device: %s\n" , zram->disk->disk_name);return device_id;
Greg Kroah-Hartman
maintainerPATCH 4/166 hrtimer: Use and report correct timerslack values for realtime tasks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Moessbauer <[email protected]>
commit ed4fb6d7ef68111bb539283561953e5c6e9a6e38 upstream.
The timerslack_ns setting is used to specify how much the hardware timers should be delayed, to potentially dispatch multiple timers in a single interrupt. This is a performance optimization. Timers of realtime tasks (having a realtime scheduling policy) should not be delayed.
This logic was inconsitently applied to the hrtimers, leading to delays of realtime tasks which used timed waits for events (e.g. condition variables). Due to the downstream override of the slack for rt tasks, the procfs reported incorrect (non-zero) timerslack_ns values.
This is changed by setting the timer_slack_ns task attribute to 0 for all tasks with a rt policy. By that, downstream users do not need to specially handle rt tasks (w.r.t. the slack), and the procfs entry shows the correct value of "0". Setting non-zero slack values (either via procfs or PR_SET_TIMERSLACK) on tasks with a rt policy is ignored, as stated in "man 2 PR_SET_TIMERSLACK":
Timer slack is not applied to threads that are scheduled under a real-time scheduling policy (see sched_setscheduler(2)).
The special handling of timerslack on rt tasks in downstream users is removed as well.
--- fs/proc/base.c | 9 +++++---- fs/select.c | 11 ++++------- kernel/sched/core.c | 8 ++++++++ kernel/sys.c | 2 ++ kernel/time/hrtimer.c | 18 +++--------------- 5 files changed, 22 insertions(+), 26 deletions(-)
fs/proc/base.c +5 -4
@@ -2633,10 +2633,11 @@ static ssize_t timerslack_ns_write(struc }task_lock (p); -if (slack_ns ==0 ) - p->timer_slack_ns = p->default_timer_slack_ns; -else - p->timer_slack_ns = slack_ns; +if (task_is_realtime (p)) + slack_ns =0 ; +else if (slack_ns ==0 ) + slack_ns = p->default_timer_slack_ns; + p->timer_slack_ns = slack_ns;task_unlock (p); out:
fs/select.c +4 -7
@@ -77,19 +77,16 @@ u64 select_estimate_accuracy(struct time {u64 ret;struct timespec64 now; +u64 slack = current->timer_slack_ns; -/* -* Realtime tasks get a slack of 0 for obvious reasons. -*/ - -if (rt_task (current)) +if (slack ==0 )return 0 ;ktime_get_ts64 (&now); now =timespec64_sub (*tv, now); ret =__estimate_accuracy (&now); -if (ret < current->timer_slack_ns) -return current->timer_slack_ns; +if (ret < slack) +return slack;return ret; }
kernel/sched/core.c +8 -0
@@ -7530,6 +7530,14 @@ static void __setscheduler_params(structelse if (fair_policy (policy)) p->static_prio =NICE_TO_PRIO (attr->sched_nice); +/* rt-policy tasks do not have a timerslack */ +if (task_is_realtime (p)) { + p->timer_slack_ns =0 ; + }else if (p->timer_slack_ns ==0 ) { +/* when switching back to non-rt policy, restore timerslack */ + p->timer_slack_ns = p->default_timer_slack_ns; + } +/* * __sched_setscheduler() ensures attr->sched_priority == 0 when * !rt_policy. Always setting this ensures that things like
kernel/sys.c +2 -0
@@ -2535,6 +2535,8 @@ SYSCALL_DEFINE5(prctl, int, option, unsi error = current->timer_slack_ns;break ;case PR_SET_TIMERSLACK : +if (task_is_realtime (current)) +break ;if (arg2 <=0 ) current->timer_slack_ns = current->default_timer_slack_ns;
kernel/time/hrtimer.c +3 -15
@@ -2093,14 +2093,9 @@ long hrtimer_nanosleep(ktime_t rqtp, construct restart_block *restart;struct hrtimer_sleeper t;int ret =0 ; -u64 slack; - - slack = current->timer_slack_ns; -if (rt_task (current)) - slack =0 ;hrtimer_init_sleeper_on_stack (&t, clockid, mode); -hrtimer_set_expires_range_ns (&t.timer, rqtp, slack); +hrtimer_set_expires_range_ns (&t.timer, rqtp, current->timer_slack_ns); ret =do_nanosleep (&t, mode);if (ret != -ERESTART_RESTARTBLOCK ) goto out;
@@ -2281,7 +2276,7 @@ void __init hrtimers_init(void)/** * schedule_hrtimeout_range_clock - sleep until timeout * @expires: timeout value (ktime_t) -* @delta: slack in expires timeout (ktime_t) for SCHED_OTHER tasks +* @delta: slack in expires timeout (ktime_t) * @mode: timer mode * @clock_id: timer clock to be used */
@@ -2308,13 +2303,6 @@ schedule_hrtimeout_range_clock(ktime_t *return -EINTR ; } -/* -* Override any slack passed by the user if under -* rt contraints. -*/ -if (rt_task (current)) - delta =0 ; -hrtimer_init_sleeper_on_stack (&t, clock_id, mode);hrtimer_set_expires_range_ns (&t.timer, *expires, delta);hrtimer_sleeper_start_expires (&t, mode);
@@ -2334,7 +2322,7 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_ran/** * schedule_hrtimeout_range - sleep until timeout * @expires: timeout value (ktime_t) -* @delta: slack in expires timeout (ktime_t) for SCHED_OTHER tasks +* @delta: slack in expires timeout (ktime_t) * @mode: timer mode * * Make the current task sleep until the given expiry time has
Greg Kroah-Hartman
maintainerPATCH 5/166 bpf: Use raw_spinlock_t in ringbuf
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wander Lairson Costa <[email protected]>
commit 8b62645b09f870d70c7910e7550289d444239a46 upstream.
The function __bpf_ringbuf_reserve is invoked from a tracepoint, which disables preemption. Using spinlock_t in this context can lead to a "sleep in atomic" warning in the RT variant. This issue is illustrated in the example below:
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 556208, name: test_progspreempt_count: 1, expected: 0
RCU nest depth: 1, expected: 1
INFO: lockdep is turned off.
Preemption disabled at:
[<ffffd33a5c88ea44>] migrate_enable+0xc0/0x39c CPU: 7 PID: 556208 Comm: test_progs Tainted: G Hardware name: Qualcomm SA8775P Ride (DT) Call trace: dump_backtrace+0xac/0x130 show_stack+0x1c/0x30 dump_stack_lvl+0xac/0xe8 dump_stack+0x18/0x30 __might_resched+0x3bc/0x4fc rt_spin_lock+0x8c/0x1a4 __bpf_ringbuf_reserve+0xc4/0x254 bpf_ringbuf_reserve_dynptr+0x5c/0xdc bpf_prog_ac3d15160d62622a_test_read_write+0x104/0x238 trace_call_bpf+0x238/0x774 perf_call_bpf_enter.isra.0+0x104/0x194 perf_syscall_enter+0x2f8/0x510 trace_sys_enter+0x39c/0x564 syscall_trace_enter+0x220/0x3c0 do_el0_svc+0x138/0x1dc el0_svc+0x54/0x130 el0t_64_sync_handler+0x134/0x150 el0t_64_sync+0x17c/0x180
Switch the spinlock to raw_spinlock_t to avoid this error.
--- kernel/bpf/ringbuf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
kernel/bpf/ringbuf.c +6 -6
@@ -29,7 +29,7 @@ struct bpf_ringbuf {u64 mask;struct page **pages;int nr_pages; -spinlock_t spinlock____cacheline_aligned_in_smp ; +raw_spinlock_t spinlock____cacheline_aligned_in_smp ;/* For user-space producer ring buffers, an atomic_t busy bit is used * to synchronize access to the ring buffers in the kernel, rather than * the spinlock that is used for kernel-producer ring buffers. This is
@@ -173,7 +173,7 @@ static struct bpf_ringbuf *bpf_ringbuf_aif (!rb)return NULL ; -spin_lock_init (&rb->spinlock); +raw_spin_lock_init (&rb->spinlock);atomic_set (&rb->busy,0 );init_waitqueue_head (&rb->waitq);init_irq_work (&rb->work, bpf_ringbuf_notify);
@@ -417,10 +417,10 @@ static void *__bpf_ringbuf_reserve(struc cons_pos =smp_load_acquire (&rb->consumer_pos);if (in_nmi ()) { -if (!spin_trylock_irqsave (&rb->spinlock, flags)) +if (!raw_spin_trylock_irqsave (&rb->spinlock, flags))return NULL ; }else { -spin_lock_irqsave (&rb->spinlock, flags); +raw_spin_lock_irqsave (&rb->spinlock, flags); } pend_pos = rb->pending_pos;
@@ -446,7 +446,7 @@ static void *__bpf_ringbuf_reserve(struc*/ if (new_prod_pos - cons_pos > rb->mask || new_prod_pos - pend_pos > rb->mask) { -spin_unlock_irqrestore (&rb->spinlock, flags); +raw_spin_unlock_irqrestore (&rb->spinlock, flags);return NULL ; }
@@ -458,7 +458,7 @@ static void *__bpf_ringbuf_reserve(struc/* pairs with consumer's smp_load_acquire() */ smp_store_release (&rb->producer_pos, new_prod_pos); -spin_unlock_irqrestore (&rb->spinlock, flags); +raw_spin_unlock_irqrestore (&rb->spinlock, flags);return (void *)hdr +BPF_RINGBUF_HDR_SZ ; }
Greg Kroah-Hartman
maintainerPATCH 6/166 tcp: fix races in tcp_abort()
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 5ce4645c23cf5f048eb8e9ce49e514bababdee85 upstream.
tcp_abort() has the same issue than the one fixed in the prior patch in tcp_write_err().
In order to get consistent results from tcp_poll(), we must call sk_error_report() after tcp_done().
We can use tcp_done_with_error() to centralize this logic.
--- net/ipv4/tcp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
net/ipv4/tcp.c +1 -5
@@ -4630,13 +4630,9 @@ int tcp_abort(struct sock *sk, int err)bh_lock_sock (sk);if (!sock_flag (sk,SOCK_DEAD )) { -WRITE_ONCE (sk->sk_err, err); -/* This barrier is coupled with smp_rmb() in tcp_poll() */ -smp_wmb (); -sk_error_report (sk);if (tcp_need_reset (sk->sk_state))tcp_send_active_reset (sk,GFP_ATOMIC ); -tcp_done (sk); +tcp_done_with_error (sk, err); }bh_unlock_sock (sk);
Greg Kroah-Hartman
maintainerPATCH 7/166 tcp: fix forever orphan socket caused by tcp_abort
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueming Feng <[email protected]>
commit bac76cf89816bff06c4ec2f3df97dc34e150a1c4 upstream.
We have some problem closing zero-window fin-wait-1 tcp sockets in our environment. This patch come from the investigation.
Previously tcp_abort only sends out reset and calls tcp_done when the socket is not SOCK_DEAD, aka orphan. For orphan socket, it will only purging the write queue, but not close the socket and left it to the timer.
While purging the write queue, tp->packets_out and sk->sk_write_queue is cleared along the way. However tcp_retransmit_timer have early return based on !tp->packets_out and tcp_probe_timer have early return based on !sk->sk_write_queue.
This caused ICSK_TIME_RETRANS and ICSK_TIME_PROBE0 not being resched and socket not being killed by the timers, converting a zero-windowed orphan into a forever orphan.
This patch removes the SOCK_DEAD check in tcp_abort, making it send reset to peer and close the socket accordingly. Preventing the timer-less orphan from happening.
According to Lorenzo's email in the v1 thread, the check was there to prevent force-closing the same socket twice. That situation is handled by testing for TCP_CLOSE inside lock, and returning -ENOENT if it is already closed.
The -ENOENT code comes from the associate patch Lorenzo made for iproute2-ss; link attached below, which also conform to RFC 9293.
At the end of the patch, tcp_write_queue_purge(sk) is removed because it was already called in tcp_done_with_error().
p.s. This is the same patch with v2. Resent due to mis-labeled "changes requested" on patchwork.kernel.org.
--- net/ipv4/tcp.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
net/ipv4/tcp.c +10 -6
@@ -4620,6 +4620,13 @@ int tcp_abort(struct sock *sk, int err)/* Don't race with userspace socket closes such as tcp_close. */ lock_sock (sk); +/* Avoid closing the same socket twice. */ +if (sk->sk_state ==TCP_CLOSE ) { +if (!has_current_bpf_ctx ()) +release_sock (sk); +return -ENOENT ; + } +if (sk->sk_state ==TCP_LISTEN ) {tcp_set_state (sk,TCP_CLOSE );inet_csk_listen_stop (sk);
@@ -4629,15 +4636,12 @@ int tcp_abort(struct sock *sk, int err)local_bh_disable ();bh_lock_sock (sk); -if (!sock_flag (sk,SOCK_DEAD )) { -if (tcp_need_reset (sk->sk_state)) -tcp_send_active_reset (sk,GFP_ATOMIC ); -tcp_done_with_error (sk, err); - } +if (tcp_need_reset (sk->sk_state)) +tcp_send_active_reset (sk,GFP_ATOMIC ); +tcp_done_with_error (sk, err);bh_unlock_sock (sk);local_bh_enable (); -tcp_write_queue_purge (sk);if (!has_current_bpf_ctx ())release_sock (sk);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 8/166 fbdev: hyperv_fb: iounmap() the correct memory when removing a device
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <[email protected]>
[ Upstream commit 7241c886a71797cc51efc6fadec7076fcf6435c2 ]
When a Hyper-V framebuffer device is removed, or the driver is unbound from a device, any allocated and/or mapped memory must be released. In particular, MMIO address space that was mapped to the framebuffer must be unmapped. Current code unmaps the wrong address, resulting in an error like:
[ 4093.980597] iounmap: bad address 00000000c936c05c
followed by a stack dump.
Commit d21987d709e8 ("video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver") changed the kind of address stored in info->screen_base, and the iounmap() call in hvfb_putmem() was not updated accordingly.
Fix this by updating hvfb_putmem() to unmap the correct address.
Message-ID: <[email protected]>
--- drivers/video/fbdev/hyperv_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/hyperv_fb.c +1 -1
@@ -1106,7 +1106,7 @@ static void hvfb_putmem(struct hv_device *hdev, struct fb_info *info)if (par->need_docopy) {vfree (par->dio_vp); -iounmap (info->screen_base); +iounmap (par->mmio_vp);vmbus_free_mmio (par->mem->start, screen_fb_size); }else { hvfb_release_phymem(hdev, info->fix.smem_start,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 9/166 pinctrl: bcm281xx: Fix incorrect regmap max_registers value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artur Weber <[email protected]>
[ Upstream commit 68283c1cb573143c0b7515e93206f3503616bc10 ]
The max_registers value does not take into consideration the stride; currently, it's set to the number of the last pin, but this does not accurately represent the final register.
Fix this by multiplying the current value by 4.
--- drivers/pinctrl/bcm/pinctrl-bcm281xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/bcm/pinctrl-bcm281xx.c +1 -1
@@ -974,7 +974,7 @@ static const struct regmap_config bcm281xx_pinctrl_regmap_config = { .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = BCM281XX_PIN_VC_CAM3_SDA, + .max_register = BCM281XX_PIN_VC_CAM3_SDA * 4, };static int bcm281xx_pinctrl_get_groups_count (struct pinctrl_dev *pctldev)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 10/166 netfilter: nft_ct: Use __refcount_inc() for per-CPU nft_ct_pcpu_template.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit 5cfe5612ca9590db69b9be29dc83041dbf001108 ]
nft_ct_pcpu_template is a per-CPU variable and relies on disabled BH for its locking. The refcounter is read and if its value is set to one then the refcounter is incremented and variable is used - otherwise it is already in use and left untouched.
Without per-CPU locking in local_bh_disable() on PREEMPT_RT the read-then-increment operation is not atomic and therefore racy.
This can be avoided by using unconditionally __refcount_inc() which will increment counter and return the old value as an atomic operation. In case the returned counter is not one, the variable is in use and we need to decrement counter. Otherwise we can use it.
Use __refcount_inc() instead of read and a conditional increment.
--- net/netfilter/nft_ct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/netfilter/nft_ct.c +4 -2
@@ -230,6 +230,7 @@ static void nft_ct_set_zone_eval(const struct nft_expr *expr,enum ip_conntrack_info ctinfo;u16 value =nft_reg_load16 (®s->data[priv->sreg]);struct nf_conn *ct; +int oldcnt; ct =nf_ct_get (skb, &ctinfo);if (ct)/* already tracked */
@@ -250,10 +251,11 @@ static void nft_ct_set_zone_eval(const struct nft_expr *expr, ct =this_cpu_read (nft_ct_pcpu_template); -if (likely (refcount_read (&ct->ct_general.use) ==1 )) { -refcount_inc (&ct->ct_general.use); +__refcount_inc (&ct->ct_general.use, &oldcnt); +if (likely (oldcnt ==1 )) {nf_ct_zone_add (ct, &zone); }else { +refcount_dec (&ct->ct_general.use);/* previous skb got queued to userspace, allocate temporary * one until percpu template can be reused. */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 11/166 ice: fix memory leak in aRFS after reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Grzegorz Nitka <[email protected]>
[ Upstream commit 23d97f18901ef5e4e264e3b1777fe65c760186b5 ]
Fix aRFS (accelerated Receive Flow Steering) structures memory leak by adding a checker to verify if aRFS memory is already allocated while configuring VSI. aRFS objects are allocated in two cases:
- as part of VSI initialization (at probe), and
- as part of reset handling
However, VSI reconfiguration executed during reset involves memory allocation one more time, without prior releasing already allocated resources. This led to the memory leak with the following signature:
[root@os-delivery ~]# cat /sys/kernel/debug/kmemleak unreferenced object 0xff3c1ca7252e6000 (size 8192):
comm "kworker/0:0", pid 8, jiffies 4296833052 hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 0):
[<ffffffff991ec485>] __kmalloc_cache_noprof+0x275/0x340
[<ffffffffc0a6e06a>] ice_init_arfs+0x3a/0xe0 [ice]
[<ffffffffc09f1027>] ice_vsi_cfg_def+0x607/0x850 [ice]
[<ffffffffc09f244b>] ice_vsi_setup+0x5b/0x130 [ice]
[<ffffffffc09c2131>] ice_init+0x1c1/0x460 [ice]
[<ffffffffc09c64af>] ice_probe+0x2af/0x520 [ice]
[<ffffffff994fbcd3>] local_pci_probe+0x43/0xa0
[<ffffffff98f07103>] work_for_cpu_fn+0x13/0x20
[<ffffffff98f0b6d9>] process_one_work+0x179/0x390
[<ffffffff98f0c1e9>] worker_thread+0x239/0x340
[<ffffffff98f14abc>] kthread+0xcc/0x100
[<ffffffff98e45a6d>] ret_from_fork+0x2d/0x50
[<ffffffff98e083ba>] ret_from_fork_asm+0x1a/0x30
...--- drivers/net/ethernet/intel/ice/ice_arfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_arfs.c +1 -1
@@ -510,7 +510,7 @@ void ice_init_arfs(struct ice_vsi *vsi)struct hlist_head *arfs_fltr_list;unsigned int i; -if (!vsi || vsi->type !=ICE_VSI_PF ) +if (!vsi || vsi->type !=ICE_VSI_PF ||ice_is_arfs_active (vsi))return ; arfs_fltr_list = kcalloc(ICE_MAX_ARFS_LIST, sizeof(*arfs_fltr_list),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 12/166 netfilter: nf_conncount: garbage collection is not skipped when jiffies wrap around
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicklas Bo Jensen <[email protected]>
[ Upstream commit df08c94baafb001de6cf44bb7098bb557f36c335 ]
nf_conncount is supposed to skip garbage collection if it has already run garbage collection in the same jiffy. Unfortunately, this is broken when jiffies wrap around which this patch fixes.
The problem is that last_gc in the nf_conncount_list struct is an u32, but jiffies is an unsigned long which is 8 bytes on my systems. When those two are compared it only works until last_gc wraps around.
See bug report: https://bugzilla.netfilter.org/show_bug.cgi?id=1778
for more details.
--- net/netfilter/nf_conncount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conncount.c +2 -2
@@ -132,7 +132,7 @@ static int __nf_conncount_add(struct net *net,struct nf_conn *found_ct;unsigned int collect =0 ; -if (time_is_after_eq_jiffies ((unsigned long )list->last_gc)) +if ((u32 )jiffies == list->last_gc) goto add_new_node;/* check the saved connections */
@@ -234,7 +234,7 @@ bool nf_conncount_gc_list(struct net *net,bool ret = false;/* don't bother if we just did GC */ -if (time_is_after_eq_jiffies ((unsigned long )READ_ONCE (list->last_gc))) +if ((u32 )jiffies ==READ_ONCE (list->last_gc))return false;/* don't bother if other cpu is already doing GC */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 13/166 sched: address a potential NULL pointer dereference in the GRED scheduler.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jun Yang <[email protected]>
[ Upstream commit 115ef44a98220fddfab37a39a19370497cd718b9 ]
If kzalloc in gred_init returns a NULL pointer, the code follows the error handling path, invoking gred_destroy. This, in turn, calls gred_offload, where memset could receive a NULL pointer as input, potentially leading to a kernel crash.
When table->opt is NULL in gred_init(), gred_change_table_def() is not called yet, so it is not necessary to call ->ndo_setup_tc() in gred_offload().
--- net/sched/sch_gred.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/sch_gred.c +2 -1
@@ -913,7 +913,8 @@ static void gred_destroy(struct Qdisc *sch)for (i =0 ; i < table->DPs; i++)gred_destroy_vq (table->tab[i]); -gred_offload (sch,TC_GRED_DESTROY ); +if (table->opt) +gred_offload (sch,TC_GRED_DESTROY );kfree (table->opt); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 14/166 wifi: cfg80211: cancel wiphy_work before freeing wiphy
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miri Korenblit <[email protected]>
[ Upstream commit 72d520476a2fab6f3489e8388ab524985d6c4b90 ]
A wiphy_work can be queued from the moment the wiphy is allocated and initialized (i.e. wiphy_new_nm). When a wiphy_work is queued, the rdev::wiphy_work is getting queued.
If wiphy_free is called before the rdev::wiphy_work had a chance to run, the wiphy memory will be freed, and then when it eventally gets to run it'll use invalid memory.
Fix this by canceling the work before freeing the wiphy.
--- net/wireless/core.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/wireless/core.c +7 -0
@@ -1151,6 +1151,13 @@ void cfg80211_dev_free(struct cfg80211_registered_device *rdev) {struct cfg80211_internal_bss *scan, *tmp;struct cfg80211_beacon_registration *reg, *treg; +unsigned long flags; + +spin_lock_irqsave (&rdev->wiphy_work_lock, flags); +WARN_ON (!list_empty (&rdev->wiphy_work_list)); +spin_unlock_irqrestore (&rdev->wiphy_work_lock, flags); +cancel_work_sync (&rdev->wiphy_work); +rfkill_destroy (rdev->wiphy.rfkill);list_for_each_entry_safe (reg, treg, &rdev->beacon_registrations, list) {list_del (®->list);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 15/166 Bluetooth: hci_event: Fix enabling passive scanning
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 0bdd88971519cfa8a76d1a4dde182e74cfbd5d5c ]
Passive scanning shall only be enabled when disconnecting LE links, otherwise it may start result in triggering scanning when e.g. an ISO link disconnects:
Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 29
LE Connected Isochronous Stream Established (0x19)
Status: Success (0x00)
Connection Handle: 257
CIG Synchronization Delay: 0 us (0x000000)
CIS Synchronization Delay: 0 us (0x000000)
Central to Peripheral Latency: 10000 us (0x002710)
Peripheral to Central Latency: 10000 us (0x002710)
Central to Peripheral PHY: LE 2M (0x02)
Peripheral to Central PHY: LE 2M (0x02)
Number of Subevents: 1
Central to Peripheral Burst Number: 1
Peripheral to Central Burst Number: 1
Central to Peripheral Flush Timeout: 2
Peripheral to Central Flush Timeout: 2
Central to Peripheral MTU: 320
Peripheral to Central MTU: 160
ISO Interval: 10.00 msec (0x0008)...
Quoted 1 line
HCI Event: Disconnect Complete (
0x05) plen 4
Status: Success (0x00)
Handle: 257
Reason: Remote User Terminated Connection (0x13)
< HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6
Extended scan: Enabled (0x01)
Filter duplicates: Enabled (0x01)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)--- net/bluetooth/hci_event.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-)
net/bluetooth/hci_event.c +22 -15
@@ -3394,23 +3394,30 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,hci_update_scan (hdev); } - params =hci_conn_params_lookup (hdev, &conn->dst, conn->dst_type); -if (params) { -switch (params->auto_connect) { -case HCI_AUTO_CONN_LINK_LOSS : -if (ev->reason !=HCI_ERROR_CONNECTION_TIMEOUT ) +/* Re-enable passive scanning if disconnected device is marked +* as auto-connectable. +*/ +if (conn->type ==LE_LINK ) { + params =hci_conn_params_lookup (hdev, &conn->dst, + conn->dst_type); +if (params) { +switch (params->auto_connect) { +case HCI_AUTO_CONN_LINK_LOSS : +if (ev->reason !=HCI_ERROR_CONNECTION_TIMEOUT ) +break ; + fallthrough; + +case HCI_AUTO_CONN_DIRECT : +case HCI_AUTO_CONN_ALWAYS : +hci_pend_le_list_del_init (params); +hci_pend_le_list_add (params, + &hdev->pend_le_conns); +hci_update_passive_scan (hdev);break ; - fallthrough; -case HCI_AUTO_CONN_DIRECT : -case HCI_AUTO_CONN_ALWAYS : -hci_pend_le_list_del_init (params); -hci_pend_le_list_add (params, &hdev->pend_le_conns); -hci_update_passive_scan (hdev); -break ; - -default : -break ; +default : +break ; + } } }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 16/166 Revert "Bluetooth: hci_core: Fix sleeping function called from invalid context"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit ab6ab707a4d060a51c45fc13e3b2228d5f7c0b87 ]
This reverts commit 4d94f05558271654670d18c26c912da0c1c15549 which has problems (see [1]) and is no longer needed since 581dd2dc168f ("Bluetooth: hci_event: Fix using rcu_read_(un)lock while iterating") has reworked the code where the original bug has been found.
[1] Link: https://lore.kernel.org/linux-bluetooth/[email protected]/T/#t
--- include/net/bluetooth/hci_core.h | 108 +++++++++++-------------------- net/bluetooth/hci_core.c | 10 ++- net/bluetooth/iso.c | 6 -- net/bluetooth/l2cap_core.c | 12 ++-- net/bluetooth/rfcomm/core.c | 6 -- net/bluetooth/sco.c | 12 ++-- 6 files changed, 57 insertions(+), 97 deletions(-)
include/net/bluetooth/hci_core.h +38 -70
@@ -800,6 +800,7 @@ struct hci_conn_params {extern struct list_head hci_dev_list;extern struct list_head hci_cb_list;extern rwlock_t hci_dev_list_lock; +extern struct mutex hci_cb_list_lock;#define hci_dev_set_flag (hdev, nr) set_bit((nr), (hdev)->dev_flags)#define hci_dev_clear_flag (hdev, nr) clear_bit((nr), (hdev)->dev_flags)
@@ -1948,47 +1949,24 @@ struct hci_cb {char *name; -bool (*match) (struct hci_conn *conn);void (*connect_cfm) (struct hci_conn *conn,__u8 status);void (*disconn_cfm) (struct hci_conn *conn,__u8 status);void (*security_cfm) (struct hci_conn *conn,__u8 status, -__u8 encrypt); +__u8 encrypt);void (*key_change_cfm) (struct hci_conn *conn,__u8 status);void (*role_switch_cfm) (struct hci_conn *conn,__u8 status,__u8 role); }; -static inline void hci_cb_lookup (struct hci_conn *conn,struct list_head *list) -{ -struct hci_cb *cb, *cpy; - -rcu_read_lock (); -list_for_each_entry_rcu (cb, &hci_cb_list, list) { -if (cb->match && cb->match (conn)) { - cpy =kmalloc (sizeof (*cpy),GFP_ATOMIC ); -if (!cpy) -break ; - - *cpy = *cb; -INIT_LIST_HEAD (&cpy->list); -list_add_rcu (&cpy->list, list); - } - } -rcu_read_unlock (); -} -static inline void hci_connect_cfm (struct hci_conn *conn,__u8 status) { -struct list_head list; -struct hci_cb *cb, *tmp; - -INIT_LIST_HEAD (&list); -hci_cb_lookup (conn, &list); +struct hci_cb *cb; -list_for_each_entry_safe (cb, tmp, &list, list) { +mutex_lock (&hci_cb_list_lock); +list_for_each_entry (cb, &hci_cb_list, list) {if (cb->connect_cfm) cb->connect_cfm (conn, status); -kfree (cb); } +mutex_unlock (&hci_cb_list_lock);if (conn->connect_cfm_cb) conn->connect_cfm_cb (conn, status);
@@ -1996,43 +1974,22 @@ static inline void hci_connect_cfm(struct hci_conn *conn, __u8 status)static inline void hci_disconn_cfm (struct hci_conn *conn,__u8 reason) { -struct list_head list; -struct hci_cb *cb, *tmp; - -INIT_LIST_HEAD (&list); -hci_cb_lookup (conn, &list); +struct hci_cb *cb; -list_for_each_entry_safe (cb, tmp, &list, list) { +mutex_lock (&hci_cb_list_lock); +list_for_each_entry (cb, &hci_cb_list, list) {if (cb->disconn_cfm) cb->disconn_cfm (conn, reason); -kfree (cb); } +mutex_unlock (&hci_cb_list_lock);if (conn->disconn_cfm_cb) conn->disconn_cfm_cb (conn, reason); } -static inline void hci_security_cfm (struct hci_conn *conn,__u8 status, -__u8 encrypt) -{ -struct list_head list; -struct hci_cb *cb, *tmp; - -INIT_LIST_HEAD (&list); -hci_cb_lookup (conn, &list); - -list_for_each_entry_safe (cb, tmp, &list, list) { -if (cb->security_cfm) - cb->security_cfm (conn, status, encrypt); -kfree (cb); - } - -if (conn->security_cfm_cb) - conn->security_cfm_cb (conn, status); -} -static inline void hci_auth_cfm (struct hci_conn *conn,__u8 status) { +struct hci_cb *cb;__u8 encrypt;if (test_bit (HCI_CONN_ENCRYPT_PEND , &conn->flags))
@@ -2040,11 +1997,20 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) encrypt =test_bit (HCI_CONN_ENCRYPT , &conn->flags) ?0x01 :0x00 ; -hci_security_cfm (conn, status, encrypt); +mutex_lock (&hci_cb_list_lock); +list_for_each_entry (cb, &hci_cb_list, list) { +if (cb->security_cfm) + cb->security_cfm (conn, status, encrypt); + } +mutex_unlock (&hci_cb_list_lock); + +if (conn->security_cfm_cb) + conn->security_cfm_cb (conn, status); }static inline void hci_encrypt_cfm (struct hci_conn *conn,__u8 status) { +struct hci_cb *cb;__u8 encrypt;if (conn->state ==BT_CONFIG ) {
@@ -2071,38 +2037,40 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status) conn->sec_level = conn->pending_sec_level; } -hci_security_cfm (conn, status, encrypt); +mutex_lock (&hci_cb_list_lock); +list_for_each_entry (cb, &hci_cb_list, list) { +if (cb->security_cfm) + cb->security_cfm (conn, status, encrypt); + } +mutex_unlock (&hci_cb_list_lock); + +if (conn->security_cfm_cb) + conn->security_cfm_cb (conn, status); }static inline void hci_key_change_cfm (struct hci_conn *conn,__u8 status) { -struct list_head list; -struct hci_cb *cb, *tmp; - -INIT_LIST_HEAD (&list); -hci_cb_lookup (conn, &list); +struct hci_cb *cb; -list_for_each_entry_safe (cb, tmp, &list, list) { +mutex_lock (&hci_cb_list_lock); +list_for_each_entry (cb, &hci_cb_list, list) {if (cb->key_change_cfm) cb->key_change_cfm (conn, status); -kfree (cb); } +mutex_unlock (&hci_cb_list_lock); }static inline void hci_role_switch_cfm (struct hci_conn *conn,__u8 status,__u8 role) { -struct list_head list; -struct hci_cb *cb, *tmp; - -INIT_LIST_HEAD (&list); -hci_cb_lookup (conn, &list); +struct hci_cb *cb; -list_for_each_entry_safe (cb, tmp, &list, list) { +mutex_lock (&hci_cb_list_lock); +list_for_each_entry (cb, &hci_cb_list, list) {if (cb->role_switch_cfm) cb->role_switch_cfm (conn, status, role); -kfree (cb); } +mutex_unlock (&hci_cb_list_lock); }static inline bool hci_bdaddr_is_rpa (bdaddr_t *bdaddr,u8 addr_type)
net/bluetooth/hci_core.c +7 -3
@@ -58,6 +58,7 @@ DEFINE_RWLOCK(hci_dev_list_lock);/* HCI callback list */ LIST_HEAD (hci_cb_list); +DEFINE_MUTEX (hci_cb_list_lock);/* HCI ID Numbering */ static DEFINE_IDA (hci_index_ida);
@@ -2956,7 +2957,9 @@ int hci_register_cb(struct hci_cb *cb) {BT_DBG ("%p name %s" , cb, cb->name); -list_add_tail_rcu (&cb->list, &hci_cb_list); +mutex_lock (&hci_cb_list_lock); +list_add_tail (&cb->list, &hci_cb_list); +mutex_unlock (&hci_cb_list_lock);return 0 ; }
@@ -2966,8 +2969,9 @@ int hci_unregister_cb(struct hci_cb *cb) {BT_DBG ("%p name %s" , cb, cb->name); -list_del_rcu (&cb->list); -synchronize_rcu (); +mutex_lock (&hci_cb_list_lock); +list_del (&cb->list); +mutex_unlock (&hci_cb_list_lock);return 0 ; }
net/bluetooth/iso.c +0 -6
@@ -1929,11 +1929,6 @@ int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags)return lm; } -static bool iso_match (struct hci_conn *hcon) -{ -return hcon->type ==ISO_LINK || hcon->type ==LE_LINK ; -} -static void iso_connect_cfm (struct hci_conn *hcon,__u8 status) {if (hcon->type !=ISO_LINK ) {
@@ -2115,7 +2110,6 @@ void iso_recv(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)static struct hci_cb iso_cb = { .name ="ISO" , - .match = iso_match, .connect_cfm = iso_connect_cfm, .disconn_cfm = iso_disconn_cfm, };
net/bluetooth/l2cap_core.c +6 -6
@@ -7228,11 +7228,6 @@ static struct l2cap_chan *l2cap_global_fixed_chan(struct l2cap_chan *c,return NULL ; } -static bool l2cap_match (struct hci_conn *hcon) -{ -return hcon->type ==ACL_LINK || hcon->type ==LE_LINK ; -} -static void l2cap_connect_cfm (struct hci_conn *hcon,u8 status) {struct hci_dev *hdev = hcon->hdev;
@@ -7240,6 +7235,9 @@ static void l2cap_connect_cfm(struct hci_conn *hcon, u8 status)struct l2cap_chan *pchan;u8 dst_type; +if (hcon->type !=ACL_LINK && hcon->type !=LE_LINK ) +return ; +BT_DBG ("hcon %p bdaddr %pMR status %d" , hcon, &hcon->dst, status);if (status) {
@@ -7304,6 +7302,9 @@ int l2cap_disconn_ind(struct hci_conn *hcon)static void l2cap_disconn_cfm (struct hci_conn *hcon,u8 reason) { +if (hcon->type !=ACL_LINK && hcon->type !=LE_LINK ) +return ; +BT_DBG ("hcon %p reason %d" , hcon, reason);l2cap_conn_del (hcon,bt_to_errno (reason));
@@ -7582,7 +7583,6 @@ void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)static struct hci_cb l2cap_cb = { .name ="L2CAP" , - .match = l2cap_match, .connect_cfm = l2cap_connect_cfm, .disconn_cfm = l2cap_disconn_cfm, .security_cfm = l2cap_security_cfm,
net/bluetooth/rfcomm/core.c +0 -6
@@ -2134,11 +2134,6 @@ static int rfcomm_run(void *unused)return 0 ; } -static bool rfcomm_match (struct hci_conn *hcon) -{ -return hcon->type ==ACL_LINK ; -} -static void rfcomm_security_cfm (struct hci_conn *conn,u8 status,u8 encrypt) {struct rfcomm_session *s;
@@ -2185,7 +2180,6 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt)static struct hci_cb rfcomm_cb = { .name ="RFCOMM" , - .match = rfcomm_match, .security_cfm = rfcomm_security_cfm };
net/bluetooth/sco.c +6 -6
@@ -1353,13 +1353,11 @@ int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags)return lm; } -static bool sco_match (struct hci_conn *hcon) -{ -return hcon->type ==SCO_LINK || hcon->type ==ESCO_LINK ; -} -static void sco_connect_cfm (struct hci_conn *hcon,__u8 status) { +if (hcon->type !=SCO_LINK && hcon->type !=ESCO_LINK ) +return ; +BT_DBG ("hcon %p bdaddr %pMR status %u" , hcon, &hcon->dst, status);if (!status) {
@@ -1374,6 +1372,9 @@ static void sco_connect_cfm(struct hci_conn *hcon, __u8 status)static void sco_disconn_cfm (struct hci_conn *hcon,__u8 reason) { +if (hcon->type !=SCO_LINK && hcon->type !=ESCO_LINK ) +return ; +BT_DBG ("hcon %p reason %d" , hcon, reason);sco_conn_del (hcon,bt_to_errno (reason));
@@ -1399,7 +1400,6 @@ void sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)static struct hci_cb sco_cb = { .name ="SCO" , - .match = sco_match, .connect_cfm = sco_connect_cfm, .disconn_cfm = sco_disconn_cfm, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/166 net/mlx5: Fill out devlink dev info only for PFs
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Pirko <[email protected]>
[ Upstream commit d749d901b2168389f060b654fdaa08acf6b367d2 ]
Firmware version query is supported on the PFs. Due to this following kernel warning log is observed:
[ 188.590344] mlx5_core 0000:08:00.2: mlx5_fw_version_query:816:(pid 1453): fw query isn't supported by the FW
Fix it by restricting the query and devlink info to the PF.
--- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +3 -0
@@ -46,6 +46,9 @@ mlx5_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,u32 running_fw, stored_fw;int err; +if (!mlx5_core_is_pf (dev)) +return 0 ; + err =devlink_info_version_fixed_put (req,"fw.psid" , dev->board_id);if (err)return err;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/166 net: dsa: mv88e6xxx: Verify after ATU Load ops
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Huang <[email protected]>
[ Upstream commit dc5340c3133a3ebe54853fd299116149e528cfaa ]
ATU Load operations could fail silently if there's not enough space on the device to hold the new entry. When this happens, the symptom depends on the unknown flood settings. If unknown multicast flood is disabled, the multicast packets are dropped when the ATU table is full. If unknown multicast flood is enabled, the multicast packets will be flooded to all ports. Either way, IGMP snooping is broken when the ATU Load operation fails silently.
Do a Read-After-Write verification after each fdb/mdb add operation to make sure that the operation was really successful, and return -ENOSPC otherwise.
--- drivers/net/dsa/mv88e6xxx/chip.c | 59 ++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 11 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +48 -11
@@ -2125,13 +2125,11 @@ mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,return err; } -static int mv88e6xxx_port_db_load_purge (struct mv88e6xxx_chip *chip,int port, -const unsigned char *addr,u16 vid, -u8 state) +static int mv88e6xxx_port_db_get (struct mv88e6xxx_chip *chip, +const unsigned char *addr,u16 vid, +u16 *fid,struct mv88e6xxx_atu_entry *entry) { -struct mv88e6xxx_atu_entry entry;struct mv88e6xxx_vtu_entry vlan; -u16 fid;int err;/* Ports have two private address databases: one for when the port is
@@ -2142,7 +2140,7 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,* VLAN ID into the port's database used for VLAN-unaware bridging. */ if (vid ==0 ) { - fid =MV88E6XXX_FID_BRIDGED ; + *fid =MV88E6XXX_FID_BRIDGED ; }else { err =mv88e6xxx_vtu_get (chip, vid, &vlan);if (err)
@@ -2152,14 +2150,39 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port,if (!vlan.valid)return -EOPNOTSUPP ; - fid = vlan.fid; + *fid = vlan.fid; } - entry.state =0 ; -ether_addr_copy (entry.mac, addr); -eth_addr_dec (entry.mac); + entry->state =0 ; +ether_addr_copy (entry->mac, addr); +eth_addr_dec (entry->mac); + +return mv88e6xxx_g1_atu_getnext (chip, *fid, entry); +} + +static bool mv88e6xxx_port_db_find (struct mv88e6xxx_chip *chip, +const unsigned char *addr,u16 vid) +{ +struct mv88e6xxx_atu_entry entry; +u16 fid; +int err; - err =mv88e6xxx_g1_atu_getnext (chip, fid, &entry); + err =mv88e6xxx_port_db_get (chip, addr, vid, &fid, &entry); +if (err) +return false; + +return entry.state &ðer_addr_equal (entry.mac, addr); +} + +static int mv88e6xxx_port_db_load_purge (struct mv88e6xxx_chip *chip,int port, +const unsigned char *addr,u16 vid, +u8 state) +{ +struct mv88e6xxx_atu_entry entry; +u16 fid; +int err; + + err =mv88e6xxx_port_db_get (chip, addr, vid, &fid, &entry);if (err)return err;
@@ -2757,6 +2780,13 @@ static int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port,mv88e6xxx_reg_lock (chip); err =mv88e6xxx_port_db_load_purge (chip, port, addr, vid,MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC ); +if (err) + goto out; + +if (!mv88e6xxx_port_db_find (chip, addr, vid)) + err = -ENOSPC ; + +out:mv88e6xxx_reg_unlock (chip);return err;
@@ -6454,6 +6484,13 @@ static int mv88e6xxx_port_mdb_add(struct dsa_switch *ds, int port,mv88e6xxx_reg_lock (chip); err =mv88e6xxx_port_db_load_purge (chip, port, mdb->addr, mdb->vid,MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC ); +if (err) + goto out; + +if (!mv88e6xxx_port_db_find (chip, mdb->addr, mdb->vid)) + err = -ENOSPC ; + +out:mv88e6xxx_reg_unlock (chip);return err;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/166 net: mctp i2c: Copy headers if cloned
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Johnston <[email protected]>
[ Upstream commit df8ce77ba8b7c012a3edd1ca7368b46831341466 ]
Use skb_cow_head() prior to modifying the TX SKB. This is necessary when the SKB has been cloned, to avoid modifying other shared clones.
--- drivers/net/mctp/mctp-i2c.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/mctp/mctp-i2c.c +5 -0
@@ -543,6 +543,7 @@ static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev,struct mctp_i2c_hdr *hdr;struct mctp_hdr *mhdr;u8 lldst, llsrc; +int rc;if (len >MCTP_I2C_MAXMTU )return -EMSGSIZE ;
@@ -553,6 +554,10 @@ static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev, lldst = *((u8 *)daddr); llsrc = *((u8 *)saddr); + rc =skb_cow_head (skb,sizeof (struct mctp_i2c_hdr )); +if (rc) +return rc; +skb_push (skb,sizeof (struct mctp_i2c_hdr ));skb_reset_mac_header (skb); hdr = (void *)skb_mac_header (skb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/166 netpoll: hold rcu read lock in __netpoll_send_skb()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
[ Upstream commit 505ead7ab77f289f12d8a68ac83da068e4d4408b ]
The function __netpoll_send_skb() is being invoked without holding the RCU read lock. This oversight triggers a warning message when CONFIG_PROVE_RCU_LIST is enabled:
net/core/netpoll.c:330 suspicious rcu_dereference_check() usage!
netpoll_send_skb
netpoll_send_udp
write_ext_msg
console_flush_all
console_unlock
vprintk_emit
To prevent npinfo from disappearing unexpectedly, ensure that __netpoll_send_skb() is protected with the RCU read lock.
--- net/core/netpoll.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
net/core/netpoll.c +7 -2
@@ -326,6 +326,7 @@ static int netpoll_owner_active(struct net_device *dev)static netdev_tx_t __netpoll_send_skb (struct netpoll *np,struct sk_buff *skb) {netdev_tx_t status =NETDEV_TX_BUSY ; +netdev_tx_t ret =NET_XMIT_DROP ;struct net_device *dev;unsigned long tries;/* It is up to the caller to keep npinfo alive. */
@@ -334,11 +335,12 @@ static netdev_tx_t __netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)lockdep_assert_irqs_disabled (); dev = np->dev; +rcu_read_lock (); npinfo =rcu_dereference_bh (dev->npinfo);if (!npinfo || !netif_running (dev) || !netif_device_present (dev)) {dev_kfree_skb_irq (skb); -return NET_XMIT_DROP ; + goto out; }/* don't get messages out of order, and no recursion */
@@ -377,7 +379,10 @@ static netdev_tx_t __netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)skb_queue_tail (&npinfo->txq, skb);schedule_delayed_work (&npinfo->tx_work,0 ); } -return NETDEV_TX_OK ; + ret =NETDEV_TX_OK ; +out: +rcu_read_unlock (); +return ret; }netdev_tx_t netpoll_send_skb (struct netpoll *np,struct sk_buff *skb)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/166 drm/hyperv: Fix address space leak when Hyper-V DRM device is removed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <[email protected]>
[ Upstream commit aed709355fd05ef747e1af24a1d5d78cd7feb81e ]
When a Hyper-V DRM device is probed, the driver allocates MMIO space for the vram, and maps it cacheable. If the device removed, or in the error path for device probing, the MMIO space is released but no unmap is done. Consequently the kernel address space for the mapping is leaked.
Fix this by adding iounmap() calls in the device removal path, and in the error path during device probing.
Message-ID: <[email protected]>
--- drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +2 -0
@@ -157,6 +157,7 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,return 0 ; err_free_mmio: +iounmap (hv->vram);vmbus_free_mmio (hv->mem->start, hv->fb_size); err_vmbus_close:vmbus_close (hdev->channel);
@@ -175,6 +176,7 @@ static void hyperv_vmbus_remove(struct hv_device *hdev)vmbus_close (hdev->channel);hv_set_drvdata (hdev,NULL ); +iounmap (hv->vram);vmbus_free_mmio (hv->mem->start, hv->fb_size); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/166 Drivers: hv: vmbus: Dont release fb_mmio resource in vmbus_free_mmio()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <[email protected]>
[ Upstream commit 73fe9073c0cc28056cb9de0c8a516dac070f1d1f ]
The VMBus driver manages the MMIO space it owns via the hyperv_mmio resource tree. Because the synthetic video framebuffer portion of the MMIO space is initially setup by the Hyper-V host for each guest, the VMBus driver does an early reserve of that portion of MMIO space in the hyperv_mmio resource tree. It saves a pointer to that resource in fb_mmio. When a VMBus driver requests MMIO space and passes "true" for the "fb_overlap_ok" argument, the reserved framebuffer space is used if possible. In that case it's not necessary to do another request against the "shadow" hyperv_mmio resource tree because that resource was already requested in the early reserve steps.
However, the vmbus_free_mmio() function currently does no special handling for the fb_mmio resource. When a framebuffer device is removed, or the driver is unbound, the current code for vmbus_free_mmio() releases the reserved resource, leaving fb_mmio pointing to memory that has been freed. If the same or another driver is subsequently bound to the device, vmbus_allocate_mmio() checks against fb_mmio, and potentially gets garbage. Furthermore a second unbind operation produces this "nonexistent resource" error because of the unbalanced behavior between vmbus_allocate_mmio() and vmbus_free_mmio():
[ 55.499643] resource: Trying to free nonexistent resource <0x00000000f0000000-0x00000000f07fffff>
Fix this by adding logic to vmbus_free_mmio() to recognize when MMIO space in the fb_mmio reserved area would be released, and don't release it. This filtering ensures the fb_mmio resource always exists, and makes vmbus_free_mmio() more parallel with vmbus_allocate_mmio().
Message-ID: <[email protected]>
--- drivers/hv/vmbus_drv.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/hv/vmbus_drv.c +13 -0
@@ -2242,12 +2242,25 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size)struct resource *iter;mutex_lock (&hyperv_mmio_lock); + +/* +* If all bytes of the MMIO range to be released are within the +* special case fb_mmio shadow region, skip releasing the shadow +* region since no corresponding __request_region() was done +* in vmbus_allocate_mmio(). +*/ +if (fb_mmio && start >= fb_mmio->start && + (start + size -1 <= fb_mmio->end)) + goto skip_shadow_release; +for (iter = hyperv_mmio; iter; iter = iter->sibling) {if ((iter->start >= start + size) || (iter->end <= start))continue ;__release_region (iter, start, size); } + +skip_shadow_release:release_mem_region (start, size);mutex_unlock (&hyperv_mmio_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/166 net/mlx5: handle errors in mlx5_chains_create_table()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit eab0396353be1c778eba1c0b5180176f04dd21ce ]
In mlx5_chains_create_table(), the return value of mlx5_get_fdb_sub_ns() and mlx5_get_flow_namespace() must be checked to prevent NULL pointer dereferences. If either function fails, the function should log error message with mlx5_core_warn() and return error pointer.
--- drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c +5 -0
@@ -196,6 +196,11 @@ mlx5_chains_create_table(struct mlx5_fs_chains *chains, ns =mlx5_get_flow_namespace (chains->dev, chains->ns); } +if (!ns) { +mlx5_core_warn (chains->dev,"Failed to get flow namespace\n" ); +return ERR_PTR (-EOPNOTSUPP ); + } + ft_attr.autogroup.num_reserved_entries =2 ; ft_attr.autogroup.max_num_groups = chains->group_num; ft =mlx5_create_auto_grouped_flow_table (ns, &ft_attr);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/166 eth: bnxt: do not update checksum in bnxt_xdp_build_skb()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taehee Yoo <[email protected]>
[ Upstream commit c03e7d05aa0e2f7e9a9ce5ad8a12471a53f941dc ]
The bnxt_rx_pkt() updates ip_summed value at the end if checksum offload is enabled.
When the XDP-MB program is attached and it returns XDP_PASS, the bnxt_xdp_build_skb() is called to update skb_shared_info. The main purpose of bnxt_xdp_build_skb() is to update skb_shared_info, but it updates ip_summed value too if checksum offload is enabled. This is actually duplicate work.
When the bnxt_rx_pkt() updates ip_summed value, it checks if ip_summed is CHECKSUM_NONE or not.
It means that ip_summed should be CHECKSUM_NONE at this moment. But ip_summed may already be updated to CHECKSUM_UNNECESSARY in the XDP-MB-PASS path.
So the by skb_checksum_none_assert() WARNS about it.
This is duplicate work and updating ip_summed in the bnxt_xdp_build_skb() is not needed.
Splat looks like:
WARNING: CPU: 3 PID: 5782 at ./include/linux/skbuff.h:5155 bnxt_rx_pkt+0x479b/0x7610 [bnxt_en] Modules linked in: bnxt_re bnxt_en rdma_ucm rdma_cm iw_cm ib_cm ib_uverbs veth xt_nat xt_tcpudp xt_conntrack nft_chain_nat xt_MASQUERADE nf_] CPU: 3 UID: 0 PID: 5782 Comm: socat Tainted: G W 6.14.0-rc4+ #27 Tainted: [W]=WARN Hardware name: ASUS System Product Name/PRIME Z690-P D4, BIOS 0603 11/01/2021 RIP: 0010:bnxt_rx_pkt+0x479b/0x7610 [bnxt_en] Code: 54 24 0c 4c 89 f1 4c 89 ff c1 ea 1f ff d3 0f 1f 00 49 89 c6 48 85 c0 0f 84 4c e5 ff ff 48 89 c7 e8 ca 3d a0 c8 e9 8f f4 ff ff <0f> 0b f RSP: 0018:ffff88881ba09928 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 00000000c7590303 RCX: 0000000000000000 RDX: 1ffff1104e7d1610 RSI: 0000000000000001 RDI: ffff8881c91300b8 RBP: ffff88881ba09b28 R08: ffff888273e8b0d0 R09: ffff888273e8b070 R10: ffff888273e8b010 R11: ffff888278b0f000 R12: ffff888273e8b080 R13: ffff8881c9130e00 R14: ffff8881505d3800 R15: ffff888273e8b000 FS: 00007f5a2e7be080(0000) GS:ffff88881ba00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff2e708ff8 CR3: 000000013e3b0000 CR4: 00000000007506f0 PKRU: 55555554 Call Trace: <IRQ> ? __warn+0xcd/0x2f0 ? bnxt_rx_pkt+0x479b/0x7610 ? report_bug+0x326/0x3c0 ? handle_bug+0x53/0xa0 ? exc_invalid_op+0x14/0x50 ? asm_exc_invalid_op+0x16/0x20 ? bnxt_rx_pkt+0x479b/0x7610 ? bnxt_rx_pkt+0x3e41/0x7610 ? __pfx_bnxt_rx_pkt+0x10/0x10 ? napi_complete_done+0x2cf/0x7d0 __bnxt_poll_work+0x4e8/0x1220 ? __pfx___bnxt_poll_work+0x10/0x10 ? __pfx_mark_lock.part.0+0x10/0x10 bnxt_poll_p5+0x36a/0xfa0 ? __pfx_bnxt_poll_p5+0x10/0x10 __napi_poll.constprop.0+0xa0/0x440 net_rx_action+0x899/0xd00
...
Following ping.py patch adds xdp-mb-pass case. so ping.py is going to be able to reproduce this issue.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 11 ++--------- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h | 3 +-- 3 files changed, 5 insertions(+), 12 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -1
@@ -1958,7 +1958,8 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,if (!skb) goto oom_next_rx; }else { - skb =bnxt_xdp_build_skb (bp, skb, agg_bufs, rxr->page_pool, &xdp, rxcmp1); + skb =bnxt_xdp_build_skb (bp, skb, agg_bufs, + rxr->page_pool, &xdp);if (!skb) {/* we should be able to free the old skb here */ bnxt_xdp_buff_frags_free (rxr, &xdp);
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +2 -9
@@ -462,20 +462,13 @@ int bnxt_xdp(struct net_device *dev, struct netdev_bpf *xdp)struct sk_buff *bnxt_xdp_build_skb (struct bnxt *bp,struct sk_buff *skb,u8 num_frags, -struct page_pool *pool,struct xdp_buff *xdp, -struct rx_cmp_ext *rxcmp1) +struct page_pool *pool,struct xdp_buff *xdp) {struct skb_shared_info *sinfo =xdp_get_shared_info_from_buff (xdp);if (!skb)return NULL ; -skb_checksum_none_assert (skb); -if (RX_CMP_L4_CS_OK (rxcmp1)) { -if (bp->dev->features &NETIF_F_RXCSUM ) { - skb->ip_summed =CHECKSUM_UNNECESSARY ; - skb->csum_level =RX_CMP_ENCAP (rxcmp1); - } - } + xdp_update_skb_shared_info(skb, num_frags, sinfo->xdp_frags_size, BNXT_RX_PAGE_SIZE * sinfo->nr_frags,
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h +1 -2
@@ -33,6 +33,5 @@ void bnxt_xdp_buff_frags_free(struct bnxt_rx_ring_info *rxr, struct xdp_buff *xdp);struct sk_buff *bnxt_xdp_build_skb (struct bnxt *bp,struct sk_buff *skb,u8 num_frags,struct page_pool *pool, -struct xdp_buff *xdp, -struct rx_cmp_ext *rxcmp1); +struct xdp_buff *xdp);#endif
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 25/166 net: switchdev: Convert blocking notification chain to a raw one
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Cohen <[email protected]>
[ Upstream commit 62531a1effa87bdab12d5104015af72e60d926ff ]
A blocking notification chain uses a read-write semaphore to protect the integrity of the chain. The semaphore is acquired for writing when adding / removing notifiers to / from the chain and acquired for reading when traversing the chain and informing notifiers about an event.
In case of the blocking switchdev notification chain, recursive notifications are possible which leads to the semaphore being acquired twice for reading and to lockdep warnings being generated [1].
Specifically, this can happen when the bridge driver processes a SWITCHDEV_BRPORT_UNOFFLOADED event which causes it to emit notifications about deferred events when calling switchdev_deferred_process().
Fix this by converting the notification chain to a raw notification chain in a similar fashion to the netdev notification chain. Protect the chain using the RTNL mutex by acquiring it when modifying the chain. Events are always informed under the RTNL mutex, but add an assertion in call_switchdev_blocking_notifiers() to make sure this is not violated in the future.
Maintain the "blocking" prefix as events are always emitted from process context and listeners are allowed to block.
[1]:
WARNING: possible recursive locking detected
6.14.0-rc4-custom-g079270089484 #1 Not tainted
--------------------------------------------
ip/52731 is trying to acquire lock:ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0
but task is already holding lock:ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock((switchdev_blocking_notif_chain).rwsem);
lock((switchdev_blocking_notif_chain).rwsem);
*** DEADLOCK ***
May be due to missing lock nesting notation
3 locks held by ip/52731:
#0: ffffffff84f795b0 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x727/0x1dc0
#1: ffffffff8731f628 (&net->rtnl_mutex){+.+.}-{4:4}, at: rtnl_newlink+0x790/0x1dc0
#2: ffffffff850918d8 ((switchdev_blocking_notif_chain).rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x58/0xa0
stack backtrace: ... ? __pfx_down_read+0x10/0x10 ? __pfx_mark_lock+0x10/0x10 ? __pfx_switchdev_port_attr_set_deferred+0x10/0x10 blocking_notifier_call_chain+0x58/0xa0 switchdev_port_attr_notify.constprop.0+0xb3/0x1b0 ? __pfx_switchdev_port_attr_notify.constprop.0+0x10/0x10 ? mark_held_locks+0x94/0xe0 ? switchdev_deferred_process+0x11a/0x340 switchdev_port_attr_set_deferred+0x27/0xd0 switchdev_deferred_process+0x164/0x340 br_switchdev_port_unoffload+0xc8/0x100 [bridge] br_switchdev_blocking_event+0x29f/0x580 [bridge] notifier_call_chain+0xa2/0x440 blocking_notifier_call_chain+0x6e/0xa0 switchdev_bridge_port_unoffload+0xde/0x1a0
...
--- net/switchdev/switchdev.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
net/switchdev/switchdev.c +18 -7
@@ -381,7 +381,7 @@ bool switchdev_port_obj_act_is_deferred(struct net_device *dev,EXPORT_SYMBOL_GPL (switchdev_port_obj_act_is_deferred);static ATOMIC_NOTIFIER_HEAD (switchdev_notif_chain); -static BLOCKING_NOTIFIER_HEAD (switchdev_blocking_notif_chain); +static RAW_NOTIFIER_HEAD (switchdev_blocking_notif_chain);/** * register_switchdev_notifier - Register notifier
@@ -427,17 +427,27 @@ EXPORT_SYMBOL_GPL(call_switchdev_notifiers);int register_switchdev_blocking_notifier (struct notifier_block *nb) { -struct blocking_notifier_head *chain = &switchdev_blocking_notif_chain; +struct raw_notifier_head *chain = &switchdev_blocking_notif_chain; +int err; + +rtnl_lock (); + err =raw_notifier_chain_register (chain, nb); +rtnl_unlock (); -return blocking_notifier_chain_register (chain, nb); +return err; }EXPORT_SYMBOL_GPL (register_switchdev_blocking_notifier);int unregister_switchdev_blocking_notifier (struct notifier_block *nb) { -struct blocking_notifier_head *chain = &switchdev_blocking_notif_chain; +struct raw_notifier_head *chain = &switchdev_blocking_notif_chain; +int err; -return blocking_notifier_chain_unregister (chain, nb); +rtnl_lock (); + err =raw_notifier_chain_unregister (chain, nb); +rtnl_unlock (); + +return err; }EXPORT_SYMBOL_GPL (unregister_switchdev_blocking_notifier);
@@ -445,10 +455,11 @@ int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev,struct switchdev_notifier_info *info, struct netlink_ext_ack *extack) { +ASSERT_RTNL (); info->dev = dev; info->extack = extack; -return blocking_notifier_call_chain (&switchdev_blocking_notif_chain, - val, info); +return raw_notifier_call_chain (&switchdev_blocking_notif_chain, + val, info); }EXPORT_SYMBOL_GPL (call_switchdev_blocking_notifiers);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/166 bonding: fix incorrect MAC address setting to receive NS messages
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hangbin Liu <[email protected]>
[ Upstream commit 0c5e145a350de3b38cd5ae77a401b12c46fb7c1d ]
When validation on the backup slave is enabled, we need to validate the Neighbor Solicitation (NS) messages received on the backup slave. To receive these messages, the correct destination MAC address must be added to the slave. However, the target in bonding is a unicast address, which we cannot use directly. Instead, we should first convert it to a Solicited-Node Multicast Address and then derive the corresponding MAC address.
Fix the incorrect MAC address setting on both slave_set_ns_maddr() and slave_set_ns_maddrs(). Since the two function names are similar. Add some description for the functions. Also only use one mac_addr variable in slave_set_ns_maddr() to save some code and logic.
--- drivers/net/bonding/bond_options.c | 55 +++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 8 deletions(-)
drivers/net/bonding/bond_options.c +47 -8
@@ -1226,10 +1226,28 @@ static bool slave_can_set_ns_maddr(const struct bonding *bond, struct slave *sla slave->dev->flags &IFF_MULTICAST ; } +/** +* slave_set_ns_maddrs - add/del all NS mac addresses for slave +* @bond: bond device +* @slave: slave device +* @add: add or remove all the NS mac addresses +* +* This function tries to add or delete all the NS mac addresses on the slave +* +* Note, the IPv6 NS target address is the unicast address in Neighbor +* Solicitation (NS) message. The dest address of NS message should be +* solicited-node multicast address of the target. The dest mac of NS message +* is converted from the solicited-node multicast address. +* +* This function is called when +* * arp_validate changes +* * enslaving, releasing new slaves +*/ static void slave_set_ns_maddrs (struct bonding *bond,struct slave *slave,bool add) {struct in6_addr *targets = bond->params.ns_targets;char slot_maddr[MAX_ADDR_LEN ]; +struct in6_addr mcaddr;int i;if (!slave_can_set_ns_maddr (bond, slave))
@@ -1239,7 +1257,8 @@ static void slave_set_ns_maddrs(struct bonding *bond, struct slave *slave, boolif (ipv6_addr_any (&targets[i]))break ; -if (!ndisc_mc_map (&targets[i], slot_maddr, slave->dev,0 )) { +addrconf_addr_solict_mult (&targets[i], &mcaddr); +if (!ndisc_mc_map (&mcaddr, slot_maddr, slave->dev,0 )) {if (add)dev_mc_add (slave->dev, slot_maddr);else
@@ -1262,23 +1281,43 @@ void bond_slave_ns_maddrs_del(struct bonding *bond, struct slave *slave)slave_set_ns_maddrs (bond, slave, false); } +/** +* slave_set_ns_maddr - set new NS mac address for slave +* @bond: bond device +* @slave: slave device +* @target: the new IPv6 target +* @slot: the old IPv6 target in the slot +* +* This function tries to replace the old mac address to new one on the slave. +* +* Note, the target/slot IPv6 address is the unicast address in Neighbor +* Solicitation (NS) message. The dest address of NS message should be +* solicited-node multicast address of the target. The dest mac of NS message +* is converted from the solicited-node multicast address. +* +* This function is called when +* * An IPv6 NS target is added or removed. +*/ static void slave_set_ns_maddr (struct bonding *bond,struct slave *slave,struct in6_addr *target,struct in6_addr *slot) { -char target_maddr[MAX_ADDR_LEN ], slot_maddr[MAX_ADDR_LEN ]; +char mac_addr[MAX_ADDR_LEN ]; +struct in6_addr mcast_addr;if (!bond->params.arp_validate || !slave_can_set_ns_maddr (bond, slave))return ; -/* remove the previous maddr from slave */ +/* remove the previous mac addr from slave */ +addrconf_addr_solict_mult (slot, &mcast_addr);if (!ipv6_addr_any (slot) && - !ndisc_mc_map (slot, slot_maddr, slave->dev,0 )) -dev_mc_del (slave->dev, slot_maddr); + !ndisc_mc_map (&mcast_addr, mac_addr, slave->dev,0 )) +dev_mc_del (slave->dev, mac_addr); -/* add new maddr on slave if target is set */ +/* add new mac addr on slave if target is set */ +addrconf_addr_solict_mult (target, &mcast_addr);if (!ipv6_addr_any (target) && - !ndisc_mc_map (target, target_maddr, slave->dev,0 )) -dev_mc_add (slave->dev, target_maddr); + !ndisc_mc_map (&mcast_addr, mac_addr, slave->dev,0 )) +dev_mc_add (slave->dev, mac_addr); } static void _bond_options_ns_ip6_target_set(struct bonding *bond, int slot,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/166 netfilter: nf_conncount: Fully initialize struct nf_conncount_tuple in insert_tree()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kohei Enju <[email protected]>
[ Upstream commit d653bfeb07ebb3499c403404c21ac58a16531607 ]
Since commit b36e4523d4d5 ("netfilter: nf_conncount: fix garbage collection confirm race"), cpu and jiffies32 were introduced to the struct nf_conncount_tuple.
The commit made nf_conncount_add() initialize conn->cpu and conn->jiffies32 when allocating the struct.
In contrast, count_tree() was not changed to initialize them.
By commit 34848d5c896e ("netfilter: nf_conncount: Split insert and traversal"), count_tree() was split and the relevant allocation code now resides in insert_tree().
Initialize conn->cpu and conn->jiffies32 in insert_tree().
BUG: KMSAN: uninit-value in find_or_evict net/netfilter/nf_conncount.c:117 [inline] BUG: KMSAN: uninit-value in __nf_conncount_add+0xd9c/0x2850 net/netfilter/nf_conncount.c:143 find_or_evict net/netfilter/nf_conncount.c:117 [inline] __nf_conncount_add+0xd9c/0x2850 net/netfilter/nf_conncount.c:143 count_tree net/netfilter/nf_conncount.c:438 [inline] nf_conncount_count+0x82f/0x1e80 net/netfilter/nf_conncount.c:521 connlimit_mt+0x7f6/0xbd0 net/netfilter/xt_connlimit.c:72 __nft_match_eval net/netfilter/nft_compat.c:403 [inline] nft_match_eval+0x1a5/0x300 net/netfilter/nft_compat.c:433 expr_call_ops_eval net/netfilter/nf_tables_core.c:240 [inline] nft_do_chain+0x426/0x2290 net/netfilter/nf_tables_core.c:288 nft_do_chain_ipv4+0x1a5/0x230 net/netfilter/nft_chain_filter.c:23 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xf4/0x400 net/netfilter/core.c:626 nf_hook_slow_list+0x24d/0x860 net/netfilter/core.c:663 NF_HOOK_LIST include/linux/netfilter.h:350 [inline] ip_sublist_rcv+0x17b7/0x17f0 net/ipv4/ip_input.c:633 ip_list_rcv+0x9ef/0xa40 net/ipv4/ip_input.c:669 __netif_receive_skb_list_ptype net/core/dev.c:5936 [inline] __netif_receive_skb_list_core+0x15c5/0x1670 net/core/dev.c:5983 __netif_receive_skb_list net/core/dev.c:6035 [inline] netif_receive_skb_list_internal+0x1085/0x1700 net/core/dev.c:6126 netif_receive_skb_list+0x5a/0x460 net/core/dev.c:6178 xdp_recv_frames net/bpf/test_run.c:280 [inline] xdp_test_run_batch net/bpf/test_run.c:361 [inline] bpf_test_run_xdp_live+0x2e86/0x3480 net/bpf/test_run.c:390 bpf_prog_test_run_xdp+0xf1d/0x1ae0 net/bpf/test_run.c:1316 bpf_prog_test_run+0x5e5/0xa30 kernel/bpf/syscall.c:4407 __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5813 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline] __se_sys_bpf kernel/bpf/syscall.c:5900 [inline] __ia32_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5900 ia32_sys_call+0x394d/0x4180 arch/x86/include/generated/asm/syscalls_32.h:358 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xb0/0x110 arch/x86/entry/common.c:387 do_fast_syscall_32+0x38/0x80 arch/x86/entry/common.c:412 do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:450 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
Uninit was created at:
slab_post_alloc_hook mm/slub.c:4121 [inline] slab_alloc_node mm/slub.c:4164 [inline] kmem_cache_alloc_noprof+0x915/0xe10 mm/slub.c:4171 insert_tree net/netfilter/nf_conncount.c:372 [inline] count_tree net/netfilter/nf_conncount.c:450 [inline] nf_conncount_count+0x1415/0x1e80 net/netfilter/nf_conncount.c:521 connlimit_mt+0x7f6/0xbd0 net/netfilter/xt_connlimit.c:72 __nft_match_eval net/netfilter/nft_compat.c:403 [inline] nft_match_eval+0x1a5/0x300 net/netfilter/nft_compat.c:433 expr_call_ops_eval net/netfilter/nf_tables_core.c:240 [inline] nft_do_chain+0x426/0x2290 net/netfilter/nf_tables_core.c:288 nft_do_chain_ipv4+0x1a5/0x230 net/netfilter/nft_chain_filter.c:23 nf_hook_entry_hookfn include/linux/netfilter.h:154 [inline] nf_hook_slow+0xf4/0x400 net/netfilter/core.c:626 nf_hook_slow_list+0x24d/0x860 net/netfilter/core.c:663 NF_HOOK_LIST include/linux/netfilter.h:350 [inline] ip_sublist_rcv+0x17b7/0x17f0 net/ipv4/ip_input.c:633 ip_list_rcv+0x9ef/0xa40 net/ipv4/ip_input.c:669 __netif_receive_skb_list_ptype net/core/dev.c:5936 [inline] __netif_receive_skb_list_core+0x15c5/0x1670 net/core/dev.c:5983 __netif_receive_skb_list net/core/dev.c:6035 [inline] netif_receive_skb_list_internal+0x1085/0x1700 net/core/dev.c:6126 netif_receive_skb_list+0x5a/0x460 net/core/dev.c:6178 xdp_recv_frames net/bpf/test_run.c:280 [inline] xdp_test_run_batch net/bpf/test_run.c:361 [inline] bpf_test_run_xdp_live+0x2e86/0x3480 net/bpf/test_run.c:390 bpf_prog_test_run_xdp+0xf1d/0x1ae0 net/bpf/test_run.c:1316 bpf_prog_test_run+0x5e5/0xa30 kernel/bpf/syscall.c:4407 __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5813 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline] __se_sys_bpf kernel/bpf/syscall.c:5900 [inline] __ia32_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5900 ia32_sys_call+0x394d/0x4180 arch/x86/include/generated/asm/syscalls_32.h:358 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xb0/0x110 arch/x86/entry/common.c:387 do_fast_syscall_32+0x38/0x80 arch/x86/entry/common.c:412 do_SYSENTER_32+0x1f/0x30 arch/x86/entry/common.c:450 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
--- net/netfilter/nf_conncount.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nf_conncount.c +2 -0
@@ -377,6 +377,8 @@ insert_tree(struct net *net, conn->tuple = *tuple; conn->zone = *zone; + conn->cpu =raw_smp_processor_id (); + conn->jiffies32 = (u32 )jiffies;memcpy (rbconn->key, key,sizeof (u32) * data->keylen);nf_conncount_list_init (&rbconn->list);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/166 ipvs: prevent integer overflow in do_ip_vs_get_ctl()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 80b78c39eb86e6b55f56363b709eb817527da5aa ]
The get->num_services variable is an unsigned int which is controlled by the user. The struct_size() function ensures that the size calculation does not overflow an unsigned long, however, we are saving the result to an int so the calculation can overflow.
Both "len" and "get->num_services" come from the user. This check is just a sanity check to help the user and ensure they are using the API correctly. An integer overflow here is not a big deal. This has no security impact.
Save the result from struct_size() type size_t to fix this integer overflow bug.
--- net/netfilter/ipvs/ip_vs_ctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_ctl.c +4 -4
@@ -3091,12 +3091,12 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)case IP_VS_SO_GET_SERVICES : {struct ip_vs_get_services *get; -int size; +size_t size; get = (struct ip_vs_get_services *)arg; size =struct_size (get, entrytable, get->num_services);if (*len != size) { -pr_err ("length: %u != %u\n" , *len, size); +pr_err ("length: %u != %zu\n" , *len, size); ret = -EINVAL ; goto out; }
@@ -3132,12 +3132,12 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)case IP_VS_SO_GET_DESTS : {struct ip_vs_get_dests *get; -int size; +size_t size; get = (struct ip_vs_get_dests *)arg; size =struct_size (get, entrytable, get->num_dests);if (*len != size) { -pr_err ("length: %u != %u\n" , *len, size); +pr_err ("length: %u != %zu\n" , *len, size); ret = -EINVAL ; goto out; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/166 net_sched: Prevent creation of classes with TC_H_ROOT
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 0c3057a5a04d07120b3d0ec9c79568fceb9c921e ]
The function qdisc_tree_reduce_backlog() uses TC_H_ROOT as a termination condition when traversing up the qdisc tree to update parent backlog counters. However, if a class is created with classid TC_H_ROOT, the traversal terminates prematurely at this class instead of reaching the actual root qdisc, causing parent statistics to be incorrectly maintained. In case of DRR, this could lead to a crash as reported by Mingi Cho.
Prevent the creation of any Qdisc class with classid TC_H_ROOT (0xFFFFFFFF) across all qdisc types, as suggested by Jamal.
--- net/sched/sch_api.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/sched/sch_api.c +6 -0
@@ -2197,6 +2197,12 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,return -EOPNOTSUPP ; } +/* Prevent creation of traffic classes with classid TC_H_ROOT */ +if (clid ==TC_H_ROOT ) { +NL_SET_ERR_MSG (extack,"Cannot create traffic class with classid TC_H_ROOT" ); +return -EINVAL ; + } + new_cl = cl; err = -EOPNOTSUPP ;if (cops->change)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 30/166 netfilter: nft_exthdr: fix offset with ipv4_find_option()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Kashavkin <[email protected]>
[ Upstream commit 6edd78af9506bb182518da7f6feebd75655d9a0e ]
There is an incorrect calculation in the offset variable which causes the nft_skb_copy_to_reg() function to always return -EFAULT. Adding the start variable is redundant. In the __ip_options_compile() function the correct offset is specified when finding the function. There is no need to add the size of the iphdr structure to the offset.
--- net/netfilter/nft_exthdr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
net/netfilter/nft_exthdr.c +4 -6
@@ -85,7 +85,6 @@ static int ipv4_find_option(struct net *net, struct sk_buff *skb,unsigned char optbuf[sizeof (struct ip_options ) +40 ];struct ip_options *opt = (struct ip_options *)optbuf;struct iphdr *iph, _iph; -unsigned int start;bool found = false;__be32 info;int optlen;
@@ -93,7 +92,6 @@ static int ipv4_find_option(struct net *net, struct sk_buff *skb, iph =skb_header_pointer (skb,0 ,sizeof (_iph), &_iph);if (!iph)return -EBADMSG ; - start =sizeof (struct iphdr ); optlen = iph->ihl *4 - (int )sizeof (struct iphdr );if (optlen <=0 )
@@ -103,7 +101,7 @@ static int ipv4_find_option(struct net *net, struct sk_buff *skb,/* Copy the options since __ip_options_compile() modifies * the options. */ -if (skb_copy_bits (skb, start, opt->__data, optlen)) +if (skb_copy_bits (skb,sizeof (struct iphdr ), opt->__data, optlen))return -EBADMSG ; opt->optlen = optlen;
@@ -118,18 +116,18 @@ static int ipv4_find_option(struct net *net, struct sk_buff *skb, found = target ==IPOPT_SSRR ? opt->is_strictroute : !opt->is_strictroute;if (found) - *offset = opt->srr + start; + *offset = opt->srr;break ;case IPOPT_RR :if (!opt->rr)break ; - *offset = opt->rr + start; + *offset = opt->rr; found = true;break ;case IPOPT_RA :if (!opt->router_alert)break ; - *offset = opt->router_alert + start; + *offset = opt->router_alert; found = true;break ;default :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 31/166 gre: Fix IPv6 link-local address generation.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guillaume Nault <[email protected]>
[ Upstream commit 183185a18ff96751db52a46ccf93fff3a1f42815 ]
Use addrconf_addr_gen() to generate IPv6 link-local addresses on GRE devices in most cases and fall back to using add_v4_addrs() only in case the GRE configuration is incompatible with addrconf_addr_gen().
GRE used to use addrconf_addr_gen() until commit e5dd729460ca ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address") restricted this use to gretap and ip6gretap devices, and created add_v4_addrs() (borrowed from SIT) for non-Ethernet GRE ones.
The original problem came when commit 9af28511be10 ("addrconf: refuse isatap eui64 for INADDR_ANY") made __ipv6_isatap_ifid() fail when its addr parameter was 0. The commit says that this would create an invalid address, however, I couldn't find any RFC saying that the generated interface identifier would be wrong. Anyway, since gre over IPv4 devices pass their local tunnel address to __ipv6_isatap_ifid(), that commit broke their IPv6 link-local address generation when the local address was unspecified.
Then commit e5dd729460ca ("ip/ip6_gre: use the same logic as SIT interfaces when computing v6LL address") tried to fix that case by defining add_v4_addrs() and calling it to generate the IPv6 link-local address instead of using addrconf_addr_gen() (apart for gretap and ip6gretap devices, which would still use the regular addrconf_addr_gen(), since they have a MAC address).
That broke several use cases because add_v4_addrs() isn't properly integrated into the rest of IPv6 Neighbor Discovery code. Several of these shortcomings have been fixed over time, but add_v4_addrs() remains broken on several aspects. In particular, it doesn't send any Router Sollicitations, so the SLAAC process doesn't start until the interface receives a Router Advertisement. Also, add_v4_addrs() mostly ignores the address generation mode of the interface (/proc/sys/net/ipv6/conf/*/addr_gen_mode), thus breaking the IN6_ADDR_GEN_MODE_RANDOM and IN6_ADDR_GEN_MODE_STABLE_PRIVACY cases.
Fix the situation by using add_v4_addrs() only in the specific scenario where the normal method would fail. That is, for interfaces that have all of the following characteristics:
* run over IPv4,
* transport IP packets directly, not Ethernet (that is, not gretap interfaces),
* tunnel endpoint is INADDR_ANY (that is, 0),
* device address generation mode is EUI64.
In all other cases, revert back to the regular addrconf_addr_gen().
Also, remove the special case for ip6gre interfaces in add_v4_addrs(), since ip6gre devices now always use addrconf_addr_gen() instead.
--- net/ipv6/addrconf.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
net/ipv6/addrconf.c +9 -6
@@ -3189,16 +3189,13 @@ static void add_v4_addrs(struct inet6_dev *idev)struct in6_addr addr;struct net_device *dev;struct net *net =dev_net (idev->dev); -int scope, plen, offset =0 ; +int scope, plen;u32 pflags =0 ;ASSERT_RTNL ();memset (&addr,0 ,sizeof (struct in6_addr )); -/* in case of IP6GRE the dev_addr is an IPv6 and therefore we use only the last 4 bytes */ -if (idev->dev->addr_len ==sizeof (struct in6_addr )) - offset =sizeof (struct in6_addr ) -4 ; -memcpy (&addr.s6_addr32[3 ], idev->dev->dev_addr + offset,4 ); +memcpy (&addr.s6_addr32[3 ], idev->dev->dev_addr,4 );if (!(idev->dev->flags &IFF_POINTOPOINT ) && idev->dev->type ==ARPHRD_SIT ) { scope = IPV6_ADDR_COMPATv4;
@@ -3508,7 +3505,13 @@ static void addrconf_gre_config(struct net_device *dev)return ; } -if (dev->type ==ARPHRD_ETHER ) { +/* Generate the IPv6 link-local address using addrconf_addr_gen(), +* unless we have an IPv4 GRE device not bound to an IP address and +* which is in EUI64 mode (as __ipv6_isatap_ifid() would fail in this +* case). Such devices fall back to add_v4_addrs() instead. +*/ +if (!(dev->type ==ARPHRD_IPGRE && *(__be32 *)dev->dev_addr ==0 && + idev->cnf.addr_gen_mode ==IN6_ADDR_GEN_MODE_EUI64 )) {addrconf_addr_gen (idev, true);return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/166 net: openvswitch: remove misbehaving actions length check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <[email protected]>
[ Upstream commit a1e64addf3ff9257b45b78bc7d743781c3f41340 ]
The actions length check is unreliable and produces different results depending on the initial length of the provided netlink attribute and the composition of the actual actions inside of it. For example, a user can add 4088 empty clone() actions without triggering -EMSGSIZE, on attempt to add 4089 such actions the operation will fail with the -EMSGSIZE verdict. However, if another 16 KB of other actions will be *appended* to the previous 4089 clone() actions, the check passes and the flow is successfully installed into the openvswitch datapath.
The reason for a such a weird behavior is the way memory is allocated. When ovs_flow_cmd_new() is invoked, it calls ovs_nla_copy_actions(), that in turn calls nla_alloc_flow_actions() with either the actual length of the user-provided actions or the MAX_ACTIONS_BUFSIZE. The function adds the size of the sw_flow_actions structure and then the actually allocated memory is rounded up to the closest power of two.
So, if the user-provided actions are larger than MAX_ACTIONS_BUFSIZE, then MAX_ACTIONS_BUFSIZE + sizeof(*sfa) rounded up is 32K + 24 -> 64K. Later, while copying individual actions, we look at ksize(), which is 64K, so this way the MAX_ACTIONS_BUFSIZE check is not actually triggered and the user can easily allocate almost 64 KB of actions.
However, when the initial size is less than MAX_ACTIONS_BUFSIZE, but the actions contain ones that require size increase while copying (such as clone() or sample()), then the limit check will be performed during the reserve_sfa_size() and the user will not be allowed to create actions that yield more than 32 KB internally.
This is one part of the problem. The other part is that it's not actually possible for the userspace application to know beforehand if the particular set of actions will be rejected or not.
Certain actions require more space in the internal representation, e.g. an empty clone() takes 4 bytes in the action list passed in by the user, but it takes 12 bytes in the internal representation due to an extra nested attribute, and some actions require less space in the internal representations, e.g. set(tunnel(..)) normally takes 64+ bytes in the action list provided by the user, but only needs to store a single pointer in the internal implementation, since all the data is stored in the tunnel_info structure instead.
And the action size limit is applied to the internal representation, not to the action list passed by the user. So, it's not possible for the userpsace application to predict if the certain combination of actions will be rejected or not, because it is not possible for it to calculate how much space these actions will take in the internal representation without knowing kernel internals.
All that is causing random failures in ovs-vswitchd in userspace and inability to handle certain traffic patterns as a result. For example, it is reported that adding a bit more than a 1100 VMs in an OpenStack setup breaks the network due to OVS not being able to handle ARP traffic anymore in some cases (it tries to install a proper datapath flow, but the kernel rejects it with -EMSGSIZE, even though the action list isn't actually that large.)
Kernel behavior must be consistent and predictable in order for the userspace application to use it in a reasonable way. ovs-vswitchd has a mechanism to re-direct parts of the traffic and partially handle it in userspace if the required action list is oversized, but that doesn't work properly if we can't actually tell if the action list is oversized or not.
Solution for this is to check the size of the user-provided actions instead of the internal representation. This commit just removes the check from the internal part because there is already an implicit size check imposed by the netlink protocol. The attribute can't be larger than 64 KB. Realistically, we could reduce the limit to 32 KB, but we'll be risking to break some existing setups that rely on the fact that it's possible to create nearly 64 KB action lists today.
Vast majority of flows in real setups are below 100-ish bytes. So removal of the limit will not change real memory consumption on the system. The absolutely worst case scenario is if someone adds a flow with 64 KB of empty clone() actions. That will yield a 192 KB in the internal representation consuming 256 KB block of memory. However, that list of actions is not meaningful and also a no-op. Real world very large action lists (that can occur for a rare cases of BUM traffic handling) are unlikely to contain a large number of clones and will likely have a lot of tunnel attributes making the internal representation comparable in size to the original action list. So, it should be fine to just remove the limit.
Commit in the 'Fixes' tag is the first one that introduced the difference between internal representation and the user-provided action lists, but there were many more afterwards that lead to the situation we have today.
--- net/openvswitch/flow_netlink.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-)
net/openvswitch/flow_netlink.c +1 -14
@@ -2304,14 +2304,10 @@ int ovs_nla_put_mask(const struct sw_flow *flow, struct sk_buff *skb) OVS_FLOW_ATTR_MASK, true, skb); } -#define MAX_ACTIONS_BUFSIZE (32 * 1024) -static struct sw_flow_actions *nla_alloc_flow_actions (int size) {struct sw_flow_actions *sfa; -WARN_ON_ONCE (size >MAX_ACTIONS_BUFSIZE ); - sfa =kmalloc (kmalloc_size_roundup (sizeof (*sfa) + size),GFP_KERNEL );if (!sfa)return ERR_PTR (-ENOMEM );
@@ -2467,15 +2463,6 @@ static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, new_acts_size =max (next_offset + req_size,ksize (*sfa) *2 ); -if (new_acts_size >MAX_ACTIONS_BUFSIZE ) { -if ((next_offset + req_size) >MAX_ACTIONS_BUFSIZE ) { -OVS_NLERR (log,"Flow action size exceeds max %u" , -MAX_ACTIONS_BUFSIZE ); -return ERR_PTR (-EMSGSIZE ); - } - new_acts_size =MAX_ACTIONS_BUFSIZE ; - } - acts =nla_alloc_flow_actions (new_acts_size);if (IS_ERR (acts))return (void *)acts;
@@ -3502,7 +3489,7 @@ int ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,int err;u32 mpls_label_count =0 ; - *sfa =nla_alloc_flow_actions (min (nla_len (attr),MAX_ACTIONS_BUFSIZE )); + *sfa =nla_alloc_flow_actions (nla_len (attr));if (IS_ERR (*sfa))return PTR_ERR (*sfa);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/166 net/mlx5: Lag, Check shared fdb before creating MultiPort E-Switch
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <[email protected]>
[ Upstream commit 32966984bee1defd9f5a8f9be274d7c32f911ba1 ]
Currently, MultiPort E-Switch is requesting to create a LAG with shared FDB without checking the LAG is supporting shared FDB.
Add the check.
--- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +2 -2
@@ -823,7 +823,7 @@ void mlx5_disable_lag(struct mlx5_lag *ldev)mlx5_eswitch_reload_ib_reps (ldev->pf[i].dev->priv.eswitch); } -static bool mlx5_shared_fdb_supported (struct mlx5_lag *ldev) +bool mlx5_lag_shared_fdb_supported (struct mlx5_lag *ldev) {struct mlx5_core_dev *dev;int i;
@@ -900,7 +900,7 @@ static void mlx5_do_bond(struct mlx5_lag *ldev) }if (do_bond && !__mlx5_lag_is_active (ldev)) { -bool shared_fdb =mlx5_shared_fdb_supported (ldev); +bool shared_fdb =mlx5_lag_shared_fdb_supported (ldev); roce_lag =mlx5_lag_is_roce_lag (ldev);
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h +1 -0
@@ -92,6 +92,7 @@ mlx5_lag_is_ready(struct mlx5_lag *ldev)return test_bit (MLX5_LAG_FLAG_NDEVS_READY , &ldev->state_flags); } +bool mlx5_lag_shared_fdb_supported (struct mlx5_lag *ldev);bool mlx5_lag_check_prereq (struct mlx5_lag *ldev);void mlx5_modify_lag (struct mlx5_lag *ldev,struct lag_tracker *tracker);
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c +2 -1
@@ -81,7 +81,8 @@ static int enable_mpesw(struct mlx5_lag *ldev)if (mlx5_eswitch_mode (dev0) !=MLX5_ESWITCH_OFFLOADS || !MLX5_CAP_PORT_SELECTION (dev0, port_select_flow_table) || !MLX5_CAP_GEN (dev0, create_lag_when_not_master_up) || - !mlx5_lag_check_prereq (ldev)) + !mlx5_lag_check_prereq (ldev) || + !mlx5_lag_shared_fdb_supported (ldev))return -EOPNOTSUPP ; err =mlx5_mpesw_metadata_set (ldev);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/166 net/mlx5: Bridge, fix the crash caused by LAG state check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianbo Liu <[email protected]>
[ Upstream commit 4b8eeed4fb105770ce6dc84a2c6ef953c7b71cbb ]
When removing LAG device from bridge, NETDEV_CHANGEUPPER event is triggered. Driver finds the lower devices (PFs) to flush all the offloaded entries. And mlx5_lag_is_shared_fdb is checked, it returns false if one of PF is unloaded. In such case, mlx5_esw_bridge_lag_rep_get() and its caller return NULL, instead of the alive PF, and the flush is skipped.
Besides, the bridge fdb entry's lastuse is updated in mlx5 bridge event handler. But this SWITCHDEV_FDB_ADD_TO_BRIDGE event can be ignored in this case because the upper interface for bond is deleted, and the entry will never be aged because lastuse is never updated.
To make things worse, as the entry is alive, mlx5 bridge workqueue keeps sending that event, which is then handled by kernel bridge notifier. It causes the following crash when accessing the passed bond netdev which is already destroyed.
To fix this issue, remove such checks. LAG state is already checked in commit 15f8f168952f ("net/mlx5: Bridge, verify LAG state when adding bond to bridge"), driver still need to skip offload if LAG becomes invalid state after initialization.
Oops: stack segment: 0000 [#1] SMP CPU: 3 UID: 0 PID: 23695 Comm: kworker/u40:3 Tainted: G OE 6.11.0_mlnx #1 Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5_bridge_wq mlx5_esw_bridge_update_work [mlx5_core] RIP: 0010:br_switchdev_event+0x2c/0x110 [bridge] Code: 44 00 00 48 8b 02 48 f7 00 00 02 00 00 74 69 41 54 55 53 48 83 ec 08 48 8b a8 08 01 00 00 48 85 ed 74 4a 48 83 fe 02 48 89 d3 <4c> 8b 65 00 74 23 76 49 48 83 fe 05 74 7e 48 83 fe 06 75 2f 0f b7 RSP: 0018:ffffc900092cfda0 EFLAGS: 00010297 RAX: ffff888123bfe000 RBX: ffffc900092cfe08 RCX: 00000000ffffffff RDX: ffffc900092cfe08 RSI: 0000000000000001 RDI: ffffffffa0c585f0 RBP: 6669746f6e690a30 R08: 0000000000000000 R09: ffff888123ae92c8 R10: 0000000000000000 R11: fefefefefefefeff R12: ffff888123ae9c60 R13: 0000000000000001 R14: ffffc900092cfe08 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88852c980000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f15914c8734 CR3: 0000000002830005 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: <TASK> ? __die_body+0x1a/0x60 ? die+0x38/0x60 ? do_trap+0x10b/0x120 ? do_error_trap+0x64/0xa0 ? exc_stack_segment+0x33/0x50 ? asm_exc_stack_segment+0x22/0x30 ? br_switchdev_event+0x2c/0x110 [bridge] ? sched_balance_newidle.isra.149+0x248/0x390 notifier_call_chain+0x4b/0xa0 atomic_notifier_call_chain+0x16/0x20 mlx5_esw_bridge_update+0xec/0x170 [mlx5_core] mlx5_esw_bridge_update_work+0x19/0x40 [mlx5_core] process_scheduled_works+0x81/0x390 worker_thread+0x106/0x250 ? bh_worker+0x110/0x110 kthread+0xb7/0xe0 ? kthread_park+0x80/0x80 ret_from_fork+0x2d/0x50 ? kthread_park+0x80/0x80 ret_from_fork_asm+0x11/0x20 </TASK>
--- .../net/ethernet/mellanox/mlx5/core/en/rep/bridge.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c +5 -7
@@ -48,15 +48,10 @@ mlx5_esw_bridge_lag_rep_get(struct net_device *dev, struct mlx5_eswitch *esw)struct list_head *iter;netdev_for_each_lower_dev (dev, lower, iter) { -struct mlx5_core_dev *mdev; -struct mlx5e_priv *priv; -if (!mlx5e_eswitch_rep (lower))continue ; - priv =netdev_priv (lower); - mdev = priv->mdev; -if (mlx5_lag_is_shared_fdb (mdev) &&mlx5_esw_bridge_dev_same_esw (lower, esw)) +if (mlx5_esw_bridge_dev_same_esw (lower, esw))return lower; }
@@ -125,7 +120,7 @@ static bool mlx5_esw_bridge_is_local(struct net_device *dev, struct net_device * priv =netdev_priv (rep); mdev = priv->mdev;if (netif_is_lag_master (dev)) -return mlx5_lag_is_shared_fdb (mdev) &&mlx5_lag_is_master (mdev); +return mlx5_lag_is_master (mdev);return true; }
@@ -455,6 +450,9 @@ static int mlx5_esw_bridge_switchdev_event(struct notifier_block *nb,if (!rep)return NOTIFY_DONE ; +if (netif_is_lag_master (dev) && !mlx5_lag_is_shared_fdb (esw->dev)) +return NOTIFY_DONE ; +switch (event) {case SWITCHDEV_FDB_ADD_TO_BRIDGE : fdb_info = container_of(info,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/166 net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carolina Jubran <[email protected]>
[ Upstream commit e92df790d07a8eea873efcb84776e7b71f81c7d5 ]
mlx5_eswitch_get_vepa returns -EPERM if the device lacks eswitch_manager capability, blocking mlx5e_bridge_getlink from retrieving VEPA mode. Since mlx5e_bridge_getlink implements ndo_bridge_getlink, returning -EPERM causes bridge link show to fail instead of skipping devices without this capability.
To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when mlx5_eswitch_get_vepa fails, ensuring the command continues processing other devices while ignoring those without the necessary capability.
--- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +2 -4
@@ -4891,11 +4891,9 @@ static int mlx5e_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,struct mlx5e_priv *priv =netdev_priv (dev);struct mlx5_core_dev *mdev = priv->mdev;u8 mode, setting; -int err; - err =mlx5_eswitch_get_vepa (mdev->priv.eswitch, &setting); -if (err) -return err; +if (mlx5_eswitch_get_vepa (mdev->priv.eswitch, &setting)) +return -EOPNOTSUPP ; mode = setting ?BRIDGE_MODE_VEPA :BRIDGE_MODE_VEB ; return ndo_dflt_bridge_getlink(skb, pid, seq, dev, mode,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/166 nvme-fc: go straight to connecting state when initializing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit d3d380eded7ee5fc2fc53b3b0e72365ded025c4a ]
The initial controller initialization mimiks the reconnect loop behavior by switching from NEW to RESETTING and then to CONNECTING.
The transition from NEW to CONNECTING is a valid transition, so there is no point entering the RESETTING state. TCP and RDMA also transition directly to CONNECTING state.
--- drivers/nvme/host/fc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/nvme/host/fc.c +1 -2
@@ -3553,8 +3553,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,list_add_tail (&ctrl->ctrl_list, &rport->ctrl_list);spin_unlock_irqrestore (&rport->lock, flags); -if (!nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_RESETTING ) || - !nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_CONNECTING )) { +if (!nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_CONNECTING )) {dev_err (ctrl->ctrl.device,"NVME-FC{%d}: failed to init ctrl state\n" , ctrl->cnum); goto fail_ctrl;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/166 nvme-fc: do not ignore connectivity loss during connecting
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit ee59e3820ca92a9f4307ae23dfc7229dc8b8d400 ]
When a connectivity loss occurs while nvme_fc_create_assocation is being executed, it's possible that the ctrl ends up stuck in the LIVE state:
1) nvme nvme10: NVME-FC{10}: create association : ...
2) nvme nvme10: NVME-FC{10}: controller connectivity lost. Awaiting Reconnect
nvme nvme10: queue_size 128 > ctrl maxcmd 32, reducing to maxcmd
3) nvme nvme10: Could not set queue count (880)
nvme nvme10: Failed to configure AEN (cfg 900)
4) nvme nvme10: NVME-FC{10}: controller connect complete
5) nvme nvme10: failed nvme_keep_alive_end_io error=4
A connection attempt starts 1) and the ctrl is in state CONNECTING. Shortly after the LLDD driver detects a connection lost event and calls nvme_fc_ctrl_connectivity_loss 2). Because we are still in CONNECTING state, this event is ignored.
nvme_fc_create_association continues to run in parallel and tries to communicate with the controller and these commands will fail. Though these errors are filtered out, e.g in 3) setting the I/O queues numbers fails which leads to an early exit in nvme_fc_create_io_queues. Because the number of IO queues is 0 at this point, there is nothing left in nvme_fc_create_association which could detected the connection drop. Thus the ctrl enters LIVE state 4).
Eventually the keep alive handler times out 5) but because nothing is being done, the ctrl stays in LIVE state.
There is already the ASSOC_FAILED flag to track connectivity loss event but this bit is set too late in the recovery code path. Move this into the connectivity loss event handler and synchronize it with the state change. This ensures that the ASSOC_FAILED flag is seen by nvme_fc_create_io_queues and it does not enter the LIVE state after a connectivity loss event. If the connectivity loss event happens after we entered the LIVE state the normal error recovery path is executed.
--- drivers/nvme/host/fc.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/nvme/host/fc.c +18 -5
@@ -782,11 +782,19 @@ nvme_fc_abort_lsops(struct nvme_fc_rport *rport)static void nvme_fc_ctrl_connectivity_loss (struct nvme_fc_ctrl *ctrl) { +enum nvme_ctrl_state state; +unsigned long flags; +dev_info (ctrl->ctrl.device,"NVME-FC{%d}: controller connectivity lost. Awaiting " "Reconnect" , ctrl->cnum); -switch (nvme_ctrl_state (&ctrl->ctrl)) { +spin_lock_irqsave (&ctrl->lock, flags); +set_bit (ASSOC_FAILED , &ctrl->flags); + state =nvme_ctrl_state (&ctrl->ctrl); +spin_unlock_irqrestore (&ctrl->lock, flags); + +switch (state) {case NVME_CTRL_NEW :case NVME_CTRL_LIVE :/*
@@ -2546,7 +2554,6 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)*/ if (state ==NVME_CTRL_CONNECTING ) {__nvme_fc_abort_outstanding_ios (ctrl, true); -set_bit (ASSOC_FAILED , &ctrl->flags);dev_warn (ctrl->ctrl.device,"NVME-FC{%d}: transport error during (re)connect\n" , ctrl->cnum);
@@ -3168,12 +3175,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)else ret =nvme_fc_recreate_io_queues (ctrl); } -if (!ret &&test_bit (ASSOC_FAILED , &ctrl->flags)) - ret = -EIO ;if (ret) goto out_term_aen_ops; - changed =nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_LIVE ); +spin_lock_irqsave (&ctrl->lock, flags); +if (!test_bit (ASSOC_FAILED , &ctrl->flags)) + changed =nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_LIVE ); +else + ret = -EIO ; +spin_unlock_irqrestore (&ctrl->lock, flags); + +if (ret) + goto out_term_aen_ops; ctrl->ctrl.nr_reconnects =0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/166 hrtimers: Mark is_migration_base() with __always_inline
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 27af31e44949fa85550176520ef7086a0d00fd7b ]
When is_migration_base() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:
kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
156 | static inline bool is_migration_base(struct hrtimer_clock_base *base)
| ^~~~~~~~~~~~~~~~~
Fix this by marking it with __always_inline.
[ tglx: Use __always_inline instead of __maybe_unused and move it into the
usage sites conditional ]
--- kernel/time/hrtimer.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
kernel/time/hrtimer.c +12 -10
@@ -145,11 +145,6 @@ static struct hrtimer_cpu_base migration_cpu_base = {#define migration_base migration_cpu_base.clock_base[0] -static inline bool is_migration_base (struct hrtimer_clock_base *base) -{ -return base == &migration_base; -} -/* * We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock * means that all timers which are tied to this base via timer->base are
@@ -275,11 +270,6 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base,#else /* CONFIG_SMP */ -static inline bool is_migration_base (struct hrtimer_clock_base *base) -{ -return false; -} -static inline struct hrtimer_clock_base *lock_hrtimer_base (const struct hrtimer *timer,unsigned long *flags) __acquires(&timer->base->cpu_base->lock)
@@ -1381,6 +1371,18 @@ static void hrtimer_sync_wait_running(struct hrtimer_cpu_base *cpu_base, } } +#ifdef CONFIG_SMP +static __always_inline bool is_migration_base(struct hrtimer_clock_base *base) +{ +return base == &migration_base; +} +#else +static __always_inline bool is_migration_base(struct hrtimer_clock_base *base) +{ +return false; +} +#endif +/* * This function is called on PREEMPT_RT kernels when the fast path * deletion of a timer failed because the timer callback function was
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/166 powercap: call put_device() on an error path in powercap_register_control_type()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joe Hattori <[email protected]>
[ Upstream commit 93c66fbc280747ea700bd6199633d661e3c819b3 ]
powercap_register_control_type() calls device_register(), but does not release the refcount of the device when it fails.
Call put_device() before returning an error to balance the refcount.
Since the kfree(control_type) will be done by powercap_release(), remove the lines in powercap_register_control_type() before returning the error.
This bug was found by an experimental verifier that I am developing.
--- drivers/powercap/powercap_sys.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/powercap/powercap_sys.c +1 -2
@@ -627,8 +627,7 @@ struct powercap_control_type *powercap_register_control_type(dev_set_name (&control_type->dev,"%s" , name); result =device_register (&control_type->dev);if (result) { -if (control_type->allocated) -kfree (control_type); +put_device (&control_type->dev);return ERR_PTR (result); }idr_init (&control_type->idr);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/166 iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengen Du <[email protected]>
[ Upstream commit 07e0d99a2f701123ad3104c0f1a1e66bce74d6e5 ]
When performing an iSCSI boot using IPv6, iscsistart still reads the /sys/firmware/ibft/ethernetX/subnet-mask entry. Since the IPv6 prefix length is 64, this causes the shift exponent to become negative, triggering a UBSAN warning. As the concept of a subnet mask does not apply to IPv6, the value is set to ~0 to suppress the warning message.
--- drivers/firmware/iscsi_ibft.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/iscsi_ibft.c +4 -1
@@ -310,7 +310,10 @@ static ssize_t ibft_attr_show_nic(void *data, int type, char *buf) str +=sprintf_ipaddr (str, nic->ip_addr);break ;case ISCSI_BOOT_ETH_SUBNET_MASK : - val =cpu_to_be32 (~((1 << (32 -nic->subnet_mask_prefix))-1 )); +if (nic->subnet_mask_prefix >32 ) + val =cpu_to_be32 (~0 ); +else + val =cpu_to_be32 (~((1 << (32 -nic->subnet_mask_prefix))-1 )); str +=sprintf (str,"%pI4" , &val);break ;case ISCSI_BOOT_ETH_PREFIX_LEN :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 41/166 sched/debug: Provide slice length for fair tasks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <[email protected]>
[ Upstream commit 9065ce69754dece78606c8bbb3821449272e56bf ]
Since commit:
857b158dc5e8 ("sched/eevdf: Use sched_attr::sched_runtime to set request/slice suggestion")
... we have the userspace per-task tunable slice length, which is a key parameter that is otherwise difficult to obtain, so provide it in /proc/$PID/sched.
[ mingo: Clarified the changelog. ]
--- kernel/sched/debug.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/sched/debug.c +2 -0
@@ -1089,6 +1089,8 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,if (task_has_dl_policy (p)) {P (dl.runtime);P (dl.deadline); + }else if (fair_policy (p->policy)) { +P (se.slice); }#undef PN_SCHEDSTAT#undef P_SCHEDSTAT
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 42/166 platform/x86/intel: pmc: fix ltr decode in pmc_core_ltr_show()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Kandybka <[email protected]>
[ Upstream commit 583ef25bb2a094813351a727ddec38b35a15b9f8 ]
In pmc_core_ltr_show(), promote 'val' to 'u64' to avoid possible integer overflow. Values (10 bit) are multiplied by the scale, the result of expression is in a range from 1 to 34,326,183,936 which is bigger then UINT32_MAX. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/platform/x86/intel/pmc/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/intel/pmc/core.c +2 -2
@@ -620,8 +620,8 @@ static u32 convert_ltr_scale(u32 val)static int pmc_core_ltr_show (struct seq_file *s,void *unused) {struct pmc_dev *pmcdev = s->private; -u64 decoded_snoop_ltr, decoded_non_snoop_ltr; -u32 ltr_raw_data, scale, val; +u64 decoded_snoop_ltr, decoded_non_snoop_ltr, val; +u32 ltr_raw_data, scale;u16 snoop_ltr, nonsnoop_ltr;int i, index, ltr_index =0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 43/166 scsi: core: Use GFP_NOIO to avoid circular locking dependency
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rik van Riel <[email protected]>
[ Upstream commit 5363ee9d110e139584c2d92a0b640bc210588506 ]
Filesystems can write to disk from page reclaim with __GFP_FS set. Marc found a case where scsi_realloc_sdev_budget_map() ends up in page reclaim with GFP_KERNEL, where it could try to take filesystem locks again, leading to a deadlock.
WARNING: possible circular locking dependency detected
6.13.0 #1 Not tainted
------------------------------------------------------
kswapd0/70 is trying to acquire lock:ffff8881025d5d78 (&q->q_usage_counter(io)){++++}-{0:0}, at: blk_mq_submit_bio+0x461/0x6e0
but task is already holding lock:ffffffff81ef5f40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x9f/0x760
The full lockdep splat can be found in Marc's report:
https://lkml.org/lkml/2025/1/24/1101
Avoid the potential deadlock by doing the allocation with GFP_NOIO, which prevents both filesystem and block layer recursion.
--- drivers/scsi/scsi_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_scan.c +1 -1
@@ -245,7 +245,7 @@ static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev, } ret =sbitmap_init_node (&sdev->budget_map,scsi_device_max_queue_depth (sdev), - new_shift,GFP_KERNEL , + new_shift,GFP_NOIO , sdev->request_queue->node, false, true);if (!ret)sbitmap_resize (&sdev->budget_map, depth);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 44/166 scsi: ufs: core: Fix error return with query response
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seunghui Lee <[email protected]>
[ Upstream commit 1a78a56ea65252bb089e0daace989167227f2d31 ]
There is currently no mechanism to return error from query responses. Return the error and print the corresponding error message with it.
--- drivers/ufs/core/ufshcd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +6 -1
@@ -3027,8 +3027,13 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)case UPIU_TRANSACTION_QUERY_RSP : {u8 response = lrbp->ucd_rsp_ptr->header.response; -if (response ==0 ) +if (response ==0 ) { err =ufshcd_copy_query_response (hba, lrbp); + }else { + err = -EINVAL ; +dev_err (hba->dev,"%s: unexpected response in Query RSP: %x\n" , + __func__, response); + }break ; }case UPIU_TRANSACTION_REJECT_UPIU :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/166 scsi: qla1280: Fix kernel oops when debug level > 2
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Magnus Lindholm <[email protected]>
[ Upstream commit 5233e3235dec3065ccc632729675575dbe3c6b8a ]
A null dereference or oops exception will eventually occur when qla1280.c driver is compiled with DEBUG_QLA1280 enabled and ql_debug_level > 2. I think its clear from the code that the intention here is sg_dma_len(s) not length of sg_next(s) when printing the debug info.
--- drivers/scsi/qla1280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla1280.c +1 -1
@@ -2866,7 +2866,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)dprintk (3 ,"S/G Segment phys_addr=%x %x, len=0x%x\n" ,cpu_to_le32 (upper_32_bits (dma_handle)),cpu_to_le32 (lower_32_bits (dma_handle)), -cpu_to_le32 (sg_dma_len (sg_next (s)))); +cpu_to_le32 (sg_dma_len (s))); remseg--; } dprintk(5, "qla1280_64bit_start_scsi: Scatter/gather "
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/166 ACPI: resource: IRQ override for Eluktronics MECH-17
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gannon Kolding <[email protected]>
[ Upstream commit 607ab6f85f4194b644ea95ac5fe660ef575db3b4 ]
The Eluktronics MECH-17 (GM7RG7N) needs IRQ overriding for the keyboard to work.
Adding a DMI_MATCH entry for this laptop model makes the internal keyboard function normally.
--- drivers/acpi/resource.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/acpi/resource.c +6 -0
@@ -549,6 +549,12 @@ static const struct dmi_system_id maingear_laptop[] = { DMI_MATCH(DMI_BOARD_NAME, "RP-15"), }, }, + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Eluktronics Inc." ), + DMI_MATCH(DMI_BOARD_NAME, "MECH-17"), + }, + }, {/* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */ .matches = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/166 smb: client: fix noisy when tree connecting to DFS interlink targets
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 773dc23ff81838b6f74d7fabba5a441cc6a93982 ]
When the client attempts to tree connect to a domain-based DFS namespace from a DFS interlink target, the server will return STATUS_BAD_NETWORK_NAME and the following will appear on dmesg:
CIFS: VFS: BAD_NETWORK_NAME: \\dom\dfs
Since a DFS share might contain several DFS interlinks and they expire after 10 minutes, the above message might end up being flooded on dmesg when mounting or accessing them.
Print this only once per share.
--- fs/smb/client/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/smb2pdu.c +1 -1
@@ -2162,7 +2162,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, tcon_error_exit:if (rsp && rsp->hdr.Status ==STATUS_BAD_NETWORK_NAME ) -cifs_tcon_dbg (VFS ,"BAD_NETWORK_NAME: %s\n" , tree); +cifs_dbg (VFS |ONCE ,"BAD_NETWORK_NAME: %s\n" , tree); goto tcon_exit; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/166 alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric W. Biederman <[email protected]>
[ Upstream commit b029628be267cba3c7684ec684749fe3e4372398 ]
Richard Henderson <[email protected]> writes[1]:
Quoted 11 lines
There was a Spec benchmark (I forget which) which was memory bound and ran twice as fast with 32-bit pointers.
I copied the idea from DEC to the ELF abi, but never did all the other work to allow the toolchain to take advantage.
Amusingly, a later Spec changed the benchmark data sets to not fit into a 32-bit address space, specifically because of this.
I expect one could delete the ELF bit and personality and no one would notice. Not even the 10 remaining Alpha users.
In [2] it was pointed out that parts of setarch weren't working properly on alpha because it has it's own SET_PERSONALITY implementation. In the discussion that followed Richard Henderson pointed out that the 32bit pointer support for alpha was never completed.
Fix this by removing alpha's 32bit pointer support.
As a bit of paranoia refuse to execute any alpha binaries that have the EF_ALPHA_32BIT flag set. Just in case someone somewhere has binaries that try to use alpha's 32bit pointer support.
--- arch/alpha/include/asm/elf.h | 6 +----- arch/alpha/include/asm/pgtable.h | 2 +- arch/alpha/include/asm/processor.h | 8 ++------ arch/alpha/kernel/osf_sys.c | 11 ++--------- 4 files changed, 6 insertions(+), 21 deletions(-)
arch/alpha/include/asm/elf.h +1 -5
@@ -74,7 +74,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];/* * This is used to ensure we don't load something for the wrong architecture. */ -#define elf_check_arch (x) ((x)->e_machine == EM_ALPHA) +#define elf_check_arch (x) (((x)->e_machine == EM_ALPHA) && !((x)->e_flags & EF_ALPHA_32BIT))/* * These are used to set parameters in the core dumps.
@@ -139,10 +139,6 @@ extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task); : amask (AMASK_CIX) ? "ev6" : "ev67"); \ }) -#define SET_PERSONALITY (EX ) \ - set_personality(((EX).e_flags & EF_ALPHA_32BIT) \ - ? PER_LINUX_32BIT : PER_LINUX) -extern int alpha_l1i_cacheshape;extern int alpha_l1d_cacheshape;extern int alpha_l2_cacheshape;
arch/alpha/include/asm/pgtable.h +1 -1
@@ -360,7 +360,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)extern void paging_init (void ); -/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT. */ +/* We have our own get_unmapped_area */ #define HAVE_ARCH_UNMAPPED_AREA #endif /* _ALPHA_PGTABLE_H */
arch/alpha/include/asm/processor.h +2 -6
@@ -8,23 +8,19 @@#ifndef __ASM_ALPHA_PROCESSOR_H#define __ASM_ALPHA_PROCESSOR_H -#include <linux/personality.h> /* for ADDR_LIMIT_32BIT */ -/* * We have a 42-bit user address space: 4TB user VM... */ #define TASK_SIZE (0x40000000000UL) -#define STACK_TOP \ - (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL) +#define STACK_TOP (0x00120000000UL)#define STACK_TOP_MAX 0x00120000000UL/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ -#define TASK_UNMAPPED_BASE \ - ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2) +#define TASK_UNMAPPED_BASE (TASK_SIZE / 2)/* This is dead. Everything has been moved to thread_info. */ struct thread_struct { };
arch/alpha/kernel/osf_sys.c +2 -9
@@ -1211,8 +1211,7 @@ SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)return ret; } -/* Get an address range which is currently unmapped. Similar to the -generic version except that we know how to honor ADDR_LIMIT_32BIT. */ +/* Get an address range which is currently unmapped. */ static unsigned long arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
@@ -1234,13 +1233,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { - unsigned long limit; - -/* "32 bit" actually means 31 bit, since pointers sign extend. */ -if (current->personality &ADDR_LIMIT_32BIT ) - limit =0x80000000 ; -else - limit =TASK_SIZE ; + unsigned long limit = TASK_SIZE;if (len > limit)return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/166 vboxsf: fix building with GCC 15
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brahmajit Das <[email protected]>
[ Upstream commit 4e7487245abcbc5a1a1aea54e4d3b33c53804bda ]
Building with GCC 15 results in build errorfs/vboxsf/super.c:24:54: error: initializer-string for array of ‘unsigned char’ is too long [-Werror=unterminated-string-initialization]
24 | static const unsigned char VBSF_MOUNT_SIGNATURE[4] = "\000\377\376\375";
| ^~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
Due to GCC having enabled -Werror=unterminated-string-initialization[0] by default. Separately initializing each array element of VBSF_MOUNT_SIGNATURE to ensure NUL termination, thus satisfying GCC 15 and fixing the build error.
[0]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-unterminated-string-initialization
--- fs/vboxsf/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/vboxsf/super.c +2 -1
@@ -21,7 +21,8 @@#define VBOXSF_SUPER_MAGIC 0x786f4256/* 'VBox' little endian */ -static const unsigned char VBSF_MOUNT_SIGNATURE [4 ] ="\000\377\376\375" ; +static const unsigned char VBSF_MOUNT_SIGNATURE [4 ] = {'\000' ,'\377' ,'\376' , +'\375' };static int follow_symlinks;module_param (follow_symlinks, int,0444 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/166 HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Lixu <[email protected]>
[ Upstream commit 4b54ae69197b9f416baa0fceadff7e89075f8454 ]
The timestamps in the Firmware log and HID sensor samples are incorrect. They show 1970-01-01 because the current IPC driver only uses the first 8 bytes of bootup time when synchronizing time with the firmware. The firmware converts the bootup time to UTC time, which results in the display of 1970-01-01.
In write_ipc_from_queue(), when sending the MNG_SYNC_FW_CLOCK message, the clock is updated according to the definition of ipc_time_update_msg. However, in _ish_sync_fw_clock(), the message length is specified as the size of uint64_t when building the doorbell. As a result, the firmware only receives the first 8 bytes of struct ipc_time_update_msg. This patch corrects the length in the doorbell to ensure the entire ipc_time_update_msg is sent, fixing the timestamp issue.
--- drivers/hid/intel-ish-hid/ipc/ipc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hid/intel-ish-hid/ipc/ipc.c +3 -3
@@ -577,14 +577,14 @@ static void fw_reset_work_fn(struct work_struct *unused)static void _ish_sync_fw_clock (struct ishtp_device *dev) {static unsigned long prev_sync; -uint64_t usec; +struct ipc_time_update_msg time = {};if (prev_sync &&time_before (jiffies, prev_sync +20 *HZ ))return ; prev_sync = jiffies; - usec =ktime_to_us (ktime_get_boottime ()); -ipc_send_mng_msg (dev,MNG_SYNC_FW_CLOCK , &usec,sizeof (uint64_t )); +/* The fields of time would be updated while sending message */ +ipc_send_mng_msg (dev,MNG_SYNC_FW_CLOCK , &time,sizeof (time)); }/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/166 HID: intel-ish-hid: Send clock sync message immediately after reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Lixu <[email protected]>
[ Upstream commit 7e0d1cff12b895f44f4ddc8cf50311bc1f775201 ]
The ISH driver performs a clock sync with the firmware once at system startup and then every 20 seconds. If a firmware reset occurs right after a clock sync, the driver would wait 20 seconds before performing another clock sync with the firmware. This is particularly problematic with the introduction of the "load firmware from host" feature, where the driver performs a clock sync with the bootloader and then has to wait 20 seconds before syncing with the main firmware.
This patch clears prev_sync immediately upon receiving an IPC reset, so that the main firmware and driver will perform a clock sync immediately after completing the IPC handshake.
--- drivers/hid/intel-ish-hid/ipc/ipc.c | 9 ++++++--- drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-)
drivers/hid/intel-ish-hid/ipc/ipc.c +6 -3
@@ -517,6 +517,10 @@ static int ish_fw_reset_handler(struct ishtp_device *dev)/* ISH FW is dead */ if (!ish_is_input_ready (dev))return -EPIPE ; + +/* Send clock sync at once after reset */ + ishtp_dev->prev_sync =0 ; +/* * Set HOST2ISH.ILUP. Apparently we need this BEFORE sending * RESET_NOTIFY_ACK - FW will be checking for it
@@ -576,13 +580,12 @@ static void fw_reset_work_fn(struct work_struct *unused)*/ static void _ish_sync_fw_clock (struct ishtp_device *dev) { -static unsigned long prev_sync;struct ipc_time_update_msg time = {}; -if (prev_sync &&time_before (jiffies, prev_sync +20 *HZ )) +if (dev->prev_sync &&time_before (jiffies, dev->prev_sync +20 *HZ ))return ; - prev_sync = jiffies; + dev->prev_sync = jiffies;/* The fields of time would be updated while sending message */ ipc_send_mng_msg (dev,MNG_SYNC_FW_CLOCK , &time,sizeof (time)); }
drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h +2 -0
@@ -212,6 +212,8 @@ struct ishtp_device {unsigned int ipc_tx_cnt;unsigned long long ipc_tx_bytes_cnt; +/* Time of the last clock sync */ +unsigned long prev_sync;const struct ishtp_hw_ops *ops;size_t mtu;uint32_t ishtp_msg_hdr;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 52/166 HID: ignore non-functional sensor in HP 5MP Camera
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chia-Lin Kao (AceLan) <[email protected]>
[ Upstream commit 363236d709e75610b628c2a4337ccbe42e454b6d ]
The HP 5MP Camera (USB ID 0408:5473) reports a HID sensor interface that is not actually implemented. Attempting to access this non-functional sensor via iio_info causes system hangs as runtime PM tries to wake up an unresponsive sensor.
[453] hid-sensor-hub 0003:0408:5473.0003: Report latency attributes: ffffffff:ffffffff
[453] hid-sensor-hub 0003:0408:5473.0003: common attributes: 5:1, 2:1, 3:1 ffffffff:ffffffff
Add this device to the HID ignore list since the sensor interface is non-functional by design and should not be exposed to userspace.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-quirks.c | 1 + 2 files changed, 2 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -1085,6 +1085,7 @@#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003 0x3003#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008 +#define USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473 0x5473#define I2C_VENDOR_ID_RAYDIUM 0x2386#define I2C_PRODUCT_ID_RAYDIUM_4B33 0x4b33
drivers/hid/hid-quirks.c +1 -0
@@ -891,6 +891,7 @@ static const struct hid_device_id hid_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_DPAD) }, #endif { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, + { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) }, { } };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 53/166 usb: phy: generic: Use proper helper for property detection
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit 309005e448c1f3e4b81e4416406991b7c3339c1d ]
Since commit c141ecc3cecd7 ("of: Warn when of_property_read_bool() is used on non-boolean properties") a warning is raised if this function is used for property detection. of_property_present() is the correct helper for this.
--- drivers/usb/phy/phy-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/phy-generic.c +1 -1
@@ -217,7 +217,7 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)if (of_property_read_u32 (node,"clock-frequency" , &clk_rate)) clk_rate =0 ; - needs_clk =of_property_read_bool (node,"clocks" ); + needs_clk =of_property_present (node,"clocks" ); } nop->gpiod_reset =devm_gpiod_get_optional (dev,"reset" ,GPIOD_ASIS );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 54/166 HID: topre: Fix n-key rollover on Realforce R3S TKL boards
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Brackenbury <[email protected]>
[ Upstream commit 9271af9d846c7e49c8709b58d5853cb73c00b193 ]
Newer model R3* Topre Realforce keyboards share an issue with their older R2 cousins where a report descriptor fixup is needed in order for n-key rollover to work correctly, otherwise only 6-key rollover is available. This patch adds some new hardware IDs for the R3S 87-key keyboard and makes amendments to the existing hid-topre driver in order to change the correct byte in the new model.
--- drivers/hid/Kconfig | 3 ++- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-topre.c | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-)
drivers/hid/Kconfig +2 -1
@@ -1151,7 +1151,8 @@ config HID_TOPRE tristate "Topre REALFORCE keyboards" depends on HID help - Say Y for N-key rollover support on Topre REALFORCE R2 108/87 key keyboards. + Say Y for N-key rollover support on Topre REALFORCE R2 108/87 key and + Topre REALFORCE R3S 87 key keyboards. config HID_THINGM tristate "ThingM blink(1) USB RGB LED"
drivers/hid/hid-ids.h +1 -0
@@ -1285,6 +1285,7 @@#define USB_VENDOR_ID_TOPRE 0x0853#define USB_DEVICE_ID_TOPRE_REALFORCE_R2_108 0x0148#define USB_DEVICE_ID_TOPRE_REALFORCE_R2_87 0x0146 +#define USB_DEVICE_ID_TOPRE_REALFORCE_R3S_87 0x0313#define USB_VENDOR_ID_TOPSEED 0x0766#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204
drivers/hid/hid-topre.c +7 -0
@@ -29,6 +29,11 @@ static __u8 *topre_report_fixup(struct hid_device *hdev, __u8 *rdesc,hid_info (hdev,"fixing up Topre REALFORCE keyboard report descriptor\n" ); rdesc[72 ] =0x02 ; + }else if (*rsize >=106 && rdesc[28 ] ==0x29 && rdesc[29 ] ==0xe7 && + rdesc[30 ] ==0x81 && rdesc[31 ] ==0x00 ) { +hid_info (hdev, +"fixing up Topre REALFORCE keyboard report descriptor\n" ); + rdesc[31 ] =0x02 ; }return rdesc; }
@@ -38,6 +43,8 @@ static const struct hid_device_id topre_id_table[] = { USB_DEVICE_ID_TOPRE_REALFORCE_R2_108) }, { HID_USB_DEVICE(USB_VENDOR_ID_TOPRE, USB_DEVICE_ID_TOPRE_REALFORCE_R2_87) }, + { HID_USB_DEVICE(USB_VENDOR_ID_TOPRE, + USB_DEVICE_ID_TOPRE_REALFORCE_R3S_87) }, { } }; MODULE_DEVICE_TABLE(hid, topre_id_table);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 55/166 HID: hid-apple: Apple Magic Keyboard a3203 USB-C support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ievgen Vovk <[email protected]>
[ Upstream commit 2813e00dcd748cef47d2bffaa04071de93fddf00 ]
Add Apple Magic Keyboard 2024 model (with USB-C port) device ID (0320) to those recognized by the hid-apple driver. Keyboard is otherwise compatible with the existing implementation for its earlier 2021 model.
--- drivers/hid/hid-apple.c | 5 +++++ drivers/hid/hid-ids.h | 1 + 2 files changed, 6 insertions(+)
drivers/hid/hid-apple.c +5 -0
@@ -459,6 +459,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015) table = magic_keyboard_2015_fn_keys; else if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 || + hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 || hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 || hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021) table = apple2021_fn_keys;
@@ -1064,6 +1065,10 @@ static const struct hid_device_id apple_devices[] = { .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021), .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024), + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, + { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024), + .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021), .driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK | APPLE_RDESC_BATTERY }, { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021),
drivers/hid/hid-ids.h +1 -0
@@ -184,6 +184,7 @@#define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242#define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c +#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2024 0x0320#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f#define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 56/166 HID: apple: fix up the F6 key on the Omoton KB066 keyboard
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Henrie <[email protected]>
[ Upstream commit 819083cb6eedcc8495cbf84845877bcc741b93b3 ]
The Omoton KB066 is an Apple A1255 keyboard clone (HID product code 05ac:022c). On both keyboards, the F6 key becomes Num Lock when the Fn key is held. But unlike its Apple exemplar, when the Omoton's F6 key is pressed without Fn, it sends the usage code 0xC0301 from the reserved section of the consumer page instead of the standard F6 usage code 0x7003F from the keyboard page. The nonstandard code is translated to KEY_UNKNOWN and becomes useless on Linux. The Omoton KB066 is a pretty popular keyboard, judging from its 29,058 reviews on Amazon at time of writing, so let's account for its quirk to make it more usable.
By the way, it would be nice if we could automatically set fnmode to 0 for Omoton keyboards because they handle the Fn key internally and the kernel's Fn key handling creates undesirable side effects such as making F1 and F2 always Brightness Up and Brightness Down in fnmode=1 (the default) or always F1 and F2 in fnmode=2. Unfortunately I don't think there's a way to identify Bluetooth keyboards more specifically than the HID product code which is obviously inaccurate. Users of Omoton keyboards will just have to set fnmode to 0 manually to get full Fn key functionality.
--- drivers/hid/hid-apple.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hid/hid-apple.c +3 -0
@@ -531,6 +531,9 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, } } +if (usage->hid ==0xc0301 )/* Omoton KB066 quirk */ + code =KEY_F6 ; +if (usage->code != code) {input_event_with_scancode (input, usage->type, code, usage->hid, value);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 57/166 objtool: Ignore dangling jump table entries
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Poimboeuf <[email protected]>
[ Upstream commit 3724062ca2b1364f02cf44dbea1a552227844ad1 ]
Clang sometimes leaves dangling unused jump table entries which point to the end of the function. Ignore them.
--- tools/objtool/check.c | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/objtool/check.c +9 -0
@@ -2028,6 +2028,14 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, reloc_addend(reloc) == pfunc->offset)break ; +/* +* Clang sometimes leaves dangling unused jump table entries +* which point to the end of the function. Ignore them. +*/ +if (reloc->sym->sec == pfunc->sec && +reloc_addend (reloc) == pfunc->offset + pfunc->len) + goto next; + dest_insn =find_insn (file, reloc->sym->sec,reloc_addend (reloc));if (!dest_insn)break ;
@@ -2045,6 +2053,7 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, alt->insn = dest_insn; alt->next = insn->alts; insn->alts = alt; +next: prev_offset =reloc_offset (reloc); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 58/166 sched: Clarify wake_up_q()s write to task->wake_q.next
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <[email protected]>
[ Upstream commit bcc6244e13b4d4903511a1ea84368abf925031c0 ]
Clarify that wake_up_q() does an atomic write to task->wake_q.next, after which a concurrent __wake_q_add() can immediately overwrite task->wake_q.next again.
--- kernel/sched/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/sched/core.c +3 -2
@@ -1019,9 +1019,10 @@ void wake_up_q(struct wake_q_head *head)struct task_struct *task; task = container_of(node, struct task_struct, wake_q); -/* Task can safely be re-inserted now: */ node = node->next; - task->wake_q.next =NULL ; +/* pairs with cmpxchg_relaxed() in __wake_q_add() */ +WRITE_ONCE (task->wake_q.next,NULL ); +/* Task can safely be re-inserted now. */ /* * wake_up_process() executes a full barrier, which pairs with
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 59/166 platform/x86: thinkpad_acpi: Fix invalid fan speed on ThinkPad X120e
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sybil Isabel Dorsett <[email protected]>
[ Upstream commit 1046cac109225eda0973b898e053aeb3d6c10e1d ]
On ThinkPad X120e, fan speed is reported in ticks per revolution rather than RPM.
Recalculate the fan speed value reported for ThinkPad X120e to RPM based on a 22.5 kHz clock.
Based on the information on
https://www.thinkwiki.org/wiki/How_to_control_fan_speed,
the same problem is highly likely to be relevant to at least Edge11, but Edge11 is not addressed in this patch.
--- drivers/platform/x86/thinkpad_acpi.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +14 -2
@@ -7961,6 +7961,7 @@ static struct ibm_struct volume_driver_data = {#define FAN_NS_CTRL_STATUS BIT(2)/* Bit which determines control is enabled or not */ #define FAN_NS_CTRL BIT(4)/* Bit which determines control is by host or EC */ +#define FAN_CLOCK_TPM (22500*60)/* Ticks per minute for a 22.5 kHz clock */ enum {/* Fan control constants */ fan_status_offset =0x2f ,/* EC register 0x2f */
@@ -8014,6 +8015,7 @@ static int fan_watchdog_maxinterval;static bool fan_with_ns_addr;static bool ecfw_with_fan_dec_rpm; +static bool fan_speed_in_tpr;static struct mutex fan_mutex;
@@ -8195,8 +8197,11 @@ static int fan_get_speed(unsigned int *speed) !acpi_ec_read(fan_rpm_offset + 1, &hi)))return -EIO ; -if (likely (speed)) +if (likely (speed)) { *speed = (hi <<8 ) | lo; +if (fan_speed_in_tpr && *speed !=0 ) + *speed =FAN_CLOCK_TPM / *speed; + }break ;case TPACPI_FAN_RD_TPEC_NS :if (!acpi_ec_read (fan_rpm_status_ns, &lo))
@@ -8229,8 +8234,11 @@ static int fan2_get_speed(unsigned int *speed)if (rc)return -EIO ; -if (likely (speed)) +if (likely (speed)) { *speed = (hi <<8 ) | lo; +if (fan_speed_in_tpr && *speed !=0 ) + *speed =FAN_CLOCK_TPM / *speed; + }break ;case TPACPI_FAN_RD_TPEC_NS :
@@ -8758,6 +8766,7 @@ static const struct attribute_group fan_driver_attr_group = {#define TPACPI_FAN_NOFAN 0x0008/* no fan available */ #define TPACPI_FAN_NS 0x0010/* For EC with non-Standard register addresses */ #define TPACPI_FAN_DECRPM 0x0020/* For ECFW's with RPM in register as decimal */ +#define TPACPI_FAN_TPR 0x0040/* Fan speed is in Ticks Per Revolution */ static const struct tpacpi_quirk fan_quirk_table[]__initconst = {TPACPI_QEC_IBM ('1' ,'Y' ,TPACPI_FAN_Q1 ),
@@ -8780,6 +8789,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {TPACPI_Q_LNV3 ('N' ,'2' ,'U' ,TPACPI_FAN_NS ),/* X13 Yoga Gen 2*/ TPACPI_Q_LNV3 ('N' ,'1' ,'O' ,TPACPI_FAN_NOFAN ),/* X1 Tablet (2nd gen) */ TPACPI_Q_LNV3 ('R' ,'0' ,'Q' ,TPACPI_FAN_DECRPM ),/* L480 */ + TPACPI_Q_LNV('8', 'F', TPACPI_FAN_TPR), /* ThinkPad x120e */ };static int __init fan_init (struct ibm_init_struct *iibm)
@@ -8843,6 +8853,8 @@ static int __init fan_init(struct ibm_init_struct *iibm)if (quirks &TPACPI_FAN_Q1 )fan_quirk1_setup (); +if (quirks &TPACPI_FAN_TPR ) + fan_speed_in_tpr = true;/* Try and probe the 2nd fan */ tp_features.second_fan =1 ;/* needed for get_speed to work */ res =fan2_get_speed (&speed);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 60/166 platform/x86: thinkpad_acpi: Support for V9 DYTC platform profiles
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Pearson <[email protected]>
[ Upstream commit 9cff907cbf8c7fb5345918dbcc7b74a01656f34f ]
Newer Thinkpad AMD platforms are using V9 DYTC and this changes the profiles used for PSC mode. Add support for this update. Tested on P14s G5 AMD
--- drivers/platform/x86/thinkpad_acpi.c | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +22 -12
@@ -10283,6 +10283,10 @@ static struct ibm_struct proxsensor_driver_data = {#define DYTC_MODE_PSC_BALANCE 5/* Default mode aka balanced */ #define DYTC_MODE_PSC_PERFORM 7/* High power mode aka performance */ +#define DYTC_MODE_PSCV9_LOWPOWER 1/* Low power mode */ +#define DYTC_MODE_PSCV9_BALANCE 3/* Default mode aka balanced */ +#define DYTC_MODE_PSCV9_PERFORM 4/* High power mode aka performance */ +#define DYTC_ERR_MASK 0xF/* Bits 0-3 in cmd result are the error result */ #define DYTC_ERR_SUCCESS 1/* CMD completed successful */
@@ -10303,6 +10307,10 @@ static int dytc_capabilities;static bool dytc_mmc_get_available;static int profile_force; +static int platform_psc_profile_lowpower =DYTC_MODE_PSC_LOWPOWER ; +static int platform_psc_profile_balanced =DYTC_MODE_PSC_BALANCE ; +static int platform_psc_profile_performance =DYTC_MODE_PSC_PERFORM ; +static int convert_dytc_to_profile (int funcmode,int dytcmode,enum platform_profile_option *profile) {
@@ -10324,19 +10332,15 @@ static int convert_dytc_to_profile(int funcmode, int dytcmode, }return 0 ;case DYTC_FUNCTION_PSC : -switch (dytcmode) { -case DYTC_MODE_PSC_LOWPOWER : +if (dytcmode == platform_psc_profile_lowpower) *profile =PLATFORM_PROFILE_LOW_POWER ; -break ; -case DYTC_MODE_PSC_BALANCE : +else if (dytcmode == platform_psc_profile_balanced) *profile =PLATFORM_PROFILE_BALANCED ; -break ; -case DYTC_MODE_PSC_PERFORM : +else if (dytcmode == platform_psc_profile_performance) *profile =PLATFORM_PROFILE_PERFORMANCE ; -break ; -default :/* Unknown mode */ +else return -EINVAL ; - } +return 0 ;case DYTC_FUNCTION_AMT :/* For now return balanced. It's the closest we have to 'auto' */
@@ -10357,19 +10361,19 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *peif (dytc_capabilities &BIT (DYTC_FC_MMC )) *perfmode =DYTC_MODE_MMC_LOWPOWER ;else if (dytc_capabilities &BIT (DYTC_FC_PSC )) - *perfmode =DYTC_MODE_PSC_LOWPOWER ; + *perfmode = platform_psc_profile_lowpower;break ;case PLATFORM_PROFILE_BALANCED :if (dytc_capabilities &BIT (DYTC_FC_MMC )) *perfmode =DYTC_MODE_MMC_BALANCE ;else if (dytc_capabilities &BIT (DYTC_FC_PSC )) - *perfmode =DYTC_MODE_PSC_BALANCE ; + *perfmode = platform_psc_profile_balanced;break ;case PLATFORM_PROFILE_PERFORMANCE :if (dytc_capabilities &BIT (DYTC_FC_MMC )) *perfmode =DYTC_MODE_MMC_PERFORM ;else if (dytc_capabilities &BIT (DYTC_FC_PSC )) - *perfmode =DYTC_MODE_PSC_PERFORM ; + *perfmode = platform_psc_profile_performance;break ;default :/* Unknown profile */ return -EOPNOTSUPP ;
@@ -10558,6 +10562,7 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)if (output &BIT (DYTC_QUERY_ENABLE_BIT )) dytc_version = (output >>DYTC_QUERY_REV_BIT ) &0xF ; +dbg_printk (TPACPI_DBG_INIT ,"DYTC version %d\n" , dytc_version);/* Check DYTC is enabled and supports mode setting */ if (dytc_version <5 )return -ENODEV ;
@@ -10596,6 +10601,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm) } }else if (dytc_capabilities &BIT (DYTC_FC_PSC )) {/* PSC MODE */ pr_debug ("PSC is supported\n" ); +if (dytc_version >=9 ) {/* update profiles for DYTC 9 and up */ + platform_psc_profile_lowpower =DYTC_MODE_PSCV9_LOWPOWER ; + platform_psc_profile_balanced =DYTC_MODE_PSCV9_BALANCE ; + platform_psc_profile_performance =DYTC_MODE_PSCV9_PERFORM ; + } }else {dbg_printk (TPACPI_DBG_INIT ,"No DYTC support available\n" );return -ENODEV ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 61/166 s390/cio: Fix CHPID "configure" attribute caching
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Oberparleiter <[email protected]>
[ Upstream commit 32ae4a2992529e2c7934e422035fad1d9b0f1fb5 ]
In some environments, the SCLP firmware interface used to query a CHPID's configured state is not supported. On these environments, rapidly reading the corresponding sysfs attribute produces inconsistent results:
$ cat /sys/devices/css0/chp0.00/configure cat: /sys/devices/css0/chp0.00/configure: Operation not supported $ cat /sys/devices/css0/chp0.00/configure 3
This occurs for example when Linux is run as a KVM guest. The inconsistency is a result of CIO using cached results for generating the value of the "configure" attribute while failing to handle the situation where no data was returned by SCLP.
Fix this by not updating the cache-expiration timestamp when SCLP returns no data. With the fix applied, the system response is consistent:
$ cat /sys/devices/css0/chp0.00/configure cat: /sys/devices/css0/chp0.00/configure: Operation not supported $ cat /sys/devices/css0/chp0.00/configure cat: /sys/devices/css0/chp0.00/configure: Operation not supported
--- drivers/s390/cio/chp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/cio/chp.c +2 -1
@@ -661,7 +661,8 @@ static int info_update(void)if (time_after (jiffies, chp_info_expires)) {/* Data is too old, update. */ rc =sclp_chp_read_info (&chp_info); - chp_info_expires = jiffies +CHP_INFO_UPDATE_INTERVAL ; +if (!rc) + chp_info_expires = jiffies +CHP_INFO_UPDATE_INTERVAL ; }mutex_unlock (&info_lock);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 62/166 thermal/cpufreq_cooling: Remove structure member documentation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Lezcano <[email protected]>
[ Upstream commit a6768c4f92e152265590371975d44c071a5279c7 ]
The structure member documentation refers to a member which does not exist any more. Remove it.
--- drivers/thermal/cpufreq_cooling.c | 2 -- 1 file changed, 2 deletions(-)
drivers/thermal/cpufreq_cooling.c +0 -2
@@ -57,8 +57,6 @@ struct time_in_idle {* @max_level: maximum cooling level. One less than total number of valid * cpufreq frequencies. * @em: Reference on the Energy Model of the device -* @cdev: thermal_cooling_device pointer to keep track of the -* registered cooling device. * @policy: cpufreq policy. * @cooling_ops: cpufreq callbacks to thermal cooling device ops * @idle_time: idle time stats
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 63/166 Xen/swiotlb: mark xen_swiotlb_fixup() __init
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Beulich <[email protected]>
[ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ]
It's sole user (pci_xen_swiotlb_init()) is __init, too.
Message-ID: <[email protected]>
--- drivers/xen/swiotlb-xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/swiotlb-xen.c +1 -1
@@ -112,7 +112,7 @@ static int is_xen_swiotlb_buffer(struct device *dev, dma_addr_t dma_addr) }#ifdef CONFIG_X86 -int xen_swiotlb_fixup (void *buf,unsigned long nslabs) +int __init xen_swiotlb_fixup (void *buf,unsigned long nslabs) {int rc;unsigned int order =get_order (IO_TLB_SEGSIZE <<IO_TLB_SHIFT );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 64/166 Bluetooth: L2CAP: Fix slab-use-after-free Read in l2cap_send_cmd
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit b4f82f9ed43aefa79bec2504ae8c29be0c0f5d1d ]
After the hci sync command releases l2cap_conn, the hci receive data work queue references the released l2cap_conn when sending to the upper layer. Add hci dev lock to the hci receive data work queue to synchronize the two.
[1]
BUG: KASAN: slab-use-after-free in l2cap_send_cmd+0x187/0x8d0 net/bluetooth/l2cap_core.c:954 Read of size 8 at addr ffff8880271a4000 by task kworker/u9:2/5837 CPU: 0 UID: 0 PID: 5837 Comm: kworker/u9:2 Not tainted 6.13.0-rc5-syzkaller-00163-gab75170520d4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: hci1 hci_rx_work Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 l2cap_build_cmd net/bluetooth/l2cap_core.c:2964 [inline] l2cap_send_cmd+0x187/0x8d0 net/bluetooth/l2cap_core.c:954 l2cap_sig_send_rej net/bluetooth/l2cap_core.c:5502 [inline] l2cap_sig_channel net/bluetooth/l2cap_core.c:5538 [inline] l2cap_recv_frame+0x221f/0x10db0 net/bluetooth/l2cap_core.c:6817 hci_acldata_packet net/bluetooth/hci_core.c:3797 [inline] hci_rx_work+0x508/0xdb0 net/bluetooth/hci_core.c:4040 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 </TASK> Allocated by task 5837: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4329 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] l2cap_conn_add+0xa9/0x8e0 net/bluetooth/l2cap_core.c:6860 l2cap_connect_cfm+0x115/0x1090 net/bluetooth/l2cap_core.c:7239 hci_connect_cfm include/net/bluetooth/hci_core.h:2057 [inline] hci_remote_features_evt+0x68e/0xac0 net/bluetooth/hci_event.c:3726 hci_event_func net/bluetooth/hci_event.c:7473 [inline] hci_event_packet+0xac2/0x1540 net/bluetooth/hci_event.c:7525 hci_rx_work+0x3f3/0xdb0 net/bluetooth/hci_core.c:4035 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Freed by task 54: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kfree+0x196/0x430 mm/slub.c:4761 l2cap_connect_cfm+0xcc/0x1090 net/bluetooth/l2cap_core.c:7235 hci_connect_cfm include/net/bluetooth/hci_core.h:2057 [inline] hci_conn_failed+0x287/0x400 net/bluetooth/hci_conn.c:1266 hci_abort_conn_sync+0x56c/0x11f0 net/bluetooth/hci_sync.c:5603 hci_cmd_sync_work+0x22b/0x400 net/bluetooth/hci_sync.c:332 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
--- net/bluetooth/l2cap_core.c | 39 +++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-)
net/bluetooth/l2cap_core.c +34 -5
@@ -949,6 +949,16 @@ static u8 l2cap_get_ident(struct l2cap_conn *conn)return id; } +static void l2cap_send_acl (struct l2cap_conn *conn,struct sk_buff *skb, +u8 flags) +{ +/* Check if the hcon still valid before attempting to send */ +if (hci_conn_valid (conn->hcon->hdev, conn->hcon)) +hci_send_acl (conn->hchan, skb, flags); +else +kfree_skb (skb); +} +static void l2cap_send_cmd (struct l2cap_conn *conn,u8 ident,u8 code,u16 len,void *data) {
@@ -971,7 +981,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len,bt_cb (skb)->force_active =BT_POWER_FORCE_ACTIVE_ON ; skb->priority =HCI_PRIO_MAX ; -hci_send_acl (conn->hchan, skb, flags); +l2cap_send_acl (conn, skb, flags); }static void l2cap_do_send (struct l2cap_chan *chan,struct sk_buff *skb)
@@ -1793,13 +1803,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)mutex_unlock (&conn->chan_lock); -hci_chan_del (conn->hchan); -if (conn->info_state &L2CAP_INFO_FEAT_MASK_REQ_SENT )cancel_delayed_work_sync (&conn->info_timer); hcon->l2cap_data =NULL ; - conn->hchan =NULL ;l2cap_conn_put (conn); }
@@ -1807,6 +1814,7 @@ static void l2cap_conn_free(struct kref *ref) { struct l2cap_conn *conn = container_of(ref, struct l2cap_conn, ref); +hci_chan_del (conn->hchan);hci_conn_put (conn->hcon);kfree (conn); }
@@ -7478,14 +7486,33 @@ static void l2cap_recv_reset(struct l2cap_conn *conn) conn->rx_len =0 ; } +static struct l2cap_conn *l2cap_conn_hold_unless_zero (struct l2cap_conn *c) +{ +BT_DBG ("conn %p orig refcnt %u" , c,kref_read (&c->ref)); + +if (!kref_get_unless_zero (&c->ref)) +return NULL ; + +return c; +} +void l2cap_recv_acldata (struct hci_conn *hcon,struct sk_buff *skb,u16 flags) { -struct l2cap_conn *conn = hcon->l2cap_data; +struct l2cap_conn *conn;int len; +/* Lock hdev to access l2cap_data to avoid race with l2cap_conn_del */ +hci_dev_lock (hcon->hdev); + + conn = hcon->l2cap_data; +if (!conn) conn =l2cap_conn_add (hcon); + conn =l2cap_conn_hold_unless_zero (conn); + +hci_dev_unlock (hcon->hdev); +if (!conn) goto drop;
@@ -7577,6 +7604,8 @@ void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)break ; } +l2cap_conn_put (conn); + drop:kfree_skb (skb); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 65/166 selftests/bpf: Fix invalid flag of recv()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiayuan Chen <[email protected]>
[ Upstream commit a0c11149509aa905aeec10cf9998091443472b0b ]
SOCK_NONBLOCK flag is only effective during socket creation, not during recv. Use MSG_DONTWAIT instead.
--- tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/bpf/prog_tests/sockmap_basic.c +3 -3
@@ -402,8 +402,8 @@ static void test_sockmap_skb_verdict_shutdown(void)if (!ASSERT_EQ (err,1 ,"epoll_wait(fd)" )) goto out_close; - n =recv (c1, &b,1 ,SOCK_NONBLOCK ); -ASSERT_EQ (n,0 ,"recv_timeout(fin)" ); + n =recv (c1, &b,1 ,MSG_DONTWAIT ); +ASSERT_EQ (n,0 ,"recv(fin)" ); out_close:close (c1);close (p1);
@@ -459,7 +459,7 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog)ASSERT_EQ (avail, expected,"ioctl(FIONREAD)" );/* On DROP test there will be no data to read */ if (pass_prog) { - recvd =recv_timeout (c1, &buf,sizeof (buf),SOCK_NONBLOCK ,IO_TIMEOUT_SEC ); + recvd =recv_timeout (c1, &buf,sizeof (buf),MSG_DONTWAIT ,IO_TIMEOUT_SEC );ASSERT_EQ (recvd,sizeof (buf),"recv_timeout(c0)" ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 66/166 ASoC: simple-card-utils.c: add missing dlc->of_node
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <[email protected]>
[ Upstream commit dabbd325b25edb5cdd99c94391817202dd54b651 ]
commit 90de551c1bf ("ASoC: simple-card-utils.c: enable multi Component support") added muiti Component support, but was missing to add dlc->of_node. Because of it, Sound device list will indicates strange name if it was DPCM connection and driver supports dai->driver->dai_args, like below
> aplay -l card X: sndulcbmix [xxxx], device 0: fe.(null).rsnd-dai.0 (*) [] ... ^^^^^^
It will be fixed by this patch
> aplay -l card X: sndulcbmix [xxxx], device 0: [email protected] (*) [] ... ^^^^^^^^^^^^^^
--- sound/soc/generic/simple-card-utils.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/generic/simple-card-utils.c +1 -0
@@ -1086,6 +1086,7 @@ int asoc_graph_parse_dai(struct device *dev, struct device_node *ep, args.np = ep; dai =snd_soc_get_dai_via_args (&args);if (dai) { + dlc->of_node = node; dlc->dai_name =snd_soc_dai_name_get (dai); dlc->dai_args =snd_soc_copy_dai_args (dev, &args);if (!dlc->dai_args)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 67/166 ALSA: hda/realtek: Limit mic boost on Positivo ARN50
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edson Juliano Drosdeck <[email protected]>
[ Upstream commit 76b0a22d4cf7dc9091129560fdc04e73eb9db4cb ]
The internal mic boost on the Positivo ARN50 is too high.
Fix this by applying the ALC269_FIXUP_LIMIT_INT_MIC_BOOST fixup to the machine to limit the gain.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -10527,6 +10527,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1d72 ,0x1945 ,"Redmi G" ,ALC256_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1d72 ,0x1947 ,"RedmiBook Air" ,ALC255_FIXUP_XIAOMI_HEADSET_MIC ),SND_PCI_QUIRK (0x1f66 ,0x0105 ,"Ayaneo Portable Game Player" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x2014 ,0x800a ,"Positivo ARN50" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x2782 ,0x0214 ,"VAIO VJFE-CL" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x2782 ,0x0228 ,"Infinix ZERO BOOK 13" ,ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13 ), SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 68/166 ASoC: rsnd: indicate unsupported clock rate
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <[email protected]>
[ Upstream commit 796106e29e5df6cd4b4e2b51262a8a19e9fa0625 ]
It will indicate "unsupported clock rate" when setup clock failed. But it is unclear what kind of rate was failed. Indicate it.
--- sound/soc/sh/rcar/ssi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/sh/rcar/ssi.c +2 -1
@@ -334,7 +334,8 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,return 0 ; rate_err: -dev_err (dev,"unsupported clock rate\n" ); +dev_err (dev,"unsupported clock rate (%d)\n" , rate); +return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 69/166 ASoC: rsnd: dont indicate warning on rsnd_kctrl_accept_runtime()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <[email protected]>
[ Upstream commit c3fc002b206c6c83d1e3702b979733002ba6fb2c ]
rsnd_kctrl_accept_runtime() (1) is used for runtime convert rate (= Synchronous SRC Mode). Now, rsnd driver has 2 kctrls for it
(A): "SRC Out Rate Switch"
(B): "SRC Out Rate" // it calls (1)
(A): can be called anytime
(B): can be called only runtime, and will indicate warning if it was used
at non-runtime.
To use runtime convert rate (= Synchronous SRC Mode), user might uses command in below order.
(X): > amixer set "SRC Out Rate" on
> aplay xxx.wav &
(Y): > amixer set "SRC Out Rate" 48010 // convert rate to 48010Hz
(Y): calls B
(X): calls both A and B.
In this case, when user calls (X), it calls both (A) and (B), but it is not yet start running. So, (B) will indicate warning.
This warning was added by commit b5c088689847 ("ASoC: rsnd: add warning message to rsnd_kctrl_accept_runtime()"), but the message sounds like the operation was not correct. Let's update warning message.
The message is very SRC specific, implement it in src.c
--- sound/soc/sh/rcar/core.c | 14 -------------- sound/soc/sh/rcar/rsnd.h | 1 - sound/soc/sh/rcar/src.c | 18 +++++++++++++++++- 3 files changed, 17 insertions(+), 16 deletions(-)
sound/soc/sh/rcar/core.c +0 -14
@@ -1775,20 +1775,6 @@ int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io)return 1 ; } -int rsnd_kctrl_accept_runtime (struct rsnd_dai_stream *io) -{ -struct snd_pcm_runtime *runtime =rsnd_io_to_runtime (io); -struct rsnd_priv *priv =rsnd_io_to_priv (io); -struct device *dev =rsnd_priv_to_dev (priv); - -if (!runtime) { -dev_warn (dev,"Can't update kctrl when idle\n" ); -return 0 ; - } - -return 1 ; -} -struct rsnd_kctrl_cfg *rsnd_kctrl_init_m (struct rsnd_kctrl_cfg_m *cfg) { cfg->cfg.val = cfg->val;
sound/soc/sh/rcar/rsnd.h +0 -1
@@ -755,7 +755,6 @@ struct rsnd_kctrl_cfg_s {#define rsnd_kctrl_vals (x) ((x).val)/* = (x).cfg.val[0] */ int rsnd_kctrl_accept_anytime (struct rsnd_dai_stream *io); -int rsnd_kctrl_accept_runtime (struct rsnd_dai_stream *io);struct rsnd_kctrl_cfg *rsnd_kctrl_init_m (struct rsnd_kctrl_cfg_m *cfg);struct rsnd_kctrl_cfg *rsnd_kctrl_init_s (struct rsnd_kctrl_cfg_s *cfg); int rsnd_kctrl_new(struct rsnd_mod *mod,
sound/soc/sh/rcar/src.c +17 -1
@@ -530,6 +530,22 @@ static irqreturn_t rsnd_src_interrupt(int irq, void *data)return IRQ_HANDLED ; } +static int rsnd_src_kctrl_accept_runtime (struct rsnd_dai_stream *io) +{ +struct snd_pcm_runtime *runtime =rsnd_io_to_runtime (io); + +if (!runtime) { +struct rsnd_priv *priv =rsnd_io_to_priv (io); +struct device *dev =rsnd_priv_to_dev (priv); + +dev_warn (dev,"\"SRC Out Rate\" can use during running\n" ); + +return 0 ; + } + +return 1 ; +} +static int rsnd_src_probe_ (struct rsnd_mod *mod,struct rsnd_dai_stream *io,struct rsnd_priv *priv)
@@ -593,7 +609,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod,rsnd_io_is_play (io) ?"SRC Out Rate" :"SRC In Rate" , - rsnd_kctrl_accept_runtime, + rsnd_src_kctrl_accept_runtime, rsnd_src_set_convert_rate, &src->sync, 192000);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 70/166 ASoC: rsnd: adjust convert rate limitation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuninori Morimoto <[email protected]>
[ Upstream commit 89f9cf185885d4358aa92b48e51d0f09b71775aa ]
Current rsnd driver supports Synchronous SRC Mode, but HW allow to update rate only within 1% from current rate. Adjust to it.
Becially, this feature is used to fine-tune subtle difference that occur during sampling rate conversion in SRC. So, it should be called within 1% margin of rate difference.
If there was difference over 1%, it will apply with 1% increments by using loop without indicating error message.
--- sound/soc/sh/rcar/src.c | 98 ++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 22 deletions(-)
sound/soc/sh/rcar/src.c +76 -22
@@ -34,6 +34,7 @@ struct rsnd_src {struct rsnd_mod *dma;struct rsnd_kctrl_cfg_s sen;/* sync convert enable */ struct rsnd_kctrl_cfg_s sync;/* sync convert */ +u32 current_sync_rate;int irq; };
@@ -99,7 +100,7 @@ static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io,if (!rsnd_src_sync_is_enabled (mod))return rsnd_io_converted_rate (io); - convert_rate = src->sync.val; + convert_rate = src->current_sync_rate;if (!convert_rate) convert_rate =rsnd_io_converted_rate (io);
@@ -200,13 +201,73 @@ static const u32 chan222222[] = {static void rsnd_src_set_convert_rate (struct rsnd_dai_stream *io,struct rsnd_mod *mod) { +struct snd_pcm_runtime *runtime =rsnd_io_to_runtime (io);struct rsnd_priv *priv =rsnd_mod_to_priv (mod); -struct device *dev =rsnd_priv_to_dev (priv); +struct rsnd_src *src =rsnd_mod_to_src (mod); +u32 fin, fout, new_rate; +int inc, cnt, rate; +u64 base, val; + +if (!runtime) +return ; + +if (!rsnd_src_sync_is_enabled (mod)) +return ; + + fin =rsnd_src_get_in_rate (priv, io); + fout =rsnd_src_get_out_rate (priv, io); + + new_rate = src->sync.val; + +if (!new_rate) + new_rate = fout; + +/* Do nothing if no diff */ +if (new_rate == src->current_sync_rate) +return ; + +/* +* SRCm_IFSVR::INTIFS can change within 1% +* see +* SRCm_IFSVR::INTIFS Note +*/ + inc = fout /100 ; + cnt =abs (new_rate - fout) / inc; +if (fout > new_rate) + inc *=-1 ; + +/* +* After start running SRC, we can update only SRC_IFSVR +* for Synchronous Mode +*/ + base = (u64 )0x0400000 * fin; + rate = fout; +for (int i =0 ; i < cnt; i++) { + val = base; + rate += inc; +do_div (val, rate); + +rsnd_mod_write (mod,SRC_IFSVR , val); + } + val = base; +do_div (val, new_rate); + +rsnd_mod_write (mod,SRC_IFSVR , val); + +/* update current_sync_rate */ + src->current_sync_rate = new_rate; +} + +static void rsnd_src_init_convert_rate (struct rsnd_dai_stream *io, +struct rsnd_mod *mod) +{struct snd_pcm_runtime *runtime =rsnd_io_to_runtime (io); +struct rsnd_priv *priv =rsnd_mod_to_priv (mod); +struct device *dev =rsnd_priv_to_dev (priv);int is_play =rsnd_io_is_play (io);int use_src =0 ;u32 fin, fout; -u32 ifscr, fsrate, adinr; +u32 ifscr, adinr;u32 cr, route;u32 i_busif, o_busif, tmp;const u32 *bsdsr_table;
@@ -244,26 +305,15 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io, adinr =rsnd_get_adinr_bit (mod, io) | chan;/* -* SRC_IFSCR / SRC_IFSVR -*/ - ifscr =0 ; - fsrate =0 ; -if (use_src) { -u64 n; - - ifscr =1 ; - n = (u64 )0x0400000 * fin; -do_div (n, fout); - fsrate = n; - } - -/* +* SRC_IFSCR * SRC_SRCCR / SRC_ROUTE_MODE0 */ + ifscr =0 ; cr =0x00011110 ; route =0x0 ;if (use_src) { route =0x1 ; + ifscr =0x1 ;if (rsnd_src_sync_is_enabled (mod)) { cr |=0x1 ;
@@ -334,7 +384,6 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,rsnd_mod_write (mod,SRC_SRCIR ,1 );/* initialize */ rsnd_mod_write (mod,SRC_ADINR , adinr);rsnd_mod_write (mod,SRC_IFSCR , ifscr); -rsnd_mod_write (mod,SRC_IFSVR , fsrate);rsnd_mod_write (mod,SRC_SRCCR , cr);rsnd_mod_write (mod,SRC_BSDSR , bsdsr_table[idx]);rsnd_mod_write (mod,SRC_BSISR , bsisr_table[idx]);
@@ -347,6 +396,9 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,rsnd_adg_set_src_timesel_gen2 (mod, io, fin, fout); +/* update SRC_IFSVR */ +rsnd_src_set_convert_rate (io, mod); +return ; convert_rate_err:
@@ -466,7 +518,8 @@ static int rsnd_src_init(struct rsnd_mod *mod,int ret;/* reset sync convert_rate */ - src->sync.val =0 ; + src->sync.val = + src->current_sync_rate =0 ; ret =rsnd_mod_power_on (mod);if (ret <0 )
@@ -474,7 +527,7 @@ static int rsnd_src_init(struct rsnd_mod *mod,rsnd_src_activation (mod); -rsnd_src_set_convert_rate (io, mod); +rsnd_src_init_convert_rate (io, mod);rsnd_src_status_clear (mod);
@@ -492,7 +545,8 @@ static int rsnd_src_quit(struct rsnd_mod *mod,rsnd_mod_power_off (mod);/* reset sync convert_rate */ - src->sync.val =0 ; + src->sync.val = + src->current_sync_rate =0 ;return 0 ; }
@@ -600,7 +654,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod, "SRC Out Rate Switch" :"SRC In Rate Switch" , rsnd_kctrl_accept_anytime, - rsnd_src_set_convert_rate, + rsnd_src_init_convert_rate, &src->sen, 1);if (ret <0 )return ret;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 71/166 ASoC: arizona/madera: use fsleep() in up/down DAPM event delays.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vitaly Rodionov <[email protected]>
[ Upstream commit 679074942c2502a95842a80471d8fb718165ac77 ]
Using fsleep instead of msleep resolves some customer complaints regarding the precision of up/down DAPM event timing. fsleep() automatically selects the appropriate sleep function, making the delay time more predictable.
--- sound/soc/codecs/arizona.c | 14 +++++++------- sound/soc/codecs/madera.c | 10 +++++----- sound/soc/codecs/wm5110.c | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-)
sound/soc/codecs/arizona.c +7 -7
@@ -967,7 +967,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,case ARIZONA_OUT3L_ENA_SHIFT :case ARIZONA_OUT3R_ENA_SHIFT : priv->out_up_pending++; - priv->out_up_delay +=17 ; + priv->out_up_delay +=17000 ;break ;case ARIZONA_OUT4L_ENA_SHIFT :case ARIZONA_OUT4R_ENA_SHIFT :
@@ -977,7 +977,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,case WM8997 :break ;default : - priv->out_up_delay +=10 ; + priv->out_up_delay +=10000 ;break ; }break ;
@@ -999,7 +999,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,if (!priv->out_up_pending && priv->out_up_delay) {dev_dbg (component->dev,"Power up delay: %d\n" , priv->out_up_delay); -msleep (priv->out_up_delay); +fsleep (priv->out_up_delay); priv->out_up_delay =0 ; }break ;
@@ -1017,7 +1017,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,case ARIZONA_OUT3L_ENA_SHIFT :case ARIZONA_OUT3R_ENA_SHIFT : priv->out_down_pending++; - priv->out_down_delay++; + priv->out_down_delay +=1000 ;break ;case ARIZONA_OUT4L_ENA_SHIFT :case ARIZONA_OUT4R_ENA_SHIFT :
@@ -1028,10 +1028,10 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,break ;case WM8998 :case WM1814 : - priv->out_down_delay +=5 ; + priv->out_down_delay +=5000 ;break ;default : - priv->out_down_delay++; + priv->out_down_delay +=1000 ;break ; }break ;
@@ -1053,7 +1053,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,if (!priv->out_down_pending && priv->out_down_delay) {dev_dbg (component->dev,"Power down delay: %d\n" , priv->out_down_delay); -msleep (priv->out_down_delay); +fsleep (priv->out_down_delay); priv->out_down_delay =0 ; }break ;
sound/soc/codecs/madera.c +5 -5
@@ -2322,10 +2322,10 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,case CS42L92 :case CS47L92 :case CS47L93 : - out_up_delay =6 ; + out_up_delay =6000 ;break ;default : - out_up_delay =17 ; + out_up_delay =17000 ;break ; }
@@ -2356,7 +2356,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,case MADERA_OUT3R_ENA_SHIFT : priv->out_up_pending--;if (!priv->out_up_pending) { -msleep (priv->out_up_delay); +fsleep (priv->out_up_delay); priv->out_up_delay =0 ; }break ;
@@ -2375,7 +2375,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,case MADERA_OUT3L_ENA_SHIFT :case MADERA_OUT3R_ENA_SHIFT : priv->out_down_pending++; - priv->out_down_delay++; + priv->out_down_delay +=1000 ;break ;default :break ;
@@ -2392,7 +2392,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,case MADERA_OUT3R_ENA_SHIFT : priv->out_down_pending--;if (!priv->out_down_pending) { -msleep (priv->out_down_delay); +fsleep (priv->out_down_delay); priv->out_down_delay =0 ; }break ;
sound/soc/codecs/wm5110.c +4 -4
@@ -302,7 +302,7 @@ static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w) }else { wseq = wm5110_no_dre_left_enable; nregs =ARRAY_SIZE (wm5110_no_dre_left_enable); - priv->out_up_delay +=10 ; + priv->out_up_delay +=10000 ; }break ;case ARIZONA_OUT1R_ENA_SHIFT :
@@ -312,7 +312,7 @@ static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w) }else { wseq = wm5110_no_dre_right_enable; nregs =ARRAY_SIZE (wm5110_no_dre_right_enable); - priv->out_up_delay +=10 ; + priv->out_up_delay +=10000 ; }break ;default :
@@ -338,7 +338,7 @@ static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w)snd_soc_component_update_bits (component,ARIZONA_SPARE_TRIGGERS ,ARIZONA_WS_TRG1 ,0 ); - priv->out_down_delay +=27 ; + priv->out_down_delay +=27000 ; }break ;case ARIZONA_OUT1R_ENA_SHIFT :
@@ -350,7 +350,7 @@ static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w)snd_soc_component_update_bits (component,ARIZONA_SPARE_TRIGGERS ,ARIZONA_WS_TRG2 ,0 ); - priv->out_down_delay +=27 ; + priv->out_down_delay +=27000 ; }break ;default :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 72/166 ASoC: SOF: Intel: hda: add softdep pre to snd-hda-codec-hdmi module
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Terry Cheong <[email protected]>
[ Upstream commit 33b7dc7843dbdc9b90c91d11ba30b107f9138ffd ]
In enviornment without KMOD requesting module may fail to load snd-hda-codec-hdmi, resulting in HDMI audio not usable.
Add softdep to loading HDMI codec module first to ensure we can load it correctly.
--- sound/soc/sof/intel/hda-codec.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sof/intel/hda-codec.c +1 -0
@@ -444,6 +444,7 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev) }EXPORT_SYMBOL_NS_GPL (hda_codec_i915_exit,SND_SOC_SOF_HDA_AUDIO_CODEC_I915 ); +MODULE_SOFTDEP ("pre: snd-hda-codec-hdmi" );#endif MODULE_LICENSE ("Dual BSD/GPL" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 73/166 ASoC: SOF: amd: Handle IPC replies before FW_BOOT_COMPLETE
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Ciocaltea <[email protected]>
[ Upstream commit ac84ca815adb4171a4276b1d44096b75f6a150b7 ]
In some cases, e.g. during resuming from suspend, there is a possibility that some IPC reply messages get received by the host while the DSP firmware has not yet reached the complete boot state.
Detect when this happens and do not attempt to process the unexpected replies from DSP. Instead, provide proper debugging support.
--- sound/soc/sof/amd/acp-ipc.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
sound/soc/sof/amd/acp-ipc.c +16 -7
@@ -167,6 +167,7 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context)if (sdev->first_boot && sdev->fw_state !=SOF_FW_BOOT_COMPLETE ) {acp_mailbox_read (sdev, sdev->dsp_box.offset, &status,sizeof (status)); +if ((status &SOF_IPC_PANIC_MAGIC_MASK ) ==SOF_IPC_PANIC_MAGIC ) {snd_sof_dsp_panic (sdev, sdev->dsp_box.offset +sizeof (status), true);
@@ -188,13 +189,21 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context) dsp_ack =snd_sof_dsp_read (sdev,ACP_DSP_BAR ,ACP_SCRATCH_REG_0 + dsp_ack_write);if (dsp_ack) { -spin_lock_irq (&sdev->ipc_lock); -/* handle immediate reply from DSP core */ -acp_dsp_ipc_get_reply (sdev); -snd_sof_ipc_reply (sdev,0 ); -/* set the done bit */ -acp_dsp_ipc_dsp_done (sdev); -spin_unlock_irq (&sdev->ipc_lock); +if (likely (sdev->fw_state ==SOF_FW_BOOT_COMPLETE )) { +spin_lock_irq (&sdev->ipc_lock); + +/* handle immediate reply from DSP core */ +acp_dsp_ipc_get_reply (sdev); +snd_sof_ipc_reply (sdev,0 ); +/* set the done bit */ +acp_dsp_ipc_dsp_done (sdev); + +spin_unlock_irq (&sdev->ipc_lock); + }else { +dev_dbg_ratelimited (sdev->dev,"IPC reply before FW_BOOT_COMPLETE: %#x\n" , + dsp_ack); + } + ipc_irq = true; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 74/166 net: wwan: mhi_wwan_mbim: Silence sequence number glitch errors
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephan Gerhold <[email protected]>
[ Upstream commit 0d1fac6d26aff5df21bb4ec980d9b7a11c410b96 ]
When using the Qualcomm X55 modem on the ThinkPad X13s, the kernel log is constantly being filled with errors related to a "sequence number glitch", e.g.:
[ 1903.284538] sequence number glitch prev=16 curr=0 [ 1913.812205] sequence number glitch prev=50 curr=0 [ 1923.698219] sequence number glitch prev=142 curr=0 [ 2029.248276] sequence number glitch prev=1555 curr=0 [ 2046.333059] sequence number glitch prev=70 curr=0 [ 2076.520067] sequence number glitch prev=272 curr=0 [ 2158.704202] sequence number glitch prev=2655 curr=0 [ 2218.530776] sequence number glitch prev=2349 curr=0 [ 2225.579092] sequence number glitch prev=6 curr=0
Internet connectivity is working fine, so this error seems harmless. It looks like modem does not preserve the sequence number when entering low power state; the amount of errors depends on how actively the modem is being used.
A similar issue has also been seen on USB-based MBIM modems [1]. However, in cdc_ncm.c the "sequence number glitch" message is a debug message instead of an error. Apply the same to the mhi_wwan_mbim.c driver to silence these errors when using the modem.
[1]: https://lists.freedesktop.org/archives/libmbim-devel/2016-November/000781.html
--- drivers/net/wwan/mhi_wwan_mbim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wwan/mhi_wwan_mbim.c +1 -1
@@ -209,7 +209,7 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *sif (mbim->rx_seq +1 !=le16_to_cpu (nth16->wSequence) && (mbim->rx_seq ||le16_to_cpu (nth16->wSequence)) && !(mbim->rx_seq ==0xffff && !le16_to_cpu (nth16->wSequence))) { -net_err_ratelimited ("sequence number glitch prev=%d curr=%d\n" , +net_dbg_ratelimited ("sequence number glitch prev=%d curr=%d\n" , mbim->rx_seq,le16_to_cpu (nth16->wSequence)); } mbim->rx_seq =le16_to_cpu (nth16->wSequence);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 75/166 io-wq: backoff when retrying worker creation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uday Shankar <[email protected]>
[ Upstream commit 13918315c5dc5a515926c8799042ea6885c2b734 ]
When io_uring submission goes async for the first time on a given task, we'll try to create a worker thread to handle the submission. Creating this worker thread can fail due to various transient conditions, such as an outstanding signal in the forking thread, so we have retry logic with a limit of 3 retries. However, this retry logic appears to be too aggressive/fast - we've observed a thread blowing through the retry limit while having the same outstanding signal the whole time. Here's an excerpt of some tracing that demonstrates the issue:
First, signal 26 is generated for the process. It ends up getting routed to thread 92942.
0) cbd-92284 /* signal_generate: sig=26 errno=0 code=-2 comm=psblkdASD pid=92934 grp=1 res=0 */
This causes create_io_thread in the signalled thread to fail with ERESTARTNOINTR, and thus a retry is queued.
13) task_th-92942 /* io_uring_queue_async_work: ring 000000007325c9ae, request 0000000080c96d8e, user_data 0x0, opcode URING_CMD, flags 0x8240001, normal queue, work 000000006e96dd3f */
13) task_th-92942 io_wq_enqueue() {
13) task_th-92942 _raw_spin_lock();
13) task_th-92942 io_wq_activate_free_worker();
13) task_th-92942 _raw_spin_lock();
13) task_th-92942 create_io_worker() {
13) task_th-92942 __kmalloc_cache_noprof();
13) task_th-92942 __init_swait_queue_head();
13) task_th-92942 kprobe_ftrace_handler() {13) task_th-92942 get_kprobe();
13) task_th-92942 aggr_pre_handler() {
13) task_th-92942 pre_handler_kretprobe();
13) task_th-92942 /* create_enter: (create_io_thread+0x0/0x50) fn=0xffffffff8172c0e0 arg=0xffff888996bb69c0 node=-1 */
13) task_th-92942 } /* aggr_pre_handler */
...
13) task_th-92942 } /* copy_process */
13) task_th-92942 } /* create_io_thread */
13) task_th-92942 kretprobe_rethook_handler() {
13) task_th-92942 /* create_exit: (create_io_worker+0x8a/0x1a0 <- create_io_thread) arg1=0xfffffffffffffdff */
13) task_th-92942 } /* kretprobe_rethook_handler */
13) task_th-92942 queue_work_on() {
...
The CPU is then handed to a kworker to process the queued retry:
------------------------------------------
13) task_th-92942 => kworker-54154
------------------------------------------
13) kworker-54154 io_workqueue_create() {
13) kworker-54154 io_queue_worker_create() {
13) kworker-54154 task_work_add() {
13) kworker-54154 wake_up_state() {
13) kworker-54154 try_to_wake_up() {
13) kworker-54154 _raw_spin_lock_irqsave();
13) kworker-54154 _raw_spin_unlock_irqrestore();
13) kworker-54154 } /* try_to_wake_up */
13) kworker-54154 } /* wake_up_state */
13) kworker-54154 kick_process();
13) kworker-54154 } /* task_work_add */
13) kworker-54154 } /* io_queue_worker_create */
13) kworker-54154 } /* io_workqueue_create */
And then we immediately switch back to the original task to try creating a worker again. This fails, because the original task still hasn't handled its signal.
-----------------------------------------
13) kworker-54154 => task_th-92942
------------------------------------------
13) task_th-92942 create_worker_cont() {
13) task_th-92942 kprobe_ftrace_handler() {
13) task_th-92942 get_kprobe();
13) task_th-92942 aggr_pre_handler() {
13) task_th-92942 pre_handler_kretprobe();
13) task_th-92942 /* create_enter: (create_io_thread+0x0/0x50) fn=0xffffffff8172c0e0 arg=0xffff888996bb69c0 node=-1 */
13) task_th-92942 } /* aggr_pre_handler */
13) task_th-92942 } /* kprobe_ftrace_handler */
13) task_th-92942 create_io_thread() {
13) task_th-92942 copy_process() {
13) task_th-92942 task_active_pid_ns(); 13) task_th-92942 _raw_spin_lock_irq(); 13) task_th-92942 recalc_sigpending(); 13) task_th-92942 _raw_spin_lock_irq();
13) task_th-92942 } /* copy_process */
13) task_th-92942 } /* create_io_thread */
13) task_th-92942 kretprobe_rethook_handler() {
13) task_th-92942 /* create_exit: (create_worker_cont+0x35/0x1b0 <- create_io_thread) arg1=0xfffffffffffffdff */
13) task_th-92942 } /* kretprobe_rethook_handler */
13) task_th-92942 io_worker_release();
13) task_th-92942 queue_work_on() {
13) task_th-92942 clear_pending_if_disabled();
13) task_th-92942 __queue_work() {
13) task_th-92942 } /* __queue_work */13) task_th-92942 } /* queue_work_on */
13) task_th-92942 } /* create_worker_cont */
The pattern repeats another couple times until we blow through the retry counter, at which point we give up. All outstanding work is canceled, and the io_uring command which triggered all this is failed with ECANCELED:
13) task_th-92942 io_acct_cancel_pending_work() {
...
13) task_th-92942 /* io_uring_complete: ring 000000007325c9ae, req 0000000080c96d8e, user_data 0x0, result -125, cflags 0x0 extra1 0 extra2 0 */
Finally, the task gets around to processing its outstanding signal 26, but it's too late.
13) task_th-92942 /* signal_deliver: sig=26 errno=0 code=-2 sa_handler=59566a0 sa_flags=14000000 */
Try to address this issue by adding a small scaling delay when retrying worker creation. This should give the forking thread time to handle its signal in the above case. This isn't a particularly satisfying solution, as sufficiently paradoxical scheduling would still have us hitting the same issue, and I'm open to suggestions for something better. But this is likely to prevent this (already rare) issue from hitting in practice.
--- io_uring/io-wq.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
io_uring/io-wq.c +18 -5
@@ -65,7 +65,7 @@ struct io_worker {union {struct rcu_head rcu; -struct work_struct work; +struct delayed_work work; }; };
@@ -771,6 +771,18 @@ static inline bool io_should_retry_thread(struct io_worker *worker, long err) } } +static void queue_create_worker_retry (struct io_worker *worker) +{ +/* +* We only bother retrying because there's a chance that the +* failure to create a worker is due to some temporary condition +* in the forking task (e.g. outstanding signal); give the task +* some time to clear that condition. +*/ +schedule_delayed_work (&worker->work, +msecs_to_jiffies (worker->init_retries *5 )); +} +static void create_worker_cont (struct callback_head *cb) {struct io_worker *worker;
@@ -810,12 +822,13 @@ static void create_worker_cont(struct callback_head *cb)/* re-create attempts grab a new worker ref, drop the existing one */ io_worker_release (worker); -schedule_work (&worker->work); +queue_create_worker_retry (worker); }static void io_workqueue_create (struct work_struct *work) { - struct io_worker *worker = container_of(work, struct io_worker, work); + struct io_worker *worker = container_of(work, struct io_worker, + work.work);struct io_wq_acct *acct =io_wq_get_acct (worker);if (!io_queue_worker_create (worker, acct, create_worker_cont))
@@ -856,8 +869,8 @@ static bool create_io_worker(struct io_wq *wq, int index)kfree (worker); goto fail; }else { -INIT_WORK (&worker->work, io_workqueue_create); -schedule_work (&worker->work); +INIT_DELAYED_WORK (&worker->work, io_workqueue_create); +queue_create_worker_retry (worker); }return true;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 76/166 nvme-pci: quirk Acer FA100 for non-uniqueue identifiers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christopher Lentocha <[email protected]>
[ Upstream commit fcd875445866a5219cf2be3101e276b21fc843f3 ]
In order for two Acer FA100 SSDs to work in one PC (in the case of myself, a Lenovo Legion T5 28IMB05), and not show one drive and not the other, and sometimes mix up what drive shows up (randomly), these two lines of code need to be added, and then both of the SSDs will show up and not conflict when booting off of one of them. If you boot up your computer with both SSDs installed without this patch, you may also randomly get into a kernel panic (if the initrd is not set up) or stuck in the initrd "/init" process, it is set up, however, if you do apply this patch, there should not be problems with booting or seeing both contents of the drive. Tested with the btrfs filesystem with a RAID configuration of having the root drive '/' combined to make two 256GB Acer FA100 SSDs become 512GB in total storage.
Kernel Logs with patch applied (dmesg -t | grep -i nvm):
``` ... nvme 0000:04:00.0: platform quirk: setting simple suspend nvme nvme0: pci function 0000:04:00.0 nvme 0000:05:00.0: platform quirk: setting simple suspend nvme nvme1: pci function 0000:05:00.0 nvme nvme1: missing or invalid SUBNQN field. nvme nvme1: allocated 64 MiB host memory buffer. nvme nvme0: missing or invalid SUBNQN field. nvme nvme0: allocated 64 MiB host memory buffer. nvme nvme1: 8/0/0 default/read/poll queues nvme nvme1: Ignoring bogus Namespace Identifiers nvme nvme0: 8/0/0 default/read/poll queues nvme nvme0: Ignoring bogus Namespace Identifiers nvme0n1: p1 p2 ... ```
Kernel Logs with patch not applied (dmesg -t | grep -i nvm):
``` ... nvme 0000:04:00.0: platform quirk: setting simple suspend nvme nvme0: pci function 0000:04:00.0 nvme 0000:05:00.0: platform quirk: setting simple suspend nvme nvme1: pci function 0000:05:00.0 nvme nvme0: missing or invalid SUBNQN field. nvme nvme1: missing or invalid SUBNQN field. nvme nvme0: allocated 64 MiB host memory buffer. nvme nvme1: allocated 64 MiB host memory buffer. nvme nvme0: 8/0/0 default/read/poll queues nvme nvme1: 8/0/0 default/read/poll queues nvme nvme1: globally duplicate IDs for nsid 1 nvme nvme1: VID:DID 1dbe:5216 model:Acer SSD FA100 256GB firmware:1.Z.J.2X nvme0n1: p1 p2 ... ```
--- drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/pci.c +2 -0
@@ -3509,6 +3509,8 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */ .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1dbe, 0x5216), /* Acer/INNOGRIT FA100/5216 NVMe SSD */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */ .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1e49, 0x0021), /* ZHITAI TiPro5000 NVMe SSD */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 77/166 nvme-tcp: add basic support for the C2HTermReq PDU
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maurizio Lombardi <[email protected]>
[ Upstream commit 84e009042d0f3dfe91bec60bcd208ee3f866cbcd ]
Previously, the NVMe/TCP host driver did not handle the C2HTermReq PDU, instead printing "unsupported pdu type (3)" when received. This patch adds support for processing the C2HTermReq PDU, allowing the driver to print the Fatal Error Status field.
Example of output:
nvme nvme4: Received C2HTermReq (FES = Invalid PDU Header Field)
--- drivers/nvme/host/tcp.c | 43 ++++++++++++++++++++++++++++++++++++++++ include/linux/nvme-tcp.h | 2 ++ 2 files changed, 45 insertions(+)
drivers/nvme/host/tcp.c +43 -0
@@ -707,6 +707,40 @@ static int nvme_tcp_handle_r2t(struct nvme_tcp_queue *queue,return 0 ; } +static void nvme_tcp_handle_c2h_term (struct nvme_tcp_queue *queue, +struct nvme_tcp_term_pdu *pdu) +{ +u16 fes; +const char *msg; +u32 plen =le32_to_cpu (pdu->hdr.plen); + +static const char *const msg_table[] = { + [NVME_TCP_FES_INVALID_PDU_HDR ] ="Invalid PDU Header Field" , + [NVME_TCP_FES_PDU_SEQ_ERR ] ="PDU Sequence Error" , + [NVME_TCP_FES_HDR_DIGEST_ERR ] ="Header Digest Error" , + [NVME_TCP_FES_DATA_OUT_OF_RANGE ] ="Data Transfer Out Of Range" , + [NVME_TCP_FES_R2T_LIMIT_EXCEEDED ] ="R2T Limit Exceeded" , + [NVME_TCP_FES_UNSUPPORTED_PARAM ] ="Unsupported Parameter" , + }; + +if (plen <NVME_TCP_MIN_C2HTERM_PLEN || + plen >NVME_TCP_MAX_C2HTERM_PLEN ) { +dev_err (queue->ctrl->ctrl.device, +"Received a malformed C2HTermReq PDU (plen = %u)\n" , + plen); +return ; + } + + fes =le16_to_cpu (pdu->fes); +if (fes && fes <ARRAY_SIZE (msg_table)) + msg = msg_table[fes]; +else + msg ="Unknown" ; + +dev_err (queue->ctrl->ctrl.device, +"Received C2HTermReq (FES = %s)\n" , msg); +} +static int nvme_tcp_recv_pdu (struct nvme_tcp_queue *queue,struct sk_buff *skb,unsigned int *offset,size_t *len) {
@@ -728,6 +762,15 @@ static int nvme_tcp_recv_pdu(struct nvme_tcp_queue *queue, struct sk_buff *skb,return 0 ; hdr = queue->pdu; +if (unlikely (hdr->type == nvme_tcp_c2h_term)) { +/* +* C2HTermReq never includes Header or Data digests. +* Skip the checks. +*/ +nvme_tcp_handle_c2h_term (queue, (void *)queue->pdu); +return -EINVAL ; + } +if (queue->hdr_digest) { ret =nvme_tcp_verify_hdgst (queue, queue->pdu, hdr->hlen);if (unlikely (ret))
include/linux/nvme-tcp.h +2 -0
@@ -13,6 +13,8 @@#define NVME_TCP_ADMIN_CCSZ SZ_8K#define NVME_TCP_DIGEST_LENGTH 4#define NVME_TCP_MIN_MAXH2CDATA 4096 +#define NVME_TCP_MIN_C2HTERM_PLEN 24 +#define NVME_TCP_MAX_C2HTERM_PLEN 152enum nvme_tcp_pfv {NVME_TCP_PFV_1_0 =0x0 ,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/166 nvmet-rdma: recheck queue state is LIVE in state lock in recv done
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ruozhu Li <[email protected]>
[ Upstream commit 3988ac1c67e6e84d2feb987d7b36d5791174b3da ]
The queue state checking in nvmet_rdma_recv_done is not in queue state lock.Queue state can transfer to LIVE in cm establish handler between state checking and state lock here, cause a silent drop of nvme connect cmd.
Recheck queue state whether in LIVE state in state lock to prevent this issue.
--- drivers/nvme/target/rdma.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)
drivers/nvme/target/rdma.c +23 -10
@@ -997,6 +997,27 @@ static void nvmet_rdma_handle_command(struct nvmet_rdma_queue *queue,nvmet_req_complete (&cmd->req, status); } +static bool nvmet_rdma_recv_not_live (struct nvmet_rdma_queue *queue, +struct nvmet_rdma_rsp *rsp) +{ +unsigned long flags; +bool ret = true; + +spin_lock_irqsave (&queue->state_lock, flags); +/* +* recheck queue state is not live to prevent a race condition +* with RDMA_CM_EVENT_ESTABLISHED handler. +*/ +if (queue->state ==NVMET_RDMA_Q_LIVE ) + ret = false; +else if (queue->state ==NVMET_RDMA_Q_CONNECTING ) +list_add_tail (&rsp->wait_list, &queue->rsp_wait_list); +else +nvmet_rdma_put_rsp (rsp); +spin_unlock_irqrestore (&queue->state_lock, flags); +return ret; +} +static void nvmet_rdma_recv_done (struct ib_cq *cq,struct ib_wc *wc) { struct nvmet_rdma_cmd *cmd =
@@ -1038,17 +1059,9 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc) rsp->req.port = queue->port; rsp->n_rdma =0 ; -if (unlikely (queue->state !=NVMET_RDMA_Q_LIVE )) { -unsigned long flags; - -spin_lock_irqsave (&queue->state_lock, flags); -if (queue->state ==NVMET_RDMA_Q_CONNECTING ) -list_add_tail (&rsp->wait_list, &queue->rsp_wait_list); -else -nvmet_rdma_put_rsp (rsp); -spin_unlock_irqrestore (&queue->state_lock, flags); +if (unlikely (queue->state !=NVMET_RDMA_Q_LIVE ) && +nvmet_rdma_recv_not_live (queue, rsp))return ; - }nvmet_rdma_handle_command (queue, rsp); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/166 apple-nvme: Release power domains when probe fails
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hector Martin <[email protected]>
[ Upstream commit eefa72a15ea03fd009333aaa9f0e360b2578e434 ]
--- drivers/nvme/host/apple.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/apple.c +2 -0
@@ -1517,6 +1517,7 @@ static struct apple_nvme *apple_nvme_alloc(struct platform_device *pdev)return anv; put_dev: +apple_nvme_detach_genpd (anv);put_device (anv->dev);return ERR_PTR (ret); }
@@ -1545,6 +1546,7 @@ static int apple_nvme_probe(struct platform_device *pdev) out_uninit_ctrl:nvme_uninit_ctrl (&anv->ctrl);nvme_put_ctrl (&anv->ctrl); +apple_nvme_detach_genpd (anv);return ret; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/166 cifs: Treat unhandled directory name surrogate reparse points as mount directory nodes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pali Rohár <[email protected]>
[ Upstream commit b587fd128660d48cd2122f870f720ff8e2b4abb3 ]
If the reparse point was not handled (indicated by the -EOPNOTSUPP from ops->parse_reparse_point() call) but reparse tag is of type name surrogate directory type, then treat is as a new mount point.
Name surrogate reparse point represents another named entity in the system.
Quoted 1 line
From SMB client point of view, this another entity is resolved on the SMB
server, and server serves its content automatically. Therefore from Linux client point of view, this name surrogate reparse point of directory type crosses mount point.
--- fs/smb/client/inode.c | 13 +++++++++++++ fs/smb/common/smbfsctl.h | 3 +++ 2 files changed, 16 insertions(+)
fs/smb/client/inode.c +13 -0
@@ -1132,6 +1132,19 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data, rc = server->ops->parse_reparse_point (cifs_sb, full_path, iov, data); +/* +* If the reparse point was not handled but it is the +* name surrogate which points to directory, then treat +* is as a new mount point. Name surrogate reparse point +* represents another named entity in the system. +*/ +if (rc == -EOPNOTSUPP && +IS_REPARSE_TAG_NAME_SURROGATE (data->reparse.tag) && + (le32_to_cpu (data->fi.Attributes) &ATTR_DIRECTORY )) { + rc =0 ; +cifs_create_junction_fattr (fattr, sb); + goto out; + } }break ; }
fs/smb/common/smbfsctl.h +3 -0
@@ -158,6 +158,9 @@#define IO_REPARSE_TAG_LX_CHR 0x80000025#define IO_REPARSE_TAG_LX_BLK 0x80000026 +/* If Name Surrogate Bit is set, the file or directory represents another named entity in the system. */ +#define IS_REPARSE_TAG_NAME_SURROGATE (tag) (!!((tag) & 0x20000000)) +/* fsctl flags */ /* If Flags is set to this value, the request is an FSCTL not ioctl request */ #define SMB2_0_IOCTL_IS_FSCTL 0x00000001
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/166 sctp: Fix undefined behavior in left shift operation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu-Chun Lin <[email protected]>
[ Upstream commit 606572eb22c1786a3957d24307f5760bb058ca19 ]
According to the C11 standard (ISO/IEC 9899:2011, 6.5.7):
"If E1 has a signed type and E1 x 2^E2 is not representable in the result type, the behavior is undefined."
Shifting 1 << 31 causes signed integer overflow, which leads to undefined behavior.
Fix this by explicitly using '1U << 31' to ensure the shift operates on an unsigned type, avoiding undefined behavior.
--- net/sctp/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sctp/stream.c +1 -1
@@ -735,7 +735,7 @@ struct sctp_chunk *sctp_process_strreset_tsnreq(* value SHOULD be the smallest TSN not acknowledged by the * receiver of the request plus 2^31. */ - init_tsn =sctp_tsnmap_get_ctsn (&asoc->peer.tsn_map) + (1 <<31 ); + init_tsn =sctp_tsnmap_get_ctsn (&asoc->peer.tsn_map) + (1U <<31 );sctp_tsnmap_init (&asoc->peer.tsn_map,SCTP_TSN_MAP_INITIAL , init_tsn,GFP_ATOMIC );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 82/166 nvme: only allow entering LIVE from CONNECTING state
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit d2fe192348f93fe3a0cb1e33e4aba58e646397f4 ]
The fabric transports and also the PCI transport are not entering the LIVE state from NEW or RESETTING. This makes the state machine more restrictive and allows to catch not supported state transitions, e.g. directly switching from RESETTING to LIVE.
--- drivers/nvme/host/core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/nvme/host/core.c +0 -2
@@ -503,8 +503,6 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,switch (new_state) {case NVME_CTRL_LIVE :switch (old_state) { -case NVME_CTRL_NEW : -case NVME_CTRL_RESETTING :case NVME_CTRL_CONNECTING : changed = true; fallthrough;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 83/166 ASoC: tas2770: Fix volume scale
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hector Martin <[email protected]>
[ Upstream commit 579cd64b9df8a60284ec3422be919c362de40e41 ]
The scale starts at -100dB, not -128dB.
--- sound/soc/codecs/tas2770.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/tas2770.c +1 -1
@@ -508,7 +508,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component) } static DECLARE_TLV_DB_SCALE(tas2770_digital_tlv, 1100, 50, 0); -static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -12750, 50, 0); +static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -10050, 50, 0);static const struct snd_kcontrol_new tas2770_snd_controls[] = { SOC_SINGLE_TLV("Speaker Playback Volume", TAS2770_PLAY_CFG_REG2,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/166 ASoC: tas2764: Fix power control mask
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hector Martin <[email protected]>
[ Upstream commit a3f172359e22b2c11b750d23560481a55bf86af1 ]
--- sound/soc/codecs/tas2764.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/tas2764.h +1 -1
@@ -25,7 +25,7 @@/* Power Control */ #define TAS2764_PWR_CTRL TAS2764_REG(0X0, 0x02) -#define TAS2764_PWR_CTRL_MASK GENMASK(1, 0) +#define TAS2764_PWR_CTRL_MASK GENMASK(2, 0)#define TAS2764_PWR_CTRL_ACTIVE 0x0#define TAS2764_PWR_CTRL_MUTE BIT(0)#define TAS2764_PWR_CTRL_SHUTDOWN BIT(1)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 85/166 ASoC: tas2764: Set the SDOUT polarity correctly
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hector Martin <[email protected]>
[ Upstream commit f5468beeab1b1adfc63c2717b1f29ef3f49a5fab ]
TX launch polarity needs to be the opposite of RX capture polarity, to generate the right bit slot alignment.
--- sound/soc/codecs/tas2764.c | 10 +++++++++- sound/soc/codecs/tas2764.h | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-)
sound/soc/codecs/tas2764.c +9 -1
@@ -367,7 +367,7 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {struct snd_soc_component *component = dai->component;struct tas2764_priv *tas2764 =snd_soc_component_get_drvdata (component); -u8 tdm_rx_start_slot =0 , asi_cfg_0 =0 , asi_cfg_1 =0 ; +u8 tdm_rx_start_slot =0 , asi_cfg_0 =0 , asi_cfg_1 =0 , asi_cfg_4 =0 ;int ret;switch (fmt &SND_SOC_DAIFMT_INV_MASK ) {
@@ -376,12 +376,14 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) fallthrough;case SND_SOC_DAIFMT_NB_NF : asi_cfg_1 =TAS2764_TDM_CFG1_RX_RISING ; + asi_cfg_4 =TAS2764_TDM_CFG4_TX_FALLING ;break ;case SND_SOC_DAIFMT_IB_IF : asi_cfg_0 ^=TAS2764_TDM_CFG0_FRAME_START ; fallthrough;case SND_SOC_DAIFMT_IB_NF : asi_cfg_1 =TAS2764_TDM_CFG1_RX_FALLING ; + asi_cfg_4 =TAS2764_TDM_CFG4_TX_RISING ;break ; }
@@ -391,6 +393,12 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)if (ret <0 )return ret; + ret =snd_soc_component_update_bits (component,TAS2764_TDM_CFG4 , +TAS2764_TDM_CFG4_TX_MASK , + asi_cfg_4); +if (ret <0 ) +return ret; +switch (fmt &SND_SOC_DAIFMT_FORMAT_MASK ) {case SND_SOC_DAIFMT_I2S : asi_cfg_0 ^=TAS2764_TDM_CFG0_FRAME_START ;
sound/soc/codecs/tas2764.h +6 -0
@@ -79,6 +79,12 @@#define TAS2764_TDM_CFG3_RXS_SHIFT 0x4#define TAS2764_TDM_CFG3_MASK GENMASK(3, 0) +/* TDM Configuration Reg4 */ +#define TAS2764_TDM_CFG4 TAS2764_REG(0X0, 0x0d) +#define TAS2764_TDM_CFG4_TX_MASK BIT(0) +#define TAS2764_TDM_CFG4_TX_RISING 0x0 +#define TAS2764_TDM_CFG4_TX_FALLING BIT(0) +/* TDM Configuration Reg5 */ #define TAS2764_TDM_CFG5 TAS2764_REG(0X0, 0x0e)#define TAS2764_TDM_CFG5_VSNS_MASK BIT(6)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 86/166 fuse: dont truncate cached, mutated symlink
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <[email protected]>
[ Upstream commit b4c173dfbb6c78568578ff18f9e8822d7bd0e31b ]
Fuse allows the value of a symlink to change and this property is exploited by some filesystems (e.g. CVMFS).
It has been observed, that sometimes after changing the symlink contents, the value is truncated to the old size.
This is caused by fuse_getattr() racing with fuse_reverse_inval_inode(). fuse_reverse_inval_inode() updates the fuse_inode's attr_version, which results in fuse_change_attributes() exiting before updating the cached attributes
This is okay, as the cached attributes remain invalid and the next call to fuse_change_attributes() will likely update the inode with the correct values.
The reason this causes problems is that cached symlinks will be returned through page_get_link(), which truncates the symlink to inode->i_size. This is correct for filesystems that don't mutate symlinks, but in this case it causes bad behavior.
The solution is to just remove this truncation. This can cause a regression in a filesystem that relies on supplying a symlink larger than the file size, but this is unlikely. If that happens we'd need to make this behavior conditional.
--- fs/fuse/dir.c | 2 +- fs/namei.c | 24 +++++++++++++++++++----- include/linux/fs.h | 2 ++ 3 files changed, 22 insertions(+), 6 deletions(-)
fs/fuse/dir.c +1 -1
@@ -1608,7 +1608,7 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode, goto out_err;if (fc->cache_symlinks) -return page_get_link (dentry, inode, callback); +return page_get_link_raw (dentry, inode, callback); err = -ECHILD ;if (!dentry)
fs/namei.c +19 -5
@@ -5154,10 +5154,9 @@ const char *vfs_get_link(struct dentry *dentry, struct delayed_call *done)EXPORT_SYMBOL (vfs_get_link);/* get the link contents into pagecache */ -const char *page_get_link (struct dentry *dentry,struct inode *inode, -struct delayed_call *callback) +static char *__page_get_link (struct dentry *dentry,struct inode *inode, +struct delayed_call *callback) { -char *kaddr;struct page *page;struct address_space *mapping = inode->i_mapping;
@@ -5176,8 +5175,23 @@ const char *page_get_link(struct dentry *dentry, struct inode *inode, }set_delayed_call (callback, page_put_link, page);BUG_ON (mapping_gfp_mask (mapping) & __GFP_HIGHMEM); - kaddr =page_address (page); -nd_terminate_link (kaddr, inode->i_size,PAGE_SIZE -1 ); +return page_address (page); +} + +const char *page_get_link_raw (struct dentry *dentry,struct inode *inode, +struct delayed_call *callback) +{ +return __page_get_link (dentry, inode, callback); +} +EXPORT_SYMBOL_GPL (page_get_link_raw); + +const char *page_get_link (struct dentry *dentry,struct inode *inode, +struct delayed_call *callback) +{ +char *kaddr =__page_get_link (dentry, inode, callback); + +if (!IS_ERR (kaddr)) +nd_terminate_link (kaddr, inode->i_size,PAGE_SIZE -1 );return kaddr; }
include/linux/fs.h +2 -0
@@ -3085,6 +3085,8 @@ extern const struct file_operations generic_ro_fops;extern int readlink_copy (char __user *,int ,const char *);extern int page_readlink (struct dentry *,char __user *,int ); +extern const char *page_get_link_raw (struct dentry *,struct inode *, +struct delayed_call *);extern const char *page_get_link (struct dentry *,struct inode *,struct delayed_call *);extern void page_put_link (void *);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 87/166 drm/vkms: Round fixp2int conversion in lerp_u16
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harry Wentland <[email protected]>
[ Upstream commit 8ec43c58d3be615a71548bc09148212013fb7e5f ]
fixp2int always rounds down, fixp2int_ceil rounds up. We need the new fixp2int_round.
--- drivers/gpu/drm/vkms/vkms_composer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_composer.c +1 -1
@@ -98,7 +98,7 @@ static u16 lerp_u16(u16 a, u16 b, s64 t)s64 delta =drm_fixp_mul (b_fp - a_fp, t); -return drm_fixp2int (a_fp + delta); +return drm_fixp2int_round (a_fp + delta); }static s64 get_lut_index (const struct vkms_color_lut *lut,u16 channel_value)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 88/166 perf/x86/intel: Use better start period for frequency mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kan Liang <[email protected]>
[ Upstream commit a26b24b2e21f6222635a95426b9ef9eec63d69b1 ]
Freqency mode is the current default mode of Linux perf. A period of 1 is used as a starting period. The period is auto-adjusted on each tick or an overflow, to meet the frequency target.
The start period of 1 is too low and may trigger some issues:
- Many HWs do not support period 1 well.
https://lore.kernel.org/lkml/875xs2oh69.ffs@tglx/
- For an event that occurs frequently, period 1 is too far away from the real period. Lots of samples are generated at the beginning. The distribution of samples may not be even.
- A low starting period for frequently occurring events also challenges virtualization, which has a longer path to handle a PMI.
The limit_period value only checks the minimum acceptable value for HW. It cannot be used to set the start period, because some events may need a very low period. The limit_period cannot be set too high. It doesn't help with the events that occur frequently.
It's hard to find a universal starting period for all events. The idea implemented by this patch is to only give an estimate for the popular HW and HW cache events. For the rest of the events, start from the lowest possible recommended value.
--- arch/x86/events/intel/core.c | 85 ++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+)
arch/x86/events/intel/core.c +85 -0
@@ -3881,6 +3881,85 @@ static inline bool intel_pmu_has_cap(struct perf_event *event, int idx)return test_bit (idx, (unsigned long *)&intel_cap->capabilities); } +static u64 intel_pmu_freq_start_period (struct perf_event *event) +{ +int type = event->attr.type; +u64 config, factor; +s64 start; + +/* +* The 127 is the lowest possible recommended SAV (sample after value) +* for a 4000 freq (default freq), according to the event list JSON file. +* Also, assume the workload is idle 50% time. +*/ + factor =64 *4000 ; +if (type !=PERF_TYPE_HARDWARE && type !=PERF_TYPE_HW_CACHE ) + goto end; + +/* +* The estimation of the start period in the freq mode is +* based on the below assumption. +* +* For a cycles or an instructions event, 1GHZ of the +* underlying platform, 1 IPC. The workload is idle 50% time. +* The start period = 1,000,000,000 * 1 / freq / 2. +* = 500,000,000 / freq +* +* Usually, the branch-related events occur less than the +* instructions event. According to the Intel event list JSON +* file, the SAV (sample after value) of a branch-related event +* is usually 1/4 of an instruction event. +* The start period of branch-related events = 125,000,000 / freq. +* +* The cache-related events occurs even less. The SAV is usually +* 1/20 of an instruction event. +* The start period of cache-related events = 25,000,000 / freq. +*/ + config = event->attr.config &PERF_HW_EVENT_MASK ; +if (type ==PERF_TYPE_HARDWARE ) { +switch (config) { +case PERF_COUNT_HW_CPU_CYCLES : +case PERF_COUNT_HW_INSTRUCTIONS : +case PERF_COUNT_HW_BUS_CYCLES : +case PERF_COUNT_HW_STALLED_CYCLES_FRONTEND : +case PERF_COUNT_HW_STALLED_CYCLES_BACKEND : +case PERF_COUNT_HW_REF_CPU_CYCLES : + factor =500000000 ; +break ; +case PERF_COUNT_HW_BRANCH_INSTRUCTIONS : +case PERF_COUNT_HW_BRANCH_MISSES : + factor =125000000 ; +break ; +case PERF_COUNT_HW_CACHE_REFERENCES : +case PERF_COUNT_HW_CACHE_MISSES : + factor =25000000 ; +break ; +default : + goto end; + } + } + +if (type ==PERF_TYPE_HW_CACHE ) + factor =25000000 ; +end: +/* +* Usually, a prime or a number with less factors (close to prime) +* is chosen as an SAV, which makes it less likely that the sampling +* period synchronizes with some periodic event in the workload. +* Minus 1 to make it at least avoiding values near power of twos +* for the default freq. +*/ + start =DIV_ROUND_UP_ULL (factor, event->attr.sample_freq) -1 ; + +if (start > x86_pmu.max_period) + start = x86_pmu.max_period; + +if (x86_pmu.limit_period) + x86_pmu.limit_period (event, &start); + +return start; +} +static int intel_pmu_hw_config (struct perf_event *event) {int ret =x86_pmu_hw_config (event);
@@ -3892,6 +3971,12 @@ static int intel_pmu_hw_config(struct perf_event *event)if (ret)return ret; +if (event->attr.freq && event->attr.sample_freq) { + event->hw.sample_period =intel_pmu_freq_start_period (event); + event->hw.last_period = event->hw.sample_period; +local64_set (&event->hw.period_left, event->hw.sample_period); + } +if (event->attr.precise_ip) {if ((event->attr.config &INTEL_ARCH_EVENT_MASK ) ==INTEL_FIXED_VLBR_EVENT )return -EINVAL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 89/166 x86/irq: Define trace events conditionally
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 9de7695925d5d2d2085681ba935857246eb2817d ]
When both of X86_LOCAL_APIC and X86_THERMAL_VECTOR are disabled, the irq tracing produces a W=1 build warning for the tracing definitions:
In file included from include/trace/trace_events.h:27,
from include/trace/define_trace.h:113,
from arch/x86/include/asm/trace/irq_vectors.h:383,
from arch/x86/kernel/irq.c:29: include/trace/stages/init.h:2:23: error: 'str__irq_vectors__trace_system_name' defined but not used [-Werror=unused-const-variable=]
Make the tracepoints conditional on the same symbosl that guard their usage.
--- arch/x86/kernel/irq.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/irq.c +2 -0
@@ -23,8 +23,10 @@#include <asm/traps.h> #include <asm/thermal.h> +#if defined(CONFIG_X86_LOCAL_APIC ) || defined(CONFIG_X86_THERMAL_VECTOR )#define CREATE_TRACE_POINTS #include <asm/trace/irq_vectors.h> +#endif DEFINE_PER_CPU_SHARED_ALIGNED (irq_cpustat_t, irq_stat);EXPORT_PER_CPU_SYMBOL (irq_stat);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 90/166 mptcp: safety check before fallback
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
[ Upstream commit db75a16813aabae3b78c06b1b99f5e314c1f55d3 ]
Recently, some fallback have been initiated, while the connection was not supposed to fallback.
Add a safety check with a warning to detect when an wrong attempt to fallback is being done. This should help detecting any future issues quicker.
--- net/mptcp/protocol.h | 2 ++ 1 file changed, 2 insertions(+)
net/mptcp/protocol.h +2 -0
@@ -1103,6 +1103,8 @@ static inline void __mptcp_do_fallback(struct mptcp_sock *msk)pr_debug ("TCP fallback already done (msk=%p)\n" , msk);return ; } +if (WARN_ON_ONCE (!READ_ONCE (msk->allow_infinite_fallback))) +return ;set_bit (MPTCP_FALLBACK_DONE , &msk->flags); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 91/166 drm/nouveau: Do not override forced connector status
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit 01f1d77a2630e774ce33233c4e6723bca3ae9daa ]
Keep user-forced connector status even if it cannot be programmed. Same behavior as for the rest of the drivers.
--- drivers/gpu/drm/nouveau/nouveau_connector.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_connector.c +0 -1
@@ -758,7 +758,6 @@ nouveau_connector_force(struct drm_connector *connector)if (!nv_encoder) {NV_ERROR (drm,"can't find encoder to force %s on!\n" , connector->name); - connector->status = connector_status_disconnected;return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 92/166 net: Handle napi_schedule() calls from non-interrupt
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frederic Weisbecker <[email protected]>
[ Upstream commit 77e45145e3039a0fb212556ab3f8c87f54771757 ]
napi_schedule() is expected to be called either:
* From an interrupt, where raised softirqs are handled on IRQ exit
* From a softirq disabled section, where raised softirqs are handled on the next call to local_bh_enable().
* From a softirq handler, where raised softirqs are handled on the next round in do_softirq(), or further deferred to a dedicated kthread.
Other bare tasks context may end up ignoring the raised NET_RX vector until the next random softirq handling opportunity, which may not happen before a while if the CPU goes idle afterwards with the tick stopped.
Such "misuses" have been detected on several places thanks to messages of the kind:
"NOHZ tick-stop error: local softirq work is pending, handler #08!!!"
For example:
__raise_softirq_irqoff
__napi_schedule
rtl8152_runtime_resume.isra.0
rtl8152_resume
usb_resume_interface.isra.0
usb_resume_both
__rpm_callback
rpm_callback
rpm_resume
__pm_runtime_resume
usb_autoresume_device
usb_remote_wakeup
hub_event
process_one_work
worker_thread
kthread
ret_from_fork
ret_from_fork_asmAnd also:
* drivers/net/usb/r8152.c::rtl_work_func_t
* drivers/net/netdevsim/netdev.c::nsim_start_xmit
There is a long history of issues of this kind:
019edd01d174 ("ath10k: sdio: Add missing BH locking around napi_schdule()")
330068589389 ("idpf: disable local BH when scheduling napi for marker packets")
e3d5d70cb483 ("net: lan78xx: fix "softirq work is pending" error")
e55c27ed9ccf ("mt76: mt7615: add missing bh-disable around rx napi schedule")
c0182aa98570 ("mt76: mt7915: add missing bh-disable around tx napi enable/schedule")
970be1dff26d ("mt76: disable BH around napi_schedule() calls")
019edd01d174 ("ath10k: sdio: Add missing BH locking around napi_schdule()")
30bfec4fec59 ("can: rx-offload: can_rx_offload_threaded_irq_finish(): add new function to be called from threaded interrupt")
e63052a5dd3c ("mlx5e: add add missing BH locking around napi_schdule()")
83a0c6e58901 ("i40e: Invoke softirqs after napi_reschedule")
bd4ce941c8d5 ("mlx4: Invoke softirqs after napi_reschedule")
8cf699ec849f ("mlx4: do not call napi_schedule() without care")
ec13ee80145c ("virtio_net: invoke softirqs after __napi_schedule")This shows that relying on the caller to arrange a proper context for the softirqs to be handled while calling napi_schedule() is very fragile and error prone. Also fixing them can also prove challenging if the caller may be called from different kinds of contexts.
Therefore fix this from napi_schedule() itself with waking up ksoftirqd when softirqs are raised from task contexts.
--- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
@@ -4532,7 +4532,7 @@ static inline void ____napi_schedule(struct softnet_data *sd,* we have to raise NET_RX_SOFTIRQ. */ if (!sd->in_net_rx_action) -__raise_softirq_irqoff (NET_RX_SOFTIRQ ); +raise_softirq_irqoff (NET_RX_SOFTIRQ ); }#ifdef CONFIG_RPS
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 93/166 block: fix kmem_cache of name bio-108 already exists
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
[ Upstream commit b654f7a51ffb386131de42aa98ed831f8c126546 ]
Device mapper bioset often has big bio_slab size, which can be more than 1000, then 8byte can't hold the slab name any more, cause the kmem_cache allocation warning of 'kmem_cache of name 'bio-108' already exists'.
Fix the warning by extending bio_slab->name to 12 bytes, but fix output of /proc/slabinfo
--- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/bio.c +1 -1
@@ -78,7 +78,7 @@ struct bio_slab {struct kmem_cache *slab;unsigned int slab_ref;unsigned int slab_size; -char name[8 ]; +char name[12 ]; };static DEFINE_MUTEX (bio_slab_lock);static DEFINE_XARRAY (bio_slabs);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/166 mm: add nommu variant of vm_insert_pages()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 62346c6cb28b043f2a6e95337d9081ec0b37b5f5 upstream.
An identical one exists for vm_insert_page(), add one for vm_insert_pages() to avoid needing to check for CONFIG_MMU in code using it.
--- mm/nommu.c | 7 +++++++ 1 file changed, 7 insertions(+)
mm/nommu.c +7 -0
@@ -357,6 +357,13 @@ int vm_insert_page(struct vm_area_struct }EXPORT_SYMBOL (vm_insert_page); +int vm_insert_pages (struct vm_area_struct *vma,unsigned long addr, +struct page **pages,unsigned long *num) +{ +return -EINVAL ; +} +EXPORT_SYMBOL (vm_insert_pages); +int vm_map_pages (struct vm_area_struct *vma,struct page **pages,unsigned long num) {
Greg Kroah-Hartman
maintainerPATCH 95/166 io_uring: get rid of remap_pfn_range() for mapping rings/sqes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 3ab1db3c6039e02a9deb9d5091d28d559917a645 upstream.
Rather than use remap_pfn_range() for this and manually free later, switch to using vm_insert_pages() and have it Just Work.
If possible, allocate a single compound page that covers the range that is needed. If that works, then we can just use page_address() on that page. If we fail to get a compound page, allocate single pages and use vmap() to map them into the kernel virtual address space.
This just covers the rings/sqes, the other remaining user of the mmap remap_pfn_range() user will be converted separately. Once that is done, we can kill the old alloc/free code.
--- io_uring/io_uring.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++--- io_uring/io_uring.h | 2 2 files changed, 133 insertions(+), 8 deletions(-)
io_uring/io_uring.c +131 -8
@@ -2683,6 +2683,36 @@ static int io_cqring_wait(struct io_ringreturn READ_ONCE (rings->cq.head) ==READ_ONCE (rings->cq.tail) ? ret :0 ; } +static void io_pages_unmap (void *ptr,struct page ***pages, +unsigned short *npages) +{ +bool do_vunmap = false; + +if (!ptr) +return ; + +if (*npages) { +struct page **to_free = *pages; +int i; + +/* +* Only did vmap for the non-compound multiple page case. +* For the compound page, we just need to put the head. +*/ +if (PageCompound (to_free[0 ])) + *npages =1 ; +else if (*npages >1 ) + do_vunmap = true; +for (i =0 ; i < *npages; i++) +put_page (to_free[i]); + } +if (do_vunmap) +vunmap (ptr); +kvfree (*pages); + *pages =NULL ; + *npages =0 ; +} +void io_mem_free (void *ptr) {if (!ptr)
@@ -2787,8 +2817,8 @@ static void *io_sqes_map(struct io_ring_static void io_rings_free (struct io_ring_ctx *ctx) {if (!(ctx->flags &IORING_SETUP_NO_MMAP )) { -io_mem_free (ctx->rings); -io_mem_free (ctx->sq_sqes); +io_pages_unmap (ctx->rings, &ctx->ring_pages, &ctx->n_ring_pages); +io_pages_unmap (ctx->sq_sqes, &ctx->sqe_pages, &ctx->n_sqe_pages); }else {io_pages_free (&ctx->ring_pages, ctx->n_ring_pages); ctx->n_ring_pages =0 ;
@@ -2800,6 +2830,80 @@ static void io_rings_free(struct io_ring ctx->sq_sqes =NULL ; } +static void *io_mem_alloc_compound (struct page **pages,int nr_pages, +size_t size,gfp_t gfp) +{ +struct page *page; +int i, order; + + order =get_order (size); +if (order >10 ) +return ERR_PTR (-ENOMEM ); +else if (order) + gfp |= __GFP_COMP; + + page =alloc_pages (gfp, order); +if (!page) +return ERR_PTR (-ENOMEM ); + +for (i =0 ; i < nr_pages; i++) + pages[i] = page + i; + +return page_address (page); +} + +static void *io_mem_alloc_single (struct page **pages,int nr_pages,size_t size, +gfp_t gfp) +{ +void *ret; +int i; + +for (i =0 ; i < nr_pages; i++) { + pages[i] =alloc_page (gfp); +if (!pages[i]) + goto err; + } + + ret =vmap (pages, nr_pages,VM_MAP ,PAGE_KERNEL ); +if (ret) +return ret; +err: +while (i--) +put_page (pages[i]); +return ERR_PTR (-ENOMEM ); +} + +static void *io_pages_map (struct page ***out_pages,unsigned short *npages, +size_t size) +{ +gfp_t gfp =GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN; +struct page **pages; +int nr_pages; +void *ret; + + nr_pages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ; + pages =kvmalloc_array (nr_pages,sizeof (struct page *), gfp); +if (!pages) +return ERR_PTR (-ENOMEM ); + + ret =io_mem_alloc_compound (pages, nr_pages, size, gfp); +if (!IS_ERR (ret)) + goto done; + + ret =io_mem_alloc_single (pages, nr_pages, size, gfp); +if (!IS_ERR (ret)) { +done: + *out_pages = pages; + *npages = nr_pages; +return ret; + } + +kvfree (pages); + *out_pages =NULL ; + *npages =0 ; +return ret; +} +void *io_mem_alloc (size_t size) {gfp_t gfp =GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP;
@@ -3463,14 +3567,12 @@ static void *io_uring_validate_mmap_requ/* Don't allow mmap if the ring was setup without it */ if (ctx->flags &IORING_SETUP_NO_MMAP )return ERR_PTR (-EINVAL ); - ptr = ctx->rings; -break ; +return ctx->rings;case IORING_OFF_SQES :/* Don't allow mmap if the ring was setup without it */ if (ctx->flags &IORING_SETUP_NO_MMAP )return ERR_PTR (-EINVAL ); - ptr = ctx->sq_sqes; -break ; +return ctx->sq_sqes;case IORING_OFF_PBUF_RING : {struct io_buffer_list *bl;unsigned int bgid;
@@ -3494,11 +3596,22 @@ static void *io_uring_validate_mmap_requreturn ptr; } +int io_uring_mmap_pages (struct io_ring_ctx *ctx,struct vm_area_struct *vma, +struct page **pages,int npages) +{ +unsigned long nr_pages = npages; + +vm_flags_set (vma,VM_DONTEXPAND ); +return vm_insert_pages (vma, vma->vm_start, pages, &nr_pages); +} +#ifdef CONFIG_MMU static __cold int io_uring_mmap (struct file *file,struct vm_area_struct *vma) { +struct io_ring_ctx *ctx = file->private_data;size_t sz = vma->vm_end - vma->vm_start; +long offset = vma->vm_pgoff <<PAGE_SHIFT ;unsigned long pfn;void *ptr;
@@ -3506,6 +3619,16 @@ static __cold int io_uring_mmap(struct fif (IS_ERR (ptr))return PTR_ERR (ptr); +switch (offset &IORING_OFF_MMAP_MASK ) { +case IORING_OFF_SQ_RING : +case IORING_OFF_CQ_RING : +return io_uring_mmap_pages (ctx, vma, ctx->ring_pages, + ctx->n_ring_pages); +case IORING_OFF_SQES : +return io_uring_mmap_pages (ctx, vma, ctx->sqe_pages, + ctx->n_sqe_pages); + } + pfn =virt_to_phys (ptr) >>PAGE_SHIFT ;return remap_pfn_range (vma, vma->vm_start, pfn, sz, vma->vm_page_prot); }
@@ -3795,7 +3918,7 @@ static __cold int io_allocate_scq_uringsreturn -EOVERFLOW ;if (!(ctx->flags &IORING_SETUP_NO_MMAP )) - rings =io_mem_alloc (size); + rings =io_pages_map (&ctx->ring_pages, &ctx->n_ring_pages, size);else rings =io_rings_map (ctx, p->cq_off.user_addr, size);
@@ -3820,7 +3943,7 @@ static __cold int io_allocate_scq_urings }if (!(ctx->flags &IORING_SETUP_NO_MMAP )) - ptr =io_mem_alloc (size); + ptr =io_pages_map (&ctx->sqe_pages, &ctx->n_sqe_pages, size);else ptr =io_sqes_map (ctx, p->sq_off.user_addr, size);
io_uring/io_uring.h +2 -0
@@ -55,6 +55,8 @@ bool io_fill_cqe_req_aux(struct io_kiocbvoid __io_commit_cqring_flush (struct io_ring_ctx *ctx);struct page **io_pin_pages (unsigned long ubuf,unsigned long len,int *npages); +int io_uring_mmap_pages (struct io_ring_ctx *ctx,struct vm_area_struct *vma, +struct page **pages,int npages);struct file *io_file_get_normal (struct io_kiocb *req,int fd); struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
Greg Kroah-Hartman
maintainerPATCH 96/166 io_uring: dont attempt to mmap larger than what the user asks for
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 06fe9b1df1086b42718d632aa57e8f7cd1a66a21 upstream.
If IORING_FEAT_SINGLE_MMAP is ignored, as can happen if an application uses an ancient liburing or does setup manually, then 3 mmap's are required to map the ring into userspace. The kernel will still have collapsed the mappings, however userspace may ask for mapping them individually. If so, then we should not use the full number of ring pages, as it may exceed the partial mapping. Doing so will yield an -EFAULT from vm_insert_pages(), as we pass in more pages than what the application asked for.
Cap the number of pages to match what the application asked for, for the particular mapping operation.
--- io_uring/io_uring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
io_uring/io_uring.c +3 -2
@@ -3612,6 +3612,7 @@ static __cold int io_uring_mmap(struct fstruct io_ring_ctx *ctx = file->private_data;size_t sz = vma->vm_end - vma->vm_start;long offset = vma->vm_pgoff <<PAGE_SHIFT ; +unsigned int npages;unsigned long pfn;void *ptr;
@@ -3622,8 +3623,8 @@ static __cold int io_uring_mmap(struct fswitch (offset &IORING_OFF_MMAP_MASK ) {case IORING_OFF_SQ_RING :case IORING_OFF_CQ_RING : -return io_uring_mmap_pages (ctx, vma, ctx->ring_pages, - ctx->n_ring_pages); + npages =min (ctx->n_ring_pages, (sz +PAGE_SIZE -1 ) >>PAGE_SHIFT ); +return io_uring_mmap_pages (ctx, vma, ctx->ring_pages, npages);case IORING_OFF_SQES :return io_uring_mmap_pages (ctx, vma, ctx->sqe_pages, ctx->n_sqe_pages);
Greg Kroah-Hartman
maintainerPATCH 97/166 io_uring: fix corner case forgetting to vunmap
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
Commit 43eef70e7e2ac74e7767731dd806720c7fb5e010 upstream.
io_pages_unmap() is a bit tricky in trying to figure whether the pages were previously vmap'ed or not. In particular If there is juts one page it belives there is no need to vunmap. Paired io_pages_map(), however, could've failed io_mem_alloc_compound() and attempted to io_mem_alloc_single(), which does vmap, and that leads to unpaired vmap.
The solution is to fail if io_mem_alloc_compound() can't allocate a single page. That's the easiest way to deal with it, and those two functions are getting removed soon, so no need to overcomplicate it.
--- io_uring/io_uring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/io_uring.c +3 -1
@@ -2889,6 +2889,8 @@ static void *io_pages_map(struct page ** ret =io_mem_alloc_compound (pages, nr_pages, size, gfp);if (!IS_ERR (ret)) goto done; +if (nr_pages ==1 ) + goto fail; ret =io_mem_alloc_single (pages, nr_pages, size, gfp);if (!IS_ERR (ret)) {
@@ -2897,7 +2899,7 @@ done: *npages = nr_pages;return ret; } - +fail:kvfree (pages); *out_pages =NULL ; *npages =0 ;
Greg Kroah-Hartman
maintainerPATCH 98/166 io_uring: use vmap() for ring mapping
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 09fc75e0c035a2cabb8caa15cec6e85159dd94f0 upstream.
This is the last holdout which does odd page checking, convert it to vmap just like what is done for the non-mmap path.
--- io_uring/io_uring.c | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-)
io_uring/io_uring.c +9 -29
@@ -64,7 +64,6 @@#include <linux/sched/mm.h> #include <linux/uaccess.h> #include <linux/nospec.h> -#include <linux/highmem.h> #include <linux/fsnotify.h> #include <linux/fadvise.h> #include <linux/task_work.h>
@@ -2745,7 +2744,7 @@ static void *__io_uaddr_map(struct pagestruct page **page_array;unsigned int nr_pages;void *page_addr; -int ret, i, pinned; +int ret, pinned; *npages =0 ;
@@ -2767,34 +2766,13 @@ static void *__io_uaddr_map(struct page goto free_pages; } - page_addr =page_address (page_array[0 ]); -for (i =0 ; i < nr_pages; i++) { - ret = -EINVAL ; - -/* -* Can't support mapping user allocated ring memory on 32-bit -* archs where it could potentially reside in highmem. Just -* fail those with -EINVAL, just like we did on kernels that -* didn't support this feature. -*/ -if (PageHighMem (page_array[i])) - goto free_pages; - -/* -* No support for discontig pages for now, should either be a -* single normal page, or a huge page. Later on we can add -* support for remapping discontig pages, for now we will -* just fail them with EINVAL. -*/ -if (page_address (page_array[i]) != page_addr) - goto free_pages; - page_addr +=PAGE_SIZE ; + page_addr =vmap (page_array, nr_pages,VM_MAP ,PAGE_KERNEL ); +if (page_addr) { + *pages = page_array; + *npages = nr_pages; +return page_addr; } - - *pages = page_array; - *npages = nr_pages; -return page_to_virt (page_array[0 ]); - + ret = -ENOMEM ; free_pages:io_pages_free (&page_array, pinned >0 ? pinned :0 );return ERR_PTR (ret);
@@ -2824,6 +2802,8 @@ static void io_rings_free(struct io_ring ctx->n_ring_pages =0 ;io_pages_free (&ctx->sqe_pages, ctx->n_sqe_pages); ctx->n_sqe_pages =0 ; +vunmap (ctx->rings); +vunmap (ctx->sq_sqes); } ctx->rings =NULL ;
Greg Kroah-Hartman
maintainerPATCH 99/166 io_uring: unify io_pin_pages()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 1943f96b3816e0f0d3d6686374d6e1d617c8b42c upstream.
Move it into io_uring.c where it belongs, and use it in there as well rather than have two implementations of this.
--- io_uring/io_uring.c | 61 +++++++++++++++++++++++++++++++++++----------------- io_uring/rsrc.c | 39 --------------------------------- 2 files changed, 42 insertions(+), 58 deletions(-)
io_uring/io_uring.c +42 -19
@@ -2738,33 +2738,57 @@ static void io_pages_free(struct page ** *pages =NULL ; } +struct page **io_pin_pages (unsigned long uaddr,unsigned long len,int *npages) +{ +unsigned long start, end, nr_pages; +struct page **pages; +int ret; + + end = (uaddr + len +PAGE_SIZE -1 ) >>PAGE_SHIFT ; + start = uaddr >>PAGE_SHIFT ; + nr_pages = end - start; +if (WARN_ON_ONCE (!nr_pages)) +return ERR_PTR (-EINVAL ); + + pages =kvmalloc_array (nr_pages,sizeof (struct page *),GFP_KERNEL ); +if (!pages) +return ERR_PTR (-ENOMEM ); + + ret =pin_user_pages_fast (uaddr, nr_pages,FOLL_WRITE |FOLL_LONGTERM , + pages); +/* success, mapped all pages */ +if (ret == nr_pages) { + *npages = nr_pages; +return pages; + } + +/* partial map, or didn't map anything */ +if (ret >=0 ) { +/* if we did partial map, release any pages we did get */ +if (ret) +unpin_user_pages (pages, ret); + ret = -EFAULT ; + } +kvfree (pages); +return ERR_PTR (ret); +} +static void *__io_uaddr_map (struct page ***pages,unsigned short *npages,unsigned long uaddr,size_t size) {struct page **page_array;unsigned int nr_pages;void *page_addr; -int ret, pinned; *npages =0 ;if (uaddr & (PAGE_SIZE -1 ) || !size)return ERR_PTR (-EINVAL ); - nr_pages = (size +PAGE_SIZE -1 ) >>PAGE_SHIFT ; -if (nr_pages >USHRT_MAX ) -return ERR_PTR (-EINVAL ); - page_array =kvmalloc_array (nr_pages,sizeof (struct page *),GFP_KERNEL ); -if (!page_array) -return ERR_PTR (-ENOMEM ); - - - pinned =pin_user_pages_fast (uaddr, nr_pages,FOLL_WRITE |FOLL_LONGTERM , - page_array); -if (pinned != nr_pages) { - ret = (pinned <0 ) ? pinned : -EFAULT ; - goto free_pages; - } + nr_pages =0 ; + page_array =io_pin_pages (uaddr, size, &nr_pages); +if (IS_ERR (page_array)) +return page_array; page_addr =vmap (page_array, nr_pages,VM_MAP ,PAGE_KERNEL );if (page_addr) {
@@ -2772,10 +2796,9 @@ static void *__io_uaddr_map(struct page *npages = nr_pages;return page_addr; } - ret = -ENOMEM ; -free_pages: -io_pages_free (&page_array, pinned >0 ? pinned :0 ); -return ERR_PTR (ret); + +io_pages_free (&page_array, nr_pages); +return ERR_PTR (-ENOMEM ); } static void *io_rings_map(struct io_ring_ctx *ctx, unsigned long uaddr,
io_uring/rsrc.c +0 -39
@@ -873,45 +873,6 @@ static int io_buffer_account_pin(structreturn ret; } -struct page **io_pin_pages (unsigned long ubuf,unsigned long len,int *npages) -{ -unsigned long start, end, nr_pages; -struct page **pages =NULL ; -int pret, ret = -ENOMEM ; - - end = (ubuf + len +PAGE_SIZE -1 ) >>PAGE_SHIFT ; - start = ubuf >>PAGE_SHIFT ; - nr_pages = end - start; - - pages =kvmalloc_array (nr_pages,sizeof (struct page *),GFP_KERNEL ); -if (!pages) - goto done; - - ret =0 ; -mmap_read_lock (current->mm); - pret =pin_user_pages (ubuf, nr_pages,FOLL_WRITE |FOLL_LONGTERM , - pages); -if (pret == nr_pages) - *npages = nr_pages; -else - ret = pret <0 ? pret : -EFAULT ; - -mmap_read_unlock (current->mm); -if (ret) { -/* if we did partial map, release any pages we did get */ -if (pret >0 ) -unpin_user_pages (pages, pret); - goto done; - } - ret =0 ; -done: -if (ret <0 ) { -kvfree (pages); - pages =ERR_PTR (ret); - } -return pages; -} -static int io_sqe_buffer_register (struct io_ring_ctx *ctx,struct iovec *iov,struct io_mapped_ubuf **pimu,struct page **last_hpage)
Greg Kroah-Hartman
maintainerPATCH 100/166 io_uring/kbuf: vmap pinned buffer ring
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit e270bfd22a2a10d1cfbaddf23e79b6d0b405d21e upstream.
This avoids needing to care about HIGHMEM, and it makes the buffer indexing easier as both ring provided buffer methods are now virtually mapped in a contigious fashion.
--- io_uring/kbuf.c | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-)
io_uring/kbuf.c +15 -24
@@ -7,6 +7,7 @@#include <linux/slab.h> #include <linux/namei.h> #include <linux/poll.h> +#include <linux/vmalloc.h> #include <linux/io_uring.h> #include <uapi/linux/io_uring.h>
@@ -153,15 +154,7 @@ static void __user *io_ring_buffer_selecreturn NULL ; head &= bl->mask; -/* mmaped buffers are always contig */ -if (bl->is_mmap || head <IO_BUFFER_LIST_BUF_PER_PAGE ) { - buf = &br->bufs[head]; - }else { -int off = head & (IO_BUFFER_LIST_BUF_PER_PAGE -1 ); -int index = head /IO_BUFFER_LIST_BUF_PER_PAGE ; - buf =page_address (bl->buf_pages[index]); - buf += off; - } + buf = &br->bufs[head];if (*len ==0 || *len > buf->len) *len = buf->len; req->flags |=REQ_F_BUFFER_RING ;
@@ -249,6 +242,7 @@ static int __io_remove_buffers(struct iofor (j =0 ; j < bl->buf_nr_pages; j++)unpin_user_page (bl->buf_pages[j]);kvfree (bl->buf_pages); +vunmap (bl->buf_ring); bl->buf_pages =NULL ; bl->buf_nr_pages =0 ; }
@@ -501,9 +495,9 @@ err:static int io_pin_pbuf_ring (struct io_uring_buf_reg *reg,struct io_buffer_list *bl) { -struct io_uring_buf_ring *br; +struct io_uring_buf_ring *br =NULL ; +int nr_pages, ret, i;struct page **pages; -int i, nr_pages; pages = io_pin_pages(reg->ring_addr, flex_array_size(br, bufs, reg->ring_entries),
@@ -511,18 +505,12 @@ static int io_pin_pbuf_ring(struct io_urif (IS_ERR (pages))return PTR_ERR (pages); -/* -* Apparently some 32-bit boxes (ARM) will return highmem pages, -* which then need to be mapped. We could support that, but it'd -* complicate the code and slowdown the common cases quite a bit. -* So just error out, returning -EINVAL just like we did on kernels -* that didn't support mapped buffer rings. -*/ -for (i =0 ; i < nr_pages; i++) -if (PageHighMem (pages[i])) - goto error_unpin; + br =vmap (pages, nr_pages,VM_MAP ,PAGE_KERNEL ); +if (!br) { + ret = -ENOMEM ; + goto error_unpin; + } - br =page_address (pages[0 ]);#ifdef SHM_COLOUR /* * On platforms that have specific aliasing requirements, SHM_COLOUR
@@ -533,8 +521,10 @@ static int io_pin_pbuf_ring(struct io_ur* should use IOU_PBUF_RING_MMAP instead, and liburing will handle * this transparently. */ -if ((reg->ring_addr | (unsigned long ) br) & (SHM_COLOUR -1 )) +if ((reg->ring_addr | (unsigned long ) br) & (SHM_COLOUR -1 )) { + ret = -EINVAL ; goto error_unpin; + }#endif bl->buf_pages = pages; bl->buf_nr_pages = nr_pages;
@@ -546,7 +536,8 @@ error_unpin:for (i =0 ; i < nr_pages; i++)unpin_user_page (pages[i]);kvfree (pages); -return -EINVAL ; +vunmap (br); +return ret; }/*
Greg Kroah-Hartman
maintainerPATCH 101/166 io_uring/kbuf: use vm_insert_pages() for mmaped pbuf ring
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 87585b05757dc70545efb434669708d276125559 upstream.
Rather than use remap_pfn_range() for this and manually free later, switch to using vm_insert_page() and have it Just Work.
This requires a bit of effort on the mmap lookup side, as the ctx uring_lock isn't held, which otherwise protects buffer_lists from being torn down, and it's not safe to grab from mmap context that would introduce an ABBA deadlock between the mmap lock and the ctx uring_lock. Instead, lookup the buffer_list under RCU, as the the list is RCU freed already. Use the existing reference count to determine whether it's possible to safely grab a reference to it (eg if it's not zero already), and drop that reference when done with the mapping. If the mmap reference is the last one, the buffer_list and the associated memory can go away, since the vma insertion has references to the inserted pages at that point.
--- include/linux/io_uring_types.h | 3 io_uring/io_uring.c | 58 ++++------------- io_uring/io_uring.h | 6 + io_uring/kbuf.c | 137 ++++++++--------------------------------- io_uring/kbuf.h | 3 5 files changed, 48 insertions(+), 159 deletions(-)
include/linux/io_uring_types.h +0 -3
@@ -326,9 +326,6 @@ struct io_ring_ctx {struct list_head io_buffers_cache; -/* deferred free list, protected by ->uring_lock */ -struct hlist_head io_buf_list; -/* Keep this last, we don't need it for the fast path */ struct wait_queue_head poll_wq;struct io_restriction restrictions;
io_uring/io_uring.c +16 -42
142 lines not on this page · raw message
io_uring/io_uring.h +4 -2
@@ -93,8 +93,10 @@ bool __io_alloc_req_refill(struct io_rinbool io_match_task_safe (struct io_kiocb *head,struct task_struct *task,bool cancel_all); -void *io_mem_alloc (size_t size); -void io_mem_free (void *ptr); +void *io_pages_map (struct page ***out_pages,unsigned short *npages, +size_t size); +void io_pages_unmap (void *ptr,struct page ***pages,unsigned short *npages, +bool put_pages);#if defined(CONFIG_PROVE_LOCKING )static inline void io_lockdep_assert_cq_locked (struct io_ring_ctx *ctx)
io_uring/kbuf.c +27 -110
180 lines not on this page · raw message
io_uring/kbuf.h +1 -2
@@ -54,8 +54,6 @@ int io_provide_buffers(struct io_kiocb *int io_register_pbuf_ring (struct io_ring_ctx *ctx,void __user *arg);int io_unregister_pbuf_ring (struct io_ring_ctx *ctx,void __user *arg); -void io_kbuf_mmap_list_free (struct io_ring_ctx *ctx); -unsigned int __io_put_kbuf (struct io_kiocb *req,unsigned issue_flags);void io_kbuf_recycle_legacy (struct io_kiocb *req,unsigned issue_flags);
@@ -63,6 +61,7 @@ void io_kbuf_recycle_legacy(struct io_kivoid io_put_bl (struct io_ring_ctx *ctx,struct io_buffer_list *bl);struct io_buffer_list *io_pbuf_get_bl (struct io_ring_ctx *ctx,unsigned long bgid); +int io_pbuf_mmap (struct file *file,struct vm_area_struct *vma);static inline void io_kbuf_recycle_ring (struct io_kiocb *req) {
Greg Kroah-Hartman
maintainerPATCH 102/166 io_uring: use unpin_user_pages() where appropriate
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 18595c0a58ae29ac6a996c5b664610119b73182d upstream.
There are a few cases of open-rolled loops around unpin_user_page(), use the generic helper instead.
--- io_uring/kbuf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
io_uring/kbuf.c +2 -3
@@ -458,8 +458,8 @@ static int io_pin_pbuf_ring(struct io_ur struct io_buffer_list *bl) {struct io_uring_buf_ring *br =NULL ; -int nr_pages, ret, i;struct page **pages; +int nr_pages, ret; pages = io_pin_pages(reg->ring_addr, flex_array_size(br, bufs, reg->ring_entries),
@@ -495,8 +495,7 @@ static int io_pin_pbuf_ring(struct io_ur bl->is_mmap =0 ;return 0 ; error_unpin: -for (i =0 ; i < nr_pages; i++) -unpin_user_page (pages[i]); +unpin_user_pages (pages, nr_pages);kvfree (pages);vunmap (br);return ret;
Greg Kroah-Hartman
maintainerPATCH 103/166 io_uring: fix error pbuf checking
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
Commit bcc87d978b834c298bbdd9c52454c5d0a946e97e upstream.
Syz reports a problem, which boils down to NULL vs IS_ERR inconsistent error handling in io_alloc_pbuf_ring().
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] RIP: 0010:__io_remove_buffers+0xac/0x700 io_uring/kbuf.c:341 Call Trace: <TASK> io_put_bl io_uring/kbuf.c:378 [inline] io_destroy_buffers+0x14e/0x490 io_uring/kbuf.c:392 io_ring_ctx_free+0xa00/0x1070 io_uring/io_uring.c:2613 io_ring_exit_work+0x80f/0x8a0 io_uring/io_uring.c:2844 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd40 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
--- io_uring/kbuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/kbuf.c +3 -1
@@ -510,8 +510,10 @@ static int io_alloc_pbuf_ring(struct io_ ring_size = reg->ring_entries *sizeof (struct io_uring_buf_ring ); bl->buf_ring =io_pages_map (&bl->buf_pages, &bl->buf_nr_pages, ring_size); -if (!bl->buf_ring) +if (IS_ERR (bl->buf_ring)) { + bl->buf_ring =NULL ;return -ENOMEM ; + } bl->is_mapped =1 ; bl->is_mmap =1 ;return 0 ;
Greg Kroah-Hartman
maintainerPATCH 104/166 Input: ads7846 - fix gpiod allocation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: H. Nikolaus Schaller <[email protected]>
commit c9ccb88f534ca760d06590b67571c353a2f0cbcd upstream.
commit 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
has simplified the code but accidentially converted a devm_gpiod_get() to gpiod_get(). This leaves the gpio reserved on module remove and the driver can no longer be loaded again.
--- drivers/input/touchscreen/ads7846.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +1 -1
@@ -995,7 +995,7 @@ static int ads7846_setup_pendown(structif (pdata->get_pendown_state) { ts->get_pendown_state = pdata->get_pendown_state; }else { - ts->gpio_pendown =gpiod_get (&spi->dev,"pendown" ,GPIOD_IN ); + ts->gpio_pendown =devm_gpiod_get (&spi->dev,"pendown" ,GPIOD_IN );if (IS_ERR (ts->gpio_pendown)) {dev_err (&spi->dev,"failed to request pendown GPIO\n" );return PTR_ERR (ts->gpio_pendown);
Greg Kroah-Hartman
maintainerPATCH 105/166 Input: iqs7222 - preserve system status register
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff LaBundy <[email protected]>
commit a2add513311b48cc924a699a8174db2c61ed5e8a upstream.
Some register groups reserve a byte at the end of their continuous address space. Depending on the variant of silicon, this field may share the same memory space as the lower byte of the system status register (0x10).
In these cases, caching the reserved byte and writing it later may effectively reset the device depending on what happened in between the read and write operations.
Solve this problem by avoiding any access to this last byte within offending register groups. This method replaces a workaround which attempted to write the reserved byte with up-to-date contents, but left a small window in which updates by the device could have been clobbered.
Now that the driver does not touch these reserved bytes, the order in which the device's registers are written no longer matters, and they can be written in their natural order. The new method is also much more generic, and can be more easily extended to new variants of silicon with different register maps.
As part of this change, the register read and write functions must be gently updated to support byte access instead of word access.
--- drivers/input/misc/iqs7222.c | 50 ++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 28 deletions(-)
drivers/input/misc/iqs7222.c +22 -28
@@ -100,11 +100,11 @@ enum iqs7222_reg_key_id {enum iqs7222_reg_grp_id {IQS7222_REG_GRP_STAT , -IQS7222_REG_GRP_FILT ,IQS7222_REG_GRP_CYCLE ,IQS7222_REG_GRP_GLBL ,IQS7222_REG_GRP_BTN ,IQS7222_REG_GRP_CHAN , +IQS7222_REG_GRP_FILT ,IQS7222_REG_GRP_SLDR ,IQS7222_REG_GRP_TPAD ,IQS7222_REG_GRP_GPIO ,
@@ -286,6 +286,7 @@ static const struct iqs7222_event_desc istruct iqs7222_reg_grp_desc {u16 base; +u16 val_len;int num_row;int num_col; };
@@ -342,6 +343,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAC00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -400,6 +402,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAC00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -454,6 +457,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xC400, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -496,6 +500,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xC400, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -543,6 +548,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAA00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -600,6 +606,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAA00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -656,6 +663,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAE00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -712,6 +720,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAE00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -768,6 +777,7 @@ static const struct iqs7222_dev_desc iqs }, [IQS7222_REG_GRP_FILT] = { .base = 0xAE00, + .val_len = 3, .num_row = 1, .num_col = 2, },
@@ -1604,7 +1614,7 @@ static int iqs7222_force_comms(struct iq }static int iqs7222_read_burst (struct iqs7222_private *iqs7222, -u16 reg,void *val,u16 num_val) +u16 reg,void *val,u16 val_len) {u8 reg_buf[sizeof (__be16)];int ret, i;
@@ -1619,7 +1629,7 @@ static int iqs7222_read_burst(struct iqs { .addr = client->addr, .flags = I2C_M_RD, - .len = num_val * sizeof(__le16), + .len = val_len, .buf = (u8 *)val, }, };
@@ -1675,7 +1685,7 @@ static int iqs7222_read_word(struct iqs7__le16 val_buf;int error; - error =iqs7222_read_burst (iqs7222, reg, &val_buf,1 ); + error =iqs7222_read_burst (iqs7222, reg, &val_buf,sizeof (val_buf));if (error)return error;
@@ -1685,10 +1695,9 @@ static int iqs7222_read_word(struct iqs7 }static int iqs7222_write_burst (struct iqs7222_private *iqs7222, -u16 reg,const void *val,u16 num_val) +u16 reg,const void *val,u16 val_len) {int reg_len = reg >U8_MAX ?sizeof (reg) :sizeof (u8); -int val_len = num_val *sizeof (__le16);int msg_len = reg_len + val_len;int ret, i;struct i2c_client *client = iqs7222->client;
@@ -1747,7 +1756,7 @@ static int iqs7222_write_word(struct iqs {__le16 val_buf =cpu_to_le16 (val); -return iqs7222_write_burst (iqs7222, reg, &val_buf,1 ); +return iqs7222_write_burst (iqs7222, reg, &val_buf,sizeof (val_buf)); }static int iqs7222_ati_trigger (struct iqs7222_private *iqs7222)
@@ -1831,30 +1840,14 @@ static int iqs7222_dev_init(struct iqs72/* * Acknowledge reset before writing any registers in case the device -* suffers a spurious reset during initialization. Because this step -* may change the reserved fields of the second filter beta register, -* its cache must be updated. -* -* Writing the second filter beta register, in turn, may clobber the -* system status register. As such, the filter beta register pair is -* written first to protect against this hazard. +* suffers a spurious reset during initialization. */ if (dir ==WRITE ) { -u16 reg = dev_desc->reg_grps[IQS7222_REG_GRP_FILT ].base +1 ; -u16 filt_setup; - error =iqs7222_write_word (iqs7222,IQS7222_SYS_SETUP , iqs7222->sys_setup[0 ] |IQS7222_SYS_SETUP_ACK_RESET );if (error)return error; - - error =iqs7222_read_word (iqs7222, reg, &filt_setup); -if (error) -return error; - - iqs7222->filt_setup[1 ] &=GENMASK (7 ,0 ); - iqs7222->filt_setup[1 ] |= (filt_setup & ~GENMASK (7 ,0 )); }/*
@@ -1883,6 +1876,7 @@ static int iqs7222_dev_init(struct iqs72int num_col = dev_desc->reg_grps[i].num_col;u16 reg = dev_desc->reg_grps[i].base;__le16 *val_buf; +u16 val_len = dev_desc->reg_grps[i].val_len ? : num_col *sizeof (*val_buf);u16 *val;if (!num_col)
@@ -1900,7 +1894,7 @@ static int iqs7222_dev_init(struct iqs72switch (dir) {case READ : error =iqs7222_read_burst (iqs7222, reg, - val_buf, num_col); + val_buf, val_len);for (k =0 ; k < num_col; k++) val[k] =le16_to_cpu (val_buf[k]);break ;
@@ -1909,7 +1903,7 @@ static int iqs7222_dev_init(struct iqs72for (k =0 ; k < num_col; k++) val_buf[k] =cpu_to_le16 (val[k]); error =iqs7222_write_burst (iqs7222, reg, - val_buf, num_col); + val_buf, val_len);break ;default :
@@ -1962,7 +1956,7 @@ static int iqs7222_dev_info(struct iqs72int error, i; error =iqs7222_read_burst (iqs7222,IQS7222_PROD_NUM , dev_id, -ARRAY_SIZE (dev_id)); +sizeof (dev_id));if (error)return error;
@@ -2917,7 +2911,7 @@ static int iqs7222_report(struct iqs7222__le16 status[IQS7222_MAX_COLS_STAT ]; error =iqs7222_read_burst (iqs7222,IQS7222_SYS_STATUS , status, - num_stat); + num_stat *sizeof (*status));if (error)return error;
Greg Kroah-Hartman
maintainerPATCH 106/166 Input: xpad - add 8BitDo SN30 Pro, Hyperkin X91 and Gamesir G7 SE controllers
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nilton Perim Neto <[email protected]>
commit 36e093c8dcc585d0a9e79a005f721f01f3365eba upstream.
Add 8BitDo SN30 Pro, Hyperkin X91 and Gamesir G7 SE to the list of recognized controllers, and update vendor comments to match.
--- drivers/input/joystick/xpad.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/input/joystick/xpad.c +8 -5
@@ -375,8 +375,10 @@ static const struct xpad_device { { 0x294b, 0x3404, "Snakebyte GAMEPAD RGB X", 0, XTYPE_XBOXONE }, { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE }, { 0x2dc8, 0x3106, "8BitDo Ultimate Wireless / Pro 2 Wired Controller", 0, XTYPE_XBOX360 }, + { 0x2dc8, 0x6001, "8BitDo SN30 Pro", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x310a, "8BitDo Ultimate 2C Wireless Controller", 0, XTYPE_XBOX360 }, { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE }, + { 0x2e24, 0x1688, "Hyperkin X91 X-Box One pad", 0, XTYPE_XBOXONE }, { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -388,6 +390,7 @@ static const struct xpad_device { { 0x3285, 0x0646, "Nacon Pro Compact", 0, XTYPE_XBOXONE }, { 0x3285, 0x0663, "Nacon Evol-X", 0, XTYPE_XBOXONE }, { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 }, + { 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE }, { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
@@ -526,12 +529,12 @@ static const struct usb_device_id xpad_tXPAD_XBOXONE_VENDOR (0x24c6 ),/* PowerA controllers */ XPAD_XBOX360_VENDOR (0x2563 ),/* OneXPlayer Gamepad */ XPAD_XBOX360_VENDOR (0x260d ),/* Dareu H101 */ -XPAD_XBOXONE_VENDOR (0x294b ),/* Snakebyte */ +XPAD_XBOXONE_VENDOR (0x294b ),/* Snakebyte */ XPAD_XBOX360_VENDOR (0x2c22 ),/* Qanba Controllers */ -XPAD_XBOX360_VENDOR (0x2dc8 ),/* 8BitDo Pro 2 Wired Controller */ -XPAD_XBOXONE_VENDOR (0x2dc8 ),/* 8BitDo Pro 2 Wired Controller for Xbox */ -XPAD_XBOXONE_VENDOR (0x2e24 ),/* Hyperkin Duke Xbox One pad */ -XPAD_XBOX360_VENDOR (0x2f24 ),/* GameSir controllers */ +XPAD_XBOX360_VENDOR (0x2dc8 ),/* 8BitDo Controllers */ +XPAD_XBOXONE_VENDOR (0x2dc8 ),/* 8BitDo Controllers */ +XPAD_XBOXONE_VENDOR (0x2e24 ),/* Hyperkin Controllers */ +XPAD_XBOX360_VENDOR (0x2f24 ),/* GameSir Controllers */ XPAD_XBOX360_VENDOR (0x31e3 ),/* Wooting Keyboards */ XPAD_XBOX360_VENDOR (0x3285 ),/* Nacon GC-100 */ XPAD_XBOXONE_VENDOR(0x3285), /* Nacon Evol-X */
Greg Kroah-Hartman
maintainerPATCH 107/166 Input: xpad - add multiple supported devices
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Rojtberg <[email protected]>
commit 3492321e2e60ddfe91aa438bb9ac209016f48f7a upstream.
This is based on multiple commits at https://github.com/paroj/xpad
that had bouncing email addresses and were not signed off.
--- drivers/input/joystick/xpad.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/input/joystick/xpad.c +19 -1
@@ -140,6 +140,7 @@ static const struct xpad_device { { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX }, { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, + { 0x044f, 0xd01e, "ThrustMaster, Inc. ESWAP X 2 ELDEN RING EDITION", 0, XTYPE_XBOXONE }, { 0x044f, 0x0f10, "Thrustmaster Modena GT Wheel", 0, XTYPE_XBOX }, { 0x044f, 0xb326, "Thrustmaster Gamepad GP XID", 0, XTYPE_XBOX360 }, { 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", 0, XTYPE_XBOX },
@@ -177,6 +178,7 @@ static const struct xpad_device { { 0x06a3, 0x0200, "Saitek Racing Wheel", 0, XTYPE_XBOX }, { 0x06a3, 0x0201, "Saitek Adrenalin", 0, XTYPE_XBOX }, { 0x06a3, 0xf51a, "Saitek P3600", 0, XTYPE_XBOX360 }, + { 0x0738, 0x4503, "Mad Catz Racing Wheel", 0, XTYPE_XBOXONE }, { 0x0738, 0x4506, "Mad Catz 4506 Wireless Controller", 0, XTYPE_XBOX }, { 0x0738, 0x4516, "Mad Catz Control Pad", 0, XTYPE_XBOX }, { 0x0738, 0x4520, "Mad Catz Control Pad Pro", 0, XTYPE_XBOX },
@@ -238,6 +240,7 @@ static const struct xpad_device { { 0x0e6f, 0x0146, "Rock Candy Wired Controller for Xbox One", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0147, "PDP Marvel Xbox One Controller", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x015c, "PDP Xbox One Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, + { 0x0e6f, 0x015d, "PDP Mirror's Edge Official Wired Controller for Xbox One", XTYPE_XBOXONE }, { 0x0e6f, 0x0161, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0162, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0163, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
@@ -276,12 +279,15 @@ static const struct xpad_device { { 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, { 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, { 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, + { 0x0f0d, 0x0151, "Hori Racing Wheel Overdrive for Xbox Series X", 0, XTYPE_XBOXONE }, + { 0x0f0d, 0x0152, "Hori Racing Wheel Overdrive for Xbox Series X", 0, XTYPE_XBOXONE }, { 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX }, { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX }, { 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 }, { 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 }, + { 0x10f5, 0x7005, "Turtle Beach Recon Controller", 0, XTYPE_XBOXONE }, { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 }, { 0x11ff, 0x0511, "PXN V900", 0, XTYPE_XBOX360 }, { 0x1209, 0x2882, "Ardwiino Controller", 0, XTYPE_XBOX360 },
@@ -365,6 +371,7 @@ static const struct xpad_device { { 0x24c6, 0x5510, "Hori Fighting Commander ONE (Xbox 360/PC Mode)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, { 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE }, { 0x24c6, 0x561a, "PowerA FUSION Controller", 0, XTYPE_XBOXONE }, + { 0x24c6, 0x581a, "ThrustMaster XB1 Classic Controller", 0, XTYPE_XBOXONE }, { 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 }, { 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 }, { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
@@ -375,10 +382,12 @@ static const struct xpad_device { { 0x294b, 0x3404, "Snakebyte GAMEPAD RGB X", 0, XTYPE_XBOXONE }, { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE }, { 0x2dc8, 0x3106, "8BitDo Ultimate Wireless / Pro 2 Wired Controller", 0, XTYPE_XBOX360 }, - { 0x2dc8, 0x6001, "8BitDo SN30 Pro", 0, XTYPE_XBOX360 }, + { 0x2dc8, 0x3109, "8BitDo Ultimate Wireless Bluetooth", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x310a, "8BitDo Ultimate 2C Wireless Controller", 0, XTYPE_XBOX360 }, + { 0x2dc8, 0x6001, "8BitDo SN30 Pro", 0, XTYPE_XBOX360 }, { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE }, { 0x2e24, 0x1688, "Hyperkin X91 X-Box One pad", 0, XTYPE_XBOXONE }, + { 0x2e95, 0x0504, "SCUF Gaming Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE }, { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -386,12 +395,16 @@ static const struct xpad_device { { 0x31e3, 0x1230, "Wooting Two HE (ARM)", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 }, + { 0x3285, 0x0603, "Nacon Pro Compact controller for Xbox", 0, XTYPE_XBOXONE }, { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 }, + { 0x3285, 0x0614, "Nacon Pro Compact", 0, XTYPE_XBOXONE }, { 0x3285, 0x0646, "Nacon Pro Compact", 0, XTYPE_XBOXONE }, + { 0x3285, 0x0662, "Nacon Revolution5 Pro", 0, XTYPE_XBOX360 }, { 0x3285, 0x0663, "Nacon Evol-X", 0, XTYPE_XBOXONE }, { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 }, { 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE }, { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, + { 0x413d, 0x2104, "Black Shark Green Ghost Gamepad", 0, XTYPE_XBOX360 }, { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } };
@@ -490,6 +503,7 @@ static const struct usb_device_id xpad_tXPAD_XBOX360_VENDOR (0x03f0 ),/* HP HyperX Xbox 360 controllers */ XPAD_XBOXONE_VENDOR (0x03f0 ),/* HP HyperX Xbox One controllers */ XPAD_XBOX360_VENDOR (0x044f ),/* Thrustmaster Xbox 360 controllers */ +XPAD_XBOXONE_VENDOR (0x044f ),/* Thrustmaster Xbox One controllers */ XPAD_XBOX360_VENDOR (0x045e ),/* Microsoft Xbox 360 controllers */ XPAD_XBOXONE_VENDOR (0x045e ),/* Microsoft Xbox One controllers */ XPAD_XBOX360_VENDOR(0x046d), /* Logitech Xbox 360-style controllers */
@@ -535,11 +549,13 @@ static const struct usb_device_id xpad_tXPAD_XBOXONE_VENDOR (0x2dc8 ),/* 8BitDo Controllers */ XPAD_XBOXONE_VENDOR (0x2e24 ),/* Hyperkin Controllers */ XPAD_XBOX360_VENDOR (0x2f24 ),/* GameSir Controllers */ +XPAD_XBOXONE_VENDOR (0x2e95 ),/* SCUF Gaming Controller */ XPAD_XBOX360_VENDOR (0x31e3 ),/* Wooting Keyboards */ XPAD_XBOX360_VENDOR (0x3285 ),/* Nacon GC-100 */ XPAD_XBOXONE_VENDOR (0x3285 ),/* Nacon Evol-X */ XPAD_XBOX360_VENDOR (0x3537 ),/* GameSir Controllers */ XPAD_XBOXONE_VENDOR (0x3537 ),/* GameSir Controllers */ + XPAD_XBOX360_VENDOR(0x413d), /* Black Shark Green Ghost Controller */ { } };
@@ -692,7 +708,9 @@ static const struct xboxone_init_packetXBOXONE_INIT_PKT (0x045e ,0x0b00 , xboxone_s_init),XBOXONE_INIT_PKT (0x045e ,0x0b00 , extra_input_packet_init),XBOXONE_INIT_PKT (0x0e6f ,0x0000 , xboxone_pdp_led_on), +XBOXONE_INIT_PKT (0x20d6 ,0xa01a , xboxone_pdp_led_on),XBOXONE_INIT_PKT (0x0e6f ,0x0000 , xboxone_pdp_auth), +XBOXONE_INIT_PKT (0x20d6 ,0xa01a , xboxone_pdp_auth),XBOXONE_INIT_PKT (0x24c6 ,0x541a , xboxone_rumblebegin_init),XBOXONE_INIT_PKT (0x24c6 ,0x542a , xboxone_rumblebegin_init), XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
Greg Kroah-Hartman
maintainerPATCH 108/166 Input: xpad - add support for ZOTAC Gaming Zone
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antheas Kapenekakis <[email protected]>
commit 709329c48214ad2acf12eed1b5c0eb798e40a64c upstream.
ZOTAC Gaming Zone is ZOTAC's 2024 handheld release. As it is common with these handhelds, it uses a hybrid USB device with an xpad endpoint, a keyboard endpoint, and a vendor-specific endpoint for RGB control et al.
--- drivers/input/joystick/xpad.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
@@ -349,6 +349,7 @@ static const struct xpad_device { { 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 }, { 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 }, { 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 }, + { 0x1ee9, 0x1590, "ZOTAC Gaming Zone", 0, XTYPE_XBOX360 }, { 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE }, { 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE }, { 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
@@ -537,6 +538,7 @@ static const struct usb_device_id xpad_tXPAD_XBOX360_VENDOR (0x1949 ),/* Amazon controllers */ XPAD_XBOX360_VENDOR (0x1a86 ),/* QH Electronics */ XPAD_XBOX360_VENDOR (0x1bad ),/* Harmonix Rock Band guitar and drums */ +XPAD_XBOX360_VENDOR (0x1ee9 ),/* ZOTAC Technology Limited */ XPAD_XBOX360_VENDOR (0x20d6 ),/* PowerA controllers */ XPAD_XBOXONE_VENDOR (0x20d6 ),/* PowerA controllers */ XPAD_XBOX360_VENDOR(0x24c6), /* PowerA controllers */
Greg Kroah-Hartman
maintainerPATCH 109/166 Input: xpad - add support for TECNO Pocket Go
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antheas Kapenekakis <[email protected]>
commit 95a54a96f657fd069d2a9922b6c2d293a72a001f upstream.
TECNO Pocket Go is a kickstarter handheld by manufacturer TECNO Mobile. It poses a unique feature: it does not have a display. Instead, the handheld is essentially a pc in a controller. As customary, it has an xpad endpoint, a keyboard endpoint, and a vendor endpoint for its vendor software.
--- drivers/input/joystick/xpad.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/input/joystick/xpad.c +2 -0
@@ -381,6 +381,7 @@ static const struct xpad_device { { 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 }, { 0x294b, 0x3303, "Snakebyte GAMEPAD BASE X", 0, XTYPE_XBOXONE }, { 0x294b, 0x3404, "Snakebyte GAMEPAD RGB X", 0, XTYPE_XBOXONE }, + { 0x2993, 0x2001, "TECNO Pocket Go", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE }, { 0x2dc8, 0x3106, "8BitDo Ultimate Wireless / Pro 2 Wired Controller", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x3109, "8BitDo Ultimate Wireless Bluetooth", 0, XTYPE_XBOX360 },
@@ -546,6 +547,7 @@ static const struct usb_device_id xpad_tXPAD_XBOX360_VENDOR (0x2563 ),/* OneXPlayer Gamepad */ XPAD_XBOX360_VENDOR (0x260d ),/* Dareu H101 */ XPAD_XBOXONE_VENDOR (0x294b ),/* Snakebyte */ +XPAD_XBOX360_VENDOR (0x2993 ),/* TECNO Mobile */ XPAD_XBOX360_VENDOR (0x2c22 ),/* Qanba Controllers */ XPAD_XBOX360_VENDOR (0x2dc8 ),/* 8BitDo Controllers */ XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Controllers */
Greg Kroah-Hartman
maintainerPATCH 110/166 Input: xpad - rename QH controller to Legion Go S
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antheas Kapenekakis <[email protected]>
commit 659a7614dd72e2835ac0b220c2fa68fabd8d1df9 upstream.
The QH controller is actually the controller of the Legion Go S, with the manufacturer string wch.cn and product name Legion Go S in its USB descriptor. A cursory lookup of the VID reveals the same.
Therefore, rename the xpad entries to match.
--- drivers/input/joystick/xpad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/joystick/xpad.c +2 -2
@@ -312,7 +312,7 @@ static const struct xpad_device { { 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 }, { 0x17ef, 0x6182, "Lenovo Legion Controller for Windows", 0, XTYPE_XBOX360 }, { 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 }, - { 0x1a86, 0xe310, "QH Electronics Controller", 0, XTYPE_XBOX360 }, + { 0x1a86, 0xe310, "Legion Go S", 0, XTYPE_XBOX360 }, { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 }, { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, { 0x1bad, 0x0130, "Ion Drum Rocker", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
@@ -537,7 +537,7 @@ static const struct usb_device_id xpad_tXPAD_XBOX360_VENDOR (0x1689 ),/* Razer Onza */ XPAD_XBOX360_VENDOR (0x17ef ),/* Lenovo */ XPAD_XBOX360_VENDOR (0x1949 ),/* Amazon controllers */ -XPAD_XBOX360_VENDOR (0x1a86 ),/* QH Electronics */ +XPAD_XBOX360_VENDOR (0x1a86 ),/* Nanjing Qinheng Microelectronics (WCH) */ XPAD_XBOX360_VENDOR (0x1bad ),/* Harmonix Rock Band guitar and drums */ XPAD_XBOX360_VENDOR (0x1ee9 ),/* ZOTAC Technology Limited */ XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */
Greg Kroah-Hartman
maintainerPATCH 111/166 Input: i8042 - swap old quirk combination with new quirk for NHxxRZQ
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Werner Sembach <[email protected]>
commit 729d163232971672d0f41b93c02092fb91f0e758 upstream.
Some older Clevo barebones have problems like no or laggy keyboard after resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE quirk.
With the old i8042 quirks this devices keyboard is sometimes laggy after resume. With the new quirk this issue doesn't happen.
--- drivers/input/serio/i8042-acpipnpio.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/input/serio/i8042-acpipnpio.h +1 -9
@@ -1209,18 +1209,10 @@ static const struct dmi_system_id i8042_ SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) }, { -/* -* Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes -* the keyboard very laggy for ~5 seconds after boot and -* sometimes also after resume. -* However both are required for the keyboard to not fail -* completely sometimes after boot or resume. -*/ .matches = { DMI_MATCH(DMI_BOARD_NAME, "NHxxRZQ"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
Greg Kroah-Hartman
maintainerPATCH 112/166 Input: i8042 - add required quirks for missing old boardnames
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Werner Sembach <[email protected]>
commit 9ed468e17d5b80e7116fd35842df3648e808ae47 upstream.
Some older Clevo barebones have problems like no or laggy keyboard after resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE quirk.
The PB71RD keyboard is sometimes laggy after resume and the PC70DR, PB51RF, P640RE, and PCX0DX_GN20 keyboard is sometimes unresponsive after resume. This quirk fixes that.
--- drivers/input/serio/i8042-acpipnpio.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
drivers/input/serio/i8042-acpipnpio.h +30 -0
@@ -1261,6 +1261,12 @@ static const struct dmi_system_id i8042_ SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) }, { + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "P640RE"), + }, + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) + }, + {/* * This is only a partial board_name and might be followed by * another letter or number. DMI_MATCH however does do partial
@@ -1337,11 +1343,35 @@ static const struct dmi_system_id i8042_ }, { .matches = { + DMI_MATCH(DMI_BOARD_NAME, "PB51RF"), + }, + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "PB71RD"), + }, + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "PC70DR"), + }, + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) + }, + { + .matches = { DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"), }, .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS |SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) }, + { + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "PCX0DX_GN20"), + }, + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) + }, /* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */ { .matches = {
Greg Kroah-Hartman
maintainerPATCH 113/166 Input: i8042 - swap old quirk combination with new quirk for several devices
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Werner Sembach <[email protected]>
commit 75ee4ebebbbe8dc4b55ba37f388924fa96bf1564 upstream.
Some older Clevo barebones have problems like no or laggy keyboard after resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE quirk.
While the old quirk combination did not show negative effects on these devices specifically, the new quirk works just as well and seems more stable in general.
--- drivers/input/serio/i8042-acpipnpio.h | 40 +++++++++++----------------------- 1 file changed, 14 insertions(+), 26 deletions(-)
drivers/input/serio/i8042-acpipnpio.h +14 -26
@@ -1080,16 +1080,14 @@ static const struct dmi_system_id i8042_DMI_MATCH (DMI_BOARD_VENDOR ,"TUXEDO" ), DMI_MATCH(DMI_BOARD_NAME, "AURA1501"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {DMI_MATCH (DMI_BOARD_VENDOR ,"TUXEDO" ), DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/* Mivvy M310 */
@@ -1171,8 +1169,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1205,8 +1202,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1218,8 +1214,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) },/* * At least one modern Clevo barebone has the touchpad connected both
@@ -1235,17 +1230,15 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "NS50MU"), }, - .driver_data = (void *)(SERIO_QUIRK_NOAUX |SERIO_QUIRK_NOMUX | -SERIO_QUIRK_RESET_ALWAYS |SERIO_QUIRK_NOLOOP | -SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_NOAUX | +SERIO_QUIRK_FORCENORESTORE ) }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"), }, - .driver_data = (void *)(SERIO_QUIRK_NOAUX |SERIO_QUIRK_NOMUX | -SERIO_QUIRK_RESET_ALWAYS |SERIO_QUIRK_NOLOOP | -SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_NOAUX | +SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1319,8 +1312,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/*
@@ -1338,8 +1330,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1363,8 +1354,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1383,15 +1373,13 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "X170SM"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/*
Greg Kroah-Hartman
maintainerPATCH 114/166 Input: i8042 - swap old quirk combination with new quirk for more devices
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Werner Sembach <[email protected]>
commit d85862ccca452eeb19329e9f4f9a6ce1d1e53561 upstream.
Some older Clevo barebones have problems like no or laggy keyboard after resume or boot which can be fixed with the SERIO_QUIRK_FORCENORESTORE quirk.
We could not activly retest these devices because we no longer have them in our archive, but based on the other old Clevo barebones we tested where the new quirk had the same or a better behaviour I think it would be good to apply it on these too.
--- drivers/input/serio/i8042-acpipnpio.h | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-)
drivers/input/serio/i8042-acpipnpio.h +10 -21
@@ -1157,9 +1157,7 @@ static const struct dmi_system_id i8042_ },/* * A lot of modern Clevo barebones have touchpad and/or keyboard issues -* after suspend fixable with nomux + reset + noloop + nopnp. Luckily, -* none of them have an external PS/2 port so this can safely be set for -* all of them. +* after suspend fixable with the forcenorestore quirk. * Clevo barebones come with board_vendor and/or system_vendor set to * either the very generic string "Notebook" and/or a different value * for each individual reseller. The only somewhat universal way to
@@ -1175,22 +1173,19 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "N140CU"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "N141CU"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1250,8 +1245,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
@@ -1268,16 +1262,14 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/* Clevo P650RS, 650RP6, Sager NP8152-S, and others */ .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/*
@@ -1288,8 +1280,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/*
@@ -1300,8 +1291,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, {/*
@@ -1323,8 +1313,7 @@ static const struct dmi_system_id i8042_ .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"), }, - .driver_data = (void *)(SERIO_QUIRK_NOMUX |SERIO_QUIRK_RESET_ALWAYS | -SERIO_QUIRK_NOLOOP |SERIO_QUIRK_NOPNP ) + .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE ) }, { .matches = {
Greg Kroah-Hartman
maintainerPATCH 115/166 USB: serial: ftdi_sio: add support for Altera USB Blaster 3
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boon Khai Ng <[email protected]>
commit 18e0885bd2ca738407036434418a26a58394a60e upstream.
The Altera USB Blaster 3, available as both a cable and an on-board solution, is primarily used for programming and debugging FPGAs.
It interfaces with host software such as Quartus Programmer, System Console, SignalTap, and Nios Debugger. The device utilizes either an FT2232 or FT4232 chip.
Enabling the support for various configurations of the on-board USB Blaster 3 by including the appropriate VID/PID pairs, allowing it to function as a serial device via ftdi_sio.
Note that this check-in does not include support for the cable solution, as it does not support UART functionality. The supported configurations are determined by the hardware design and include:
1) PID 0x6022, FT2232, 1 JTAG port (Port A) + Port B as UART
2) PID 0x6025, FT4232, 1 JTAG port (Port A) + Port C as UART
3) PID 0x6026, FT4232, 1 JTAG port (Port A) + Port C, D as UART
4) PID 0x6029, FT4232, 1 JTAG port (Port B) + Port C as UART
5) PID 0x602a, FT4232, 1 JTAG port (Port B) + Port C, D as UART
6) PID 0x602c, FT4232, 1 JTAG port (Port A) + Port B as UART
7) PID 0x602d, FT4232, 1 JTAG port (Port A) + Port B, C as UART
8) PID 0x602e, FT4232, 1 JTAG port (Port A) + Port B, C, D as UART
These configurations allow for flexibility in how the USB Blaster 3 is used, depending on the specific needs of the hardware design.
--- drivers/usb/serial/ftdi_sio.c | 14 ++++++++++++++ drivers/usb/serial/ftdi_sio_ids.h | 13 +++++++++++++ 2 files changed, 27 insertions(+)
drivers/usb/serial/ftdi_sio.c +14 -0
@@ -1079,6 +1079,20 @@ static const struct usb_device_id id_tab .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },/* GMC devices */ { USB_DEVICE(GMC_VID, GMC_Z216C_PID) }, +/* Altera USB Blaster 3 */ + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6022_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6025_PID, 2) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6026_PID, 2) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6026_PID, 3) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6029_PID, 2) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602A_PID, 2) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602A_PID, 3) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602C_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602D_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602D_PID, 2) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 1) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 2) }, + { USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 3) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +13 -0
@@ -1612,3 +1612,16 @@*/ #define GMC_VID 0x1cd7#define GMC_Z216C_PID 0x0217/* GMC Z216C Adapter IR-USB */ + +/* +* Altera USB Blaster 3 (http://www.altera.com). +*/ +#define ALTERA_VID 0x09fb +#define ALTERA_UB3_6022_PID 0x6022 +#define ALTERA_UB3_6025_PID 0x6025 +#define ALTERA_UB3_6026_PID 0x6026 +#define ALTERA_UB3_6029_PID 0x6029 +#define ALTERA_UB3_602A_PID 0x602a +#define ALTERA_UB3_602C_PID 0x602c +#define ALTERA_UB3_602D_PID 0x602d +#define ALTERA_UB3_602E_PID 0x602e
Greg Kroah-Hartman
maintainerPATCH 116/166 USB: serial: option: add Telit Cinterion FE990B compositions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Porcedda <[email protected]>
commit 4981bb50392b7515b765da28cf8768ce624c2670 upstream.
Add the following Telit Cinterion FE990B40 compositions:
0x10b0: rmnet + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 7 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1bc7 ProdID=10b0 Rev=05.15 S: Manufacturer=Telit Cinterion S: Product=FE990 S: SerialNumber=28c2595e C: #Ifs= 9 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8a(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none) E: Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none) E: Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
0x10b1: MBIM + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 8 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1bc7 ProdID=10b1 Rev=05.15 S: Manufacturer=Telit Cinterion S: Product=FE990 S: SerialNumber=28c2595e C: #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8a(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none) E: Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none) E: Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
0x10b2: RNDIS + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 9 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1bc7 ProdID=10b2 Rev=05.15 S: Manufacturer=Telit Cinterion S: Product=FE990 S: SerialNumber=28c2595e C: #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8a(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none) E: Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none) E: Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
0x10b3: ECM + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (AT) +
tty (diag) + DPL + QDSS (Qualcomm Debug SubSystem) + adb
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 11 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1bc7 ProdID=10b3 Rev=05.15 S: Manufacturer=Telit Cinterion S: Product=FE990 S: SerialNumber=28c2595e C: #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether E: Ad=82(I) Atr=03(Int.) MxPS= 16 Ivl=32ms I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8a(I) Atr=03(Int.) MxPS= 10 Ivl=32ms I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=80 Driver=(none) E: Ad=8c(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=70 Driver=(none) E: Ad=8d(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/usb/serial/option.c +16 -0
@@ -1388,6 +1388,22 @@ static const struct usb_device_id option .driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10aa, 0xff), /* Telit FN920C04 (MBIM) */ .driver_info = NCTRL(3) | RSVD(4) | RSVD(5) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x30), /* Telit FE990B (rmnet) */ + .driver_info = NCTRL(5) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x60) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b1, 0xff, 0xff, 0x30), /* Telit FE990B (MBIM) */ + .driver_info = NCTRL(6) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b1, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b1, 0xff, 0xff, 0x60) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b2, 0xff, 0xff, 0x30), /* Telit FE990B (RNDIS) */ + .driver_info = NCTRL(6) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b2, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b2, 0xff, 0xff, 0x60) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b3, 0xff, 0xff, 0x30), /* Telit FE990B (ECM) */ + .driver_info = NCTRL(6) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b3, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b3, 0xff, 0xff, 0x60) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c0, 0xff), /* Telit FE910C04 (rmnet) */ .driver_info = RSVD(0) | NCTRL(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c4, 0xff), /* Telit FE910C04 (rmnet) */
Greg Kroah-Hartman
maintainerPATCH 117/166 USB: serial: option: fix Telit Cinterion FE990A name
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Porcedda <[email protected]>
commit 6232f0d8e100a26275bbd773fc56a60af2c95322 upstream.
The correct name for FE990 is FE990A so use it in order to avoid confusion with FE990B.
--- drivers/usb/serial/option.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/serial/option.c +4 -4
@@ -1368,13 +1368,13 @@ static const struct usb_device_id option .driver_info = NCTRL(0) | RSVD(1) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990A (PCIe) */ .driver_info = RSVD(0) }, - { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990 (rmnet) */ + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990A (rmnet) */ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, - { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990 (MBIM) */ + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990A (MBIM) */ .driver_info = NCTRL(0) | RSVD(1) }, - { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1082, 0xff), /* Telit FE990 (RNDIS) */ + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1082, 0xff), /* Telit FE990A (RNDIS) */ .driver_info = NCTRL(2) | RSVD(3) }, - { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1083, 0xff), /* Telit FE990 (ECM) */ + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1083, 0xff), /* Telit FE990A (ECM) */ .driver_info = NCTRL(0) | RSVD(1) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a0, 0xff), /* Telit FN20C04 (rmnet) */ .driver_info = RSVD(0) | NCTRL(3) },
Greg Kroah-Hartman
maintainerPATCH 118/166 USB: serial: option: match on interface class for Telit FN990B
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 9a665fe3d967fe46edb4fd2497c7a5cc2dac2f55 upstream.
The device id entries for Telit FN990B ended up matching only on the interface protocol. While this works, the protocol is qualified by the interface class (and subclass) which should have been included.
Switch to matching using USB_DEVICE_AND_INTERFACE_INFO() while keeping the entries sorted also by protocol for consistency.
--- drivers/usb/serial/option.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/usb/serial/option.c +12 -12
@@ -1410,22 +1410,22 @@ static const struct usb_device_id option .driver_info = RSVD(0) | NCTRL(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c8, 0xff), /* Telit FE910C04 (rmnet) */ .driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d0, 0x60) }, /* Telit FN990B (rmnet) */ - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d0, 0x40) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d0, 0x30), + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x30), /* Telit FN990B (rmnet) */ .driver_info = NCTRL(5) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d1, 0x60) }, /* Telit FN990B (MBIM) */ - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d1, 0x40) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d1, 0x30), + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x60) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x30), /* Telit FN990B (MBIM) */ .driver_info = NCTRL(6) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d2, 0x60) }, /* Telit FN990B (RNDIS) */ - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d2, 0x40) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d2, 0x30), + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x60) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d2, 0xff, 0xff, 0x30), /* Telit FN990B (RNDIS) */ .driver_info = NCTRL(6) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d3, 0x60) }, /* Telit FN990B (ECM) */ - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d3, 0x40) }, - { USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d3, 0x30), + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d2, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d2, 0xff, 0xff, 0x60) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d3, 0xff, 0xff, 0x30), /* Telit FN990B (ECM) */ .driver_info = NCTRL(6) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d3, 0xff, 0xff, 0x40) }, + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d3, 0xff, 0xff, 0x60) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
Greg Kroah-Hartman
maintainerPATCH 119/166 x86/microcode/AMD: Fix out-of-bounds on systems with CPU-less NUMA nodes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florent Revest <[email protected]>
commit e3e89178a9f4a80092578af3ff3c8478f9187d59 upstream.
Currently, load_microcode_amd() iterates over all NUMA nodes, retrieves their CPU masks and unconditionally accesses per-CPU data for the first CPU of each mask.
According to Documentation/admin-guide/mm/numaperf.rst:
"Some memory may share the same node as a CPU, and others are provided as memory only nodes."
Therefore, some node CPU masks may be empty and wouldn't have a "first CPU".
On a machine with far memory (and therefore CPU-less NUMA nodes):
- cpumask_of_node(nid) is 0
- cpumask_first(0) is CONFIG_NR_CPUS
- cpu_data(CONFIG_NR_CPUS) accesses the cpu_info per-CPU array at an index that is 1 out of bounds
This does not have any security implications since flashing microcode is a privileged operation but I believe this has reliability implications by potentially corrupting memory while flashing a microcode update.
When booting with CONFIG_UBSAN_BOUNDS=y on an AMD machine that flashes a microcode update. I get the following splat:
UBSAN: array-index-out-of-bounds in arch/x86/kernel/cpu/microcode/amd.c:X:Y index 512 is out of range for type 'unsigned long[512]' [...] Call Trace: dump_stack __ubsan_handle_out_of_bounds load_microcode_amd request_microcode_amd reload_store kernfs_fop_write_iter vfs_write ksys_write do_syscall_64 entry_SYSCALL_64_after_hwframe
Change the loop to go over only NUMA nodes which have CPUs before determining whether the first CPU on the respective node needs microcode update.
[ bp: Massage commit message, fix typo. ]
--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -1
@@ -1078,7 +1078,7 @@ static enum ucode_state load_microcode_aif (ret !=UCODE_OK )return ret; -for_each_node (nid) { +for_each_node_with_cpus (nid) { cpu =cpumask_first (cpumask_of_node (nid)); c = &cpu_data (cpu);
Greg Kroah-Hartman
maintainerPATCH 120/166 drm/i915/cdclk: Do cdclk post plane programming later
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit 6266f4a78131c795631440ea9c7b66cdfd399484 upstream.
We currently call intel_set_cdclk_post_plane_update() far too early. When pipes are active during the reprogramming the current spot only works for the cd2x divider update case, as that is synchronize to the pipe's vblank. Squashing and crawling are not synchronized in any way, so doing the programming while the pipes/planes are potentially still using the old hardware state could lead to underruns.
Move the post plane reprgramming to a spot where we know that the pipes/planes have switched over the new hardware state.
--- drivers/gpu/drm/i915/display/intel_display.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +2 -3
@@ -7097,9 +7097,6 @@ static void intel_atomic_commit_tail(str/* Now enable the clocks, plane, pipe, and connectors that we set up. */ dev_priv->display.funcs.display->commit_modeset_enables (state); -if (state->modeset) -intel_set_cdclk_post_plane_update (state); -intel_wait_for_vblank_workers (state);/* FIXME: We should call drm_atomic_helper_commit_hw_done() here
@@ -7178,6 +7175,8 @@ static void intel_atomic_commit_tail(strintel_verify_planes (state);intel_sagv_post_plane_update (state); +if (state->modeset) +intel_set_cdclk_post_plane_update (state);intel_pmdemand_post_plane_update (state);drm_atomic_helper_commit_hw_done (&state->base);
Greg Kroah-Hartman
maintainerPATCH 121/166 drm/atomic: Filter out redundant DPMS calls
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit de93ddf88088f7624b589d0ff3af9effb87e8f3b upstream.
Video players (eg. mpv) do periodic XResetScreenSaver() calls to keep the screen on while the video playing. The modesetting ddx plumbs these straight through into the kernel as DPMS setproperty ioctls, without any filtering whatsoever. When implemented via atomic these end up as empty commits on the crtc (which will nonetheless take one full frame), which leads to a dropped frame every time XResetScreenSaver() is called.
Let's just filter out redundant DPMS property changes in the kernel to avoid this issue.
v2: Explain the resulting commits a bit better (Sima)
Document the behaviour in uapi docs (Sima)
Cc: [email protected]
Testcase: igt/kms_flip/flip-vs-dpms-on-nop
--- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/drm_atomic_uapi.c +4 -0
@@ -974,6 +974,10 @@ int drm_atomic_connector_commit_dpms(strif (mode !=DRM_MODE_DPMS_ON ) mode =DRM_MODE_DPMS_OFF ; + +if (connector->dpms == mode) + goto out; + connector->dpms = mode; crtc = connector->state->crtc;
drivers/gpu/drm/drm_connector.c +4 -0
@@ -1162,6 +1162,10 @@ static const u32 dp_colorspaces =* callback. For atomic drivers the remapping to the "ACTIVE" property is * implemented in the DRM core. * +* On atomic drivers any DPMS setproperty ioctl where the value does not +* change is completely skipped, otherwise a full atomic commit will occur. +* On legacy drivers the exact behavior is driver specific. +* * Note that this property cannot be set through the MODE_ATOMIC ioctl, * userspace must use "ACTIVE" on the CRTC instead. *
Greg Kroah-Hartman
maintainerPATCH 122/166 drm/dp_mst: Fix locking when skipping CSN before topology probing
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Deak <[email protected]>
commit 12d8f318347b1d4feac48e8ac351d3786af39599 upstream.
The handling of the MST Connection Status Notify message is skipped if the probing of the topology is still pending. Acquiring the drm_dp_mst_topology_mgr::probe_lock for this in drm_dp_mst_handle_up_req() is problematic: the task/work this function is called from is also responsible for handling MST down-request replies (in drm_dp_mst_handle_down_rep()). Thus drm_dp_mst_link_probe_work() - holding already probe_lock - could be blocked waiting for an MST down-request reply while drm_dp_mst_handle_up_req() is waiting for probe_lock while processing a CSN message. This leads to the probe work's down-request message timing out.
A scenario similar to the above leading to a down-request timeout is handling a CSN message in drm_dp_mst_handle_conn_stat(), holding the probe_lock and sending down-request messages while a second CSN message sent by the sink subsequently is handled by drm_dp_mst_handle_up_req().
Fix the above by moving the logic to skip the CSN handling to drm_dp_mst_process_up_req(). This function is called from a work (separate from the task/work handling new up/down messages), already holding probe_lock. This solves the above timeout issue, since handling of down-request replies won't be blocked by probe_lock.
--- drivers/gpu/drm/display/drm_dp_mst_topology.c | 40 +++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-)
drivers/gpu/drm/display/drm_dp_mst_topology.c +24 -16
@@ -3959,6 +3959,22 @@ out:return 0 ; } +static bool primary_mstb_probing_is_done (struct drm_dp_mst_topology_mgr *mgr) +{ +bool probing_done = false; + +mutex_lock (&mgr->lock); + +if (mgr->mst_primary &&drm_dp_mst_topology_try_get_mstb (mgr->mst_primary)) { + probing_done = mgr->mst_primary->link_address_sent; +drm_dp_mst_topology_put_mstb (mgr->mst_primary); + } + +mutex_unlock (&mgr->lock); + +return probing_done; +} +static inline bool drm_dp_mst_process_up_req (struct drm_dp_mst_topology_mgr *mgr,struct drm_dp_pending_up_req *up_req)
@@ -3989,8 +4005,12 @@ drm_dp_mst_process_up_req(struct drm_dp_/* TODO: Add missing handler for DP_RESOURCE_STATUS_NOTIFY events */ if (msg->req_type ==DP_CONNECTION_STATUS_NOTIFY ) { - dowork =drm_dp_mst_handle_conn_stat (mstb, &msg->u.conn_stat); - hotplug = true; +if (!primary_mstb_probing_is_done (mgr)) { +drm_dbg_kms (mgr->dev,"Got CSN before finish topology probing. Skip it.\n" ); + }else { + dowork =drm_dp_mst_handle_conn_stat (mstb, &msg->u.conn_stat); + hotplug = true; + } }drm_dp_mst_topology_put_mstb (mstb);
@@ -4069,10 +4089,11 @@ static int drm_dp_mst_handle_up_req(strudrm_dp_send_up_ack_reply (mgr, mst_primary, up_req->msg.req_type, false); +drm_dp_mst_topology_put_mstb (mst_primary); +if (up_req->msg.req_type ==DP_CONNECTION_STATUS_NOTIFY ) {const struct drm_dp_connection_status_notify *conn_stat = &up_req->msg.u.conn_stat; -bool handle_csn; drm_dbg_kms(mgr->dev, "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", conn_stat->port_number,
@@ -4081,16 +4102,6 @@ static int drm_dp_mst_handle_up_req(stru conn_stat->message_capability_status, conn_stat->input_port, conn_stat->peer_device_type); - -mutex_lock (&mgr->probe_lock); - handle_csn = mst_primary->link_address_sent; -mutex_unlock (&mgr->probe_lock); - -if (!handle_csn) { -drm_dbg_kms (mgr->dev,"Got CSN before finish topology probing. Skip it." ); -kfree (up_req); - goto out_put_primary; - } }else if (up_req->msg.req_type ==DP_RESOURCE_STATUS_NOTIFY ) {const struct drm_dp_resource_status_notify *res_stat = &up_req->msg.u.resource_stat;
@@ -4105,9 +4116,6 @@ static int drm_dp_mst_handle_up_req(strulist_add_tail (&up_req->next, &mgr->up_req_list);mutex_unlock (&mgr->up_req_lock);queue_work (system_long_wq, &mgr->up_req_work); - -out_put_primary: -drm_dp_mst_topology_put_mstb (mst_primary); out_clear_reply:memset (&mgr->up_req_recv,0 ,sizeof (struct drm_dp_sideband_msg_rx ));return 0 ;
Greg Kroah-Hartman
maintainerPATCH 123/166 drm/amd/display: Disable unneeded hpd interrupts during dm_init
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leo Li <[email protected]>
commit 40b8c14936bd2726354c856251f6baed9869e760 upstream.
[Why]
It seems HPD interrupts are enabled by default for all connectors, even if the hpd source isn't valid. An eDP for example, does not have a valid hpd source (but does have a valid hpdrx source; see construct_phy()). Thus, eDPs should have their hpd interrupt disabled.
In the past, this wasn't really an issue. Although the driver gets interrupted, then acks by writing to hw registers, there weren't any subscribed handlers that did anything meaningful (see register_hpd_handlers()).
But things changed with the introduction of IPS. s2idle requires that the driver allows IPS for DMUB fw to put hw to sleep. Since register access requires hw to be awake, the driver will block IPS entry to do so. And no IPS means no hw sleep during s2idle.
This was the observation on DCN35 systems with an eDP. During suspend, the eDP toggled its hpd pin as part of the panel power down sequence. The driver was then interrupted, and acked by writing to registers, blocking IPS entry.
[How]
Since DC marks eDP connections as having invalid hpd sources (see construct_phy()), DM should disable them at the hw level. Do so in amdgpu_dm_hpd_init() by disabling all hpd ints first, then selectively enabling ones for connectors that have valid hpd sources.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 64 ++++++++++++------ 1 file changed, 45 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +45 -19
@@ -891,8 +891,16 @@ void amdgpu_dm_hpd_init(struct amdgpu_destruct drm_device *dev =adev_to_drm (adev);struct drm_connector *connector;struct drm_connector_list_iter iter; +int irq_type;int i; +/* First, clear all hpd and hpdrx interrupts */ +for (i =DC_IRQ_SOURCE_HPD1 ; i <=DC_IRQ_SOURCE_HPD6RX ; i++) { +if (!dc_interrupt_set (adev->dm.dc, i, false)) +drm_err (dev,"Failed to clear hpd(rx) source=%d on init\n" , + i); + } +drm_connector_list_iter_begin (dev, &iter);drm_for_each_connector_iter (connector, &iter) { struct amdgpu_dm_connector *amdgpu_dm_connector =
@@ -900,10 +908,31 @@ void amdgpu_dm_hpd_init(struct amdgpu_deconst struct dc_link *dc_link = amdgpu_dm_connector->dc_link; +/* +* Get a base driver irq reference for hpd ints for the lifetime +* of dm. Note that only hpd interrupt types are registered with +* base driver; hpd_rx types aren't. IOW, amdgpu_irq_get/put on +* hpd_rx isn't available. DM currently controls hpd_rx +* explicitly with dc_interrupt_set() +*/ if (dc_link->irq_source_hpd !=DC_IRQ_SOURCE_INVALID ) { -dc_interrupt_set (adev->dm.dc, - dc_link->irq_source_hpd, - true); + irq_type = dc_link->irq_source_hpd -DC_IRQ_SOURCE_HPD1 ; +/* +* TODO: There's a mismatch between mode_info.num_hpd +* and what bios reports as the # of connectors with hpd +* sources. Since the # of hpd source types registered +* with base driver == mode_info.num_hpd, we have to +* fallback to dc_interrupt_set for the remaining types. +*/ +if (irq_type < adev->mode_info.num_hpd) { +if (amdgpu_irq_get (adev, &adev->hpd_irq, irq_type)) +drm_err (dev,"DM_IRQ: Failed get HPD for source=%d)!\n" , + dc_link->irq_source_hpd); + }else { +dc_interrupt_set (adev->dm.dc, + dc_link->irq_source_hpd, + true); + } }if (dc_link->irq_source_hpd_rx !=DC_IRQ_SOURCE_INVALID ) {
@@ -913,12 +942,6 @@ void amdgpu_dm_hpd_init(struct amdgpu_de } }drm_connector_list_iter_end (&iter); - -/* Update reference counts for HPDs */ -for (i =DC_IRQ_SOURCE_HPD1 ; i <= adev->mode_info.num_hpd; i++) { -if (amdgpu_irq_get (adev, &adev->hpd_irq, i -DC_IRQ_SOURCE_HPD1 )) -drm_err (dev,"DM_IRQ: Failed get HPD for source=%d)!\n" , i); - } }/**
@@ -934,7 +957,7 @@ void amdgpu_dm_hpd_fini(struct amdgpu_destruct drm_device *dev =adev_to_drm (adev);struct drm_connector *connector;struct drm_connector_list_iter iter; -int i; +int irq_type;drm_connector_list_iter_begin (dev, &iter);drm_for_each_connector_iter (connector, &iter) {
@@ -943,9 +966,18 @@ void amdgpu_dm_hpd_fini(struct amdgpu_deconst struct dc_link *dc_link = amdgpu_dm_connector->dc_link;if (dc_link->irq_source_hpd !=DC_IRQ_SOURCE_INVALID ) { -dc_interrupt_set (adev->dm.dc, - dc_link->irq_source_hpd, - false); + irq_type = dc_link->irq_source_hpd -DC_IRQ_SOURCE_HPD1 ; + +/* TODO: See same TODO in amdgpu_dm_hpd_init() */ +if (irq_type < adev->mode_info.num_hpd) { +if (amdgpu_irq_put (adev, &adev->hpd_irq, irq_type)) +drm_err (dev,"DM_IRQ: Failed put HPD for source=%d!\n" , + dc_link->irq_source_hpd); + }else { +dc_interrupt_set (adev->dm.dc, + dc_link->irq_source_hpd, + false); + } }if (dc_link->irq_source_hpd_rx !=DC_IRQ_SOURCE_INVALID ) {
@@ -955,10 +987,4 @@ void amdgpu_dm_hpd_fini(struct amdgpu_de } }drm_connector_list_iter_end (&iter); - -/* Update reference counts for HPDs */ -for (i =DC_IRQ_SOURCE_HPD1 ; i <= adev->mode_info.num_hpd; i++) { -if (amdgpu_irq_put (adev, &adev->hpd_irq, i -DC_IRQ_SOURCE_HPD1 )) -drm_err (dev,"DM_IRQ: Failed put HPD for source=%d!\n" , i); - } }
Greg Kroah-Hartman
maintainerPATCH 124/166 drm/amd/display: Restore correct backlight brightness after a GPU reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 5760388d9681ac743038b846b9082b9023969551 upstream.
[Why]
GPU reset will attempt to restore cached state, but brightness doesn't get restored. It will come back at 100% brightness, but userspace thinks it's the previous value.
[How]
When running resume sequence if GPU is in reset restore brightness to previous value.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10 -0
@@ -227,6 +227,10 @@ static int amdgpu_dm_atomic_check(structstatic void handle_hpd_irq_helper (struct amdgpu_dm_connector *aconnector);static void handle_hpd_rx_irq (void *param); +static void amdgpu_dm_backlight_set_level (struct amdgpu_display_manager *dm, +int bl_idx, +u32 user_brightness); +static bool is_timing_unchanged_for_freesync (struct drm_crtc_state *old_crtc_state,struct drm_crtc_state *new_crtc_state);
@@ -2879,6 +2883,12 @@ static int dm_resume(void *handle)mutex_unlock (&dm->dc_lock); +/* set the backlight after a reset */ +for (i =0 ; i < dm->num_of_edps; i++) { +if (dm->backlight_dev[i]) +amdgpu_dm_backlight_set_level (dm, i, dm->brightness[i]); + } +return 0 ; }/* Recreate dc_state - DC invalidates it when setting power state to S3. */
Greg Kroah-Hartman
maintainerPATCH 125/166 drm/amd/display: Assign normalized_pix_clk when color depth = 14
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Hung <[email protected]>
commit 79e31396fdd7037c503e6add15af7cb00633ea92 upstream.
[WHY & HOW]
A warning message "WARNING: CPU: 4 PID: 459 at ... /dc_resource.c:3397 calculate_phy_pix_clks+0xef/0x100 [amdgpu]" occurs because the display_color_depth == COLOR_DEPTH_141414 is not handled. This is observed in Radeon RX 6600 XT.
It is fixed by assigning pix_clk * (14 * 3) / 24 - same as the rests.
Also fixes the indentation in get_norm_pix_clk.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +5 -2
@@ -2567,10 +2567,13 @@ static int get_norm_pix_clk(const structbreak ;case COLOR_DEPTH_121212 : normalized_pix_clk = (pix_clk *36 ) /24 ; -break ; +break ; +case COLOR_DEPTH_141414 : + normalized_pix_clk = (pix_clk *42 ) /24 ; +break ;case COLOR_DEPTH_161616 : normalized_pix_clk = (pix_clk *48 ) /24 ; -break ; +break ;default :ASSERT (0 );break ;
Greg Kroah-Hartman
maintainerPATCH 126/166 drm/amd/display: Fix slab-use-after-free on hdcp_work
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit e65e7bea220c3ce8c4c793b4ba35557f4994ab2b upstream.
[Why]
A slab-use-after-free is reported when HDCP is destroyed but the property_validate_dwork queue is still running.
[How]
Cancel the delayed work when destroying workqueue.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +1 -0
@@ -455,6 +455,7 @@ void hdcp_destroy(struct kobject *kobj,for (i =0 ; i < hdcp_work->max_link; i++) {cancel_delayed_work_sync (&hdcp_work[i].callback_dwork);cancel_delayed_work_sync (&hdcp_work[i].watchdog_timer_dwork); +cancel_delayed_work_sync (&hdcp_work[i].property_validate_dwork); }sysfs_remove_bin_file (kobj, &hdcp_work[0 ].attr);
Greg Kroah-Hartman
maintainerPATCH 127/166 ksmbd: fix use-after-free in ksmbd_free_work_struct
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit bb39ed47065455604729404729d9116868638d31 upstream.
->interim_entry of ksmbd_work could be deleted after oplock is freed. We don't need to manage it with linked list. The interim request could be immediately sent whenever a oplock break wait is needed.
--- fs/smb/server/ksmbd_work.c | 3 --- fs/smb/server/ksmbd_work.h | 1 - fs/smb/server/oplock.c | 37 +++++++++++++++---------------------- fs/smb/server/oplock.h | 1 - 4 files changed, 15 insertions(+), 27 deletions(-)
fs/smb/server/ksmbd_work.c +0 -3
@@ -26,7 +26,6 @@ struct ksmbd_work *ksmbd_alloc_work_struINIT_LIST_HEAD (&work->request_entry);INIT_LIST_HEAD (&work->async_request_entry);INIT_LIST_HEAD (&work->fp_entry); -INIT_LIST_HEAD (&work->interim_entry);INIT_LIST_HEAD (&work->aux_read_list); work->iov_alloc_cnt =4 ; work->iov = kcalloc(work->iov_alloc_cnt, sizeof(struct kvec),
@@ -56,8 +55,6 @@ void ksmbd_free_work_struct(struct ksmbdkfree (work->tr_buf);kvfree (work->request_buf);kfree (work->iov); -if (!list_empty (&work->interim_entry)) -list_del (&work->interim_entry);if (work->async_id)ksmbd_release_id (&work->conn->async_ida, work->async_id);
fs/smb/server/ksmbd_work.h +0 -1
@@ -89,7 +89,6 @@ struct ksmbd_work {/* List head at conn->async_requests */ struct list_head async_request_entry;struct list_head fp_entry; -struct list_head interim_entry; };/**
fs/smb/server/oplock.c +15 -22
@@ -46,7 +46,6 @@ static struct oplock_info *alloc_opinfo( opinfo->fid = id; opinfo->Tid = Tid;INIT_LIST_HEAD (&opinfo->op_entry); -INIT_LIST_HEAD (&opinfo->interim_list);init_waitqueue_head (&opinfo->oplock_q);init_waitqueue_head (&opinfo->oplock_brk);atomic_set (&opinfo->refcount,1 );
@@ -803,7 +802,6 @@ out:static int smb2_lease_break_noti (struct oplock_info *opinfo) {struct ksmbd_conn *conn = opinfo->conn; -struct list_head *tmp, *t;struct ksmbd_work *work;struct lease_break_info *br_info;struct lease *lease = opinfo->o_lease;
@@ -831,16 +829,6 @@ static int smb2_lease_break_noti(struct work->sess = opinfo->sess;if (opinfo->op_state ==OPLOCK_ACK_WAIT ) { -list_for_each_safe (tmp, t, &opinfo->interim_list) { -struct ksmbd_work *in_work; - - in_work = list_entry(tmp, struct ksmbd_work, - interim_entry); -setup_async_work (in_work,NULL ,NULL ); -smb2_send_interim_resp (in_work,STATUS_PENDING ); -list_del_init (&in_work->interim_entry); -release_async_work (in_work); - }INIT_WORK (&work->work, __smb2_lease_break_noti);ksmbd_queue_work (work);wait_for_break_ack (opinfo);
@@ -871,7 +859,8 @@ static void wait_lease_breaking(struct o } } -static int oplock_break (struct oplock_info *brk_opinfo,int req_op_level) +static int oplock_break (struct oplock_info *brk_opinfo,int req_op_level, +struct ksmbd_work *in_work) {int err =0 ;
@@ -914,9 +903,15 @@ static int oplock_break(struct oplock_in }if (lease->state & (SMB2_LEASE_WRITE_CACHING_LE | -SMB2_LEASE_HANDLE_CACHING_LE )) +SMB2_LEASE_HANDLE_CACHING_LE )) { +if (in_work) { +setup_async_work (in_work,NULL ,NULL ); +smb2_send_interim_resp (in_work,STATUS_PENDING ); +release_async_work (in_work); + } + brk_opinfo->op_state =OPLOCK_ACK_WAIT ; -else + }else atomic_dec (&brk_opinfo->breaking_cnt); }else { err =oplock_break_pending (brk_opinfo, req_op_level);
@@ -1116,7 +1111,7 @@ void smb_send_parent_lease_break_noti(stif (ksmbd_conn_releasing (opinfo->conn))continue ; -oplock_break (opinfo,SMB2_OPLOCK_LEVEL_NONE ); +oplock_break (opinfo,SMB2_OPLOCK_LEVEL_NONE ,NULL );opinfo_put (opinfo); } }
@@ -1152,7 +1147,7 @@ void smb_lazy_parent_lease_break_close(sif (ksmbd_conn_releasing (opinfo->conn))continue ; -oplock_break (opinfo,SMB2_OPLOCK_LEVEL_NONE ); +oplock_break (opinfo,SMB2_OPLOCK_LEVEL_NONE ,NULL );opinfo_put (opinfo); } }
@@ -1252,8 +1247,7 @@ int smb_grant_oplock(struct ksmbd_work * goto op_break_not_needed; } -list_add (&work->interim_entry, &prev_opinfo->interim_list); - err =oplock_break (prev_opinfo,SMB2_OPLOCK_LEVEL_II ); + err =oplock_break (prev_opinfo,SMB2_OPLOCK_LEVEL_II , work);opinfo_put (prev_opinfo);if (err == -ENOENT ) goto set_lev;
@@ -1322,8 +1316,7 @@ static void smb_break_all_write_oplock(s } brk_opinfo->open_trunc = is_trunc; -list_add (&work->interim_entry, &brk_opinfo->interim_list); -oplock_break (brk_opinfo,SMB2_OPLOCK_LEVEL_II ); +oplock_break (brk_opinfo,SMB2_OPLOCK_LEVEL_II , work);opinfo_put (brk_opinfo); }
@@ -1386,7 +1379,7 @@ void smb_break_all_levII_oplock(struct k SMB2_LEASE_KEY_SIZE)) goto next; brk_op->open_trunc = is_trunc; -oplock_break (brk_op,SMB2_OPLOCK_LEVEL_NONE ); +oplock_break (brk_op,SMB2_OPLOCK_LEVEL_NONE ,NULL ); next:opinfo_put (brk_op);rcu_read_lock ();
fs/smb/server/oplock.h +0 -1
@@ -74,7 +74,6 @@ struct oplock_info {bool is_lease;bool open_trunc;/* truncate on open */ struct lease *o_lease; -struct list_head interim_list;struct list_head op_entry;struct list_head lease_entry;wait_queue_head_t oplock_q;/* Other server threads */
Greg Kroah-Hartman
maintainerPATCH 128/166 ksmbd: prevent connection release during oplock break notification
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <[email protected]>
commit 3aa660c059240e0c795217182cf7df32909dd917 upstream.
ksmbd_work could be freed when after connection release. Increment r_count of ksmbd_conn to indicate that requests are not finished yet and to not release the connection.
--- fs/smb/server/connection.c | 20 ++++++++++++++++++++ fs/smb/server/connection.h | 2 ++ fs/smb/server/oplock.c | 6 ++++++ fs/smb/server/server.c | 14 ++------------ 4 files changed, 30 insertions(+), 12 deletions(-)
fs/smb/server/connection.c +20 -0
@@ -432,6 +432,26 @@ void ksmbd_conn_init_server_callbacks(st default_conn_ops.terminate_fn = ops->terminate_fn; } +void ksmbd_conn_r_count_inc (struct ksmbd_conn *conn) +{ +atomic_inc (&conn->r_count); +} + +void ksmbd_conn_r_count_dec (struct ksmbd_conn *conn) +{ +/* +* Checking waitqueue to dropping pending requests on +* disconnection. waitqueue_active is safe because it +* uses atomic operation for condition. +*/ +atomic_inc (&conn->refcnt); +if (!atomic_dec_return (&conn->r_count) &&waitqueue_active (&conn->r_count_q)) +wake_up (&conn->r_count_q); + +if (atomic_dec_and_test (&conn->refcnt)) +kfree (conn); +} +int ksmbd_conn_transport_init (void ) {int ret;
fs/smb/server/connection.h +2 -0
@@ -168,6 +168,8 @@ int ksmbd_conn_transport_init(void);void ksmbd_conn_transport_destroy (void );void ksmbd_conn_lock (struct ksmbd_conn *conn);void ksmbd_conn_unlock (struct ksmbd_conn *conn); +void ksmbd_conn_r_count_inc (struct ksmbd_conn *conn); +void ksmbd_conn_r_count_dec (struct ksmbd_conn *conn);/* * WARNING
fs/smb/server/oplock.c +6 -0
@@ -634,6 +634,7 @@ static void __smb2_oplock_break_noti(str {struct smb2_oplock_break *rsp =NULL ; struct ksmbd_work *work = container_of(wk, struct ksmbd_work, work); +struct ksmbd_conn *conn = work->conn;struct oplock_break_info *br_info = work->request_buf;struct smb2_hdr *rsp_hdr;struct ksmbd_file *fp;
@@ -689,6 +690,7 @@ static void __smb2_oplock_break_noti(str out:ksmbd_free_work_struct (work); +ksmbd_conn_r_count_dec (conn); }/**
@@ -723,6 +725,7 @@ static int smb2_oplock_break_noti(struct work->sess = opinfo->sess;if (opinfo->op_state ==OPLOCK_ACK_WAIT ) { +ksmbd_conn_r_count_inc (conn);INIT_WORK (&work->work, __smb2_oplock_break_noti);ksmbd_queue_work (work);
@@ -744,6 +747,7 @@ static void __smb2_lease_break_noti(stru {struct smb2_lease_break *rsp =NULL ; struct ksmbd_work *work = container_of(wk, struct ksmbd_work, work); +struct ksmbd_conn *conn = work->conn;struct lease_break_info *br_info = work->request_buf;struct smb2_hdr *rsp_hdr;
@@ -790,6 +794,7 @@ static void __smb2_lease_break_noti(stru out:ksmbd_free_work_struct (work); +ksmbd_conn_r_count_dec (conn); }/**
@@ -829,6 +834,7 @@ static int smb2_lease_break_noti(struct work->sess = opinfo->sess;if (opinfo->op_state ==OPLOCK_ACK_WAIT ) { +ksmbd_conn_r_count_inc (conn);INIT_WORK (&work->work, __smb2_lease_break_noti);ksmbd_queue_work (work);wait_for_break_ack (opinfo);
fs/smb/server/server.c +2 -12
@@ -270,17 +270,7 @@ static void handle_ksmbd_work(struct worksmbd_conn_try_dequeue_request (work);ksmbd_free_work_struct (work); -/* -* Checking waitqueue to dropping pending requests on -* disconnection. waitqueue_active is safe because it -* uses atomic operation for condition. -*/ -atomic_inc (&conn->refcnt); -if (!atomic_dec_return (&conn->r_count) &&waitqueue_active (&conn->r_count_q)) -wake_up (&conn->r_count_q); - -if (atomic_dec_and_test (&conn->refcnt)) -kfree (conn); +ksmbd_conn_r_count_dec (conn); }/**
@@ -310,7 +300,7 @@ static int queue_ksmbd_work(struct ksmbd conn->request_buf =NULL ;ksmbd_conn_enqueue_request (work); -atomic_inc (&conn->r_count); +ksmbd_conn_r_count_inc (conn);/* update activity on connection */ conn->last_active = jiffies;INIT_WORK (&work->work, handle_ksmbd_work);
Greg Kroah-Hartman
maintainerPATCH 129/166 clk: samsung: update PLL locktime for PLL142XX used on FSD platform
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Varada Pavani <[email protected]>
commit 53517a70873c7a91675f7244768aad5006cc45de upstream.
Currently PLL142XX locktime is 270. As per spec, it should be 150. Hence update PLL142XX controller locktime to 150.
--- drivers/clk/samsung/clk-pll.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/clk/samsung/clk-pll.c +6 -1
@@ -206,6 +206,7 @@ static const struct clk_ops samsung_pll3*/ /* Maximum lock time can be 270 * PDIV cycles */ #define PLL35XX_LOCK_FACTOR (270) +#define PLL142XX_LOCK_FACTOR (150)#define PLL35XX_MDIV_MASK (0x3FF)#define PLL35XX_PDIV_MASK (0x3F)
@@ -272,7 +273,11 @@ static int samsung_pll35xx_set_rate(stru }/* Set PLL lock time. */ -writel_relaxed (rate->pdiv *PLL35XX_LOCK_FACTOR , +if (pll->type == pll_142xx) +writel_relaxed (rate->pdiv *PLL142XX_LOCK_FACTOR , + pll->lock_reg); +else +writel_relaxed (rate->pdiv *PLL35XX_LOCK_FACTOR , pll->lock_reg);/* Change PLL PMS values */
Greg Kroah-Hartman
maintainerPATCH 130/166 ASoC: amd: yc: Support mic on another Lenovo ThinkPad E16 Gen 2 model
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Mizrahi <[email protected]>
commit 0704a15b930cf97073ce091a0cd7ad32f2304329 upstream.
The internal microphone on the Lenovo ThinkPad E16 model requires a quirk entry to work properly. This was fixed in a previous patch (linked below), but depending on the specific variant of the model, the product name may be "21M5" or "21M6".
The following patch fixed this issue for the 21M5 variant:
https://lore.kernel.org/all/[email protected]/
This patch adds support for the microphone on the 21M6 variant.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -252,6 +252,13 @@ static const struct dmi_system_id yc_acp .driver_data = &acp6x_card, .matches = {DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "21M6"), + } + }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), DMI_MATCH(DMI_PRODUCT_NAME, "21ME"), } },
Greg Kroah-Hartman
maintainerPATCH 131/166 dm-flakey: Fix memory corruption in optional corrupt_bio_byte feature
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kent Overstreet <[email protected]>
commit 57e9417f69839cb10f7ffca684c38acd28ceb57b upstream.
Fix memory corruption due to incorrect parameter being passed to bio_init
--- drivers/md/dm-flakey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-flakey.c +1 -1
@@ -426,7 +426,7 @@ static struct bio *clone_bio(struct dm_target *ti, struct flakey_c *fc, struct bif (!clone)return NULL ; -bio_init (clone, fc->dev->bdev, bio->bi_inline_vecs, nr_iovecs, bio->bi_opf); +bio_init (clone, fc->dev->bdev, clone->bi_inline_vecs, nr_iovecs, bio->bi_opf); clone->bi_iter.bi_sector =flakey_map_sector (ti, bio->bi_iter.bi_sector); clone->bi_private = bio;
Signature · 1 line
2.48.1
Greg Kroah-Hartman
maintainerPATCH 132/166 arm64: mm: Populate vmemmap at the page level if not section aligned
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhenhua Huang <[email protected]>
commit d4234d131b0a3f9e65973f1cdc71bb3560f5d14b upstream.
On the arm64 platform with 4K base page config, SECTION_SIZE_BITS is set to 27, making one section 128M. The related page struct which vmemmap points to is 2M then.
Commit c1cc1552616d ("arm64: MMU initialisation") optimizes the vmemmap to populate at the PMD section level which was suitable initially since hot plug granule is always one section(128M). However, commit ba72b4c8cf60 ("mm/sparsemem: support sub-section hotplug") introduced a 2M(SUBSECTION_SIZE) hot plug granule, which disrupted the existing arm64 assumptions.
The first problem is that if start or end is not aligned to a section boundary, such as when a subsection is hot added, populating the entire section is wasteful.
The next problem is if we hotplug something that spans part of 128 MiB section (subsections, let's call it memblock1), and then hotplug something that spans another part of a 128 MiB section(subsections, let's call it memblock2), and subsequently unplug memblock1, vmemmap_free() will clear the entire PMD entry which also supports memblock2 even though memblock2 is still active.
Assuming hotplug/unplug sizes are guaranteed to be symmetric. Do the fix similar to x86-64: populate to pages levels if start/end is not aligned with section boundary.
--- arch/arm64/mm/mmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm64/mm/mmu.c +4 -1
@@ -1150,8 +1150,11 @@ int __meminit vmemmap_populate(unsigned struct vmem_altmap *altmap) {WARN_ON ((start <VMEMMAP_START ) || (end >VMEMMAP_END )); +/* [start, end] should be within one section */ +WARN_ON_ONCE (end - start >PAGES_PER_SECTION *sizeof (struct page )); -if (!IS_ENABLED (CONFIG_ARM64_4K_PAGES )) +if (!IS_ENABLED (CONFIG_ARM64_4K_PAGES ) || + (end - start <PAGES_PER_SECTION *sizeof (struct page )))return vmemmap_populate_basepages (start, end, node, altmap);else return vmemmap_populate_hugepages (start, end, node, altmap);
Greg Kroah-Hartman
maintainerPATCH 133/166 qlcnic: fix memory leak issues in qlcnic_sriov_common.c
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haoxiang Li <[email protected]>
commit d2b9d97e89c79c95f8b517e4fa43fd100f936acc upstream.
Add qlcnic_sriov_free_vlans() in qlcnic_sriov_alloc_vlans() if any sriov_vlans fails to be allocated.
Add qlcnic_sriov_free_vlans() to free the memory allocated by qlcnic_sriov_alloc_vlans() if "sriov->allowed_vlans" fails to be allocated.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +6 -2
@@ -454,8 +454,10 @@ static int qlcnic_sriov_set_guest_vlan_m num_vlans = sriov->num_allowed_vlans; sriov->allowed_vlans =kcalloc (num_vlans,sizeof (u16),GFP_KERNEL ); -if (!sriov->allowed_vlans) +if (!sriov->allowed_vlans) { +qlcnic_sriov_free_vlans (adapter);return -ENOMEM ; + } vlans = (u16 *)&cmd->rsp.arg[3 ];for (i =0 ; i < num_vlans; i++)
@@ -2167,8 +2169,10 @@ int qlcnic_sriov_alloc_vlans(struct qlcn vf = &sriov->vf_info[i]; vf->sriov_vlans =kcalloc (sriov->num_allowed_vlans,sizeof (*vf->sriov_vlans),GFP_KERNEL ); -if (!vf->sriov_vlans) +if (!vf->sriov_vlans) { +qlcnic_sriov_free_vlans (adapter);return -ENOMEM ; + } }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 134/166 smb: client: fix regression with guest option
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
commit fc99045effa81fdf509c2a97cbb7e6e8f2fd4443 upstream.
When mounting a CIFS share with 'guest' mount option, mount.cifs(8) will set empty password= and password2= options. Currently we only handle empty strings from user= and password= options, so the mount will fail with
cifs: Bad value for 'password2'
Fix this by handling empty string from password2= option as well.
--- fs/smb/client/fs_context.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/smb/client/fs_context.c +4 -0
@@ -162,6 +162,7 @@ const struct fs_parameter_spec smb3_fs_pfsparam_string ("username" , Opt_user),fsparam_string ("pass" , Opt_pass),fsparam_string ("password" , Opt_pass), +fsparam_string ("pass2" , Opt_pass2),fsparam_string ("password2" , Opt_pass2),fsparam_string ("ip" , Opt_ip), fsparam_string("addr", Opt_ip),
@@ -1041,6 +1042,9 @@ static int smb3_fs_context_parse_param(s }else if (!strcmp ("user" , param->key) || !strcmp ("username" , param->key)) { skip_parsing = true; opt = Opt_user; + }else if (!strcmp ("pass2" , param->key) || !strcmp ("password2" , param->key)) { + skip_parsing = true; + opt = Opt_pass2; } }
Greg Kroah-Hartman
maintainerPATCH 135/166 rust: Disallow BTF generation with Rust + LTO
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Maurer <[email protected]>
commit 5daa0c35a1f0e7a6c3b8ba9cb721e7d1ace6e619 upstream.
The kernel cannot currently self-parse BTF containing Rust debug information. pahole uses the language of the CU to determine whether to filter out debug information when generating the BTF. When LTO is enabled, Rust code can cross CU boundaries, resulting in Rust debug information in CUs labeled as C. This results in a system which cannot parse its own BTF.
--- init/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
init/Kconfig +1 -1
@@ -1908,7 +1908,7 @@ config RUST depends on !GCC_PLUGINS depends on !RANDSTRUCT depends on !SHADOW_CALL_STACK - depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE + depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO) help Enables Rust support in the kernel.
Greg Kroah-Hartman
maintainerPATCH 136/166 rust: init: fix `Zeroable` implementation for `Option<NonNull<T>>` and `Option<KBox<T>>`
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benno Lossin <[email protected]>
commit df27cef153603b18a7d094b53cc3d5264ff32797 upstream.
According to [1], NonNull<T> and #[repr(transparent)] wrapper types such as our custom KBox<T> have the null pointer optimization only if T: Sized. Thus remove the Zeroable implementation for the unsized case.
--- rust/kernel/init.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
rust/kernel/init.rs +4 -7
@@ -1310,17 +1310,14 @@ impl_zeroable! { // SAFETY: `T: Zeroable` and `UnsafeCell` is `repr(transparent)`. {<T: ?Sized + Zeroable>} UnsafeCell<T>, - // SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee). + // SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee: + // https://doc.rust-lang.org/stable/std/option/index.html#representation). Option<NonZeroU8>, Option<NonZeroU16>, Option<NonZeroU32>, Option<NonZeroU64>, Option<NonZeroU128>, Option<NonZeroUsize>, Option<NonZeroI8>, Option<NonZeroI16>, Option<NonZeroI32>, Option<NonZeroI64>, Option<NonZeroI128>, Option<NonZeroIsize>, - - // SAFETY: All zeros is equivalent to `None` (option layout optimization guarantee). - // - // In this case we are allowed to use `T: ?Sized`, since all zeros is the `None` variant. - {<T: ?Sized>} Option<NonNull<T>>, - {<T: ?Sized>} Option<Box<T>>, + {<T>} Option<NonNull<T>>, + {<T>} Option<Box<T>>, // SAFETY: `null` pointer is valid. //
Greg Kroah-Hartman
maintainerPATCH 137/166 lib/buildid: Handle memfd_secret() files in build_id_parse()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrii Nakryiko <[email protected]>
commit 5ac9b4e935dfc6af41eee2ddc21deb5c36507a9f upstream.
Quoted 1 line
From
memfd_secret(2)manpage:
The memory areas backing the file created with memfd_secret(2) are visible only to the processes that have access to the file descriptor. The memory region is removed from the kernel page tables and only the page tables of the processes holding the file descriptor map the corresponding physical memory. (Thus, the pages in the region can't be accessed by the kernel itself, so that, for example, pointers to the region can't be passed to system calls.)
We need to handle this special case gracefully in build ID fetching code. Return -EFAULT whenever secretmem file is passed to build_id_parse() family of APIs. Original report and repro can be found in [0].
[0] https://lore.kernel.org/bpf/ZwyG8Uro%2FSyTXAni@ly-workstation/
--- lib/buildid.c | 5 +++++ 1 file changed, 5 insertions(+)
lib/buildid.c +5 -0
@@ -5,6 +5,7 @@#include <linux/elf.h> #include <linux/kernel.h> #include <linux/pagemap.h> +#include <linux/secretmem.h> #define BUILD_ID 3
@@ -157,6 +158,10 @@ int build_id_parse(struct vm_area_structif (!vma->vm_file)return -EINVAL ; +/* reject secretmem folios created with memfd_secret() */ +if (vma_is_secretmem (vma)) +return -EFAULT ; + page =find_get_page (vma->vm_file->f_mapping,0 );if (!page)return -EFAULT ;/* page not mapped */
Greg Kroah-Hartman
maintainerPATCH 138/166 mm: split critical region in remap_file_pages() and invoke LSMs in between
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirill A. Shutemov <[email protected]>
commit 58a039e679fe72bd0efa8b2abe669a7914bb4429 upstream.
Commit ea7e2d5e49c0 ("mm: call the security_mmap_file() LSM hook in remap_file_pages()") fixed a security issue, it added an LSM check when trying to remap file pages, so that LSMs have the opportunity to evaluate such action like for other memory operations such as mmap() and mprotect().
However, that commit called security_mmap_file() inside the mmap_lock lock, while the other calls do it before taking the lock, after commit 8b3ec6814c83 ("take security_mmap_file() outside of ->mmap_sem").
This caused lock inversion issue with IMA which was taking the mmap_lock and i_mutex lock in the opposite way when the remap_file_pages() system call was called.
Solve the issue by splitting the critical region in remap_file_pages() in two regions: the first takes a read lock of mmap_lock, retrieves the VMA and the file descriptor associated, and calculates the 'prot' and 'flags' variables; the second takes a write lock on mmap_lock, checks that the VMA flags and the VMA file descriptor are the same as the ones obtained in the first critical region (otherwise the system call fails), and calls do_mmap().
In between, after releasing the read lock and before taking the write lock, call security_mmap_file(), and solve the lock inversion issue.
--- mm/mmap.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 17 deletions(-)
mm/mmap.c +52 -17
@@ -2981,6 +2981,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsignunsigned long populate =0 ;unsigned long ret = -EINVAL ;struct file *file; +vm_flags_t vm_flags;pr_warn_once ("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/mm/remap_file_pages.rst.\n" , current->comm, current->pid);
@@ -2997,12 +2998,60 @@ SYSCALL_DEFINE5(remap_file_pages, unsignif (pgoff + (size >>PAGE_SHIFT ) < pgoff)return ret; -if (mmap_write_lock_killable (mm)) +if (mmap_read_lock_killable (mm))return -EINTR ; +/* +* Look up VMA under read lock first so we can perform the security +* without holding locks (which can be problematic). We reacquire a +* write lock later and check nothing changed underneath us. +*/ vma =vma_lookup (mm, start); -if (!vma || !(vma->vm_flags &VM_SHARED )) +if (!vma || !(vma->vm_flags &VM_SHARED )) { +mmap_read_unlock (mm); +return -EINVAL ; + } + + prot |= vma->vm_flags &VM_READ ?PROT_READ :0 ; + prot |= vma->vm_flags &VM_WRITE ?PROT_WRITE :0 ; + prot |= vma->vm_flags &VM_EXEC ?PROT_EXEC :0 ; + + flags &=MAP_NONBLOCK ; + flags |=MAP_SHARED |MAP_FIXED |MAP_POPULATE ; +if (vma->vm_flags &VM_LOCKED ) + flags |=MAP_LOCKED ; + +/* Save vm_flags used to calculate prot and flags, and recheck later. */ + vm_flags = vma->vm_flags; + file =get_file (vma->vm_file); + +mmap_read_unlock (mm); + +/* Call outside mmap_lock to be consistent with other callers. */ + ret =security_mmap_file (file, prot, flags); +if (ret) { +fput (file); +return ret; + } + + ret = -EINVAL ; + +/* OK security check passed, take write lock + let it rip. */ +if (mmap_write_lock_killable (mm)) { +fput (file); +return -EINTR ; + } + + vma =vma_lookup (mm, start); + +if (!vma) + goto out; + +/* Make sure things didn't change under us. */ +if (vma->vm_flags != vm_flags) + goto out; +if (vma->vm_file != file) goto out;if (start + size > vma->vm_end) {
@@ -3030,25 +3079,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsign goto out; } - prot |= vma->vm_flags &VM_READ ?PROT_READ :0 ; - prot |= vma->vm_flags &VM_WRITE ?PROT_WRITE :0 ; - prot |= vma->vm_flags &VM_EXEC ?PROT_EXEC :0 ; - - flags &=MAP_NONBLOCK ; - flags |=MAP_SHARED |MAP_FIXED |MAP_POPULATE ; -if (vma->vm_flags &VM_LOCKED ) - flags |=MAP_LOCKED ; - - file =get_file (vma->vm_file); - ret =security_mmap_file (vma->vm_file, prot, flags); -if (ret) - goto out_fput; ret =do_mmap (vma->vm_file, start, size, prot, flags,0 , pgoff, &populate,NULL ); -out_fput: -fput (file); out:mmap_write_unlock (mm); +fput (file);if (populate)mm_populate (ret, populate);if (!IS_ERR_VALUE (ret))
Greg Kroah-Hartman
maintainerPATCH 139/166 ASoC: ops: Consistently treat platform_max as control value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit 0eba2a7e858907a746ba69cd002eb9eb4dbd7bf3 ]
This reverts commit 9bdd10d57a88 ("ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min"), and makes some additional related updates.
There are two ways the platform_max could be interpreted; the maximum register value, or the maximum value the control can be set to. The patch moved from treating the value as a control value to a register one. When the patch was applied it was technically correct as snd_soc_limit_volume() also used the register interpretation. However, even then most of the other usages treated platform_max as a control value, and snd_soc_limit_volume() has since been updated to also do so in commit fb9ad24485087 ("ASoC: ops: add correct range check for limiting volume"). That patch however, missed updating snd_soc_put_volsw() back to the control interpretation, and fixing snd_soc_info_volsw_range(). The control interpretation makes more sense as limiting is typically done from the machine driver, so it is appropriate to use the customer facing representation rather than the internal codec representation. Update all the code to consistently use this interpretation of platform_max.
Finally, also add some comments to the soc_mixer_control struct to hopefully avoid further patches switching between the two approaches.
--- include/sound/soc.h | 5 ++++- sound/soc/soc-ops.c | 15 +++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-)
include/sound/soc.h +4 -1
@@ -1184,7 +1184,10 @@ void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);/* mixer control */ struct soc_mixer_control { -int min, max, platform_max; +/* Minimum and maximum specified as written to the hardware */ +int min, max; +/* Limited maximum value specified as presented through the control */ +int platform_max;int reg, rreg;unsigned int shift, rshift;unsigned int sign_bit;
sound/soc/soc-ops.c +7 -8
@@ -336,7 +336,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,if (ucontrol->value.integer.value[0 ] <0 )return -EINVAL ; val = ucontrol->value.integer.value[0 ]; -if (mc->platform_max && ((int )val + min) > mc->platform_max) +if (mc->platform_max && val > mc->platform_max)return -EINVAL ;if (val > max - min)return -EINVAL ;
@@ -349,7 +349,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,if (ucontrol->value.integer.value[1 ] <0 )return -EINVAL ; val2 = ucontrol->value.integer.value[1 ]; -if (mc->platform_max && ((int )val2 + min) > mc->platform_max) +if (mc->platform_max && val2 > mc->platform_max)return -EINVAL ;if (val2 > max - min)return -EINVAL ;
@@ -502,17 +502,16 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, {struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; -int platform_max; -int min = mc->min; +int max; -if (!mc->platform_max) - mc->platform_max = mc->max; - platform_max = mc->platform_max; + max = mc->max - mc->min; +if (mc->platform_max && mc->platform_max < max) + max = mc->platform_max; uinfo->type =SNDRV_CTL_ELEM_TYPE_INTEGER ; uinfo->count =snd_soc_volsw_is_stereo (mc) ?2 :1 ; uinfo->value.integer.min =0 ; - uinfo->value.integer.max = platform_max - min; + uinfo->value.integer.max = max;return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 140/166 rust: error: add missing newline to pr_warn! calls
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alban Kurti <[email protected]>
[ Upstream commit 6f5c36f56d475732981dcf624e0ac0cc7c8984c8 ]
Added missing newline at the end of pr_warn! usage so the log is not missed.
--- rust/kernel/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/error.rs +1 -1
@@ -103,7 +103,7 @@ impl Error {if errno < -(bindings::MAX_ERRNO as i32 ) || errno >=0 {// TODO: Make it a `WARN_ONCE` once available. crate ::pr_warn!( -"attempted to create `Error` with out of range `errno`: {}" , +"attempted to create `Error` with out of range `errno`: {}\n" , errno );return code::EINVAL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 141/166 drm/gma500: Add NULL check for pci_gfx_root in mid_get_vbt_data()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Abramov <[email protected]>
[ Upstream commit 9af152dcf1a06f589f44a74da4ad67e365d4db9a ]
Since pci_get_domain_bus_and_slot() can return NULL, add NULL check for pci_gfx_root in the mid_get_vbt_data().
This change is similar to the checks implemented in mid_get_fuse_settings() and mid_get_pci_revID(), which were introduced by commit 0cecdd818cd7 ("gma500: Final enables for Oaktrail") as "additional minor bulletproofing".
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/gpu/drm/gma500/mid_bios.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/gma500/mid_bios.c +5 -0
@@ -279,6 +279,11 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv) 0, PCI_DEVFN(2, 0));int ret =-1 ; +if (pci_gfx_root ==NULL ) { +WARN_ON (1 ); +return ; + } +/* Get the address of the platform config vbt */ pci_read_config_dword (pci_gfx_root,0xFC , &addr);pci_dev_put (pci_gfx_root);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 142/166 ASoC: cs42l43: Fix maximum ADC Volume
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Keepax <[email protected]>
[ Upstream commit e26f1cfeac6712516bfeed80890da664f4f2e88a ]
The range of ADC volume is -1 -> 3 (-6 to 18dB) so the number of levels should actually be 4.
--- sound/soc/codecs/cs42l43.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs42l43.c +1 -1
@@ -1020,7 +1020,7 @@ static const struct snd_kcontrol_new cs42l43_controls[] = {SOC_DOUBLE_R_SX_TLV ("ADC Volume" ,CS42L43_ADC_B_CTRL1 ,CS42L43_ADC_B_CTRL2 ,CS42L43_ADC_PGA_GAIN_SHIFT , -0xF ,5 , cs42l43_adc_tlv), +0xF ,4 , cs42l43_adc_tlv),SOC_DOUBLE ("PDM1 Invert Switch" ,CS42L43_DMIC_PDM_CTRL , CS42L43_PDM1L_INV_SHIFT, CS42L43_PDM1R_INV_SHIFT, 1, 0),
Signature · 1 line
2.39.5