diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2011-10-12 10:39:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-18 16:49:33 -0400 |
commit | 68aa95d5d4de31c9348c1628ffa85c805305ebc5 (patch) | |
tree | 7782dad26b9672be03b78a70cae1105f395dafe2 /drivers/usb/host/ehci.h | |
parent | 91960c2ef095c4b0744349e80a933921cbdcfd6e (diff) |
EHCI: workaround for MosChip controller bug
This patch (as1489) works around a hardware bug in MosChip EHCI
controllers. Evidently when one of these controllers increments the
frame-index register, it changes the three low-order bits (the
microframe counter) before changing the higher order bits (the frame
counter). If the register is read at just the wrong time, the value
obtained is too low by 8.
When the appropriate quirk flag is set, we work around this problem by
reading the frame-index register a second time if the first value's
three low-order bits are all 0. This gives the hardware a chance to
finish updating the register, yielding the correct value.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Jason N Pitt <jpitt@fhcrc.org>
CC: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci.h')
-rw-r--r-- | drivers/usb/host/ehci.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index c161d97de7d..0a5fda73b3f 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -146,6 +146,7 @@ struct ehci_hcd { /* one per controller */ | |||
146 | unsigned fs_i_thresh:1; /* Intel iso scheduling */ | 146 | unsigned fs_i_thresh:1; /* Intel iso scheduling */ |
147 | unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/ | 147 | unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/ |
148 | unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ | 148 | unsigned has_synopsys_hc_bug:1; /* Synopsys HC */ |
149 | unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */ | ||
149 | 150 | ||
150 | /* required for usb32 quirk */ | 151 | /* required for usb32 quirk */ |
151 | #define OHCI_CTRL_HCFS (3 << 6) | 152 | #define OHCI_CTRL_HCFS (3 << 6) |
@@ -747,6 +748,22 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x) | |||
747 | 748 | ||
748 | /*-------------------------------------------------------------------------*/ | 749 | /*-------------------------------------------------------------------------*/ |
749 | 750 | ||
751 | #ifdef CONFIG_PCI | ||
752 | |||
753 | /* For working around the MosChip frame-index-register bug */ | ||
754 | static unsigned ehci_read_frame_index(struct ehci_hcd *ehci); | ||
755 | |||
756 | #else | ||
757 | |||
758 | static inline unsigned ehci_read_frame_index(struct ehci_hcd *ehci) | ||
759 | { | ||
760 | return ehci_readl(ehci, &ehci->regs->frame_index); | ||
761 | } | ||
762 | |||
763 | #endif | ||
764 | |||
765 | /*-------------------------------------------------------------------------*/ | ||
766 | |||
750 | #ifndef DEBUG | 767 | #ifndef DEBUG |
751 | #define STUB_DEBUG_FILES | 768 | #define STUB_DEBUG_FILES |
752 | #endif /* DEBUG */ | 769 | #endif /* DEBUG */ |