From patchwork Fri Nov 16 22:39:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Greer X-Patchwork-Id: 1757521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id DA0FDDF288 for ; Fri, 16 Nov 2012 22:42:21 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TZUa2-0003Pe-1q; Fri, 16 Nov 2012 22:40:10 +0000 Received: from mail20.dotsterhost.com ([66.11.232.73]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1TZUZx-0003PH-Qo for linux-arm-kernel@lists.infradead.org; Fri, 16 Nov 2012 22:40:07 +0000 Received: (qmail 23808 invoked from network); 16 Nov 2012 22:39:31 -0000 Received: from unknown (HELO blue.animalcreek.com) (mgreer@animalcreek.com@[68.3.93.7]) by 66.11.232.73 with SMTP; 16 Nov 2012 22:39:30 -0000 Received: by blue.animalcreek.com (Postfix, from userid 1001) id 83D07659B5; Fri, 16 Nov 2012 15:39:30 -0700 (MST) Date: Fri, 16 Nov 2012 15:39:30 -0700 From: "Mark A. Greer" To: =?iso-8859-1?Q?P=E9ter?= Ujfalusi Subject: Re: [RFC] dmaengine: omap-dma: Allow DMA controller to prefetch data Message-ID: <20121116223930.GA25182@animalcreek.com> References: <20121018222046.GA28541@animalcreek.com> <20121018225540.GB28061@n2100.arm.linux.org.uk> <20121018232405.GA29064@animalcreek.com> <20121018233335.GC28061@n2100.arm.linux.org.uk> <50814B83.7090203@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50814B83.7090203@ti.com> Organization: Animal Creek Technologies, Inc. User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121116_174006_043586_A70FF122 X-CRM114-Status: GOOD ( 29.05 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [66.11.232.73 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-omap@vger.kernel.org, Russell King - ARM Linux , Jarkko Nikula , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Fri, Oct 19, 2012 at 02:45:55PM +0200, Péter Ujfalusi wrote: > Hi, > > On 10/19/2012 01:33 AM, Russell King - ARM Linux wrote: > > I would suggest getting some feedback from the ASoC people first, before > > trying to invent new APIs to work around this stuff. If they can live > > with having prefetch enabled on OMAP then there isn't an issue here. If > > not, we need a solution to this. > > > > I do not believe that precisely stopping and starting playback across a > > suspend/resume event is really necessary (it's desirable but the world > > doesn't collapse if you miss a few samples.) It could be more of an > > issue for pause/resume though, but as I say, that's for ASoC people to > > comment on. > > There is another issue with the prefetch in audio: > we tend to like to know the position of the DMA and also to know how much data > we have stored in buffers, FIFOs. This information is used by userspace to do > echo cancellation and also used by PA for example to do runtime mixing > directly in the audio buffer. We have means to extract this information from > McBSP for example (and from tlv320dac33 codec) but AFAIK this information can > not be retrieved from sDMA. > We could assume that the sDMA FIFO is kept full and report that as a 'delay' > or do not account this information. > > For now I think the cyclic mode should not set the prefetch. If I recall right > the cyclic mode is only used by audio at the moment. > > > I'm merely pointing out here that we need their feedback here before > > deciding if there's anything further that needs to happen. > > Thanks Russell, I'll take a look at the implication of the prefetch for audio. So how about enabling prefetch for just non-cyclic? --- From 04b4d7b2d940822af501ea8a6bf265098d2c1810 Mon Sep 17 00:00:00 2001 From: "Mark A. Greer" Date: Wed, 17 Oct 2012 18:12:21 -0700 Subject: [PATCH] dmaengine: omap-dma: Allow DMA controller to prefetch data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable DMA prefetching for non-cyclic DMAs by setting the 'OMAP_DMA_DST_SYNC_PREFETCH' flag when there is a destination synchronized DMA transfer. Prefetching is not allowed on source synchronized DMA transfers. It is not allowed on cyclic DMAs either since that can cause issues with some users (e.g., suspending/resuming audio). CC: rmk+kernel@arm.linux.org.uk CC: Péter Ujfalusi Signed-off-by: Mark A. Greer --- drivers/dma/omap-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index bb2d8e7..e660f94 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c @@ -310,7 +310,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( dev_addr = c->cfg.dst_addr; dev_width = c->cfg.dst_addr_width; burst = c->cfg.dst_maxburst; - sync_type = OMAP_DMA_DST_SYNC; + sync_type = OMAP_DMA_DST_SYNC | OMAP_DMA_DST_SYNC_PREFETCH; } else { dev_err(chan->device->dev, "%s: bad direction?\n", __func__); return NULL;