From patchwork Tue Jan 6 16:37:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 42791 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 684712062F for ; Tue, 6 Jan 2015 16:38:03 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf13225039lbi.4 for ; Tue, 06 Jan 2015 08:38:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=1Kxc4lsEApDBUoUTA0jza4k9pUhOtKPILCENzqCnLE4=; b=QibB9y9kDf82Ruo3gwag+l/QWfDoY/ql1eGxGYoaGYqpa1PaAFlPWMeLW5PxJ0BA+g hs6MYJS0sfCV5M/q3tY4hawnafEHslgsfR2OSH/wcqVmeznNGlyRZsERAupNaZdldaTs pVU9d3nJKl2temZ6jVwsk/v/ITvmUKgIRF9kptL0M/85pQyjc8Yf/xFZaVohdD71kruo ZJMoUrvVdoZshzcTjYYd6nymNHCBfTxrzoiJKJKhxTYZC9j4Dmk7BH5w+GMO8g9UpNkx mrysy/si6nTryvhWiHE1ZfXXOniJqm7yCEKYog//3r4uL7wmeX15xCi/tLGfW3wUHSTx OwYQ== X-Gm-Message-State: ALoCoQmvM7JAPC7PZHODMi4dm4HWm5gjWCuksM2rvJNwuUi6UJjJ/CkdSJKBpwRg83F3hD8LaryR X-Received: by 10.112.137.136 with SMTP id qi8mr341138lbb.13.1420562282412; Tue, 06 Jan 2015 08:38:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.41 with SMTP id y9ls61428lag.54.gmail; Tue, 06 Jan 2015 08:38:02 -0800 (PST) X-Received: by 10.152.204.70 with SMTP id kw6mr102143773lac.53.1420562282198; Tue, 06 Jan 2015 08:38:02 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id ll1si66632182lac.41.2015.01.06.08.38.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Jan 2015 08:38:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so19908109lab.22 for ; Tue, 06 Jan 2015 08:38:02 -0800 (PST) X-Received: by 10.112.180.135 with SMTP id do7mr58901611lbc.23.1420562282104; Tue, 06 Jan 2015 08:38:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1224912lbb; Tue, 6 Jan 2015 08:38:01 -0800 (PST) X-Received: by 10.66.66.135 with SMTP id f7mr7672432pat.93.1420562272884; Tue, 06 Jan 2015 08:37:52 -0800 (PST) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com. [209.85.220.49]) by mx.google.com with ESMTPS id e12si67128742pat.39.2015.01.06.08.37.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Jan 2015 08:37:52 -0800 (PST) Received-SPF: pass (google.com: domain of mathieu.poirier@linaro.org designates 209.85.220.49 as permitted sender) client-ip=209.85.220.49; Received: by mail-pa0-f49.google.com with SMTP id eu11so31158379pac.22 for ; Tue, 06 Jan 2015 08:37:52 -0800 (PST) X-Received: by 10.66.139.227 with SMTP id rb3mr80034740pab.25.1420562271984; Tue, 06 Jan 2015 08:37:51 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPSA id iv1sm42245554pbc.87.2015.01.06.08.37.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jan 2015 08:37:51 -0800 (PST) From: mathieu.poirier@linaro.org To: liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, patches@linaro.org Subject: [PATCH 5/9] coresight-tpiu: Adding runtime PM awareness Date: Tue, 6 Jan 2015 09:37:09 -0700 Message-Id: <1420562233-2015-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1420562233-2015-1-git-send-email-mathieu.poirier@linaro.org> References: <1420562233-2015-1-git-send-email-mathieu.poirier@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mathieu.poirier@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mathieu Poirier Using the runtime API whenever HW access is required. As such and by associating a coresight component to a power domain in the device tree, faults associated to accessing unpowered devices are mitigated. Signed-off-by: Mathieu Poirier --- drivers/coresight/coresight-tpiu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/coresight/coresight-tpiu.c b/drivers/coresight/coresight-tpiu.c index ae101082791a..199244700c99 100644 --- a/drivers/coresight/coresight-tpiu.c +++ b/drivers/coresight/coresight-tpiu.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "coresight-priv.h" @@ -78,6 +79,7 @@ static int tpiu_enable(struct coresight_device *csdev) if (ret) return ret; + pm_runtime_get_sync(drvdata->dev); tpiu_enable_hw(drvdata); dev_info(drvdata->dev, "TPIU enabled\n"); @@ -101,7 +103,7 @@ static void tpiu_disable(struct coresight_device *csdev) struct tpiu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); tpiu_disable_hw(drvdata); - + pm_runtime_put_sync(drvdata->dev); clk_disable_unprepare(drvdata->clk); dev_info(drvdata->dev, "TPIU disabled\n"); @@ -171,6 +173,9 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) if (IS_ERR(drvdata->csdev)) return PTR_ERR(drvdata->csdev); + pm_runtime_set_suspended(dev); + pm_runtime_put_noidle(dev); + dev_info(dev, "TPIU initialized\n"); return 0; }