diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-15 14:06:25 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-18 20:25:12 +0200 |
commit | 68ab61084de3220e2fb0a698c890ba91decddc85 (patch) | |
tree | 3a39c406c22fc8a5646c27e6a27994041ef62bc0 /sound/core/seq/seq.c | |
parent | 54841a06c54eb55918948c12ab9b5f02cacb6ab3 (diff) | |
download | linux-68ab61084de3220e2fb0a698c890ba91decddc85.tar.bz2 |
ALSA: seq: bind seq driver automatically
Currently the sequencer module binding is performed independently from
the card module itself. The reason behind it is to keep the sequencer
stuff optional and allow the system running without it (e.g. for using
PCM or rawmidi only). This works in most cases, but a remaining
problem is that the binding isn't done automatically when a new driver
module is probed. Typically this becomes visible when a hotplug
driver like usb audio is used.
This patch tries to address this and other potential issues. First,
the seq-binder (seq_device.c) tries to load a missing driver module at
creating a new device object. This is done asynchronously in a workq
for avoiding the deadlock (modprobe call in module init path).
This action, however, should be enabled only when the sequencer stuff
was already initialized, i.e. snd-seq module was already loaded. For
that, a new function, snd_seq_autoload_init() is introduced here; this
clears the blocking of autoloading, and also tries to load all pending
driver modules.
Reported-by: Adam Goode <agoode@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq.c')
-rw-r--r-- | sound/core/seq/seq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c index 712110561082..bebdd2e920ca 100644 --- a/sound/core/seq/seq.c +++ b/sound/core/seq/seq.c @@ -110,6 +110,7 @@ static int __init alsa_seq_init(void) if ((err = snd_seq_system_client_init()) < 0) goto error; + snd_seq_autoload_init(); error: snd_seq_autoload_unlock(); return err; @@ -131,6 +132,8 @@ static void __exit alsa_seq_exit(void) /* release event memory */ snd_sequencer_memory_done(); + + snd_seq_autoload_exit(); } module_init(alsa_seq_init) |