USB GadgetFS: write() function call blocks indefinitely
by OkCalis from LinuxQuestions.org on (#57XQJ)
Hi,
I've been working on an ARM9 device with Linux kernel 3.2, which acts as a USB peripheral when connected to a PC. To this end, I use GadgetFS feature built within the kernel.
It's been working properly; however recently, I've encountered a frustrating issue: After receiving bulk commands and transmitting bulk data over USB for a random time interval, the "write()" function call starts to block indefinitely for no apparent reason, causing my Sender Posix Thread to become unresponsive. Restarting the application temporarily solves the problem (which makes me suspect that this is a software-related issue). I also tried closing the source, sink, and ep0 file descriptors and reopening them whenever this error occurs, but even after reopening the endpoints, the "write()" function never seems to work properly.
As for the source code, I'm using the one provided as an example at http://www.linux-usb.org/gadget/usb.c
What do you think could be causing this?
Thanks in advance,
OkCalis


I've been working on an ARM9 device with Linux kernel 3.2, which acts as a USB peripheral when connected to a PC. To this end, I use GadgetFS feature built within the kernel.
It's been working properly; however recently, I've encountered a frustrating issue: After receiving bulk commands and transmitting bulk data over USB for a random time interval, the "write()" function call starts to block indefinitely for no apparent reason, causing my Sender Posix Thread to become unresponsive. Restarting the application temporarily solves the problem (which makes me suspect that this is a software-related issue). I also tried closing the source, sink, and ep0 file descriptors and reopening them whenever this error occurs, but even after reopening the endpoints, the "write()" function never seems to work properly.
As for the source code, I'm using the one provided as an example at http://www.linux-usb.org/gadget/usb.c
What do you think could be causing this?
Thanks in advance,
OkCalis