ChangeSet 1.1939.1.71, 2004/09/29 16:20:47-07:00, [EMAIL PROTECTED] [PATCH] USB: OHCI autodetects "need" for init reset quirk
Ther recent QUIRK_INITRESET update turns out to need support for some ALi and ServerWorks chips, as well as the original SiS and OPTi cases. Rather than trying to maintain a quirk table (for what I still think must be a subtle init sequence bug), this patch kicks it in automatically when the frame clock init problem is detected. Signed-off-by: David Brownell <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> drivers/usb/host/ohci-hcd.c | 8 ++++++++ drivers/usb/host/ohci-pci.c | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c --- a/drivers/usb/host/ohci-hcd.c 2004-10-19 08:07:20 -07:00 +++ b/drivers/usb/host/ohci-hcd.c 2004-10-19 08:07:20 -07:00 @@ -545,6 +545,7 @@ /* 2msec timelimit here means no irqs/preempt */ spin_lock_irq (&ohci->lock); +retry: /* HC Reset requires max 10 us delay */ writel (OHCI_HCR, &ohci->regs->cmdstatus); temp = 30; /* ... allow extra time */ @@ -563,6 +564,8 @@ * ... but some hardware won't init fmInterval "by the book" * (SiS, OPTi ...), so reset again instead. SiS doesn't need * this if we write fmInterval after we're OPERATIONAL. + * Unclear about ALi, ServerWorks, and others ... this could + * easily be a longstanding bug in chip init on Linux. */ if (ohci->flags & OHCI_QUIRK_INITRESET) { writel (ohci->hc_control, &ohci->regs->control); @@ -586,6 +589,11 @@ */ if ((ohci_readl (&ohci->regs->fminterval) & 0x3fff0000) == 0 || !ohci_readl (&ohci->regs->periodicstart)) { + if (!(ohci->flags & OHCI_QUIRK_INITRESET)) { + ohci->flags |= OHCI_QUIRK_INITRESET; + ohci_dbg (ohci, "enabling initreset quirk\n"); + goto retry; + } spin_unlock_irq (&ohci->lock); ohci_err (ohci, "init err (%08x %04x)\n", ohci_readl (&ohci->regs->fminterval), diff -Nru a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c --- a/drivers/usb/host/ohci-pci.c 2004-10-19 08:07:20 -07:00 +++ b/drivers/usb/host/ohci-pci.c 2004-10-19 08:07:20 -07:00 @@ -69,8 +69,6 @@ && pdev->device == 0xc861) { ohci_info (ohci, "WARNING: OPTi workarounds unavailable\n"); - /* OPTi sometimes acts wierd during init */ - ohci->flags = OHCI_QUIRK_INITRESET; } /* Check for NSC87560. We have to look at the bridge (fn1) to @@ -88,13 +86,6 @@ ohci_info (ohci, "Using NSC SuperIO setup\n"); } } - - /* SiS sometimes acts wierd during init */ - else if (pdev->vendor == PCI_VENDOR_ID_SI) { - ohci->flags = OHCI_QUIRK_INITRESET; - ohci_info(ohci, "SiS init quirk\n"); - } - } /* NOTE: there may have already been a first reset, to ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel