Re: [PATCH v6 6/8] i2c: wmt: fix a bug when thread blocked

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

 



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();

ack!

Andi




[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