diff mbox

dma: tegra: implement flags parameters for cyclic transfer

Message ID 1355924434-7930-1-git-send-email-ldewangan@nvidia.com
State Not Applicable, archived
Headers show

Commit Message

Laxman Dewangan Dec. 19, 2012, 1:40 p.m. UTC
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(-)

Comments

Stephen Warren Dec. 19, 2012, 5:02 p.m. UTC | #1
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?

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laxman Dewangan Dec. 20, 2012, 6:11 a.m. UTC | #2
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@ti.com>
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.
*/

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Warren Dec. 20, 2012, 4:46 p.m. UTC | #3
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?
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laxman Dewangan Dec. 21, 2012, 4:23 a.m. UTC | #4
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
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Warren Dec. 21, 2012, 8:53 p.m. UTC | #5
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laxman Dewangan Jan. 7, 2013, 1:52 p.m. UTC | #6
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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