From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.jf.intel.com>,
Viresh Kumar <viresh.linux@gmail.com>,
linux-kernel@vger.kernel.org,
spear-devel <spear-devel@list.st.com>
Subject: Re: [PATCH 2/2] dw_dmac: return proper residue value
Date: Tue, 22 Jan 2013 09:24:51 +0200 [thread overview]
Message-ID: <1358839491.12502.41.camel@smile> (raw)
In-Reply-To: <20130121142205.GB26562@intel.com>
On Mon, 2013-01-21 at 06:22 -0800, Vinod Koul wrote:
> On Mon, Jan 21, 2013 at 11:45:51AM +0200, Andy Shevchenko wrote:
> > > > + return 0;
> > > hmmm, why not use BLOCK_TS value. That way you dont need to look at direction
> > > and along with burst can easily calculate residue...
> >
> > Do you mean to read CTL hi/lo and do
> >
> > desc->len - ctlhi.block_ts * ctllo.src_tr_width?
> >
> Yes
> > I think it could be not precise when memory-to-peripheral transfer is
> > going on. In that case you probably will have src_tr_width like 32 bits,
> > meanwhile peripheral may receive only byte stream.
> Nope that is not the case.
> SAR/DAR is always incremented in src/dstn_tr_width granularity. For example if
> you are using MEM to DMA, then SAR will always increment in case of x86 in 4byte
> granularity as we will read bursts not singles.
>
> Also if check the spec, it says "Once the transfer starts, the read-back value is the
> total number of data items already read from the source peripheral, regardless of
> what is the flow controller"
>
> So basically you get what is read from buffer in case of MEM->PER and get what
> is read from FIFO in case of PER->MEM which IMO gives you better or equal results
> than your calulation.
I will try this. Indeed I don't like usage of direction as well, and
your solution seems much clear in that sense.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2013-01-22 7:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 9:00 [PATCH 1/2] dw_dmac: fill len field of the descriptor Andy Shevchenko
2013-01-21 9:00 ` [PATCH 2/2] dw_dmac: return proper residue value Andy Shevchenko
2013-01-21 8:49 ` Vinod Koul
2013-01-21 9:45 ` Andy Shevchenko
2013-01-21 14:22 ` Vinod Koul
2013-01-22 7:24 ` Andy Shevchenko [this message]
2013-01-22 8:11 ` Viresh Kumar
2013-01-22 9:22 ` Andy Shevchenko
2013-01-22 9:40 ` Viresh Kumar
2013-01-23 9:12 ` Andy Shevchenko
2013-01-23 9:22 ` Viresh Kumar
2013-01-23 9:36 ` Andy Shevchenko
2013-01-23 9:51 ` Viresh Kumar
2013-01-23 10:20 ` Andy Shevchenko
2013-01-23 10:24 ` Viresh Kumar
2013-01-23 10:33 ` Andy Shevchenko
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=1358839491.12502.41.camel@smile \
--to=andriy.shevchenko@linux.intel.com \
--cc=andriy.shevchenko@linux.jf.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spear-devel@list.st.com \
--cc=vinod.koul@intel.com \
--cc=viresh.linux@gmail.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.