From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: linux-sound@vger.kernel.org, dmaengine@vger.kernel.org,
alsa-devel@alsa-project.org, miquel.raynal@bootlin.com,
perex@perex.cz, tiwai@suse.com, lars@metafoo.de,
lgirdwood@gmail.com
Subject: Re: DMA Transfer Synchronization Issue in Out-of-Tree Sound Card Driver
Date: Wed, 22 May 2024 07:52:14 +0200 [thread overview]
Message-ID: <87msoiz94h.wl-tiwai@suse.de> (raw)
In-Reply-To: <6e01c13f-2bc1-4e08-b50e-9f1307bda92d@sirena.org.uk>
On Tue, 21 May 2024 20:32:59 +0200,
Mark Brown wrote:
>
> On Tue, May 21, 2024 at 10:31:12AM +0200, Louis Chauvet wrote:
>
> > To address this DMA issue, I have created a patch [1] that guarantees the
> > completion of the DMA transfer upon the return of xdma_synchronize. This
> > means xdma_synchronize now sleeps, but looking at other drivers around it
> > appears expected to be able to do so.
>
> You need to set the nonatomic flag for the PCM to allow this, the
> default is that triggers run in atomic context.
Right, that's a most straightforward solution. It implies that the
period updates must be in non-atomic, i.e. use a threaded irq handler
in most cases.
If the synchronization is needed for assuring the hardware stop, there
is an alternative with PCM sync_stop callback, too. The callback is
called at each time after a stream gets stopped before the next action
(that is, either prepare, hw_params or close). It's only for
stopping, and there is no similar way for sync of a stream start,
though.
thanks,
Takashi
next prev parent reply other threads:[~2024-05-22 5:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 8:31 DMA Transfer Synchronization Issue in Out-of-Tree Sound Card Driver Louis Chauvet
2024-05-21 18:32 ` Mark Brown
2024-05-22 5:52 ` Takashi Iwai [this message]
2024-05-24 16:13 ` Louis Chauvet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msoiz94h.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-sound@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox