Re: [2.6.23-rc7] main.c: undefined reference to `acpi_sleep_prepare'

2007-09-23 Thread Rafael J. Wysocki
On Sunday, 23 September 2007 08:41, Alexey Starikovskiy wrote:
> Frans Pop wrote:
> > I wanted to test 5a50fe709d527f31 and thus created a config with ACPI and 
> > CONFIG_HIBERNATION, but without CONFIG_SUSPEND, which resulted in (git 
> > checkout updated to 1f0cff6e4d579ab0):
> > 
> >   GEN .version
> >   CHK include/linux/compile.h
> >   UPD include/linux/compile.h
> >   CC  init/version.o
> >   LD  init/built-in.o
> >   LD  .tmp_vmlinux1
> > drivers/built-in.o: In function `acpi_power_off_prepare':
> > main.c:(.text+0x32282): undefined reference to `acpi_sleep_prepare'
> > drivers/built-in.o: In function `acpi_hibernation_prepare':
> > main.c:(.text+0x3228c): undefined reference to `acpi_sleep_prepare'
> > make[1]: *** [.tmp_vmlinux1] Error 1
> > make[1]: Leaving directory `/home/fjp/projects/kernel/linux-2.6'
> > make: *** [debian/stamp-build-kernel] Error 2
> > 
> > 
> yep... acpi_sleep_prepare was put under CONFIG_SUSPEND spanning half of the 
> file...
> this patch moves it out.

Acked-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6.23-rc7] main.c: undefined reference to `acpi_sleep_prepare'

2007-09-23 Thread Frans Pop
On Sunday 23 September 2007, Alexey Starikovskiy wrote:
> Frans Pop wrote:
> > drivers/built-in.o: In function `acpi_power_off_prepare':
> > main.c:(.text+0x32282): undefined reference to `acpi_sleep_prepare'
> > drivers/built-in.o: In function `acpi_hibernation_prepare':
> > main.c:(.text+0x3228c): undefined reference to `acpi_sleep_prepare'
>
> yep... acpi_sleep_prepare was put under CONFIG_SUSPEND spanning half of
> the file... this patch moves it out.

Compiles and works fine with that patch applied. Thanks.


One thing I noticed after booting with the kernel without CONFIG_SUSPEND.
/proc/acpi/sleep no longer lists S3 (as expected), but /proc/acpi/wakeup 
does still list the device status for S3, which seems somewhat 
inconsistent:

Device  S-state   Status   Sysfs node
VIY0  S3 disabled  pci::01:0b.0
USB1  S3 disabled  pci::00:1d.0
USB2  S3 disabled  pci::00:1d.1
USB4  S3 disabled  pci::00:1d.7
AMDM  S3 disabled  pci::00:1f.6
LID   S4*enabled   
PWRB  S4*enabled   

Not sure if it's worth fixing though.

Cheers,
FJP
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6.23-rc7] main.c: undefined reference to `acpi_sleep_prepare'

2007-09-22 Thread Alexey Starikovskiy
Frans Pop wrote:
> I wanted to test 5a50fe709d527f31 and thus created a config with ACPI and 
> CONFIG_HIBERNATION, but without CONFIG_SUSPEND, which resulted in (git 
> checkout updated to 1f0cff6e4d579ab0):
> 
>   GEN .version
>   CHK include/linux/compile.h
>   UPD include/linux/compile.h
>   CC  init/version.o
>   LD  init/built-in.o
>   LD  .tmp_vmlinux1
> drivers/built-in.o: In function `acpi_power_off_prepare':
> main.c:(.text+0x32282): undefined reference to `acpi_sleep_prepare'
> drivers/built-in.o: In function `acpi_hibernation_prepare':
> main.c:(.text+0x3228c): undefined reference to `acpi_sleep_prepare'
> make[1]: *** [.tmp_vmlinux1] Error 1
> make[1]: Leaving directory `/home/fjp/projects/kernel/linux-2.6'
> make: *** [debian/stamp-build-kernel] Error 2
> 
> 
yep... acpi_sleep_prepare was put under CONFIG_SUSPEND spanning half of the 
file...
this patch moves it out.
Thanks,
Alex.
ACPI: suspend: move acpi_sleep_prepare outside of CONFIG_SUSPEND

From: Alexey Starikovskiy <[EMAIL PROTECTED]>

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/sleep/main.c |   42 +-
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index 85633c5..c79edcb 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -26,6 +26,27 @@ u8 sleep_states[ACPI_S_STATE_COUNT];
 
 static u32 acpi_target_sleep_state = ACPI_STATE_S0;
 
+int acpi_sleep_prepare(u32 acpi_state)
+{
+#ifdef CONFIG_ACPI_SLEEP
+	/* do we have a wakeup address for S2 and S3? */
+	if (acpi_state == ACPI_STATE_S3) {
+		if (!acpi_wakeup_address) {
+			return -EFAULT;
+		}
+		acpi_set_firmware_waking_vector((acpi_physical_address)
+		virt_to_phys((void *)
+			 acpi_wakeup_address));
+
+	}
+	ACPI_FLUSH_CPU_CACHE();
+	acpi_enable_wakeup_device_prep(acpi_state);
+#endif
+	acpi_gpe_sleep_prepare(acpi_state);
+	acpi_enter_sleep_state_prep(acpi_state);
+	return 0;
+}
+
 #ifdef CONFIG_SUSPEND
 static struct pm_ops acpi_pm_ops;
 
@@ -60,27 +81,6 @@ static int acpi_pm_set_target(suspend_state_t pm_state)
 	return error;
 }
 
-int acpi_sleep_prepare(u32 acpi_state)
-{
-#ifdef CONFIG_ACPI_SLEEP
-	/* do we have a wakeup address for S2 and S3? */
-	if (acpi_state == ACPI_STATE_S3) {
-		if (!acpi_wakeup_address) {
-			return -EFAULT;
-		}
-		acpi_set_firmware_waking_vector((acpi_physical_address)
-		virt_to_phys((void *)
-			 acpi_wakeup_address));
-
-	}
-	ACPI_FLUSH_CPU_CACHE();
-	acpi_enable_wakeup_device_prep(acpi_state);
-#endif
-	acpi_gpe_sleep_prepare(acpi_state);
-	acpi_enter_sleep_state_prep(acpi_state);
-	return 0;
-}
-
 /**
  *	acpi_pm_prepare - Do preliminary suspend work.
  *	@pm_state: ignored