public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mattias Wallin <mattias.wallin@stericsson.com>
To: "broonie@opensource.wolfsonmicro.com" 
	<broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	elinwal <linus.walleij@stericsson.com>,
	Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Subject: [PATCH] regulator: lock supply in regulator enable
Date: Thu, 4 Nov 2010 11:01:31 +0100	[thread overview]
Message-ID: <4CD2847B.1060009@stericsson.com> (raw)

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


             reply	other threads:[~2010-11-04 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 10:01 Mattias Wallin [this message]
2010-11-04 10:18 ` [PATCH] regulator: lock supply in regulator enable 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CD2847B.1060009@stericsson.com \
    --to=mattias.wallin@stericsson.com \
    --cc=bengt.g.jonsson@stericsson.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox