]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: Fix deadlock during regulator registration
authorJon Hunter <jonathanh@nvidia.com>
Wed, 30 Mar 2016 16:09:13 +0000 (17:09 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 30 Mar 2016 18:03:54 +0000 (11:03 -0700)
commit43688748e23e1add6bfd4f37b897deed0d314871
tree666f47abfa742a71fde56c3b5267db66410c896e
parent318002b45e39d03b474a8d39458a2bda43789d75
regulator: Fix deadlock during regulator registration

Commit 318002b45e39 ("regulator: Try to resolve regulators supplies on
registration") added a call to regulator_resolve_supply() within
regulator_register() where the regulator_list_mutex is held. This causes
a deadlock to occur on the Tegra114 Dalmore board when the palmas PMIC
is registered because regulator_register_resolve_supply() calls
regulator_dev_lookup() which may try to acquire the regulator_list_mutex
again.

Fix this by releasing the mutex before calling
regulator_register_resolve_supply() and update the error exit path to
ensure the mutex is released on an error.

[Made commit message more legible -- broonie]

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c