Message ID | 1434532118-119906-1-git-send-email-mika.westerberg@linux.intel.com |
---|---|
State | Accepted |
Headers | show |
On Wed, Jun 17, 2015 at 12:08:38PM +0300, Mika Westerberg wrote: > The driver calls pm_runtime_put() right before pm_runtime_disable() in its > ->remove() hook to make sure clock is gated etc. However, it turns out that > pm_runtime_put() only calls ->idle() hook without actually suspending > anything. The following pm_runtime_disable() will prevent the driver from > suspending thus leaving it "active". > > It is better to suspend the device synchronously to make sure it is > actually suspended before disabling runtime PM from it. > > While there, undo call to pm_runtime_use_autosuspend(). > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> For current? For next? stable?
On Wed, Jun 17, 2015 at 12:16:45PM +0200, Wolfram Sang wrote: > On Wed, Jun 17, 2015 at 12:08:38PM +0300, Mika Westerberg wrote: > > The driver calls pm_runtime_put() right before pm_runtime_disable() in its > > ->remove() hook to make sure clock is gated etc. However, it turns out that > > pm_runtime_put() only calls ->idle() hook without actually suspending > > anything. The following pm_runtime_disable() will prevent the driver from > > suspending thus leaving it "active". > > > > It is better to suspend the device synchronously to make sure it is > > actually suspended before disabling runtime PM from it. > > > > While there, undo call to pm_runtime_use_autosuspend(). > > > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> > > For current? For next? stable? > Right, sorry about that. I think it is fine to get this for next. -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Jun 17, 2015 at 12:08:38PM +0300, Mika Westerberg wrote: > The driver calls pm_runtime_put() right before pm_runtime_disable() in its > ->remove() hook to make sure clock is gated etc. However, it turns out that > pm_runtime_put() only calls ->idle() hook without actually suspending > anything. The following pm_runtime_disable() will prevent the driver from > suspending thus leaving it "active". > > It is better to suspend the device synchronously to make sure it is > actually suspended before disabling runtime PM from it. > > While there, undo call to pm_runtime_use_autosuspend(). > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Applied to for-next, thanks!
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 4794911a6165..3dd2de31a2f8 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -281,7 +281,8 @@ static int dw_i2c_remove(struct platform_device *pdev) i2c_dw_disable(dev); - pm_runtime_put(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); if (has_acpi_companion(&pdev->dev))
The driver calls pm_runtime_put() right before pm_runtime_disable() in its ->remove() hook to make sure clock is gated etc. However, it turns out that pm_runtime_put() only calls ->idle() hook without actually suspending anything. The following pm_runtime_disable() will prevent the driver from suspending thus leaving it "active". It is better to suspend the device synchronously to make sure it is actually suspended before disabling runtime PM from it. While there, undo call to pm_runtime_use_autosuspend(). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> --- drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)