]> www.infradead.org Git - users/hch/misc.git/log
users/hch/misc.git
2 months agoALSA: ac97: Use guard() for spin locks
Takashi Iwai [Fri, 29 Aug 2025 14:42:37 +0000 (16:42 +0200)]
ALSA: ac97: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829144342.4290-3-tiwai@suse.de
2 months agoALSA: ac97: Use guard() for mutex locks
Takashi Iwai [Fri, 29 Aug 2025 14:42:36 +0000 (16:42 +0200)]
ALSA: ac97: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829144342.4290-2-tiwai@suse.de
2 months agoALSA: firewire: motu: Use guard() for spin locks
Takashi Iwai [Sat, 30 Aug 2025 08:03:50 +0000 (10:03 +0200)]
ALSA: firewire: motu: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20250830080351.25600-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: firewire: lib: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:23 +0000 (15:27 +0200)]
ALSA: firewire: lib: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-20-tiwai@suse.de
2 months agoALSA: firewire: tascam: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:22 +0000 (15:27 +0200)]
ALSA: firewire: tascam: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-19-tiwai@suse.de
2 months agoALSA: firewire: oxfw: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:21 +0000 (15:27 +0200)]
ALSA: firewire: oxfw: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-18-tiwai@suse.de
2 months agoALSA: firewire: fireworks: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:19 +0000 (15:27 +0200)]
ALSA: firewire: fireworks: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-16-tiwai@suse.de
2 months agoALSA: firewire: fireface: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:18 +0000 (15:27 +0200)]
ALSA: firewire: fireface: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-15-tiwai@suse.de
2 months agoALSA: firewire: digi00x: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:17 +0000 (15:27 +0200)]
ALSA: firewire: digi00x: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-14-tiwai@suse.de
2 months agoALSA: firewire: dice: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:16 +0000 (15:27 +0200)]
ALSA: firewire: dice: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-13-tiwai@suse.de
2 months agoALSA: firewire: bebob: Use guard() for spin locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:15 +0000 (15:27 +0200)]
ALSA: firewire: bebob: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-12-tiwai@suse.de
2 months agoALSA: firewire: lib: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:14 +0000 (15:27 +0200)]
ALSA: firewire: lib: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-11-tiwai@suse.de
2 months agoALSA: firewire: isight: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:13 +0000 (15:27 +0200)]
ALSA: firewire: isight: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-10-tiwai@suse.de
2 months agoALSA: firewire: fireface: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:12 +0000 (15:27 +0200)]
ALSA: firewire: fireface: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-9-tiwai@suse.de
2 months agoALSA: firewire: tascam: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:11 +0000 (15:27 +0200)]
ALSA: firewire: tascam: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-8-tiwai@suse.de
2 months agoALSA: firewire: oxfw: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:10 +0000 (15:27 +0200)]
ALSA: firewire: oxfw: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-7-tiwai@suse.de
2 months agoALSA: firewire: motu: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:09 +0000 (15:27 +0200)]
ALSA: firewire: motu: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-6-tiwai@suse.de
2 months agoALSA: firewire: fireworks: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:08 +0000 (15:27 +0200)]
ALSA: firewire: fireworks: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-5-tiwai@suse.de
2 months agoALSA: firewire: digi00x: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:07 +0000 (15:27 +0200)]
ALSA: firewire: digi00x: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-4-tiwai@suse.de
2 months agoALSA: firewire: dice: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:06 +0000 (15:27 +0200)]
ALSA: firewire: dice: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-3-tiwai@suse.de
2 months agoALSA: firewire: bebob: Use guard() for mutex locks
Takashi Iwai [Thu, 28 Aug 2025 13:27:05 +0000 (15:27 +0200)]
ALSA: firewire: bebob: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250828132802.9032-2-tiwai@suse.de
2 months agoMerge branch 'for-linus' into for-next
Takashi Iwai [Sat, 30 Aug 2025 07:42:45 +0000 (09:42 +0200)]
Merge branch 'for-linus' into for-next

Pull 6.17 devel branch for further auto-cleanup updates.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: hda: tas2781: reorder tas2563 calibration variables
Gergo Koteles [Fri, 29 Aug 2025 16:04:50 +0000 (18:04 +0200)]
ALSA: hda: tas2781: reorder tas2563 calibration variables

The tasdev_load_calibrated_data() function expects the calibration data
values in the cali_data buffer as R0, R0Low, InvR0, Power, TLim which
is not the same as what tas2563_save_calibration() writes to the buffer.

Reorder the EFI variables in the tas2563_save_calibration() function
to put the values in the buffer in the correct order.

Fixes: 4fe238513407 ("ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://patch.msgid.link/20250829160450.66623-2-soyer@irl.hu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: hda: tas2781: fix tas2563 EFI data endianness
Gergo Koteles [Fri, 29 Aug 2025 16:04:49 +0000 (18:04 +0200)]
ALSA: hda: tas2781: fix tas2563 EFI data endianness

Before conversion to unify the calibration data management, the
tas2563_apply_calib() function performed the big endian conversion and
wrote the calibration data to the device. The writing is now done by the
common tasdev_load_calibrated_data() function, but without conversion.

Put the values into the calibration data buffer with the expected
endianness.

Fixes: 4fe238513407 ("ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://patch.msgid.link/20250829160450.66623-1-soyer@irl.hu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: firewire-motu: drop EPOLLOUT from poll return values as write is not supported
Takashi Sakamoto [Fri, 29 Aug 2025 23:37:49 +0000 (08:37 +0900)]
ALSA: firewire-motu: drop EPOLLOUT from poll return values as write is not supported

The ALSA HwDep character device of the firewire-motu driver incorrectly
returns EPOLLOUT in poll(2), even though the driver implements no operation
for write(2). This misleads userspace applications to believe write() is
allowed, potentially resulting in unnecessarily wakeups.

This issue dates back to the driver's initial code added by a commit
71c3797779d3 ("ALSA: firewire-motu: add hwdep interface"), and persisted
when POLLOUT was updated to EPOLLOUT by a commit a9a08845e9ac ('vfs: do
bulk POLL* -> EPOLL* replacement("").').

This commit fixes the bug.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20250829233749.366222-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: seq: oss/rw: Cleanup with guard
Takashi Iwai [Wed, 27 Aug 2025 08:05:17 +0000 (10:05 +0200)]
ALSA: seq: oss/rw: Cleanup with guard

Replace the manual spin lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-12-tiwai@suse.de
2 months agoALSA: seq: oss/synth: Clean up with guard and auto cleanup
Takashi Iwai [Wed, 27 Aug 2025 08:05:16 +0000 (10:05 +0200)]
ALSA: seq: oss/synth: Clean up with guard and auto cleanup

Use the auto-cleanup for the refcount management of seq_oss_synth
object.  The explicit call of snd_use_lock_free() is dropped by the
magic __free(seq_oss_synth) attribute.

Along with that, replace the manual mutex and spin locks with
guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-11-tiwai@suse.de
2 months agoALSA: seq: oss/midi: Cleanup with guard and auto-cleanup
Takashi Iwai [Wed, 27 Aug 2025 08:05:15 +0000 (10:05 +0200)]
ALSA: seq: oss/midi: Cleanup with guard and auto-cleanup

Use the auto-cleanup for the refcount management of seq_oss_midi
object.  The explicit call of snd_use_lock_free() is dropped by the
magic __free(seq_oss_midi) attribute.

Along with that, replace the manual mutex and spin locks with
guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-10-tiwai@suse.de
2 months agoALSA: seq: oss: Clean up core code with guard()
Takashi Iwai [Wed, 27 Aug 2025 08:05:14 +0000 (10:05 +0200)]
ALSA: seq: oss: Clean up core code with guard()

Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-9-tiwai@suse.de
2 months agoALSA: seq: Clean up fifo locking with guard
Takashi Iwai [Wed, 27 Aug 2025 08:05:13 +0000 (10:05 +0200)]
ALSA: seq: Clean up fifo locking with guard

Yet more cleanup, now for seq_fifo.c about its refcount calls; the
manual refcount calls (either snd_use_lock_*() or snd_seq_fifo_lock())
are replaced with guard(snd_seq_fifo).

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-8-tiwai@suse.de
2 months agoALSA: seq: Clean up queue locking with auto cleanup
Takashi Iwai [Wed, 27 Aug 2025 08:05:12 +0000 (10:05 +0200)]
ALSA: seq: Clean up queue locking with auto cleanup

Yet more cleanup with the auto-cleanup macro: now we replace the
queuefree() calls with the magic pointer attribute
__free(snd_seq_queue).

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-7-tiwai@suse.de
2 months agoALSA: seq: Clean up port locking with auto cleanup
Takashi Iwai [Wed, 27 Aug 2025 08:05:11 +0000 (10:05 +0200)]
ALSA: seq: Clean up port locking with auto cleanup

Like the previous change in seq_clientmgr.c, introduce a new
auto-cleanup macro for the snd_seq_port_unlock(), and apply it
appropriately.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-6-tiwai@suse.de
2 months agoALSA: seq: Use auto-cleanup for client refcounting
Takashi Iwai [Wed, 27 Aug 2025 08:05:10 +0000 (10:05 +0200)]
ALSA: seq: Use auto-cleanup for client refcounting

The current code manages the refcount of client in a way like:

snd_seq_client *client;
client = clientptr(id);
....
snd_seq_client_unlock(client);

Now we introduce an auto-cleanup macro to manage the unlock
implicitly, namely, the above will be replaced like:

snd_seq_client *client __free(snd_seq_client) = NULL;
client = clientptr(id);

and we can forget the unref call.

A part of the code in snd_seq_deliver_single_event() is factored out
to a function, so that the auto-cleanups can be applied cleanly.

This also allows us to replace some left mutex lock/unlock with
guard(), and also reduce scoped_guard() to the normal guard(), too.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-5-tiwai@suse.de
2 months agoALSA: seq: Use guard() for mutex and rwsem locks
Takashi Iwai [Wed, 27 Aug 2025 08:05:09 +0000 (10:05 +0200)]
ALSA: seq: Use guard() for mutex and rwsem locks

There are a few manual calls of mutex and rwsem lock/unlock pairs in
seq_clientmngr.c, and those can be replaced nicely with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-4-tiwai@suse.de
2 months agoALSA: seq: Clean up spin lock with guard()
Takashi Iwai [Wed, 27 Aug 2025 08:05:08 +0000 (10:05 +0200)]
ALSA: seq: Clean up spin lock with guard()

Use guard() for spin locks to manage the sequencer client locking.

The code about the refcounting was modified with the new
snd_seq_client_ref() and *_unref() helpers instead of the ugly goto,
too.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-3-tiwai@suse.de
2 months agoALSA: seq: Simplify internal command operation from OSS layer
Takashi Iwai [Wed, 27 Aug 2025 08:05:07 +0000 (10:05 +0200)]
ALSA: seq: Simplify internal command operation from OSS layer

snd_seq_client_ioctl_lock() and *_unlock() are used only from a single
function of the OSS layer, and it's just to wrap the call of
snd_seq_kernel_client_ctl().

Provide another variant of snd_seq_kernel_client_ctl() that takes the
locks internally and drop the ugly snd_seq_client_ioctl_lock() and
*_unlock() implementations, instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827080520.7544-2-tiwai@suse.de
2 months agoALSA: hda/intel: Use guard() for spinlocks
Takashi Iwai [Wed, 27 Aug 2025 07:29:05 +0000 (09:29 +0200)]
ALSA: hda/intel: Use guard() for spinlocks

Replace the manual spin lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-26-tiwai@suse.de
2 months agoALSA: hda/common: Use guard() for spinlocks
Takashi Iwai [Wed, 27 Aug 2025 07:29:04 +0000 (09:29 +0200)]
ALSA: hda/common: Use guard() for spinlocks

Replace the manual spin lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-25-tiwai@suse.de
2 months agoALSA: hda/core: Use guard() for spinlocks
Takashi Iwai [Wed, 27 Aug 2025 07:29:03 +0000 (09:29 +0200)]
ALSA: hda/core: Use guard() for spinlocks

Replace the manual spin lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-24-tiwai@suse.de
2 months agoALSA: hda/ext: Use guard() for spinlocks
Takashi Iwai [Wed, 27 Aug 2025 07:29:02 +0000 (09:29 +0200)]
ALSA: hda/ext: Use guard() for spinlocks

Replace the manual spin lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-23-tiwai@suse.de
2 months agoALSA: hda/generic: Use auto cleanup for temporary buffers
Takashi Iwai [Wed, 27 Aug 2025 07:29:01 +0000 (09:29 +0200)]
ALSA: hda/generic: Use auto cleanup for temporary buffers

The release of temporary kmalloced buffers can be nicely handled via
the standard __free(kfree).

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-22-tiwai@suse.de
2 months agoALSA: hda/realtek: Use auto cleanup for temporary buffers
Takashi Iwai [Wed, 27 Aug 2025 07:29:00 +0000 (09:29 +0200)]
ALSA: hda/realtek: Use auto cleanup for temporary buffers

The release of temporary kmalloced buffers can be nicely handled via
the standard __free(kfree).

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-21-tiwai@suse.de
2 months agoALSA: hda/common: Use auto cleanup for temporary buffers
Takashi Iwai [Wed, 27 Aug 2025 07:28:59 +0000 (09:28 +0200)]
ALSA: hda/common: Use auto cleanup for temporary buffers

The release of temporary kmalloced buffers can be nicely handled via
the standard __free(kfree).

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-20-tiwai@suse.de
2 months agoALSA: hda/intel: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:58 +0000 (09:28 +0200)]
ALSA: hda/intel: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-19-tiwai@suse.de
2 months agoALSA: hda/analog: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:57 +0000 (09:28 +0200)]
ALSA: hda/analog: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-18-tiwai@suse.de
2 months agoALSA: hda/generic: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:56 +0000 (09:28 +0200)]
ALSA: hda/generic: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-17-tiwai@suse.de
2 months agoALSA: hda/component: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:55 +0000 (09:28 +0200)]
ALSA: hda/component: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-16-tiwai@suse.de
2 months agoALSA: hda/cs8409: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:54 +0000 (09:28 +0200)]
ALSA: hda/cs8409: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-15-tiwai@suse.de
2 months agoALSA: hda/tas2781: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:53 +0000 (09:28 +0200)]
ALSA: hda/tas2781: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-14-tiwai@suse.de
2 months agoALSA: hda/cs35l41: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:52 +0000 (09:28 +0200)]
ALSA: hda/cs35l41: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-13-tiwai@suse.de
2 months agoALSA: hda/realtek: Use guard() for mutex locks and COEF locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:51 +0000 (09:28 +0200)]
ALSA: hda/realtek: Use guard() for mutex locks and COEF locks

Replace the manual mutex lock/unlock pairs with guard().

Also, introduce the guard() for coef_mutex_lock() and _unlock() pairs,
and replace accordingly, too.  The coef_mutex_lock() and *_unlock()
are moved to readtek.h as static inline functions along with it.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-12-tiwai@suse.de
2 months agoALSA: hda/hdmi: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:50 +0000 (09:28 +0200)]
ALSA: hda/hdmi: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-11-tiwai@suse.de
2 months agoALSA: hda/ca0132: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:49 +0000 (09:28 +0200)]
ALSA: hda/ca0132: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-10-tiwai@suse.de
2 months agoALSA: hda/core: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:48 +0000 (09:28 +0200)]
ALSA: hda/core: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-9-tiwai@suse.de
2 months agoALSA: hda/common: Use guard() for mutex locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:47 +0000 (09:28 +0200)]
ALSA: hda/common: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-8-tiwai@suse.de
2 months agoALSA: hda: Use auto cleanup macros for DSP loader locks
Takashi Iwai [Wed, 27 Aug 2025 07:28:46 +0000 (09:28 +0200)]
ALSA: hda: Use auto cleanup macros for DSP loader locks

There are temporary DSP locking/unlocking patterns found in various
places, and those can be cleaned up nicely with the guard() macro
calling snd_hdac_dsp_lock() and *_unlock().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-7-tiwai@suse.de
2 months agoALSA: hda/common: Use cleanup macros for PM controls
Takashi Iwai [Wed, 27 Aug 2025 07:28:45 +0000 (09:28 +0200)]
ALSA: hda/common: Use cleanup macros for PM controls

The new macro CLASS(snd_hda_power_pm) can replace the manual
snd_hda_power_up_pm() and _down() calls gracefully.

A part of the code in codec_exec_verb() is factored out to a function,
so that the auto-cleanup can be well scoped.

Merely cleanups and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-6-tiwai@suse.de
2 months agoALSA: hda/realtek: Use cleanup macros for PM controls
Takashi Iwai [Wed, 27 Aug 2025 07:28:44 +0000 (09:28 +0200)]
ALSA: hda/realtek: Use cleanup macros for PM controls

The new macro CLASS(snd_hda_power_pm) can replace the manual
snd_hda_power_up_pm() and _down() calls gracefully.

Merely code cleanups and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-5-tiwai@suse.de
2 months agoALSA: hda/hdmi: Use cleanup macros for PM controls
Takashi Iwai [Wed, 27 Aug 2025 07:28:43 +0000 (09:28 +0200)]
ALSA: hda/hdmi: Use cleanup macros for PM controls

The new macro CLASS(snd_hda_power_pm) can replace the manual
snd_hda_power_up_pm() and _down() calls gracefully.

Merely code cleanups and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-4-tiwai@suse.de
2 months agoALSA: hda/ca0132: Use cleanup macros for PM controls
Takashi Iwai [Wed, 27 Aug 2025 07:28:42 +0000 (09:28 +0200)]
ALSA: hda/ca0132: Use cleanup macros for PM controls

The new macro CLASS(snd_hda_power) can replace the manual
snd_hda_power_up() and _down() calls as well as the *_pm_*() variants
gracefully.

Merely code cleanups and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-3-tiwai@suse.de
2 months agoALSA: hda: Introduce auto cleanup macros for PM
Takashi Iwai [Wed, 27 Aug 2025 07:28:41 +0000 (09:28 +0200)]
ALSA: hda: Introduce auto cleanup macros for PM

The temporary power up/down of the codec via snd_hda_power_up() and
_down() (or snd_hda_power_up_pm() and _down_pm()) is seen in various
places.  This patch introduces simple auto-cleanup macros for those
call patterns, so that the drivers don't have to call the
corresponding power-down calls explicitly.

Namely,
err = snd_hda_power_up(codec);
if (err < 0)
return err;
....
snd_power_down(codec);

can drop the *_down() call by replacing with
CLASS(snd_hda_power, pm)(codec);
if (pm.err < 0)
return pm.err;

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-2-tiwai@suse.de
2 months agoALSA: docs: Add documents for recently changes in snd-usb-audio
Cryolitia PukNgae [Fri, 29 Aug 2025 08:46:06 +0000 (16:46 +0800)]
ALSA: docs: Add documents for recently changes in snd-usb-audio

Changed:
  - ignore_ctl_error
  - lowlatency
  - skip_validation
  - quirk_flags[19:24]

[ corrected a typo -- tiwai ]

Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://patch.msgid.link/20250829-sound-doc-v1-1-e0110452b03d@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoMerge tag 'asoc-fix-v6.17-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git...
Takashi Iwai [Fri, 29 Aug 2025 09:13:09 +0000 (11:13 +0200)]
Merge tag 'asoc-fix-v6.17-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.17

The main fixes here are for some of the cleanups done in the core in
this release, we had broken component lookup in the case with a single
bus and DMA controller.  Otherwise it's driver specific changes, the
shortlogs for the Intel WCL and rsnd drivers look like minor cleanups
but are actually bugfixes (adding an op needed for correct functionality
and reverting an inappropriate helper usage).

2 months agoALSA: usb-audio: Add mute TLV for playback volumes on more devices
qaqland [Fri, 29 Aug 2025 06:40:48 +0000 (14:40 +0800)]
ALSA: usb-audio: Add mute TLV for playback volumes on more devices

Applying the quirk of that, the lowest Playback mixer volume setting
mutes the audio output, on more devices.

Suggested-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Signed-off-by: qaqland <anguoli@uniontech.com>
Link: https://patch.msgid.link/20250829-sound_quirk-v1-1-745529b44440@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoASoC: SOF: Intel: WCL: Add the sdw_process_wakeen op
Ajye Huang [Tue, 26 Aug 2025 15:40:40 +0000 (23:40 +0800)]
ASoC: SOF: Intel: WCL: Add the sdw_process_wakeen op

Add the missing op in the device description to avoid issues with jack
detection.

Fixes: 6b04629ae97a ("ASoC: SOF: Intel: add initial support for WCL")
Acked-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Message-ID: <20250826154040.2723998-1-ajye_huang@compal.corp-partner.google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 months agoALSA: hda: Avoid binding with SOF for SKL/KBL platforms
Takashi Iwai [Thu, 28 Aug 2025 14:11:00 +0000 (16:11 +0200)]
ALSA: hda: Avoid binding with SOF for SKL/KBL platforms

