提交 2e283256 编写于 作者: A Alan Young 提交者: Takashi Iwai

ALSA: pcm: Call substream ack() method upon compat mmap commit

If a 32-bit application is being used with a 64-bit kernel and is using
the mmap mechanism to write data, then the SNDRV_PCM_IOCTL_SYNC_PTR
ioctl results in calling snd_pcm_ioctl_sync_ptr_compat(). Make this use
pcm_lib_apply_appl_ptr() so that the substream's ack() method, if
defined, is called.

The snd_pcm_sync_ptr() function, used in the 64-bit ioctl case, already
uses snd_pcm_ioctl_sync_ptr_compat().

Fixes: 9027c463 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")
Signed-off-by: NAlan Young <consult.awy@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/c441f18c-eb2a-3bdd-299a-696ccca2de9c@gmail.comSigned-off-by: NTakashi Iwai <tiwai@suse.de>
上级 e73f0f0e
...@@ -3063,9 +3063,14 @@ static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream, ...@@ -3063,9 +3063,14 @@ static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream,
boundary = 0x7fffffff; boundary = 0x7fffffff;
snd_pcm_stream_lock_irq(substream); snd_pcm_stream_lock_irq(substream);
/* FIXME: we should consider the boundary for the sync from app */ /* FIXME: we should consider the boundary for the sync from app */
if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL)) if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL)) {
control->appl_ptr = scontrol.appl_ptr; err = pcm_lib_apply_appl_ptr(substream,
else scontrol.appl_ptr);
if (err < 0) {
snd_pcm_stream_unlock_irq(substream);
return err;
}
} else
scontrol.appl_ptr = control->appl_ptr % boundary; scontrol.appl_ptr = control->appl_ptr % boundary;
if (!(sflags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN)) if (!(sflags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN))
control->avail_min = scontrol.avail_min; control->avail_min = scontrol.avail_min;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册