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 7ABEEC25B0E for ; Tue, 16 Aug 2022 11:49:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F5E4849A5; Tue, 16 Aug 2022 13:48:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org 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=chromium.org header.i=@chromium.org header.b="XfkZzTqL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CECE984994; Tue, 16 Aug 2022 13:48:30 +0200 (CEST) Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) (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 DEFE983ACA for ; Tue, 16 Aug 2022 13:48:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-3246910dac3so143427397b3.12 for ; Tue, 16 Aug 2022 04:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Qbj08hpcovH27kNB2N+Iu6VVuCsdZPL+x+MNhYzlldk=; b=XfkZzTqLV6JyFdHO7WYxCi5fJiw/1iVO71qvgm+vDsSbyVOclCj6Vf3gPnaKK+p64j gZpAfcYAMniNvH9eucVtC8X3Ar8BDQDs0rahl2ELvGZdFLm7AyITj3sUwiGhVuHRB52j 3NAFuA5vGQrr8HtxoTbwQkx/DXLYtem2SzZLs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Qbj08hpcovH27kNB2N+Iu6VVuCsdZPL+x+MNhYzlldk=; b=CKL1RW7xcNbroAmS9qI8gPgvaD1c2BjzxabWEbr/1rhYsVzzQ9T5b08WH0a9/NZ4Hg QLRQGCrw84bujR7hD5QbHdBdejAO2z8jUZg8QV8xs2hfOAQDxWMbMkjcR4QzorZdbefF Nwifz928u/FmIPOnbSBR9HyCjo4sssvsf8KPCz42LPuayhg4mg7RHQ34acEWI6giRa0/ t5POugevDat3+ExfNuuV5hUYXgWp3SR0jlP+n/WDTV9n6B0G+61rcwdjAcKzJ/Kw87YR 3qNBw8plKzlLdYyWDFUdj+QJ3JadoyLZk7VSJTy9GQxY1fdJhW5I8d2qqVnJhv0JdMQM DD/w== X-Gm-Message-State: ACgBeo1Ty5hLrhPrA/R5I7G4oW5fmVyYhTtzG1qHd5kIb9vwflsp1vPY /X5+UuOVzJv6/sZqZgmsEjgyUNhrutfMpqgUZKioug== X-Google-Smtp-Source: AA6agR4okMNirkHadmRvEmFv5bPsYzTuz5s5Ae+tLFVi7nUzag7LGRH9IOELII8cXxrQ2R1R8Ln5Xj0zjQ86w8i2bhE= X-Received: by 2002:a81:1308:0:b0:333:450f:7ca5 with SMTP id 8-20020a811308000000b00333450f7ca5mr2752003ywt.328.1660650505461; Tue, 16 Aug 2022 04:48:25 -0700 (PDT) MIME-Version: 1.0 References: <20220816102816.2938010-1-sr@denx.de> <20220816102816.2938010-7-sr@denx.de> In-Reply-To: <20220816102816.2938010-7-sr@denx.de> From: Simon Glass Date: Tue, 16 Aug 2022 05:48:13 -0600 Message-ID: Subject: Re: [PATCH v4 6/9] sandbox: Add cyclic demo function To: Stefan Roese Cc: U-Boot Mailing List , Tom Rini , Chandrakala Chavva , Aaron Williams Content-Type: text/plain; charset="UTF-8" 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 Hi Stefan, On Tue, 16 Aug 2022 at 04:28, Stefan Roese wrote: > > This patch enables the cyclic infrastructure on sandbox and also adds > one simple example/demo functions using this cyclic functionality. > > Signed-off-by: Stefan Roese > --- > v4: > - Rename cyclic_struct to cyclic_info > > v3: > - No change > > v2: > - Extend CONFIG_CYCLIC_MAX_CPU_TIME_US to 10000ms as running this > in CI might take a bit longer > > board/sandbox/sandbox.c | 15 +++++++++++++++ > configs/sandbox_defconfig | 3 +++ > 2 files changed, 18 insertions(+) Now that we have the test, do we need this? Or perhaps it should be a 'cyclic demo' command? > > diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c > index ca9a2ca5b17c..f633b8e63768 100644 > --- a/board/sandbox/sandbox.c > +++ b/board/sandbox/sandbox.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -17,6 +18,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -106,8 +108,21 @@ int dram_init(void) > return 0; > } > > +static void cyclic_demo(void *ctx) > +{ > + /* Just a small dummy delay here */ > + udelay(10); > +} > + > int board_init(void) > { > + struct cyclic_info *cyclic; > + > + /* Register demo cyclic function */ > + cyclic = cyclic_register(cyclic_demo, 10 * 1000, "cyclic_demo", NULL); > + if (!cyclic) > + printf("Registering of cyclic_demo failed\n"); > + > return 0; > } > > diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig > index eba7bcbb483b..8b6c003760f2 100644 > --- a/configs/sandbox_defconfig > +++ b/configs/sandbox_defconfig > @@ -34,6 +34,8 @@ CONFIG_LOG=y > CONFIG_LOG_MAX_LEVEL=9 > CONFIG_LOG_DEFAULT_LEVEL=6 > CONFIG_DISPLAY_BOARDINFO_LATE=y > +CONFIG_CYCLIC=y > +CONFIG_CYCLIC_MAX_CPU_TIME_US=10000 > CONFIG_STACKPROTECTOR=y > CONFIG_ANDROID_AB=y > CONFIG_CMD_CPU=y > @@ -114,6 +116,7 @@ CONFIG_CMD_EROFS=y > CONFIG_CMD_EXT4_WRITE=y > CONFIG_CMD_SQUASHFS=y > CONFIG_CMD_MTDPARTS=y > +CONFIG_CMD_CYCLIC=y > CONFIG_CMD_STACKPROTECTOR_TEST=y > CONFIG_MAC_PARTITION=y > CONFIG_AMIGA_PARTITION=y > -- > 2.37.2 > Regards, Simon