Page MenuHomeFreeBSD

Add tsw_busy support to usb_serial (ucom).
ClosedPublic

Authored by ian on Jan 14 2017, 6:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 4:01 AM
Unknown Object (File)
Nov 10 2023, 10:51 AM
Unknown Object (File)
Nov 8 2023, 3:22 PM
Unknown Object (File)
Nov 8 2023, 10:51 AM
Unknown Object (File)
Nov 6 2023, 4:56 PM
Unknown Object (File)
Nov 5 2023, 3:38 AM
Unknown Object (File)
Oct 30 2023, 5:14 PM
Unknown Object (File)
Oct 29 2023, 5:50 PM
Subscribers

Details

Summary

The tty layer uses tsw_busy to poll for busy/idle status of the transmitter hardware during close() and tcdrain(). The ucom layer defines ULSR_TXRDY and ULSR_TSRE bits for the line status register; when both are set, the transmitter is idle. Not all chip drivers maintain those bits in the sc_lsr field, and if the bits never get set the transmitter will always appear busy, causing hangs in tcdrain().

These changes add a new sc_flag bit, UCOM_FLAG_LSRTXIDLE. When this flag is set, ucom_busy() uses the lsr bits to return busy vs. idle state, otherwise it always returns idle (which is effectively what happened before this change because tsw_busy wasn't implemented).

For the uftdi chip driver, these changes stop masking out the tx idle bits when processing the status register (because now they're useful), and it calls ucom_use_lsr_txbits() to indicate the bits are maintained by the driver and can be used by ucom_busy().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ian retitled this revision from to Add tsw_busy support to usb_serial (ucom)..
ian updated this object.
ian edited the test plan for this revision. (Show Details)
ian set the repository for this revision to rS FreeBSD src repository - subversion.
ian added a subscriber: hselasky.
hselasky edited edge metadata.

Looks good - no objections. I assume you've tested it.

This revision is now accepted and ready to land.Jan 18 2017, 1:46 PM
This revision was automatically updated to reflect the committed changes.