From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Cyclic DMA - callback properties and tx_status residue
Date: Wed, 2 May 2012 15:45:55 +0100 [thread overview]
Message-ID: <20120502144555.GA4456@n2100.arm.linux.org.uk> (raw)
Dan, Vinod,
What is the desired behaviour of the callback for cyclic DMA?
My understanding is:
1. Such callbacks will be made from tasklet context.
2. Exactly one callback will be issued for every 'period' of the transfer
which has completed.
My main reason for asking is point (2) - because tasklets have a property
which means that they are guaranteed to run exactly once after a
tasklet_schedule() call even if there are further tasklet_schedule()
calls before the tasklet is actually run. This property can lead to
dropped callbacks unless DMA engine authors have thought about this.
Alternatively, we could document that for cyclic transfers, one callback
will be made after the expiry of a period or number of periods. In
other words, if two periods expire before we issue the callback, the
user will only get _one_ callback issued. In that case, we definitely
need some way to determine the DMA position...
The next issue is this tx_status method, and the residue bytes returned.
There seems to be quite a bit of confusion over what this is, and what
it should be, and its relationship to the passed in cookie. The drivers
I've seen using it appear to total up the number of pending bytes to
be transferred for every transfer which has been issued. This seems
wrong to me, I think it should be the number of bytes left until the
transfer with the specified cookie has completed.
Moreover, what's the requirement here when we're using cyclic transfers?
If we take that same definition, then, because cyclic transfers never
complete, effectively they have an infinite number of bytes. That's not
useful. What would be more useful is if this was defined as the number
of bytes to the end of the cyclic buffer - or something similar. That
then would allow the current DMA position to be determined for applications
like ASoC to know how much of the buffer it could refill with new data.
next reply other threads:[~2012-05-02 14:45 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-02 14:45 Russell King - ARM Linux [this message]
2012-05-02 16:01 ` Cyclic DMA - callback properties and tx_status residue Vinod Koul
2012-05-02 16:27 ` Russell King - ARM Linux
2012-05-04 12:26 ` Russell King - ARM Linux
2012-05-04 12:45 ` Vinod Koul
2012-05-10 22:54 ` Russell King - ARM Linux
2012-05-11 3:00 ` Vinod Koul
2012-05-11 12:24 ` Linus Walleij
2012-05-11 13:03 ` Russell King - ARM Linux
2012-05-15 5:02 ` Vinod Koul
2012-05-09 9:27 ` Linus Walleij
2012-05-09 9:33 ` Russell King - ARM Linux
2012-05-09 11:16 ` Mark Brown
2012-05-09 12:19 ` Russell King - ARM Linux
2012-05-09 12:49 ` Lars-Peter Clausen
2012-05-09 14:03 ` Mark Brown
2012-05-10 3:44 ` Vinod Koul
2012-05-10 7:44 ` Russell King - ARM Linux
2012-05-10 10:58 ` Vinod Koul
2012-05-10 13:19 ` Huang Shijie
2012-05-10 14:54 ` Vinod Koul
2012-05-10 9:42 ` Mark Brown
2012-05-10 11:01 ` Vinod Koul
2012-05-11 14:02 ` Mark Brown
2012-05-11 14:07 ` Russell King - ARM Linux
2012-05-11 14:18 ` Mark Brown
2012-05-11 14:29 ` Russell King - ARM Linux
2012-05-11 15:07 ` Mark Brown
2012-05-15 5:07 ` Vinod Koul
2012-05-15 7:37 ` Russell King - ARM Linux
2012-05-15 8:58 ` Vinod Koul
2012-05-09 12:35 ` Lars-Peter Clausen
2012-05-07 10:40 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120502144555.GA4456@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).