diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-20 18:42:59 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-20 18:42:59 -0500 |
commit | 6efd3f8cde1d6acc20a715ac6ea17e01421742df (patch) | |
tree | 5fc4caece6907a2ccdeb8b13b887a01d683d9803 /drivers/acpi | |
parent | a72aea722f1b43442c9e219de824d5975dcdaa61 (diff) | |
parent | 3ded91041a762423bd49bb932ae2e36b65c6ae4b (diff) |
Merge branch 'pm-core'
* pm-core:
driver core: Avoid NULL pointer dereferences in device_is_bound()
platform: Do not detach from PM domains on shutdown
USB / PM: Allow USB devices to remain runtime-suspended when sleeping
PM / sleep: Go direct_complete if driver has no callbacks
PM / Domains: add setter for dev.pm_domain
device core: add device_is_bound()
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 5 | ||||
-rw-r--r-- | drivers/acpi/device_pm.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 047281a6ae11..c570b1d9f094 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
20 | #include <linux/platform_data/clk-lpss.h> | 20 | #include <linux/platform_data/clk-lpss.h> |
21 | #include <linux/pm_domain.h> | ||
21 | #include <linux/pm_runtime.h> | 22 | #include <linux/pm_runtime.h> |
22 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
23 | 24 | ||
@@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb, | |||
875 | 876 | ||
876 | switch (action) { | 877 | switch (action) { |
877 | case BUS_NOTIFY_BIND_DRIVER: | 878 | case BUS_NOTIFY_BIND_DRIVER: |
878 | pdev->dev.pm_domain = &acpi_lpss_pm_domain; | 879 | dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain); |
879 | break; | 880 | break; |
880 | case BUS_NOTIFY_DRIVER_NOT_BOUND: | 881 | case BUS_NOTIFY_DRIVER_NOT_BOUND: |
881 | case BUS_NOTIFY_UNBOUND_DRIVER: | 882 | case BUS_NOTIFY_UNBOUND_DRIVER: |
882 | pdev->dev.pm_domain = NULL; | 883 | pdev->dev.pm_domain = NULL; |
883 | break; | 884 | break; |
884 | case BUS_NOTIFY_ADD_DEVICE: | 885 | case BUS_NOTIFY_ADD_DEVICE: |
886 | dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain); | ||
885 | if (pdata->dev_desc->flags & LPSS_LTR) | 887 | if (pdata->dev_desc->flags & LPSS_LTR) |
886 | return sysfs_create_group(&pdev->dev.kobj, | 888 | return sysfs_create_group(&pdev->dev.kobj, |
887 | &lpss_attr_group); | 889 | &lpss_attr_group); |
@@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb, | |||
889 | case BUS_NOTIFY_DEL_DEVICE: | 891 | case BUS_NOTIFY_DEL_DEVICE: |
890 | if (pdata->dev_desc->flags & LPSS_LTR) | 892 | if (pdata->dev_desc->flags & LPSS_LTR) |
891 | sysfs_remove_group(&pdev->dev.kobj, &lpss_attr_group); | 893 | sysfs_remove_group(&pdev->dev.kobj, &lpss_attr_group); |
894 | dev_pm_domain_set(&pdev->dev, NULL); | ||
892 | break; | 895 | break; |
893 | default: | 896 | default: |
894 | break; | 897 | break; |
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 08a02cdc737c..cd2c3d6d40e0 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/export.h> | 22 | #include <linux/export.h> |
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/pm_qos.h> | 24 | #include <linux/pm_qos.h> |
25 | #include <linux/pm_domain.h> | ||
25 | #include <linux/pm_runtime.h> | 26 | #include <linux/pm_runtime.h> |
26 | 27 | ||
27 | #include "internal.h" | 28 | #include "internal.h" |
@@ -1059,7 +1060,7 @@ static void acpi_dev_pm_detach(struct device *dev, bool power_off) | |||
1059 | struct acpi_device *adev = ACPI_COMPANION(dev); | 1060 | struct acpi_device *adev = ACPI_COMPANION(dev); |
1060 | 1061 | ||
1061 | if (adev && dev->pm_domain == &acpi_general_pm_domain) { | 1062 | if (adev && dev->pm_domain == &acpi_general_pm_domain) { |
1062 | dev->pm_domain = NULL; | 1063 | dev_pm_domain_set(dev, NULL); |
1063 | acpi_remove_pm_notifier(adev); | 1064 | acpi_remove_pm_notifier(adev); |
1064 | if (power_off) { | 1065 | if (power_off) { |
1065 | /* | 1066 | /* |
@@ -1111,7 +1112,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) | |||
1111 | return -EBUSY; | 1112 | return -EBUSY; |
1112 | 1113 | ||
1113 | acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func); | 1114 | acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func); |
1114 | dev->pm_domain = &acpi_general_pm_domain; | 1115 | dev_pm_domain_set(dev, &acpi_general_pm_domain); |
1115 | if (power_on) { | 1116 | if (power_on) { |
1116 | acpi_dev_pm_full_power(adev); | 1117 | acpi_dev_pm_full_power(adev); |
1117 | acpi_device_wakeup(adev, ACPI_STATE_S0, false); | 1118 | acpi_device_wakeup(adev, ACPI_STATE_S0, false); |