[PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue

Peter Ujfalusi
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

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/3] ARM: edma: Set default queue to lowest priority

Peter Ujfalusi
Use the lowest priority queue as default for clients.

Signed-off-by: Peter Ujfalusi <[hidden email]>
---
 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

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/3] ARM: edma: Add edma_assign_channel_eventq() to move channel to a give queue

Peter Ujfalusi
In reply to this post by Peter Ujfalusi
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 <[hidden email]>
---
 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

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/3] dma: edma: Serve cyclic (audio) channels with high priority queue

Peter Ujfalusi
In reply to this post by Peter Ujfalusi
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 <[hidden email]>
---
 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

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue

Peter Ujfalusi
In reply to this post by Peter Ujfalusi
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
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue

Sekhar Nori
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 <[hidden email]>

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

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/3] ARM/dma: edma: Serve cyclic clients via high priority queue

Vinod Koul-3
In reply to this post by Peter Ujfalusi
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
>

--
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source