Re: [PATCH V5] i2c: qcom-geni: Add dynamic transfer timeout based on transfer length and frequency
Mukesh Savaliya <[email protected]>
| Newsgroups | org.kernel.vger.linux-i2c,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media |
|---|---|
| Message-ID | <[email protected]> |
On 7/15/2026 5:15 PM, Dmitry Guzman wrote: > On Wed, 15 Jul 2026 15:48:05 +0530 > Aniket Randive <[email protected]> wrote: > >> This replaces the fixed 1-second timeout with a transfer-specific >> timeout while preserving sufficient margin for software overheads and >> bus-level delays. >> > > The dynamic timeout may be useful for any I2C bus controller, not only > for qcom-geni. Structure i2c_adapter already has field "timeout". Isn't This is good, thanks for pointing. For geni driver, please review gi2c->adap.timeout (client->adapter->timeout) can be used and you may explore retries also in case you want to retry. > it worth to move the timeout calculation to i2c-core, so that the core > updates the timeout field in i2c_adapter structure, and the controller > driver just uses this value, instead of duplicating the calculation in > every driver that will use this feature? > > Also, such parameters as I2C_TIMEOUT_SAFETY_COEFFICIENT and > I2C_TIMEOUT_MIN_USEC may be configurable by user (for example, in > device tree) for more flexibility. > I think it's good to keep it within driver, not to expose as configurable. This would keep changing per user/system load, but ideal timing is theoretical + some offset, hence can be better managed by driver. > Best regards,