Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1316079lqp; Fri, 22 Mar 2024 11:08:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDgwm8c4FethexbCbE7XTR8UNLFJjRhad5x9X6aR5HnCguQ2ka0sZQ4Y58O3uYHZhJQGxAiEHvp/CHWdkqUD0w62ng92Np4U7KXqhSXg== X-Google-Smtp-Source: AGHT+IF1pZb0xyRWeFC5ZX3gGBGjkEM7lQWuxSJC5Yy9BSGvp7nfMBhJQNGW5MHAHwRtbpJHipHC X-Received: by 2002:a05:6214:27ce:b0:690:d247:8a03 with SMTP id ge14-20020a05621427ce00b00690d2478a03mr113892qvb.1.1711130898018; Fri, 22 Mar 2024 11:08:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711130898; cv=pass; d=google.com; s=arc-20160816; b=ryrxI/2jmnkyWVmDCsHMUzcn7MzD95IfCiyHsPCrcjr1aMF8AxtR6fWSOnrOX6s1Sg NmhVSx63dPeoHghOzF6Ej53mEmYVQmiGLyz+SVza1LwPl27tt/+pvMF1goHIyCup6Uj7 zIIDZBj/DW/RtUZkA2tEg2bbfiZekdcmI+/9adwza+Y/l8cEAHZCH8Fg5RzisWzBwxtU bFhEKxiHlisQpnIfaC5OyXRNu4fUqbzYmLaunGCGGmiIhj9XuvT9xlu4iyJT9UO04ppE vU6nKQFbaw4i+fEyL2DmcdVBKkD/fwJLmyZSSwsbabbExEdL/o/iO+EXUkS9aArhriqx quvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=2Fb6/Yr0qF7T/ZXBwDVbGljourPARg5lAZE79kV93cw=; fh=4L2f+/6l+KWbqDOAQvrgBkPYw7HmnsyObzFPI1/hw9Y=; b=VIJO4Sd8P4ix7LDu0nEw80w6lFfcXw0Nym89StH7S2Ef41F05aJR7YvHPKd36j7Gdl XdKNEcxcY6Z+FPGO6CLpB7AV8xkcpA0jnj1lGgZaqKvQ0FMi/6iaK841a+QZYcGFm8Nh 1ifDAGa5dgUuuAK5RsJbAHdOVbgYiKC/rAJ3F9u3QWHQirM85TOlb6rn1OBV49AkDJC6 N/o5lb5WDGpr4GB0anpGsD+WK7OOgxbfOA5FQe8PIfNS+2ll9ljHl+skW79dHNbYNui9 PBc8R4Ygnc7z2H1LNc26U49xBuo7UwWTO/k6YLQmMACSCfmQUYoOtLTeePxS7ljekz8O ctCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-111916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111916-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fq12-20020a056214258c00b00690b07d1fe6si2583341qvb.282.2024.03.22.11.08.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 11:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-111916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111916-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B9D471C212AB for ; Fri, 22 Mar 2024 18:08:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D1DA626AF; Fri, 22 Mar 2024 18:08:09 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C88255A0EE; Fri, 22 Mar 2024 18:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711130888; cv=none; b=bph+S9D8eZMwMvVY6bA1JnCHAUUtOPszp/HAu85TGTr4zuc7vXhqbfnjv4/rUjy+WlbfGtRdbAmQI+lNsrVcR4L5kNKaPkSs/Xa/PGLxr6hgFkUtu0XZD/ZsdPtaKj/05eYbJ/0ujSCDFnHa8C/WnNi5GKT7NthACx+bjKTEMbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711130888; c=relaxed/simple; bh=KiwcN6OXG4cAG14WcslHNhcajsRkQ9j3y5Cu1CHHcik=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mye19LDdG+7+l2epbCG44/PXoyURjsXoSNT32uenVF+y4AoQUvl0ltV4U0vPXAPj7nqZo8u+NuOo4SsxPorsnkvCqu/34oRRkD49KKCoWIfUbtYoXXvCl1kCtmss9nT/GTwFcTzG3xOtmnaHQnKFz+OGUXua4D3ySnHHoVd+PJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rnjIq-0005aI-0F; Fri, 22 Mar 2024 18:07:40 +0000 Date: Fri, 22 Mar 2024 18:07:36 +0000 From: Daniel Golle To: Bart Van Assche Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , Jens Axboe , Dave Chinner , Jan Kara , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Damien Le Moal , Li Lingfeng , Christian Brauner , Christian Heusel , Min Li , Adrian Hunter , Avri Altman , Hannes Reinecke , Christian Loehle , Bean Huo , Yeqi Fu , Victor Shih , Christophe JAILLET , Dominique Martinet , "Ricardo B. Marliere" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 3/8] block: add new genhd flag GENHD_FL_NVMEM Message-ID: References: <89abd9ab93783da0e8934ebc03d66559f78f6060.1711048433.git.daniel@makrotopia.org> <7027ccdc-878a-420e-a7ea-5156e1d67b8a@acm.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7027ccdc-878a-420e-a7ea-5156e1d67b8a@acm.org> On Fri, Mar 22, 2024 at 10:49:48AM -0700, Bart Van Assche wrote: > On 3/21/24 12:33, Daniel Golle wrote: > > Add new flag to destinguish block devices which may act as an NVMEM > > provider. > > > > Signed-off-by: Daniel Golle > > --- > > include/linux/blkdev.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > > index c3e8f7cf96be9..f2c4f280d7619 100644 > > --- a/include/linux/blkdev.h > > +++ b/include/linux/blkdev.h > > @@ -81,11 +81,13 @@ 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_NVMEM``: the block device should be considered as NVMEM provider. > > */ > > enum { > > GENHD_FL_REMOVABLE = 1 << 0, > > GENHD_FL_HIDDEN = 1 << 1, > > GENHD_FL_NO_PART = 1 << 2, > > + GENHD_FL_NVMEM = 1 << 3, > > }; > > What would break if this flag wouldn't exist? As both, MTD and UBI already act as NVMEM providers themselves, once the user creates a ubiblock device or got CONFIG_MTD_BLOCK=y set in their kernel configuration, we would run into problems because both, the block layer as well as MTD or UBI would try to be an NVMEM provider for the same device tree node. I intially suggested the invert of this flag, GENHD_FL_NO_NVMEM which would be set only for mtdblock and ubiblock devices to opt-out of acting as NVMEM proviers. However, in a previous comment [1] on the RFC it was requested to make this opt-in instead. [1]: https://patchwork.kernel.org/comment/25432948/