From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98A15C07E96 for ; Fri, 9 Jul 2021 02:44:51 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE93161404 for ; Fri, 9 Jul 2021 02:44:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE93161404 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 80142831EB; Fri, 9 Jul 2021 04:44:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Bud6ckch"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 58F32831EC; Fri, 9 Jul 2021 04:44:48 +0200 (CEST) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C397F831EB for ; Fri, 9 Jul 2021 04:44:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x530.google.com with SMTP id y4so5982634pgl.10 for ; Thu, 08 Jul 2021 19:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=6iKf6f5GHUpLe8XCeeICCu+8pkx6WRlDhwRGo5pTm+Y=; b=Bud6ckchSaxCf//l6mOzLBeu9F/0vnIQvRFx2Av+mpS8wAiVpq8nrqPGpSruiAnTGD IsTs9fjDleeo/5cD/P62gVYCC160ZgSiteNsusz/YTxnJao7UN5ZGXRqVwN3BxYPxJ4E 3LL8pCTzE7vZy3s+zBzbAekBzMjuCIustTFybsxrh5UBuTC/KUK2n+fHVjTQVt2O8QTX DcG78U13CrRgpFXBh0FlMUMR5LlI3HPoqeqr/6dakZLb3eI40uio63WuUak0qNYIfYRy b0GGR9bYUk8n5omidMdn/yf/wRmvKyp9bRp6ZctmLhhZvqutCijcxzZZNlKGP41+h6Gx PZgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=6iKf6f5GHUpLe8XCeeICCu+8pkx6WRlDhwRGo5pTm+Y=; b=cvmMu6JGDsYDnrupgHdHKN1JcXV/D3CxJx9NtMk9Lp7frR9YHAM3ivpfdYX2dsSIns pImdBt4rF4lULUVje/ZBHeujEz2NHWbIG4MV/iPF8Y9gOXGbqgAecq8X8VxBIAHFfj1Y wMel7aTmqVKuZFTACEzZUnc3dp0D8vWnx+sF8P82NagXdSnz/BysxxIaV85+w+MuU1nV cf4+RU7JXKGrJk7adQXcuuNCUqVEWZJQYpvH4MaL+YT3uO26VkgWVcmkui4UAtSjBClh XfKX7C01pagiozGt7ZMeWVV23CSsv5/o+Zr5EL3MuWdHDSuqhaALQjY2kzQ3/2H1LJgw tcaw== X-Gm-Message-State: AOAM5332E9bt7jurHh4nsz7kGwrIX2i2ullQzSB6dvy/DXguRfDBDvX0 7ueW3nb1HFEDhegAjuuCUVfyow== X-Google-Smtp-Source: ABdhPJwdHha4exLxzlGJfQ4mx3b7HTr1c0C68B40vHB0F/On/VzQwCoZAd4pJq3ZXazxZ0TeDsQxrg== X-Received: by 2002:aa7:8244:0:b029:2ec:968d:c1b4 with SMTP id e4-20020aa782440000b02902ec968dc1b4mr34227284pfn.32.1625798681882; Thu, 08 Jul 2021 19:44:41 -0700 (PDT) Received: from laputa (p3dd30549.tkyea130.ap.so-net.ne.jp. [61.211.5.73]) by smtp.gmail.com with ESMTPSA id m13sm4040453pfo.102.2021.07.08.19.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 19:44:41 -0700 (PDT) Date: Fri, 9 Jul 2021 11:44:37 +0900 From: AKASHI Takahiro To: Simon Glass Cc: U-Boot Mailing List , Tom Rini , Heinrich Schuchardt , Ilias Apalodimas , Marek Vasut , Sean Anderson , Marek Beh??n Subject: Re: RFC: Devices for files and partitions Message-ID: <20210709024437.GA70106@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , U-Boot Mailing List , Tom Rini , Heinrich Schuchardt , Ilias Apalodimas , Marek Vasut , Sean Anderson , Marek Beh??n References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Tue, Jul 06, 2021 at 05:05:19PM -0600, Simon Glass wrote: > Hi, > > At present U-Boot avoids the concept of 'opening' a file. Being in a > bootloader environment, it is normally better to take the action > immediately and avoid any caching, for example, since there is no > background task to clean up afterwards. > > Having said that, the concept of a file is quite useful, for example > to write the output of a command to a file, or to open a file and read > it a line at a time. > > Another case has come to light in that EFI wants to access files using > a file handle. This currently uses parallel data structures and does > not map very well in U-Boot. > > Finally, partitions has a similar issue, where defining them as a > device can have benefits, e.g. to specify the device to use directly, > rather than with the 'type dev:part' approach, perhaps providing them > in the devicetree, etc. > > For the above reasons, I propose that we implement, as an option, > support for files and partitions within driver model. +1 # Nobody has commented yet :) Regarding a "file (or file descriptor)", we have already implemented the same concept in efi_loader. So technically, it won't be a hard-work. Regarding "partitions as udevice," I have posted an experimental patch [1]. So it must also be feasible. One of my concerns is what benefit end users may enjoy. -Takahiro Akashi [1] https://lists.denx.de/pipermail/u-boot/2019-February/357937.html https://lists.denx.de/pipermail/u-boot/2019-February/357934.html > Regards, > Simon