Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9626474rwp; Thu, 20 Jul 2023 07:35:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlE/Yrt4RYt6X7Hr2KGj1aZbjmGulPTSlPBXG9Y6+sEh4kXtnQkEDyknau1zHDnv4GiZsI3G X-Received: by 2002:a17:907:720b:b0:98e:3cef:68ff with SMTP id dr11-20020a170907720b00b0098e3cef68ffmr5996544ejc.43.1689863709673; Thu, 20 Jul 2023 07:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689863709; cv=none; d=google.com; s=arc-20160816; b=Ss2PjD+YNO/3R3DfJSglTkcCYayST1FFQ+cBzNA+Ib6YoHan3/XhEBOyH5AZqBXILl qpjBQxxQqm3fUcnRl+krjhoOQIlqnEJ99LhH+uIGmI5zKQP+WzFKAi8JV3fOqQeowVPu FRBGP/PChtBDCJsTNzxgA0GSNf5XaiAL4RG6QncRW0yvsohFPn1GDBJZoId0uio7B4/1 o7/J5VaPfdUBHzQ8jG+aaoecFyq4IEzoVQdknarYxP5Un/o2ffR57zBik0LOvuH8sX/k Z0l1LKmIfj44wNLfI6pQNPqFbfuI3CPPG42hv/lhxFObWPsMRSb91YZvE/RqtGzFpniP mUsg== 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=Xu9HCWt48W7ch1JVvw8HmEUSduaUOhR2BsLwZDOs2cM=; fh=vrRrsce+l2loKPGjCqpEoJRrx+6L6my2rhKJs0+rIbQ=; b=VUw34rCkTFYNkz1qGrYUDdld9EswXJZA93jEDs13v8vsJxCiNsvDrNToATN5DSMIYS oBT168Q+IBDr+okkQsJxjZ6lt6uBzaQFjayUDdKPcG4o4XDH/1M9wO11KO9WF/PxqzOo D3Xr0ZbguUqWKl6hhxScJXL9lyGi7CzpwGF/+uLvX3jeIXkH08mKO/AMHzcjNcqHjyP1 ttJ/97pqu64UN0FurVraDwdmV8u0Dy58QFx1gubnK1csN16D2JFDv5H1qoHGsfP9betn NhNBCGCL0YL8gnCOwl8ztzJ3UF2EiKJIYCA9R/wYavrw7Q8z+66ixzrvpnWt0qQuL9dp xR+Q== 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 f16-20020a17090624d000b00992bfd1ffc2si678751ejb.981.2023.07.20.07.34.44; Thu, 20 Jul 2023 07:35:09 -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 S231164AbjGTNsu (ORCPT + 99 others); Thu, 20 Jul 2023 09:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjGTNst (ORCPT ); Thu, 20 Jul 2023 09:48:49 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B4CA2; Thu, 20 Jul 2023 06:48:48 -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 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0592e021-237d-6d41-7faf-e5b93aefbeea@suse.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 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.