Commit a678cdee authored by Wu Fengguang's avatar Wu Fengguang Committed by Takashi Iwai

ALSA: hda: take cmd_mutex in probe_codec()

Now that each codec will have its own module, it is possible
for the user to load one codec while another one is running.

So cmd_mutex would be a safe addition to probe_codec().
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent deadff16
...@@ -1275,10 +1275,12 @@ static int probe_codec(struct azx *chip, int addr) ...@@ -1275,10 +1275,12 @@ static int probe_codec(struct azx *chip, int addr)
(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID; (AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
unsigned int res; unsigned int res;
mutex_lock(&chip->bus->cmd_mutex);
chip->probing = 1; chip->probing = 1;
azx_send_cmd(chip->bus, cmd); azx_send_cmd(chip->bus, cmd);
res = azx_get_response(chip->bus, addr); res = azx_get_response(chip->bus, addr);
chip->probing = 0; chip->probing = 0;
mutex_unlock(&chip->bus->cmd_mutex);
if (res == -1) if (res == -1)
return -EIO; return -EIO;
snd_printdd(SFX "codec #%d probed OK\n", addr); snd_printdd(SFX "codec #%d probed OK\n", addr);
......
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