public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: Mark Brown <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] drivers/regulator/core.c: Don't print error on EPROBE_DEFER
Date: Tue, 16 Dec 2014 11:27:03 +0100	[thread overview]
Message-ID: <549008F7.9060206@topic.nl> (raw)
In-Reply-To: <20141209184817.GH11764@sirena.org.uk>

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@topic.nl
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/


  parent reply	other threads:[~2014-12-16 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 13:12 [PATCH 1/2] drivers/regulator/core.c: Don't print error on EPROBE_DEFER Mike Looijmans
2014-12-09 13:12 ` [PATCH 2/2] regulator/fixed.c: Don't report EPROBE_DEFER errors Mike Looijmans
2014-12-09 16:14 ` [PATCH 1/2] drivers/regulator/core.c: Don't print error on EPROBE_DEFER Mark Brown
2014-12-09 18:12   ` Mike Looijmans
2014-12-09 18:48     ` Mark Brown
2014-12-09 19:14       ` Joe Perches
2014-12-09 19:17         ` Mark Brown
2014-12-16 10:27       ` Mike Looijmans [this message]
2014-12-16 11:29         ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=549008F7.9060206@topic.nl \
    --to=mike.looijmans@topic.nl \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox