Skip to content

Commit

Permalink
PM / Runtime: Idle devices asynchronously after probe|release
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ulf Hansson authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 4e4098a commit fa180eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fa180eb

Please sign in to comment.