From patchwork Tue Nov 8 23:04:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 1701523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=CFaJq3VA; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N6Nyx6bQwz23lT for ; Wed, 9 Nov 2022 10:07:05 +1100 (AEDT) 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:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=IGQWPjaVu6YujectVVrCsrQrtQEpFEKX4hmY06N9lk0=; b=CFaJq3VAE36IyV HspE+du5qRI5jf+gWRSMHxfaYBbmohP0rhIBNuZurFzpgFkT5fjRgAgQ3AOl7r/9eCl/1bBhEgiSv E69/F+bUw8urjn+fBGDiGu0CdjDaQL08Kud99rI9IIE3Lx/almgqt0+4PfmPoi06RclMz/8CzGtev SCfdJwZn8PR3rTnM9HByN4tDevqC3BBWn2eDyp7e8u1F19sDKpOo1lLHXUm+1uqAXWQu07/ZqTSYk eJ1mt7/ZodNFaAsgsWz/Ay2LM8wI/GWLycAhRrPfOK0eIJ/Gffyt4VQJuhEt/F9WDsBT9yHbc1pDG tdgiksm6Bh9rkdvXQMgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osXfZ-0092Sg-Mp; Tue, 08 Nov 2022 23:06:13 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1osXfV-0092Qf-U9 for linux-mtd@lists.infradead.org; Tue, 08 Nov 2022 23:06:12 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from ) id 1osXfK-0005wb-6u; Wed, 09 Nov 2022 00:05:58 +0100 Date: Tue, 8 Nov 2022 23:04:35 +0000 From: Daniel Golle To: Jens Axboe , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Davidlohr Bueso , Matthew Wilcox , "Martin K. Petersen" , Chaitanya Kulkarni , Daniel Golle , Ming Lei , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-efi@vger.kernel.org Subject: [PATCH v4 5/5] mtd: ubi: block: add option to enable scanning for partitions Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_150610_015050_95134B6A X-CRM114-Status: GOOD ( 11.38 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add Kconfig option CONFIG_MTD_UBI_BLOCK_PARTITIONS and enable block partition parsers on ubiblock devices in case it is selected. Signed-off-by: Daniel Golle --- drivers/mtd/ubi/Kconfig | 10 ++++++++++ drivers/mtd/ubi/block.c | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add Kconfig option CONFIG_MTD_UBI_BLOCK_PARTITIONS and enable block partition parsers on ubiblock devices in case it is selected. Signed-off-by: Daniel Golle --- drivers/mtd/ubi/Kconfig | 10 ++++++++++ drivers/mtd/ubi/block.c | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig index 2ed77b7b3fcb..491330e42ab2 100644 --- a/drivers/mtd/ubi/Kconfig +++ b/drivers/mtd/ubi/Kconfig @@ -104,4 +104,14 @@ config MTD_UBI_BLOCK If in doubt, say "N". +config MTD_UBI_BLOCK_PARTITIONS + bool "Scan UBI block devices for partitions" + default y if FIT_PARTITION + depends on MTD_UBI_BLOCK + help + Scan UBI block devices for partitions (ie. MBR, GPT, uImage.FIT, ...). + + Unless your UBI volumes contain sub-partitions mapped using a partition + table, say no. + endif # MTD_UBI diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c index 75eaecc8639f..d9baa99ca093 100644 --- a/drivers/mtd/ubi/block.c +++ b/drivers/mtd/ubi/block.c @@ -430,7 +430,10 @@ int ubiblock_create(struct ubi_volume_info *vi) ret = -ENODEV; goto out_cleanup_disk; } - gd->flags |= GENHD_FL_NO_PART; + + if (!IS_ENABLED(CONFIG_MTD_UBI_BLOCK_PARTITIONS)) + gd->flags |= GENHD_FL_NO_PART; + gd->private_data = dev; sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id); set_capacity(gd, disk_capacity);