lkml.org 
[lkml]   [2017]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regmap: allow to disable all locking mechanisms
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-12-12 16:56    [W:0.198 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site