linux-stable/drivers/i2c
Dmitry Torokhov 7c0bb53d48 i2c: core: Disable client irq on reboot/shutdown
[ Upstream commit b64210f2f7 ]

If an i2c client receives an interrupt during reboot or shutdown it may
be too late to service it by making an i2c transaction on the bus
because the i2c controller has already been shutdown. This can lead to
system hangs if the i2c controller tries to make a transfer that is
doomed to fail because the access to the i2c pins is already shut down,
or an iommu translation has been torn down so i2c controller register
access doesn't work.

Let's simply disable the irq if there isn't a shutdown callback for an
i2c client when there is an irq associated with the device. This will
make sure that irqs don't come in later than the time that we can handle
it. We don't do this if the i2c client device already has a shutdown
callback because presumably they're doing the right thing and quieting
the device so irqs don't come in after the shutdown callback returns.

Reported-by: kernel test robot <lkp@intel.com>
[swboyd@chromium.org: Dropped newline, added commit text, added
interrupt.h for robot build error]
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-20 16:16:10 +02:00
..
algos i2c: algo: pca: Reapply i2c bus settings after reset 2020-09-23 12:10:59 +02:00
busses i2c: robotfuzz-osif: fix control-request directions 2021-06-30 08:48:34 -04:00
muxes i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()' 2020-05-27 17:37:30 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs 2020-10-30 10:38:26 +01:00
i2c-core-base.c i2c: core: Disable client irq on reboot/shutdown 2021-07-20 16:16:10 +02:00
i2c-core-of.c i2c: core: fix use after free in of_i2c_notify 2019-12-13 08:51:07 +01:00
i2c-core-slave.c i2c: slave: add sanity check when unregistering 2020-08-11 15:32:33 +02:00
i2c-core-smbus.c i2c: core: check returned size of emulated smbus block read 2020-06-30 23:17:13 -04:00
i2c-core.h
i2c-dev.c i2c: bail out early when RDWR parameters are wrong 2021-05-22 10:59:40 +02:00
i2c-mux.c Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-08-21 17:40:46 -07:00
i2c-slave-eeprom.c
i2c-smbus.c
i2c-stub.c
Kconfig
Makefile i2c: don't use any __deprecated handling anymore 2018-08-24 17:26:43 +02:00