On Tuesday 02 May 2017 15:07:03 Laurent Pinchart wrote: > Hello, > > I ran into an issue with a Xilinx Zynq XC7Z010 system. The system acts as a > USB peripheral, using the UVC gadget driver. > > When transferring high bandwidth data over USB in isochronous mode, complete > system freezes are occasionally noticed. The problem was traced to the > following code from _hardware_enqueue() in drivers/usb/chipidea/udc.c. > > wmb(); > if (hw_read(ci, OP_ENDPTPRIME, BIT(n))) > goto done; > do { > hw_write(ci, OP_USBCMD, USBCMD_ATDTW, USBCMD_ATDTW); > tmp_stat = hw_read(ci, OP_ENDPTSTAT, BIT(n)); > } while (!hw_read(ci, OP_USBCMD, USBCMD_ATDTW)); > hw_write(ci, OP_USBCMD, USBCMD_ATDTW, 0); > if (tmp_stat) > goto done; > > > The do ... while loop loops forever, and as the function is called under a > spin_lock_irqsave(), the system doesn't appreciate. Adding a maximum number > of iterations to exit the loop is easy (I'll try to submit a patch after > finding the root cause of the problem). That fixes the system hang, but USB > transfers are still broken. > > I've checked the code and unfortunately it seems to match the procedure > documented in the datasheet :-/ > > The MTBF is several hours, but running 'memtester -M100' Quick update, this should have read 'memtester 100M', sorry. > (http://pyropus.ca/software/memtester/) in parallel to UVC video transfer > over USB brings the MTBF to a few minutes. The problem thus seems to be > related to memory bus pressure. > > Has anyone run into this problem before ? Is this a known issue ? I don't > mind getting my hands dirty debugging, but as I'm not familiar with the > chipidea USB controller pointers to what I should check in priority would > be appreciated. -- Regards, Laurent Pinchart -- 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