Re: PCI hotplug question.

Greg KH (greg@kroah.com)
Tue, 4 Mar 2003 22:15:20 -0800


On Tue, Mar 04, 2003 at 05:10:16PM -0600, Cameron, Steve wrote:
>
> So, the question is this. For HBA drivers, block storage drivers in
> particular, are there plans to make hot-unplugging behave similarly to
> rmmod (checking that nobody has the device open before kicking
> the driver out and so on) or, is it the driver's duty to defend
> against incoming i/o's to devices which may be yanked out from
> underneath it whenever somebody presses the pushbutton?

I can't find my copy of the PCI Hotplug spec right now (and it's not
free for download anymore...), but I think that once a user presses the
latch button, the OS _has_ to power down that slot within a reasonable
amount of time. So there's no way that a driver could return an error
to the remove() callback and have a chance to still be around in a
moment or so. And some systems (ACPI controlled PCI Hotplug), we don't
have a choice, as the BIOS is about to do the powerdown anyway, and we
can't stop it.

So no, we can't rely on the same module count type mechanism that rmmod
can use, so the driver has to do everything it possibly can to shutdown
that device, and clean up after itself when remove() is called.

I'll try to find my copy of the spec to verify this, but it might take a
while to dig it up. Anyone else with access to it right now?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/