Re: [PATCH v3] platform/chrome: cros_ec_sensorhub: Modify clock drift estimation
From: Tzung-Bi Shih
Date: Wed Oct 14 2026 - 02:53:18 EST
On Tue, Oct 13, 2026 at 10:56:50AM +0000, Satyam Gupta wrote:
> On Tue, Jul 28, 2026 at 10:15:52AM +0000, Tzung-Bi Shih wrote:
> > > This CL makes 5 specific changes to the clock drift estimation algorithm
> >
> > Since these are 5 distinct logical changes, shouldn't they be separated into
> > a 5-patch series?
>
> Although the v3 commit description listed the adjustments as 5 bullet points,
> they are tightly coupled parts of a single fix to support sensor batching in
> the timestamp filter without breaking intermediate states:
>
> - Extending TS_HISTORY_BORED_US from 0.5s to 2.0s so the filter survives 1-2s
> batch flush intervals requires the 10x dx ODR/mode-change reset and slope
> clamping; otherwise, transitions between active streaming and batching (which
> previously exceeded the 0.5s timeout) mix into the same filter history.
> - The 10x dx check (which reads state->x_history[1] when history_len > 1)
> depends directly on the loop start index fix: previously, with
> `i = state->history_len - 1`, the loop did not run when `history_len == 1`,
> leaving `x_history[1]` unpopulated when `history_len` became 2.
> - Dropping strictly past timestamps instead of clamping them to `last_ts`
> prevents post-reset backward ticks from being mistaken for same-timestamp
> batches by `cros_ec_sensor_ring_spread_add()`.
>
> I have reworded the commit message in v4 to explain how these pieces work
> together as a single cohesive change rather than a numbered list of unrelated
> items.
I'm not convinced. I think they should still separate into 5 patches and
form a series.
> > On a related note, is [1] still relevant? Should we disregard it?
> >
> > [1] https://lore.kernel.org/all/20260720110405.2127011-1-sgsatyam@xxxxxxxxxx
>
> Yes, [1] ("platform/chrome: cros_ec_sensorhub: Fix AP/EC TS wrap") is still
> relevant — it addresses 32-bit EC timestamp rollover across deep AP suspend.
Please resend or include it in the same series.