Skip to content

Commit ec69c9e

Browse files
cyndistorvalds
authored andcommitted
i2c: tegra: Don't mark devices with pins as IRQ safe
I2C devices with associated pinctrl states (DPAUX I2C controllers) will change pinctrl state during runtime PM. This requires taking a mutex, so these devices cannot be marked as IRQ safe. Add PINCTRL as dependency to avoid build errors. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Reported-by: Russell King <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/all/E1vsNBv-00000009nfA-27ZK@rmk-PC.armlinux.org.uk/ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d5273fd commit ec69c9e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/i2c/busses/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,8 @@ config I2C_TEGRA
12131213
tristate "NVIDIA Tegra internal I2C controller"
12141214
depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
12151215
# COMPILE_TEST needs architectures with readsX()/writesX() primitives
1216+
depends on PINCTRL
1217+
# ARCH_TEGRA implies PINCTRL, but the COMPILE_TEST side doesn't.
12161218
help
12171219
If you say yes to this option, support will be included for the
12181220
I2C controller embedded in NVIDIA Tegra SOCs

drivers/i2c/busses/i2c-tegra.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2047,8 +2047,11 @@ static int tegra_i2c_probe(struct platform_device *pdev)
20472047
*
20482048
* VI I2C device shouldn't be marked as IRQ-safe because VI I2C won't
20492049
* be used for atomic transfers. ACPI device is not IRQ safe also.
2050+
*
2051+
* Devices with pinctrl states cannot be marked IRQ-safe as the pinctrl
2052+
* state transitions during runtime PM require mutexes.
20502053
*/
2051-
if (!IS_VI(i2c_dev) && !has_acpi_companion(i2c_dev->dev))
2054+
if (!IS_VI(i2c_dev) && !has_acpi_companion(i2c_dev->dev) && !i2c_dev->dev->pins)
20522055
pm_runtime_irq_safe(i2c_dev->dev);
20532056

20542057
pm_runtime_enable(i2c_dev->dev);

0 commit comments

Comments
 (0)