From patchwork Wed Jul 19 22:03:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 122849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2738174vqt; Wed, 19 Jul 2023 15:13:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPHsHKs5umzWt9kzQ9SHQP4on/+DvM3cWnpLm1gHS1Ct2ni5sCw3cMlwYl7fojewIDVOQF X-Received: by 2002:a17:907:2d23:b0:978:90cc:bf73 with SMTP id gs35-20020a1709072d2300b0097890ccbf73mr4074105ejc.48.1689804823778; Wed, 19 Jul 2023 15:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689804823; cv=none; d=google.com; s=arc-20160816; b=scWeG9H/Hwu50UogHcVw7aJk5I01k9go4NbBnV62ifC91+tFKH4kckO6ulkiJ4ONGl kX+sIo2Hvkf4h0066z7yppk+q8Hdec/UblqMCiDTGJb8wxvP6Wnb+3ZgtnS/iitaKGQW DqBt16Msxefen4Hk30ZLW2UYiHtcrIHQ/vH4O7fJwNfrZOFlukK8gZAh8Zqz4EES4nRZ BkHGS8ETIrudALToJyDJsxkW3nGrfSoZUnDtNlW+UZ+qV48DiFE27Dz0J4efQfbYwNG6 jpttm7mHVV+7ugXfj0vDb7AZwWqOuMdpHMqkfiX9IgkQIh52QdT+KRjhHWw++SC6SRIb Qy3w== 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:to:from:date; bh=aI+oONGaegupJ0seogiMq5KOugYmjBNwpl7+MkGhXeY=; fh=O/hjEvlM0nIN8LC6WbIQ4s0L6nmnRMOzajXXMF81As0=; b=rySUH0T8WAcV+Jgdb2O+AgQJIHYktjKMUkBKP8XLB0pl5J7lJz9U/U2kw/UgfxP/Lp H6Vdnx0rlg2Zs6fYjHWS81E0ZFK0xGy1EiInC6aw1d6a9WLG0AMt1/7DPpLxzmQ5kWED jhI6FhIn5YLYvyzhmHcJOXTqxK91QIS7bZeFOb8PzUmzs4OlvwFHkhJ/utL3TvuqfIVl bOPFzcZdjv8UwJ4wqz6PjAeV64e85LAflO2dz93U+xrwCK5mclt0iC5FzophF4tJIj6N F813yZ1fqSBAmAHbGaKK8hOg5Rql+D0P79X3TtXN3mgu0JX/1vAu/ClpCP2H/0vkCuAm t7JA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa23-20020a170907b9d700b009938248d370si3652266ejc.2.2023.07.19.15.13.19; Wed, 19 Jul 2023 15:13:43 -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 S230181AbjGSWDr (ORCPT + 99 others); Wed, 19 Jul 2023 18:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjGSWDp (ORCPT ); Wed, 19 Jul 2023 18:03:45 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBB2213D; Wed, 19 Jul 2023 15:03:29 -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 1qMFGL-0008Kc-1x; Wed, 19 Jul 2023 22:03:13 +0000 Date: Wed, 19 Jul 2023 23:03:05 +0100 From: Daniel Golle To: Jens Axboe , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dave Chinner , Matthew Wilcox , Thomas =?iso-8859-1?q?Wei=DFschuh?= , Jan Kara , Daniel Golle , 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?UmFmYcWCIE1pxYJl?= =?utf-8?b?Y2tp?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [RFC PATCH 3/6] block: add new genhd flag GENHD_FL_NO_NVMEM Message-ID: <96510d925cb0ca1a3a132f8f8affd4bbdafd8fc9.1689802933.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771888782752038240 X-GMAIL-MSGID: 1771888782752038240 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 {