* [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe
@ 2026-02-02 4:42 Mikko Perttunen
2026-02-02 5:08 ` Mikko Perttunen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Mikko Perttunen @ 2026-02-02 4:42 UTC (permalink / raw)
To: Dmitry Osipenko, Andi Shyti, Thierry Reding, Jonathan Hunter
Cc: linux-i2c, linux-tegra, linux-kernel, Mikko Perttunen
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.
Discovered through lockdep.
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
drivers/i2c/busses/i2c-tegra.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe
2026-02-02 4:42 [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe Mikko Perttunen
@ 2026-02-02 5:08 ` Mikko Perttunen
2026-02-05 10:47 ` Andi Shyti
2026-02-07 0:25 ` Andi Shyti
2 siblings, 0 replies; 5+ messages in thread
From: Mikko Perttunen @ 2026-02-02 5:08 UTC (permalink / raw)
To: Dmitry Osipenko, Andi Shyti, Thierry Reding, Jonathan Hunter
Cc: linux-i2c, linux-tegra, linux-kernel
On Monday, February 2, 2026 1:42 PM Mikko Perttunen wrote:
> 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.
>
> Discovered through lockdep.
Eh, I guess not lockdep, just normal lock debugging..
>
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
> drivers/i2c/busses/i2c-tegra.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> 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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe
2026-02-02 4:42 [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe Mikko Perttunen
2026-02-02 5:08 ` Mikko Perttunen
@ 2026-02-05 10:47 ` Andi Shyti
2026-02-06 3:38 ` Mikko Perttunen
2026-02-07 0:25 ` Andi Shyti
2 siblings, 1 reply; 5+ messages in thread
From: Andi Shyti @ 2026-02-05 10:47 UTC (permalink / raw)
To: Mikko Perttunen
Cc: Dmitry Osipenko, Thierry Reding, Jonathan Hunter, linux-i2c,
linux-tegra, linux-kernel
Hi Mikko,
On Mon, Feb 02, 2026 at 01:42:34PM +0900, Mikko Perttunen wrote:
> 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.
>
> Discovered through lockdep.
I removed this sentence...
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
... and merged the patch in i2c/i2c-host-2.
Thanks,
Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe
2026-02-05 10:47 ` Andi Shyti
@ 2026-02-06 3:38 ` Mikko Perttunen
0 siblings, 0 replies; 5+ messages in thread
From: Mikko Perttunen @ 2026-02-06 3:38 UTC (permalink / raw)
To: Andi Shyti
Cc: Dmitry Osipenko, Thierry Reding, Jonathan Hunter, linux-i2c,
linux-tegra, linux-kernel
On Thursday, February 5, 2026 7:47 PM Andi Shyti wrote:
> Hi Mikko,
>
> On Mon, Feb 02, 2026 at 01:42:34PM +0900, Mikko Perttunen wrote:
> > 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.
> >
> > Discovered through lockdep.
>
> I removed this sentence...
Sorry about that.
>
> > Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
>
> ... and merged the patch in i2c/i2c-host-2.
>
> Thanks,
> Andi
>
Thank you!
Looks like there's a COMPILE_TEST failure so we'll need to do something like ..
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
--
2.52.0
Please let me know how you'd like to go about it.
Mikko
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe
2026-02-02 4:42 [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe Mikko Perttunen
2026-02-02 5:08 ` Mikko Perttunen
2026-02-05 10:47 ` Andi Shyti
@ 2026-02-07 0:25 ` Andi Shyti
2 siblings, 0 replies; 5+ messages in thread
From: Andi Shyti @ 2026-02-07 0:25 UTC (permalink / raw)
To: Mikko Perttunen
Cc: Dmitry Osipenko, Thierry Reding, Jonathan Hunter, linux-i2c,
linux-tegra, linux-kernel
Hi Mikko,
> - 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)
I'm sorry, I had to remove your patch. The ->pins member is
conditional to CONFIG_PINCTRL, without it we get this compile
error:
drivers/i2c/busses/i2c-tegra.c: In function 'tegra_i2c_probe':
>> drivers/i2c/busses/i2c-tegra.c:1842:82: error: 'struct device' has no member named 'pins'
1842 | if (!IS_VI(i2c_dev) && !has_acpi_companion(i2c_dev->dev) && !i2c_dev->dev->pins)
| ^~
Please fix it and resubmit a v2.
Thanks,
Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-07 0:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 4:42 [PATCH] i2c: tegra: Don't mark devices with pins as IRQ safe Mikko Perttunen
2026-02-02 5:08 ` Mikko Perttunen
2026-02-05 10:47 ` Andi Shyti
2026-02-06 3:38 ` Mikko Perttunen
2026-02-07 0:25 ` Andi Shyti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox