]> git.ipfire.org Git - thirdparty/linux.git/log
thirdparty/linux.git
3 weeks agodrm/sysfb: Fix efidrm error handling and memory type mismatch
Chen Ni [Wed, 11 Mar 2026 06:46:52 +0000 (14:46 +0800)] 
drm/sysfb: Fix efidrm error handling and memory type mismatch

Fix incorrect error checking and memory type confusion in
efidrm_device_create(). devm_memremap() returns error pointers, not
NULL, and returns system memory while devm_ioremap() returns I/O memory.
The code incorrectly passes system memory to iosys_map_set_vaddr_iomem().

Restructure to handle each memory type separately. Use devm_ioremap*()
with ERR_PTR(-ENXIO) for WC/UC, and devm_memremap() with ERR_CAST() for
WT/WB.

Fixes: 32ae90c66fb6 ("drm/sysfb: Add efidrm for EFI displays")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260311064652.2903449-1-nichen@iscas.ac.cn
3 weeks agoxfs: return default quota limits for IDs without a dquot
Ravi Singh [Mon, 30 Mar 2026 06:14:14 +0000 (14:14 +0800)] 
xfs: return default quota limits for IDs without a dquot

When an ID has no dquot on disk, Q_XGETQUOTA returns -ENOENT even
though default quota limits are configured and enforced against that
ID.  This means unprivileged users who have never used any resources
cannot see the limits that apply to them.

When xfs_qm_dqget() returns -ENOENT for a non-zero ID, return a
zero-usage response with the default limits filled in from
m_quotainfo rather than propagating the error.  This is consistent
with the enforcement behavior in xfs_qm_adjust_dqlimits(), which
pushes the same default limits into a dquot when it is first
allocated.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ravi Singh <ravising@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
3 weeks agobacklight: apple_bl: Convert to a platform driver
Rafael J. Wysocki [Sat, 14 Mar 2026 11:50:11 +0000 (12:50 +0100)] 
backlight: apple_bl: Convert to a platform driver

In all cases in which a struct acpi_driver is used for binding a driver
to an ACPI device object, a corresponding platform device is created by
the ACPI core and that device is regarded as a proper representation of
underlying hardware.  Accordingly, a struct platform_driver should be
used by driver code to bind to that device.  There are multiple reasons
why drivers should not bind directly to ACPI device objects [1].

Overall, it is better to bind drivers to platform devices than to their
ACPI companions, so convert the Apple Backlight ACPI driver to a
platform one.

While this is not expected to alter functionality, it changes sysfs
layout and so it will be visible to user space.

Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Link: https://patch.msgid.link/5084777.GXAFRqVoOG@rafael.j.wysocki
Signed-off-by: Lee Jones <lee@kernel.org>
3 weeks agommc: dw_mmc: Remove dw_mci_start_request wrapper and rename core function
Shawn Lin [Tue, 31 Mar 2026 07:54:50 +0000 (15:54 +0800)] 
mmc: dw_mmc: Remove dw_mci_start_request wrapper and rename core function

The function dw_mci_start_request() was just a thin wrapper around
__dw_mci_start_request(). Since it serves almost no functional purpose,
remove the wrapper to simplify the code flow.

Consequently, rename __dw_mci_start_request() to dw_mci_start_request()
so that the core implementation uses the primary name.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agommc: dw_mmc: Inline dw_mci_queue_request() into dw_mci_request()
Shawn Lin [Tue, 31 Mar 2026 07:54:49 +0000 (15:54 +0800)] 
mmc: dw_mmc: Inline dw_mci_queue_request() into dw_mci_request()

With the removal of queue support, the function dw_mci_queue_request()
is now just a wrapper with a confusing name that doesn't suggest
anything about queue. Removes the function and moves its body into
dw_mci_request().

No functional changes intended.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agommc: block: Use MQRQ_XFER_SINGLE_BLOCK for both read and write recovery
Shawn Lin [Mon, 30 Mar 2026 03:28:32 +0000 (11:28 +0800)] 
mmc: block: Use MQRQ_XFER_SINGLE_BLOCK for both read and write recovery

Currently, the code uses the MQRQ_XFER_SINGLE_BLOCK flag to handle write
failures by retrying with single-block transfers. However, read failures
bypass this mechanism and instead use a dedicated legacy path mmc_blk_read_single()
that performs sector-by-sector retries.

Extend the MQRQ_XFER_SINGLE_BLOCK logic to cover multi-block read failures
as well. By doing so, we can remove the redundant and complex mmc_blk_read_single()
function, unifying the retry logic for both read and write operations under
a single, consistent, easier-to-maintain mechanism.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agommc: mmc_test: Replace hard-coded values with macros and consolidate test parameters
Shawn Lin [Mon, 30 Mar 2026 03:28:31 +0000 (11:28 +0800)] 
mmc: mmc_test: Replace hard-coded values with macros and consolidate test parameters

Replacing hard-coded values with standardized macros to improve code clarity,
simplify future maintenance.

Meanwhile, introduce global bs and sg_len arrays for block sizes and SG lengths,
eliminating redundant local definitions in multiple test functions.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agommc: block: Convert to use DEFINE_SIMPLE_DEV_PM_OPS()
Shawn Lin [Mon, 30 Mar 2026 03:28:30 +0000 (11:28 +0800)] 
mmc: block: Convert to use DEFINE_SIMPLE_DEV_PM_OPS()

Convert to use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() to drop the
CONFIG_PM_SLEEP to handle the conditional compilation when PM support is
disabled. This allows the compiler to automatically optimize away the
unused code paths when CONFIG_PM_SLEEP is not selected.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agommc: core: Replace the hard-coded shift value 9 with SECTOR_SHIFT
Shawn Lin [Mon, 30 Mar 2026 03:28:29 +0000 (11:28 +0800)] 
mmc: core: Replace the hard-coded shift value 9 with SECTOR_SHIFT

These shift-by-9 operations are for converting between bytes and sectors.
Use the SECTOR_SHIFT macro to improve code readability and maintainability.

No functional changes intended.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agommc: sdhci-dwcmshc: Refactor Rockchip platform data for controller revisions
Shawn Lin [Sat, 28 Mar 2026 00:29:22 +0000 (08:29 +0800)] 
mmc: sdhci-dwcmshc: Refactor Rockchip platform data for controller revisions

The driver previously used an enum (dwcmshc_rk_type) to distinguish
platforms like the RK3568 and RK3588 based on DT compatible names.
This approach is inflexible, scales poorly for future revisions or
mixed-revision platforms, and conflates SoC names with controller
revisions. One example is RK3576 which lists "rockchip,rk3588-dwcmshc"
as a secondary compatible string just in order to claim it uses the
same controller revision as RK3588. This is confusing and makes it
error-prone to add new SoC support.

Introduces a new struct rockchip_pltfm_data containing a dedicated
revision field. The old enum is removed, and all code paths are
updated to use the revision-based data.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
3 weeks agoleds: led-class: Switch to using class_find_device_by_fwnode()
Dmitry Torokhov [Mon, 23 Mar 2026 01:54:23 +0000 (18:54 -0700)] 
leds: led-class: Switch to using class_find_device_by_fwnode()

In preparation to class_find_device_by_of_node() going away switch to
using class_find_device_by_fwnode().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20260322-remove-device-find-by-of-node-v1-5-b72eb22a1215@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
3 weeks agoMerge branch 'correct-bd-length-masks-and-bql-accounting-for-multi-bd-tx-packets'
Paolo Abeni [Tue, 31 Mar 2026 10:09:26 +0000 (12:09 +0200)] 
Merge branch 'correct-bd-length-masks-and-bql-accounting-for-multi-bd-tx-packets'

Suraj Gupta says:

====================
Correct BD length masks and BQL accounting for multi-BD TX packets

This patch series fixes two issues in the Xilinx AXI Ethernet driver:
 1. Corrects the BD length masks to match the AXIDMA IP spec.
 2. Fixes BQL accounting for multi-BD TX packets.
====================

Link: https://patch.msgid.link/20260327073238.134948-1-suraj.gupta2@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agonet: xilinx: axienet: Fix BQL accounting for multi-BD TX packets
Suraj Gupta [Fri, 27 Mar 2026 07:32:38 +0000 (13:02 +0530)] 
net: xilinx: axienet: Fix BQL accounting for multi-BD TX packets

When a TX packet spans multiple buffer descriptors (scatter-gather),
axienet_free_tx_chain sums the per-BD actual length from descriptor
status into a caller-provided accumulator. That sum is reset on each
NAPI poll. If the BDs for a single packet complete across different
polls, the earlier bytes are lost and never credited to BQL. This
causes BQL to think bytes are permanently in-flight, eventually
stalling the TX queue.

The SKB pointer is stored only on the last BD of a packet. When that
BD completes, use skb->len for the byte count instead of summing
per-BD status lengths. This matches netdev_sent_queue(), which debits
skb->len, and naturally survives across polls because no partial
packet contributes to the accumulator.

Fixes: c900e49d58eb ("net: xilinx: axienet: Implement BQL")
Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com>
Reviewed-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://patch.msgid.link/20260327073238.134948-3-suraj.gupta2@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agonet: xilinx: axienet: Correct BD length masks to match AXIDMA IP spec
Suraj Gupta [Fri, 27 Mar 2026 07:32:37 +0000 (13:02 +0530)] 
net: xilinx: axienet: Correct BD length masks to match AXIDMA IP spec

The XAXIDMA_BD_CTRL_LENGTH_MASK and XAXIDMA_BD_STS_ACTUAL_LEN_MASK
macros were defined as 0x007FFFFF (23 bits), but the AXI DMA IP
product guide (PG021) specifies the buffer length field as bits 25:0
(26 bits). Update both masks to match the IP documentation.

In practice this had no functional impact, since Ethernet frames are
far smaller than 2^23 bytes and the extra bits were always zero, but
the masks should still reflect the hardware specification.

Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com>
Reviewed-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://patch.msgid.link/20260327073238.134948-2-suraj.gupta2@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agocachefiles: fix incorrect dentry refcount in cachefiles_cull()
NeilBrown [Thu, 26 Mar 2026 22:18:21 +0000 (09:18 +1100)] 
cachefiles: fix incorrect dentry refcount in cachefiles_cull()

The patch mentioned below changed cachefiles_bury_object() to expect 2
references to the 'rep' dentry.  Three of the callers were changed to
use start_removing_dentry() which takes an extra reference so in those
cases the call gets the expected references.

However there is another call to cachefiles_bury_object() in
cachefiles_cull() which did not need to be changed to use
start_removing_dentry() and so was not properly considered.
It still passed the dentry with just one reference so the net result is
that a reference is lost.

To meet the expectations of cachefiles_bury_object(), cachefiles_cull()
must take an extra reference before the call.  It will be dropped by
cachefiles_bury_object().

Reported-by: Marc Dionne <marc.dionne@auristor.com>
Fixes: 7bb1eb45e43c ("VFS: introduce start_removing_dentry()")
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/177456350181.1851489.16359967086642190170@noble.neil.brown.name
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
3 weeks agomfd: ene-kb3930: Use of_device_is_system_power_controller() wrapper
Krzysztof Kozlowski [Mon, 23 Mar 2026 09:20:53 +0000 (10:20 +0100)] 
mfd: ene-kb3930: Use of_device_is_system_power_controller() wrapper

Instead of checking for exact device node property, use the
of_device_is_system_power_controller() wrapper.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260323092052.64684-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Lee Jones <lee@kernel.org>
3 weeks agofs: hide file and bfile caches behind runtime const machinery
Mateusz Guzik [Sat, 28 Mar 2026 17:37:28 +0000 (18:37 +0100)] 
fs: hide file and bfile caches behind runtime const machinery

s/cachep/cache/ for consistency with namei and dentry caches.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20260328173728.3388070-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
3 weeks agofs: write a better comment in step_into() concerning .mnt assignment
Mateusz Guzik [Sat, 28 Mar 2026 17:58:40 +0000 (18:58 +0100)] 
fs: write a better comment in step_into() concerning .mnt assignment

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20260328175841.3390950-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
3 weeks agobpf: Fix block device hooks names
Jiri Olsa [Mon, 30 Mar 2026 21:03:44 +0000 (23:03 +0200)] 
bpf: Fix block device hooks names

Use proper names for block device hooks names.

Fixes: 46df585fcff7 ("bpf: classify block device hooks appropriately")
Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Closes: https://lore.kernel.org/bpf/acrVKUy_EPiFFmV9@krava/T/#m7c7906a1ff4029e29185aec3266dbf5c8996dbf7
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20260330210344.3073712-1-jolsa@kernel.org
3 weeks agoNFC: pn533: bound the UART receive buffer
Pengpeng Hou [Thu, 26 Mar 2026 14:20:33 +0000 (22:20 +0800)] 
NFC: pn533: bound the UART receive buffer

pn532_receive_buf() appends every incoming byte to dev->recv_skb and
only resets the buffer after pn532_uart_rx_is_frame() recognizes a
complete frame. A continuous stream of bytes without a valid PN532 frame
header therefore keeps growing the skb until skb_put_u8() hits the tail
limit.

Drop the accumulated partial frame once the fixed receive buffer is full
so malformed UART traffic cannot grow the skb past
PN532_UART_SKB_BUFF_LEN.

Fixes: c656aa4c27b1 ("nfc: pn533: add UART phy driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260326142033.82297-1-pengpeng@iscas.ac.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agonet: bonding: fix use-after-free in bond_xmit_broadcast()
Xiang Mei [Thu, 26 Mar 2026 07:55:53 +0000 (00:55 -0700)] 
net: bonding: fix use-after-free in bond_xmit_broadcast()

bond_xmit_broadcast() reuses the original skb for the last slave
(determined by bond_is_last_slave()) and clones it for others.
Concurrent slave enslave/release can mutate the slave list during
RCU-protected iteration, changing which slave is "last" mid-loop.
This causes the original skb to be double-consumed (double-freed).

Replace the racy bond_is_last_slave() check with a simple index
comparison (i + 1 == slaves_count) against the pre-snapshot slave
count taken via READ_ONCE() before the loop.  This preserves the
zero-copy optimization for the last slave while making the "last"
determination stable against concurrent list mutations.

The UAF can trigger the following crash:

==================================================================
BUG: KASAN: slab-use-after-free in skb_clone
Read of size 8 at addr ffff888100ef8d40 by task exploit/147

CPU: 1 UID: 0 PID: 147 Comm: exploit Not tainted 7.0.0-rc3+ #4 PREEMPTLAZY
Call Trace:
 <TASK>
 dump_stack_lvl (lib/dump_stack.c:123)
 print_report (mm/kasan/report.c:379 mm/kasan/report.c:482)
 kasan_report (mm/kasan/report.c:597)
 skb_clone (include/linux/skbuff.h:1724 include/linux/skbuff.h:1792 include/linux/skbuff.h:3396 net/core/skbuff.c:2108)
 bond_xmit_broadcast (drivers/net/bonding/bond_main.c:5334)
 bond_start_xmit (drivers/net/bonding/bond_main.c:5567 drivers/net/bonding/bond_main.c:5593)
 dev_hard_start_xmit (include/linux/netdevice.h:5325 include/linux/netdevice.h:5334 net/core/dev.c:3871 net/core/dev.c:3887)
 __dev_queue_xmit (include/linux/netdevice.h:3601 net/core/dev.c:4838)
 ip6_finish_output2 (include/net/neighbour.h:540 include/net/neighbour.h:554 net/ipv6/ip6_output.c:136)
 ip6_finish_output (net/ipv6/ip6_output.c:208 net/ipv6/ip6_output.c:219)
 ip6_output (net/ipv6/ip6_output.c:250)
 ip6_send_skb (net/ipv6/ip6_output.c:1985)
 udp_v6_send_skb (net/ipv6/udp.c:1442)
 udpv6_sendmsg (net/ipv6/udp.c:1733)
 __sys_sendto (net/socket.c:730 net/socket.c:742 net/socket.c:2206)
 __x64_sys_sendto (net/socket.c:2209)
 do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
 entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
 </TASK>

Allocated by task 147:

Freed by task 147:

The buggy address belongs to the object at ffff888100ef8c80
 which belongs to the cache skbuff_head_cache of size 224
The buggy address is located 192 bytes inside of
 freed 224-byte region [ffff888100ef8c80ffff888100ef8d60)

Memory state around the buggy address:
 ffff888100ef8c00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888100ef8c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888100ef8d00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                                                    ^
 ffff888100ef8d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
 ffff888100ef8e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Fixes: 4e5bd03ae346 ("net: bonding: fix bond_xmit_broadcast return value error bug")
Reported-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Link: https://patch.msgid.link/20260326075553.3960562-1-xmei5@asu.edu
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agostaging: most: dim2: replace BUG_ON() in poison_channel()
Gabriel Rondon [Mon, 30 Mar 2026 18:22:55 +0000 (19:22 +0100)] 
staging: most: dim2: replace BUG_ON() in poison_channel()

Replace BUG_ON() range check on ch_idx with a return of -EINVAL.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-6-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: most: dim2: replace BUG_ON() in enqueue()
Gabriel Rondon [Mon, 30 Mar 2026 18:22:54 +0000 (19:22 +0100)] 
staging: most: dim2: replace BUG_ON() in enqueue()

Replace BUG_ON() range check on ch_idx with a return of -EINVAL.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-5-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: most: dim2: replace BUG_ON() in configure_channel()
Gabriel Rondon [Mon, 30 Mar 2026 18:22:53 +0000 (19:22 +0100)] 
staging: most: dim2: replace BUG_ON() in configure_channel()

Replace BUG_ON() range check on ch_idx with a return of -EINVAL.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-4-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: most: dim2: replace BUG_ON() in service_done_flag()
Gabriel Rondon [Mon, 30 Mar 2026 18:22:52 +0000 (19:22 +0100)] 
staging: most: dim2: replace BUG_ON() in service_done_flag()

Replace BUG_ON() calls with an early return since the function returns
void.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-3-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: most: dim2: replace BUG_ON() in try_start_dim_transfer()
Gabriel Rondon [Mon, 30 Mar 2026 18:22:51 +0000 (19:22 +0100)] 
staging: most: dim2: replace BUG_ON() in try_start_dim_transfer()

Replace BUG_ON() calls with graceful error handling.

For the null/uninitialized channel checks, return -EINVAL instead of
crashing the kernel. For the zero bus_address check, release the
spinlock and return -EFAULT.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-2-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove unused RTL8188E antenna selection macros
Mashiro Chen [Tue, 31 Mar 2026 05:04:34 +0000 (13:04 +0800)] 
staging: rtl8723bs: remove unused RTL8188E antenna selection macros

Remove the SET_TX_DESC_ANTSEL_{A,B,C}_88E macros from odm_types.h.
These are leftover dead code for the RTL8188E chip and have no callers
in the rtl8723bs driver. The RTL8188E is a different chip family and
has its own driver at drivers/net/wireless/realtek/rtl8xxxu

This addresses the TODO item "find and remove any code for other chips
that is left over".

Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Link: https://patch.msgid.link/20260331050434.102744-1-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove redundant blank lines in basic_types.h
Mashiro Chen [Mon, 30 Mar 2026 11:42:32 +0000 (19:42 +0800)] 
staging: rtl8723bs: remove redundant blank lines in basic_types.h

Remove redundant blank lines at the top of the file to improve
code cleanliness.

Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260330114232.91431-4-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: wrap complex macros with parentheses
Mashiro Chen [Mon, 30 Mar 2026 11:42:31 +0000 (19:42 +0800)] 
staging: rtl8723bs: wrap complex macros with parentheses

Fix "COMPLEX_MACRO" errors reported by checkpatch.pl
by wrapping macro values in parentheses to ensure
correct operator precedence.

Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260330114232.91431-3-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove unused WRITEEF/READEF byte macros
Mashiro Chen [Mon, 30 Mar 2026 11:42:30 +0000 (19:42 +0800)] 
staging: rtl8723bs: remove unused WRITEEF/READEF byte macros

The WRITEEF4BYTE, WRITEEF2BYTE, WRITEEF1BYTE, READEF4BYTE,
READEF2BYTE and READEF1BYTE macros are never used in the driver.
Remove them entirely.

Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260330114232.91431-2-mashiro.chen@mailbox.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agoKVM: s390: Fix lpsw/e breaking event handling
Janosch Frank [Mon, 23 Mar 2026 15:35:22 +0000 (15:35 +0000)] 
KVM: s390: Fix lpsw/e breaking event handling

LPSW and LPSWE need to set the gbea on completion but currently don't.
Time to fix this up.

LPSWEY was designed to not set the bear.

Fixes: 48a3e950f4cee ("KVM: s390: Add support for machine checks.")
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
3 weeks agoKVM: s390: only deliver service interrupt with payload
Eric Farman [Wed, 25 Feb 2026 15:20:13 +0000 (16:20 +0100)] 
KVM: s390: only deliver service interrupt with payload

Routine __inject_service() may set both the SERVICE and SERVICE_EV
pending bits, and in the case of a pure service event the corresponding
trip through __deliver_service_ev() will clear the SERVICE_EV bit only.
This necessitates an additional trip through __deliver_service() for
the other pending interrupt bit, however it is possible that the
external interrupt parameters are zero and there is nothing to be
delivered to the guest.

To avoid sending empty data to the guest, let's only write out the SCLP
data when there is something for the guest to do, otherwise bail out.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
3 weeks agostaging: rtl8723bs: rename camelCase variable
Bhavya Gupta [Sat, 21 Mar 2026 13:16:00 +0000 (18:46 +0530)] 
staging: rtl8723bs: rename camelCase variable

Rename the "pIE" variable to "ie" to comply with the linux kernel coding
style.

This fixes the following checkpatch.pl warnings:
CHECK: Avoid CamelCase: <pIE>

Signed-off-by: Bhavya Gupta <anim8tor.ing@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/ab6aELnTA0EnQI6X@gamin8ing
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: greybus: audio: fix error message for BTN_3 button
Haoyu Lu [Mon, 30 Mar 2026 08:34:25 +0000 (16:34 +0800)] 
staging: greybus: audio: fix error message for BTN_3 button

In gbaudio_init_jack(), when setting SND_JACK_BTN_3 key, the error
message incorrectly says "Failed to set BTN_0". This should be
"Failed to set BTN_3" to match the button being configured.

Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260330083425.266-1-hechushiguitu666@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: rename variables to snake_case
David Holland [Fri, 27 Mar 2026 20:36:36 +0000 (16:36 -0400)] 
staging: rtl8723bs: rename variables to snake_case

The Linux kernel coding style guidelines prohibit the use of CamelCase
variable names. All variables should be snakecase.

Rename the 'ChipVersion' parameter to 'chip_version' and the
'AutoLoadFail' parameter to 'auto_load_fail' in hal_com.c to adhere to
the standard snakecase naming convention.

Signed-off-by: David Holland <david@cardinalsystem.net>
Link: https://patch.msgid.link/20260327203636.24891-1-david@cardinalsystem.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: fix spelling in comment
Haoyu Lu [Fri, 27 Mar 2026 11:14:54 +0000 (19:14 +0800)] 
staging: rtl8723bs: fix spelling in comment

Change "co-existance" to "co-existence" in comment.

Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260327111455.3260-1-hechushiguitu666@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: cleanup return in sdio_init()
Omer El Idrissi [Thu, 26 Mar 2026 09:36:07 +0000 (10:36 +0100)] 
staging: rtl8723bs: cleanup return in sdio_init()

Make sdio_init() return errno from sdio_enable_func or
sdio_set_block_size instead of _SUCCESS/_FAIL vendor-defined
macros. Let rtw_resume_process_normal return errno returned by
sdio_init instead of -1. sdio_dvobj_init returns NULL on error
so leave that as is. Let sdio_dvobj_init use a slightly more
readable and conventional error check for sdio_init().

Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260326093607.13011-3-omer.e.idrissi@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: use direct returns in sdio_dvobj_init()
Omer El Idrissi [Thu, 26 Mar 2026 09:36:06 +0000 (10:36 +0100)] 
staging: rtl8723bs: use direct returns in sdio_dvobj_init()

Make sdio_dvobj_init() use direct returns

Signed-off-by: Omer El Idrissi <omer.e.idrissi@gmail.com>
Signed-off-by: Omer El Idrissi <omer.e.idriss@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260326093607.13011-2-omer.e.idrissi@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove unused arg at odm_interface.h
Rodrigo Gobbi [Wed, 25 Mar 2026 21:21:08 +0000 (18:21 -0300)] 
staging: rtl8723bs: remove unused arg at odm_interface.h

The header file uses some macros to create proper constants for
ODM_REG and ODM_SET but current macros were not using _ic_type,
leading to a checkpatch warn:

WARNING: Argument '_ic_type' is not used in function-like macro

Remove that arg, currently there is no support for per ic type

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Link: https://patch.msgid.link/20260325212826.20309-1-rodrigo.gobbi.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agogreybus: raw: fix use-after-free if write is called after disconnect
Damien Riégel [Tue, 24 Mar 2026 14:00:39 +0000 (10:00 -0400)] 
greybus: raw: fix use-after-free if write is called after disconnect

If a user writes to the chardev after disconnect has been called, the
kernel panics with the following trace (with
CONFIG_INIT_ON_FREE_DEFAULT_ON=y):

        BUG: kernel NULL pointer dereference, address: 0000000000000218
         ...
        Call Trace:
         <TASK>
         gb_operation_create_common+0x61/0x180
         gb_operation_create_flags+0x28/0xa0
         gb_operation_sync_timeout+0x6f/0x100
         raw_write+0x7b/0xc7 [gb_raw]
         vfs_write+0xcf/0x420
         ? task_mm_cid_work+0x136/0x220
         ksys_write+0x63/0xe0
         do_syscall_64+0xa4/0x290
         entry_SYSCALL_64_after_hwframe+0x77/0x7f

Disconnect calls gb_connection_destroy, which ends up freeing the
connection object. When gb_operation_sync is called in the write file
operations, its gets a freed connection as parameter and the kernel
panics.

The gb_connection_destroy cannot be moved out of the disconnect
function, as the Greybus subsystem expect all connections belonging to a
bundle to be destroyed when disconnect returns.

To prevent this bug, use a rw lock to synchronize access between write
and disconnect. This guarantees that the write function doesn't try
to use a disconnected connection.

Fixes: e806c7fb8e9b ("greybus: raw: add raw greybus kernel driver")
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Damien Riégel <damien.riegel@silabs.com>
Link: https://patch.msgid.link/20260324140039.40001-2-damien.riegel@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agogreybus: raw: fix use-after-free on cdev close
Damien Riégel [Tue, 24 Mar 2026 14:00:38 +0000 (10:00 -0400)] 
greybus: raw: fix use-after-free on cdev close

This addresses a use-after-free bug when a raw bundle is disconnected
but its chardev is still opened by an application. When the application
releases the cdev, it causes the following panic when init on free is
enabled (CONFIG_INIT_ON_FREE_DEFAULT_ON=y):

        refcount_t: underflow; use-after-free.
        WARNING: CPU: 0 PID: 139 at lib/refcount.c:28 refcount_warn_saturate+0xd0/0x130
         ...
        Call Trace:
         <TASK>
         cdev_put+0x18/0x30
         __fput+0x255/0x2a0
         __x64_sys_close+0x3d/0x80
         do_syscall_64+0xa4/0x290
         entry_SYSCALL_64_after_hwframe+0x77/0x7f

The cdev is contained in the "gb_raw" structure, which is freed in the
disconnect operation. When the cdev is released at a later time,
cdev_put gets an address that points to freed memory.

To fix this use-after-free, convert the struct device from a pointer to
being embedded, that makes the lifetime of the cdev and of this device
the same. Then, use cdev_device_add, which guarantees that the device
won't be released until all references to the cdev have been released.
Finally, delegate the freeing of the structure to the device release
function, instead of freeing immediately in the disconnect callback.

Fixes: e806c7fb8e9b ("greybus: raw: add raw greybus kernel driver")
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Damien Riégel <damien.riegel@silabs.com>
Link: https://patch.msgid.link/20260324140039.40001-1-damien.riegel@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: fix logical continuations in xmit_linux.c
Sajal Gupta [Tue, 24 Mar 2026 12:17:47 +0000 (17:47 +0530)] 
staging: rtl8723bs: fix logical continuations in xmit_linux.c

Simplify the conditional by removing redundant boolean
comparisons and fixing the continuation line indentation.

Signed-off-by: Sajal Gupta <sajal2005gupta@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260324121828.14675-1-sajal2005gupta@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: sm750fb: fix division by zero in ps_to_hz()
Junrui Luo [Mon, 23 Mar 2026 07:31:56 +0000 (15:31 +0800)] 
staging: sm750fb: fix division by zero in ps_to_hz()

ps_to_hz() is called from hw_sm750_crtc_set_mode() without validating
that pixclock is non-zero. A zero pixclock passed via FBIOPUT_VSCREENINFO
causes a division by zero.

Fix by rejecting zero pixclock in lynxfb_ops_check_var(), consistent
with other framebuffer drivers.

Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881AFBFCE28CCF528B35D0CAF4BA@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove custom is_multicast_mac_addr() function
Nikolay Kulikov [Mon, 23 Mar 2026 15:06:08 +0000 (18:06 +0300)] 
staging: rtl8723bs: remove custom is_multicast_mac_addr() function

is_multicast_mac_addr() is redundant reimplementation of standard
is_multicast_ether_addr() func.
Remove it and switch to use is_multicast_ether_addr().

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-7-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove custom is_broadcast_mac_addr() function
Nikolay Kulikov [Mon, 23 Mar 2026 15:06:07 +0000 (18:06 +0300)] 
staging: rtl8723bs: remove custom is_broadcast_mac_addr() function

Replace the custom broadcast address checking function with standard
kernel is_broadcast_ether_addr() func for this.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-6-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove custom is_zero_mac_addr() function
Nikolay Kulikov [Mon, 23 Mar 2026 15:06:06 +0000 (18:06 +0300)] 
staging: rtl8723bs: remove custom is_zero_mac_addr() function

Remove the custom function is_zero_mac_addr() and replace all calls to it
with the default kernel function is_zero_ether_addr() to avoid
duplicating existing code.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-5-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: move logical operators to end of previous line
Nikolay Kulikov [Mon, 23 Mar 2026 15:06:05 +0000 (18:06 +0300)] 
staging: rtl8723bs: move logical operators to end of previous line

Change the position of logical operators '||' and remove unnecessary
curly braces around single expression to fix checkpatch.pl warnings.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-4-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove dead code in validate_recv_mgnt_frame()
Nikolay Kulikov [Mon, 23 Mar 2026 15:06:04 +0000 (18:06 +0300)] 
staging: rtl8723bs: remove dead code in validate_recv_mgnt_frame()

Remove unused code from the validate_recv_mgnt_frame() function. This
code was previously commented out and is no longer needed.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-3-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: replace deeply nested if-else with switch-case
Nikolay Kulikov [Mon, 23 Mar 2026 15:06:03 +0000 (18:06 +0300)] 
staging: rtl8723bs: replace deeply nested if-else with switch-case

The main logic of the validate_recv_mgnt_frame() function is deeply
nested due to multiple if-else statements and additional block scope.
Fix this by replacing identical if-else with switch-case statements,
which will improve code readability and correct checkpatch.pl warnings
about line lengths.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260323150650.7168-2-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()
Lin YuChen [Fri, 20 Mar 2026 17:25:02 +0000 (01:25 +0800)] 
staging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()

Initialize le_tmp64 to zero in rtw_BIP_verify() to prevent using
uninitialized data.

Smatch warns that only 6 bytes are copied to this 8-byte (u64)
variable, leaving the last two bytes uninitialized:

drivers/staging/rtl8723bs/core/rtw_security.c:1308 rtw_BIP_verify()
warn: not copying enough bytes for '&le_tmp64' (8 vs 6 bytes)

Initializing the variable at the start of the function fixes this
warning and ensures predictable behavior.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable <stable@kernel.org>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-staging/abvwIQh0CHTp4wNJ@stanley.mountain/
Signed-off-by: Lin YuChen <starpt.official@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260320172502.167332-1-starpt.official@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove unused function declarations
Oskar Ray-Frayssinet [Sat, 21 Mar 2026 22:33:46 +0000 (23:33 +0100)] 
staging: rtl8723bs: remove unused function declarations

Remove unused declarations of MRateToHwRate8723B() and
HwRateToMRate8723B() from rtl8723b_hal.h as they have no
implementation and are never called.

Signed-off-by: Oskar Ray-Frayssinet <rayfraytech@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260321223347.7054-1-rayfraytech@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: refactor rtw_joinbss_event_prehandle to reduce indentation
Jose A. Perez de Azpillaga [Sat, 21 Mar 2026 18:27:00 +0000 (19:27 +0100)] 
staging: rtl8723bs: refactor rtw_joinbss_event_prehandle to reduce indentation

The rtw_joinbss_event_prehandle function has excessive indentation due
to deeply nested if-statements.

Refactor the function using early returns and guard clauses for the
failure paths. This flattens the code and significantly improves
readability.

Signed-off-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260321182713.665872-3-azpijr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: remove dead REJOIN code
Jose A. Perez de Azpillaga [Sat, 21 Mar 2026 18:26:59 +0000 (19:26 +0100)] 
staging: rtl8723bs: remove dead REJOIN code

The REJOIN macro is not defined anywhere in the kernel tree. Remove this
dead code to simplify the function.

Signed-off-by: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260321182713.665872-2-azpijr@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: use guard clause for stainfo check
Lin YuChen [Thu, 19 Mar 2026 12:07:37 +0000 (20:07 +0800)] 
staging: rtl8723bs: use guard clause for stainfo check

Continue the refactor of rtw_aes_decrypt() by introducing a guard
clause for the stainfo check. This allows the subsequent multicast
and unicast decryption logic to be moved one indentation level to
the left, further improving code readability.

Signed-off-by: Lin YuChen <starpt.official@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260319120737.29692-3-starpt.official@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: use guard clause for AES check
Lin YuChen [Thu, 19 Mar 2026 12:07:36 +0000 (20:07 +0800)] 
staging: rtl8723bs: use guard clause for AES check

Refactor the AES encryption check by using a guard clause to
reduce the indentation level of the subsequent logic.

Signed-off-by: Lin YuChen <starpt.official@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260319120737.29692-2-starpt.official@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agostaging: rtl8723bs: split multiple assignment in rtw_mgmt_xmitframe_coalesce
Marco Antonio Solis Segura [Thu, 19 Mar 2026 06:26:26 +0000 (00:26 -0600)] 
staging: rtl8723bs: split multiple assignment in rtw_mgmt_xmitframe_coalesce

Cleanup the multiple assignment of tmp_buf and BIP_AAD to fix the
checkpatch.pl CHECK: "Multiple assignments should be avoided".

Additionally, reorder the assignments to ensure tmp_buf is assigned
only after BIP_AAD has been validated as non-NULL.

Signed-off-by: Marco Antonio Solis Segura <mshdevv@gmail.com>
Link: https://patch.msgid.link/20260319062626.605200-1-mshdevv@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agoata: libahci_platform: use flex array for platform PHYs
Rosen Penev [Mon, 30 Mar 2026 20:37:37 +0000 (13:37 -0700)] 
ata: libahci_platform: use flex array for platform PHYs

Modify struct ahci_host_priv to use a flexible array member for an adapter
port PHYs and use struct_size to combine the allocation of this array
together with the adapter private data structure. __counted_by() annotation
is added for the phys field to support runtime analysis.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
3 weeks agostaging: rtl8723bs: Remove dead code
Bera Yüzlü [Wed, 18 Mar 2026 19:50:05 +0000 (22:50 +0300)] 
staging: rtl8723bs: Remove dead code

Clean up the dm_odm_t structure by removing commented-out members and
related legacy comments.

Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260318195005.23962-1-b9788213@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 weeks agoMerge branch 'r8152-add-helper-functions-for-pla-usb-phy-ocp-registers'
Paolo Abeni [Tue, 31 Mar 2026 08:28:57 +0000 (10:28 +0200)] 
Merge branch 'r8152-add-helper-functions-for-pla-usb-phy-ocp-registers'

Chih Kai Hsu says:

====================
r8152: add helper functions for PLA/USB/PHY OCP registers
====================

Link: https://patch.msgid.link/20260326073925.32976-453-nic_swsd@realtek.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agor8152: add helper functions for PHY OCP registers
Chih Kai Hsu [Thu, 26 Mar 2026 07:39:25 +0000 (15:39 +0800)] 
r8152: add helper functions for PHY OCP registers

Add the following bitwise operation functions for PHY OCP registers to
simplify the code.

- ocp_reg_w0w1()
- ocp_reg_clr_bits()
- ocp_reg_set_bits()
- sram_write_w0w1()
- sram_clr_bits()
- sram_set_bits()
- r8152_mdio_clr_bit()
- r8152_mdio_set_bit()
- r8152_mdio_test_and_clr_bit()

In addition, remove variable set but not used from r8153_init(),
r8153b_init() and r8153c_init().

Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>
Reviewed-by: Hayes Wang <hayeswang@realtek.com>
Link: https://patch.msgid.link/20260326073925.32976-456-nic_swsd@realtek.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agor8152: add helper functions for PLA/USB OCP registers
Chih Kai Hsu [Thu, 26 Mar 2026 07:39:24 +0000 (15:39 +0800)] 
r8152: add helper functions for PLA/USB OCP registers

Add the following bitwise operation functions for PLA/USB OCP registers
to simplify the code.

- ocp_dword_w0w1()
- ocp_word_w0w1()
- ocp_byte_w0w1()
- ocp_dword_clr_bits()
- ocp_dword_set_bits()
- ocp_word_clr_bits()
- ocp_word_set_bits()
- ocp_word_test_and_clr_bits()
- ocp_byte_clr_bits()
- ocp_byte_set_bits()

Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>
Reviewed-by: Hayes Wang <hayeswang@realtek.com>
Link: https://patch.msgid.link/20260326073925.32976-455-nic_swsd@realtek.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agor8152: fix incorrect register write to USB_UPHY_XTAL
Chih Kai Hsu [Thu, 26 Mar 2026 07:39:23 +0000 (15:39 +0800)] 
r8152: fix incorrect register write to USB_UPHY_XTAL

The old code used ocp_write_byte() to clear the OOBS_POLLING bit
(BIT(8)) in the USB_UPHY_XTAL register, but this doesn't correctly
clear a bit in the upper byte of the 16-bit register.

Fix this by using ocp_write_word() instead.

Fixes: 195aae321c82 ("r8152: support new chips")
Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>
Reviewed-by: Hayes Wang <hayeswang@realtek.com>
Link: https://patch.msgid.link/20260326073925.32976-454-nic_swsd@realtek.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 weeks agoALSA: hda/realtek: fix code style (ERROR: else should follow close brace '}')
Lei Huang [Tue, 31 Mar 2026 07:54:05 +0000 (15:54 +0800)] 
ALSA: hda/realtek: fix code style (ERROR: else should follow close brace '}')

Fix checkpatch code style errors:

  ERROR: else should follow close brace '}'
  #2300: FILE: sound/hda/codecs/realtek/alc269.c:2300:
  +       }
  +       else

