Page MenuHomeFreeBSD

usb: serial: make more commands execute synchronously
ClosedPublic

Authored by kevans on Dec 6 2024, 10:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 6, 9:13 PM
Unknown Object (File)
Mon, Jan 6, 6:14 PM
Unknown Object (File)
Mon, Jan 6, 6:12 AM
Unknown Object (File)
Mon, Jan 6, 2:28 AM
Unknown Object (File)
Wed, Dec 11, 9:03 AM
Unknown Object (File)
Wed, Dec 11, 2:50 AM
Unknown Object (File)
Wed, Dec 11, 2:23 AM
Unknown Object (File)
Dec 9 2024, 2:32 AM

Details

Summary

The termios layer wants some level of guarantee that we've actually
submitted param changes to the hardware when our functions return, so we
need to do a little more waiting to avoid violating those guarantees.

This is especially important as some hardware has some minimum timing
specifications around this stuff, and without being less asynchronous
the software dealing with these devices can't reasonably operate the
hardware without more excessive delays than they should need.

More specifically, we make sure that:

  • The command to start transfers is finished before we toggle DTR/RTS
  • The status_change command finishes before we return, which may change some fields in the softc that we need for a subsequent call into usb_serial
  • cfg_param finishes before we re-enable transfers, and we ensure that RTS is appropriately toggled before we return to userland

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kevans created this revision.

Return ENXIO for tty_gone in uart_command_barrier to match uart_command_queue,
convert it to ENODEV in the ioctl layer to match ttyil_ioctl.

This revision is now accepted and ready to land.Dec 7 2024, 11:22 PM