Skip to content

Commit 27b7c6e

Browse files
cyndiswsakernel
authored andcommitted
i2c: tegra: Wait for config load atomically while in ISR
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: ede2299 ("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>
1 parent 7c53f6b commit 27b7c6e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-tegra.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static int tegra_i2c_poll_register(struct tegra_i2c_dev *i2c_dev,
533533
void __iomem *addr = i2c_dev->base + tegra_i2c_reg_addr(i2c_dev, reg);
534534
u32 val;
535535

536-
if (!i2c_dev->atomic_mode)
536+
if (!i2c_dev->atomic_mode && !in_irq())
537537
return readl_relaxed_poll_timeout(addr, val, !(val & mask),
538538
delay_us, timeout_us);
539539

0 commit comments

Comments
 (0)