From 3d2699bc179a10eee7d2aa1db50f822be01636f7 Mon Sep 17 00:00:00 2001 From: "Liu, Chuansheng" Date: Tue, 18 Feb 2014 10:28:44 +0800 Subject: PM / sleep: Two flags for async suspend_noirq and suspend_late The patch is a helper adding two new flags for implementing async threads for suspend_noirq and suspend_late. Signed-off-by: Chuansheng Liu Signed-off-by: Rafael J. Wysocki --- include/linux/pm.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/pm.h') diff --git a/include/linux/pm.h b/include/linux/pm.h index 8c6583a..f23a4f1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -542,6 +542,8 @@ struct dev_pm_info { unsigned int async_suspend:1; bool is_prepared:1; /* Owned by the PM core */ bool is_suspended:1; /* Ditto */ + bool is_noirq_suspended:1; + bool is_late_suspended:1; bool ignore_children:1; bool early_init:1; /* Owned by the PM core */ spinlock_t lock; -- cgit v1.1 From 3e54d1518f8f31effd487b7609c6779f62b0c04f Mon Sep 17 00:00:00 2001 From: "Lad, Prabhakar" Date: Thu, 20 Feb 2014 13:30:32 +0530 Subject: PM: fix typo in comment Signed-off-by: Lad, Prabhakar Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki --- include/linux/pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/pm.h') diff --git a/include/linux/pm.h b/include/linux/pm.h index f23a4f1..3540ea9 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -352,7 +352,7 @@ const struct dev_pm_ops name = { \ /* * Use this for defining a set of PM operations to be used in all situations - * (sustem suspend, hibernation or runtime PM). + * (system suspend, hibernation or runtime PM). * NOTE: In general, system suspend callbacks, .suspend() and .resume(), should * be different from the corresponding runtime PM callbacks, .runtime_suspend(), * and .runtime_resume(), because .runtime_suspend() always works on an already -- cgit v1.1 From 0a9efc4d91df7b18fb3e97c24ee85a1529618899 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Wed, 19 Feb 2014 13:09:21 +0100 Subject: PM / sleep: Set pm_generic functions to NULL for !CONFIG_PM_SLEEP Previously only a subset of the functions were defined and set to NULL while !CONFIG_PM_SLEEP. Let's make them all available so they can be used no matter of CONFIG_PM_SLEEP or not. Signed-off-by: Ulf Hansson Reviewed-by: Pavel Machek Signed-off-by: Rafael J. Wysocki --- include/linux/pm.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'include/linux/pm.h') diff --git a/include/linux/pm.h b/include/linux/pm.h index 3540ea9..6fffbcd 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -719,14 +719,26 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void { } -#define pm_generic_prepare NULL -#define pm_generic_suspend NULL -#define pm_generic_resume NULL -#define pm_generic_freeze NULL -#define pm_generic_thaw NULL -#define pm_generic_restore NULL -#define pm_generic_poweroff NULL -#define pm_generic_complete NULL +#define pm_generic_prepare NULL +#define pm_generic_suspend_late NULL +#define pm_generic_suspend_noirq NULL +#define pm_generic_suspend NULL +#define pm_generic_resume_early NULL +#define pm_generic_resume_noirq NULL +#define pm_generic_resume NULL +#define pm_generic_freeze_noirq NULL +#define pm_generic_freeze_late NULL +#define pm_generic_freeze NULL +#define pm_generic_thaw_noirq NULL +#define pm_generic_thaw_early NULL +#define pm_generic_thaw NULL +#define pm_generic_restore_noirq NULL +#define pm_generic_restore_early NULL +#define pm_generic_restore NULL +#define pm_generic_poweroff_noirq NULL +#define pm_generic_poweroff_late NULL +#define pm_generic_poweroff NULL +#define pm_generic_complete NULL #endif /* !CONFIG_PM_SLEEP */ /* How to reorder dpm_list after device_move() */ -- cgit v1.1 From 651665dbfdfca3201966c72edefdb0391160bea9 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 17 Mar 2014 21:26:11 +0100 Subject: PM / Runtime: Update runtime_idle() documentation for return value meaning As of commit 45f0a85c8258 ('PM / Runtime: Rework the "runtime idle" helper routine'), the return value of ->runtime_idle() is no longer ignored by the PM core, but used to decide whether to suspend the device or not. Update the documentation to match the code. Signed-off-by: Geert Uytterhoeven Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki --- include/linux/pm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/linux/pm.h') diff --git a/include/linux/pm.h b/include/linux/pm.h index 8c6583a..0298b5e 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -264,9 +264,9 @@ typedef struct pm_message { * registers, so that it is fully operational. * * @runtime_idle: Device appears to be inactive and it might be put into a - * low-power state if all of the necessary conditions are satisfied. Check - * these conditions and handle the device as appropriate, possibly queueing - * a suspend request for it. The return value is ignored by the PM core. + * low-power state if all of the necessary conditions are satisfied. + * Check these conditions, and return 0 if it's appropriate to let the PM + * core queue a suspend request for the device. * * Refer to Documentation/power/runtime_pm.txt for more information about the * role of the above callbacks in device runtime power management. -- cgit v1.1 From 33fe0ad946bbb0a2f04f551fce68a74d8821f32e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 17 Mar 2014 21:26:10 +0100 Subject: PM / sleep: Correct whitespace errors in rjw> Why exactly are they errors? Geert> checkpatch.pl says: "WARNING: please, no space before tabs", Vim (with "let c_space_errors=1") shows them in red. Signed-off-by: Geert Uytterhoeven Signed-off-by: Rafael J. Wysocki --- include/linux/pm.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include/linux/pm.h') diff --git a/include/linux/pm.h b/include/linux/pm.h index 6fffbcd..f902ad8 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -379,7 +379,7 @@ const struct dev_pm_ops name = { \ * * ON No transition. * - * FREEZE System is going to hibernate, call ->prepare() and ->freeze() + * FREEZE System is going to hibernate, call ->prepare() and ->freeze() * for all devices. * * SUSPEND System is going to suspend, call ->prepare() and ->suspend() @@ -423,7 +423,7 @@ const struct dev_pm_ops name = { \ #define PM_EVENT_INVALID (-1) #define PM_EVENT_ON 0x0000 -#define PM_EVENT_FREEZE 0x0001 +#define PM_EVENT_FREEZE 0x0001 #define PM_EVENT_SUSPEND 0x0002 #define PM_EVENT_HIBERNATE 0x0004 #define PM_EVENT_QUIESCE 0x0008 @@ -614,11 +614,11 @@ struct dev_pm_domain { * message is implicit: * * ON Driver starts working again, responding to hardware events - * and software requests. The hardware may have gone through - * a power-off reset, or it may have maintained state from the - * previous suspend() which the driver will rely on while - * resuming. On most platforms, there are no restrictions on - * availability of resources like clocks during resume(). + * and software requests. The hardware may have gone through + * a power-off reset, or it may have maintained state from the + * previous suspend() which the driver will rely on while + * resuming. On most platforms, there are no restrictions on + * availability of resources like clocks during resume(). * * Other transitions are triggered by messages sent using suspend(). All * these transitions quiesce the driver, so that I/O queues are inactive. @@ -628,21 +628,21 @@ struct dev_pm_domain { * differ according to the message: * * SUSPEND Quiesce, enter a low power device state appropriate for - * the upcoming system state (such as PCI_D3hot), and enable - * wakeup events as appropriate. + * the upcoming system state (such as PCI_D3hot), and enable + * wakeup events as appropriate. * * HIBERNATE Enter a low power device state appropriate for the hibernation - * state (eg. ACPI S4) and enable wakeup events as appropriate. + * state (eg. ACPI S4) and enable wakeup events as appropriate. * * FREEZE Quiesce operations so that a consistent image can be saved; - * but do NOT otherwise enter a low power device state, and do - * NOT emit system wakeup events. + * but do NOT otherwise enter a low power device state, and do + * NOT emit system wakeup events. * * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring - * the system from a snapshot taken after an earlier FREEZE. - * Some drivers will need to reset their hardware state instead - * of preserving it, to ensure that it's never mistaken for the - * state which that earlier snapshot had set up. + * the system from a snapshot taken after an earlier FREEZE. + * Some drivers will need to reset their hardware state instead + * of preserving it, to ensure that it's never mistaken for the + * state which that earlier snapshot had set up. * * A minimally power-aware driver treats all messages as SUSPEND, fully * reinitializes its device during resume() -- whether or not it was reset -- cgit v1.1