Bug 12321

Summary: System hangs when unloading alsa modules
Product: Drivers Reporter: François Valenduc (francoisvalenduc)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: CLOSED INVALID    
Severity: normal CC: giovanni.pellerano, kernel, rjw, stefanr
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.28-git1 Subsystem:
Regression: Yes Bisected commit-id:

Description François Valenduc 2008-12-29 06:07:09 UTC
Latest working kernel version: 2.6.28
Earliest failing kernel version: 2.6.28-git1
Distribution: Gentoo
Hardware Environment: Packard Bell Easynote MB86, Intel Corporation 82801H (ICH8 Family) HD Audio Controller
Software Environment: Gentoo
Problem Description:

When I shut down my computer, the process hangs at "unloading alsa modules", when alsasound is stopped. I have noticed that this hang is due to the fact that this script tries to unload snd-hda-codec-conexant when snd-hda-intel is not unloaded. Since this module uses snd-hda-codec-conexant, it can't be unloaded.
Is there a way to force the order in which the modules are unloaded ? All alsa modules can be unloaded if the correct order is respected (in particular if snd-hda-intel is unloaded before snd-hda-codec-conexant)

Steps to reproduce: run /etc/init.d/alsasound stop
Comment 1 Takashi Iwai 2009-01-01 01:57:25 UTC
This is actually a problem of alsasound init script on your system.  It tries to unload the module that is being used without checking the usage count.  It means that script might be broken for the other driver like snd-aoa, too.

The unloading works if it first unload snd-hda-intel, then others.

BTW, you don't need to unload the modules at shutdown at all...  For example, SUSE init script has some tricks to avoid that.
Comment 2 David McCloskey 2009-01-12 11:50:43 UTC
You can set UNLOAD_ON_STOP to "no" in /etc/conf.d/alsasound I'm guessing to avoid this bug.
Comment 3 François Valenduc 2009-01-12 13:09:27 UTC
That's indeed what I have done to avoid the problem.
Comment 4 Giovanni Pellerano 2009-01-19 03:45:14 UTC
*** Bug 12448 has been marked as a duplicate of this bug. ***
Comment 5 Stefan Richter 2009-02-19 13:04:08 UTC
entry for Gentoo init script bug:
https://bugs.gentoo.org/show_bug.cgi?id=253535
Comment 6 Stefan Richter 2009-04-08 06:25:12 UTC
*** Bug 13018 has been marked as a duplicate of this bug. ***