Re: [PATCH 1/2] drivers/regulator/core.c: Don't print error on EPROBE_DEFER

From: Mike Looijmans
Date: Tue Dec 16 2014 - 05:27:14 EST


ïOn 12/09/2014 07:48 PM, Mark Brown wrote:
On Tue, Dec 09, 2014 at 07:12:30PM +0100, Mike Looijmans wrote:
On 12/09/2014 05:14 PM, Mark Brown wrote:

If a regulator depends on another regulator that happens to be called
later, the kernel always prints a message like this:
reg-fixed-voltage regulator_sd1: Failed to find supply vin
Since the deferral is not something fatal, nor even something the user
may need to be aware about, reduce the message to debug level.

Can we instead at least reduce it to WARN or INFO level then?

You appear to have deleted my reply here... one problem with your
suggestion is that it means we have to special case all error handling
on probe for deferral which isn't wonderful.

(Sorry for deleting your reply. It wasn't intentional though.)

special casing deferral may not be "wonderful", but it is what currently happens in many places, and it's just "the best we can do for now". A similar patch for MMC got approval:
https://lkml.org/lkml/2014/10/27/477

I have to explain over and over again that there's no problem when that
message comes along ten times in a row. And it causes people to overlook the
messages that really are errors.

Can we do something with the log message that triggers on probe
deferral? There tends to be a learning curve with probe deferral but
the fact that it's generally extremely noisy tends to be useful - I
usually point people at that (not just in the context at regulators) and
tell them not to worry unless debugging.

Using "dev_err" is not really "tell them not to worry unless debugging", I think that is what "dev_dbg" was meant to do.

The only real solution I could come up with here is to replace "return -EPROBE_DEFER" with something that stores the current stack, registers the resource it requires and jumps back to where the driver probe originated. Once the resource is available, the stored stack is resumed and then the probe code path can continue as if nothing bad happened. This would also deliver excellent diagnostic data in case the resource remains absent. I've built something like this in Python which has a "yield" statement one can use for this purpose. It's a bit tougher to do in C I guess. So until then, we're stuck with sprinkling "if (ret == -EPROBE_DEFER)" code snippets all over the place.




Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Systems
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: (+31) (0) 499 33 69 79
Telefax: (+31) (0) 499 33 69 70
E-mail: mike.looijmans@xxxxxxxx
Website: www.topic.nl

Please consider the environment before printing this e-mail

Topic zoekt gedreven (embedded) software specialisten!
http://topic.nl/vacatures/topic-zoekt-software-engineers/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/