Could you try this patch on your system with acpi that
is having problems.

The patch needs some work before it goes into a mainline kernel
as I have hacked the call to acpi_power_off_prepare into roughly
the proper position in the call chain instead of use a proper
hook.  But I can't quickly find an existing hook in the proper
location.

Eric

diff -uNr linux-2.6.11-rc1-mm1-nokexec/drivers/acpi/sleep/poweroff.c 
linux-2.6.11-rc1-mm1-acpi-power-off-shuffle/drivers/acpi/sleep/poweroff.c
--- linux-2.6.11-rc1-mm1-nokexec/drivers/acpi/sleep/poweroff.c  Fri Jan  7 
12:53:50 2005
+++ linux-2.6.11-rc1-mm1-acpi-power-off-shuffle/drivers/acpi/sleep/poweroff.c   
Tue Jan 25 05:05:06 2005
@@ -7,18 +7,34 @@
 
 #include <linux/pm.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <acpi/acpi_bus.h>
 #include <linux/sched.h>
 #include "sleep.h"
 
+static void acpi_power_off_prepare(void)
+{
+       if (system_state == SYSTEM_POWER_OFF) {
+               acpi_wakeup_gpe_poweroff_prepare();
+               acpi_enter_sleep_state_prep(ACPI_STATE_S5);
+       }
+}
+
+void do_acpi_power_off_prepare(void)
+{
+       if (!acpi_disabled) {
+               apci_power_offf_prepare();
+       }
+}
+
 static void
 acpi_power_off (void)
 {
        printk("%s called\n",__FUNCTION__);
+#if 0 /* This should be made redundant by other patches.. */
        /* Some SMP machines only can poweroff in boot CPU */
        set_cpus_allowed(current, cpumask_of_cpu(0));
-       acpi_wakeup_gpe_poweroff_prepare();
-       acpi_enter_sleep_state_prep(ACPI_STATE_S5);
+#endif
        ACPI_DISABLE_IRQS();
        acpi_enter_sleep_state(ACPI_STATE_S5);
 }
diff -uNr linux-2.6.11-rc1-mm1-nokexec/drivers/base/power/shutdown.c 
linux-2.6.11-rc1-mm1-acpi-power-off-shuffle/drivers/base/power/shutdown.c
--- linux-2.6.11-rc1-mm1-nokexec/drivers/base/power/shutdown.c  Mon Oct 18 
15:54:37 2004
+++ linux-2.6.11-rc1-mm1-acpi-power-off-shuffle/drivers/base/power/shutdown.c   
Tue Jan 25 05:06:09 2005
@@ -62,6 +62,12 @@
        }
        up_write(&devices_subsys.rwsem);
 
+#if 1
+       {
+               extern void do_acpi_power_off_prepare(void);
+               do_acpi_power_off_prepare();
+       }
+#endif
        sysdev_shutdown();
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to