ehci: Lower timer freq when the periodic schedule is idle
commit8082624099bce56a3139e6b9f72016c00fd10227
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Nov 2012 11:47:17 +0000 (17 12:47 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 4 Dec 2012 13:41:54 +0000 (4 14:41 +0100)
tree09b3245dee39323e0b5d8d288fe63d89535f86b1
parent386ab487ebc25d780ddfc4a9aea0b21c4a9aaa94
ehci: Lower timer freq when the periodic schedule is idle

Lower the timer freq if no iso schedule packets complete for 64 frames in
a row.

We can safely do this, without adding latency, because:
1) If there is isoc traffic this will never trigger
2) For async handled interrupt packets (only usb-host), the completion handler
   will immediately schedule the frame_timer from a bh
3) All devices using NAK to signal no data for interrupt endpoints now use
   wakeup, which will immediately schedule the frame_timer from a bh

The advantage of this is that when we only have interrupt packets in the
periodic schedule, async_stepdown can do its work and significantly lower
the frequency at which the frame_timer runs.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-ehci.c
hw/usb/hcd-ehci.h