Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ca5a2ae authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power management fix from Rafael Wysocki:
 "Fix a regression from the 4.15 cycle that caused the system suspend
  and resume overhead to increase on many systems and triggered more
  serious problems on some of them (Rafael Wysocki)"

* tag 'pm-4.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM / core: Fix direct_complete handling for devices with no callbacks
parents bee79752 c62ec461
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1923,10 +1923,8 @@ static int device_prepare(struct device *dev, pm_message_t state)

	dev->power.wakeup_path = false;

	if (dev->power.no_pm_callbacks) {
		ret = 1;	/* Let device go direct_complete */
	if (dev->power.no_pm_callbacks)
		goto unlock;
	}

	if (dev->pm_domain)
		callback = dev->pm_domain->ops.prepare;
@@ -1960,7 +1958,8 @@ static int device_prepare(struct device *dev, pm_message_t state)
	 */
	spin_lock_irq(&dev->power.lock);
	dev->power.direct_complete = state.event == PM_EVENT_SUSPEND &&
		pm_runtime_suspended(dev) && ret > 0 &&
		((pm_runtime_suspended(dev) && ret > 0) ||
		 dev->power.no_pm_callbacks) &&
		!dev_pm_test_driver_flags(dev, DPM_FLAG_NEVER_SKIP);
	spin_unlock_irq(&dev->power.lock);
	return 0;