mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Niklas Cassel <niklas.cassel@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: core: Take lock before applying system load
Date: Mon, 18 Feb 2019 18:39:44 +0000	[thread overview]
Message-ID: <20190218183944.GH10794@sirena.org.uk> (raw)
In-Reply-To: <20190215105533.10264-1-niklas.cassel@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]

On Fri, Feb 15, 2019 at 11:55:33AM +0100, Niklas Cassel wrote:
> Take the regulator lock before applying system load.
> 
> Fixes the following lockdep splat:
> 
> [    5.583581] WARNING: CPU: 1 PID: 16 at drivers/regulator/core.c:925 drms_uA_update+0x114/0x360
> [    5.588467] Modules linked in:
> [    5.596833] CPU: 1 PID: 16 Comm: kworker/1:0 Not tainted 5.0.0-rc6-next-20190213-00002-g0fce66ab480f #18

Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative then it's
usually better to pull out the relevant sections.

>  		 * We'll only apply the initial system load if an
>  		 * initial mode wasn't specified.
>  		 */
> +		regulator_lock(rdev);
>  		drms_uA_update(rdev);
> +		regulator_unlock(rdev);

This is correct in that it will shut up the warning but we're not
supposed to need locks at this point as the regulator is in the process
of being registered so there should be no possibility of concurrent
access.  Since I can't see a sensible way to conditionally assert that
the lock is held we're probably better off just removing the annotation
since it's no longer valid.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2019-02-18 18:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 10:55 Niklas Cassel
2019-02-18 18:39 ` Mark Brown [this message]

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=20190218183944.GH10794@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niklas.cassel@linaro.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

all inboxes | Powered by JetHome®