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

Commit 9bb4064c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-sleep'

* pm-sleep:
  PM / hibernate: fix a comment typo
  input: i8042: Avoid resetting controller on system suspend/resume
  PM / PCI / ACPI: Kick devices that might have been reset by firmware
  PM / sleep: Add flags to indicate platform firmware involvement
  PM / sleep: Drop pm_request_idle() from pm_generic_complete()
  PCI / PM: Avoid resuming more devices during system suspend
  PM / wakeup: wakeup_source_create: use kstrdup_const
  PM / sleep: Report interrupt that caused system wakeup
parents 66c44877 d439e64f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -256,3 +256,15 @@ Description:
		Writing a "1" enables this printing while writing a "0"
		disables it.  The default value is "0".  Reading from this file
		will display the current value.

What:		/sys/power/pm_wakeup_irq
Date:		April 2015
Contact:	Alexandra Yates <alexandra.yates@linux.intel.org>
Description:
		The /sys/power/pm_wakeup_irq file reports to user space the IRQ
		number of the first wakeup interrupt (that is, the first
		interrupt from an IRQ line armed for system wakeup) seen by the
		kernel during the most recent system suspend/resume cycle.

		This output is useful for system wakeup diagnostics of spurious
		wakeup interrupts.
+1 −1
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ static struct dev_pm_domain acpi_lpss_pm_domain = {
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
		.prepare = acpi_subsys_prepare,
		.complete = acpi_subsys_complete,
		.complete = pm_complete_with_resume_check,
		.suspend = acpi_subsys_suspend,
		.suspend_late = acpi_lpss_suspend_late,
		.resume_early = acpi_lpss_resume_early,
+1 −18
Original line number Diff line number Diff line
@@ -962,23 +962,6 @@ int acpi_subsys_prepare(struct device *dev)
}
EXPORT_SYMBOL_GPL(acpi_subsys_prepare);

/**
 * acpi_subsys_complete - Finalize device's resume during system resume.
 * @dev: Device to handle.
 */
void acpi_subsys_complete(struct device *dev)
{
	pm_generic_complete(dev);
	/*
	 * If the device had been runtime-suspended before the system went into
	 * the sleep state it is going out of and it has never been resumed till
	 * now, resume it in case the firmware powered it up.
	 */
	if (dev->power.direct_complete)
		pm_request_resume(dev);
}
EXPORT_SYMBOL_GPL(acpi_subsys_complete);

/**
 * acpi_subsys_suspend - Run the device driver's suspend callback.
 * @dev: Device to handle.
@@ -1047,7 +1030,7 @@ static struct dev_pm_domain acpi_general_pm_domain = {
		.runtime_resume = acpi_subsys_runtime_resume,
#ifdef CONFIG_PM_SLEEP
		.prepare = acpi_subsys_prepare,
		.complete = acpi_subsys_complete,
		.complete = pm_complete_with_resume_check,
		.suspend = acpi_subsys_suspend,
		.suspend_late = acpi_subsys_suspend_late,
		.resume_early = acpi_subsys_resume_early,
+3 −0
Original line number Diff line number Diff line
@@ -487,6 +487,8 @@ static int acpi_suspend_begin(suspend_state_t pm_state)
		pr_err("ACPI does not support sleep state S%u\n", acpi_state);
		return -ENOSYS;
	}
	if (acpi_state > ACPI_STATE_S1)
		pm_set_suspend_via_firmware();

	acpi_pm_start(acpi_state);
	return 0;
@@ -522,6 +524,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
		if (error)
			return error;
		pr_info(PREFIX "Low-level resume complete\n");
		pm_set_resume_via_firmware();
		break;
	}
	trace_suspend_resume(TPS("acpi_suspend"), acpi_state, false);
+20 −3
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/export.h>
#include <linux/suspend.h>

#ifdef CONFIG_PM
/**
@@ -296,11 +297,27 @@ void pm_generic_complete(struct device *dev)

	if (drv && drv->pm && drv->pm->complete)
		drv->pm->complete(dev);
}

/**
 * pm_complete_with_resume_check - Complete a device power transition.
 * @dev: Device to handle.
 *
 * Complete a device power transition during a system-wide power transition and
 * optionally schedule a runtime resume of the device if the system resume in
 * progress has been initated by the platform firmware and the device had its
 * power.direct_complete flag set.
 */
void pm_complete_with_resume_check(struct device *dev)
{
	pm_generic_complete(dev);
	/*
	 * Let runtime PM try to suspend devices that haven't been in use before
	 * going into the system-wide sleep state we're resuming from.
	 * If the device had been runtime-suspended before the system went into
	 * the sleep state it is going out of and it has never been resumed till
	 * now, resume it in case the firmware powered it up.
	 */
	pm_request_idle(dev);
	if (dev->power.direct_complete && pm_resume_via_firmware())
		pm_request_resume(dev);
}
EXPORT_SYMBOL_GPL(pm_complete_with_resume_check);
#endif /* CONFIG_PM_SLEEP */
Loading