From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752425AbdLLP4u (ORCPT ); Tue, 12 Dec 2017 10:56:50 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:48040 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752048AbdLLP4s (ORCPT ); Tue, 12 Dec 2017 10:56:48 -0500 Date: Tue, 12 Dec 2017 15:56:44 +0000 From: Mark Brown To: Bartosz Golaszewski Cc: Lars-Peter Clausen , Greg Kroah-Hartman , Linux Kernel Mailing List Subject: Re: [PATCH] regmap: allow to disable all locking mechanisms Message-ID: <20171212155644.GK16323@sirena.org.uk> References: <20171206142621.1053-1-brgl@bgdev.pl> <20171212121831.GJ16323@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="W/+CTqSGWdiRg+8j" Content-Disposition: inline In-Reply-To: X-Cookie: This screen intentionally left blank. User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --W/+CTqSGWdiRg+8j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 12, 2017 at 01:21:46PM +0100, Bartosz Golaszewski wrote: > 2017-12-12 13:18 GMT+01:00 Mark Brown : > > 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. --W/+CTqSGWdiRg+8j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlov/DsACgkQJNaLcl1U h9Axswf/RT85+hZDEWcfAsV2uBSAfQA2to5MF75iZk3b0nMkdq7SeiYcHFPnzcET xlOSMGb1bL+wDH5EuL3OCBZdjIUkXZlOEoetyzmqJkk21TBGxiYH+YtYT3HXgZtV ofNmqhflP35OBSX1YEpcU0oZKPCMWpmbblmwluedZX/awmszwAxvm0xX79HcPQKt VxVkF0UZFnRPN/miFnAnDyGdHv3lqjR2/hxK9YATr/n40T+bfMDdILb8lpt0+CuM J6/TjSwONwasb8UX6aw1ef9sUji2tFRD2lMrChuFsuWScX46w92/Krmu/ZRCTmXM CwAOKvzhBkR2YXzdmiARViO2leu7Cw== =Ngig -----END PGP SIGNATURE----- --W/+CTqSGWdiRg+8j--