mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dave Young" <hidave.darkstar@gmail.com>
To: "Jarek Poplawski" <jarkao2@gmail.com>
Cc: "Kay Sievers" <kay.sievers@vrfy.org>,
	"Alan Stern" <stern@rowland.harvard.edu>,
	"Greg KH" <gregkh@suse.de>,
	stefanr@s5r6.in-berlin.de, "David Brownell" <david-b@pacbell.net>,
	"Kernel development list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/7] driver-core : convert semaphore to mutex in struct class
Date: Fri, 18 Jan 2008 15:48:02 +0800	[thread overview]
Message-ID: <a8e1da0801172348q575d6c2fs9f51e3e76d41c62@mail.gmail.com> (raw)
In-Reply-To: <20080118073836.GA1703@ff.dom.local>

On Jan 18, 2008 3:38 PM, Jarek Poplawski <jarkao2@gmail.com> wrote:
> On Fri, Jan 18, 2008 at 01:31:17PM +0800, Dave Young wrote:
> > On Jan 18, 2008 11:18 AM, Kay Sievers <kay.sievers@vrfy.org> wrote:
> ...
> > > Yeah, might be better to wait until class_device is gone, otherwise you
> > > may need to fix stuff that is just going to be removed. Your change to
> > > have iterators for the class devices look like a nice preparation for
> > > future changes though.
> > >
> > > Our rough plan is:
> > >  2.6.25:
> > >   - get the ~100 patches in Greg's tree (in -mm) merged :)
> > >  2.6.26:
> > > ???  - remove the 20 char limit in "struct device"
> > >   - get rid of "struct class_device"
> >
> > Fine, thanks.
> >
> > Let's wait for other people's comment.
>
> Dave, I doubt you'll ever manage to do this if you're going to wait:
> probably there will be always some new changes like this around...

Maybe you are right.

>
> IMHO, it would be nice to get the real state of current lockdep
> problems here to figure out if there is any chance to do this right &
> without any warnings with current lockdep. If I got it right from
> earlier threads it might be impossible with USB, at least.

I don't think so, usb doesn't be affected by struct class mutex, they
only use the lock of struct device. As I replied before, the lockdep
issue exist only between class_interface and class_device.

>
> So, since I think these nesting levels seem to be wrong in 7/7 patch,
> maybe it's better to exclude it from this patchset, and to try this as
> testing for some time.

I may file the updated patch with more nesting changes and test it of
course. Actually I should have done it, thanks.

>
> My proposal is to do the annotations with mutex_lock_nested(),
> everywhere in this patch, according to 'real' relations between these
> classes from thread POV, so e.g.:
>
> mutex_lock_nested(&some_class->mutex, CLASS_PARENT);
> mutex_lock_nested(&some_class->mutex, CLASS_CLASS);
> ...or more if needed:
> mutex_lock_nested(&some_class->mutex, CLASS_CHILD);
> mutex_lock_nested(&some_class->mutex, CLASS_ROOT);
> ...etc.
>
> using adequate names for these enums, and only after this check what
> lockdep thinks about it. Then, if there are no obvious mistakes, but
> lockdep doesn't like it, send the patch and report without trying to
> 'silence' lockdep, so we could see what's going on, and if there are
> any chances to make it right.

1) Using CLASS_NORMAL/CLASS_PARENT/CLASS_CHILD will be enough.
or
2) Simply add SINGLE_LEVEL_NESTING in class_device_add and other
class_device functions because it is the only possible nest-lock place
as I know.

Do you agree?

>
> Thanks,
> Jarek P.
>

  reply	other threads:[~2008-01-18  7:48 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12 10:05 Dave Young
2008-01-15  9:15 ` Dave Young
2008-01-15 13:56   ` Jarek Poplawski
2008-01-16  1:03     ` Dave Young
2008-01-16  8:34       ` Jarek Poplawski
2008-01-17  1:17         ` Dave Young
2008-01-17  8:38           ` Jarek Poplawski
2008-01-17  8:56             ` Dave Young
2008-01-16 15:27       ` Alan Stern
2008-01-17  0:01         ` Jarek Poplawski
2008-01-17  1:18         ` Dave Young
2008-01-17 15:16           ` Alan Stern
2008-01-17 19:47             ` Jarek Poplawski
2008-01-17 19:57               ` Alan Stern
2008-01-17 20:31                 ` Jarek Poplawski
2008-01-17 22:02                   ` Jarek Poplawski
2008-01-17 23:26                   ` Jarek Poplawski
2008-01-18  1:42                     ` Dave Young
2008-01-18  1:55                       ` Kay Sievers
2008-01-18  2:28                         ` Dave Young
2008-01-18  3:18                           ` Kay Sievers
2008-01-18  6:25                             ` Greg KH
     [not found]                             ` <a8e1da0801172131h57097622h6d111133b6a0773d@mail.gmail.com>
2008-01-18  7:38                               ` Jarek Poplawski
2008-01-18  7:48                                 ` Dave Young [this message]
2008-01-18  8:23                                   ` Jarek Poplawski
2008-01-18  9:07                                     ` Dave Young
2008-01-19  9:39                                       ` Jarek Poplawski
2008-01-21  1:19                                         ` Dave Young
2008-01-21  1:30                                         ` Dave Young
2008-01-21  1:43                                           ` Dave Young
2008-01-21  8:36                                             ` Jarek Poplawski
2008-01-21  8:44                                               ` Dave Young
2008-01-21  9:03                                                 ` Jarek Poplawski
2008-01-21 21:16                                                 ` Jarek Poplawski
2008-01-22  0:55                                                   ` Dave Young
2008-01-22  5:15                                                     ` Greg KH
2008-01-22  6:13                                                       ` Dave Young
2008-01-22  7:45                                                     ` Jarek Poplawski
2008-01-18 10:45                                 ` Kay Sievers
2008-01-18 11:40                                   ` Jarek Poplawski
2008-01-18  8:00                       ` Jarek Poplawski
2008-01-18  8:39                         ` Jarek Poplawski
2008-01-17 21:11                 ` Greg KH
2008-01-17 21:55                   ` Jarek Poplawski
2008-01-18  1:45             ` Dave Young

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=a8e1da0801172348q575d6c2fs9f51e3e76d41c62@mail.gmail.com \
    --to=hidave.darkstar@gmail.com \
    --cc=david-b@pacbell.net \
    --cc=gregkh@suse.de \
    --cc=jarkao2@gmail.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=stern@rowland.harvard.edu \
    /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®