Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4334558rdb; Mon, 11 Dec 2023 16:44:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IE10OvWT/fVIU4jRvqCGB4Ih9CBjwAj/lMDZMEoUp815qV8z7RDclhnb5k3fDx2OrZ2IvcV X-Received: by 2002:a05:6a20:13cc:b0:18f:97c:8a43 with SMTP id ho12-20020a056a2013cc00b0018f097c8a43mr5854342pzc.110.1702341872926; Mon, 11 Dec 2023 16:44:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702341872; cv=pass; d=google.com; s=arc-20160816; b=04txUM3p8NGPYawGoB4V4v/rxJagfDjc1/bM+X2Eey6keayFl6tKPK31fInmhprzlk +xZYtuo1NxklKp4ZAPPKrQOrfR8bI+uQcW+DVuj/sDYfeWSP09mkLnXIZKiW6c3v4UoM pd1HWUTLc1qkMsgqEOtoTf2qdiuf3t63Ehy+o4x47PM+kkY97bJok1KRA9/8STdEb1jU ahmjPul95Fc3Sm2p3bgCb8w5d5o4rgYxcnA5eRGcUDF/YyxMTi2bg8mSoaRDCVjquSCv SuOh3LjlDf7/PwvpogTDShDihsphnA/31Fe+x/5SqOosc4MHCs9IpSA0oQxYnG4FGc15 hZwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mF/Vo4/Bjp0KnZuQHVj8rbwp5yFhrkFsYdhlOMyaCbg=; fh=VWXRQwuoFuSnJNrIo7JXRxy11i851YlfofmzRHx0KTE=; b=SyNCOKTkUKr+ZZp7Pukg6tUrSjZc28EerzwF1U7vsNv9AaGLJAywD5i6U1xFFWh9YK qLsifsBu4iC6rPjENclZi62sYEasDJk/D3M1Rmw2u+AFC6u5wSzx1B4cQbflwq0pFn9l FUVQpRAjzjB0IV3LURKCVhLtgQYZ1S1x+nSuZHJUnuSxXtI2Uya+EQIBI2QBzZaYknTB gp4wkNR8BCGgKcY/SH6eL7eiiaJQsTePk2ZwhNY4GMOCDv/xRNQ18brRBVAMu66gY5RI En0y4tCVQxyXeTTMhW07g44U8Vm6gtIMKsd2T4Dudjz82PT1ixc1TqRDq9RgDeBRTcnQ JXcQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@stgolabs.net header.s=dreamhost header.b=j8DHAwuP; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ka41-20020a056a0093a900b006cd8db94631si6518968pfb.365.2023.12.11.16.44.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 16:44:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@stgolabs.net header.s=dreamhost header.b=j8DHAwuP; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3DE068069217; Mon, 11 Dec 2023 16:44:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345517AbjLLAoP (ORCPT + 99 others); Mon, 11 Dec 2023 19:44:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345477AbjLLAoO (ORCPT ); Mon, 11 Dec 2023 19:44:14 -0500 Received: from bee.birch.relay.mailchannels.net (bee.birch.relay.mailchannels.net [23.83.209.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87CFFA6; Mon, 11 Dec 2023 16:44:20 -0800 (PST) X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EC0F97A3326; Tue, 12 Dec 2023 00:44:19 +0000 (UTC) Received: from pdx1-sub0-mail-a241.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 648F07A33C0; Tue, 12 Dec 2023 00:44:19 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1702341859; a=rsa-sha256; cv=none; b=WfVG4SSwRyXeEqf06z6ACiV5ytZmhy8gZItJKq1SZZNPSqMWTNLZdEpGnj2IikrokX+bOp s0up7pk6JlFMqOnKYaniYfFQnOs+leFOHCCEDk54VR3YsTcWxoZFJfIzT3/Sg+p5tRMJve FAkH7Z/Drgnw00iC6KLa4BWv9dTNC92K1hPkCmIVKK6IblntrLG+aYl6HIa+0hxylA1i96 AY2P9rpTlSFSMXuwqcJXCCo7cxAdGWOg++zjOi7Sj4QAc8kwCIxttfMsEAZ8HtGaFc9OO6 Mt90yxfTUwD3uOeIumnJMvaoTwLhOP8a8Jc2A4MYiiR0yKGLTEXckL9nH2lNRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1702341859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mF/Vo4/Bjp0KnZuQHVj8rbwp5yFhrkFsYdhlOMyaCbg=; b=Wh5Khxytvukjt8QWDslzHoUND4LTPJ5D7neQ9e14wl4E2ZVZ3qCm7MSWLKYWWGNegy4pay JLp7H03isdxZ/p+VLUsMW4aIGgNM3eprQDR3i+F9kgZdgXb97wipEXH4dv2TeTreZQDE6k umNftFkcSeiG3/jOFDp4m3Mcc4BjtdE+X9ATFZZVHSNGecchJYLZzeso/NnQ3nbCY0En0M 6t7OIgJcvFjV77ZB56zRGhfBjGZ4vv8O+9PN9Dw4/5o+3rRA9mBYBOfD7XUTfQNvzHWKaz j1vsMLhwqvyiVrHd3yqfVSoQYi1rNANrlmZh1L3fbnJ9N4QO/lYGfwCMuZOu2w== ARC-Authentication-Results: i=1; rspamd-5749745b69-czvrl; auth=pass smtp.auth=dreamhost smtp.mailfrom=dave@stgolabs.net X-Sender-Id: dreamhost|x-authsender|dave@stgolabs.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dave@stgolabs.net X-MailChannels-Auth-Id: dreamhost X-Desert-Fumbling: 2d7025c1535d992e_1702341859740_305295213 X-MC-Loop-Signature: 1702341859740:2844852777 X-MC-Ingress-Time: 1702341859740 Received: from pdx1-sub0-mail-a241.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.127.58.202 (trex/6.9.2); Tue, 12 Dec 2023 00:44:19 +0000 Received: from offworld (unknown [172.56.169.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dave@stgolabs.net) by pdx1-sub0-mail-a241.dreamhost.com (Postfix) with ESMTPSA id 4Sq0HK3kd3zqM; Mon, 11 Dec 2023 16:44:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stgolabs.net; s=dreamhost; t=1702341854; bh=mF/Vo4/Bjp0KnZuQHVj8rbwp5yFhrkFsYdhlOMyaCbg=; h=Date:From:To:Cc:Subject:Content-Type; b=j8DHAwuPoFxHqrqS+yeA0YQa9yNrbyRSTaNAJFkQE+UqKgg1Q1MsLd7CWm9jceUYN O8TQS51/TEiDQPKOLg71Hp9nYqh0ifF3wfMDAagn35iH5p5GbMj/pYh9H9jz0Xrdsz JHTaD4I7dFMfUgq9MBq4LlpcqToB57JIanyIuk8epPFGbOFLw/pps//E8v5oHKBJ8p MLgoxBSpI4k1oN28wH7TTbumPC5iczULbNMObYAfuN5s4/3AGJmTeMx4h/wU8hC2Tv hDB6PQCnIwUoX5SSmZ8H3qKfsuQedvUE0rCtSjIeUr2eLQNy+xtauPd0rM2ylxPwxJ WsCD0D5XkTN0A== Date: Mon, 11 Dec 2023 16:43:58 -0800 From: Davidlohr Bueso To: Romain Gantois Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jens Axboe , Ard Biesheuvel , Thomas Petazzoni , Herve Codina , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-efi@vger.kernel.org Subject: Re: [RFC PATCH 0/6] Add GPT parser to MTD layer Message-ID: References: <20231211151244.289349-1-romain.gantois@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20231211151244.289349-1-romain.gantois@bootlin.com> User-Agent: NeoMutt/20231103 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 11 Dec 2023 16:44:30 -0800 (PST) On Mon, 11 Dec 2023, Romain Gantois wrote: >Hello everyone, > >MTD devices were historically partitioned using fixed partitions schemes >defined in the kernel device tree or on the cmdline. More recently, a bunch >of dynamic parsers have been introduced, allowing partitioning information >to be stored in-band. However, unlike disks, parsers for MTD devices do not >support runtime discovery of the partition format. This format is instead >named in the device-tree using a compatible string. > >The GUID Partition Table is one of the most common ways of partitioning a >block device. As of now, there is no support in the MTD layer for parsing >GPT tables. Indeed, use cases for layouts like GPT on raw Flash devices are >rare, and for good reason since these partitioning schemes are sensitive to >bad blocks in strategic locations such as LBA 2. Moreover, they do not >allow proper wear-leveling to be performed on the full span of the device. > >However, allowing GPT to be used on MTD devices can be practical in some >cases. In the context of an A/B OTA upgrade that can act on either NOR of >eMMC devices, having the same partition table format for both kinds of >devices can simplify the task of the update software. > >This series adds a fully working MTD GPT parser to the kernel. Use of the >parser is restricted to NOR flash devices, since NAND flashes are too >susceptible to bad blocks. To ensure coherence and code-reuse between >subsystems, I've factored device-agnostic code from the block layer GPT >parser and moved it to a new generic library in lib/gpt.c. No functional >change is intended in the block layer parser. > >I understand that this can seem like a strange feature for MTD devices, but >with the restriction to NOR devices, the partition table can be fairly >reliable. Moreover, this addition fits nicely into the MTD parser model. >Please tell me what you think. I am not a fan of this. The usecase seems very hacky and ad-hoc to justify decoupling from the block layer, not to mention move complexity out of userspace and into the kernel (new parser) for something that is already being done/worked around. Also, what other user would consume this new gpt lib abstraction in the future? I don't think it is worth it. Thanks, Davidlohr