Commit 2a3f3475 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

PM: sleep: core: Rename DPM_FLAG_LEAVE_SUSPENDED



Rename DPM_FLAG_LEAVE_SUSPENDED to DPM_FLAG_MAY_SKIP_RESUME which
matches its purpose more closely.

No functional impact.

Suggested-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de> # for I2C
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent e0751556
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -803,7 +803,7 @@ general.]
However, it often is desirable to leave devices in suspend after system
transitions to the working state, especially if those devices had been in
runtime suspend before the preceding system-wide suspend (or analogous)
transition.  Device drivers can use the ``DPM_FLAG_LEAVE_SUSPENDED`` flag to
transition.  Device drivers can use the ``DPM_FLAG_MAY_SKIP_RESUME`` flag to
indicate to the PM core (and middle-layer code) that they prefer the specific
devices handled by them to be left suspended and they have no problems with
skipping their system-wide resume callbacks for this reason.  Whether or not the
@@ -825,7 +825,7 @@ device really can be left in suspend.

For devices whose "noirq", "late" and "early" driver callbacks are invoked
directly by the PM core, all of the system-wide resume callbacks are skipped if
``DPM_FLAG_LEAVE_SUSPENDED`` is set and the device is in runtime suspend during
``DPM_FLAG_MAY_SKIP_RESUME`` is set and the device is in runtime suspend during
the ``suspend_noirq`` (or analogous) phase or the transition under way is a
proper system suspend (rather than anything related to hibernation) and the
device's wakeup settings are suitable for runtime PM (that is, it cannot
+1 −1
Original line number Diff line number Diff line
@@ -1029,7 +1029,7 @@ into D0 going forward), but if it is in runtime suspend in pci_pm_thaw_noirq(),
the function will set the power.direct_complete flag for it (to make the PM core
skip the subsequent "thaw" callbacks for it) and return.

Setting the DPM_FLAG_LEAVE_SUSPENDED flag means that the driver prefers the
Setting the DPM_FLAG_MAY_SKIP_RESUME flag means that the driver prefers the
device to be left in suspend after system-wide transitions to the working state.
This flag is checked by the PM core, but the PCI bus type informs the PM core
which devices may be left in suspend from its perspective (that happens during
+1 −1
Original line number Diff line number Diff line
@@ -624,7 +624,7 @@ static int acpi_tad_probe(struct platform_device *pdev)
	 */
	device_init_wakeup(dev, true);
	dev_pm_set_driver_flags(dev, DPM_FLAG_SMART_SUSPEND |
				     DPM_FLAG_LEAVE_SUSPENDED);
				     DPM_FLAG_MAY_SKIP_RESUME);
	/*
	 * The platform bus type layer tells the ACPI PM domain powers up the
	 * device, so set the runtime PM status of it to "active".
+1 −1
Original line number Diff line number Diff line
@@ -1247,7 +1247,7 @@ Skip:
	 * to be skipped.
	 */
	if (atomic_read(&dev->power.usage_count) > 1 ||
	    !(dev_pm_test_driver_flags(dev, DPM_FLAG_LEAVE_SUSPENDED) &&
	    !(dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME) &&
	      dev->power.may_skip_resume))
		dev->power.must_resume = true;

+2 −2
Original line number Diff line number Diff line
@@ -357,12 +357,12 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
	if (dev->flags & ACCESS_NO_IRQ_SUSPEND) {
		dev_pm_set_driver_flags(&pdev->dev,
					DPM_FLAG_SMART_PREPARE |
					DPM_FLAG_LEAVE_SUSPENDED);
					DPM_FLAG_MAY_SKIP_RESUME);
	} else {
		dev_pm_set_driver_flags(&pdev->dev,
					DPM_FLAG_SMART_PREPARE |
					DPM_FLAG_SMART_SUSPEND |
					DPM_FLAG_LEAVE_SUSPENDED);
					DPM_FLAG_MAY_SKIP_RESUME);
	}

	/* The code below assumes runtime PM to be disabled. */
Loading