linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* New underflow of regulator enable count warnings in v5.0-rc1
@ 2019-01-29 16:48 Tony Lindgren
  2019-01-29 17:01 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tony Lindgren @ 2019-01-29 16:48 UTC (permalink / raw)
  To: Douglas Anderson, Mark Brown
  Cc: linux-omap, Sebastian Reichel, linux-arm-kernel, linux-kernel

Hi,

Looks like commit 5451781dadf8 ("regulator: core: Only count load for
enabled consumers") started showing new warnings with v5.0-rc cycle:

regulator-dummy: Underflow of regulator enable count

I'm seeing this at least with my pwm-vibra test case:

# rumble-test /dev/input/by-path/platform-vibrator-event 0xffff
pwm-vibrator vibrator: vibrator supply vcc not found, using dummy regulator
input: pwm-vibrator as /devices/platform/vibrator/input/input4
regulator-dummy: Underflow of regulator enable count
Upload rumble effect... id=0
regulator-dummy: Underflow of regulator enable count

Are these bogus warnings for dummy regulator or do we have
real unpaired regulator calls or somewhere?

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 16:48 New underflow of regulator enable count warnings in v5.0-rc1 Tony Lindgren
@ 2019-01-29 17:01 ` Mark Brown
  2019-01-29 17:04 ` Doug Anderson
  2019-01-29 17:18 ` Sebastian Reichel
  2 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2019-01-29 17:01 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-kernel, linux-omap, Douglas Anderson, linux-arm-kernel,
	Sebastian Reichel


[-- Attachment #1.1: Type: text/plain, Size: 309 bytes --]

On Tue, Jan 29, 2019 at 08:48:13AM -0800, Tony Lindgren wrote:

> regulator-dummy: Underflow of regulator enable count

> Are these bogus warnings for dummy regulator or do we have
> real unpaired regulator calls or somewhere?

Given that this is a new warning my first guess would be that it's
legitimate...

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 16:48 New underflow of regulator enable count warnings in v5.0-rc1 Tony Lindgren
  2019-01-29 17:01 ` Mark Brown
@ 2019-01-29 17:04 ` Doug Anderson
  2019-01-29 17:11   ` Tony Lindgren
  2019-01-29 17:18 ` Sebastian Reichel
  2 siblings, 1 reply; 8+ messages in thread
From: Doug Anderson @ 2019-01-29 17:04 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Mark Brown, Sebastian Reichel, Linux ARM, LKML

Hi,

On Tue, Jan 29, 2019 at 8:48 AM Tony Lindgren <tony@atomide.com> wrote:
>
> Hi,
>
> Looks like commit 5451781dadf8 ("regulator: core: Only count load for
> enabled consumers") started showing new warnings with v5.0-rc cycle:
>
> regulator-dummy: Underflow of regulator enable count
>
> I'm seeing this at least with my pwm-vibra test case:
>
> # rumble-test /dev/input/by-path/platform-vibrator-event 0xffff
> pwm-vibrator vibrator: vibrator supply vcc not found, using dummy regulator
> input: pwm-vibrator as /devices/platform/vibrator/input/input4
> regulator-dummy: Underflow of regulator enable count
> Upload rumble effect... id=0
> regulator-dummy: Underflow of regulator enable count
>
> Are these bogus warnings for dummy regulator or do we have
> real unpaired regulator calls or somewhere?

My first guess is that there's a real unpaired regulator call somewhere.

I actually meant to include this in the commit message, but I'm an
idiot and I used "--" to break up the parts of the commit message
which confused git when Mark applied it.  Sigh.  For the full commit
message, see:

https://lkml.kernel.org/r/20181120175255.227783-1-dianders@chromium.org

In that message I said:

> - We can (and will) spit errors out for code that used to be invalid
>   but was never caught before.  Specifically if someone leaves a
>   regulator enabled and calls regulator_put() we'll yell.  We'll also
>   yell if a single consumer calls more disables than enables.

Looking quickly at 'pwm-vibra.c' it wouldn't surprise me at all if you
call regulator_disable() more times than regulator_enable().  If
that's true it should be fixed.

-Doug

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 17:04 ` Doug Anderson
@ 2019-01-29 17:11   ` Tony Lindgren
  2019-01-29 17:15     ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2019-01-29 17:11 UTC (permalink / raw)
  To: Doug Anderson; +Cc: linux-omap, Mark Brown, Sebastian Reichel, Linux ARM, LKML

* Doug Anderson <dianders@chromium.org> [190129 17:05]:
> Hi,
> 
> On Tue, Jan 29, 2019 at 8:48 AM Tony Lindgren <tony@atomide.com> wrote:
> >
> > Hi,
> >
> > Looks like commit 5451781dadf8 ("regulator: core: Only count load for
> > enabled consumers") started showing new warnings with v5.0-rc cycle:
> >
> > regulator-dummy: Underflow of regulator enable count
> >
> > I'm seeing this at least with my pwm-vibra test case:
> >
> > # rumble-test /dev/input/by-path/platform-vibrator-event 0xffff
> > pwm-vibrator vibrator: vibrator supply vcc not found, using dummy regulator
> > input: pwm-vibrator as /devices/platform/vibrator/input/input4
> > regulator-dummy: Underflow of regulator enable count
> > Upload rumble effect... id=0
> > regulator-dummy: Underflow of regulator enable count
> >
> > Are these bogus warnings for dummy regulator or do we have
> > real unpaired regulator calls or somewhere?
> 
> My first guess is that there's a real unpaired regulator call somewhere.
> 
> I actually meant to include this in the commit message, but I'm an
> idiot and I used "--" to break up the parts of the commit message
> which confused git when Mark applied it.  Sigh.  For the full commit
> message, see:
> 
> https://lkml.kernel.org/r/20181120175255.227783-1-dianders@chromium.org

Oh I see, thanks for the link :)

> In that message I said:
> 
> > - We can (and will) spit errors out for code that used to be invalid
> >   but was never caught before.  Specifically if someone leaves a
> >   regulator enabled and calls regulator_put() we'll yell.  We'll also
> >   yell if a single consumer calls more disables than enables.
> 
> Looking quickly at 'pwm-vibra.c' it wouldn't surprise me at all if you
> call regulator_disable() more times than regulator_enable().  If
> that's true it should be fixed.

OK. Let's see if Sebastian spots where pwm_vibrator_start()
and pwm_vibrator_stop() might get called multiple times
or something similar.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 17:11   ` Tony Lindgren
@ 2019-01-29 17:15     ` Mark Brown
  2019-01-29 17:18       ` Tony Lindgren
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2019-01-29 17:15 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: LKML, linux-omap, Doug Anderson, Linux ARM, Sebastian Reichel


[-- Attachment #1.1: Type: text/plain, Size: 672 bytes --]

On Tue, Jan 29, 2019 at 09:11:51AM -0800, Tony Lindgren wrote:

> OK. Let's see if Sebastian spots where pwm_vibrator_start()
> and pwm_vibrator_stop() might get called multiple times
> or something similar.

Given that nobody has noticed that the driver stops working entirely
it's possible that the pattern is something like:


    pwm_vibrator_start()
    pwm_vibrator_stop()
    pwm_vibrator_stop()
    pwm_vibrator_start()

so it's a temporary underflow that gets corrected (or it could be that
not many people are using mainline kernels on these systems).  On your
system it's the dummy driver but presumably some other users have it
connected to actual regulators.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 16:48 New underflow of regulator enable count warnings in v5.0-rc1 Tony Lindgren
  2019-01-29 17:01 ` Mark Brown
  2019-01-29 17:04 ` Doug Anderson
@ 2019-01-29 17:18 ` Sebastian Reichel
  2019-01-29 17:27   ` Tony Lindgren
  2 siblings, 1 reply; 8+ messages in thread
From: Sebastian Reichel @ 2019-01-29 17:18 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap, Mark Brown, Douglas Anderson, linux-arm-kernel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1243 bytes --]

Hi,

On Tue, Jan 29, 2019 at 08:48:13AM -0800, Tony Lindgren wrote:
> Looks like commit 5451781dadf8 ("regulator: core: Only count load for
> enabled consumers") started showing new warnings with v5.0-rc cycle:
> 
> regulator-dummy: Underflow of regulator enable count
> 
> I'm seeing this at least with my pwm-vibra test case:
> 
> # rumble-test /dev/input/by-path/platform-vibrator-event 0xffff
> pwm-vibrator vibrator: vibrator supply vcc not found, using dummy regulator
> input: pwm-vibrator as /devices/platform/vibrator/input/input4
> regulator-dummy: Underflow of regulator enable count
> Upload rumble effect... id=0
> regulator-dummy: Underflow of regulator enable count
> 
> Are these bogus warnings for dummy regulator or do we have
> real unpaired regulator calls or somewhere?

There are real unpaired regulator calls in the pwm-vibrator driver,
that I did not notice when I wrote the driver :(. Good news is, that
Paweł Chmiel and Jonathan Bakker are already working on fixing my mess:

https://lore.kernel.org/patchwork/patch/1032759/

On Droid 4 it's a dummy regulator, since I did not know what
regulator is being used to supply the vibrator. Probably directly
from the battery.

-- Sebastian

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 17:15     ` Mark Brown
@ 2019-01-29 17:18       ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2019-01-29 17:18 UTC (permalink / raw)
  To: Mark Brown; +Cc: LKML, linux-omap, Doug Anderson, Linux ARM, Sebastian Reichel

* Mark Brown <broonie@kernel.org> [190129 17:15]:
> On Tue, Jan 29, 2019 at 09:11:51AM -0800, Tony Lindgren wrote:
> 
> > OK. Let's see if Sebastian spots where pwm_vibrator_start()
> > and pwm_vibrator_stop() might get called multiple times
> > or something similar.
> 
> Given that nobody has noticed that the driver stops working entirely
> it's possible that the pattern is something like:
> 
> 
>     pwm_vibrator_start()
>     pwm_vibrator_stop()
>     pwm_vibrator_stop()
>     pwm_vibrator_start()
> 
> so it's a temporary underflow that gets corrected (or it could be that
> not many people are using mainline kernels on these systems).  On your
> system it's the dummy driver but presumably some other users have it
> connected to actual regulators.

Yeah that makes sense.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: New underflow of regulator enable count warnings in v5.0-rc1
  2019-01-29 17:18 ` Sebastian Reichel
@ 2019-01-29 17:27   ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2019-01-29 17:27 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: linux-omap, Mark Brown, Douglas Anderson, linux-arm-kernel, linux-kernel

* Sebastian Reichel <sre@kernel.org> [190129 17:18]:
> Hi,
> 
> On Tue, Jan 29, 2019 at 08:48:13AM -0800, Tony Lindgren wrote:
> > Looks like commit 5451781dadf8 ("regulator: core: Only count load for
> > enabled consumers") started showing new warnings with v5.0-rc cycle:
> > 
> > regulator-dummy: Underflow of regulator enable count
> > 
> > I'm seeing this at least with my pwm-vibra test case:
> > 
> > # rumble-test /dev/input/by-path/platform-vibrator-event 0xffff
> > pwm-vibrator vibrator: vibrator supply vcc not found, using dummy regulator
> > input: pwm-vibrator as /devices/platform/vibrator/input/input4
> > regulator-dummy: Underflow of regulator enable count
> > Upload rumble effect... id=0
> > regulator-dummy: Underflow of regulator enable count
> > 
> > Are these bogus warnings for dummy regulator or do we have
> > real unpaired regulator calls or somewhere?
> 
> There are real unpaired regulator calls in the pwm-vibrator driver,
> that I did not notice when I wrote the driver :(. Good news is, that
> Paweł Chmiel and Jonathan Bakker are already working on fixing my mess:
> 
> https://lore.kernel.org/patchwork/patch/1032759/

OK good to hear.

> On Droid 4 it's a dummy regulator, since I did not know what
> regulator is being used to supply the vibrator. Probably directly
> from the battery.

Yeah no idea.. Hmm maybe it's actually using the VVIB on the pmic?

Regards,

Tony


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-01-29 17:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29 16:48 New underflow of regulator enable count warnings in v5.0-rc1 Tony Lindgren
2019-01-29 17:01 ` Mark Brown
2019-01-29 17:04 ` Doug Anderson
2019-01-29 17:11   ` Tony Lindgren
2019-01-29 17:15     ` Mark Brown
2019-01-29 17:18       ` Tony Lindgren
2019-01-29 17:18 ` Sebastian Reichel
2019-01-29 17:27   ` Tony Lindgren

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).