Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755185Ab0KDKBu (ORCPT ); Thu, 4 Nov 2010 06:01:50 -0400 Received: from eu1sys200aog112.obsmtp.com ([207.126.144.133]:50791 "EHLO eu1sys200aog112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754602Ab0KDKBt (ORCPT ); Thu, 4 Nov 2010 06:01:49 -0400 Message-ID: <4CD2847B.1060009@stericsson.com> Date: Thu, 4 Nov 2010 11:01:31 +0100 From: Mattias Wallin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10 MIME-Version: 1.0 To: "broonie@opensource.wolfsonmicro.com" , Liam Girdwood Cc: "linux-kernel@vger.kernel.org" , elinwal , Bengt JONSSON Subject: [PATCH] regulator: lock supply in regulator enable Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1255 Lines: 34 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); -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/