From patchwork Tue Apr 5 22:56:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 65146 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp730732lbc; Tue, 5 Apr 2016 15:57:33 -0700 (PDT) X-Received: by 10.98.76.194 with SMTP id e63mr33933976pfj.89.1459897048073; Tue, 05 Apr 2016 15:57:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si28709260pfk.202.2016.04.05.15.57.27; Tue, 05 Apr 2016 15:57:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760182AbcDEW5X (ORCPT + 29 others); Tue, 5 Apr 2016 18:57:23 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:34310 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760002AbcDEW5Q (ORCPT ); Tue, 5 Apr 2016 18:57:16 -0400 Received: by mail-wm0-f51.google.com with SMTP id l6so42113819wml.1 for ; Tue, 05 Apr 2016 15:57:15 -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=hSnlOx+aPzj7D+z8tjm/Crvi0iUNQWBf3d6KoMRqUcE=; b=Nh4V09WHd2ZDSXXvVhmGtvGLXKcmoj9rRlnu4DrQzOnQoADL7lbvTc8HLeMKoKrkxj K95nKp3AvHDyolXH87IgfwTxN7RTicmOUk7nGqvxolqCmJq4Vn2z6pUOVawfotryQhCa ivHGaNrym8e838Ho63dYypvc9GheM+xctsnHE= 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=hSnlOx+aPzj7D+z8tjm/Crvi0iUNQWBf3d6KoMRqUcE=; b=bQ+U2T0hsvYgTa7fzjP3F8zMgClwCxCU0nUGA5cZH6WDhRJ1FChupvIrwiItKTkDPq EAOjckvgMCGuDblLVwAHA/d38hn6NseY2G/0cBqeN9zlAv4/cCgfmu3dwU9bTNimqefP zWFwx1epl2s3Ui1FdwJdOG4vzCK5MfXkVIX0EKawoWz8ElSOqPfJM5K0h0Hq/bqycHGd zRW5KzezKDThiPOlRQ7fkDaMYMgiO03wjqsDxALk9jQUey3AkpVHF8pSncPbhTGnL++2 Ijyi6kgoQ3J9OlHlM/zlMlsgUuQZwEgwpm709DixjB0kf906qMi9WiLcFJi/lTYXYh5O BfVw== X-Gm-Message-State: AD7BkJJXjJMb4JOQZmPTF5OiH+/FocVgj96/rPJRePLq8NJje0Hw2vn4tZA+Iaqq9kuBL40f X-Received: by 10.194.23.67 with SMTP id k3mr4181546wjf.177.1459897030151; Tue, 05 Apr 2016 15:57:10 -0700 (PDT) Received: from localhost.localdomain (hst-221-11.medicom.bg. [84.238.221.11]) by smtp.gmail.com with ESMTPSA id n3sm21914wja.6.2016.04.05.15.57.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Apr 2016 15:57:09 -0700 (PDT) From: Stanimir Varbanov To: Rob Herring , Mark Rutland , Vinod Koul , Andy Gross Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, Sinan Kaya , Pramod Gurav , Stanimir Varbanov Subject: [PATCH v2 2/5] dmaengine: qcom: bam_dma: clear BAM interrupt only if it is rised Date: Wed, 6 Apr 2016 01:56:19 +0300 Message-Id: <1459896982-30171-3-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459896982-30171-1-git-send-email-stanimir.varbanov@linaro.org> References: <1459896982-30171-1-git-send-email-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/dma/qcom/bam_dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 1.9.1 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; }