All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpiolib: suppress error message on EPROBE_DEFER
@ 2018-01-21 20:32 David Lechner
  2018-02-07 12:57 ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: David Lechner @ 2018-01-21 20:32 UTC (permalink / raw)
  To: linux-gpio; +Cc: linux-kernel, David Lechner, Linus Walleij

This suppresses printing an error message during probe of gpio drivers
when the error is EPROBE_DEFER.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David Lechner <david@lechnology.com>
---
 drivers/gpio/gpiolib.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 44332b7..134d0e4 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1289,9 +1289,10 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data,
 err_free_gdev:
 	ida_simple_remove(&gpio_ida, gdev->id);
 	/* failures here can mean systems won't boot... */
-	pr_err("%s: GPIOs %d..%d (%s) failed to register\n", __func__,
-	       gdev->base, gdev->base + gdev->ngpio - 1,
-	       chip->label ? : "generic");
+	if (status != -EPROBE_DEFER)
+		pr_err("%s: GPIOs %d..%d (%s) failed to register\n", __func__,
+		       gdev->base, gdev->base + gdev->ngpio - 1,
+		       chip->label ? : "generic");
 	kfree(gdev);
 	return status;
 }
-- 
2.7.4


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

* Re: [PATCH] gpiolib: suppress error message on EPROBE_DEFER
  2018-01-21 20:32 [PATCH] gpiolib: suppress error message on EPROBE_DEFER David Lechner
@ 2018-02-07 12:57 ` Linus Walleij
  2018-02-08 18:18     ` Grygorii Strashko
  2018-02-18  3:47   ` David Lechner
  0 siblings, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2018-02-07 12:57 UTC (permalink / raw)
  To: David Lechner; +Cc: linux-gpio, linux-kernel

On Sun, Jan 21, 2018 at 9:32 PM, David Lechner <david@lechnology.com> wrote:

> This suppresses printing an error message during probe of gpio drivers
> when the error is EPROBE_DEFER.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: David Lechner <david@lechnology.com>

I'm not sure about this.

GPIO can be very basic system components. If we don't
print this, defer a few times (for some reason) and then
the kernel gives up on retrying, silently (as it happens)
there is no trace in dmesg of what happened. That makes
things hard to debug.

This happened to me with some other driver, so it is not
a made up example.

What about an explicit deferral message for now?

Yours,
Linus Walleij

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

* Re: [PATCH] gpiolib: suppress error message on EPROBE_DEFER
  2018-02-07 12:57 ` Linus Walleij
@ 2018-02-08 18:18     ` Grygorii Strashko
  2018-02-18  3:47   ` David Lechner
  1 sibling, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2018-02-08 18:18 UTC (permalink / raw)
  To: Linus Walleij, David Lechner; +Cc: linux-gpio, linux-kernel



On 02/07/2018 06:57 AM, Linus Walleij wrote:
> On Sun, Jan 21, 2018 at 9:32 PM, David Lechner <david@lechnology.com> wrote:
> 
>> This suppresses printing an error message during probe of gpio drivers
>> when the error is EPROBE_DEFER.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: David Lechner <david@lechnology.com>
> 
> I'm not sure about this.
> 
> GPIO can be very basic system components. If we don't
> print this, defer a few times (for some reason) and then
> the kernel gives up on retrying, silently (as it happens)
> there is no trace in dmesg of what happened. That makes
> things hard to debug.
> 
> This happened to me with some other driver, so it is not
> a made up example.
> 
> What about an explicit deferral message for now?
> 

The DD has debuging prints for all cases, so in general it can be used
for boot debugging (really_probe()). So, in my opinion it make sense to 
print gpiolib specific message only in case of !EPROBE_DEFER.

5c

-- 
regards,
-grygorii

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

* Re: [PATCH] gpiolib: suppress error message on EPROBE_DEFER
@ 2018-02-08 18:18     ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2018-02-08 18:18 UTC (permalink / raw)
  To: Linus Walleij, David Lechner; +Cc: linux-gpio, linux-kernel



On 02/07/2018 06:57 AM, Linus Walleij wrote:
> On Sun, Jan 21, 2018 at 9:32 PM, David Lechner <david@lechnology.com> wrote:
> 
>> This suppresses printing an error message during probe of gpio drivers
>> when the error is EPROBE_DEFER.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: David Lechner <david@lechnology.com>
> 
> I'm not sure about this.
> 
> GPIO can be very basic system components. If we don't
> print this, defer a few times (for some reason) and then
> the kernel gives up on retrying, silently (as it happens)
> there is no trace in dmesg of what happened. That makes
> things hard to debug.
> 
> This happened to me with some other driver, so it is not
> a made up example.
> 
> What about an explicit deferral message for now?
> 

The DD has debuging prints for all cases, so in general it can be used
for boot debugging (really_probe()). So, in my opinion it make sense to 
print gpiolib specific message only in case of !EPROBE_DEFER.

5c

-- 
regards,
-grygorii

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

* Re: [PATCH] gpiolib: suppress error message on EPROBE_DEFER
  2018-02-07 12:57 ` Linus Walleij
  2018-02-08 18:18     ` Grygorii Strashko
@ 2018-02-18  3:47   ` David Lechner
  2018-02-22 15:00     ` Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: David Lechner @ 2018-02-18  3:47 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

On 02/07/2018 06:57 AM, Linus Walleij wrote:
> On Sun, Jan 21, 2018 at 9:32 PM, David Lechner <david@lechnology.com> wrote:
> 
>> This suppresses printing an error message during probe of gpio drivers
>> when the error is EPROBE_DEFER.
>>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: David Lechner <david@lechnology.com>
> 
> I'm not sure about this.
> 
> GPIO can be very basic system components. If we don't
> print this, defer a few times (for some reason) and then
> the kernel gives up on retrying, silently (as it happens)
> there is no trace in dmesg of what happened. That makes
> things hard to debug.
> 
> This happened to me with some other driver, so it is not
> a made up example.
> 
> What about an explicit deferral message for now?

so you mean something like this?

if (err == -EPROBE_DEFER)
	dev_info(dev, "deferring probe\n")
else
	dev_err(dev, "... failed to register\n")

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

* Re: [PATCH] gpiolib: suppress error message on EPROBE_DEFER
  2018-02-18  3:47   ` David Lechner
@ 2018-02-22 15:00     ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2018-02-22 15:00 UTC (permalink / raw)
  To: David Lechner; +Cc: open list:GPIO SUBSYSTEM, linux-kernel

On Sun, Feb 18, 2018 at 4:47 AM, David Lechner <david@lechnology.com> wrote:
> On 02/07/2018 06:57 AM, Linus Walleij wrote:
>>
>> On Sun, Jan 21, 2018 at 9:32 PM, David Lechner <david@lechnology.com>
>> wrote:
>>
>>> This suppresses printing an error message during probe of gpio drivers
>>> when the error is EPROBE_DEFER.
>>>
>>> Cc: Linus Walleij <linus.walleij@linaro.org>
>>> Signed-off-by: David Lechner <david@lechnology.com>
>>
>>
>> I'm not sure about this.
>>
>> GPIO can be very basic system components. If we don't
>> print this, defer a few times (for some reason) and then
>> the kernel gives up on retrying, silently (as it happens)
>> there is no trace in dmesg of what happened. That makes
>> things hard to debug.
>>
>> This happened to me with some other driver, so it is not
>> a made up example.
>>
>> What about an explicit deferral message for now?
>
>
> so you mean something like this?
>
> if (err == -EPROBE_DEFER)
>         dev_info(dev, "deferring probe\n")
> else
>         dev_err(dev, "... failed to register\n")

Yes exactly.

It has been brought to my attention that people are especially
allergic to dmesg messages containing the word "failed". So
if that is the problem, let's avoid it like this.

Yours,
Linus Walleij

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

end of thread, other threads:[~2018-02-22 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-21 20:32 [PATCH] gpiolib: suppress error message on EPROBE_DEFER David Lechner
2018-02-07 12:57 ` Linus Walleij
2018-02-08 18:18   ` Grygorii Strashko
2018-02-08 18:18     ` Grygorii Strashko
2018-02-18  3:47   ` David Lechner
2018-02-22 15:00     ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.