Messages in this thread | | | Date | Tue, 21 Jul 2015 11:43:14 +0100 | From | Mark Brown <> | Subject | Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks |
| |
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_only > (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 != (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) > CONFIG_LOCKDEP is enabled. It warns right ahead but only if you begged for > 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 more > recent IP revision with more features) might not be synchronized with the > defaults. Nobody might noticed until CONFIG_LOCKDEP is enabled and the > 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. [unhandled content-type:application/pgp-signature] | |