Lothar, I'm not going to merge this particular patch (but the others are already merged):
On Tuesday 07 September 2004 2:18 pm, Lothar Wassmann wrote: > > > The patch below makes sure that ed->tick has been set to the current > frame number BEFORE enabling the SF interrupt. Otherwise the interrupt > routine might read a bogus value from ed->tick and decide that > the ED cannot yet be removed from the done list. Not so. The driver holds ohci->lock then, so no IRQ can arrive (inside the HCD) until after SF is enabled. So ed->tick can't be checked by anything until the lock is dropped. And reversing the order creates a race with the hardware ... it's OK to sometimes need an "extra" SF IRQ, but using the wrong value for the frame counter could mean that the HCD would be modifying EDs that the hardware was still using. And preventing that is the entire reason to wait for SF; we know that the HCCA is written immediately before SF is triggered. - Dave > This might be quite unlikely and won't give any problem if there are > further interrupts, since the next one would find the correct ed->tick > value. BUT, if the ED removal has been triggered by device removal we > won't get any further SF interrupts to finish up clearing the done > queue. > > --- linux-2.6.8.1-karo/drivers/usb/host/ohci-q.c~ohci-bugfix > +++ linux-2.6.8.1-karo/drivers/usb/host/ohci-q.c > @@ -477,19 +477,17 @@ > ed->ed_prev = NULL; > ohci->ed_rm_list = ed; > > - /* enable SOF interrupt */ > - writel (OHCI_INTR_SF, &ohci->regs->intrstatus); > - writel (OHCI_INTR_SF, &ohci->regs->intrenable); > - // flush those writes, and get latest HCCA contents > - (void) ohci_readl (&ohci->regs->control); > - > /* SF interrupt might get delayed; record the frame counter value that > * indicates when the HC isn't looking at it, so concurrent unlinks > * behave. frame_no wraps every 2^16 msec, and changes right before > * SF is triggered. > */ > ed->tick = OHCI_FRAME_NO(ohci->hcca) + 1; > - > + /* enable SOF interrupt */ > + writel (OHCI_INTR_SF, &ohci->regs->intrstatus); > + writel (OHCI_INTR_SF, &ohci->regs->intrenable); > + // flush those writes, and get latest HCCA contents > + (void) ohci_readl (&ohci->regs->control); > } > > /*-------------------------------------------------------------------------* > --- end of patch --- > ------------------------------------------------------- This SF.Net email is sponsored by: thawte's Crypto Challenge Vl Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam Camcorder. More prizes in the weekly Lunch Hour Challenge. Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel