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 5F142C433FE for ; Fri, 22 Oct 2021 06:47:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33D51610E7 for ; Fri, 22 Oct 2021 06:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230238AbhJVGtT (ORCPT ); Fri, 22 Oct 2021 02:49:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:57752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229609AbhJVGtS (ORCPT ); Fri, 22 Oct 2021 02:49:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 488E560F50; Fri, 22 Oct 2021 06:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634885221; bh=+Fkp4XMTW4DD+TiuV8fRU7EzH5a/UJyx5ELdTnoO+vk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jq3iY2JKlAX0xOntAT8OGpltqeTISuwgz9HM/ViUZxGGBAkGBpWCFtN5QwmUL3Klh pfe6nt3IzzL8gQpJixVJyghPQe8Xb47mIFZpYdwC2qrrFLVuf669y7dnCCFN8AgvoV 4nSyjbrHqJTYIHyauyIpVbelASHdZvypS4/QAP5A= Date: Fri, 22 Oct 2021 08:46:56 +0200 From: Greg Kroah-Hartman To: Zev Weiss Cc: Frank Rowand , Rob Herring , openbmc@lists.ozlabs.org, Jeremy Kerr , Joel Stanley , Andrew Jeffery , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Dave Jiang , Vinod Koul , Kirti Wankhede , Alex Williamson , Cornelia Huck , Saravana Kannan , Konrad Rzeszutek Wilk , Thomas Gleixner , Bhaskar Chowdhury , Jianxiong Gao , Mauro Carvalho Chehab , Rajat Jain , Andy Shevchenko , dmaengine@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH 4/5] driver core: inhibit automatic driver binding on reserved devices Message-ID: References: <20211022020032.26980-1-zev@bewilderbeest.net> <20211022020032.26980-5-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211022020032.26980-5-zev@bewilderbeest.net> Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On Thu, Oct 21, 2021 at 07:00:31PM -0700, Zev Weiss wrote: > Devices whose fwnodes are marked as reserved are instantiated, but > will not have a driver bound to them unless userspace explicitly > requests it by writing to a 'bind' sysfs file. This is to enable > devices that may require special (userspace-mediated) preparation > before a driver can safely probe them. > > Signed-off-by: Zev Weiss > --- > drivers/base/bus.c | 2 +- > drivers/base/dd.c | 13 ++++++++----- > drivers/dma/idxd/compat.c | 3 +-- > drivers/vfio/mdev/mdev_core.c | 2 +- > include/linux/device.h | 14 +++++++++++++- > 5 files changed, 24 insertions(+), 10 deletions(-) Ugh, no, I don't really want to add yet-another-state to the driver core like this. Why are these devices even in the kernel with a driver that wants to bind to them registered if the driver somehow should NOT be bound to it? Shouldn't all of that logic be in the crazy driver itself as that is a very rare and odd thing to do that the driver core should not care about at all. And why does a device need userspace interaction at all? Again, why would the driver not know about this and handle it all directly? thanks, greg k-h 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 D2A56C433F5 for ; Fri, 22 Oct 2021 06:47:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 621AF60EE3 for ; Fri, 22 Oct 2021 06:47:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 621AF60EE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HbFK7673Xz3c7X for ; Fri, 22 Oct 2021 17:47:39 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jq3iY2JK; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jq3iY2JK; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HbFJR55H5z2yQB for ; Fri, 22 Oct 2021 17:47:03 +1100 (AEDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 488E560F50; Fri, 22 Oct 2021 06:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634885221; bh=+Fkp4XMTW4DD+TiuV8fRU7EzH5a/UJyx5ELdTnoO+vk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jq3iY2JKlAX0xOntAT8OGpltqeTISuwgz9HM/ViUZxGGBAkGBpWCFtN5QwmUL3Klh pfe6nt3IzzL8gQpJixVJyghPQe8Xb47mIFZpYdwC2qrrFLVuf669y7dnCCFN8AgvoV 4nSyjbrHqJTYIHyauyIpVbelASHdZvypS4/QAP5A= Date: Fri, 22 Oct 2021 08:46:56 +0200 From: Greg Kroah-Hartman To: Zev Weiss Subject: Re: [PATCH 4/5] driver core: inhibit automatic driver binding on reserved devices Message-ID: References: <20211022020032.26980-1-zev@bewilderbeest.net> <20211022020032.26980-5-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211022020032.26980-5-zev@bewilderbeest.net> X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, "Rafael J. Wysocki" , Kirti Wankhede , Jeremy Kerr , Rajat Jain , Frank Rowand , Jianxiong Gao , Dave Jiang , Saravana Kannan , Mauro Carvalho Chehab , openbmc@lists.ozlabs.org, devicetree@vger.kernel.org, Konrad Rzeszutek Wilk , Alex Williamson , Rob Herring , Bhaskar Chowdhury , Thomas Gleixner , Andy Shevchenko , Andrew Jeffery , Cornelia Huck , linux-kernel@vger.kernel.org, Vinod Koul , dmaengine@vger.kernel.org Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Thu, Oct 21, 2021 at 07:00:31PM -0700, Zev Weiss wrote: > Devices whose fwnodes are marked as reserved are instantiated, but > will not have a driver bound to them unless userspace explicitly > requests it by writing to a 'bind' sysfs file. This is to enable > devices that may require special (userspace-mediated) preparation > before a driver can safely probe them. > > Signed-off-by: Zev Weiss > --- > drivers/base/bus.c | 2 +- > drivers/base/dd.c | 13 ++++++++----- > drivers/dma/idxd/compat.c | 3 +-- > drivers/vfio/mdev/mdev_core.c | 2 +- > include/linux/device.h | 14 +++++++++++++- > 5 files changed, 24 insertions(+), 10 deletions(-) Ugh, no, I don't really want to add yet-another-state to the driver core like this. Why are these devices even in the kernel with a driver that wants to bind to them registered if the driver somehow should NOT be bound to it? Shouldn't all of that logic be in the crazy driver itself as that is a very rare and odd thing to do that the driver core should not care about at all. And why does a device need userspace interaction at all? Again, why would the driver not know about this and handle it all directly? thanks, greg k-h