Skip to content

watchdog: adi: fix WDOG_CNT calculation - #99

Open
jiez wants to merge 1 commit into
adi-u-boot-2025.10.yfrom
fix-watchdog-count-calculation
Open

watchdog: adi: fix WDOG_CNT calculation#99
jiez wants to merge 1 commit into
adi-u-boot-2025.10.yfrom
fix-watchdog-count-calculation

Conversation

@jiez

@jiez jiez commented Jun 10, 2026

Copy link
Copy Markdown

Fix two bugs in the timeout count calculation:

  • Integer truncation: timeout_ms / 1000 * clk_rate loses sub-second precision; reorder to multiply first in u64 before dividing.
  • Incorrect divide by 2 for SC58X: WDOG_CNT decrements once per cycle of SCLK0_0 clock.

This should fix issue #95

Fix two bugs in the timeout count calculation:
- Integer truncation: timeout_ms / 1000 * clk_rate loses sub-second
  precision; reorder to multiply first in u64 before dividing.
- Incorrect divide by 2 for SC58X: WDOG_CNT decrements once per cycle
  of SCLK0_0 clock.

Signed-off-by: Jie Zhang <jie.zhang@analog.com>
@jiez
jiez requested review from a team June 10, 2026 22:12
@jiez jiez mentioned this pull request Jun 10, 2026

@CalebEthridgeADI CalebEthridgeADI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on sc589-mini

@jiez jiez self-assigned this Jun 25, 2026
@jiez jiez added this to ADSP Jun 25, 2026
@pamolloy pamolloy moved this to In Development in ADSP Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Development

Development

Successfully merging this pull request may close these issues.

3 participants