Skip to contentSkip to conversation

New underflow of regulator enable count warnings in v5.0-rc1

DISCUSSION Tony Lindgren 4 participants 8 messages Jan 29, 2019

lore
Share & tools
lore
#0 lore raw

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

#2 lore raw
In reply to Tony Lindgren

Hi,

Quoted 17 lines · Tony Lindgren

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
Quoted 2 lines

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/[email protected]

Quoted 4 lines · In that message I

- 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

#3 lore raw
Quoted 23 lines · Doug Anderson

Hi,

Quoted 17 lines · Tony Lindgren

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
Quoted 2 lines

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

Quoted 8 lines

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/[email protected]

Oh I see, thanks for the link :)

Quoted 10 lines
Quoted 4 lines · In that message I

- 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

#4 lore raw
Quoted 3 lines · Tony Lindgren

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.

#5 lore raw
Quoted 15 lines · Mark Brown
Quoted 3 lines · Tony Lindgren

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

Quoted 4 lines

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

#6 lore raw
In reply to Tony Lindgren

Hi,

Quoted 14 lines · Tony Lindgren

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
Quoted 2 lines

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

#7 lore raw
Quoted 17 lines · Sebastian Reichel

Hi,

Quoted 14 lines · Tony Lindgren

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
Quoted 8 lines
Quoted 2 lines

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.

Quoted 3 lines

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