<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/sound/virtio, branch v6.6.131</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.131</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.131'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-05-02T05:50:54+00:00</updated>
<entry>
<title>sound/virtio: Fix cancel_sync warnings on uninitialized work_structs</title>
<updated>2025-05-02T05:50:54+00:00</updated>
<author>
<name>John Stultz</name>
<email>jstultz@google.com</email>
</author>
<published>2025-01-16T19:40:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5be9407b41eae20eef9140f5cfbfcbc3d01aaf45'/>
<id>urn:sha1:5be9407b41eae20eef9140f5cfbfcbc3d01aaf45</id>
<content type='text'>
[ Upstream commit 3c7df2e27346eb40a0e86230db1ccab195c97cfe ]

Betty reported hitting the following warning:

[    8.709131][  T221] WARNING: CPU: 2 PID: 221 at kernel/workqueue.c:4182
...
[    8.713282][  T221] Call trace:
[    8.713365][  T221]  __flush_work+0x8d0/0x914
[    8.713468][  T221]  __cancel_work_sync+0xac/0xfc
[    8.713570][  T221]  cancel_work_sync+0x24/0x34
[    8.713667][  T221]  virtsnd_remove+0xa8/0xf8 [virtio_snd ab15f34d0dd772f6d11327e08a81d46dc9c36276]
[    8.713868][  T221]  virtsnd_probe+0x48c/0x664 [virtio_snd ab15f34d0dd772f6d11327e08a81d46dc9c36276]
[    8.714035][  T221]  virtio_dev_probe+0x28c/0x390
[    8.714139][  T221]  really_probe+0x1bc/0x4c8
...

It seems we're hitting the error path in virtsnd_probe(), which
triggers a virtsnd_remove() which iterates over the substreams
calling cancel_work_sync() on the elapsed_period work_struct.

Looking at the code, from earlier in:
virtsnd_probe()-&gt;virtsnd_build_devs()-&gt;virtsnd_pcm_parse_cfg()

We set snd-&gt;nsubstreams, allocate the snd-&gt;substreams, and if
we then hit an error on the info allocation or something in
virtsnd_ctl_query_info() fails, we will exit without having
initialized the elapsed_period work_struct.

When that error path unwinds we then call virtsnd_remove()
which as long as the substreams array is allocated, will iterate
through calling cancel_work_sync() on the uninitialized work
struct hitting this warning.

Takashi Iwai suggested this fix, which initializes the substreams
structure right after allocation, so that if we hit the error
paths we avoid trying to cleanup uninitialized data.

Note: I have not yet managed to reproduce the issue myself, so
this patch has had limited testing.

Feedback or thoughts would be appreciated!

Cc: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Cc: Jaroslav Kysela &lt;perex@perex.cz&gt;
Cc: Takashi Iwai &lt;tiwai@suse.com&gt;
Cc: virtualization@lists.linux.dev
Cc: linux-sound@vger.kernel.org
Cc: kernel-team@android.com
Reported-by: Betty Zhou &lt;bettyzhou@google.com&gt;
Suggested-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: John Stultz &lt;jstultz@google.com&gt;
Message-Id: &lt;20250116194114.3375616-1-jstultz@google.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>virtio: wrap config-&gt;reset calls</title>
<updated>2022-01-14T23:50:52+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2021-10-13T10:55:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d9679d0013a66849f23057978f92e76b255c50aa'/>
<id>urn:sha1:d9679d0013a66849f23057978f92e76b255c50aa</id>
<content type='text'>
This will enable cleanups down the road.
The idea is to disable cbs, then add "flush_queued_cbs" callback
as a parameter, this way drivers can flush any work
queued after callbacks have been disabled.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Link: https://lore.kernel.org/r/20211013105226.20225-1-mst@redhat.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: Replace zero-length array with flexible-array member</title>
<updated>2021-09-30T11:47:57+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2021-09-29T19:15:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b38269ecd2b2bdd63780b3f7d43c39f924ac515a'/>
<id>urn:sha1:b38269ecd2b2bdd63780b3f7d43c39f924ac515a</id>
<content type='text'>
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].

Also, make use of the struct_size() helper in kzalloc().

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Link: https://lore.kernel.org/r/20210929191504.GA337268@embeddedor
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: fix kernel-doc</title>
<updated>2021-04-27T06:39:39+00:00</updated>
<author>
<name>Pierre-Louis Bossart</name>
<email>pierre-louis.bossart@linux.intel.com</email>
</author>
<published>2021-04-26T21:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e861431303d23428bf26e8496252d7bee260a956'/>
<id>urn:sha1:e861431303d23428bf26e8496252d7bee260a956</id>
<content type='text'>
make W=1 warning:

sound/virtio/virtio_ctl_msg.c:70: warning: expecting prototype for
virtsnd_ctl_msg_request(). Prototype was for
virtsnd_ctl_msg_response() instead

Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20210426213902.234711-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: use module_virtio_driver() to simplify the code</title>
<updated>2021-04-12T10:15:34+00:00</updated>
<author>
<name>Chen Huang</name>
<email>chenhuang5@huawei.com</email>
</author>
<published>2021-04-08T12:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d91cbe83d319e8923d36f974d8c9b1e1b56fea62'/>
<id>urn:sha1:d91cbe83d319e8923d36f974d8c9b1e1b56fea62</id>
<content type='text'>
module_virtio_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Chen Huang &lt;chenhuang5@huawei.com&gt;
Reviewed-by: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Link: https://lore.kernel.org/r/20210408125429.1158703-1-chenhuang5@huawei.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: introduce device suspend/resume support</title>
<updated>2021-03-07T08:08:39+00:00</updated>
<author>
<name>Anton Yakovlev</name>
<email>anton.yakovlev@opensynergy.com</email>
</author>
<published>2021-03-02T16:47:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=575483e90a3292c2afceb7161732046e411d6fdd'/>
<id>urn:sha1:575483e90a3292c2afceb7161732046e411d6fdd</id>
<content type='text'>
All running PCM substreams are stopped on device suspend and restarted
on device resume.

Signed-off-by: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Link: https://lore.kernel.org/r/20210302164709.3142702-10-anton.yakovlev@opensynergy.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: introduce PCM channel map support</title>
<updated>2021-03-07T08:08:20+00:00</updated>
<author>
<name>Anton Yakovlev</name>
<email>anton.yakovlev@opensynergy.com</email>
</author>
<published>2021-03-02T16:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19325fedf245ca932c58a629d3888a9a393534ab'/>
<id>urn:sha1:19325fedf245ca932c58a629d3888a9a393534ab</id>
<content type='text'>
Enumerate all available PCM channel maps and create ALSA controls.

Signed-off-by: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Link: https://lore.kernel.org/r/20210302164709.3142702-9-anton.yakovlev@opensynergy.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: introduce jack support</title>
<updated>2021-03-07T08:08:11+00:00</updated>
<author>
<name>Anton Yakovlev</name>
<email>anton.yakovlev@opensynergy.com</email>
</author>
<published>2021-03-02T16:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ca61a41f389c80db091db9d4ad5a651e2b4c9f70'/>
<id>urn:sha1:ca61a41f389c80db091db9d4ad5a651e2b4c9f70</id>
<content type='text'>
Enumerate all available jacks and create ALSA controls.

At the moment jacks have a simple implementation and can only be used
to receive notifications about a plugged in/out device.

Signed-off-by: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Link: https://lore.kernel.org/r/20210302164709.3142702-8-anton.yakovlev@opensynergy.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: PCM substream operators</title>
<updated>2021-03-07T08:08:03+00:00</updated>
<author>
<name>Anton Yakovlev</name>
<email>anton.yakovlev@opensynergy.com</email>
</author>
<published>2021-03-02T16:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=da76e9f3e43a7195c69d370ee514cccae6517c76'/>
<id>urn:sha1:da76e9f3e43a7195c69d370ee514cccae6517c76</id>
<content type='text'>
Introduce the operators required for the operation of substreams.

Signed-off-by: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Link: https://lore.kernel.org/r/20210302164709.3142702-7-anton.yakovlev@opensynergy.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: virtio: handling control and I/O messages for the PCM device</title>
<updated>2021-03-07T08:07:44+00:00</updated>
<author>
<name>Anton Yakovlev</name>
<email>anton.yakovlev@opensynergy.com</email>
</author>
<published>2021-03-02T16:47:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f40a28679e0b7cb3a9cc6627a8dbb40961990f0a'/>
<id>urn:sha1:f40a28679e0b7cb3a9cc6627a8dbb40961990f0a</id>
<content type='text'>
The driver implements a message-based transport for I/O substream
operations. Before the start of the substream, the hardware buffer is
sliced into I/O messages, the number of which is equal to the current
number of periods. The size of each message is equal to the current
size of one period.

I/O messages are organized in an ordered queue. The completion of the
I/O message indicates an elapsed period (the only exception is the end
of the stream for the capture substream). Upon completion, the message
is automatically re-added to the end of the queue.

Signed-off-by: Anton Yakovlev &lt;anton.yakovlev@opensynergy.com&gt;
Link: https://lore.kernel.org/r/20210302164709.3142702-6-anton.yakovlev@opensynergy.com
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
