diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2018-11-19 00:56:17 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-11-19 12:33:17 +0000 |
commit | f8702f9e4aa7b45131af3df5531d6e3835269141 (patch) | |
tree | 60c485ee3dac05b6eca89f5dc4f6058d84badfd0 /include/linux/regulator | |
parent | 6303f3e78b6fd3f84dbe7f2fa4f108d47061d1fb (diff) | |
download | blackbird-op-linux-f8702f9e4aa7b45131af3df5531d6e3835269141.tar.gz blackbird-op-linux-f8702f9e4aa7b45131af3df5531d6e3835269141.zip |
regulator: core: Use ww_mutex for regulators locking
Wait/wound mutex shall be used in order to avoid lockups on locking of
coupled regulators.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Suggested-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r-- | include/linux/regulator/driver.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index a05d37d0efa1..7065031f0846 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -20,6 +20,7 @@ #include <linux/device.h> #include <linux/notifier.h> #include <linux/regulator/consumer.h> +#include <linux/ww_mutex.h> struct gpio_desc; struct regmap; @@ -462,7 +463,7 @@ struct regulator_dev { struct coupling_desc coupling_desc; struct blocking_notifier_head notifier; - struct mutex mutex; /* consumer lock */ + struct ww_mutex mutex; /* consumer lock */ struct task_struct *mutex_owner; int ref_cnt; struct module *owner; @@ -545,4 +546,7 @@ int regulator_set_active_discharge_regmap(struct regulator_dev *rdev, bool enable); void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data); +void regulator_lock(struct regulator_dev *rdev); +void regulator_unlock(struct regulator_dev *rdev); + #endif |