+117
−70
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
Some GDSCs have a hardware requirement that their parent supply must be enabled in order for the GDSC registers to be accessible. To account for this, gdsc-regulator regulator_ops callback functions call regulator_enable() on the parent supply to guarantee that the GDSC registers are accessible. Unfortunately, this usage of regulator_enable() (and regulator_disable()) can result in a mutex deadlock when commit f8702f9e ("regulator: core: Use ww_mutex for regulators locking") is present. Therefore, remove all regulator_enable() and regulator_disable() calls to eliminate the possibility of deadlock. Return an error if the parent is not enabled when necessary. This imposes a requirement that consumers must enable the parent or the GDSC itself (which indirectly enables the parent) before calling regulator_set_mode() on a GDSC. Change-Id: I49315a30f9f2034e9a6ad715bfbe5f8ed0896e46 Signed-off-by:David Collins <collinsd@codeaurora.org>