Right now , it works fine. I'll do more tests and give you feedback. But what I am thinking is that if the WDH is set in interrupt status register, should I clear this bit if I omit this interrupt? What's your improved way? Thanks, Frank -----Original Message----- From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx] Sent: Wednesday, December 30, 2009 10:45 AM To: Huang, FrankR Cc: USB list Subject: RE: A question about ohci_irq() On Wed, 30 Dec 2009, Huang, FrankR wrote: > Alan, > > The mouse is still hang with this patch. > The done_head is also 0 after the udelay(10). > I suspect when the done_head is 0 , this interrupt is not > belonging the ohci controller. I guess you are right. The controller appears to set the WDH bit _before_ setting ohci->hcca->done_head, which is a violation of section 6.5.2 in the OHCI specification. > Based on my modification, I omit this > interrupt when done_head is 0. Is that ok? The idea is okay, but your modification can be improved. Does this patch solve the problem? Alan Stern Index: usb-2.6/drivers/usb/host/ohci-hcd.c =================================================================== --- usb-2.6.orig/drivers/usb/host/ohci-hcd.c +++ usb-2.6/drivers/usb/host/ohci-hcd.c @@ -831,10 +831,19 @@ static irqreturn_t ohci_irq (struct usb_ usb_hcd_resume_root_hub(hcd); } + /* Some controllers violate the OHCI spec by setting OHCI_INTR_WDH + * before writing ohci->hcca->done_head. They don't generate an + * early interrupt, but if the IRQ line is shared then we might see + * the status bit prematurely. + */ if (ints & OHCI_INTR_WDH) { - spin_lock (&ohci->lock); - dl_done_list (ohci); - spin_unlock (&ohci->lock); + if (unlikely((ohci->hcca->done_head == 0)) { + ints &= ~OHCI_INTR_WDH; + } else { + spin_lock(&ohci->lock); + dl_done_list(ohci); + spin_unlock(&ohci->lock); + } } if (quirk_zfmicro(ohci) && (ints & OHCI_INTR_SF)) { -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html