Commit d9a22d71 authored by Lucas Stach's avatar Lucas Stach Committed by Wolfram Sang

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: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 90ad2cbe
...@@ -1226,7 +1226,7 @@ static int i2c_imx_runtime_suspend(struct device *dev) ...@@ -1226,7 +1226,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
{ {
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
clk_disable_unprepare(i2c_imx->clk); clk_disable(i2c_imx->clk);
return 0; return 0;
} }
...@@ -1236,7 +1236,7 @@ static int i2c_imx_runtime_resume(struct device *dev) ...@@ -1236,7 +1236,7 @@ static int i2c_imx_runtime_resume(struct device *dev)
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
int ret; int ret;
ret = clk_prepare_enable(i2c_imx->clk); ret = clk_enable(i2c_imx->clk);
if (ret) if (ret)
dev_err(dev, "can't enable I2C clock, ret=%d\n", ret); dev_err(dev, "can't enable I2C clock, ret=%d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment