* [PATCH] dma: tegra: implement flags parameters for cyclic transfer
@ 2012-12-19 13:40 Laxman Dewangan
[not found] ` <1355924434-7930-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Laxman Dewangan @ 2012-12-19 13:40 UTC (permalink / raw)
To: djbw, vinod.koul; +Cc: linux-kernel, swarren, linux-tegra, Laxman Dewangan
The flag parameter is added in the cyclic transfer request.
Use the flag option of:
- DMA_PREP_INTERRUPT for enabling interrupt.
- DMA_CTRL_ACK for deciding whether ack is requred or not for
descriptor.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/dma/tegra20-apb-dma.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index efdfffa..bf58bb8 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -266,6 +266,7 @@ static struct tegra_dma_desc *tegra_dma_desc_get(
if (async_tx_test_ack(&dma_desc->txd)) {
list_del(&dma_desc->node);
spin_unlock_irqrestore(&tdc->lock, flags);
+ dma_desc->txd.flags = 0;
return dma_desc;
}
}
@@ -1050,7 +1051,9 @@ struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
TEGRA_APBDMA_AHBSEQ_WRAP_SHIFT;
ahb_seq |= TEGRA_APBDMA_AHBSEQ_BUS_WIDTH_32;
- csr |= TEGRA_APBDMA_CSR_FLOW | TEGRA_APBDMA_CSR_IE_EOC;
+ csr |= TEGRA_APBDMA_CSR_FLOW;
+ if (flags & DMA_PREP_INTERRUPT)
+ csr |= TEGRA_APBDMA_CSR_IE_EOC;
csr |= tdc->dma_sconfig.slave_id << TEGRA_APBDMA_CSR_REQ_SEL_SHIFT;
apb_seq |= TEGRA_APBDMA_APBSEQ_WRAP_WORD_1;
@@ -1095,7 +1098,8 @@ struct dma_async_tx_descriptor *tegra_dma_prep_dma_cyclic(
mem += len;
}
sg_req->last_sg = true;
- dma_desc->txd.flags = 0;
+ if (flags & DMA_CTRL_ACK)
+ dma_desc->txd.flags = DMA_CTRL_ACK;
/*
* Make sure that mode should not be conflicting with currently
--
1.7.1.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: implement flags parameters for cyclic transfer
[not found] ` <1355924434-7930-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-12-19 17:02 ` Stephen Warren
[not found] ` <50D1F33D.1050709-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2012-12-19 17:02 UTC (permalink / raw)
To: Laxman Dewangan
Cc: djbw-b10kYP2dOMg, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
swarren-DDmLM1+adcrQT0dZR+AlfA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On 12/19/2012 06:40 AM, Laxman Dewangan wrote:
> The flag parameter is added in the cyclic transfer request.
> Use the flag option of:
> - DMA_PREP_INTERRUPT for enabling interrupt.
> - DMA_CTRL_ACK for deciding whether ack is requred or not for
> descriptor.
Do the relevant drivers that use Tegra's DMA engine already set flags
correctly, so that this change won't cause any regressions?
Why would you not want to enable interrupts; how does a client know when
to refill the buffer?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: implement flags parameters for cyclic transfer
[not found] ` <50D1F33D.1050709-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-12-20 6:11 ` Laxman Dewangan
[not found] ` <50D2ABF7.8090308-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Laxman Dewangan @ 2012-12-20 6:11 UTC (permalink / raw)
To: Stephen Warren
Cc: djbw-b10kYP2dOMg@public.gmane.org,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Wednesday 19 December 2012 10:32 PM, Stephen Warren wrote:
> On 12/19/2012 06:40 AM, Laxman Dewangan wrote:
>> The flag parameter is added in the cyclic transfer request.
>> Use the flag option of:
>> - DMA_PREP_INTERRUPT for enabling interrupt.
>> - DMA_CTRL_ACK for deciding whether ack is requred or not for
>> descriptor.
> Do the relevant drivers that use Tegra's DMA engine already set flags
> correctly, so that this change won't cause any regressions?
>
Currently, the sound soc driver uses the cyclic mode of dma transfer and
it has already enable the proper flags. This was done recently after
adding flags in cyclic api.
Also, there was bug in our dma driver for not setting DMA_CTRL_ACK by
default for cyclic case.
This will fix the issue.
> Why would you not want to enable interrupts; how does a client know when
> to refill the buffer?
This came recently from the cyclic api after adding flags that client
can pass proper flag to enable inetrrupt or not.
Changes from Peter:
/*
commit ec8b5e48c03790a68cb875fe5064007a9cbdfdd0
Author: Peter Ujfalusi <peter.ujfalusi-l0cyMroinI0@public.gmane.org>
Date: Fri Sep 14 15:05:47 2012 +0300
dmaengine: Pass flags via device_prep_dma_cyclic() callback
Change the parameter list of device_prep_dma_cyclic() so the DMA
drivers
can receive the flags coming from clients.
This feature can be used during audio operation to disable all audio
related interrupts when the DMA_PREP_INTERRUPT is cleared from the
flags.
*/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: implement flags parameters for cyclic transfer
[not found] ` <50D2ABF7.8090308-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-12-20 16:46 ` Stephen Warren
[not found] ` <50D340E1.7040600-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2012-12-20 16:46 UTC (permalink / raw)
To: Laxman Dewangan,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: djbw-b10kYP2dOMg@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 12/19/2012 11:11 PM, Laxman Dewangan wrote:
> On Wednesday 19 December 2012 10:32 PM, Stephen Warren wrote:
>> On 12/19/2012 06:40 AM, Laxman Dewangan wrote:
>>> The flag parameter is added in the cyclic transfer request.
>>> Use the flag option of:
>>> - DMA_PREP_INTERRUPT for enabling interrupt.
>>> - DMA_CTRL_ACK for deciding whether ack is requred or not for
>>> descriptor.
>> Do the relevant drivers that use Tegra's DMA engine already set flags
>> correctly, so that this change won't cause any regressions?
>>
>
> Currently, the sound soc driver uses the cyclic mode of dma transfer and
> it has already enable the proper flags. This was done recently after
> adding flags in cyclic api.
> Also, there was bug in our dma driver for not setting DMA_CTRL_ACK by
> default for cyclic case.
> This will fix the issue.
OK. I assume "This was done recently after adding flags in cyclic api."
was a patch that went into 3.8? So, this patch is a bug-fix that should
be included in 3.8 then?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: implement flags parameters for cyclic transfer
[not found] ` <50D340E1.7040600-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-12-21 4:23 ` Laxman Dewangan
[not found] ` <50D3E44F.4060007-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Laxman Dewangan @ 2012-12-21 4:23 UTC (permalink / raw)
To: Stephen Warren
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
djbw-b10kYP2dOMg@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Thursday 20 December 2012 10:16 PM, Stephen Warren wrote:
> On 12/19/2012 11:11 PM, Laxman Dewangan wrote:
>> On Wednesday 19 December 2012 10:32 PM, Stephen Warren wrote:
>>> On 12/19/2012 06:40 AM, Laxman Dewangan wrote:
>>>> The flag parameter is added in the cyclic transfer request.
>>>> Use the flag option of:
>>>> - DMA_PREP_INTERRUPT for enabling interrupt.
>>>> - DMA_CTRL_ACK for deciding whether ack is requred or not for
>>>> descriptor.
>>> Do the relevant drivers that use Tegra's DMA engine already set flags
>>> correctly, so that this change won't cause any regressions?
>>>
>> Currently, the sound soc driver uses the cyclic mode of dma transfer and
>> it has already enable the proper flags. This was done recently after
>> adding flags in cyclic api.
>> Also, there was bug in our dma driver for not setting DMA_CTRL_ACK by
>> default for cyclic case.
>> This will fix the issue.
> OK. I assume "This was done recently after adding flags in cyclic api."
> was a patch that went into 3.8? So, this patch is a bug-fix that should
> be included in 3.8 then?
I can see this in Linux 3.7 tag.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=history;f=drivers/dma/tegra20-apb-dma.c;h=528c62dd4b00e1b52928ff66f3a54e7ae206680f;hb=29594404d7fe73cd80eaa4ee8c43dcc53970c60e
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: implement flags parameters for cyclic transfer
[not found] ` <50D3E44F.4060007-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-12-21 20:53 ` Stephen Warren
[not found] ` <50D4CC62.6080304-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2012-12-21 20:53 UTC (permalink / raw)
To: Laxman Dewangan
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
djbw-b10kYP2dOMg@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 12/20/2012 09:23 PM, Laxman Dewangan wrote:
> On Thursday 20 December 2012 10:16 PM, Stephen Warren wrote:
>> On 12/19/2012 11:11 PM, Laxman Dewangan wrote:
>>> On Wednesday 19 December 2012 10:32 PM, Stephen Warren wrote:
>>>> On 12/19/2012 06:40 AM, Laxman Dewangan wrote:
>>>>> The flag parameter is added in the cyclic transfer request.
>>>>> Use the flag option of:
>>>>> - DMA_PREP_INTERRUPT for enabling interrupt.
>>>>> - DMA_CTRL_ACK for deciding whether ack is requred or not for
>>>>> descriptor.
>>>> Do the relevant drivers that use Tegra's DMA engine already set flags
>>>> correctly, so that this change won't cause any regressions?
>>>
>>> Currently, the sound soc driver uses the cyclic mode of dma transfer and
>>> it has already enable the proper flags. This was done recently after
>>> adding flags in cyclic api.
>>> Also, there was bug in our dma driver for not setting DMA_CTRL_ACK by
>>> default for cyclic case.
>>> This will fix the issue.
>>
>> OK. I assume "This was done recently after adding flags in cyclic api."
>> was a patch that went into 3.8? So, this patch is a bug-fix that should
>> be included in 3.8 then?
>
> I can see this in Linux 3.7 tag.
So I assume that means that when Vinod applies *this* patch, it should
be Cc: stable for 3.7 and up?
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=history;f=drivers/dma/tegra20-apb-dma.c;h=528c62dd4b00e1b52928ff66f3a54e7ae206680f;hb=29594404d7fe73cd80eaa4ee8c43dcc53970c60e
I don't think that points where you want; it just shows a log of 3.7 for me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: implement flags parameters for cyclic transfer
[not found] ` <50D4CC62.6080304-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-01-07 13:52 ` Laxman Dewangan
0 siblings, 0 replies; 7+ messages in thread
From: Laxman Dewangan @ 2013-01-07 13:52 UTC (permalink / raw)
To: Stephen Warren
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
djbw-b10kYP2dOMg@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Saturday 22 December 2012 02:23 AM, Stephen Warren wrote:
> On 12/20/2012 09:23 PM, Laxman Dewangan wrote:
>> On Thursday 20 December 2012 10:16 PM, Stephen Warren wrote:
>>> On 12/19/2012 11:11 PM, Laxman Dewangan wrote:
>>>> On Wednesday 19 December 2012 10:32 PM, Stephen Warren wrote:
>>>>> On 12/19/2012 06:40 AM, Laxman Dewangan wrote:
>>>>>> The flag parameter is added in the cyclic transfer request.
>>>>>> Use the flag option of:
>>>>>> - DMA_PREP_INTERRUPT for enabling interrupt.
>>>>>> - DMA_CTRL_ACK for deciding whether ack is requred or not for
>>>>>> descriptor.
>>>>> Do the relevant drivers that use Tegra's DMA engine already set flags
>>>>> correctly, so that this change won't cause any regressions?
>>>> Currently, the sound soc driver uses the cyclic mode of dma transfer and
>>>> it has already enable the proper flags. This was done recently after
>>>> adding flags in cyclic api.
>>>> Also, there was bug in our dma driver for not setting DMA_CTRL_ACK by
>>>> default for cyclic case.
>>>> This will fix the issue.
>>> OK. I assume "This was done recently after adding flags in cyclic api."
>>> was a patch that went into 3.8? So, this patch is a bug-fix that should
>>> be included in 3.8 then?
>> I can see this in Linux 3.7 tag.
> So I assume that means that when Vinod applies *this* patch, it should
> be Cc: stable for 3.7 and up?
>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=history;f=drivers/dma/tegra20-apb-dma.c;h=528c62dd4b00e1b52928ff66f3a54e7ae206680f;hb=29594404d7fe73cd80eaa4ee8c43dcc53970c60e
> I don't think that points where you want; it just shows a log of 3.7 for me.
Oops, I just wanted to say that 3.7 branch and history of
drivers/dma/tegra20-apb-dma.c shows the above change of inclusion of flags.
Seems link is messed up.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-01-07 13:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-19 13:40 [PATCH] dma: tegra: implement flags parameters for cyclic transfer Laxman Dewangan
[not found] ` <1355924434-7930-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-19 17:02 ` Stephen Warren
[not found] ` <50D1F33D.1050709-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-12-20 6:11 ` Laxman Dewangan
[not found] ` <50D2ABF7.8090308-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-20 16:46 ` Stephen Warren
[not found] ` <50D340E1.7040600-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-12-21 4:23 ` Laxman Dewangan
[not found] ` <50D3E44F.4060007-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-21 20:53 ` Stephen Warren
[not found] ` <50D4CC62.6080304-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-07 13:52 ` Laxman Dewangan
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).