<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/base/regmap/regcache-flat.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-31T12:01:54+00:00</updated>
<entry>
<title>regcache: flat: Split -&gt;populate() from -&gt;init()</title>
<updated>2025-10-31T12:01:54+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-10-31T08:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44c1a444b030647803d900e60f5a8af31a782f0e'/>
<id>urn:sha1:44c1a444b030647803d900e60f5a8af31a782f0e</id>
<content type='text'>
Split -&gt;populate() implementation from -&gt;init() code.
This decoupling will help for the further changes.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://patch.msgid.link/20251031080540.3970776-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: flat: Remove unneeded check and error message for -ENOMEM</title>
<updated>2025-10-31T12:01:53+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2025-10-31T08:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27fef3048fe95934f6f2f87341eb33ef6581a075'/>
<id>urn:sha1:27fef3048fe95934f6f2f87341eb33ef6581a075</id>
<content type='text'>
There is a convention in the kernel to avoid error messages
in the cases of -ENOMEM errors. Besides that, the idea behind
using struct_size() and other macros from overflow.h is
to saturate the size that the following allocation call will
definitely fail, hence the check and the error messaging added
in regcache_flat_init() are redundant. Remove them.

Acked-by: Sander Vanheule &lt;sander@svanheule.net&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Charles Keepax &lt;ckeepax@opensource.cirrus.com&gt;
Link: https://patch.msgid.link/20251031080540.3970776-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: warn users about uninitialized flat cache</title>
<updated>2025-10-29T12:54:05+00:00</updated>
<author>
<name>Sander Vanheule</name>
<email>sander@svanheule.net</email>
</author>
<published>2025-10-29T08:12:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8'/>
<id>urn:sha1:e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8</id>
<content type='text'>
The standard flat cache did not contain any validity info, so the cache
was always considered to be entirely valid. Multiple mechanisms exist to
initialize the cache on regmap init (defaults, raw defaults, HW init),
but not all drivers are using one of these. As a result, their
implementation might currently depend on the zero-initialized cache or
contain other workarounds.

When reading an uninitialized value from the flat cache, warn the user,
but maintain the current behavior. This will allow developers to switch
to a sparse (flat) cache independently.

Signed-off-by: Sander Vanheule &lt;sander@svanheule.net&gt;
Link: https://patch.msgid.link/20251029081248.52607-3-sander@svanheule.net
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: add flat cache with sparse validity</title>
<updated>2025-10-29T12:54:04+00:00</updated>
<author>
<name>Sander Vanheule</name>
<email>sander@svanheule.net</email>
</author>
<published>2025-10-29T08:12:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9c7f7262bc1affb9b9acd2ec2fb1f6314d5d474c'/>
<id>urn:sha1:9c7f7262bc1affb9b9acd2ec2fb1f6314d5d474c</id>
<content type='text'>
The flat regcache will always assume the data in the cache is valid.
Since the cache is preferred over hardware access, this may shadow the
actual state of the device.

Add a new containing cache structure with the flat data table and a
bitmap indicating cache validity. REGCACHE_FLAT will still behave as
before, as the validity is ignored.

Define new cache type REGCACHE_FLAT_S: a flat cache with sparse
validity. The sparse validity is used to determine if a hardware access
should occur to initialize the cache on the fly, vs. at regmap init for
REGCACHE_FLAT. Contrary to REGCACHE_FLAT, this allows us to implement
regcache_ops.drop.

Signed-off-by: Sander Vanheule &lt;sander@svanheule.net&gt;
Link: https://patch.msgid.link/20251029081248.52607-2-sander@svanheule.net
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: use map-&gt;alloc_flags also for allocating cache</title>
<updated>2024-08-28T12:52:29+00:00</updated>
<author>
<name>Marek Szyprowski</name>
<email>m.szyprowski@samsung.com</email>
</author>
<published>2024-08-28T12:28:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ae0acef3822ed8908e83cd24f337891e6be64eba'/>
<id>urn:sha1:ae0acef3822ed8908e83cd24f337891e6be64eba</id>
<content type='text'>
Commit fd4ebc07b4df ("regmap: Hold the regmap lock when allocating and
freeing the cache") introduced a locking around the allocating and
freeing a regmap cache, so adjust the memory allocation flags to the ones
given in the regmap configuration instead of the hardcoded GFP_KERNEL.

This fixes the "BUG: sleeping function called from invalid context"
introduced by the mentioned commit.

Fixes: fd4ebc07b4df ("regmap: Hold the regmap lock when allocating and freeing the cache")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Link: https://patch.msgid.link/20240828122834.3778031-1-m.szyprowski@samsung.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: rework -&gt;max_register handling</title>
<updated>2024-02-05T14:32:35+00:00</updated>
<author>
<name>Jan Dakinevich</name>
<email>jan.dakinevich@salutedevices.com</email>
</author>
<published>2024-01-26T20:08:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0ec74ad3c157bd4bcbcc8b294777733687e8cd2a'/>
<id>urn:sha1:0ec74ad3c157bd4bcbcc8b294777733687e8cd2a</id>
<content type='text'>
When regmap consists of single register, 'regmap' subsystem is unable to
understand whether -&gt;max_register is set or not, because in both cases it
is equal to zero. It leads to that the logic based on value of
-&gt;max_register doesn't work. For example using of REGCACHE_FLAT fails.

This patch introduces an extra parameter to regmap config, indicating
that zero value in -&gt;max_register is authentic.

Signed-off-by: Jan Dakinevich &lt;jan.dakinevich@salutedevices.com&gt;
Link: https://lore.kernel.org/r/20240126200836.1829995-1-jan.dakinevich@salutedevices.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regmap: add proper SPDX identifiers on files that did not have them.</title>
<updated>2019-04-25T19:22:15+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-04-25T18:06:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=37613fa5b762a73073de3c2e23baa4a1da337e71'/>
<id>urn:sha1:37613fa5b762a73073de3c2e23baa4a1da337e71</id>
<content type='text'>
There were a few files in the regmap code that did not have SPDX
identifiers on them, so fix that up.  At the same time, remove the "free
form" text that specified the license of the file, as that is impossible
for any tool to properly parse.

Also, as Mark loves // comment markers, convert all of the headers to be
the same to make things look consistent :)

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: flat: Un-inline index lookup from cache access</title>
<updated>2018-01-08T12:08:57+00:00</updated>
<author>
<name>Andrew F. Davis</name>
<email>afd@ti.com</email>
</author>
<published>2018-01-07T23:22:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=46318b9784fb7b8363cc67bec24796b15dbba1e9'/>
<id>urn:sha1:46318b9784fb7b8363cc67bec24796b15dbba1e9</id>
<content type='text'>
This makes the code slightly more readable and allows for cleaner
addition of functionality in later patches.

Signed-off-by: Andrew F. Davis &lt;afd@ti.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: flat: Require max_registers to be set</title>
<updated>2016-03-29T16:51:04+00:00</updated>
<author>
<name>Alexander Stein</name>
<email>alexander.stein@systec-electronic.com</email>
</author>
<published>2016-03-29T06:53:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e4f28780f38e27cb7ca0edeb1d7ebb4edfd1fc5'/>
<id>urn:sha1:6e4f28780f38e27cb7ca0edeb1d7ebb4edfd1fc5</id>
<content type='text'>
If max_register is unset, regcache_flat_get_index will return 0 and only
memory for 1 unsigned int will be allocated, resulting in writing out
of bounds.

Signed-off-by: Alexander Stein &lt;alexander.stein@systec-electronic.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>regcache: flat: Introduce register strider order</title>
<updated>2016-02-19T16:12:32+00:00</updated>
<author>
<name>Xiubo Li</name>
<email>lixiubo@cmss.chinamobile.com</email>
</author>
<published>2016-01-04T10:00:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce11020f0e82dbb18eb59b6f6ce92cc0410b353e'/>
<id>urn:sha1:ce11020f0e82dbb18eb59b6f6ce92cc0410b353e</id>
<content type='text'>
Here we introduce regcache_flat_get_index(), which using register
stride order and bit rotation, will save some memory spaces for
flat cache. Though this will also lost some access performance,
since the bit rotation is used to get the index of the cache array,
and this could be ingored for memory I/O accessing.

Signed-off-by: Xiubo Li &lt;lixiubo@cmss.chinamobile.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
