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: 8756501 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 BE4D8C0553 for ; Tue, 5 Apr 2016 22:59:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2F58202EC for ; Tue, 5 Apr 2016 22:58:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [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 2F65E2011E for ; Tue, 5 Apr 2016 22:58:59 +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 1anZuk-0004BW-Oc; Tue, 05 Apr 2016 22:57:38 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1anZud-00042I-OL for linux-arm-kernel@lists.infradead.org; Tue, 05 Apr 2016 22:57:33 +0000 Received: by mail-wm0-x236.google.com with SMTP id u206so22636478wme.1 for ; Tue, 05 Apr 2016 15:57:11 -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=c4o+WFr9KLQcyFRgNQKisbmyCi4oxsoWLkPu8UFa2VqxULSv0sqONunPV51Bgyfuks Kfq1r2eysRq0kh77Yjx3Hl1PGNktKpJ8axnIzKftgn4kK1Q+oJMGEE9Cqp/U3lDRjZOO 6q8MfhDnW2en0j/OIMI7EA915heLpa9XNs0CwV+tlrAz/gFFU6Hw2q5L2+0AeIXmJynY O8fOYlGh+mEdCGYZkLLkNZBE4sHBiXeTsQ0c13pLSGf3+yPdfzvZ9R4ryY21ycWWOKaJ 4OP7Kk2XFjSPAICQSAK/fCnvNZXO6AOMei0MBfQmm19QdE20xs2u9OV8mhTj0ekctPyq Agvg== X-Gm-Message-State: AD7BkJKpCcFBFNTfiZ8edjArICl9HuMXyy+04PSHd7xd9zWHc17OmLlLMnZM+VAHmc9RJFnt 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160405_155732_140096_5F9A80F1 X-CRM114-Status: GOOD ( 14.14 ) 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, 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=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,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; }