From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
dmaengine@vger.kernel.org
Cc: davinci-linux-open-source@linux.davincidsp.com, joelf@ti.com,
Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Tony Lindgren <tony@atomide.com>,
nsekhar@ti.com, Jyri Sarha <jsarha@ti.com>,
mporter@linaro.org, vinod.koul@intel.com,
dan.j.williams@intel.com
Subject: [PATCH 06/18] arm: common: edma: API to request non default queue for a channel
Date: Thu, 13 Mar 2014 11:18:28 +0200 [thread overview]
Message-ID: <1394702320-21743-7-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1394702320-21743-1-git-send-email-peter.ujfalusi@ti.com>
When using eDMA3 via dmaengine all dma channels will use the default queue.
Since during request time we do not have means to change this it need to be done
later, before the DMA has been started.
With the added function it is possible to move the channel to a non default
queue if it is possible, otherwise (when only one EQ/TC is available for the CC)
the default queue is going to be used.
For example: For optimal system performance the audio (cyclic) DMA should
be placed to a separate queue which is different than what the rest of the
system is using.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/common/edma.c | 27 +++++++++++++++++++++++++++
include/linux/platform_data/edma.h | 2 ++
2 files changed, 29 insertions(+)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index be267b2080be..eaf6dd19f082 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -712,6 +712,33 @@ int edma_alloc_channel(int channel,
}
EXPORT_SYMBOL(edma_alloc_channel);
+/**
+ * edma_request_non_default_queue - try to map the channel to non default queue
+ * @channel: dma channel returned from edma_alloc_channel()
+ *
+ * For certain type of applications like audio it is preferred to not use the
+ * default event queue/tc to avoid eDMA caused latency.
+ *
+ * This function will iterate through the event queues available for the CC and
+ * picks the first EQ/TC which is not set as the default for the CC
+ */
+void edma_request_non_default_queue(int channel)
+{
+ unsigned ctlr = EDMA_CTLR(channel);
+ enum dma_event_q eventq_no = EVENTQ_DEFAULT;
+ int i;
+
+ for (i = 0; i < edma_cc[ctlr]->num_tc; i++) {
+ if (i != edma_cc[ctlr]->default_queue) {
+ eventq_no = i;
+ break;
+ }
+ }
+
+ channel = EDMA_CHAN_SLOT(channel);
+ map_dmach_queue(ctlr, channel, eventq_no);
+}
+EXPORT_SYMBOL(edma_request_non_default_queue);
/**
* edma_free_channel - deallocate DMA channel
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index 923f8a3e4ce0..5d0a1b98f205 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -117,6 +117,8 @@ int edma_alloc_channel(int channel,
void *data, enum dma_event_q);
void edma_free_channel(unsigned channel);
+void edma_request_non_default_queue(int channel);
+
/* alloc/free parameter RAM slots */
int edma_alloc_slot(unsigned ctlr, int slot);
void edma_free_slot(unsigned slot);
--
1.9.0
next prev parent reply other threads:[~2014-03-13 9:18 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 9:18 [PATCH 00/18] edma/ASoC: dmaengine PCM for AM335x and AM447x Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 04/18] arm: common: edma: Select event queue 1 as default when booted with DT Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 05/18] arm: common: edma: Save the number of event queues/TCs Peter Ujfalusi
2014-03-13 9:18 ` Peter Ujfalusi [this message]
2014-03-13 9:18 ` [PATCH 07/18] DMA: edma: Use different eventq for cyclic channels Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 08/18] dma: edma: Implement device_slave_caps callback Peter Ujfalusi
[not found] ` <1394702320-21743-1-git-send-email-peter.ujfalusi-l0cyMroinI0@public.gmane.org>
2014-03-13 9:18 ` [PATCH 01/18] platform_data: edma: Be precise with the paRAM struct Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 02/18] dma: edma: Add support for DMA_PAUSE/RESUME operation Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 03/18] dma: edma: Set DMA_CYCLIC capability flag Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 09/18] dma: edma: Simplify direction configuration in edma_config_pset() Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 10/18] dma: edma: Reduce debug print verbosity for non verbose debugging Peter Ujfalusi
2014-03-13 12:53 ` Shevchenko, Andriy
[not found] ` <1394715211.28803.239.camel-XvqNBM/wLWRrdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2014-03-13 13:37 ` Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 11/18] dma: edma: Prefix debug prints where the text were identical in prep callbacks Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 12/18] dma: edma: Add channel number to debug prints Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 13/18] dma: edma: Print the direction value as well when it is not supported Peter Ujfalusi
2014-03-13 13:03 ` Shevchenko, Andriy
2014-03-13 13:40 ` Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 14/18] ASoC: davinci: Add edma dmaengine platform driver Peter Ujfalusi
2014-03-13 10:28 ` [alsa-devel] " Lars-Peter Clausen
[not found] ` <53218835.3080909-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-03-13 11:56 ` Peter Ujfalusi
2014-03-13 12:09 ` Lars-Peter Clausen
2014-03-13 13:03 ` Peter Ujfalusi
2014-03-13 13:38 ` Lars-Peter Clausen
2014-03-13 9:18 ` [PATCH 15/18] ASoC: davinci-mcasp: Use dmaengine based platform driver for AM335x/447x Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 16/18] ASoC: davinci-mcasp: Provide correct filter_data for dmaengine for non-DT boot Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 17/18] ASoC: davinci-mcasp: Assign the dma_data earlier in dai_probe callback Peter Ujfalusi
2014-03-13 9:18 ` [PATCH 18/18] ASoC: davinci-mcasp: Place constraint on the period size based on FIFO config Peter Ujfalusi
2014-03-13 13:46 ` [PATCH 00/18] edma/ASoC: dmaengine PCM for AM335x and AM447x Mark Brown
2014-03-14 9:38 ` Peter Ujfalusi
2014-03-14 10:13 ` Mark Brown
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=1394702320-21743-7-git-send-email-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=dmaengine@vger.kernel.org \
--cc=joelf@ti.com \
--cc=jsarha@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mporter@linaro.org \
--cc=nsekhar@ti.com \
--cc=tony@atomide.com \
--cc=vinod.koul@intel.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