Fixes: 31278997add6 ("ALSA: hda/realtek - Add headset quirk for Dell DT")
Signed-off-by: Lei Huang <huanglei@kylinos.cn>
Link: https://patch.msgid.link/20260331075405.78148-1-huanglei814@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 weeks agoALSA: ctxfi: Don't enumerate SPDIF1 at DAIO initialization
Takashi Iwai [Tue, 31 Mar 2026 08:12:17 +0000 (10:12 +0200)] 
ALSA: ctxfi: Don't enumerate SPDIF1 at DAIO initialization

The recent refactoring of xfi driver changed the assignment of
atc->daios[] at atc_get_resources(); now it loops over all enum
DAIOTYP entries while it looped formerly only a part of them.
The problem is that the last entry, SPDIF1, is a special type that
is used only for hw20k1 CTSB073X model (as a replacement of SPDIFIO),
and there is no corresponding definition for hw20k2.  Due to the lack
of the info, it caused a kernel crash on hw20k2, which was already
worked around by the commit b045ab3dff97 ("ALSA: ctxfi: Fix missing
SPDIFI1 index handling").

This patch addresses the root cause of the regression above properly,
simply by skipping the incorrect SPDIF1 type in the parser loop.

For making the change clearer, the code is slightly arranged, too.

Fixes: a2dbaeb5c61e ("ALSA: ctxfi: Refactor resource alloc for sparse mappings")
Cc: <stable@vger.kernel.org>
Link: https://bugzilla.suse.com/show_bug.cgi?id=1259925
Link: https://patch.msgid.link/20260331081227.216134-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 weeks agocrypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption
Herbert Xu [Fri, 27 Mar 2026 06:04:17 +0000 (15:04 +0900)] 
crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption

When decrypting data that is not in-place (src != dst), there is
no need to save the high-order sequence bits in dst as it could
simply be re-copied from the source.

However, the data to be hashed need to be rearranged accordingly.

Reported-by: Taeyang Lee <0wn@theori.io>
Fixes: 104880a6b470 ("crypto: authencesn - Convert to new AEAD interface")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 weeks agocrypto: algif_aead - Revert to operating out-of-place
Herbert Xu [Thu, 26 Mar 2026 06:30:20 +0000 (15:30 +0900)] 
crypto: algif_aead - Revert to operating out-of-place

This mostly reverts commit 72548b093ee3 except for the copying of
the associated data.

There is no benefit in operating in-place in algif_aead since the
source and destination come from different mappings.  Get rid of
all the complexity added for in-place operation and just copy the
AD directly.

Fixes: 72548b093ee3 ("crypto: algif_aead - copy AAD from src to dst")
Reported-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
3 weeks agoirqchip/riscv-aplic: Restrict genpd notifier to device tree only
Jessica Liu [Tue, 31 Mar 2026 01:30:29 +0000 (09:30 +0800)] 
irqchip/riscv-aplic: Restrict genpd notifier to device tree only

On ACPI systems, the aplic's pm_domain is set to acpi_general_pm_domain,
which provides its own power management callbacks (e.g., runtime_suspend
via acpi_subsys_runtime_suspend).

aplic_pm_add() unconditionally calls dev_pm_genpd_add_notifier() when
dev->pm_domain is non‑NULL, leading to a comparison between runtime_suspend
and genpd_runtime_suspend. This results in the following errors when ACPI
is enabled:

  riscv-aplic RSCV0002:00: failed to create APLIC context
  riscv-aplic RSCV0002:00: error -ENODEV: failed to setup APLIC in MSI mode

Fix this by checking for dev->of_node before adding or removing the genpd
notifier, ensuring it is only used for device tree based systems.

Fixes: 95a8ddde3660 ("irqchip/riscv-aplic: Preserve APLIC states across suspend/resume")
Signed-off-by: Jessica Liu <liu.xuemei1@zte.com.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260331093029749vRpdH-0qoEqjS0Wnn9M4x@zte.com.cn
3 weeks agox86/vdso: Drop pointless #ifdeffery in vvar_vclock_fault()
Thomas Weißschuh [Tue, 31 Mar 2026 07:58:54 +0000 (09:58 +0200)] 
x86/vdso: Drop pointless #ifdeffery in vvar_vclock_fault()

Sparse complains rightfully when CONFIG_PARAVIRT_CLOCK and
CONFIG_HYPERV_TIMER are both not set:

  arch/x86/entry/vdso/vma.c:94:9: warning: switch with no cases

The #ifdeffery is not actually necessary as the compiler can optimize away
the branches already if these config options are not set.

Remove the #ifdeffery to make the code simpler and Sparse happy.

Closes: https://lore.kernel.org/lkml/20260117215542.405790227@kernel.org/
Reported-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@kernel.org>
Link: https://patch.msgid.link/20260331-vdso-x86-ifdef-v1-1-6be9a58b1e7e@linutronix.de
3 weeks agox86/platform/geode: Fix on-stack property data use-after-return bug
Dmitry Torokhov [Mon, 30 Mar 2026 02:27:48 +0000 (19:27 -0700)] 
x86/platform/geode: Fix on-stack property data use-after-return bug

The PROPERTY_ENTRY_GPIO macro (and by extension PROPERTY_ENTRY_REF)
creates a temporary software_node_ref_args structure on the stack
when used in a runtime assignment. This results in the property
pointing to data that is invalid once the function returns.

Fix this by ensuring the GPIO reference data is not stored on stack and
using PROPERTY_ENTRY_REF_ARRAY_LEN() to point directly to the persistent
reference data.

Fixes: 298c9babadb8 ("x86/platform/geode: switch GPIO buttons and LEDs to software properties")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Daniel Scally <djrscally@gmail.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Hans de Goede <hansg@kernel.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260329-property-gpio-fix-v2-1-3cca5ba136d8@gmail.com
3 weeks agox86/tls: Clean up 'sel' variable usage in do_set_thread_area()
Uros Bizjak [Mon, 30 Mar 2026 08:59:23 +0000 (10:59 +0200)] 
x86/tls: Clean up 'sel' variable usage in do_set_thread_area()

The top-level 'sel' variable in do_set_thread_area() was previously
marked __maybe_unused, but it is now only needed locally when
updating the current task.

Remove the unused top-level declaration and introduce a local 'sel'
variable where it is actually used

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/20260330085938.67985-4-ubizjak@gmail.com
3 weeks agox86/process/32: Use correct type for 'gs' variable in __show_regs() to avoid zero...
Uros Bizjak [Mon, 30 Mar 2026 08:59:22 +0000 (10:59 +0200)] 
x86/process/32: Use correct type for 'gs' variable in __show_regs() to avoid zero-extension

Change the type of 'gs' variable in __show_regs() from
'unsigned short' to 'unsigned int'. This prevents unwanted
zero-extension when storing the 16-bit segment register
into a wider general purpose register.

The code improves from:

  50: 8c ee                 mov    %gs,%esi
  52: 0f b7 f6              movzwl %si,%esi
  ...
  be: 89 74 24 14           mov    %esi,0x14(%esp)

to:

  50: 8c ef                 mov    %gs,%edi
  ...
  bb: 89 7c 24 14           mov    %edi,0x14(%esp)

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/20260330085938.67985-3-ubizjak@gmail.com
3 weeks agox86/process/64: Use savesegment() in __show_regs() instead of inline asm
Uros Bizjak [Mon, 30 Mar 2026 08:59:21 +0000 (10:59 +0200)] 
x86/process/64: Use savesegment() in __show_regs() instead of inline asm

Replace direct 'movl' instructions for DS, ES, FS, and GS read in
__show_regs() with the savesegment() helper. This improves
readability, consistency, and ensures proper handling of
segment registers on x86_64.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/20260330085938.67985-2-ubizjak@gmail.com
3 weeks agox86/elf: Use savesegment() for segment register reads in ELF core dump
Uros Bizjak [Mon, 30 Mar 2026 08:59:20 +0000 (10:59 +0200)] 
x86/elf: Use savesegment() for segment register reads in ELF core dump

ELF_CORE_COPY_REGS() currently reads %ds, %es, %fs, and %gs using
inline assembly and manual zero-extension. This results in redundant
instructions like `mov %eax,%eax`.

Replace the inline assembly with the `savesegment()` helper, which
automatically zero-extends the value to the full register width,
eliminating unnecessary instructions.

For example, the %ds load sequence changes from:

  d03: 8c d8                 mov    %ds,%eax
  d05: 89 c0                 mov    %eax,%eax
  d07: 48 89 84 24 38 01 00  mov    %rax,0x138(%rsp)
  d0e: 00

to:

  ce8: 8c d8                 mov    %ds,%eax
  cea: 48 89 84 24 38 01 00  mov    %rax,0x138(%rsp)
  cf1: 00

thus eliminating the unnecessary zero-extending `mov %eax,%eax`.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/20260330085938.67985-1-ubizjak@gmail.com
3 weeks agopower: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:36 +0000 (13:36 +0530)] 
power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth

For supporting bluetooth over the non-discoverable UART interface of
WCN7850, create the serdev device after enumerating the PCIe interface.
This is mandatory since the device ID is only known after the PCIe
enumeration and the ID is used for creating the serdev device.

Since by default there is no OF or ACPI node for the created serdev,
create a dynamic OF 'bluetooth' node with the 'compatible' property and
attach it to the serdev device. This will allow the serdev device to bind
to the existing bluetooth driver.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-8-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agopower: sequencing: pcie-m2: Add support for PCIe M.2 Key E connectors
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:35 +0000 (13:36 +0530)] 
power: sequencing: pcie-m2: Add support for PCIe M.2 Key E connectors

Add support for handling the power sequence of the PCIe M.2 Key E
connectors. These connectors are used to attach the Wireless Connectivity
devices to the host machine including combinations of WiFi, BT, NFC using
interfaces such as PCIe/SDIO for WiFi, USB/UART for BT and I2C for NFC.

Currently, this driver supports only the PCIe interface for WiFi and UART
interface for BT. The driver also only supports driving the 3.3v/1.8v power
supplies and W_DISABLE{1/2}# GPIOs. The optional signals of the Key E
connectors are not currently supported.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-7-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agodt-bindings: connector: Add PCIe M.2 Mechanical Key E connector
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:33 +0000 (13:36 +0530)] 
dt-bindings: connector: Add PCIe M.2 Mechanical Key E connector

Add the devicetree binding for PCIe M.2 Mechanical Key E connector defined
in the PCI Express M.2 Specification, r4.0, sec 5.1.2. This connector
provides interfaces like PCIe or SDIO to attach the WiFi devices to the
host machine, USB or UART+PCM interfaces to attach the Bluetooth (BT)
devices. Spec also provides an optional interface to connect the UIM card,
but that is not covered in this binding.

The connector provides a primary power supply of 3.3v, along with an
optional 1.8v VIO supply for the Adapter I/O buffer circuitry operating at
1.8v sideband signaling.

The connector also supplies optional signals in the form of GPIOs for fine
grained power management.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-5-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agodt-bindings: serial: Document the graph port
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:32 +0000 (13:36 +0530)] 
dt-bindings: serial: Document the graph port

A serial controller could be connected to an external connector like PCIe
M.2 for controlling the serial interface of the card. Hence, document the
OF graph port.

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-4-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agoserdev: Do not return -ENODEV from of_serdev_register_devices() if external connector...
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:31 +0000 (13:36 +0530)] 
serdev: Do not return -ENODEV from of_serdev_register_devices() if external connector is used

If an external connector like M.2 is connected to the serdev controller
in DT, then the serdev devices may be created dynamically by the connector
driver. So do not return -ENODEV from of_serdev_register_devices() if the
static nodes are not found and the graph node is used.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-3-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agoserdev: Add an API to find the serdev controller associated with the devicetree node
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:30 +0000 (13:36 +0530)] 
serdev: Add an API to find the serdev controller associated with the devicetree node

