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)
Nov 22 2024, 4:53 AM
Unknown Object (File)
Nov 18 2024, 12:48 AM
Unknown Object (File)
Sep 16 2024, 8:01 PM
Unknown Object (File)
Sep 13 2024, 11:51 AM
Unknown Object (File)
Sep 11 2024, 2:06 PM
Unknown Object (File)
Sep 8 2024, 8:47 AM
Unknown Object (File)
Sep 8 2024, 8:06 AM
Unknown Object (File)
Sep 8 2024, 12:13 AM
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.