Skip to content

Commit 520c651

Browse files
committed
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: 08af476 ("drm/msm: handle for EPROBE_DEFER for of_icc_get") Fixes: 00bb924 ("drm/msm/gpu: add support for ocmem interconnect path") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 7b149f2 commit 520c651

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/gpu/drm/msm/adreno/adreno_gpu.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,29 +1003,31 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
10031003
if (ret)
10041004
return ret;
10051005

1006-
/* Check for an interconnect path for the bus */
1007-
gpu->icc_path = of_icc_get(dev, "gfx-mem");
1008-
if (!gpu->icc_path) {
1009-
/*
1010-
* Keep compatbility with device trees that don't have an
1011-
* interconnect-names property.
1012-
*/
1006+
/*
1007+
* The legacy case, before "interconnect-names", only has a
1008+
* single interconnect path which is equivalent to "gfx-mem"
1009+
*/
1010+
if (!of_find_property(dev->of_node, "interconnect-names", NULL)) {
10131011
gpu->icc_path = of_icc_get(dev, NULL);
1012+
} else {
1013+
gpu->icc_path = of_icc_get(dev, "gfx-mem");
1014+
gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
10141015
}
1016+
10151017
if (IS_ERR(gpu->icc_path)) {
10161018
ret = PTR_ERR(gpu->icc_path);
10171019
gpu->icc_path = NULL;
10181020
return ret;
10191021
}
10201022

1021-
gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
10221023
if (IS_ERR(gpu->ocmem_icc_path)) {
10231024
ret = PTR_ERR(gpu->ocmem_icc_path);
10241025
gpu->ocmem_icc_path = NULL;
10251026
/* allow -ENODATA, ocmem icc is optional */
10261027
if (ret != -ENODATA)
10271028
return ret;
10281029
}
1030+
10291031
return 0;
10301032
}
10311033

0 commit comments

Comments
 (0)