Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa180eb4 authored by Ulf Hansson's avatar Ulf Hansson Committed by Greg Kroah-Hartman
Browse files

PM / Runtime: Idle devices asynchronously after probe|release



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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarKevin Hilman <khilman@linaro.org>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e4098a3
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -380,7 +380,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)


	pm_runtime_barrier(dev);
	pm_runtime_barrier(dev);
	ret = really_probe(dev, drv);
	ret = really_probe(dev, drv);
	pm_runtime_idle(dev);
	pm_request_idle(dev);


	return ret;
	return ret;
}
}
@@ -428,7 +428,7 @@ int device_attach(struct device *dev)
		}
		}
	} else {
	} else {
		ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
		ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
		pm_runtime_idle(dev);
		pm_request_idle(dev);
	}
	}
out_unlock:
out_unlock:
	device_unlock(dev);
	device_unlock(dev);
@@ -499,7 +499,7 @@ static void __device_release_driver(struct device *dev)
						     BUS_NOTIFY_UNBIND_DRIVER,
						     BUS_NOTIFY_UNBIND_DRIVER,
						     dev);
						     dev);


		pm_runtime_put_sync(dev);
		pm_runtime_put(dev);


		if (dev->bus && dev->bus->remove)
		if (dev->bus && dev->bus->remove)
			dev->bus->remove(dev);
			dev->bus->remove(dev);