Commit 3ec487ae authored by Chengfeng Ye's avatar Chengfeng Ye Committed by sanglipeng
Browse files

i2c: bcm-iproc: Fix bcm_iproc_i2c_isr deadlock issue

stable inclusion
from stable-v5.10.192
commit 268cc9bc54bd98979293b10f3f1ff13515809c08
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=268cc9bc54bd98979293b10f3f1ff13515809c08



--------------------------------

commit 4caf4cb1 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: 9a103872 ("i2c: iproc: add NIC I2C support")
Signed-off-by: default avatarChengfeng Ye <dg573847474@gmail.com>
Acked-by: default avatarRay Jui <ray.jui@broadcom.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 71a70b65
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment