diff options
author | Alexander Stein <alexander.stein@ew.tq-group.com> | 2023-04-24 10:06:27 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2023-05-03 17:27:29 +0200 |
commit | fa39065833dbdb2059ffe25d071e722c31fbbb6c (patch) | |
tree | 37a98a3beed7294ca0bd358f9753000c16a0d8d7 /drivers/i2c | |
parent | i2c: omap: Fix standard mode false ACK readings (diff) | |
download | linux-fa39065833dbdb2059ffe25d071e722c31fbbb6c.tar.xz linux-fa39065833dbdb2059ffe25d071e722c31fbbb6c.zip |
i2c: imx-lpi2c: 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: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx-lpi2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c index a49b14d52a98..1af0a637d7f1 100644 --- a/drivers/i2c/busses/i2c-imx-lpi2c.c +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c @@ -639,7 +639,7 @@ static int __maybe_unused lpi2c_runtime_suspend(struct device *dev) { struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev); - clk_bulk_disable_unprepare(lpi2c_imx->num_clks, lpi2c_imx->clks); + clk_bulk_disable(lpi2c_imx->num_clks, lpi2c_imx->clks); pinctrl_pm_select_sleep_state(dev); return 0; @@ -651,7 +651,7 @@ static int __maybe_unused lpi2c_runtime_resume(struct device *dev) int ret; pinctrl_pm_select_default_state(dev); - ret = clk_bulk_prepare_enable(lpi2c_imx->num_clks, lpi2c_imx->clks); + ret = clk_bulk_enable(lpi2c_imx->num_clks, lpi2c_imx->clks); if (ret) { dev_err(dev, "failed to enable I2C clock, ret=%d\n", ret); return ret; |