From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756469AbXIZAEi (ORCPT ); Tue, 25 Sep 2007 20:04:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750878AbXIZAEb (ORCPT ); Tue, 25 Sep 2007 20:04:31 -0400 Received: from netops-testserver-4-out.sgi.com ([192.48.171.29]:60990 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751558AbXIZAEa (ORCPT ); Tue, 25 Sep 2007 20:04:30 -0400 From: akepner@sgi.com Date: Tue, 25 Sep 2007 17:03:30 -0700 To: Grant Grundler , Jesse Barnes , Jes Sorensen , Randy Dunlap , David Miller , Roland Dreier Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/4] dma: document dma_flags_set_dmaflush() Message-ID: <20070926000330.GN30013@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Document dma_flags_set_dmaflush(). Signed-off-by: Arthur Kepner -- DMA-mapping.txt | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt index e07f253..31e3234 100644 --- a/Documentation/DMA-mapping.txt +++ b/Documentation/DMA-mapping.txt @@ -745,7 +745,30 @@ to "Closing". 2.5., page+offset is always used, and the "address" field has been deleted. -2) More to come... +2) Platforms that permit DMA reordering + + At least one platform (SGI SN2) allows DMA to be reordered between + device and host memory. This reordering can happen in the NUMA + interconnect, and it usually results in correct operation and improved + performance. In some situations it may be necessary to explicitly + synchronize DMA from the device. For example, if the device does a DMA + write to indicate that data is ready, the DMA of the "completion + indication" can race with DMA of data. In this situation, + dma_flags_set_dmaflush() can be used to associate a "dmaflush" + attribute with a memory region. The dmaflush attribute will cause in- + flight DMA from the device to be flushed to host memory when the + associated memory region is written. (On platforms that don't permit + DMA reordering, this is a no-op.) + + For example, you might map the memory region used for completion + indications as follows: + + int count, flags = dma_flags_set_dmaflush(DMA_BIDIRECTIONAL); + ..... + count = dma_map_sg(dev, sglist, nents, flags); + + +3) More to come... Handling Errors