Commit d689e34b authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove spinlocks around proc prints

Don't lock during showing proc read.  snd_iprintf() might sleep.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bf850204
...@@ -351,10 +351,8 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, ...@@ -351,10 +351,8 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,
snd_iprintf(buffer, "closed\n"); snd_iprintf(buffer, "closed\n");
return; return;
} }
snd_pcm_stream_lock_irq(substream);
if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
snd_iprintf(buffer, "no setup\n"); snd_iprintf(buffer, "no setup\n");
snd_pcm_stream_unlock_irq(substream);
return; return;
} }
snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access)); snd_iprintf(buffer, "access: %s\n", snd_pcm_access_name(runtime->access));
...@@ -375,7 +373,6 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, ...@@ -375,7 +373,6 @@ static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,
snd_iprintf(buffer, "OSS period frames: %lu\n", (unsigned long)runtime->oss.period_frames); snd_iprintf(buffer, "OSS period frames: %lu\n", (unsigned long)runtime->oss.period_frames);
} }
#endif #endif
snd_pcm_stream_unlock_irq(substream);
} }
static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry, static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry,
...@@ -387,10 +384,8 @@ static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry, ...@@ -387,10 +384,8 @@ static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry,
snd_iprintf(buffer, "closed\n"); snd_iprintf(buffer, "closed\n");
return; return;
} }
snd_pcm_stream_lock_irq(substream);
if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { if (runtime->status->state == SNDRV_PCM_STATE_OPEN) {
snd_iprintf(buffer, "no setup\n"); snd_iprintf(buffer, "no setup\n");
snd_pcm_stream_unlock_irq(substream);
return; return;
} }
snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode)); snd_iprintf(buffer, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(runtime->tstamp_mode));
...@@ -403,7 +398,6 @@ static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry, ...@@ -403,7 +398,6 @@ static void snd_pcm_substream_proc_sw_params_read(struct snd_info_entry *entry,
snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold); snd_iprintf(buffer, "silence_threshold: %lu\n", runtime->silence_threshold);
snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size); snd_iprintf(buffer, "silence_size: %lu\n", runtime->silence_size);
snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary); snd_iprintf(buffer, "boundary: %lu\n", runtime->boundary);
snd_pcm_stream_unlock_irq(substream);
} }
static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry, static void snd_pcm_substream_proc_status_read(struct snd_info_entry *entry,
......
...@@ -1095,7 +1095,6 @@ static void snd_timer_proc_read(struct snd_info_entry *entry, ...@@ -1095,7 +1095,6 @@ static void snd_timer_proc_read(struct snd_info_entry *entry,
if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE) if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
snd_iprintf(buffer, " SLAVE"); snd_iprintf(buffer, " SLAVE");
snd_iprintf(buffer, "\n"); snd_iprintf(buffer, "\n");
spin_lock_irqsave(&timer->lock, flags);
list_for_each(q, &timer->open_list_head) { list_for_each(q, &timer->open_list_head) {
ti = list_entry(q, struct snd_timer_instance, open_list); ti = list_entry(q, struct snd_timer_instance, open_list);
snd_iprintf(buffer, " Client %s : %s\n", snd_iprintf(buffer, " Client %s : %s\n",
...@@ -1104,7 +1103,6 @@ static void snd_timer_proc_read(struct snd_info_entry *entry, ...@@ -1104,7 +1103,6 @@ static void snd_timer_proc_read(struct snd_info_entry *entry,
SNDRV_TIMER_IFLG_RUNNING) SNDRV_TIMER_IFLG_RUNNING)
? "running" : "stopped"); ? "running" : "stopped");
} }
spin_unlock_irqrestore(&timer->lock, flags);
} }
mutex_unlock(&register_mutex); mutex_unlock(&register_mutex);
} }
......
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