Re: Re: Hotplug events during sleep transition

Patrick Mochel
2006-01-02T23:49:59Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1066 bytes --]

On Fri, 30 Dec 2005, Alan Stern wrote:

> Khubd does not exactly scan device lists on resume. What happens is that
> we set a bit in the device's parent hub's private data structure,
> indicating that there was a connect-change on the device's port, and we
> put the data structure on a list of hubs needing attention. Khubd
> continually scans this hub-event list whenever it isn't asleep, so it sees
> that the device has been disconnected as soon as it gets unfrozen.

Getting back to the original topic about unbinding and rebinding...

IMO, it would be best to not unbind and rebind devices, but rather do the
steps necessary to quiesce the driver and/or the device.

But, in the event that that can't happen (or in the interim), could a
similar mechanism be used for unbind events that are used for removals -
i.e. setting a bit in the device's (or related) data structure indicating
that the driver has been unbound -- and that work needs to be done -- and
then having khubd process it (and generate the appropriate events) on
resume?

Thanks,

Patrick