Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1164675pxb; Wed, 29 Sep 2021 19:09:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4AsgwA6HKTHaR0yJiJfvadtKj5bdKXY3Jg4sGX06I7NAI08+Dw9rq2ytfgCvhiMWhxndO X-Received: by 2002:a17:906:154c:: with SMTP id c12mr3992077ejd.76.1632967773657; Wed, 29 Sep 2021 19:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632967773; cv=none; d=google.com; s=arc-20160816; b=E633Zmz0jdkr1iLrRFOOdhjDmFQcEWU5ZPb5XxcQJO2d2ufKBF6MM65PCmrmHGO9kb anm/KIOFCQWciIuozfPIZn1+0KTu2XCF7TYYVoTnNgL7Ydl3b/FfYiTtPCyRgXzIIY1A PtljipQYM1LahiCjHdtWz1pY0anIolEJjY8V78J1pZFHVWV7UtrpcLJV58crPqzQRQno KPZXHEsdDbyVp2lznetBKIjLZZhA89K6G8eV8PX2NxFoxuGx4tr6pwnpqabpooHQk49F FYgLSTC49Mgr5Rr9r6WUH8bTkDCo6mF0rntkXqfluZeszN7RPCmxhGxoxzE4RiyjaTty XAdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=oAlNwbsUmif9YSrTG0hOXY8VITw4Y7KGx/gvlq3/TuA=; b=u0N8MPylzN9Si8JSWFDvo1l05TXtciuRkeZnZdc3exzFDBYC4Uxec70oVAGN8CDng2 NzvLUlvQ9pjGuGEwKd/uxoPyzZuDZ7s6Wb7UlQpOuFrH1tOj3K0rPp/0RE61ATJKKRfl nunW9HUsf4dFcs0cACpDxg+WzF8s4fDI1/LqHG0WVGTu1iv/KsWrimEJcmuNQCahcSyV VnzkJWM+cvUFqDs8TKCRBDr2nmpyS6H4USLkogEMbP2sF3oCruOVxoX7i0j26zds6Uou 2oEODvuaDRRXJeDd++0seJDqoAkvRBzsQThpPQ90K656bnpSaM4j/WfiDnNaO7dhylEs n2zg== 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 o9si2030410ejb.684.2021.09.29.19.09.10; Wed, 29 Sep 2021 19:09:33 -0700 (PDT) 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 S234448AbhI3BoN (ORCPT + 99 others); Wed, 29 Sep 2021 21:44:13 -0400 Received: from netrider.rowland.org ([192.131.102.5]:36479 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S233941AbhI3BoM (ORCPT ); Wed, 29 Sep 2021 21:44:12 -0400 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 Cc: Greg Kroah-Hartman , Borislav Petkov , x86@kernel.org, Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Andreas Noever , "Michael S . Tsirkin" , Michael Jamet , Yehezkel Bernat , "Rafael J . Wysocki" , Mika Westerberg , Jonathan Corbet , Jason Wang , Dan Williams , Andi Kleen , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210930010511.3387967-2-sathyanarayanan.kuppuswamy@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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