Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1083356rdh; Fri, 24 Nov 2023 05:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEO/iK2oUwnWHeF8ZTDr6EOi5+QJaAVA8Ynp3xXd33DkTos235qAHXQ1GIHubU2p1uXOys1 X-Received: by 2002:a05:6830:3b0e:b0:6ce:25b9:d9b5 with SMTP id dk14-20020a0568303b0e00b006ce25b9d9b5mr2772571otb.38.1700831130490; Fri, 24 Nov 2023 05:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700831130; cv=none; d=google.com; s=arc-20160816; b=viEtKhGOEYC3aj7o4kw4Buw79wysXYDQE2KcfXvFypB8Co7oBVZz8utCuDqNB8DMcg CrABJEeQ7Mzgg4DBfKDS8U+YJ3Y7IqLem4fNDoxNg2pxm6UVPVdEQ12cAeJenLbr+CTj uYTJZ25kd2FDcoZi/Ur4eY+1jCVmlprQ+ASnZWRURnJXzXGGx+i2e+TdYRlE/2CEQZ3k xy017ox4f57qhhePta2AghwoSZf7B8puLSuDNnmpLyq8mCCgcV/69aN3Stg16Y6jJkZn RlMv9oD+79fsWpi7uOXt7LXkl3QI5Hz7FpAMZXtAD6RdralyVmsIxM/uRDrN0ChLIhXV qpKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xrl3663wr/aNUNpr7kLsdrH2Fkr1QVQJLgjpmra2+N0=; fh=GI0+66uV5La9hC6NPrBUggSxMI1Tvxm01BaxkqqIAtk=; b=GZi2Bri+YBmmHUv30FSrYkd1P0ywpmlzsqSVcFdMRp/IBwll6NXLopncf/aRCJHdEz 6PgvA393oah8W7a3E9Xs27uImy5SsbdKAtITMnG5hmMadJMxg9ua2M8DCc1h514GKzrt kzht6XGruiUB3bUGSqoIq2t5/YcsMnMqTJRv33+lgBmxAeegqlkeGN/ZNqXBDDhS9XKI KyGQD5hMmbSbBc0JcMFBOlMR9Ly1TpyWcm5H9pa+bfp38e7TzAgmP6zRXe8mwKiHZPKm gVdBnRn+44QMjHuAH4Mm41i1D8B6mo8iydJkxvk1ks05B+XnE2+0t8K3XMiwT5t/T3Ai Jaiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RS9lmVeP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id v24-20020a056830141800b006d253b44428si1235626otp.137.2023.11.24.05.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 05:05:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RS9lmVeP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6E66A80AE562; Fri, 24 Nov 2023 05:05:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345158AbjKXNFM (ORCPT + 99 others); Fri, 24 Nov 2023 08:05:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345152AbjKXNFL (ORCPT ); Fri, 24 Nov 2023 08:05:11 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74F23D71 for ; Fri, 24 Nov 2023 05:05:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CAA9C433C9; Fri, 24 Nov 2023 13:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700831117; bh=gHslPrCptnwdn3oC+vz7EhLUeTjbHXiOmST977Cv03c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RS9lmVePw1mp/uxFPOGJ/9reUlYKEgqjb7V3a6RHa018Q7L8unFQ3pmmCm5sbk/dH 8KPFJSgFxJ2SXqr89yKgvhGyXLnJrr59l2g+0jf+xxIUVE2vbRK5V4th6dbTSbaF/A Nm5NF2WuCoQLimA8lKqZd2j9wGAgmCQxncpRzGvQ= Date: Fri, 24 Nov 2023 13:05:14 +0000 From: Greg Kroah-Hartman To: Vlastimil Babka Cc: Oleksandr Natalenko , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, stable@vger.kernel.org, Mathias Nyman , Philipp Zabel , Basavaraj Natikar , Mario Limonciello , Sasha Levin , Linus Torvalds , Thorsten Leemhuis , Petr Tesarik , Krzysztof Kozlowski , Javier Martinez Canillas , workflows@vger.kernel.org Subject: Re: [REGRESSION] USB ports do not work after suspend/resume cycle with v6.6.2 Message-ID: <2023112436-guru-repent-e1ff@gregkh> References: <5993222.lOV4Wx5bFT@natalenko.name> <2023112421-brisket-starless-c20d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 05:05:27 -0800 (PST) On Fri, Nov 24, 2023 at 01:59:24PM +0100, Vlastimil Babka wrote: > +Cc workflows > > On 11/24/23 12:43, Greg Kroah-Hartman wrote: > > On Thu, Nov 23, 2023 at 07:20:46PM +0100, Oleksandr Natalenko wrote: > >> Hello. > >> > >> Since v6.6.2 kernel release I'm experiencing a regression with regard > >> to USB ports behaviour after a suspend/resume cycle. > >> > >> If a USB port is empty before suspending, after resuming the machine > >> the port doesn't work. After a device insertion there's no reaction in > >> the kernel log whatsoever, although I do see that the device gets > >> powered up physically. If the machine is suspended with a device > >> inserted into the USB port, the port works fine after resume. > >> > >> This is an AMD-based machine with hci version 0x110 reported. As per > >> the changelog between v6.6.1 and v6.6.2, 603 commits were backported > >> into v6.6.2, and one of the commits was as follows: > >> > >> $ git log --oneline v6.6.1..v6.6.2 -- drivers/usb/host/xhci-pci.c > >> 14a51fa544225 xhci: Loosen RPM as default policy to cover for AMD xHC > >> 1.1 > >> > >> It seems that this commit explicitly enables runtime PM specifically > >> for my platform. As per dmesg: > >> > >> v6.6.1: quirks 0x0000000000000410 v6.6.2: quirks 0x0000000200000410 > >> > >> Here, bit 33 gets set, which, as expected, corresponds to: > >> > >> drivers/usb/host/xhci.h 1895:#define XHCI_DEFAULT_PM_RUNTIME_ALLOW > >> BIT_ULL(33) > >> > >> This commit is backported from the upstream commit 4baf12181509, which > >> is one of 16 commits of the following series named "xhci features": > >> > >> https://lore.kernel.org/all/20231019102924.2797346-1-mathias.nyman@linux.intel.com/ > >> > >> It appears that there was another commit in this series, also from > >> Basavaraj (in Cc), a5d6264b638e, which was not picked for v6.6.2, but > >> which stated the following: > >> > >> Use the low-power states of the underlying platform to enable runtime > >> PM. If the platform doesn't support runtime D3, then enabling default > >> RPM will result in the controller malfunctioning, as in the case of > >> hotplug devices not being detected because of a failed interrupt > >> generation. > >> > >> It felt like this was exactly my case. So, I've conducted two tests: > >> > >> 1. Reverted 14a51fa544225 from v6.6.2. With this revert the USB ports > >> started to work fine, just as they did in v6.6.1. 2. Left 14a51fa544225 > >> in place, but also applied upstream a5d6264b638e on top of v6.6.2. With > >> this patch added the USB ports also work after a suspend/resume cycle. > >> > >> This runtime PM enablement did also impact my AX200 Bluetooth device, > >> resulting in long delays before headphones/speaker can connect, but > >> I've solved this with btusb.enable_autosuspend=N. I think this has > >> nothing to do with the original issue, and I'm OK with this workaround > >> unless someone has got a different idea. > >> > >> With that, please consider either reverting 14a51fa544225 from the > >> stable kernel, or applying a5d6264b638e in addition to it. Given the > >> mainline kernel has got both of them, I'm in favour of applying > >> additional commit to the stable kernel. > > > > I've applied this other commit as well to all of the affected branches, > > thanks for letting us know. > > > >> I'm also Cc'ing all the people from our Mastodon discussion where I > >> initially complained about the issue as well as about stable kernel > >> branch stability: > >> > >> https://activitypub.natalenko.name/@oleksandr/statuses/01HFRXBYWMXF9G4KYPE3XHH0S8 > >> > >> I'm not going to expand more on that in this email, especially given > >> Greg indicated he read the conversation, but I'm open to continuing > >> this discussion as I still think that current workflow brings visible > >> issues to ordinary users, and hence some adjustments should be made. > > > > What type of adjustments exactly? Testing on wide ranges of systems is > > pretty hard, and this patch explicitly was set to be backported when it > > hit Linus's tree, > > Are you sure about that "explicitly was set to be backported" part? > According to Documentation/process/stable-kernel-rules.rst: > > > There are three options to submit a change to -stable trees: > > > > 1. Add a 'stable tag' to the description of a patch you then submit for > > mainline inclusion. > > 2. Ask the stable team to pick up a patch already mainlined. > > 3. Submit a patch to the stable team that is equivalent to a change already > > mainlined. > > I don't see a stable tag in 4baf12181509 ("xhci: Loosen RPM as default > policy to cover for AMD xHC 1.1"), was it option 2 or 3 then? > > Do you mean the Fixes: tag? the docs only say that can replace the "# 3.3.x" > part to determine where backporting should stop, but is not itself an > explicit marking for stable backport? No, I mean the "The subsystem maintainer knew this needed to be added to the stable trees so they told the stable maintainer to do so." Now the fact that I am both people at once, and did so in my own head instead of writing myself a public email, might not have made this all that obvious :) thanks, gre gk-h