Re: [RFC PATCH] USB: enable "power/wakeup" to control remote wakeup in the runtime suspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 17 July 2012 22:49:26 Lan Tianyu wrote:
> On 2012/7/17 22:26, Alan Stern wrote:

> > What sort of driver are you talking about?  An HID driver?  Serial
> > driver?
> I can find hid, bcm, serial, mouse, screen and some net device drivers 
> does such thing. set needs_remote_wakeup to 1 in open() and to 0 in 
> close(). Some net drivers will set it to 0 when network is stop.

You should react this way to stop. Generally those drivers need to deal
with input arriving at unpredictable times. If that can happen, you need
remote wakeup.

> > But in general, if a driver needs wakeup in order to work properly then
> > it _won't_ work when the port is powered off.  So as Oliver says, the
> > user might as well unbind the driver first.
> You mean userspace app unbind the driver? But some devices maybe work 
> properly when the port power on again and device is resumed. e.g
> keyboard and mouse.

But they do not work while power has been cut.
So why not close() before yo would cut power and open()
after that? There may be a very small benefit in keeping the fd
open in case you have exclusive open, but the justification is slim.
You could just as well have an unplug/replug cycle, especially as
the kernel usually cannot rule that out anyway.

We could implement a generic ioctl() for not caring about input
right now.

	Regards
		Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux