public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: lock supply in regulator enable
@ 2010-11-04 10:01 Mattias Wallin
  2010-11-04 10:18 ` Liam Girdwood
  2010-11-04 14:05 ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Mattias Wallin @ 2010-11-04 10:01 UTC (permalink / raw)
  To: broonie@opensource.wolfsonmicro.com, Liam Girdwood
  Cc: linux-kernel@vger.kernel.org, elinwal, Bengt JONSSON

This patch add locks around regulator supply enable.

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
---
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);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-06 11:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04 10:01 [PATCH] regulator: lock supply in regulator enable Mattias Wallin
2010-11-04 10:18 ` Liam Girdwood
2010-11-04 10:49   ` Mattias Wallin
2010-11-04 11:11     ` Liam Girdwood
2010-11-04 11:43       ` Mattias Wallin
2010-11-06 11:54         ` Liam Girdwood
2010-11-04 14:05 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox