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 11465C433F5 for ; Mon, 14 Mar 2022 02:43:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 40E9983928; Mon, 14 Mar 2022 03:43:13 +0100 (CET) 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="gpp1h14e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D9DDD83933; Mon, 14 Mar 2022 03:43:10 +0100 (CET) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (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 3B7A483915 for ; Mon, 14 Mar 2022 03:43:06 +0100 (CET) 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-pj1-x1031.google.com with SMTP id lj8-20020a17090b344800b001bfaa46bca3so12979868pjb.2 for ; Sun, 13 Mar 2022 19:43:06 -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:content-transfer-encoding :in-reply-to; bh=zrt4SDAHb5NFWzqtz3pFFVqyNYl9gdOzPv+4XrIQals=; b=gpp1h14eAXzSLUleNurZwEKcng7oE534WXikPORtY5Mzv38r0KIYMJ8fluZxfabgiR nGrdvcruRRzzyYDdZqgTESByaz+8/4bT22PtAXmODwhW+g+O2M4Ui/PS9X+AcOrjNjk2 Aoa0Vi1YdefMgk9oMniOWharEvXDrHp6ZuLQCY5tj0yuZn12j63ipVl2yQwcBQtQYlwS jef0uEJ7oc4kmca1HrcQGJbsyP07YnKoJ+hxOclKZXxvjIujMnwz+dwJJZkmNrGvcTLa xjPaklyE8VwPz3u+pHLHo3bP8Nrx3L5F21QOgKmSXYn2mSbXmYYWYdH9RzRKwzO9nf+Q 36qQ== 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 :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=zrt4SDAHb5NFWzqtz3pFFVqyNYl9gdOzPv+4XrIQals=; b=iN6T7qLk3Z3xerp3Yvm+FAnc0CQz870Mm0xTeyFQsZUZ6iyanQJPYZVw4djmlkN6B8 AoUtaG0L803SMEo67g3sfxpjNeMMJT+60LrSp3ajTszTC3tP8RddY+cq4pcfrlUL4B7d 5Dk0rQ9J3nppyY6Xy9G/h8ztjwJ6cDmgPIMNnWY/OgsMBbddBosH1CtDgh8cmuhPDOuJ wy0XMN0ivviHSqns8jKapjUPsurhiZyiGJvLu2N4mqk89LMZ8DnJs8+UJYhZuJaGWhr+ X1/mbhWUuN1Pg8ovgQ0Iii4YDm95jjiSkI381Dp0yBG1ZwtBVG1ZT8CdixWyCAJcCdWP ElOg== X-Gm-Message-State: AOAM533F4VEyz8dD0+P0y3gdWtHryOjwZ8rklLQnAIBgoJSO/aF9dYMC PeNLdK8TV4ceMd4BPrp7AsNAJw== X-Google-Smtp-Source: ABdhPJwMxRqi2d66JzJP/IhCmle+k9k8xayt29LtiK36xTaFqrcJvKZd01E3xqGIjtbu/qYnD3Qa1Q== X-Received: by 2002:a17:90a:9502:b0:1bf:f7f0:816a with SMTP id t2-20020a17090a950200b001bff7f0816amr21076230pjo.228.1647225784058; Sun, 13 Mar 2022 19:43:04 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:69ab:dc6d:d6e2:371d]) by smtp.gmail.com with ESMTPSA id w23-20020a627b17000000b004f6cf170070sm17581138pfc.186.2022.03.13.19.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 19:43:03 -0700 (PDT) Date: Mon, 14 Mar 2022 11:42:58 +0900 From: AKASHI Takahiro To: Simon Glass Cc: Heinrich Schuchardt , Masami Hiramatsu , Tom Rini , U-Boot Mailing List , Patrick Delaunay , Patrice Chotard , Alexander Graf , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: Re: [PATCH] test/py: efi_capsule: Handle expected reset after capsule on disk Message-ID: <20220314024258.GC37492@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , Heinrich Schuchardt , Masami Hiramatsu , Tom Rini , U-Boot Mailing List , Patrick Delaunay , Patrice Chotard , Alexander Graf , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Etienne Carriere , Sughosh Ganu , Paul Liu References: <4ba143f8-6114-db0e-08e2-d97ac9dc6e13@gmx.de> <20220219011550.GB6672@laputa> <20220314010813.GA37492@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 On Sun, Mar 13, 2022 at 08:15:02PM -0600, Simon Glass wrote: > Hi Takahiro, > > On Sun, 13 Mar 2022 at 19:08, AKASHI Takahiro > wrote: > > > > Hi Simon, > > > > On Fri, Mar 11, 2022 at 07:24:39PM -0700, Simon Glass wrote: > > > Hi Takahiro, > > > > > > On Fri, 18 Feb 2022 at 18:16, AKASHI Takahiro > > > wrote: > > > > > > > > On Fri, Feb 18, 2022 at 02:48:54PM +0100, Heinrich Schuchardt wrote: > > > > > On 2/18/22 03:16, Masami Hiramatsu wrote: > > > > > > Hi Simon, > > > > > > > > > > > > Thank you for your reply. > > > > > > > > > > > > 2022年2月18日(金) 2:56 Simon Glass : > > > > > > > > > > > > > > > > > > > > Hi Masami, > > > > > > > > > > > > > > On Wed, 16 Feb 2022 at 18:11, Masami Hiramatsu > > > > > > > wrote: > > > > > > > > > > > > > > > > Hi Simon, > > > > > > > > > > > > > > > > Let me confirm your point. > > > > > > > > So are you concerning the 'real' reset for the capsule update test > > > > > > > > case itself or this patch? > > > > > > > > > > > > > > > > I'm actually learning how the test is working, so please help me to > > > > > > > > understand how I can solve it. > > > > > > > > > > > > > > > > There are 3 environments to run the test, sandbox, Qemu, and a real board. > > > > > > > > If we reset a sandbox, it will continue to run (just restart itself), > > > > > > > > > > > > > > Here you should be able to avoid doing a reset. See > > > > > > > dm_test_sysreset_base() which tests sysreset drivers on sandbox. > > > > > > > > > > > > Would you mean that reset-after-capsule-on-disk itself should not > > > > > > make a reset on sandbox? > > > > > > > > > > We have several tests that do resets by calling do_reset(), e.g. the > > > > > UEFI unit tests. There is nothing wrong about it. > > > > > > > > > > We want the sandbox to behave like any other board where capsule updates > > > > > lead to resets. > > > > > > > > > > > > > > > > > In dm_test_sysreset_base(), I can see the below code, this means > > > > > > sysreset_request() > > > > > > will not execute real reset, but just mimic the reset, right? > > > > > > > > > > > > state->sysreset_allowed[SYSRESET_WARM] = true; > > > > > > ut_asserteq(-EINPROGRESS, sysreset_request(dev, SYSRESET_WARM)); > > > > > > state->sysreset_allowed[SYSRESET_WARM] = false; > > > > > > > > > > > > > > but Qemu and real board will cause a real reset and it will terminate > > > > > > > > the qemu or stop the board (depends on how it is implemented). Thus, > > > > > > > > if a command or boot process will cause a reset, it will need a > > > > > > > > special care (maybe respawn?). > > > > > > > > > > > > > > Here you need to worry about the surrounding automation logic which > > > > > > > could be tbot of the U-Boot pytest hooks. I suggest you avoid this and > > > > > > > handle it some other way, without reset. > > > > > > > > > > The sandbox should run through exactly the same code path as all other > > > > > boards to get a meaningful test results. Therefore don't put in any > > > > > quirks on C level. Your Python test changes are all that is needed. > > > > > > > > +1, I have the same opinion here. > > > > To exercise capsule-on-disk code, we need a "real" reset > > > > because pytest/CI loop is basically a black-box test. > > > > > > I don't see why you need the reset at all to test the code. > > > > As I repeatedly said, I believe that this is a black-box test and > > a system test. The purpose of the test is to make sure the firmware > > update be performed in real operations as expected, that is, > > a *reset* triggers the action *at the beginning of* system reboot. > > I understand you are frustrated with this, but I just don't agree, or > perhaps don't understand. > > What specific mechanism is used to initiate the firmware update? Is > this happening in U-Boot or somewhere else? There are two ways: a. CapsuleUpdate runtime service b. capsule delivery on disk My original patch provides only (b), partly, because runtime service is a bit hard to implement under the current framework. UEFI specification requires that (b) can/should be initiated by a *reset by a user* and another reset be automatically triggered by UEFI when the update has been completed either successfully or in vain. The latter behavior has been enforced on U-BOOT UEFI implementation by Masami's patch (not this series). Masami's patch (this series) fixes issues around those two resets in pytest. > > > > > You should > > > be able to run a command to make the update happen. How does the > > > updata actually get triggered when you reset? > > > > It's not the purpose of this test. > > Then drop the reset and design the feature with testing in mind. So it's just beyond of my scope. -Takahiro Akashi > Regards, > SImon