<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/sound/core.h, branch v7.2-rc1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-06-11T07:34:09+00:00</updated>
<entry>
<title>ALSA: core: Use the new helper for the power refcount</title>
<updated>2026-06-11T07:34:09+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2026-06-10T15:45:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2fa8d8b6c18b3443b65d42ced33bc9e36683e886'/>
<id>urn:sha1:2fa8d8b6c18b3443b65d42ced33bc9e36683e886</id>
<content type='text'>
Replace the open code for managing the power refcount in the snd_card
object with the new helper functions.
Only a code cleanup, no functional changes.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20260610154538.51076-3-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: Add simple refcount helper functions</title>
<updated>2026-06-11T07:34:09+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2026-06-10T15:45:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dcca9b6064c33c84fbeb9f09814178a206321249'/>
<id>urn:sha1:dcca9b6064c33c84fbeb9f09814178a206321249</id>
<content type='text'>
There are many open-code to manage the same pattern for refcount +
wakeup sync at closing.  Let's provide the common helper functions to
replace the open-code.

- The recount is kept in struct snd_refcount, where it's initialized
by snd_refcount_init().
- The user can simply reference or unreference via snd_refcount_get()
and snd_refcount_put() functions
- The user can wait for the all usages gone by snd_refcount_sync()

Note that here we use atomic_t instead of refcount_t since the current
users allow reusing the refcount after sync again.  The design of
refcount_t prevents exactly this behavior, so it doesn't fit.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20260610154538.51076-2-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: core: Add scoped cleanup helper for card references</title>
<updated>2026-06-04T08:20:41+00:00</updated>
<author>
<name>Cássio Gabriel</name>
<email>cassiogabrielcontato@gmail.com</email>
</author>
<published>2026-06-04T04:48:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c6c6f0aec6fb4cbcc547bb265315fd76f18be731'/>
<id>urn:sha1:c6c6f0aec6fb4cbcc547bb265315fd76f18be731</id>
<content type='text'>
Several ALSA paths acquire temporary card references with snd_card_ref()
and release them manually with snd_card_unref(). control_led.c already
defines a local cleanup helper for this pattern, while other core paths
still open-code the release.

Move the helper to the common ALSA core header and use it in control-layer
card-reference paths. This makes the ownership rule explicit and avoids
future missing-unref mistakes when adding early exits.

No functional change is intended.

Signed-off-by: Cássio Gabriel &lt;cassiogabrielcontato@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20260604-alsa-scoped-cleanups-v1-2-10c43152a728@gmail.com
</content>
</entry>
<entry>
<title>ALSA: core: Use flexible array for card private data</title>
<updated>2026-06-01T09:29:02+00:00</updated>
<author>
<name>Cássio Gabriel</name>
<email>cassiogabrielcontato@gmail.com</email>
</author>
<published>2026-06-01T01:23:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e9c82f767f0f46ef90eeefccc0a8006cc86aff40'/>
<id>urn:sha1:e9c82f767f0f46ef90eeefccc0a8006cc86aff40</id>
<content type='text'>
snd_card_new() and snd_devm_card_new() allocate struct snd_card
together with optional driver-private storage. The storage is currently
described only by open-coded sizeof(*card) + extra_size arithmetic, and
snd_card_init() reaches it by manually adding sizeof(struct snd_card) to
the card pointer.

Make the trailing storage explicit with a flexible array member. Use
kzalloc_flex() for the regular allocation path and struct_size() for the
devres allocation size. This documents the layout and avoids open-coded
variable-size object arithmetic.

Align the flexible array to unsigned long long so the driver-private area
does not become less aligned than the old sizeof(struct snd_card) tail
address on 32-bit ABIs.

Signed-off-by: Cássio Gabriel &lt;cassiogabrielcontato@gmail.com&gt;
Link: https://patch.msgid.link/20260531-alsa-card-private-flex-array-v2-1-e4ff67f5bd23@gmail.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: Verify put() result when in debug mode</title>
<updated>2026-02-28T08:32:39+00:00</updated>
<author>
<name>Cezary Rojewski</name>
<email>cezary.rojewski@intel.com</email>
</author>
<published>2026-02-24T20:56:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84446536f63d471ab16b2faa25eeab1df21ace0a'/>
<id>urn:sha1:84446536f63d471ab16b2faa25eeab1df21ace0a</id>
<content type='text'>
The put() operation is expected to return:
1) 0 on success if no changes were made
2) 1 on success if changes were made
3) error code otherwise

Currently 2) is usually ignored when writing control-operations. While
forcing compliance is not an option right now, make it easier for
developers to adhere to the expectations and notice problems by logging
them when CONFIG_SND_CTL_DEBUG is enabled.

