Skip to contentSkip to conversation

PM / Runtime: Idle devices asynchronously after probe|release

PATCH RESEND New Ulf Hansson 3 participants 3 messages Apr 10, 2013 – Apr 11, 2013 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 PM / Runtime: Idle devices asynchronously after probe|release

From: Ulf Hansson <[email protected]>

Putting devices into idle|suspend in a synchronous manner means we are waiting for each device to become idle|suspended before the probe|release is fully done.

This patch switch to use the asynchronous runtime PM API:s instead and thus improves the parallelism since we can move on and handle the next device in queue in an earlier phase.

Cc Kevin Hilman <[email protected]>
Cc Alan Stern <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/base/dd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/dd.c +3 -3
index bb5645e..35fa368 100644
@@ -380,7 +380,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
 
 	pm_runtime_barrier(dev);
 	ret = really_probe(dev, drv);
-	pm_runtime_idle(dev);
+	pm_request_idle(dev);
 
 	return ret;
 }
@@ -428,7 +428,7 @@ int device_attach(struct device *dev)
 		}
 	} else {
 		ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
-		pm_runtime_idle(dev);
+		pm_request_idle(dev);
 	}
 out_unlock:
 	device_unlock(dev);
@@ -499,7 +499,7 @@ static void __device_release_driver(struct device *dev)
 						     BUS_NOTIFY_UNBIND_DRIVER,
 						     dev);
 
-		pm_runtime_put_sync(dev);
+		pm_runtime_put(dev);
 
 		if (dev->bus && dev->bus->remove)
 			dev->bus->remove(dev);
Signature · 1 line
1.7.10
#1 lore raw

PATCH RESEND 1/1 PM / Runtime: Idle devices asynchronously after probe|release

Quoted 9 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

Putting devices into idle|suspend in a synchronous manner means we are waiting for each device to become idle|suspended before the probe|release is fully done.

This patch switch to use the asynchronous runtime PM API:s instead and thus improves the parallelism since we can move on and handle the next device in queue in an earlier phase.

Quoted 40 lines
Cc Kevin Hilman <[email protected]>
Cc Alan Stern <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/base/dd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/dd.c +3 -3
index bb5645e..35fa368 100644
@@ -380,7 +380,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
 
 	pm_runtime_barrier(dev);
 	ret = really_probe(dev, drv);
-	pm_runtime_idle(dev);
+	pm_request_idle(dev);
 
 	return ret;
 }
@@ -428,7 +428,7 @@ int device_attach(struct device *dev)
 		}
 	} else {
 		ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
-		pm_runtime_idle(dev);
+		pm_request_idle(dev);
 	}
 out_unlock:
 	device_unlock(dev);
@@ -499,7 +499,7 @@ static void __device_release_driver(struct device *dev)
 						     BUS_NOTIFY_UNBIND_DRIVER,
 						     dev);
 
-		pm_runtime_put_sync(dev);
+		pm_runtime_put(dev);
 
 		if (dev->bus && dev->bus->remove)
 			dev->bus->remove(dev);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw

PATCH RESEND 1/1 PM / Runtime: Idle devices asynchronously after probe|release

In reply to Ulf Hansson
Quoted 6 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

Putting devices into idle|suspend in a synchronous manner means we are waiting for each device to become idle|suspended before the probe|release is fully done.

Quoted 8 lines

This patch switch to use the asynchronous runtime PM API:s instead and thus improves the parallelism since we can move on and handle the next device in queue in an earlier phase.

Cc Kevin Hilman <[email protected]>
Cc Alan Stern <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>