Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796207999; b=tBuvZJtPglaHYth3ebvLppvzoOoVHAcDzCmKZ1HjYtTtMf5M8x+ers4qm+mcsVX2eR0v TXk0kY64qmPlSmN5O2tHdA3srW5P0RtDOGjPk4BfeDsbtLi8wqzHNXb9bVZGDfuuBxarb /p/4DPsga6vY+GSUIbkoyRlh4l6ty+YbOtv8T9CFDLWSqS8seatrCBMrfryLEsIFnlsCx tVeXKtm750/FBEl5mPuHpa5hlQi1qy98ge0H/SjjH2f2xfjjI+sdcz9hcqiLvhyAo8fOZ OdCqRaI/Hh7Fg2WPFCki8Mdz1bPyi3JPY4g3T7NmuxKowlqasvM9IM4FDPh6+ouY7Ww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796207999; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=3yA2EZIGDPuzQxIGSh1xe9cTZr059OR0a8y2yx4h4tU=; b=LIK5YEv7nPhLgu1pXiWJibRhDytLQHA137jVXU9IyIdj9/Di1Jk+JXWiiQLqpP570YSR lSUZz94wA07cuSdn3kTjUTShbex7G2QEO/yNVWdG5vUaMthl8BJNn2XPkRwjDAZynXGv2 gGfXkuH5LtO8neqTHTtzQZeNOGkVEX+/y2lFVW8Q5IBBWJDxxLxaSfkns+JfDzWEnTIDY DHAf9K9xhWnEsCV+BkKxKZXw9koTvXARGDvetD6HANHCVLwm5ekljMNwxI0/nAuI1xc/D b5/53POdxaXmV+viWNkZjHkuAag37QqyWklFV4R+maBM9o4Rxsru0n0RoffIdj1kwEQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=gozJz7os; arc=none smtp.remote-ip=209.85.221.43 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 052F7606A68B for ; Wed, 2 Dec 2026 10:39:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 052F7606A68B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=gozJz7os Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-492f0a1b685so9286893f8f.0 for ; Wed, 02 Dec 2026 02:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1796207996; x=1796812796; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3yA2EZIGDPuzQxIGSh1xe9cTZr059OR0a8y2yx4h4tU=; b=gozJz7osCptnT+V2eU747Kc0nbWDuADfYsfnX4hmq1OihyJ0NhRoRB6kP3cuyKT3eK QBm+/YsDp9g0/b5RywPzeIN/FXUTsIw0SJhNhbHdY8yCla4smI+U/yC947eJSaSOl5qW F7nDHWVzbVfOIre1ZN+GYVAzZ7g5JRm0ONEmRqR6VAFoKkqkGjJPsf6uhQAhApFpov3H MKNP/dXdNNtCB2u8wybhziEfosQHtN3u0EFUqmQN06T4hfDIgIuVA2WbE9moi4UtF/K1 Vq6BhUPJdIxiwFroZi8RTWnYBPMVuTjpcjVyxRLsUR5bq3haoTJDzUgR9g8ZTk9nGFgK jLKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796207996; x=1796812796; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3yA2EZIGDPuzQxIGSh1xe9cTZr059OR0a8y2yx4h4tU=; b=vKu5QYRIprVfB/R8J3fBMoIGBpEiMra79gJrFfd2OjHMqczwZxeMZGt+kvyhsgFr2+ pJN4bUgIapo21oFC2/rS0+1wiZIdnqPBw0NJty6hqaAWGPEf2b9VOo91utEaUn9EZXhS Kp8700Bha/FLeOS+rSbm9VADLh6taAC0K1RjB2jz3WF11jH6lKXozo+9CrRjtFvE50HE +HFazFE5zN1jfbthXZXTXqf/rIt0LqtQzupFKBSMPTuu7lc/Y3jJhyBGZ0fHSgGb2N40 eEKNGaHps/tZDSVVubCSIr/zXYGjuOFQy6Gvqsy+DMcJP4hzQu5MFyQJIe0ewHqkNCSB VP7w== X-Gm-Message-State: APuU4Z8Lv8H9SSNqGLGbkoLL/V//fRlzohEntzelPQlIWEMca5PVlPYc qoxUHUeaFQ7wBnz7ipKEMQZr14LpJKammWQwes6XxjhgHwGfK4H/PNz93I4EUN86BrXdL2tbnoB 1H3vw X-Gm-Gg: AZFdTZdBcFOW58jeND5NW2TMtuLapoJiKdlPNubwZMvuUf1XPBM551M7YaZLMxqdjKT 9ocDUWP1dgbaiNoglZi01YQn/TEi+11tW7pui8r89citsNBTH2Jo73h7tLHR4wLeJy2VoEyxvoa 64xfJ0olViDsvhEepavvOxLtMyiDQuQkQMtIIRMHXIRVLGzLgb3o04YtwwReALJnDvl0hwoBaBF z4CkHU2Oh4elOJv9J1y4/iCCsPLguaWkrJCylqyIiW/QleuqnEfXnKtsxIVgjWD2SVUMqWkvj2b UcSZj0ImeNH8qw34LF0LR6VUIaIgVixYTu+JlBdB0j+Eo0ayBpPt2cQIoy0Gp2YFRxAIQtISU/e PjfedH/o2fc+HuCoiLRZi3PZmzcQoxv7wTUXYw7hA7YD8fJqHvAG3QeQnh/oNarSwUI+onER9uv wD/Hw+tUhae9c4CT6ShCnMcoJP2J7bwYNQ2uyVoo8OT6WVtZ9lNZy66VOSAudgTmQPwvUMaepou W3t1+wMgDpZPZG0jBaT4u8IVK/HIPujgpSyMTap1gOy4pF0lu0v3mSygHgRPScBd9knDIAn5CWJ J6YhRhqgffBi3V/zf3GD+tBr4aJDxxiGxAGeXfytdMlQ0cybCOd1ePaSGmb7zT2EDEy5ZLY= X-Received: by 2002:a5d:584f:0:b0:4b9:8ac3:f5fa with SMTP id ffacd0b85a97d-4b98ac3f6d5mr46354431f8f.48.1796207996524; Wed, 02 Dec 2026 02:39:56 -0800 (PST) Received: from ?IPV6:2a02:3033:27e:6449:f0e2:6233:74e1:8263? ([2a02:3033:27e:6449:f0e2:6233:74e1:8263]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6bb989eesm75941695f8f.50.2026.12.02.02.39.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 02:39:56 -0800 (PST) Message-ID: <500fbfc0-f9f3-412c-bcb5-978f341b8eff@suse.com> Date: Wed, 2 Dec 2026 11:39:54 +0100 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] USB: cdc-acm: restore the line coding after a reset-resume To: Piotr Kubik , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Lavra , stable@vger.kernel.org References: <20261201164534.340923-1-piotr@kubik.pl> Content-Language: en-US From: Oliver Neukum In-Reply-To: <20261201164534.340923-1-piotr@kubik.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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