lkml.org 
[lkml]   [2011]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/8] regmap: Ensure we scream if we enable cache bypass/only at the same time
On Thu, Sep 29, 2011 at 11:25:30AM +0100, Mark Brown wrote:
> On Thu, Sep 29, 2011 at 10:39:13AM +0100, Dimitris Papastamos wrote:
>
> > void regcache_cache_only(struct regmap *map, bool enable)
> > {
> > + BUG_ON(map->cache_bypass && enable);
> > mutex_lock(&map->lock);
>
> I'd move these inside the lock otherwise there's an enable/enable race
> where two threads check that things are safe simultaneously. I'd also
> change to WARN_ON(), if nothing else it's hard to see BUG_ON()s that
> occur prior to console output and PMICs are likely to trigger that sort
> of stuff.

Aw yes, of course :)


\
 
 \ /
  Last update: 2011-09-29 15:27    [from the cache]
©2003-2011 Jasper Spaans