* DMA: get data count of descriptor in dmaengine
@ 2012-09-07 9:59 Song, Elen
2012-09-07 10:35 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Song, Elen @ 2012-09-07 9:59 UTC (permalink / raw)
To: linux-arm-kernel
Hi All:
When I am developing using dma for uart receive, I found a problem.
I use a cyclic dma transfer and set descriptor transfer size to lk,
only receive 1k bytes(descriptor transfer done) that will call an interrupt.
If I receive 1 byte, there will happened nothing except my peripherals have timeout function.
Fortunately, I got timeout function in uart peripheral, in timeout handler, I can receive data from uart.
But I do not know how many data I have receive, so there should be a count register in dma.
I found the count register but I do not found correlative api in dmaengine, I think we should add one.
Even during a single or multi buffer transfer, knowing how many data has been transfer in current descriptor is necessary.
Through that, we will not lose a data.
So there should be an api to get current descriptor receive data count.
Or we could get current descriptor status , the status with count value?
I submit an patch to retrieve descriptor data transfer size.
We use this to get data count .
We use Atmel dma, but it could be a common demand.
FYI & Best Regards
Elen Song
^ permalink raw reply [flat|nested] 3+ messages in thread
* DMA: get data count of descriptor in dmaengine
2012-09-07 9:59 DMA: get data count of descriptor in dmaengine Song, Elen
@ 2012-09-07 10:35 ` Russell King - ARM Linux
2012-09-10 3:26 ` Song, Elen
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-09-07 10:35 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Sep 07, 2012 at 09:59:17AM +0000, Song, Elen wrote:
> Hi All:
>
> When I am developing using dma for uart receive, I found a problem.
> I use a cyclic dma transfer and set descriptor transfer size to lk,
> only receive 1k bytes(descriptor transfer done) that will call an interrupt.
>
> If I receive 1 byte, there will happened nothing except my peripherals have timeout function.
> Fortunately, I got timeout function in uart peripheral, in timeout handler, I can receive data from uart.
> But I do not know how many data I have receive, so there should be a count register in dma.
>
> I found the count register but I do not found correlative api in dmaengine, I think we should add one.
> Even during a single or multi buffer transfer, knowing how many data has been transfer in current descriptor is necessary.
> Through that, we will not lose a data.
>
> So there should be an api to get current descriptor receive data count.
> Or we could get current descriptor status , the status with count value?
>
> I submit an patch to retrieve descriptor data transfer size.
> We use this to get data count .
> We use Atmel dma, but it could be a common demand.
See dmaengine_tx_status() - the residue is returned in struct dma_tx_state.
See the PL011 UART driver to see how this is used with a timeout interrupt.
^ permalink raw reply [flat|nested] 3+ messages in thread
* DMA: get data count of descriptor in dmaengine
2012-09-07 10:35 ` Russell King - ARM Linux
@ 2012-09-10 3:26 ` Song, Elen
0 siblings, 0 replies; 3+ messages in thread
From: Song, Elen @ 2012-09-10 3:26 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russel:
>-----Original Message-----
>From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
>Sent: 2012?9?7? 18:36
>To: Song, Elen
>Cc: djbw at fb.com; Ferre, Nicolas; Lin, JM; Wu, Josh;
>linux-arm-kernel at lists.infradead.org
>Subject: Re: DMA: get data count of descriptor in dmaengine
>
>On Fri, Sep 07, 2012 at 09:59:17AM +0000, Song, Elen wrote:
>> Hi All:
>>
>> When I am developing using dma for uart receive, I found a problem.
>> I use a cyclic dma transfer and set descriptor transfer size to lk,
>> only receive 1k bytes(descriptor transfer done) that will call an interrupt.
>>
>> If I receive 1 byte, there will happened nothing except my peripherals have
>timeout function.
>> Fortunately, I got timeout function in uart peripheral, in timeout handler, I
>can receive data from uart.
>> But I do not know how many data I have receive, so there should be a count
>register in dma.
>>
>> I found the count register but I do not found correlative api in dmaengine, I
>think we should add one.
>> Even during a single or multi buffer transfer, knowing how many data has
>been transfer in current descriptor is necessary.
>> Through that, we will not lose a data.
>>
>> So there should be an api to get current descriptor receive data count.
>> Or we could get current descriptor status , the status with count value?
>>
>> I submit an patch to retrieve descriptor data transfer size.
>> We use this to get data count .
>> We use Atmel dma, but it could be a common demand.
>
>See dmaengine_tx_status() - the residue is returned in struct dma_tx_state.
>See the PL011 UART driver to see how this is used with a timeout interrupt.
Thanks, I will check!
Best regards
Elen song
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-10 3:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 9:59 DMA: get data count of descriptor in dmaengine Song, Elen
2012-09-07 10:35 ` Russell King - ARM Linux
2012-09-10 3:26 ` Song, Elen
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).