On Mon, 5 Jan 2015, vichy wrote:
> hi all:
> after tracing and reading kernel usb source code about run time and
> normal suspend.
> 1. how could we check the rum time suspend is work on some device?
> By plugging in devices and check whether
> /sys/bus/usb/devices/.../power/ is empty or not?
No. That directory will never be empty.
You can check whether runtime suspend works by enabling it:
echo auto >/sys/bus/usb/devices/.../power/control
You can see whether the device has been suspended by looking at the
runtime_status and runtime_suspended_time files in the .../power
directory.
> 2. I plug in one mouse and found the device will auto disconnect every
> 2 secs, the default value of usb_autosuspend_delay.
> But I have some questions
> a. how kernel judge the device is idle, from usb spec, the idle
> mean there is no any bus traffic, including sof, over 3ms and host
> will always firing sof even there is no transaction on the bus.
The kernel judges a device to be idle if it hasn't been used in some
time. The bus traffic has nothing to do with it.
> b. I think dynamic suspend is used for saving power when device is
> idle for a specific time, but why the mouse will dynamic resume when
> suspend for a while. it should resume when user or external event
> trigger it for resume right?
That's right. If your mouse is resuming, it must be because some event
has triggered the resume.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html