[PATCH/RFC] pm: disabling runtime power-management has to reset the status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Restore the initial RPM_SUSPENDED runtime pm status, when disabling,
otherwise the following enable will not function. This happens, e.g.,
when unloading and reloading drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
Cc: Simon Horman <horms@xxxxxxxxxxxx>
Cc: Magnus Damm <damm@xxxxxxxxxxxxx>
---

No, I do not claim to understand the thousand of states, flags, and 
counters, this just happens to fix the problem for me. Feel free to make a 
correct solution out of this.

 drivers/base/power/runtime.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 3172c60..83d6898 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -1012,8 +1012,10 @@ void __pm_runtime_disable(struct device *dev, bool check_resume)
 		pm_runtime_put_noidle(dev);
 	}
 
-	if (!dev->power.disable_depth++)
+	if (!dev->power.disable_depth++) {
 		__pm_runtime_barrier(dev);
+		dev->power.runtime_status = RPM_SUSPENDED;
+	}
 
  out:
 	spin_unlock_irq(&dev->power.lock);
-- 
1.7.2.5

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux