]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 30 Oct 2023 11:00:15 +0000 (12:00 +0100)
commiteddeaef73ca02ebaec60cd516615e4c85078a666
tree9f7e49bdeeff1f9b1a26c32e4105bbbd2938566d
parenta7876f5780dea1d61d3b0e2633c2380ac558f304
i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue

BugLink: https://bugs.launchpad.net/bugs/2039110
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/i2c/busses/i2c-bcm-iproc.c