All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Fabio Estevam <festevam@gmail.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>,
	Nicolin Chen <b42378@freescale.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: mx6: Audio does not work on linux-next 20140107
Date: Tue, 07 Jan 2014 13:50:20 +0100	[thread overview]
Message-ID: <52CBF80C.3000907@metafoo.de> (raw)
In-Reply-To: <CAOMZO5C18WJQKJPuK_Pwq=EW0UhFh=9wxc4M4QEGBscZCHim8g@mail.gmail.com>

On 01/07/2014 01:29 PM, Fabio Estevam wrote:
> Hi Lars-Peter,
> 
> On Tue, Jan 7, 2014 at 10:07 AM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> 
>> We've had similar problems like this before. Typically this is caused by the
>> dmaengine driver calling the complete callback when it shouldn't. E.g. after
>> dmaegine_terminate_all() has already been called for the channel. There is
>> also unfortunately a small chance condition (which needs some extensions to
>> the dmaengine API before we can fix it). But the chance for this race
>> condition to occur is really small and has only been observed on a 4 (or 8,
>> not sure) core system so far. Is the problem reproducible in your case? Also
> 
> Thanks for your comments. Yes, I get this issue on a mx6 quad all the
> time running linux-next, but not on a mx6solo.

Looking at the imx-sdma dmaengine driver there is a whole bunch of issues in
regard to concurrency. The problem might have existed before and only
surfaced now due to some random other changes.

For starters there is absolutely no protection against concurrent access to
the drivers state struct. Access to buf_tail, bd, num_bd and possible other
fields should be protected by a lock. The second problem is that the active
descriptor is not invalidated when dmaengine_terminate_all() is called, so
if the tasklet runs after dmaengine_terminate_all() has been called the DMA
descriptor callback will be called even though it shouldn't.

And another problem is that the imx-sdma driver doesn't really conform to
the semantics of the dmaengine API with regrads to the prepare, submit and
issue_pending. But I don't think this is the source of the problem in this case.

- Lars

      parent reply	other threads:[~2014-01-07 12:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 11:56 mx6: Audio does not work on linux-next 20140107 Fabio Estevam
2014-01-07 12:07 ` Lars-Peter Clausen
2014-01-07 12:29   ` Fabio Estevam
2014-01-07 12:28     ` Nicolin Chen
2014-01-07 12:49       ` Fabio Estevam
2014-01-08  3:50         ` Fabio Estevam
2014-01-08  5:04           ` Nicolin Chen
2014-01-08 10:01             ` Fabio Estevam
2014-01-08  9:53               ` Nicolin Chen
2014-01-08 15:33                 ` Fabio Estevam
2014-01-07 12:50     ` Lars-Peter Clausen [this message]

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=52CBF80C.3000907@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=b42378@freescale.com \
    --cc=broonie@kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    /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 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.