From patchwork Mon Nov 12 08:52:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 1726821 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork1.kernel.org (Postfix) with ESMTP id 3CFFE3FCAE for ; Mon, 12 Nov 2012 08:56:20 +0000 (UTC) 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.76) (envelope-from ) id 1TXpoZ-0007yL-Al; Mon, 12 Nov 2012 08:56:19 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1TXpoY-0007yG-0M for spi-devel-general@lists.sourceforge.net; Mon, 12 Nov 2012 08:56:18 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of atmel.com designates 204.2.163.5 as permitted sender) client-ip=204.2.163.5; envelope-from=Wenyou.Yang@atmel.com; helo=sjogate2.atmel.com; Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1TXpoX-00042o-7B for spi-devel-general@lists.sourceforge.net; Mon, 12 Nov 2012 08:56:17 +0000 Received: from penbh01.corp.atmel.com ([10.168.5.31]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id qAC8oZEF029478; Mon, 12 Nov 2012 00:51:00 -0800 (PST) Received: from penmb01.corp.atmel.com ([10.168.5.33]) by penbh01.corp.atmel.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Nov 2012 16:55:57 +0800 Received: from shaarm01.corp.atmel.com ([10.217.6.34]) by penmb01.corp.atmel.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Nov 2012 16:55:56 +0800 From: Wenyou Yang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/17] spi/atmel_spi: call unmapping on transfers buffers Date: Mon, 12 Nov 2012 16:52:24 +0800 Message-Id: <1352710357-3265-5-git-send-email-wenyou.yang@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352710357-3265-1-git-send-email-wenyou.yang@atmel.com> References: <1352710357-3265-1-git-send-email-wenyou.yang@atmel.com> X-OriginalArrivalTime: 12 Nov 2012 08:55:57.0238 (UTC) FILETIME=[87B99D60:01CDC0B3] X-Spam-Score: -1.7 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1TXpoX-00042o-7B Cc: spi-devel-general@lists.sourceforge.net, JM.Lin@atmel.com, nicolas.ferre@atmel.com, wenyou.yang@atmel.com 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: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net From: Nicolas Ferre Signed-off-by: Nicolas Ferre Cc: grant.likely@secretlab.ca Cc: spi-devel-general@lists.sourceforge.net --- drivers/spi/spi-atmel.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index 2e040be..fc1222a 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1010,6 +1010,7 @@ static int __devexit atmel_spi_remove(struct platform_device *pdev) struct spi_master *master = platform_get_drvdata(pdev); struct atmel_spi *as = spi_master_get_devdata(master); struct spi_message *msg; + struct spi_transfer *xfer; /* reset the hardware and block queue progress */ spin_lock_irq(&as->lock); @@ -1021,9 +1022,10 @@ static int __devexit atmel_spi_remove(struct platform_device *pdev) /* Terminate remaining queued transfers */ list_for_each_entry(msg, &as->queue, queue) { - /* REVISIT unmapping the dma is a NOP on ARM and AVR32 - * but we shouldn't depend on that... - */ + list_for_each_entry(xfer, &msg->transfers, transfer_list) { + if (!msg->is_dma_mapped) + atmel_spi_dma_unmap_xfer(master, xfer); + } msg->status = -ESHUTDOWN; msg->complete(msg->context); }