i2c: tegra: Wait for config load atomically while in ISR
authorMikko Perttunen <mperttunen@nvidia.com>
Mon, 11 Jan 2021 16:08:32 +0000 (18:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2021 10:54:50 +0000 (11:54 +0100)
commite633c0879be39a63bb8bd79879b9991329515254
tree23643be45954c493436a17eee640d399c67876de
parent48481056537e8bd5e23bd286a6d1a77f34dae88d
i2c: tegra: Wait for config load atomically while in ISR

commit 27b7c6e096264cc7b91bb80a4f65f8c0a66f079f upstream.

Upon a communication error, the interrupt handler can call
tegra_i2c_disable_packet_mode. This causes a sleeping poll to happen
unless the current transaction was marked atomic. Fix this by
making the poll happen atomically if we are in an IRQ.

This matches the behavior prior to the patch mentioned
in the Fixes tag.

Fixes: ede2299f7101 ("i2c: tegra: Support atomic transfers")
Cc: stable@vger.kernel.org
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-tegra.c