From: David Collins <collinsd@codeaurora.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm-owner@vger.kernel.org
Subject: Re: [PATCH 1/2] regulator: Remove possible deadlock from regulator_enable
Date: Mon, 28 Mar 2011 11:22:22 -0700 [thread overview]
Message-ID: <4D90D1DE.2030202@codeaurora.org> (raw)
In-Reply-To: <20110328181151.GB28494@opensource.wolfsonmicro.com>
On 03/28/2011 11:11 AM, Mark Brown wrote:
>> -/* locks held by regulator_enable() */
>> +/* Locks are *not* held by regulator_enable(). */
>> static int _regulator_enable(struct regulator_dev *rdev)
>> {
>> - int ret, delay;
>> + struct regulator_dev *supply_rdev = NULL;
>> + int ret = 0, delay;
>>
>> + mutex_lock(&rdev->mutex);
>
> This is going to be terribly confusing - the _ versions of the functions
> all by convention rely on their callers taking the mutex, allowing them
> to be safely used from internal APIs.
_regulator_enable is only being called within regulator_enable and
_regulator_enable. Would it remove the confusion to rename
_regulator_enable to something different?
-David
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
WARNING: multiple messages have this Message-ID (diff)
From: collinsd@codeaurora.org (David Collins)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] regulator: Remove possible deadlock from regulator_enable
Date: Mon, 28 Mar 2011 11:22:22 -0700 [thread overview]
Message-ID: <4D90D1DE.2030202@codeaurora.org> (raw)
In-Reply-To: <20110328181151.GB28494@opensource.wolfsonmicro.com>
On 03/28/2011 11:11 AM, Mark Brown wrote:
>> -/* locks held by regulator_enable() */
>> +/* Locks are *not* held by regulator_enable(). */
>> static int _regulator_enable(struct regulator_dev *rdev)
>> {
>> - int ret, delay;
>> + struct regulator_dev *supply_rdev = NULL;
>> + int ret = 0, delay;
>>
>> + mutex_lock(&rdev->mutex);
>
> This is going to be terribly confusing - the _ versions of the functions
> all by convention rely on their callers taking the mutex, allowing them
> to be safely used from internal APIs.
_regulator_enable is only being called within regulator_enable and
_regulator_enable. Would it remove the confusion to rename
_regulator_enable to something different?
-David
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2011-03-28 18:22 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 15:34 [PATCH 0/2] regulator: Fix regulator_enable deadlock and add uA_load propagation David Collins
2011-03-28 15:34 ` David Collins
2011-03-28 15:34 ` [PATCH 1/2] regulator: Remove possible deadlock from regulator_enable David Collins
2011-03-28 15:34 ` David Collins
2011-03-28 18:11 ` Mark Brown
2011-03-28 18:11 ` Mark Brown
2011-03-28 18:22 ` David Collins [this message]
2011-03-28 18:22 ` David Collins
2011-03-28 15:34 ` [PATCH 2/2] regulator: Propagate uA_load requirements up supply chain David Collins
2011-03-28 15:34 ` David Collins
2011-03-28 18:02 ` Mark Brown
2011-03-28 18:02 ` Mark Brown
2011-03-28 18:14 ` Russell King - ARM Linux
2011-03-28 18:14 ` Russell King - ARM Linux
2011-03-29 7:53 ` Mark Brown
2011-03-29 7:53 ` Mark Brown
2011-03-29 8:28 ` Russell King - ARM Linux
2011-03-29 8:28 ` Russell King - ARM Linux
2011-03-29 8:40 ` Mark Brown
2011-03-29 8:40 ` Mark Brown
2011-03-28 18:18 ` David Collins
2011-03-28 18:18 ` David Collins
2011-03-28 18:33 ` broonie@gmail.com
2011-03-28 18:33 ` broonie@gmail.com
2011-03-28 23:52 ` [PATCH v2 0/2] regulator: Fix regulator_enable deadlock and add uA_load propagation David Collins
2011-03-28 23:52 ` David Collins
2011-03-28 23:53 ` [PATCH v2 1/2] regulator: Remove possible deadlock from regulator_enable David Collins
2011-03-28 23:53 ` David Collins
2011-03-28 23:53 ` [PATCH v2 2/2] regulator: Propagate uA_load requirements up supply chain David Collins
2011-03-28 23:53 ` David Collins
2011-03-29 8:44 ` Mark Brown
2011-03-29 8:44 ` Mark Brown
2011-03-29 16:08 ` David Collins
2011-03-29 16:08 ` David Collins
2011-03-29 21:20 ` Mark Brown
2011-03-29 21:20 ` Mark Brown
2011-03-30 1:00 ` Mark Brown
2011-03-30 1:00 ` Mark Brown
2011-03-29 22:40 ` Mark Brown
2011-03-29 22:40 ` 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=4D90D1DE.2030202@codeaurora.org \
--to=collinsd@codeaurora.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm-owner@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.