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 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 1311BC433F5 for ; Sat, 5 Feb 2022 12:33:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E67CB83A9F; Sat, 5 Feb 2022 13:33:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (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="VklVr/2k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98A5F83B49; Sat, 5 Feb 2022 13:33:40 +0100 (CET) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) (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 8393E80F94 for ; Sat, 5 Feb 2022 13:33:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x835.google.com with SMTP id b5so8013601qtq.11 for ; Sat, 05 Feb 2022 04:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rPS0ySve3AdzVBoKHDYrWaIhgpFNXiDW2SVA3gcwbSQ=; b=VklVr/2kEGOAh7fRjB1OfAptPZ77sh5vctiUc4/60Fe0TpbtuQIoSU3kUHYwAatebu foCEtt3yyrsy48lJhtbhPXuyB564Am7930uXcLPvmHsSi/rA8RWgP32Odzyv+UwflpZE ONswp1QBrr7HpsJjHBY8oA9Qhe9VTnrglwX7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rPS0ySve3AdzVBoKHDYrWaIhgpFNXiDW2SVA3gcwbSQ=; b=qwFHNK3YGTHLTul0JyF1ceFShi6x7DAKdpm16bXPxHxd+RiExZfjYHICFwGHu1l5sZ nH1ycIkF8Swm/LftWsFWi8IxdQm+sSTX3AYRF88amUz9wIts2Tz7EX3MjMF59omrpNdf UHuhRlmmNQsQEMDzkGQQYXs4NIKIOjpUN1wSI5QPRQCryv7qf7z21u5EiREc9Yqg+yhS tkf9IgXEcwmy5m8lGscyzpfHZmJsh7gHrdO9SB0zx8wIkSUNPkQfctD8suyKAGROX0o2 aFiOsMGIh0LcaPI2vsnBnHythvEmkCp55eE31dIKc9xhf0KBFQDr4qnJQuapMewTS/SC LU4A== X-Gm-Message-State: AOAM5300qci26HsxFgBmoOiRNCxxdN/W0nCnCRrKMOSM+PXtwoBMpaEa OR+ebLCELyVuEJTqRbsRXDBTdg== X-Google-Smtp-Source: ABdhPJyT1yBrFnC31v914WksZSURJo5WOrDLkTy0RVi/NRNfAoFGANZefM7fxW79AI/jA9ulBJPNXQ== X-Received: by 2002:ac8:5cd0:: with SMTP id s16mr2368488qta.304.1644064416168; Sat, 05 Feb 2022 04:33:36 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id c20sm2848119qtb.58.2022.02.05.04.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Feb 2022 04:33:35 -0800 (PST) Date: Sat, 5 Feb 2022 07:33:33 -0500 From: Tom Rini To: Heinrich Schuchardt Cc: Simon Glass , Paul Liu , Jose Marinho , Etienne Carriere , Ilias Apalodimas , Patrick Delaunay , Grant Likely , Bin Meng , Patrice Chotard , Alexander Graf , u-boot@lists.denx.de, Masami Hiramatsu , AKASHI Takahiro , Sughosh Ganu Subject: Re: [PATCH v2 2/2] efi_loader: Reset system after CapsuleUpdate on disk Message-ID: <20220205123333.GS7515@bill-the-cat> References: <164370436957.365087.15139421656192351360.stgit@localhost> <164370438970.365087.16509597865935044130.stgit@localhost> <20220201113837.GA94173@laputa> <20220202041542.GA47272@laputa> <7bfebeac-ee98-855a-9635-41863bc5da78@gmx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VZU1Xz2wsgqbbnLB" Content-Disposition: inline In-Reply-To: <7bfebeac-ee98-855a-9635-41863bc5da78@gmx.de> 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.5 at phobos.denx.de X-Virus-Status: Clean --VZU1Xz2wsgqbbnLB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 03, 2022 at 06:32:50PM +0100, Heinrich Schuchardt wrote: > On 2/2/22 05:15, AKASHI Takahiro wrote: > > On Wed, Feb 02, 2022 at 10:53:05AM +0900, Masami Hiramatsu wrote: > > > Hi Takahiro, > > >=20 > > > 2022=E5=B9=B42=E6=9C=881=E6=97=A5(=E7=81=AB) 20:38 AKASHI Takahiro : > > >=20 > > > >=20 > > > > On Tue, Feb 01, 2022 at 05:33:09PM +0900, Masami Hiramatsu wrote: > > > > > Add a config option to reset system soon after processing capsule= update > > > > > on disk. This is required in UEFI specification 2.9 Section 8.5.5 > > > > > "Delivery of Capsules via file on Mass Storage device" as; > > > > >=20 > > > > > In all cases that a capsule is identified for processing the= system is > > > > > restarted after capsule processing is completed. > > > > >=20 > > > > > This also reports the result of each capsule update so that the u= ser can > > > > > notice that the capsule update has been succeeded or not from con= sole log. > > > > >=20 > > > > > Signed-off-by: Masami Hiramatsu > > > > > --- > > > > > Changes in v2: > > > > > - Remove kconfig option to disable this feature. > > > > > - Use panic() instead of do_reset() so that if the reset fails, > > > > > the machine halt. > > > > > - Log the result of each capsule update always. > > > > > --- > > > > > lib/efi_loader/efi_capsule.c | 12 +++++++++--- > > > > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > >=20 > > > > > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_ca= psule.c > > > > > index 1ec7ea29ff..39bce714f7 100644 > > > > > --- a/lib/efi_loader/efi_capsule.c > > > > > +++ b/lib/efi_loader/efi_capsule.c > > > > > @@ -1119,9 +1119,9 @@ efi_status_t efi_launch_capsules(void) > > > > > ret =3D efi_capsule_read_file(files[i], &capsule); > > > > > if (ret =3D=3D EFI_SUCCESS) { > > > > > ret =3D efi_capsule_update_firmware(capsul= e); > > > > > - if (ret !=3D EFI_SUCCESS) > > > > > - log_err("Applying capsule %ls faile= d\n", > > > > > - files[i]); > > > > > + log_err("Applying capsule %ls %s\n", > > > > > + files[i], > > > > > + ret =3D=3D EFI_SUCCESS ? "succeeded= " : "failed"); > > > >=20 > > > > log_err()? log_info() is better, I think. > > >=20 > > > Hmm, would you think to use log_info() even if it is failed? Or should > > > we have log_err(failure) and log_info(success)? > >=20 > > It is what I meant :) > >=20 > > > >=20 > > > > >=20 > > > > > /* create CapsuleXXXX */ > > > > > set_capsule_result(index, capsule, ret); > > > > > @@ -1142,6 +1142,12 @@ efi_status_t efi_launch_capsules(void) > > > > > free(files[i]); > > > > > free(files); > > > > >=20 > > > > > + /* > > > > > + * UEFI spec requires to reset system after complete proces= sing capsule > > > > > + * update on the storage. > > > > > + */ > > > > > + panic("Reboot after firmware update"); > > > >=20 > > > > If CONFIG_PANIC_HANG is enabled, the system won't restart. > > > > It's not what we want here. > > >=20 > > > Indeed. > > > Heinrich, what would you think if do_reset() doesn't work? > > > (I think it is OK to get it back here, but needs a warning) > >=20 > > If (CONFIG_IS_ENABLED(SYSRESET)) { > > puts ("resetting ...\n"); > > sysreset_reset_walk(SYSRESET_WARM); >=20 > do_reset() is implemented in many 25 places. > drivers/sysreset/sysreset-uclass.c is just one of them. >=20 > @Tom, @Simon: > Is there a migration timeline to replace all other do_reset() > implementations? >=20 > A dummy implementation like in arch/riscv/lib/reset.c should not exist. > The sysreset uclass handles the case of no sysreset driver already. Not yet, please feel free to propose something, if it can't just be done outright, right now. --=20 Tom --VZU1Xz2wsgqbbnLB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmH+bpoACgkQFHw5/5Y0 tyzmaAv/dZfx7oxL6ZfoQhxXrVmvdqJ7dLV+nzeTblPF71VoAFtgwfLaLkN7b2kK A9iSX+oLotJLqJ9KoUhTuhkVaZgMLb2odJkv97nkq/3+/C4E5fEkcZzkWTjAACHh AP0aISNhUBaUWcCRx8JLLdXzR5QOxhf2cpZ/US/CVJPJGRr/AtOaRNdTRzd53U6M /gcBAcs5CpoGnFoa++RxmYTQ/h6yW6Ei61fC6GEZez5mfGAwB5nIJwoaRXAqUP5k 8HJDQwcTqqsFuIM+gJTSytcjig+kiHBNQUHoOgM83JoEdX9XksF+fmLAJRn+5ygg L+zcl5clP1AQYYS266eFkSwjLvPu5QIA/zDqolYVw5mvp4VMhTgHdJ9m0wiy6MvI ZknP3iczjQKKDMR8iPNnd0J0m42xRrRC5QSI2zNIkX7D8Hu0cjr5CSJ0ThP6VUZX AxvVUW1UC2NQnFprQ1c3JtpOK1ear2Ntw+I6JdvDq5Cpd2RjW/b5Ujbm/20XxKDt RzEW+2TR =BoW6 -----END PGP SIGNATURE----- --VZU1Xz2wsgqbbnLB--