Skip to content

Commit a9e2616

Browse files
groeckbroonie
authored andcommitted
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: f033c26 ("regmap: Add maple tree based register cache") Fixes: 2238959 ("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>
1 parent b460a52 commit a9e2616

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/base/regmap/regmap-kunit.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ static struct regmap *gen_regmap(struct regmap_config *config,
5858
int i;
5959
struct reg_default *defaults;
6060

61+
config->disable_locking = config->cache_type == REGCACHE_RBTREE ||
62+
config->cache_type == REGCACHE_MAPLE;
63+
6164
buf = kmalloc(size, GFP_KERNEL);
6265
if (!buf)
6366
return ERR_PTR(-ENOMEM);
@@ -889,6 +892,8 @@ static struct regmap *gen_raw_regmap(struct regmap_config *config,
889892

890893
config->cache_type = test_type->cache_type;
891894
config->val_format_endian = test_type->val_endian;
895+
config->disable_locking = config->cache_type == REGCACHE_RBTREE ||
896+
config->cache_type == REGCACHE_MAPLE;
892897

893898
buf = kmalloc(size, GFP_KERNEL);
894899
if (!buf)

0 commit comments

Comments
 (0)