<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/sound/synth, branch v4.4.26</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ALSA: synth: Fix conflicting OSS device registration on AWE32</title>
<updated>2015-10-05T14:55:09+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-10-05T14:55:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=225db5762dc1a35b26850477ffa06e5cd0097243'/>
<id>225db5762dc1a35b26850477ffa06e5cd0097243</id>
<content type='text'>
When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel
warnings like:
  WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80()
  sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0'

It's because both emux synth and opl3 drivers try to register their
OSS device object with the same static index number 0.  This hasn't
been a big problem until the recent rewrite of device management code
(that exposes sysfs at the same time), but it's been an obvious bug.

This patch works around it just by using a different index number of
emux synth object.  There can be a more elegant way to fix, but it's
enough for now, as this code won't be touched so often, in anyway.

Reported-and-tested-by: Michael Shell &lt;list1@michaelshell.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When OSS emulation is loaded on ISA SB AWE32 chip, we get now kernel
warnings like:
  WARNING: CPU: 0 PID: 2791 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x80()
  sysfs: cannot create duplicate filename '/devices/isa/sbawe.0/sound/card0/seq-oss-0-0'

It's because both emux synth and opl3 drivers try to register their
OSS device object with the same static index number 0.  This hasn't
been a big problem until the recent rewrite of device management code
(that exposes sysfs at the same time), but it's been an obvious bug.

This patch works around it just by using a different index number of
emux synth object.  There can be a more elegant way to fix, but it's
enough for now, as this code won't be touched so often, in anyway.

Reported-and-tested-by: Michael Shell &lt;list1@michaelshell.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: emux: Fix/cleanup old ifdef CONFIG_PROC_FS</title>
<updated>2015-05-29T05:58:11+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-05-29T05:58:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=52262b4a5d7c3d3549985a47d96fe7d661220162'/>
<id>52262b4a5d7c3d3549985a47d96fe7d661220162</id>
<content type='text'>
Build emux_proc.o and drop the unneeded ifdefs.
Replace the left CONFIG_PROC with the new CONFIG_SND_PROC_FS.

Along with this, fix the build of emux_oss.o in Makefile, too.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Build emux_proc.o and drop the unneeded ifdefs.
Replace the left CONFIG_PROC with the new CONFIG_SND_PROC_FS.

Along with this, fix the build of emux_oss.o in Makefile, too.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: emux: Fix mutex deadlock in OSS emulation</title>
<updated>2015-04-28T15:45:45+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-04-28T15:11:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1c94e65c668f44d2c69ae7e7fc268ab3268fba3e'/>
<id>1c94e65c668f44d2c69ae7e7fc268ab3268fba3e</id>
<content type='text'>
The OSS emulation in synth-emux helper has a potential AB/BA deadlock
at the simultaneous closing and opening:

  close -&gt;
    snd_seq_release() -&gt;
      sne_seq_free_client() -&gt;
        snd_seq_delete_all_ports(): takes client-&gt;ports_mutex -&gt;
	  port_delete() -&gt;
	    snd_emux_unuse(): takes emux-&gt;register_mutex

  open -&gt;
    snd_seq_oss_open() -&gt;
      snd_emux_open_seq_oss(): takes emux-&gt;register_mutex -&gt;
        snd_seq_event_port_attach() -&gt;
	  snd_seq_create_port(): takes client-&gt;ports_mutex

This patch addresses the deadlock by reducing the rance taking
emux-&gt;register_mutex in snd_emux_open_seq_oss().  The lock is needed
for the refcount handling, so move it locally.  The calls in
emux_seq.c are already with the mutex, thus they are replaced with the
version without mutex lock/unlock.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The OSS emulation in synth-emux helper has a potential AB/BA deadlock
at the simultaneous closing and opening:

  close -&gt;
    snd_seq_release() -&gt;
      sne_seq_free_client() -&gt;
        snd_seq_delete_all_ports(): takes client-&gt;ports_mutex -&gt;
	  port_delete() -&gt;
	    snd_emux_unuse(): takes emux-&gt;register_mutex

  open -&gt;
    snd_seq_oss_open() -&gt;
      snd_emux_open_seq_oss(): takes emux-&gt;register_mutex -&gt;
        snd_seq_event_port_attach() -&gt;
	  snd_seq_create_port(): takes client-&gt;ports_mutex

This patch addresses the deadlock by reducing the rance taking
emux-&gt;register_mutex in snd_emux_open_seq_oss().  The lock is needed
for the refcount handling, so move it locally.  The calls in
emux_seq.c are already with the mutex, thus they are replaced with the
version without mutex lock/unlock.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: emux: Fix mutex deadlock at unloading</title>
<updated>2015-04-27T12:50:39+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-04-27T12:50:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=07b0e5d49d227e3950cb13a3e8caf248ef2a310e'/>
<id>07b0e5d49d227e3950cb13a3e8caf248ef2a310e</id>
<content type='text'>
The emux-synth driver has a possible AB/BA mutex deadlock at unloading
the emu10k1 driver:

  snd_emux_free() -&gt;
    snd_emux_detach_seq(): mutex_lock(&amp;emu-&gt;register_mutex) -&gt;
      snd_seq_delete_kernel_client() -&gt;
        snd_seq_free_client(): mutex_lock(&amp;register_mutex)

  snd_seq_release() -&gt;
    snd_seq_free_client(): mutex_lock(&amp;register_mutex) -&gt;
      snd_seq_delete_all_ports() -&gt;
        snd_emux_unuse(): mutex_lock(&amp;emu-&gt;register_mutex)

Basically snd_emux_detach_seq() doesn't need a protection of
emu-&gt;register_mutex as it's already being unregistered.  So, we can
get rid of this for avoiding the deadlock.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The emux-synth driver has a possible AB/BA mutex deadlock at unloading
the emu10k1 driver:

  snd_emux_free() -&gt;
    snd_emux_detach_seq(): mutex_lock(&amp;emu-&gt;register_mutex) -&gt;
      snd_seq_delete_kernel_client() -&gt;
        snd_seq_free_client(): mutex_lock(&amp;register_mutex)

  snd_seq_release() -&gt;
    snd_seq_free_client(): mutex_lock(&amp;register_mutex) -&gt;
      snd_seq_delete_all_ports() -&gt;
        snd_emux_unuse(): mutex_lock(&amp;emu-&gt;register_mutex)

Basically snd_emux_detach_seq() doesn't need a protection of
emu-&gt;register_mutex as it's already being unregistered.  So, we can
get rid of this for avoiding the deadlock.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: Include linux/uaccess.h and linux/bitopts.h instead of asm/*</title>
<updated>2015-01-28T16:25:07+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-01-28T16:24:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=976412fbc9855176ea7e02602a601b46c4479fcc'/>
<id>976412fbc9855176ea7e02602a601b46c4479fcc</id>
<content type='text'>
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: emux: Use setup_timer() and mod_timer()</title>
<updated>2015-01-19T10:41:13+00:00</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-01-19T10:41:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=abd083526af3a8a1610e884c8e619925c3d663e6'/>
<id>abd083526af3a8a1610e884c8e619925c3d663e6</id>
<content type='text'>
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: emux: Delete an unnecessary check before the function call "snd_sf_free"</title>
<updated>2015-01-04T14:12:29+00:00</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2015-01-03T17:28:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b172e0aae6d14baf646a36052d03b301535f4ef5'/>
<id>b172e0aae6d14baf646a36052d03b301535f4ef5</id>
<content type='text'>
The snd_sf_free() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The snd_sf_free() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: synth: emux: soundfont.c: Cleaning up memory leak</title>
<updated>2014-06-01T12:33:09+00:00</updated>
<author>
<name>Rickard Strandqvist</name>
<email>rickard_strandqvist@spectrumdigital.se</email>
</author>
<published>2014-06-01T11:35:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=14577c25169beb8676577490bf2f0bd539d5e999'/>
<id>14577c25169beb8676577490bf2f0bd539d5e999</id>
<content type='text'>
There is a risk for memory leak in when something unexpected happens
and the function returns.

This was largely found by using a static code analysis program called cppcheck.

[fixed a typo of kfree() by tiwai]

Signed-off-by: Rickard Strandqvist &lt;rickard_strandqvist@spectrumdigital.se&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a risk for memory leak in when something unexpected happens
and the function returns.

This was largely found by using a static code analysis program called cppcheck.

[fixed a typo of kfree() by tiwai]

Signed-off-by: Rickard Strandqvist &lt;rickard_strandqvist@spectrumdigital.se&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed</title>
<updated>2011-10-31T23:31:22+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-09-22T13:34:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d81a6d71760c4d8323f1f9a506c64084caa09063'/>
<id>d81a6d71760c4d8323f1f9a506c64084caa09063</id>
<content type='text'>
These aren't modules, but they do make use of these macros, so
they will need export.h to get that definition.  Previously,
they got it via the implicit module.h inclusion.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These aren't modules, but they do make use of these macros, so
they will need export.h to get that definition.  Previously,
they got it via the implicit module.h inclusion.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sound: Add module.h to the previously silent sound users</title>
<updated>2011-10-31T23:31:21+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-07-15T16:38:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=da155d5b40587815a4397e1a69382fe2366d940b'/>
<id>da155d5b40587815a4397e1a69382fe2366d940b</id>
<content type='text'>
Lots of sound drivers were getting module.h via the implicit presence
of it in &lt;linux/device.h&gt; but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lots of sound drivers were getting module.h via the implicit presence
of it in &lt;linux/device.h&gt; but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
