Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933604Ab3CSHry (ORCPT ); Tue, 19 Mar 2013 03:47:54 -0400 Received: from nasmtp01.atmel.com ([192.199.1.245]:27914 "EHLO DVREDG01.corp.atmel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932304Ab3CSHrx (ORCPT ); Tue, 19 Mar 2013 03:47:53 -0400 From: Wenyou Yang To: CC: , , , , , , , , Subject: [PATCH v7 04/14] spi/spi-atmel: call unmapping on transfers buffers Date: Tue, 19 Mar 2013 15:44:22 +0800 Message-ID: <1363679062-3797-1-git-send-email-wenyou.yang@atmel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363678866-3567-1-git-send-email-wenyou.yang@atmel.com> References: <1363678866-3567-1-git-send-email-wenyou.yang@atmel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1600 Lines: 45 From: Nicolas Ferre Signed-off-by: Nicolas Ferre Cc: spi-devel-general@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org [wenyou.yang@atmel.com: submit the patch] Signed-off-by: Wenyou Yang --- 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 f3e1cd8..e3af244 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1049,6 +1049,7 @@ static int 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); @@ -1060,9 +1061,10 @@ static int 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); } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/