From patchwork Sat Dec 5 16:56:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Bondarenko X-Patchwork-Id: 7775831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D76F1BEEE1 for ; Sat, 5 Dec 2015 16:59:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E8392034A for ; Sat, 5 Dec 2015 16:59:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B396202C8 for ; Sat, 5 Dec 2015 16:59:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a5G9c-0003Np-KD; Sat, 05 Dec 2015 16:57:48 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a5G9O-0003FN-KJ for linux-arm-kernel@lists.infradead.org; Sat, 05 Dec 2015 16:57:35 +0000 Received: by lfu94 with SMTP id 94so12904339lfu.1 for ; Sat, 05 Dec 2015 08:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4wSp3gL7qOQRNJQqMA1ynxzmm2BGvgY1uJOdUpCQg3E=; b=qhCLB7mf5Lt8jc+RFxCrGUWks5afujmJcG2FYbgj0PKoXmQV5atDJLcP1RBdXeKKYv z0/EDslFUMoEMbrIi1LkhqMD2sjUHpt2Xc8DjNoTgLT9Yp44OLqkan/uNZnuKlwRq3ms 0G3e2ChCCNtQAQKmMWYjCgDkKk4A8j1gRLLQssnrKO+4Mwx0dT/zMzhr5aIISiL7BByt uGvAezVpxKSbplkwVzk47cSFAufqCT6xVZXCUYnsS2I194GQWlTsB8EAZQDAJsbmA63R tDKeKl3vzkdmT9GreWetHHfLK/nyYRXAbReLwtC4J1M1uMqUVbGxK7X02Vh1IwySNmei LZbg== X-Received: by 10.25.43.146 with SMTP id r140mr8747115lfr.140.1449334632687; Sat, 05 Dec 2015 08:57:12 -0800 (PST) Received: from localhost.localdomain (c-89-233-200-205.cust.bredband2.com. [89.233.200.205]) by smtp.gmail.com with ESMTPSA id tv8sm164546lbb.27.2015.12.05.08.57.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Dec 2015 08:57:12 -0800 (PST) From: Anton Bondarenko To: broonie@kernel.org, b38343@freescale.com, s.hauer@pengutronix.de Subject: [PATCH v5 01/11] spi: imx: terminate RX DMA transaction in case of TX DMA timeout Date: Sat, 5 Dec 2015 17:56:59 +0100 Message-Id: <1449334629-4715-2-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1449334629-4715-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1449334629-4715-1-git-send-email-anton.bondarenko.sama@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151205_085734_932423_0B205507 X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiada_wang@mentor.com, vladimir_zapolskiy@mentor.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Not only TX DMA should be terminated, but RX DMA also. It's required to avoid accidential DMA memory writes from RX DMA channel and properly terminate transaction. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 0e5723a..fb3bcc4 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -958,6 +958,7 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx, dev_driver_string(&master->dev), dev_name(&master->dev)); dmaengine_terminate_all(master->dma_tx); + dmaengine_terminate_all(master->dma_rx); } else { timeout = wait_for_completion_timeout( &spi_imx->dma_rx_completion, IMX_DMA_TIMEOUT);