From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: Piotr Kubik <piotr@kubik.pl>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Francesco Lavra <francescolavra@interfree.it>,
stable@vger.kernel.org
Subject: Re: [PATCH v3] USB: cdc-acm: restore the line coding after a reset-resume
Date: Thu, 3 Dec 2026 23:10:42 +0100 [thread overview]
Message-ID: <2026120333-wriggly-stowaway-0e69@gregkh> (raw)
In-Reply-To: <500fbfc0-f9f3-412c-bcb5-978f341b8eff@suse.com>
On Wed, Dec 02, 2026 at 11:39:54AM +0100, Oliver Neukum wrote:
>
>
> On 01.12.26 17:45, Piotr Kubik wrote:
> > A device that loses power during system suspend comes back at its
> > power-on line coding. With USB persist, the USB core then resets the
> > device and calls acm_reset_resume(), but acm->line still holds the line
> > coding that the driver sent last. acm_tty_set_termios() sends
> > SET_LINE_CODING only when the termios differ from acm->line, so an open
> > with the same settings sends nothing. The port then runs at the wrong
> > rate until the termios change or the device is probed again.
> >
> > Send the cached line coding from acm_reset_resume() of the last
> > interface to resume, which acm->susp_count shows, before acm_resume()
> > restarts the URBs. The USB core calls reset_resume for each interface in
> > the order of the configuration descriptor, so the control interface is
> > not always the last one. Send it with __acm_set_line(), a new variant of
> > acm_set_line() without the autopm reference, because reset_resume also
> > runs in a runtime resume of the device, where usb_autopm_get_interface()
> > would wait for that same resume and never return. Ignore the result, as
> > acm_probe() does, because a device without USB_CDC_CAP_LINE need not
> > support the request.
> >
> > I saw the fault on my workstation while using serial consoles.
> > Claude Code agent (Opus 5.5) traced the cause to the cached
> > acm->line and wrote the first draft of this patch and this commit message.
> > It also wrote and ran the test: a QEMU guest with the adapter passed
> > through, and a USB power cut while the guest was in S3.
> > Three other Claude instances reviewed the patch, the message and the test
> > record. I reviewed the patch and I understand the change.
> >
> > Fixes: a91b0c502285 ("cdc_acm: add reset_resume method")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Piotr Kubik <piotr@kubik.pl>Acked-by: Oliver Neukum <oneukum@suse.com>
>
Can you put your acked-by on a new line please?
prev parent reply other threads:[~2026-12-04 3:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 16:45 Piotr Kubik
2026-12-02 10:39 ` Oliver Neukum
2026-12-03 22:10 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026120333-wriggly-stowaway-0e69@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=francescolavra@interfree.it \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=piotr@kubik.pl \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®