--- linux-2.6.21/sound/core/pcm_native.c.old 2007-05-12 11:30:06.000000000 +0400 +++ linux-2.6.21/sound/core/pcm_native.c 2007-05-20 01:22:45.000000000 +0400 @@ -922,8 +922,14 @@ static int snd_pcm_do_stop(struct snd_pcm_substream *substream, int state) { if (substream->runtime->trigger_master == substream && - snd_pcm_running(substream)) - substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); + snd_pcm_running(substream)) { + if (substream->ops->async_stop) + /* the driver provides a separate callback + * for the IRQ context */ + substream->ops->async_stop(substream); + else + substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_STOP); + } return 0; /* unconditonally stop all substreams */ } --- linux-2.6.21/include/sound/pcm.h.old 2007-05-12 11:30:01.000000000 +0400 +++ linux-2.6.21/include/sound/pcm.h 2007-05-20 01:21:29.000000000 +0400 @@ -68,6 +68,7 @@ int (*hw_free)(struct snd_pcm_substream *substream); int (*prepare)(struct snd_pcm_substream *substream); int (*trigger)(struct snd_pcm_substream *substream, int cmd); + int (*async_stop)(struct snd_pcm_substream *substream); snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); int (*copy)(struct snd_pcm_substream *substream, int channel, snd_pcm_uframes_t pos,