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 [thread overview]
Message-ID: <1420562233-2015-6-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1420562233-2015-1-git-send-email-mathieu.poirier@linaro.org>
From: Mathieu Poirier <mathieu.poirier@linaro.org>
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 <mathieu.poirier@linaro.org>
---
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 <linux/clk.h>
#include <linux/coresight.h>
#include <linux/amba/bus.h>
+#include <linux/pm_runtime.h>
#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;
}
--
1.9.1
next prev parent reply other threads:[~2015-01-06 16:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 16:37 [PATCH 0/9] coresight: Add PM runtime awareness mathieu.poirier
2015-01-06 16:37 ` [PATCH 1/9] coresight-etm3x: Adding runtime PM awareness mathieu.poirier
2015-01-06 16:37 ` [PATCH 2/9] coresight-etb: " mathieu.poirier
2015-01-06 16:37 ` [PATCH 3/9] coresight-funnel: " mathieu.poirier
2015-01-06 16:37 ` [PATCH 4/9] coresight-tmc: " mathieu.poirier
2015-01-06 16:37 ` mathieu.poirier [this message]
2015-01-06 16:37 ` [PATCH 6/9] coresight-etm3x: Fixing suspend/wake modes mathieu.poirier
2015-01-06 16:37 ` [PATCH 7/9] ARM: vexpress/TC2: Add generic power domain awareness to scp driver mathieu.poirier
2015-01-07 11:39 ` Lorenzo Pieralisi
2015-01-09 23:37 ` Mathieu Poirier
2015-01-06 16:37 ` [PATCH 8/9] coresight: Adding DT generic power domain support mathieu.poirier
2015-01-06 16:37 ` [PATCH 9/9] coresight: Documenting reference to generic PD bindings mathieu.poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420562233-2015-6-git-send-email-mathieu.poirier@linaro.org \
--to=mathieu.poirier@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=lorenzo.pieralisi@arm.com \
--cc=patches@linaro.org \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).