Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp835442rwi; Wed, 26 Oct 2022 07:48:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pyJ6s6WMwWHig5jVsn2m7WdFQDtSeGwXKtBEMbAqjNUkI+bYeX2Zekh20A0qUZvZR73hk X-Received: by 2002:aa7:88c9:0:b0:56b:e851:5b65 with SMTP id k9-20020aa788c9000000b0056be8515b65mr14338807pff.74.1666795728148; Wed, 26 Oct 2022 07:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666795728; cv=none; d=google.com; s=arc-20160816; b=urhGVVdNgcYQ4nqUhOfebmdsrRCl3JvtGtmZMVU6c+W3Z+SxCtgCPl+Iux94cMmV0k h6cmwbHSC0vzsJAKKHaH0S5VF5KkRG/A5fSJW82CgJD7F7hRaDXG+2An6MWIOjSbWQTI aMdDPXKSIUANk3b2zUI1ehU+pz0tJJtRuv5AyE40My0x9QmgFPxbc7Y3Tnyea8obRAwu x+LcIBiFqIhNCUyLhhAcUo7bXkQQcRoANrcfumEmNkDDkJiBE6fqAiHuJXjhKeO5qxzZ JTZrcQqMc6980MbkA3wMtO70BgwF/txfxwPpSxS2HW7cnRGvDiIUsrnA/H8/zh4LPq5W PuBg== 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=cFzKJZKrNnFtdOS3TLvoB8fI2j8xs0oMYNfPCDg96Tw=; b=G+qXpk3A/8XyTypw3Sv+kXMPhqfUUPNWs7FErpg0rvAh92Z00JEG2M/x9MVlZjqui7 MQ2Hmtlyrk7K13y7fu+oKURUpax10igfwucdmIbexqZgTq1tQ+5Wd0/vk+Kzzr4krBWB d8kwFbRHNQtfBkTQs0a0J1PkQc53GkiP8Z9pT8GPRs2TN9pS+chzi0YKikpHt40lt0// eE/G2ubTbp4p/G5X1zYfI/WRf6yWFxdE8+qXPEbUYXQ8P5nkpkQNbufjXhMPNqsP2x/r GWCHh4Fy3pXy9MX8xk+b+DL6rYu7nwjxALoxrYmOynHAZUkuBl2UaojGCaQkSGXdA6tr 69Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RuU5wBDi; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il2-20020a17090b164200b0020d5867aab6si3068336pjb.141.2022.10.26.07.48.40; Wed, 26 Oct 2022 07:48:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RuU5wBDi; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S234376AbiJZOiD (ORCPT + 65 others); Wed, 26 Oct 2022 10:38:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234358AbiJZOh4 (ORCPT ); Wed, 26 Oct 2022 10:37:56 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63466BA25B; Wed, 26 Oct 2022 07:37:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id AC0E9CE2295; Wed, 26 Oct 2022 14:37:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7462EC433C1; Wed, 26 Oct 2022 14:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666795072; bh=y2U35Pk+CmD/Ks0JVJ0GmzyJIulw6nH1nLCwcfBn04Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RuU5wBDipXRYa4nCxyKvqv0eTq2JoVlhhjn5FTT7ZmDJrG8uF2LJt1LAf/00IMyuO BG8py7QRzsNGuuIE9EJScbHsBRmNbQCSiQ/YUqthNMOUTnnUj3LTKjUCbj7slPVU5u xaFztWPUG8uKYghyJAWiJyNg+pqleuh0WkzIY9o0= Date: Wed, 26 Oct 2022 16:37:49 +0200 From: Greg Kroah-Hartman To: Matthias Schiffer Cc: Arnd Bergmann , Rob Herring , Krzysztof Kozlowski , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux@ew.tq-group.com Subject: Re: [RFC 1/5] misc: introduce notify-device driver Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Oct 26, 2022 at 03:15:30PM +0200, Matthias Schiffer wrote: > A notify-device is a synchronization facility that allows to query > "readiness" across drivers, without creating a direct dependency between > the driver modules. The notify-device can also be used to trigger deferred > probes. > > Signed-off-by: Matthias Schiffer > --- > drivers/misc/Kconfig | 4 ++ > drivers/misc/Makefile | 1 + > drivers/misc/notify-device.c | 109 ++++++++++++++++++++++++++++++++++ > include/linux/notify-device.h | 33 ++++++++++ > 4 files changed, 147 insertions(+) > create mode 100644 drivers/misc/notify-device.c > create mode 100644 include/linux/notify-device.h > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 358ad56f6524..63559e9f854c 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -496,6 +496,10 @@ config VCPU_STALL_DETECTOR > > If you do not intend to run this kernel as a guest, say N. > > +config NOTIFY_DEVICE > + tristate "Notify device" > + depends on OF > + > source "drivers/misc/c2port/Kconfig" > source "drivers/misc/eeprom/Kconfig" > source "drivers/misc/cb710/Kconfig" > diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile > index ac9b3e757ba1..1e8012112b43 100644 > --- a/drivers/misc/Makefile > +++ b/drivers/misc/Makefile > @@ -62,3 +62,4 @@ obj-$(CONFIG_HI6421V600_IRQ) += hi6421v600-irq.o > obj-$(CONFIG_OPEN_DICE) += open-dice.o > obj-$(CONFIG_GP_PCI1XXXX) += mchp_pci1xxxx/ > obj-$(CONFIG_VCPU_STALL_DETECTOR) += vcpu_stall_detector.o > +obj-$(CONFIG_NOTIFY_DEVICE) += notify-device.o > diff --git a/drivers/misc/notify-device.c b/drivers/misc/notify-device.c > new file mode 100644 > index 000000000000..42e0980394ea > --- /dev/null > +++ b/drivers/misc/notify-device.c > @@ -0,0 +1,109 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +static void notify_device_release(struct device *dev) > +{ > + of_node_put(dev->of_node); > + kfree(dev); > +} > + > +static struct class notify_device_class = { > + .name = "notify-device", > + .owner = THIS_MODULE, > + .dev_release = notify_device_release, > +}; > + > +static struct platform_driver notify_device_driver = { Ick, wait, this is NOT a platform device, nor driver, so it shouldn't be either here. Worst case, it's a virtual device on the virtual bus. But why is this a class at all? Classes are a representation of a type of device that userspace can see, how is this anything that userspace cares about? Doesn't the device link stuff handle all of this type of "when this device is done being probed, now I can" problems? Why is a whole new thing needed? thanks, greg k-h