aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/runtime.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-09-13 17:54:57 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-09-13 17:54:57 -0400
commit9a5d5bd8480068c5829e3d997ee21dab9b3ed05f (patch)
treef8bea83deb720d4fa3a9ada8d4845406c2d7c8f0 /drivers/base/power/runtime.c
parent271fd03a3013b106ccc178d54219c1be0c9759b7 (diff)
parent55d512e245bc7699a8800e23df1a24195dd08217 (diff)
Merge commit 'v3.6-rc5' into pci/gavin-window-alignment
* commit 'v3.6-rc5': (1098 commits) Linux 3.6-rc5 HID: tpkbd: work even if the new Lenovo Keyboard driver is not configured Remove user-triggerable BUG from mpol_to_str xen/pciback: Fix proper FLR steps. uml: fix compile error in deliver_alarm() dj: memory scribble in logi_dj Fix order of arguments to compat_put_time[spec|val] xen: Use correct masking in xen_swiotlb_alloc_coherent. xen: fix logical error in tlb flushing xen/p2m: Fix one-off error in checking the P2M tree directory. powerpc: Don't use __put_user() in patch_instruction powerpc: Make sure IPI handlers see data written by IPI senders powerpc: Restore correct DSCR in context switch powerpc: Fix DSCR inheritance in copy_thread() powerpc: Keep thread.dscr and thread.dscr_inherit in sync powerpc: Update DSCR on all CPUs when writing sysfs dscr_default powerpc/powernv: Always go into nap mode when CPU is offline powerpc: Give hypervisor decrementer interrupts their own handler powerpc/vphn: Fix arch_update_cpu_topology() return value ARM: gemini: fix the gemini build ... Conflicts: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/rapidio/devices/tsi721.c
Diffstat (limited to 'drivers/base/power/runtime.c')
-rw-r--r--drivers/base/power/runtime.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 59894873a3b3..7d9c1cb1c39a 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -147,6 +147,8 @@ static int rpm_check_suspend_allowed(struct device *dev)
147 || (dev->power.request_pending 147 || (dev->power.request_pending
148 && dev->power.request == RPM_REQ_RESUME)) 148 && dev->power.request == RPM_REQ_RESUME))
149 retval = -EAGAIN; 149 retval = -EAGAIN;
150 else if (__dev_pm_qos_read_value(dev) < 0)
151 retval = -EPERM;
150 else if (dev->power.runtime_status == RPM_SUSPENDED) 152 else if (dev->power.runtime_status == RPM_SUSPENDED)
151 retval = 1; 153 retval = 1;
152 154
@@ -388,7 +390,6 @@ static int rpm_suspend(struct device *dev, int rpmflags)
388 goto repeat; 390 goto repeat;
389 } 391 }
390 392
391 dev->power.deferred_resume = false;
392 if (dev->power.no_callbacks) 393 if (dev->power.no_callbacks)
393 goto no_callback; /* Assume success. */ 394 goto no_callback; /* Assume success. */
394 395
@@ -403,12 +404,6 @@ static int rpm_suspend(struct device *dev, int rpmflags)
403 goto out; 404 goto out;
404 } 405 }
405 406
406 if (__dev_pm_qos_read_value(dev) < 0) {
407 /* Negative PM QoS constraint means "never suspend". */
408 retval = -EPERM;
409 goto out;
410 }
411
412 __update_runtime_status(dev, RPM_SUSPENDING); 407 __update_runtime_status(dev, RPM_SUSPENDING);
413 408
414 if (dev->pm_domain) 409 if (dev->pm_domain)
@@ -440,6 +435,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
440 wake_up_all(&dev->power.wait_queue); 435 wake_up_all(&dev->power.wait_queue);
441 436
442 if (dev->power.deferred_resume) { 437 if (dev->power.deferred_resume) {
438 dev->power.deferred_resume = false;
443 rpm_resume(dev, 0); 439 rpm_resume(dev, 0);
444 retval = -EAGAIN; 440 retval = -EAGAIN;
445 goto out; 441 goto out;
@@ -584,6 +580,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
584 || dev->parent->power.runtime_status == RPM_ACTIVE) { 580 || dev->parent->power.runtime_status == RPM_ACTIVE) {
585 atomic_inc(&dev->parent->power.child_count); 581 atomic_inc(&dev->parent->power.child_count);
586 spin_unlock(&dev->parent->power.lock); 582 spin_unlock(&dev->parent->power.lock);
583 retval = 1;
587 goto no_callback; /* Assume success. */ 584 goto no_callback; /* Assume success. */
588 } 585 }
589 spin_unlock(&dev->parent->power.lock); 586 spin_unlock(&dev->parent->power.lock);
@@ -664,7 +661,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
664 } 661 }
665 wake_up_all(&dev->power.wait_queue); 662 wake_up_all(&dev->power.wait_queue);
666 663
667 if (!retval) 664 if (retval >= 0)
668 rpm_idle(dev, RPM_ASYNC); 665 rpm_idle(dev, RPM_ASYNC);
669 666
670 out: 667 out: