FAILED: patch "[PATCH] ALSA: pcm: Call substream ack() method upon compat mmap" failed to apply to 4.19-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2e2832562c877e6530b8480982d99a4ff90c6777 Mon Sep 17 00:00:00 2001
From: Alan Young <[email protected]>
Date: Fri, 9 Jul 2021 09:48:54 +0100
Subject: [PATCH] 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().
sound/core/pcm_native.c +8 -3
@@ -3063,9 +3063,14 @@ static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream, boundary =0x7fffffff ;snd_pcm_stream_lock_irq (substream);/* FIXME: we should consider the boundary for the sync from app */ -if (!(sflags &SNDRV_PCM_SYNC_PTR_APPL )) - control->appl_ptr = scontrol.appl_ptr; -else +if (!(sflags &SNDRV_PCM_SYNC_PTR_APPL )) { + err =pcm_lib_apply_appl_ptr (substream, + scontrol.appl_ptr); +if (err <0 ) { +snd_pcm_stream_unlock_irq (substream); +return err; + } + }else scontrol.appl_ptr = control->appl_ptr % boundary;if (!(sflags &SNDRV_PCM_SYNC_PTR_AVAIL_MIN )) control->avail_min = scontrol.avail_min;
This commit is not applicable before the 64-bit time_t in user space with 32-bit compatibility changes introduces by 80fe7430c7085951d1246d83f638cc17e6c0be36 in 5.6.
Quoted 55 lines · On 26/07/2021 09:09, [email protected] wrote:
The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to<[email protected]>.thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
2e2832562c877e6530b8480982d99a4ff90c6777Mon Sep 17 00:00:00 2001
From: Alan Young<[email protected]>
Date: Fri, 9 Jul 2021 09:48:54 +0100
Subject: [PATCH] ALSA: pcm: Call substreamack()method upon compat mmap
commitIf 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_PTRioctl results in callingsnd_pcm_ioctl_sync_ptr_compat(). Make this usepcm_lib_apply_appl_ptr()so that the substream'sack()method, if defined, is called.The
snd_pcm_sync_ptr()function, used in the 64-bit ioctl case, already usessnd_pcm_ioctl_sync_ptr_compat().Fixes 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")Signed-off-by Alan Young<[email protected]>Cc <[email protected]>Signed-off-by Takashi Iwai<[email protected]>sound/core/pcm_native.c +8
-3@@ -3063,9 +3063,14 @@ static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream, boundary =0x7fffffff ;snd_pcm_stream_lock_irq (substream);/* FIXME: we should consider the boundary for the sync from app */ -if (!(sflags &SNDRV_PCM_SYNC_PTR_APPL )) - control->appl_ptr = scontrol.appl_ptr; -else +if (!(sflags &SNDRV_PCM_SYNC_PTR_APPL )) { + err =pcm_lib_apply_appl_ptr (substream, + scontrol.appl_ptr); +if (err <0 ) { +snd_pcm_stream_unlock_irq (substream); +return err; + } + }else scontrol.appl_ptr = control->appl_ptr % boundary;if (!(sflags &SNDRV_PCM_SYNC_PTR_AVAIL_MIN )) control->avail_min = scontrol.avail_min;