For the DT based device attach process, let's parse the device node for PM QoS latency properties and provide the result as the timing data when adding a device to its PM domain. In DT based platforms, this change allows a device to have initial correct latency values. In the ideal scenario it should mean that the calibration of these values shouldn't be needed by the genpd governor, but let's leave that as a future change to consider. Suggested-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx> --- drivers/base/power/domain.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 56705b5..f3302a9 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1790,6 +1790,7 @@ int genpd_dev_pm_attach(struct device *dev) { struct of_phandle_args pd_args; struct generic_pm_domain *pd; + struct gpd_timing_data td; unsigned int i; int ret; @@ -1824,10 +1825,16 @@ int genpd_dev_pm_attach(struct device *dev) return -EPROBE_DEFER; } + memset(&td, 0, sizeof(td)); + of_property_read_u64(dev->of_node, "suspend-latency", + &td.suspend_latency_ns); + of_property_read_u64(dev->of_node, "resume-latency", + &td.resume_latency_ns); + dev_dbg(dev, "adding to PM domain %s\n", pd->name); for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) { - ret = pm_genpd_add_device(pd, dev); + ret = __pm_genpd_add_device(pd, dev, &td); if (ret != -EAGAIN) break; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html