All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] ALSA: pcm: Call substream ack() method upon compat mmap" failed to apply to 5.4-stable tree
@ 2021-07-26  8:09 gregkh
       [not found] ` <e26c27fb-12e8-f1c1-0dde-50fd68623118@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2021-07-26  8:09 UTC (permalink / raw)
  To: consult.awy, stable, tiwai; +Cc: stable


The patch below does not apply to the 5.4-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 <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 2e2832562c877e6530b8480982d99a4ff90c6777 Mon Sep 17 00:00:00 2001
From: Alan Young <consult.awy@gmail.com>
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().

Fixes: 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")
Signed-off-by: Alan Young <consult.awy@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/c441f18c-eb2a-3bdd-299a-696ccca2de9c@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 14e32825c339..c88c4316c417 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -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;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: FAILED: patch "[PATCH] ALSA: pcm: Call substream ack() method upon compat mmap" failed to apply to 5.4-stable tree
       [not found] ` <e26c27fb-12e8-f1c1-0dde-50fd68623118@gmail.com>
@ 2021-07-30  9:26   ` Greg KH
  2021-07-30 11:15     ` Alan Young
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-07-30  9:26 UTC (permalink / raw)
  To: Alan Young; +Cc: stable, tiwai

On Fri, Jul 30, 2021 at 09:38:52AM +0100, Alan Young wrote:
> 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.

That is odd, as that is not what you wrote in the patch itself:

>     Fixes: 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")

So is the Fixes: tag here incorrect?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FAILED: patch "[PATCH] ALSA: pcm: Call substream ack() method upon compat mmap" failed to apply to 5.4-stable tree
  2021-07-30  9:26   ` Greg KH
@ 2021-07-30 11:15     ` Alan Young
  2021-07-30 18:12       ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Young @ 2021-07-30 11:15 UTC (permalink / raw)
  To: Greg KH; +Cc: stable, tiwai

On 30/07/2021 10:26, Greg KH wrote:
> On Fri, Jul 30, 2021 at 09:38:52AM +0100, Alan Young wrote:
>> 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.
> That is odd, as that is not what you wrote in the patch itself:
>
>>      Fixes: 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")
> So is the Fixes: tag here incorrect?
>
> thanks,
>
> greg k-h

I did not add the Fixes tag. I guess Takashi Iwai did.

I think that 9027c4639ef1 added some functionality that was broken by 
80fe7430c7085951 and which my patch corrects. So the Fixes: 9027c4639ef1 
tag refers to the actual functionality, not the breaking of it.

I have no idea if that is the correct usage of the Fixes tag which, as I 
said, I did not add.

Alan.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FAILED: patch "[PATCH] ALSA: pcm: Call substream ack() method upon compat mmap" failed to apply to 5.4-stable tree
  2021-07-30 11:15     ` Alan Young
@ 2021-07-30 18:12       ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-07-30 18:12 UTC (permalink / raw)
  To: Alan Young; +Cc: Greg KH, stable, tiwai

On Fri, 30 Jul 2021 13:15:14 +0200,
Alan Young wrote:
> 
> On 30/07/2021 10:26, Greg KH wrote:
> > On Fri, Jul 30, 2021 at 09:38:52AM +0100, Alan Young wrote:
> >> 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.
> > That is odd, as that is not what you wrote in the patch itself:
> >
> >>      Fixes: 9027c4639ef1 ("ALSA: pcm: Call ack() whenever appl_ptr is updated")
> > So is the Fixes: tag here incorrect?
> >
> > thanks,
> >
> > greg k-h
> 
> I did not add the Fixes tag. I guess Takashi Iwai did.
> 
> I think that 9027c4639ef1 added some functionality that was broken by
> 80fe7430c7085951 and which my patch corrects. So the Fixes:
> 9027c4639ef1 tag refers to the actual functionality, not the breaking
> of it.
> 
> I have no idea if that is the correct usage of the Fixes tag which, as
> I said, I did not add.

Yeah, sorry for the mess, I was confused that the function already
missed that point.  But the patch can't be applied in anyway, so it
can't go wrong at least :)


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-30 18:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26  8:09 FAILED: patch "[PATCH] ALSA: pcm: Call substream ack() method upon compat mmap" failed to apply to 5.4-stable tree gregkh
     [not found] ` <e26c27fb-12e8-f1c1-0dde-50fd68623118@gmail.com>
2021-07-30  9:26   ` Greg KH
2021-07-30 11:15     ` Alan Young
2021-07-30 18:12       ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.