Transmit under power save mode

Marcelo Tosatti marcelo at kvack.org
Thu Jun 29 14:55:49 EDT 2006


Hi Ronak,

I'm trying to enhance TX latency under PS mode and need some help.

After removing the internal TX queue, I had to fixup power save mode by
stopping the Linux queue when confirm sleep command is sent to firmware,
and restarting it upon receival of awake event:

http://git.infradead.org/?p=users/marcelo/libertas;a=commit;h=4d45a22f86fce4b4625a56577fb9287efffac20f

Problem is that this change degraded latency, as noted in the changelog:

"Latency under power saving mode has degraded due to this change, in
comparison with the in-driver transmit queue. If it ends up being a
problem, it might be necessary to go back to the old scheme (note:
throughput without TX/RX queue is 8% higher).

Worst case latency with original driver ~= 500ms
Worst case latency with current driver ~= 1500ms"

I've noticed that _not_ stopping the OS queue when the device is
in sleep state does not cause harm, and packets are transmitted
successfully.

However, doing that is not recommended:

5.13.6 Assumptions
The host must not issue any command (except the disable PS mode command,
HOST_WAKE_UP_CFG command, or HOST_AWAKE_CONFIRM command) after it
enables PS mode. It may, however, continue to process data transmit and
receive. After sending the sleep confirm message, the host must not
issue the disable PS mode command until it receives an awake indication.
It should also not attempt to transmit or receive any data during this
window (see Figure 5).

                                    Enable PS mode req/rsp
  Host may Tx/Rx data. Host
must not issue any command
   except disable PS mode,
 HOST_WAKE_UP_CFG, or
 HOST_AWAKE_CONFIRM
                                    Sleep event
                                    Sleep confirm
 Host must NOT Tx /Rx data
     Host must not issue any                                        Dozing
   command (no exception)
                                    Awake event

I'm guessing that what happens is the USB controller queues the
transfers until the device wakes up (so we don't lose any of them).

Another advantage is that latency goes to 300ms worst case, versus      
500ms worst case in the original driver.

So, my question is, is it harmful to transmit data while the device is
in sleep state, via the USB bus?

And another related question is, do you have implementation of driver 
code for different buses?

Thanks



More information about the libertas-dev mailing list