From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Walker <dwalker@mvista.com>
Cc: Remy Bohmer <linux@bohmer.net>, Ingo Molnar <mingo@elte.hu>,
Steven Rostedt <rostedt@goodmis.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Dave Chinner <dgc@sgi.com>
Subject: Re: lockdep problem conversion semaphore->mutex (dev->sem)
Date: Sat, 08 Dec 2007 18:11:50 +0100 [thread overview]
Message-ID: <1197133910.6353.33.camel@lappy> (raw)
In-Reply-To: <1197132792.1568.162.camel@jnielson-xp.ddns.mvista.com>
On Sat, 2007-12-08 at 08:53 -0800, Daniel Walker wrote:
> On Sat, 2007-12-08 at 13:16 +0100, Peter Zijlstra wrote:
> > On Sat, 2007-12-08 at 00:02 +0100, Remy Bohmer wrote:
> > > Hello Peter,
> > >
> > > > > What specifically is wrong with dev->sem ?
> > > >
> > > > Nothing really, other than that they use semaphores to avoid lockdep :-/
> > > >
> > > > I think I know how to annotate this, after Alan Stern explained all the
> > > > use cases, but I haven't come around to implementing it. Hope to do that
> > > > soonish.
> > >
> > > I was looking for an easy semaphore I could convert to a mutex, and I
> > > ran into one that was widely spread and interesting, and which seemed
> > > quite doable at first sight.
> > > So, I started working on it, but was forgotten this discussion, (until
> > > Daniel made me remember it this afternoon). So, I (stupid me ;-) )
> > > tried to convert dev->sem...
> > >
> > > After doing the monkey part of the conversion I can boot the kernel
> > > completely on X86 and ARM, and everything works fine, except after
> > > enabling lockdep, lockdep starts complaining...
> > >
> > > Is this the problem you were pointing at?
> >
> > Yeah, one of the interesting nestings :-)
>
> It must be the locking in __driver_attach(), taking dev->parent->sem
> then taking dev->sem .. Assuming those are different structures, why
> does lockdep trigger?
They aren't different, parent is a struct device again.
next prev parent reply other threads:[~2007-12-08 17:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-07 23:02 lockdep problem conversion semaphore->mutex (dev->sem) Remy Bohmer
2007-12-08 12:16 ` Peter Zijlstra
2007-12-08 16:53 ` Daniel Walker
2007-12-08 17:11 ` Peter Zijlstra [this message]
2007-12-08 17:06 ` Daniel Walker
2007-12-08 17:36 ` Peter Zijlstra
2007-12-08 19:52 ` Remy Bohmer
2007-12-08 20:04 ` Peter Zijlstra
2007-12-08 20:33 ` Remy Bohmer
2007-12-08 20:50 ` Peter Zijlstra
2007-12-08 20:55 ` Remy Bohmer
2007-12-08 22:57 ` Jarek Poplawski
2007-12-08 20:08 ` Ingo Molnar
2007-12-08 20:48 ` Remy Bohmer
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=1197133910.6353.33.camel@lappy \
--to=peterz@infradead.org \
--cc=dgc@sgi.com \
--cc=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@bohmer.net \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
/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