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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 965C2C433F5 for ; Thu, 30 Sep 2021 01:49:15 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 25F2E613CE for ; Thu, 30 Sep 2021 01:49:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 25F2E613CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id DD7A540176; Thu, 30 Sep 2021 01:49:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pDEL7xkBFN7m; Thu, 30 Sep 2021 01:49:14 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4A94E4076A; Thu, 30 Sep 2021 01:49:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 19387C0011; Thu, 30 Sep 2021 01:49:13 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 19719C000D for ; Thu, 30 Sep 2021 01:49:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E8ECA4076A for ; Thu, 30 Sep 2021 01:49:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ObA8f3UcrDfQ for ; Thu, 30 Sep 2021 01:49:10 +0000 (UTC) X-Greylist: delayed 00:06:38 by SQLgrey-1.8.0 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp2.osuosl.org (Postfix) with SMTP id BB91F40176 for ; Thu, 30 Sep 2021 01:49:10 +0000 (UTC) Received: (qmail 448410 invoked by uid 1000); 29 Sep 2021 21:42:29 -0400 Date: Wed, 29 Sep 2021 21:42:29 -0400 From: Alan Stern To: Kuppuswamy Sathyanarayanan Subject: Re: [PATCH v2 1/6] driver core: Move the "authorized" attribute from USB/Thunderbolt to core Message-ID: <20210930014229.GA447956@rowland.harvard.edu> References: <20210930010511.3387967-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210930010511.3387967-2-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210930010511.3387967-2-sathyanarayanan.kuppuswamy@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Jonathan Corbet , Andi Kleen , "Michael S . Tsirkin" , Michael Jamet , Greg Kroah-Hartman , x86@kernel.org, virtualization@lists.linux-foundation.org, Yehezkel Bernat , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org, Andreas Noever , Ingo Molnar , Borislav Petkov , linux-pci@vger.kernel.org, Bjorn Helgaas , Thomas Gleixner , linux-usb@vger.kernel.org, Mika Westerberg , Dan Williams , "Rafael J . Wysocki" X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Wed, Sep 29, 2021 at 06:05:06PM -0700, Kuppuswamy Sathyanarayanan wrote: > Currently bus drivers like "USB" or "Thunderbolt" implement a custom > version of device authorization to selectively authorize the driver > probes. Since there is a common requirement, move the "authorized" > attribute support to the driver core in order to allow it to be used > by other subsystems / buses. > > Similar requirements have been discussed in the PCI [1] community for > PCI bus drivers as well. > > No functional changes are intended. It just converts authorized > attribute from int to bool and moves it to the driver core. There > should be no user-visible change in the location or semantics of > attributes for USB devices. > > Regarding thunderbolt driver, although it declares sw->authorized as > "int" and allows 0,1,2 as valid values for sw->authorized attribute, > but within the driver, in all authorized attribute related checks, > it is treated as bool value. So when converting the authorized > attribute from int to bool value, there should be no functional > changes other than value 2 being not visible to the user. > > [1]: https://lore.kernel.org/all/CACK8Z6E8pjVeC934oFgr=VB3pULx_GyT2NkzAogdRQJ9TKSX9A@mail.gmail.com/ > > Reviewed-by: Dan Williams > Signed-off-by: Kuppuswamy Sathyanarayanan Since you're moving the authorized flag from the USB core to the driver core, the corresponding sysfs attribute functions should be moved as well. Also, you ignored the usb_[de]authorize_interface() functions and their friends. Alan Stern _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization