[PATCH 1/5] drm/msm: Remove pm_runtime operations from msm_iommu

Vivek Gautam vivek.gautam at codeaurora.org
Tue Jun 26 09:35:03 UTC 2018


On Wed, Jun 20, 2018 at 4:00 AM, Jordan Crouse <jcrouse at codeaurora.org> wrote:
> Now that the IOMMU is the master of it's own power we don't need to bring
> up the GPU to do IOMMU operations. This is good because bringing up a6xx
> requires the GMU so calling pm_runtime_get_sync() too early in the process
> gets us into some nasty circular dependency situations.
>
> Signed-off-by: Jordan Crouse <jcrouse at codeaurora.org>
> ---
>  drivers/gpu/drm/msm/msm_iommu.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
> index b23d33622f37..e80c79b3bb5c 100644
> --- a/drivers/gpu/drm/msm/msm_iommu.c
> +++ b/drivers/gpu/drm/msm/msm_iommu.c
> @@ -38,13 +38,8 @@ static int msm_iommu_attach(struct msm_mmu *mmu, const char * const *names,
>                             int cnt)
>  {
>         struct msm_iommu *iommu = to_msm_iommu(mmu);
> -       int ret;
>
> -       pm_runtime_get_sync(mmu->dev);
> -       ret = iommu_attach_device(iommu->domain, mmu->dev);
> -       pm_runtime_put_sync(mmu->dev);
> -
> -       return ret;
> +       return iommu_attach_device(iommu->domain, mmu->dev);
>  }
>
>  static void msm_iommu_detach(struct msm_mmu *mmu, const char * const *names,
> @@ -52,9 +47,7 @@ static void msm_iommu_detach(struct msm_mmu *mmu, const char * const *names,
>  {
>         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,
> @@ -63,9 +56,7 @@ 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;
> @@ -76,9 +67,7 @@ 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;
>  }

Looks good to me.
Reviewed-by: Vivek Gautam <vivek.gautam at codeaurora.org>

Best regards
Vivek

> --
> 2.17.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


More information about the dri-devel mailing list