Skip to content

Backport fix of possible deadlock in i2c-imx#28

Merged
mhei merged 2 commits into
v6.12.34-2.1.0-phy-cbfrom
v6.12.34-2.1.0-phy-cb-i2c-deadlock
May 21, 2026
Merged

Backport fix of possible deadlock in i2c-imx#28
mhei merged 2 commits into
v6.12.34-2.1.0-phy-cbfrom
v6.12.34-2.1.0-phy-cb-i2c-deadlock

Conversation

@lategoodbye
Copy link
Copy Markdown
Member

Phytec noticed a possible deadlock in the i2c-imx driver:
nxp-imx/linux-imx#21

So backport this patches from https://github.com/phytec/linux-phytec-imx/tree/v6.12.49-2.2.0-phy

These patches has been boot tested on a chargebyte Charge SOM DC EVB.

tremmet added 2 commits May 21, 2026 15:31
We see deadlock issues with clock prepare mutex in imx i2c driver
. I our case this came up with a clock output of a rtc connected to i2c bus.

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

But was reintroduced by a wrongly resolved merge conflict with this commit:
(66c0769) 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.

Link: nxp-imx/linux-imx#21
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
clk_get_rate() keeps the clk prepare lock which
can lead into a deadlock. It was removed upstream with this commit:
(90ad2cb) i2c: imx: use clk notifier for rate changes

But it has been readded again with:
(0e94d44) MLK-20368 i2c-imx: Coverity: fix divide by zero warning

The commit message does not explain why it was re added. It is not needed
as the clk notifier is used. Removed it again.

Link: nxp-imx/linux-imx#21
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
@lategoodbye lategoodbye requested review from mhei and t-mon May 21, 2026 13:51
@mhei mhei merged commit a239e81 into v6.12.34-2.1.0-phy-cb May 21, 2026
@mhei mhei deleted the v6.12.34-2.1.0-phy-cb-i2c-deadlock branch May 21, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants