mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Julian Vetter <jvetter@kalrayinc.com>, barebox@lists.infradead.org
Cc: Yann Sionneau <ysionneau@kalrayinc.com>
Subject: Re: [PATCH] kvx: watchdog: Add early watchdog init
Date: Thu, 24 Oct 2024 15:03:50 +0200	[thread overview]
Message-ID: <0cc21fc3-a980-4d77-b05d-5c94dc3803ef@pengutronix.de> (raw)
In-Reply-To: <1afa7a34-5a08-48a8-b037-9ea59507aa43@kalrayinc.com>

On 24.10.24 14:35, Julian Vetter wrote:
fdef CONFIG_WATCHDOG_KVX_EARLY_INIT>>
>> Move this down before the core_initcall
>>
>>> +static int kvx_wdt_early_init(void)
>>
>> Add __maybe_unused here.
>>
>> That way compile test in CI tests this function even if option is disabled.
>>
> 
> I have tried what you proposed but the CONFIG_WATCHDOG_KVX_EARLY_TIMEOUT is only defined if we enable the CONFIG_WATCHDOG_KVX_EARLY_INIT. So, it fails if we have the watchdog enabled but not the EARLY_INIT. I could either keep the #ifdef before the function. So, it will not be covered by compile tests or I add something like the following to the function:
> 
> int wtd_timeout = 0;
> 
> #ifdef CONFIG_WATCHDOG_KVX_EARLY_INIT
> wtd_timeout = CONFIG_WATCHDOG_KVX_EARLY_TIMEOUT
> #endif
> 
> What do you think?

I missed the undefined macro. Never mind then, I think
we can leave it as is.

Cheers,
Ahmad

> 
> Thank you.
> 
>>> +{
>>> +    /* Set Start watchdog counting */
>>> +    kvx_sfr_set(WDV, CONFIG_WATCHDOG_KVX_EARLY_TIMEOUT);
>>> +    kvx_sfr_set(WDR, 0);
>>> +
>>> +    /* Start watchdog counting */
>>> +    kvx_sfr_set_field(TCR, WUI, 1);
>>> +    kvx_sfr_set_field(TCR, WCE, 1);
>>> +
>>> +    return 0;
>>> +}
>>> +core_initcall(kvx_wdt_early_init);
>>> +#endif
>>
>>
> 
> 
> 
> 
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2024-10-24 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23  8:55 Julian Vetter
2024-10-23  9:25 ` Ahmad Fatoum
2024-10-24 12:35   ` Julian Vetter
2024-10-24 13:03     ` Ahmad Fatoum [this message]

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=0cc21fc3-a980-4d77-b05d-5c94dc3803ef@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jvetter@kalrayinc.com \
    --cc=ysionneau@kalrayinc.com \
    /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