mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: "Grover, Andrew" <andrew.grover@intel.com>
Cc: torvalds@transmeta.com, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Fix suspend-to-RAM in 2.5.20
Date: Mon, 3 Jun 2002 22:50:37 +0200	[thread overview]
Message-ID: <20020603205036.GD28911@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <59885C5E3098D511AD690002A5072D3C02AB7ECB@orsmsx111.jf.intel.com>

Hi!

> Please keep the ifdefs in place in acpi/system.c. It's marked broken for a
> reason until I have a chance to look at it.

I tried to fix it. I believe I'll have it working within 30 minutes
with followup patch. Well, so it was less than 30 ;-).

> Also -- what's the point of moving obviously ACPI-specific code into
> suspend.c, instead of leaving it in acpi.c?

The code is also suspend-specific, and suspend-to-disk will have very
similar function in very near future.

Here's followup patch that makes it work. Notice freeze_processes() --
if you don't do that you risk data corruption. Please apply,
								Pavel

--- linux-swsusp.linus/arch/i386/kernel/suspend.c	Mon Jun  3 19:01:07 2002
+++ linux-swsusp/arch/i386/kernel/suspend.c	Mon Jun  3 22:35:15 2002
@@ -41,5 +41,6 @@
 		return;
 	}
 acpi_sleep_done:
+	acpi_restore_register_state();
 	restore_processor_context();
 }
--- linux-swsusp.linus/drivers/acpi/system.c	Mon Jun  3 18:57:34 2002
+++ linux-swsusp/drivers/acpi/system.c	Mon Jun  3 22:42:25 2002
@@ -267,25 +267,15 @@
 	switch (state)
 	{
 	case ACPI_STATE_S1:
-		/* do nothing */
+		barrier();
+		status = acpi_enter_sleep_state(state);
 		break;
 
 	case ACPI_STATE_S2:
 	case ACPI_STATE_S3:
-		save_processor_context();
-		/* TODO: this is horribly broken, fix it */
-		/* TODO: inline this function in acpi_suspend,or something. */
+		do_suspend_lowlevel(0);
 		break;
 	}
-
-	barrier();
-	status = acpi_enter_sleep_state(state);
-
-acpi_sleep_done:
-
-	restore_processor_context();
-	fix_processor_context();
-
 	restore_flags(flags);
 
 	return status;
@@ -307,6 +297,8 @@
 	if (state < ACPI_STATE_S1 || state > ACPI_STATE_S5)
 		return AE_ERROR;
 
+	freeze_processes();		/* device_suspend needs processes to be stopped */
+
 	/* do we have a wakeup address for S2 and S3? */
 	if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3) {
 		if (!acpi_wakeup_address)
@@ -339,6 +331,7 @@
 
 	/* reset firmware waking vector */
 	acpi_set_firmware_waking_vector((ACPI_PHYSICAL_ADDRESS) 0);
+	thaw_processes();
 
 	return status;
 }


-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.


  reply	other threads:[~2002-06-03 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-03 20:33 Grover, Andrew
2002-06-03 20:50 ` Pavel Machek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-03 20:11 Pavel Machek

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=20020603205036.GD28911@atrey.karlin.mff.cuni.cz \
    --to=pavel@suse.cz \
    --cc=andrew.grover@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®