Commit 520c651f authored by Rob Clark's avatar Rob Clark

drm/msm/adreno: fix gpu probe if no interconnect-names

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: 08af4769 ("drm/msm: handle for EPROBE_DEFER for of_icc_get")
Fixes: 00bb9243 ("drm/msm/gpu: add support for ocmem interconnect path")
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 7b149f2b
...@@ -1003,22 +1003,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, ...@@ -1003,22 +1003,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (ret) if (ret)
return ret; return ret;
/* Check for an interconnect path for the bus */ /*
gpu->icc_path = of_icc_get(dev, "gfx-mem"); * The legacy case, before "interconnect-names", only has a
if (!gpu->icc_path) { * single interconnect path which is equivalent to "gfx-mem"
/* */
* Keep compatbility with device trees that don't have an if (!of_find_property(dev->of_node, "interconnect-names", NULL)) {
* interconnect-names property.
*/
gpu->icc_path = of_icc_get(dev, 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)) { if (IS_ERR(gpu->icc_path)) {
ret = PTR_ERR(gpu->icc_path); ret = PTR_ERR(gpu->icc_path);
gpu->icc_path = NULL; gpu->icc_path = NULL;
return ret; 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); ret = PTR_ERR(gpu->ocmem_icc_path);
gpu->ocmem_icc_path = NULL; gpu->ocmem_icc_path = NULL;
...@@ -1026,6 +1027,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, ...@@ -1026,6 +1027,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (ret != -ENODATA) if (ret != -ENODATA)
return ret; return ret;
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment