Skip to content

hisilicon-opensdk: bump to b922e19, so the watchdog can reset the board - #2400

Merged
widgetii merged 1 commit into
masterfrom
hisilicon-opensdk-bump-wdt
Sep 12, 2026
Merged

widgetii merged 1 commit into
masterfrom
hisilicon-opensdk-bump-wdt

Conversation

@widgetii

Copy link
Copy Markdown
Member

Bumps hisilicon-opensdk from 916e767 to b922e19, picking up OpenIPC/openhisilicon#223.

Fixes #1803. Touches #127 — see the end.

What it fixes

The watchdog driver did not honour the Linux watchdog API in six ways. The one
that matters most here is #1803: release() set the driver's state back to
SELFCLR, which handed the device to the driver's own kernel feeder thread. So
the moment majestic died and the kernel closed its descriptor for it, the driver
went on feeding the dog for the rest of the board's life, and nothing ever reset.
The only workaround available was nodeamon=1 — which removes the feeder
altogether, and with it the cover between module load and the first open.

Measured on the lab boards before the change:

board
hi3516ev300 majestic SIGKILLed at uptime 40195 still up at 40400
hi3516av300 SIGKILLed at 215043 still up at 215249
gk7205v200 probe died at 28050 still up 164 s later

The rest, briefly:

  • The margin meant twice itself. The SP805 runs its load value twice before
    resetting, so a whole margin in the counter made every timeout double. 30 s
    reset the board at 58.
  • A ping did nothing for half of every cycle. feed() returned without
    touching anything unless an interrupt was already pending, so the honest
    cadence of one ping per half-margin was worth one accepted ping per cycle —
    miss it and a process that had been feeding all along got reset under it.
  • open() did not start the timer. After any deliberate stop the device was
    inert while looking entirely healthy: open succeeded, the margin was accepted
    and read back, pings were accepted, and nothing would ever reset.
  • A reopen ran at the counter maximum, not the margin the caller had set —
    GETTIMEOUT said 30 while the hardware ran at 1431 s.
  • rmmod racing an open() could wedge the board in D state holding
    module_mutex, past a clean reboot. It cost one lab board a power cycle.

hi3516cv300 gains a watchdog it never had

Its driver contained no module entry point and its build linked no init object,
so hi3516cv300_wdt.ko loaded, did nothing, and the board came up with no
/dev/watchdog
. majestic logged Watchdog device (/dev/watchdog) not found
and every cv300 has been running unguarded. Confirmed on a lab cv300 before the
change; after it majestic logs Detected Watchdog / Watchdog timeout set to 300 seconds for the first time.

Verified

Four lab cameras, both binding styles. Crash path is open, SETTIMEOUT(30), die
without "V"; the board must reset one margin later and come back.

board crash → reset GETTIMELEFT reopen keeps margin clean majestic stop majestic soak
hi3516cv300 30 s (was: no device) 299/300 yes no reset 456 s
hi3516av300 30 s (was: never) 299/300 yes no reset 491 s
hi3516ev300 30 s (was: never) 299/300 yes no reset 1327 s
gk7205v200 30 s (was: never) 299/300 yes no reset

All 35 checks green on the upstream PR, including the SDK builds and QEMU boots
for every affected chip.

Worth a release note

A cv300 whose majestic wedges will now reboot where it previously sat there
unguarded. That is the fix working, but it is a behaviour change in the field
and the first thing anyone will notice.

On #127

That issue asks for the watchdog module on hi3516cv200/hi3518ev200. It is
already insmoded there — the #nodeamon=1 beside it in load_hisilicon is a
comment, not a parameter — but the .ko is a prebuilt vendor blob shipped in
general/package/hisilicon-osdrv-hi3516cv200/files/kmod/wdt.ko, dated 2022. So
none of the above reaches those boards. The V2 generation also has no OSAL at
all, which is why upstream left its copy of the driver alone. Both are separate
pieces of work; noting it here so the issue is not closed on the strength of
this bump.

OpenIPC/openhisilicon#223. The watchdog driver did not honour the Linux
watchdog API in six ways, and the one that matters most here is #1803:
release() handed the device back to the driver's own kernel feeder, so
the moment majestic died and the kernel closed its descriptor, the
driver went on feeding the dog for the rest of the board's life. Nothing
ever reset. The only workaround was nodeamon=1, which removes the feeder
altogether and with it the cover between module load and the first open.

Also: the margin meant twice what was asked for; a ping was ignored for
half of every cycle; open() did not start the timer, so the device went
inert after any deliberate stop while still looking healthy; a reopen ran
at the counter maximum rather than the margin the caller had set; and an
rmmod racing an open could wedge the board in D state past a clean
reboot.

hi3516cv300 gains a watchdog it never had. Its driver had no module entry
point at all, so hi3516cv300_wdt.ko loaded, did nothing, and the board
came up with no /dev/watchdog -- majestic logged "Watchdog device
(/dev/watchdog) not found" and every cv300 ran unguarded.

Measured on four lab cameras, both binding styles: a process that dies
without writing "V" now resets the board one margin later and it comes
back; GETTIMELEFT reads 299 of 300; the magic close works; a clean
majestic stop still resets nothing; and majestic feeding at its own
cadence soaks past the margin without a reboot.

Worth knowing before this ships: a cv300 whose majestic wedges will now
reboot where it previously sat there unguarded. That is the fix, but it
is a behaviour change in the field.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Bump hisilicon-opensdk to restore watchdog resets

🐞 Bug fix ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Bump openhisilicon to b922e19, incorporating Linux watchdog API fixes.
• Restore crash-triggered resets and reliable timeout, ping, reopen, and unload behavior.
• Enable the previously nonfunctional watchdog on hi3516cv300.
Diagram

graph TD
  A["Buildroot Package"] -->|pins| B["OpenHiSilicon SDK"] -->|builds| C["Watchdog Module"] -->|exposes| D["/dev/watchdog"] -->|used by| E["Majestic"]
  D -->|timeout| F["Board Reset"]
Loading
High-Level Assessment

Pinning the tested upstream commit is the appropriate approach because it incorporates the complete, jointly validated watchdog fixes without maintaining a downstream patch stack. Cherry-picking individual fixes was considered but would risk omitting interacting lifecycle corrections and diverging from upstream.

Files changed (1) +1 / -1

Other (1) +1 / -1
hisilicon-opensdk.mkPin hisilicon-opensdk to watchdog-fixed revision b922e19 +1/-1

Pin hisilicon-opensdk to watchdog-fixed revision b922e19

• Updates the OpenHiSilicon source revision from 916e767 to b922e19. The new revision supplies corrected watchdog behavior and enables the hi3516cv300 watchdog module.

general/package/hisilicon-opensdk/hisilicon-opensdk.mk

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit d87dae1 into master Sep 12, 2026
64 of 65 checks passed
@widgetii
widgetii deleted the hisilicon-opensdk-bump-wdt branch September 12, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watchdog not working on hi3516ev300 and gk7205v300

1 participant