diff options
author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-08-25 17:19:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-31 07:05:42 -0400 |
commit | cd9e3474bb793dc93fbe0985f822ad4b2605e847 (patch) | |
tree | c26eae33b81de772287eba0fdc73bd7cd1245ba0 /drivers/hwtracing | |
parent | 62d39ac934daaaecc716d651809b18da8ac255b0 (diff) |
coresight: add PM runtime calls to coresight_simple_func()
It is mandatory to enable a coresight block's power domain before
trying to access management registers. Otherwise the transaction
simply stalls, leading to a system hang.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r-- | drivers/hwtracing/coresight/coresight-priv.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index ad975c58080d..decfd52b5dc3 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/bitops.h> | 16 | #include <linux/bitops.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/coresight.h> | 18 | #include <linux/coresight.h> |
19 | #include <linux/pm_runtime.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * Coresight management registers (0xf00-0xfcc) | 22 | * Coresight management registers (0xf00-0xfcc) |
@@ -42,8 +43,11 @@ static ssize_t name##_show(struct device *_dev, \ | |||
42 | struct device_attribute *attr, char *buf) \ | 43 | struct device_attribute *attr, char *buf) \ |
43 | { \ | 44 | { \ |
44 | type *drvdata = dev_get_drvdata(_dev->parent); \ | 45 | type *drvdata = dev_get_drvdata(_dev->parent); \ |
45 | return scnprintf(buf, PAGE_SIZE, "0x%x\n", \ | 46 | u32 val; \ |
46 | readl_relaxed(drvdata->base + offset)); \ | 47 | pm_runtime_get_sync(_dev->parent); \ |
48 | val = readl_relaxed(drvdata->base + offset); \ | ||
49 | pm_runtime_put_sync(_dev->parent); \ | ||
50 | return scnprintf(buf, PAGE_SIZE, "0x%x\n", val); \ | ||
47 | } \ | 51 | } \ |
48 | static DEVICE_ATTR_RO(name) | 52 | static DEVICE_ATTR_RO(name) |
49 | 53 | ||