dtschema: i2c: messy situation about timeouts
Wolfram Sang <[email protected]>
| Newsgroups | org.kernel.vger.devicetree-spec,org.kernel.vger.linux-i2c |
|---|---|
| Message-ID | <ZdxjGwvGXlDGkYs0@shikoro> |
Hey guys, we have quite a messy situation regarding I2C timeouts in the dtschema. Partly because I was too busy to pay detailed attention, partly because reviewing dtschema changes happen on Github which I totally missed. No complaining, though, here are my observations and suggestions to get it straight. Comments are more than welcome. - "i2c-transfer-timeout-us" Description says "Number of microseconds to wait before considering an I2C transfer has failed." To me, this binding is very descriptive and makes sense. We should keep it. Sadly, it is the newest one and we already have others. - "i2c-scl-has-clk-low-timeout" AFAIU this binding tells that the controller can do clock stretching. But what for? I don't see why this is important for clients. If anything, then it would be interesting if the *client* can do clock stretching and if the controller can actually handle that. But no need to describe it in DT, we have this as an adapter quirk already 'I2C_AQ_NO_CLK_STRETCH'. Two controllers use it, but no client checks for it so far. Coming back to this binding, it is also unused in the kernel. Suggestion: let's remove it - "i2c-scl-clk-low-timeout-us" The description says "Number of microseconds the clock line needs to be pulled down in order to force a waiting state." What does "forcing a waiting state" mean here? I don't understand this description. It is used in the i2c-mpc driver. The use case is simply to put it into the 'struct i2c_adapter.timeout' member. That timeout is used to determine if a transfer failed. So, to me, "i2c-transfer-timeout-us" makes a lot more sense to use here. Suggestion: let's remove this binding and conver i2c-mpc to "i2c-transfer-timeout-us". Yes, not nice to have two deprecated bindings, but things happened. So, these are my thoughts about the current situation. I might have missed something, so if you have anything to add, I am all ears. Comments really welcome! Happy hacking, Wolfram
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmXcYxcACgkQFA3kzBSg KbazcA/9FdG/a6oj1Ahq2MW9uT2iS/32c248QKavvuk4+DakyDmNwkCGgz+LJkeU gkpWjCyrEBJqIZEuOjmTJ6fW9gRercffLeu7a9Cq/U6XN4foGudN38y9ou5sfikq uCyCKbVok919aiPczJbnm4IhyG+wp4+isxXZWpLd7zUQezgGC/4RCi1ifwW7LQ6d 3Caobc5O5na6En9+xeEDyKf1iC0ymU3hVaXKIrIGEts9SKtGfCht//HvCuLs2pWg YAv+pUFSCFUBn1zGzj31CO3RKAFkVZSn0IWBqdqub6/oFh6+GsKCQ6ZdkFgQQtmL O3Mtaw9SjBw48e9frh2rpbdZHJO1+ovSOu7JG3YyZ516dtaVCLa+Ze0oePQi3H6C zbpDi2azM8kqW9zVqZhYVLd2TyT4xS6jfaYmoUY3eDSzH/U/cMEq4+bot8ZQXMBG yJRLV4l84PpHD+Duf3/kEG8I+/yMom6VHBNQKexuMOZjUpYJSYWoQd5Cs3VYR/oD 97kkm1xnNBteKA7qaFkcFIEQ/mjfY4bctLiyNusfgKSjzrKu/5uRlqyIboDAMEO7 3roJyes3F18Vt5wB8x3cIhuF0qCk6dx/ZRPSEeT9QX2AIw0kRKi091O5SQmDTlpq c3BXsgELnazLw4fYYTJqEzNOa4jHazYIp6Jqo3HfXRczcL6uefM= =9Gr2 -----END PGP SIGNATURE-----