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: 7775891 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D8D229F30B for ; Sat, 5 Dec 2015 17:00:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 242A4204F6 for ; Sat, 5 Dec 2015 17:00:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60BBB202C8 for ; Sat, 5 Dec 2015 17:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754901AbbLEQ7y (ORCPT ); Sat, 5 Dec 2015 11:59:54 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33594 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754222AbbLEQ5O (ORCPT ); Sat, 5 Dec 2015 11:57:14 -0500 Received: by lfr20 with SMTP id 20so12911432lfr.0; 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 Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vladimir_zapolskiy@mentor.com, jiada_wang@mentor.com 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> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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);