Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3900341pxb; Tue, 10 Nov 2020 03:04:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJE7KXmC0vr76fe85THey9ATrifECO8iJ44F7W/oS21NQA0ovvkIa47XJE50wkeDB5FUN8 X-Received: by 2002:aa7:d64b:: with SMTP id v11mr20157695edr.253.1605006253428; Tue, 10 Nov 2020 03:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605006253; cv=none; d=google.com; s=arc-20160816; b=F/kAehM/hcj1vCBXgiI40W0naukfOKsbxnGZdbhNd+9rngvnCZPcgIy72iZqij1d91 Tu68mDkzpTzBi03vnVmSK3rFHacyRO5ViMHG2bU33a0Gip3QHnupyylilWcRrQZq3Q9Y 49tTpaOTVxV5ogyqJKKBWG5wSmj4M6IWq5/YmFUSmLopHBaQjXU7mLwIpOlg7R5ZFEGa dKRRQmHRyFukgwyUYsINC6SHuSl9BMAAuwN5Uu1PeBumzJYwb1XScfGh02pZJ8MyN9pn VcCRU7ckajBPIP4G3SP0kxgUrkcSiD4p+eg/66jQ5kBvNH/vtOkNEZO1xFaQf3dlz00V h9Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:cc:to:from:subject:message-id; bh=VjkK1SyV4BP5XQvjimrjeTiwLMj8CMxEa6OM5C53Q1s=; b=C+7uRQMXUg8DFl/QCNtAnd4QOwq1kJoE8RFbHYr5FRS7yuQsZDKrm1rZL89CfASkwr gxi9RguTliENc4ZjpMGOCb6XQx1x04pCT377ggoRn/e3YURRNShCvPOnU9OgOkTFpcUI EIcUbLB9+v1xtwB/cUvqtxZ08/l+9ch+9MxnlJ8CKkU49WMwGN4kt37TU/FqOZobybw2 86pGzepxOOc87E+tsT535cnKtF2Z+ANzF056ijGUIoD/ESvtj7XBV1jF8cuamG4kY95O +UGKgj/axIn/MbFYEvPULGMMrTCpChsqxKCbwEdOs1kVHlKQI1uL88N6UtNVw21EeUPc oUrw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si8969333ejc.451.2020.11.10.03.03.45; Tue, 10 Nov 2020 03:04:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726944AbgKJLB1 (ORCPT + 99 others); Tue, 10 Nov 2020 06:01:27 -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