Rework zyd(4)'s register read/write methods to eliminate race conditions.
Read commands were issued via asynchronous transfers and replies were
expected after a fixed tsleep() timeout. Upon timeout zyd simply freed
the xfer even if it was still in-flight within the USB stack. This could
cause havoc such as making all USB ports on the system unusable until reboot.
ehci_freex: xfer=0xfffffe811e63e9d8 not busy, 0x4f4e5155
("busy" here would indicate the xfer is done and marked for being freed)
To fix this, issue read commands with synchronous transfers so the xfer
can always complete. Split read/write code paths into separate methods.
Add a flag that tells us if a reply was received in interrupt context
while the read path waited in tsleep().
With and ok mpi@