From: Guenter Roeck <linux@roeck-us.net>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 1/2] regmap: Disable locking for RBTREE and MAPLE unit tests
Date: Wed, 19 Jul 2023 20:28:47 -0700 [thread overview]
Message-ID: <20230720032848.1306349-1-linux@roeck-us.net> (raw)
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>
---
drivers/base/regmap/regmap-kunit.c | 5 +++++
1 file changed, 5 insertions(+)
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)
--
2.39.2
next reply other threads:[~2023-07-20 3:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 3:28 Guenter Roeck [this message]
2023-07-20 3:28 ` [RFC PATCH 2/2] regmap: Reject fast_io regmap configurations with RBTREE and MAPLE caches Guenter Roeck
[not found] ` <CGME20230721145342eucas1p12e658a54d36d985b2811e2c21f7810ee@eucas1p1.samsung.com>
2023-07-21 14:53 ` Marek Szyprowski
2023-07-21 15:03 ` Mark Brown
2023-07-21 15:07 ` Guenter Roeck
2023-07-21 15:13 ` Mark Brown
2023-07-21 16:01 ` Guenter Roeck
2023-07-21 16:14 ` Mark Brown
2023-07-21 16:16 ` Guenter Roeck
2023-07-21 16:18 ` Dan Carpenter
2023-07-21 16:22 ` Mark Brown
2023-07-21 16:29 ` Guenter Roeck
2023-07-21 15:05 ` Guenter Roeck
2023-07-20 18:19 ` [PATCH 1/2] regmap: Disable locking for RBTREE and MAPLE unit tests Mark Brown
2023-07-21 17:41 ` (subset) " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230720032848.1306349-1-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome