From patchwork Fri Dec 4 21:49:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 7772131 Return-Path: X-Original-To: patchwork-dmaengine@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 EF0D1BEEE1 for ; Fri, 4 Dec 2015 21:52:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36B3E2061D for ; Fri, 4 Dec 2015 21:52:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3721920623 for ; Fri, 4 Dec 2015 21:52:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756772AbbLDVv7 (ORCPT ); Fri, 4 Dec 2015 16:51:59 -0500 Received: from mga11.intel.com ([192.55.52.93]:30442 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756568AbbLDVte (ORCPT ); Fri, 4 Dec 2015 16:49:34 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 04 Dec 2015 13:49:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,382,1444719600"; d="scan'208";a="834558383" Received: from black.fi.intel.com ([10.237.72.93]) by orsmga001.jf.intel.com with ESMTP; 04 Dec 2015 13:49:31 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7B668501; Fri, 4 Dec 2015 23:49:27 +0200 (EET) From: Andy Shevchenko To: "Rafael J . Wysocki" , linux-acpi@vger.kernel.org, Vinod Koul , dmaengine@vger.kernel.org, Thomas Gleixner , Greg Kroah-Hartman , Jarkko Nikula , linux-kernel@vger.kernel.org, Mika Westerberg Cc: Andy Shevchenko Subject: [PATCH v3 8/9] dmaengine: dw: return immediately from IRQ when DMA isn't in use Date: Fri, 4 Dec 2015 23:49:24 +0200 Message-Id: <1449265765-9393-9-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1449265765-9393-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1449265765-9393-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 There is no need to bother the hardware when all channels are idle. We have not to get any interrupts. Signed-off-by: Andy Shevchenko Acked-by: Vinod Koul --- drivers/dma/dw/core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 7067b6d..8b20930 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -622,12 +622,17 @@ static void dw_dma_tasklet(unsigned long data) static irqreturn_t dw_dma_interrupt(int irq, void *dev_id) { struct dw_dma *dw = dev_id; - u32 status = dma_readl(dw, STATUS_INT); + u32 status; + /* Check if we have any interrupt from the DMAC which is not in use */ + if (!dw->in_use) + return IRQ_NONE; + + status = dma_readl(dw, STATUS_INT); dev_vdbg(dw->dma.dev, "%s: status=0x%x\n", __func__, status); /* Check if we have any interrupt from the DMAC */ - if (!status || !dw->in_use) + if (!status) return IRQ_NONE; /*