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: Fri, 11 May 2012 14:03:52 +0100 [thread overview]
Message-ID: <20120511130352.GA6220@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CACRpkdZpC4pwSCLrZuVg9C=5u5pVQpm8c7HVmshs09wtEOcnqg@mail.gmail.com>
On Fri, May 11, 2012 at 02:24:10PM +0200, Linus Walleij wrote:
> > + * @residue: is defined as:
> > + * ? - for completed descriptor: 0
> > + * ? - for descriptors which are in DMA_PAUSED, DMA_IN_PROGRESS:
> > + * ? ? length - (current_addr - start_addr), where:
> > + * ? ? ? ? ? ? length = descriptor dma length
> > + * ? ? ? ? ? ? current_addr = current dma pointer queried for dma channel
> > + * ? ? ? ? ? ? start_addr: starting address of this descriptor
> > + * ? This is mandatory and needs to be correctly filled by driver
> > ?*/
> > Does this make it clear?
>
> Looks good to me.
There's a problem with defining it that way. Consider a scatterlist.
What does 'current address' and 'start address' mean with respect to
those transfers?
Rather than trying to define this in terms of mathematics, which will
always lead to this kind of confusion, use English instead.
- for descriptors which are in progress or paused:
the number of bytes yet to be transferred to or from the memory for
MEM2DEV or DEV2MEM transfers.
This leaves MEM2MEM and DEV2DEV transfers ambiguous - both suffer from
the problem of whether you use the source or destination pointers/lengths
to calculate the residue.
For MEM2MEM, I would suggest these should either be reported as complete
or not-complete in their entirety. (In other words, either their full
transfer size or zero.) It's racy to try to do anything else with an
in-progress transfer...
DEV2DEV I've not thought about, and I'm rather wishing we didn't have
that transfer type...
next prev parent reply other threads:[~2012-05-11 13:03 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-02 14:45 Cyclic DMA - callback properties and tx_status residue Russell King - ARM Linux
2012-05-02 16:01 ` 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 [this message]
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=20120511130352.GA6220@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).