linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle
@ 2014-09-30  0:20 Rafael J. Wysocki
  2014-09-30  0:21 ` [PATCH 1/5] PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq() Rafael J. Wysocki
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30  0:20 UTC (permalink / raw)
  To: ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Zhang Rui, Linux PM list, Robert Moore

Hi,

This series is based on the pm-genirq branch of linux-pm.git which has been
included into linux-next for a few weeks.  That branch reworks the handling
of wakeup interrupts in general so that enable_irq_wake() can be used to
indicate that the given interrupt is to be used to wake up from suspend-to-idle
as well as from the other sleep states.  At the same time, using IRQF_NO_SUSPEND
with wakeup interrupts is not regarded as correct any more.

Along these lines, rework the handling of wakeup GPEs for suspend-to-idle so as
to make use of the new mechanism.

This has been tested on Toshiba Portege R500 with ACPI button wakeup and with
ACPI-based PCI Wake-on-LAN.

[1/5] Export dpm_suspend_late(), dpm_suspend_noirq(), dpm_resume_noirq() and
      dpm_resume_early() from the PM core.
[2/5] Rename local functions in the suspend core to better reflect their purpose.
[3/5] Rework ACPICA's acpi_hw_enable_wakeup_gpe_block() to disable all non-wakeup
      GPEs along with enabling the wakeup ones.
[4/5] Introduce acpi_enable_all_wakeup_gpes() in ACPICA (along the lines of the
      analogous function for runtime GPEs).
[5/5] Modify the handling of wakeup GPEs for suspend-to-idle.

Thanks!


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq()
  2014-09-30  0:20 [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle Rafael J. Wysocki
@ 2014-09-30  0:21 ` Rafael J. Wysocki
  2014-09-30  0:22 ` [PATCH 2/5] PM / sleep: Rename platform suspend/resume functions in suspend.c Rafael J. Wysocki
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30  0:21 UTC (permalink / raw)
  To: ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Zhang Rui, Linux PM list, Robert Moore

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Subsequent change sets will add platform-related operations between
dpm_suspend_late() and dpm_suspend_noirq() as well as between
dpm_resume_noirq() and dpm_resume_early() in suspend_enter(), so
export these functions for suspend_enter() to be able to call them
separately and split the invocations of dpm_suspend_end() and
dpm_resume_start() in there accordingly.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/base/power/main.c |    8 ++++----
 include/linux/pm.h        |    4 ++++
 kernel/power/suspend.c    |   14 +++++++++++---
 3 files changed, 19 insertions(+), 7 deletions(-)

Index: linux-pm/drivers/base/power/main.c
===================================================================
--- linux-pm.orig/drivers/base/power/main.c
+++ linux-pm/drivers/base/power/main.c
@@ -540,7 +540,7 @@ static void async_resume_noirq(void *dat
  * Call the "noirq" resume handlers for all devices in dpm_noirq_list and
  * enable device drivers to receive interrupts.
  */
-static void dpm_resume_noirq(pm_message_t state)
+void dpm_resume_noirq(pm_message_t state)
 {
 	struct device *dev;
 	ktime_t starttime = ktime_get();
@@ -662,7 +662,7 @@ static void async_resume_early(void *dat
  * dpm_resume_early - Execute "early resume" callbacks for all devices.
  * @state: PM transition of the system being carried out.
  */
-static void dpm_resume_early(pm_message_t state)
+void dpm_resume_early(pm_message_t state)
 {
 	struct device *dev;
 	ktime_t starttime = ktime_get();
@@ -1093,7 +1093,7 @@ static int device_suspend_noirq(struct d
  * Prevent device drivers from receiving interrupts and call the "noirq" suspend
  * handlers for all non-sysdev devices.
  */
-static int dpm_suspend_noirq(pm_message_t state)
+int dpm_suspend_noirq(pm_message_t state)
 {
 	ktime_t starttime = ktime_get();
 	int error = 0;
@@ -1232,7 +1232,7 @@ static int device_suspend_late(struct de
  * dpm_suspend_late - Execute "late suspend" callbacks for all devices.
  * @state: PM transition of the system being carried out.
  */
-static int dpm_suspend_late(pm_message_t state)
+int dpm_suspend_late(pm_message_t state)
 {
 	ktime_t starttime = ktime_get();
 	int error = 0;
Index: linux-pm/kernel/power/suspend.c
===================================================================
--- linux-pm.orig/kernel/power/suspend.c
+++ linux-pm/kernel/power/suspend.c
@@ -265,11 +265,16 @@ static int suspend_enter(suspend_state_t
 	if (error)
 		goto Platform_finish;
 
-	error = dpm_suspend_end(PMSG_SUSPEND);
+	error = dpm_suspend_late(PMSG_SUSPEND);
 	if (error) {
-		printk(KERN_ERR "PM: Some devices failed to power down\n");
+		printk(KERN_ERR "PM: late suspend of devices failed\n");
 		goto Platform_finish;
 	}
+	error = dpm_suspend_noirq(PMSG_SUSPEND);
+	if (error) {
+		printk(KERN_ERR "PM: noirq suspend of devices failed\n");
+		goto Devices_early_resume;
+	}
 	error = platform_suspend_prepare_late(state);
 	if (error)
 		goto Platform_wake;
@@ -319,7 +324,10 @@ static int suspend_enter(suspend_state_t
 
  Platform_wake:
 	platform_suspend_wake(state);
-	dpm_resume_start(PMSG_RESUME);
+	dpm_resume_noirq(PMSG_RESUME);
+
+ Devices_early_resume:
+	dpm_resume_early(PMSG_RESUME);
 
  Platform_finish:
 	platform_suspend_finish(state);
Index: linux-pm/include/linux/pm.h
===================================================================
--- linux-pm.orig/include/linux/pm.h
+++ linux-pm/include/linux/pm.h
@@ -680,12 +680,16 @@ struct dev_pm_domain {
 extern void device_pm_lock(void);
 extern void dpm_resume_start(pm_message_t state);
 extern void dpm_resume_end(pm_message_t state);
+extern void dpm_resume_noirq(pm_message_t state);
+extern void dpm_resume_early(pm_message_t state);
 extern void dpm_resume(pm_message_t state);
 extern void dpm_complete(pm_message_t state);
 
 extern void device_pm_unlock(void);
 extern int dpm_suspend_end(pm_message_t state);
 extern int dpm_suspend_start(pm_message_t state);
+extern int dpm_suspend_noirq(pm_message_t state);
+extern int dpm_suspend_late(pm_message_t state);
 extern int dpm_suspend(pm_message_t state);
 extern int dpm_prepare(pm_message_t state);
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/5] PM / sleep: Rename platform suspend/resume functions in suspend.c
  2014-09-30  0:20 [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle Rafael J. Wysocki
  2014-09-30  0:21 ` [PATCH 1/5] PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq() Rafael J. Wysocki
@ 2014-09-30  0:22 ` Rafael J. Wysocki
  2014-09-30  0:24 ` [PATCH 3/5] ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block() Rafael J. Wysocki
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30  0:22 UTC (permalink / raw)
  To: ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Zhang Rui, Linux PM list, Robert Moore

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Rename several local functions related to platform handling during
system suspend resume in suspend.c so that their names better
reflect their roles.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 kernel/power/suspend.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Index: linux-pm/kernel/power/suspend.c
===================================================================
--- linux-pm.orig/kernel/power/suspend.c
+++ linux-pm/kernel/power/suspend.c
@@ -144,19 +144,19 @@ static int platform_suspend_prepare(susp
 		suspend_ops->prepare() : 0;
 }
 
-static int platform_suspend_prepare_late(suspend_state_t state)
+static int platform_suspend_prepare_noirq(suspend_state_t state)
 {
 	return state != PM_SUSPEND_FREEZE && suspend_ops->prepare_late ?
 		suspend_ops->prepare_late() : 0;
 }
 
-static void platform_suspend_wake(suspend_state_t state)
+static void platform_resume_noirq(suspend_state_t state)
 {
 	if (state != PM_SUSPEND_FREEZE && suspend_ops->wake)
 		suspend_ops->wake();
 }
 
