Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp838740pxt; Thu, 5 Aug 2021 13:00:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7wV0kKGUw2kNFlP8XgyojpEe17j4LTACD2SsAlTBWQ5GY0mkxQQVDWiYz/f1Mzc26Ybl2 X-Received: by 2002:a05:6638:164c:: with SMTP id a12mr1885216jat.49.1628193633303; Thu, 05 Aug 2021 13:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628193633; cv=none; d=google.com; s=arc-20160816; b=YDps6P7B6y25yDdtMetz2PXj7kyVeDVE2c0CiysH20pOoBcMGLrIyGqxoQI3uuN9jc CPZm85fjUV521CpOeDMglYUYncQIiF/ste/a5HC5FTJLbuSUIBU5xczatD2iZ5ryJAzz AwH0EwciD/3yUMKPm57vPGKCXR+FrilQPROYT8+hcac4q75JGQHO79iNoZnP6EQTuGAZ 2tK6slf3MBDKbguFPVw46T4Zjrl7ZF3dPKsFVOrbjSoEFx0WoTR3yPw+pL+8c9y6klCp MaqkookBQ6W86xlS5+Fzv9tIEZQ5NPNy/6Z02IuY+v+XVomr6o62qUF6Q02rTu0lLMqg zLTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zSwWf+Cav6PY8NSaMNAR3REvC7HP9drM81t+ljghQOk=; b=y2Ukk9+BA/eYRmw5BKhWY/4oOzzT8GPAB89qpzx5yRHk744dlEN/dr3db+wVZFCjdp l6xnUdBUXVfg7aFVcvSMlgqr0N6pm9Wt/RJsKNroiRvHy3+tfOReKGc2u7GoeE+QhHoB D/k4Hbcv+OAjfWl9z0Dg8Dhm3Z1aTv6QsgxwjJkQslL6gn/6a5f4ZEVM/S4IcyP/vmou S59epPDyupxL1nx9zahHkXZrj44WV61wv+2+A/xM5E7hYpvKHo78sCVIUdIIx1iU1Caa Lj9h/+Y5OWQY2dtE6qQplUlTO4xhzNobDgIXjg6W0cm5VJ4R6dUjndwzR/4ltQQ3dzYs 51Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LSfSwq7M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si6155498ilq.32.2021.08.05.13.00.20; Thu, 05 Aug 2021 13:00: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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LSfSwq7M; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240502AbhHERtr (ORCPT + 99 others); Thu, 5 Aug 2021 13:49:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:37084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236276AbhHERtq (ORCPT ); Thu, 5 Aug 2021 13:49:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B17B4610A2; Thu, 5 Aug 2021 17:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628185772; bh=B6IL9Cpv/JUtI1XkONksmlrwilPPgHrXazVlYgLgEhY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LSfSwq7M7P7fkLYbRF2/4z3uyTAgo6LxrlojcSuwN1yV3P1ib9D/HWt97m7r+tSn0 p9WuCndm9MKuMXgtUzaJc25kiWO/b52uRNOa8QQaAvXWW9oGXDKCUoitxNhPQeJLZv +wIVf+DpV8FqZHLbMSf48iRGi7/DqYHa858ybh1Q= Date: Thu, 5 Aug 2021 19:49:30 +0200 From: Greg Kroah-Hartman To: Dan Williams Cc: Andi Kleen , Kuppuswamy Sathyanarayanan , "Rafael J . Wysocki" , Jonathan Corbet , Kuppuswamy Sathyanarayanan , Linux Kernel Mailing List , Linux Doc Mailing List Subject: Re: [PATCH v1] driver: base: Add driver filter support Message-ID: References: <20210804174322.2898409-1-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 05, 2021 at 09:37:28AM -0700, Dan Williams wrote: > On Thu, Aug 5, 2021 at 12:58 AM Greg Kroah-Hartman > wrote: > > > > On Thu, Aug 05, 2021 at 09:55:33AM +0200, Greg Kroah-Hartman wrote: > > > On Thu, Aug 05, 2021 at 09:49:29AM +0200, Greg Kroah-Hartman wrote: > > > > On Wed, Aug 04, 2021 at 12:50:24PM -0700, Andi Kleen wrote: > > > > > > And what's wrong with the current method of removing drivers from > > > > > > devices that you do not want them to be bound to? We offer that support > > > > > > for all busses now that want to do it, what driver types are you needing > > > > > > to "control" here that does not take advantage of the existing > > > > > > infrastructure that we currently have for this type of thing? > > > > > > > > > > I'm not sure what mechanism you're referring to here, but in general don't > > > > > want the drivers to initialize at all because they might get exploited in > > > > > any code that they execute. > > > > > > > > That is exactly the mechanism we have today in the kernel for all busses > > > > if they wish to take advantage of it. We have had this for all USB > > > > drivers for well over a decade now, this is not a new feature. Please > > > > use that instead. > > > > > > Hm, wait, maybe that didn't get merged yet, let me dig... > > > > > > > Ok, my fault, I was thinking of the generic "removable" support that > > recently got added. > > > > Both thunderbolt and USB have the idea of "authorized" devices, that is > > the logic that should be made generic and available for all busses to > > use, by moving it to the driver core, just like the "removable" logic > > got moved to the driver core recently (see 70f400d4d957 ("driver core: > > Move the "removable" attribute from USB to core") > > > > Please use that type of interface, as we already have userspace tools > > using it, and expand it for all busses in the system to use if they > > want. Otherwise with this proposal you will end up with multiple ways > > to control the same bus type with different types of "filtering", > > ensuring a mess. > > I overlooked the "authorized" attribute in usb and thunderbolt. The > collision problem makes sense. Are you open to a core "authorized" > attribute that buses like usb and thunderbolt would override in favor > of their local implementation? I.e. similar to suppress_bind_attrs: What about doing it the other way around and making it generic like was done for the "removable" attribute? That way the logic from both thunderbolt and USB moves into the driver core as they really should be shared. See the above git commit as an example of what I mean. thanks, greg k-h