Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp860043pxu; Mon, 23 Nov 2020 06:05:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkp+22f6LhoeHBYzhGJQL3k4IeTYnxRovp63q4VQFWGm2G0WtdZ5uayMN7wRqCRcNCT1wK X-Received: by 2002:a17:906:b14e:: with SMTP id bt14mr12676128ejb.226.1606140349564; Mon, 23 Nov 2020 06:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606140349; cv=none; d=google.com; s=arc-20160816; b=bEMMnHf2sDUmvkGuDRXL8fQrDFLIDoaUYcQ9Gjwg9W1VZNFzW+TnxQkKAxssEY/cD6 LpBj8N9yTUujJoyF6vhatLpkAPZQjBXGoXVUcfygiTAetMTBdaJ0y5nZXnXii4/7Gu2c fjS/cuy2K3Ivl9+ilyL7fXGC2+O8ApNpbml30zUXIoYObASJ+NQuOj9z7G+JhDids1Wx QlJ1CyVXnsQSCmqSEm74FRov4SEOMHgamYBqQSx60pD+1Vg7fhws+PvAnI4adwM0pj54 hvF6ZFGQDGms5D4Dtwk2+vJbQJDcYVUIapN76jXKWn4wPjpomgNx3jWY4M7wHYF2SAni XdYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=W0Ac40JbJrwxAkwLItN+wLFowis+4SU3qjwygi6DPDA=; b=WDkjMjeatuOCuT9kfDs4nGMXghtyNUx9crCuZv/AgU41f9vOaKKoSZXymYzEMIxLjh YpWXn5ILti4QgCYkXbHafsiK6OGP29Koxfk7KUZ78tbXXXi2cyzxh3Rr0hJ/NQsjD8Nl r9tTZBN5ysu+uSg3roEQ5e5pdOBn7jFuqdtNPfyYWa4xltPTfKIGxjO/211zwjDxn2lL hlbjhOGpopVQ3VBqHDXt/OsXYKZ2LYuHFQc7V/i+42QbGOlmA2mpN8CKoDkpZju87mqm zoKUF2pz9woTdfoqDnfQkIlsSkqlJRZ1GpNr5OBspqRBe8tNiSxU1QB+1/fHTOjBc8rI I5yg== 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 g22si6616203ejk.32.2020.11.23.06.05.18; Mon, 23 Nov 2020 06:05:49 -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 S1729571AbgKWOC3 (ORCPT + 99 others); Mon, 23 Nov 2020 09:02:29 -0500 Received: from mga01.intel.com ([192.55.52.88]:63525 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729204AbgKWOC2 (ORCPT ); Mon, 23 Nov 2020 09:02:28 -0500 IronPort-SDR: spnnYeEfuRWBDUI0LG+hBh9748dyY9Zs2gJNM7YnxnqcRx20TbQegzJHHEXIbtEESMCFqmtWAe OX8PXQLYzRaw== X-IronPort-AV: E=McAfee;i="6000,8403,9813"; a="189883334" X-IronPort-AV: E=Sophos;i="5.78,363,1599548400"; d="scan'208";a="189883334" 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; 23 Nov 2020 06:01:59 -0800 IronPort-SDR: 0nGuZgGGDoe7uPQJ22Okwy+Lh8nH5FrzV4XYEELZXE3Cv1uGGQx5C7lOIdkUmsxvBNMDH8uww7 NOERVTa4lQKg== X-IronPort-AV: E=Sophos;i="5.78,363,1599548400"; d="scan'208";a="478118454" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.163]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 06:01:55 -0800 Received: by lahna (sSMTP sendmail emulation); Mon, 23 Nov 2020 16:01:51 +0200 Date: Mon, 23 Nov 2020 16:01:51 +0200 From: Mika Westerberg To: Hans de Goede Cc: "Limonciello, Mario" , Greg KH , Bastien Nocera , Linux PM , "linux-usb@vger.kernel.org" , Linux Kernel Mailing List , "linux-input@vger.kernel.org" , Mathias Nyman Subject: Re: How to enable auto-suspend by default Message-ID: <20201123140151.GH2495@lahna.fi.intel.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30aa8c96-1809-8c5f-2305-5e39fbeba434@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 02:54:19PM +0100, 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!