From patchwork Wed Feb 14 14:44:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10219177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABBE3601C2 for ; Wed, 14 Feb 2018 14:48:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E11528ED0 for ; Wed, 14 Feb 2018 14:48:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9243928FC9; Wed, 14 Feb 2018 14:48:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08D4E28ED0 for ; Wed, 14 Feb 2018 14:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030944AbeBNOrX (ORCPT ); Wed, 14 Feb 2018 09:47:23 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33608 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031094AbeBNOrP (ORCPT ); Wed, 14 Feb 2018 09:47:15 -0500 Received: by mail-wm0-f65.google.com with SMTP id x4so18079715wmc.0 for ; Wed, 14 Feb 2018 06:47:14 -0800 (PST) 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=iGIUlLTXe5YlQRL1SFpRs80ajzgNP1ylmrEJTMEn+q8=; b=W8zxasGFq80qDJfWl7C9UZayVpD/JsPayp2epgWgmtK8K3d5WiaYGfh6dCJFQp3rCo LKtmgXkdzA1QcNbJDiF21Ny8v5Ci2VoDtUGzDy+azKmfei3nV5TqCpYdcgxlMMjYOTFv 5KEi9+nT6ITCy4KELv09u1ZHzVBhCISSs8H64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iGIUlLTXe5YlQRL1SFpRs80ajzgNP1ylmrEJTMEn+q8=; b=mR8R+adQIO19W44776oYpA8rSyoql/MNGAbQBeUAg99THez7Di5pFlEGJT9BKZaxcx H2hzbhr/mcDDxu541chTJ5mpRMAJMCLgixF1wB2VArIYDvY4pZ+koeeqXxzbsF2kR4OD vwGAkrpUM+vieRHeFmR4ezILqiNoOkicSC/BgldzYrkctJWKUy7d4HBKk3oRvWh2uw+p hR7wheDGBoEq79mEwEozzvVbeeMRzQGSjgR6Xn+JX0fyaVYk0rOUo3hUJ7nr5c8qacoD BMv712CyK+gq2SuVk5wrh+tJld7IFXEVSBIRH32zhV/uXK6mBFxPhZ2lC4uRMSxJ1WUq N2BQ== X-Gm-Message-State: APf1xPC39fstDvOslKcwEEEFEGTa/vxyqXcmzSR6zCEePjqETV3GFyTO fEiFePODw1u8Pl30TJPxVfSpVxsNurs= X-Google-Smtp-Source: AH8x224cGXNflwQem/ozKIekWUKjOG5WT36C1wYMx09tPMTN9GMBxN5aL8g12is/0NWmm3xJvK67cQ== X-Received: by 10.28.166.20 with SMTP id p20mr4284342wme.85.1518619633935; Wed, 14 Feb 2018 06:47:13 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u20sm7675965wrg.13.2018.02.14.06.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Feb 2018 06:47:13 -0800 (PST) From: srinivas.kandagatla@linaro.org To: vinod.koul@intel.com, andy.gross@linaro.org, dmaengine@vger.kernel.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, david.brown@linaro.org, dan.j.williams@intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, yanhe@quicinc.com, ramkri@qti.qualcomm.com, sdharia@quicinc.com, Srinivas Kandagatla Subject: [PATCH v2 5/5] dmaengine: qcom: bam_dma: disable runtime pm on remote controlled Date: Wed, 14 Feb 2018 14:44:59 +0000 Message-Id: <20180214144459.29813-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> References: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Srinivas Kandagatla Remotely controlled BAM instance should not do any power management from CPU side, as cpu can not reliably say if the BAM is busy or not. Disable it for such instances. Signed-off-by: Srinivas Kandagatla --- drivers/dma/qcom/bam_dma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 88ec515ad125..6e4fe398f0c8 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1330,6 +1330,11 @@ static int bam_dma_probe(struct platform_device *pdev) if (ret) goto err_unregister_dma; + if (bdev->controlled_remotely) { + pm_runtime_disable(&pdev->dev); + return 0; + } + pm_runtime_irq_safe(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, BAM_DMA_AUTOSUSPEND_DELAY); pm_runtime_use_autosuspend(&pdev->dev); @@ -1413,7 +1418,8 @@ static int __maybe_unused bam_dma_suspend(struct device *dev) { struct bam_device *bdev = dev_get_drvdata(dev); - pm_runtime_force_suspend(dev); + if (!bdev->controlled_remotely) + pm_runtime_force_suspend(dev); clk_unprepare(bdev->bamclk); @@ -1429,7 +1435,8 @@ static int __maybe_unused bam_dma_resume(struct device *dev) if (ret) return ret; - pm_runtime_force_resume(dev); + if (!bdev->controlled_remotely) + pm_runtime_force_resume(dev); return 0; }