-static void platform_suspend_finish(suspend_state_t state)
+static void platform_resume_finish(suspend_state_t state)
 {
 	if (state != PM_SUSPEND_FREEZE && suspend_ops->finish)
 		suspend_ops->finish();
@@ -172,7 +172,7 @@ static int platform_suspend_begin(suspen
 		return 0;
 }
 
-static void platform_suspend_end(suspend_state_t state)
+static void platform_resume_end(suspend_state_t state)
 {
 	if (state == PM_SUSPEND_FREEZE && freeze_ops && freeze_ops->end)
 		freeze_ops->end();
@@ -180,7 +180,7 @@ static void platform_suspend_end(suspend
 		suspend_ops->end();
 }
 
-static void platform_suspend_recover(suspend_state_t state)
+static void platform_recover(suspend_state_t state)
 {
 	if (state != PM_SUSPEND_FREEZE && suspend_ops->recover)
 		suspend_ops->recover();
@@ -275,7 +275,7 @@ static int suspend_enter(suspend_state_t
 		printk(KERN_ERR "PM: noirq suspend of devices failed\n");
 		goto Devices_early_resume;
 	}
-	error = platform_suspend_prepare_late(state);
+	error = platform_suspend_prepare_noirq(state);
 	if (error)
 		goto Platform_wake;
 
@@ -323,14 +323,14 @@ static int suspend_enter(suspend_state_t
 	enable_nonboot_cpus();
 
  Platform_wake:
-	platform_suspend_wake(state);
+	platform_resume_noirq(state);
 	dpm_resume_noirq(PMSG_RESUME);
 
  Devices_early_resume:
 	dpm_resume_early(PMSG_RESUME);
 
  Platform_finish:
-	platform_suspend_finish(state);
+	platform_resume_finish(state);
 	return error;
 }
 
@@ -374,11 +374,11 @@ int suspend_devices_and_enter(suspend_st
 	trace_suspend_resume(TPS("resume_console"), state, false);
 
  Close:
-	platform_suspend_end(state);
+	platform_resume_end(state);
 	return error;
 
  Recover_platform:
-	platform_suspend_recover(state);
+	platform_recover(state);
 	goto Resume_devices;
 }
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/5] ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block()
  2014-09-30  0:20 [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle Rafael J. Wysocki
  2014-09-30  0:21 ` [PATCH 1/5] PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq() Rafael J. Wysocki
  2014-09-30  0:22 ` [PATCH 2/5] PM / sleep: Rename platform suspend/resume functions in suspend.c Rafael J. Wysocki
@ 2014-09-30  0:24 ` Rafael J. Wysocki
  2014-09-30  0:25 ` [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes() Rafael J. Wysocki
  2014-09-30  0:29 ` [PATCH 5/5] ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle Rafael J. Wysocki
  4 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30  0:24 UTC (permalink / raw)
  To: ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Zhang Rui, Linux PM list, Robert Moore

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since acpi_hw_enable_wakeup_gpe_block() is currently always called
after disabling all GPEs, it can actually write zeros to all
non-wakeup enable bits unconditionally.

That will be useful going forward for disabling runtime GPEs and
enabling wakeup GPEs in one go instead of doing that in two steps
(disable runtime and enable wakeup) which in theory may lead to a
loss of a wakeup event.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

Bob, please let me know if I can fast-track this.

---
 drivers/acpi/acpica/hwgpe.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-pm/drivers/acpi/acpica/hwgpe.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpica/hwgpe.c
+++ linux-pm/drivers/acpi/acpica/hwgpe.c
@@ -396,11 +396,11 @@ acpi_hw_enable_wakeup_gpe_block(struct a
 	/* Examine each GPE Register within the block */
 
 	for (i = 0; i < gpe_block->register_count; i++) {
-		if (!gpe_block->register_info[i].enable_for_wake) {
-			continue;
-		}
 
-		/* Enable all "wake" GPEs in this register */
+		/*
+		 * Enable all "wake" GPEs in this register and disable the
+		 * remaining ones.
+		 */
 
 		status =
 		    acpi_hw_write(gpe_block->register_info[i].enable_for_wake,


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes()
  2014-09-30  0:20 [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle Rafael J. Wysocki
                   ` (2 preceding siblings ...)
  2014-09-30  0:24 ` [PATCH 3/5] ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block() Rafael J. Wysocki
@ 2014-09-30  0:25 ` Rafael J. Wysocki
  2014-09-30 15:52   ` Moore, Robert
  2014-09-30  0:29 ` [PATCH 5/5] ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle Rafael J. Wysocki
  4 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30  0:25 UTC (permalink / raw)
  To: ACPI Devel Maling List, Robert Moore
  Cc: Linux Kernel Mailing List, Zhang Rui, Linux PM list

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Add a routine for host OSes to enable all wakeup GPEs and disable
all of the non-wakeup ones at the same time.

It will be used for the handling of GPE wakeup from suspend-to-idle
in Linux.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

Bob, please let me know if I can fast-track this one.

---
 drivers/acpi/acpica/evxfgpe.c |   32 ++++++++++++++++++++++++++++++++
 include/acpi/acpixf.h         |    1 +
 2 files changed, 33 insertions(+)

Index: linux-pm/drivers/acpi/acpica/evxfgpe.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpica/evxfgpe.c
+++ linux-pm/drivers/acpi/acpica/evxfgpe.c
@@ -596,6 +596,38 @@ acpi_status acpi_enable_all_runtime_gpes
 
 ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes)
 
+/******************************************************************************
+ *
+ * FUNCTION:    acpi_enable_all_wakeup_gpes
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Enable all "wakeup" GPEs and disable all of the other GPEs, in
+ *              all GPE blocks.
+ *
+ ******************************************************************************/
+
+acpi_status acpi_enable_all_wakeup_gpes(void)
+{
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_enable_all_wakeup_gpes);
+
+	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
+	if (ACPI_FAILURE(status)) {
+		return_ACPI_STATUS(status);
+	}
+
+	status = acpi_hw_enable_all_wakeup_gpes();
+	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+
+	return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_install_gpe_block
Index: linux-pm/include/acpi/acpixf.h
===================================================================
--- linux-pm.orig/include/acpi/acpixf.h
+++ linux-pm/include/acpi/acpixf.h
@@ -692,6 +692,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_sta
 						     *event_status))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
+ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
 
 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
 				acpi_get_gpe_device(u32 gpe_index,


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/5] ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle
  2014-09-30  0:20 [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle Rafael J. Wysocki
                   ` (3 preceding siblings ...)
  2014-09-30  0:25 ` [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes() Rafael J. Wysocki
@ 2014-09-30  0:29 ` Rafael J. Wysocki
  4 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30  0:29 UTC (permalink / raw)
  To: ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Zhang Rui, Linux PM list, Robert Moore

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

The ACPI GPE wakeup from suspend-to-idle is currently based on using
the IRQF_NO_SUSPEND flag for the ACPI SCI, but that is problematic
for a couple of reasons.  First, in principle the ACPI SCI may be
shared and IRQF_NO_SUSPEND does not really work well with shared
interrupts.  Second, it may require the ACPI subsystem to special-case
the handling of device notifications depending on whether or not
they are received during suspend-to-idle in some places which would
lead to fragile code.  Finally, it's better the handle ACPI wakeup
interrupts consistently with wakeup interrupts from other sources.

For this reason, remove the IRQF_NO_SUSPEND flag from the ACPI SCI
and use enable_irq_wake()/disable_irq_wake() with it instead, which
requires two additional platform hooks to be added to struct
platform_freeze_ops.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/osl.c      |    2 +-
 drivers/acpi/sleep.c    |   16 ++++++++++++++++
 include/linux/suspend.h |    2 ++
 kernel/power/suspend.c  |   21 ++++++++++++++++++++-
 4 files changed, 39 insertions(+), 2 deletions(-)

Index: linux-pm/include/linux/suspend.h
===================================================================
--- linux-pm.orig/include/linux/suspend.h
+++ linux-pm/include/linux/suspend.h
@@ -189,6 +189,8 @@ struct platform_suspend_ops {
 
 struct platform_freeze_ops {
 	int (*begin)(void);
+	int (*prepare)(void);
+	void (*restore)(void);
 	void (*end)(void);
 };
 
Index: linux-pm/kernel/power/suspend.c
===================================================================
--- linux-pm.orig/kernel/power/suspend.c
+++ linux-pm/kernel/power/suspend.c
@@ -144,6 +144,12 @@ static int platform_suspend_prepare(susp
 		suspend_ops->prepare() : 0;
 }
 
+static int platform_suspend_prepare_late(suspend_state_t state)
+{
+	return state == PM_SUSPEND_FREEZE && freeze_ops->prepare ?
+		freeze_ops->prepare() : 0;
+}
+
 static int platform_suspend_prepare_noirq(suspend_state_t state)
 {
 	return state != PM_SUSPEND_FREEZE && suspend_ops->prepare_late ?
@@ -156,6 +162,12 @@ static void platform_resume_noirq(suspen
 		suspend_ops->wake();
 }
 
+static void platform_resume_early(suspend_state_t state)
+{
+	if (state == PM_SUSPEND_FREEZE && freeze_ops->restore)
+		freeze_ops->restore();
+}
+
 static void platform_resume_finish(suspend_state_t state)
 {
 	if (state != PM_SUSPEND_FREEZE && suspend_ops->finish)
@@ -270,10 +282,14 @@ static int suspend_enter(suspend_state_t
 		printk(KERN_ERR "PM: late suspend of devices failed\n");
 		goto Platform_finish;
 	}
+	error = platform_suspend_prepare_late(state);
+	if (error)
+		goto Devices_early_resume;
+
 	error = dpm_suspend_noirq(PMSG_SUSPEND);
 	if (error) {
 		printk(KERN_ERR "PM: noirq suspend of devices failed\n");
-		goto Devices_early_resume;
+		goto Platform_early_resume;
 	}
 	error = platform_suspend_prepare_noirq(state);
 	if (error)
@@ -326,6 +342,9 @@ static int suspend_enter(suspend_state_t
 	platform_resume_noirq(state);
 	dpm_resume_noirq(PMSG_RESUME);
 
+ Platform_early_resume:
+	platform_resume_early(state);
+
  Devices_early_resume:
 	dpm_resume_early(PMSG_RESUME);
 
Index: linux-pm/drivers/acpi/sleep.c
===================================================================
--- linux-pm.orig/drivers/acpi/sleep.c
+++ linux-pm/drivers/acpi/sleep.c
@@ -14,6 +14,7 @@
 #include <linux/irq.h>
 #include <linux/dmi.h>
 #include <linux/device.h>
+#include <linux/interrupt.h>
 #include <linux/suspend.h>
 #include <linux/reboot.h>
 #include <linux/acpi.h>
@@ -626,6 +627,19 @@ static int acpi_freeze_begin(void)
 	return 0;
 }
 
+static int acpi_freeze_prepare(void)
+{
+	acpi_enable_all_wakeup_gpes();
+	enable_irq_wake(acpi_gbl_FADT.sci_interrupt);
+	return 0;
+}
+
+static void acpi_freeze_restore(void)
+{
+	disable_irq_wake(acpi_gbl_FADT.sci_interrupt);
+	acpi_enable_all_runtime_gpes();
+}
+
 static void acpi_freeze_end(void)
 {
 	acpi_scan_lock_release();
@@ -633,6 +647,8 @@ static void acpi_freeze_end(void)
 
 static const struct platform_freeze_ops acpi_freeze_ops = {
 	.begin = acpi_freeze_begin,
+	.prepare = acpi_freeze_prepare,
+	.restore = acpi_freeze_restore,
 	.end = acpi_freeze_end,
 };
 
Index: linux-pm/drivers/acpi/osl.c
===================================================================
--- linux-pm.orig/drivers/acpi/osl.c
+++ linux-pm/drivers/acpi/osl.c
@@ -835,7 +835,7 @@ acpi_os_install_interrupt_handler(u32 gs
 
 	acpi_irq_handler = handler;
 	acpi_irq_context = context;
-	if (request_irq(irq, acpi_irq, IRQF_SHARED | IRQF_NO_SUSPEND, "acpi", acpi_irq)) {
+	if (request_irq(irq, acpi_irq, IRQF_SHARED, "acpi", acpi_irq)) {
 		printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
 		acpi_irq_handler = NULL;
 		return AE_NOT_ACQUIRED;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes()
  2014-09-30  0:25 ` [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes() Rafael J. Wysocki
@ 2014-09-30 15:52   ` Moore, Robert
  2014-09-30 19:52     ` Rafael J. Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Moore, Robert @ 2014-09-30 15:52 UTC (permalink / raw)
  To: Rafael J. Wysocki, ACPI Devel Maling List
  Cc: Linux Kernel Mailing List, Zhang, Rui, Linux PM list

If you need it, sure.
Let me know when there is an ACPICA version


> -----Original Message-----
> From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net]
> Sent: Monday, September 29, 2014 5:26 PM
> To: ACPI Devel Maling List; Moore, Robert
> Cc: Linux Kernel Mailing List; Zhang, Rui; Linux PM list
> Subject: [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes()
> 
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Add a routine for host OSes to enable all wakeup GPEs and disable all of
> the non-wakeup ones at the same time.
> 
> It will be used for the handling of GPE wakeup from suspend-to-idle in
> Linux.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> Bob, please let me know if I can fast-track this one.
> 
> ---
>  drivers/acpi/acpica/evxfgpe.c |   32 ++++++++++++++++++++++++++++++++
>  include/acpi/acpixf.h         |    1 +
>  2 files changed, 33 insertions(+)
> 
> Index: linux-pm/drivers/acpi/acpica/evxfgpe.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/acpica/evxfgpe.c
> +++ linux-pm/drivers/acpi/acpica/evxfgpe.c
> @@ -596,6 +596,38 @@ acpi_status acpi_enable_all_runtime_gpes
> 
>  ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes)
> 
> +/**********************************************************************
> +********
> + *
> + * FUNCTION:    acpi_enable_all_wakeup_gpes
> + *
> + * PARAMETERS:  None
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Enable all "wakeup" GPEs and disable all of the other
> GPEs, in
> + *              all GPE blocks.
> + *
> +
> +***********************************************************************
> +*******/
> +
> +acpi_status acpi_enable_all_wakeup_gpes(void) {
> +	acpi_status status;
> +
> +	ACPI_FUNCTION_TRACE(acpi_enable_all_wakeup_gpes);
> +
> +	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
> +	if (ACPI_FAILURE(status)) {
> +		return_ACPI_STATUS(status);
> +	}
> +
> +	status = acpi_hw_enable_all_wakeup_gpes();
> +	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
> +
> +	return_ACPI_STATUS(status);
> +}
> +
> +ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
> +
> 
> /*************************************************************************
> ******
>   *
>   * FUNCTION:    acpi_install_gpe_block
> Index: linux-pm/include/acpi/acpixf.h
> ===================================================================
> --- linux-pm.orig/include/acpi/acpixf.h
> +++ linux-pm/include/acpi/acpixf.h
> @@ -692,6 +692,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_sta
>  						     *event_status))
>  ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
> ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
> acpi_enable_all_runtime_gpes(void))
> +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
> +acpi_enable_all_wakeup_gpes(void))
> 
>  ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
>  				acpi_get_gpe_device(u32 gpe_index,


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes()
  2014-09-30 15:52   ` Moore, Robert
@ 2014-09-30 19:52     ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-09-30 19:52 UTC (permalink / raw)
  To: Moore, Robert
  Cc: ACPI Devel Maling List, Linux Kernel Mailing List, Zhang, Rui,
	Linux PM list

On Tuesday, September 30, 2014 03:52:16 PM Moore, Robert wrote:
> If you need it, sure.

Thanks!

I hope this applies to https://patchwork.kernel.org/patch/4999321/ too?

> Let me know when there is an ACPICA version

OK


> > -----Original Message-----
> > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net]
> > Sent: Monday, September 29, 2014 5:26 PM
> > To: ACPI Devel Maling List; Moore, Robert
> > Cc: Linux Kernel Mailing List; Zhang, Rui; Linux PM list
> > Subject: [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes()
> > 
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > Add a routine for host OSes to enable all wakeup GPEs and disable all of
> > the non-wakeup ones at the same time.
> > 
> > It will be used for the handling of GPE wakeup from suspend-to-idle in
> > Linux.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> > 
> > Bob, please let me know if I can fast-track this one.
> > 
> > ---
> >  drivers/acpi/acpica/evxfgpe.c |   32 ++++++++++++++++++++++++++++++++
> >  include/acpi/acpixf.h         |    1 +
> >  2 files changed, 33 insertions(+)
> > 
> > Index: linux-pm/drivers/acpi/acpica/evxfgpe.c
> > ===================================================================
> > --- linux-pm.orig/drivers/acpi/acpica/evxfgpe.c
> > +++ linux-pm/drivers/acpi/acpica/evxfgpe.c
> > @@ -596,6 +596,38 @@ acpi_status acpi_enable_all_runtime_gpes
> > 
> >  ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes)
> > 
> > +/**********************************************************************
> > +********
> > + *
> > + * FUNCTION:    acpi_enable_all_wakeup_gpes
> > + *
> > + * PARAMETERS:  None
> > + *
> > + * RETURN:      Status
> > + *
> > + * DESCRIPTION: Enable all "wakeup" GPEs and disable all of the other
> > GPEs, in
> > + *              all GPE blocks.
> > + *
> > +
> > +***********************************************************************
> > +*******/
> > +
> > +acpi_status acpi_enable_all_wakeup_gpes(void) {
> > +	acpi_status status;
> > +
> > +	ACPI_FUNCTION_TRACE(acpi_enable_all_wakeup_gpes);
> > +
> > +	status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
> > +	if (ACPI_FAILURE(status)) {
> > +		return_ACPI_STATUS(status);
> > +	}
> > +
> > +	status = acpi_hw_enable_all_wakeup_gpes();
> > +	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
> > +
> > +	return_ACPI_STATUS(status);
> > +}
> > +
> > +ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
> > +
> > 
> > /*************************************************************************
> > ******
> >   *
> >   * FUNCTION:    acpi_install_gpe_block
> > Index: linux-pm/include/acpi/acpixf.h
> > ===================================================================
> > --- linux-pm.orig/include/acpi/acpixf.h
> > +++ linux-pm/include/acpi/acpixf.h
> > @@ -692,6 +692,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_sta
> >  						     *event_status))
> >  ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
> > ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
> > acpi_enable_all_runtime_gpes(void))
> > +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
> > +acpi_enable_all_wakeup_gpes(void))
> > 
> >  ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
> >  				acpi_get_gpe_device(u32 gpe_index,
> 
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-09-30 19:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  0:20 [PATCH 0/5]: ACPI / PM: Rework wakeup GPE handling for suspend-to-idle Rafael J. Wysocki
2014-09-30  0:21 ` [PATCH 1/5] PM / sleep: Export dpm_suspend_late/noirq() and dpm_resume_early/noirq() Rafael J. Wysocki
2014-09-30  0:22 ` [PATCH 2/5] PM / sleep: Rename platform suspend/resume functions in suspend.c Rafael J. Wysocki
2014-09-30  0:24 ` [PATCH 3/5] ACPICA: Clear all non-wakeup GPEs in acpi_hw_enable_wakeup_gpe_block() Rafael J. Wysocki
2014-09-30  0:25 ` [PATCH 4/5] ACPICA: Introduce acpi_enable_all_wakeup_gpes() Rafael J. Wysocki
2014-09-30 15:52   ` Moore, Robert
2014-09-30 19:52     ` Rafael J. Wysocki
2014-09-30  0:29 ` [PATCH 5/5] ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).