Re: [PATCH v5 1/8] regmap: Support atomic forced uncached reads

From: Andy Shevchenko
Date: Sat Jun 12 2021 - 17:25:00 EST


On Sun, Jun 13, 2021 at 12:13 AM Sander Vanheule <sander@xxxxxxxxxxxxx> wrote:
>
> When a user wants to read a single uncached register, cache bypassing
> can be enabled. However, this is not atomic unless an external lock is
> used for the regmap. When using regcache_cache_bypass, the original
> bypass state also cannot be restored.
>
> Add support to atomically read a single uncached value, bypassing any
> regmap cache.

> +int regmap_read_bypassed(struct regmap *map, unsigned int reg, unsigned int *val)

If this is acceptable in general, I will rather name the function like
regmap_nocache_read() to be aligned with the other API naming pattern
(see below).

> int regmap_raw_write_async(struct regmap *map, unsigned int reg,
> const void *val, size_t val_len);
> int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
> +int regmap_read_bypassed(struct regmap *map, unsigned int reg, unsigned int *val);
> int regmap_raw_read(struct regmap *map, unsigned int reg,
> void *val, size_t val_len);
> int regmap_noinc_read(struct regmap *map, unsigned int reg,


--
With Best Regards,
Andy Shevchenko