On Thu, Oct 25, 2018 at 07:59:36AM +0000, Emmanuel Dreyfus wrote: > 3) Use USB timeout in usbd_transfer() > https://ftp.espci.fr/shadow/manu/usb_sync_xfer.patch > > Make sure the USB timeout is used when doing synchronous USB transfers. > Here again the goal is to avoid getting stuck in the kernel forever > because the ack frame was rejected by the host controler.
After investigating, that one is not necessary. I thought I got stuck forever in cv_wait but in fact I was entering it again and again because processes were pushing new requests. On the otherhand, I made some progress with enabling libnfc to handle the toggle bit problem. It detects a read timeout as a toggle bit miss, and sends an empty frame to resync it. But in order to proceed, that hack must not fail its write operation. I let it go despite a toggle miss related write timeout by adding a quirk that hides the timeout. https:///ftp.espci.fr/shadow/manu/toggle.patch That is horrible, but the hardware is really buggy, despite being widespread. -- Emmanuel Dreyfus m...@netbsd.org