Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp839155pxt; Thu, 5 Aug 2021 13:01:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwZeu0J2hXArHh9QNi5v16jji9wGEGaPWJAL/iGueCgJXJZxb+nphRjsJHGTUy5JUJ+dzx X-Received: by 2002:a02:8241:: with SMTP id q1mr6237966jag.134.1628193668754; Thu, 05 Aug 2021 13:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628193668; cv=none; d=google.com; s=arc-20160816; b=C8puZXMLIDuXVsXep6P3J35CNhl8U+R7p58UK0zSG3iww4hFZW7mwuRnxKzSEHQJXW vQcu1FHtK+x0R1xaUM9mNCdQmEx5Hwdl3KWBejdrAn31YrsRNbgBPresk0n6teUIV/Nu vm4JxGWASDNqHYB8TOClp6h9BP6xSbSDYTUzxC5RsOWX8e/a+h+P2dEZYgYwOnIVWv6p IYD860WSFZ+6Tb/dqTigckb0jHpj2WcvM+1N/6IRzopD/CBS3j7dDYITv8e6+1UMGgQM pBg5/iM+qpKzNqR/aIbPAPiHZ1+Pb5/PW+mb6YHYItbozoTy04rqXAWdH+0BBi8UyuFb tK3g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KiuI52pfoaDmfzPaJZ6zZYBDgM6SpRcYkOD5WRX6KAI=; b=ghJW3452MuUWEbNXDF0CynszTu08WUNgjdE3uoTLjE9B4UY5f+FuHqWqyj8RbkhEQH p9V7JYzXYrUno9yRGQPiIQzTxqL+XSuGyHT8DDJlMN+thrCU1ALusSs7BpyzYMVXJT8x gDLC024c5O2wbnJAUclQdrNhoCwqCW3bEiMgY4iSS7n92xinxJ6OHCZ1U3BCO9q7/cF2 rPcvLACTYRIaqdDkyYEee8EY/alTvlgxTgq/aLC7kCWcai7+Rv4+73iYYvOR2X+0r2eu 4lvi6xDLwZJ9tXJRz2InQumEMlzFVe4nYGgW4qbR9zRlRDie8pZksMegDD+LquAhKYWj wTAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O0U2Rduf; 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 t16si7141761jaq.36.2021.08.05.13.00.56; Thu, 05 Aug 2021 13:01:08 -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=O0U2Rduf; 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 S240683AbhHERvo (ORCPT + 99 others); Thu, 5 Aug 2021 13:51:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:38226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236297AbhHERvn (ORCPT ); Thu, 5 Aug 2021 13:51:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 176AF610A2; Thu, 5 Aug 2021 17:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628185889; bh=5jNjejyjxB7nwfUqDY9J1juhKh4IHwjC1LQw9Czvn0s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O0U2Rduft6AQmfcB8IFmxBcBpgCDSzI2fZI16xXYHSWXvqNx9IGlG1OrG/WlVZNiF 567k3XoLLUD1Q4ynHes8cLrnUBq1BRCfIsLvrIENZnwcwOURDgr2pnSiVZJDUtutPu vuXOxfVd7Cn2X4fNA9Pw4PWfhO9dY3bB0LY9nKVE= Date: Thu, 5 Aug 2021 19:51:26 +0200 From: Greg Kroah-Hartman To: Andi Kleen Cc: Kuppuswamy Sathyanarayanan , "Rafael J . Wysocki" , Jonathan Corbet , Dan Williams , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 05, 2021 at 06:52:25AM -0700, Andi Kleen wrote: > > > 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") > > This looks like it's controlled by udev?? Have a default per bus, and let > user space override it before setting up the device. It's controlled by whatever you want to use in userspace. usbguard has been handling this logic in userspace for over a decade now just fine. > This doesn't help us handle builtin drivers that initialize before user > space is up. Then have the default setting for your bus be "unauthorized" like we allow for some busses today. > We need something that works for all drivers. Also cannot just use a default > at bootup because some drivers (like virtio or rtc) need to be initialized > in early boot to make the system functional at all. So you need a way to > distinguish these two cases in the pre user space boot. > > That's basically what this patch implements the infrastructure for. It also ignores the existing implementation we already have for this for some busses, please do not do that. > > 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. > > How would such a proposal work for a platform driver that doesn't have a > bus? There is a platform bus, it's just a fake one. The platform bus code does the binding just like any other bus does, why is platform somehow "special"? Except for how it is abused... thanks, greg k-h