mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Walleij <linus.ml.walleij@gmail.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	Dan Williams <dan.j.williams@intel.com>,
	linux-kernel@vger.kernel.org,
	Maciej Sosnowski <maciej.sosnowski@intel.com>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Pavel Machek <pavel@ucw.cz>, Li Yang <leoli@freescale.com>,
	Paul Mundt <lethal@linux-sh.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Haavard Skinnemoen <haavard.skinnemoen@atmel.com>,
	Magnus Damm <damm@opensource.se>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Joe Perches <joe@perches.com>, Roland Dreier <rdreier@cisco.com>
Subject: Re: [PATCH 2/2] DMAENGINE: generic channel status
Date: Fri, 26 Mar 2010 00:18:49 +0100	[thread overview]
Message-ID: <63386a3d1003251618q5786df4eoae906d6e3b6b4b3e@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1003252146070.4413@axis700.grange>

2010/3/25 Guennadi Liakhovetski <g.liakhovetski@gmx.de>:

> General: you converted all drivers to the new .device_tx_status() API, but
> since they don't implement "residue," you left it uninitialised
> everywhere. Wouldn't it be better to set it to 0 or total length,
> depending on the complete / not complete status?

The total length is a bit hard to know without understanding all drivers
I'm afraid, but I can sure add txtstatus->residue = 0; everywhere,
I'll fix.

>> +struct dma_tx_state {
>> +     dma_cookie_t last;
>> +     dma_cookie_t used;
>> +     u32 residue;
>
> In the original proposal by Dan Williams the last member was "unsigned
> long pos." I don't think, even on 64-bit systems anyone would kick off a >
> 4GB transfer, but who knows... And - I don't particularly like the name
> "pos," but I do like the idea of returning bytes transfered better, than
> bytes left. Can we change this?

As Dan says consistency with other systems suggests something
residue or bytes_left.

>> - * @device_is_tx_complete: poll for transaction completion
>> + * @device_tx_status: poll for transaction completion, the optional
>> + *   txstate parameter can be supplied with a pointer to get a
>> + *   struct with some transfer information, else the call will just
>
> Maybe "with auxiliary transfer status information, otherwise..."

OK

>> @@ -572,7 +592,13 @@ static inline void dma_async_issue_pending(struct dma_chan *chan)
>>  static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
>>       dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
>>  {
>> -     return chan->device->device_is_tx_complete(chan, cookie, last, used);
>> +     struct dma_tx_state state;
>> +     enum dma_status status;
>> +
>> +     status = chan->device->device_tx_status(chan, cookie, &state);
>> +     *last = state.last;
>> +     *used = state.used;
>
> Both last and used can be NULL.

Good you spotted this! Thanks.

Linus

      parent reply	other threads:[~2010-03-25 23:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 15:03 Linus Walleij
2010-03-25 15:07 ` Mark Brown
2010-03-25 20:58 ` Guennadi Liakhovetski
2010-03-25 22:00   ` Dan Williams
2010-03-25 22:37     ` Guennadi Liakhovetski
2010-03-26  0:05       ` Dan Williams
2010-03-25 23:18   ` Linus Walleij [this message]

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=63386a3d1003251618q5786df4eoae906d6e3b6b4b3e@mail.gmail.com \
    --to=linus.ml.walleij@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=damm@opensource.se \
    --cc=dan.j.williams@intel.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=joe@perches.com \
    --cc=leoli@freescale.com \
    --cc=lethal@linux-sh.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=maciej.sosnowski@intel.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=pavel@ucw.cz \
    --cc=ralf@linux-mips.org \
    --cc=rdreier@cisco.com \
    /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

all inboxes | Powered by JetHome®