Message ID | 543C97EC.4040000@internode.on.net (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Takashi Iwai |
Headers | show |
Arthur Marsh wrote, on 14/10/14 13:56: >> --- >> diff --git a/sound/pci/emu10k1/emu10k1_callback.c >> b/sound/pci/emu10k1/emu10k1_callback.c >> index 3f3ef38d9b6e..874cd76c7b7f 100644 >> --- a/sound/pci/emu10k1/emu10k1_callback.c >> +++ b/sound/pci/emu10k1/emu10k1_callback.c >> @@ -85,6 +85,8 @@ snd_emu10k1_ops_setup(struct snd_emux *emux) >> * get more voice for pcm >> * >> * terminate most inactive voice and give it as a pcm voice. >> + * >> + * voice_lock is already held. >> */ >> int >> snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) >> @@ -92,12 +94,10 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) >> struct snd_emux *emu; >> struct snd_emux_voice *vp; >> struct best_voice best[V_END]; >> - unsigned long flags; >> int i; >> >> emu = hw->synth; >> >> - spin_lock_irqsave(&emu->voice_lock, flags); >> lookup_voices(emu, hw, best, 1); /* no OFF voices */ >> for (i = 0; i < V_END; i++) { >> if (best[i].voice >= 0) { >> @@ -113,11 +113,9 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) >> vp->emu->num_voices--; >> vp->ch = -1; >> vp->state = SNDRV_EMUX_ST_OFF; >> - spin_unlock_irqrestore(&emu->voice_lock, flags); >> return ch; >> } >> } >> - spin_unlock_irqrestore(&emu->voice_lock, flags); >> >> /* not found */ >> return -ENOMEM; >> > > I'll apply the above patch only first and report the results. > > Thanks again, > > Arthur. With only the above emu10k1_callback.c patch and not the pcm_native.c patch, I experience a lock-up when running alsa-info.sh Regards, Arthur.
At Tue, 14 Oct 2014 17:31:48 +1030, Arthur Marsh wrote: > > > > Arthur Marsh wrote, on 14/10/14 13:56: > >> --- > >> diff --git a/sound/pci/emu10k1/emu10k1_callback.c > >> b/sound/pci/emu10k1/emu10k1_callback.c > >> index 3f3ef38d9b6e..874cd76c7b7f 100644 > >> --- a/sound/pci/emu10k1/emu10k1_callback.c > >> +++ b/sound/pci/emu10k1/emu10k1_callback.c > >> @@ -85,6 +85,8 @@ snd_emu10k1_ops_setup(struct snd_emux *emux) > >> * get more voice for pcm > >> * > >> * terminate most inactive voice and give it as a pcm voice. > >> + * > >> + * voice_lock is already held. > >> */ > >> int > >> snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) > >> @@ -92,12 +94,10 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) > >> struct snd_emux *emu; > >> struct snd_emux_voice *vp; > >> struct best_voice best[V_END]; > >> - unsigned long flags; > >> int i; > >> > >> emu = hw->synth; > >> > >> - spin_lock_irqsave(&emu->voice_lock, flags); > >> lookup_voices(emu, hw, best, 1); /* no OFF voices */ > >> for (i = 0; i < V_END; i++) { > >> if (best[i].voice >= 0) { > >> @@ -113,11 +113,9 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw) > >> vp->emu->num_voices--; > >> vp->ch = -1; > >> vp->state = SNDRV_EMUX_ST_OFF; > >> - spin_unlock_irqrestore(&emu->voice_lock, flags); > >> return ch; > >> } > >> } > >> - spin_unlock_irqrestore(&emu->voice_lock, flags); > >> > >> /* not found */ > >> return -ENOMEM; > >> > > > > I'll apply the above patch only first and report the results. > > > > Thanks again, > > > > Arthur. > > With only the above emu10k1_callback.c patch and not the pcm_native.c > patch, I experience a lock-up when running alsa-info.sh OK, good to know. I'll put proper comments about it. thanks, Takashi
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 85fe1a216225..9c7cbd1b839e 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2275,6 +2275,9 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) int err; wait_queue_t wait; + if (WARN_ON(pcm->nonatomic)) + return -EINVAL; + if (pcm == NULL) { err = -ENODEV;