linux/drivers/i2c
Breno Leitao 14d069d929 i2c: tegra: Do not mark ACPI devices as irq safe
On ACPI machines, the tegra i2c module encounters an issue due to a
mutex being called inside a spinlock. This leads to the following bug:

	BUG: sleeping function called from invalid context at kernel/locking/mutex.c:585
	...

	Call trace:
	__might_sleep
	__mutex_lock_common
	mutex_lock_nested
	acpi_subsys_runtime_resume
	rpm_resume
	tegra_i2c_xfer

The problem arises because during __pm_runtime_resume(), the spinlock
&dev->power.lock is acquired before rpm_resume() is called. Later,
rpm_resume() invokes acpi_subsys_runtime_resume(), which relies on
mutexes, triggering the error.

To address this issue, devices on ACPI are now marked as not IRQ-safe,
considering the dependency of acpi_subsys_runtime_resume() on mutexes.

Fixes: bd2fdedbf2 ("i2c: tegra: Add the ACPI support")
Cc: <stable@vger.kernel.org> # v5.17+
Co-developed-by: Michael van der Westhuizen <rmikey@meta.com>
Signed-off-by: Michael van der Westhuizen <rmikey@meta.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
2024-08-15 00:22:28 +02:00
..
algos
busses i2c: tegra: Do not mark ACPI devices as irq safe 2024-08-15 00:22:28 +02:00
muxes i2c: mux: gpio: Add support for the 'settle-time-us' property 2024-07-20 03:07:55 +02:00
i2c-atr.c
i2c-boardinfo.c
i2c-core-acpi.c
i2c-core-base.c Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
i2c-core-of.c
i2c-core-slave.c
i2c-core-smbus.c
i2c-core.h
i2c-dev.c i2c: dev: Check for I2C_FUNC_I2C before calling i2c_transfer 2024-06-26 12:45:25 +02:00
i2c-mux.c
i2c-slave-eeprom.c
i2c-slave-testunit.c i2c: testunit: match HostNotify test name with docs 2024-08-08 07:20:33 +02:00
i2c-smbus.c i2c: smbus: Send alert notifications to all devices if source not found 2024-08-04 16:29:34 +02:00
i2c-stub.c
Kconfig i2c: testunit: correct Kconfig description 2024-07-11 11:27:22 +02:00
Makefile