aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorWu Fengguang <wfg@linux.intel.com>2009-01-09 03:45:24 -0500
committerTakashi Iwai <tiwai@suse.de>2009-01-09 03:58:47 -0500
commit5a9e02e94989323c2a7102e2fc80ee9102b19fa0 (patch)
treee6f5d2ecd8928a5b0256f4c9f8f7c7963d1f8e36 /sound/pci/hda/patch_realtek.c
parent57d139278e6c246d78f71e4bf0e0d15bb0390646 (diff)
ALSA: hda - create hda_codec.control_mutex for kcontrol->private_value
Fix the following lockdep warning by not reusing the hda_codec.spdif_mutex. ALSA sound/pci/hda/hda_codec.c:882: hda_codec_cleanup_stream: NID=0x2 ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.28-next-20090102 #33 ------------------------------------------------------- mplayer/3151 is trying to acquire lock: (&pcm->open_mutex){--..}, at: [<ffffffffa004ced3>] snd_pcm_release+0x43/0xd0 [snd_pcm] but task is already holding lock: (&mm->mmap_sem){----}, at: [<ffffffff810c0252>] sys_munmap+0x42/0x80 which lock already depends on the new lock. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e8ec74173525..aa86a1584506 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1502,11 +1502,11 @@ static int alc_cap_vol_info(struct snd_kcontrol *kcontrol,
1502 struct alc_spec *spec = codec->spec; 1502 struct alc_spec *spec = codec->spec;
1503 int err; 1503 int err;
1504 1504
1505 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1505 mutex_lock(&codec->control_mutex);
1506 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, 1506 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
1507 HDA_INPUT); 1507 HDA_INPUT);
1508 err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo); 1508 err = snd_hda_mixer_amp_volume_info(kcontrol, uinfo);
1509 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1509 mutex_unlock(&codec->control_mutex);
1510 return err; 1510 return err;
1511} 1511}
1512 1512
@@ -1517,11 +1517,11 @@ static int alc_cap_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
1517 struct alc_spec *spec = codec->spec; 1517 struct alc_spec *spec = codec->spec;
1518 int err; 1518 int err;
1519 1519
1520 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1520 mutex_lock(&codec->control_mutex);
1521 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0, 1521 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[0], 3, 0,
1522 HDA_INPUT); 1522 HDA_INPUT);
1523 err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv); 1523 err = snd_hda_mixer_amp_tlv(kcontrol, op_flag, size, tlv);
1524 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1524 mutex_unlock(&codec->control_mutex);
1525 return err; 1525 return err;
1526} 1526}
1527 1527
@@ -1537,11 +1537,11 @@ static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
1537 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1537 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
1538 int err; 1538 int err;
1539 1539
1540 mutex_lock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1540 mutex_lock(&codec->control_mutex);
1541 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], 1541 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx],
1542 3, 0, HDA_INPUT); 1542 3, 0, HDA_INPUT);
1543 err = func(kcontrol, ucontrol); 1543 err = func(kcontrol, ucontrol);
1544 mutex_unlock(&codec->spdif_mutex); /* reuse spdif_mutex */ 1544 mutex_unlock(&codec->control_mutex);
1545 return err; 1545 return err;
1546} 1546}
1547 1547