public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Sérgio Monteiro Basto" <sergiomb-hHo3WeeoaswVhHzd4jOs4w@public.gmane.org>
To: Pavel Machek <pavel-AlSwsSmVLrQ@public.gmane.org>
Cc: Willy Tarreau <willy-tRhHnHjXm5DYtjvyW6yDsg@public.gmane.org>,
	Bruno Ducrot <ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org>,
	acpi-devel
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] ACPI poweroff fixes for 2.4.26-pre2
Date: Fri, 26 Mar 2004 01:01:50 +0000	[thread overview]
Message-ID: <1080262910.4144.39.camel@darkstar> (raw)
In-Reply-To: <20040325230037.GK2179-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 875 bytes --]

Preamble :
I can be confused, but far as I know, you propose a patch for a _very
wrong_ thing, ( I believe that you are right ).
acpi_system_save_state is one reality, at least in kernel 2.4.26-pre2,
but what you propose looks like, that just resolve half of the problem.
if it a recently patch that made this problem I don't know.

Seeing the code yes, you are right.
I don't know if as make any sense to you but, what do you think put
acpi_system_save_state under #ifdef CONFIG_PM instead of CONFIG_SLEEP ?
like this 

thanks
On Thu, 2004-03-25 at 23:00, Pavel Machek wrote:
> Hi!
> 
> > so acpi_system_save_state(state) does do nothing at all ?
> > or does return nothing at all ?
> 
> IIRC there was patch that made acpi_system_save_state() do nothing at
> all if !CONFIG_ACPI_SLEEP. I'm arguing thats very wrong.
> 								Pavel
-- 
Sérgio M. B.

[-- Attachment #2: sys.diff --]
[-- Type: text/x-patch, Size: 3416 bytes --]

--- linux-2.4.26-pre2/drivers/acpi/system.c.orig	2004-03-26 00:47:29.000000000 +0000
+++ linux-2.4.26-pre2/drivers/acpi/system.c	2004-03-26 00:57:11.000000000 +0000
@@ -46,14 +46,16 @@
 #include <linux/mc146818rtc.h>
 #include <linux/irq.h>
 #include <asm/hw_irq.h>
+#endif /* CONFIG_ACPI_SLEEP */
 
+#ifdef CONFIG_PM
 acpi_status acpi_system_save_state(u32);
 #else
 static inline acpi_status acpi_system_save_state(u32 state)
 {
 	return AE_OK;
 }
-#endif /* !CONFIG_ACPI_SLEEP */
+#endif /* CONFIG_PM */ 
 
 #define _COMPONENT		ACPI_SYSTEM_COMPONENT
 ACPI_MODULE_NAME		("acpi_system")
@@ -110,62 +112,6 @@
 	printk(KERN_EMERG "ACPI: can not power off machine\n");
 }
 
