diff mbox series

[2/3] i2c: enable async suspend/resume for i2c adapters

Message ID 20211025213532.2349161-3-rajatja@google.com
State Accepted
Headers show
Series i2c: Enable asynchronous suspend/resume | expand

Commit Message

Rajat Jain Oct. 25, 2021, 9:35 p.m. UTC
Enable async suspend/resume of i2c adapters. It enormously helps with
reducing the resume time of systems (as much as 20%-40%) where I2C devices
can take significant time (100s of ms) to resume.

Signed-off-by: Rajat Jain <rajatja@google.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
v2: Add Jarkko's tested by

 drivers/i2c/i2c-core-base.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Wolfram Sang Nov. 29, 2021, 4:51 p.m. UTC | #1
On Mon, Oct 25, 2021 at 02:35:30PM -0700, Rajat Jain wrote:
> Enable async suspend/resume of i2c adapters. It enormously helps with
> reducing the resume time of systems (as much as 20%-40%) where I2C devices
> can take significant time (100s of ms) to resume.
> 
> Signed-off-by: Rajat Jain <rajatja@google.com>
> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 54964fbe3f03..8d4f2be54e17 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1576,6 +1576,7 @@  static int i2c_register_adapter(struct i2c_adapter *adap)
 	if (res)
 		goto out_reg;
 
+	device_enable_async_suspend(&adap->dev);
 	pm_runtime_no_callbacks(&adap->dev);
 	pm_suspend_ignore_children(&adap->dev, true);
 	pm_runtime_enable(&adap->dev);