mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Bara - SKIDATA <Benjamin.Bara@skidata.com>
To: Robin Gong <yibin.gong@nxp.com>
Cc: "timur@kernel.org" <timur@kernel.org>,
	"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	dl-linux-imx <linux-imx@nxp.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Richard Leitner - SKIDATA <Richard.Leitner@skidata.com>
Subject: RE: pcm|dmaengine|imx-sdma race condition on i.MX6
Date: Mon, 17 Aug 2020 11:38:10 +0000	[thread overview]
Message-ID: <a64ae27d9f1348ecae6adc74969cc88c@skidata.com> (raw)
In-Reply-To: <VE1PR04MB6638AC2A3AE852C3047E7B97895F0@VE1PR04MB6638.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: Robin Gong <yibin.gong@nxp.com>
> Sent: Montag, 17. August 2020 11:23
> busy_wait is not good I think, would you please have a try with the attached patch
> which is based on https://lkml.org/lkml/2020/8/11/111? The basic idea is
> to keep the freed descriptor into another list for freeing in later terminate_worker
> instead of freeing directly all in terminate_worker by vchan_get_all_descriptors
> which may break next descriptor coming soon

The idea sounds good, but with this attempt we are still not sure that the 1ms
(the ultimate reason why this is a problem) is awaited between DMA disabling and
re-enabling.

If we are allowed to leave the atomic PCM context on each trigger, synchronize the DMA and then
enter it back again, everything is fine.
This might be the most performant and elegant solution.
However, since we are in an atomic context for a reason, it might not be wanted by the PCM system
that the DMA termination completion of the previous context happens within the next call,
but we are not sure about that.
In this case, a busy wait is not a good solution, but a necessary one,
or at least the only valid solution we are aware of.

Anyhow, based on my understanding, either the start or the stop trigger has to wait the 1ms
(or whats left of it).


  reply	other threads:[~2020-08-17 11:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 11:22 Richard Leitner
2020-08-14  8:45 ` Robin Gong
     [not found]   ` <7f98cd6d30404e4d9d621f57f45ae441@skidata.com>
2020-08-17  5:38     ` Richard Leitner
2020-08-17  7:28   ` Benjamin Bara - SKIDATA
2020-08-17  9:22     ` Robin Gong
2020-08-17 11:38       ` Benjamin Bara - SKIDATA [this message]
2020-08-18 10:41         ` Robin Gong
2020-08-19 11:08     ` Lars-Peter Clausen
2020-08-19 11:16       ` Lars-Peter Clausen
2020-08-19 14:25       ` Benjamin Bara - SKIDATA
2020-08-20 15:01         ` Robin Gong
2020-08-21  4:34           ` Richard Leitner
2020-08-21  9:21             ` Robin Gong
2020-08-21  9:54               ` Richard Leitner
2020-08-20  6:52       ` Sascha Hauer
2020-08-21  9:52         ` Robin Gong
2020-08-25  6:12           ` Sascha Hauer

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=a64ae27d9f1348ecae6adc74969cc88c@skidata.com \
    --to=benjamin.bara@skidata.com \
    --cc=Richard.Leitner@skidata.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=shawnguo@kernel.org \
    --cc=timur@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yibin.gong@nxp.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

all inboxes | Powered by JetHome®