Skip to content
Snippets Groups Projects
Commit 22494098 authored by Teresa Remmet's avatar Teresa Remmet Committed by Gianfranco Mariotti
Browse files

i2c: imx: Fix ABBA deadlock again

Like other i2c controllers we see deadlock issues with clock prepare mutex.
In our case this came up with a clock output of a rtc connected to i2c bus.

This issue has already been fixed upstream by:
(d9a22d71) i2c: imx: avoid taking clk_prepare mutex in PM callbacks

But was reintroduced by a wrongly resolved merge conflict with this commit:
(d59c7185) MLK-11403: I2C: imx: restore pin setting for i2c

So again we keep the i2c clock prepared and only enable and disable it for
a transfer.

REFERENCE: https://github.com/nxp-imx/linux-imx/pull/21
parent cd2f1a54
No related tags found
1 merge request!208Draft: i2c: imx: Fix deadlock issues
......@@ -1755,7 +1755,7 @@ static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
{
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
clk_disable_unprepare(i2c_imx->clk);
clk_disable(i2c_imx->clk);
pinctrl_pm_select_sleep_state(dev);
return 0;
......@@ -1767,7 +1767,7 @@ static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
int ret;
pinctrl_pm_select_default_state(dev);
ret = clk_prepare_enable(i2c_imx->clk);
ret = clk_enable(i2c_imx->clk);
if (ret)
dev_err(dev, "can't enable I2C clock, ret=%d\n", ret);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment