All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Stefan Roese <sr@denx.de>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Tom Rini <trini@konsulko.com>,
	 Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: Re: [RFC PATCH 3/8] cyclic: Introduce schedule() function
Date: Mon, 29 Aug 2022 20:31:35 -0600	[thread overview]
Message-ID: <CAPnjgZ1jeiwEPXae2DWy999s4p85HwvAxr6xXKbH5XnfBNk90w@mail.gmail.com> (raw)
In-Reply-To: <20220829062313.32654-4-sr@denx.de>

Hi Stefan,

On Mon, 29 Aug 2022 at 00:23, Stefan Roese <sr@denx.de> wrote:
>
> This patch introduces a schedule() function, which shall be used instead
> of the old WATCHDOG_RESET. Follow-up patches will make sure, that this
> new function is used.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> ---
>  common/cyclic.c  | 11 +++++++++++
>  include/cyclic.h |  5 +++++
>  2 files changed, 16 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

but see below

>
> diff --git a/common/cyclic.c b/common/cyclic.c
> index 766a98382596..6402af4542e9 100644
> --- a/common/cyclic.c
> +++ b/common/cyclic.c
> @@ -20,6 +20,8 @@ struct list_head cyclic_list;
>  static bool cyclic_ready;
>  static bool cyclic_running;
>
> +void hw_watchdog_reset(void);
> +
>  struct cyclic_info *cyclic_register(cyclic_func_t func, uint64_t delay_us,
>                                     const char *name, void *ctx)
>  {
> @@ -93,6 +95,15 @@ void cyclic_run(void)
>         cyclic_running = false;
>  }
>
> +void schedule(void)
> +{
> +       /* The HW watchdog is not integrated into the cyclic IF (yet) */
> +       if (IS_ENABLED(CONFIG_HW_WATCHDOG))
> +               hw_watchdog_reset();
> +
> +       cyclic_run();
> +}
> +
>  int cyclic_uninit(void)
>  {
>         struct cyclic_info *cyclic, *tmp;
> diff --git a/include/cyclic.h b/include/cyclic.h
> index 2ae1cba32f20..5cea3fb3e9b4 100644
> --- a/include/cyclic.h
> +++ b/include/cyclic.h
> @@ -78,6 +78,7 @@ int cyclic_init(void);
>  int cyclic_uninit(void);
>
>  void cyclic_run(void);
> +void schedule(void);

Both of these need a full function comment.

>  #else
>  static inline struct cyclic_info *cyclic_register(cyclic_func_t func,
>                                                   uint64_t delay_us,
> @@ -96,6 +97,10 @@ static inline void cyclic_run(void)
>  {
>  }
>
> +static inline void schedule(void)
> +{
> +}
> +
>  static inline int cyclic_init(void)
>  {
>         return 0;
> --
> 2.37.2
>

Regards,
Simon

  reply	other threads:[~2022-08-30  2:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29  6:23 [RFC PATCH 0/8] Migrate watchdog reset to cyclic infrastructure Stefan Roese
2022-08-29  6:23 ` [RFC PATCH 1/8] cmd/cyclic: Use div64 macros for division and remainder Stefan Roese
2022-08-30  2:31   ` Simon Glass
2022-08-29  6:23 ` [RFC PATCH 2/8] watchdog: Integrate watchdog triggering into the cyclic framework Stefan Roese
2022-08-29  7:38   ` Rasmus Villemoes
2022-08-29  8:09     ` Stefan Roese
2022-08-29  6:23 ` [RFC PATCH 3/8] cyclic: Introduce schedule() function Stefan Roese
2022-08-30  2:31   ` Simon Glass [this message]
2022-08-29  6:23 ` [RFC PATCH 4/8] cyclic: Use schedule() instead of WATCHDOG_RESET() Stefan Roese
2022-08-30  2:31   ` Simon Glass
2022-08-29  6:23 ` [RFC PATCH 5/8] watchdog: Get rid of ASSEMBLY hacks Stefan Roese
2022-08-29  7:50   ` Rasmus Villemoes
2022-08-29  8:31     ` Stefan Roese
2022-08-29  6:23 ` [RFC PATCH 6/8] watchdog: Remove WATCHDOG_RESET macro Stefan Roese
2022-08-30  2:31   ` Simon Glass
2022-08-29  6:23 ` [RFC PATCH 7/8] watchdog: Further cleanup Stefan Roese
2022-08-30  2:31   ` Simon Glass
2022-08-29  6:23 ` [RFC PATCH 8/8] WIP: .azure-pipelines.yml: Remove evb-ast2600 Stefan Roese
2022-09-02  4:09   ` Joel Stanley
2022-09-02  6:00     ` Joel Stanley
2022-09-02  6:14       ` Stefan Roese
2022-09-02  7:44         ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPnjgZ1jeiwEPXae2DWy999s4p85HwvAxr6xXKbH5XnfBNk90w@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sr@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.