diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-07-11 11:22:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 19:54:25 -0400 |
commit | 314466101c6ae14f6f5db8a86eda1509ba2c02a8 (patch) | |
tree | d2605336919a20a1ee122c813ca7ddc479755d12 /drivers/usb/host/ehci.h | |
parent | 9671cd7a91059bcd27665a884ee6568d31ef6857 (diff) |
USB: EHCI: use hrtimer for async schedule
This patch (as1576) adds hrtimer support for managing ehci-hcd's
async schedule. Just as with the earlier change to the periodic
schedule management, two new hrtimer events take care of everything.
One event polls at 1-ms intervals to see when the Asynchronous
Schedule Status (ASS) flag matches the Asynchronous Schedule Enable
(ASE) value; the schedule's state must not be changed until it does.
The other event delays for 15 ms after the async schedule becomes
empty before turning it off.
The new events replace a busy-wait poll and a kernel timer usage.
They also replace the rather illogical method currently used for
indicating the async schedule should be turned off: attempting to
unlink the dedicated QH at the head of the async list.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r-- | drivers/usb/host/ehci.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index da2e0ab23850..bf06bbb77ba4 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -79,8 +79,10 @@ enum ehci_rh_state { | |||
79 | * ehci-timer.c) in parallel with this list. | 79 | * ehci-timer.c) in parallel with this list. |
80 | */ | 80 | */ |
81 | enum ehci_hrtimer_event { | 81 | enum ehci_hrtimer_event { |
82 | EHCI_HRTIMER_POLL_ASS, /* Poll for async schedule off */ | ||
82 | EHCI_HRTIMER_POLL_PSS, /* Poll for periodic schedule off */ | 83 | EHCI_HRTIMER_POLL_PSS, /* Poll for periodic schedule off */ |
83 | EHCI_HRTIMER_DISABLE_PERIODIC, /* Wait to disable periodic sched */ | 84 | EHCI_HRTIMER_DISABLE_PERIODIC, /* Wait to disable periodic sched */ |
85 | EHCI_HRTIMER_DISABLE_ASYNC, /* Wait to disable async sched */ | ||
84 | EHCI_HRTIMER_NUM_EVENTS /* Must come last */ | 86 | EHCI_HRTIMER_NUM_EVENTS /* Must come last */ |
85 | }; | 87 | }; |
86 | #define EHCI_HRTIMER_NO_EVENT 99 | 88 | #define EHCI_HRTIMER_NO_EVENT 99 |
@@ -93,6 +95,7 @@ struct ehci_hcd { /* one per controller */ | |||
93 | struct hrtimer hrtimer; | 95 | struct hrtimer hrtimer; |
94 | 96 | ||
95 | int PSS_poll_count; | 97 | int PSS_poll_count; |
98 | int ASS_poll_count; | ||
96 | 99 | ||
97 | /* glue to PCI and HCD framework */ | 100 | /* glue to PCI and HCD framework */ |
98 | struct ehci_caps __iomem *caps; | 101 | struct ehci_caps __iomem *caps; |
@@ -110,6 +113,7 @@ struct ehci_hcd { /* one per controller */ | |||
110 | struct ehci_qh *async_unlink_last; | 113 | struct ehci_qh *async_unlink_last; |
111 | struct ehci_qh *qh_scan_next; | 114 | struct ehci_qh *qh_scan_next; |
112 | unsigned scanning : 1; | 115 | unsigned scanning : 1; |
116 | unsigned async_count; /* async activity count */ | ||
113 | 117 | ||
114 | /* periodic schedule support */ | 118 | /* periodic schedule support */ |
115 | #define DEFAULT_I_TDPS 1024 /* some HCs can do less */ | 119 | #define DEFAULT_I_TDPS 1024 /* some HCs can do less */ |
@@ -229,7 +233,6 @@ static inline void iaa_watchdog_done(struct ehci_hcd *ehci) | |||
229 | enum ehci_timer_action { | 233 | enum ehci_timer_action { |
230 | TIMER_IO_WATCHDOG, | 234 | TIMER_IO_WATCHDOG, |
231 | TIMER_ASYNC_SHRINK, | 235 | TIMER_ASYNC_SHRINK, |
232 | TIMER_ASYNC_OFF, | ||
233 | }; | 236 | }; |
234 | 237 | ||
235 | static inline void | 238 | static inline void |