Re: [PATCH] PM: allow for usage_count > 0 in pm_runtime_get()

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

 



On Tuesday 01 December 2009, Alan Stern wrote:
> Rafael:

Hi,

> One other thing I just noticed.  The power.timer_expires field is 
> supposed to be nonzero when the timer is scheduled.  But the code at 
> the end of pm_schedule_suspend() doesn't check for the possibility that 
> the expiration time might just happen to be 0.  If it is, the 
> timer_expires value should be bumped up to 1 before the mod_timer() 
> call.

Do you mean something like the patch below?

Rafael

---
 drivers/base/power/runtime.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6/drivers/base/power/runtime.c
===================================================================
--- linux-2.6.orig/drivers/base/power/runtime.c
+++ linux-2.6/drivers/base/power/runtime.c
@@ -625,6 +625,8 @@ int pm_schedule_suspend(struct device *d
 		goto out;
 
 	dev->power.timer_expires = jiffies + msecs_to_jiffies(delay);
+	if (!dev->power.timer_expires)
+		dev->power.timer_expires = 1;
 	mod_timer(&dev->power.suspend_timer, dev->power.timer_expires);
 
  out:
_______________________________________________
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