[PATCH v2] i2c: tegra: Don't mark devices with pins as IRQ safe

From: Mikko Perttunen

Date: Mon Feb 16 2026 - 23:01:43 EST


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 requirement for COMPILE_TEST to avoid build errors.

Signed-off-by: Mikko Perttunen <mperttunen@xxxxxxxxxx>
---
Changes in v2:
- Removed incorrect reference to lockdep in commit message.
- Added PINCTRL dependency when building for COMPILE_TEST.
Tegra platforms already globally select PINCTRL, but COMPILE_TEST
configurations may not.
- Link to v1: https://lore.kernel.org/r/20260202-i2c-dpaux-irqsafe-v1-1-5b1847e8bc97@xxxxxxxxxx
---
drivers/i2c/busses/Kconfig | 2 +-
drivers/i2c/busses/i2c-tegra.c | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index e11d50750e63..09152088b79f 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -1211,7 +1211,7 @@ config I2C_SYNQUACER

config I2C_TEGRA
tristate "NVIDIA Tegra internal I2C controller"
- depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC))
+ depends on ARCH_TEGRA || (COMPILE_TEST && (ARC || ARM || ARM64 || M68K || RISCV || SUPERH || SPARC) && PINCTRL)
# COMPILE_TEST needs architectures with readsX()/writesX() primitives
help
If you say yes to this option, support will be included for the
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index bec619b9af4e..4eaeb395d5db 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -2047,8 +2047,11 @@ static int tegra_i2c_probe(struct platform_device *pdev)
*
* VI I2C device shouldn't be marked as IRQ-safe because VI I2C won't
* be used for atomic transfers. ACPI device is not IRQ safe also.
+ *
+ * Devices with pinctrl states cannot be marked IRQ-safe as the pinctrl
+ * state transitions during runtime PM require mutexes.
*/
- if (!IS_VI(i2c_dev) && !has_acpi_companion(i2c_dev->dev))
+ if (!IS_VI(i2c_dev) && !has_acpi_companion(i2c_dev->dev) && !i2c_dev->dev->pins)
pm_runtime_irq_safe(i2c_dev->dev);

pm_runtime_enable(i2c_dev->dev);

---
base-commit: 4f938c7d3b25d87b356af4106c2682caf8c835a2
change-id: 20260202-i2c-dpaux-irqsafe-edc04628b401