diff options
author | Archit Taneja <architt@codeaurora.org> | 2017-07-28 12:47:08 +0200 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2017-08-02 01:20:13 +0200 |
commit | 541de4c9c953438b677c31072e7762115ac11299 (patch) | |
tree | 924c860581fe9f3fcfaab7da7dbcf661e5f78397 | |
parent | drm/msm: Remove __user from __u64 data types (diff) | |
download | linux-541de4c9c953438b677c31072e7762115ac11299.tar.xz linux-541de4c9c953438b677c31072e7762115ac11299.zip |
drm/msm/adreno: Prevent unclocked access when retrieving timestamps
msm_gpu's get_timestamp() op (called by the MSM_GET_PARAM ioctl) can
result in register accesses. We need our power domain and clocks to
be active for that. Make sure they are enabled here.
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
-rw-r--r-- | drivers/gpu/drm/msm/adreno/adreno_gpu.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index f1ab2703674a..7414c6bbd582 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -48,8 +48,15 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value) *value = adreno_gpu->base.fast_rate; return 0; case MSM_PARAM_TIMESTAMP: - if (adreno_gpu->funcs->get_timestamp) - return adreno_gpu->funcs->get_timestamp(gpu, value); + if (adreno_gpu->funcs->get_timestamp) { + int ret; + + pm_runtime_get_sync(&gpu->pdev->dev); + ret = adreno_gpu->funcs->get_timestamp(gpu, value); + pm_runtime_put_autosuspend(&gpu->pdev->dev); + + return ret; + } return -EINVAL; default: DBG("%s: invalid param: %u", gpu->name, param); |