Repository navigation
w1: masters: w1-uart: Cap consecutive HDQ timeouts on guarded variants - #180
Conversation
Keep the transient retry from the previous change, but restore fail-stop protection when the battery gauge stops answering altogether: after five consecutive reads exhaust their retries on the wire, disable further transfers via w1_uart_hdq_stop_on_error(). Record whether a complete HDQ response arrived before hdq_deadline in the receive callback under hdq_rx_lock so a delayed host wakeup does not discard an on-time reply, and do not count attempts that exhausted the host budget before waiting for a wire response toward permanent fail-stop. Serialize HDQ bus transfers and resets under hdq_lock, and reset the counter on any successful transfer. Assisted-by: LLM Signed-off-by: Grier Johnson <grier@scooterfarm.com>
ff980e3 to
dc378ed
Compare
|
Updated (
|
|
Merged, thank you @grierj! Capping the consecutive HDQ timeouts on the A10X gauge stops endless retries when the gauge is really gone. Keeping a reply that arrived on time even when the host woke late, and serializing transfers with Nothing was changed on the branch and nothing was left out. One follow-up we'd like, as a separate PR: after the 5-failure cap the battery readout stays gone until reboot. If the gauge goes quiet briefly, for example around suspend and resume, the battery would vanish from the desktop for the rest of the session. A slow periodic retry after the cap (say one attempt every 30-60 s, or on resume) would let the battery come back by itself while still keeping the log quiet. Thanks! |
|
Follow-up from us: #182 makes a faulted gauge link try again every 60 s, so the battery comes back by itself after a short gauge silence (around suspend, for example) instead of staying gone until reboot. A dead gauge costs one short attempt a minute, and only the first fault is logged as an error. Thanks again for the cap, Grier! |
Follow-up to #169:
hdq_consecutive_timeouts) on guarded (hdq_fail_stop) variants, resetting the counter to0on any successful transfer.W1_UART_HDQ_MAX_TIMEOUTS(5) consecutive exhausted reads (15 consecutive timed-out cycles with zero successful responses), callw1_uart_hdq_stop_on_error()so a permanently dead HDQ link faults and stops retrying.Built cleanly for
apple-16kwith zero warnings viaorchard build --device j207 --kernel-tree.Assisted-by: LLM