For Intel SKL and KBL platforms, it may be bound with one of three
HD-audio drivers (AVS, SOF and legacy).  AVS is the preferred one when
DMIC is detected, and that's how it's defined in the snd-intel-dspcfg
config table.

But, when AVS driver is disabled (CONFIG_SND_SOC_INTEL_AVS=n), the
device may be bound freely with either SOF or legacy driver.
Before 6.17, the legacy driver took it primarily, but on 6.17, likely
due to the recent code shuffling, SOF driver seems taking it at first,
and fails to probe.  For avoiding the regression, we should enforce to
bind those with the legacy HD-audio drvier when AVS is disabled.

This patch adds the extra two entries in intel-dspcfg table that are
applied only when CONFIG_SND_SOC_INTEL_AVS=n, for binding with the
legacy driver.

Note that there are entries for APL in that config table block, but
APL may be supported by SOF for certain setups, so the choice can't be
exclusive.  Hence this patch includes only SKL and KBL.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1248121
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250828141101.16294-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoASoC: rsnd: tidyup direction name on rsnd_dai_connect()
Kuninori Morimoto [Tue, 26 Aug 2025 06:30:01 +0000 (06:30 +0000)]
ASoC: rsnd: tidyup direction name on rsnd_dai_connect()

commit 2c6b6a3e8b93 ("ASoC: rsnd: use snd_pcm_direction_name()") uses
snd_pcm_direction_name() instead of original method to get string
"Playback" or "Capture". But io->substream might be NULL in this timing.
Let's re-use original method.

Fixes: 2c6b6a3e8b93 ("ASoC: rsnd: use snd_pcm_direction_name()")
Reported-by: Thuan Nguyen <thuan.nguyen-hong@banvien.com.vn>
Tested-by: Thuan Nguyen <thuan.nguyen-hong@banvien.com.vn>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-ID: <87zfbmwq6v.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 months agoALSA: lx_core: use int type to store negative error codes
Qianfeng Rong [Thu, 28 Aug 2025 08:13:10 +0000 (16:13 +0800)]
ALSA: lx_core: use int type to store negative error codes

Change the 'ret' variable from u16 to int to store negative error codes or
zero returned by lx_message_send_atomic().

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but it's ugly as pants. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.

No effect on runtime.

Fixes: 02bec4904508 ("ALSA: lx6464es - driver for the digigram lx6464es interface")
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Link: https://patch.msgid.link/20250828081312.393148-1-rongqianfeng@vivo.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: hda/tas2781: Fix EFI name for calibration beginning with 1 instead of 0
Shenghao Ding [Wed, 27 Aug 2025 04:34:03 +0000 (12:34 +0800)]
ALSA: hda/tas2781: Fix EFI name for calibration beginning with 1 instead of 0

A bug reported by one of my customers that EFI name beginning with 0
instead of 1.

Fixes: 4fe238513407 ("ALSA: hda/tas2781: Move and unified the calibrated-data getting function for SPI and I2C into the tas2781_hda lib")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20250827043404.644-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: pcm: oss: Use guard() for spin locks
Takashi Iwai [Wed, 27 Aug 2025 08:06:13 +0000 (10:06 +0200)]
ALSA: pcm: oss: Use guard() for spin locks

Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Link: https://patch.msgid.link/20250827080618.7682-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: usb-audio: move mixer_quirks' min_mute into common quirk
Cryolitia PukNgae [Wed, 27 Aug 2025 03:29:02 +0000 (11:29 +0800)]
ALSA: usb-audio: move mixer_quirks' min_mute into common quirk

We have found more and more devices that have the same problem, that
the mixer's minimum value is muted. Accroding to pipewire's MR[1]
and Arch Linux wiki[2], this should be a very common problem in USB
audio devices. Move the quirk into common quirk,as a preparation of
more devices' quirk's patch coming on the road[3].

1. https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2514
2. https://wiki.archlinux.org/index.php?title=PipeWire&oldid=804138#No_sound_from_USB_DAC_until_30%_volume
3. On the road, in the physical sense. We have been buying ton of
   these devices for testing the problem.

Tested-by: Guoli An <anguoli@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://patch.msgid.link/20250827-sound-quirk-min-mute-v1-1-4717aa8a4f6a@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: hda/realtek: Fix headset mic for TongFang X6[AF]R5xxY
Aaron Erhardt [Tue, 26 Aug 2025 14:10:54 +0000 (16:10 +0200)]
ALSA: hda/realtek: Fix headset mic for TongFang X6[AF]R5xxY

Add a PCI quirk to enable microphone detection on the headphone jack of
TongFang X6AR5xxY and X6FR5xxY devices.

Signed-off-by: Aaron Erhardt <aer@tuxedocomputers.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20250826141054.1201482-1-aer@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: usb-audio: us144mkii: Fixes for handshake, MIDI out and cleanup
Šerif Rami [Mon, 25 Aug 2025 07:25:57 +0000 (09:25 +0200)]
ALSA: usb-audio: us144mkii: Fixes for handshake, MIDI out and cleanup

Add a handshake value of 0x32, which is required when the device
was previously used by another OS with the official drivers.

Correct the last byte of the MIDI output protocol to 0xe0.

Also, remove the unused DRIVER_VERSION macro.

Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com>
Link: https://patch.msgid.link/20250825072557.7670-1-ramiserifpersia@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: hda/hdmi: Restore missing HDMI codec entries
Daniel Dadap [Tue, 26 Aug 2025 02:48:38 +0000 (21:48 -0500)]
ALSA: hda/hdmi: Restore missing HDMI codec entries

Commit ad781b550f9a ("ALSA: hda/hdmi: Rewrite to new probe method")
rewrote the HDMI codec ID tables to a new format. In doing so, recently
added codec IDs from commit e0a911ac868 ("ALSA: hda: Add missing NVIDIA
HDA codec IDs") were dropped from the tables. These tables had recently
been split from the unified table that existed in patch_hdmi.c, and did
contain the entries in question after the split but before the codec ID
entries were rewritten to the new format.

Restore the missing codec ID entries to nvhdmi.c and tegrahdmi.c. There
do not appear to be any additional missing entries in any of the other
codec ID tables when compared to the patch_hdmi.c at the final revision
before the split.

Fixes: ad781b550f9a ("ALSA: hda/hdmi: Rewrite to new probe method")
Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
Link: https://patch.msgid.link/aK0ghvagXy740rxd@ddadap-lakeline.nvidia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoASoC: fixup snd_soc_lookup_component_nolocked()
Mark Brown [Mon, 25 Aug 2025 20:16:07 +0000 (21:16 +0100)]
ASoC: fixup snd_soc_lookup_component_nolocked()

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Because snd_dmaengine_pcm is sharing same dev with CPU and Platform,
snd_soc_lookup_component_nolocked() might be call with NULL driver name
(= CPU). This patch fixup and cleanup it.

2 months agoASoC: codecs: idt821034: fix wrong log in idt821034_chip_direction_output()
Cryolitia PukNgae [Fri, 22 Aug 2025 10:28:33 +0000 (18:28 +0800)]
ASoC: codecs: idt821034: fix wrong log in idt821034_chip_direction_output()

Change `dir in` to `dir out`

Suggested-by: Jun Zhan <zhanjun@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Message-ID: <20250822-idt821034-v1-1-e2bfffbde56f@uniontech.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 months agoASoC: soc-core: tidyup snd_soc_lookup_component_nolocked()
Kuninori Morimoto [Tue, 19 Aug 2025 01:59:01 +0000 (01:59 +0000)]
ASoC: soc-core: tidyup snd_soc_lookup_component_nolocked()

snd_soc_lookup_component_nolocked() is very complex today.
Let's tidyup the code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-ID: <87cy8sysuy.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 months agoASoC: soc-core: care NULL dirver name on snd_soc_lookup_component_nolocked()
Kuninori Morimoto [Tue, 19 Aug 2025 01:58:51 +0000 (01:58 +0000)]
ASoC: soc-core: care NULL dirver name on snd_soc_lookup_component_nolocked()

soc-generic-dmaengine-pcm.c uses same dev for both CPU and Platform.
In such case, CPU component driver might not have driver->name, then
snd_soc_lookup_component_nolocked() will be NULL pointer access error.
Care NULL driver name.

Call trace:
 strcmp from snd_soc_lookup_component_nolocked+0x64/0xa4
 snd_soc_lookup_component_nolocked from snd_soc_unregister_component_by_driver+0x2c/0x44
 snd_soc_unregister_component_by_driver from snd_dmaengine_pcm_unregister+0x28/0x64
 snd_dmaengine_pcm_unregister from devres_release_all+0x98/0xfc
 devres_release_all from device_unbind_cleanup+0xc/0x60
 device_unbind_cleanup from really_probe+0x220/0x2c8
 really_probe from __driver_probe_device+0x88/0x1a0
 __driver_probe_device from driver_probe_device+0x30/0x110
driver_probe_device from __driver_attach+0x90/0x178
__driver_attach from bus_for_each_dev+0x7c/0xcc
bus_for_each_dev from bus_add_driver+0xcc/0x1ec
bus_add_driver from driver_register+0x80/0x11c
driver_register from do_one_initcall+0x58/0x23c
do_one_initcall from kernel_init_freeable+0x198/0x1f4
kernel_init_freeable from kernel_init+0x1c/0x12c
kernel_init from ret_from_fork+0x14/0x28

Fixes: 144d6dfc7482 ("ASoC: soc-core: merge snd_soc_unregister_component() and snd_soc_unregister_component_by_driver()")
Reported-by: J. Neuschäfer <j.ne@posteo.net>
Closes: https://lore.kernel.org/r/aJb311bMDc9x-dpW@probook
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Ondřej Jirman <megi@xff.cz>
Closes: https://lore.kernel.org/r/arxpwzu6nzgjxvsndct65ww2wz4aezb5gjdzlgr24gfx7xvyih@natjg6dg2pj6
Tested-by: J. Neuschäfer <j.ne@posteo.net>
Message-ID: <87ect8ysv8.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2 months agoLinux 6.17-rc3
Linus Torvalds [Sun, 24 Aug 2025 16:04:12 +0000 (12:04 -0400)]
Linux 6.17-rc3

2 months agoMerge tag 'i2c-for-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sun, 24 Aug 2025 14:32:04 +0000 (10:32 -0400)]
Merge tag 'i2c-for-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:

 - hisi: update maintainership

 - fix several issues in rtl9300 xfer:
     - check message length boundaries
     - correct multi-byte value composition on write
     - increase polling timeout
     - fix block transfer protocol

* tag 'i2c-for-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: rtl9300: Add missing count byte for SMBus Block Ops
  i2c: rtl9300: Increase timeout for transfer polling
  i2c: rtl9300: Fix multi-byte I2C write
  i2c: rtl9300: Fix out-of-bounds bug in rtl9300_i2c_smbus_xfer
  MAINTAINERS: i2c: Update i2c_hisi entry

2 months agoMerge tag 'perf_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Aug 2025 14:13:05 +0000 (10:13 -0400)]
Merge tag 'perf_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fix from Borislav Petkov:

 - Fix a case where the events throttling logic operates on inactive
   events

* tag 'perf_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Avoid undefined behavior from stopping/starting inactive events

2 months agoMerge tag 'x86_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Aug 2025 13:52:28 +0000 (09:52 -0400)]
Merge tag 'x86_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - Fix the GDS mitigation detection on some machines after the recent
   attack vectors conversion

 - Filter out the invalid machine reset reason value -1 when running as
   a guest as in such cases the reason why the machine was rebooted does
   not make a whole lot of sense

 - Init the resource control machinery on Hygon hw in order to avoid a
   division by zero and to actually enable the feature on hw which
   supports it

* tag 'x86_urgent_for_v6.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/bugs: Fix GDS mitigation selecting when mitigation is off
  x86/CPU/AMD: Ignore invalid reset reason value
  x86/cpu/hygon: Add missing resctrl_cpu_detect() in bsp_init helper

2 months agoMerge tag 'mips-fixes_6.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips...
Linus Torvalds [Sun, 24 Aug 2025 13:47:03 +0000 (09:47 -0400)]
Merge tag 'mips-fixes_6.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from Thomas Bogendoerfer:
 "Fix ethernet on Lantiq boards"

* tag 'mips-fixes_6.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  mips: lantiq: xway: sysctrl: rename the etop node
  mips: dts: lantiq: danube: add missing burst length property

2 months agoMerge tag 'modules-6.17-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 24 Aug 2025 13:43:50 +0000 (09:43 -0400)]
Merge tag 'modules-6.17-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux

Pull modules fix from Daniel Gomez:
 "This includes a fix part of the KSPP (Kernel Self Protection Project)
  to replace the deprecated and unsafe strcpy() calls in the kernel
  parameter string handler and sysfs parameters for built-in modules.
  Single commit, no functional changes"

* tag 'modules-6.17-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux:
  params: Replace deprecated strcpy() with strscpy() and memcpy()

2 months agoMerge tag 'char-misc-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sat, 23 Aug 2025 15:27:31 +0000 (11:27 -0400)]
Merge tag 'char-misc-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc/iio fixes from Greg KH:
 "Here are a small number of char/misc/iio and other driver fixes for
  6.17-rc3.  Included in here are:

   - IIO driver bugfixes for reported issues

   - bunch of comedi driver fixes

   - most core bugfix

   - fpga driver bugfix

   - cdx driver bugfix

  All of these have been in linux-next this week with no reported
  issues"

* tag 'char-misc-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  most: core: Drop device reference after usage in get_channel()
  comedi: Make insn_rw_emulate_bits() do insn->n samples
  comedi: Fix use of uninitialized memory in do_insn_ioctl() and do_insnlist_ioctl()
  comedi: pcl726: Prevent invalid irq number
  cdx: Fix off-by-one error in cdx_rpmsg_probe()
  fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()
  iio: pressure: bmp280: Use IS_ERR() in bmp280_common_probe()
  iio: light: as73211: Ensure buffer holes are zeroed
  iio: adc: rzg2l_adc: Set driver data before enabling runtime PM
  iio: adc: rzg2l: Cleanup suspend/resume path
  iio: adc: ad7380: fix missing max_conversion_rate_hz on adaq4381-4
  iio: adc: bd79124: Add GPIOLIB dependency
  iio: imu: inv_icm42600: change invalid data error to -EBUSY
  iio: adc: ad7124: fix channel lookup in syscalib functions
  iio: temperature: maxim_thermocouple: use DMA-safe buffer for spi_read()
  iio: adc: ad7173: prevent scan if too many setups requested
  iio: proximity: isl29501: fix buffered read on big-endian systems
  iio: accel: sca3300: fix uninitialized iio scan data

2 months agoMerge tag 'usb-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sat, 23 Aug 2025 15:21:56 +0000 (11:21 -0400)]
Merge tag 'usb-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some small USB driver fixes for 6.17-rc3 to resolve a bunch
  of reported issues. Included in here are:

   - typec driver fixes

   - dwc3 new device id

   - dwc3 driver fixes

   - new usb-storage driver quirks

   - xhci driver fixes

   - other tiny USB driver fixes to resolve bugs

  All of these have been in linux-next this week with no reported issues"

* tag 'usb-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: xhci: fix host not responding after suspend and resume
  usb: xhci: Fix slot_id resource race conflict
  usb: typec: fusb302: Revert incorrect threaded irq fix
  USB: core: Update kerneldoc for usb_hcd_giveback_urb()
  usb: typec: maxim_contaminant: re-enable cc toggle if cc is open and port is clean
  usb: typec: maxim_contaminant: disable low power mode when reading comparator values
  usb: dwc3: Remove WARN_ON for device endpoint command timeouts
  USB: storage: Ignore driver CD mode for Realtek multi-mode Wi-Fi dongles
  usb: storage: realtek_cr: Use correct byte order for bcs->Residue
  usb: chipidea: imx: improve usbmisc_imx7d_pullup()
  kcov, usb: Don't disable interrupts in kcov_remote_start_usb_softirq()
  usb: dwc3: pci: add support for the Intel Wildcat Lake
  usb: dwc3: Ignore late xferNotReady event to prevent halt timeout
  USB: storage: Add unusual-devs entry for Novatek NTK96550-based camera
  usb: core: hcd: fix accessing unmapped memory in SINGLE_STEP_SET_FEATURE test
  usb: renesas-xhci: Fix External ROM access timeouts
  usb: gadget: tegra-xudc: fix PM use count underflow
  usb: quirks: Add DELAY_INIT quick for another SanDisk 3.2Gen1 Flash Drive

2 months agoMerge tag 'trace-v6.17-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Sat, 23 Aug 2025 14:11:34 +0000 (10:11 -0400)]
Merge tag 'trace-v6.17-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Fix rtla and latency tooling pkg-config errors

   If libtraceevent and libtracefs is installed, but their corresponding
   '.pc' files are not installed, it reports that the libraries are
   missing and confuses the developer. Instead, report that the
   pkg-config files are missing and should be installed.

 - Fix overflow bug of the parser in trace_get_user()

   trace_get_user() uses the parsing functions to parse the user space
   strings. If the parser fails due to incorrect processing, it doesn't
   terminate the buffer with a nul byte. Add a "failed" flag to the
   parser that gets set when parsing fails and is used to know if the
   buffer is fine to use or not.

 - Remove a semicolon that was at an end of a comment line

 - Fix register_ftrace_graph() to unregister the pm notifier on error

   The register_ftrace_graph() registers a pm notifier but there's an
   error path that can exit the function without unregistering it. Since
   the function returns an error, it will never be unregistered.

 - Allocate and copy ftrace hash for reader of ftrace filter files

   When the set_ftrace_filter or set_ftrace_notrace files are open for
   read, an iterator is created and sets its hash pointer to the
   associated hash that represents filtering or notrace filtering to it.
   The issue is that the hash it points to can change while the
   iteration is happening. All the locking used to access the tracer's
   hashes are released which means those hashes can change or even be
   freed. Using the hash pointed to by the iterator can cause UAF bugs
   or similar.

   Have the read of these files allocate and copy the corresponding
   hashes and use that as that will keep them the same while the
   iterator is open. This also simplifies the code as opening it for
   write already does an allocate and copy, and now that the read is
   doing the same, there's no need to check which way it was opened on
   the release of the file, and the iterator hash can always be freed.

 - Fix function graph to copy args into temp storage

   The output of the function graph tracer shows both the entry and the
   exit of a function. When the exit is right after the entry, it
   combines the two events into one with the output of "function();",
   instead of showing:

     function() {
     }

   In order to do this, the iterator descriptor that reads the events
   includes storage that saves the entry event while it peaks at the
   next event in the ring buffer. The peek can free the entry event so
   the iterator must store the information to use it after the peek.

   With the addition of function graph tracer recording the args, where
   the args are a dynamic array in the entry event, the temp storage
   does not save them. This causes the args to be corrupted or even
   cause a read of unsafe memory.

   Add space to save the args in the temp storage of the iterator.

 - Fix race between ftrace_dump and reading trace_pipe

   ftrace_dump() is used when a crash occurs where the ftrace buffer
   will be printed to the console. But it can also be triggered by
   sysrq-z. If a sysrq-z is triggered while a task is reading trace_pipe
   it can cause a race in the ftrace_dump() where it checks if the
   buffer has content, then it checks if the next event is available,
   and then prints the output (regardless if the next event was
   available or not). Reading trace_pipe at the same time can cause it
   to not be available, and this triggers a WARN_ON in the print. Move
   the printing into the check if the next event exists or not

* tag 'trace-v6.17-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  ftrace: Also allocate and copy hash for reading of filter files
  ftrace: Fix potential warning in trace_printk_seq during ftrace_dump
  fgraph: Copy args in intermediate storage with entry
  trace/fgraph: Fix the warning caused by missing unregister notifier
  ring-buffer: Remove redundant semicolons
  tracing: Limit access to parser->buffer when trace_get_user failed
  rtla: Check pkg-config install
  tools/latency-collector: Check pkg-config install

2 months agoMerge tag 'driver-core-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 23 Aug 2025 13:04:32 +0000 (09:04 -0400)]
Merge tag 'driver-core-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core fixes from Danilo Krummrich:

 - Fix swapped handling of lru_gen and lru_gen_full debugfs files in
   vmscan

 - Fix debugfs mount options (uid, gid, mode) being silently ignored

 - Fix leak of devres action in the unwind path of Devres::new()

 - Documentation:
     - Expand and fix documentation of (outdated) Device, DeviceContext
       and generic driver infrastructure
     - Fix C header link of faux device abstractions
     - Clarify expected interaction with the security team
     - Smooth text flow in the security bug reporting process
       documentation

* tag 'driver-core-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
  Documentation: smooth the text flow in the security bug reporting process
  Documentation: clarify the expected collaboration with security bugs reporters
  debugfs: fix mount options not being applied
  rust: devres: fix leaking call to devm_add_action()
  rust: faux: fix C header link
  driver: rust: expand documentation for driver infrastructure
  device: rust: expand documentation for Device
  device: rust: expand documentation for DeviceContext
  mm/vmscan: fix inverted polarity in lru_gen_seq_show()

2 months agoMerge tag 'i2c-host-fixes-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel...
Wolfram Sang [Sat, 23 Aug 2025 05:57:28 +0000 (07:57 +0200)]
Merge tag 'i2c-host-fixes-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-current

i2c-host-fixes for v6.17-rc3

- hisi: update maintainership
- rtl9300: fix several issues in xfer
  - check message length boundaries
  - correct multi-byte value composition on write
  - increase polling timeout
  - fix block transfer protocol

2 months agoftrace: Also allocate and copy hash for reading of filter files
Steven Rostedt [Fri, 22 Aug 2025 22:36:06 +0000 (18:36 -0400)]
ftrace: Also allocate and copy hash for reading of filter files

Currently the reader of set_ftrace_filter and set_ftrace_notrace just adds
the pointer to the global tracer hash to its iterator. Unlike the writer
that allocates a copy of the hash, the reader keeps the pointer to the
filter hashes. This is problematic because this pointer is static across
function calls that release the locks that can update the global tracer
hashes. This can cause UAF and similar bugs.

Allocate and copy the hash for reading the filter files like it is done
for the writers. This not only fixes UAF bugs, but also makes the code a
bit simpler as it doesn't have to differentiate when to free the
iterator's hash between writers and readers.

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/20250822183606.12962cc3@batman.local.home
Fixes: c20489dad156 ("ftrace: Assign iter->hash to filter or notrace hashes on seq read")
Closes: https://lore.kernel.org/all/20250813023044.2121943-1-wutengda@huaweicloud.com/
Closes: https://lore.kernel.org/all/20250822192437.GA458494@ax162/
Reported-by: Tengda Wu <wutengda@huaweicloud.com>
Tested-by: Tengda Wu <wutengda@huaweicloud.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2 months agoMerge tag 'drm-fixes-2025-08-23-1' of https://gitlab.freedesktop.org/drm/kernel
Linus Torvalds [Fri, 22 Aug 2025 22:16:54 +0000 (18:16 -0400)]
Merge tag 'drm-fixes-2025-08-23-1' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Weekly drm fixes. Looks like things did indeed get busier after rc2,
  nothing seems too major, but stuff scattered all over the place,
  amdgpu, xe, i915, hibmc, rust support code, and other small fixes.

  rust:
   - drm device memory layout and safety fixes

  tests:
   - Endianness fixes

  gpuvm:
   - docs warning fix

  panic:
   - fix division on 32-bit arm

  i915:
   - TypeC DP display Fixes
   - Silence rpm wakeref asserts on GEN11_GU_MISC_IIR access
   - Relocate compression repacking WA for JSL/EHL

  xe:
   - xe_vm_create fixes
   - fix vm bind ioctl double free

  amdgpu:
   - Replay fixes
   - SMU14 fix
   - Null check DC fixes
   - DCE6 DC fixes
   - Misc DC fixes

  bridge:
   - analogix_dp: devm_drm_bridge_alloc() error handling fix

  habanalabs:
   - Memory deallocation fix

  hibmc:
   - modesetting black screen fixes
   - fix UAF on irq
   - fix leak on i2c failure path

  nouveau:
   - memory leak fixes
   - typos

  rockchip:
   - Kconfig fix
   - register caching fix"

* tag 'drm-fixes-2025-08-23-1' of https://gitlab.freedesktop.org/drm/kernel: (49 commits)
  drm/xe: Fix vm_bind_ioctl double free bug
  drm/xe: Move ASID allocation and user PT BO tracking into xe_vm_create
  drm/xe: Assign ioctl xe file handler to vm in xe_vm_create
  drm/i915/gt: Relocate compression repacking WA for JSL/EHL
  drm/i915: silence rpm wakeref asserts on GEN11_GU_MISC_IIR access
  drm/amd/display: Fix DP audio DTO1 clock source on DCE 6.
  drm/amd/display: Fix fractional fb divider in set_pixel_clock_v3
  drm/amd/display: Don't print errors for nonexistent connectors
  drm/amd/display: Don't warn when missing DCE encoder caps
  drm/amd/display: Fill display clock and vblank time in dce110_fill_display_configs
  drm/amd/display: Find first CRTC and its line time in dce110_fill_display_configs
  drm/amd/display: Adjust DCE 8-10 clock, don't overclock by 15%
  drm/amd/display: Don't overclock DCE 6 by 15%
  drm/amd/display: Add null pointer check in mod_hdcp_hdcp1_create_session()
  drm/amd/display: Fix Xorg desktop unresponsive on Replay panel
  drm/amd/display: Avoid a NULL pointer dereference
  drm/amdgpu/swm14: Update power limit logic
  drm/amd/display: Revert Add HPO encoder support to Replay
  drm/i915/icl+/tc: Convert AUX powered WARN to a debug message
  drm/i915/lnl+/tc: Use the cached max lane count value
  ...

2 months agoftrace: Fix potential warning in trace_printk_seq during ftrace_dump
Tengda Wu [Fri, 22 Aug 2025 03:33:43 +0000 (03:33 +0000)]
ftrace: Fix potential warning in trace_printk_seq during ftrace_dump

When calling ftrace_dump_one() concurrently with reading trace_pipe,
a WARN_ON_ONCE() in trace_printk_seq() can be triggered due to a race
condition.

The issue occurs because:

CPU0 (ftrace_dump)                              CPU1 (reader)
echo z > /proc/sysrq-trigger

!trace_empty(&iter)
trace_iterator_reset(&iter) <- len = size = 0
                                                cat /sys/kernel/tracing/trace_pipe
trace_find_next_entry_inc(&iter)
  __find_next_entry
    ring_buffer_empty_cpu <- all empty
  return NULL

trace_printk_seq(&iter.seq)
  WARN_ON_ONCE(s->seq.len >= s->seq.size)

In the context between trace_empty() and trace_find_next_entry_inc()
during ftrace_dump, the ring buffer data was consumed by other readers.
This caused trace_find_next_entry_inc to return NULL, failing to populate
`iter.seq`. At this point, due to the prior trace_iterator_reset, both
`iter.seq.len` and `iter.seq.size` were set to 0. Since they are equal,
the WARN_ON_ONCE condition is triggered.

Move the trace_printk_seq() into the if block that checks to make sure the
return value of trace_find_next_entry_inc() is non-NULL in
ftrace_dump_one(), ensuring the 'iter.seq' is properly populated before
subsequent operations.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Ingo Molnar <mingo@elte.hu>
Link: https://lore.kernel.org/20250822033343.3000289-1-wutengda@huaweicloud.com
Fixes: d769041f8653 ("ring_buffer: implement new locking")
Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2 months agofgraph: Copy args in intermediate storage with entry
Steven Rostedt [Wed, 20 Aug 2025 23:55:22 +0000 (19:55 -0400)]
fgraph: Copy args in intermediate storage with entry

The output of the function graph tracer has two ways to display its
entries. One way for leaf functions with no events recorded within them,
and the other is for functions with events recorded inside it. As function
graph has an entry and exit event, to simplify the output of leaf
functions it combines the two, where as non leaf functions are separate:

 2)               |              invoke_rcu_core() {
 2)               |                raise_softirq() {
 2)   0.391 us    |                  __raise_softirq_irqoff();
 2)   1.191 us    |                }
 2)   2.086 us    |              }

