* [question] some question about the residue
@ 2012-11-26 3:19 Elen Song
0 siblings, 0 replies; 9+ messages in thread
From: Elen Song @ 2012-11-26 3:19 UTC (permalink / raw)
To: linux-arm-kernel
Hi All:
I got a question about the residue in struct dma_tx_state:
I wondering what residue means, is it the current descriptor residue or
the total dma buffer residue?
Thanks
Best Regards
Elen Song
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121126/20b915fa/attachment-0001.html>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
@ 2012-11-26 6:43 Elen Song
2012-11-26 6:49 ` Vinod Koul
2012-11-26 10:19 ` Russell King - ARM Linux
0 siblings, 2 replies; 9+ messages in thread
From: Elen Song @ 2012-11-26 6:43 UTC (permalink / raw)
To: linux-arm-kernel
Hi All:
I got a question about the residue in struct dma_tx_state:
I wonder what residue means, is it the current descriptor residue or
the total dma buffer residue?
Thanks
Best Regards
Elen Song
--
1.7.9.5
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 6:43 Elen Song
@ 2012-11-26 6:49 ` Vinod Koul
2012-11-26 7:35 ` Elen Song
2012-11-26 10:19 ` Russell King - ARM Linux
1 sibling, 1 reply; 9+ messages in thread
From: Vinod Koul @ 2012-11-26 6:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2012-11-26 at 14:43 +0800, Elen Song wrote:
> Hi All:
>
> I got a question about the residue in struct dma_tx_state:
>
> I wonder what residue means, is it the current descriptor residue or
>
> the total dma buffer residue?
You read the status for descriptor, so it means this is residue for said
descriptor.
--
Vinod Koul
Intel Corp.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 6:49 ` Vinod Koul
@ 2012-11-26 7:35 ` Elen Song
2012-11-26 10:22 ` Russell King - ARM Linux
0 siblings, 1 reply; 9+ messages in thread
From: Elen Song @ 2012-11-26 7:35 UTC (permalink / raw)
To: linux-arm-kernel
On 2012-11-26 14:49, Vinod Koul wrote:
> On Mon, 2012-11-26 at 14:43 +0800, Elen Song wrote:
>> Hi All:
>>
>> I got a question about the residue in struct dma_tx_state:
>>
>> I wonder what residue means, is it the current descriptor residue or
>>
>> the total dma buffer residue?
> You read the status for descriptor, so it means this is residue for said
> descriptor.
>
>
Hi Koul:
Well , I don't get it , if I read the status of a LLI, is it means the
residue of total LLI length?
I saw driver/dma/amba-pl08x.c drivers/dma/coh901318.c, if read status of
a LLI, residue is the remain of LLI, not only
current descriptor.
1 patch from Russel King how he realize device_tx_status said:
[PATCH] ARM: PL08x: clean up LLI lookup
As the LLI list is an array, we can use maths to locate which LLI
index we're currently at, and then sum up the remaining LLI entries
until we reach the end of the list.
Is it right?
best regards
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 7:35 ` Elen Song
@ 2012-11-26 10:22 ` Russell King - ARM Linux
2012-11-26 10:37 ` Elen Song
0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux @ 2012-11-26 10:22 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 26, 2012 at 03:35:42PM +0800, Elen Song wrote:
> On 2012-11-26 14:49, Vinod Koul wrote:
>> On Mon, 2012-11-26 at 14:43 +0800, Elen Song wrote:
>>> Hi All:
>>>
>>> I got a question about the residue in struct dma_tx_state:
>>>
>>> I wonder what residue means, is it the current descriptor residue or
>>>
>>> the total dma buffer residue?
>> You read the status for descriptor, so it means this is residue for said
>> descriptor.
>>
>>
> Hi Koul:
>
> Well , I don't get it , if I read the status of a LLI, is it means the
> residue of total LLI length?
>
> I saw driver/dma/amba-pl08x.c drivers/dma/coh901318.c, if read status of
> a LLI, residue is the remain of LLI, not only
> current descriptor.
>
> 1 patch from Russel King how he realize device_tx_status said:
>
> [PATCH] ARM: PL08x: clean up LLI lookup
> As the LLI list is an array, we can use maths to locate which LLI
> index we're currently at, and then sum up the remaining LLI entries
> until we reach the end of the list.
>
> Is it right?
It is as far as fixing a pretty major bug in the driver, but it doesn't
fix the other bug in the driver where it sums up all outstanding
descriptors, which pre-dates the understanding of 'residue'.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 10:22 ` Russell King - ARM Linux
@ 2012-11-26 10:37 ` Elen Song
2012-11-26 10:40 ` Russell King - ARM Linux
0 siblings, 1 reply; 9+ messages in thread
From: Elen Song @ 2012-11-26 10:37 UTC (permalink / raw)
To: linux-arm-kernel
On 2012-11-26 18:22, Russell King - ARM Linux wrote:
> On Mon, Nov 26, 2012 at 03:35:42PM +0800, Elen Song wrote:
>> On 2012-11-26 14:49, Vinod Koul wrote:
>>> On Mon, 2012-11-26 at 14:43 +0800, Elen Song wrote:
>>>> Hi All:
>>>>
>>>> I got a question about the residue in struct dma_tx_state:
>>>>
>>>> I wonder what residue means, is it the current descriptor residue or
>>>>
>>>> the total dma buffer residue?
>>> You read the status for descriptor, so it means this is residue for said
>>> descriptor.
>>>
>>>
>> Hi Koul:
>>
>> Well , I don't get it , if I read the status of a LLI, is it means the
>> residue of total LLI length?
>>
>> I saw driver/dma/amba-pl08x.c drivers/dma/coh901318.c, if read status of
>> a LLI, residue is the remain of LLI, not only
>> current descriptor.
>>
>> 1 patch from Russel King how he realize device_tx_status said:
>>
>> [PATCH] ARM: PL08x: clean up LLI lookup
>> As the LLI list is an array, we can use maths to locate which LLI
>> index we're currently at, and then sum up the remaining LLI entries
>> until we reach the end of the list.
>>
>> Is it right?
> It is as far as fixing a pretty major bug in the driver, but it doesn't
> fix the other bug in the driver where it sums up all outstanding
> descriptors, which pre-dates the understanding of 'residue'.
So residue actually means current active descriptor remain, it should
not sums up all outstanding descriptors.
the way amba-p108x.c and coh901318.c is wrong , right?
best regards
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 10:37 ` Elen Song
@ 2012-11-26 10:40 ` Russell King - ARM Linux
2012-11-27 2:39 ` Elen Song
0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux @ 2012-11-26 10:40 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 26, 2012 at 06:37:28PM +0800, Elen Song wrote:
> So residue actually means current active descriptor remain, it should
No, not the current active descriptor - the transfer identified by the
cookie, and only that transfer.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 10:40 ` Russell King - ARM Linux
@ 2012-11-27 2:39 ` Elen Song
0 siblings, 0 replies; 9+ messages in thread
From: Elen Song @ 2012-11-27 2:39 UTC (permalink / raw)
To: linux-arm-kernel
On 2012-11-26 18:40, Russell King - ARM Linux wrote:
> On Mon, Nov 26, 2012 at 06:37:28PM +0800, Elen Song wrote:
>> So residue actually means current active descriptor remain, it should
> No, not the current active descriptor - the transfer identified by the
> cookie, and only that transfer.
Hi Russell King:
Thank you for your explanations.
Here I got an example, perhaps you can help me figure out if it is
correct.
//allocate a cyclic transfer with 2 descriptors, a cookie identify
current transfer.
desc = dmaengine_prep_dma_cyclic(chan,
sg_dma_address,
sg_dma_len,
sg_dma_len/2,
DMA_DEV_TO_MEM);
cookie= dmaengine_submit(desc);
//if transfer in progress, state.residue is current transfer
remain(sg_dma_len remain), not current descriptor remain(sg_dma_len/2
remain).
device_tx_status(chan,cookie, &state);
Is it right?
Best Regards
^ permalink raw reply [flat|nested] 9+ messages in thread
* [question] some question about the residue
2012-11-26 6:43 Elen Song
2012-11-26 6:49 ` Vinod Koul
@ 2012-11-26 10:19 ` Russell King - ARM Linux
1 sibling, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2012-11-26 10:19 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 26, 2012 at 02:43:17PM +0800, Elen Song wrote:
> Hi All:
>
> I got a question about the residue in struct dma_tx_state:
>
> I wonder what residue means, is it the current descriptor residue or
>
> the total dma buffer residue?
It's the number of bytes remaining to be transferred on the descriptor
identified by the cookie. If that transfer has not been started, it
will be the total number of bytes in that transfer. If it has been
completed, it will be zero. If it is in progress, it will be the number
of bytes to be transferred before the transfer identified by that cookie
is marked as complete.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-11-27 2:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26 3:19 [question] some question about the residue Elen Song
-- strict thread matches above, loose matches on Subject: below --
2012-11-26 6:43 Elen Song
2012-11-26 6:49 ` Vinod Koul
2012-11-26 7:35 ` Elen Song
2012-11-26 10:22 ` Russell King - ARM Linux
2012-11-26 10:37 ` Elen Song
2012-11-26 10:40 ` Russell King - ARM Linux
2012-11-27 2:39 ` Elen Song
2012-11-26 10:19 ` Russell King - ARM Linux
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).