From patchwork Tue Aug 14 13:49:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 1319461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A1FABDF215 for ; Tue, 14 Aug 2012 13:56:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T1HXH-0000wa-59; Tue, 14 Aug 2012 13:51:56 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T1HVr-0000YS-FZ for linux-arm-kernel@lists.infradead.org; Tue, 14 Aug 2012 13:50:31 +0000 Received: by mail-wi0-f171.google.com with SMTP id hq4so3564551wib.0 for ; Tue, 14 Aug 2012 06:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=LCimGjI2K23xoG+i8PazdfyTkJewlesMYwoJwnV7864=; b=Z7H6urjeM2seSivaRNk+jO4VfbVnErPEZaq5YK8jC+eqxDlQx8z9LxxPjCWn4dMwT2 1JLqUOKX5CweeoInOrYtngpVhmQndt6QXGy49uE6xNF19vHGzJTbZcIuBIE5tXdjH3yW CD2tFDc58p0jyAd8iaLUf3gLZ+4tLfFmO0csDFK6a5YdZ0X9QCGVc0eR8pDlE7OCsNiu T8teqdJNQ7WP21sPRwWwKfCq+pIutTdxHVd2l3iNcJDl/qmjMOF37c7YDeWESIsygtbC VTWFL+yEqjEpsNoxmRZmkEjvmeWq1ypZ+m/56nzg8HSRv6HC1GnWAkosZr4ScKJcHpNk yBXQ== Received: by 10.216.195.212 with SMTP id p62mr8186790wen.217.1344952226939; Tue, 14 Aug 2012 06:50:26 -0700 (PDT) Received: from localhost.localdomain (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPS id eu4sm22509397wib.2.2012.08.14.06.50.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Aug 2012 06:50:26 -0700 (PDT) From: Richard Genoud To: Nicolas Ferre Subject: [PATCH 05/23] spi/atmel_spi: call unmapping on transfers buffers Date: Tue, 14 Aug 2012 15:49:19 +0200 Message-Id: <1344952177-18385-6-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1344952177-18385-1-git-send-email-richard.genoud@gmail.com> References: <1344952177-18385-1-git-send-email-richard.genoud@gmail.com> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.171 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richard.genoud[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Nicolas Ferre , Jean-Christophe PLAGNIOL-VILLARD , linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Nicolas Ferre Signed-off-by: Nicolas Ferre Signed-off-by: Uwe Kleine-König --- drivers/spi/spi-atmel.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index a83f470..39285ef 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1011,6 +1011,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); @@ -1022,9 +1023,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); }