• Takashi Sakamoto's avatar
    ALSA: firewire-lib: operate for period elapse event in process context · 7ba5ca32
    Takashi Sakamoto authored
    
    
    All of drivers in ALSA firewire stack processes two chances to process
    isochronous packets in 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 uses workqueue to delegate the call. A variant of
    snd_pcm_period_elapsed() without lock acquisition can obsolete the
    workqueue.
    
    An extra care is needed for the callback of .pointer since it's called
    from snd_pcm_period_elapsed(). The isochronous context in Linux FireWire
    subsystem is safe mostly for nested call except in software IRQ context.
    Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
    Link: https://lore.kernel.org/r/20210610031733.56297-3-o-takashi@sakamocchi.jp
    
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    7ba5ca32
amdtp-stream.c 56.6 KB