Skip to contentSkip to conversation

component: Silence bind error on -EPROBE_DEFER

PATCH Superseded James Hilliard 2 participants 4 messages Apr 11, 2020 – Apr 15, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 component: Silence bind error on -EPROBE_DEFER

If a component fails to bind due to -EPROBE_DEFER we should not log an error as this is not a real failure.

Fixes:
vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517 vc4-drm soc:gpu: master bind failed: -517

---
 drivers/base/component.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/base/component.c +6 -3
index e97704104784..157c6c790578 100644
@@ -256,7 +256,8 @@ static int try_to_bring_up_master(struct master *master,
 	ret = master->ops->bind(master->dev);
 	if (ret < 0) {
 		devres_release_group(master->dev, NULL);
-		dev_info(master->dev, "master bind failed: %d\n", ret);
+		if (ret != -EPROBE_DEFER)
+			dev_info(master->dev, "master bind failed: %d\n", ret);
 		return ret;
 	}
 
@@ -611,8 +612,10 @@ static int component_bind(struct component *component, struct master *master,
 		devres_release_group(component->dev, NULL);
 		devres_release_group(master->dev, NULL);
 
-		dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
-			dev_name(component->dev), component->ops, ret);
+		if (ret != -EPROBE_DEFER) {
+			dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
+				dev_name(component->dev), component->ops, ret);
+		}
 	}
 
 	return ret;
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 6 lines · James Hilliard

If a component fails to bind due to -EPROBE_DEFER we should not log an error as this is not a real failure.

Fixes:
vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517 vc4-drm soc:gpu: master bind failed: -517

I'd think the probe defer is useful information anyway. Maybe just tone down the severity and/or the message?

BR,
Jani.

Quoted 33 lines
---
 drivers/base/component.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/base/component.c +6 -3
index e97704104784..157c6c790578 100644
@@ -256,7 +256,8 @@ static int try_to_bring_up_master(struct master *master,
 	ret = master->ops->bind(master->dev);
 	if (ret < 0) {
 		devres_release_group(master->dev, NULL);
-		dev_info(master->dev, "master bind failed: %d\n", ret);
+		if (ret != -EPROBE_DEFER)
+			dev_info(master->dev, "master bind failed: %d\n", ret);
 		return ret;
 	}
 
@@ -611,8 +612,10 @@ static int component_bind(struct component *component, struct master *master,
 		devres_release_group(component->dev, NULL);
 		devres_release_group(master->dev, NULL);
 
-		dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
-			dev_name(component->dev), component->ops, ret);
+		if (ret != -EPROBE_DEFER) {
+			dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
+				dev_name(component->dev), component->ops, ret);
+		}
 	}
 
 	return ret;
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 11 lines · Jani Nikula
Quoted 6 lines · James Hilliard

If a component fails to bind due to -EPROBE_DEFER we should not log an error as this is not a real failure.

Fixes:
vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517 vc4-drm soc:gpu: master bind failed: -517

I'd think the probe defer is useful information anyway. Maybe just tone down the severity and/or the message?

That's probably not needed as there's dev_dbg logging for -EPROBE_DEFER elsewhere from what it looks like.

For example:
https://github.com/torvalds/linux/blob/v5.6/drivers/base/dd.c#L621

Quoted 36 lines

BR,
Jani.

Quoted 32 lines
---
 drivers/base/component.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/base/component.c +6 -3
index e97704104784..157c6c790578 100644
@@ -256,7 +256,8 @@ static int try_to_bring_up_master(struct master *master,
      ret = master->ops->bind(master->dev);
      if (ret < 0) {
              devres_release_group(master->dev, NULL);
-             dev_info(master->dev, "master bind failed: %d\n", ret);
+             if (ret != -EPROBE_DEFER)
+                     dev_info(master->dev, "master bind failed: %d\n", ret);
              return ret;
      }
 
@@ -611,8 +612,10 @@ static int component_bind(struct component *component, struct master *master,
              devres_release_group(component->dev, NULL);
              devres_release_group(master->dev, NULL);
 
-             dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
-                     dev_name(component->dev), component->ops, ret);
+             if (ret != -EPROBE_DEFER) {
+                     dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
+                             dev_name(component->dev), component->ops, ret);
+             }
      }
 
Quoted 4 lines

drivers/base/component.c static int component_bind(struct component *component, struct master *master, · line 621

Quoted 1 line
drivers/base/component.c +0 -0
      return ret;

--
Jani Nikula, Intel Open Source Graphics Center

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 6 lines · James Hilliard
Quoted 5 lines · Jani Nikula
Quoted 3 lines · James Hilliard

If a component fails to bind due to -EPROBE_DEFER we should not log an error as this is not a real failure.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Fixes:
vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517 vc4-drm soc:gpu: master bind failed: -517

I'd think the probe defer is useful information anyway. Maybe just tone down the severity and/or the message?

That's probably not needed as there's dev_dbg logging for -EPROBE_DEFER elsewhere from what it looks like.

If you say so; I don't have the time to go through all the code paths.

BR,
Jani.

Quoted 43 lines

For example:
https://github.com/torvalds/linux/blob/v5.6/drivers/base/dd.c#L621

Quoted 40 lines

BR,
Jani.

Quoted 23 lines
---
 drivers/base/component.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/base/component.c +2 -1
index e97704104784..157c6c790578 100644
@@ -256,7 +256,8 @@ static int try_to_bring_up_master(struct master *master,
      ret = master->ops->bind(master->dev);
      if (ret < 0) {
              devres_release_group(master->dev, NULL);
-             dev_info(master->dev, "master bind failed: %d\n", ret);
+             if (ret != -EPROBE_DEFER)
+                     dev_info(master->dev, "master bind failed: %d\n", ret);
              return ret;
      }
 
@@ -611,8 +612,10 @@ static int component_bind(struct component *component, struct master *master,
              devres_release_group(component->dev, NULL);
              devres_release_group(master->dev, NULL);

drivers/base/component.c static int component_bind(struct component *component, struct master *master, · line 621

Quoted 10 lines
drivers/base/component.c +4 -2
 
-             dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
-                     dev_name(component->dev), component->ops, ret);
+             if (ret != -EPROBE_DEFER) {
+                     dev_err(master->dev, "failed to bind %s (ops %ps): %d\n",
+                             dev_name(component->dev), component->ops, ret);
+             }
      }
 
      return ret;

--
Jani Nikula, Intel Open Source Graphics Center

Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel