From: Dominik Brodowski <linux@dominikbrodowski.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [linux-pm] [GIT PULL] One more power management fix for 2.6.37
Date: Thu, 4 Nov 2010 07:27:09 +0100 [thread overview]
Message-ID: <20101104062709.GA3118@isilmar-3.linta.de> (raw)
In-Reply-To: <201011040604.05183.rjw@sisk.pl>
On Thu, Nov 04, 2010 at 06:04:05AM +0100, Rafael J. Wysocki wrote:
> On Wednesday, November 03, 2010, Dominik Brodowski wrote:
> > > There's apparently an ordering problem with dpm_list_mtx and
> > > socket->skt_mutex. Lockdep details appended.
> > >
> > > Dominik, Rafael? What's the proper locking order here, and
> > > how do we fix this?
> >
> > Thanks for noting this; let's see:
> >
> > - We add a PCMCIA device holding skt_mutex, therefore we have the ordering
> > (1) skt_mutex -> (2) dpm_list_mtx
> >
> > - If we're suspending, dpm_list_mtx is held, but we need to acquire
> > skt_mutex as we modify some data being protected by skt_mutex
> > (1) dpm_list_mtx -> (2) skt_mutex
> >
> > Rafael, any idea on how to solve this? How do other subsystems handle such
> > an issue? Do they call device_add() with no locks held at all?
>
> They usually do from what I can tell.
>
> Also only a few of them implement the ->suspend_noirq() callback, which is the
> one executed under dpm_list_mtx.
>
> What exactly is protected by skt_mutex ?
e.g.
struct pcmcia_socket {
...
u_int suspended_state;
int resume_status;
...
}
Furthermore, one has to acquire skt_mutex first before obtaining ops_mutex,
which protects many more fields (and asserts exclusion for some code paths),
see Documentation/pcmcia/locking.txt for details.
Best,
Dominik
next prev parent reply other threads:[~2010-11-04 6:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-29 21:58 Rafael J. Wysocki
2010-11-02 21:49 ` Linus Torvalds
2010-11-03 2:56 ` Rafael J. Wysocki
2010-11-03 17:40 ` Linus Torvalds
2010-11-03 18:36 ` Linus Torvalds
2010-11-03 21:18 ` [linux-pm] " Dominik Brodowski
2010-11-04 5:04 ` Rafael J. Wysocki
2010-11-04 6:27 ` Dominik Brodowski [this message]
2010-11-04 13:24 ` Rafael J. Wysocki
2010-11-04 14:50 ` Alan Stern
2010-11-09 23:39 ` Rafael J. Wysocki
2010-11-10 0:49 ` Linus Torvalds
2010-11-10 3:22 ` Alan Stern
2010-11-10 20:51 ` Rafael J. Wysocki
2010-11-15 15:20 ` Alan Stern
2010-11-04 17:07 ` Linus Torvalds
2010-11-04 19:55 ` Rafael J. Wysocki
2010-11-04 17:19 ` Linus Torvalds
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=20101104062709.GA3118@isilmar-3.linta.de \
--to=linux@dominikbrodowski.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®