[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120108002104.GC13181@n2100.arm.linux.org.uk>
Date: Sun, 8 Jan 2012 00:21:04 +0000
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Daniel Walker <dwalker@...o99.com>
Cc: David Brown <davidb@...eaurora.org>,
Ravi Kumar V <kumarrav@...eaurora.org>, vinod.koul@...el.com,
dan.j.williams@...el.com, arnd@...db.de,
linux-arch@...r.kernel.org, bryanh@...eaurora.org,
tsoni@...lcomm.com, johlstei@...lcomm.com,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Nicolas Ferre <nicolas.ferre@...el.com>
Subject: Re: [PATCH v2 2/2] msm: DMAEngine: Add DMAEngine driver based on
old MSM DMA APIs
On Sat, Jan 07, 2012 at 04:13:56PM -0800, Daniel Walker wrote:
> On Sat, 2012-01-07 at 19:21 +0000, Russell King - ARM Linux wrote:
> > Please refer to the DMA engine documentation, found here:
> >
> > Documentation/dmaengine.txt
> >
> > section 3:
> >
> > Note:
> > Although the async_tx API specifies that completion callback
> > routines cannot submit any new operations, this is not the
> > case for slave/cyclic DMA.
> >
> > For slave DMA, the subsequent transaction may not be available
> > for submission prior to callback function being invoked, so
> > slave DMA callbacks are permitted to prepare and submit a new
> > transaction.
> >
> > For cyclic DMA, a callback function may wish to terminate the
> > DMA via dmaengine_terminate_all().
> >
> > * Therefore, it is important that DMA engine drivers drop any
> > * locks before calling the callback function which may cause a
> > * deadlock.
>
> Here's the comment from at_hdmac.c .
>
> /*
> * The API requires that no submissions are done from a
> * callback, so we don't need to drop the lock here
> */
> if (callback)
> callback(param);
>
> I don't know much about the DMA engine, but maybe there is some special
> case here that makes this ok.. (CC'ed Nicolas Ferre)
If you read the note fully, you'll notice that there's a difference
between the async_tx API and the slave/cyclic DMA API (it's covered
in the first paragraph.)
Plus that documentation was written by me, reviewed by Dan and Vinod
and accepted. You can treat it as authoritive, and take from it that
at_hdmac.c is buggy.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists