aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-11 11:21:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 19:53:16 -0400
commitd58b4bcc6df8046cf9c3c59f9ff84d2cd86b93eb (patch)
treebef387c0c81654a38271f8528bb8b877ac5d3ed7 /drivers/usb/host/ehci.h
parentc0c53dbc32ea05a1e1dd9dba4772327da9a11750 (diff)
USB: EHCI: introduce high-res timer
This patch (as1572) begins the conversion of ehci-hcd over to using high-resolution timers rather than old-fashioned low-resolution kernel timers. This reduces overhead caused by timer roundoff on systems where HZ is smaller than 1000. Also, the new timer framework introduced here is much more logical and easily extended than the ad-hoc approach ehci-hcd currently uses for timers. An hrtimer structure is added to ehci_hcd, along with a bitflag array and an array of ktime_t values, to keep track of which timing events are pending and what their expiration times are. Only the infrastructure for the timing operations is added in this patch. Later patches will add routines for handling each of the various timing events the driver needs. In some cases the new hrtimer handlers will replace the existing handlers for ehci-hcd's kernel timers; as this happens the old timers will be removed. In other cases the new timing events will replace busy-wait loops. 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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 9e8e82ecce58..070be83028d5 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -73,7 +73,23 @@ enum ehci_rh_state {
73 EHCI_RH_STOPPING 73 EHCI_RH_STOPPING
74}; 74};
75 75
76/*
77 * Timer events, ordered by increasing delay length.
78 * Always update event_delays_ns[] and event_handlers[] (defined in
79 * ehci-timer.c) in parallel with this list.
80 */
81enum ehci_hrtimer_event {
82 EHCI_HRTIMER_NUM_EVENTS /* Must come last */
83};
84#define EHCI_HRTIMER_NO_EVENT 99
85
76struct ehci_hcd { /* one per controller */ 86struct ehci_hcd { /* one per controller */
87 /* timing support */
88 enum ehci_hrtimer_event next_hrtimer_event;
89 unsigned enabled_hrtimer_events;
90 ktime_t hr_timeouts[EHCI_HRTIMER_NUM_EVENTS];
91 struct hrtimer hrtimer;
92
77 /* glue to PCI and HCD framework */ 93 /* glue to PCI and HCD framework */
78 struct ehci_caps __iomem *caps; 94 struct ehci_caps __iomem *caps;
79 struct ehci_regs __iomem *regs; 95 struct ehci_regs __iomem *regs;