<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/sound/control.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-08-09T12:25:24+00:00</updated>
<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>ASoC: Drop snd_soc_*_get_kcontrol_locked()</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:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9cacb32a0ba691c2859a20bd5e30b71cc592fad2'/>
<id>urn:sha1:9cacb32a0ba691c2859a20bd5e30b71cc592fad2</id>
<content type='text'>
The recent cleanup in ALSA control core made no difference between
snd_ctl_find_id_mixer() and snd_ctl_find_id_mixer_locked(), and the
latter is to be dropped.  The only user of the left API was ASoC, and
that's snd_soc_card_get_kcontrol_locked() and
snd_soc_component_get_kcontrol_locked().

This patch drops those functions and rewrites those users to call the
variant without locked instead.  The test of the API became
superfluous, hence dropped as well.

As all callers of snd_ctl_find_id_mixer_locked() are gone,
snd_ctl_find_id_mixer_locked() is finally dropped, too.

Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://patch.msgid.link/20240809104234.8488-4-tiwai@suse.de
</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: Annotate snd_kcontrol with __counted_by()</title>
<updated>2024-07-30T05:45:37+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2024-07-26T15:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e9652003bc39032c3ab79e607aa3d1913c7cf57'/>
<id>urn:sha1:4e9652003bc39032c3ab79e607aa3d1913c7cf57</id>
<content type='text'>
struct snd_kcontrol contains a flex array of snd_kcontrol_volatile
objects at its end, and the array size is stored in count field.
This can be annotated gracefully with __counted_by() for catching
possible array overflows.

One additional change is the order of the count field initialization;
The assignment of the count field is moved before assignment of vd[]
elements for avoiding false-positive warnings from compilers.

Link: https://patch.msgid.link/20240726152840.8629-1-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: Introduce snd_ctl_find_id_mixer_locked()</title>
<updated>2024-04-02T14:54:47+00:00</updated>
<author>
<name>Richard Fitzgerald</name>
<email>rf@opensource.cirrus.com</email>
</author>
<published>2024-04-01T10:02:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08ea486a61451189b190c7b89e406b889cf693fa'/>
<id>urn:sha1:08ea486a61451189b190c7b89e406b889cf693fa</id>
<content type='text'>
Adds wrapper function snd_ctl_find_id_mixer_locked(). This is
identical to snd_ctl_find_id_mixer() except that it can be called
from code that is already holding controls_rwsem.

Signed-off-by: Richard Fitzgerald &lt;rf@opensource.cirrus.com&gt;
Reviewed-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://msgid.link/r/20240401100210.61277-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ALSA: vmaster: Add snd_ctl_add_followers() helper</title>
<updated>2023-07-21T07:37:47+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2023-07-21T07:16:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ae07eb9bf23e1a52cdb28222a71eb014131018d8'/>
<id>urn:sha1:ae07eb9bf23e1a52cdb28222a71eb014131018d8</id>
<content type='text'>
Add a new helper to add multiple vmaster followers in a shot.  The
same function was open-coded in various places, and this helper
replaces them.

Link: https://lore.kernel.org/r/20230721071643.3631-2-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: Introduce snd_ctl_find_id_mixer()</title>
<updated>2023-07-21T07:10:38+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2023-07-20T08:20:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=68fa05d4a82b8f4ca6fa85be85833e35bd6ebef9'/>
<id>urn:sha1:68fa05d4a82b8f4ca6fa85be85833e35bd6ebef9</id>
<content type='text'>
A commonly seen pattern is to run snd_ctl_find_id() for a mixer
control element with a given string.  Let's provide a standard helper
for achieving that for simplifying the code.

Link: https://lore.kernel.org/r/20230720082108.31346-2-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: Introduce unlocked version for snd_ctl_find_*() helpers</title>
<updated>2023-07-20T08:03:00+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2023-07-18T14:13:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b1e055f67611daf098e27e8731386eeb5257bde3'/>
<id>urn:sha1:b1e055f67611daf098e27e8731386eeb5257bde3</id>
<content type='text'>
For reducing the unnecessary use of controls_rwsem in the drivers,
this patch adds a new variant for snd_ctl_find_*() helpers:
snd_ctl_find_id_locked() and snd_ctl_find_numid_locked() look for a
kctl element inside the card-&gt;controls_rwsem -- that is, doing the
very same as what snd_ctl_find_id() and snd_ctl_find_numid() did until
now.  snd_ctl_find_id() and snd_ctl_find_numid() remain same,
i.e. still unlocked version, but they will be switched to locked
version once after all callers are replaced.

The patch also replaces the calls of snd_ctl_find_id() and
snd_ctl_find_numid() in a few places; all of those are places where we
know that the functions are called properly with controls_rwsem held.
All others are without rwsem (although they should have been).

After this patch, we'll turn on the locking in snd_ctl_find_id() and
snd_ctl_find_numid() to be more race-free.

Link: https://lore.kernel.org/r/20230718141304.1032-10-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: Make snd_ctl_find_id() argument const</title>
<updated>2023-07-20T08:02:59+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2023-07-18T14:13:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6723670a483501497dc339ae37676525245a913a'/>
<id>urn:sha1:6723670a483501497dc339ae37676525245a913a</id>
<content type='text'>
The id object passed to snd_ctl_find_id() is only read, and we can
mark it with const gracefully.

Link: https://lore.kernel.org/r/20230718141304.1032-9-tiwai@suse.de
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: control: add snd_ctl_rename()</title>
<updated>2022-10-21T06:17:08+00:00</updated>
<author>
<name>Maciej S. Szmigiero</name>
<email>maciej.szmigiero@oracle.com</email>
</author>
<published>2022-10-20T20:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=966f015fe4329199cc49084ee2886cfb626b34d3'/>
<id>urn:sha1:966f015fe4329199cc49084ee2886cfb626b34d3</id>
<content type='text'>
Add a snd_ctl_rename() function that takes care of updating the control
hash entries for callers that already have the relevant struct snd_kcontrol
at hand and hold the control write lock (or simply haven't registered the
card yet).

Fixes: c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups")
Cc: stable@vger.kernel.org
Signed-off-by: Maciej S. Szmigiero &lt;maciej.szmigiero@oracle.com&gt;
Link: https://lore.kernel.org/r/4170b71117ea81357a4f7eb8410f7cde20836c70.1666296963.git.maciej.szmigiero@oracle.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
