lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200715200523.GA26861@jcrouse1-lnx.qualcomm.com>
Date:   Wed, 15 Jul 2020 14:05:24 -0600
From:   Jordan Crouse <jcrouse@...eaurora.org>
To:     Rob Clark <robdclark@...il.com>
Cc:     dri-devel@...ts.freedesktop.org,
        Jonathan Marek <jonathan@...ek.ca>,
        Rob Clark <robdclark@...omium.org>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Brian Masney <masneyb@...tation.org>,
        Fabio Estevam <festevam@...il.com>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <linux-arm-msm@...r.kernel.org>,
        "open list:DRM DRIVER FOR MSM ADRENO GPU" 
        <freedreno@...ts.freedesktop.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/msm/adreno: fix gpu probe if no interconnect-names

On Wed, Jul 15, 2020 at 12:07:30PM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@...omium.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@...omium.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@...eaurora.org>

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