From: Takashi Iwai <tiwai@suse.de>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Takashi Iwai <tiwai@suse.de>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: pcm: Apply sync-stop at SNDRV_PCM_IOCTL_DROP ioctl
Date: Thu, 15 Oct 2026 20:56:21 +0200 [thread overview]
Message-ID: <874iem7pyi.wl-tiwai@suse.de> (raw)
In-Reply-To: <c2bc1478-5999-455f-bd67-8b536c452215@samsung.com>
On Thu, 15 Oct 2026 20:30:21 +0200,
Marek Szyprowski wrote:
>
> On 14.10.2026 16:24, Takashi Iwai wrote:
> > When a PCM stream is stopped via SNDRV_PCM_IOCTL_DROP ioctl, it calls
> > snd_pcm_stop() but sync-stop operation is missing. Although this is
> > usually no big issue, let's add snd_pcm_sync_stop() call, just to be
> > sure.
> >
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> > sound/core/pcm_native.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> > index 6c379068b54c..7ffbf2c0ea92 100644
> > --- a/sound/core/pcm_native.c
> > +++ b/sound/core/pcm_native.c
> > @@ -2332,6 +2332,8 @@ static int snd_pcm_drop(struct snd_pcm_substream *substream)
> > result = snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
> > /* runtime->control->appl_ptr = runtime->status->hw_ptr; */
> >
> > + snd_pcm_sync_stop(substream, true);
> > +
> > return result;
> > }
>
> This patch landed in today's linux-next as commit fdf9a21cda78 ("ALSA: pcm: Apply
> sync-stop at SNDRV_PCM_IOCTL_DROP ioctl"). In my tests I found that it triggers
> the kernel bug about invalid context for sleeping.
>
> It looks that thissnd_pcm_sync_stop() should be called outside the scope of
> the guard(pcm_stream_lock_irq)(substream).
Gah, obviously it's calling in a wrong context, and I overlooked
guard() line.
I'm going to submit the trivial fix.
thanks,
Takashi
prev parent reply other threads:[~2026-10-15 18:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20261015183022eucas1p10d5777e112c34458f4b360407d2228c4@eucas1p1.samsung.com>
2026-10-14 14:24 ` [PATCH] ALSA: pcm: Apply sync-stop at SNDRV_PCM_IOCTL_DROP ioctl Takashi Iwai
2026-10-15 18:30 ` Marek Szyprowski
2026-10-15 18:56 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874iem7pyi.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.