linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	"lrg@ti.com" <lrg@ti.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"patches@opensource.wolfsonmicro.com" 
	<patches@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] regulator: core: Move regulator release to avoid deadlock
Date: Wed, 31 Oct 2012 12:01:17 +0000	[thread overview]
Message-ID: <20121031120117.GB27099@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5090FE97.7070303@nvidia.com>

On Wed, Oct 31, 2012 at 04:03:59PM +0530, Laxman Dewangan wrote:
> On Monday 29 October 2012 09:44 PM, Mark Brown wrote:
>> * PGP Signed by an unknown key
>>
>> On Mon, Oct 29, 2012 at 09:33:33AM +0000, Charles Keepax wrote:
>>> regulator_put function was called whilst holding the
>>> regulator_list_mutex, which is also locked from regulator_put. This
>>> causes deadlock when failing to register a regulator.
>> Applied, thanks.
>
> This patch create the crash in following case:
> - If there is of rail supply and supply does not found. In this case it  
> goes to scrub and rdev->supply at this point shows NULL but when call  
> the function device_unregister(&rdev->dev), the rdev->supply becomes  
> random pointer.

Yeah that is a problem, sorry for missing this.

>
> What happen if we do the device_unregister() outside the mutex lock?

It would look reasonable to me, but I think it is going to make
more sense for someone with more experience than myself to have a
closer look at what can be done.

      reply	other threads:[~2012-10-31 12:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29  9:33 [PATCH] regulator: core: Move regulator release to avoid deadlock Charles Keepax
2012-10-29 16:14 ` Mark Brown
2012-10-31 10:33   ` Laxman Dewangan
2012-10-31 12:01     ` Charles Keepax [this message]

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=20121031120117.GB27099@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=patches@opensource.wolfsonmicro.com \
    /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;
as well as URLs for NNTP newsgroup(s).