From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [IPv6:2002:4e20:1eda::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 61453B6EE6 for ; Tue, 6 Mar 2012 20:00:20 +1100 (EST) Date: Tue, 6 Mar 2012 08:59:39 +0000 From: Russell King - ARM Linux To: H Hartley Sweeten Subject: Re: [PATCH 6/9] dmaengine: consolidate tx_status functions Message-ID: <20120306085939.GC17370@n2100.arm.linux.org.uk> References: <20120305201411.GA17791@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: Russell King - ARM Linux Cc: Viresh Kumar , Stephen Warren , Linus Walleij , Srinidhi Kasagar , Vinod Koul , Zhang Wei , Barry Song , Dan Williams , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Mar 05, 2012 at 06:12:50PM -0600, H Hartley Sweeten wrote: > On Monday, March 05, 2012 1:17 PM, Russell King wrote: > > diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h > > index 47e0997..244a2c5 100644 > > --- a/drivers/dma/dmaengine.h > > +++ b/drivers/dma/dmaengine.h > > @@ -45,4 +45,35 @@ static inline void dma_cookie_complete(struct dma_async_tx_descriptor *tx) > > tx->cookie = 0; > > } > > > > +/** > > + * dma_cookie_status - report cookie status > > + * @chan: dma channel > > + * @cookie: cookie we are interested in > > + * @state: dma_tx_state structure to return last/used cookies > > + * > > + * Report the status of the cookie, filling in the state structure if > > + * non-NULL. No locking is required. > > + */ > > +static inline enum dma_status dma_cookie_status(struct dma_chan *chan, > > + dma_cookie_t cookie, struct dma_tx_state *state) > > +{ > > + dma_cookie_t used, complete; > > + > > + used = chan->cookie; > > + complete = chan->complete; > > + barrier(); > > + if (state) { > > + state->last = complete; > > + state->used = used; > > + state->residue = 0; > > + } > > Isn't this dma_set_tx_state()? It's more than dma_set_tx_state(). It is my intention to get rid of dma_set_tx_state() in favour of these implementations. > > + return dma_async_is_complete(cookie, complete, used); > > +} > > Regards, > Hartley >