]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue
authorChengfeng Ye <dg573847474@gmail.com>
Fri, 7 Jul 2023 08:49:41 +0000 (08:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Aug 2023 12:23:31 +0000 (14:23 +0200)
commitc4e671dae50e04e08571b58d818825d8c93df040
treefeeb7c3a43b8bc761e396ac1b6a4c998a66307e1
parentb99f490ea87ebcca3a429fd8837067feb56a4c7c
i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue

commit 4caf4cb1eaed469742ef719f2cc024b1ec3fa9e6 upstream.

iproc_i2c_rd_reg() and iproc_i2c_wr_reg() are called from both
interrupt context (e.g. bcm_iproc_i2c_isr) and process context
(e.g. bcm_iproc_i2c_suspend). Therefore, interrupts should be
disabled to avoid potential deadlock. To prevent this scenario,
use spin_lock_irqsave().

Fixes: 9a1038728037 ("i2c: iproc: add NIC I2C support")
Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-bcm-iproc.c