diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-30 04:08:09 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-30 04:08:09 -0400 |
| commit | d2fc88a61b4ea99f574bde16e92718e22f312136 (patch) | |
| tree | f256841ebcbc3b90fc29d7fa751610ba9aac5a2b /drivers/base | |
| parent | e16f4f3e0b7daecd48d4f944ab4147c1a6cb16a8 (diff) | |
| parent | acb1872577b346bd15ab3a3f8dff780d6cca4b70 (diff) | |
Merge 4.18-rc7 into driver-core-next
We need the driver core changes in here as well for testing.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/dd.c | 8 | ||||
| -rw-r--r-- | drivers/base/power/domain.c | 23 |
2 files changed, 12 insertions, 19 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index fb62f1be40d3..edfc9f0b1180 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
| @@ -496,14 +496,6 @@ re_probe: | |||
| 496 | goto probe_failed; | 496 | goto probe_failed; |
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | /* | ||
| 500 | * Ensure devices are listed in devices_kset in correct order | ||
| 501 | * It's important to move Dev to the end of devices_kset before | ||
| 502 | * calling .probe, because it could be recursive and parent Dev | ||
| 503 | * should always go first | ||
| 504 | */ | ||
| 505 | devices_kset_move_last(dev); | ||
| 506 | |||
| 507 | if (dev->bus->probe) { | 499 | if (dev->bus->probe) { |
| 508 | ret = dev->bus->probe(dev); | 500 | ret = dev->bus->probe(dev); |
| 509 | if (ret) | 501 | if (ret) |
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 8c12213875c6..946da9bddcb8 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -2235,7 +2235,7 @@ static void genpd_dev_pm_sync(struct device *dev) | |||
| 2235 | } | 2235 | } |
| 2236 | 2236 | ||
| 2237 | static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, | 2237 | static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, |
| 2238 | unsigned int index) | 2238 | unsigned int index, bool power_on) |
| 2239 | { | 2239 | { |
| 2240 | struct of_phandle_args pd_args; | 2240 | struct of_phandle_args pd_args; |
| 2241 | struct generic_pm_domain *pd; | 2241 | struct generic_pm_domain *pd; |
| @@ -2271,9 +2271,11 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device_node *np, | |||
| 2271 | dev->pm_domain->detach = genpd_dev_pm_detach; | 2271 | dev->pm_domain->detach = genpd_dev_pm_detach; |
| 2272 | dev->pm_domain->sync = genpd_dev_pm_sync; | 2272 | dev->pm_domain->sync = genpd_dev_pm_sync; |
| 2273 | 2273 | ||
| 2274 | genpd_lock(pd); | 2274 | if (power_on) { |
| 2275 | ret = genpd_power_on(pd, 0); | 2275 | genpd_lock(pd); |
| 2276 | genpd_unlock(pd); | 2276 | ret = genpd_power_on(pd, 0); |
| 2277 | genpd_unlock(pd); | ||
| 2278 | } | ||
| 2277 | 2279 | ||
| 2278 | if (ret) | 2280 | if (ret) |
| 2279 | genpd_remove_device(pd, dev); | 2281 | genpd_remove_device(pd, dev); |
| @@ -2307,7 +2309,7 @@ int genpd_dev_pm_attach(struct device *dev) | |||
| 2307 | "#power-domain-cells") != 1) | 2309 | "#power-domain-cells") != 1) |
| 2308 | return 0; | 2310 | return 0; |
| 2309 | 2311 | ||
| 2310 | return __genpd_dev_pm_attach(dev, dev->of_node, 0); | 2312 | return __genpd_dev_pm_attach(dev, dev->of_node, 0, true); |
| 2311 | } | 2313 | } |
| 2312 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); | 2314 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); |
| 2313 | 2315 | ||
| @@ -2359,14 +2361,14 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, | |||
| 2359 | } | 2361 | } |
| 2360 | 2362 | ||
| 2361 | /* Try to attach the device to the PM domain at the specified index. */ | 2363 | /* Try to attach the device to the PM domain at the specified index. */ |
| 2362 | ret = __genpd_dev_pm_attach(genpd_dev, dev->of_node, index); | 2364 | ret = __genpd_dev_pm_attach(genpd_dev, dev->of_node, index, false); |
| 2363 | if (ret < 1) { | 2365 | if (ret < 1) { |
| 2364 | device_unregister(genpd_dev); | 2366 | device_unregister(genpd_dev); |
| 2365 | return ret ? ERR_PTR(ret) : NULL; | 2367 | return ret ? ERR_PTR(ret) : NULL; |
| 2366 | } | 2368 | } |
| 2367 | 2369 | ||
| 2368 | pm_runtime_set_active(genpd_dev); | ||
| 2369 | pm_runtime_enable(genpd_dev); | 2370 | pm_runtime_enable(genpd_dev); |
| 2371 | genpd_queue_power_off_work(dev_to_genpd(genpd_dev)); | ||
| 2370 | 2372 | ||
| 2371 | return genpd_dev; | 2373 | return genpd_dev; |
| 2372 | } | 2374 | } |
| @@ -2487,10 +2489,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); | |||
| 2487 | * power domain corresponding to a DT node's "required-opps" property. | 2489 | * power domain corresponding to a DT node's "required-opps" property. |
| 2488 | * | 2490 | * |
| 2489 | * @dev: Device for which the performance-state needs to be found. | 2491 | * @dev: Device for which the performance-state needs to be found. |
| 2490 | * @opp_node: DT node where the "required-opps" property is present. This can be | 2492 | * @np: DT node where the "required-opps" property is present. This can be |
| 2491 | * the device node itself (if it doesn't have an OPP table) or a node | 2493 | * the device node itself (if it doesn't have an OPP table) or a node |
| 2492 | * within the OPP table of a device (if device has an OPP table). | 2494 | * within the OPP table of a device (if device has an OPP table). |
| 2493 | * @state: Pointer to return performance state. | ||
| 2494 | * | 2495 | * |
| 2495 | * Returns performance state corresponding to the "required-opps" property of | 2496 | * Returns performance state corresponding to the "required-opps" property of |
| 2496 | * a DT node. This calls platform specific genpd->opp_to_performance_state() | 2497 | * a DT node. This calls platform specific genpd->opp_to_performance_state() |
| @@ -2499,7 +2500,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); | |||
| 2499 | * Returns performance state on success and 0 on failure. | 2500 | * Returns performance state on success and 0 on failure. |
| 2500 | */ | 2501 | */ |
| 2501 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, | 2502 | unsigned int of_genpd_opp_to_performance_state(struct device *dev, |
| 2502 | struct device_node *opp_node) | 2503 | struct device_node *np) |
| 2503 | { | 2504 | { |
| 2504 | struct generic_pm_domain *genpd; | 2505 | struct generic_pm_domain *genpd; |
| 2505 | struct dev_pm_opp *opp; | 2506 | struct dev_pm_opp *opp; |
| @@ -2514,7 +2515,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, | |||
| 2514 | 2515 | ||
| 2515 | genpd_lock(genpd); | 2516 | genpd_lock(genpd); |
| 2516 | 2517 | ||
| 2517 | opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node); | 2518 | opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np); |
| 2518 | if (IS_ERR(opp)) { | 2519 | if (IS_ERR(opp)) { |
| 2519 | dev_err(dev, "Failed to find required OPP: %ld\n", | 2520 | dev_err(dev, "Failed to find required OPP: %ld\n", |
| 2520 | PTR_ERR(opp)); | 2521 | PTR_ERR(opp)); |
