linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: [PATCH 14/42] ACPI / PM: Merge do_suspend_lowlevel() into acpi_save_state_mem()
Date: Wed, 23 Mar 2011 02:42:27 -0400	[thread overview]
Message-ID: <f1a2003e22f6b50ea21f7f4b38b38c5ebc9c8017.1300862481.git.len.brown@intel.com> (raw)
In-Reply-To: <1300862575-10206-1-git-send-email-lenb@kernel.org>
In-Reply-To: <073b4964b3b75fd9e19bf3933b26d9c23591c9db.1300862481.git.len.brown@intel.com>

From: Rafael J. Wysocki <rjw@sisk.pl>

The function do_suspend_lowlevel() is specific to x86 and defined in
assembly code, so it should be called from the x86 low-level suspend
code rather than from acpi_suspend_enter().

Merge do_suspend_lowlevel() into the x86's acpi_save_state_mem() and
change the name of the latter to acpi_suspend_lowlevel(), so that the
function's purpose is better reflected by its name.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 arch/ia64/include/asm/acpi.h |    4 ++--
 arch/ia64/kernel/acpi.c      |    9 ++-------
 arch/x86/include/asm/acpi.h  |    4 ++--
 arch/x86/kernel/acpi/sleep.c |    5 +++--
 arch/x86/kernel/acpi/sleep.h |    2 ++
 drivers/acpi/sleep.c         |    5 +----
 6 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
index db3986a..a06dfb1 100644
--- a/arch/ia64/include/asm/acpi.h
+++ b/arch/ia64/include/asm/acpi.h
@@ -128,8 +128,8 @@ static inline const char *acpi_get_sysname (void)
 int acpi_request_vector (u32 int_type);
 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
-/* Routine for saving kernel state during suspend. */
-extern int acpi_save_state_mem(void);
+/* Low-level suspend routine. */
+extern int acpi_suspend_lowlevel(void);
 
 extern unsigned long acpi_wakeup_address;
 
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 7cf2d10..a54d054 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -1034,13 +1034,8 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
 /*
- * acpi_save_state_mem() - save kernel state
+ * acpi_suspend_lowlevel() - save kernel state and suspend.
  *
  * TBD when when IA64 starts to support suspend...
  */
-int acpi_save_state_mem(void) { return 0; } 
-
-/*
- * do_suspend_lowlevel()
- */
-void do_suspend_lowlevel(void) {}
+int acpi_suspend_lowlevel(void) { return 0; }
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 47981f0..aa92684 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -112,8 +112,8 @@ static inline void acpi_disable_pci(void)
 	acpi_noirq_set();
 }
 
-/* Routine for saving kernel state during suspend. */
-extern int acpi_save_state_mem(void);
+/* Low-level suspend routine. */
+extern int acpi_suspend_lowlevel(void);
 
 extern unsigned long acpi_wakeup_address;
 
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index c27a483..5f1b747 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -29,14 +29,14 @@ static char temp_stack[4096];
 #endif
 
 /**
- * acpi_save_state_mem - save kernel state
+ * acpi_suspend_lowlevel - save kernel state
  *
  * Create an identity mapped page table and copy the wakeup routine to
  * low memory.
  *
  * Note that this is too late to change acpi_wakeup_address.
  */
-int acpi_save_state_mem(void)
+int acpi_suspend_lowlevel(void)
 {
 	struct wakeup_header *header;
 
@@ -107,6 +107,7 @@ int acpi_save_state_mem(void)
        saved_magic = 0x123456789abcdef0L;
 #endif /* CONFIG_64BIT */
 
+	do_suspend_lowlevel();
 	return 0;
 }
 
diff --git a/arch/x86/kernel/acpi/sleep.h b/arch/x86/kernel/acpi/sleep.h
index adbcbaa..31ce13f 100644
--- a/arch/x86/kernel/acpi/sleep.h
+++ b/arch/x86/kernel/acpi/sleep.h
@@ -14,3 +14,5 @@ extern char swsusp_pg_dir[PAGE_SIZE];
 
 extern unsigned long acpi_copy_wakeup_routine(unsigned long);
 extern void wakeup_long64(void);
+
+extern void do_suspend_lowlevel(void);
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 2307604..0a81bf1 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -199,8 +199,6 @@ static void acpi_pm_end(void)
 #endif /* CONFIG_ACPI_SLEEP */
 
 #ifdef CONFIG_SUSPEND
-extern void do_suspend_lowlevel(void);
-
 static u32 acpi_suspend_states[] = {
 	[PM_SUSPEND_ON] = ACPI_STATE_S0,
 	[PM_SUSPEND_STANDBY] = ACPI_STATE_S1,
@@ -255,10 +253,9 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
 		break;
 
 	case ACPI_STATE_S3:
-		error = acpi_save_state_mem();
+		error = acpi_suspend_lowlevel();
 		if (error)
 			return error;
-		do_suspend_lowlevel();
 		pr_info(PREFIX "Low-level resume complete\n");
 		break;
 	}
-- 
1.7.4.1.343.ga91df


  parent reply	other threads:[~2011-03-23  7:07 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23  6:42 ACPI patch queue for 2.6.39-merge Len Brown
2011-03-23  6:42 ` [PATCH 01/42] ACPI: Do not export functions that are only used in osl.c Len Brown
2011-03-23  6:42   ` [PATCH 02/42] ACPI: Change acpi_ioremap_lock into a mutex Len Brown
2011-03-23  6:42   ` [PATCH 03/42] ACPI: Avoid walking the list of memory mappings in osl.c twice in a row Len Brown
2011-03-23  6:42   ` [PATCH 04/42] ACPI: Make acpi_os_map_memory() avoid creating unnecessary mappings Len Brown
2011-03-23  6:42   ` [PATCH 05/42] ACPI: Do not use krefs under a mutex in osl.c Len Brown
2011-03-23  6:42   ` [PATCH 06/42] ACPI: Introduce acpi_os_get_iomem() Len Brown
2011-03-23  6:42   ` [PATCH 07/42] ACPI / PM: Use existing ACPI iomaps for NVS save/restore (v2) Len Brown
2011-03-23  6:42   ` [PATCH 08/42] ACPI: Remove the wakeup.run_wake_count device field Len Brown
2011-03-23  6:42   ` [PATCH 09/42] ACPI / Button: Avoid disabling wakeup unnecessarily on remove Len Brown
2011-03-23  6:42   ` [PATCH 10/42] ACPI / PM: Drop acpi_restore_state_mem() Len Brown
2011-03-23  6:42   ` [PATCH 11/42] ACPI / PM: acpi_suspend_enter() need not switch interrupts off Len Brown
2011-03-23  6:42   ` [PATCH 12/42] ACPI / PM: Modify the "low-level resume finished" message Len Brown
2011-03-23  6:42   ` [PATCH 13/42] ACPI / PM: Call acpi_save_state_mem() right before low-level suspend Len Brown
2011-03-23  6:42   ` Len Brown [this message]
2011-03-23  6:42   ` [PATCH 15/42] ACPI / PM: acpi_hibernation_enter() need not switch interrupts off Len Brown
2011-03-23  6:42   ` [PATCH 16/42] ACPI: Avoid calling request_irq() many times for the same interrupt Len Brown
2011-03-23  6:42   ` [PATCH 17/42] ACPICA: GPE detect optimization - ignore unused GPE registers Len Brown
2011-03-23  6:42   ` [PATCH 18/42] ACPICA: Remove use of unreliable FADT revision field Len Brown
2011-03-23  6:42   ` [PATCH 19/42] ACPICA: Clarify a couple of error messages Len Brown
2011-03-23  6:42   ` [PATCH 20/42] ACPICA: Split large utglobal into utdecode.c Len Brown
2011-03-23  6:42   ` [PATCH 21/42] ACPICA: Fix unresolved name issue for no-debug and no-error-msg cases Len Brown
2011-03-23  6:42   ` [PATCH 22/42] ACPICA: Split large dsopcode and dsload.c files Len Brown
2011-03-23  6:42   ` [PATCH 23/42] ACPICA: Add support for FunctionalFixedHW in acpi_ut_get_region_name Len Brown
2011-03-23  6:42   ` [PATCH 24/42] ACPICA: Add mechanism to defer _REG methods for some installed handlers Len Brown
2011-03-23  6:42   ` [PATCH 25/42] ACPICA: Update version to 20110211 Len Brown
2011-03-23  6:42   ` [PATCH 26/42] Thermal_Framework-Fix_crash_during_hwmon_unregister Len Brown
2011-03-23  6:42   ` [PATCH 27/42] ACPI: use __init where possible in processor driver Len Brown
2011-03-23  6:42   ` [PATCH 28/42] ACPI: use __cpuinit for the acpi_processor_set_pdc() call tree Len Brown
2011-03-23  6:42   ` [PATCH 29/42] ACPI: Remove the unused EC sysdev class Len Brown
2011-03-23  6:42   ` [PATCH 30/42] ACPI: Use syscore_ops instead of sysdev class and sysdev Len Brown
2011-03-23  6:42   ` [PATCH 31/42] ACPI, APEI, Add ERST record ID cache Len Brown
2011-03-23  6:42   ` [PATCH 32/42] PCIe, AER, use pre-generated prefix in error information printing Len Brown
2011-03-23  6:42   ` [PATCH 33/42] ACPI, APEI, Add PCIe AER error information printing support Len Brown
2011-03-23  6:42   ` [PATCH 34/42] ACPI button: remove unused procfs I/F Len Brown
2011-03-23  6:42   ` [PATCH 35/42] ACPI battery: fribble sysfs files from a resume notifier Len Brown
2011-03-23 13:40     ` Kyle McMartin
2011-04-13 10:37     ` Kyle McMartin
2011-04-24 23:55       ` [stable] " Greg KH
2011-03-23  6:42   ` [PATCH 36/42] ACPICA: Fix access width for reset vector Len Brown
2011-03-23  6:42   ` [PATCH 37/42] ACPI: Bug compatibility for Windows on the ACPI reboot vector Len Brown
2011-03-23  6:42   ` [PATCH 38/42] ACPI: Make sure the FADT is at least rev 2 before using the reset register Len Brown
2011-03-23  6:42   ` [PATCH 39/42] ACPICA: Header support for SLIC table Len Brown
2011-03-23  6:42   ` [PATCH 40/42] ACPICA: Update version to 20110316 Len Brown
2011-03-23  6:42   ` [PATCH 41/42] ACPI: make acpi_pad /sys output more readable Len Brown
2011-03-23  6:42   ` [PATCH 42/42] ACPI: minor printk format change in acpi_pad Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1a2003e22f6b50ea21f7f4b38b38c5ebc9c8017.1300862481.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).