All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Vinod Koul <vinod.koul@intel.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: Wed, 23 Jan 2013 15:21:42 +0530	[thread overview]
Message-ID: <CAKohpo=_BR49Og4MRPB9SfDEwnD3OoKwFWiCsTKNfpYFSyp25Q@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VeNe1Z9CqYXVjV6am_vg=5XF=vx1i47h71xRdTvT6hSGA@mail.gmail.com>

On 23 January 2013 15:06, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Wed, Jan 23, 2013 at 11:22 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:

>> Firstly i believe we can have a union of both list_heads as only one is used
>> at any time. Can you patch it down?
>
> Okay, separately and later to avoid additional testing. Will it work for you?

Yes.

>> Second to solve your problem, you can add another field here: total_len.
>> I know it will consume 4 bytes per desc but i think that's the drawback we need
>> to accept.
>
> I found already better solution I guess.

Wow!!

> I introduced two functions to get amount of sent bytes like
>
> u32 calc_sent(u32 ctlhi, u32 ctllo)
> {
>  return f1(ctlhi) * f2(ctllo);
> }
>
> u32 get_sent(dwc)
> {
>  return calc_sent(read(CTL_HI), read(CTL_LO));
> }
>
> And usage like
>
> /* initial residue */
> desc->len - calc_sent(desc->lli.ctlhi, desc->lli.ctllo).
>
> What do you think?

You plan to use it for
- the first descriptor in a list as others already have length embedded in them?
- And the descriptor currently getting used, by reading its ctlhi/lo
from registers
  instead of lli.*** ?

Looks good. but still keeping len of individual descriptors in all
descriptors leaving
the first one is not the code i would like to keep :)

  reply	other threads:[~2013-01-23  9:51 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
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 [this message]
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='CAKohpo=_BR49Og4MRPB9SfDEwnD3OoKwFWiCsTKNfpYFSyp25Q@mail.gmail.com' \
    --to=viresh.kumar@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spear-devel@list.st.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.