diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-10-18 09:19:08 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-10-19 10:18:22 +0300 |
commit | e6dcc92fcea07f23c13996b7bb6a2a32ed4c6ed5 (patch) | |
tree | fcaf402980b6c06ab843b9b0615c521d4d97893c /sound/firewire/amdtp-stream.c | |
parent | f890f9a04b361b2209c38e3317e6290a98e6ff6e (diff) | |
download | linux-e6dcc92fcea07f23c13996b7bb6a2a32ed4c6ed5.tar.xz |
ALSA: firewire-lib: replace ack callback to flush isoc contexts in AMDTP domain
An isoc context for AMDTP stream is flushed to queue packet
by a call of pcm.ack. This commit extends this for AMDTP
domain.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20191018061911.24909-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-stream.c')
-rw-r--r-- | sound/firewire/amdtp-stream.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 23677b805b05..3d27d4ce2b45 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -1139,23 +1139,29 @@ unsigned long amdtp_domain_stream_pcm_pointer(struct amdtp_domain *d, EXPORT_SYMBOL_GPL(amdtp_domain_stream_pcm_pointer); /** - * amdtp_stream_pcm_ack - acknowledge queued PCM frames + * amdtp_domain_stream_pcm_ack - acknowledge queued PCM frames + * @d: the AMDTP domain. * @s: the AMDTP stream that transfers the PCM frames * * Returns zero always. */ -int amdtp_stream_pcm_ack(struct amdtp_stream *s) +int amdtp_domain_stream_pcm_ack(struct amdtp_domain *d, struct amdtp_stream *s) { - /* - * Process isochronous packets for recent isochronous cycle to handle - * queued PCM frames. - */ - if (amdtp_stream_running(s)) - fw_iso_context_flush_completions(s->context); + struct amdtp_stream *irq_target = d->irq_target; + + // Process isochronous packets for recent isochronous cycle to handle + // queued PCM frames. + if (irq_target && amdtp_stream_running(irq_target)) { + // Queued packet should be processed without any kernel + // preemption to keep latency against bus cycle. + preempt_disable(); + fw_iso_context_flush_completions(irq_target->context); + preempt_enable(); + } return 0; } -EXPORT_SYMBOL(amdtp_stream_pcm_ack); +EXPORT_SYMBOL_GPL(amdtp_domain_stream_pcm_ack); /** * amdtp_stream_update - update the stream after a bus reset |