2bb980892d
select(2), and discovered to my horror that ugen(4)'s bulk in/out support is horribly lobotomized. Bulk transfers are done using the synchronous API instead of the asynchronous one. This causes the following broken behavior to occur: - You open the bulk in/out ugen device and get a descriptor - You create some other descriptor (socket, other device, etc...) - You select on both the descriptors waiting until either one has data ready to read - Because of ugen's brokenness, you block in usb_bulk_transfer() inside ugen_do_read() instead of blocking in select() - The non-USB descriptor becomes ready for reading, but you remain blocked on select() - The USB descriptor becomes ready for reading - Only now are you woken up so that you can ready data from either descriptor. The result is select() can only wake up when there's USB data pending. If any other descriptor becomes ready, you lose: until the USB descriptor becomes ready, you stay asleep. The correct approach is to use async bulk transfers, so I changed the read code to use the async bulk transfer API. I left the write side alone for now since it's less of an issue. Note that the uscanner driver has the same brokenness in it. |
||
---|---|---|
.. | ||
alpha | ||
amd64 | ||
arm | ||
boot | ||
cam | ||
coda | ||
compat | ||
conf | ||
contrib | ||
crypto | ||
ddb | ||
dev | ||
doc | ||
fs | ||
gdb | ||
geom | ||
gnu | ||
i4b | ||
i386 | ||
ia64 | ||
isa | ||
isofs/cd9660 | ||
kern | ||
libkern | ||
modules | ||
net | ||
net80211 | ||
netatalk | ||
netatm | ||
netgraph | ||
netinet | ||
netinet6 | ||
netipsec | ||
netipx | ||
netkey | ||
netnatm | ||
netncp | ||
netsmb | ||
nfs | ||
nfs4client | ||
nfsclient | ||
nfsserver | ||
opencrypto | ||
pc98 | ||
pccard | ||
pci | ||
posix4 | ||
powerpc | ||
rpc | ||
security | ||
sparc64 | ||
sys | ||
tools | ||
ufs | ||
vm | ||
Makefile |