[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpo=BHGukSQJJGUS=H++qzxME3aEEQZR8QiyHPU8LabHsSw@mail.gmail.com>
Date: Wed, 23 Jan 2013 14:52:17 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Vinod Koul <vinod.koul@...el.com>, linux-kernel@...r.kernel.org,
spear-devel <spear-devel@...t.st.com>
Subject: Re: [PATCH 2/2] dw_dmac: return proper residue value
On 23 January 2013 14:42, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> Ah, you mean the dma_cookie_status returns DMA_SUCCESS in case
> active_list is empty, don't you?
Bingo!!
> Yesterday I spent in testing of different approaches. First of all, the
> calculation of the sent amount is nicer when ctlhi/ctllo is used and it
> works fine. But the approach, when we substract length of sent
> descriptors, is losing data. Namely, we have no information how big is
> the master descriptor (it has total length of the entire chain). So, I'm
> thinking how to solve this one. Otherwise it seems simpler than mine
> first idea.
I was planning to give you another review comment which i thought i will
give later :)
It looks to be a bit wrong to have individual lengths in all descriptors leaving
the first one :)
This is the descriptor struct:
struct dw_desc {
/* FIRST values the hardware uses */
struct dw_lli lli;
/* THEN values for driver housekeeping */
struct list_head desc_node;
struct list_head tx_list;
struct dma_async_tx_descriptor txd;
size_t len;
};
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?
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists