From: Sharat Masetty <smasetty-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Jordan Crouse <jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
hoegsberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 3/5] drm/msm/adreno: Load the firmware before bringing up the hardware
Date: Mon, 20 Aug 2018 17:14:54 +0530 [thread overview]
Message-ID: <e59df46f-9efc-03a2-2ac8-e7975c6f2e3a@codeaurora.org> (raw)
In-Reply-To: <20180806173324.16074-4-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
On 8/6/2018 11:03 PM, Jordan Crouse wrote:
> Failure to load firmware is the primary reason to fail adreno_load_gpu().
> Try to load it first before going into the hardware initialization code and
> unwinding it. This is important for a6xx because the GMU gets loaded from
> the runtime power code and it is more costly to fail in that path because
> of missing firmware.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> ---
> drivers/gpu/drm/msm/adreno/adreno_device.c | 23 +++++++++++++++++++++-
> drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +-
> drivers/gpu/drm/msm/adreno/adreno_gpu.h | 2 +-
> 3 files changed, 24 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
> index 44813624a286..37746f1d54cf 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
> @@ -155,6 +155,7 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
> struct msm_drm_private *priv = dev->dev_private;
> struct platform_device *pdev = priv->gpu_pdev;
> struct msm_gpu *gpu = NULL;
> + struct adreno_gpu *adreno_gpu;
> int ret;
>
> if (pdev)
> @@ -165,7 +166,27 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
> return NULL;
> }
>
> - pm_runtime_get_sync(&pdev->dev);
> + adreno_gpu = to_adreno_gpu(gpu);
> +
> + /*
> + * The number one reason for HW init to fail is if the firmware isn't
> + * loaded yet. Try that first and don't bother continuing on
> + * otherwise
> + */
> +
> + ret = adreno_load_fw(adreno_gpu);
> + if (ret)
> + return NULL;
This is a good idea, but you should remove the call to adreno_load_fw()
from adreno_hw_init() as it should no longer be needed with this change.
> +
> + /* Make sure pm runtime is active and reset any previous errors */
> + pm_runtime_set_active(&pdev->dev);
> +
> + ret = pm_runtime_get_sync(&pdev->dev);
> + if (ret < 0) {
> + dev_err(dev->dev, "Couldn't power up the GPU: %d\n", ret);
> + return NULL;
> + }
> +
> mutex_lock(&dev->struct_mutex);
> ret = msm_gpu_hw_init(gpu);
> mutex_unlock(&dev->struct_mutex);
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index 65c0ae7d8ad1..da1363a0c54d 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -149,7 +149,7 @@ adreno_request_fw(struct adreno_gpu *adreno_gpu, const char *fwname)
> return fw;
> }
>
> -static int adreno_load_fw(struct adreno_gpu *adreno_gpu)
> +int adreno_load_fw(struct adreno_gpu *adreno_gpu)
> {
> int i;
>
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
> index 4406776597fd..d391ff377612 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
> @@ -228,7 +228,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
> struct adreno_gpu *gpu, const struct adreno_gpu_funcs *funcs,
> int nr_rings);
> void adreno_gpu_cleanup(struct adreno_gpu *gpu);
> -
> +int adreno_load_fw(struct adreno_gpu *adreno_gpu);
>
> void adreno_gpu_state_destroy(struct msm_gpu_state *state);
>
>
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-08-20 11:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-06 17:33 [v7 PATCH 0/5] Add support for Adreno a6xx Jordan Crouse
[not found] ` <20180806173324.16074-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-06 17:33 ` [PATCH 1/5] drm/msm: Remove pm_runtime operations from msm_iommu Jordan Crouse
2018-08-06 17:33 ` [PATCH 2/5] drm/msm: Add a helper function to parse clock names Jordan Crouse
2018-08-06 17:33 ` [PATCH 3/5] drm/msm/adreno: Load the firmware before bringing up the hardware Jordan Crouse
[not found] ` <20180806173324.16074-4-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-20 11:44 ` Sharat Masetty [this message]
2018-08-06 17:33 ` [PATCH 4/5] drm/msm: Add generated headers for A6XX Jordan Crouse
2018-08-06 17:33 ` [PATCH 5/5] drm/msm: Add A6XX device support Jordan Crouse
2018-08-06 18:03 ` [v7 PATCH 0/5] Add support for Adreno a6xx Rob Clark
-- strict thread matches above, loose matches on Subject: below --
2018-06-19 22:30 [v6 PATCH 0/5] drm/msm: " Jordan Crouse
[not found] ` <20180619223006.31519-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-19 22:30 ` [PATCH 3/5] drm/msm/adreno: Load the firmware before bringing up the hardware Jordan Crouse
2018-06-11 18:25 [PATCH 0/5] drm/msm: Add support for Adreno a6xx Jordan Crouse
[not found] ` <20180611182604.30467-1-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-11 18:26 ` [PATCH 3/5] drm/msm/adreno: Load the firmware before bringing up the hardware Jordan Crouse
[not found] ` <20180611182604.30467-4-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-06-11 21:50 ` kbuild test robot
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=e59df46f-9efc-03a2-2ac8-e7975c6f2e3a@codeaurora.org \
--to=smasetty-sgv2jx0feol9jmxxk+q4oq@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 \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).