[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-02-09 Thread valdis.kletni...@vt.edu
On Mon, 08 Feb 2016 22:50:39 +0100, "Rafael J. Wysocki" said:
> On Mon, Feb 8, 2016 at 10:44 PM,   wrote:

> > My Dell Latitude laptopi on next-20160201 is throwing a similar error
> > at shutdown, except the traceback continues:
> >
> > mei_me_remove+0xbd/0xc0
> > pci_device_shutdown+0x32/0x50
> > device_shutdown+0xe2/0x210
> >
> > (sorry, that's all I have, transcribing from one frame of video shot while
> > the system was shutting down)
>
> This should be fixed in 4.5-rc3, so please retest.

Confirming that next-20160201 has the problem, but it is fixed as of 
next-20160208.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
URL: 



[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-02-08 Thread Rafael J. Wysocki
On Mon, Feb 8, 2016 at 10:44 PM,   wrote:
> On Fri, 29 Jan 2016 22:35:18 +0100, "Rafael J. Wysocki" said:
>> > One more test unveils this one
>> >
>> > # modprobe -r sdhci-acpi
>> > [ 1289.909441] [ cut here ]
>> > [ 1289.918205] WARNING: CPU: 1 PID: 4374 at
>> > /home/andy/prj/linux-otc/drivers/base/power/common.c:150
>> > dev_pm_domain_set+0x51/0x60()
>> > [ 1289.934681] PM domains can only be changed for unbound devices
>> > [ 1289.944843] Modules linked in: sdhci_acpi(-) sdhci mmc_core
>> > led_class [last unloaded: dw_dmac_core]
>> > [ 1289.958802] CPU: 1 PID: 4374 Comm: modprobe Not tainted 4.5.0-rc1+ #3
>> > [ 1289.969736]  81c38330 88007bb53d18 8133162f
>> > 88007bb53d60
>> > [ 1289.981844]  88007bb53d50 8105cd12 88017a007410
>> > 
>> > [ 1289.993996]  0001 0080 
>> > 88007bb53db0
>> > [ 1290.006123] Call Trace:
>> > [ 1290.012600]  [] dump_stack+0x44/0x55
>> > [ 1290.022052]  [] warn_slowpath_common+0x82/0xc0
>> > [ 1290.032462]  [] warn_slowpath_fmt+0x4c/0x50
>> > [ 1290.042589]  [] dev_pm_domain_set+0x51/0x60
>
> My Dell Latitude laptopi on next-20160201 is throwing a similar error
> at shutdown, except the traceback continues:
>
> mei_me_remove+0xbd/0xc0
> pci_device_shutdown+0x32/0x50
> device_shutdown+0xe2/0x210
>
> (sorry, that's all I have, transcribing from one frame of video shot while
> the system was shutting down)

This should be fixed in 4.5-rc3, so please retest.

Thanks,
Rafael


[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-02-08 Thread valdis.kletni...@vt.edu
On Fri, 29 Jan 2016 22:35:18 +0100, "Rafael J. Wysocki" said:
> > One more test unveils this one
> > 
> > # modprobe -r sdhci-acpi
> > [ 1289.909441] [ cut here ]
> > [ 1289.918205] WARNING: CPU: 1 PID: 4374 at
> > /home/andy/prj/linux-otc/drivers/base/power/common.c:150
> > dev_pm_domain_set+0x51/0x60()
> > [ 1289.934681] PM domains can only be changed for unbound devices
> > [ 1289.944843] Modules linked in: sdhci_acpi(-) sdhci mmc_core
> > led_class [last unloaded: dw_dmac_core]
> > [ 1289.958802] CPU: 1 PID: 4374 Comm: modprobe Not tainted 4.5.0-rc1+ #3
> > [ 1289.969736]  81c38330 88007bb53d18 8133162f
> > 88007bb53d60
> > [ 1289.981844]  88007bb53d50 8105cd12 88017a007410
> > 
> > [ 1289.993996]  0001 0080 
> > 88007bb53db0
> > [ 1290.006123] Call Trace:
> > [ 1290.012600]  [] dump_stack+0x44/0x55
> > [ 1290.022052]  [] warn_slowpath_common+0x82/0xc0
> > [ 1290.032462]  [] warn_slowpath_fmt+0x4c/0x50
> > [ 1290.042589]  [] dev_pm_domain_set+0x51/0x60

My Dell Latitude laptopi on next-20160201 is throwing a similar error
at shutdown, except the traceback continues:

mei_me_remove+0xbd/0xc0
pci_device_shutdown+0x32/0x50
device_shutdown+0xe2/0x210

(sorry, that's all I have, transcribing from one frame of video shot while
the system was shutting down)



[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-01-29 Thread Rafael J. Wysocki
On Friday, January 29, 2016 06:35:49 PM Andy Shevchenko wrote:
> On Fri, Jan 29, 2016 at 5:51 PM, Andy Shevchenko
>  wrote:
> > On Fri, Jan 29, 2016 at 5:38 PM, Andy Shevchenko
> >  wrote:
> >> On Thu, Jan 7, 2016 at 5:46 PM, Tomeu Vizoso  >> collabora.com> wrote:
> >>> Adds a function that sets the pointer to dev_pm_domain in struct device
> >>> and that warns if the device has already finished probing. The reason
> >>> why we want to enforce that is because in the general case that can
> >>> cause problems and also that we can simplify code quite a bit if we can
> >>> always assume that.
> >>>
> >>> This patch also changes all current code that directly sets the
> >>> dev.pm_domain pointer.
> >>
> >>
> >>> --- a/drivers/acpi/acpi_lpss.c
> >>> +++ b/drivers/acpi/acpi_lpss.c
> >>
> >>> @@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct 
> >>> notifier_block *nb,
> >>>
> >>> switch (action) {
> >>> case BUS_NOTIFY_BIND_DRIVER:
> >>> -   pdev->dev.pm_domain = _lpss_pm_domain;
> >>> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
> >>> break;
> >>> case BUS_NOTIFY_DRIVER_NOT_BOUND:
> >>> case BUS_NOTIFY_UNBOUND_DRIVER:
> >>> pdev->dev.pm_domain = NULL;
> >>
> >> Missed?
> >>
> >>> break;
> >>> case BUS_NOTIFY_ADD_DEVICE:
> >>> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
> >>> if (pdata->dev_desc->flags & LPSS_LTR)
> >>> return sysfs_create_group(>dev.kobj,
> >>>   _attr_group);
> >>> @@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct 
> >>> notifier_block *nb,
> >>> case BUS_NOTIFY_DEL_DEVICE:
> >>> if (pdata->dev_desc->flags & LPSS_LTR)
> >>> sysfs_remove_group(>dev.kobj, 
> >>> _attr_group);
> >>> +   dev_pm_domain_set(>dev, NULL);
> >>> break;
> >>> default:
> >>> break;
> >>
> >> This looks wrong. I didn't test yet, but I have concerns here. Why did
> >> you add those calls?
> >
> >
> > Okay, for first glance it seems working on Intel Braswell.
> 
> One more test unveils this one
> 
> # modprobe -r sdhci-acpi
> [ 1289.909441] [ cut here ]
> [ 1289.918205] WARNING: CPU: 1 PID: 4374 at
> /home/andy/prj/linux-otc/drivers/base/power/common.c:150
> dev_pm_domain_set+0x51/0x60()
> [ 1289.934681] PM domains can only be changed for unbound devices
> [ 1289.944843] Modules linked in: sdhci_acpi(-) sdhci mmc_core
> led_class [last unloaded: dw_dmac_core]
> [ 1289.958802] CPU: 1 PID: 4374 Comm: modprobe Not tainted 4.5.0-rc1+ #3
> [ 1289.969736]  81c38330 88007bb53d18 8133162f
> 88007bb53d60
> [ 1289.981844]  88007bb53d50 8105cd12 88017a007410
> 
> [ 1289.993996]  0001 0080 
> 88007bb53db0
> [ 1290.006123] Call Trace:
> [ 1290.012600]  [] dump_stack+0x44/0x55
> [ 1290.022052]  [] warn_slowpath_common+0x82/0xc0
> [ 1290.032462]  [] warn_slowpath_fmt+0x4c/0x50
> [ 1290.042589]  [] dev_pm_domain_set+0x51/0x60
> [ 1290.052695]  [] acpi_dev_pm_detach+0x3f/0x84
> [ 1290.062910]  [] dev_pm_domain_detach+0x27/0x30
> [ 1290.073294]  [] platform_drv_remove+0x38/0x40
> [ 1290.083585]  [] __device_release_driver+0xa1/0x160
> [ 1290.094335]  [] driver_detach+0xa6/0xb0
> [ 1290.104009]  [] bus_remove_driver+0x55/0xd0
> [ 1290.114053]  [] driver_unregister+0x2c/0x50
> [ 1290.124076]  [] platform_driver_unregister+0x12/0x20
> [ 1290.134957]  [] sdhci_acpi_driver_exit+0x10/0x12
> [sdhci_acpi]
> [ 1290.146730]  [] SyS_delete_module+0x199/0x240
> [ 1290.156907]  [] ? exit_to_usermode_loop+0x8b/0x90
> [ 1290.167478]  [] do_syscall_32_irqs_off+0x53/0xa0
> [ 1290.177949]  [] entry_INT80_compat+0x2a/0x40
> [ 1290.187986] ---[ end trace a8351c0506ee239b ]---
> [ 1290.213855] mmc0: card 0001 removed
> 
> Which function is guilty?

acpi_dev_pm_detach() calls dev_pm_domain_set() to clear the pm_domain pointer.

One might argue that this is happening too early.

Thanks,
Rafael



[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-01-29 Thread Andy Shevchenko
On Fri, Jan 29, 2016 at 5:51 PM, Andy Shevchenko
 wrote:
> On Fri, Jan 29, 2016 at 5:38 PM, Andy Shevchenko
>  wrote:
>> On Thu, Jan 7, 2016 at 5:46 PM, Tomeu Vizoso  
>> wrote:
>>> Adds a function that sets the pointer to dev_pm_domain in struct device
>>> and that warns if the device has already finished probing. The reason
>>> why we want to enforce that is because in the general case that can
>>> cause problems and also that we can simplify code quite a bit if we can
>>> always assume that.
>>>
>>> This patch also changes all current code that directly sets the
>>> dev.pm_domain pointer.
>>
>>
>>> --- a/drivers/acpi/acpi_lpss.c
>>> +++ b/drivers/acpi/acpi_lpss.c
>>
>>> @@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct 
>>> notifier_block *nb,
>>>
>>> switch (action) {
>>> case BUS_NOTIFY_BIND_DRIVER:
>>> -   pdev->dev.pm_domain = _lpss_pm_domain;
>>> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
>>> break;
>>> case BUS_NOTIFY_DRIVER_NOT_BOUND:
>>> case BUS_NOTIFY_UNBOUND_DRIVER:
>>> pdev->dev.pm_domain = NULL;
>>
>> Missed?
>>
>>> break;
>>> case BUS_NOTIFY_ADD_DEVICE:
>>> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
>>> if (pdata->dev_desc->flags & LPSS_LTR)
>>> return sysfs_create_group(>dev.kobj,
>>>   _attr_group);
>>> @@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct 
>>> notifier_block *nb,
>>> case BUS_NOTIFY_DEL_DEVICE:
>>> if (pdata->dev_desc->flags & LPSS_LTR)
>>> sysfs_remove_group(>dev.kobj, 
>>> _attr_group);
>>> +   dev_pm_domain_set(>dev, NULL);
>>> break;
>>> default:
>>> break;
>>
>> This looks wrong. I didn't test yet, but I have concerns here. Why did
>> you add those calls?
>
>
> Okay, for first glance it seems working on Intel Braswell.

One more test unveils this one

# modprobe -r sdhci-acpi
[ 1289.909441] [ cut here ]
[ 1289.918205] WARNING: CPU: 1 PID: 4374 at
/home/andy/prj/linux-otc/drivers/base/power/common.c:150
dev_pm_domain_set+0x51/0x60()
[ 1289.934681] PM domains can only be changed for unbound devices
[ 1289.944843] Modules linked in: sdhci_acpi(-) sdhci mmc_core
led_class [last unloaded: dw_dmac_core]
[ 1289.958802] CPU: 1 PID: 4374 Comm: modprobe Not tainted 4.5.0-rc1+ #3
[ 1289.969736]  81c38330 88007bb53d18 8133162f
88007bb53d60
[ 1289.981844]  88007bb53d50 8105cd12 88017a007410

[ 1289.993996]  0001 0080 
88007bb53db0
[ 1290.006123] Call Trace:
[ 1290.012600]  [] dump_stack+0x44/0x55
[ 1290.022052]  [] warn_slowpath_common+0x82/0xc0
[ 1290.032462]  [] warn_slowpath_fmt+0x4c/0x50
[ 1290.042589]  [] dev_pm_domain_set+0x51/0x60
[ 1290.052695]  [] acpi_dev_pm_detach+0x3f/0x84
[ 1290.062910]  [] dev_pm_domain_detach+0x27/0x30
[ 1290.073294]  [] platform_drv_remove+0x38/0x40
[ 1290.083585]  [] __device_release_driver+0xa1/0x160
[ 1290.094335]  [] driver_detach+0xa6/0xb0
[ 1290.104009]  [] bus_remove_driver+0x55/0xd0
[ 1290.114053]  [] driver_unregister+0x2c/0x50
[ 1290.124076]  [] platform_driver_unregister+0x12/0x20
[ 1290.134957]  [] sdhci_acpi_driver_exit+0x10/0x12
[sdhci_acpi]
[ 1290.146730]  [] SyS_delete_module+0x199/0x240
[ 1290.156907]  [] ? exit_to_usermode_loop+0x8b/0x90
[ 1290.167478]  [] do_syscall_32_irqs_off+0x53/0xa0
[ 1290.177949]  [] entry_INT80_compat+0x2a/0x40
[ 1290.187986] ---[ end trace a8351c0506ee239b ]---
[ 1290.213855] mmc0: card 0001 removed

Which function is guilty?

> But can
> yoyu point me out what was going on before this patch?

-- 
With Best Regards,
Andy Shevchenko


[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-01-29 Thread Andy Shevchenko
On Fri, Jan 29, 2016 at 5:38 PM, Andy Shevchenko
 wrote:
> On Thu, Jan 7, 2016 at 5:46 PM, Tomeu Vizoso  
> wrote:
>> Adds a function that sets the pointer to dev_pm_domain in struct device
>> and that warns if the device has already finished probing. The reason
>> why we want to enforce that is because in the general case that can
>> cause problems and also that we can simplify code quite a bit if we can
>> always assume that.
>>
>> This patch also changes all current code that directly sets the
>> dev.pm_domain pointer.
>
>
>> --- a/drivers/acpi/acpi_lpss.c
>> +++ b/drivers/acpi/acpi_lpss.c
>
>> @@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct 
>> notifier_block *nb,
>>
>> switch (action) {
>> case BUS_NOTIFY_BIND_DRIVER:
>> -   pdev->dev.pm_domain = _lpss_pm_domain;
>> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
>> break;
>> case BUS_NOTIFY_DRIVER_NOT_BOUND:
>> case BUS_NOTIFY_UNBOUND_DRIVER:
>> pdev->dev.pm_domain = NULL;
>
> Missed?
>
>> break;
>> case BUS_NOTIFY_ADD_DEVICE:
>> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
>> if (pdata->dev_desc->flags & LPSS_LTR)
>> return sysfs_create_group(>dev.kobj,
>>   _attr_group);
>> @@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct 
>> notifier_block *nb,
>> case BUS_NOTIFY_DEL_DEVICE:
>> if (pdata->dev_desc->flags & LPSS_LTR)
>> sysfs_remove_group(>dev.kobj, 
>> _attr_group);
>> +   dev_pm_domain_set(>dev, NULL);
>> break;
>> default:
>> break;
>
> This looks wrong. I didn't test yet, but I have concerns here. Why did
> you add those calls?


Okay, for first glance it seems working on Intel Braswell. But can
yoyu point me out what was going on before this patch?

-- 
With Best Regards,
Andy Shevchenko


[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-01-29 Thread Andy Shevchenko
On Thu, Jan 7, 2016 at 5:46 PM, Tomeu Vizoso  
wrote:
> Adds a function that sets the pointer to dev_pm_domain in struct device
> and that warns if the device has already finished probing. The reason
> why we want to enforce that is because in the general case that can
> cause problems and also that we can simplify code quite a bit if we can
> always assume that.
>
> This patch also changes all current code that directly sets the
> dev.pm_domain pointer.


> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c

> @@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct 
> notifier_block *nb,
>
> switch (action) {
> case BUS_NOTIFY_BIND_DRIVER:
> -   pdev->dev.pm_domain = _lpss_pm_domain;
> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
> break;
> case BUS_NOTIFY_DRIVER_NOT_BOUND:
> case BUS_NOTIFY_UNBOUND_DRIVER:
> pdev->dev.pm_domain = NULL;

Missed?

> break;
> case BUS_NOTIFY_ADD_DEVICE:
> +   dev_pm_domain_set(>dev, _lpss_pm_domain);
> if (pdata->dev_desc->flags & LPSS_LTR)
> return sysfs_create_group(>dev.kobj,
>   _attr_group);
> @@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct 
> notifier_block *nb,
> case BUS_NOTIFY_DEL_DEVICE:
> if (pdata->dev_desc->flags & LPSS_LTR)
> sysfs_remove_group(>dev.kobj, _attr_group);
> +   dev_pm_domain_set(>dev, NULL);
> break;
> default:
> break;

This looks wrong. I didn't test yet, but I have concerns here. Why did
you add those calls?

Have you been aware about the commit b5f88dd1d6ef ("Revert "ACPI /
LPSS: allow to use specific PM domain during ->probe()") ?

Sorry for being too late with this.

-- 
With Best Regards,
Andy Shevchenko


[PATCH v12 2/4] PM / Domains: add setter for dev.pm_domain

2016-01-07 Thread Tomeu Vizoso
Adds a function that sets the pointer to dev_pm_domain in struct device
and that warns if the device has already finished probing. The reason
why we want to enforce that is because in the general case that can
cause problems and also that we can simplify code quite a bit if we can
always assume that.

This patch also changes all current code that directly sets the
dev.pm_domain pointer.

Signed-off-by: Tomeu Vizoso 
Reviewed-by: Ulf Hansson 
---

Changes in v12:
- Include linux/pm_domain.h in vga_switcheroo.c for dev_pm_domain_set()

Changes in v11:
- Move calls to dev_pm_domain_set() out from >power.lock as that
  isn't needed for dev->pm_domain.

Changes in v9:
- Add docs noting the need for the device lock to be held before calling
  dev_pm_domain_set()

Changes in v8:
- Add dev_pm_domain_set() and update code to use it

 arch/arm/mach-omap2/omap_device.c |  7 ---
 drivers/acpi/acpi_lpss.c  |  5 -
 drivers/acpi/device_pm.c  |  5 +++--
 drivers/base/power/clock_ops.c|  5 +++--
 drivers/base/power/common.c   | 21 +
 drivers/base/power/domain.c   |  6 --
 drivers/gpu/vga/vga_switcheroo.c  | 11 ++-
 drivers/misc/mei/pci-me.c |  5 +++--
 drivers/misc/mei/pci-txe.c|  5 +++--
 include/linux/pm_domain.h |  3 +++
 10 files changed, 54 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c 
b/arch/arm/mach-omap2/omap_device.c
index 3750ed14f8c5..0437537751bc 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -168,7 +169,7 @@ static int omap_device_build_from_dt(struct platform_device 
*pdev)
r->name = dev_name(>dev);
}

-   pdev->dev.pm_domain = _device_pm_domain;
+   dev_pm_domain_set(>dev, _device_pm_domain);

if (device_active) {
omap_device_enable(pdev);
@@ -180,7 +181,7 @@ odbfd_exit1:
 odbfd_exit:
/* if data/we are at fault.. load up a fail handler */
if (ret)
-   pdev->dev.pm_domain = _device_fail_pm_domain;
+   dev_pm_domain_set(>dev, _device_fail_pm_domain);

return ret;
 }
@@ -701,7 +702,7 @@ int omap_device_register(struct platform_device *pdev)
 {
pr_debug("omap_device: %s: registering\n", pdev->name);

-   pdev->dev.pm_domain = _device_pm_domain;
+   dev_pm_domain_set(>dev, _device_pm_domain);
return platform_device_add(pdev);
 }

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 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 

@@ -875,13 +876,14 @@ static int acpi_lpss_platform_notify(struct 
notifier_block *nb,

switch (action) {
case BUS_NOTIFY_BIND_DRIVER:
-   pdev->dev.pm_domain = _lpss_pm_domain;
+   dev_pm_domain_set(>dev, _lpss_pm_domain);
break;
case BUS_NOTIFY_DRIVER_NOT_BOUND:
case BUS_NOTIFY_UNBOUND_DRIVER:
pdev->dev.pm_domain = NULL;
break;
case BUS_NOTIFY_ADD_DEVICE:
+   dev_pm_domain_set(>dev, _lpss_pm_domain);
if (pdata->dev_desc->flags & LPSS_LTR)
return sysfs_create_group(>dev.kobj,
  _attr_group);
@@ -889,6 +891,7 @@ static int acpi_lpss_platform_notify(struct notifier_block 
*nb,
case BUS_NOTIFY_DEL_DEVICE:
if (pdata->dev_desc->flags & LPSS_LTR)
sysfs_remove_group(>dev.kobj, _attr_group);
+   dev_pm_domain_set(>dev, NULL);
break;
default:
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 @@
 #include 
 #include 
 #include 
+#include 
 #include 

 #include "internal.h"
@@ -1059,7 +1060,7 @@ static void acpi_dev_pm_detach(struct device *dev, bool 
power_off)
struct acpi_device *adev = ACPI_COMPANION(dev);

if (adev && dev->pm_domain == _general_pm_domain) {
-   dev->pm_domain = NULL;
+   dev_pm_domain_set(dev, NULL);
acpi_remove_pm_notifier(adev);
if (power_off) {
/*
@@ -,7 +1112,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
return -EBUSY;

acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func);
-   dev->pm_domain = _general_pm_domain;
+   dev_pm_domain_set(dev, _general_pm_domain);
if (power_on) {
acpi_dev_pm_full_power(adev);
acpi_device_wakeup(adev, ACPI_STATE_S0, false);
diff --git a/drivers/base/power/clock_ops.c