aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-03-08 08:25:18 -0500
committerWolfram Sang <wsa@the-dreams.de>2018-04-03 09:29:28 -0400
commitd9a22d713acb484f9d60861598a71e28129c0afa (patch)
tree737453064662c8287cc586e7fd605917835a4ec8
parent90ad2cbe88c22d0215225ab9594eeead0eb24fde (diff)
i2c: imx: avoid taking clk_prepare mutex in PM callbacks
This is unsafe, as the runtime PM callbacks are called from the PM workqueue, so this may deadlock when handling an i2c attached clock, which may already hold the clk_prepare mutex from another context. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-imx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index c9632b2f0eaa..d7267dd9c7bf 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1226,7 +1226,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
1226{ 1226{
1227 struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); 1227 struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
1228 1228
1229 clk_disable_unprepare(i2c_imx->clk); 1229 clk_disable(i2c_imx->clk);
1230 1230
1231 return 0; 1231 return 0;
1232} 1232}
@@ -1236,7 +1236,7 @@ static int i2c_imx_runtime_resume(struct device *dev)
1236 struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); 1236 struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
1237 int ret; 1237 int ret;
1238 1238
1239 ret = clk_prepare_enable(i2c_imx->clk); 1239 ret = clk_enable(i2c_imx->clk);
1240 if (ret) 1240 if (ret)
1241 dev_err(dev, "can't enable I2C clock, ret=%d\n", ret); 1241 dev_err(dev, "can't enable I2C clock, ret=%d\n", ret);
1242 1242