u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: Rasmus Villemoes <rasmus.villemoes@prevas.dk>, u-boot@lists.denx.de
Cc: trini@konsulko.com, sjg@chromium.org
Subject: Re: [RFC PATCH 5/8] watchdog: Get rid of ASSEMBLY hacks
Date: Mon, 29 Aug 2022 10:31:07 +0200	[thread overview]
Message-ID: <3dc42a42-0c8d-1409-c0e7-3238c87de289@denx.de> (raw)
In-Reply-To: <7a12c12a-4003-80f7-c6b5-6c19cf16d943@prevas.dk>

On 29.08.22 09:50, Rasmus Villemoes wrote:
> On 29/08/2022 08.23, Stefan Roese wrote:
>> Only one occurance of WATCHDOG_RESET is left in one assembler file.
>> This patch changes this occurance to a direct call to watchdog_reset
> 
> Well...
> 
>> and then removes all the ASSEMBLY ifdef'ery in watchdog.h, as it's not
>> needed any more to clean this mess a bit up.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> ---
>>   arch/powerpc/lib/ticks.S |  5 ++--
>>   include/watchdog.h       | 50 +++++++++++++---------------------------
>>   2 files changed, 19 insertions(+), 36 deletions(-)
>>
>> diff --git a/arch/powerpc/lib/ticks.S b/arch/powerpc/lib/ticks.S
>> index c487f938fa8d..8647d77cc9ad 100644
>> --- a/arch/powerpc/lib/ticks.S
>> +++ b/arch/powerpc/lib/ticks.S
>> @@ -9,7 +9,6 @@
>>   #include <ppc_asm.tmpl>
>>   #include <ppc_defs.h>
>>   #include <config.h>
>> -#include <watchdog.h>
>>   
>>   /*
>>    * unsigned long long get_ticks(void);
>> @@ -42,7 +41,9 @@ wait_ticks:
>>   	addc    r14, r4, r14	/* Compute end time lower */
>>   	addze	r15, r3		/*     and end time upper */
>>   
>> -	WATCHDOG_RESET		/* Trigger watchdog, if needed */
>> +#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
>> +	bl	schedule	/* Trigger watchdog, if needed */
> 
> ...you actually change it to a call to schedule(), which AFAICT doesn't
> always exist (at least as a function with external linkage). Or does it
> if either one of those conditions are met?

It has passed the CI world build at least, so I assume all is fine
with this change.

> Side note: Oh gosh do I hope this can put an end to the CONFIG_WATCHDOG
> v CONFIG_HW_WATCHDOG silliness; what is a watchdog if not a piece of HW.

Right. I was not brave enough to remove CONFIG_HW_WATCHDOG with this
patchset yet. But it's definitely on my list, to remove non DM watchdog
support and the HW_WATCHDOG stuff as well. Meaning to get this stuff
re-worked to support DM WDT as well or dropped if it's not maintained
any more.

>>   	#if defined(CONFIG_WATCHDOG)
>> -		#if defined(__ASSEMBLY__)
>> -			/* Don't require the watchdog to be enabled in SPL */
>> -			#if defined(CONFIG_SPL_BUILD) &&		\
>> -				!defined(CONFIG_SPL_WATCHDOG)
>> -				#define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/
> 
> Yes please. I strongly suspect that comment is some ancient leftover
> from some none-complying preprocessor or whatnot.

Frankly, this definitely needs intensive and especially board testing.
So that all permutations of SPL and non-SPL watchdog support will still
be working with this patchset / migration.

Thanks,
Stefan


  reply	other threads:[~2022-08-29  8:31 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
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 [this message]
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=3dc42a42-0c8d-1409-c0e7-3238c87de289@denx.de \
    --to=sr@denx.de \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).