Skip to contentSkip to conversation

i2c: designware: Make sure the device is suspended before disabling runtime PM

PATCH Applied Mika Westerberg 2 participants 4 messages Jun 17, 2015 – Jun 21, 2015 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: designware: Make sure the device is suspended before disabling runtime PM

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().

---
 drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-platdrv.c +2 -1
index 4794911a6165..3dd2de31a2f8 100644
@@ -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))
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1434532118-119906-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/[email protected]

#2 lore raw
Quoted 6 lines · Mika Westerberg

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".

Quoted 6 lines

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().

For current? For next? stable?

#3 lore raw
Quoted 7 lines · Wolfram Sang
Quoted 6 lines · Mika Westerberg

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".

Quoted 9 lines
Quoted 6 lines

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().

For current? For next? stable?

Right, sorry about that.

I think it is fine to get this for next.

Applied
#4 lore raw
In reply to a message not in the archive
Quoted 6 lines · Mika Westerberg

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".

Quoted 6 lines

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().

Applied to for-next, thanks!