mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Marek <jonathan@marek.ca>
To: Rob Clark <robdclark@gmail.com>
Cc: freedreno <freedreno@lists.freedesktop.org>,
	Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>,
	Jordan Crouse <jcrouse@codeaurora.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Brian Masney <masneyb@onstation.org>,
	Fabio Estevam <festevam@gmail.com>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<linux-arm-msm@vger.kernel.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU" 
	<dri-devel@lists.freedesktop.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] drm/msm: handle for EPROBE_DEFER for of_icc_get
Date: Fri, 10 Jul 2020 19:10:38 -0400	[thread overview]
Message-ID: <3729cda9-2d02-c213-c31a-d3e1316798f8@marek.ca> (raw)
In-Reply-To: <CAF6AEGsQFVptXi2wgx_JipyK0AOSUBHOHaDmRF_gG+hSH8mF5A@mail.gmail.com>

On 7/9/20 11:15 AM, Rob Clark wrote:
> On Thu, Jul 9, 2020 at 7:35 AM Jonathan Marek <jonathan@marek.ca> wrote:
>>
>> Check for errors instead of silently not using icc if the msm driver
>> probes before the interconnect driver.
>>
>> Allow ENODATA for ocmem path, as it is optional and this error
>> is returned when "gfx-mem" path is provided but not "ocmem".
>>
>> Remove the WARN_ON in msm_gpu_cleanup because INIT_LIST_HEAD won't have
>> been called on the list yet when going through the defer error path.
>>
>> Changes in v2:
>> * Changed to not only check for EPROBE_DEFER
>>
>> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
>> ---
>>   drivers/gpu/drm/msm/adreno/adreno_gpu.c | 17 ++++++++++++++---
>>   drivers/gpu/drm/msm/msm_gpu.c           |  2 --
>>   2 files changed, 14 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> index 89673c7ed473..0f5217202eb5 100644
>> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> @@ -940,12 +940,20 @@ static int adreno_get_pwrlevels(struct device *dev,
>>                   */
>>                  gpu->icc_path = of_icc_get(dev, NULL);
>>          }
>> -       if (IS_ERR(gpu->icc_path))
>> +       if (IS_ERR(gpu->icc_path)) {
>> +               ret = PTR_ERR(gpu->icc_path);
>>                  gpu->icc_path = NULL;
>> +               return ret;
>> +       }
>>
>>          gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
>> -       if (IS_ERR(gpu->ocmem_icc_path))
>> +       if (IS_ERR(gpu->ocmem_icc_path)) {
>> +               ret = PTR_ERR(gpu->ocmem_icc_path);
>>                  gpu->ocmem_icc_path = NULL;
>> +               /* allow -ENODATA, ocmem icc is optional */
>> +               if (ret != -ENODATA)
>> +                       return ret;
>> +       }
>>
>>          return 0;
>>   }
>> @@ -996,6 +1004,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>>          struct adreno_platform_config *config = pdev->dev.platform_data;
>>          struct msm_gpu_config adreno_gpu_config  = { 0 };
>>          struct msm_gpu *gpu = &adreno_gpu->base;
>> +       int ret;
>>
>>          adreno_gpu->funcs = funcs;
>>          adreno_gpu->info = adreno_info(config->rev);
>> @@ -1007,7 +1016,9 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>>
>>          adreno_gpu_config.nr_rings = nr_rings;
>>
>> -       adreno_get_pwrlevels(&pdev->dev, gpu);
>> +       ret = adreno_get_pwrlevels(&pdev->dev, gpu);
>> +       if (ret)
>> +               return ret;
>>
>>          pm_runtime_set_autosuspend_delay(&pdev->dev,
>>                  adreno_gpu->info->inactive_period);
>> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
>> index a22d30622306..ccf9a0dd9706 100644
>> --- a/drivers/gpu/drm/msm/msm_gpu.c
>> +++ b/drivers/gpu/drm/msm/msm_gpu.c
>> @@ -959,8 +959,6 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
>>
>>          DBG("%s", gpu->name);
>>
>> -       WARN_ON(!list_empty(&gpu->active_list));
>> -
> 
> hmm, not a huge fan of removing the WARN_ON().. can we just init the
> list head earlier?
> 

There doesn't seem to be a nice way of doing that. Would it be 
reasonable to instead detect that msm_gpu_init wasn't called (checking 
if gpu->dev is NULL?), and just skip the msm_gpu_cleanup() call in 
adreno_gpu_cleanup() in that case?

> BR,
> -R
> 
>>          for (i = 0; i < ARRAY_SIZE(gpu->rb); i++) {
>>                  msm_ringbuffer_destroy(gpu->rb[i]);
>>                  gpu->rb[i] = NULL;
>> --
>> 2.26.1
>>

  reply	other threads:[~2020-07-10 23:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 14:34 Jonathan Marek
2020-07-09 15:15 ` Rob Clark
2020-07-10 23:10   ` Jonathan Marek [this message]
2020-07-10 23:29     ` Rob Clark

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=3729cda9-2d02-c213-c31a-d3e1316798f8@marek.ca \
    --to=jonathan@marek.ca \
    --cc=airlied@linux.ie \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jcrouse@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masneyb@onstation.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /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

all inboxes | Powered by JetHome®