Re: [PATCH v7 4/6] i2c: wmt: fix a bug when thread blocked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Jan 05, 2024 at 03:51:47PM +0800, Hans Hu wrote:
> v6->v7:
> 	1. some dirty patches were removed
> 	2. rename structure member 'to/ti' to 't1/t2'
> 	   to make it easier to understand.
> 	3. add a comment about arbitration.
> 	Link: https://lore.kernel.org/all/b0f284621b6763c32133d39be83f05f1184b3635.1703830854.git.hanshu-oc@xxxxxxxxxxx/
> 
> 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.
> 
> Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
> Signed-off-by: Hans Hu <hanshu-oc@xxxxxxxxxxx>

Uh oh, NACK. We shouldn't limit clock stretching because some touchpad
controllers can't handle it.

The first thing I suggest is to move more handling to the interrupt
context, like filling the next byte after the previous has been
processed. Then, you are not interruptible anymore.

If this all fails, we need to determine a bus specific property, but I
am quite sure the above conversion will be enough.

Maybe it is an idea to first get the driver converted to support your
platform, and afterwards the conversion to more handling in interrupt.

Kind regards,

   Wolfram

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux