Commit 8dda8fb7 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Fix auto-loading of sequencer modules

ALSA sequencer
Allow auto-loading of sequencer modules except for module init time
(which may cause blocking).
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ce32846a
...@@ -71,11 +71,14 @@ MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in ...@@ -71,11 +71,14 @@ MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in
* INIT PART * INIT PART
*/ */
int snd_seq_in_init;
static int __init alsa_seq_init(void) static int __init alsa_seq_init(void)
{ {
int err; int err;
snd_seq_in_init = 1;
if ((err = client_init_data()) < 0) if ((err = client_init_data()) < 0)
return err; return err;
...@@ -99,6 +102,7 @@ static int __init alsa_seq_init(void) ...@@ -99,6 +102,7 @@ static int __init alsa_seq_init(void)
if ((err = snd_seq_system_client_init()) < 0) if ((err = snd_seq_system_client_init()) < 0)
return err; return err;
snd_seq_in_init = 0;
return 0; return 0;
} }
......
...@@ -152,14 +152,16 @@ client_t *snd_seq_client_use_ptr(int clientid) ...@@ -152,14 +152,16 @@ client_t *snd_seq_client_use_ptr(int clientid)
} else if (clientid >= 64 && clientid < 128) { } else if (clientid >= 64 && clientid < 128) {
int card = (clientid - 64) / 8; int card = (clientid - 64) / 8;
if (card < snd_ecards_limit) { if (card < snd_ecards_limit) {
extern int snd_seq_in_init;
if (! card_requested[card]) { if (! card_requested[card]) {
card_requested[card] = 1; card_requested[card] = 1;
snd_request_card(card); snd_request_card(card);
} }
/* FIXME: may cause blocking when called from /* Calling request_module during module_init()
* module_init(), so disable this feature * may cause blocking.
*/ */
/* snd_seq_device_load_drivers(); */ if (! snd_seq_in_init)
snd_seq_device_load_drivers();
} }
} }
spin_lock_irqsave(&clients_lock, flags); spin_lock_irqsave(&clients_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment