From patchwork Tue Dec 1 09:14:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 7734481 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 600ADBEEE1 for ; Tue, 1 Dec 2015 09:20:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2EBE206B6 for ; Tue, 1 Dec 2015 09:20:29 +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 952AD206A9 for ; Tue, 1 Dec 2015 09:20:06 +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 1a3h4f-0001Ht-UM; Tue, 01 Dec 2015 09:18:13 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3h2v-0007hQ-A9 for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2015 09:16:38 +0000 Received: by wmuu63 with SMTP id u63so163929033wmu.0 for ; Tue, 01 Dec 2015 01:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YZFIm4Zl81XopatedcskBtal1uS0tkPSxmkWXBhWG5E=; b=m8MlEQF4wGkopkv+PcThrVj39GjbK0da7F5kYdOa+Q+lo5J6DP0COdq2bkA2PvEAAf IXu7/M9KJPmxLQUAwvvmqhMqZkz5wIcclC0UxXapo4dH6/AFE5zUh4r/IlXS6lp4e+TP rvKy6Norj80ax/vdPMb9+2MwJEURnvUXESQdejIgCHwxbDtnn9l/mSbiHWsc8PdP2Io6 ZhncH/sZMJksiWn6/zZzm6CejK7mOX2bZEmV25TtDgaTKc0qC4P+GmXOrUHK8pdnkxVW 6epEWHtSP4jtrxBUAt34b1yCvjDbg4IIUb7w3Pm7Cx/j2b588N0voiFDXHH+e4bVA9Yu +jQA== 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=YZFIm4Zl81XopatedcskBtal1uS0tkPSxmkWXBhWG5E=; b=iLIYGNVJzo4FXe4cduDi7QChFcZE7tB05PBAOISX7M1U9qfJty2it3hlWD88XE1dnn L+bt1Gn39/r7xFH3X2oht7mOBsAtI67T0DLtv2zD5GHRyY0vd7acEpQjBiFn0swvaNqx l0fsW+orroQnZdyNNSpvjiK9oi+CpkQwbBx+U8wbp71uj4XzkyV5lbhFx1Jf9Dl0oLVl 34nWoDWJdQ14LvZIGhEeajrUzidKa4xoJ6QRlqNmztab9BqMUagNoQQUtWjfDRvE7TcM 8QADuqhBDC75EETXirLlcax5USpcJrxxIGghx/+TZTiT6gbW3BcstLg6YyCrW9xRxQ/j QQPg== X-Gm-Message-State: ALoCoQnD2DbivhQ9PE/OjIDuW2fhd9eg4xU35YCBR9pmzwMfRnE98VXHnca2eAlOcit3lEMuq+VE X-Received: by 10.28.142.205 with SMTP id q196mr36085619wmd.42.1448961363523; Tue, 01 Dec 2015 01:16:03 -0800 (PST) Received: from mms734.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id t64sm25290428wmf.23.2015.12.01.01.16.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 01:16:03 -0800 (PST) From: Stanimir Varbanov To: 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, Vinod Koul Subject: [PATCH 2/4] dmaengine: qcom_bam_dma: clear BAM interrupt only if it is rised Date: Tue, 1 Dec 2015 11:14:57 +0200 Message-Id: <1448961299-15161-3-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1448961299-15161-1-git-send-email-stanimir.varbanov@linaro.org> References: <1448961299-15161-1-git-send-email-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151201_011626_132709_67024890 X-CRM114-Status: GOOD ( 14.71 ) X-Spam-Score: -2.6 (--) 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: Mark Rutland , Archit Taneja , Pawel Moll , Ian Campbell , Stanimir Varbanov , Rob Herring , Andy Gross 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 --- 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 dc9da477eb69..0f06f3b7a72b 100644 --- a/drivers/dma/qcom_bam_dma.c +++ b/drivers/dma/qcom_bam_dma.c @@ -800,13 +800,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; }