Re: [PATCH 1/3] regmap: flat: use the cache_present bitmap

From: Mark Brown
Date: Fri Aug 09 2013 - 07:44:34 EST


On Fri, Aug 09, 2013 at 12:09:11PM +0200, Ionut Nicu wrote:
> As opposed to the other regmap cache implementations,
> regcache_flat didn't use the cache_present bitmap for
> figuring out whether a register was cached or not, nor
> did it mark a register as present in the cache when
> regcache_flat_write() was called.

> This caused incorrect behaviour, such as returning
> value 0 for non-volatile registers without first reading
> their value from the device and storing it in the cache.

The goal with the flat cache is to do as little work as possible for
things like memory mapped devices where the cache operations are
actually noticable in comparison with the I/O costs. I would therefore
exapect that anything using the flat cache would want to ensure that the
cache is fully populated at init time, reading back from the device if
nothing else (by setting num_reg_defaults_raw but not providing values),
rather than do additional operations in the data path.

Attachment: signature.asc
Description: Digital signature