<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/sound/core, branch v3.0.56</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.0.56</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v3.0.56'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2012-11-17T21:14:26+00:00</updated>
<entry>
<title>ALSA: Fix card refcount unbalance</title>
<updated>2012-11-17T21:14:26+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2012-11-08T13:36:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=aaf238baf31e14cb1c111815193c3a78770b1873'/>
<id>urn:sha1:aaf238baf31e14cb1c111815193c3a78770b1873</id>
<content type='text'>
commit 8bb4d9ce08b0a92ca174e41d92c180328f86173f upstream.

There are uncovered cases whether the card refcount introduced by the
commit a0830dbd isn't properly increased or decreased:
- OSS PCM and mixer success paths
- When lookup function gets NULL

This patch fixes these places.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=50251

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ALSA: Avoid endless sleep after disconnect</title>
<updated>2012-11-17T21:14:22+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2012-11-07T11:44:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8a7173c58c8a1e25d7b2d572f045da837bb373bf'/>
<id>urn:sha1:8a7173c58c8a1e25d7b2d572f045da837bb373bf</id>
<content type='text'>
commit 0914f7961babbf28aaa2f19b453951fb4841c03f upstream.

When disconnect callback is called, each component should wake up
sleepers and check card-&gt;shutdown flag for avoiding the endless sleep
blocking the proper resource release.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ALSA: Add a reference counter to card instance</title>
<updated>2012-11-17T21:14:22+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2012-11-07T11:44:12+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=40edba667959559aa4385a5ec047420fcfeb5f03'/>
<id>urn:sha1:40edba667959559aa4385a5ec047420fcfeb5f03</id>
<content type='text'>
commit a0830dbd4e42b38aefdf3fb61ba5019a1a99ea85 upstream.

For more strict protection for wild disconnections, a refcount is
introduced to the card instance, and let it up/down when an object is
referred via snd_lookup_*() in the open ops.

The free-after-last-close check is also changed to check this refcount
instead of the empty list, too.

Reported-by: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ALSA: PCM: Fix some races at disconnection</title>
<updated>2012-11-17T21:14:22+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2012-11-07T11:39:51+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=61bc2855cf2e28f7ef3928c04453daa07dfffd9b'/>
<id>urn:sha1:61bc2855cf2e28f7ef3928c04453daa07dfffd9b</id>
<content type='text'>
commit 9b0573c07f278e9888c352aa9724035c75784ea0 upstream.

Fix races at PCM disconnection:
- while a PCM device is being opened or closed
- while the PCM state is being changed without lock in prepare,
  hw_params, hw_free ops

Reported-by: Matthieu CASTET &lt;matthieu.castet@parrot.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ALSA: pcm - fix race condition in wait_for_avail()</title>
<updated>2011-10-03T18:40:31+00:00</updated>
<author>
<name>Arjan van de Ven</name>
<email>arjan@infradead.org</email>
</author>
<published>2011-09-15T06:49:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3345c36f951a36962493b1f59f23e47b5a94d8d2'/>
<id>urn:sha1:3345c36f951a36962493b1f59f23e47b5a94d8d2</id>
<content type='text'>
commit 763437a9e7737535b2fc72175ad4974048769be6 upstream.

wait_for_avail() in pcm_lib.c has a race in it (observed in practice by an
Intel validation group).

The function is supposed to return once space in the buffer has become
available, or if some timeout happens.  The entity that creates space (irq
handler of sound driver and some such) will do a wake up on a waitqueue
that this function registers for.

However there are two races in the existing code

1) If space became available between the caller noticing there was no
   space and this function actually sleeping, the wakeup is missed and the
   timeout condition will happen instead

2) If a wakeup happened but not sufficient space became available, the
   code will loop again and wait for more space.  However, if the second
   wake comes in prior to hitting the schedule_timeout_interruptible(), it
   will be missed, and potentially you'll wait out until the timeout
   happens.

The fix consists of using more careful setting of the current state (so
that if a wakeup happens in the main loop window, the schedule_timeout()
falls through) and by checking for available space prior to going into the
schedule_timeout() loop, but after being on the waitqueue and having the
state set to interruptible.

[tiwai: the following changes have been added to Arjan's original patch:
 - merged akpm's fix for waitqueue adding order into a single patch
 - reduction of duplicated code of avail check
]

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>ALSA: timer - Fix Oops at closing slave timer</title>
<updated>2011-08-16T01:31:36+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2011-08-08T10:24:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9ef4ce3c5f9f8960ef347ad85a90ccb9e11fb482'/>
<id>urn:sha1:9ef4ce3c5f9f8960ef347ad85a90ccb9e11fb482</id>
<content type='text'>
commit 0584ffa548b6e59aceb027112f23a55f0133400e upstream.

A slave-timer instance has no timer reference, and this results in
NULL-dereference at stopping the timer, typically called at closing
the device.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=40682

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>ALSA: sound/core/pcm_compat.c: adjust array index</title>
<updated>2011-08-05T04:58:42+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2011-07-28T12:46:05+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f8c62dc268a9f499b86c051ddd3bacf10d70e347'/>
<id>urn:sha1:f8c62dc268a9f499b86c051ddd3bacf10d70e347</id>
<content type='text'>
commit ca9380fd68514c7bc952282c1b4fc70607e9fe43 upstream.

Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 &lt; e2; e1++) { &lt;...
  ar[
- e2
+ e1
  ]
  ...&gt; }
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>ALSA: Use %pV for snd_printk()</title>
<updated>2011-06-10T13:35:20+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2011-06-10T13:32:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=890ee02ac12c02c4712b6d7dd062ff4d6d37691c'/>
<id>urn:sha1:890ee02ac12c02c4712b6d7dd062ff4d6d37691c</id>
<content type='text'>
Clean up snd_printk() helper using the %pV prefix for recursive printks.
This also automagically fixes an Oops with RO/NX-enabled modules.

Tested-by: Maarten Lankhorst &lt;m.b.lankhorst@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: core: remove unused variables.</title>
<updated>2011-05-26T06:19:04+00:00</updated>
<author>
<name>Luca Tettamanti</name>
<email>kronos.it@gmail.com</email>
</author>
<published>2011-05-25T20:43:27+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=78fa2c4d2465d014e67d3e12d948425856587251'/>
<id>urn:sha1:78fa2c4d2465d014e67d3e12d948425856587251</id>
<content type='text'>
Drop a few variables that are never read.

Signed-off-by: Luca Tettamanti &lt;kronos.it@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>ALSA: PCM - Don't check DMA time-out too shortly</title>
<updated>2011-05-26T06:09:38+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2011-05-26T06:09:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f2b3614cefb61ee6046a0aaee503ee37f227d310'/>
<id>urn:sha1:f2b3614cefb61ee6046a0aaee503ee37f227d310</id>
<content type='text'>
When the PCM period size is set larger than 10 seconds, currently the
PCM core may abort the operation with DMA-error due to the fixed timeout
for 10 seconds.  A similar problem is seen in the drain operation that
has a fixed timeout of 10 seconds, too.

This patch fixes the timeout length depending on the period size and
rate, also including the consideration of no_period_wakeup flag.

Reported-by: Raymond Yau &lt;superquad.vortex2@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
</feed>
