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 45C83ECAAD8 for ; Tue, 20 Sep 2022 07:30:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1641A84B10; Tue, 20 Sep 2022 09:30:46 +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="WvccGl4k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ED09084C5B; Tue, 20 Sep 2022 09:30:43 +0200 (CEST) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 316A184B10 for ; Tue, 20 Sep 2022 09:30:41 +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=ilias.apalodimas@linaro.org Received: by mail-wm1-x331.google.com with SMTP id v185-20020a1cacc2000000b003b42e4f278cso6266787wme.5 for ; Tue, 20 Sep 2022 00:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=aWGljXa0t5HXFlkvJp4uiLEr1cd2uOCMDjwA2HCTj+s=; b=WvccGl4k0YoCw99dFNq8I9sS3dwiUx3/jHM+rQQ0LwFPetAT4fkyVvzuzZIJg2jKyN sqRA/LBg2DMoXjjRT/e41WMBjRKNO1PcWii2fcETelFSwOYhL41pAYum714UJyps33cl pHN3IUF/XKuzFzmJFpenUp/un7ZIiCdUrZZplmo6EOx3FfWoTPz5POWutmCARRR8Lf+p pa68DZ2zOTFfnyWT3WFm3iJuj9iHySZJjzfICd7ol7vR2IM39lDbJsZNWw7bO59679wr WsZ6Zwajw3yAisQl5hwUnTRpOZhAdgHLncr3CT6GRNP/cKVQv3SoqaVJuGHhQ19wAO9n NrxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=aWGljXa0t5HXFlkvJp4uiLEr1cd2uOCMDjwA2HCTj+s=; b=IxqhHs6ayF8Z2++NylvwLz/5f4Kg+Iasgx/DR6tgvYd+v2qrz9SDOvMDm/V/3PDjRv XRsee8MKE8deDjP9kY4T/nU8+xCeR9DVtDOedY+GJN3/tE1R9Ppcr0Jee3YbfUWOnPoi E9G0KEunvIImmuaSUd7jOY4jiSoTzGuRMKk/VFnpIjkBP4ULQMgMrwElvHZ3RhR17M/C WjHWzvEGFCOF1QJJWHHiPzMlwrXylZdYFMugC/NmWcYMaQKVfLKfE2wC8aTjvAhXSbGD QNSVBoxcMmjQR7210w3NTZHSET7I9YpNZcdP+UhIOyg+zSkMhIeiUUfIUsPMknMWT5MO eAOw== X-Gm-Message-State: ACrzQf3qI7CCyzXz4TLSgDPLJacsI+1Dy1+HT50rVjt5r/H8TUd6c6eN 7CNYGLJAGh3uF/kjj/pXUXcZCw== X-Google-Smtp-Source: AMsMyM4Epph6FJ4o+bbD8cQgQ+cPwE1nG/00/We9TaO+y/KYqUC4rVnmYhP2MRlSwvI95oGkbqqhRw== X-Received: by 2002:a05:600c:4e91:b0:3b4:bcbd:b641 with SMTP id f17-20020a05600c4e9100b003b4bcbdb641mr1314561wmq.59.1663659040551; Tue, 20 Sep 2022 00:30:40 -0700 (PDT) Received: from hades ([46.103.15.185]) by smtp.gmail.com with ESMTPSA id a11-20020adfdd0b000000b00228d67db06esm759966wrm.21.2022.09.20.00.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 00:30:40 -0700 (PDT) Date: Tue, 20 Sep 2022 10:30:37 +0300 From: Ilias Apalodimas To: Sughosh Ganu Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Takahiro Akashi , Patrick Delaunay , Patrice Chotard , Simon Glass , Bin Meng , Tom Rini , Etienne Carriere , Michal Simek , Jassi Brar Subject: Re: [PATCH v10 08/15] event: Add an event for main_loop Message-ID: References: <20220915081451.633983-1-sughosh.ganu@linaro.org> <20220915081451.633983-9-sughosh.ganu@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220915081451.633983-9-sughosh.ganu@linaro.org> 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 On Thu, Sep 15, 2022 at 01:44:44PM +0530, Sughosh Ganu wrote: > Add an event type EVT_MAIN_LOOP that can be used for registering > events that need to be run after the platform has been initialised and > before the main_loop function is called. > > Signed-off-by: Sughosh Ganu > Reviewed-by: Simon Glass > --- > Changes since V9: > * Add a comment to indicate where the event notification will be > called, as suggested by Simon. > > common/board_r.c | 3 +++ > common/event.c | 3 +++ > include/event.h | 3 +++ > 3 files changed, 9 insertions(+) > > diff --git a/common/board_r.c b/common/board_r.c > index 56eb60fa27..1db061e65c 100644 > --- a/common/board_r.c > +++ b/common/board_r.c > @@ -576,6 +576,9 @@ static int run_main_loop(void) > #ifdef CONFIG_SANDBOX > sandbox_main_loop_init(); > #endif > + > + event_notify_null(EVT_MAIN_LOOP); > + > /* main_loop() can return to retry autoboot, if so just run it again */ > for (;;) > main_loop(); > diff --git a/common/event.c b/common/event.c > index 3e34550978..231b9e6ffd 100644 > --- a/common/event.c > +++ b/common/event.c > @@ -38,6 +38,9 @@ const char *const type_name[] = { > > /* fdt hooks */ > "ft_fixup", > + > + /* main loop events */ > + "main_loop", > }; > > _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size"); > diff --git a/include/event.h b/include/event.h > index e8f2f55c63..8089b464b1 100644 > --- a/include/event.h > +++ b/include/event.h > @@ -34,6 +34,9 @@ enum event_t { > /* Device tree fixups before booting */ > EVT_FT_FIXUP, > > + /* To be called once, before calling main_loop() */ > + EVT_MAIN_LOOP, > + > EVT_COUNT > }; > > -- > 2.34.1 > Reviewed-by: Ilias Apalodimas