ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 10 Jun 2021 03:17:31 +0000 (12:17 +0900)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Jun 2021 07:49:54 +0000 (09:49 +0200)
commit47271b1b98c980e915c0332eb5e8b2f273b2cd78
tree6900897ad9032de6a41fa5e996c01901a1447523
parent6ea9a2b84cc354ffd028195edb4e3d60d47f7bcb
ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream

Current implementation of ALSA PCM core has a kernel API,
snd_pcm_period_elapsed(), for drivers to queue event to awaken processes
from waiting for available frames. The function voluntarily acquires lock
of PCM substream, therefore it is not called in process context for any
PCM operation since the lock is already acquired.

It is convenient for packet-oriented driver, at least for drivers to audio
and music unit in IEEE 1394 bus. The drivers are allowed by Linux
FireWire subsystem to process isochronous packets queued till recent
isochronous cycle in process context in any time.

This commit adds snd_pcm_period_elapsed() variant,
snd_pcm_period_elapsed_without_lock(), for drivers to queue the event in
the process context.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210610031733.56297-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/pcm.h
sound/core/pcm_lib.c