Re: [PROBLEM/BUG] mouse polling at only half rate on ohci_hcd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/20/2013 01:27 PM, Alan Stern wrote:
>
> I think I see what's going on.
> 
> The usbhid driver uses a single interrupt URB to receive data from the
> device.  When the URB completes, it gets resubmitted to receive the
> next packet of data.
> 
> The OHCI controller issues interrupts at frame boundaries, and it
> probably gets the information for upcoming interrupt transfers at the
> beginning of a frame.  Thus, suppose some data is received during frame
> N.  An interrupt occurs and the URB completes at the end of frame N.  
> The usbhid driver processes the data and then resubmits the URB.  By
> that time, however, it is already too late for the controller to handle
> it during frame N+1.  It doesn't get handled until frame N+2.  Since
> each frame is one millisecond, the maximum polling rate ends up being
> 500 Hz.
> 
> With EHCI controllers, interrupts occur at the boundaries of
> microframes rather than frames.  Thus, the usbhid driver gets the data
> and processes it after only 1/8 ms has elapsed, which leaves enough
> time to resubmit the URB before frame N+1 begins.
> 
> This could be considered a bug in the usbhid driver.  As far as I can
> see, the only way to fix it is to use two interrupts URBs rather than
> one.
> 
> Alan Stern
> 

Thanks a lot for taking time to diagnose this, I appreciate it!  I think
I understand the general gist of what you've said.

I'd love to be able to try and solve this or to write a patch, but I'm
afraid I've never really done any kernel-related hacking before, and I'm
not too familiar with how USB works...  I'm extremely interested in
writing patches for Linux in the future, so I'll be researching this.

So if anybody wants to write a patch, or even give some tips on what I
might need to research to do this myself in the future (I don't know
what an URB is, tbh), I'd appreciate it in either case.

Regards!

--
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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux