From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796356149; b=ZS9VZr3Ntk1ai2QHiHKRQo8L2nsTSm3eZlSFEwogNpCsKtJHmyZf5j8D2HoIBbah9IQr Sb/vdDhfBs4icI7VLJKAUFbEfLogyQhAj+nOjOQommokRaQagwxcFnRGImdAz8iV9Eipp wngEDgmlwSe4Z/qGO1YOcenGSYJnqjgJN3PPdTgcx2olOti9VILSkKPVFUMCnXgqURibC tFkUqbXS08/sE58yFT5lkU5Gdu+ayGEeVcYQGBu+DJEEQ9eh4whxj026zzAIUAf3dEvET kFX9vRL90OFyq7IsVt7JPVDHAdH922J227m08Nr3xlVe7Bf1ooPnmhr6C+XYMwPwW0Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796356149; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=ySU0zTHshVt37EEGcAvZW5KyJtlmRAVhtXNjUM6+oIs=; b=yxfSZxrN6c8px9KLVr2brRJugj+E4V7ol/P4IAvMAVUL2E3ojDb4JgJW2AW4KMKsmLOB y0zbmBiC68EmYGCVq4T+sDbs+maEImB+KzKNyw3rJPclpcJppROpCEaQi036Pe3aaSlc9 dBi94W2u8QnCfffUx+RJzsJqXs5xU3hJkmsbyvdd/ND1DTnaUBRTxU4mIBaK1rweWldd8 zWuhpdL1uEa2peXGNbjxxxw/1NQzEjWO5NbXPP1emZSwZo/27v7uziYEgs72mSwIAbX7R iS/mD9CxNDkp+FR6xXDh8qWY2l7kbY71bgGSrz3x558aklsRObknymtii8m3rfOlSLw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="bhxjq/Ox"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54DC6606A322; Fri, 4 Dec 2026 03:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=bhxjq/Ox Received: by smtp.kernel.org (Postfix) with ESMTPSA id 275C81F000C2; Fri, 4 Dec 2026 03:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796356148; bh=ySU0zTHshVt37EEGcAvZW5KyJtlmRAVhtXNjUM6+oIs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=bhxjq/OxiIeYMUCRRSwi/h7pKxnDHAHVs9B4MH4XYMj5bDb63kqzSh0u0Oj8oIOar cUR/fi8Lcqv2VeSuD/G9ubG+udrg0Ivt9Mv9kxriVLY5U9mNBa+F2lzP1ftXekq03k csdtw5RoTar9L9oVvoEjdKBZLlxXjuucKeL+fa4c= Date: Thu, 3 Dec 2026 23:10:42 +0100 From: Greg Kroah-Hartman To: Oliver Neukum Cc: Piotr Kubik , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Lavra , stable@vger.kernel.org Subject: Re: [PATCH v3] USB: cdc-acm: restore the line coding after a reset-resume Message-ID: <2026120333-wriggly-stowaway-0e69@gregkh> References: <20261201164534.340923-1-piotr@kubik.pl> <500fbfc0-f9f3-412c-bcb5-978f341b8eff@suse.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Acked-by: Oliver Neukum > Can you put your acked-by on a new line please?