Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668399 > unrolled thread

[PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary

Started byMichał Mirosław <mirq-linux@rere.qmqm.pl>
First post2017-06-17 23:40 +0200
Last post2017-06-19 18:50 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH RESEND v2 1/2] regulator: include 'enabled' status in  debugfs/regulator_summary Michał Mirosław <mirq-linux@rere.qmqm.pl> - 2017-06-17 23:40 +0200
    Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in  debugfs/regulator_summary Mark Brown <broonie@kernel.org> - 2017-06-19 12:20 +0200
      Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in  debugfs/regulator_summary Mark Brown <broonie@kernel.org> - 2017-06-19 18:50 +0200
        Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in  debugfs/regulator_summary Michał Mirosław <mirq-linux@rere.qmqm.pl> - 2017-06-19 19:00 +0200
          Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in  debugfs/regulator_summary Mark Brown <broonie@kernel.org> - 2017-06-19 19:50 +0200
      Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in  debugfs/regulator_summary Michał Mirosław <mirq-linux@rere.qmqm.pl> - 2017-06-19 18:50 +0200

#1668399 — [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary

FromMichał Mirosław <mirq-linux@rere.qmqm.pl>
Date2017-06-17 23:40 +0200
Subject[PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
Message-ID<tTtBL-4x1-3@gated-at.bofh.it>
Extend regulator's info line with enabled/disabled status.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2:
  - include commit message

 drivers/regulator/core.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c0d9ae8d0860..ba4d121ae07f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4379,13 +4379,18 @@ static void regulator_summary_show_subtree(struct seq_file *s,
 	struct regulation_constraints *c;
 	struct regulator *consumer;
 	struct summary_data summary_data;
+	int is_enabled;
 
 	if (!rdev)
 		return;
 
-	seq_printf(s, "%*s%-*s %3d %4d %6d ",
+	mutex_lock(&rdev->mutex);
+	is_enabled = _regulator_is_enabled(rdev);
+	mutex_unlock(&rdev->mutex);
+
+	seq_printf(s, "%*s%-*s %3d %3d %4d %6d ",
 		   level * 3 + 1, "",
-		   30 - level * 3, rdev_get_name(rdev),
+		   30 - level * 3, rdev_get_name(rdev), is_enabled,
 		   rdev->use_count, rdev->open_count, rdev->bypass_count);
 
 	seq_printf(s, "%5dmV ", _regulator_get_voltage(rdev) / 1000);
@@ -4450,8 +4455,8 @@ static int regulator_summary_show_roots(struct device *dev, void *data)
 
 static int regulator_summary_show(struct seq_file *s, void *data)
 {
-	seq_puts(s, " regulator                      use open bypass voltage current     min     max\n");
-	seq_puts(s, "-------------------------------------------------------------------------------\n");
+	seq_puts(s, " regulator                      ena use open bypass voltage current     min     max\n");
+	seq_puts(s, "-----------------------------------------------------------------------------------\n");
 
 	class_for_each_device(&regulator_class, NULL, s,
 			      regulator_summary_show_roots);
-- 
2.11.0

[toc] | [next] | [standalone]


#1668970

FromMark Brown <broonie@kernel.org>
Date2017-06-19 12:20 +0200
Message-ID<tU1WN-1kn-9@gated-at.bofh.it>
In reply to#1668399

[Multipart message — attachments visible in raw view] — view raw

On Sat, Jun 17, 2017 at 11:30:12PM +0200, Michał Mirosław wrote:
> Extend regulator's info line with enabled/disabled status.

Why is the use count not enough information here?

[toc] | [prev] | [next] | [standalone]


#1669480

FromMark Brown <broonie@kernel.org>
Date2017-06-19 18:50 +0200
Message-ID<tU82d-5a3-7@gated-at.bofh.it>
In reply to#1668970

[Multipart message — attachments visible in raw view] — view raw

On Mon, Jun 19, 2017 at 06:41:34PM +0200, Michał Mirosław wrote:
> On Mon, Jun 19, 2017 at 11:17:41AM +0100, Mark Brown wrote:
> > On Sat, Jun 17, 2017 at 11:30:12PM +0200, Michał Mirosław wrote:
> > > Extend regulator's info line with enabled/disabled status.
> > Why is the use count not enough information here?

> Regulators can be enabled without any users, because of eg. always-on.

We should probably just have always-on be incrementing the use count
instead if it's an issue.

[toc] | [prev] | [next] | [standalone]


#1669486

FromMichał Mirosław <mirq-linux@rere.qmqm.pl>
Date2017-06-19 19:00 +0200
Message-ID<tU8bU-5do-7@gated-at.bofh.it>
In reply to#1669480
On Mon, Jun 19, 2017 at 05:47:33PM +0100, Mark Brown wrote:
> On Mon, Jun 19, 2017 at 06:41:34PM +0200, Michał Mirosław wrote:
> > On Mon, Jun 19, 2017 at 11:17:41AM +0100, Mark Brown wrote:
> > > On Sat, Jun 17, 2017 at 11:30:12PM +0200, Michał Mirosław wrote:
> > > > Extend regulator's info line with enabled/disabled status.
> > > Why is the use count not enough information here?
> > Regulators can be enabled without any users, because of eg. always-on.
> We should probably just have always-on be incrementing the use count
> instead if it's an issue.

That's another way of tackling the issue. This file is a debuging aid, so
I prefer to see precise state information in it rather than have it hide
some special cases like this. Not a strong opinion, though.

Best Regards,
Michał Mirosław

[toc] | [prev] | [next] | [standalone]


#1669551

FromMark Brown <broonie@kernel.org>
Date2017-06-19 19:50 +0200
Message-ID<tU8Yi-5Lk-21@gated-at.bofh.it>
In reply to#1669486

[Multipart message — attachments visible in raw view] — view raw

On Mon, Jun 19, 2017 at 06:59:39PM +0200, Michał Mirosław wrote:
> On Mon, Jun 19, 2017 at 05:47:33PM +0100, Mark Brown wrote:

> > We should probably just have always-on be incrementing the use count
> > instead if it's an issue.

> That's another way of tackling the issue. This file is a debuging aid, so
> I prefer to see precise state information in it rather than have it hide
> some special cases like this. Not a strong opinion, though.

The longer the line gets the harder it is to read.

[toc] | [prev] | [next] | [standalone]


#1669481

FromMichał Mirosław <mirq-linux@rere.qmqm.pl>
Date2017-06-19 18:50 +0200
Message-ID<tU82e-5a3-9@gated-at.bofh.it>
In reply to#1668970
On Mon, Jun 19, 2017 at 11:17:41AM +0100, Mark Brown wrote:
> On Sat, Jun 17, 2017 at 11:30:12PM +0200, Michał Mirosław wrote:
> > Extend regulator's info line with enabled/disabled status.
> Why is the use count not enough information here?

Regulators can be enabled without any users, because of eg. always-on.

Best Regards,
Michał Mirosław

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web