* [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
@ 2017-06-17 21:30 Michał Mirosław
2017-06-17 21:30 ` [PATCH RESEND v2 2/2] regulator: use consumer->supply_name " Michał Mirosław
2017-06-19 10:17 ` [PATCH RESEND v2 1/2] regulator: include 'enabled' status " Mark Brown
0 siblings, 2 replies; 7+ messages in thread
From: Michał Mirosław @ 2017-06-17 21:30 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown
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(®ulator_class, NULL, s,
regulator_summary_show_roots);
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH RESEND v2 2/2] regulator: use consumer->supply_name in debugfs/regulator_summary
2017-06-17 21:30 [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary Michał Mirosław
@ 2017-06-17 21:30 ` Michał Mirosław
2017-06-19 10:17 ` [PATCH RESEND v2 1/2] regulator: include 'enabled' status " Mark Brown
1 sibling, 0 replies; 7+ messages in thread
From: Michał Mirosław @ 2017-06-17 21:30 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown
Make it easier to identify regulator consumers when consumer device
uses more than one supply.
Before:
regulator ena use open bypass voltage current min max
-----------------------------------------------------------------------------------
regulator-dummy 1 0 2 0 0mV 0mA 0mV 0mV
1-0010 0mV 0mV
1-0010 0mV 0mV
After:
regulator ena use open bypass voltage current min max
-----------------------------------------------------------------------------------
regulator-dummy 1 0 2 0 0mV 0mA 0mV 0mV
1-0010-vccio 0mV 0mV
1-0010-vcc33 0mV 0mV
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
v2:
- extend commit message
drivers/regulator/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ba4d121ae07f..a9bfabd132cf 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4419,6 +4419,7 @@ static void regulator_summary_show_subtree(struct seq_file *s,
seq_printf(s, "%*s%-*s ",
(level + 1) * 3 + 1, "",
30 - (level + 1) * 3,
+ consumer->supply_name ? consumer->supply_name :
consumer->dev ? dev_name(consumer->dev) : "deviceless");
switch (rdev->desc->type) {
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
2017-06-17 21:30 [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary Michał Mirosław
2017-06-17 21:30 ` [PATCH RESEND v2 2/2] regulator: use consumer->supply_name " Michał Mirosław
@ 2017-06-19 10:17 ` Mark Brown
2017-06-19 16:41 ` Michał Mirosław
1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2017-06-19 10:17 UTC (permalink / raw)
To: Michał Mirosław; +Cc: linux-kernel, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
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?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
2017-06-19 10:17 ` [PATCH RESEND v2 1/2] regulator: include 'enabled' status " Mark Brown
@ 2017-06-19 16:41 ` Michał Mirosław
2017-06-19 16:47 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Michał Mirosław @ 2017-06-19 16:41 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, Liam Girdwood
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
2017-06-19 16:41 ` Michał Mirosław
@ 2017-06-19 16:47 ` Mark Brown
2017-06-19 16:59 ` Michał Mirosław
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2017-06-19 16:47 UTC (permalink / raw)
To: Michał Mirosław; +Cc: linux-kernel, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
2017-06-19 16:47 ` Mark Brown
@ 2017-06-19 16:59 ` Michał Mirosław
2017-06-19 17:44 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Michał Mirosław @ 2017-06-19 16:59 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, Liam Girdwood
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary
2017-06-19 16:59 ` Michał Mirosław
@ 2017-06-19 17:44 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-06-19 17:44 UTC (permalink / raw)
To: Michał Mirosław; +Cc: linux-kernel, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-19 17:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-17 21:30 [PATCH RESEND v2 1/2] regulator: include 'enabled' status in debugfs/regulator_summary Michał Mirosław
2017-06-17 21:30 ` [PATCH RESEND v2 2/2] regulator: use consumer->supply_name " Michał Mirosław
2017-06-19 10:17 ` [PATCH RESEND v2 1/2] regulator: include 'enabled' status " Mark Brown
2017-06-19 16:41 ` Michał Mirosław
2017-06-19 16:47 ` Mark Brown
2017-06-19 16:59 ` Michał Mirosław
2017-06-19 17:44 ` 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).