From patchwork Mon Apr 11 08:38:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 8798691 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 CB9F2C0554 for ; Mon, 11 Apr 2016 08:49:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 029A520272 for ; Mon, 11 Apr 2016 08:49:26 +0000 (UTC) Received: from bombadil.infradead.org (unknown [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 298BD201CD for ; Mon, 11 Apr 2016 08:49:25 +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 1apXOL-0006yZ-0j; Mon, 11 Apr 2016 08:40:17 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1apXNo-0005ux-Pt for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2016 08:39:46 +0000 Received: by mail-wm0-x22f.google.com with SMTP id f198so135440287wme.0 for ; Mon, 11 Apr 2016 01:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=knX78BHhl5HDgPLV00HEcBAPZqv/5QALHwNlsklolXg=; b=a7/0i+hBQAmga0qgUc8lQvFdJhpNuXF6/TxrdicKKV31dTRNXesWflFvY8pCC2p8mL 6GJLRm7gpZVJyU369+5UXuZY4IE7vyQ9ma8AVXdS6R7XzFP8LDwcSjPtbclVMNHMDoze SY7Y1anGQNZ2ed12n5kjRnYM4pFd7BkTQuS7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=knX78BHhl5HDgPLV00HEcBAPZqv/5QALHwNlsklolXg=; b=Utm10byqOK921vjIL51Y9h+hF6kz1wM2R5jrXpn+O7oA/ogqgINkIvfT5dpaedAwQ9 RqYI1rRhFKbhjyL0YoG6bvjoDqZls/G3hBD/iHVJaglID3piC0/7fp8qjMbR2X3anrXd k/K86B5fK1XJiTs6roPNX2ZQyDNVXvndPQurabN4RhQDtoPtXKbAyXNwG1foh5ZVYypD Yug3NCjSZe3hp3mdXZjka1JJMg+1zd9lWJHkETd/vVK1YcL5Ou7abZ0iZjtwbd3NvdXw h+G2jYwTEaISuocDmRzBMS42y0MfmQvUU1/ZzTv7MbrxCrZFtYsFKZ4HI+M87QQJCjI2 hhKA== X-Gm-Message-State: AD7BkJLYUnhG8e6LBLGmQrWmcC+bh9vLQq1BRpJZL5rHXfirJJzPrO11ew+xN61ZLpUFK0gO X-Received: by 10.194.243.226 with SMTP id xb2mr22216183wjc.35.1460363963015; Mon, 11 Apr 2016 01:39:23 -0700 (PDT) Received: from mms734.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id d1sm16078604wmh.18.2016.04.11.01.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 01:39:22 -0700 (PDT) From: Stanimir Varbanov To: Rob Herring , Mark Rutland , Vinod Koul , Andy Gross Subject: [PATCH v3 2/6] dmaengine: qcom: bam_dma: clear BAM interrupt only if it is raised Date: Mon, 11 Apr 2016 11:38:39 +0300 Message-Id: <1460363923-16296-3-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1460363923-16296-1-git-send-email-stanimir.varbanov@linaro.org> References: <1460363923-16296-1-git-send-email-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160411_013945_146222_A25DD486 X-CRM114-Status: GOOD ( 13.53 ) 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: devicetree@vger.kernel.org, Archit Taneja , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Stanimir Varbanov , Sinan Kaya , dmaengine@vger.kernel.org, Pramod Gurav , linux-arm-kernel@lists.infradead.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=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RDNS_NONE,T_DKIM_INVALID,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 Currently we write BAM_IRQ_CLR register with zero even when no BAM_IRQ occured. This write has some bad side effects when the BAM instance is for the crypto engine. In case of crypto engine some of the BAM registers are xPU protected and they cannot be controlled by the driver. Signed-off-by: Stanimir Varbanov Reviewed-by: Andy Gross Tested-by: Pramod Gurav --- drivers/dma/qcom/bam_dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index a486bc0f82e0..789d5f836bf7 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -801,13 +801,17 @@ static irqreturn_t bam_dma_irq(int irq, void *data) if (srcs & P_IRQ) tasklet_schedule(&bdev->task); - if (srcs & BAM_IRQ) + if (srcs & BAM_IRQ) { clr_mask = readl_relaxed(bam_addr(bdev, 0, BAM_IRQ_STTS)); - /* don't allow reorder of the various accesses to the BAM registers */ - mb(); + /* + * don't allow reorder of the various accesses to the BAM + * registers + */ + mb(); - writel_relaxed(clr_mask, bam_addr(bdev, 0, BAM_IRQ_CLR)); + writel_relaxed(clr_mask, bam_addr(bdev, 0, BAM_IRQ_CLR)); + } return IRQ_HANDLED; }