Re: [PATCH] USB: cdc-acm: restore the line coding after a reset-resume

From: Oliver Neukum

Date: Thu Nov 19 2026 - 07:47:22 EST




On 19.11.26 13:28, Piotr Kubik wrote:
Hi,

thank you for this patch. However, it has an issue.
Let me comment on this inline.

+ /*
+ * The device can lose its line coding, for example when it loses
+ * power during system suspend, and acm_tty_set_termios() sends the
+ * line coding only when it differs from acm->line. Send it once, for
+ * the control interface. In a runtime resume of the device, an autopm
+ * reference here would wait for this resume and never return.
+ */
+ if (intf == acm->control)

This test is problematic. The interfaces may be resumed in any order.
You are setting a line coding before the rest of the device is
resumed.

To do this cleanly, you need to look at the counter.

Regards
Oliver