Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1493415 > unrolled thread
| Started by | Kiran Gunda <kgunda@codeaurora.org> |
|---|---|
| First post | 2016-09-29 13:40 +0200 |
| Last post | 2016-10-03 23:10 +0200 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] spmi: regmap: enable userspace writes Kiran Gunda <kgunda@codeaurora.org> - 2016-09-29 13:40 +0200
Re: [PATCH] spmi: regmap: enable userspace writes Mark Brown <broonie@kernel.org> - 2016-09-29 20:10 +0200
Re: [PATCH] spmi: regmap: enable userspace writes kgunda@codeaurora.org - 2016-09-30 07:10 +0200
Re: [PATCH] spmi: regmap: enable userspace writes Stephen Boyd <sboyd@codeaurora.org> - 2016-10-03 23:10 +0200
| From | Kiran Gunda <kgunda@codeaurora.org> |
|---|---|
| Date | 2016-09-29 13:40 +0200 |
| Subject | [PATCH] spmi: regmap: enable userspace writes |
| Message-ID | <smHR0-3wN-13@gated-at.bofh.it> |
Being able to write to spmi registers via userspace is required
for quick debug and development. Enable it.
The regmap framework uses dev_name to create debugfs dir names.
So update the spmi devices to have proper names.
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
---
drivers/base/regmap/regmap-debugfs.c | 2 +-
drivers/spmi/spmi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 1ee3d40..061e771 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -259,7 +259,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
count, ppos);
}
-#undef REGMAP_ALLOW_WRITE_DEBUGFS
+#define REGMAP_ALLOW_WRITE_DEBUGFS
#ifdef REGMAP_ALLOW_WRITE_DEBUGFS
/*
* This can be dangerous especially when we have clients such as
diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index 2b9b094..d7a0106 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -70,7 +70,7 @@ int spmi_device_add(struct spmi_device *sdev)
struct spmi_controller *ctrl = sdev->ctrl;
int err;
- dev_set_name(&sdev->dev, "%d-%02x", ctrl->nr, sdev->usid);
+ dev_set_name(&sdev->dev, "spmi%d-%02x", ctrl->nr, sdev->usid);
err = device_add(&sdev->dev);
if (err < 0) {
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
[toc] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2016-09-29 20:10 +0200 |
| Message-ID | <smNWq-7uF-19@gated-at.bofh.it> |
| In reply to | #1493415 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Sep 29, 2016 at 05:06:26PM +0530, Kiran Gunda wrote: > -#undef REGMAP_ALLOW_WRITE_DEBUGFS > +#define REGMAP_ALLOW_WRITE_DEBUGFS This is completely inappropriate for upstream, if you need to do debugging on your platform you can enable this locally but enabling random writes from userspace to any regmap device is really not a good idea for system stablity or robustness.
[toc] | [prev] | [next] | [standalone]
| From | kgunda@codeaurora.org |
|---|---|
| Date | 2016-09-30 07:10 +0200 |
| Message-ID | <smYf7-5TN-3@gated-at.bofh.it> |
| In reply to | #1493633 |
On 2016-09-29 23:30, Mark Brown wrote: > On Thu, Sep 29, 2016 at 05:06:26PM +0530, Kiran Gunda wrote: > >> -#undef REGMAP_ALLOW_WRITE_DEBUGFS >> +#define REGMAP_ALLOW_WRITE_DEBUGFS > > This is completely inappropriate for upstream, if you need to do > debugging on your platform you can enable this locally but enabling > random writes from userspace to any regmap device is really not a good > idea for system stablity or robustness. Sure. I will remove this change and send the next version only to update the spmi device name.
[toc] | [prev] | [next] | [standalone]
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Date | 2016-10-03 23:10 +0200 |
| Message-ID | <soiEO-1DF-15@gated-at.bofh.it> |
| In reply to | #1493882 |
On 09/30, kgunda@codeaurora.org wrote: > On 2016-09-29 23:30, Mark Brown wrote: > >On Thu, Sep 29, 2016 at 05:06:26PM +0530, Kiran Gunda wrote: > > > >>-#undef REGMAP_ALLOW_WRITE_DEBUGFS > >>+#define REGMAP_ALLOW_WRITE_DEBUGFS > > > >This is completely inappropriate for upstream, if you need to do > >debugging on your platform you can enable this locally but enabling > >random writes from userspace to any regmap device is really not a good > >idea for system stablity or robustness. > > Sure. I will remove this change and send the next version only to update > the spmi device name. Why? The device name looks fine. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web