All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Patrick Mochel <mochel@digitalimplant.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	David Brownell <david-b@pacbell.net>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: klists and struct device semaphores
Date: Wed, 30 Mar 2005 22:01:53 -0500	[thread overview]
Message-ID: <200503302201.53487.dtor_core@ameritech.net> (raw)
In-Reply-To: <Pine.LNX.4.50.0503301814090.20992-100000@monsoon.he.net>

On Wednesday 30 March 2005 21:16, Patrick Mochel wrote:
> 
> On Tue, 29 Mar 2005, Alan Stern wrote:
> 
> > On Mon, 28 Mar 2005, Patrick Mochel wrote:
> >
> > > How is this related to (8) above? Do you need some sort of protected,
> > > short path through the core to add the device, but not bind it or add it
> > > to the PM core?
> >
> > Having thought it through, I believe all we need for USB support is this:
> >
> > 	Whenever usb_register() in the USB core calls driver_register()
> > 	and the call filters down to driver_attach(), that routine
> > 	should lock dev->parent->sem before calling driver_probe_device()
> > 	(and unlock it afterward, of course).
> >
> > 	(For the corresponding remove pathway, where usb_deregister()
> > 	calls driver_unregister(), it would be nice if __remove_driver()
> > 	locked dev->parent->sem before calling device_release_driver().
> > 	This is not really needed, however, since USB drivers aren't
> > 	supposed to touch the device in their disconnect() method.)
> 
> 
> Why can't you just lock it in ->probe() and ->remove() yourself?
> 

Will the lock be exported (via helper functions)? I always felt dirty using
subsys.rwsem because it I think it was supposed to be implementation detail.
 
-- 
Dmitry

  reply	other threads:[~2005-03-31  3:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-26 16:53 klists and struct device semaphores Alan Stern
2005-03-28 16:56 ` Patrick Mochel
2005-03-28 19:48   ` Alan Stern
2005-03-29 16:38     ` Patrick Mochel
2005-03-28 17:44 ` Patrick Mochel
2005-03-28 18:16   ` David Brownell
2005-03-28 18:43     ` Patrick Mochel
2005-03-28 21:58   ` Alan Stern
2005-03-31  2:12     ` Patrick Mochel
2005-03-31 16:18       ` Alan Stern
2005-03-31 17:59         ` Patrick Mochel
2005-03-31 18:18           ` David Brownell
2005-03-31 18:26             ` Patrick Mochel
2005-03-31 18:46               ` David Brownell
2005-03-31 19:08                 ` Patrick Mochel
2005-03-31 19:08               ` Dmitry Torokhov
2005-03-29 16:18   ` Alan Stern
2005-03-29 16:26     ` Dmitry Torokhov
2005-03-31  2:16     ` Patrick Mochel
2005-03-31  3:01       ` Dmitry Torokhov [this message]
2005-03-31  5:47         ` Patrick Mochel
2005-03-31 16:24       ` Alan Stern
2005-03-31 18:04         ` Patrick Mochel
2005-03-31 19:49           ` Alan Stern
2005-04-02 18:06   ` Alan Stern
2005-04-06  7:39     ` Patrick Mochel
2005-04-06 19:45       ` Alan Stern
2005-04-07 20:08         ` Patrick Mochel

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=200503302201.53487.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    --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 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.