From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D729C388F7 for ; Tue, 10 Nov 2020 11:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0D072054F for ; Tue, 10 Nov 2020 11:01:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729183AbgKJLB2 (ORCPT ); Tue, 10 Nov 2020 06:01:28 -0500 Received: from mslow2.mail.gandi.net ([217.70.178.242]:46164 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbgKJLB0 (ORCPT ); Tue, 10 Nov 2020 06:01:26 -0500 Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 0EFFE3B63DD; Tue, 10 Nov 2020 10:57:32 +0000 (UTC) X-Originating-IP: 82.255.60.242 Received: from [192.168.0.28] (lns-bzn-39-82-255-60-242.adsl.proxad.net [82.255.60.242]) (Authenticated sender: hadess@hadess.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6DCC2C0004; Tue, 10 Nov 2020 10:57:08 +0000 (UTC) Message-ID: Subject: How to enable auto-suspend by default From: Bastien Nocera To: Linux PM , linux-usb@vger.kernel.org, Linux Kernel Mailing List , "linux-input@vger.kernel.org" Cc: Hans de Goede , Mario Limonciello Date: Tue, 10 Nov 2020 11:57:07 +0100 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1 (3.38.1-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_autosuspend_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. So the question is: how can we make it easier for device drivers to implicitly allow autosuspend *unless they opt-out*, especially for frameworks where the device's transport layer isn't directly available (eg. HID devices)? If that can't be done in the kernel drivers directly, would it be possible for the kernel to ship with a somewhat canonical list that systemd (or its replacement on other "Linuxes") could use to generate those user-space quirks? Ideally, for example, all new "iwlwifi" or all tested "iwlwifi" devices should have autosuspend enabled by the developers adding support for them, as in the script above, rather than downstreams (systemd upstream included) having to chase new PCI IDs. Cheers