Subject: Re: device tree traversal
To: Garrett D'Amore <>
From: Garrett D'Amore <>
List: tech-kern
Date: 07/04/2006 09:40:57
Daniel Carosone wrote:
> On Mon, Jul 03, 2006 at 10:22:57PM -0700, Garrett D'Amore wrote:
>> I am unaware of any buses besides pcmcia and USB/firewire which are
>> designed to support hot detach without advance notification to the
>> driver.  Indeed, even Cardbus doesn't support this properly -- a detach
>> notification is required from userland _before_ physical removal in
>> order to guarantee safe operation.
> One possible fly in the ointment: there are usb-to-pci bridges (and
> many other weird things besides), so you can have a pci bus behind a
> hot-deteached usb device.  I've seen them get used for USB video cards
> among other things.
> Trying to deal with these might well lead to otherwise-unnecessary
> overengineering, of course, but it's worth mentioning.
> --
> Dan.
In such a case, I suspect you _really_ want user interaction _before_
the device is removed.  I would imagine a lot of PCI device drivers are
not well equipped for a hard device removal in the middle of doing
things like DMA.  (From my experience with hotplug drivers mostly on
Solaris, it is pretty common to have drivers that want to "clean" the
device up for things like removal or power down -- sometimes for example
this means waiting for the device to go quiescent -- e.g. waiting for
the txfifo on a serial port to drain.)

Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
Phone: 951 325-2134  Fax: 951 325-2191