linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hotplug remove vs. device driver close
@ 2004-06-02 23:14 linas
  2004-06-02 23:28 ` Greg KH
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: linas @ 2004-06-02 23:14 UTC (permalink / raw)
  To: linux-hotplug

Hi,

We are hitting a situation where we are hot-plug removing a pci card before
closing the device driver.  This seems to lead to kernel memory leaks if not
outright crashes. I'm trying to understand what the correct solution to this
is supposed to be.

For example: 'ifup eth0' and 'ifdown eth0' are what usually cause an ethernet
device driver to be opened/closed.  Seprately, we have a userland tool that
can be used to power off the pci slot, and thus perform a hotplug unconfigure 
in the kernel (i.e. calls pci_remove_bus_device()).   Thus, the sysadmin 
currently has the power to hot-remove a device without first closing the 
device driver.  Surely, this is bad. (Right?)  But how is this supposed to
be handled?

Please don't tell me that a good sysadmin should never do that ... in the 
hothouse of the server room, crazy stuff happens and it should not result 
in a server crash so easily ... 

I'm hoping that the answer also isn't that 'the hotplug scripts should 
do that', since hotplug scripts can be buggy, or can crash for many reasons;
such events shouldn't bring down the kernel.

So I conclude two possibilities:

-- All device drivers should watch for hotplug remove, and close themselves
   down in such an event

-- The syscall that allows the pci slot to be powered off should also 
   go through the steps of closing the device driver first. 

Is there another possibility?  What's the right way of handling this?


--linas
 






-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-06-04 17:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-02 23:14 hotplug remove vs. device driver close linas
2004-06-02 23:28 ` Greg KH
2004-06-03  1:40 ` Anton Blanchard
2004-06-03 16:20 ` Greg KH
2004-06-03 18:50 ` linas
2004-06-03 19:02 ` Greg KH
2004-06-03 19:23 ` Don Fry
2004-06-03 19:28 ` Greg KH
2004-06-03 19:34 ` linas
2004-06-03 19:39 ` linas
2004-06-03 20:02 ` Don Fry
2004-06-03 20:39 ` Greg KH
2004-06-03 22:25 ` linas
2004-06-04  3:58 ` Benjamin Herrenschmidt
2004-06-04 16:24 ` Greg KH
2004-06-04 17:26 ` linas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).