From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ned Forrester Subject: Re: SPI TX andRX buffer overlap Date: Fri, 14 Nov 2008 22:53:33 -0500 Message-ID: <491E47BD.5080005@whoi.edu> References: <491C87BF.6030905@whoi.edu> <200811141430.53146.david-b@pacbell.net> <491E033E.9010008@whoi.edu> <200811141541.46799.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel , Vernon Sauder , "J. Scott Merritt" To: David Brownell Return-path: In-Reply-To: <200811141541.46799.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org David Brownell wrote: > Mapping any number of times *should* be OK -- unless one mapping > reports an error. Or you do them in the wrong order (removing > cache entries before writing their data out to memory). BINGO! That was it. pxa2xx_spi has always done dma_map_single(..., rx, ..., DMA_FROM_DEVICE) (thus invalidating the cache) before dma_map_single(..., tx, ..., DMA_TO_DEVICE) (thus copying possibly invalid data, if the buffers overlapped). Thanks, it works now with a much more pleasant patch. I never looked at it that way before. A patch will be coming soon. -- Ned Forrester nforrester-/d+BM93fTQY@public.gmane.org Oceanographic Systems Lab 508-289-2226 Applied Ocean Physics and Engineering Dept. Woods Hole Oceanographic Institution Woods Hole, MA 02543, USA http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212 http://www.whoi.edu/hpb/Site.do?id=1532 http://www.whoi.edu/page.do?pid=10079 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/