-#endif /*CONFIG_PM*/
-
-
-#ifdef CONFIG_ACPI_SLEEP
-
-/**
- * acpi_system_restore_state - OS-specific restoration of state
- * @state:	sleep state we're exiting
- *
- * Note that if we're coming back from S4, the memory image should have
- * already been loaded from the disk and is already in place.  (Otherwise how
- * else would we be here?).
- */
-acpi_status
-acpi_system_restore_state(
-	u32			state)
-{
-	/* 
-	 * We should only be here if we're coming back from STR or STD.
-	 * And, in the case of the latter, the memory image should have already
-	 * been loaded from disk.
-	 */
-	if (state > ACPI_STATE_S1) {
-		acpi_restore_state_mem();
-
-		/* Do _early_ resume for irqs.  Required by
-		 * ACPI specs.
-		 */
-		/* TBD: call arch dependant reinitialization of the 
-		 * interrupts.
-		 */
-#ifdef CONFIG_X86
-		init_8259A(0);
-#endif
-		/* wait for power to come back */
-		mdelay(1000);
-
-	}
-
-	/* Be really sure that irqs are disabled. */
-	ACPI_DISABLE_IRQS();
-
-	/* Wait a little again, just in case... */
-	mdelay(1000);
-
-	/* enable interrupts once again */
-	ACPI_ENABLE_IRQS();
-
-	/* turn all the devices back on */
-	if (state > ACPI_STATE_S1)
-		pm_send_all(PM_RESUME, (void *)0);
-
-	return AE_OK;
-}
-
-
 /**
  * acpi_system_save_state - save OS specific state and power down devices
  * @state:	sleep state we're entering.
@@ -259,6 +205,63 @@
 	return error ? AE_ERROR : AE_OK;
 }
 
+#endif /*CONFIG_PM*/
+
+
+#ifdef CONFIG_ACPI_SLEEP
+
+/**
+ * acpi_system_restore_state - OS-specific restoration of state
+ * @state:	sleep state we're exiting
+ *
+ * Note that if we're coming back from S4, the memory image should have
+ * already been loaded from the disk and is already in place.  (Otherwise how
+ * else would we be here?).
+ */
+acpi_status
+acpi_system_restore_state(
+	u32			state)
+{
+	/* 
+	 * We should only be here if we're coming back from STR or STD.
+	 * And, in the case of the latter, the memory image should have already
+	 * been loaded from disk.
+	 */
+	if (state > ACPI_STATE_S1) {
+		acpi_restore_state_mem();
+
+		/* Do _early_ resume for irqs.  Required by
+		 * ACPI specs.
+		 */
+		/* TBD: call arch dependant reinitialization of the 
+		 * interrupts.
+		 */
+#ifdef CONFIG_X86
+		init_8259A(0);
+#endif
+		/* wait for power to come back */
+		mdelay(1000);
+
+	}
+
+	/* Be really sure that irqs are disabled. */
+	ACPI_DISABLE_IRQS();
+
+	/* Wait a little again, just in case... */
+	mdelay(1000);
+
+	/* enable interrupts once again */
+	ACPI_ENABLE_IRQS();
+
+	/* turn all the devices back on */
+	if (state > ACPI_STATE_S1)
+		pm_send_all(PM_RESUME, (void *)0);
+
+	return AE_OK;
+}
+
+
+
 
 /****************************************************************************
  *

  parent reply	other threads:[~2004-03-26  1:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-03 18:17 fix ACPI poweroff in 2.4.25-rc2 Bjorn Helgaas
     [not found] ` <200403031117.25937.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2004-03-03 19:46   ` Matthew Wilcox
     [not found]     ` <20040303194656.GV25779-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2004-03-03 20:05       ` Bjorn Helgaas
     [not found]         ` <200403031305.31966.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2004-03-06  6:16           ` Len Brown
2004-03-03 20:20       ` Willy Tarreau
     [not found]         ` <20040303202027.GA30084-HkMpAodKYdnXX8ko2wsARw@public.gmane.org>
2004-03-06  6:21           ` Len Brown
     [not found]             ` <1078554086.12991.3191.camel-D2Zvc0uNKG8@public.gmane.org>
2004-03-06  8:52               ` Willy Tarreau
2004-03-06  9:16               ` Willy Tarreau
2004-03-06 11:01               ` Willy Tarreau
2004-03-08 16:34   ` Pavel Machek
     [not found]     ` <20040308163452.GE5352-u08AdweFZfgxtPtxi4kahqVXKuFTiq87@public.gmane.org>
2004-03-08 18:15       ` Marcelo Tosatti
     [not found]         ` <Pine.LNX.4.44.0403081515190.10436-100000-N7x2SXzAOustNcHCoTQCcg@public.gmane.org>
2004-03-08 18:23           ` Pavel Machek
2004-03-08 18:32           ` Pavel Machek
     [not found]             ` <20040308183228.GD484-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-03-08 18:39               ` Marcelo Tosatti
     [not found]                 ` <Pine.LNX.4.44.0403081539370.13683-100000-N7x2SXzAOustNcHCoTQCcg@public.gmane.org>
2004-03-08 19:58                   ` Pavel Machek
2004-03-08 20:14               ` Willy Tarreau
     [not found]                 ` <20040308201411.GA18636-HkMpAodKYdnXX8ko2wsARw@public.gmane.org>
2004-03-08 20:54                   ` Pavel Machek
     [not found]                     ` <20040308205444.GH484-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-03-08 21:11                       ` Willy Tarreau
2004-03-09 23:33                       ` [PATCH] ACPI poweroff fixes for 2.4.26-pre2 Willy Tarreau
     [not found]                         ` <20040309233325.GA22953-HkMpAodKYdnXX8ko2wsARw@public.gmane.org>
2004-03-10 11:46                           ` Sérgio Monteiro Basto
2004-03-11 10:51                           ` Bruno Ducrot
2004-03-14 15:51                           ` Sérgio Monteiro Basto
     [not found]                             ` <1079279490.10225.10.camel-4/PLUo9XfK8@public.gmane.org>
2004-03-15 21:07                               ` Willy Tarreau
     [not found]                                 ` <20040315210729.GA19306-HkMpAodKYdnXX8ko2wsARw@public.gmane.org>
2004-03-15 22:23                                   ` Sérgio Monteiro Basto
     [not found]                                     ` <1079389434.3695.2.camel-4/PLUo9XfK8@public.gmane.org>
2004-03-15 23:19                                       ` Willy Tarreau
     [not found]                                         ` <20040315231927.GA19829-HkMpAodKYdnXX8ko2wsARw@public.gmane.org>
2004-03-22 10:59                                           ` Pavel Machek
     [not found]                                             ` <20040322105946.GC1505-u08AdweFZfgxtPtxi4kahqVXKuFTiq87@public.gmane.org>
2004-03-25 22:22                                               ` Sérgio Monteiro Basto
     [not found]                                                 ` <1080253327.3755.20.camel-4/PLUo9XfK8@public.gmane.org>
2004-03-25 22:29                                                   ` Pavel Machek
     [not found]                                                     ` <20040325222934.GF2179-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-03-25 22:50                                                       ` Sérgio Monteiro Basto
     [not found]                                                         ` <1080255058.4187.1.camel-4/PLUo9XfK8@public.gmane.org>
2004-03-25 23:00                                                           ` Pavel Machek
     [not found]                                                             ` <20040325230037.GK2179-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-03-26  1:01                                                               ` Sérgio Monteiro Basto [this message]
     [not found]                                                                 ` <1080262910.4144.39.camel-4/PLUo9XfK8@public.gmane.org>
2004-03-26 17:41                                                                   ` Sérgio Monteiro Basto
     [not found]                                                                     ` <1080322903.2325.113.camel-4/PLUo9XfK8@public.gmane.org>
2004-03-26 22:07                                                                       ` Pavel Machek
     [not found]                                                                         ` <20040326220723.GC9491-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-03-26 22:34                                                                           ` Sérgio Monteiro Basto
2004-03-27 14:01                                                                           ` Sérgio Monteiro Basto
2004-03-26  5:55                                                               ` Willy Tarreau
     [not found]                                                                 ` <20040326055547.GA26599-HkMpAodKYdnXX8ko2wsARw@public.gmane.org>
2004-03-26  8:53                                                                   ` Hartwig Felger
2004-03-26 10:06                                                                   ` 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=1080262910.4144.39.camel@darkstar \
    --to=sergiomb-hho3weeoaswvhhzd4jos4w@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=pavel-AlSwsSmVLrQ@public.gmane.org \
    --cc=willy-tRhHnHjXm5DYtjvyW6yDsg@public.gmane.org \
    /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