* [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue
@ 2014-07-08 10:46 Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 1/3] ARM: edma: Set default queue to lowest priority Peter Ujfalusi
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2014-07-08 10:46 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
It is preferred that audio is served with the highest priority queue in order to
avoid delays in data transfer between memory and audio IP.
The following series will add an API to arch code to assign a channel to a given
queue.
The default queue is changed from 0 (highest priority) to lowest priority.
In the dmaengine driver we move the cyclic channel to queue0 (highest priority)
and move it back to default queue when the channel is terminated.
Regards,
Peter
---
Peter Ujfalusi (3):
ARM: edma: Set default queue to lowest priority
ARM: edma: Add edma_assign_channel_eventq() to move channel to a give
queue
dma: edma: Serve cyclic (audio) channels with high priority queue
arch/arm/common/edma.c | 31 ++++++++++++++++++++++++++++++-
drivers/dma/edma.c | 8 ++++++++
include/linux/platform_data/edma.h | 2 ++
3 files changed, 40 insertions(+), 1 deletion(-)
--
2.0.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] ARM: edma: Set default queue to lowest priority
2014-07-08 10:46 [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue Peter Ujfalusi
@ 2014-07-08 10:46 ` Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 2/3] ARM: edma: Add edma_assign_channel_eventq() to move channel to a give queue Peter Ujfalusi
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2014-07-08 10:46 UTC (permalink / raw)
To: linux-arm-kernel
Use the lowest priority queue as default for clients.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/common/edma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 485be42519b9..f834aae7720f 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1470,7 +1470,8 @@ static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
queue_priority_map[i][1] = -1;
pdata->queue_priority_mapping = queue_priority_map;
- pdata->default_queue = 0;
+ /* Default queue has the lowest priority */
+ pdata->default_queue = i - 1;
return 0;
}
--
2.0.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ARM: edma: Add edma_assign_channel_eventq() to move channel to a give queue
2014-07-08 10:46 [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 1/3] ARM: edma: Set default queue to lowest priority Peter Ujfalusi
@ 2014-07-08 10:46 ` Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 3/3] dma: edma: Serve cyclic (audio) channels with high priority queue Peter Ujfalusi
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2014-07-08 10:46 UTC (permalink / raw)
To: linux-arm-kernel
In some cases it is desired to move a channel to a specific event queue.
Such a use case is audio, where it is preferred that it is served with
highest priority compared to other DMA clients.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
arch/arm/common/edma.c | 28 ++++++++++++++++++++++++++++
include/linux/platform_data/edma.h | 2 ++
2 files changed, 30 insertions(+)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index f834aae7720f..88099175fc56 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1414,6 +1414,34 @@ void edma_clear_event(unsigned channel)
}
EXPORT_SYMBOL(edma_clear_event);
+/*
+ * edma_assign_channel_eventq - move given channel to desired eventq
+ * Arguments:
+ * channel - channel number
+ * eventq_no - queue to move the channel
+ *
+ * Can be used to move a channel to a selected event queue.
+ */
+void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no)
+{
+ unsigned ctlr;
+
+ ctlr = EDMA_CTLR(channel);
+ channel = EDMA_CHAN_SLOT(channel);
+
+ if (channel >= edma_cc[ctlr]->num_channels)
+ return;
+
+ /* default to low priority queue */
+ if (eventq_no == EVENTQ_DEFAULT)
+ eventq_no = edma_cc[ctlr]->default_queue;
+ if (eventq_no >= edma_cc[ctlr]->num_tc)
+ return;
+
+ map_dmach_queue(ctlr, channel, eventq_no);
+}
+EXPORT_SYMBOL(edma_assign_channel_eventq);
+
static int edma_setup_from_hw(struct device *dev, struct edma_soc_info *pdata,
struct edma *edma_cc)
{
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index eb8d5627d080..bdb2710e2aab 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -150,6 +150,8 @@ void edma_clear_event(unsigned channel);
void edma_pause(unsigned channel);
void edma_resume(unsigned channel);
+void edma_assign_channel_eventq(unsigned channel, enum dma_event_q eventq_no);
+
struct edma_rsv_info {
const s16 (*rsv_chans)[2];
--
2.0.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] dma: edma: Serve cyclic (audio) channels with high priority queue
2014-07-08 10:46 [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 1/3] ARM: edma: Set default queue to lowest priority Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 2/3] ARM: edma: Add edma_assign_channel_eventq() to move channel to a give queue Peter Ujfalusi
@ 2014-07-08 10:46 ` Peter Ujfalusi
2014-07-28 6:12 ` [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via " Peter Ujfalusi
2014-07-28 11:34 ` Vinod Koul
4 siblings, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2014-07-08 10:46 UTC (permalink / raw)
To: linux-arm-kernel
Move the DMA channel used in cyclic mode (audio) to the highest priority
event queue which helps to reduce audio problems.
When the channel is terminated, move it back to the default queue.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/edma.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index b512caf46944..fe55f78ea137 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -256,8 +256,13 @@ static int edma_terminate_all(struct edma_chan *echan)
* echan->edesc is NULL and exit.)
*/
if (echan->edesc) {
+ int cyclic = echan->edesc->cyclic;
echan->edesc = NULL;
edma_stop(echan->ch_num);
+ /* Move the cyclic channel back to default queue */
+ if (cyclic)
+ edma_assign_channel_eventq(echan->ch_num,
+ EVENTQ_DEFAULT);
}
vchan_get_all_descriptors(&echan->vchan, &head);
@@ -724,6 +729,9 @@ static struct dma_async_tx_descriptor *edma_prep_dma_cyclic(
edesc->pset[i].param.opt |= TCINTEN;
}
+ /* Place the cyclic channel to highest priority queue */
+ edma_assign_channel_eventq(echan->ch_num, EVENTQ_0);
+
return vchan_tx_prep(&echan->vchan, &edesc->vdesc, tx_flags);
}
--
2.0.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue
2014-07-08 10:46 [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue Peter Ujfalusi
` (2 preceding siblings ...)
2014-07-08 10:46 ` [PATCH 3/3] dma: edma: Serve cyclic (audio) channels with high priority queue Peter Ujfalusi
@ 2014-07-28 6:12 ` Peter Ujfalusi
2014-07-28 6:32 ` Sekhar Nori
2014-07-28 11:34 ` Vinod Koul
4 siblings, 1 reply; 7+ messages in thread
From: Peter Ujfalusi @ 2014-07-28 6:12 UTC (permalink / raw)
To: linux-arm-kernel
On 07/08/2014 01:46 PM, Peter Ujfalusi wrote:
> Hi,
>
> It is preferred that audio is served with the highest priority queue in order to
> avoid delays in data transfer between memory and audio IP.
>
> The following series will add an API to arch code to assign a channel to a given
> queue.
> The default queue is changed from 0 (highest priority) to lowest priority.
> In the dmaengine driver we move the cyclic channel to queue0 (highest priority)
> and move it back to default queue when the channel is terminated.
ping?
>
> Regards,
> Peter
> ---
> Peter Ujfalusi (3):
> ARM: edma: Set default queue to lowest priority
> ARM: edma: Add edma_assign_channel_eventq() to move channel to a give
> queue
> dma: edma: Serve cyclic (audio) channels with high priority queue
>
> arch/arm/common/edma.c | 31 ++++++++++++++++++++++++++++++-
> drivers/dma/edma.c | 8 ++++++++
> include/linux/platform_data/edma.h | 2 ++
> 3 files changed, 40 insertions(+), 1 deletion(-)
>
--
P?ter
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue
2014-07-28 6:12 ` [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via " Peter Ujfalusi
@ 2014-07-28 6:32 ` Sekhar Nori
0 siblings, 0 replies; 7+ messages in thread
From: Sekhar Nori @ 2014-07-28 6:32 UTC (permalink / raw)
To: linux-arm-kernel
On Monday 28 July 2014 11:42 AM, Peter Ujfalusi wrote:
> On 07/08/2014 01:46 PM, Peter Ujfalusi wrote:
>> Hi,
>>
>> It is preferred that audio is served with the highest priority queue in order to
>> avoid delays in data transfer between memory and audio IP.
>>
>> The following series will add an API to arch code to assign a channel to a given
>> queue.
>> The default queue is changed from 0 (highest priority) to lowest priority.
This should not really change any performance behavior as everything at
highest priority is same as everything at lowest priority.
>> In the dmaengine driver we move the cyclic channel to queue0 (highest priority)
>> and move it back to default queue when the channel is terminated.
>
> ping?
For 1/3 and 2/3:
Acked-by: Sekhar Nori <nsekhar@ti.com>
Vinod, can you take the series together with your tree (if you are happy
with the series, that is)? I don't have anything else queued for this
merge window.
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue
2014-07-08 10:46 [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue Peter Ujfalusi
` (3 preceding siblings ...)
2014-07-28 6:12 ` [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via " Peter Ujfalusi
@ 2014-07-28 11:34 ` Vinod Koul
4 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2014-07-28 11:34 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 08, 2014 at 01:46:35PM +0300, Peter Ujfalusi wrote:
> Hi,
>
> It is preferred that audio is served with the highest priority queue in order to
> avoid delays in data transfer between memory and audio IP.
>
> The following series will add an API to arch code to assign a channel to a given
> queue.
> The default queue is changed from 0 (highest priority) to lowest priority.
> In the dmaengine driver we move the cyclic channel to queue0 (highest priority)
> and move it back to default queue when the channel is terminated.
Applied, thanks
--
~Vinod
>
> Regards,
> Peter
> ---
> Peter Ujfalusi (3):
> ARM: edma: Set default queue to lowest priority
> ARM: edma: Add edma_assign_channel_eventq() to move channel to a give
> queue
> dma: edma: Serve cyclic (audio) channels with high priority queue
>
> arch/arm/common/edma.c | 31 ++++++++++++++++++++++++++++++-
> drivers/dma/edma.c | 8 ++++++++
> include/linux/platform_data/edma.h | 2 ++
> 3 files changed, 40 insertions(+), 1 deletion(-)
>
> --
> 2.0.0
>
--
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-07-28 11:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 10:46 [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 1/3] ARM: edma: Set default queue to lowest priority Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 2/3] ARM: edma: Add edma_assign_channel_eventq() to move channel to a give queue Peter Ujfalusi
2014-07-08 10:46 ` [PATCH 3/3] dma: edma: Serve cyclic (audio) channels with high priority queue Peter Ujfalusi
2014-07-28 6:12 ` [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via " Peter Ujfalusi
2014-07-28 6:32 ` Sekhar Nori
2014-07-28 11:34 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).