Received: by 2002:ac8:6d01:0:b0:423:7e07:f8e4 with SMTP id o1csp6906912qtt; Mon, 18 Dec 2023 09:57:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjQrVeSzwO1opyA02LpSg/1BdUFQP3Ne7rxoASuz0R3i4ilnyNaqB31omeuRdHfJHYp79e X-Received: by 2002:a05:620a:2a10:b0:77f:550:c97d with SMTP id o16-20020a05620a2a1000b0077f0550c97dmr21232267qkp.81.1702922239542; Mon, 18 Dec 2023 09:57:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702922239; cv=none; d=google.com; s=arc-20160816; b=p6N3dIAprZvrNvonGANCtXDJtIbJ/+sNxS/aYddkoZQPmXpZ61Y77DznB8diYUZ8tl 8qNsMl6eNaZa/mmIPMY7I51p2VumBbRA3Oo1/E1Iz2aFv15j4lB0FfcrbtGHz8v3sP18 RVdgieuGfPv3TOSH5kZhC2ROJpkR0tANCgc3GtWdEOJMC7rBvWz95i8pmkw+DaRbqckb jb72+bVluxwmX/bTv0xhIqRUsOIg1sTEkVReEntm2HLgPX/VBN//J8zLzvDRnZcUm08D n6oIbpKkU8pAQrF6Q4OjKVXxH6L/kSPIGJIrJKaLsYakTA+KjLfOaTjxhrdaaG0xJBe3 6uJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=hvU6gzfTs9lCogdn/NpLP0q62oK4/JEeiS3XhHZHgsE=; fh=W1nFwMN39XjFu6D0zhUTBkX26nwc9WS+/2BvXLLPEC4=; b=O+YZWD7V63WsqbrSEBfjLXBulS2kh2gMk5UL/Cq22qY7ENQEloB6GYVo2yq1T3I6XC nKfEmwB0Yb2L2UycLwSAZc7PdSFiVRO77CT4U9FK2Mk83lDj2UkNT9kh79xcjy1+P4rO l/zY2aSZvJ/lsB6XtS7qjTcAn3gU32N7EUc0JtbtNl/3BGR7Cg23yAvKYA6eJD5oxAz6 D0T3DWf+9Zvl2d4VoJlIrMY73EEmgDU0i4Si7Jf98eEvGWv1AytJGZQHxW3yH7t/EP8f xWNkki1p1nmxquwsByW/wKVTNvGmWVASNirx6FBEFSBXeq0EBAJsSoSpw2YCJ6obAYEz hirQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bk35-20020a05620a1a2300b0076810d8f04esi26889550qkb.266.2023.12.18.09.57.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:57:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 367DC1C21841 for ; Mon, 18 Dec 2023 17:57:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AE995D733; Mon, 18 Dec 2023 17:57:10 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id F2C524FF6C for ; Mon, 18 Dec 2023 17:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 385326 invoked by uid 1000); 18 Dec 2023 12:57:01 -0500 Date: Mon, 18 Dec 2023 12:57:00 -0500 From: Alan Stern To: Yinghua Yang Yang Cc: Greg KH , zachary.zuzzio@motorolasolutions.com, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Oliver Neukum , Lukas Bulwahn , Wentong Wu , Sakari Ailus , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: misc: Add driver for Motorola Solutions security accessories Message-ID: References: <20231215211218.2313996-1-Yinghua.Yang@motorolasolutions.com> <26c70a69-f18f-4c82-a520-7943be0e1961@rowland.harvard.edu> <2023121712-gigabyte-oppressed-b8f4@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Dec 17, 2023 at 09:56:34PM -0600, Yinghua Yang Yang wrote: > Is there a way to set the auto suspend mode for a usb device without root > permission? I think this is a general question for many usb devices. > According to the Linux Kernel document > https://www.kernel.org/doc/Documentation/usb/power-management.txt, by > default the kernel disables autosuspend for all devices. So there are many > usb devices that support autosuspend but by default autosuspend is > disabled. In order to support autosuspend on those devices, are the only > solutions 1) obtain root permission and write ../power/control file using a > script It doesn't have to be a script; any sort of program can do it. A power-management daemon such as PowerTOP, for example. > 2) work with the hardware vendor on a driver/kernel to write the > autosuspend flag? That would be kind of silly. After all, if the vendor is willing to work with you on a kernel driver, they certainly ought to be willing to work with you on installing a power-management userspace program. And installing a program should be much easier than getting a new driver into the kernel. But to answer your question -- Yes, the only ways to modify the autosuspend settings are from userspace or from within the kernel. Alan Stern