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: 128353 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp686058ljc; Wed, 14 Feb 2018 06:47:29 -0800 (PST) X-Google-Smtp-Source: AH8x227c5fZMPbPAnqU/nXXpKjkcCVT8MhOyTP80KomA3FYxZjpM4nQuLUxLcX3RO+79bn71VegQ X-Received: by 10.99.120.143 with SMTP id t137mr4162923pgc.79.1518619648947; Wed, 14 Feb 2018 06:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518619648; cv=none; d=google.com; s=arc-20160816; b=W23rwjdyr0F8mGP7DO200TuK3rItvMZWC6tJZSugIgLp4c0rz92ZxkB1l5DQ6s5J9J MwruOWLWPzfjgLAFNIi0Z361OPx3+QV43cVcfKC1f9xNcyMUvZtmPmc6C3w1NA8QDpc+ XRN1/Ipb0QiNYqi4gJqHO8jOWvtm0o2nGP+FcOIeDEHBD1jIo2ktxSs3WKr/Y5GYnt/I bIISBLU49G/LGKiY2VPYBvT4m6yYkZ+leKgbTRAHghxaam3toprLNFuaM+loNwDnZ+kp tguufzUmYApaJxQJAHu2tc5CvuKCg0MjIDBSK8R+eRiM7jAKyBGTd29L0EuL6ZwxaUgk ygQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iGIUlLTXe5YlQRL1SFpRs80ajzgNP1ylmrEJTMEn+q8=; b=TAC2FU1jCCzeChbeezHDbTIQZ8q6zuiOCf6IY3ge6UJshVhhHp6+Ey9M1zzM+7wnvp UCHLBzS7zs2TgxXwQsKEZPXXdnzpNAYuVn6FJyZnjmLR2GdtW5WSyBM3MXDOynwqegje x2IZqraQ0EMl0uSx6TEWj0sHySc51O1++XbDKsZjFVWh/eIH9UF1Fy6xOKUmPkBnzmm0 exPBUFQHueIIeCvXtnWzRLdkh7bQLKtL9nG7cd7GA4fgLVxWDxSFVtBNy+SATEfy/pBI UU34XyYSnEs/VmZYnTI0mi8XEToTjTHkF+xxmBwXG6AYoIbUA8SkjFx0rCTMPuYn0P1V HM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8zxasGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p29-v6si724680pli.731.2018.02.14.06.47.28; Wed, 14 Feb 2018 06:47:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8zxasGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030951AbeBNOrZ (ORCPT + 28 others); Wed, 14 Feb 2018 09:47:25 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33610 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031097AbeBNOrP (ORCPT ); Wed, 14 Feb 2018 09:47:15 -0500 Received: by mail-wm0-f67.google.com with SMTP id x4so18079717wmc.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=Ym87qq7PJCPPl8WavS+5XoMLAXUVhCiEJbiXViz0dBHACSWeALVJbE0ve5zpKWE5gm LIuNW2op6qhUIJIZNMS7Wc+xa9nz27YKO60XYoBl5+JApBXU+XxETDvufzAWGqdtzN9R E8k0W0iYuioNgO3O1g5gm3mShykyiPqWrfU4SxCE/7vIGHawALIntBVnYxBVCqvalN8J ycgdkZxjXmcHshSas7RPn3+PmPF19xea1iDsvrDtndlsa6jjMlHQgj2a/7Bq1dIpHLh+ W5+RPzgsajVzXJJ0RDdFxBPJtyJIp4+Nb20zeBYp/FHXdv+257Kk0wlwgh/LdMfRzYkc xWzg== X-Gm-Message-State: APf1xPCUY0uJCrrqXRsHEYut8Hkwn+4ORNfWUSFQXgvLe/fFLiOteD+w xlxE9Fjc5EMyIe9yeKSKwQOCyQ== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.15.1 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; }