diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-02-18 03:51:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-21 01:11:01 +0300 |
commit | 5da5325fa85658ee793792b5285dd5fdb76ccfb7 (patch) | |
tree | 9e65a2bde84eb02c6090f4371ada38edd3c3ba24 /drivers/hwtracing/coresight/coresight.c | |
parent | b6404e21f023e4aa208a0ba03d55a9c8a57cb940 (diff) | |
download | linux-5da5325fa85658ee793792b5285dd5fdb76ccfb7.tar.xz |
coresight: moving PM runtime operations to core framework
Moving PM runtime operations in Coresight devices enable() and
disable() API to the framework core when a path is setup. That
way the runtime core doesn't have to be involved everytime a
path is enabled. It also avoids calling runtime PM operations
in IRQ context.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight.c')
-rw-r--r-- | drivers/hwtracing/coresight/coresight.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 2ed48545df26..6b44928c1076 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -24,6 +24,7 @@ #include <linux/coresight.h> #include <linux/of_platform.h> #include <linux/delay.h> +#include <linux/pm_runtime.h> #include "coresight-priv.h" @@ -376,7 +377,8 @@ out: /* * A path from this element to a sink has been found. The elements * leading to the sink are already enqueued, all that is left to do - * is add a node for this element. + * is tell the PM runtime core we need this element and add a node + * for it. */ node = kzalloc(sizeof(struct coresight_node), GFP_KERNEL); if (!node) @@ -384,6 +386,7 @@ out: node->csdev = csdev; list_add(&node->link, path); + pm_runtime_get_sync(csdev->dev.parent); return 0; } @@ -415,9 +418,13 @@ struct list_head *coresight_build_path(struct coresight_device *csdev) */ void coresight_release_path(struct list_head *path) { + struct coresight_device *csdev; struct coresight_node *nd, *next; list_for_each_entry_safe(nd, next, path, link) { + csdev = nd->csdev; + + pm_runtime_put_sync(csdev->dev.parent); list_del(&nd->link); kfree(nd); } |