Article View: muc.lists.freebsd.hackers
Article #56Re: watchdogd rc ordering
From: Adrian Chadd
Date: Fri, 23 Oct 2026 21:23
Date: Fri, 23 Oct 2026 21:23
115 lines
9978 bytes
9978 bytes
--000000000000a32aa2065e8898be Content-Type: text/plain; charset="UTF-8" hi! On Thu, 22 Oct 2026 at 04:26, Dave Cottlehuber <dch@freebsd.org> wrote: > hi, > > I am working on a driver that attaches the ARM SBSA Generic Watchdog > described by GTDT and takes it over from firmware, for DGX Spark[1]. > > Watchdogd starts via rc, and then all is well. But between when > the driver loads, and when rc kicks in, I need to wait for network, > because the rc ordering puts it after: > > # PROVIDE: watchdogd > # REQUIRE: FILESYSTEMS syslogd > # KEYWORD: nojail shutdown > > Would this not make more sense to happen earlier, such as `REQUIRE: DISK`? > > This seems mostly to be working so far, unless the NICs take longer > than ~ 20s to initialise, in which case the watchdog timer fires *before* > the userland watchdog rc script gets called to "pet the dog" in time. > > In my case, the mlx5en driver does take longer to initialise, because I > don't have anything to plug it into, so the box times out & panics. > > Is the problem here that the watchdog is already armed by the firmware? Are you explicitly re-configuring the timeout to some defined value? IIRC when working on this stuff for MIPS platforms you'll want a couple of things: * the driver self pats the watchdog until userland says "i'm ready to pat the watchdog again" at which point it goes back to userland triggered patting; * some optional configuration that you can set that starts the watchdog at attach time to set to some value that's notionally useful (ie, "the watchdog should fire if the box doesn't boot far enough in say, 60 seconds.") So I /can/ see having watchdogd started earlier being useful - as long as whatever it needs is available! - but unless we're defining it ourselves in the driver, we may see weird platform behaviour differences that lead to unwanted reboots. nice work though, I'm glad we're booting and running on it! -adrian --000000000000a32aa2065e8898be Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">hi!</div><br><div class=3D"gmail_quote gm= ail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, 22 Oct 2= 026 at 04:26, Dave Cottlehuber <<a href=3D"mailto:dch@freebsd.org">dch@f= reebsd.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex">hi,<br> <br> I am working on a driver that attaches the ARM SBSA Generic Watchdog<br> described by GTDT and takes it over from firmware, for DGX Spark[1].<br> <br> Watchdogd starts via rc, and then all is well. But between when<br> the driver loads, and when rc kicks in, I need to wait for network,<br> because the rc ordering puts it after:<br> <br> # PROVIDE: watchdogd<br> # REQUIRE: FILESYSTEMS syslogd<br> # KEYWORD: nojail shutdown<br> <br> Would this not make more sense to happen earlier, such as `REQUIRE: DISK`?<= br> <br> This seems mostly to be working so far, unless the NICs take longer<br> than ~ 20s to initialise, in which case the watchdog timer fires *before*<b= r> the userland watchdog rc script gets called to "pet the dog" in t= ime.<br> <br> In my case, the mlx5en driver does take longer to initialise, because I<br> don't have anything to plug it into, so the box times out & panics.= <br><br></blockquote><div><br></div><div>Is the problem here that the watch= dog is already armed by the firmware?</div><div>Are you explicitly re-confi= guring the timeout to some defined value?</div><div><br></div><div>IIRC whe= n working on this stuff for MIPS platforms you'll want a couple</div><d= iv>of things:</div><div><br></div><div>* the driver self pats the watchdog = until userland says "i'm ready to pat the watchdog again"</di= v><div>=C2=A0 at which point it goes back to userland triggered patting;</d= iv><div>* some optional configuration that you can set that starts the watc= hdog at attach time</div><div>=C2=A0 to set to some value that's notion= ally useful (ie, "the watchdog should fire if the box</div><div>=C2=A0= doesn't boot far enough in say, 60 seconds.")</div><div><br></div= ><div>So I /can/ see having watchdogd started earlier being useful - as lon= g as whatever</div><div>it needs is available! - but unless we're defin= ing it ourselves in the driver, we may</div><div>see weird platform behavio= ur differences that lead to unwanted reboots.</div><div><br></div><div>nice= work though, I'm glad we're booting and running on it!</div><div><= br></div><div><br></div><div><br></div><div>-adrian</div><div>=C2=A0</div><= /div></div> --000000000000a32aa2065e8898be-- -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<CAJ-Vmo=augejFnsmY8FUapZmUADjWnK6pR6tiKxZdZ7LSiL4sQ@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mailReferences:
<f0cb318d-a06d-4b24-8a80-c6ae765dde17@app.fastmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Adrian Chadd <adrian@freebsd.org>
Newsgroups: muc.lists.freebsd.hackers
Subject: Re: watchdogd rc ordering
Date: Fri, 23 Oct 2026 14:23:38 -0700
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-hackers@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <CAJ-Vmo=augejFnsmY8FUapZmUADjWnK6pR6tiKxZdZ7LSiL4sQ@mail.gmail.com>
References: <f0cb318d-a06d-4b24-8a80-c6ae765dde17@app.fastmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000a32aa2065e8898be"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
logging-data="87188"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
t=1792790633; h=from:from:sender:sender:reply-to:subject:subject:date:date:
message-id:message-id:to:to:cc:cc:mime-version:mime-version:
content-type:content-type:in-reply-to:in-reply-to:
references:references:list-id:list-help:list-owner:list-unsubscribe:
list-subscribe:list-post; bh=CNWqDVuiNxs5pzCetcNQR9z0IqPLXOaJLxv2DGGEyEo=;
b=lvQXupEpymGxa3qxLbIoH/Dy96Qop/xcH448d2Bw2LfNrJzan8oa2oah0m3PyI3vSKDisn
Ta2iuNkScm4XgNjbUcwqGRfmhiWPrkwMMEABe5AIaPSo+vo8/Bq3yKHhMqIJK7ViRaDonV
PxxeF5ZkQOhQ8vJczN1JFG5aW9Y6TlmVLNScP8/K4mjN+6Js6y1b8BdZOv8W23go/UW9F2
AlWIPxKgggO8vk0WOtJTHb2dqu2TMfhMLUYJS03NMFvzIkjIW+mLseJNUlGbFhQ0P0BnCe
YdKfsSaSCRQHzKmODGg657HJd8tXqZJytdAHdPNjzlVP7UXzR37YxGoU/2lFhg==
X-Original-To: hackers@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
dkim=none;
arc=pass ("google.com:s=arc-20260327:i=1");
spf=pass (mx1.freebsd.org: domain of adrian.chadd@gmail.com designates 209.85.222.174 as permitted sender) smtp.mailfrom=adrian.chadd@gmail.com;
dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792790630; x=1793395430;
h=content-type:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=CNWqDVuiNxs5pzCetcNQR9z0IqPLXOaJLxv2DGGEyEo=;
b=hI2ScLMn52A+uH3XGD2iuIiJNa3Jso0OypmdGoY4BbDZzc4gwvC1iU9LqvPErtNTc/
TMpPb/rjU0ClgUfCS44My6XdUwzoGOUYjRyoWu0n/5ZQp0ddHFrNyAMREciuusdwVPHk
RGoUDgf/70L6nBM2PJ5PNEABiF2nezjJEAewE/fZ+GXRD8GBR5vVo3kLTw3zF6GE+LrB
ZS85Syt/pR/s4dnTcg4H9rQvX2S8dgqOUMWVP/ecuM4AiXp0PM7pR2yZ6GXdWdA6ljnl
k0sDQAEEsAFkVwCtoMXhECIxpcA6uS2r0QfYTZHpkyv0VW8JiX5UhXM9E6y+eeAJp5cV
HiKg==
X-Gm-Message-State: AFq9FYLZcES8sGKOvfBoiULwGawZYhAR167l52iz3YWP0V88VVIj5FJW
BZl0ievgJV9K2Tk+FIT8l9yprNmBfCG5ZCl6z2qn+A+bGiv6hEqs7zeTb9Pa0M1VbVM3i1SY8eM
H6unsVupsq2Z80kDNvMI0uXEn+xnfsz/mQg==
X-Gm-Gg: AYBFou3MiOOwD7+xpbnQovYOGH0DVgrJM7svKVyj7zAem3W8RnjQ5TJIO0+lYurB2cj
MZcBr+ckuIcbJbp/zvi9YtOt2nQvtChdHTHW4phYM4/t4mkDBmy56fM6nErSnoqLtq19/Giozwl
YQiuRlfSYxzvdPk/nu57QqDTmggZ3ChYs3SNN38BgqKCHLxiXZGiF8a8ogUrq5GbwM0QNga1fgm
IHYwOTnd8tHhRx2gDuZp9k3Z/y24KhATNJVhi8bixCeP74PFJto8lOSCx6ajKV5+RhTYhVA5NL4
WisOxxJb2jm0tRzpQwabKtWa1eSRvTK296Ca2ObCqnwD+aJ6xARFSneZwBxqo92LR0Hc5AIGVNV
cdH7PxwOsiqF6jiN+h7LiOWUTEZqdEiRfXtNPUSJYQ9GP8hSdCdPF428M/CYSSyjfG8mw+vK18k
2B24ZxrYst4LEK5YjcBjDaItWKB7ajC4agz6S6xx1ykRW1I7lpKe+ohPmy8uNj/r4t/Djhgxe5f
PZlVuKewNLRAQx9C502p10/ZihnFDjMn/ff/KDeSM0=
Precedence: list
In-Reply-To: <f0cb318d-a06d-4b24-8a80-c6ae765dde17@app.fastmail.com>
X-Gm-Features: AclHuK9DfRUYE_LZT-QtfAEu9cGVjUKgG-vcLeEhbbXSAXvULe1gQbHZqzNGboE
X-Spamd-Bar: /
X-Spamd-Result: default: False [-0.90 / 15.00];
ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1];
FORGED_SENDER(0.30)[adrian@freebsd.org,adrianchadd@gmail.com];
R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17];
MIME_GOOD(-0.10)[multipart/alternative,text/plain];
DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none];
RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.174:from];
MISSING_XM_UA(0.00)[];
MIME_TRACE(0.00)[0:+,1:+,2:~];
ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US];
RCVD_TLS_LAST(0.00)[];
RCVD_COUNT_ONE(0.00)[1];
RCPT_COUNT_TWO(0.00)[2];
R_DKIM_NA(0.00)[];
MLMMJ_DEST(0.00)[hackers@freebsd.org];
FROM_NEQ_ENVFROM(0.00)[adrian@freebsd.org,adrianchadd@gmail.com];
FROM_HAS_DN(0.00)[];
FREEMAIL_ENVFROM(0.00)[gmail.com];
TO_MATCH_ENVRCPT_SOME(0.00)[];
TO_DN_ALL(0.00)[];
PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org];
ALIAS_RESOLVED(0.00)[];
RCVD_IN_DNSWL_NONE(0.00)[209.85.222.174:from]
X-Rspamd-Queue-Id: 4jBGGt4Ts9z4pnG
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes