Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754455AbbGUKnZ (ORCPT ); Tue, 21 Jul 2015 06:43:25 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:33001 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754115AbbGUKnW (ORCPT ); Tue, 21 Jul 2015 06:43:22 -0400 Date: Tue, 21 Jul 2015 11:43:14 +0100 From: Mark Brown To: Alexander Stein Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Message-ID: <20150721104314.GO11162@sirena.org.uk> References: <1437061732-21018-1-git-send-email-alexander.stein@systec-electronic.com> <3879923.hy2mOjvtRz@ws-stein> <20150720172627.GF11162@sirena.org.uk> <8537578.XGSGY4If3j@ws-stein> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d+HVnKf17tRgD4xw" Content-Disposition: inline In-Reply-To: <8537578.XGSGY4If3j@ws-stein> X-Cookie: Stay together, drag each other down. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2652 Lines: 67 --d+HVnKf17tRgD4xw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 21, 2015 at 08:14:32AM +0200, Alexander Stein wrote: > On Monday 20 July 2015 18:26:27, Mark Brown wrote: > > Well, it's *better* to provide defaults since otherwise everything > > defaults to 0 but it does avoid the whole allocation during fast path > > issue since it allocates the cache on init and perhaps that's OK. > There is another reason for using REGCACHE_FLAT: Using regcache_cache_onl= y=20 > (e.g. during suspend) which is not possible with REGCACHE_NONE. Sure, if you want a cache you need to use a cache. > > > So how to handle this properly? Bail out, if fast_io is available and > > > cache_type !=3D (REGCACHE_NONE || REGCACHE_FLAT)? > > Or perhaps just if we have to do an allocation? I can see that someone > > might want to use an rbtree and would be careful enough to do the init, > > though I *am* a bit dubious about it. > I'm feeling uncomfortable this warning occured only when (at least)=20 > CONFIG_LOCKDEP is enabled. It warns right ahead but only if you begged fo= r=20 > it... OTOH it'll splat with lockdep enabled just as soon as someone tries to access a register that they didn't provide a default for. An explicitly added error and bomb out like I suggested above would do the same thing. > Even if defaults are provided an extension to the register set (e.g. a mo= re=20 > recent IP revision with more features) might not be synchronized with the= =20 > defaults. Nobody might noticed until CONFIG_LOCKDEP is enabled and the=20 > register without defaults gets written. Sure, it's got sharp edges but the whole point with my suggestion above is that detection wouldn't depend on CONFIG_LOCKDEP. --d+HVnKf17tRgD4xw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVriJBAAoJECTWi3JdVIfQrlgH/0AMUjlcDkNGAJ0tUnLmaMDH /uFitcZVMHo5yxxyp6jBEHyooYYnHgGlrcz+pfcN+Kn2PrL8AL87xjrnwCY/iTCS oa4AaUs2YnSArYYKCMwvNqly/08Qdt6mJmbEouWzMNHDSzNOBt8f7T1h1ZOcXo9n DsRAmAfE76/61Iysu9krktLaaNZs7vBNxeM9Mq4azIRs1atGGDctgidIJbVTpYiQ Iblg79mBeud5SyG+gUX1EU3GZ1g3YJn55z9813V3qEpdXfubfzBeJoq4Zd0XdMN3 Nmm8/SP1IGhBAixaxAMxFI0XOvc8P0I0CRz7/HTV7+/+LL/K+2++NF3UdHvCT2o= =BvAu -----END PGP SIGNATURE----- --d+HVnKf17tRgD4xw-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/