From patchwork Mon Jul 27 05:50:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 6868761 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 51FA89F358 for ; Mon, 27 Jul 2015 05:44:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87B3520638 for ; Mon, 27 Jul 2015 05:44:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 745552062E for ; Mon, 27 Jul 2015 05:44:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753353AbbG0FoJ (ORCPT ); Mon, 27 Jul 2015 01:44:09 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:35085 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754196AbbG0FoH (ORCPT ); Mon, 27 Jul 2015 01:44:07 -0400 Received: by pdrg1 with SMTP id g1so45842841pdr.2 for ; Sun, 26 Jul 2015 22:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Ck0Z4xFo7FOZgwmftWhyu5veW/l1y1gJ5ZKo5l1gekk=; b=YXNhHithxsw50b/GrfUYCJF/F1+vtSqTMR/1Lz1Ncd5uUcc+9zLziCp/1g7Ti9FktG 58UmnE8wcPg5nkAQJCnzVDEIi9ff6Pprw0kOxymJLdk/6P2zqqlyjUutIso8aBc6YJlQ gMdbiXGU7ORija8AzZ0bH/Upxdvs22Dm0S5noQI2bqJyxyto9duRIxtPWMwFKh6a6ky1 OipkCAXgWXFjinygORDwf/VN3r9gYZd2KZ31v5Sm10U6TKTCHUKc1ZQRMjpivdy4Mxax 7536BG16T7Stl+ZtWhmEAgWPfGb3KoeaSnMFZ07KCuzlLZ8m6f/lzTgjz7T0lgQXvy01 J1Nw== X-Received: by 10.70.7.162 with SMTP id k2mr63795679pda.128.1437975846828; Sun, 26 Jul 2015 22:44:06 -0700 (PDT) Received: from ip-172-31-29-47.ap-northeast-1.compute.internal (ec2-54-65-106-64.ap-northeast-1.compute.amazonaws.com. [54.65.106.64]) by smtp.gmail.com with ESMTPSA id xp10sm27178263pac.34.2015.07.26.22.44.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Jul 2015 22:44:05 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: vinod.koul@intel.com, dmaengine@vger.kernel.org, workgroup.linux@csr.com Cc: Yanchang Li , Yanchang Li , Barry Song Subject: [PATCH] dmaengine: sirf: clear pending DMA interrupt when DMA terminates Date: Mon, 27 Jul 2015 05:50:21 +0000 Message-Id: <1437976221-12341-1-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Yanchang Li If DMA interrupt comes and is latched by IRQ controller during the execution of dma_terminate_all(), dma_irq routine will be executed after dma terminated, and it will cause kernel panic. We clear DMA interrupts in dma_terminate_all() to avoid this useless interrupt. Signed-off-by: Yanchang Li Signed-off-by: Barry Song --- drivers/dma/sirf-dma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c index 8c5186c..7d5598d 100644 --- a/drivers/dma/sirf-dma.c +++ b/drivers/dma/sirf-dma.c @@ -455,6 +455,7 @@ static int sirfsoc_dma_terminate_all(struct dma_chan *chan) switch (sdma->type) { case SIRFSOC_DMA_VER_A7V1: writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_INT_EN_CLR); + writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_CH_INT); writel_relaxed((1 << cid) | 1 << (cid + 16), sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL_CLR_ATLAS7); @@ -462,6 +463,8 @@ static int sirfsoc_dma_terminate_all(struct dma_chan *chan) break; case SIRFSOC_DMA_VER_A7V2: writel_relaxed(0, sdma->base + SIRFSOC_DMA_INT_EN_ATLAS7); + writel_relaxed(SIRFSOC_DMA_INT_ALL_ATLAS7, + sdma->base + SIRFSOC_DMA_INT_ATLAS7); writel_relaxed(0, sdma->base + SIRFSOC_DMA_LOOP_CTRL_ATLAS7); writel_relaxed(0, sdma->base + SIRFSOC_DMA_VALID_ATLAS7); break;