ALSA: pcm: Call sync_stop at disconnection
authorTakashi Iwai <tiwai@suse.de>
Sat, 6 Feb 2021 20:36:53 +0000 (21:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:19 +0000 (11:37 +0100)
commit6bcf443bce968a5622102b12e5f0f87364f4a153
treec0c2cece6159b2c817964d5e40e656bd802b8302
parent85c1062920d13d425377d76b81a2567e5e1fe64c
ALSA: pcm: Call sync_stop at disconnection

commit 29bb274e94974669acb5186a75538f20df1508b6 upstream.

The PCM core should perform the sync for the pending stop operations
at disconnection.  Otherwise it may lead to unexpected access.

Currently the old user of sync_stop, USB-audio driver, has its own
sync, so this isn't needed, but it's better to guarantee the sync in
the PCM core level.

This patch adds the missing sync_stop call at PCM disconnection
callback.  It also assures the IRQ sync if it's specified in the
card.  snd_pcm_sync_stop() is slightly modified to be called also for
any PCM substream object now.

Fixes: 1e850beea278 ("ALSA: pcm: Add the support for sync-stop operation")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210206203656.15959-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/init.c
sound/core/pcm.c
sound/core/pcm_local.h
sound/core/pcm_native.c