Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756782AbYBDPcV (ORCPT ); Mon, 4 Feb 2008 10:32:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752438AbYBDPcH (ORCPT ); Mon, 4 Feb 2008 10:32:07 -0500 Received: from nat-132.atmel.no ([80.232.32.132]:63311 "EHLO relay.atmel.no" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753784AbYBDPcF (ORCPT ); Mon, 4 Feb 2008 10:32:05 -0500 Date: Mon, 4 Feb 2008 16:32:00 +0100 From: Haavard Skinnemoen To: "Dan Williams" Cc: "David Brownell" , linux-kernel@vger.kernel.org, "Shannon Nelson" , kernel@avr32linux.org, "Francis Moreau" , "Paul Mundt" , "Vladimir A. Barinov" , "Pierre Ossman" Subject: Re: [RFC v2 0/5] dmaengine: Slave DMA interface and example users Message-ID: <20080204163200.550481a7@dhcp-252-066.norway.atmel.com> In-Reply-To: References: <1201630213-31900-1-git-send-email-hskinnemoen@atmel.com> <20080129215453.1e3758ab@siona> <200801292256.14553.david-b@pacbell.net> <20080130095641.39eaad13@dhcp-252-066.norway.atmel.com> Organization: Atmel Norway X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.5; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2032 Lines: 47 On Wed, 30 Jan 2008 10:39:47 -0700 "Dan Williams" wrote: > Agreed, the issue is how to do this without requiring an > interrupt+callback sequence for each transaction or requiring the > client to carry per transaction unmap-data. For example NET_DMA never > sees a dma_addr_t and assumes that all it needs to care about is the > last transaction in a sequence. Since it is alive for the duration of > a transaction, we could put unmap data in dma_async_tx_descriptor > along with an unmap function pointer since dma_unmap* routines have an > equal number of parameters. But I just got through making this > structure smaller so maybe there is a better way. I have to say I'm not crazy about the idea of adding more callbacks to the descriptor... The client must somehow know when the transfer is complete -- after all, it has to call async_tx_ack() at some point. So additional callbacks shouldn't be needed. How about adding more variants of the "ack" function -- one for each kind of transfer? For example, after an async_memcpy() transaction is complete, the client must call async_memcpy_ack(), which could be an inline function containing something along the lines of static inline void async_memcpy_ack(struct dma_async_tx_descriptor *tx) { struct dma_device *dma = tx->chan->device; dma_unmap_page(dma->dev, tx->src_phys, tx->len, DMA_TO_DEVICE); dma_unmap_page(dma->dev, tx->dst_phys, tx->len, DMA_FROM_DEVICE); async_tx_ack(tx); } which would evaluate to just async_tx_ack(tx) in most cases, since dma_unmap_page() usually doesn't actually do anything. This requires three additional fields in the dma_async_tx_descriptor structure, but in many cases the driver needs these fields in its own private descriptor wrapper anyway. Haavard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/