From: Hans de Goede <hdegoede@redhat.com>
To: Mathias Nyman <mathias.nyman@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christian Kellner <ckellner@redhat.com>,
linux-usb <linux-usb@vger.kernel.org>,
Mark Pearson <mpearson@lenovo.com>
Subject: XHCI-PCI: existing allowlist for enabling auto-suspend/runtime-pm in the kernel vs a userspace allowlist ?
Date: Thu, 6 Aug 2020 13:55:55 +0200 [thread overview]
Message-ID: <b8b21ba3-0a8a-ff54-5e12-cf8960651086@redhat.com> (raw)
Hi All,
ATM the kernel has a allowlist (coded as a big if) for XHCI-PCI controllers on
which to enable auto-suspend. This seems to consist solely of XHCI controllers
embedded inside Intel Thunderbolt controllers:
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
(pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI))
xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
I noticed this because it seems that the product-id for the TB controller
in the Lenovo T14 gen 1 is missing: 8086:15c1
At the same time we also have a more generic allowlist for enabling
auto-suspend/runtime-pm in userspace:
https://github.com/systemd/systemd/blob/master/hwdb.d/60-autosuspend.hwdb
ATM this only contains USB device ids, but there also is a second hwdb
file, auto-generated baed on info from ChromeOS (to avoid having to
duplicate this info):
https://github.com/systemd/systemd/blob/master/tools/make-autosuspend-rules.py
https://github.com/systemd/systemd/blob/master/tools/chromiumos/gen_autosuspend_rules.py
As you can see this second file already contains a whole bunch of
(mostly Intel vendor) PCI vid:pid pairs and udev will enable
runtime-pm on these based on the auto generated hwdb file.
To me it seems better for future XHCI controllers on which we
want to auto-enable runtime-pm, such as the missing 8086:15c1
model in userspace, together with the allowlist for runtime-pm
on other PCI devices in userspace, rather then to add yet another
quirk for this to to xhci-pci.c code.
The downside would be that this is somewhat inconsistent with
how we have done this before, still I believe that it would
be better / easier to maintain this in userspace (hwdb) in the
future.
So I was wondering what other people think about this?
Regards,
Hans
next reply other threads:[~2020-08-06 17:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-06 11:55 Hans de Goede [this message]
2020-08-06 12:12 ` XHCI-PCI: existing allowlist for enabling auto-suspend/runtime-pm in the kernel vs a userspace allowlist ? Greg Kroah-Hartman
2020-08-06 12:21 ` Hans de Goede
2020-08-06 12:26 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8b21ba3-0a8a-ff54-5e12-cf8960651086@redhat.com \
--to=hdegoede@redhat.com \
--cc=ckellner@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=mpearson@lenovo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).