]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: generic recovery: check SCL before SDA
authorClaudio Foellmi <claudio.foellmi@ergon.ch>
Thu, 5 Oct 2017 12:44:14 +0000 (14:44 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 28 Oct 2017 20:56:50 +0000 (22:56 +0200)
commit275ca7eea2b71545ebfad0ab8b456cdeec7d5ded
treef078d095f01fa9792a3ce8e8849cf5a1e70e0c4d
parent082c884d8b1d826fe8c536e06c7939c5612381de
i2c: generic recovery: check SCL before SDA

Move the check for a stuck SCL before the check for a high SDA.
This prevent false positives in the specific case that SDA is fine
and SCL is stuck, which previously returned 0.

Also check SDA again after the loop, if we can.
Together, these changes should lead to a lot more failed
recoveries being caught and returning error codes.

Signed-off-by: Claudio Foellmi <claudio.foellmi@ergon.ch>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c