Skip to content

Commit 9f42de8

Browse files
digetxWolfram Sang
authored andcommitted
i2c: tegra: Fix suspending in active runtime PM state
I noticed that sometime I2C clock is kept enabled during suspend-resume. This happens because runtime PM defers dynamic suspension and thus it may happen that runtime PM is in active state when system enters into suspend. In particular I2C controller that is used for CPU's DVFS is often kept ON during suspend because CPU's voltage scaling happens quite often. Fixes: 8ebf15e ("i2c: tegra: Move suspend handling to NOIRQ phase") Cc: <[email protected]> # v5.4+ Tested-by: Thierry Reding <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent b3a987b commit 9f42de8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/i2c/busses/i2c-tegra.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,9 +1710,14 @@ static int tegra_i2c_remove(struct platform_device *pdev)
17101710
static int __maybe_unused tegra_i2c_suspend(struct device *dev)
17111711
{
17121712
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
1713+
int err;
17131714

17141715
i2c_mark_adapter_suspended(&i2c_dev->adapter);
17151716

1717+
err = pm_runtime_force_suspend(dev);
1718+
if (err < 0)
1719+
return err;
1720+
17161721
return 0;
17171722
}
17181723

@@ -1733,6 +1738,10 @@ static int __maybe_unused tegra_i2c_resume(struct device *dev)
17331738
if (err)
17341739
return err;
17351740

1741+
err = pm_runtime_force_resume(dev);
1742+
if (err < 0)
1743+
return err;
1744+
17361745
i2c_mark_adapter_resumed(&i2c_dev->adapter);
17371746

17381747
return 0;

0 commit comments

Comments
 (0)