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=1796144081; b=bQPfCiF2xMW0MFW42wIAnM8oOI4xjrznrWe9nZm/ypnRg778Yv1cJYS5/Rnft3M5sDl0 rpwu+V9uWE1pTCWjR+znNGVVB/U8g6XcVsMhqH7lnITu9kdaTHj9ycvcHReh2CUl2eIWc eYjsGNFxc3oUnrIeTxcYyaldVXYnjYJ61kabQ2LQ1vgol2tRpIhfvGUrcAhDFuRvvEyal 67aaJ+MuvZRkRr4P5XDJcO7UmHDXx/FXRgBw3KOVHz3ZuhqE6VM/YuE2YENZeNy0y7U7r TzkwiHMNLNeTmzJ5pHNsl9ttbq7AjZwuBxlmQC7FAVo0BPtqIA4SDAuJpkepDKnVvbw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796144081; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=finSuplg/l4UZ4QaQcBvwZh24bgXekW7To/xCd3VbCU=; b=Wwo5QQHDMHIdBpBrubShAxD6xMDpJ9Z6tCW3NT0YNZD+Cu23QIkaCkSFQmA00kLUVMB/ v+Tn7vJNANjb0AlMckECp3rMtxbYVW+rz9HMZnajAUgio5JRmMdD2W/Tk4z2q0WDyMncS xle1AsAHmSiYH4gPyrQXUOrQGk94GYbgd9Su1FcnGieRKCW7+FhFLaE6jx1as7J8Npf2l HbY6nzGmunCoJWDqew2xbzevvf+80xYyTd72w6GbQOH3w5pSt3jV8JVVAtL/yMusj/6BG ETztMKXbZPyttPXncVh8/JsfrzTccjb4yd+q6Sd+lRVeRxjCbGMoppizn6eGmfCTEjg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ezu+QDV7; 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 5F20F606A32E for ; Tue, 1 Dec 2026 16:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ezu+QDV7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4B7D1F0089B; Tue, 1 Dec 2026 16:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796144080; bh=finSuplg/l4UZ4QaQcBvwZh24bgXekW7To/xCd3VbCU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Ezu+QDV7puUlTAPlM7SIXaFA6PuSI4pcW1sIPULwteS/NbjDvYemULrgYWXOjTFrG pK28+rcOc5ETrtQJBBO5C/1hCLNOiufsMFzvxl27JgpHbYlSvTyj5eyxdrGDjVWSVx Zu2r8nqybeWoO/wFSO2S3llrUzIdt1IwMOVlGr3KqHA8C91U+N608PaXuSLkGlWCrt 9SLbH7kdnJImC4YBqQQOzaLVKVQ4b8Yp98/2q3EC8GNLF2C8nLDs2l9+JO9k1pJb7Y QwRli4lqFtFagPe2fzueAqFL/momqIvT6dzKL0s5M6tEjP1sEsRrmGtvgwSl5csUNs JZS69fImegE1g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3] USB: cdc-acm: restore the line coding after a reset-resume Reply-To: sashiko-reviews@lists.linux.dev To: "Piotr Kubik" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261201164534.340923-1-piotr@kubik.pl> References: <20261201164534.340923-1-piotr@kubik.pl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 16:54:40 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > 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. >=20 > 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. >=20 > 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. >=20 > Fixes: a91b0c502285 ("cdc_acm: add reset_resume method") > Cc: stable@vger.kernel.org > Signed-off-by: Piotr Kubik Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201164534.3409= 23-1-piotr@kubik.pl?part=3D1