CVSROOT: /cvs Module name: src Changes by: chel...@cvs.openbsd.org 2019/12/22 12:11:45
Modified files: sys/dev : midi.c Log message: midi(4): *sleep(9) -> *sleep_nsec(9) These are straightforward except for the tsleep(9) conversion. ratchov@ had a bit to say about that code: https://marc.info/?l=openbsd-tech&m=157665936017373&w=2 > The problem is that close(2) may reset the transmitter before the few > bytes of its internal buffer is sent on the wire; there's no "wait for > completion" feature in such simple hardware, so we just wait few > milliseconds. > > The transmitter buffer size is around 16 bytes, the byte rate is 3125 > bytes/second. So if we wait at least 16B / 3125B/s = 5.12ms, we're > safe. Waiting 10ms-20ms is enough and is unnoticeable. Hence, in this diff we wait a flat 20ms in that situation. ok ratchov@