All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Crouse <jcrouse@codeaurora.org>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	Jonathan Marek <jonathan@marek.ca>,
	Rob Clark <robdclark@chromium.org>, Sean Paul <sean@poorly.run>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	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" 
	<freedreno@lists.freedesktop.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/msm/adreno: fix gpu probe if no interconnect-names
Date: Wed, 15 Jul 2020 14:05:24 -0600	[thread overview]
Message-ID: <20200715200523.GA26861@jcrouse1-lnx.qualcomm.com> (raw)
In-Reply-To: <20200715190732.3116556-1-robdclark@gmail.com>

On Wed, Jul 15, 2020 at 12:07:30PM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> If there is no interconnect-names, but there is an interconnects
> property, then of_icc_get(dev, "gfx-mem"); would return an error
> rather than NULL.
> 
> Also, if there is no interconnect-names property, there will never
> be a ocmem path.  But of_icc_get(dev, "ocmem") would return -EINVAL
> instead of -ENODATA.  Just don't bother trying in this case.
> 
> v2: explicity check for interconnect-names property
> 
> Fixes: 8e29fb37b301 ("drm/msm: handle for EPROBE_DEFER for of_icc_get")
> Fixes: 00bb9243d346 ("drm/msm/gpu: add support for ocmem interconnect path")
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/msm/adreno/adreno_gpu.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index 0527e85184e1..e23641a5ec84 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -1003,22 +1003,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  	if (ret)
>  		return ret;
>  
> -	/* Check for an interconnect path for the bus */
> -	gpu->icc_path = of_icc_get(dev, "gfx-mem");
> -	if (!gpu->icc_path) {
> -		/*
> -		 * Keep compatbility with device trees that don't have an
> -		 * interconnect-names property.
> -		 */
> +	/*
> +	 * The legacy case, before "interconnect-names", only has a
> +	 * single interconnect path which is equivalent to "gfx-mem"
> +	 */
> +	if (!of_find_property(dev->of_node, "interconnect-names", NULL)) {
>  		gpu->icc_path = of_icc_get(dev, NULL);
> +	} else {
> +		gpu->icc_path = of_icc_get(dev, "gfx-mem");
> +		gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
>  	}
> +
>  	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)) {
>  		ret = PTR_ERR(gpu->ocmem_icc_path);
>  		gpu->ocmem_icc_path = NULL;
> @@ -1026,6 +1027,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  		if (ret != -ENODATA)
>  			return ret;
>  	}
> +

Nit for an extra blank line but otherwise looks fine.  I like this workaround.

With that, Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

>  	return 0;
>  }
>  
> -- 
> 2.26.2
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Jordan Crouse <jcrouse@codeaurora.org>
To: Rob Clark <robdclark@gmail.com>
Cc: Rob Clark <robdclark@chromium.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<freedreno@lists.freedesktop.org>,
	Jonathan Marek <jonathan@marek.ca>,
	David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>,
	dri-devel@lists.freedesktop.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<linux-arm-msm@vger.kernel.org>, Sean Paul <sean@poorly.run>,
	Brian Masney <masneyb@onstation.org>
Subject: Re: [PATCH] drm/msm/adreno: fix gpu probe if no interconnect-names
Date: Wed, 15 Jul 2020 14:05:24 -0600	[thread overview]
Message-ID: <20200715200523.GA26861@jcrouse1-lnx.qualcomm.com> (raw)
In-Reply-To: <20200715190732.3116556-1-robdclark@gmail.com>

On Wed, Jul 15, 2020 at 12:07:30PM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> If there is no interconnect-names, but there is an interconnects
> property, then of_icc_get(dev, "gfx-mem"); would return an error
> rather than NULL.
> 
> Also, if there is no interconnect-names property, there will never
> be a ocmem path.  But of_icc_get(dev, "ocmem") would return -EINVAL
> instead of -ENODATA.  Just don't bother trying in this case.
> 
> v2: explicity check for interconnect-names property
> 
> Fixes: 8e29fb37b301 ("drm/msm: handle for EPROBE_DEFER for of_icc_get")
> Fixes: 00bb9243d346 ("drm/msm/gpu: add support for ocmem interconnect path")
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/msm/adreno/adreno_gpu.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index 0527e85184e1..e23641a5ec84 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -1003,22 +1003,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  	if (ret)
>  		return ret;
>  
> -	/* Check for an interconnect path for the bus */
> -	gpu->icc_path = of_icc_get(dev, "gfx-mem");
> -	if (!gpu->icc_path) {
> -		/*
> -		 * Keep compatbility with device trees that don't have an
> -		 * interconnect-names property.
> -		 */
> +	/*
> +	 * The legacy case, before "interconnect-names", only has a
> +	 * single interconnect path which is equivalent to "gfx-mem"
> +	 */
> +	if (!of_find_property(dev->of_node, "interconnect-names", NULL)) {
>  		gpu->icc_path = of_icc_get(dev, NULL);
> +	} else {
> +		gpu->icc_path = of_icc_get(dev, "gfx-mem");
> +		gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
>  	}
> +
>  	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)) {
>  		ret = PTR_ERR(gpu->ocmem_icc_path);
>  		gpu->ocmem_icc_path = NULL;
> @@ -1026,6 +1027,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
>  		if (ret != -ENODATA)
>  			return ret;
>  	}
> +

Nit for an extra blank line but otherwise looks fine.  I like this workaround.

With that, Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

>  	return 0;
>  }
>  
> -- 
> 2.26.2
> 

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-07-15 20:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 19:07 [PATCH] drm/msm/adreno: fix gpu probe if no interconnect-names Rob Clark
2020-07-15 19:07 ` Rob Clark
2020-07-15 20:05 ` Jordan Crouse [this message]
2020-07-15 20:05   ` Jordan Crouse
  -- strict thread matches above, loose matches on Subject: below --
2020-07-15 18:29 Rob Clark
2020-07-15 18:29 ` Rob Clark
2020-07-15 18:36 ` Jonathan Marek
2020-07-15 18:36   ` Jonathan Marek
2020-07-15 18:46   ` Rob Clark
2020-07-15 18:46     ` 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=20200715200523.GA26861@jcrouse1-lnx.qualcomm.com \
    --to=jcrouse@codeaurora.org \
    --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=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masneyb@onstation.org \
    --cc=robdclark@chromium.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 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.