Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10727598rwp; Fri, 21 Jul 2023 04:10:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlHIPdJ9mckvLtdrblBsk4/JGZSFbnzNUlfs3hkTVTEMkFSnTCrNrYBEvdYiwaHby8sFGQZt X-Received: by 2002:a17:906:5d:b0:977:eed1:453c with SMTP id 29-20020a170906005d00b00977eed1453cmr1410398ejg.73.1689937812907; Fri, 21 Jul 2023 04:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689937812; cv=none; d=google.com; s=arc-20160816; b=DftTrkQKKP0fJbYuJ5PGdnt7LFId6oB+eUXakeXN43WrrNogVk1lIIkT7aef5fZ8pN kqIr72iixhB+Sb67D5en8XAXltDEvic0sQMRXsTHngCGRMpusAzXhjYXwvaQOKEAg4Oc yIF0x+dkcLEOZz+HwsA9EDfcAmdQXUBAea1OI7EJtdbjD1ahMIUg1cHdD6jostiXkpvm 93vDdTbbpl5W962kkg+8wV+kvMn8VL+nJcpGft4IhK245CuoVblma1RMlyiIrRfHGfDC xMmfpD4v7EywGEdKMGBY1BtNvLlU62hq1EyDJcFPP1mYwj63tQN1TuT/gCeSgFHwe6pA FBMg== 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; bh=C8dE2GetF4lPf5cDYHR1vVjNp6FbQmGdFsv18z7q6xw=; fh=qfO5LNPXeE+qNW4zKcERgQW8DlUaFgo6OgOhlWYyNkk=; b=dadrasTiWK/VmpJvkLRb//49Q+pGPWG+4TCqAHN61GnzgiyinqNKQxq1AEbl/WUQeV PZ8R+H6XKw6HuYd1C8jyC7G0b7/YB3OkAs925mjlSMuKhdDO8qhSaCcv7UFpsytlqdfh V3DYXq8ELGkY1t+eM2D7yn51WWfmabIZUnV2OvFrsLeIXgRHukpAPnOfQP+Kzv0cMpFM Ed1k0puU6ukui4D0upgCD6nIQOhFUImYF2opEEMZmjF0Elu1xFX5i/252emeG3J2pmBJ MckPk0wDHNjRdRNI0myasr+thUQlf0AL6nbyy88rB9dDU7nWVklhvQZqhnlTMiOzqdL4 0DYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ov28-20020a170906fc1c00b0098902d18096si2129299ejb.244.2023.07.21.04.09.34; Fri, 21 Jul 2023 04:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229655AbjGUKmA (ORCPT + 99 others); Fri, 21 Jul 2023 06:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbjGUKl5 (ORCPT ); Fri, 21 Jul 2023 06:41:57 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D314A1710; Fri, 21 Jul 2023 03:41:55 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qMnZF-0001IB-0Q; Fri, 21 Jul 2023 10:41:01 +0000 Date: Fri, 21 Jul 2023 11:40:51 +0100 From: Daniel Golle To: Christoph Hellwig Cc: Jens Axboe , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dave Chinner , Matthew Wilcox , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Jan Kara , Damien Le Moal , Ming Lei , Min Li , Christian Loehle , Adrian Hunter , Hannes Reinecke , Jack Wang , Florian Fainelli , Yeqi Fu , Avri Altman , Hans de Goede , Ye Bin , Greg Kroah-Hartman , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org Subject: Re: [RFC PATCH 6/6] block: implement NVMEM provider 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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Thu, Jul 20, 2023 at 11:31:06PM -0700, Christoph Hellwig wrote: > On Thu, Jul 20, 2023 at 05:02:32PM +0100, Daniel Golle wrote: > > On Thu, Jul 20, 2023 at 12:04:43AM -0700, Christoph Hellwig wrote: > > > The layering here is exactly the wrong way around. This block device > > > as nvmem provide has not business sitting in the block layer and being > > > keyed ff the gendisk registration. Instead you should create a new > > > nvmem backed that opens the block device as needed if it fits your > > > OF description without any changes to the core block layer. > > > > > > > Ok. I will use a class_interface instead. > > I'm not sure a class_interface makes much sense here. Why does the > block layer even need to know about you using a device a nvmem provider? It doesn't. But it has to notify the nvmem providing driver about the addition of new block devices. This is what I'm using class_interface for, simply to hook into .add_dev of the block_class. > As far as I can tell your provider should layer entirely above the > block layer and not have to be integrated with it. My approach using class_interface doesn't require any changes to be made to existing block code. However, it does use block_class. If you see any other good option to implement matching off and usage of block devices by in-kernel users, please let me know.