summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-02-15 16:00:25 -0500
committerRob Clark <robdclark@gmail.com>2017-04-08 06:59:31 -0400
commitcc69272673ae8ef83982d6e54c67bc01997a13ea (patch)
treeb19b3c2c2307196f61bf71fb660109a07d724475 /drivers/gpu/drm/msm
parentf90000492ed8df9cb0214e7551a43a2be170db7a (diff)
downloadlinux-cc69272673ae8ef83982d6e54c67bc01997a13ea.tar.bz2
drm/msm: pm runtime support for iommu
In particular, attach() and unmap() need pm-runtime get/put to ensure iommu clks are enabled. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r--drivers/gpu/drm/msm/msm_iommu.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
index 6583fadc6e5b..b23d33622f37 100644
--- a/drivers/gpu/drm/msm/msm_iommu.c
+++ b/drivers/gpu/drm/msm/msm_iommu.c
@@ -38,14 +38,23 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char * const *names,
int cnt)
{
struct msm_iommu *iommu = to_msm_iommu(mmu);
- return iommu_attach_device(iommu->domain, mmu->dev);
+ int ret;
+
+ pm_runtime_get_sync(mmu->dev);
+ ret = iommu_attach_device(iommu->domain, mmu->dev);
+ pm_runtime_put_sync(mmu->dev);
+
+ return ret;
}
static void msm_iommu_detach(struct msm_mmu *mmu, const char * const *names,
int cnt)
{
struct msm_iommu *iommu = to_msm_iommu(mmu);
+
+ pm_runtime_get_sync(mmu->dev);
iommu_detach_device(iommu->domain, mmu->dev);
+ pm_runtime_put_sync(mmu->dev);
}
static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
@@ -54,7 +63,9 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
struct msm_iommu *iommu = to_msm_iommu(mmu);
size_t ret;
+// pm_runtime_get_sync(mmu->dev);
ret = iommu_map_sg(iommu->domain, iova, sgt->sgl, sgt->nents, prot);
+// pm_runtime_put_sync(mmu->dev);
WARN_ON(ret < 0);
return (ret == len) ? 0 : -EINVAL;
@@ -65,7 +76,9 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova,
{
struct msm_iommu *iommu = to_msm_iommu(mmu);
+ pm_runtime_get_sync(mmu->dev);
iommu_unmap(iommu->domain, iova, len);
+ pm_runtime_put_sync(mmu->dev);
return 0;
}