Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1978653pxu; Tue, 24 Nov 2020 13:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1Kivx8XLmuIyrHdYrnXVxu8XuL3jICzvXiAqDIt+dxGKJxDNcBn+tiwS4flzZw9s6YcnG X-Received: by 2002:a17:906:4ed2:: with SMTP id i18mr396774ejv.195.1606254225024; Tue, 24 Nov 2020 13:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606254225; cv=none; d=google.com; s=arc-20160816; b=PJIN1RheUuQbd8XoIksEu37Prmq3lSWfc/ruKZM3r4oHu/87LaSwtitpqcoAVk3E7r 81J3QNX8zjHp+0cBPmtgijZEVhZ48B9MfmXNplPRXopVwyrE3AvSkL/N7vE/3eJKvKOT lmA9QKZZZSc682jf5T8Cso6VCtD2V9ji0HrIdYFoNPxAA8VkIriAAqV28n6qCey99rYk rFwtQMJ/3PvrsyEzhljVtKJKmRssV/FPctOOkX1aGBtA3i03Acjga8g99ZhTssTNfHtg vQ9EQZ1h3LByWSby8SNdPs9kiWnrcqZLq8g11SFR1IWCyqOENMrWD2DDsOCMbbMGZesU PADQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:ironport-sdr:ironport-sdr; bh=vFYoh9C3g2sNc3fHwP/xvEdFP+NkR77V8YQg5b9mWjc=; b=uV+tQ7k2147gz5WCUDZ80KkaqFshIOiy9E3H22NLNA1DK4RG1/GKwNCQbu8kKQ8X+2 bNZ1dUahCSJmaPOxPL6T7G1czixbhKbz9xbBGyj/95xIqwDHCUp5wtsjMN89oq653tnh 5jAMaoVZhQulg217XsF9CxHmohCKZiOETTmSJEXfD3pOVUulwdrggN5XLKkXjwAN9vbD TmO6vbnE0qZojQ837C3W0iIQORIbHsX1KgbgIeqQHoEyLJlI7qtvD4G2MuPPU/HC1bYz Lva5XCbptom5/CdOUuIzjDKEZ99afTaVppzdIubQK+LhbHZg+gwPQrMiF2JWDtAgWBIJ iO7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh5si90608ejb.488.2020.11.24.13.43.20; Tue, 24 Nov 2020 13:43:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387592AbgKXMfg (ORCPT + 99 others); Tue, 24 Nov 2020 07:35:36 -0500 Received: from mga01.intel.com ([192.55.52.88]:52789 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387530AbgKXMfg (ORCPT ); Tue, 24 Nov 2020 07:35:36 -0500 IronPort-SDR: H53SCl4JPQVVhId37oOeFXqR274E6UhpIl8vzNkvDO4jj/chI7U1HIY4v6FGFTpZ8T9HMrhUDZ 6gIDZOz5zx2Q== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="190060628" X-IronPort-AV: E=Sophos;i="5.78,366,1599548400"; d="scan'208";a="190060628" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2020 04:35:35 -0800 IronPort-SDR: /VW7t1HEueGL6TMTcOaGlcfZ3+047NqtbZMYZsQlPCcv+yS3N8ky8H8smVbj4nMeafmgnj0745 GeBP4bshzFLw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,366,1599548400"; d="scan'208";a="478483431" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.170]) ([10.237.72.170]) by orsmga004.jf.intel.com with ESMTP; 24 Nov 2020 04:35:32 -0800 Subject: Re: How to enable auto-suspend by default To: Hans de Goede , Mika Westerberg Cc: "Limonciello, Mario" , Greg KH , Bastien Nocera , Linux PM , "linux-usb@vger.kernel.org" , Linux Kernel Mailing List , "linux-input@vger.kernel.org" References: <20201110172517.GC2495@lahna.fi.intel.com> <30957f1a-1fe5-5d9a-101b-25f12fb93907@redhat.com> <20201111143143.GV2495@lahna.fi.intel.com> <30aa8c96-1809-8c5f-2305-5e39fbeba434@redhat.com> From: Mathias Nyman Autocrypt: addr=mathias.nyman@linux.intel.com; prefer-encrypt=mutual; keydata= mQINBFMB0ccBEADd+nZnZrFDsIjQtclVz6OsqFOQ6k0nQdveiDNeBuwyFYykkBpaGekoHZ6f lH4ogPZzQ+pzoJEMlRGXc881BIggKMCMH86fYJGfZKWdfpg9O6mqSxyEuvBHKe9eZCBKPvoC L2iwygtO8TcXXSCynvXSeZrOwqAlwnxWNRm4J2ikDck5S5R+Qie0ZLJIfaId1hELofWfuhy+ tOK0plFR0HgVVp8O7zWYT2ewNcgAzQrRbzidA3LNRfkL7jrzyAxDapuejuK8TMrFQT/wW53e uegnXcRJaibJD84RUJt+mJrn5BvZ0MYfyDSc1yHVO+aZcpNr+71yZBQVgVEI/AuEQ0+p9wpt O9Wt4zO2KT/R5lq2lSz1MYMJrtfFRKkqC6PsDSB4lGSgl91XbibK5poxrIouVO2g9Jabg04T MIPpVUlPme3mkYHLZUsboemRQp5/pxV4HTFR0xNBCmsidBICHOYAepCzNmfLhfo1EW2Uf+t4 L8IowAaoURKdgcR2ydUXjhACVE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a355X6r2ROGSRgIIeYjAiSMgGAZMPEVsdvKsYw6BH17hDRzltNyIj5S0dIhb Gjynb3sXforM/GVbr4mnuxTdLXQYlj2EJ4O4f0tkLlADT7podzKSlSuZsLi2D+ohKxtP3U/r 42i8PBnX2oAV0UIkYk7Oel/3hr0+BP666SnTls9RJuoXc7R5XQVsomqXID6GmjwFQR5Wh/RE IJtkiDAsk37cfZ9d1kZ2gCQryTV9lmflSOB6AFZkOLuEVSC5qW8M/s6IGDfYXN12YJaZPptJ fiD/ Message-ID: Date: Tue, 24 Nov 2020 14:37:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <30aa8c96-1809-8c5f-2305-5e39fbeba434@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.11.2020 15.54, Hans de Goede wrote: > Hi, > > On 11/11/20 3:31 PM, Mika Westerberg wrote: >> On Wed, Nov 11, 2020 at 12:27:32PM +0100, Hans de Goede wrote: >>> Hi, >>> >>> On 11/10/20 6:25 PM, Mika Westerberg wrote: >>>> On Tue, Nov 10, 2020 at 04:02:33PM +0000, Limonciello, Mario wrote: >>>>>> >>>>>> On Tue, Nov 10, 2020 at 11:57:07AM +0100, Bastien Nocera wrote: >>>>>>> Hey, >>>>>>> >>>>>>> systemd has been shipping this script to enable auto-suspend on a >>>>>>> number of USB and PCI devices: >>>>>>> >>>>>> https://github.com/systemd/systemd/blob/master/tools/chromiumos/gen_autosuspen >>>>>> d_rules.py >>>>>>> >>>>>>> The problem here is twofold. First, the list of devices is updated from >>>>>>> ChromeOS, and the original list obviously won't be updated by ChromeOS >>>>>>> developers unless a device listed exists in a ChromeBook computer, >>>>>>> which means a number of devices that do support autosuspend aren't >>>>>>> listed. >>>>>>> >>>>>>> The other problem is that this list needs to exist at all, and that it >>>>>>> doesn't seem possible for device driver developers (at various levels >>>>>>> of the stack) to opt-in to auto-suspend when all the variants of the >>>>>>> device (or at least detectable ones) support auto-suspend. >>>>>> >>>>>> A driver can say they support autosuspend today, but I think you are >>>>>> concerned about the devices that are controlled by class-compliant >>>>>> drivers, right? And for those, no, we can't do this in the kernel as >>>>>> there are just too many broken devices out there. >>>>>> >>>>> >>>>> I guess what Bastien is getting at is for newer devices supported by class >>>>> drivers rather than having to store an allowlist in udev rules, can we set >>>>> the allowlist in the kernel instead. Then distributions that either don't >>>>> use systemd or don't regularly update udev rules from systemd can take >>>>> advantage of better defaults on modern hardware. >>>>> >>>>> The one item that stood out to me in that rules file was 8086:a0ed. >>>>> It's listed as "Volteer XHCI", but that same device ID is actually present >>>>> in an XPS 9310 in front of me as well and used by the xhci-pci kernel module. >>>>> >>>>> Given we're effectively ending up with the combination of runtime PM turned >>>>> on by udev rules, do we need something like this for that ID: >>>>> >>>>> https://github.com/torvalds/linux/commit/6a7c533d4a1854f54901a065d8c672e890400d8a >>>>> >>>>> @Mika Westerberg should 8086:a0ed be quirked like the TCSS xHCI too? >>>> >>>> I think this one is the TGL PCH xHCI. The quirk currently for xHCI >>>> controllers that are part of the TCSS (Type-C SubSystem) where it is >>>> important to put all devices into low power mode whenever possible, >>>> otherwise it keeps the whole block on. >>> >>> Note that there are currently some IDs missing from the xHCIs which >>> are part of the TCSS too. At least the id for the xHCI in the thunderbolt >>> controller on the Lenovo T14 gen 1 is missing. I started a discussion >>> about extending the kernel quirk list for this vs switching to hwdb >>> a while a go: >>> >>> https://lore.kernel.org/linux-usb/b8b21ba3-0a8a-ff54-5e12-cf8960651086@redhat.com/ >>> >>> The conclusion back then was to switch to hwdb, but I never got around to this. >> >> The reason I've added these to the xHCI driver is that it works even if >> you are running some really small userspace (like busybox). Also for the >> xHCI in TCSS we know for sure that it fully supports D3cold. >> >> (The one you refer above is actually mistake from my side as I never >> tested Alpine Ridge LP controller which I think this is). > > Ok, so I'll submit a patch adding the 15c1 product-id for the > INTEL_ALPINE_RIDGE_LP_2C_XHCI controller to the list of ids for which we > set the XHCI_DEFAULT_PM_RUNTIME_ALLOW quirk. To fix the much too high > idle-power consumption problem on devices with this Alpine Ridge variant. Thanks > >>>> Typically we haven't done that for PCH side xHCI controllers though, but >>>> I don't see why not if it works that is. Adding Mathias to comment more >>>> on that since he is the xHCI maintainer. >>> >>> If we are also going to enable this for the non TCSS Intel XHCI controllers, >>> maybe just uncondtionally enable it for all Intel XHCI controllers, or >>> if necessary do a deny-list for some older models and enable it for anything >>> not on the deny-list (so all newer models). That should avoid the game of >>> whack-a-mole which we will have with this otherwise. >> >> This is really up to Mathias to decide. I'm fine either way :) > > Ok, Matthias what do you think about this? I don't think we are ready to enable runtime pm as default for all Intel xHCI controllers. The risk of xHCI not waking up when user plugs a mouse/keyboard, making the system unusable just seems too high compared to the powersaving benefit. The powersaving benefit from autosuspending the TCSS xHCI is a lot better, and we, (Mika mostly) has been able to verify they work. So I propose we for now continue adding TCSS xHCI controllers to the allowlist in kernel. For others I think a userspace allow/denylist makes sense. Long term goal would be default allow for all, with short denylist in kernel. Thanks Mathias