Fishwaldo commented on code in PR #19861: URL: https://github.com/apache/nuttx/pull/19861#discussion_r4056410342
########## drivers/usbhost/usbhost_xhci.c: ########## @@ -160,6 +160,16 @@ struct xhci_epinfo_s size_t dmacopy; /* Length to copy back out of a stand-in */ bool dmain; /* Direction this buffer was prepared for */ sem_t iocsem; /* Semaphore used to wait for transfer completion */ + + /* One transfer at a time on an endpoint. The controller lock below is + * released while a transfer is in flight, so it cannot serve this: two + * threads would each set up a transfer on the same endpoint and the + * second would find iocwait already set. A device's default control + * endpoint is the one that meets this, since every interface driver on + * a composite device speaks through it. + */ + + mutex_t exclsem; /* Serialises transfers on this endpoint */ Review Comment: exclsem is only locked in xhci_transfer(), and unlocked in that same function. So it should always execute from the same thread right? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
