From patchwork Tue Aug 17 22:08:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 120022 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7HMeqsP032198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Aug 2010 22:48:11 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OlUpu-0006nq-VI; Tue, 17 Aug 2010 22:40:50 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OlUpu-0006nj-1h for spi-devel-general@lists.sourceforge.net; Tue, 17 Aug 2010 22:40:50 +0000 X-ACL-Warn: Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]) by sog-mx-3.v43.ch3.sourceforge.com with smtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OlUps-0000wU-NK for spi-devel-general@lists.sourceforge.net; Tue, 17 Aug 2010 22:40:50 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKTGsP6YsCmgP/hXUiNMFDp1aF/YFER8XI@postini.com; Tue, 17 Aug 2010 22:40:48 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9FAD381; Tue, 17 Aug 2010 22:08:58 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1F2A14A3F; Tue, 17 Aug 2010 22:08:58 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id E974724C075; Wed, 18 Aug 2010 00:08:57 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.1.393.1; Wed, 18 Aug 2010 00:08:57 +0200 From: Linus Walleij To: Grant Likely , Date: Wed, 18 Aug 2010 00:08:44 +0200 Message-ID: <1282082924-25809-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 X-Spam-Score: 1.2 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.2 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OlUps-0000wU-NK Cc: yuanyabin1978@sina.com, Dan Williams , Russell King , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: [spi-devel-general] [PATCH] SPI: remove superfluous DMA buffer syncs on PL022 X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 17 Aug 2010 22:48:19 +0000 (UTC) diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index 59b3948..521d3d9 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c @@ -794,12 +794,7 @@ static void dma_callback(void *data) struct pl022 *pl022 = data; struct spi_message *msg = pl022->cur_msg; - /* Sync in RX buffer to CPU */ BUG_ON(!pl022->sgt_rx.sgl); - dma_sync_sg_for_cpu(&pl022->adev->dev, - pl022->sgt_rx.sgl, - pl022->sgt_rx.nents, - DMA_FROM_DEVICE); #ifdef VERBOSE_DEBUG /* @@ -812,6 +807,11 @@ static void dma_callback(void *data) struct scatterlist *sg; unsigned int i; + dma_sync_sg_for_cpu(&pl022->adev->dev, + pl022->sgt_rx.sgl, + pl022->sgt_rx.nents, + DMA_FROM_DEVICE); + for_each_sg(pl022->sgt_rx.sgl, sg, pl022->sgt_rx.nents, i) { dev_dbg(&pl022->adev->dev, "SPI RX SG ENTRY: %d", i); print_hex_dump(KERN_ERR, "SPI RX: ", @@ -1001,12 +1001,6 @@ static int configure_dma(struct pl022 *pl022) if (sglen != pages) goto err_tx_sgmap; - /* Synchronize the TX scatterlist, invalidate buffers, caches etc */ - dma_sync_sg_for_device(&pl022->adev->dev, - pl022->sgt_tx.sgl, - pl022->sgt_tx.nents, - DMA_TO_DEVICE); - /* Send both scatterlists */ rxdesc = rxchan->device->device_prep_slave_sg(rxchan, pl022->sgt_rx.sgl,