The __raise_softirq_irqoff() function above is really two events that were
merged into one. Otherwise it would have looked like:

 2)               |              invoke_rcu_core() {
 2)               |                raise_softirq() {
 2)               |                  __raise_softirq_irqoff() {
 2)   0.391 us    |                  }
 2)   1.191 us    |                }
 2)   2.086 us    |              }

In order to do this merge, the reading of the trace output file needs to
look at the next event before printing. But since the pointer to the event
is on the ring buffer, it needs to save the entry event before it looks at
the next event as the next event goes out of focus as soon as a new event
is read from the ring buffer. After it reads the next event, it will print
the entry event with either the '{' (non leaf) or ';' and timestamps (leaf).

The iterator used to read the trace file has storage for this event. The
problem happens when the function graph tracer has arguments attached to
the entry event as the entry now has a variable length "args" field. This
field only gets set when funcargs option is used. But the args are not
recorded in this temp data and garbage could be printed. The entry field
is copied via:

  data->ent = *curr;

Where "curr" is the entry field. But this method only saves the non
variable length fields from the structure.

Add a helper structure to the iterator data that adds the max args size to
the data storage in the iterator. Then simply copy the entire entry into
this storage (with size protection).

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/20250820195522.51d4a268@gandalf.local.home
Reported-by: Sasha Levin <sashal@kernel.org>
Tested-by: Sasha Levin <sashal@kernel.org>
Closes: https://lore.kernel.org/all/aJaxRVKverIjF4a6@lappy/
Fixes: ff5c9c576e75 ("ftrace: Add support for function argument to graph tracer")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2 months agoMerge tag 'drm-xe-fixes-2025-08-21-1' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Fri, 22 Aug 2025 21:22:43 +0000 (07:22 +1000)]
Merge tag 'drm-xe-fixes-2025-08-21-1' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

- xe_vm_create fixes (Piotr)
- Fix vm_bind_ioctl double free (Christoph)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/aKdxiw9hvO6mcyKs@intel.com
2 months agoMerge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg...
Linus Torvalds [Fri, 22 Aug 2025 21:24:48 +0000 (17:24 -0400)]
Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd

Pull iommufd fixes from Jason Gunthorpe:
 "Two very minor fixes:

   - Fix mismatched kvalloc()/kfree()

   - Spelling fixes in documentation"

* tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd:
  iommufd: Fix spelling errors in iommufd.rst
  iommufd: viommu: free memory allocated by kvcalloc() using kvfree()

2 months agoMerge tag 'drm-misc-fixes-2025-08-21' of https://gitlab.freedesktop.org/drm/misc...
Dave Airlie [Fri, 22 Aug 2025 20:45:22 +0000 (06:45 +1000)]
Merge tag 'drm-misc-fixes-2025-08-21' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

A bunch of fixes for 6.17:
  - analogix_dp: devm_drm_bridge_alloc() error handling fix
  - gaudi: Memory deallocation fix
  - gpuvm: Documentation warning fix
  - hibmc: Various misc fixes
  - nouveau: Memory leak fixes, typos
  - panic: u64 division handling on 32 bits architecture fix
  - rockchip: Kconfig fix, register caching fix
  - rust: memory layout and safety fixes
  - tests: Endianness fixes

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250821-economic-dandelion-rooster-c57fa9@houat
2 months agomips: lantiq: xway: sysctrl: rename the etop node
Aleksander Jan Bajkowski [Sun, 17 Aug 2025 12:49:07 +0000 (14:49 +0200)]
mips: lantiq: xway: sysctrl: rename the etop node

Bindig requires a node name matching ‘^ethernet@[0-9a-f]+$’. This patch
changes the clock name from “etop” to “ethernet”.

This fixes the following warning:
arch/mips/boot/dts/lantiq/danube_easy50712.dtb: etop@e180000 (lantiq,etop-xway): $nodename:0: 'etop@e180000' does not match '^ethernet@[0-9a-f]+$'
from schema $id: http://devicetree.org/schemas/net/lantiq,etop-xway.yaml#

Fixes: dac0bad93741 ("dt-bindings: net: lantiq,etop-xway: Document Lantiq Xway ETOP bindings")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Acked-by: Jakub Kicinski <kuba@kernel.org>
2 months agomips: dts: lantiq: danube: add missing burst length property
Aleksander Jan Bajkowski [Sun, 17 Aug 2025 12:49:06 +0000 (14:49 +0200)]
mips: dts: lantiq: danube: add missing burst length property

The upstream dts lacks the lantiq,{rx/tx}-burst-length property. Other
issues were also fixed:
arch/mips/boot/dts/lantiq/danube_easy50712.dtb: etop@e180000 (lantiq,etop-xway): 'interrupt-names' is a required property
from schema $id: http://devicetree.org/schemas/net/lantiq,etop-xway.yaml#
arch/mips/boot/dts/lantiq/danube_easy50712.dtb: etop@e180000 (lantiq,etop-xway): 'lantiq,tx-burst-length' is a required property
from schema $id: http://devicetree.org/schemas/net/lantiq,etop-xway.yaml#
arch/mips/boot/dts/lantiq/danube_easy50712.dtb: etop@e180000 (lantiq,etop-xway): 'lantiq,rx-burst-length' is a required property
from schema $id: http://devicetree.org/schemas/net/lantiq,etop-xway.yaml#

Fixes: 14d4e308e0aa ("net: lantiq: configure the burst length in ethernet drivers")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Acked-by: Jakub Kicinski <kuba@kernel.org>
2 months agoALSA: hda: intel-dsp-config: Select SOF driver on MTL Chromebooks
Brady Norander [Thu, 21 Aug 2025 01:47:30 +0000 (21:47 -0400)]
ALSA: hda: intel-dsp-config: Select SOF driver on MTL Chromebooks

The SOF driver is required for functional audio on MTL Chromebooks

Signed-off-by: Brady Norander <bradynorander@gmail.com>
Link: https://patch.msgid.link/20250821014730.8843-1-bradynorander@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2 months agoALSA: usb-audio: Add mute TLV for playback volumes on some devices
Cryolitia PukNgae [Fri, 22 Aug 2025 12:58:08 +0000 (20:58 +0800)]
ALSA: usb-audio: Add mute TLV for playback volumes on some devices

Applying the quirk of that, the lowest Playback mixer volume setting
mutes the audio output, on more devices.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/2514
Cc: <stable@vger.kernel.org>
Tested-by: Guoli An <anguoli@uniontech.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://patch.msgid.link/20250822-mixer-quirk-v1-1-b19252239c1c@uniontech.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>