Backport fix of possible deadlock in i2c-imx#28
Merged
Conversation
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>
t-mon
approved these changes
May 21, 2026
mhei
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.