On Tue, 26 Oct 2004, Geoff Oakham wrote:

> Hey Alan,
> 
> Unfortunately I haven't had any luck fixing this timing issue, so I've
> returned to seek wisdom and guidance.  I've tried:
> 
>       -capping the average transfer speed in my driver
>       -looking for similar behaviour in the Windows driver
> 
> Everything I've observed* suggests (to me) a lurking race condition.
> There's only two places it could be lurking:
> 
>       -my driver
>       -the uhci host driver
> 
> Since the linux-usb implementation is 100% bug-free, my code is the
> bug's likely home.  Should I be holding any locks when I call
> usb_control_msg() or usb_bulk_msg()?

You certainly shouldn't hold any spinlocks, since those routines need to 
sleep.  There's nothing wrong with holding a semaphore, but you don't 
_need_ to hold any locks at all.

Does your driver print a debug message every time it submits an URB or 
calls one of those routines?  By checking the log you could verify that 
events aren't happening out of sequence.

> any insight would be appreciated; thanks in advance,

Have you eliminated the possibility of other programs running in the
background also trying to communicate with your device (some Gnome/hotplug
programs do that)?

Have you turned on USB debugging in the kernel configuration?  If 
something is going wrong, maybe it will show in the debugging log.

> Geoff
> 
> * Just to recap: this bug happens when my system is heavily loaded
>   with lots of disk activity.  (Ie, lots of hardware and software
>   interrupts.) Also, the only tester that reported the same problem was
>   using a dual AMD64.  (Sounds ripe for race conditions.)

I'm not aware of any race conditions.  (Of course, if I did know of one I 
probably would have fixed it already!)

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to