On 7/5/26 3:57 PM, Aniket Randive wrote:
The driver uses a static XFER_TIMEOUT of HZ (1 second) for all transfers regardless of message length or bus frequency, causing unnecessary delays on error paths.
Compute the timeout dynamically from message length and bus frequency with a 10x safety margin over the theoretical wire time and a 300ms floor. For GPI multi-descriptor transfers, use the maximum message length across all queued messages as the per-completion timeout.
What's the reason for a 0.3 s floor?
Why a 10x safety margin specifically?
[...]
+static unsigned long geni_i2c_xfer_timeout(struct geni_i2c_dev *gi2c, size_t len) +{
- size_t bit_cnt = len * 9;
- size_t bit_usec = (bit_cnt * USEC_PER_SEC) / gi2c->clk_freq_out;
mult_frac()
Konrad