[RFC PATCH v2] phy: qcom-mipi-csi2: round the requested settle interval up

Bryan O'Donoghue bod at kernel.org
Mon Oct 19 08:49:54 PDT 2026


On 19/10/2026 16:47, Jizhou Tong wrote:
> Hi Bryan,
> 
> I checked the zero-count case raised by Sashiko against media-next
> (d7e7bca71698) and the rounding patch. Both the base driver and the
> patched driver return zero when the calculated interval is exactly
> six integer timer periods, and lanes_enable() rejects it with -ENODEV.
> 
> For example, link_freq = 600000000 Hz and timer_clk_rate = 66666666 Hz
> produce a 90000 ps interval and a 15000 ps integer timer period. The
> helper returns zero before and after the patch. This is a software
> boundary case, not a clock configuration I have tested on hardware.
> 
> Is a programmed settle count of zero valid on the supported PHYs, or
> is rejecting it intentional? If it is valid, the helper would need to
> distinguish it from an unrepresentable interval, with the caller checking
> for an error separately.
> 
> The rounding RFC preserves the existing zero-count handling. I would
> keep any change to that hardware policy separate from the rounding fix.
> 
> Best regards,
> Jizhou Tong

Zero is not a valid settle count so we should just pick a minimum value. 
For historical reasons six counts is it.

If the calculated settle_cnt < 6 => settle_cnt = 6;

I realise the LLM is in paroxysms about that but...

---
bod



More information about the linux-phy mailing list