All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonas Jensen <jonas.jensen@gmail.com>
Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, arm@kernel.org,
	vinod.koul@intel.com, djbw@fb.com, arnd@arndb.de,
	linux@arm.linux.org.uk, mark.rutland@arm.com,
	andriy.shevchenko@linux.intel.com
Subject: Re: [PATCH v14] dmaengine: Add MOXA ART DMA engine driver
Date: Fri, 13 Dec 2013 17:02:58 +0100	[thread overview]
Message-ID: <52AB2FB2.7000009@metafoo.de> (raw)
In-Reply-To: <1386851534-11288-1-git-send-email-jonas.jensen@gmail.com>

On 12/12/2013 01:32 PM, Jonas Jensen wrote:
> The MOXA ART SoC has a DMA controller capable of offloading expensive
> memory operations, such as large copies. This patch adds support for
> the controller including four channels. Two of these are used to
> handle MMC copy on the UC-7112-LX hardware. The remaining two can be
> used in a future audio driver or client application.
> 
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
> ---
[...]
> +static size_t moxart_dma_desc_size_in_flight(struct moxart_chan *ch)
> +{
> +	size_t size;
> +	unsigned int completed_cycles, cycles, i;
> +
> +	for (size = i = 0; i <= ch->sgidx; i++)
> +		size += ch->desc->sg[i].len;

This still does not look right. The residue is the amount of data that still
needs to be transferred, so you need to count the the segments that have not
been completed yet. Just like I wrote in the last mail loop from ch->sgidx
to ch->desc->sglen.

> +	cycles = readl(ch->base + REG_OFF_CYCLES);
> +	completed_cycles = (ch->desc->dma_cycles - cycles);
> +	size -= completed_cycles << es_bytes[ch->desc->es];
> +
> +	dev_dbg(chan2dev(&ch->vc.chan), "%s: size=%zu\n", __func__, size);
> +
> +	return size;
> +}
[...]

WARNING: multiple messages have this Message-ID (diff)
From: lars@metafoo.de (Lars-Peter Clausen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v14] dmaengine: Add MOXA ART DMA engine driver
Date: Fri, 13 Dec 2013 17:02:58 +0100	[thread overview]
Message-ID: <52AB2FB2.7000009@metafoo.de> (raw)
In-Reply-To: <1386851534-11288-1-git-send-email-jonas.jensen@gmail.com>

On 12/12/2013 01:32 PM, Jonas Jensen wrote:
> The MOXA ART SoC has a DMA controller capable of offloading expensive
> memory operations, such as large copies. This patch adds support for
> the controller including four channels. Two of these are used to
> handle MMC copy on the UC-7112-LX hardware. The remaining two can be
> used in a future audio driver or client application.
> 
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
> ---
[...]
> +static size_t moxart_dma_desc_size_in_flight(struct moxart_chan *ch)
> +{
> +	size_t size;
> +	unsigned int completed_cycles, cycles, i;
> +
> +	for (size = i = 0; i <= ch->sgidx; i++)
> +		size += ch->desc->sg[i].len;

This still does not look right. The residue is the amount of data that still
needs to be transferred, so you need to count the the segments that have not
been completed yet. Just like I wrote in the last mail loop from ch->sgidx
to ch->desc->sglen.

> +	cycles = readl(ch->base + REG_OFF_CYCLES);
> +	completed_cycles = (ch->desc->dma_cycles - cycles);
> +	size -= completed_cycles << es_bytes[ch->desc->es];
> +
> +	dev_dbg(chan2dev(&ch->vc.chan), "%s: size=%zu\n", __func__, size);
> +
> +	return size;
> +}
[...]

  reply	other threads:[~2013-12-13 16:02 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10  8:51 [PATCH] dmaengine: Add MOXA ART DMA engine driver Jonas Jensen
2013-07-10  8:51 ` Jonas Jensen
2013-07-10  9:30 ` Russell King - ARM Linux
2013-07-10  9:30   ` Russell King - ARM Linux
2013-07-10  9:48   ` Jonas Jensen
2013-07-10  9:48     ` Jonas Jensen
2013-07-10 12:43 ` [PATCH v2] " Jonas Jensen
2013-07-10 12:43   ` Jonas Jensen
2013-07-17 10:06   ` [PATCH v3] " Jonas Jensen
2013-07-17 10:06     ` Jonas Jensen
2013-07-29 13:44     ` [PATCH v4] " Jonas Jensen
2013-07-29 13:44       ` Jonas Jensen
2013-07-29 16:35       ` Arnd Bergmann
2013-07-29 16:35         ` Arnd Bergmann
2013-08-02 12:28         ` Jonas Jensen
2013-08-02 12:28           ` Jonas Jensen
2013-08-02 19:28           ` Arnd Bergmann
2013-08-02 19:28             ` Arnd Bergmann
2013-08-02 12:03       ` [PATCH v5] " Jonas Jensen
2013-08-02 12:03         ` Jonas Jensen
2013-08-02 13:28         ` [PATCH v6] " Jonas Jensen
2013-08-02 13:28           ` Jonas Jensen
2013-08-02 13:51           ` Russell King - ARM Linux
2013-08-02 13:51             ` Russell King - ARM Linux
2013-08-02 14:09           ` Mark Rutland
2013-08-02 14:09             ` Mark Rutland
2013-08-05 14:37           ` [PATCH v7] " Jonas Jensen
2013-08-05 14:37             ` Jonas Jensen
2013-08-05 16:57             ` Mark Rutland
2013-08-05 16:57               ` Mark Rutland
2013-08-05 20:49             ` Arnd Bergmann
2013-08-05 20:49               ` Arnd Bergmann
2013-08-06 12:38             ` [PATCH v8] " Jonas Jensen
2013-08-06 12:38               ` Jonas Jensen
2013-08-06 18:42               ` Arnd Bergmann
2013-08-06 18:42                 ` Arnd Bergmann
2013-08-07 15:13               ` Mark Rutland
2013-08-07 15:13                 ` Mark Rutland
2013-10-07 13:42                 ` Jonas Jensen
2013-10-07 13:42                   ` Jonas Jensen
2013-10-07 13:13               ` [PATCH v9] " Jonas Jensen
2013-10-07 13:13                 ` Jonas Jensen
2013-10-07 14:10                 ` [PATCH v10] " Jonas Jensen
2013-10-07 14:10                   ` Jonas Jensen
2013-10-07 15:12                   ` Mark Rutland
2013-10-07 15:12                     ` Mark Rutland
2013-10-07 15:12                     ` Mark Rutland
2013-10-08  9:53                     ` Jonas Jensen
2013-10-08  9:53                       ` Jonas Jensen
2013-10-08  9:53                       ` Jonas Jensen
2013-10-08 12:55                       ` Mark Rutland
2013-10-08 12:55                         ` Mark Rutland
2013-10-08 12:55                         ` Mark Rutland
2013-10-08  8:42                   ` [PATCH v11] " Jonas Jensen
2013-10-08  8:42                     ` Jonas Jensen
2013-11-13 13:59                     ` Vinod Koul
2013-11-13 13:59                       ` Vinod Koul
2013-11-13 17:16                       ` Arnd Bergmann
2013-11-13 17:16                         ` Arnd Bergmann
2013-12-06 14:27                     ` [PATCH v12] " Jonas Jensen
2013-12-06 14:27                       ` Jonas Jensen
2013-12-11 15:13                       ` [PATCH v13] " Jonas Jensen
2013-12-11 15:13                         ` Jonas Jensen
2013-12-11 21:27                         ` Arnd Bergmann
2013-12-11 21:27                           ` Arnd Bergmann
2013-12-12  9:16                         ` Andy Shevchenko
2013-12-12  9:16                           ` Andy Shevchenko
2013-12-12 12:32                         ` [PATCH v14] " Jonas Jensen
2013-12-12 12:32                           ` Jonas Jensen
2013-12-13 16:02                           ` Lars-Peter Clausen [this message]
2013-12-13 16:02                             ` Lars-Peter Clausen
2013-12-16 10:24                           ` [PATCH v15] " Jonas Jensen
2013-12-16 10:24                             ` Jonas Jensen
2014-01-17  8:46                             ` [PATCH v16] " Jonas Jensen
2014-01-17  8:46                               ` Jonas Jensen
     [not found]                               ` <1389948365-13999-1-git-send-email-jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-01-17 13:29                                 ` Fwd: " Jonas Jensen
2014-01-17 14:42                               ` Arnd Bergmann
2014-01-17 14:42                                 ` Arnd Bergmann
2014-01-20  7:07                               ` Vinod Koul
2014-01-20  7:07                                 ` Vinod Koul

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=52AB2FB2.7000009@metafoo.de \
    --to=lars@metafoo.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arm@kernel.org \
    --cc=arnd@arndb.de \
    --cc=djbw@fb.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jonas.jensen@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=vinod.koul@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.