Skip to contentSkip to conversation

gpiolib: suppress error message on EPROBE_DEFER

PATCH In review David Lechner 3 participants 5 messages Jan 21, 2018 – Feb 22, 2018 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: suppress error message on EPROBE_DEFER

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

---
 drivers/gpio/gpiolib.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpio/gpiolib.c +4 -3
index 44332b7..134d0e4 100644
@@ -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;
 }
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · David Lechner

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

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

#2 lore raw
Quoted 16 lines · Linus Walleij
Quoted 5 lines · David Lechner

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

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.

Quoted 5 lines

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

Signature · 2 lines
regards,
-grygorii
#3 lore raw
In reply to Linus Walleij
Quoted 16 lines · Linus Walleij
Quoted 5 lines · David Lechner

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

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.

Quoted 4 lines

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")

#4 lore raw
Quoted 26 lines · David Lechner
Quoted 19 lines · Linus Walleij
Quoted 5 lines · David Lechner

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

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.

Quoted 4 lines

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

What about an explicit deferral message for now?

Quoted 6 lines

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