]> www.infradead.org Git - linux.git/commitdiff
regcache: Improve documentation of available cache types
authorMark Brown <broonie@kernel.org>
Tue, 24 Sep 2024 10:08:08 +0000 (12:08 +0200)
committerMark Brown <broonie@kernel.org>
Sun, 29 Sep 2024 23:11:10 +0000 (01:11 +0200)
There is some user confusion about which cache types to choose when which
is not helped by the lack of any central documentation providing an
overview of what's available. Provide a short overview in the API header to
try to help reduce this.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20240924-regcache-document-types-v1-1-e157054e1215@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
include/linux/regmap.h

index f9ccad32fc5cbad8b8ea7d32a20a738c27cca271..da07584284ab36dc3ddd5db18812a7979c7014e3 100644 (file)
@@ -54,7 +54,14 @@ struct sdw_slave;
 #define REGMAP_UPSHIFT(s)      (-(s))
 #define REGMAP_DOWNSHIFT(s)    (s)
 
-/* An enum of all the supported cache types */
+/*
+ * The supported cache types, the default is no cache.  Any new caches
+ * should usually use the maple tree cache unless they specifically
+ * require that there are never any allocations at runtime and can't
+ * provide defaults in which case they should use the flat cache.  The
+ * rbtree cache *may* have some performance advantage for very low end
+ * systems that make heavy use of cache syncs but is mainly legacy.
+ */
 enum regcache_type {
        REGCACHE_NONE,
        REGCACHE_RBTREE,