* [PATCH] regmap: debugfs: document why we don't create the debugfs entries
@ 2017-12-22 17:42 Bartosz Golaszewski
2017-12-27 10:40 ` Applied "regmap: debugfs: document why we don't create the debugfs entries" to the regmap tree Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2017-12-22 17:42 UTC (permalink / raw)
To: Mark Brown, Greg Kroah-Hartman; +Cc: linux-kernel, Bartosz Golaszewski
This is a follow-up to commit a5ba91c380b8 ("regmap: debugfs: emit a
debug message when locking is disabled"). I figured that a user may
see this message, grep the code, come to this place and he still won't
know why we actually disabled debugfs.
Add a comment explaining the reason.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/base/regmap/regmap-debugfs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index ae962b756863..f3266334063e 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -529,6 +529,13 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
struct regmap_range_node *range_node;
const char *devname = "dummy";
+ /*
+ * Userspace can initiate reads from the hardware over debugfs.
+ * Normally internal regmap structures and buffers are protected with
+ * a mutex or a spinlock, but if the regmap owner decided to disable
+ * all locking mechanisms, this is no longer the case. For safety:
+ * don't create the debugfs entries if locking is disabled.
+ */
if (map->debugfs_disable) {
dev_dbg(map->dev, "regmap locking disabled - not creating debugfs entries\n");
return;
--
2.15.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Applied "regmap: debugfs: document why we don't create the debugfs entries" to the regmap tree
2017-12-22 17:42 [PATCH] regmap: debugfs: document why we don't create the debugfs entries Bartosz Golaszewski
@ 2017-12-27 10:40 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2017-12-27 10:40 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Mark Brown, Mark Brown, Greg Kroah-Hartman, linux-kernel,
linux-kernel
The patch
regmap: debugfs: document why we don't create the debugfs entries
has been applied to the regmap tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 078711d7f88d33b0adebb402a1bcb2aa89afe68b Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <brgl@bgdev.pl>
Date: Fri, 22 Dec 2017 18:42:08 +0100
Subject: [PATCH] regmap: debugfs: document why we don't create the debugfs
entries
This is a follow-up to commit a5ba91c380b8 ("regmap: debugfs: emit a
debug message when locking is disabled"). I figured that a user may
see this message, grep the code, come to this place and he still won't
know why we actually disabled debugfs.
Add a comment explaining the reason.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/base/regmap/regmap-debugfs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index ae962b756863..f3266334063e 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -529,6 +529,13 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
struct regmap_range_node *range_node;
const char *devname = "dummy";
+ /*
+ * Userspace can initiate reads from the hardware over debugfs.
+ * Normally internal regmap structures and buffers are protected with
+ * a mutex or a spinlock, but if the regmap owner decided to disable
+ * all locking mechanisms, this is no longer the case. For safety:
+ * don't create the debugfs entries if locking is disabled.
+ */
if (map->debugfs_disable) {
dev_dbg(map->dev, "regmap locking disabled - not creating debugfs entries\n");
return;
--
2.15.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-27 10:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-22 17:42 [PATCH] regmap: debugfs: document why we don't create the debugfs entries Bartosz Golaszewski
2017-12-27 10:40 ` Applied "regmap: debugfs: document why we don't create the debugfs entries" to the regmap tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).