Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 652165

Summary: ALSA: fix sysfs related issues (modules cannot be reloaded) and mutex problem in OSS mixer emulation
Product: Red Hat Enterprise Linux 5 Reporter: Jaroslav Kysela <jkysela>
Component: kernelAssignee: Jaroslav Kysela <jkysela>
Status: CLOSED ERRATA QA Contact: desktop-bugs <desktop-bugs>
Severity: high Docs Contact:
Priority: low    
Version: 5.6CC: cmeadors, vbenes
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 22:00:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for issues described above none

Description Jaroslav Kysela 2010-11-11 08:27:16 UTC
Description of problem:

In current RHEL 5.6 kernel, the ALSA device nodes in sysfs are not destroyed correctly when the sound modules are unloaded. It prevents sound module reloading (sysfs reports EEXIST error when new ALSA device node is created).

Also the OSS mixer emulation contains mutex bugs so all audio applications using mixer API can be blocked until system reboot.

Comment 2 Jaroslav Kysela 2010-11-11 08:46:18 UTC
Created attachment 459688 [details]
Patch for issues described above

Comment 3 RHEL Program Management 2010-11-11 08:59:21 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 7 Jarod Wilson 2010-12-07 19:16:48 UTC
in kernel-2.6.18-236.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 9 Vladimir Benes 2010-12-14 12:05:26 UTC
Hi,
after execution of 
awk '/^snd/||/^sound/&&($3==0){system("rmmod " $1)}' /proc/modules /proc/modules /proc/modules

I can see this error:

WARNING: at fs/proc/generic.c:734 remove_proc_entry()

Call Trace:
 [<ffffffff8010ae33>] remove_proc_entry+0xd7/0x13e
 [<ffffffff8827ebaa>] :snd:snd_info_done+0x54/0x58
 [<ffffffff8827eb09>] :snd:alsa_sound_exit+0xe/0x3b
 [<ffffffff800a8559>] sys_delete_module+0x196/0x1c5
 [<ffffffff8005d28d>] tracesys+0xd5/0xe0

however, the device can be enabled again so it looks quite bogus. Any idea why is this error shown while removing snd_hda_intel (and other sound modules)  via above mentioned command?

Is there any reproducer for testing the other bug (stalled mutex issues)?

Thanks in advance,
Vladimir

Comment 10 Jaroslav Kysela 2010-12-16 15:54:38 UTC
This warning is caused by removing of the 'snd.ko' (the single snd_hda_intel.ko can be removed and inserted without warning). Unfortunately, I don't see the real culprit. The backtrace shows the bug in:

        if (S_ISLNK(de->mode) && de->data)
                kfree(de->data);

.. but the snd_proc_root should not be marked as link (it is real directory). I hope that it's not a memory corruption. Anyway, it does not seem like a major issue - it's very rare that customers will replace all sound modules. Usually, only the front modules like snd-hda-intel are reloaded.

The stalled mutex issues can be reproduced when the OSS mixer controls are reassigned to another ALSA mixer control:

echo "MASTER \"Master Playback Volume\" 0" > /proc/asound/card0/oss_mixer
echo "MASTER \"Front Playback Volume\" 0" > /proc/asound/card0/oss_mixer

The list of available ALSA control names can be obtained using 'amixer contents'. The last parameter is control index value.

Just open/close an OSS mixer application and apply the changes to procfs simultaneously.

Comment 12 Vladimir Benes 2010-12-21 13:48:53 UTC
working fine.. created bug 664726 for the above mentioned trace
-> VERIFIED

Comment 14 errata-xmlrpc 2011-01-13 22:00:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0017.html