On 07/15/2010 07:59 AM, Alan Stern wrote:
http://marc.info/?l=linux-usb&m=127911981822386&w=2
Oh, very very interesting!
You can go ahead and try that patch to see if it helps. It might need
a little manual adjustment to apply on your kernel.
The patch improves performance indeed but not to a degree that helps
fixing the problem.
I will have a look. We are not using PCI and as far as I know our
controller should not have problems.
Then you can try clearing the need_io_watchdog flag.
So disabling the watchdog removes the "periodic" pop that happens
roughly a couple of times per second; anyway if we have a mouse
connected through a hub we hear many pops when moving it, the same if we
copy stuff to/from a mass storage device.
Further investiagtion with the trace tool shows that the execution gets
"stuck" in the for loop in ehci-sched.c, drivers/usb/host/ehci-sched.c,
the following code:
// FIXME: this assumes we won't get lapped when
// latencies climb; that should be rare, but...
// detect it, and just go all the way around.
// FLR might help detect this case, so long as latencies
// don't exceed periodic_size msec (default 1.024 sec).
// FIXME: likewise assumes HC doesn't halt mid-scan
if (now_uframe == clock) {
unsigned now;
if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state)
|| ehci->periodic_sched == 0)
break;
ehci->next_uframe = now_uframe;
now = ehci_readl(ehci, &ehci->regs->frame_index) &
(mod - 1);
if (now_uframe == now)
break;
/* rescan the rest of this frame, then ... */
clock = now;
clock_frame = clock >> 3;
if (ehci->clock_frame != clock_frame) {
free_cached_lists(ehci);
ehci->clock_frame = clock_frame;
}
} else {
now_uframe++;
now_uframe &= mod - 1;
}
This loops keep executing several hundreds of times, for almost 2
milliseconds while interrupts are globally disabled, and basically no
action is really performed.
Would you be able to suggest any kind of further debug or experiment I
may try? Or give a rough explanation what *should* happen here?
Thank you,
Alessio
--
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