Re: Re: Hotplug events during sleep transition

Alan Stern
2005-12-30T19:26:41Z

On Fri, 30 Dec 2005, Dmitry Torokhov wrote:

> > There may indeed be other devices like that.  If you can't handle device
> > removal while the system is running normally, why should you be able to
> > handle device removal while the system is suspended?
> >
>
> Because I can?
>
> > Conversely, even if the resume routine does detect somehow that the device
> > was removed, there's nothing it can do with that information if you don't
> > have a mechanism in place for handling device removals.
> >
>
> The subsystem can handle device removal, its just hardware does not
> give any notification when device is removed so subsystem has to rely
> on some external event (such as resume process) to query the device
> and check if it is still present.

In that case, I would say that it is appropriate to use keventd or some
other worker thread to handle device removal detected during resume.
Since these threads will be frozen along with everything else, the
unregister calls wouldn't be made until the system was once again awake.

If you were really serious about it, you could even set up a work queue
to query each input device once per minute (say), to see whether it had
gotten removed. But that's probably overkill.

Alan Stern