From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796208002; b=qglULlsyZCKH6vF9pW95VaoXaOwA5TH7Qb19loXCxJaOxNVRBW01g74z3zIpJSN5oloo +a0L2CfJKSXU/CJYMMsUW4gn5dDR3UchtlrCfxHkLu5GBGza9fKQPzEQSos4eFDtVRhY+ fxRRIUvMi7AKdUF/YqdbLUgqAM4xXHqpT9GpsLzNencT/G/eEMM4Kg2drupzHhHHxaTPh R0XIB89zhnUC0GaGhsCEh/6cX0o+Dxy/a1fe5plLtCN8Vy06kglYcDfKyqhEeVDPYZvfp Wz/ehjVrFOFSh4z811XLzVipoUyPKrQUxSC3QQigqqhRg+nSRTn6DGK+GrkVVKPx+dQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796208002; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted: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=sYS69xceeDuMGQzbtdPN/nlyMSa3PjbYDgQyLS5+n1y/jS9ZrZ8CyqsOEZwmp/aCNHR4 xwReC6h/k9L2jrZj4TKgDotMde4BjiqpjDBNQCgbElmjJbflWNVUIrOA6K8+yLecDmjY1 qipGAdbEQ0oSdBb+p2TMakLwbB4OH3FfSh1oos4/u5mF2KOEnuAim2LZNSn17xlzczLta mUrptwRUqSzimz6F42qZTOPiBtadE62bC6zc/r+FhDU4ywD+eNXORdMcVA1Ask3YMxqq/ KbMmqExs33UOMVLlK4tURkNExGzeXFV7kWGIu3emc9Xo+4HNjJ0Xj5RH1fDro2JqX5Q== 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.50 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 11F8C606A68E for ; Wed, 2 Dec 2026 10:39:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 11F8C606A68E 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-f50.google.com with SMTP id ffacd0b85a97d-491846221ffso11273636f8f.3 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=uWE0xa2wboHkXir7yfeFGfMCkueL8AxikvO5REZ2PnS2EM+yg0V3cSJC4jkTx7OY/x z49ijVXkHt+Br5IpM37ZG/OmOHNUnZNXtG2fbs53nH8yQiiQ2ttqMcd42SrYfX+UGW0P epgqDDTXYNo/I4miK5M6btAs6eAmKLUWSI7SOXBZtgGcNYYs8fmTORRTifyT8JRyBKCG NLrgVTSdM5gyHkOj4QNOkbmmbRxZni+vsvyXbikH70EUTd04JrWcD2XbiB/T+jXCtD8e 6QOBA66cCTvQfRKeJz+zIk5Fai0X1apDXR4L94PHZQkLVhJCVw8bppHZmM5uMt0YHmMZ Euzg== X-Forwarded-Encrypted: i=1; AL+hErFMkjvldd4AjiH0nLtG0Qu2tnZf5uqNAdY5TVdMJpeuC5mr7xDdw9PvwJP4/P15bDIcVIFwz4U4/dZkteg=@vger.kernel.org X-Gm-Message-State: APuU4Z+zvZO+p03sXjhlWcIxPLDtWhB+RAtB4Q6mwoD5/vmJ4v8tQaIQ d8r94pHLp/x0TmyjH83hQv5HAKD4upYwVXi9B4Kjpui57799LbFslMcBIqnwIUvRL8g= X-Gm-Gg: AZFdTZcvtomegqNx9Sc7ptvaowLYMuyA3q0NHf0NhCts0F9bHM0K16cAtbVuAUoL8kU FUfMidGbBqFogRNRT0i44zor6S91vLJQd0D+nc+64+9PUoGuKf5jn0Bv3/YR9XnAEDghhmHtNOd Q8Zgk3H/wvU3O4j4tMLvI8LGhs5x3zdzz/2K+d2Kb8QYUJwGamGf9sIgJOMYBEz0D8BzM+OG7D5 8Wmr3RrqtJo1+X6RBJpC42X/65Pe7X+QA1y5Zj0VE8Ow24IkV71s2W5/JLOdEmrpu/52s1JGaMI x6/IjPTopOSPEIdJ4BNrUPU4M5PxlFiawWvC2jceqSml0rvZ5R7px94AExrriNdlZHL12sg2rdk ga1q7gWhxX4uLw6SEUC7ZoCQsGXCJvEr2PLAGnTasbOBlsv5ouThOdTnJOWS0Mv4Mzm8sqyzcAf KG9uc2KtAtnXyLawhOqVZRUVSDEkLD0pP6V+kGxO2T+7+NY1CdZ6W+wCu8kSorlpJA9kJ7iPaSZ /tOMs9CZhawiM7AwQWrRh1beHhZVatfQjKDRvs5T5vgsBtESECvKi6wacuImWSGj1qqrPMyJ2ns +IlnKJXltUvsQpzNefdp88s3Diss+AmHJDK2oK7nNcYPkOON8M81RV5PtH9H1nC2rGqVT7Y= 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-kernel@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