Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mikko Perttunen and committed by
Linus Torvalds
ec69c9e8 d5273fd3

+6 -1
+2
drivers/i2c/busses/Kconfig
··· 1213 1213 tristate "NVIDIA Tegra internal I2C controller" 1214 1214 depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC)) 1215 1215 # COMPILE_TEST needs architectures with readsX()/writesX() primitives 1216 + depends on PINCTRL 1217 + # ARCH_TEGRA implies PINCTRL, but the COMPILE_TEST side doesn't. 1216 1218 help 1217 1219 If you say yes to this option, support will be included for the 1218 1220 I2C controller embedded in NVIDIA Tegra SOCs
+4 -1
drivers/i2c/busses/i2c-tegra.c
··· 2047 2047 * 2048 2048 * VI I2C device shouldn't be marked as IRQ-safe because VI I2C won't 2049 2049 * 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. 2050 2053 */ 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) 2052 2055 pm_runtime_irq_safe(i2c_dev->dev); 2053 2056 2054 2057 pm_runtime_enable(i2c_dev->dev);