]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: tegra: Fix NACK error handling
authorJon Hunter <jonathanh@nvidia.com>
Tue, 3 Jul 2018 08:55:43 +0000 (09:55 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 9 Jul 2018 22:20:47 +0000 (00:20 +0200)
commit84c3b421a4a143e106ef4bee76d37bedc5690120
tree8369a9e28bbf81801033ef079d3b89e56735088f
parent1c9ac9e7d72e22bd2f2b872b7db569312bc3d6cf
i2c: tegra: Fix NACK error handling

On Tegra30 Cardhu the PCA9546 I2C mux is not ACK'ing I2C commands on
resume from suspend (which is caused by the reset signal for the I2C
mux not being configured correctl). However, this NACK is causing the
Tegra30 to hang on resuming from suspend which is not expected as we
detect NACKs and handle them. The hang observed appears to occur when
resetting the I2C controller to recover from the NACK.

Commit a4e8ba8e7d31 ("i2c: tegra: proper handling of error cases") added
additional error handling for some error cases including NACK, however,
it appears that this change conflicts with an early fix by commit
c13adefbc690 ("i2c: tegra: Add delay before resetting the controller
after NACK"). After commit a4e8ba8e7d31 was made we now disable 'packet
mode' before the delay from commit c13adefbc690 happens. Testing shows
that moving the delay to before disabling 'packet mode' fixes the hang
observed on Tegra30. The delay was added to give the I2C controller
chance to send a stop condition and so it makes sense to move this to
before we disable packet mode. Please note that packet mode is always
enabled for Tegra.

Fixes: a4e8ba8e7d31 ("i2c: tegra: proper handling of error cases")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@vger.kernel.org
drivers/i2c/busses/i2c-tegra.c