Re: [PATCH v2] i2c: ocores: generate stop condition after timeout in polling mode

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

 



>>>>> "Matthias" == Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx> writes:

 > From: Gregor Herburger <gregor.herburger@xxxxxxxxxxxx>
 > In polling mode, no stop condition is generated after a timeout. This
 > causes SCL to remain low and thereby block the bus. If this happens
 > during a transfer it can cause slaves to misinterpret the subsequent
 > transfer and return wrong values.

 > To solve this, pass the ETIMEDOUT error up from ocores_process_polling()
 > instead of setting STATE_ERROR directly. The caller is adjusted to call
 > ocores_process_timeout() on error both in polling and in IRQ mode, which
 > will set STATE_ERROR and generate a stop condition.

 > Fixes: 69c8c0c0efa8 ("i2c: ocores: add polling interface")
 > Signed-off-by: Gregor Herburger <gregor.herburger@xxxxxxxxxxxx>
 > Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
 > ---

 > v2: style improvements based on feedback from Federico and Andrew. I went
 >     with a slightly different solution than Andrew suggested to avoid using
 >     the ret variable for two different kinds of returns.

Acked-by: Peter Korsgaard <peter@xxxxxxxxxxxxx>

-- 
Bye, Peter Korsgaard



[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