[alsa-devel] unload Audio drivers while playback stream is active case kernel crash

Takashi Iwai tiwai at suse.de
Thu Jan 15 07:21:18 CET 2015


At Wed, 14 Jan 2015 16:34:15 +0000,
Mark Brown wrote:
> 
> On Wed, Jan 14, 2015 at 02:01:33PM +0100, Takashi Iwai wrote:
> > Mark Brown wrote:
> 
> > > > Above all, disallowing the module unload while using is the common
> > > > behavior of any other drivers.  Why do we have to be a rebel against
> > > > all civil manner? :)
> 
> > > That's not true for everything
> 
> > Hmm, which driver does behave so intentionally?  I'm interested in the
> > supposed reason behind it.
> 
> Relatively few of the subsystems in drivers have references to
> module_get().

Time flys...  At the time of Linux 2.2 kernels, it was fairly common
to run a regular auto-cleanup of unused modules via cron running
"rmmod -a". Thus, each driver was mandated to deal with the module
refcount while used, or set it to -1 to avoid the auto-unload
permanently (like ipv6).

> > > and for ASoC I'd tend to assume that the
> > > user knows what they're doing and has a good reason for it; it's
> > > certainly something that can be helpful in development.
> 
> > The module unload is never considered to be equivalent with hot
> > unplug  It's more than that.
> 
> I'm not sure that's the case from a user perspective.

Unloading a module means to remove the functionality.  Unbinding is to
remove a device aka hotunplug.  Conceptually totally different.


Takashi


More information about the Alsa-devel mailing list