diff options
author | Guenter Roeck <linux@roeck-us.net> | 2023-07-19 20:28:47 -0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-20 13:57:01 +0100 |
commit | a9e26169cfda651802f88262a315146fbe4bc74c (patch) | |
tree | 9b66d33fd9d2bac0d3c4bfd12320c9995108a992 /drivers/base/regmap/regmap-kunit.c | |
parent | b460a52257b1f5299ca70b7d1bb32442d3ce7bf6 (diff) |
regmap: Disable locking for RBTREE and MAPLE unit tests
REGCACHE_RBTREE and REGCACHE_MAPLE dynamically allocate memory
for regmap operations. This is incompatible with spinlock based locking
which is used for fast_io operations. Disable locking for the associated
unit tests to avoid lockdep splashes.
Fixes: f033c26de5a5 ("regmap: Add maple tree based register cache")
Fixes: 2238959b6ad2 ("regmap: Add some basic kunit tests")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230720032848.1306349-1-linux@roeck-us.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap/regmap-kunit.c')
-rw-r--r-- | drivers/base/regmap/regmap-kunit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-kunit.c b/drivers/base/regmap/regmap-kunit.c index 24257aa9004d..9ff3018a46aa 100644 --- a/drivers/base/regmap/regmap-kunit.c +++ b/drivers/base/regmap/regmap-kunit.c @@ -58,6 +58,9 @@ static struct regmap *gen_regmap(struct regmap_config *config, int i; struct reg_default *defaults; + config->disable_locking = config->cache_type == REGCACHE_RBTREE || + config->cache_type == REGCACHE_MAPLE; + buf = kmalloc(size, GFP_KERNEL); if (!buf) return ERR_PTR(-ENOMEM); @@ -889,6 +892,8 @@ static struct regmap *gen_raw_regmap(struct regmap_config *config, config->cache_type = test_type->cache_type; config->val_format_endian = test_type->val_endian; + config->disable_locking = config->cache_type == REGCACHE_RBTREE || + config->cache_type == REGCACHE_MAPLE; buf = kmalloc(size, GFP_KERNEL); if (!buf) |