public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@home-tj.org>,
	rusty@rustcorp.com.au, mochel@osdl.org
Subject: Re: [PATCH 2.6.10-rc1 4/4] driver-model: attach/detach sysfs node implemented
Date: Thu, 4 Nov 2004 09:49:44 -0800	[thread overview]
Message-ID: <20041104174944.GG16389@kroah.com> (raw)
In-Reply-To: <200411041205.32028.dtor_core@ameritech.net>

On Thu, Nov 04, 2004 at 12:05:31PM -0500, Dmitry Torokhov wrote:
> On Thursday 04 November 2004 02:46 am, Tejun Heo wrote:
> > ?ma_04_manual_attach.patch
> > 
> > ?This patch implements device interface nodes attach and detach.
> > Reading attach node shows the name of applicable drivers. ?Writing a
> > driver name attaches the device to the driver. ?Writing anything to
> > the write-only detach node detaches the driver from the currently
> > associated driver.
> > 
> ...
> > +/**
> > + *???detach - manually detaches the device from its associated driver.
> > + *
> > + *???This is a write-only node. ?When any value is written, it detaches
> > + *???the device from its associated driver.
> > + */
> > +static ssize_t detach_store(struct device * dev, const char * buf, size_t
> > n)
> > +{
> > +?????down_write(&dev->bus->subsys.rwsem);
> > +?????device_release_driver(dev);
> > +?????up_write(&dev->bus->subsys.rwsem);
> > +?????return n;
> > +}
> 
> This will not work for pretty much any bus but PCI because only PCI
> allows to detach a driver leaving children devices on the bus. The
> rest of buses remove children devices when disconnecting parent.

Yeah, I was glad you stepped in.  Both of you are trying to work on the
same problem, in different ways.  It would be great if you both could
work out a common method together.

> Also, there usually much more going on with regard to locking and
> other bus-specific actions besides taking bus's rwsem when binding
> devices. Serio bus will definitely get upset if you try to disconnect
> even a leaf device in the manner presented above and I think USB
> will get upset as well.

No, we can disconnect a driver from a device just fine for USB with no
problems (as long as it's not the hub driver from a hub device, we need
to never be able to disconnect those.)

thanks,

greg k-h

  reply	other threads:[~2004-11-04 17:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04  7:43 [PATCH 2.6.10-rc1 0/4] driver-model: manual device attach Tejun Heo
2004-11-04  7:44 ` [PATCH 2.6.10-rc1 1/4] driver-model: sysctl node dev.autoattach Tejun Heo
2004-11-04  7:45 ` [PATCH 2.6.10-rc1 2/4] driver-model: devparam expanded to accept direct per-device parameters via @args argument Tejun Heo
2004-11-04  7:45 ` [PATCH 2.6.10-rc1 3/4] driver-model: detach_state functions renamed Tejun Heo
2004-11-04  7:46 ` [PATCH 2.6.10-rc1 4/4] driver-model: attach/detach sysfs node implemented Tejun Heo
2004-11-04 17:05   ` Dmitry Torokhov
2004-11-04 17:49     ` Greg KH [this message]
2004-11-04 10:27 ` [PATCH 2.6.10-rc1 0/4] driver-model: manual device attach Martin Waitz
2004-11-04 17:53 ` Greg KH
2004-11-05  4:50   ` Tejun Heo
2004-11-05  5:02   ` Dmitry Torokhov
2004-11-05  6:32     ` Tejun Heo
2004-11-05 14:53       ` Dmitry Torokhov
2004-11-08  7:23       ` Dmitry Torokhov
2004-11-08  7:23         ` [PATCH 1/3] Add drvctl default device attribute Dmitry Torokhov
2004-11-08  7:25           ` [PATCH 2/3] Add drvctl handler to PCI bus Dmitry Torokhov
2004-11-08  7:26             ` [PATCH 3/3] Add bind_mode default device/driver attributes Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2004-11-04 19:06 [PATCH 2.6.10-rc1 4/4] driver-model: attach/detach sysfs node implemented Dmitry Torokhov
2004-11-05  4:45 ` Tejun Heo
2004-11-05  5:17   ` Dmitry Torokhov

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=20041104174944.GG16389@kroah.com \
    --to=greg@kroah.com \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tj@home-tj.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