From patchwork Thu Feb 15 12:25:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10221067 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 B4D466055C for ; Thu, 15 Feb 2018 12:27:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A600227528 for ; Thu, 15 Feb 2018 12:27:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AE6F27EED; Thu, 15 Feb 2018 12:27:45 +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 3F6E927528 for ; Thu, 15 Feb 2018 12:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031700AbeBOM1n (ORCPT ); Thu, 15 Feb 2018 07:27:43 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:39391 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031521AbeBOM1X (ORCPT ); Thu, 15 Feb 2018 07:27:23 -0500 Received: by mail-wm0-f66.google.com with SMTP id b21so476884wme.4 for ; Thu, 15 Feb 2018 04:27:23 -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=mitw7QQlF05ZYn5f+YltPDyfGcQqCth4+uO7SALBKmE=; b=bya7RMudFAEbRE5wIofJurrWuRNp0PtX8aox4paa3+eKKHPTN/T+g7UhVgzd2R+BDI cpe5Fr75tjEREiAFtVP4IvG1F2GQgIo7Ds0uXgDdsLsbJwWwPXQWbIrSxUDC1I6RG9Ju g3S8SMVgRFdQG31gTiZda2/zdxg/zLPQ4ApRQ= 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=mitw7QQlF05ZYn5f+YltPDyfGcQqCth4+uO7SALBKmE=; b=T+yNIzJzeIKKs2V/4FzKGWkFP5n1Boxn79yzlOVD9OSiR15u9L6Ux4nL7VwuV/Frct ToAcCdoGfGDudnDDeFnBs8+HxUzpNQTH5JtO1BBUzlDCYSgC5yRsAcNQt0GO6Sp6p2VH mUwYNM7xZnHAsYT+glRb1qlNAhM5qddTq9Klib6WTH1/7vG3FMgM2rF4okmMH9RYCfVZ DSlIhqet1NvQaPJaA+HMEZ3hvkyqH5SZPoHKcJB/k0kfrTAcNVk5v6Dn4XZQcPFNOa+v YO7aSXfSm7MaGl+wmbxAkgQt7S1vnd53cTpvw/RaqIITqPytroEsuip1YoZiqCnztwRh HCUQ== X-Gm-Message-State: APf1xPC1M/0Ppmztamh10PqtEG4E6qpKdVukiM8RM1rtNn2hcvJUMUFk tGHHp1hw1vvcUjQdDBI78a4+tg== X-Google-Smtp-Source: AH8x227kmJUpX7YYdMCdB0RaVEGEyVUO6P4GRuBeRuU2q7j36MJnJ5hWTXVhhPaSgRebhsLqa2NoPQ== X-Received: by 10.28.150.139 with SMTP id y133mr1926655wmd.142.1518697642093; Thu, 15 Feb 2018 04:27:22 -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 s9sm15632778wra.4.2018.02.15.04.27.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Feb 2018 04:27:21 -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-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, yanhe@quicinc.com, ramkri@qti.qualcomm.com, sdharia@quicinc.com, Srinivas Kandagatla Subject: [PATCH v3 5/5] dmaengine: qcom: bam_dma: disable runtime pm on remote controlled Date: Thu, 15 Feb 2018 12:25:11 +0000 Message-Id: <20180215122511.13517-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180215122511.13517-1-srinivas.kandagatla@linaro.org> References: <20180215122511.13517-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 6919f501b9f3..d29275b97e84 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1333,6 +1333,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); @@ -1416,7 +1421,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); @@ -1432,7 +1438,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; }