From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
rafael@kernel.org
Cc: Danilo Krummrich <dakr@kernel.org>,
linux-kernel@vger.kernel.org, driver-core@lists.linux.dev,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v2 2/2] regcache: Validate cache_only state in regcache_sync_region()
Date: Mon, 20 Jul 2026 10:32:38 +0700 [thread overview]
Message-ID: <20260720033238.52479-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260720033238.52479-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Add a WARN_ON() check to ensure regcache_sync_region() is not called
while cache_only is enabled.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/base/regmap/regcache.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 20e0641d21b2..be167ee6f57c 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -518,6 +518,10 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
map->lock(map->lock_arg);
+ if (WARN_ON(map->cache_only)) {
+ map->unlock(map->lock_arg);
+ return -EINVAL;
+ }
/* Remember the initial bypass state */
bypass = map->cache_bypass;
--
2.43.0
next prev parent reply other threads:[~2026-07-20 3:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 3:32 [PATCH v2 1/2] regcache: Warn if regcache_sync() is called in cache_only mode phucduc.bui
2026-07-20 3:32 ` phucduc.bui [this message]
2026-07-20 17:46 ` 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=20260720033238.52479-2-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=broonie@kernel.org \
--cc=dakr@kernel.org \
--cc=driver-core@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.