Page MenuHomeFreeBSD

usb: serial: allow the open/close sleep to be interruptible
ClosedPublic

Authored by kevans on Dec 6 2024, 10:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 15 2024, 12:59 AM
Unknown Object (File)
Dec 15 2024, 12:55 AM
Unknown Object (File)
Dec 15 2024, 12:54 AM
Unknown Object (File)
Dec 11 2024, 9:06 AM
Unknown Object (File)
Dec 11 2024, 2:11 AM
Unknown Object (File)
Dec 10 2024, 5:59 PM
Unknown Object (File)
Dec 9 2024, 2:33 AM
Unknown Object (File)
Dec 9 2024, 2:32 AM

Details

Summary

ucom_queue_command will issue commands for open/close, then wait on them
to be finished. In the spirit of playing it safe, allow
ucom_queue_command's wait to be interrupted in case the usb process gets
jammed up waiting on the hardware -- we can at least recover the user
thread that initiated it, even if we can't recover the usb process.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61020
Build 57904: arc lint + arc unit

Event Timeline

kevans created this revision.
sys/dev/usb/usb_process.c
409–442

I have no idea about USB code, but I have an opinion. Suppose that we are waken by a signal, and suppose that pm_qentry links are gone. Shouldn't we avoid returning EINTR in this case, pretending that the entry was processed properly?

This way the caller knows for sure was the entry processed or not.

Override cv_wait_sig() errors if neither of the tasks are currently enqueued,
because the caller doesn't actually care beyond that..

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