From: Bjorn Andersson <bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Kristian Kristensen
<hoegsberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
Subject: Re: [PATCH] drm/msm: Remove pm_runtime calls from msm_iommu.c
Date: Tue, 19 Feb 2019 12:11:35 -0800 [thread overview]
Message-ID: <20190219201135.GA20679@builder> (raw)
In-Reply-To: <1550602100-14169-1-git-send-email-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On Tue 19 Feb 10:48 PST 2019, Jordan Crouse wrote:
> Currently the IOMMU code calls pm_runtime_get/put on the GPU or display
> device before doing a IOMMU operation. This was because usually the
> IOMMU driver didn't do power control of its own and since the hardware
> used the same clocks and power as the respective multimedia device it
> was a easy way to make sure that the power was available.
>
> Now two things have changed. First, the SMMU devices can do their own power
> control and more important bringing up the a6xx GPU isn't as easy as
> turning on some clocks. To bring the GPU up we need the GMU which itself
> needs the IOMMU so we have a chicken and egg problem.
>
> Luckily this is easily fixed by removing the pm_runtime calls from the
> functions and letting the device link to the IOMMU device handle the magic.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Thanks for the patch Jordan, this resolves the previously seen splat and
the GPU driver is now happily initialized.
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> ---
>
> 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 4d62790..12bb54c 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);
>
> return (ret == len) ? 0 : -EINVAL;
> @@ -75,9 +66,7 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len)
> {
> 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;
> }
> --
> 2.7.4
>
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Jordan Crouse <jcrouse@codeaurora.org>
Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Sean Paul <sean@poorly.run>,
Doug Anderson <dianders@chromium.org>,
Kristian Kristensen <hoegsberg@gmail.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Rob Clark <robdclark@gmail.com>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH] drm/msm: Remove pm_runtime calls from msm_iommu.c
Date: Tue, 19 Feb 2019 12:11:35 -0800 [thread overview]
Message-ID: <20190219201135.GA20679@builder> (raw)
In-Reply-To: <1550602100-14169-1-git-send-email-jcrouse@codeaurora.org>
On Tue 19 Feb 10:48 PST 2019, Jordan Crouse wrote:
> Currently the IOMMU code calls pm_runtime_get/put on the GPU or display
> device before doing a IOMMU operation. This was because usually the
> IOMMU driver didn't do power control of its own and since the hardware
> used the same clocks and power as the respective multimedia device it
> was a easy way to make sure that the power was available.
>
> Now two things have changed. First, the SMMU devices can do their own power
> control and more important bringing up the a6xx GPU isn't as easy as
> turning on some clocks. To bring the GPU up we need the GMU which itself
> needs the IOMMU so we have a chicken and egg problem.
>
> Luckily this is easily fixed by removing the pm_runtime calls from the
> functions and letting the device link to the IOMMU device handle the magic.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Thanks for the patch Jordan, this resolves the previously seen splat and
the GPU driver is now happily initialized.
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> ---
>
> 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 4d62790..12bb54c 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);
>
> return (ret == len) ? 0 : -EINVAL;
> @@ -75,9 +66,7 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, unsigned len)
> {
> 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;
> }
> --
> 2.7.4
>
next prev parent reply other threads:[~2019-02-19 20:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 18:48 [PATCH] drm/msm: Remove pm_runtime calls from msm_iommu.c Jordan Crouse
[not found] ` <1550602100-14169-1-git-send-email-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2019-02-19 20:11 ` Bjorn Andersson [this message]
2019-02-19 20:11 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190219201135.GA20679@builder \
--to=bjorn.andersson-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=hoegsberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.