From patchwork Thu Mar 26 23:55:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Branden X-Patchwork-Id: 6102841 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 A034CBF90F for ; Thu, 26 Mar 2015 23:58:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D22FA2044B for ; Thu, 26 Mar 2015 23:58:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0329A20443 for ; Thu, 26 Mar 2015 23:58:33 +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 1YbHcz-0004ps-2e; Thu, 26 Mar 2015 23:55:57 +0000 Received: from mail-gw1-out.broadcom.com ([216.31.210.62]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YbHcr-0004hV-W6 for linux-arm-kernel@lists.infradead.org; Thu, 26 Mar 2015 23:55:51 +0000 X-IronPort-AV: E=Sophos;i="5.11,476,1422950400"; d="scan'208";a="60708307" Received: from irvexchcas07.broadcom.com (HELO IRVEXCHCAS07.corp.ad.broadcom.com) ([10.9.208.55]) by mail-gw1-out.broadcom.com with ESMTP; 26 Mar 2015 17:05:55 -0700 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 26 Mar 2015 16:55:20 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.174.1; Thu, 26 Mar 2015 16:55:20 -0700 Received: from mail.broadcom.com (unknown [10.136.13.65]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id A17E6410A1; Thu, 26 Mar 2015 16:53:57 -0700 (PDT) From: Scott Branden To: Dan Williams , Vinod Koul Subject: [PATCH] dmaengine: pl330: fix the race condition in pl330 driver. Date: Thu, 26 Mar 2015 16:55:05 -0700 Message-ID: <1427414105-3480-1-git-send-email-sbranden@broadcom.com> X-Mailer: git-send-email 2.3.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150326_165550_081280_21786064 X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) Cc: Scott Branden , linux-kernel@vger.kernel.org, ismail , Anatol Pomazao , Dmitry Torokhov , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: ismail Update the thread running index before issuing the GO command to the DMAC. Tested-by: Mohamed Ismail Abdul Packir Mohamed Reviewed-by: Ray Jui Reviewed-by: Arun Parameswaran Reviewed-by: Scott Branden Signed-off-by: Scott Branden Signed-off-by: Mohamed Ismail Abdul Packir Mohamed --- drivers/dma/pl330.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 0e1f567..631642d 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1072,11 +1072,11 @@ static bool _trigger(struct pl330_thread *thrd) /* Set to generate interrupts for SEV */ writel(readl(regs + INTEN) | (1 << thrd->ev), regs + INTEN); + thrd->req_running = idx; + /* Only manager can execute GO */ _execute_DBGINSN(thrd, insn, true); - thrd->req_running = idx; - return true; }