linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Dmitry Osipenko <digetx@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: simplify locking
Date: Mon, 10 Aug 2020 17:23:10 +0100	[thread overview]
Message-ID: <20200810162310.GE6438@sirena.org.uk> (raw)
In-Reply-To: <20200809223030.GB5522@qmqm.qmqm.pl>

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

On Mon, Aug 10, 2020 at 12:30:30AM +0200, Michał Mirosław wrote:
> On Mon, Aug 10, 2020 at 12:40:04AM +0300, Dmitry Osipenko wrote:
> > 10.08.2020 00:16, Michał Mirosław пишет:

> > > -	mutex_lock(&regulator_nesting_mutex);
> > > +	if (ww_ctx || !mutex_trylock_recursive(&rdev->mutex.base))

> > Have you seen comment to the mutex_trylock_recursive()?

> > https://elixir.bootlin.com/linux/v5.8/source/include/linux/mutex.h#L205

> >  * This function should not be used, _ever_. It is purely for hysterical GEM
> >  * raisins, and once those are gone this will be removed.

> I think that reimplementing the function just to not use it is not the
> right solution. The whole locking protocol is problematic and this patch
> just uncovers one side of it.

OTOH if this is just making the issue more obvious rather than fixing it
then it's much harder to justify adding a new usage of a function people
are trying to remove.  The coupled regulator stuff is definitely a mess
as far as locking is concerned, it really interferes with the model we
had handling regulators separately as much as possible since we're no
longer just walking back up the tree.  ww does seem like the way
forwards.

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

      parent reply	other threads:[~2020-08-10 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-09 21:16 [PATCH] regulator: simplify locking Michał Mirosław
2020-08-09 21:40 ` Dmitry Osipenko
2020-08-09 22:30   ` Michał Mirosław
2020-08-10  0:21     ` Dmitry Osipenko
2020-08-10  0:59       ` Michał Mirosław
2020-08-10  5:14         ` Dmitry Osipenko
2020-08-10 16:12           ` Michał Mirosław
2020-08-10  1:08       ` Michał Mirosław
2020-08-10 16:23     ` 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=20200810162310.GE6438@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=digetx@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    /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;
as well as URLs for NNTP newsgroup(s).