[lkml]   [2010]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] regulator: lock supply in regulator enable
This patch add locks around regulator supply enable.

Signed-off-by: Mattias Wallin <>
The previous patch I sent solves a problem seen in our system.
This patch does not solve a problem I have seen but I still think
it should be there. Or at least some locking of the supply in regulator enable.
What do you guys think?
drivers/regulator/core.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c625633..d10ad4a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1270,7 +1270,9 @@ static int _regulator_enable(struct regulator_dev *rdev)

/* do we need to enable the supply regulator first */
if (rdev->supply) {
+ mutex_lock(&rdev->supply->mutex);
ret = _regulator_enable(rdev->supply);
+ mutex_unlock(&rdev->supply->mutex);
if (ret < 0) {
printk(KERN_ERR "%s: failed to enable %s: %d\n",
__func__, rdev_get_name(rdev), ret);

 \ /
  Last update: 2010-11-04 11:05    [W:0.094 / U:6.928 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site