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 93514C433EF for ; Mon, 14 Mar 2022 01:08:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9D5F83B74; Mon, 14 Mar 2022 02:08:29 +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="k352U7UG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED0E383B74; Mon, 14 Mar 2022 02:08:25 +0100 (CET) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 12D2C83B32 for ; Mon, 14 Mar 2022 02:08:21 +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-x1030.google.com with SMTP id bx5so13038805pjb.3 for ; Sun, 13 Mar 2022 18:08:20 -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=ePfKddTeOV6YJzpN1R98Tq3YXw/BbwsFLkmyPWoaKd8=; b=k352U7UGTXKoRoi5PK3qkw0HAEm/O+FZGyUXZbpV1f6iBZSky+VZ6+mTQAJqfxdMVI gUn5nZLeYkDD7VrReje9neDO+NGPTzlHQcDHtiNvwpeShFroQKTjdVIV16nR41RUQo6I ruDDjw3wiGk8rXv7bXy8WsA2q2UjNnuucjqGbfqEOjsAGWrxxdsJqzfL5yzcz4cOTWxk uRQsJDX4BoT5nFI5j2j6LmiJEjkSNn1b+sPd0v//+fWmx7DP3JroIoBYBuMtjMWke1GO wtVbvCut91AT+YZA3kN0R6t1xj6PqjhINCJVSr1gV6sdEXMIFVHDY2U1rrRf5lluASe6 FDvQ== 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=ePfKddTeOV6YJzpN1R98Tq3YXw/BbwsFLkmyPWoaKd8=; b=XjfOS04MZve4Ix92sY+L7HnWByR8jhxPW+qWc+fbT1QWJ3TL1SJ+SaVN6ZgfxfBbRl eEvk4sA8GhAs5LpLinuTkP49U51cbvgfwoXEpBvjMXeet3ihGnVF4Oi4R0bjqjAl0WIc cOeQeT+RAB2mb58pW9pLpXQwPFfx9xwtcQJzSZvYtsJvaqlpgvpIO2zd+Hq8C9nDSiOt mBG8mXGB9WlSFpT9XuRDp+N68iI10wXVbx6MjiOrHqdBCDXHNGRBe77Nabe4REMe4nII CYVcay/NXRLtKHKfJVT6E74CDsZLUfIMCJstDKNTB7WmrTdDa8XtqLydEF3hgaGrsdOy cekw== X-Gm-Message-State: AOAM5303sczO8HNnSyQ6n27JgGHSSkOo8rjZNZ5ev+5oDJfqPDK79d97 lzidKfIKJRh7+z1BtwO1ZZwE5w== X-Google-Smtp-Source: ABdhPJxFytLP2h7Lx8PtfFn1o07vll6dHHlqrFQFge30kCxivIFiAtPLWrc4iNZtAeBFuY0rc4MDSA== X-Received: by 2002:a17:903:2c7:b0:14f:fc47:5a2f with SMTP id s7-20020a17090302c700b0014ffc475a2fmr21379763plk.112.1647220099267; Sun, 13 Mar 2022 18:08:19 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:69ab:dc6d:d6e2:371d]) by smtp.gmail.com with ESMTPSA id 67-20020a630846000000b00372782a65d0sm15870432pgi.60.2022.03.13.18.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 18:08:18 -0700 (PDT) Date: Mon, 14 Mar 2022 10:08:13 +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: <20220314010813.GA37492@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: <20220216154642.GA1576803@bill-the-cat> <4ba143f8-6114-db0e-08e2-d97ac9dc6e13@gmx.de> <20220219011550.GB6672@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 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. > 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. -Takahiro Akashi > > [..] > > Regards, > Simon