Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7AFE3C64ED6 for ; Tue, 28 Feb 2023 00:58:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6FB3B85A7B; Tue, 28 Feb 2023 01:58:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="nHFMqk+3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A6B2785A97; Tue, 28 Feb 2023 01:58:10 +0100 (CET) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 4A7EE85958 for ; Tue, 28 Feb 2023 01:58:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82b.google.com with SMTP id l18so7807223qtp.1 for ; Mon, 27 Feb 2023 16:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1677545887; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6zkWfsKUor40pPTGn4bEUA12lXRyLllNpMowudhafOQ=; b=nHFMqk+3+HOy2NJR/LWtwulQxUAMSII1JYPB7NU/jk6DavL95kt05cNc4eZYfAuhST GHG/GElilQZYzPOccyXRN1p8gHpxNqBsr7ojxRJzzcKhhawlllRXdHv/IPmr9ImuLhye 7AUq4K8FF/2ZLHsl3L7Qfbvazxd6dd51UpWkc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677545887; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6zkWfsKUor40pPTGn4bEUA12lXRyLllNpMowudhafOQ=; b=csBjB7i4DOD2+6OEpoSf4J21ET4BalVZ0l426rCBJuLOgmQrdu2yt4M4UikjPLd0Mj BLyX7rNQntn2PSb4guY7WnuuwNDSaWNQkltslTOP2SO5L3aVBrXBxi3O90/DvjKXVcB2 2s8c5zafu6ywX3TwNkqhK56OP6uqcllXAax3oBGhiaJ5l26RL+wxS/g53hxOQd2B8BN6 lryq8D27UF1bQCx2ZfntM+m4J9TZAugRP6jsOBuV7nJfH5AW4g1qD0xvlMaVG2WI8Ghm sj+LNHRnc5IPgcvgPltAQQzpEAc98nl3UO2yAsHQz+zvFlHZ+KdAcThbZ/ygeWYvHtP7 vHPA== X-Gm-Message-State: AO0yUKVG0Kdo2V0t20soYXKHlN4wN9wFw3FvaWzmXMlWTlPoEofCopjv iM/4BkgIt2UOr6/jH2DeZYrO/A== X-Google-Smtp-Source: AK7set/DxqA+66TCRts+h/VwJup9Ru3NLrGn/H3w1vx+FhZQbFdfhJaUM7nocwmUZRyUyY2F9qZD0Q== X-Received: by 2002:a05:622a:1a0c:b0:3bd:1081:b939 with SMTP id f12-20020a05622a1a0c00b003bd1081b939mr20027606qtb.0.1677545886952; Mon, 27 Feb 2023 16:58:06 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-0000-0000-0000-036b.res6.spectrum.com. [2603:6081:7b00:6400::36b]) by smtp.gmail.com with ESMTPSA id z8-20020ac87108000000b003bf9f9f1844sm5550965qto.71.2023.02.27.16.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 16:58:05 -0800 (PST) Date: Mon, 27 Feb 2023 19:58:03 -0500 From: Tom Rini To: jassisinghbrar@gmail.com Cc: u-boot@lists.denx.de, ilias.apalodimas@linaro.org, etienne.carriere@linaro.org, sjg@chromium.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de, patrick.delaunay@foss.st.com, patrice.chotard@foss.st.com, Jassi Brar Subject: Re: [PATCH v5 0/6] FWU: Handle meta-data in common code Message-ID: References: <20230228005135.1635726-1-jassisinghbrar@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CQDTvncrh2BFfVNQ" Content-Disposition: inline In-Reply-To: <20230228005135.1635726-1-jassisinghbrar@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean --CQDTvncrh2BFfVNQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 27, 2023 at 06:51:35PM -0600, jassisinghbrar@gmail.com wrote: > From: Jassi Brar >=20 > The patchset reduces ~400 lines of code, while keeping the functionality = same and making > meta-data operations much faster (by using cached structures). >=20 > Issue: > meta-data copies (primary and secondary) are being handled by the backen= d/storage layer > instead of the common core in fwu.c (as also noted by Ilias) that is, gp= t_blk.c manages > meta-data and similarly raw_mtd.c will have to do the same when it arrive= s. The code > could by make smaller, cleaner and optimised. >=20 > Basic idea: > Introduce .read_mdata() and .write_mdata() in fwu_mdata_ops that simpl= y read/write > meta-data copy. The core code takes care of integrity and redundancy of t= he meta-data, > as a result we can get rid of every other callback .get_mdata() .update_m= data() > .get_mdata_part_num() .read_mdata_partition() .write_mdata_partition() = and the > corresponding wrapper functions thereby making the code 100s of LOC small= er. >=20 > Get rid of fwu_check_mdata_validity() and fwu_mdata_check() which expecte= d underlying > layer to manage and verify mdata copies. > Implement fwu_get_verified_mdata(struct fwu_mdata *mdata) public functio= n that reads, > verifies and, if needed, fixes the meta-data copies. >=20 > Verified copy of meta-data is now cached as 'g_mdata' in fwu.c, which avo= ids multiple > low-level expensive read and parse calls. > gpt meta-data partition numbers are now cached in gpt_blk.c, so that we d= on't have to do expensive part_get_info() and uid ops. >=20 > Changes since v4: > * Change fwu-mdata-mtd bindings to not require external changes > * Handle 'part =3D=3D BOTH_PARTS' in fwu_sync_mdata > * use parts_ok[] and parts_mdata[] instead of pri/sec_ok and p/s_= mdata Did you run this through CI / build sandbox? This doesn't read like you fixed the problem I reported in CI, when I was trying to merge v4. --=20 Tom --CQDTvncrh2BFfVNQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmP9UZUACgkQFHw5/5Y0 tyyI0Qv/WxXUmRkawLDpGHUsao4y+vOBkUHVr2ez2ZeW/Nhs+E+M7eWUYnbymaKw L+1YYaB3RQc5HrNQZotkSbJnXICFbVpu3JAcp+UeU4BhpicLKn0G8pJyS2WDHLXf DvLykb2mqWq5crGR+fyS2tD7IWfrhzCxwHlN36mjr+Plbxw6sIsZpyrl7cXIYid8 vLkT8pfeKtjKlgOMaJUabAmM4EywSkmwUm6TeUoZ/pMEvnwRGPW+39FX/sgyMQay 2K6SnGBZAkFbaBJjQV5ofGI0buhWwt8UtFIb+eClmzQVgtdnGKVfv0i/H+BOMUCg ExBs9Nf7PHLgky3JIzu/waFqyjR2El9lfJCLcibP/V613yiaTew86QAsZGkF8PCr EMVpmzQhLdZgLbG3vfWYZ5wFrj/iQvpfPcG7z34pbhQ2UWNUXtyI2GUTkAO8aTgi SloTruB4hhJkvYf0NZTpdtdIV/mT9CDMuvFItLzyv01Mk/aghPm9Ti/adUPHk5tA aRAfl5CM =UuHg -----END PGP SIGNATURE----- --CQDTvncrh2BFfVNQ--