diff options
author | Jae Hyun Yoo <jae.hyun.yoo@intel.com> | 2020-12-15 05:53:13 +0300 |
---|---|---|
committer | Yoo, Jae Hyun <jae.hyun.yoo@intel.com> | 2020-12-17 01:05:52 +0300 |
commit | ec06446ae64ec6dc05609ddab456be9c22bf30b0 (patch) | |
tree | 0fa8a218544062b2a9d6c1f1e6a8ce16f01e7830 | |
parent | 8ade87d49a3e0657f8e04ef116741c9b6dc32d16 (diff) | |
download | linux-ec06446ae64ec6dc05609ddab456be9c22bf30b0.tar.xz |
fixup! i2c: Add mux hold/unhold msg types
This commit fixes a deadlock case by replacing a del_timer_sync call
with a del_timer in timer handler function. This issue was not
observed in previous platform because the previous UP kernel calls
del_timer instead of del_timer_sync but in SMP kernel, it calls
del_timer_sync actually.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Change-Id: I0633acafb5023c50494e41c82c65c0acaa3bc068
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 3 | ||||
-rw-r--r-- | drivers/i2c/i2c-mux.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 56fa95ee42e7..6429b24c47dc 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1281,7 +1281,8 @@ static void i2c_adapter_hold_timer_callback(struct timer_list *t) { struct i2c_adapter *adapter = from_timer(adapter, t, hold_timer); - i2c_adapter_unhold(adapter); + del_timer(&adapter->hold_timer); + mutex_unlock(&adapter->hold_lock); } static int i2c_register_adapter(struct i2c_adapter *adap) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index c6e433238b22..8dd2fc342eb0 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -53,7 +53,8 @@ static void i2c_mux_hold_timer_callback(struct timer_list *t) { struct i2c_mux_core *muxc = from_timer(muxc, t, hold_timer); - i2c_mux_unhold(muxc); + del_timer(&muxc->hold_timer); + mutex_unlock(&muxc->hold_lock); } static int __i2c_mux_master_xfer(struct i2c_adapter *adap, |