On Mo, 2018-10-15 at 09:50 -0400, Alan Stern wrote:
> 
> It seems that a better approach would be to have an ioctl which would:
> 
>         fail if there are any active user URBs;
> 
>         drop the usbfs PM reference so the device can suspend;
> 
>         block interruptibly until the device resumes;

Thus we would require user space to have a thread for each device
it wants to allow suspend for.

[..]
> What difference does it make if the URBs are killed by the user instead 
> of the kernel?

We stay within the limits of the timing (as well as we can) and the
case of a failed suspend is much easier to handle.
Else we have an unlimited time between cessation of IO and going
into suspend.

> > And notify user space when the device is resumed. IMHO select()
> > is the syscall designed for that.
> 
> Apart from the difficulties mentioned above.

Yes, I see.

        Regards
                Oliver

Reply via email to