Due to large size of struct snd_ctl_elem_value, 'value_buf' is provided
as a reusable buffer for kctl-&gt;put() verification. This prevents
exhausting the stack when verifying the operation.

&gt;From user perspective, patch introduces a new trace/events category
'snd_ctl' containing a single 'snd_ctl_put' event type. Log sample:

  amixer-1086    [003] .....    8.035939: snd_ctl_put: success: expected=0, actual=0 for ctl numid=1, iface=MIXER, name='Master Playback Volume', index=0, device=0, subdevice=0, card=0
  amixer-1087    [003] .....    8.938721: snd_ctl_put: success: expected=1, actual=1 for ctl numid=1, iface=MIXER, name='Master Playback Volume', index=0, device=0, subdevice=0, card=0
  amixer-1088    [003] .....    9.631470: snd_ctl_put: success: expected=1, actual=1 for ctl numid=1, iface=MIXER, name='Master Playback Volume', index=0, device=0, subdevice=0, card=0
  amixer-1089    [000] .....    9.636786: snd_ctl_put: fail: expected=1, actual=0 for ctl numid=5, iface=MIXER, name='Loopback Mute', index=0, device=0, subdevice=0, card=0

Signed-off-by: Cezary Rojewski &lt;cezary.rojewski@intel.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20260224205619.584795-1-cezary.rojewski@intel.com
</content>
</entry>
<entry>
<title>ALSA: core: Remove unused snd_device_get_state</title>
<updated>2025-05-05T10:36:29+00:00</updated>
<author>
<name>Dr. David Alan Gilbert</name>
<email>linux@treblig.org</email>
</author>
<published>2025-05-02T23:52:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=625a4681666adf626afc87a752974325f65a8c32'/>
<id>urn:sha1:625a4681666adf626afc87a752974325f65a8c32</id>
<content type='text'>
snd_device_get_state() last use was removed in 2022 by
commit 7e1afce5866e ("ALSA: usb-audio: Inform the delayed registration more
properly")

Remove it.

Signed-off-by: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20250502235219.1000429-5-linux@treblig.org
</content>
</entry>
<entry>
<title>Merge branch 'topic/control-lookup-rwlock' into for-next</title>
<updated>2024-08-09T12:25:24+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2024-08-09T12:25:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4004f3029e1f612903f03df497153c90a2752130'/>
<id>urn:sha1:4004f3029e1f612903f03df497153c90a2752130</id>
<content type='text'>
Pull control lookup optimization changes.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: Optimize locking for look-up</title>
<updated>2024-08-09T12:24:55+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2024-08-09T10:42:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=38ea4c3dc306edf6f4e483e8ad9cb8d33943afde'/>
<id>urn:sha1:38ea4c3dc306edf6f4e483e8ad9cb8d33943afde</id>
<content type='text'>
For a fast look-up of a control element via either numid or name
matching (enabled via CONFIG_SND_CTL_FAST_LOOKUP), a locking isn't
needed at all thanks to Xarray.  OTOH, the locking is still needed for
a slow linked-list traversal, and that's rather a rare case.

In this patch, we reduce the use of locking at snd_ctl_find_*() API
functions, and switch from controls_rwsem to controls_rwlock for
avoiding unnecessary lock inversions.  This also resulted in a nice
cleanup, as *_unlocked() version of snd_ctl_find_*() APIs can be
dropped.

snd_ctl_find_id_mixer_unlocked() is still left just as an alias of
snd_ctl_find_id_mixer(), since soc-card.c has a wrapper and there are
several users.  Once after converting there, we can remove it later.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20240809104234.8488-3-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: control: Rename ctl_files_rwlock to controls_rwlock</title>
<updated>2024-08-09T12:24:55+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2024-08-09T10:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f428cc9eac6e29d57579be4978ba210c344322ea'/>
<id>urn:sha1:f428cc9eac6e29d57579be4978ba210c344322ea</id>
<content type='text'>
We'll re-use the existing rwlock for the protection of control list
lookup, too, and now rename it to a more generic name.

This is a preliminary change, only the rename of the struct field
here, no functional changes.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20240809104234.8488-2-tiwai@suse.de
</content>
</entry>
<entry>
<title>ALSA: core: Drop snd_print stuff and co</title>
<updated>2024-08-08T05:49:47+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2024-08-07T13:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=504dc9f5e62e3beef2554c453576e84993053647'/>
<id>urn:sha1:504dc9f5e62e3beef2554c453576e84993053647</id>
<content type='text'>
Now that all users of snd_print*() are gone, let's drop the functions
completely.  This also makes CONFIG_SND_VERBOSE_PRINTK redundant, and
it's dropped, too.

Reviewed-by: Jaroslav Kysela &lt;perex@perex.cz&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20240807133452.9424-55-tiwai@suse.de
</content>
</entry>
</feed>
