dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] component: Silence bind error on -EPROBE_DEFER
@ 2020-04-11  5:41 James Hilliard
  2020-04-14 11:07 ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: James Hilliard @ 2020-04-11  5:41 UTC (permalink / raw)
  To: dri-devel
  Cc: Greg Kroah-Hartman, James Hilliard, linux-kernel, Rafael J . Wysocki

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

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 drivers/base/component.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index e97704104784..157c6c790578 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -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;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] component: Silence bind error on -EPROBE_DEFER
  2020-04-11  5:41 [PATCH] component: Silence bind error on -EPROBE_DEFER James Hilliard
@ 2020-04-14 11:07 ` Jani Nikula
  2020-04-14 23:56   ` James Hilliard
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2020-04-14 11:07 UTC (permalink / raw)
  To: James Hilliard, dri-devel
  Cc: Greg Kroah-Hartman, James Hilliard, linux-kernel, Rafael J . Wysocki

On Fri, 10 Apr 2020, James Hilliard <james.hilliard1@gmail.com> wrote:
> 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.

>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  drivers/base/component.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/base/component.c b/drivers/base/component.c
> index e97704104784..157c6c790578 100644
> --- a/drivers/base/component.c
> +++ b/drivers/base/component.c
> @@ -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;

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] component: Silence bind error on -EPROBE_DEFER
  2020-04-14 11:07 ` Jani Nikula
@ 2020-04-14 23:56   ` James Hilliard
  2020-04-15  7:37     ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: James Hilliard @ 2020-04-14 23:56 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Greg Kroah-Hartman, Linux Kernel Mailing List, dri-devel,
	Rafael J . Wysocki

On Tue, Apr 14, 2020 at 5:07 AM Jani Nikula <jani.nikula@linux.intel.com> wrote:
>
> On Fri, 10 Apr 2020, James Hilliard <james.hilliard1@gmail.com> wrote:
> > 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
>
> BR,
> Jani.
>
> >
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > ---
> >  drivers/base/component.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/base/component.c b/drivers/base/component.c
> > index e97704104784..157c6c790578 100644
> > --- a/drivers/base/component.c
> > +++ b/drivers/base/component.c
> > @@ -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;
>
> --
> Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] component: Silence bind error on -EPROBE_DEFER
  2020-04-14 23:56   ` James Hilliard
@ 2020-04-15  7:37     ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2020-04-15  7:37 UTC (permalink / raw)
  To: James Hilliard
  Cc: Greg Kroah-Hartman, Linux Kernel Mailing List, dri-devel,
	Rafael J . Wysocki

On Tue, 14 Apr 2020, James Hilliard <james.hilliard1@gmail.com> wrote:
> On Tue, Apr 14, 2020 at 5:07 AM Jani Nikula <jani.nikula@linux.intel.com> wrote:
>>
>> On Fri, 10 Apr 2020, James Hilliard <james.hilliard1@gmail.com> wrote:
>> > 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.

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

BR,
Jani.


>
> For example:
> https://github.com/torvalds/linux/blob/v5.6/drivers/base/dd.c#L621
>>
>> BR,
>> Jani.
>>
>> >
>> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
>> > ---
>> >  drivers/base/component.c | 9 ++++++---
>> >  1 file changed, 6 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/drivers/base/component.c b/drivers/base/component.c
>> > index e97704104784..157c6c790578 100644
>> > --- a/drivers/base/component.c
>> > +++ b/drivers/base/component.c
>> > @@ -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;
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-15  7:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-11  5:41 [PATCH] component: Silence bind error on -EPROBE_DEFER James Hilliard
2020-04-14 11:07 ` Jani Nikula
2020-04-14 23:56   ` James Hilliard
2020-04-15  7:37     ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).