Re: [PATCH] i2c: qup: scale the transfer timeout with the transfer length
From: Konrad Dybcio
Date: Mon Nov 30 2026 - 05:14:39 EST
On 11/14/26 3:02 PM, cookys via B4 Relay wrote:
> From: cookys <cookys@xxxxxxxxx>
>
> qup_i2c_probe() sets one transfer timeout for the adapter, sized for the
> largest DMA transfer: TOUT_MIN (2 s) plus MX_DMA_TX_RX_LEN (128 KiB)
> byte times. At the default 100 kHz that is 2 s + 131072 x 99 us, about
> 15 s, and every wait uses it, even for a one-byte read. A transfer that
> never completes therefore stalls its caller for 15 s before -ETIMEDOUT.
>
> On the Lenovo ThinkSmart View (APQ8053) the FT8201 touch controller
> sometimes does not complete the first read after power-up (about one
> boot in four). edt_ft5x06 probes asynchronously, so for those 15 s
> every module init waits in async_synchronize_full(), and boot stalls:
>
> probe of 2-0038 with driver edt_ft5x06 returned 0 after 15343275 usecs
>
> Set the timeout before each wait from the bytes that wait covers: the
> message length on the FIFO and block paths (v1 and v2), the total of
> the messages in the batch on the BAM path. The probe-time value is now
> only the initial default. With this change the same failed read returns
> after about 2 s:
>
> probe of 2-0038 with driver edt_ft5x06 returned 0 after 2353169 usecs
>
> Tested on the ThinkSmart View (msm8953-mainline 7.3 with this change),
> 24 boots: touch probe 0.32-0.35 s, and 2.35 s in the one boot where
> the controller missed its first read.
>
> Assisted-by: Grok:grok-4.6
> Assisted-by: Claude:claude-opus-5-5
These tags are obsolete now
> Signed-off-by: cookys <cookys@xxxxxxxxx>
Please use a well-known identity (i.e. your real name)
https://docs.kernel.org/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
We may also want to use the new i2c_update_timeout()
Konrad