Skip to content

w1: masters: w1-uart: Retry a faulted HDQ link every minute - #182

Merged
henrikklee merged 1 commit into
mainfrom
w1-uart-hdq-fault-retry
Dec 5, 2026
Merged

henrikklee merged 1 commit into
mainfrom
w1-uart-hdq-fault-retry

Conversation

@henrikklee

Copy link
Copy Markdown

Follow-up to #180 (iPad Pro 2 battery gauge, A10X).

Today on main: if the battery gauge misses five reads in a row, the driver stops talking to it until the next reboot, so a short gauge silence (around suspend, for example) makes the battery disappear from the desktop for the rest of the session.

After this: a faulted link tries one read again every 60 s. If the gauge answers, the battery comes back by itself; if not, it waits another minute. A dead gauge costs one short attempt a minute, and only the first fault is logged as an error.

Only the guarded HDQ variant (apple,j120-hdq-uart, the iPad Pro 2) is affected.

Since the consecutive-timeout cap, a guarded HDQ link that misses five
reads in a row stops for good, until a reboot or rebind. A gauge that
goes quiet only for a while, around suspend and resume for example,
then takes the battery away for the rest of the session.

Let a faulted link try again: once W1_UART_HDQ_RETRY_SECS (60 s) have
passed since the fault, the next reset or read goes to the wire. A good
read clears the fault count; one more exhausted read, or any other
error, faults the link again at once for another minute. A dead gauge
so costs one short attempt a minute, and only the first fault is
logged as an error.

Assisted-by: LLM
Signed-off-by: Henrik Klee <henrik@goat-code.com>
@henrikklee
henrikklee merged commit 33fa48a into main Dec 5, 2026
4 checks passed
@henrikklee
henrikklee deleted the w1-uart-hdq-fault-retry branch December 5, 2026 01:32
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.

1 participant