[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6d6xgvuvu74hm5466xeovgr4qqkwxaxaoeemvfdty3dqnl4gjp@axlzm6mxnzkv>
Date: Thu, 5 Dec 2024 12:53:42 +0100
From: Andi Shyti <andi.shyti@...nel.org>
To: carlos.song@....com
Cc: o.rempel@...gutronix.de, kernel@...gutronix.de, shawnguo@...nel.org,
s.hauer@...gutronix.de, festevam@...il.com, frank.li@....com, linux-i2c@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i2c: imx: make controller available until system
suspend_noirq() and from resume_noirq()
Hi Carlos,
...
> +static int i2c_imx_suspend(struct device *dev)
> +{
> + /*
> + * Some I2C devices may need I2C controller up during resume_noirq()
> + * or suspend_noirq(), if the controller is autosuspended, there is
> + * no way to wakeup it once runtime pm is disabled (in suspend_late()).
> + * When system resume, I2C controller will be available until runtime pm
> + * is enabled(in_resume_early()). But it is too late for some devices.
> + * Wakeup the controller in suspend() callback while runtime pm is enabled,
> + * I2C controller will be available until suspend_noirq() callback
> + * (pm_runtime_force_suspend()) is called. During the resume, I2C controller
> + * can be restored by resume_noirq() callback (pm_runtime_force_resume()).
> + * Then resume() callback enables autosuspend. It will make I2C controller
> + * available until system suspend_noirq() and from resume_noirq().
> + */
Just made some little adjustments to the comment above, please
let me know if they are fine:
/*
* Some I2C devices may need the I2C controller to remain active
* during resume_noirq() or suspend_noirq(). If the controller is
* autosuspended, there is no way to wake it up once runtime PM is
* disabled (in suspend_late()).
*
* During system resume, the I2C controller will be available only
* after runtime PM is re-enabled (in resume_early()). However, this
* may be too late for some devices.
*
* Wake up the controller in the suspend() callback while runtime PM
* is still enabled. The I2C controller will remain available until
* the suspend_noirq() callback (pm_runtime_force_suspend()) is
* called. During resume, the I2C controller can be restored by the
* resume_noirq() callback (pm_runtime_force_resume()).
*
* Finally, the resume() callback re-enables autosuspend, ensuring
* the I2C controller remains available until the system enters
* suspend_noirq() and from resume_noirq().
*/
If so, I will take it in.
Andi
> + return pm_runtime_resume_and_get(dev);
> +}
Powered by blists - more mailing lists