[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200710160131.4.I358ea82de218ea5f4406572ade23f5e121297555@changeid>
Date: Fri, 10 Jul 2020 16:02:19 -0700
From: Douglas Anderson <dianders@...omium.org>
To: Rob Herring <robh+dt@...nel.org>, Rob Clark <robdclark@...il.com>,
Sean Paul <sean@...rly.run>, Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: dri-devel@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org,
freedreno@...ts.freedesktop.org, devicetree@...r.kernel.org,
Douglas Anderson <dianders@...omium.org>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>, linux-kernel@...r.kernel.org
Subject: [PATCH 4/9] drm/msm: Avoid manually populating our children if "simple-bus" is there
If our compatible string has "simple-bus" at the end of it then the
system will handle probing our children for us. Doing this has a few
advantages:
1. If we defer we don't have to keep probing / removing our children
which should speed up boot. The system just probes them once.
2. It fixes a problem where we could get into a big loop where we'd
have:
- msm_pdev_probe() is called.
- msm_pdev_probe() registers drivers. Registering drivers kicks
off processing of probe deferrals.
- component_master_add_with_match() could return -EPROBE_DEFER.
making msm_pdev_probe() return -EPROBE_DEFER.
- When msm_pdev_probe() returned the processing of probe deferrals
happens.
- Loop back to the start.
Signed-off-by: Douglas Anderson <dianders@...omium.org>
---
drivers/gpu/drm/msm/msm_drv.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 78b09fde9e29..f7c6ef147095 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1208,10 +1208,18 @@ static int add_display_components(struct device *dev,
if (of_device_is_compatible(dev->of_node, "qcom,mdss") ||
of_device_is_compatible(dev->of_node, "qcom,sdm845-mdss") ||
of_device_is_compatible(dev->of_node, "qcom,sc7180-mdss")) {
- ret = devm_of_platform_populate(dev);
- if (ret) {
- DRM_DEV_ERROR(dev, "failed to populate children devices\n");
- return ret;
+ /*
+ * Old device tree files didn't include "simple-bus"
+ * in their compatible string so we had to manually pouplate
+ * our children. When existing device trees are fixed this
+ * can be removed.
+ */
+ if (!of_device_is_compatible(dev->of_node, "simple-bus")) {
+ ret = devm_of_platform_populate(dev);
+ if (ret) {
+ DRM_DEV_ERROR(dev, "failed to populate children devices\n");
+ return ret;
+ }
}
mdp_dev = device_find_child(dev, NULL, compare_name_mdp);
--
2.27.0.383.g050319c2ae-goog
Powered by blists - more mailing lists