diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 5e1029ab1a0e..8e3e0e871967 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -889,10 +889,11 @@ void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *op void snd_pcm_set_sync(struct snd_pcm_substream *substream); int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, - unsigned int cmd, void *arg); + unsigned int cmd, void *arg); int snd_pcm_update_state(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime); int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream); +int snd_pcm_update_delay_blk(struct snd_pcm_substream *substream); int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream); int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream); int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream); diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index d80963097e77..0abdf939a58c 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -563,6 +563,11 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) return snd_pcm_update_hw_ptr0(substream, 0); } +int snd_pcm_update_delay_blk(struct snd_pcm_substream *substream) +{ + return substream->ops->delay_blk(substream); +} + /** * snd_pcm_set_ops - set the PCM operators * @pcm: the pcm instance diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index a41e87a549c1..873d09b55947 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2497,6 +2497,12 @@ static int snd_pcm_delay(struct snd_pcm_substream *substream, int err; snd_pcm_sframes_t n = 0; + /* + * Called outside irq lock, as this will block waiting for + * DSP to respond. + */ + snd_pcm_update_delay_blk(substream); + snd_pcm_stream_lock_irq(substream); switch (runtime->status->state) { case SNDRV_PCM_STATE_DRAINING: