mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regmap: allow to disable all locking mechanisms
Date: Tue, 12 Dec 2017 15:56:44 +0000	[thread overview]
Message-ID: <20171212155644.GK16323@sirena.org.uk> (raw)
In-Reply-To: <CAMRc=Meyr6AuomZYZsuc4MnnoOcOGVDiQvPc+zA+tzsRsY1f3w@mail.gmail.com>

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

On Tue, Dec 12, 2017 at 01:21:46PM +0100, Bartosz Golaszewski wrote:
> 2017-12-12 13:18 GMT+01:00 Mark Brown <broonie@kernel.org>:

> > That's true, and the debugfs is world readable too so we can't just say
> > it's up to root to be sensible.

> This lock is only taken when writing to cache_only and cache_bypass though.

No, that's not the case at all.  Most obviously userspace can also
initiate read operations from debugfs.

> Maybe the right approach would be to provide users with locking
> routines (regmap_lock()/regmap_unlock()) and then add a boolean
> variable to the config (e.g. bool manual_locking) which would indicate
> to regmap that it shouldn't take the lock in most cases (except for
> debugfs) as this would be manually done by the regmap owner?

The most obvious thing is just to do what Lars suggested and suppress
the creation of the debugfs entries for the device when locking is
disabled.

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

      reply	other threads:[~2017-12-12 15:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 14:26 Bartosz Golaszewski
2017-12-06 15:33 ` Applied "regmap: allow to disable all locking mechanisms" to the regmap tree Mark Brown
2017-12-10 13:10 ` [PATCH] regmap: allow to disable all locking mechanisms Andy Shevchenko
2017-12-10 15:14   ` Bartosz Golaszewski
2017-12-12 11:12     ` Andy Shevchenko
2017-12-12 11:25       ` Mark Brown
2017-12-12 11:42 ` Lars-Peter Clausen
2017-12-12 12:18   ` Mark Brown
2017-12-12 12:21     ` Bartosz Golaszewski
2017-12-12 15:56       ` 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=20171212155644.GK16323@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=lars@metafoo.de \
    --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

all inboxes | Powered by JetHome®