I use USRP-like firmware on Cypress' FX2LP chip with a x86 Linux 2.6.x
host. The problem is quite simple: When I run a program (let's call it
usb_test1) and it calls the usb_bulk_write function twice it works
fine:

=========
> usb_test1

usb_bulk_write(stuff)
usb_bulk_write(morestuff)
=========

....but say we have another program (usb_test2) and it only calls bulk
write once, but we run the program TWICE, then the first write always
works and the second write fails silently. I say silently because the
URB request goes through fine, but the data never arrives in the FX2's
End Point FIFO (which I confirm by setting an LED when the FIFO is not
empty).

=========
> usb_test2

usb_bulk_write(stuff)
> usb_test2

usb_bulk_write(stuff) <======== FAILS SILENTLY
=========

This problem is solved only by reprogramming the fx2 chip.

I enabled URB tracing in the EHCI-HCD kernel module with the following
results:

===========
ehci_hcd 0000:00:1d.7: submit_async 8 urb f7ec91c0 ep0out len 0, qtd
f38e8540 [qh f38e7680]
ehci_hcd 0000:00:1d.7: irq status 0001 INT
ehci_hcd 0000:00:1d.7: ehci_urb_done 8 urb f7ec91c0 ep0out status 0 len
0/0
ehci_hcd 0000:00:1d.7: submit_async 8 urb f7ec91c0 ep2out len 36, qtd
f38e8720 [qh 00000000]
ehci_hcd 0000:00:1d.7: irq status 0001 INT
ehci_hcd 0000:00:1d.7: ehci_urb_done 8 urb f7ec91c0 ep2out status 0 len
36/36
ehci_hcd 0000:00:1d.7: irq status 0020 IAA
ehci_hcd 0000:00:1d.7: irq status 0020 IAA
============
The bad endpoint in question here is ep2out. I send 36 bytes and it
swears that 36 bytes has been sent, but this data never arrives in the
FX2's EP2 FIFO.

One might think I don't close the device correctly, but I realease all
interfaces claimed and do a usb_close on the device handle. I'm still
not quite sure wheter this is linux misbehaving or the fx2.

Any ideas will be appreciated.

Thanks

- Stephan