All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] ALSA: pcm:firewire: allow to operate for period elapse event in process context
@ 2021-06-09 14:31 Takashi Sakamoto
  2021-06-09 14:31 ` [PATCH v2 1/3] ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream Takashi Sakamoto
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Takashi Sakamoto @ 2021-06-09 14:31 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel, clemens

Hi,

This patchset is revised version of my previous one:
 * https://lore.kernel.org/alsa-devel/20210609012244.24296-1-o-takashi@sakamocchi.jp/

All of drivers in ALSA firewire stack have two chances to process
isochronous packets of any isochronous context; in software IRQ context
for 1394 OHCI, and in process context of ALSA PCM application.

In the process context, callbacks of .pointer and .ack are utilized. The
callbacks are done by ALSA PCM core under acquiring lock of PCM substream,

In design of ALSA PCM core, call of snd_pcm_period_elapsed() is used for
drivers to awaken user processes from waiting for available frames. The
function voluntarily acquires lock of PCM substream, therefore it is not
called in the process context since it causes dead lock. As a workaround
to avoid the dead lock, all of drivers in ALSA firewire stack use workqueue
to delegate the call.

This patchset is my attempt for the issue. A variant of 
'snd_pcm_period_elapsed()' without lock acquisition is going to be added,
named 'snd_pcm_period_elapsed_under_stream_lock()'. The call is available
in callbacks of .pointer and .ack of snd_pcm_ops structure.

Changes from v1:
 * fix context section of kernel API documentation

Takashi Sakamoto (3):
  ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock
    of PCM substream
  ALSA: firewire-lib: operate for period elapse event in process context
  ALSA: firewire-lib: obsolete workqueue for period update

 include/sound/pcm.h           |  1 +
 sound/core/pcm_lib.c          | 71 +++++++++++++++++++++++++++--------
 sound/firewire/amdtp-stream.c | 46 +++++++----------------
 sound/firewire/amdtp-stream.h |  1 -
 4 files changed, 71 insertions(+), 48 deletions(-)

-- 
2.27.0


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

end of thread, other threads:[~2021-06-11  7:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 14:31 [PATCH v2 0/3] ALSA: pcm:firewire: allow to operate for period elapse event in process context Takashi Sakamoto
2021-06-09 14:31 ` [PATCH v2 1/3] ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream Takashi Sakamoto
2021-06-09 15:27   ` Takashi Iwai
2021-06-09 23:16     ` Takashi Sakamoto
2021-06-10  7:39       ` Takashi Iwai
2021-06-10  8:05         ` Takashi Sakamoto
2021-06-10  8:08           ` Takashi Iwai
2021-06-10  8:26             ` Takashi Sakamoto
2021-06-10  8:36               ` Takashi Iwai
2021-06-10 10:12                 ` Takashi Sakamoto
2021-06-10 11:03                   ` Takashi Iwai
2021-06-11  3:38                     ` Takashi Sakamoto
2021-06-11  6:47                       ` Takashi Iwai
2021-06-11  7:07                         ` Takashi Sakamoto
2021-06-11  7:31                           ` Takashi Iwai
2021-06-09 14:31 ` [PATCH v2 2/3] ALSA: firewire-lib: operate for period elapse event in process context Takashi Sakamoto
2021-06-09 14:31 ` [PATCH v2 3/3] ALSA: firewire-lib: obsolete workqueue for period update Takashi Sakamoto

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.