Hi Andi,
On 2024/1/4 17:18, Andi Shyti wrote:
Hi Hans,
...
@@ -58,6 +58,8 @@ struct viai2c {
u16 tcr;
int irq;
u16 cmd_status;
+ ktime_t ti;
+ ktime_t to;
don't these need some arbitration?
I don't think it needs to be arbitration.
the controllers are independent of each other,
each access is locked using __i2c_lock_bus_helper().
Am I missing something?
no, it's fine, it's me who missed that. Do you mind writing a
comment?
ok, will add a comment like below:
+ /*
+ * During each byte access, the host performs clock stretching.
+ * In this case, the thread may be interrupted by preemption,
+ * resulting in a long stretching time.
+ *
+ * However, some touchpad can only tolerate host clock stretching
+ * of no more than 200 ms. We reduce the impact of this through
+ * a retransmission mechanism.
+ *
+ * Since __i2c_lock_bus_helper() is used to ensure that the
+ * current access will not be interrupted by the other access,
+ * We don't need to worry about arbitration anymore.
+ *
+ */
+ local_irq_disable();
+ i2c->to = ktime_get();
Hans