fix(usbcdc): Re-enable after lockup when attached again
When opening an ACM device Linux sends the ACM_SET_CONTROL_LINE_STATE with DTR and CTS high. We can use this re-enable the ACM device on our side after a lockup.
Merge request reports
Activity
This is great! While at it, is there a similar callback when the device is closed? Maybe we can circumvent the need for the ugly
lockup_disable
altogether that way? I.e. revert the hack in 4a292ac0 ("workaround(cdcacm): Fix CDC-ACM lockup on host hangup") finally?Looked a bit through the relevant kernel code, I guess
screen
setsstty -hupcl
by default which supresses the DTR lowering though the tty subsystem. If that is correct,screen /dev/ttyACM0 hupcl
should trigger the event. But in any case, this path is never going to work reliably.What could work is a detection somewhere on USB bus level. If I interpret the code correctly, once the last open fd for the CDC-ACM device is closed, any writes from card10 will be answered with an error. So ideally, MAXUSB notices this and stops trying to overfill its internal buffer ... Which is what my hack is doing right now (in a very dirty way) so we're back where we'd need to fix MAXUSB internals :/
added 1-Bug 3-Epicardium labels
added 1-Additional-Feature label and removed 1-Bug label
added 6 - To Be Merged label
mentioned in issue #54
mentioned in commit 12992926