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 2012/7/16 22:13, Alan Stern wrote:
On Mon, 16 Jul 2012, Lan Tianyu wrote:

Currently, "power/wakeup" sysfs file can't control remote wakeup in the runtime
suspend. It only depends on "usb_interface->needs_remote_wakeup" to determine
whether enable remote wakeup or not when runtime suspending. Usr space has no
choice. This patch is to enable "power/wakeup" to control remote wakeup in the
runtime suspend.

As Oliver pointed out, you need to explain why this is needed.
Yeah. Lost some background introduction. I recently try to realize usb port power off mechanism for ports with device. So design, the port with device only can be power off when remote wakeup disable. But I found remote wakeup was entirely control by driver and userspace has no control. needs_remote_wakeup is set to 1 when the device is opened. So that means the device's remote wakeup can not be disabled and usb port can not be powered off. So I try to provide a control of remote wakeup to userspace. When system becomes idle such as blank screen,
some usb devices may be able to disable remote wakeup and power off.

More importantly, the patch is completely wrong.  The "power/wakeup"
parameter is not meant for controlling runtime resume; it is supposed
to be used only for system resume.
You are right. So if it was necessary, a new sysfs would be needed?

Yes, userspace has no choice about wakeup during runtime suspend.  It
is controlled entirely by the driver.  If userspace wants to change the
settings, it has to inform the driver somehow.

Are there ways for userspace to inform driver to disable remote wakeup?
I find needs_remote_wakeup is set to zero only in device driver close();

Alan Stern



--
Best Regards
Tianyu Lan
linux kernel enabling team
--
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