Add of_find_serdev_controller_by_node() API to find the serdev controller
device associated with the devicetree node.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-2-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agoserdev: Convert to_serdev_*() helpers to macros and use container_of_const()
Manivannan Sadhasivam [Thu, 26 Mar 2026 08:06:29 +0000 (13:36 +0530)] 
serdev: Convert to_serdev_*() helpers to macros and use container_of_const()

If these helpers receive the 'const struct device' pointer, then the const
qualifier will get dropped, leading to below warning:

warning: passing argument 1 of ‘to_serdev_device_driver’ discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]

This is not an issue as of now, but with the future commits adding serdev
device based driver matching, this warning will get triggered. Hence,
convert these helpers to macros so that the qualifier get preserved and
also use container_of_const() as container_of() is deprecated.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-1-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
3 weeks agox86/vdso: Clean up remnants of VDSO32_NOTE_MASK
Thomas Weißschuh [Mon, 30 Mar 2026 12:07:55 +0000 (14:07 +0200)] 
x86/vdso: Clean up remnants of VDSO32_NOTE_MASK

VDSO32_NOTE_MASK is not used or provided anymore, remove it.

Fixes: a13f2ef168cb ("x86/xen: remove 32-bit Xen PV guest support")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Link: https://patch.msgid.link/20260330-vdso-x86-vdso32_note_mask-v1-1-2f5c473327bf@linutronix.de
3 weeks agoRDMA/hns: Remove the duplicate calls to ib_copy_validate_udata_in()
Jason Gunthorpe [Wed, 25 Mar 2026 21:27:02 +0000 (18:27 -0300)] 
RDMA/hns: Remove the duplicate calls to ib_copy_validate_udata_in()

A udata should be read only once per ioctl, not multiple times.
Multiple reads make it unclear what the content is since userspace can
change it between the reads.

Lift the ib_copy_validate_udata_in() out of
alloc_srq_buf()/alloc_srq_db() and into hns_roce_create_srq().

Found by AI.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA: Remove redundant = {} for udata req structs
Jason Gunthorpe [Wed, 25 Mar 2026 21:27:01 +0000 (18:27 -0300)] 
RDMA: Remove redundant = {} for udata req structs

Now that all of the udata request structs are loaded with the helpers
the callers should not pre-zero them. The helpers all guarantee that
the entire struct is filled with something.

Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/irdma: Add missing comp_mask check in alloc_ucontext
Jason Gunthorpe [Wed, 25 Mar 2026 21:27:00 +0000 (18:27 -0300)] 
RDMA/irdma: Add missing comp_mask check in alloc_ucontext

irdma has a comp_mask field that was never checked for validity, check
it.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jacob Moroni <jmoroni@google.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/hns: Add missing comp_mask check in create_qp
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:59 +0000 (18:26 -0300)] 
RDMA/hns: Add missing comp_mask check in create_qp

hns has a comp_mask field that was never checked for validity, check
it.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/mlx5: Pull comp_mask validation into ib_copy_validate_udata_in_cm()
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:58 +0000 (18:26 -0300)] 
RDMA/mlx5: Pull comp_mask validation into ib_copy_validate_udata_in_cm()

Directly check the supported comp_mask bitmap using
ib_copy_validate_udata_in_cm() and remove the open coding.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA: Use ib_copy_validate_udata_in_cm() for zero comp_mask
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:57 +0000 (18:26 -0300)] 
RDMA: Use ib_copy_validate_udata_in_cm() for zero comp_mask

All of these cases require a 0 comp_mask. Consolidate these into
using ib_copy_validate_udata_in_cm() and remove the open coded
comp_mask test.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/hns: Use ib_copy_validate_udata_in()
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:56 +0000 (18:26 -0300)] 
RDMA/hns: Use ib_copy_validate_udata_in()

Follow the last struct member from the commit when the struct was
added to the kernel.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/mlx4: Use ib_copy_validate_udata_in() for QP
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:55 +0000 (18:26 -0300)] 
RDMA/mlx4: Use ib_copy_validate_udata_in() for QP

Move the validation of the udata to the same function that copies it.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/mlx4: Use ib_copy_validate_udata_in()
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:54 +0000 (18:26 -0300)] 
RDMA/mlx4: Use ib_copy_validate_udata_in()

Follow the last member of each struct at the point
MLX4_IB_UVERBS_ABI_VERSION was set to 4.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/mlx5: Use ib_copy_validate_udata_in() for MW
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:53 +0000 (18:26 -0300)] 
RDMA/mlx5: Use ib_copy_validate_udata_in() for MW

The userspace side on MW made a mistake and never actually used the udata
driver structure that was defined so it always passes 0 length. Keep the
kernel structure but this conversion has to permit 0 length as well.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/mlx5: Use ib_copy_validate_udata_in() for SRQ
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:52 +0000 (18:26 -0300)] 
RDMA/mlx5: Use ib_copy_validate_udata_in() for SRQ

flags is the last member for mlx5_ib_create_srq, the uidx is a
later extension.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA/pvrdma: Use ib_copy_validate_udata_in() for srq
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:51 +0000 (18:26 -0300)] 
RDMA/pvrdma: Use ib_copy_validate_udata_in() for srq

struct pvrdma_create_srq was introduced when the driver was first
merged but was never used. At that point it had only buf_addr. Later
when SRQ was introduced the struct was expanded. So unlike the other
cases that grab the first struct member based on git blame this
uses the entire struct.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA: Use ib_copy_validate_udata_in() for implicit full structs
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:50 +0000 (18:26 -0300)] 
RDMA: Use ib_copy_validate_udata_in() for implicit full structs

All of these cases have git blames that say the entire current struct
was introduced at once, so the last member is the right choice.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA: Consolidate patterns with sizeof() to ib_copy_validate_udata_in()
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:49 +0000 (18:26 -0300)] 
RDMA: Consolidate patterns with sizeof() to ib_copy_validate_udata_in()

Similar to the prior patch, these patterns are open coding an
offsetofend() using sizeof(), which targets the last member of the
current struct.

Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Bernard Metzler <bernard.metzler@linux.dev>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA: Consolidate patterns with offsetof() to ib_copy_validate_udata_in()
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:48 +0000 (18:26 -0300)] 
RDMA: Consolidate patterns with offsetof() to ib_copy_validate_udata_in()

Similar to the prior patch, these patterns are open coding an
offsetofend(). The use of offsetof() targets the prior field as the
last field in the struct.

Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoRDMA: Consolidate patterns with offsetofend() to ib_copy_validate_udata_in()
Jason Gunthorpe [Wed, 25 Mar 2026 21:26:47 +0000 (18:26 -0300)] 
RDMA: Consolidate patterns with offsetofend() to ib_copy_validate_udata_in()

Go treewide and consolidate all existing patterns using:

* offsetofend() and variations
* ib_is_udata_cleared()
* ib_copy_from_udata()

into a direct call to the new ib_copy_validate_udata_in().

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
3 weeks agoALSA: hda/realtek: fix bad indentation for alc269
Lei Huang [Tue, 31 Mar 2026 02:40:36 +0000 (10:40 +0800)] 
ALSA: hda/realtek: fix bad indentation for alc269

Mention complains about this coding style:

  ERROR: code indent should use tabs where possible
  #6640: FILE: sound/hda/codecs/realtek/alc269.c:6640:
  +        [ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY] = {$

fix it up.

Fixes: 5de5db35350d ("ALSA: hda/realtek - Enable Mute LED for Lenovo platform")
Signed-off-by: Lei Huang <huanglei@kylinos.cn>
Link: https://patch.msgid.link/20260331024036.30782-1-huanglei814@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 weeks agoALSA: hda/realtek: Add quirk for Lenovo Yoga Slim 7 14AKP10
songxiebing [Tue, 31 Mar 2026 03:36:50 +0000 (11:36 +0800)] 
ALSA: hda/realtek: Add quirk for Lenovo Yoga Slim 7 14AKP10

The Pin Complex 0x17 (bass/woofer speakers) is incorrectly reported as
unconnected in the BIOS (pin default 0x411111f0 = N/A). This causes the
kernel to configure speaker_outs=0, meaning only the tweeters (pin 0x14)
are used. The result is very low, tinny audio with no bass.

The existing quirk ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN (already present
in patch_realtek.c for SSID 0x17aa3801) fixes the issue completely.

Reported-by: Garcicasti <andresgarciacastilla@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221298
Signed-off-by: songxiebing <songxiebing@kylinos.cn>
Link: https://patch.msgid.link/20260331033650.285601-1-songxiebing@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 weeks agoALSA: hda/realtek: add quirk for HP Laptop 15-fc0xxx
Zhang Heng [Tue, 31 Mar 2026 01:35:36 +0000 (09:35 +0800)] 
ALSA: hda/realtek: add quirk for HP Laptop 15-fc0xxx

For the HP Laptop 15-fc0xxx with ALC236, the built-in mic 0x12 was
not set up, making it unusable; after adding it, it now works properly.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221233
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Link: https://patch.msgid.link/20260331013536.13778-1-zhangheng@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>