Re: [PATCH] i2c-tools: i2ctransfer: Set I2C adapter timeout using I2C_TIMEOUT ioctl
Mukesh Savaliya <[email protected]> Thu, 23 Jul 2026 12:49:27 +0530
| Newsgroups | org.kernel.vger.linux-i2c |
|---|---|
| Message-ID | <[email protected]> |
Thanks Wolfram ! On 7/22/2026 1:26 PM, Wolfram Sang wrote: > >> Why userspace need to decide and set the timeout values for adapter ? >> Adapter knows the transfer frequency and transfer data length, it can be >> calculated by core layer itself and can set. > > Freq and data length are not enough for timeout calculation. It is also > board specific (e.g. capacitance) and environment specific (surrounding > noise). It can be argued to modify it from userspace. Unclear how much > that is used in practice, though. For board specific, i suggest to keep offset or co-efficient which can be read from DTSI. Passing from userspace would like just trial and errors. if the framework (i2c core) manage this then kernel space and user space both can be taken cared, right ? And as i mentioned, it also takes care of misc board parameters with cushion parameters. > >> Retrials can be fixed and hard coded for everyone. > > I don't think we can remove the interface because of the "don't break > userspace" rule. > I am thinking timeout handling should be fixed within the kernel framework regardless of any userspace configuration. If a userspace knob is still needed, it should only serve as an optional override for cases where the kernel-side logic proves insufficient. Once the timeout calculation and retry behavior are handled correctly in-kernel, the userspace interface becomes largely redundant and may eventually be considered obsolete. No need to remove existing one.