From patchwork Sun Jan 1 03:27:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 6012 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B7D4323E07 for ; Sun, 1 Jan 2012 03:27:57 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 98877A1841C for ; Sun, 1 Jan 2012 03:27:57 +0000 (UTC) Received: by eaac11 with SMTP id c11so13804702eaa.11 for ; Sat, 31 Dec 2011 19:27:57 -0800 (PST) Received: by 10.205.141.78 with SMTP id jd14mr10011700bkc.107.1325388477344; Sat, 31 Dec 2011 19:27:57 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs287064bkc; Sat, 31 Dec 2011 19:27:56 -0800 (PST) Received: by 10.50.12.196 with SMTP id a4mr47003274igc.9.1325388474418; Sat, 31 Dec 2011 19:27:54 -0800 (PST) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id fs2si30537119igc.13.2011.12.31.19.27.53 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 31 Dec 2011 19:27:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: by iagf6 with SMTP id f6so32394215iag.37 for ; Sat, 31 Dec 2011 19:27:53 -0800 (PST) Received: by 10.50.214.42 with SMTP id nx10mr34936070igc.0.1325388473083; Sat, 31 Dec 2011 19:27:53 -0800 (PST) Received: from localhost.localdomain ([114.95.105.23]) by mx.google.com with ESMTPS id b20sm147206239ibj.7.2011.12.31.19.27.46 (version=SSLv3 cipher=OTHER); Sat, 31 Dec 2011 19:27:52 -0800 (PST) From: Richard Zhao To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: kernel@pengutronix.de, shawn.guo@linaro.org, vinod.koul@intel.com, dan.j.williams@intel.com, eric.miao@linaro.org, patches@linaro.org, Richard Zhao Subject: [PATCH] dma/imx-sdma: add wmb before enable/run a channel Date: Sun, 1 Jan 2012 11:27:40 +0800 Message-Id: <1325388460-20678-1-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.4.1 dma_alloc_coherent memory may be bufferable. We need to add nececcary memory barrier. Signed-off-by: Richard Zhao --- drivers/dma/imx-sdma.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 2ebb2bc..8cd9492 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -403,6 +403,7 @@ static int sdma_run_channel(struct sdma_channel *sdmac) init_completion(&sdmac->done); + wmb(); __raw_writel(1 << channel, sdma->regs + SDMA_H_START); ret = wait_for_completion_timeout(&sdmac->done, HZ); @@ -809,6 +810,7 @@ out: static void sdma_enable_channel(struct sdma_engine *sdma, int channel) { + wmb(); __raw_writel(1 << channel, sdma->regs + SDMA_H_START); }