Skip to content
Unverified Commit e9153311 authored by Enric Balletbo i Serra's avatar Enric Balletbo i Serra Committed by Mark Brown
Browse files

regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage

`cat /sys/kernel/debug/regulator/regulator_summary` ends on a deadlock
when you have a voltage controlled regulator (vctrl).

The problem is that the vctrl_get_voltage() and vctrl_set_voltage() calls the
regulator_get_voltage() and regulator_set_voltage() and that will try to lock
again the dependent regulators (the regulator supplying the control voltage).

Fix the issue by exporting the unlocked version of the regulator_get_voltage()
and regulator_set_voltage() API so drivers that need it, like the voltage
controlled regulator driver can use it.

Fixes: f8702f9e

 ("regulator: core: Use ww_mutex for regulators locking")
Reported-by: default avatarDouglas Anderson <dianders@chromium.org>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200116094543.2847321-1-enric.balletbo@collabora.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6f1ff761
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment