Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Piotr Kubik <piotr@kubik.pl>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Francesco Lavra <francescolavra@interfree.it>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] USB: cdc-acm: restore the line coding after a reset-resume
Date: Mon, 23 Nov 2026 11:23:12 +0100	[thread overview]
Message-ID: <51674f53-673c-4115-af66-c0fae252fcd3@suse.com> (raw)
In-Reply-To: <20261120171809.1494779-1-piotr@kubik.pl>

On 20.11.26 18:18, Piotr Kubik wrote:

>   /* devices aren't required to support these requests.
> @@ -1739,10 +1749,27 @@ static int acm_resume(struct usb_interface *intf)
>   static int acm_reset_resume(struct usb_interface *intf)
>   {
>   	struct acm *acm = usb_get_intfdata(intf);
> +	bool last;
>   
>   	if (tty_port_initialized(&acm->port))
>   		tty_port_tty_hangup(&acm->port, false);
>   
> +	spin_lock_irq(&acm->write_lock);
> +	last = acm->susp_count == 1;
> +	spin_unlock_irq(&acm->write_lock);
> +
> +	/*
> +	 * 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 from the
> +	 * last interface to resume, before acm_resume() restarts the URBs.
> +	 * In a runtime resume of the device, an autopm reference here would
> +	 * wait for this resume and never return.
> +	 */
> +	if (last)
> +		__acm_ctrl_msg(acm, USB_CDC_REQ_SET_LINE_CODING, 0,
> +			       &acm->line, sizeof(acm->line));

Thank you, I was a bit premature unfortunately. Could you use
the acm_set_line() macro, so that the driver stays consistent
in that regard?

	Regards
		Oliver


      parent reply	other threads:[~2026-11-23 10:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 17:18 [PATCH v2] USB: cdc-acm: restore the line coding after a reset-resume Piotr Kubik
2026-11-20 17:30 ` sashiko-bot
2026-11-23 10:23 ` Oliver Neukum [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=51674f53-673c-4115-af66-c0fae252fcd3@suse.com \
    --to=oneukum@suse.com \
    --cc=francescolavra@interfree.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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