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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52EC9EB64DC for ; Thu, 20 Jul 2023 13:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TEvXOOIKI76cYZdXJmeguEwK3GIEpxvJGrbBk00kBHw=; b=2PpejhAJhHraJi KsKsVMrk36vtjjRwo9Cca251TKQKgoY9N+JXeWUGybHAQke9PT0L6QqCad7rB+KZVj41v2tW1J6v9 iBsHypUjH31yte/KWPVY644R8c9uqdXyFzLbogNJVokYxjIPx4M0MUbO+MYqrmysuiTMW/lsAtlmx 7nuXv6osAL93rSWIHHuy0tjqMR7UgpjowgjAcqq0I/EjFwzkwJpYhw/gUoB6+HL9jgGHG94t+TG92 8DamZpQL1gSOxfFbLw+OgiElUCA3dr8BcrurJ60ekJiM7kypIZ2ogPufXR6NfD7KKQ6QZL7jz7Qz3 bN05lIzlZRUhrc2CpolQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMU1S-00BHtH-2q; Thu, 20 Jul 2023 13:48:50 +0000 Received: from pidgin.makrotopia.org ([185.142.180.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMU1Q-00BHsX-17 for linux-mtd@lists.infradead.org; Thu, 20 Jul 2023 13:48:49 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qMU0Q-000496-0I; Thu, 20 Jul 2023 13:47:46 +0000 Date: Thu, 20 Jul 2023 14:47:37 +0100 From: Daniel Golle To: Hannes Reinecke 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 , 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 3/6] block: add new genhd flag GENHD_FL_NO_NVMEM Message-ID: References: <96510d925cb0ca1a3a132f8f8affd4bbdafd8fc9.1689802933.git.daniel@makrotopia.org> <0592e021-237d-6d41-7faf-e5b93aefbeea@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0592e021-237d-6d41-7faf-e5b93aefbeea@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230720_064848_390251_8DF40100 X-CRM114-Status: GOOD ( 23.65 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Thu, Jul 20, 2023 at 10:24:18AM +0200, Hannes Reinecke wrote: > On 7/20/23 00:03, Daniel Golle wrote: > > Add new flag to destinguish block devices which should not act as an > > NVMEM provider, such as for example an emulated block device on top of > > an MTD partition which already acts as an NVMEM provider itself. > > > > Signed-off-by: Daniel Golle > > --- > > include/linux/blkdev.h | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > > index 2f5371b8482c0..e853d1815be15 100644 > > --- a/include/linux/blkdev.h > > +++ b/include/linux/blkdev.h > > @@ -80,11 +80,14 @@ struct partition_meta_info { > > * ``GENHD_FL_NO_PART``: partition support is disabled. The kernel will not > > * scan for partitions from add_disk, and users can't add partitions manually. > > * > > + * ``GENHD_FL_NO_NVMEM``: NVMEM emulation is disabled. The kernel will not > > + * emulate an NVMEM device on top of this disk. > > */ > > enum { > > GENHD_FL_REMOVABLE = 1 << 0, > > GENHD_FL_HIDDEN = 1 << 1, > > GENHD_FL_NO_PART = 1 << 2, > > + GENHD_FL_NO_NVMEM = 1 << 3, > > }; > > enum { > Please reverse this flag. Most of the devices will not have an NVMEM > partition, and we shouldn't require each and every driver to tag their > devices. > So please use GENHD_FL_NVMEM and only set this flag on devices which really > have an NVMEM partition. The idea here was to exclude all those devices which already implement an NVMEM provider on a lower layer themselves, such as MTD. In this cases it would be ambigous if the OF node represents the NVMEM device registered by the MTD framework or if blk-nvmem should be used. In all other cases device tree can unambigously indicate whether a block device should serve as NVMEM provider (and right, most of them never will). However, reversing the logic seems fine just as well. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/