public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: wangx@marvell•com (Xiang Wang)
To: linux-arm-kernel@lists•infradead.org
Subject: [v3 1/2] dma: mmp_pdma: add support for residue reporting
Date: Fri, 16 Aug 2013 15:57:53 +0800	[thread overview]
Message-ID: <520DDB81.20607@marvell.com> (raw)
In-Reply-To: <1376497189-21298-1-git-send-email-zonque@gmail.com>

On 08/15/2013 12:19 AM, Daniel Mack wrote:
> In order to report the channel's residue, we have to memorize the first
> dma buffer position when the channel is configured.
>
> Signed-off-by: Daniel Mack <zonque@gmail•com>
> ---
>   drivers/dma/mmp_pdma.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
>   1 file changed, 43 insertions(+), 2 deletions(-)
>

> +static unsigned int mmp_pdma_residue(struct mmp_pdma_chan *chan)
> +{
> +	struct mmp_pdma_desc_sw *sw;
> +	u32 curr, done = 0;
> +
> +	if (chan->dir == DMA_DEV_TO_MEM)
> +		curr = readl(chan->phy->base + DTADR(chan->phy->idx));
One concern for this patch:
If we call dmaengine_tx_status() after dma_do_tasklet at mmp_pdma.c, 
chan->phy will most likely to be NULL.
dma_do_tasklet() -> start_pending_queue() -> mmp_pdma_free_phy()

For why do we call dmaengine_tx_status() after a DMA interrupt:
briefly, if we use DMA to handle device trailing bytes, it'll report a 
DMA interrupt. We need to get to know how many bytes have been received 
in the IRQ handler.
We've discussed about this in the link below:
http://thread.gmane.org/gmane.linux.kernel/1500713

-- 
Regards,
Xiang

  parent reply	other threads:[~2013-08-16  7:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 16:19 [v3 1/2] dma: mmp_pdma: add support for residue reporting Daniel Mack
2013-08-14 16:23 ` Russell King - ARM Linux
2013-08-15  1:57 ` Chao Xie
2013-08-15  3:44   ` Daniel Mack
2013-08-15  8:08     ` Chao Xie
2013-08-15 18:12       ` Daniel Mack
2013-08-16  2:21         ` Chao Xie
2013-08-16  7:57 ` Xiang Wang [this message]
2013-08-16 15:40   ` Daniel Mack

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=520DDB81.20607@marvell.com \
    --to=wangx@marvell$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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