public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@kernel.org>
To: Jarkko Sakkinen <jarkko.sakkinen@intel.com>,
	"Luck, Tony" <tony.luck@intel.com>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH] x86, realmode: ia64 build fix (drivers/acpi/sleep.c)
Date: Tue, 29 May 2012 23:47:45 -0700	[thread overview]
Message-ID: <4FC5C291.3060801@kernel.org> (raw)
In-Reply-To: <1338359162-5785-1-git-send-email-jarkko.sakkinen@intel.com>

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

On 05/29/2012 11:26 PM, Jarkko Sakkinen wrote:
> From: Jarkko Sakkinen <Jarkko Sakkinen jarkko.sakkinen@intel.com>
> 
> Added CONFIG_ACPI_SLEEP caging for #include <asm/realmode.h>.
> 
> Signed-off-by: Jarkko Sakkinen <Jarkko Sakkinen jarkko.sakkinen@intel.com>
> ---
>  drivers/acpi/sleep.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index a82fbf6..5b99f64 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -25,7 +25,9 @@
>  #include <acpi/acpi_bus.h>
>  #include <acpi/acpi_drivers.h>
>  
> +#ifdef CONFIG_ACPI_SLEEP
>  #include <asm/realmode.h>
> +#endif
>  
>  #include "internal.h"
>  #include "sleep.h"

We rarely want to do things this way, because it masks build problems.
The right way to do this is the way it was before
c9b77ccb52a5c77233b0e557b7d4417b00ef4012, where the dependency on the
trampoline code was located in an architecture-specific asm header.

ia64 actually still has acpi_wakeup_address defined, although it seems
to always be zero.

So I would say the right thing is more along the lines of the attached
(and totally untested) patch.

Also, your SOB line is messed up.




[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 1661 bytes --]

diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 724aa44..0c44630 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -29,6 +29,7 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/mpspec.h>
+#include <asm/realmode.h>
 
 #define COMPILER_DEPENDENT_INT64   long long
 #define COMPILER_DEPENDENT_UINT64  unsigned long long
@@ -116,10 +117,8 @@ static inline void acpi_disable_pci(void)
 /* Low-level suspend routine. */
 extern int acpi_suspend_lowlevel(void);
 
-extern const unsigned char acpi_wakeup_code[];
-
-/* early initialization routine */
-extern void acpi_reserve_wakeup_memory(void);
+/* Physical address to resume after wakeup */
+#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start))
 
 /*
  * Check if the CPU can handle C2 and deeper
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index ebaa045..74ee4ab 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -25,8 +25,6 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-#include <asm/realmode.h>
-
 #include "internal.h"
 #include "sleep.h"
 
@@ -93,13 +91,11 @@ static struct notifier_block tts_notifier = {
 static int acpi_sleep_prepare(u32 acpi_state)
 {
 #ifdef CONFIG_ACPI_SLEEP
-	unsigned long wakeup_pa = real_mode_header->wakeup_start;
 	/* do we have a wakeup address for S2 and S3? */
 	if (acpi_state == ACPI_STATE_S3) {
-		if (!wakeup_pa)
+		if (!acpi_wakeup_address)
 			return -EFAULT;
-		acpi_set_firmware_waking_vector(
-				(acpi_physical_address)wakeup_pa);
+		acpi_set_firmware_waking_vector(acpi_wakeup_address);
 
 	}
 	ACPI_FLUSH_CPU_CACHE();

      reply	other threads:[~2012-05-30  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  6:26 [PATCH] x86, realmode: ia64 build fix (drivers/acpi/sleep.c) Jarkko Sakkinen
2012-05-30  6:47 ` H. Peter Anvin [this message]

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=4FC5C291.3060801@kernel.org \
    --to=hpa@kernel.org \
    --cc=jarkko.sakkinen@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=tony.luck@intel.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